@1024pix/epreuves-components 1.0.2 → 1.2.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.
@@ -0,0 +1,196 @@
1
+ import { a as Y, h as T, c as p, o as d, F as U, g as u, H as s, y as h, f as e, t, j as C, T as D, _ as z, r as l, I as E, e as H, q as N, J as V, d as K } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { a as G, i as q, b as J } from "../i18n-CnN3ours.js";
3
+ const Q = {
4
+ "calcul-impact": { title: "Calculez votre impact IA", subtitle: "Quels ont été vos usages de l'IA la semaine dernière ?", numberOfConversationLabel: "Nombre de conversations courtes :", numberOfImagesLabel: "Nombre de créations d’images :", seePersonalImpact: "Voir votre impact personnel sur une semaine", seeCollectiveImpact: "Si 1 million de personnes faisaient comme vous toutes les semaines pendant un an", legals: "Estimations basées sur l'étude Hugging Face, Carnegie Mellon University, Allen Institute for AI, Oct 2024", yourPersonalImpact: "Votre impact personnel", consumptionForAWeek: "Votre consommation sur une semaine", consumptionForAYear: "1 million de personnes toutes les semaines pendant un an", personalConsumption: "Vous avez consommé environ {{energy}} Wh", personalDuration: "Cela équivaut à {{number}} minutes de micro-ondes", collectiveConsumption: "Cela représenterait {{energy}} kWh, soit l'équivalent de {{homes}} foyers français", collectiveDuration: "Équivalent à {{number}} minutes de micro-ondes", planeKilometers: "Et {{kilometers}} km parcourus en avion", yourCollectiveImpact: "Impact collectif simulé" }
5
+ }, x = {
6
+ key: 0,
7
+ class: "result-calculation"
8
+ }, X = ["aria-level"], Z = { class: "consumption" }, ee = { style: { "font-weight": "bold" } }, ae = { style: { "font-weight": "bold" } }, te = {
9
+ key: 0,
10
+ class: "result-calculation"
11
+ }, le = ["titleLevel"], oe = { class: "consumption" }, ne = { style: { "font-weight": "bold" } }, ie = { style: { "font-weight": "bold" } }, se = { style: { "font-weight": "bold" } }, re = { style: { "font-weight": "bold" } }, ce = /* @__PURE__ */ Y({
12
+ __name: "ImpactsResults.ce",
13
+ props: {
14
+ titleLevel: { type: Number },
15
+ byWeekForOne: { type: Object },
16
+ byYearForAMillion: { type: Object },
17
+ isPersonal: { type: Boolean },
18
+ isCollective: { type: Boolean }
19
+ },
20
+ setup(v) {
21
+ return (a, o) => {
22
+ const n = T("i18next");
23
+ return d(), p(U, null, [
24
+ u(D, { name: "fade-perso" }, {
25
+ default: s(() => [
26
+ a.isPersonal ? (d(), p("div", x, [
27
+ e("div", {
28
+ class: "header",
29
+ role: "heading",
30
+ "aria-level": a.titleLevel + 1
31
+ }, "📌 " + t(a.$t("calcul-impact.yourPersonalImpact")), 9, X),
32
+ e("p", Z, t(a.$t("calcul-impact.consumptionForAWeek")), 1),
33
+ e("p", null, [
34
+ o[0] || (o[0] = C("⚡ ", -1)),
35
+ u(n, {
36
+ translation: a.$t("calcul-impact.personalConsumption")
37
+ }, {
38
+ energy: s(() => [
39
+ e("span", ee, t(a.byWeekForOne.energyByWeek), 1)
40
+ ]),
41
+ _: 1
42
+ }, 8, ["translation"])
43
+ ]),
44
+ e("p", null, [
45
+ o[1] || (o[1] = C("🍽️ ", -1)),
46
+ u(n, {
47
+ translation: a.$t("calcul-impact.personalDuration")
48
+ }, {
49
+ number: s(() => [
50
+ e("span", ae, t(a.byWeekForOne.personalMicrowavesDuration), 1)
51
+ ]),
52
+ _: 1
53
+ }, 8, ["translation"])
54
+ ])
55
+ ])) : h("", !0)
56
+ ]),
57
+ _: 1
58
+ }),
59
+ u(D, { name: "fade-collectif" }, {
60
+ default: s(() => [
61
+ a.isCollective ? (d(), p("div", te, [
62
+ e("div", {
63
+ class: "header",
64
+ role: "heading",
65
+ titleLevel: a.titleLevel + 1
66
+ }, "🌍 " + t(a.$t("calcul-impact.yourCollectiveImpact")), 9, le),
67
+ e("p", oe, t(a.$t("calcul-impact.consumptionForAYear")), 1),
68
+ e("p", null, [
69
+ o[2] || (o[2] = C("⚡ ", -1)),
70
+ u(n, {
71
+ translation: a.$t("calcul-impact.collectiveConsumption")
72
+ }, {
73
+ energy: s(() => [
74
+ e("span", ne, t(a.byYearForAMillion.collectiveAnnualEnergy), 1)
75
+ ]),
76
+ homes: s(() => [
77
+ e("span", ie, t(a.byYearForAMillion.equivalentPopulationByCity), 1)
78
+ ]),
79
+ _: 1
80
+ }, 8, ["translation"])
81
+ ]),
82
+ e("p", null, [
83
+ o[3] || (o[3] = C("🍽️ ", -1)),
84
+ u(n, {
85
+ translation: a.$t("calcul-impact.collectiveDuration")
86
+ }, {
87
+ number: s(() => [
88
+ e("span", se, t(a.byYearForAMillion.collectiveMicrowavesDuration), 1)
89
+ ]),
90
+ _: 1
91
+ }, 8, ["translation"])
92
+ ]),
93
+ e("p", null, [
94
+ o[4] || (o[4] = C("✈️ ", -1)),
95
+ u(n, {
96
+ translation: a.$t("calcul-impact.planeKilometers")
97
+ }, {
98
+ kilometers: s(() => [
99
+ e("span", re, t(a.byYearForAMillion.kilometerByPlane), 1)
100
+ ]),
101
+ _: 1
102
+ }, 8, ["translation"])
103
+ ])
104
+ ])) : h("", !0)
105
+ ]),
106
+ _: 1
107
+ })
108
+ ], 64);
109
+ };
110
+ }
111
+ }), ue = ".result-calculation[data-v-350a9de7]{background:#e0f7fa;border-left:solid 3px #00796b;padding:1rem;border-radius:10px}.header[data-v-350a9de7]{font-size:1.125rem;font-weight:700}.consumption[data-v-350a9de7]{font-style:italic}.fade-perso-enter-active[data-v-350a9de7],.fade-collectif-enter-active[data-v-350a9de7]{transition:all .3s ease-out}.fade-perso-leave-active[data-v-350a9de7],.fade-collectif-leave-active[data-v-350a9de7]{transition:all .8s cubic-bezier(1,.5,.8,1)}.fade-perso-enter-from[data-v-350a9de7],.fade-collectif-enter-from[data-v-350a9de7],.fade-perso-leave-to[data-v-350a9de7],.fade-collectif-leave-to[data-v-350a9de7]{transform:translate(20px);opacity:0}", de = /* @__PURE__ */ z(ce, [["styles", [ue]], ["__scopeId", "data-v-350a9de7"]]), ve = { class: "container" }, me = ["arial-level"], pe = { for: "numberOfConversation" }, be = { for: "numberOfImage" }, fe = { class: "legals" }, ye = /* @__PURE__ */ Y({
112
+ __name: "CalculImpact.ce",
113
+ props: {
114
+ titleLevel: { type: Number }
115
+ },
116
+ setup(v, { expose: a }) {
117
+ const n = v.titleLevel ?? 2, b = l(10), f = l(2), w = l(0), $ = l(0), B = l(0), r = l(!1), y = l(!1);
118
+ function S() {
119
+ b.value = 10, f.value = 2, c.value = {}, m.value = {}, w.value = 0, $.value = 0, B.value = 0, r.value = !1, y.value = !1, _.value = 0, F.value = 0, g.value = 0, A.value = 0, O.value = 0;
120
+ }
121
+ const k = {
122
+ text: { energy: 2.9, co2: 1.5 },
123
+ image: { energy: 32, co2: 20 }
124
+ }, c = l({}), m = l({}), _ = l(0), F = l(0), g = l(0), A = l(0), O = l(0);
125
+ function P() {
126
+ _.value = b.value * k.text.energy + f.value * k.image.energy, F.value = b.value * k.text.co2 + f.value * k.image.co2, w.value = Number((_.value / 0.8).toFixed(1)), c.value.energyByWeek = _.value.toFixed(1), c.value.personalMicrowavesDuration = w.value, c.value.co2ByWeek = F.value.toFixed(1);
127
+ }
128
+ function M() {
129
+ g.value = c.value.energyByWeek * 52 * 1e6 / 1e3, A.value = c.value.co2ByWeek * 52 * 1e6 / 1e6, O.value = Math.round(g.value / 2300), $.value = g.value / 0.8, B.value = A.value * 2410, m.value.collectiveMicrowavesDuration = $.value.toLocaleString(), m.value.kilometerByPlane = B.value.toLocaleString(), m.value.equivalentPopulationByCity = O.value.toLocaleString(), m.value.collectiveAnnualEnergy = g.value.toLocaleString();
130
+ }
131
+ function j() {
132
+ P(), r.value = !0;
133
+ }
134
+ function R() {
135
+ M(), y.value = !0;
136
+ }
137
+ function W() {
138
+ r.value && y.value && (P(), M());
139
+ }
140
+ return a({
141
+ reset: S
142
+ }), (i, I) => (d(), p("div", ve, [
143
+ e("div", {
144
+ class: "title",
145
+ role: "heading",
146
+ "arial-level": N(n)
147
+ }, "📊 " + t(i.$t("calcul-impact.title")), 9, me),
148
+ e("p", null, t(i.$t("calcul-impact.subtitle")), 1),
149
+ e("label", pe, "🤖 " + t(i.$t("calcul-impact.numberOfConversationLabel")), 1),
150
+ E(e("input", {
151
+ onChange: W,
152
+ type: "number",
153
+ id: "numberOfConversation",
154
+ "onUpdate:modelValue": I[0] || (I[0] = (L) => b.value = L)
155
+ }, null, 544), [
156
+ [V, b.value]
157
+ ]),
158
+ e("label", be, "🖼️ " + t(i.$t("calcul-impact.numberOfImagesLabel")), 1),
159
+ E(e("input", {
160
+ onChange: W,
161
+ type: "number",
162
+ id: "numberOfImage",
163
+ "onUpdate:modelValue": I[1] || (I[1] = (L) => f.value = L)
164
+ }, null, 544), [
165
+ [V, f.value]
166
+ ]),
167
+ r.value ? (d(), H(de, {
168
+ key: 0,
169
+ "is-collective": y.value,
170
+ "is-personal": r.value,
171
+ "title-level": N(n),
172
+ "by-week-for-one": c.value,
173
+ "by-year-for-a-million": m.value
174
+ }, null, 8, ["is-collective", "is-personal", "title-level", "by-week-for-one", "by-year-for-a-million"])) : h("", !0),
175
+ r.value ? h("", !0) : (d(), p("button", {
176
+ key: 1,
177
+ onClick: j
178
+ }, "📌 " + t(i.$t("calcul-impact.seePersonalImpact")), 1)),
179
+ r.value && !y.value ? (d(), p("button", {
180
+ key: 2,
181
+ onClick: R
182
+ }, "🌍 " + t(i.$t("calcul-impact.seeCollectiveImpact")), 1)) : h("", !0),
183
+ e("p", fe, "📝 " + t(i.$t("calcul-impact.legals")), 1)
184
+ ]));
185
+ }
186
+ }), ge = "[data-v-9b2dbaaa]{font-family:Nunito,Roboto,sans-serif;color:#253858}p[data-v-9b2dbaaa]{padding:0}.container[data-v-9b2dbaaa]{display:flex;flex-direction:column;gap:1rem}.container button[data-v-9b2dbaaa]{border:0;border-radius:5px;font-size:.9rem;background:#357abd;color:#fff;width:50%;padding:.4rem .8rem;margin:auto;cursor:pointer}.container button[data-v-9b2dbaaa]:hover{background:#225d93}.container input[data-v-9b2dbaaa]{border:solid 1px lightgrey;border-radius:5px;padding-block:.2rem;width:40%}.container label[data-v-9b2dbaaa]{font-weight:700}.container .legals[data-v-9b2dbaaa]{font-size:.9rem;font-style:italic}.container .title[data-v-9b2dbaaa]{font-size:1.3rem;font-weight:700}@media only screen and (max-width: 768px){.container button[data-v-9b2dbaaa]{width:100%}.container input[data-v-9b2dbaaa]{width:80%}}", Ce = /* @__PURE__ */ z(ye, [["styles", [ge]], ["__scopeId", "data-v-9b2dbaaa"]]);
187
+ G(/* @__PURE__ */ Object.assign({ "./locales/fr.json": Q })).catch((v) => console.error(v));
188
+ window.customElements.define("calcul-impact", K(Ce, {
189
+ configureApp(v) {
190
+ q.changeLanguage(document?.documentElement?.lang || navigator.language), v.use(J, {
191
+ i18next: q,
192
+ slotStart: "{{",
193
+ slotEnd: "}}"
194
+ });
195
+ }
196
+ }));
@@ -1,6 +1,6 @@
1
- import { a as w, c as n, o as a, f as e, t as i, K as C, _ as x, r as p, g, F as f, b as v, x as P, e as B, d as A } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { a as M, i as h, b as j } from "../i18n-b8OapH7K.js";
3
- import { L as y } from "../LLMMessage.ce--tBITfVq.js";
1
+ import { a as w, c as n, o as t, f as e, t as r, L as C, _ as x, r as p, g, F as v, b as h, x as P, e as B, d as A } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { a as M, i as f, b as j } from "../i18n-CnN3ours.js";
3
+ import { L as y } from "../LLMMessage.ce-BXgLZdHB.js";
4
4
  const z = {}, N = {}, I = {
5
5
  "complete-phrase": { iaSuggestions: "🧠 Suggestions de l'IA", explanation: "La barre indique la probabilité de chaque mot. Plus elle est longue, plus le mot est probable dans ce contexte.", ariaLabelDescription: "Le mot {{name}} a une probabilité de {{percent}}%", clickHereButton: "Cliquez ici pour voir ce que l'IA va compléter", successfullyCompletedSentence: "🎉 Phrase complétée avec succès !" }
6
6
  }, T = {}, q = {}, E = { class: "probability-bar" }, D = { "aria-hidden": "true" }, F = { class: "sr-only" }, O = /* @__PURE__ */ w({
@@ -9,10 +9,10 @@ const z = {}, N = {}, I = {
9
9
  name: { type: String },
10
10
  percent: { type: Number }
11
11
  },
12
- setup(r) {
13
- return (o, s) => (a(), n("div", E, [
14
- e("p", D, i(o.name), 1),
15
- e("p", F, i(o.$t("complete-phrase.ariaLabelDescription", { name: o.name, percent: o.percent })), 1),
12
+ setup(i) {
13
+ return (o, s) => (t(), n("div", E, [
14
+ e("p", D, r(o.name), 1),
15
+ e("p", F, r(o.$t("complete-phrase.ariaLabelDescription", { name: o.name, percent: o.percent })), 1),
16
16
  e("div", {
17
17
  style: C(`width: ${o.percent}%`),
18
18
  class: "probability-bar__percent",
@@ -24,7 +24,7 @@ const z = {}, N = {}, I = {
24
24
  }, null, -1))
25
25
  ]));
26
26
  }
27
- }), R = ".probability-bar[data-v-f5414745]{position:relative;padding-bottom:10px;border-bottom:1px solid #cbcbcb}.probability-bar__percent[data-v-f5414745]{position:absolute;left:0;z-index:2;height:5px;border-radius:5px;background-color:#235386}.probability-bar__background[data-v-f5414745]{position:absolute;left:0;z-index:1;width:100%;height:5px;border-radius:5px;background-color:#92a1b2}.probability-bar p[data-v-f5414745]{margin-bottom:0}.sr-only[data-v-f5414745]{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", H = /* @__PURE__ */ x(O, [["styles", [R]], ["__scopeId", "data-v-f5414745"]]), V = { class: "container" }, W = { class: "container__left-side" }, G = { class: "container__conversation" }, K = ["aria-describedby"], J = {
27
+ }), R = ".probability-bar[data-v-d89fc563]{position:relative;padding-bottom:10px;border-bottom:1px solid #cbcbcb}.probability-bar__percent[data-v-d89fc563]{position:absolute;left:0;z-index:2;height:5px;border-radius:5px;background-color:#235386}.probability-bar__background[data-v-d89fc563]{position:absolute;left:0;z-index:1;width:100%;height:5px;border-radius:5px;background-color:#92a1b2}.probability-bar p[data-v-d89fc563]{margin-bottom:0}.sr-only[data-v-d89fc563]{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", H = /* @__PURE__ */ x(O, [["styles", [R]], ["__scopeId", "data-v-d89fc563"]]), V = { class: "container" }, W = { class: "container__left-side" }, G = { class: "container__conversation" }, J = ["aria-describedby"], K = {
28
28
  key: 1,
29
29
  class: "container__successSentence"
30
30
  }, Q = { class: "container__right-side" }, U = ["aria-level"], X = { "aria-hidden": "true" }, Y = { class: "probabilities" }, Z = ["id", "aria-hidden"], ee = /* @__PURE__ */ w({
@@ -36,65 +36,65 @@ const z = {}, N = {}, I = {
36
36
  wordsToAdd: { type: Array },
37
37
  titleLevel: { type: Number }
38
38
  },
39
- setup(r, { expose: o }) {
40
- const s = r, l = p(0), u = p(s.llmMessage), _ = p(!1), c = p(s.wordsToAdd);
39
+ setup(i, { expose: o }) {
40
+ const s = i, l = p(0), b = p(s.llmMessage), u = p(!1), c = p(s.wordsToAdd);
41
41
  function k() {
42
- _.value = !1, u.value = s.llmMessage, c.value = s.wordsToAdd, l.value = 0;
42
+ u.value = !1, b.value = s.llmMessage, c.value = s.wordsToAdd, l.value = 0;
43
43
  }
44
- function S() {
45
- c.value.length === 1 && (_.value = !0), l.value += 1;
46
- const [t, ...b] = c.value;
47
- c.value = b, u.value += `<span style="font-weight: bold;">${t} </span>`;
44
+ function L() {
45
+ c.value.length === 1 && (u.value = !0), l.value += 1;
46
+ const [a, ..._] = c.value;
47
+ c.value = _, b.value += `<span style="font-weight: bold;">${a} </span>`;
48
48
  }
49
49
  return o({
50
50
  reset: k
51
- }), (t, b) => (a(), n("div", V, [
51
+ }), (a, _) => (t(), n("div", V, [
52
52
  e("div", W, [
53
53
  e("div", G, [
54
54
  g(y, {
55
55
  class: "container__message",
56
- message: { content: t.userMessage, direction: "outbound" }
56
+ message: { content: a.userMessage, direction: "outbound" }
57
57
  }, null, 8, ["message"]),
58
58
  g(y, {
59
59
  class: "container__message",
60
- message: { content: u.value, direction: "inbound" }
60
+ message: { content: b.value, direction: "inbound" }
61
61
  }, null, 8, ["message"])
62
62
  ]),
63
- _.value ? (a(), n("p", J, i(t.$t("complete-phrase.successfullyCompletedSentence")), 1)) : (a(), n("button", {
63
+ u.value ? (t(), n("p", K, r(a.$t("complete-phrase.successfullyCompletedSentence")), 1)) : (t(), n("button", {
64
64
  key: 0,
65
- onClick: S,
65
+ onClick: L,
66
66
  class: "container__button",
67
67
  "aria-describedby": `currentProbability${l.value}`
68
- }, i(t.$t("complete-phrase.clickHereButton")), 9, K))
68
+ }, r(a.$t("complete-phrase.clickHereButton")), 9, J))
69
69
  ]),
70
70
  e("div", Q, [
71
71
  e("div", {
72
72
  class: "container__title",
73
- role: "header",
74
- "aria-level": t.titleLevel
75
- }, i(t.$t("complete-phrase.iaSuggestions")), 9, U),
76
- e("p", X, i(t.$t("complete-phrase.explanation")), 1),
73
+ role: "heading",
74
+ "aria-level": a.titleLevel
75
+ }, r(a.$t("complete-phrase.iaSuggestions")), 9, U),
76
+ e("p", X, r(a.$t("complete-phrase.explanation")), 1),
77
77
  e("div", Y, [
78
- (a(!0), n(f, null, v(t.listOfProbabilityBarsLists, ($, d) => (a(), n("div", {
78
+ (t(!0), n(v, null, h(a.listOfProbabilityBarsLists, (S, d) => (t(), n("div", {
79
79
  class: P(["probability", { hidden: d !== l.value }]),
80
80
  key: d,
81
81
  id: `currentProbability${d}`,
82
82
  "aria-hidden": d !== l.value
83
83
  }, [
84
- (a(!0), n(f, null, v($, (m, L) => (a(), B(H, {
84
+ (t(!0), n(v, null, h(S, (m, $) => (t(), B(H, {
85
85
  name: m.name,
86
86
  percent: m.percent,
87
- key: L
87
+ key: $
88
88
  }, null, 8, ["name", "percent"]))), 128))
89
89
  ], 10, Z))), 128))
90
90
  ])
91
91
  ])
92
92
  ]));
93
93
  }
94
- }), te = "[data-v-f0837864]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.container[data-v-f0837864]{display:grid;grid-row:auto;gap:10px}.container__conversation[data-v-f0837864]{display:flex;flex-direction:column;background:#fff;padding:1rem;border-radius:10px;margin-bottom:1rem;border:solid 1px lightgrey}.container__title[data-v-f0837864]{font-size:1.2rem;font-weight:700}.container .probabilities[data-v-f0837864]{display:grid}.container .probability[data-v-f0837864]{grid-row:1;grid-column:1}.container__right-side[data-v-f0837864]{grid-column:2;grid-row:1}.container__right-side h2[data-v-f0837864]{margin-top:0}.container__right-side .hidden[data-v-f0837864]{visibility:hidden;grid-row:1;grid-column:1}.container__left-side[data-v-f0837864]{grid-column:1;grid-row:1}.container__message[data-v-f0837864]{margin-bottom:20px}.container__successSentence[data-v-f0837864]{width:90%;background-color:#cec3f4;padding:.8rem .5rem;border-radius:10px}.container__button[data-v-f0837864]{width:90%;border:none;padding:1.2rem 1rem;background:#355ac4;color:#fff;border-radius:10px;font-weight:700}.container__button[data-v-f0837864]:hover{background:#2b3c77;cursor:pointer}@media (max-width: 600px){.container[data-v-f0837864]{display:flex;flex-wrap:wrap}}", ae = /* @__PURE__ */ x(ee, [["styles", [te]], ["__scopeId", "data-v-f0837864"]]);
95
- M(/* @__PURE__ */ Object.assign({ "./locales/en.json": z, "./locales/es.json": N, "./locales/fr.json": I, "./locales/it.json": T, "./locales/nl.json": q })).catch((r) => console.error(r));
96
- window.customElements.define("complete-phrase", A(ae, {
97
- configureApp(r) {
98
- h.changeLanguage(document?.documentElement?.lang || navigator.language), r.use(j, { i18next: h });
94
+ }), ae = "[data-v-12a26a0b]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.container[data-v-12a26a0b]{display:grid;grid-row:auto;gap:10px}.container__conversation[data-v-12a26a0b]{display:flex;flex-direction:column;background:#fff;padding:1rem;border-radius:10px;margin-bottom:1rem;border:solid 1px lightgrey}.container__title[data-v-12a26a0b]{font-size:1.2rem;font-weight:700}.container .probabilities[data-v-12a26a0b]{display:grid}.container .probability[data-v-12a26a0b]{grid-row:1;grid-column:1}.container__right-side[data-v-12a26a0b]{grid-column:2;grid-row:1}.container__right-side h2[data-v-12a26a0b]{margin-top:0}.container__right-side .hidden[data-v-12a26a0b]{visibility:hidden;grid-row:1;grid-column:1}.container__left-side[data-v-12a26a0b]{grid-column:1;grid-row:1}.container__message[data-v-12a26a0b]{margin-bottom:20px}.container__successSentence[data-v-12a26a0b]{width:90%;background-color:#cec3f4;padding:.8rem .5rem;border-radius:10px}.container__button[data-v-12a26a0b]{width:90%;border:none;padding:1.2rem 1rem;background:#355ac4;color:#fff;border-radius:10px;font-weight:700}.container__button[data-v-12a26a0b]:hover{background:#2b3c77;cursor:pointer}@media (max-width: 600px){.container[data-v-12a26a0b]{display:flex;flex-wrap:wrap}}", te = /* @__PURE__ */ x(ee, [["styles", [ae]], ["__scopeId", "data-v-12a26a0b"]]);
95
+ M(/* @__PURE__ */ Object.assign({ "./locales/en.json": z, "./locales/es.json": N, "./locales/fr.json": I, "./locales/it.json": T, "./locales/nl.json": q })).catch((i) => console.error(i));
96
+ window.customElements.define("complete-phrase", A(te, {
97
+ configureApp(i) {
98
+ f.changeLanguage(document?.documentElement?.lang || navigator.language), i.use(j, { i18next: f });
99
99
  }
100
100
  }));
@@ -1,4 +1,4 @@
1
- import { d as e } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { I as m } from "../ImageQuiz.ce-B7shuhfQ.js";
1
+ import { d as e } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { I as m } from "../ImageQuiz.ce-BpbKbNe3.js";
3
3
  window.customElements.define("image-quiz", e(m));
4
4
  window.customElements.define("qcu-image", e(m));
@@ -1,5 +1,5 @@
1
- import { a as l, r as f, w, c as z, o as t, b as p, e as d, m as g, F as v, d as _ } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { I as A } from "../ImageQuiz.ce-B7shuhfQ.js";
1
+ import { a as l, r as f, w, c as z, o as t, b as p, e as d, m as g, F as v, d as _ } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { I as A } from "../ImageQuiz.ce-BpbKbNe3.js";
3
3
  const h = /* @__PURE__ */ l({
4
4
  __name: "ImageQuizzes.ce",
5
5
  props: {
@@ -1,6 +1,6 @@
1
- import { a as m, c as r, o as a, f as e, t as n, F as t, b as p, g as i, _ as c, d as g } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { L as l } from "../LLMMessage.ce--tBITfVq.js";
3
- import { p as u } from "../shadow-dom-CTg-8Iam.js";
1
+ import { a as m, c as r, o as a, f as e, t as n, F as t, b as p, g as i, _ as c, d as g } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { L as l } from "../LLMMessage.ce-BXgLZdHB.js";
3
+ import { p as u } from "../shadow-dom-BPtJYPTL.js";
4
4
  const f = {
5
5
  class: "header",
6
6
  "aria-hidden": "true"
@@ -1,6 +1,6 @@
1
- import { a as m, k as i, l as p, c as o, o as e, F as d, b as g, e as u, _ as f, d as h } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { L as _ } from "../LLMMessage.ce--tBITfVq.js";
3
- import { p as x } from "../shadow-dom-CTg-8Iam.js";
1
+ import { a as m, k as i, l as p, c as o, o as e, F as d, b as g, e as u, _ as f, d as h } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { L as _ } from "../LLMMessage.ce-BXgLZdHB.js";
3
+ import { p as x } from "../shadow-dom-BPtJYPTL.js";
4
4
  const b = {
5
5
  class: "llm-messages",
6
6
  "aria-live": "polite"
@@ -1,4 +1,4 @@
1
- import { a as v, r as c, h, c as i, o as d, g as y, f as l, j as w, F as f, b as k, t as S, _ as C, d as L } from "../_plugin-vue_export-helper-DGDsC3jx.js";
1
+ import { a as v, r as c, h, c as i, o as d, g as y, f as l, j as w, F as f, b as k, t as S, _ as C, d as L } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
2
  import "./llm-messages.ce.js.js";
3
3
  const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, B = ["disabled", "onClick"], E = /* @__PURE__ */ v({
4
4
  __name: "LLMPromptSelect.ce",
@@ -1,10 +1,10 @@
1
- import { a as k, r as b, v as D, E as C, c as r, o as t, x, y as _, f as y, j as w, t as h, g as $, F as v, b as M, _ as N, D as E, e as B, d as T } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { L as V } from "../Loading.ce-DFM6f_1v.js";
3
- const F = ["part"], L = {
1
+ import { a as D, r as w, v as M, E as $, c as t, o as s, x, y as m, f as h, j as k, t as v, g as E, G as B, m as T, F as b, b as N, _ as S, D as V, e as z, d as F } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { L } from "../Loading.ce-BaqTP6QH.js";
3
+ const P = ["part"], j = {
4
4
  key: 1,
5
5
  class: "message__loader message__content",
6
6
  "aria-hidden": "true"
7
- }, j = ["part"], z = { key: 0 }, I = /* @__PURE__ */ k({
7
+ }, I = ["part"], G = { key: 1 }, O = { key: 0 }, R = /* @__PURE__ */ D({
8
8
  __name: "Message.ce",
9
9
  props: {
10
10
  displaySender: { type: Boolean, default: !0 },
@@ -14,52 +14,54 @@ const F = ["part"], L = {
14
14
  loadingDuration: { type: Number }
15
15
  },
16
16
  setup(n, { expose: c }) {
17
- const s = b("hidden"), l = b([]), u = D(() => n.message.content.split(`
17
+ const i = w("hidden"), g = w([]), p = M(() => n.message.content.split(`
18
18
  `));
19
- function m(e) {
20
- return new Promise((i) => {
21
- const o = setTimeout(i, e);
22
- l.value.push(o);
19
+ function d(e) {
20
+ return new Promise((a) => {
21
+ const o = setTimeout(a, e);
22
+ g.value.push(o);
23
23
  });
24
24
  }
25
- async function g() {
26
- await m(n.startAnimation), s.value = "loading", await m(n.loadingDuration), s.value = "visible", await m(n.animationDuration);
25
+ async function l() {
26
+ await d(n.startAnimation), i.value = "loading", await d(n.loadingDuration), i.value = "visible", await d(n.animationDuration);
27
27
  }
28
- C(g);
29
- async function a() {
30
- s.value = "hidden", l.value.forEach(clearTimeout), await g();
28
+ $(l);
29
+ async function f() {
30
+ i.value = "hidden", g.value.forEach(clearTimeout), await l();
31
31
  }
32
32
  return c({
33
- reset: a
34
- }), (e, i) => (t(), r("div", {
33
+ reset: f
34
+ }), (e, a) => (s(), t("div", {
35
35
  class: x(["message", [
36
36
  `message--${e.message.direction}`,
37
- { "hidden-state": s.value === "hidden" }
37
+ { "hidden-state": i.value === "hidden" }
38
38
  ]])
39
39
  }, [
40
- e.displaySender ? (t(), r("p", {
40
+ e.displaySender ? (s(), t("p", {
41
41
  key: 0,
42
42
  class: "message__sender",
43
43
  part: `sender ${e.message.direction}`
44
44
  }, [
45
- i[0] || (i[0] = y("span", { class: "sr-only" }, "Message de ", -1)),
46
- w(h(e.message.userName), 1)
47
- ], 8, F)) : _("", !0),
48
- s.value === "loading" ? (t(), r("div", L, [
49
- $(V)
50
- ])) : _("", !0),
51
- y("p", {
52
- class: x(["message__content", { "hidden-state": s.value !== "visible" }]),
45
+ a[0] || (a[0] = h("span", { class: "sr-only" }, "Message de ", -1)),
46
+ k(v(e.message.userName), 1)
47
+ ], 8, P)) : m("", !0),
48
+ i.value === "loading" ? (s(), t("div", j, [
49
+ E(L)
50
+ ])) : m("", !0),
51
+ h("p", {
52
+ class: x(["message__content", { "hidden-state": i.value !== "visible" }]),
53
53
  part: `message ${e.message.direction}`
54
54
  }, [
55
- (t(!0), r(v, null, M(u.value, (o, d) => (t(), r(v, { key: d }, [
56
- d > 0 ? (t(), r("br", z)) : _("", !0),
57
- w(" " + h(o), 1)
55
+ e.message.image ? (s(), t("img", B(T({ key: 0 }, e.message.image)), null, 16)) : m("", !0),
56
+ e.message.image ? (s(), t("br", G)) : m("", !0),
57
+ (s(!0), t(b, null, N(p.value, (o, r) => (s(), t(b, { key: r }, [
58
+ r > 0 ? (s(), t("br", O)) : m("", !0),
59
+ k(" " + v(o), 1)
58
60
  ], 64))), 128))
59
- ], 10, j)
61
+ ], 10, I)
60
62
  ], 2));
61
63
  }
62
- }), O = ".message{max-width:80%;position:relative}.message--incoming{align-self:start}.message--incoming .message__sender{padding-left:10px}.message--incoming .message__loader{left:10px}.message--incoming .message__content{background-color:#e8e8e8}.message--outgoing{align-self:end}.message--outgoing .message__sender{padding-right:10px;text-align:right}.message--outgoing .message__loader{right:10px}.message--outgoing .message__content{background-color:#d1eaff}.message__sender{color:#444;font-size:.8rem;font-weight:700;margin:0}.message__loader{position:absolute;width:24px}.message__content{border-radius:16px;margin:0;padding:10px 14px}.message__content:not(.hidden-state){animation:fade .3s ease-in-out both}.hidden-state{visibility:hidden}@keyframes fade{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){.message__content:not(.hidden-state){animation:none}.message__loader{display:none}.hidden-state{visibility:visible}}", P = /* @__PURE__ */ N(I, [["styles", [O]]]), R = { part: "conversation" }, q = { class: "sr-only" }, G = /* @__PURE__ */ k({
64
+ }), q = ".message{max-width:80%;position:relative}.message--incoming{align-self:start}.message--incoming .message__sender{padding-left:10px}.message--incoming .message__loader{left:10px}.message--incoming .message__content{background-color:#e8e8e8}.message--outgoing{align-self:end}.message--outgoing .message__sender{padding-right:10px;text-align:right}.message--outgoing .message__loader{right:10px}.message--outgoing .message__content{background-color:#d1eaff}.message__sender{color:#444;font-size:.8rem;font-weight:700;margin:0}.message__loader{position:absolute;width:24px}.message__content{border-radius:16px;margin:0;padding:10px 14px}.message__content:not(.hidden-state){animation:fade .3s ease-in-out both}.message__content>img{max-width:100%}.hidden-state{visibility:hidden}@keyframes fade{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){.message__content:not(.hidden-state){animation:none}.message__loader{display:none}.hidden-state{visibility:visible}}", H = /* @__PURE__ */ S(R, [["styles", [q]]]), J = { part: "conversation" }, K = { class: "sr-only" }, Q = /* @__PURE__ */ D({
63
65
  __name: "MessageConversation.ce",
64
66
  props: {
65
67
  title: { default: "Conversation par messages", type: String },
@@ -67,43 +69,44 @@ const F = ["part"], L = {
67
69
  animationSpeed: { default: 20, type: Number }
68
70
  },
69
71
  setup(n, { expose: c }) {
70
- const s = 50 * n.animationSpeed, l = D(
72
+ const i = 50 * n.animationSpeed, g = 50 * n.animationSpeed, p = M(
71
73
  () => n.messages.reduce(
72
- (a, e, i) => {
73
- const o = m(e);
74
- if (i === 0)
75
- return [{ message: e, displaySender: !0, startAnimation: 0, animationDuration: o }];
74
+ (e, a, o) => {
75
+ const r = l(a);
76
+ if (o === 0)
77
+ return [{ message: a, displaySender: !0, startAnimation: 0, animationDuration: r }];
76
78
  const {
77
- message: d,
78
- startAnimation: p,
79
- animationDuration: f
80
- } = a.at(-1), S = e.direction !== d.direction || e.userName !== d.userName, A = p + f + s;
81
- return [...a, { message: e, displaySender: S, startAnimation: A, animationDuration: o }];
79
+ message: u,
80
+ startAnimation: y,
81
+ animationDuration: _
82
+ } = e.at(-1), A = a.direction !== u.direction || a.userName !== u.userName, C = y + _ + i;
83
+ return [...e, { message: a, displaySender: A, startAnimation: C, animationDuration: r }];
82
84
  },
83
85
  []
84
86
  )
85
- ), u = E("messages");
86
- function m(a) {
87
- return a.content.length * n.animationSpeed;
87
+ ), d = V("messages");
88
+ function l(e) {
89
+ let a = e.content.length * n.animationSpeed;
90
+ return e.image && (a += g), a;
88
91
  }
89
- function g() {
90
- u.value.forEach((a) => a.reset());
92
+ function f() {
93
+ d.value.forEach((e) => e.reset());
91
94
  }
92
95
  return c({
93
- reset: g
94
- }), (a, e) => (t(), r("figure", R, [
95
- y("figcaption", q, h(a.title), 1),
96
- (t(!0), r(v, null, M(l.value, ({ message: i, displaySender: o, startAnimation: d, animationDuration: p }, f) => (t(), B(P, {
96
+ reset: f
97
+ }), (e, a) => (s(), t("figure", J, [
98
+ h("figcaption", K, v(e.title), 1),
99
+ (s(!0), t(b, null, N(p.value, ({ message: o, displaySender: r, startAnimation: u, animationDuration: y }, _) => (s(), z(H, {
97
100
  ref_for: !0,
98
101
  ref: "messages",
99
- message: i,
100
- "start-animation": d,
101
- "animation-duration": p,
102
- "loading-duration": s,
103
- "display-sender": o,
104
- key: f
102
+ message: o,
103
+ "start-animation": u,
104
+ "animation-duration": y,
105
+ "loading-duration": i,
106
+ "display-sender": r,
107
+ key: _
105
108
  }, null, 8, ["message", "start-animation", "animation-duration", "display-sender"]))), 128))
106
109
  ]));
107
110
  }
108
- }), H = "figure{background-color:#fff;border-radius:16px;display:flex;flex-direction:column;gap:8px;margin:0;padding:16px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", J = /* @__PURE__ */ N(G, [["styles", [H]]]);
109
- window.customElements.define("message-conversation", T(J));
111
+ }), U = "figure{background-color:#fff;border-radius:16px;display:flex;flex-direction:column;gap:8px;margin:0;padding:16px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", W = /* @__PURE__ */ S(Q, [["styles", [U]]]);
112
+ window.customElements.define("message-conversation", F(W));
@@ -1,5 +1,5 @@
1
- import { a as d, c as n, o as r, f as a, t as i, F as l, b as h, q as u, _ as p, d as _ } from "../_plugin-vue_export-helper-DGDsC3jx.js";
2
- import { a as m, i as o, b as f } from "../i18n-b8OapH7K.js";
1
+ import { a as d, c as n, o as i, f as a, t as r, F as l, b as h, q as u, _ as p, d as _ } from "../_plugin-vue_export-helper-CXkSGj2f.js";
2
+ import { a as m, i as o, b as f } from "../i18n-CnN3ours.js";
3
3
  const y = {
4
4
  "pix-article": { byAuthor: "Par {{author}}" }
5
5
  }, v = ["titleLevel"], S = { class: "article__metadata" }, b = { class: "article__author" }, L = ["innerHTML"], x = /* @__PURE__ */ d({
@@ -17,23 +17,23 @@ const y = {
17
17
  const s = e.paragraphs.join(`
18
18
  `).replace("{{highlightedSentence}}", `<strong style="color: ${e.colorOfHighlightSentence};">${e.highlightedSentence}</strong>`).split(`
19
19
  `);
20
- return (t, H) => (r(), n(l, null, [
20
+ return (t, H) => (i(), n(l, null, [
21
21
  a("div", {
22
22
  class: "article__title",
23
- role: "header",
23
+ role: "heading",
24
24
  titleLevel: t.titleLevel
25
- }, i(t.title), 9, v),
25
+ }, r(t.title), 9, v),
26
26
  a("p", S, [
27
- a("span", b, i(t.$t("pix-article.byAuthor", { author: t.author })), 1),
28
- a("time", null, i(t.date), 1)
27
+ a("span", b, r(t.$t("pix-article.byAuthor", { author: t.author })), 1),
28
+ a("time", null, r(t.date), 1)
29
29
  ]),
30
- (r(!0), n(l, null, h(u(s), (c, g) => (r(), n("p", {
30
+ (i(!0), n(l, null, h(u(s), (c, g) => (i(), n("p", {
31
31
  innerHTML: c,
32
32
  key: g
33
33
  }, null, 8, L))), 128))
34
34
  ], 64));
35
35
  }
36
- }), A = "[data-v-38484447]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.article__title[data-v-38484447]{font-size:1.3rem;font-weight:700}.article__metadata[data-v-38484447]{font-style:italic}.article__author[data-v-38484447]{border-right:solid 1px var(--pix-neutral-800);padding-right:.7rem;margin-right:.5rem}", E = /* @__PURE__ */ p(x, [["styles", [A]], ["__scopeId", "data-v-38484447"]]);
36
+ }), A = "[data-v-30ea36f1]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.article__title[data-v-30ea36f1]{font-size:1.3rem;font-weight:700}.article__metadata[data-v-30ea36f1]{font-style:italic}.article__author[data-v-30ea36f1]{border-right:solid 1px var(--pix-neutral-800);padding-right:.7rem;margin-right:.5rem}", E = /* @__PURE__ */ p(x, [["styles", [A]], ["__scopeId", "data-v-30ea36f1"]]);
37
37
  m(/* @__PURE__ */ Object.assign({ "./locales/fr.json": y })).catch((e) => console.error(e));
38
38
  window.customElements.define("pix-article", _(E, {
39
39
  configureApp(e) {