@genpact/genome.mfe.mgtwin-app 1.1.82 → 1.1.83

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.
@@ -0,0 +1,351 @@
1
+ import { _ as U, a as V, L as B } from "./LoadingSimulation-76664f39.mjs";
2
+ import { _ as H, Q as M, a as z } from "./Modal-2cffa816.mjs";
3
+ import { d as y, r as d, H as R, o as c, c as u, a as s, u as k, y as L, t as S, G, p as N, g as E, C as Q, z as D, h as x, F as O, e as Z, f as I, b as v, k as F, w as K, m as W, L as Y, q as P, s as J, l as X } from "./main-edcc4839.mjs";
4
+ import { _ as $ } from "./_plugin-vue_export-helper-dad06003.mjs";
5
+ import { p as ee, g as se } from "./api-80b5293d.mjs";
6
+ import "./loadernew-ac153a51.mjs";
7
+ const te = { class: "flex h-14 w-full flex-1 items-center justify-between bg-[#021c42] md:pr-6 lg:pr-6" }, ae = ["href"], oe = /* @__PURE__ */ s("img", {
8
+ class: "h-11 w-auto cursor-pointer",
9
+ src: U,
10
+ alt: "Genome Logo"
11
+ }, null, -1), ne = [
12
+ oe
13
+ ], re = ["href"], le = /* @__PURE__ */ s("img", {
14
+ class: "h-9 w-28 cursor-pointer md:w-36",
15
+ src: H,
16
+ alt: "Aiguru Logo"
17
+ }, null, -1), ie = [
18
+ le
19
+ ], ce = /* @__PURE__ */ y({
20
+ __name: "headerAMA",
21
+ setup(n) {
22
+ const e = d(""), o = d("");
23
+ return R === "prod" ? e.value = "https://genome.genpact.com" : e.value = "https://genome-dev.genpact.com", R === "prod" ? o.value = "https://genome.genpact.com/#aiguru" : o.value = "https://genome-dev.genpact.com/#aiguru", (l, p) => (c(), u("nav", te, [
24
+ s("a", {
25
+ class: "px-2 md:px-0 lg:px-0",
26
+ href: e.value,
27
+ target: "_blank"
28
+ }, ne, 8, ae),
29
+ s("a", {
30
+ class: "px-2 md:px-0 lg:px-0",
31
+ href: o.value,
32
+ target: "_blank"
33
+ }, ie, 8, re)
34
+ ]));
35
+ }
36
+ }), de = { class: "flex items-end justify-start" }, ue = { class: "fontFormattingAMA w-full bg-gray-100 rounded-lg" }, _e = { class: "w-full rounded-md px-3 py-2 text-lg text-black md:text-xl" }, pe = ["innerHTML"], me = /* @__PURE__ */ s("br", null, null, -1), he = /* @__PURE__ */ y({
37
+ __name: "greetingsAMA",
38
+ setup(n) {
39
+ const e = k(), o = ` Hi ${e.learnerName || "Learner"}! 👋`, l = L(() => o);
40
+ return L(() => `I'm here and ready to help! What would you like to know about <span class='font-[600]'>${e.amaSkillName || "Skill"}</span>? <br/> Ask me to explain concepts, provide examples, or clarify anything that seems confusing.`), (p, m) => (c(), u("section", null, [
41
+ s("div", de, [
42
+ s("div", ue, [
43
+ s("div", _e, [
44
+ s("div", { innerHTML: l.value }, null, 8, pe)
45
+ ])
46
+ ])
47
+ ]),
48
+ me
49
+ ]));
50
+ }
51
+ }), fe = { class: "fontFormattingAMA flex items-end justify-start py-2" }, ge = { class: "line-break w-full bg-gray-100 p-3 text-[0.8125rem] md:text-[0.9375rem] text-black rounded-lg" }, ve = ["innerHTML"], xe = /* @__PURE__ */ y({
52
+ __name: "responseAMA",
53
+ props: {
54
+ answer: {
55
+ type: String,
56
+ required: !0
57
+ }
58
+ },
59
+ setup(n) {
60
+ const e = n, o = L(() => {
61
+ const l = e.answer.replace(/[*#]/g, "").replace(
62
+ /Assessment Rating & Feedback/g,
63
+ '<div style="font-size: 26px; font-weight: bold; text-decoration: underline;">Rating & Feedback</div>'
64
+ ), p = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g;
65
+ return l.replace(p, (m, r, t) => `<a href="${t}" target="_blank" rel="noopener noreferrer" style="color: blue; text-decoration: underline;">${r}</a>`);
66
+ });
67
+ return (l, p) => (c(), u("div", fe, [
68
+ s("div", ge, [
69
+ s("span", {
70
+ class: "fontFormattingAMA",
71
+ innerHTML: o.value
72
+ }, null, 8, ve)
73
+ ])
74
+ ]));
75
+ }
76
+ });
77
+ const ye = /* @__PURE__ */ $(xe, [["__scopeId", "data-v-f88d6450"]]), we = { class: "flex justify-end items-end py-3" }, Ae = { class: "max-w-[80%]" }, be = { class: "w-fit fontFormattingAMA text-[0.8125rem] md:text-[0.9375rem] text-white bg-genpact-blue-box leading-6 p-3 rounded-lg" }, $e = /* @__PURE__ */ y({
78
+ __name: "learnerAMA",
79
+ props: {
80
+ question: {
81
+ type: String,
82
+ required: !0
83
+ }
84
+ },
85
+ setup(n) {
86
+ return (e, o) => (c(), u("div", we, [
87
+ s("div", Ae, [
88
+ s("div", be, S(n.question), 1)
89
+ ])
90
+ ]));
91
+ }
92
+ }), ke = (n) => (N("data-v-12a02acf"), n = n(), E(), n), qe = { class: "flex w-full flex-col items-start justify-start bg-white" }, Me = { class: "bot-typing-animation gap-1" }, Ie = { class: "block w-full text-lg italic text-gray-800" }, Le = /* @__PURE__ */ ke(() => /* @__PURE__ */ s("span", { class: "dot-animation" }, [
93
+ /* @__PURE__ */ s("span", null, "."),
94
+ /* @__PURE__ */ s("span", null, "."),
95
+ /* @__PURE__ */ s("span", null, ".")
96
+ ], -1)), Se = /* @__PURE__ */ G('<div class="block w-full max-w-full items-stretch" data-v-12a02acf><div class="flex animate-pulse items-start justify-start space-x-4" data-v-12a02acf><div class="flex-1 space-y-6 py-1" data-v-12a02acf><div class="h-2 w-full rounded bg-gray-300" data-v-12a02acf></div><div class="space-y-3" data-v-12a02acf><div class="grid grid-cols-3 gap-4" data-v-12a02acf><div class="col-span-2 h-2 rounded bg-gray-300" data-v-12a02acf></div><div class="col-span-1 h-2 rounded bg-gray-300" data-v-12a02acf></div></div><div class="h-2 rounded bg-gray-300" data-v-12a02acf></div></div></div></div></div>', 1), Ne = /* @__PURE__ */ y({
97
+ __name: "LoadingResponseAMA",
98
+ setup(n) {
99
+ const e = d("Generating response"), o = d([
100
+ "This may take a few seconds",
101
+ "Fetching the best response for you",
102
+ "Thinking... give me a moment",
103
+ "One moment while I gather the information",
104
+ "Hang in tight, we are almost there",
105
+ "Almost there... just a bit longer",
106
+ "Compiling a response for you"
107
+ ]);
108
+ return setTimeout(() => {
109
+ const l = Math.floor(Math.random() * o.value.length);
110
+ e.value = o.value[l];
111
+ }, 15e3), (l, p) => (c(), u("div", qe, [
112
+ s("div", Me, [
113
+ s("div", Ie, S(e.value), 1),
114
+ Le
115
+ ]),
116
+ Se
117
+ ]));
118
+ }
119
+ });
120
+ const Ee = /* @__PURE__ */ $(Ne, [["__scopeId", "data-v-12a02acf"]]), Qe = { key: 0 }, Ce = { key: 1 }, Re = {
121
+ key: 0,
122
+ class: "flex"
123
+ }, Fe = /* @__PURE__ */ y({
124
+ __name: "conversationAMA",
125
+ setup(n) {
126
+ let e = d(""), o = d("");
127
+ e.value = '<a style="color:#00AECF;"', o.value = '<ul style="list-style: disc !important; margin-left: 3.5rem !important; padding: 0;"';
128
+ const l = k(), p = d();
129
+ return Q(() => {
130
+ var t;
131
+ const m = document.getElementsByName("askQuestion"), r = Array.from(m);
132
+ m.length && ((t = r == null ? void 0 : r.pop()) == null || t.scrollIntoView({ behavior: "smooth", block: "center" }));
133
+ }), D(() => {
134
+ var t;
135
+ const m = document.getElementsByName("askQuestion"), r = Array.from(m);
136
+ m.length && ((t = r == null ? void 0 : r.pop()) == null || t.scrollIntoView({ behavior: "smooth", block: "center" }));
137
+ }), (m, r) => (c(), u("div", {
138
+ ref_key: "nestedElement",
139
+ ref: p,
140
+ class: "smooth-scroll overflow-auto md:px-6 px-2"
141
+ }, [
142
+ x(he),
143
+ (c(!0), u(O, null, Z(v(l).conversations, (t, _) => (c(), u("div", { key: _ }, [
144
+ t.question ? (c(), u("div", Qe, [
145
+ x($e, {
146
+ question: t.question,
147
+ c2question: t.c2question,
148
+ "show-feedback": t.showFeedback,
149
+ id: `qId${_}`,
150
+ name: "askQuestion",
151
+ "que-id": _
152
+ }, null, 8, ["question", "c2question", "show-feedback", "id", "que-id"])
153
+ ])) : I("", !0),
154
+ t.answer ? (c(), u("div", Ce, [
155
+ x(ye, {
156
+ question: t == null ? void 0 : t.question,
157
+ c2question: t == null ? void 0 : t.c2question,
158
+ "show-sources": t == null ? void 0 : t.showSources,
159
+ questionId: t.id,
160
+ answer: t.answer.replaceAll("<a", v(e)).replaceAll("<ul", v(o)),
161
+ "show-feedback": t.showFeedback,
162
+ "related-ques": t.relatedQues,
163
+ "options-array": t.optionsArray,
164
+ "ans-id": _
165
+ }, null, 8, ["question", "c2question", "show-sources", "questionId", "answer", "show-feedback", "related-ques", "options-array", "ans-id"])
166
+ ])) : I("", !0)
167
+ ]))), 128)),
168
+ v(l).dotLoader ? (c(), u("div", Re, [
169
+ x(Ee)
170
+ ])) : I("", !0)
171
+ ], 512));
172
+ }
173
+ });
174
+ const Pe = /* @__PURE__ */ $(Fe, [["__scopeId", "data-v-e6168dd4"]]), q = (n) => (N("data-v-4d4db1ef"), n = n(), E(), n), Te = { class: "z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6" }, je = { class: "py-2" }, Ue = { class: "flex" }, Ve = { class: "z-1 relative w-full" }, Be = { class: "relative w-full" }, He = { class: "absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3" }, ze = { key: 0 }, Ge = /* @__PURE__ */ q(() => /* @__PURE__ */ s("path", { d: "M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z" }, null, -1)), De = [
175
+ Ge
176
+ ], Oe = {
177
+ key: 1,
178
+ class: "tooltip"
179
+ }, Ze = /* @__PURE__ */ q(() => /* @__PURE__ */ s("span", { class: "tooltiptext" }, "Processing", -1)), Ke = /* @__PURE__ */ q(() => /* @__PURE__ */ s("img", {
180
+ class: "w-7 h-7",
181
+ src: V,
182
+ alt: "watingIcon"
183
+ }, null, -1)), We = [
184
+ Ze,
185
+ Ke
186
+ ], Ye = { class: "flex justify-start" }, Je = ["placeholder"], Xe = { class: "flex justify-start items-start text-[#161916] px-1" }, es = /* @__PURE__ */ q(() => /* @__PURE__ */ s("div", { class: "pt-1 text-start font-sans" }, [
187
+ /* @__PURE__ */ s("div", { class: "text-xs font-bold text-gray-500 md:text-sm px-1" }, " Note: AI-generated response may not be fully accurate; check with experts for critical information. ")
188
+ ], -1)), ss = /* @__PURE__ */ y({
189
+ __name: "NewQuestionAMA",
190
+ setup(n) {
191
+ const e = k(), o = F();
192
+ e.question = "";
193
+ const l = d(null), p = d(!1), m = d(M), r = d(!1);
194
+ Q(() => {
195
+ l.value.focus();
196
+ });
197
+ const _ = d(((h) => new URLSearchParams(window.location.search).get(h) || "")("amaId"));
198
+ console.log("amaId", _.value);
199
+ const w = (h) => {
200
+ const i = h.length;
201
+ m.value = M - i, p.value = i >= M;
202
+ }, A = async () => {
203
+ var h, i, f, b;
204
+ try {
205
+ if (e.question.trim().length < 1) {
206
+ o.setError("Please enter answer!");
207
+ return;
208
+ }
209
+ if (e.amaQuestionsLeft <= 0) {
210
+ o.setError("You have exhausted your question limit!");
211
+ return;
212
+ }
213
+ r.value = !0, e.dotLoader = !0;
214
+ const a = {
215
+ question: e == null ? void 0 : e.question
216
+ };
217
+ e.conversations.push(a);
218
+ const g = d("");
219
+ g.value = e == null ? void 0 : e.question, e.question = "";
220
+ const T = {
221
+ skillId: _.value,
222
+ question: g.value,
223
+ past_messages: e.past_messages
224
+ }, j = await ee("/amaBotResponse", T);
225
+ e.addConversation((h = j.data) == null ? void 0 : h.body, "new"), r.value = !1, e.dotLoader = !1;
226
+ } catch (a) {
227
+ if (console.error(a), e.dotLoader = !1, r.value = !1, P.isAxiosError(a)) {
228
+ const g = a;
229
+ console.log("Error found!"), console.error((i = g.response) == null ? void 0 : i.data), o.setError((b = (f = g.response) == null ? void 0 : f.data) == null ? void 0 : b.message);
230
+ } else
231
+ o.setError("There was an issue, please contact helpmate");
232
+ }
233
+ };
234
+ return (h, i) => (c(), u("div", Te, [
235
+ s("div", je, [
236
+ s("div", Ue, [
237
+ s("div", Ve, [
238
+ s("div", Be, [
239
+ s("div", He, [
240
+ r.value ? (c(), u("div", Oe, We)) : (c(), u("div", ze, [
241
+ (c(), u("svg", {
242
+ onClick: i[0] || (i[0] = (f) => A()),
243
+ xmlns: "http://www.w3.org/2000/svg",
244
+ fill: "currentColor",
245
+ class: "bi bi-send ml-2 h-7 w-7 rotate-45 rounded",
246
+ viewBox: "0 0 16 16"
247
+ }, De))
248
+ ]))
249
+ ]),
250
+ s("div", Ye, [
251
+ K(s("input", {
252
+ onKeyup: [
253
+ i[1] || (i[1] = Y((f) => r.value ? "" : A(), ["enter"])),
254
+ i[3] || (i[3] = (f) => w(v(e).question))
255
+ ],
256
+ "onUpdate:modelValue": i[2] || (i[2] = (f) => v(e).question = f),
257
+ class: "fontFormattingAMA text-[0.8125rem] md:text-[0.9375rem] rounded-lg flex w-full border border-genpact-darkest-teal py-4 pl-7 pr-16",
258
+ placeholder: `Ask me about ${v(e).amaSkillName || "Skill Name"}`,
259
+ type: "text",
260
+ ref_key: "AiSearch",
261
+ ref: l
262
+ }, null, 40, Je), [
263
+ [W, v(e).question]
264
+ ])
265
+ ])
266
+ ]),
267
+ s("div", Xe, S(v(e).amaQuestionsLeft) + " questions remaining for the day ", 1),
268
+ es
269
+ ])
270
+ ])
271
+ ])
272
+ ]));
273
+ }
274
+ });
275
+ const ts = /* @__PURE__ */ $(ss, [["__scopeId", "data-v-4d4db1ef"]]), C = (n) => (N("data-v-944ca5e3"), n = n(), E(), n), as = /* @__PURE__ */ C(() => /* @__PURE__ */ s("div", { class: "max-h-screen overflow-auto md:p-6 p-3 flex flex-col items-center justify-center gap-4 text-[#161916]" }, [
276
+ /* @__PURE__ */ s("div", { class: "text-2xl font-[700]" }, "Assessment Access Required"),
277
+ /* @__PURE__ */ s("h3", { className: "text-lg font-medium my-6 text-center text-gray-500" }, " You don't have access to this assessment. Please contact to administrator ")
278
+ ], -1)), os = {
279
+ key: 1,
280
+ className: "h-screen flex flex-col items-stretch"
281
+ }, ns = { class: "z-20" }, rs = /* @__PURE__ */ C(() => /* @__PURE__ */ s("div", { class: "mt-6" }, null, -1)), ls = { class: "flex h-full items-stretch overflow-hidden" }, is = { class: "mx-auto w-11/12 bg-white" }, cs = { class: "relative flex h-full w-full flex-col items-stretch overflow-hidden" }, ds = /* @__PURE__ */ C(() => /* @__PURE__ */ s("div", { class: "mt-[160px]" }, null, -1)), us = { class: "relative" }, _s = /* @__PURE__ */ y({
282
+ __name: "AssessmentAMA",
283
+ setup(n) {
284
+ const e = d(!0), o = d(!1), l = k(), p = F();
285
+ d("");
286
+ const r = d(((_) => new URLSearchParams(window.location.search).get(_) || "")("amaId"));
287
+ l.amaSkillId = r.value ?? "", Q(async () => {
288
+ e.value = !0, await t(), e.value = !1;
289
+ });
290
+ const t = async () => {
291
+ var _, w, A, h, i, f, b;
292
+ try {
293
+ if (r.value === null)
294
+ throw {
295
+ response: {
296
+ status: 424,
297
+ data: {
298
+ message: "Invalid URL"
299
+ }
300
+ }
301
+ };
302
+ console.log("before calling get learner");
303
+ const a = await se(
304
+ `/getLearnerData?amaSkillId=${r.value}`
305
+ );
306
+ l.initialize(a.data), l.amaQuestionsLeft = (_ = a == null ? void 0 : a.data) == null ? void 0 : _.questionsLeftAIGC, l.amaSkillName = (w = a == null ? void 0 : a.data) == null ? void 0 : w.skillName, e.value = !1;
307
+ } catch (a) {
308
+ if (console.error(a), e.value = !1, P.isAxiosError(a) && ((A = a.response) != null && A.status) || a && typeof a == "object" && "response" in a && a.response && typeof a.response == "object" && "status" in a.response && a.response.status) {
309
+ const g = a;
310
+ if (console.log("Error found!"), console.error((h = g.response) == null ? void 0 : h.data), ((i = g.response) == null ? void 0 : i.status) === 424 || ((f = g.response) == null ? void 0 : f.status) === 425) {
311
+ o.value = !0;
312
+ return;
313
+ }
314
+ p.setError(((b = g.response) == null ? void 0 : b.data).message);
315
+ } else
316
+ p.setError("There was an issue, please contact helpmate");
317
+ }
318
+ };
319
+ return (_, w) => (c(), u("section", null, [
320
+ x(z, { "is-visible": o.value }, {
321
+ default: J(() => [
322
+ as
323
+ ]),
324
+ _: 1
325
+ }, 8, ["is-visible"]),
326
+ s("div", null, [
327
+ e.value ? (c(), X(B, { key: 0 })) : (c(), u("main", os, [
328
+ s("div", ns, [
329
+ x(ce)
330
+ ]),
331
+ rs,
332
+ s("div", ls, [
333
+ s("div", is, [
334
+ s("div", cs, [
335
+ x(Pe),
336
+ ds
337
+ ]),
338
+ s("div", us, [
339
+ x(ts)
340
+ ])
341
+ ])
342
+ ])
343
+ ]))
344
+ ])
345
+ ]));
346
+ }
347
+ });
348
+ const xs = /* @__PURE__ */ $(_s, [["__scopeId", "data-v-944ca5e3"]]);
349
+ export {
350
+ xs as default
351
+ };