@gengage/assistant-fe 0.6.50 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/chat/api.d.ts +1 -1
  2. package/dist/chat/components/ChatDrawer.d.ts +3 -1
  3. package/dist/chat/features/beauty-consulting/mode-controller.d.ts +1 -1
  4. package/dist/chat/features/beauty-consulting/stream-handler.d.ts +7 -1
  5. package/dist/chat/history-storage.d.ts +36 -4
  6. package/dist/chat/runtime.d.ts +2 -2
  7. package/dist/chat/utils/chat-presentation-debug.d.ts +0 -14
  8. package/dist/chat-runtime.js +1 -1
  9. package/dist/chat.iife.js +56 -56
  10. package/dist/chat.js +1 -1
  11. package/dist/common/connection-warning.d.ts +10 -0
  12. package/dist/common/indexed-db.d.ts +35 -2
  13. package/dist/common/native-webview.d.ts +1 -1
  14. package/dist/common/streaming.d.ts +6 -1
  15. package/dist/common/transport.d.ts +2 -1
  16. package/dist/common/types.d.ts +16 -0
  17. package/dist/{common-DJFI5t11.js → common-CeuGSwJL.js} +61 -65
  18. package/dist/common.js +30 -30
  19. package/dist/{connection-warning-TXqyeFaf.js → connection-warning-C0e2byq5.js} +31 -25
  20. package/dist/{fastIntent-539wPavr.js → fastIntent-BI7l1oDv.js} +2 -2
  21. package/dist/global-error-toast-DvaKvPNA.js +798 -0
  22. package/dist/index.js +29 -29
  23. package/dist/native-webview-CHKpwixw.js +303 -0
  24. package/dist/native.iife.js +27 -27
  25. package/dist/native.js +1 -1
  26. package/dist/{overlay-BPZEIyo_.js → overlay-C3XzoSKd.js} +51 -32
  27. package/dist/overlay.js +6 -6
  28. package/dist/{price-formatter-CHUmYq8I.js → price-formatter-Q3wUKrl1.js} +2 -1
  29. package/dist/qna/runtime.d.ts +1 -0
  30. package/dist/qna-runtime.js +1 -1
  31. package/dist/qna.iife.js +32 -32
  32. package/dist/qna.js +1 -1
  33. package/dist/{request-response-cache-DwADBDeB.js → request-response-cache-BLQy7llq.js} +478 -454
  34. package/dist/{runtime-Do3qShrH.js → runtime-BC8-a6Ql.js} +231 -219
  35. package/dist/{runtime-9f9SB4WE.js → runtime-BSIrZhF2.js} +2783 -2692
  36. package/dist/{runtime-rTw1jMhB.js → runtime-DiONTdBz.js} +230 -212
  37. package/dist/{simbut-DlWvDoPI.js → simbut-BDbb3nMH.js} +5 -5
  38. package/dist/simbut.iife.js +2 -2
  39. package/dist/simbut.js +1 -1
  40. package/dist/simrel/components/GroupTabs.d.ts +6 -0
  41. package/dist/simrel/runtime.d.ts +8 -0
  42. package/dist/{simrel-BFPU2n5p.js → simrel-CdxDIKu3.js} +15 -15
  43. package/dist/simrel-runtime.js +1 -1
  44. package/dist/simrel.iife.js +22 -22
  45. package/dist/simrel.js +2 -2
  46. package/dist/widget-base-Cvxdrqqt.js +141 -0
  47. package/package.json +1 -1
  48. package/dist/context-UTzCGyR9.js +0 -543
  49. package/dist/native-webview-CYX30O3Q.js +0 -273
  50. package/dist/widget-base-BwU6SI2o.js +0 -365
