@genpact/genome.mfe.mgtwin-app 1.1.428-alpha → 1.1.429-alpha

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 (26) hide show
  1. package/dist/AssessmentAMA-1a73c00b.mjs +477 -0
  2. package/dist/{AssessmentSimulation-c5947cb0.mjs → AssessmentSimulation-a9dffb94.mjs} +790 -804
  3. package/dist/{EditSkillAdminData-a7d3044d.mjs → EditSkillAdminData-077c630a.mjs} +2 -2
  4. package/dist/{EditSkillData-1e921018.mjs → EditSkillData-a2ace12e.mjs} +2 -2
  5. package/dist/{HomeView-44b663ce.mjs → HomeView-450d5d0e.mjs} +4 -4
  6. package/dist/{Loading-c24045fa.mjs → Loading-0191500f.mjs} +1 -1
  7. package/dist/{PaperAirplaneIcon-cbcf8b3d.mjs → PaperAirplaneIcon-b08330f5.mjs} +1 -1
  8. package/dist/{PromptTesting-ce6a5a6b.mjs → PromptTesting-27a854c0.mjs} +3 -3
  9. package/dist/{SkillAutomation-dbdfe062.mjs → SkillAutomation-a7df1515.mjs} +3 -3
  10. package/dist/{SkillData-2a78929e.mjs → SkillData-189c5a3f.mjs} +3 -3
  11. package/dist/{Testcase-b6271407.mjs → Testcase-0ef86f18.mjs} +3 -3
  12. package/dist/{UnderMaintenance-cc38f517.mjs → UnderMaintenance-3f1319a1.mjs} +1 -1
  13. package/dist/{VoiceTestcase-e08807e8.mjs → VoiceTestcase-b4a537d4.mjs} +3 -3
  14. package/dist/{XMarkIcon-d1956f93.mjs → XMarkIcon-00c9268e.mjs} +1 -1
  15. package/dist/{api-53d9e4e0.mjs → api-cd0c35e1.mjs} +1 -1
  16. package/dist/{index.es-1321ec08.mjs → index.es-ac666b05.mjs} +6 -6
  17. package/dist/{main-287a9330.mjs → main-ece9019a.mjs} +234 -234
  18. package/dist/mgtwin.es.min.js +1 -1
  19. package/dist/mgtwin.umd.min.js +64 -64
  20. package/dist/native/aiguru-native.css +1 -1
  21. package/dist/native/aiguru-native.umd.min.js +62 -62
  22. package/dist/{simulationPopup.vue_vue_type_script_setup_true_lang-d231e228.mjs → simulationPopup.vue_vue_type_script_setup_true_lang-b2dc2d77.mjs} +57 -42
  23. package/dist/style.css +1 -1
  24. package/dist/{voiceServices-efe54c88.mjs → voiceServices-f741b361.mjs} +2 -2
  25. package/package.json +1 -1
  26. package/dist/AssessmentAMA-9735e352.mjs +0 -451
