bibot 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/.babelrc +7 -0
  2. package/.vscode/settings.json +5 -0
  3. package/README.md +46 -0
  4. package/dist/bibot.d.ts +5 -0
  5. package/dist/bibot.js +173 -0
  6. package/dist/bibot.js.map +1 -0
  7. package/dist/config/appStateEnums.d.ts +3 -0
  8. package/dist/config/appStateEnums.js +10 -0
  9. package/dist/config/appStateEnums.js.map +1 -0
  10. package/dist/config/endpointEnums.d.ts +18 -0
  11. package/dist/config/endpointEnums.js +31 -0
  12. package/dist/config/endpointEnums.js.map +1 -0
  13. package/dist/config/index.d.ts +3 -0
  14. package/dist/config/index.js +38 -0
  15. package/dist/config/index.js.map +1 -0
  16. package/dist/config/statusCode.d.ts +42 -0
  17. package/dist/config/statusCode.js +49 -0
  18. package/dist/config/statusCode.js.map +1 -0
  19. package/dist/context/AppContext.d.ts +8 -0
  20. package/dist/context/AppContext.js +75 -0
  21. package/dist/context/AppContext.js.map +1 -0
  22. package/dist/context/index.d.ts +1 -0
  23. package/dist/context/index.js +16 -0
  24. package/dist/context/index.js.map +1 -0
  25. package/dist/hooks/index.d.ts +3 -0
  26. package/dist/hooks/index.js +38 -0
  27. package/dist/hooks/index.js.map +1 -0
  28. package/dist/hooks/mobileView.d.ts +1 -0
  29. package/dist/hooks/mobileView.js +33 -0
  30. package/dist/hooks/mobileView.js.map +1 -0
  31. package/dist/hooks/useBiBotChatBot.d.ts +29 -0
  32. package/dist/hooks/useBiBotChatBot.js +206 -0
  33. package/dist/hooks/useBiBotChatBot.js.map +1 -0
  34. package/dist/hooks/usePluginFactory.d.ts +1 -0
  35. package/dist/hooks/usePluginFactory.js +62 -0
  36. package/dist/hooks/usePluginFactory.js.map +1 -0
  37. package/dist/index.css +36 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +9 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/reducers/appReducer.d.ts +2 -0
  42. package/dist/reducers/appReducer.js +24 -0
  43. package/dist/reducers/appReducer.js.map +1 -0
  44. package/dist/reducers/index.d.ts +1 -0
  45. package/dist/reducers/index.js +16 -0
  46. package/dist/reducers/index.js.map +1 -0
  47. package/dist/services/index.d.ts +1 -0
  48. package/dist/services/index.js +16 -0
  49. package/dist/services/index.js.map +1 -0
  50. package/dist/services/plugin-api.d.ts +26 -0
  51. package/dist/services/plugin-api.js +185 -0
  52. package/dist/services/plugin-api.js.map +1 -0
  53. package/dist/styles/RegisterPageStyle.css +63 -0
  54. package/dist/styles/adminPortal.css +26 -0
  55. package/dist/styles/appConfig.css +90 -0
  56. package/dist/styles/buttonStyle.css +27 -0
  57. package/dist/styles/chatStyle.css +140 -0
  58. package/dist/styles/index.css +82 -0
  59. package/dist/styles/predefinedStyle.css +35 -0
  60. package/dist/styles/themeStyle.css +42 -0
  61. package/dist/styles/training.css +86 -0
  62. package/dist/types/coreInterfaces.d.ts +51 -0
  63. package/dist/types/coreInterfaces.js +5 -0
  64. package/dist/types/coreInterfaces.js.map +1 -0
  65. package/dist/types/index.d.ts +1 -0
  66. package/dist/types/index.js +16 -0
  67. package/dist/types/index.js.map +1 -0
  68. package/dist/utils/index.d.ts +2 -0
  69. package/dist/utils/index.js +27 -0
  70. package/dist/utils/index.js.map +1 -0
  71. package/dist/utils/sessionManager.d.ts +2 -0
  72. package/dist/utils/sessionManager.js +17 -0
  73. package/dist/utils/sessionManager.js.map +1 -0
  74. package/dist/utils/trimWhitespace.d.ts +2 -0
  75. package/dist/utils/trimWhitespace.js +15 -0
  76. package/dist/utils/trimWhitespace.js.map +1 -0
  77. package/example/README.md +46 -0
  78. package/example/package-lock.json +18164 -0
  79. package/example/package.json +46 -0
  80. package/example/public/favicon.ico +0 -0
  81. package/example/public/index.html +43 -0
  82. package/example/public/logo192.png +0 -0
  83. package/example/public/logo512.png +0 -0
  84. package/example/public/manifest.json +25 -0
  85. package/example/public/robots.txt +3 -0
  86. package/example/src/App.css +38 -0
  87. package/example/src/App.test.tsx +9 -0
  88. package/example/src/App.tsx +28 -0
  89. package/example/src/index.css +13 -0
  90. package/example/src/index.tsx +13 -0
  91. package/example/src/logo.svg +1 -0
  92. package/example/src/react-app-env.d.ts +1 -0
  93. package/example/tsconfig.json +26 -0
  94. package/package.json +28 -8
  95. package/src/bibot.tsx +111 -0
  96. package/src/config/appStateEnums.ts +3 -0
  97. package/src/config/endpointEnums.ts +28 -0
  98. package/src/config/index.ts +5 -0
  99. package/src/config/statusCode.ts +49 -0
  100. package/src/context/AppContext.tsx +66 -0
  101. package/src/context/index.ts +3 -0
  102. package/src/hooks/index.ts +5 -0
  103. package/src/hooks/mobileView.tsx +17 -0
  104. package/src/hooks/useBiBotChatBot.tsx +107 -0
  105. package/src/hooks/usePluginFactory.tsx +38 -0
  106. package/src/index.css +36 -0
  107. package/src/index.tsx +3 -11
  108. package/src/reducers/appReducer.ts +16 -0
  109. package/src/reducers/index.ts +4 -0
  110. package/src/services/index.ts +2 -0
  111. package/src/services/plugin-api.tsx +120 -0
  112. package/src/styles/RegisterPageStyle.css +63 -0
  113. package/src/styles/adminPortal.css +26 -0
  114. package/src/styles/appConfig.css +90 -0
  115. package/src/styles/buttonStyle.css +27 -0
  116. package/src/styles/chatStyle.css +140 -0
  117. package/src/styles/index.css +82 -0
  118. package/src/styles/predefinedStyle.css +35 -0
  119. package/src/styles/themeStyle.css +42 -0
  120. package/src/styles/training.css +86 -0
  121. package/src/types/coreInterfaces.ts +69 -0
  122. package/src/types/index.ts +4 -0
  123. package/src/utils/index.ts +2 -0
  124. package/src/utils/sessionManager.tsx +15 -0
  125. package/src/utils/trimWhitespace.ts +11 -0
  126. package/tsconfig.json +25 -0
  127. package/webpack.config.js +19 -0
  128. package/src/App.tsx +0 -11
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GetPredefinedQuestion = GetPredefinedQuestion;
7
+ exports.askBiBot = askBiBot;
8
+ exports.getRemoteClientChatBubbleConfig = getRemoteClientChatBubbleConfig;
9
+ exports.getRemoteClientChatPredefinedQuestions = getRemoteClientChatPredefinedQuestions;
10
+ 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); }
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); }
16
+ 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 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 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 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; }
17
+ 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); } }
18
+ 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); }); }; }
19
+ // import { createPluginAxiosInstance } from '../hooks/usePluginFactory'
20
+ // const pluginAxiosInstance=createPluginAxiosInstance()
21
+ function askTimedOutBiBot(_x) {
22
+ return _askTimedOutBiBot.apply(this, arguments);
23
+ }
24
+ function _askTimedOutBiBot() {
25
+ _askTimedOutBiBot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
26
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
27
+ while (1) switch (_context.prev = _context.next) {
28
+ case 0:
29
+ _context.prev = 0;
30
+ return _context.abrupt("return", 'Hello');
31
+ case 4:
32
+ _context.prev = 4;
33
+ _context.t0 = _context["catch"](0);
34
+ console.log(_context.t0.message);
35
+ return _context.abrupt("return", _context.t0.message);
36
+ case 8:
37
+ case "end":
38
+ return _context.stop();
39
+ }
40
+ }, _callee, null, [[0, 4]]);
41
+ }));
42
+ return _askTimedOutBiBot.apply(this, arguments);
43
+ }
44
+ function askBiBot(_x2) {
45
+ return _askBiBot.apply(this, arguments);
46
+ } // TODO: Emmanuel fix the default returned values, especially the userImage to a default robot image
47
+ function _askBiBot() {
48
+ _askBiBot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
49
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
50
+ while (1) switch (_context2.prev = _context2.next) {
51
+ case 0:
52
+ _context2.prev = 0;
53
+ return _context2.abrupt("return", 'Hello');
54
+ case 4:
55
+ _context2.prev = 4;
56
+ _context2.t0 = _context2["catch"](0);
57
+ console.log(_context2.t0.message);
58
+ if (!(_context2.t0.code === 'ECONNABORTED' || _context2.t0.message.includes('Endpoint request timed out'))) {
59
+ _context2.next = 31;
60
+ break;
61
+ }
62
+ _context2.prev = 8;
63
+ _context2.next = 11;
64
+ return askTimedOutBiBot(_objectSpread(_objectSpread({}, data), {}, {
65
+ tries: 2
66
+ }));
67
+ case 11:
68
+ return _context2.abrupt("return", _context2.sent);
69
+ case 14:
70
+ _context2.prev = 14;
71
+ _context2.t1 = _context2["catch"](8);
72
+ if (!(_context2.t1.code === 'ECONNABORTED' || _context2.t1.message.includes('Endpoint request timed out'))) {
73
+ _context2.next = 28;
74
+ break;
75
+ }
76
+ _context2.prev = 17;
77
+ _context2.next = 20;
78
+ return askTimedOutBiBot(_objectSpread(_objectSpread({}, data), {}, {
79
+ tries: 3
80
+ }));
81
+ case 20:
82
+ return _context2.abrupt("return", _context2.sent);
83
+ case 23:
84
+ _context2.prev = 23;
85
+ _context2.t2 = _context2["catch"](17);
86
+ return _context2.abrupt("return", _context2.t2.message);
87
+ case 26:
88
+ _context2.next = 29;
89
+ break;
90
+ case 28:
91
+ return _context2.abrupt("return", _context2.t1.message);
92
+ case 29:
93
+ _context2.next = 32;
94
+ break;
95
+ case 31:
96
+ return _context2.abrupt("return", _context2.t0.message);
97
+ case 32:
98
+ case "end":
99
+ return _context2.stop();
100
+ }
101
+ }, _callee2, null, [[0, 4], [8, 14], [17, 23]]);
102
+ }));
103
+ return _askBiBot.apply(this, arguments);
104
+ }
105
+ function getRemoteClientChatBubbleConfig(_x3) {
106
+ return _getRemoteClientChatBubbleConfig.apply(this, arguments);
107
+ }
108
+ function _getRemoteClientChatBubbleConfig() {
109
+ _getRemoteClientChatBubbleConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
110
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
111
+ while (1) switch (_context3.prev = _context3.next) {
112
+ case 0:
113
+ _context3.prev = 0;
114
+ return _context3.abrupt("return", {
115
+ bgColor: 'white',
116
+ chatColor: 'blue',
117
+ title: 'ChatBot',
118
+ userImage: 'string'
119
+ });
120
+ case 4:
121
+ _context3.prev = 4;
122
+ _context3.t0 = _context3["catch"](0);
123
+ return _context3.abrupt("return", {
124
+ bgColor: 'white',
125
+ chatColor: 'blue',
126
+ title: 'ChatBot',
127
+ userImage: 'string'
128
+ });
129
+ case 7:
130
+ case "end":
131
+ return _context3.stop();
132
+ }
133
+ }, _callee3, null, [[0, 4]]);
134
+ }));
135
+ return _getRemoteClientChatBubbleConfig.apply(this, arguments);
136
+ }
137
+ function getRemoteClientChatPredefinedQuestions(_x4) {
138
+ return _getRemoteClientChatPredefinedQuestions.apply(this, arguments);
139
+ }
140
+ function _getRemoteClientChatPredefinedQuestions() {
141
+ _getRemoteClientChatPredefinedQuestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
142
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
143
+ while (1) switch (_context4.prev = _context4.next) {
144
+ case 0:
145
+ _context4.prev = 0;
146
+ return _context4.abrupt("return", ['Hello']);
147
+ case 4:
148
+ _context4.prev = 4;
149
+ _context4.t0 = _context4["catch"](0);
150
+ return _context4.abrupt("return", ['These are placeholders', 'They will be removed in production', 'This will be empty if there are no predefined questions', 'So hide if there are no predefined questions']);
151
+ case 7:
152
+ case "end":
153
+ return _context4.stop();
154
+ }
155
+ }, _callee4, null, [[0, 4]]);
156
+ }));
157
+ return _getRemoteClientChatPredefinedQuestions.apply(this, arguments);
158
+ }
159
+ function GetPredefinedQuestion() {
160
+ return _GetPredefinedQuestion.apply(this, arguments);
161
+ }
162
+ function _GetPredefinedQuestion() {
163
+ _GetPredefinedQuestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
164
+ var clientId;
165
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
166
+ while (1) switch (_context5.prev = _context5.next) {
167
+ case 0:
168
+ clientId = '6c74b4bb-0395-4751-a55f-7d065d67c56b';
169
+ _context5.prev = 1;
170
+ return _context5.abrupt("return", [{
171
+ question: "q",
172
+ answer: "a"
173
+ }]);
174
+ case 5:
175
+ _context5.prev = 5;
176
+ _context5.t0 = _context5["catch"](1);
177
+ console.error('Error fetching subscription:', _context5.t0);
178
+ case 8:
179
+ case "end":
180
+ return _context5.stop();
181
+ }
182
+ }, _callee5, null, [[1, 5]]);
183
+ }));
184
+ return _GetPredefinedQuestion.apply(this, arguments);
185
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-api.js","sourceRoot":"","sources":["../../src/services/plugin-api.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,63 @@
1
+
2
+ .amplify-button--primary {
3
+ background-color: #0fa781;
4
+ }
5
+
6
+ .preAuditLogo-on-registerPage{
7
+ max-height: 50px;
8
+ margin-bottom: 20px;
9
+ }
10
+ .amplify-tabs-item[data-state=active] {
11
+ color: #fff;
12
+ border-color: #0fa781;
13
+ }
14
+ .amplify-tabs-item[data-state=active]:hover {
15
+ color: #fff;
16
+ }
17
+
18
+ .amplify-tabs-item:hover {
19
+ color: #00152a;
20
+ }
21
+
22
+ [data-amplify-authenticator] [data-amplify-router] {
23
+ background-color: #ffffff;
24
+ border-color: #b9eee1;
25
+ }
26
+ .amplify-tabs-item[data-spacing=equal]{
27
+
28
+ }
29
+ .amplify-button--link {
30
+ color: #00152a;
31
+ }
32
+ .amplify-button--link:hover {
33
+ color: #00152a;
34
+ background-color: #fff;
35
+ }
36
+
37
+ .amplify-input, .amplify-input:focus {
38
+ border-color: #bed7f0;
39
+ border: 1px solid;
40
+ }
41
+ .fieldContainer{
42
+ display: flex;
43
+ justify-content: space-between;
44
+ flex-direction: row;
45
+ }
46
+ select, .amplify-field-group__outer-end .amplify-field-group__control, .amplify-field-group__outer-start .amplify-select__wrapper:not(:first-child) .amplify-select:not(:first-child), .amplify-field-group__outer-start--quiet .amplify-field-group__control, .amplify-field-group__outer-start .amplify-field-group__control:not(:first-child), .amplify-field-group :not(:first-child) .amplify-input {
47
+ border-color: #c9ebe2;
48
+ }
49
+ .amplify-input{
50
+ border-color: #c9ebe2;
51
+ }
52
+
53
+ .amplify-checkbox__icon {
54
+ background-color: #c9ebe2;
55
+ border-color: #c9ebe2;
56
+ }
57
+ .input-select-field{
58
+ border-color: #0fa781;
59
+ }
60
+ .amplify-select{
61
+ border-color: #c9ebe2 !important;
62
+
63
+ }
@@ -0,0 +1,26 @@
1
+ .useremail{
2
+ width: 70px;
3
+ white-space: nowrap;
4
+ overflow: hidden;
5
+ text-overflow: ellipsis;
6
+ margin-top: 0;
7
+ }
8
+
9
+ /* Media query for screens smaller than 600px */
10
+ @media screen and (max-width: 600px) {
11
+ .hideOnMobile{
12
+ display: none !important;
13
+ }
14
+ }
15
+
16
+ /* Media query for screens between 600px and 900px */
17
+ /* @media screen and (min-width: 600px) and (max-width: 900px) {
18
+ .hideProfile{
19
+ display: none;
20
+ }
21
+ } */
22
+
23
+ /* Media query for screens larger than 1200px */
24
+ @media screen and (min-width: 1200px) {
25
+
26
+ }
@@ -0,0 +1,90 @@
1
+ .mainContent{
2
+ display: flex;
3
+ width: 100%;
4
+ justify-content: space-around;
5
+ flex-wrap: wrap;
6
+ }
7
+ .firstSection{
8
+ text-align: start;
9
+ }
10
+ .secondSection{
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ }
15
+ .previewSection{
16
+ height: 100%;
17
+ }
18
+ input[type="file"] {
19
+ display: none;
20
+ }
21
+ .inputfileButton{
22
+ display: inline-block;
23
+ align-items: center;
24
+ /* background-color: #73767a; */
25
+ border: none;
26
+ border-radius: 5px;
27
+ cursor: pointer;
28
+ }
29
+
30
+
31
+ /* Media query for screens smaller than 600px */
32
+ @media screen and (max-width: 600px) {
33
+ .mainContent{
34
+ display: flex;
35
+ width: 100%;
36
+ flex-direction: column;
37
+ justify-content: space-around;
38
+ align-items: center;
39
+ }
40
+ .button{
41
+ width: 100% !important;
42
+ }
43
+ .previewSection{
44
+ width: 100%;
45
+ margin-top: 30px;
46
+ }
47
+ .firstSection{
48
+ width: 100%;
49
+ text-align: start;
50
+ margin-bottom: 50px;
51
+ }
52
+ .secondSection{
53
+ width: 100%;
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ text-align: start;
58
+ }
59
+ }
60
+
61
+ /* Media query for screens between 600px and 900px */
62
+ @media screen and (min-width: 600px) and (max-width: 900px) {
63
+ .mainContent{
64
+ display: flex;
65
+ width: 100%;
66
+ flex-direction: column;
67
+ justify-content: space-around;
68
+ align-items: center;
69
+ }
70
+ .previewSection{
71
+ width: 100%;
72
+ }
73
+ .firstSection{
74
+ width: 100%;
75
+ text-align: start;
76
+ margin-bottom: 50px;
77
+ }
78
+ .secondSection{
79
+ width: 100%;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ text-align: start;
84
+ }
85
+ }
86
+
87
+ /* Media query for screens larger than 1200px */
88
+ @media screen and (min-width: 1200px) {
89
+
90
+ }
@@ -0,0 +1,27 @@
1
+ .button,
2
+ .ant-btn.button {
3
+ font-family: Arial, sans-serif;
4
+ font-size: 14px;
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: center;
8
+ border-radius: 10px;
9
+ border: 2px solid #d67632;
10
+ outline: none;
11
+ cursor: pointer;
12
+ transition: background-color 0.3s, color 0.3s;
13
+ background-color: #5f2d78;
14
+ color: white;
15
+ }
16
+
17
+ .ant-popover-buttons {
18
+ display: flex;
19
+ justify-content: flex-end;
20
+ background-color: #5f2d78;
21
+ color: white
22
+ }
23
+
24
+ .ant-popover-button {
25
+ margin: 8px;
26
+ }
27
+
@@ -0,0 +1,140 @@
1
+ .chat-bubble {
2
+ position: fixed;
3
+ bottom: 20px;
4
+ right: 20px;
5
+ z-index: 9999;
6
+ }
7
+
8
+ .chat-toggle {
9
+ color: #fff;
10
+ border-radius: 50%;
11
+ height: 60px;
12
+ width: 60px;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ }
17
+
18
+ .chat-window {
19
+ position: absolute;
20
+ bottom: 50px;
21
+ right: 25px;
22
+ width: 350px;
23
+ height: 500px;
24
+ background-color: white;
25
+ border: 1px solid #ddd;
26
+ border-radius: 10px;
27
+ /* padding: 10px; */
28
+ box-shadow: 0 2px 10px rgba(0,0,0,0.2);
29
+ display: flex;
30
+ flex-direction: column;
31
+ justify-content: space-between;
32
+ }
33
+
34
+ /* Existing styles... */
35
+ .chat-header{
36
+ height: 50px;
37
+ border-top-left-radius: 8px;
38
+ border-top-right-radius: 8px;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: flex-start;
42
+ padding-inline: 15px;
43
+ padding-block: 30px;
44
+ }
45
+ .message-list {
46
+ height: calc(100% - 100px);
47
+ overflow-y: auto;
48
+ padding: 10px;
49
+ display: flex;
50
+ flex-grow: 1;
51
+ flex-direction: column;
52
+ }
53
+
54
+ .message {
55
+ margin-bottom: 10px;
56
+ padding: 5px 10px;
57
+ border-radius: 8px;
58
+ max-width: 70%;
59
+ }
60
+
61
+ .message.user {
62
+ background-color: #b8b8b8c6;
63
+ align-self: flex-end;
64
+ }
65
+
66
+ .message.bot {
67
+ background-color: #f0f0f0;
68
+ align-self: flex-start;
69
+ }
70
+ textarea:focus, input:focus{
71
+ outline: none;
72
+ }
73
+
74
+ /* Chat loader*/
75
+ .loader {
76
+ width: 12px;
77
+ aspect-ratio: 1;
78
+ border-radius: 50%;
79
+ animation: l5 1s infinite linear alternate;
80
+ }
81
+ @keyframes l5 {
82
+ 0% {box-shadow: 20px 0 #000, -20px 0 #0002;background: #000 }
83
+ 33% {box-shadow: 20px 0 #000, -20px 0 #0002;background: #0002}
84
+ 66% {box-shadow: 20px 0 #0002,-20px 0 #000; background: #0002}
85
+ 100%{box-shadow: 20px 0 #0002,-20px 0 #000; background: #000 }
86
+ }
87
+
88
+
89
+ .input-area {
90
+ display: flex;
91
+ align-items: center;
92
+ border-top: 1px solid #ddd;
93
+ padding: 10px;
94
+ border-bottom-left-radius: 8px;
95
+ border-bottom-right-radius: 8px;
96
+ }
97
+
98
+ .input-area input {
99
+ flex-grow: 1;
100
+ border: none;
101
+ background-color: transparent;
102
+ /* border: 1px solid #ccc; */
103
+ /* border-radius: 15px; */
104
+ padding: 5px 10px;
105
+ margin-right: 10px;
106
+ }
107
+
108
+ .input-area button {
109
+ background-color: #007bff;
110
+ color: white;
111
+ border: none;
112
+ border-radius: 15px;
113
+ padding: 5px 10px;
114
+ cursor: pointer;
115
+ }
116
+
117
+ /* Existing styles... */
118
+
119
+ .loading-bubbles {
120
+ display: flex;
121
+ justify-content: center;
122
+ align-items: center;
123
+ }
124
+
125
+ .bubble {
126
+ width: 8px;
127
+ height: 8px;
128
+ border-radius: 50%;
129
+ margin: 0 3px;
130
+ animation: bounce 0.6s infinite alternate;
131
+ }
132
+
133
+ @keyframes bounce {
134
+ from {
135
+ transform: translateY(0);
136
+ }
137
+ to {
138
+ transform: translateY(-15px);
139
+ }
140
+ }
@@ -0,0 +1,82 @@
1
+ @import 'themeStyle.css';
2
+ @import 'buttonStyle.css';
3
+ @import 'chatStyle.css';
4
+ @import 'predefinedStyle.css';
5
+ body {
6
+ font-family: 'Roboto', sans-serif;
7
+ margin: 0;
8
+ }
9
+
10
+ code {
11
+ font-family: 'Roboto', sans-serif;
12
+ }
13
+
14
+ .cardsBody, .container, .header, .display-message, .position, .embed-report, .controls, .footer, .button, .login-container, .admin-layout, .client-layout, .admin-header, .client-header, .content-layout, .title, .menu, .site-layout-background, .not-implemented, .admin-footer, .client-footer, .report-container {
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ .cardsBody {
19
+ margin: 0;
20
+ padding: 10px;
21
+ min-height: 100vh;
22
+ display: flex;
23
+ flex-direction: column;
24
+ }
25
+
26
+ .content-layout {
27
+ padding: 24px;
28
+ margin: 0;
29
+ min-height: 280px;
30
+ /* background: green; */
31
+ }
32
+
33
+ .site-layout-background {
34
+ padding: 24px;
35
+ /* background-color: red; */
36
+ }
37
+
38
+ .admin-footer, .client-footer {
39
+ text-align: center;
40
+ background: #fff;
41
+ padding: 10px 50px;
42
+ }
43
+
44
+ .not-implemented {
45
+ min-height: 89.1vh;
46
+ color: red;
47
+ background-size: fit;
48
+ background-position: center;
49
+ background-repeat: no-repeat;
50
+ background-image: var(--bg-logo);
51
+ }
52
+
53
+ .ant-spin-dot-item {
54
+ background-color: #d67632 !important;
55
+ color: #d67632 !important;
56
+ }
57
+
58
+ .admin-layout, .client-layout {
59
+ flex: 1;
60
+ overflow-y: auto;
61
+ }
62
+
63
+ .descriptions-custom .ant-descriptions-item-label {
64
+ width: 20%;
65
+ }
66
+
67
+ .descriptions-custom .ant-descriptions-item-content {
68
+ width: 70%;
69
+ }
70
+
71
+ h1 {
72
+ color: #165a72;
73
+ margin: 50px auto;
74
+ font-size: 40px;
75
+ }
76
+ .soc-menu {
77
+ margin-bottom: 40px;
78
+ margin-top: 20px;
79
+ }
80
+ h2 {
81
+ color: #165a72;
82
+ }
@@ -0,0 +1,35 @@
1
+ .predefined-questions {
2
+ margin-top: 10px;
3
+ padding: 10px;
4
+ background-color: #f7f7f7; /* light gray background */
5
+ border-top: 1px solid #e0e0e0; /* separator from the messages */
6
+ }
7
+
8
+ .predefined-question {
9
+ padding: 8px 12px;
10
+ margin-bottom: 5px; /* space between questions */
11
+ background-color: #ffffff; /* white background for the questions */
12
+ border: 1px solid #dedede; /* light gray border */
13
+ border-radius: 15px; /* rounded corners */
14
+ cursor: pointer;
15
+ transition: background-color 0.3s ease; /* smooth background color change on hover */
16
+ }
17
+
18
+ .predefined-question:hover {
19
+ background-color: #e8f0fe; /* slightly blue background on hover */
20
+ }
21
+
22
+ /* You may want to add additional styles for text size, color, and alignment */
23
+ .predefined-question {
24
+ font-size: 0.9rem; /* moderate text size */
25
+ color: #333333; /* dark gray text color */
26
+ text-align: left;
27
+ }
28
+
29
+ /* Ensuring the list doesn't cover the entire chat window and has a scroll if there are many items */
30
+ .predefined-questions {
31
+ /* max-height: 150px; */
32
+ height: 100%;
33
+ overflow-y: auto; /* enables scroll */
34
+ }
35
+