@@ -1,10 +1,10 @@
1
- import { f as x, g as Q, i as R, m as N, n as H, t as O } from "./request-response-cache-DwADBDeB.js";
2
- import { A as U, D as j, E as M, a as q, v as F } from "./context-UTzCGyR9.js";
3
- import { o as W, t as D } from "./widget-base-BwU6SI2o.js";
4
- import { t as A } from "./locale-uQ5XZ2yS.js";
5
- import { n as z } from "./connection-warning-TXqyeFaf.js";
6
- async function $(t, e, n) {
7
- const o = H("launcher_action", e), i = {
1
+ import { f as B, g as x, i as Q, m as R, n as N, t as H } from "./request-response-cache-BLQy7llq.js";
2
+ import { L as O, N as U, P as j, T as M, f as T, n as F } from "./global-error-toast-DvaKvPNA.js";
3
+ import { t as W } from "./widget-base-Cvxdrqqt.js";
4
+ import { t as q } from "./locale-uQ5XZ2yS.js";
5
+ import { r as z } from "./connection-warning-C0e2byq5.js";
6
+ async function D(t, e, n) {
7
+ const i = N("launcher_action", e), o = {
8
8
  uiSpecs: [],
9
9
  actions: []
10
10
  }, a = {
@@ -13,31 +13,37 @@ async function $(t, e, n) {
13
13
  body: JSON.stringify(t)
14
14
  };
15
15
  n !== void 0 && (a.signal = n);
16
- const l = await O(o, a);
16
+ const l = await H(i, a);
17
17
  if (!l.ok) throw new Error(`HTTP ${l.status}: ${l.statusText}`);
18
18
  const s = { onEvent: (c) => {
19
- const r = R(c);
20
- if (r && (r.type === "ui_spec" && i.uiSpecs.push(r.spec), r.type === "ui_spec" && r.spec.elements)) {
19
+ const r = Q(c);
20
+ if (r && (r.type === "ui_spec" && o.uiSpecs.push(r.spec), r.type === "ui_spec" && r.spec.elements)) {
21
21
  for (const u of Object.values(r.spec.elements)) if (u.type === "ActionButton" && u.props?.action) {
22
- const m = u.props.action;
23
- i.actions.push(m);
22
+ const h = u.props.action;
23
+ if (typeof h.title == "string" && typeof h.type == "string") {
24
+ const p = {
25
+ title: h.title,
26
+ type: h.type
27
+ };
28
+ h.payload !== void 0 && (p.payload = h.payload), o.actions.push(p);
29
+ }
24
30
  }
25
31
  }
26
32
  } };
27
- return n !== void 0 && (s.signal = n), await x(l, s), i;
33
+ return n !== void 0 && (s.signal = n), await B(l, s), o;
28
34
  }
29
- function T(t) {
35
+ function A(t) {
30
36
  const e = document.createElement("div");
31
37
  e.className = "gengage-qna-buttons gds-toolbar", e.dataset.gengagePart = "qna-button-row", e.setAttribute("role", "group"), e.setAttribute("aria-label", t.quickQuestionsAriaLabel ?? "Quick questions"), t.orientation === "vertical" && (e.style.flexDirection = "column");
32
38
  for (const n of t.actions) {
33
- const o = document.createElement("button");
34
- o.className = "gengage-qna-button gds-chip", o.dataset.gengagePart = "qna-quick-question", o.textContent = n.title, o.type = "button", o.addEventListener("click", () => {
35
- const i = {
39
+ const i = document.createElement("button");
40
+ i.className = "gengage-qna-button gds-chip", i.dataset.gengagePart = "qna-quick-question", i.textContent = n.title, i.type = "button", i.addEventListener("click", () => {
41
+ const o = {
36
42
  title: n.title,
37
43
  type: n.type
38
44
  };
39
- n.payload !== void 0 && (i.payload = n.payload), t.onAction(i);
40
- }), e.appendChild(o);
45
+ n.payload !== void 0 && (o.payload = n.payload), t.onAction(o);
46
+ }), e.appendChild(i);
41
47
  }
42
48
  if (t.ctaText || t.onOpenChat) {
43
49
  const n = document.createElement("button");
@@ -47,69 +53,69 @@ function T(t) {
47
53
  }
48
54
  return e;
49
55
  }
50
- function G(t) {
56
+ function $(t) {
51
57
  const e = document.createElement("div");
52
58
  e.className = "gengage-qna-input-wrapper", e.dataset.gengagePart = "qna-input-wrapper";
53
59
  const n = document.createElement("div");
54
60
  n.className = "gengage-qna-input-combo", n.dataset.gengagePart = "qna-input-combo";
55
- const o = document.createElement("input");
56
- o.type = "text", o.className = "gengage-qna-input", o.dataset.gengagePart = "qna-input", o.setAttribute("aria-label", t.askQuestionAriaLabel ?? "Ask a question");
57
- const i = Array.isArray(t.placeholders) ? t.placeholders : t.placeholders ? [t.placeholders] : [t.defaultInputPlaceholder ?? "Ask a question..."];
58
- let a = 0, l = i[0] ?? "";
59
- o.placeholder = l;
61
+ const i = document.createElement("input");
62
+ i.type = "text", i.className = "gengage-qna-input", i.dataset.gengagePart = "qna-input", i.setAttribute("aria-label", t.askQuestionAriaLabel ?? "Ask a question");
63
+ const o = Array.isArray(t.placeholders) ? t.placeholders : t.placeholders ? [t.placeholders] : [t.defaultInputPlaceholder ?? "Ask a question..."];
64
+ let a = 0, l = o[0] ?? "";
65
+ i.placeholder = l;
60
66
  let s = null, c = null, r = !1;
61
67
  const u = () => {
62
- s && clearInterval(s), s = null, c && clearTimeout(c), c = null, o.classList.remove("gengage-qna-input--fade");
63
- }, m = () => i.length > 1 && !r && o.value.trim().length === 0, g = () => {
64
- u(), m() && (s = setInterval(() => {
65
- m() && (o.classList.add("gengage-qna-input--fade"), c = setTimeout(() => {
66
- a = (a + 1) % i.length, l = i[a] ?? "", o.placeholder = l, o.classList.remove("gengage-qna-input--fade");
68
+ s && clearInterval(s), s = null, c && clearTimeout(c), c = null, i.classList.remove("gengage-qna-input--fade");
69
+ }, h = () => o.length > 1 && !r && i.value.trim().length === 0, p = () => {
70
+ u(), h() && (s = setInterval(() => {
71
+ h() && (i.classList.add("gengage-qna-input--fade"), c = setTimeout(() => {
72
+ a = (a + 1) % o.length, l = o[a] ?? "", i.placeholder = l, i.classList.remove("gengage-qna-input--fade");
67
73
  }, 180));
68
74
  }, 3e3));
69
- }, h = document.createElement("div");
70
- h.className = "gengage-qna-input-actions", h.dataset.gengagePart = "qna-input-actions";
71
- const f = document.createElement("button");
72
- f.className = "gengage-qna-icon-btn gengage-qna-clear gengage-qna-icon-btn--hidden", f.type = "button", f.dataset.gengagePart = "qna-clear", f.setAttribute("aria-label", "Clear question"), f.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 6L6 18" /><path d="M6 6L18 18" /></svg>';
73
- const p = document.createElement("button");
74
- p.className = "gengage-qna-icon-btn gengage-qna-send gengage-qna-icon-btn--hidden", p.type = "button", p.dataset.gengagePart = "qna-send", p.setAttribute("aria-label", t.sendQuestionAriaLabel ?? "Send question"), p.disabled = !0, p.innerHTML = `<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M22 2L11 13" /><path d="M22 2L15 22L11 13L2 9L22 2Z" /></svg><span class="gengage-qna-sr-only">${t.ctaLabel ?? t.sendButtonText ?? "Ask"}</span>`;
75
+ }, f = document.createElement("div");
76
+ f.className = "gengage-qna-input-actions", f.dataset.gengagePart = "qna-input-actions";
77
+ const m = document.createElement("button");
78
+ m.className = "gengage-qna-icon-btn gengage-qna-clear gengage-qna-icon-btn--hidden", m.type = "button", m.dataset.gengagePart = "qna-clear", m.setAttribute("aria-label", "Clear question"), m.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 6L6 18" /><path d="M6 6L18 18" /></svg>';
79
+ const g = document.createElement("button");
80
+ g.className = "gengage-qna-icon-btn gengage-qna-send gengage-qna-icon-btn--hidden", g.type = "button", g.dataset.gengagePart = "qna-send", g.setAttribute("aria-label", t.sendQuestionAriaLabel ?? "Send question"), g.disabled = !0, g.innerHTML = `<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M22 2L11 13" /><path d="M22 2L15 22L11 13L2 9L22 2Z" /></svg><span class="gengage-qna-sr-only">${t.ctaLabel ?? t.sendButtonText ?? "Ask"}</span>`;
75
81
  const y = () => {
76
- const d = o.value.trim().length > 0;
77
- f.classList.toggle("gengage-qna-icon-btn--hidden", !d), p.classList.toggle("gengage-qna-icon-btn--hidden", !d), p.classList.toggle("gengage-qna-send--active", d), p.disabled = !d;
78
- }, b = () => {
79
- const d = o.value.trim();
82
+ const d = i.value.trim().length > 0;
83
+ m.classList.toggle("gengage-qna-icon-btn--hidden", !d), g.classList.toggle("gengage-qna-icon-btn--hidden", !d), g.classList.toggle("gengage-qna-send--active", d), g.disabled = !d;
84
+ }, _ = () => {
85
+ const d = i.value.trim();
80
86
  d && (t.onSubmit({
81
87
  title: d,
82
88
  type: "user_message",
83
89
  payload: d
84
- }), o.value = "", y(), g());
90
+ }), i.value = "", y(), p());
85
91
  };
86
- return f.addEventListener("click", () => {
87
- o.value = "", y(), o.focus({ preventScroll: !0 });
88
- }), p.addEventListener("click", b), o.addEventListener("focus", () => {
89
- r = !0, u(), o.placeholder = "";
90
- }), o.addEventListener("blur", () => {
91
- r = !1, o.value.trim().length === 0 && (o.placeholder = l), g();
92
- }), o.addEventListener("input", () => {
93
- if (y(), o.value.trim().length > 0) {
92
+ return m.addEventListener("click", () => {
93
+ i.value = "", y(), i.focus({ preventScroll: !0 });
94
+ }), g.addEventListener("click", _), i.addEventListener("focus", () => {
95
+ r = !0, u(), i.placeholder = "";
96
+ }), i.addEventListener("blur", () => {
97
+ r = !1, i.value.trim().length === 0 && (i.placeholder = l), p();
98
+ }), i.addEventListener("input", () => {
99
+ if (y(), i.value.trim().length > 0) {
94
100
  u();
95
101
  return;
96
102
  }
97
- o.placeholder = r ? "" : l, g();
98
- }), o.addEventListener("keydown", (d) => {
99
- d.key === "Enter" && (d.preventDefault(), b()), d.key === "Escape" && o.value.length > 0 && (o.value = "", y(), g());
100
- }), h.appendChild(f), h.appendChild(p), n.appendChild(o), n.appendChild(h), e.appendChild(n), y(), g(), e._cleanup = () => {
103
+ i.placeholder = r ? "" : l, p();
104
+ }), i.addEventListener("keydown", (d) => {
105
+ d.key === "Enter" && (d.preventDefault(), _()), d.key === "Escape" && i.value.length > 0 && (i.value = "", y(), p());
106
+ }), f.appendChild(m), f.appendChild(g), n.appendChild(i), n.appendChild(f), e.appendChild(n), y(), p(), e._cleanup = () => {
101
107
  u();
102
108
  }, e;
103
109
  }
104
110
  function v(t, e) {
105
111
  if (!t || typeof t != "object") return null;
106
- const n = t, o = n.type;
107
- if (typeof o != "string" || o.length === 0) return null;
108
- const i = n.title, a = n.payload, l = typeof i == "string" && i.length > 0 ? i : e;
112
+ const n = t, i = n.type;
113
+ if (typeof i != "string" || i.length === 0) return null;
114
+ const o = n.title, a = n.payload, l = typeof o == "string" && o.length > 0 ? o : e;
109
115
  if (!l) return null;
110
116
  const s = {
111
117
  title: l,
112
- type: o
118
+ type: i
113
119
  };
114
120
  return a !== void 0 && (s.payload = a), s;
115
121
  }
@@ -121,13 +127,13 @@ function E(t) {
121
127
  return t.payload !== void 0 && (e.payload = t.payload), e;
122
128
  }
123
129
  function C(t, e) {
124
- const n = [], o = t.props?.actions;
125
- if (Array.isArray(o)) for (const l of o) {
130
+ const n = [], i = t.props?.actions;
131
+ if (Array.isArray(i)) for (const l of i) {
126
132
  const s = v(l);
127
133
  s && n.push(s);
128
134
  }
129
- const i = t.props?.buttons;
130
- if (Array.isArray(i)) for (const l of i) {
135
+ const o = t.props?.buttons;
136
+ if (Array.isArray(o)) for (const l of o) {
131
137
  if (!l || typeof l != "object") continue;
132
138
  const s = l, c = typeof s.label == "string" ? s.label : void 0, r = v(s.action, c);
133
139
  r && n.push(r);
@@ -141,128 +147,128 @@ function C(t, e) {
141
147
  const a = /* @__PURE__ */ new Set();
142
148
  return n.filter((l) => a.has(l.title) ? !1 : (a.add(l.title), !0));
143
149
  }
144
- var L = {
150
+ var I = {
145
151
  ButtonRow: ({ element: t, spec: e, context: n }) => {
146
- const o = C(t, e).map(E), i = t.props?.orientation, a = {
147
- actions: o,
152
+ const i = C(t, e).map(E), o = t.props?.orientation, a = {
153
+ actions: i,
148
154
  onAction: n.onAction,
149
155
  defaultCtaText: n.i18n.defaultCtaText,
150
156
  quickQuestionsAriaLabel: n.i18n.quickQuestionsAriaLabel
151
157
  };
152
- return n.onOpenChat !== void 0 && (a.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (a.ctaText = n.ctaText), (i === "horizontal" || i === "vertical") && (a.orientation = i), T(a);
158
+ return n.onOpenChat !== void 0 && (a.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (a.ctaText = n.ctaText), (o === "horizontal" || o === "vertical") && (a.orientation = o), A(a);
153
159
  },
154
160
  ActionButtons: ({ element: t, spec: e, context: n }) => {
155
- const o = {
161
+ const i = {
156
162
  actions: C(t, e).map(E),
157
163
  onAction: n.onAction,
158
164
  defaultCtaText: n.i18n.defaultCtaText,
159
165
  quickQuestionsAriaLabel: n.i18n.quickQuestionsAriaLabel
160
166
  };
161
- return n.onOpenChat !== void 0 && (o.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (o.ctaText = n.ctaText), T(o);
167
+ return n.onOpenChat !== void 0 && (i.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (i.ctaText = n.ctaText), A(i);
162
168
  },
163
169
  ActionButton: ({ element: t, context: e }) => {
164
170
  const n = document.createElement("button");
165
171
  n.className = "gengage-qna-button gds-chip", n.type = "button", n.dataset.gengagePart = "qna-action-button";
166
- const o = t.props?.label;
167
- typeof o == "string" ? n.textContent = o : n.textContent = e.i18n.defaultCtaText;
168
- const i = v(t.props?.action, typeof o == "string" ? o : void 0);
169
- return i && n.addEventListener("click", () => e.onAction(i)), n;
172
+ const i = t.props?.label;
173
+ typeof i == "string" ? n.textContent = i : n.textContent = e.i18n.defaultCtaText;
174
+ const o = v(t.props?.action, typeof i == "string" ? i : void 0);
175
+ return o && n.addEventListener("click", () => e.onAction(o)), n;
170
176
  },
171
177
  TextInput: ({ element: t, context: e }) => {
172
- const n = t.props?.placeholder, o = typeof n == "string" || Array.isArray(n) ? n : e.inputPlaceholder, i = typeof t.props?.ctaLabel == "string" ? t.props.ctaLabel : void 0, a = {
178
+ const n = t.props?.placeholder, i = typeof n == "string" || Array.isArray(n) ? n : e.inputPlaceholder, o = typeof t.props?.ctaLabel == "string" ? t.props.ctaLabel : void 0, a = {
173
179
  onSubmit: e.onAction,
174
180
  askQuestionAriaLabel: e.i18n.askQuestionAriaLabel,
175
181
  defaultInputPlaceholder: e.i18n.defaultInputPlaceholder,
176
182
  sendButtonText: e.i18n.sendButton,
177
183
  sendQuestionAriaLabel: e.i18n.sendQuestionAriaLabel
178
184
  };
179
- return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i), G(a);
185
+ return i !== void 0 && (a.placeholders = i), o !== void 0 && (a.ctaLabel = o), $(a);
180
186
  },
181
187
  QuestionHeading: ({ element: t, context: e }) => {
182
188
  const n = document.createElement("h3");
183
189
  n.className = "gengage-qna-heading", n.dataset.gengagePart = "qna-heading";
184
- const o = t.props?.text, i = e.headingTitleOverride;
185
- return n.textContent = typeof i == "string" && i.trim().length > 0 ? i : typeof o == "string" ? o : "", n;
190
+ const i = t.props?.text, o = e.headingTitleOverride;
191
+ return n.textContent = typeof o == "string" && o.trim().length > 0 ? o : typeof i == "string" ? i : "", n;
186
192
  },
187
193
  ProductCard: () => null
188
- }, S = ({ element: t, renderElement: e }) => {
194
+ }, L = ({ element: t, renderElement: e }) => {
189
195
  if (!t.children || t.children.length === 0) return null;
190
196
  const n = document.createElement("div");
191
- for (const o of t.children) {
192
- const i = e(o);
193
- i && n.appendChild(i);
197
+ for (const i of t.children) {
198
+ const o = e(i);
199
+ o && n.appendChild(o);
194
200
  }
195
201
  return n;
196
202
  };
197
- function J() {
198
- return { ...L };
203
+ function G() {
204
+ return { ...I };
199
205
  }
200
- function V(t, e, n = L, o = S) {
201
- return Q({
206
+ function J(t, e, n = I, i = L) {
207
+ return x({
202
208
  spec: t,
203
209
  context: e,
204
210
  registry: n,
205
211
  containerClassName: "gengage-qna-uispec",
206
- unknownRenderer: o
212
+ unknownRenderer: i
207
213
  });
208
214
  }
209
- function Y(t) {
215
+ function V(t) {
210
216
  if (!t) return;
211
217
  const e = t.extra;
212
218
  if (e && typeof e == "object" && !Array.isArray(e)) {
213
- const o = e.visible_skus ?? e.visibleSkus;
214
- if (Array.isArray(o)) {
215
- const i = o.filter((a) => typeof a == "string" && a.trim().length > 0).map((a) => a.trim()).slice(0, 200);
216
- if (i.length > 0) return i;
219
+ const i = e.visible_skus ?? e.visibleSkus;
220
+ if (Array.isArray(i)) {
221
+ const o = i.filter((a) => typeof a == "string" && a.trim().length > 0).map((a) => a.trim()).slice(0, 200);
222
+ if (o.length > 0) return o;
217
223
  }
218
224
  }
219
225
  const n = typeof t.sku == "string" && t.sku.trim() ? t.sku.trim() : void 0;
220
226
  return n ? [n] : void 0;
221
227
  }
222
- function P(t, e) {
228
+ function S(t, e) {
223
229
  if (!t) return null;
224
230
  const n = t.action;
225
231
  if (!n || typeof n != "object") return null;
226
- const o = n, i = o.type;
227
- if (typeof i != "string" || i.length === 0) return null;
228
- const a = o.title, l = typeof a == "string" && a.length > 0 ? a : typeof e == "string" && e.length > 0 ? e : "";
232
+ const i = n, o = i.type;
233
+ if (typeof o != "string" || o.length === 0) return null;
234
+ const a = i.title, l = typeof a == "string" && a.length > 0 ? a : typeof e == "string" && e.length > 0 ? e : "";
229
235
  if (!l) return null;
230
- const s = o.payload, c = {
236
+ const s = i.payload, c = {
231
237
  title: l,
232
- type: i
238
+ type: o
233
239
  };
234
240
  return s !== void 0 && (c.payload = s), c;
235
241
  }
236
- function Z(t, e) {
242
+ function Y(t, e) {
237
243
  const n = t.elements[t.root];
238
244
  if (!n) return !1;
239
- const o = (i) => {
240
- if (i.type !== "ActionButton") return !1;
241
- const a = i.props;
245
+ const i = (o) => {
246
+ if (o.type !== "ActionButton") return !1;
247
+ const a = o.props;
242
248
  if (!a || typeof a != "object") return !1;
243
249
  const l = typeof a.label == "string" ? a.label : void 0;
244
- return l === e ? !0 : P(a, l)?.title === e;
250
+ return l === e ? !0 : S(a, l)?.title === e;
245
251
  };
246
- if (n.type === "ActionButton") return o(n);
247
- if (n.children) for (const i of n.children) {
248
- const a = t.elements[i];
249
- if (a && o(a)) return !0;
252
+ if (n.type === "ActionButton") return i(n);
253
+ if (n.children) for (const o of n.children) {
254
+ const a = t.elements[o];
255
+ if (a && i(a)) return !0;
250
256
  }
251
257
  if (n.type === "ActionButtons" && Array.isArray(n.props?.buttons)) {
252
- for (const i of n.props.buttons)
253
- if (i?.label === e || i?.action?.title === e) return !0;
258
+ for (const o of n.props.buttons)
259
+ if (o?.label === e || o?.action?.title === e) return !0;
254
260
  }
255
261
  return !1;
256
262
  }
257
- var I = 0;
258
- function w() {
259
- return I += 1, `gengage-merge-${I}`;
263
+ var k = 0;
264
+ function P() {
265
+ return k += 1, `gengage-merge-${k}`;
260
266
  }
261
- function K(t, e) {
267
+ function Z(t, e) {
262
268
  const n = t.elements[t.root];
263
269
  if (!n || n.type !== "ButtonRow") return;
264
- const o = w();
265
- t.elements[o] = {
270
+ const i = P();
271
+ t.elements[i] = {
266
272
  type: "ActionButton",
267
273
  props: {
268
274
  label: e.title,
@@ -272,13 +278,13 @@ function K(t, e) {
272
278
  ...e.payload !== void 0 ? { payload: e.payload } : {}
273
279
  }
274
280
  }
275
- }, n.children = n.children ? [o, ...n.children] : [o];
281
+ }, n.children = n.children ? [i, ...n.children] : [i];
276
282
  }
277
- function X(t, e) {
283
+ function K(t, e) {
278
284
  const n = t.elements[t.root];
279
285
  if (!n || n.type !== "ActionButtons") return;
280
- const o = w();
281
- t.elements[o] = {
286
+ const i = P();
287
+ t.elements[i] = {
282
288
  type: "ActionButton",
283
289
  props: {
284
290
  label: e.title,
@@ -288,8 +294,8 @@ function X(t, e) {
288
294
  ...e.payload !== void 0 ? { payload: e.payload } : {}
289
295
  }
290
296
  }
291
- }, n.children = n.children ? [o, ...n.children] : [o];
292
- const i = n.props?.buttons ?? [], a = {
297
+ }, n.children = n.children ? [i, ...n.children] : [i];
298
+ const o = n.props?.buttons ?? [], a = {
293
299
  label: e.title,
294
300
  action: {
295
301
  title: e.title,
@@ -299,21 +305,21 @@ function X(t, e) {
299
305
  };
300
306
  n.props = {
301
307
  ...n.props,
302
- buttons: [a, ...i]
308
+ buttons: [a, ...o]
303
309
  };
304
310
  }
305
- function ee(t) {
311
+ function X(t) {
306
312
  const e = {}, n = [];
307
- for (let o = 0; o < t.length; o++) {
308
- const i = t[o], a = `action-${o}`;
313
+ for (let i = 0; i < t.length; i++) {
314
+ const o = t[i], a = `action-${i}`;
309
315
  n.push(a), e[a] = {
310
316
  type: "ActionButton",
311
317
  props: {
312
- label: i.title,
318
+ label: o.title,
313
319
  action: {
314
- title: i.title,
315
- type: i.type,
316
- ...i.payload !== void 0 ? { payload: i.payload } : {}
320
+ title: o.title,
321
+ type: o.type,
322
+ ...o.payload !== void 0 ? { payload: o.payload } : {}
317
323
  }
318
324
  }
319
325
  };
@@ -326,43 +332,45 @@ function ee(t) {
326
332
  elements: e
327
333
  };
328
334
  }
329
- function te(t) {
335
+ function tt(t) {
330
336
  return t.find((e) => {
331
337
  const n = e.elements[e.root];
332
338
  return n?.type === "ActionButtons" || n?.type === "ButtonRow";
333
339
  });
334
340
  }
335
- function k(t, e) {
336
- const n = t.productContextQuickPillLabel, o = { text: n };
337
- return e && e.length > 0 && (o.sku_list = e), {
341
+ function et(t, e) {
342
+ const n = t.productContextQuickPillLabel, i = { text: n };
343
+ return e && e.length > 0 && (i.sku_list = e), {
338
344
  title: n,
339
345
  type: "user_message",
340
- payload: o
346
+ payload: i
341
347
  };
342
348
  }
343
- function ne(t, e, n) {
344
- const o = n?.skuList, i = [], a = [];
349
+ function nt(t, e, n) {
350
+ const i = n?.skuList;
351
+ let o = !1;
352
+ const a = [];
345
353
  for (const c of t) {
346
354
  const r = c.elements[c.root];
347
355
  if (r?.type === "ActionButton") {
348
356
  const u = r.props;
349
- if (P(u, typeof u?.label == "string" ? u.label : void 0)?.type === "findSimilar") {
350
- i.push(k(e, o));
357
+ if (S(u, typeof u?.label == "string" ? u.label : void 0)?.type === "findSimilar") {
358
+ o = !0;
351
359
  continue;
352
360
  }
353
361
  }
354
362
  a.push(c);
355
363
  }
356
- if (i.length === 0) return t;
357
- const l = k(e, o), s = te(a);
358
- if (!s) return [...a, ee([l])];
359
- if (!Z(s, l.title)) {
364
+ if (!o) return t;
365
+ const l = et(e, i), s = tt(a);
366
+ if (!s) return [...a, X([l])];
367
+ if (!Y(s, l.title)) {
360
368
  const c = s.elements[s.root];
361
- c?.type === "ActionButtons" ? X(s, l) : c?.type === "ButtonRow" && K(s, l);
369
+ c?.type === "ActionButtons" ? K(s, l) : c?.type === "ButtonRow" && Z(s, l);
362
370
  }
363
371
  return a;
364
372
  }
365
- var B = {
373
+ var w = {
366
374
  quickQuestionsAriaLabel: "Hızlı sorular",
367
375
  askQuestionAriaLabel: "Soru sorun",
368
376
  defaultInputPlaceholder: "Bir soru sorun...",
@@ -371,7 +379,7 @@ var B = {
371
379
  defaultCtaText: "Başka bir şey sor",
372
380
  redirectingToChat: "Sohbete yönlendiriliyor...",
373
381
  productContextQuickPillLabel: "Bu ürün hakkında ne bilmeliyim?"
374
- }, oe = {
382
+ }, it = {
375
383
  quickQuestionsAriaLabel: "Quick questions",
376
384
  askQuestionAriaLabel: "Ask a question",
377
385
  defaultInputPlaceholder: "Ask a question...",
@@ -381,25 +389,25 @@ var B = {
381
389
  redirectingToChat: "Redirecting to chat...",
382
390
  productContextQuickPillLabel: "What should I know about this product?"
383
391
  };
384
- function ie(t) {
392
+ function ot(t) {
385
393
  return t ? t.toLowerCase().split("-")[0] ?? "tr" : "tr";
386
394
  }
387
- function ae(t) {
388
- return ie(t) === "en" ? oe : B;
395
+ function at(t) {
396
+ return ot(t) === "en" ? it : w;
389
397
  }
390
- var se = class extends D {
398
+ var st = class extends W {
391
399
  constructor(...t) {
392
- super(...t), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = B, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
400
+ super(...t), this._abortController = null, this._debounceTimer = null, this._dispatchTimers = /* @__PURE__ */ new Set(), this._contentEl = null, this._i18n = w, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
393
401
  }
394
402
  async onInit(t) {
395
- this._i18n = this._resolveI18n(t), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = A(t.locale);
403
+ this._i18n = this._resolveI18n(t), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = q(t.locale);
396
404
  const e = this._createChrome(t);
397
405
  if (e) {
398
- const o = document.createElement("div");
399
- o.className = "gengage-qna-chrome-widget", o.dataset.gengagePart = "qna-chrome-widget", o.appendChild(this._contentEl), e.appendChild(o), this.root.appendChild(e);
406
+ const i = document.createElement("div");
407
+ i.className = "gengage-qna-chrome-widget", i.dataset.gengagePart = "qna-chrome-widget", i.appendChild(this._contentEl), e.appendChild(i), this.root.appendChild(e);
400
408
  } else this.root.appendChild(this._contentEl);
401
409
  const n = t.pageContext?.sku;
402
- n && (this._lastSku = n, await this._fetchAndRender(n)), F("qna");
410
+ n && (this._lastSku = n, await this._fetchAndRender(n)), M("qna");
403
411
  }
404
412
  onUpdate(t) {
405
413
  const e = t.sku;
@@ -415,7 +423,9 @@ var se = class extends D {
415
423
  onHide() {
416
424
  }
417
425
  onDestroy() {
418
- this._abort(), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null), this._contentEl && (this._cleanupTextInputTimers(), this._contentEl.remove(), this._contentEl = null);
426
+ this._abort(), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null);
427
+ for (const t of this._dispatchTimers) clearTimeout(t);
428
+ this._dispatchTimers.clear(), this._contentEl && (this._cleanupTextInputTimers(), this._contentEl.remove(), this._contentEl = null);
419
429
  }
420
430
  _abort() {
421
431
  this._abortController?.abort(), this._abortController = null;
@@ -436,22 +446,22 @@ var se = class extends D {
436
446
  this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
437
447
  const e = this._createLoadingIndicator();
438
448
  this._contentEl.appendChild(e);
439
- const n = { middlewareUrl: this.config.middlewareUrl }, o = z({
449
+ const n = { middlewareUrl: this.config.middlewareUrl }, i = z({
440
450
  source: "qna",
441
451
  locale: this.config.locale
442
452
  });
443
453
  try {
444
- const i = this.config.session?.sessionId ?? "", a = {
454
+ const o = this.config.session?.sessionId ?? "", a = {
445
455
  account_id: this.config.accountId,
446
- session_id: i,
447
- correlation_id: i,
456
+ session_id: o,
457
+ correlation_id: o,
448
458
  sku: t,
449
- locale: A(this.config.locale)
459
+ locale: q(this.config.locale)
450
460
  };
451
461
  this.config.session?.userId !== void 0 && (a.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (a.view_id = this.config.session.viewId);
452
462
  const l = this.config.pageContext?.pageType;
453
463
  l !== void 0 && (a.page_type = l);
454
- const s = await $(a, n, this._abortController.signal);
464
+ const s = await D(a, n, this._abortController.signal);
455
465
  if (!this._contentEl) return;
456
466
  this._contentEl.innerHTML = "";
457
467
  const c = document.createElement("div");
@@ -461,30 +471,30 @@ var se = class extends D {
461
471
  const d = document.createElement("h3");
462
472
  d.className = "gengage-qna-heading", d.textContent = u, c.appendChild(d);
463
473
  }
464
- const m = this.config.inputPlaceholder;
465
- let g;
466
- if (m !== !0) g = m ?? this._i18n.defaultInputPlaceholder;
474
+ const h = this.config.inputPlaceholder;
475
+ let p;
476
+ if (h !== !0) p = h ?? this._i18n.defaultInputPlaceholder;
467
477
  else if (s.actions.length > 0) {
468
- const d = s.actions.filter((_) => _.type === "user_message" || _.title.includes("?")).map((_) => _.title);
469
- g = d.length > 0 ? d : this._i18n.defaultInputPlaceholder;
470
- } else g = this._i18n.defaultInputPlaceholder;
471
- const h = {
478
+ const d = s.actions.filter((b) => b.type === "user_message" || typeof b.title == "string" && b.title.includes("?")).map((b) => b.title);
479
+ p = d.length > 0 ? d : this._i18n.defaultInputPlaceholder;
480
+ } else p = this._i18n.defaultInputPlaceholder;
481
+ const f = {
472
482
  onAction: this._actionHandler,
473
483
  i18n: this._i18n
474
- }, f = this._resolvedQnaHeaderTitle();
475
- f !== void 0 && (h.headingTitleOverride = f), this.config.hideButtonRowCta || (h.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (h.ctaText = this.config.ctaText)), g !== void 0 && (h.inputPlaceholder = g);
476
- const p = this._buildFallbackActionsSpec(s.actions), y = Y(this.config.pageContext), b = (s.uiSpecs.length > 0 ? ne(s.uiSpecs, this._i18n, { skuList: y }) : [p]).filter((d) => Object.keys(d.elements).length > 0);
477
- for (const d of b) {
478
- const _ = this._renderUISpec(d, h);
479
- c.appendChild(_);
484
+ }, m = this._resolvedQnaHeaderTitle();
485
+ m !== void 0 && (f.headingTitleOverride = m), this.config.hideButtonRowCta || (f.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (f.ctaText = this.config.ctaText)), p !== void 0 && (f.inputPlaceholder = p);
486
+ const g = this._buildFallbackActionsSpec(s.actions), y = V(this.config.pageContext), _ = (s.uiSpecs.length > 0 ? nt(s.uiSpecs, this._i18n, { skuList: y }) : [g]).filter((d) => Object.keys(d.elements).length > 0);
487
+ for (const d of _) {
488
+ const b = this._renderUISpec(d, f);
489
+ c.appendChild(b);
480
490
  }
481
- b.length > 0 && M("qna"), this._specIncludesType(b, "TextInput") || this._insertStandaloneInputBeforePills(c, h, g);
482
- } catch (i) {
483
- if (i instanceof DOMException && i.name === "AbortError") return;
484
- if (q("gengage:global:error", {
491
+ _.length > 0 && U("qna"), this._specIncludesType(_, "TextInput") || this._insertStandaloneInputBeforePills(c, f, p);
492
+ } catch (o) {
493
+ if (o instanceof DOMException && o.name === "AbortError") return;
494
+ if (this._lastSku = void 0, T("gengage:global:error", {
485
495
  source: "qna",
486
496
  code: "FETCH_ERROR",
487
- message: W(this.config.locale, i)
497
+ message: F(this.config.locale, o)
488
498
  }), this._contentEl) {
489
499
  this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
490
500
  const a = document.createElement("div");
@@ -497,7 +507,7 @@ var se = class extends D {
497
507
  c !== void 0 && (s.headingTitleOverride = c), this.config.ctaText !== void 0 && (s.ctaText = this.config.ctaText), this._appendStandaloneInput(s, l, a);
498
508
  }
499
509
  } finally {
500
- o();
510
+ i();
501
511
  }
502
512
  }
503
513
  _createLoadingIndicator() {
@@ -511,49 +521,49 @@ var se = class extends D {
511
521
  }
512
522
  _resolveI18n(t) {
513
523
  return {
514
- ...ae(t.locale),
524
+ ...at(t.locale),
515
525
  ...t.i18n
516
526
  };
517
527
  }
518
528
  _createChrome(t) {
519
529
  const e = t.chrome;
520
530
  if (!e) return null;
521
- const n = typeof e.title == "string" ? e.title.trim() : "", o = typeof e.subtitle == "string" ? e.subtitle.trim() : "", i = typeof e.startButtonLabel == "string" ? e.startButtonLabel.trim() : "", a = typeof e.imageUrl == "string" ? e.imageUrl.trim() : "", l = typeof e.imagePadding == "string" ? e.imagePadding.trim() : "", s = document.createElement("section");
531
+ const n = typeof e.title == "string" ? e.title.trim() : "", i = typeof e.subtitle == "string" ? e.subtitle.trim() : "", o = typeof e.startButtonLabel == "string" ? e.startButtonLabel.trim() : "", a = typeof e.imageUrl == "string" ? e.imageUrl.trim() : "", l = typeof e.imagePadding == "string" ? e.imagePadding.trim() : "", s = document.createElement("section");
522
532
  s.className = "gengage-qna-chrome", s.dataset.gengagePart = "qna-chrome", e.layout === "side-image" && (s.classList.add("gengage-qna-chrome--side-image"), s.dataset.gengageChromeLayout = "side-image"), l && s.style.setProperty("--gengage-qna-chrome-image-padding", l);
523
533
  const c = document.createElement("div");
524
534
  if (c.className = "gengage-qna-chrome-copy", c.dataset.gengagePart = "qna-chrome-copy", n) {
525
535
  const r = document.createElement("h2");
526
536
  r.className = "gengage-qna-chrome-title", r.dataset.gengagePart = "qna-chrome-title", r.textContent = n, c.appendChild(r);
527
537
  }
528
- if (o) {
538
+ if (i) {
529
539
  const r = document.createElement("p");
530
- r.className = "gengage-qna-chrome-subtitle", r.dataset.gengagePart = "qna-chrome-subtitle", r.textContent = o, c.appendChild(r);
540
+ r.className = "gengage-qna-chrome-subtitle", r.dataset.gengagePart = "qna-chrome-subtitle", r.textContent = i, c.appendChild(r);
531
541
  }
532
- if (c.children.length > 0 && s.appendChild(c), a && U(a)) {
542
+ if (c.children.length > 0 && s.appendChild(c), a && O(a)) {
533
543
  const r = document.createElement("img");
534
544
  r.className = "gengage-qna-chrome-image", r.dataset.gengagePart = "qna-chrome-image", r.src = a, r.alt = typeof e.imageAlt == "string" ? e.imageAlt : "", r.loading = "lazy", r.addEventListener("error", () => {
535
545
  r.style.display = "none";
536
546
  }, { once: !0 }), s.appendChild(r);
537
547
  }
538
- if (i) {
548
+ if (o) {
539
549
  const r = document.createElement("button");
540
- r.className = "gengage-qna-chrome-start", r.dataset.gengagePart = "qna-chrome-start", r.type = "button", r.textContent = i, r.addEventListener("click", () => this._handleOpenChat()), s.appendChild(r);
550
+ r.className = "gengage-qna-chrome-start", r.dataset.gengagePart = "qna-chrome-start", r.type = "button", r.textContent = o, r.addEventListener("click", () => this._handleOpenChat()), s.appendChild(r);
541
551
  }
542
552
  return s.children.length === 0 ? null : s;
543
553
  }
544
554
  _resolveUISpecRegistry() {
545
- return N(J(), this.config.renderer?.registry);
555
+ return R(G(), this.config.renderer?.registry);
546
556
  }
547
557
  _renderUISpec(t, e) {
548
- const n = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? S, i = (l, s) => V(l, s, n, o), a = this.config.renderer?.renderUISpec;
558
+ const n = this._resolveUISpecRegistry(), i = this.config.renderer?.unknownRenderer ?? L, o = (l, s) => J(l, s, n, i), a = this.config.renderer?.renderUISpec;
549
559
  return a ? a(t, e, {
550
560
  registry: n,
551
- unknownRenderer: o,
552
- defaultRender: i
553
- }) : i(t, e);
561
+ unknownRenderer: i,
562
+ defaultRender: o
563
+ }) : o(t, e);
554
564
  }
555
565
  _specIncludesType(t, e) {
556
- for (const n of t) for (const o of Object.values(n.elements)) if (o.type === e) return !0;
566
+ for (const n of t) for (const i of Object.values(n.elements)) if (i.type === e) return !0;
557
567
  return !1;
558
568
  }
559
569
  _buildFallbackActionsSpec(t) {
@@ -562,16 +572,16 @@ var se = class extends D {
562
572
  elements: {}
563
573
  };
564
574
  const e = {}, n = [];
565
- for (let o = 0; o < t.length; o++) {
566
- const i = t[o], a = `action-${o}`;
575
+ for (let i = 0; i < t.length; i++) {
576
+ const o = t[i], a = `action-${i}`;
567
577
  n.push(a), e[a] = {
568
578
  type: "ActionButton",
569
579
  props: {
570
- label: i.title,
580
+ label: o.title,
571
581
  action: {
572
- title: i.title,
573
- type: i.type,
574
- payload: i.payload
582
+ title: o.title,
583
+ type: o.type,
584
+ payload: o.payload
575
585
  }
576
586
  }
577
587
  };
@@ -585,13 +595,13 @@ var se = class extends D {
585
595
  };
586
596
  }
587
597
  _insertStandaloneInputBeforePills(t, e, n) {
588
- const o = {
598
+ const i = {
589
599
  root: "root",
590
600
  elements: { root: {
591
601
  type: "TextInput",
592
602
  props: { placeholder: n }
593
603
  } }
594
- }, i = this._renderUISpec(o, e), a = i.querySelector(".gengage-qna-input-wrapper");
604
+ }, o = this._renderUISpec(i, e), a = o.querySelector(".gengage-qna-input-wrapper");
595
605
  if (!a) return;
596
606
  const l = t.querySelector(".gengage-qna-uispec"), s = t.querySelector(".gengage-qna-uispec > .gengage-qna-buttons"), c = this.config.inputAfterPills === !0;
597
607
  if (s) c ? s.insertAdjacentElement("afterend", a) : s.insertAdjacentElement("beforebegin", a);
@@ -599,27 +609,35 @@ var se = class extends D {
599
609
  const r = l.querySelector(":scope > .gengage-qna-heading");
600
610
  !c && r ? r.insertAdjacentElement("afterend", a) : l.appendChild(a);
601
611
  } else {
602
- t.appendChild(i);
612
+ t.appendChild(o);
603
613
  return;
604
614
  }
605
- i.remove();
615
+ o.remove();
606
616
  }
607
617
  _appendStandaloneInput(t, e, n) {
608
618
  if (!this._contentEl) return;
609
- const o = {
619
+ const i = {
610
620
  root: "root",
611
621
  elements: { root: {
612
622
  type: "TextInput",
613
623
  props: { placeholder: e }
614
624
  } }
615
- }, i = this._renderUISpec(o, t);
616
- (n ?? this._contentEl).appendChild(i);
625
+ }, o = this._renderUISpec(i, t);
626
+ (n ?? this._contentEl).appendChild(o);
617
627
  }
618
628
  _handleAction(t) {
619
- this._showTransitionIndicator(), j(t.title, t.type), this.config.onActionSelected?.(t), setTimeout(() => q("gengage:qna:action", t), 350);
629
+ this._showTransitionIndicator(), j(t.title, t.type), this.config.onActionSelected?.(t);
630
+ const e = setTimeout(() => {
631
+ this._dispatchTimers.delete(e), this._contentEl && T("gengage:qna:action", t);
632
+ }, 350);
633
+ this._dispatchTimers.add(e);
620
634
  }
621
635
  _handleOpenChat() {
622
- this._showTransitionIndicator(), this.config.onOpenChat?.(), setTimeout(() => q("gengage:qna:open-chat", {}), 350);
636
+ this._showTransitionIndicator(), this.config.onOpenChat?.();
637
+ const t = setTimeout(() => {
638
+ this._dispatchTimers.delete(t), this._contentEl && T("gengage:qna:open-chat", {});
639
+ }, 350);
640
+ this._dispatchTimers.add(t);
623
641
  }
624
642
  _showTransitionIndicator() {
625
643
  if (!this._contentEl) return;
@@ -630,13 +648,13 @@ var se = class extends D {
630
648
  }, 600);
631
649
  }
632
650
  };
633
- function pe() {
634
- return new se();
651
+ function pt() {
652
+ return new st();
635
653
  }
636
654
  export {
637
- V as a,
638
- S as i,
639
- pe as n,
640
- J as r,
641
- se as t
655
+ J as a,
656
+ L as i,
657
+ pt as n,
658
+ G as r,
659
+ st as t
642
660
  };