@@ -0,0 +1,477 @@
1
+ import { r as K, _ as Y, a as T, b as J, c as X, d as Z, L as ee } from "./simulationPopup.vue_vue_type_script_setup_true_lang-b2dc2d77.mjs";
2
+ import { _ as te, Q as B } from "./constants-e0c83ac4.mjs";
3
+ import { o as p, c as h, a as t, d as b, z as q, r as v, G as se, I as ne, b as m, u as L, B as F, t as C, h as w, s as j, T as oe, p as H, g as V, H as z, C as ae, F as re, e as ie, f as I, N, J as G, k as U, E as W, q as le, w as ce, m as de, P as ue, n as me, R as pe, x as _e, l as R, i as he } from "./main-ece9019a.mjs";
4
+ import { _ as M } from "./_plugin-vue_export-helper-dad06003.mjs";
5
+ import { u as D, i as O } from "./api-cd0c35e1.mjs";
6
+ import "./loadernew-ac153a51.mjs";
7
+ function fe(r, e) {
8
+ return p(), h("svg", {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ fill: "none",
11
+ viewBox: "0 0 24 24",
12
+ "stroke-width": "1.5",
13
+ stroke: "currentColor",
14
+ "aria-hidden": "true"
15
+ }, [
16
+ t("path", {
17
+ "stroke-linecap": "round",
18
+ "stroke-linejoin": "round",
19
+ d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
20
+ })
21
+ ]);
22
+ }
23
+ const ge = { class: "flex h-14 w-full flex-1 items-center justify-between bg-black md:pr-6 lg:pr-6" }, xe = ["href"], we = /* @__PURE__ */ t("img", {
24
+ class: "h-16 w-auto cursor-pointer",
25
+ src: Y,
26
+ alt: "Genome Logo"
27
+ }, null, -1), ve = [
28
+ we
29
+ ], Ae = ["href"], ye = /* @__PURE__ */ t("img", {
30
+ class: "h-6 w-28 cursor-pointer md:w-36",
31
+ src: te,
32
+ alt: "Aiguru Logo"
33
+ }, null, -1), be = [
34
+ ye
35
+ ], ke = /* @__PURE__ */ b({
36
+ __name: "headerAMA",
37
+ setup(r) {
38
+ const e = q(), i = v(""), l = v(""), _ = K(se(ne, void 0), window.location);
39
+ return _ === "prod" ? i.value = "https://genome.genpact.com" : i.value = "https://genome-dev.genpact.com", _ === "prod" ? l.value = "https://genome.genpact.com/#aiguru" : l.value = "https://genome-dev.genpact.com/#aiguru", (d, a) => (p(), h("nav", ge, [
40
+ t("a", {
41
+ class: "px-2 md:px-0 lg:px-0",
42
+ href: m(e).url(i.value),
43
+ target: "_blank"
44
+ }, ve, 8, xe),
45
+ t("a", {
46
+ class: "px-2 md:px-0 lg:px-0",
47
+ href: m(e).url(l.value),
48
+ target: "_blank"
49
+ }, be, 8, Ae)
50
+ ]));
51
+ }
52
+ }), $e = { class: "fontFormattingAMA flex items-center gap-3 pb-4 pt-2 md:pb-6" }, Fe = /* @__PURE__ */ t("span", {
53
+ class: "h-3 w-10 shrink-0 rounded-r-full bg-[#FFAB28]",
54
+ "aria-hidden": "true"
55
+ }, null, -1), qe = { class: "text-xl font-bold text-genpact-darkest-blue md:text-2xl" }, Me = { key: 0 }, Se = ["innerHTML"], Ie = /* @__PURE__ */ b({
56
+ __name: "greetingsAMA",
57
+ setup(r) {
58
+ const e = L(), i = q(), l = ` Hi ${e.learnerName || "Learner"}! 👋`, _ = F(() => l), d = F(() => i.text(l.replace("👋", "👋")));
59
+ return F(() => `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.`), (a, s) => (p(), h("section", null, [
60
+ t("div", $e, [
61
+ Fe,
62
+ t("div", qe, [
63
+ m(i).native ? (p(), h("div", Me, C(d.value), 1)) : (p(), h("div", {
64
+ key: 1,
65
+ innerHTML: _.value
66
+ }, null, 8, Se))
67
+ ])
68
+ ])
69
+ ]));
70
+ }
71
+ }), Le = { class: "fontFormattingAMA flex items-start justify-start gap-3 py-2" }, Ce = {
72
+ class: "mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-genpact-darkest-blue text-[#FFAB28]",
73
+ "aria-hidden": "true"
74
+ }, Be = { class: "w-full min-w-0 max-w-[88%] md:max-w-[85%]" }, Ee = { class: "line-break rounded-2xl rounded-tl-sm border border-gray-100 bg-white px-4 py-3 text-sm leading-6 text-[#3f4451] shadow-sm md:px-5 md:py-4 md:text-base md:leading-7" }, Ne = ["innerHTML"], Qe = /* @__PURE__ */ b({
75
+ __name: "responseAMA",
76
+ props: {
77
+ answer: {
78
+ type: String,
79
+ required: !0
80
+ }
81
+ },
82
+ setup(r) {
83
+ const e = r, i = q(), l = (a) => a.replace(/\*\*(.+?)\*\*/g, '<strong style="color: #181C23;">$1</strong>').replace(/\*/g, ""), _ = (a) => {
84
+ const s = [];
85
+ let f = [];
86
+ const n = () => {
87
+ f.length && (s.push({ html: `<ul style="list-style: disc; margin: 4px 0 4px 1.5rem; padding: 0;">${f.join("")}</ul>`, block: !0 }), f = []);
88
+ };
89
+ for (const o of a.split(`
90
+ `)) {
91
+ if (!o.trim()) {
92
+ n();
93
+ const c = s[s.length - 1];
94
+ c && !c.block && c.html !== "" && s.push({ html: "", block: !1 });
95
+ continue;
96
+ }
97
+ const x = o.match(/^\s*[-*•]\s+(.*)$/);
98
+ if (x) {
99
+ f.push(`<li style="margin: 2px 0;">${l(x[1])}</li>`);
100
+ continue;
101
+ }
102
+ n();
103
+ const u = o.match(/^\s*#{1,6}\s*(.*)$/);
104
+ u ? s.push({ html: `<div style="margin: 10px 0 2px; font-weight: 700; color: #021C42;">${l(u[1])}</div>`, block: !0 }) : s.push({ html: l(o), block: !1 });
105
+ }
106
+ n();
107
+ for (let o = s.length - 2; o >= 0; o--)
108
+ s[o].html === "" && !s[o].block && s[o + 1].block && s.splice(o, 1);
109
+ for (; s.length && s[s.length - 1].html === ""; )
110
+ s.pop();
111
+ return s.reduce((o, x, u) => u === 0 ? x.html : o + (x.block || s[u - 1].block ? "" : `
112
+ `) + x.html, "");
113
+ }, d = F(() => {
114
+ const a = _(e.answer).replace(
115
+ /Assessment Rating & Feedback/g,
116
+ '<div style="font-size: 26px; font-weight: bold; text-decoration: underline;">Rating & Feedback</div>'
117
+ ), s = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, f = a.replace(s, (n, o, x) => `<a href="${i.url(x)}" target="_blank" rel="noopener noreferrer" style="color: #00AECF; text-decoration: underline;">${o}</a>`);
118
+ return i.html(f);
119
+ });
120
+ return (a, s) => (p(), h("div", Le, [
121
+ t("div", Ce, [
122
+ w(m(T), { class: "h-[18px] w-[18px]" })
123
+ ]),
124
+ t("div", Be, [
125
+ t("div", Ee, [
126
+ t("span", {
127
+ class: "fontFormattingAMA answer-link",
128
+ innerHTML: d.value
129
+ }, null, 8, Ne)
130
+ ])
131
+ ])
132
+ ]));
133
+ }
134
+ });
135
+ const Re = /* @__PURE__ */ M(Qe, [["__scopeId", "data-v-9824fd60"]]), Te = { class: "fontFormattingAMA flex justify-end py-2" }, je = { class: "max-w-[80%]" }, He = { class: "rounded-2xl rounded-br-sm bg-[#FFAB28] px-4 py-3" }, Ve = { class: "fontFormattingAMA whitespace-pre-line break-words text-sm leading-6 text-[#181C23] md:text-base" }, ze = /* @__PURE__ */ t("div", { class: "mt-1 text-right text-xs text-gray-400" }, "You", -1), Ge = /* @__PURE__ */ b({
136
+ __name: "learnerAMA",
137
+ props: {
138
+ question: {
139
+ type: String,
140
+ required: !0
141
+ }
142
+ },
143
+ setup(r) {
144
+ return (e, i) => (p(), h("div", Te, [
145
+ t("div", je, [
146
+ t("div", He, [
147
+ t("div", Ve, C(r.question), 1)
148
+ ]),
149
+ ze
150
+ ])
151
+ ]));
152
+ }
153
+ }), P = (r) => (H("data-v-3d998441"), r = r(), V(), r), Ue = { class: "fontFormattingAMA flex w-full items-start justify-start gap-3 py-2" }, We = {
154
+ class: "mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-genpact-darkest-blue text-[#FFAB28]",
155
+ "aria-hidden": "true"
156
+ }, De = { class: "w-full min-w-0 max-w-[88%] md:max-w-[85%]" }, Oe = { class: "rounded-2xl rounded-tl-sm border border-gray-100 bg-white px-4 py-4 shadow-sm" }, Pe = {
157
+ class: "flex items-center gap-2.5",
158
+ role: "status",
159
+ "aria-live": "polite"
160
+ }, Ke = /* @__PURE__ */ P(() => /* @__PURE__ */ t("span", {
161
+ class: "dots flex shrink-0 items-center gap-1",
162
+ "aria-hidden": "true"
163
+ }, [
164
+ /* @__PURE__ */ t("span", { class: "h-1.5 w-1.5 rounded-full bg-[#FFAB28]" }),
165
+ /* @__PURE__ */ t("span", { class: "h-1.5 w-1.5 rounded-full bg-[#FFAB28]" }),
166
+ /* @__PURE__ */ t("span", { class: "h-1.5 w-1.5 rounded-full bg-[#FFAB28]" })
167
+ ], -1)), Ye = /* @__PURE__ */ P(() => /* @__PURE__ */ t("div", { class: "mt-4 space-y-2.5" }, [
168
+ /* @__PURE__ */ t("div", { class: "shimmer h-2.5 w-full rounded" }),
169
+ /* @__PURE__ */ t("div", { class: "shimmer h-2.5 w-11/12 rounded" }),
170
+ /* @__PURE__ */ t("div", { class: "shimmer h-2.5 w-4/6 rounded" })
171
+ ], -1)), Je = /* @__PURE__ */ b({
172
+ __name: "LoadingResponseAMA",
173
+ setup(r) {
174
+ const e = q(), i = [
175
+ "Generating response",
176
+ "Fetching the best response for you",
177
+ "Thinking... give me a moment",
178
+ "One moment while I gather the information",
179
+ "Hang in tight, we are almost there",
180
+ "Almost there... just a bit longer",
181
+ "Compiling a response for you"
182
+ ], l = v(0), _ = setInterval(() => {
183
+ var d, a;
184
+ !((a = (d = e.scope) == null ? void 0 : d.isActive) != null && a.call(d)) && e.native || (l.value = (l.value + 1) % i.length);
185
+ }, 5e3);
186
+ return e.own(() => clearInterval(_)), (d, a) => (p(), h("div", Ue, [
187
+ t("div", We, [
188
+ w(m(T), { class: "h-[18px] w-[18px]" })
189
+ ]),
190
+ t("div", De, [
191
+ t("div", Oe, [
192
+ t("div", Pe, [
193
+ Ke,
194
+ w(oe, {
195
+ name: "fade",
196
+ mode: "out-in"
197
+ }, {
198
+ default: j(() => [
199
+ (p(), h("span", {
200
+ key: l.value,
201
+ class: "text-xs italic leading-4 text-gray-500"
202
+ }, C(i[l.value]), 1))
203
+ ]),
204
+ _: 1
205
+ })
206
+ ]),
207
+ Ye
208
+ ])
209
+ ])
210
+ ]));
211
+ }
212
+ });
213
+ const Xe = /* @__PURE__ */ M(Je, [["__scopeId", "data-v-3d998441"]]), Ze = { key: 0 }, et = { key: 1 }, tt = {
214
+ key: 0,
215
+ class: "flex"
216
+ }, st = /* @__PURE__ */ b({
217
+ __name: "conversationAMA",
218
+ setup(r) {
219
+ let e = v(""), i = v("");
220
+ e.value = '<a style="color:#00AECF;"', i.value = '<ul style="list-style: disc !important; margin-left: 3.5rem !important; padding: 0;"';
221
+ const l = L(), _ = q(), d = v(), a = () => {
222
+ var n;
223
+ const s = _.native && _.root && typeof _.root.querySelectorAll == "function" ? _.root.querySelectorAll('[name="askQuestion"]') : document.getElementsByName("askQuestion"), f = Array.from(s);
224
+ f.length && ((n = f.pop()) == null || n.scrollIntoView({ behavior: "smooth", block: "center" }));
225
+ };
226
+ return z(a), ae(a), (s, f) => (p(), h("div", {
227
+ ref_key: "nestedElement",
228
+ ref: d,
229
+ class: "smooth-scroll overflow-auto md:px-6 px-2"
230
+ }, [
231
+ w(Ie),
232
+ (p(!0), h(re, null, ie(m(l).conversations, (n, o) => (p(), h("div", { key: o }, [
233
+ n.question ? (p(), h("div", Ze, [
234
+ w(Ge, {
235
+ question: n.question,
236
+ c2question: n.c2question,
237
+ "show-feedback": n.showFeedback,
238
+ id: `qId${o}`,
239
+ name: "askQuestion",
240
+ "que-id": o
241
+ }, null, 8, ["question", "c2question", "show-feedback", "id", "que-id"])
242
+ ])) : I("", !0),
243
+ n.answer ? (p(), h("div", et, [
244
+ w(Re, {
245
+ question: n == null ? void 0 : n.question,
246
+ c2question: n == null ? void 0 : n.c2question,
247
+ "show-sources": n == null ? void 0 : n.showSources,
248
+ questionId: n.id,
249
+ answer: n.answer.replaceAll("<a", m(e)).replaceAll("<ul", m(i)),
250
+ "show-feedback": n.showFeedback,
251
+ "related-ques": n.relatedQues,
252
+ "options-array": n.optionsArray,
253
+ "ans-id": o
254
+ }, null, 8, ["question", "c2question", "show-sources", "questionId", "answer", "show-feedback", "related-ques", "options-array", "ans-id"])
255
+ ])) : I("", !0)
256
+ ]))), 128)),
257
+ m(l).dotLoader ? (p(), h("div", tt, [
258
+ w(Xe)
259
+ ])) : I("", !0)
260
+ ], 512));
261
+ }
262
+ });
263
+ const nt = /* @__PURE__ */ M(st, [["__scopeId", "data-v-ee7bc477"]]), E = (r) => String(r.query.amaId ?? "");
264
+ function ot(r, e, i, l, _, d = (a) => !1) {
265
+ const a = v(!1);
266
+ let s = 0, f = !0;
267
+ const n = () => {
268
+ s += 1, a.value = !1, e.dotLoader = !1;
269
+ };
270
+ N(() => E(r), n), G(() => {
271
+ f = !1, n();
272
+ });
273
+ const o = (u, c) => f && u === s && c === E(r);
274
+ return { isWaitingResponse: a, sendQuestion: async () => {
275
+ var k, $, g;
276
+ if (e.question.trim().length < 1) {
277
+ i.setError("Please enter answer!");
278
+ return;
279
+ }
280
+ if (e.amaQuestionsLeft <= 0) {
281
+ i.setError("You have exhausted your question limit!");
282
+ return;
283
+ }
284
+ const u = ++s, c = E(r);
285
+ a.value = !0, e.dotLoader = !0;
286
+ const A = e.question;
287
+ e.conversations.push({ question: A }), e.question = "";
288
+ const S = {
289
+ skillId: c,
290
+ question: A,
291
+ past_messages: e.past_messages
292
+ };
293
+ try {
294
+ const y = await l(S);
295
+ if (!o(u, c))
296
+ return;
297
+ e.addConversation((k = y.data) == null ? void 0 : k.body, "new"), a.value = !1, e.dotLoader = !1;
298
+ } catch (y) {
299
+ if (d(y) || !o(u, c))
300
+ return;
301
+ a.value = !1, e.dotLoader = !1, _(y) ? i.setError((g = ($ = y.response) == null ? void 0 : $.data) == null ? void 0 : g.message) : i.setError("There was an issue, please contact helpmate");
302
+ }
303
+ } };
304
+ }
305
+ const Q = (r) => (H("data-v-7c8476bc"), r = r(), V(), r), at = { class: "w-full px-2 pb-3 pt-3 md:px-6" }, rt = { class: "relative" }, it = { class: "pointer-events-none absolute inset-y-0 left-3 flex items-center md:left-4" }, lt = {
306
+ class: "flex h-8 w-8 items-center justify-center rounded-full bg-[#FFF4E0] text-[#E08A00] md:h-9 md:w-9",
307
+ "aria-hidden": "true"
308
+ }, ct = ["placeholder"], dt = { class: "absolute inset-y-0 right-2 flex items-center md:right-3" }, ut = {
309
+ key: 1,
310
+ class: "flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF4E0]",
311
+ role: "status",
312
+ "aria-label": "Waiting for response",
313
+ title: "Waiting for response"
314
+ }, mt = /* @__PURE__ */ Q(() => /* @__PURE__ */ t("span", { class: "h-5 w-5 animate-spin rounded-full border-[2.5px] border-[#FFAB28] border-t-transparent" }, null, -1)), pt = [
315
+ mt
316
+ ], _t = { class: "fontFormattingAMA flex flex-wrap items-center justify-center gap-x-1.5 gap-y-0.5 pt-2 text-center text-xs text-gray-500 md:text-sm" }, ht = /* @__PURE__ */ Q(() => /* @__PURE__ */ t("span", null, "Note: AI-generated response may not be fully accurate; check with experts for critical information.", -1)), ft = /* @__PURE__ */ Q(() => /* @__PURE__ */ t("span", {
317
+ class: "hidden sm:inline",
318
+ "aria-hidden": "true"
319
+ }, "·", -1)), gt = { class: "font-semibold text-[#181C23]" }, xt = /* @__PURE__ */ b({
320
+ __name: "NewQuestionAMA",
321
+ setup(r) {
322
+ const e = L(), i = U();
323
+ e.question = "";
324
+ const l = v(null), _ = v(!1), d = v(B), a = W(), s = D(), { isWaitingResponse: f, sendQuestion: n } = ot(
325
+ a,
326
+ e,
327
+ i,
328
+ (u) => s.postApi("/amaBotResponse", u),
329
+ le.isAxiosError,
330
+ O
331
+ );
332
+ z(() => {
333
+ l.value.focus();
334
+ });
335
+ const o = F(() => e.question.trim().length > 0);
336
+ N(
337
+ () => e.question,
338
+ async () => {
339
+ await pe();
340
+ const u = l.value;
341
+ u && (u.style.height = "auto", u.style.height = `${u.scrollHeight}px`);
342
+ }
343
+ );
344
+ const x = (u) => {
345
+ const c = u.length;
346
+ d.value = B - c, _.value = c >= B;
347
+ };
348
+ return (u, c) => (p(), h("div", at, [
349
+ t("div", rt, [
350
+ t("div", it, [
351
+ t("span", lt, [
352
+ w(m(fe), { class: "h-4 w-4 md:h-5 md:w-5" })
353
+ ])
354
+ ]),
355
+ ce(t("textarea", {
356
+ ref_key: "AiSearch",
357
+ ref: l,
358
+ "onUpdate:modelValue": c[0] || (c[0] = (A) => m(e).question = A),
359
+ rows: "1",
360
+ class: "fontFormattingAMA block max-h-40 w-full resize-none overflow-y-auto rounded-2xl border border-[#FFAB28]/40 bg-white py-3 pl-14 pr-16 text-sm leading-6 text-[#181C23] shadow-[0_4px_16px_rgba(7,50,98,0.08)] transition placeholder:text-gray-400 hover:border-[#FFAB28]/70 focus:border-[#FFAB28] focus:outline-none focus:ring-4 focus:ring-[#FFAB28]/20 md:py-4 md:pl-16 md:pr-20 md:text-base",
361
+ placeholder: `Ask me about ${m(e).amaSkillName || "Skill Name"}`,
362
+ onKeydown: c[1] || (c[1] = ue(_e((A) => m(f) ? "" : m(n)(), ["exact", "prevent"]), ["enter"])),
363
+ onInput: c[2] || (c[2] = (A) => x(m(e).question))
364
+ }, null, 40, ct), [
365
+ [de, m(e).question]
366
+ ]),
367
+ t("div", dt, [
368
+ m(f) ? (p(), h("span", ut, pt)) : (p(), h("button", {
369
+ key: 0,
370
+ type: "button",
371
+ title: "Send",
372
+ "aria-label": "Send question",
373
+ class: me([o.value ? "bg-[#FFAB28] text-[#181C23] shadow-md hover:-translate-y-0.5 hover:shadow-lg" : "bg-[#FFAB28]/40 text-[#181C23]/60", "flex h-10 w-10 items-center justify-center rounded-full transition"]),
374
+ onClick: c[3] || (c[3] = (A) => m(n)())
375
+ }, [
376
+ w(m(J), {
377
+ class: "h-5 w-5",
378
+ "aria-hidden": "true"
379
+ })
380
+ ], 2))
381
+ ])
382
+ ]),
383
+ t("div", _t, [
384
+ w(m(X), {
385
+ class: "h-4 w-4 shrink-0 text-[#E08A00]",
386
+ "aria-hidden": "true"
387
+ }),
388
+ ht,
389
+ ft,
390
+ t("span", gt, C(m(e).amaQuestionsLeft) + " questions remaining for the day", 1)
391
+ ])
392
+ ]));
393
+ }
394
+ });
395
+ const wt = /* @__PURE__ */ M(xt, [["__scopeId", "data-v-7c8476bc"]]), vt = (r) => String(r.query.amaId ?? "");
396
+ function At(r, e, i, l, _ = (d) => !1) {
397
+ const d = v(!0), a = v(!1);
398
+ let s = 0;
399
+ const f = (o) => {
400
+ e.amaSkillId = o, e.amaSkillName = "", e.amaQuestionsLeft = 0, e.question = "", e.conversations = [], e.past_messages = [];
401
+ }, n = async (o) => {
402
+ var c, A, S, k, $;
403
+ const x = ++s;
404
+ d.value = !0, a.value = !1, f(o);
405
+ let u = !1;
406
+ try {
407
+ const g = await l(o);
408
+ if (x !== s)
409
+ return;
410
+ e.initialize(g.data), e.amaQuestionsLeft = (c = g == null ? void 0 : g.data) == null ? void 0 : c.questionsLeftAIGC, e.amaSkillName = (A = g == null ? void 0 : g.data) == null ? void 0 : A.skillName;
411
+ } catch (g) {
412
+ if (_(g)) {
413
+ u = !0;
414
+ return;
415
+ }
416
+ if (x !== s)
417
+ return;
418
+ const y = g && typeof g == "object" && ((S = g.response) == null ? void 0 : S.status);
419
+ y === 424 || y === 425 ? a.value = !0 : y ? i.setError(($ = (k = g.response) == null ? void 0 : k.data) == null ? void 0 : $.message) : i.setError("There was an issue, please contact helpmate");
420
+ } finally {
421
+ !u && x === s && (d.value = !1);
422
+ }
423
+ };
424
+ return N(() => vt(r), (o) => {
425
+ n(o);
426
+ }, { immediate: !0 }), G(() => {
427
+ s += 1;
428
+ }), { loaderValue: d, notAllowedModalVisible: a };
429
+ }
430
+ const yt = {
431
+ key: 1,
432
+ class: "flex h-screen flex-col overflow-hidden"
433
+ }, bt = { class: "z-20 shrink-0" }, kt = { class: "min-h-0 flex-1 overflow-hidden pb-1" }, $t = { class: "flex h-full flex-col bg-gray-100 px-2 sm:px-6 md:px-10 lg:px-20" }, Ft = { class: "fontFormattingAMA flex min-h-0 flex-1 flex-col border-x border-b border-black bg-gray-200 pt-3 md:pt-4" }, qt = { class: "shrink-0" }, Mt = /* @__PURE__ */ b({
434
+ __name: "AssessmentAMA",
435
+ setup(r) {
436
+ const e = L(), i = U(), l = W(), _ = D(), { loaderValue: d, notAllowedModalVisible: a } = At(
437
+ l,
438
+ e,
439
+ i,
440
+ (s) => _.getApi(`/getLearnerData?amaSkillId=${s}`),
441
+ O
442
+ );
443
+ return (s, f) => (p(), h("section", null, [
444
+ m(a) ? (p(), R(Z, {
445
+ key: 0,
446
+ tone: "error",
447
+ title: "Assessment Access Required"
448
+ }, {
449
+ default: j(() => [
450
+ he(" You don't have access to this assessment. Please contact to administrator ")
451
+ ]),
452
+ _: 1
453
+ })) : I("", !0),
454
+ t("div", null, [
455
+ m(d) ? (p(), R(ee, { key: 0 })) : (p(), h("main", yt, [
456
+ t("div", bt, [
457
+ w(ke)
458
+ ]),
459
+ t("section", kt, [
460
+ t("div", $t, [
461
+ t("div", Ft, [
462
+ w(nt, { class: "min-h-0 flex-1" }),
463
+ t("div", qt, [
464
+ w(wt)
465
+ ])
466
+ ])
467
+ ])
468
+ ])
469
+ ]))
470
+ ])
471
+ ]));
472
+ }
473
+ });
474
+ const Nt = /* @__PURE__ */ M(Mt, [["__scopeId", "data-v-52c203d2"]]);
475
+ export {
476
+ Nt as default
477
+ };