@gengage/assistant-fe 0.4.10 → 0.4.12
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.
- package/dist/{api-paths-DR5bPNhi.js → api-paths-BX3Lea3A.js} +1 -1
- package/dist/chat/runtime.d.ts +4 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +51 -51
- package/dist/chat.js +1 -1
- package/dist/{common-CKbrDUKx.js → common-CP5HKBAf.js} +2 -2
- package/dist/common.js +5 -5
- package/dist/{connection-warning-ecZqpczd.js → connection-warning-C7ehvQxx.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/native.iife.js +18 -18
- package/dist/{pill-launcher-DSEeJT9h.js → pill-launcher-D9ITHv5w.js} +1 -1
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +1 -1
- package/dist/{runtime-BsZZ8zTg.js → runtime-CLcYqzoA.js} +3 -3
- package/dist/{runtime-SKDvc0Xc.js → runtime-CN3nY1qp.js} +3 -3
- package/dist/{runtime-CIfT45il.js → runtime-CYN4ZmHO.js} +1709 -1680
- package/dist/{simbut-Bw3vBFtW.js → simbut-3kqLW3SM.js} +1 -1
- package/dist/simbut.iife.js +12 -12
- package/dist/simbut.js +1 -1
- package/dist/{simrel-DJZ983BF.js → simrel-fQg2EIB8.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +1 -1
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-2-B1Ch5I.js → widget-base-bdJaGJYi.js} +25 -22
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as m } from "./widget-base-
|
|
1
|
+
import { t as m } from "./widget-base-bdJaGJYi.js";
|
|
2
2
|
import { A as h, D as u, _ as f, j as p, v as b } from "./context-DGz5F81j.js";
|
|
3
3
|
import { t as _ } from "./locale-CfqNifrU.js";
|
|
4
4
|
var g = { findSimilarLabel: "Benzerlerini Bul" }, y = { findSimilarLabel: "Find Similar" };
|
package/dist/simbut.iife.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
(function(m){Object.defineProperty(m,Symbol.toStringTag,{value:"Module"});function I(e,t){const i={event_name:"metering.summary",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(i.view_id=e.view_id),e.user_id!==void 0&&(i.user_id=e.user_id),e.page_type!==void 0&&(i.page_type=e.page_type),e.sku!==void 0&&(i.sku=e.sku),i}function k(e,t){const i={event_name:"checkout.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(i.view_id=e.view_id),e.user_id!==void 0&&(i.user_id=e.user_id),e.page_type!==void 0&&(i.page_type=e.page_type),e.sku!==void 0&&(i.sku=e.sku),i}function T(e,t){const i={event_name:"checkout.complete",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(i.view_id=e.view_id),e.user_id!==void 0&&(i.user_id=e.user_id),e.page_type!==void 0&&(i.page_type=e.page_type),e.sku!==void 0&&(i.sku=e.sku),i}var _=["http:","https:"];function L(e){const t=e.trim();if(!t)return!1;if(t.startsWith("/")&&!t.startsWith("//"))return!0;try{return _.includes(new URL(t).protocol)}catch{return!1}}function F(e){if(e.startsWith("/")&&!e.startsWith("//"))return!0;try{const t=new URL(e);return _.includes(t.protocol)}catch{return!1}}function M(){return typeof window<"u"&&Array.isArray(window.dataLayer)}function p(e,t){const i={event:e,...t};M()&&window.dataLayer.push(i)}function U(e){p("gengage-on-init",{gengage_widget:e})}function $(e,t){p("gengage-suggested-question",{gengage_question_title:e,gengage_action_type:t})}function N(e){p("gengage-find-similars",{gengage_sku:e})}function y(e,t){const i=n=>{t(n.detail)};return window.addEventListener(e,i),()=>window.removeEventListener(e,i)}function R(){const e=window.__gengageSessionId??sessionStorage.getItem("gengage_session_id")??null??crypto.randomUUID();return window.__gengageSessionId=e,sessionStorage.setItem("gengage_session_id",e),window.gengage||(window.gengage={}),window.gengage.sessionId=e,e}function A(e){return{sessionId:e?.sessionId??R(),...e}}var v={"--gengage-chat-offset":"20px","--gengage-chat-launcher-
|
|
2
|
-
#${
|
|
1
|
+
(function(m){Object.defineProperty(m,Symbol.toStringTag,{value:"Module"});function I(e,t){const i={event_name:"metering.summary",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(i.view_id=e.view_id),e.user_id!==void 0&&(i.user_id=e.user_id),e.page_type!==void 0&&(i.page_type=e.page_type),e.sku!==void 0&&(i.sku=e.sku),i}function k(e,t){const i={event_name:"checkout.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(i.view_id=e.view_id),e.user_id!==void 0&&(i.user_id=e.user_id),e.page_type!==void 0&&(i.page_type=e.page_type),e.sku!==void 0&&(i.sku=e.sku),i}function T(e,t){const i={event_name:"checkout.complete",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(i.view_id=e.view_id),e.user_id!==void 0&&(i.user_id=e.user_id),e.page_type!==void 0&&(i.page_type=e.page_type),e.sku!==void 0&&(i.sku=e.sku),i}var _=["http:","https:"];function L(e){const t=e.trim();if(!t)return!1;if(t.startsWith("/")&&!t.startsWith("//"))return!0;try{return _.includes(new URL(t).protocol)}catch{return!1}}function F(e){if(e.startsWith("/")&&!e.startsWith("//"))return!0;try{const t=new URL(e);return _.includes(t.protocol)}catch{return!1}}function M(){return typeof window<"u"&&Array.isArray(window.dataLayer)}function p(e,t){const i={event:e,...t};M()&&window.dataLayer.push(i)}function U(e){p("gengage-on-init",{gengage_widget:e})}function $(e,t){p("gengage-suggested-question",{gengage_question_title:e,gengage_action_type:t})}function N(e){p("gengage-find-similars",{gengage_sku:e})}function y(e,t){const i=n=>{t(n.detail)};return window.addEventListener(e,i),()=>window.removeEventListener(e,i)}function R(){const e=window.__gengageSessionId??sessionStorage.getItem("gengage_session_id")??null??crypto.randomUUID();return window.__gengageSessionId=e,sessionStorage.setItem("gengage_session_id",e),window.gengage||(window.gengage={}),window.gengage.sessionId=e,e}function A(e){return{sessionId:e?.sessionId??R(),...e}}var v={"--gengage-chat-offset":"20px","--gengage-chat-launcher-width":"56px","--gengage-chat-launcher-height":"56px","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"72px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"1200px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"12px","--gengage-simrel-card-radius":"0.75rem","--radius-control":"12px","--radius-card":"16px","--radius-panel":"24px","--radius-pill":"999px","--surface-card-muted":"#f8fafc","--text-secondary":"#4b5563","--text-muted":"#6b7280","--border-default":"rgba(17, 24, 39, 0.10)"};function B(e){if(!e)return{...v};const t={...v,...e},i=e["--gengage-chat-launcher-size"];return i!==void 0&&(e["--gengage-chat-launcher-width"]===void 0&&(t["--gengage-chat-launcher-width"]=i),e["--gengage-chat-launcher-height"]===void 0&&(t["--gengage-chat-launcher-height"]=i)),t}var d={primaryColor:"#b7102a",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#111827",borderRadius:"0.75rem",fontFamily:'"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#f8f9fa","--root-wrapper-border-color":"#edeeef","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"72px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"1200px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"0.75rem","--gengage-simrel-card-radius":"0.75rem","--client-primary":"#b7102a","--client-primary-hover":"color-mix(in srgb, #b7102a 88%, black 12%)","--client-primary-active":"color-mix(in srgb, #b7102a 78%, black 22%)","--client-primary-subtle":"color-mix(in srgb, #b7102a 12%, white)","--client-primary-soft":"color-mix(in srgb, #b7102a 20%, white)","--client-on-primary":"#ffffff","--client-focus-ring":"color-mix(in srgb, #b7102a 32%, transparent)","--surface-page":"#f6f7fb","--surface-shell":"#10131a","--surface-card":"#ffffff","--surface-card-muted":"#f8fafc","--surface-card-soft":"#f8fafc","--surface-elevated":"#ffffff","--surface-input":"#ffffff","--surface-overlay":"rgba(16, 19, 26, 0.52)","--text-primary":"#111827","--text-secondary":"#4b5563","--text-muted":"#6b7280","--text-inverse":"#f9fafb","--border-subtle":"rgba(17, 24, 39, 0.06)","--border-default":"rgba(17, 24, 39, 0.10)","--border-strong":"rgba(17, 24, 39, 0.18)","--shadow-1":"0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06)","--shadow-2":"0 4px 12px rgba(16, 24, 40, 0.08)","--shadow-3":"0 10px 24px rgba(16, 24, 40, 0.12)","--radius-control":"12px","--radius-card":"16px","--radius-panel":"24px","--radius-pill":"999px","--success":"#16a34a","--warning":"#d97706","--error":"#dc2626","--info":"#2563eb","--rating":"#f5b301","--ai-accent-start":"#0b24d6","--ai-accent-end":"#f768f2","--ai-accent-soft":"linear-gradient(135deg, rgba(11, 36, 214, 0.08), rgba(247, 104, 242, 0.08))"},c="gengage-global-toast-root",w="gengage-global-toast-style",b="gengage-global-toast-root--visible",D=4200,W=1500,P=15e3,V=["--gengage-font-family","--surface-card","--text-primary","--text-muted","--border-default","--radius-card","--shadow-3","--error","--ds-toast-error-bg","--ds-toast-error-border","--ds-toast-error-accent","--ds-toast-error-fg","--ds-toast-error-shadow"],x=!1,l=null;function O(){x||typeof window>"u"||typeof document>"u"||(x=!0,y("gengage:global:error",e=>{q(e)}))}function q(e){if(typeof document>"u")return;const t=e.message.trim();if(!t)return;J();const i=z();Y(i),i.innerHTML="";const n=document.createElement("section");n.className="gengage-global-toast gengage-global-toast--error",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");const s=document.createElement("div");s.className="gengage-global-toast-title",s.textContent=G(e.source);const r=document.createElement("div");r.className="gengage-global-toast-message",r.textContent=t,n.appendChild(s),n.appendChild(r),i.appendChild(n),i.classList.add(b),l&&(clearTimeout(l),l=null),e.sticky!==!0&&(l=setTimeout(()=>{H()},j(e.durationMs)))}function H(){if(typeof document>"u")return;const e=document.getElementById(c);e&&(e.classList.remove(b),e.innerHTML="",l&&(clearTimeout(l),l=null))}function G(e){switch(e){case"chat":return"Chat warning";case"qna":return"QnA warning";case"simrel":return"Widget warning";default:return"Connection warning"}}function z(){const e=document.getElementById(c);if(e instanceof HTMLElement)return e;const t=document.createElement("div");return t.id=c,t.className="gengage-global-toast-root",document.body.appendChild(t),t}function Y(e){if(typeof document>"u"||typeof window>"u")return;const t=document.querySelector(".gengage-chat-root, .gengage-qna-container, .gengage-simrel-container, .gengage-simbut-root");if(!t)return;const i=window.getComputedStyle(t);for(const n of V){const s=i.getPropertyValue(n).trim();s?e.style.setProperty(n,s):e.style.removeProperty(n)}}function j(e){return typeof e!="number"||!Number.isFinite(e)?D:Math.min(P,Math.max(W,Math.round(e)))}function J(){if(document.getElementById(w))return;const e=document.createElement("style");e.id=w;const t=d["--surface-card"]??d.backgroundColor??"#ffffff",i=d["--text-primary"]??d.foregroundColor??"#111827",n=d["--border-default"]??"rgba(17, 24, 39, 0.10)",s=d["--error"]??"#dc2626",r=d["--shadow-3"]??"0 10px 24px rgba(16, 24, 40, 0.12)",g=d["--radius-card"]??"16px",o=d["--text-muted"]??"#6b7280";e.textContent=`
|
|
2
|
+
#${c} {
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 16px;
|
|
5
5
|
right: 16px;
|
|
6
6
|
z-index: 2147483646;
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
}
|
|
9
|
-
#${
|
|
9
|
+
#${c}.${b} {
|
|
10
10
|
pointer-events: auto;
|
|
11
11
|
}
|
|
12
|
-
#${
|
|
12
|
+
#${c} .gengage-global-toast {
|
|
13
13
|
min-width: 260px;
|
|
14
14
|
max-width: min(92vw, 420px);
|
|
15
15
|
border-radius: var(--radius-card, ${g});
|
|
16
|
-
border: 1px solid var(--ds-toast-error-border, color-mix(in srgb, var(--error, ${
|
|
17
|
-
border-left: 4px solid var(--ds-toast-error-accent, var(--error, ${
|
|
18
|
-
background: var(--ds-toast-error-bg, color-mix(in srgb, var(--error, ${
|
|
19
|
-
color: var(--ds-toast-error-fg, color-mix(in srgb, var(--error, ${
|
|
20
|
-
box-shadow: var(--ds-toast-error-shadow, var(--shadow-3, ${
|
|
16
|
+
border: 1px solid var(--ds-toast-error-border, color-mix(in srgb, var(--error, ${s}) 18%, var(--border-default, ${n})));
|
|
17
|
+
border-left: 4px solid var(--ds-toast-error-accent, var(--error, ${s}));
|
|
18
|
+
background: var(--ds-toast-error-bg, color-mix(in srgb, var(--error, ${s}) 5%, var(--surface-card, ${t})));
|
|
19
|
+
color: var(--ds-toast-error-fg, color-mix(in srgb, var(--error, ${s}) 22%, var(--text-primary, ${i})));
|
|
20
|
+
box-shadow: var(--ds-toast-error-shadow, var(--shadow-3, ${r}));
|
|
21
21
|
padding: 10px 12px;
|
|
22
22
|
font-family: var(--gengage-font-family, ${JSON.stringify(d.fontFamily??'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif')});
|
|
23
23
|
font-size: 13px;
|
|
24
24
|
line-height: 1.4;
|
|
25
25
|
animation: gengage-global-toast-in 180ms ease-out forwards;
|
|
26
26
|
}
|
|
27
|
-
#${
|
|
27
|
+
#${c} .gengage-global-toast-title {
|
|
28
28
|
margin: 0 0 4px;
|
|
29
29
|
font-size: 12px;
|
|
30
30
|
font-weight: 700;
|
|
31
31
|
color: var(--text-muted, ${o});
|
|
32
32
|
}
|
|
33
|
-
#${
|
|
33
|
+
#${c} .gengage-global-toast-message {
|
|
34
34
|
margin: 0;
|
|
35
35
|
font-weight: 500;
|
|
36
36
|
}
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
transform: translateY(0);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`,document.head.appendChild(e)}var f=null;function K(){if(f!==null)return f;try{f=localStorage.getItem("gengage:debug")==="1"}catch{f=!1}return f}function S(e,t,i){if(!K())return;const n=[`[gengage:${e}]`,t];i!==void 0&&n.push(i),console.debug(...n)}var Q=class{constructor(){this.isVisible=!1,this.isInitialised=!1,this._handlers=new Map,this._cleanups=[],this._ownsRoot=!1,this._destroying=!1}async init(e){if(this.isInitialised){console.warn("[gengage] Widget already initialised. Call update() instead.");return}const t=B(e.theme);this.config={...e,theme:t,session:A(e.session)},this.root=this._resolveMount(e.mountTarget),this._applyTheme(t),O();const i=y("gengage:context:update",n=>this.update(n));this._cleanups.push(i),S("lifecycle",`${this.constructor.name}.init`,{accountId:e.accountId,sku:e.pageContext?.sku});try{await this.onInit(this.config)}catch(n){throw this.destroy(),n}this._destroying||(this.isInitialised=!0,S("lifecycle",`${this.constructor.name} ready`),this.emit("ready"))}update(e){this.isInitialised&&(this.config.pageContext?this.config={...this.config,pageContext:{...this.config.pageContext,...e}}:e.pageType!==void 0&&(this.config={...this.config,pageContext:e}),this.onUpdate(e),this.emit("context-update",this.config.pageContext))}show(){this.isVisible||(this.isVisible=!0,this.root.style.display="",this.onShow(),this.emit("show"))}hide(){this.isVisible&&(this.isVisible=!1,this.root.style.display="none",this.onHide(),this.emit("hide"))}destroy(){this._destroying||(this._destroying=!0,this.emit("destroy"),this._cleanups.forEach(e=>e()),this._cleanups.length=0,this._handlers.clear(),this.onDestroy(),this.config.analyticsClient?.destroy(),this._cleanupRoot(),this.isInitialised=!1)}_cleanupRoot(){this._ownsRoot?this.root.remove():this.root.innerHTML=""}on(e,t){return this._handlers.has(e)||this._handlers.set(e,new Set),this._handlers.get(e).add(t),()=>this._handlers.get(e)?.delete(t)}trackCheckout(e,t){const i=e==="start"?k:T;this.track(i(this.analyticsContext(),t))}flushMeteringSummary(e){this.track(I(this.analyticsContext(),e))}emit(e,...t){this._handlers.get(e)?.forEach(i=>i(...t))}addCleanup(e){this._cleanups.push(e)}track(e){this.config.analyticsClient?.track(e)}analyticsContext(){const e={account_id:this.config.accountId,session_id:this.config.session?.sessionId??"",correlation_id:this.config.session?.sessionId??""};return this.config.session?.viewId!==void 0&&(e.view_id=this.config.session.viewId),this.config.session?.userId!==void 0&&(e.user_id=this.config.session.userId),this.config.pageContext?.pageType!==void 0&&(e.page_type=this.config.pageContext.pageType),this.config.pageContext?.sku!==void 0&&(e.sku=this.config.pageContext.sku),this.config.session?.abTestVariant!==void 0&&(e.ab_test_variant=this.config.session.abTestVariant),this.config.session?.abTestExperimentId!==void 0&&(e.ab_test_experiment_id=this.config.session.abTestExperimentId),e}_resolveMount(e){if(e instanceof HTMLElement)return e;if(typeof e=="string"){const i=document.querySelector(e);if(!i)throw new Error(`[gengage] Mount target not found: "${e}"`);return i}const t=document.createElement("div");return t.dataset.gengageWidget=this.constructor.name.toLowerCase(),document.body.insertBefore(t,document.body.firstChild),this._ownsRoot=!0,t}_applyTheme(e){if(e){for(const[t,i]of Object.entries(e))if(i!==void 0){const n=t.startsWith("--")?t:`--gengage-${X(t)}`;this.root.style.setProperty(n,i)}}}};function X(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Z(e){const t=e?.trim();return t||"tr"}var C={findSimilarLabel:"Benzerlerini Bul"},ee={findSimilarLabel:"Find Similar"};function te(e,t){return t?.findSimilarLabel?t.findSimilarLabel:(e??"tr").toLowerCase().startsWith("en")?ee.findSimilarLabel:C.findSimilarLabel}function h(e){const t=typeof e.sku=="string"&&e.sku.length>0?e.sku:void 0,i=typeof e.pageContext?.sku=="string"&&e.pageContext.sku.length>0?e.pageContext.sku:void 0;return t??i}var E=class extends Q{constructor(...e){super(...e),this._button=null,this._inlineFrame=null,this._label=C.findSimilarLabel}async onInit(e){this._label=te(e.locale,e.i18n);const t=e.layout??"overlay";this.root.classList.add("gengage-simbut-root"),this.root.classList.toggle("gengage-simbut-root--overlay",t==="overlay"),this.root.classList.toggle("gengage-simbut-root--inline-card",t==="inline-card"),t==="overlay"&&window.getComputedStyle(this.root).position==="static"&&(this.root.style.position="relative");const i=document.createElement("button");i.type="button",i.className="gengage-chat-find-similar-pill",i.lang=Z(e.locale),i.textContent=this._label,this._button=i;const n=()=>{i.disabled=!(h(this.config)&&(this.config.onFindSimilar||this.config.chat))};if(i.addEventListener("click",
|
|
47
|
+
`,document.head.appendChild(e)}var f=null;function K(){if(f!==null)return f;try{f=localStorage.getItem("gengage:debug")==="1"}catch{f=!1}return f}function S(e,t,i){if(!K())return;const n=[`[gengage:${e}]`,t];i!==void 0&&n.push(i),console.debug(...n)}var Q=class{constructor(){this.isVisible=!1,this.isInitialised=!1,this._handlers=new Map,this._cleanups=[],this._ownsRoot=!1,this._destroying=!1}async init(e){if(this.isInitialised){console.warn("[gengage] Widget already initialised. Call update() instead.");return}const t=B(e.theme);this.config={...e,theme:t,session:A(e.session)},this.root=this._resolveMount(e.mountTarget),this._applyTheme(t),O();const i=y("gengage:context:update",n=>this.update(n));this._cleanups.push(i),S("lifecycle",`${this.constructor.name}.init`,{accountId:e.accountId,sku:e.pageContext?.sku});try{await this.onInit(this.config)}catch(n){throw this.destroy(),n}this._destroying||(this.isInitialised=!0,S("lifecycle",`${this.constructor.name} ready`),this.emit("ready"))}update(e){this.isInitialised&&(this.config.pageContext?this.config={...this.config,pageContext:{...this.config.pageContext,...e}}:e.pageType!==void 0&&(this.config={...this.config,pageContext:e}),this.onUpdate(e),this.emit("context-update",this.config.pageContext))}show(){this.isVisible||(this.isVisible=!0,this.root.style.display="",this.onShow(),this.emit("show"))}hide(){this.isVisible&&(this.isVisible=!1,this.root.style.display="none",this.onHide(),this.emit("hide"))}destroy(){this._destroying||(this._destroying=!0,this.emit("destroy"),this._cleanups.forEach(e=>e()),this._cleanups.length=0,this._handlers.clear(),this.onDestroy(),this.config.analyticsClient?.destroy(),this._cleanupRoot(),this.isInitialised=!1)}_cleanupRoot(){this._ownsRoot?this.root.remove():this.root.innerHTML=""}on(e,t){return this._handlers.has(e)||this._handlers.set(e,new Set),this._handlers.get(e).add(t),()=>this._handlers.get(e)?.delete(t)}trackCheckout(e,t){const i=e==="start"?k:T;this.track(i(this.analyticsContext(),t))}flushMeteringSummary(e){this.track(I(this.analyticsContext(),e))}emit(e,...t){this._handlers.get(e)?.forEach(i=>i(...t))}addCleanup(e){this._cleanups.push(e)}track(e){this.config.analyticsClient?.track(e)}analyticsContext(){const e={account_id:this.config.accountId,session_id:this.config.session?.sessionId??"",correlation_id:this.config.session?.sessionId??""};return this.config.session?.viewId!==void 0&&(e.view_id=this.config.session.viewId),this.config.session?.userId!==void 0&&(e.user_id=this.config.session.userId),this.config.pageContext?.pageType!==void 0&&(e.page_type=this.config.pageContext.pageType),this.config.pageContext?.sku!==void 0&&(e.sku=this.config.pageContext.sku),this.config.session?.abTestVariant!==void 0&&(e.ab_test_variant=this.config.session.abTestVariant),this.config.session?.abTestExperimentId!==void 0&&(e.ab_test_experiment_id=this.config.session.abTestExperimentId),e}_resolveMount(e){if(e instanceof HTMLElement)return e;if(typeof e=="string"){const i=document.querySelector(e);if(!i)throw new Error(`[gengage] Mount target not found: "${e}"`);return i}const t=document.createElement("div");return t.dataset.gengageWidget=this.constructor.name.toLowerCase(),document.body.insertBefore(t,document.body.firstChild),this._ownsRoot=!0,t}_applyTheme(e){if(e){for(const[t,i]of Object.entries(e))if(i!==void 0){const n=t.startsWith("--")?t:`--gengage-${X(t)}`;this.root.style.setProperty(n,i)}}}};function X(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Z(e){const t=e?.trim();return t||"tr"}var C={findSimilarLabel:"Benzerlerini Bul"},ee={findSimilarLabel:"Find Similar"};function te(e,t){return t?.findSimilarLabel?t.findSimilarLabel:(e??"tr").toLowerCase().startsWith("en")?ee.findSimilarLabel:C.findSimilarLabel}function h(e){const t=typeof e.sku=="string"&&e.sku.length>0?e.sku:void 0,i=typeof e.pageContext?.sku=="string"&&e.pageContext.sku.length>0?e.pageContext.sku:void 0;return t??i}var E=class extends Q{constructor(...e){super(...e),this._button=null,this._inlineFrame=null,this._label=C.findSimilarLabel}async onInit(e){this._label=te(e.locale,e.i18n);const t=e.layout??"overlay";this.root.classList.add("gengage-simbut-root"),this.root.classList.toggle("gengage-simbut-root--overlay",t==="overlay"),this.root.classList.toggle("gengage-simbut-root--inline-card",t==="inline-card"),t==="overlay"&&window.getComputedStyle(this.root).position==="static"&&(this.root.style.position="relative");const i=document.createElement("button");i.type="button",i.className="gengage-chat-find-similar-pill",i.lang=Z(e.locale),i.textContent=this._label,this._button=i;const n=()=>{i.disabled=!(h(this.config)&&(this.config.onFindSimilar||this.config.chat))};if(i.addEventListener("click",s=>{s.stopPropagation();const r=h(this.config);if(!r)return;const g=this.config.imageUrl,o=typeof g=="string"&&F(g)?g:void 0;if($(this._label,"findSimilar"),N(r),this.config.onFindSimilar){this.config.onFindSimilar(o?{sku:r,imageUrl:o}:{sku:r});return}const u=this.config.chat;if(!u)return;const a={title:this._label,type:"findSimilar",payload:o?{sku:r,image_url:o}:{sku:r}};u.openWithAction(a,{sku:r})}),t==="inline-card"){const s=this._createInlineCard(e,i);this._inlineFrame=s,this.root.appendChild(s)}else this.root.appendChild(i);n(),U("simbut")}_createInlineCard(e,t){const i=e.inlineCard,n=typeof i?.title=="string"?i.title.trim():"",s=typeof i?.description=="string"?i.description.trim():"",r=typeof i?.imageUrl=="string"?i.imageUrl.trim():"",g=document.createElement("section");g.className="gengage-simbut-inline-card",g.dataset.gengagePart="simbut-inline-card";const o=document.createElement("div");if(o.className="gengage-simbut-inline-copy",o.dataset.gengagePart="simbut-inline-copy",n){const a=document.createElement("h4");a.className="gengage-simbut-inline-title",a.dataset.gengagePart="simbut-inline-title",a.textContent=n,o.appendChild(a)}if(s){const a=document.createElement("p");a.className="gengage-simbut-inline-description",a.dataset.gengagePart="simbut-inline-description",a.textContent=s,o.appendChild(a)}o.children.length>0&&g.appendChild(o);const u=document.createElement("div");if(u.className="gengage-simbut-inline-action",u.dataset.gengagePart="simbut-inline-action",u.appendChild(t),g.appendChild(u),r&&L(r)){const a=document.createElement("img");a.className="gengage-simbut-inline-image",a.dataset.gengagePart="simbut-inline-image",a.src=r,a.alt=typeof i?.imageAlt=="string"?i.imageAlt:"",a.loading="lazy",a.addEventListener("error",()=>{a.style.display="none"},{once:!0}),g.appendChild(a)}return g}onUpdate(e){if(!this._button)return;const t=!!h(this.config)&&(!!this.config.onFindSimilar||!!this.config.chat);this._button.disabled=!t}hide(){this.isVisible&&(this.isVisible=!1,this._inlineFrame&&(this._inlineFrame.style.display="none"),this._button&&(this._button.style.display="none"),this.onHide(),this.emit("hide"))}show(){this.isVisible||(this.isVisible=!0,this._inlineFrame&&(this._inlineFrame.style.display=""),this._button&&(this._button.style.display=""),this.onShow(),this.emit("show"))}_cleanupRoot(){}onShow(){}onHide(){}onDestroy(){this._inlineFrame?.remove(),this._inlineFrame=null,this._button?.remove(),this._button=null}setChat(e){if(this.config.chat=e,this._button){const t=!!h(this.config)&&(!!this.config.onFindSimilar||!!this.config.chat);this._button.disabled=!t}}};function ie(){return new E}m.GengageSimBut=E,m.createSimButWidget=ie})(this.Gengage=this.Gengage||{});
|
package/dist/simbut.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A, j as S } from "./context-DGz5F81j.js";
|
|
2
2
|
import { n as $, t as _ } from "./price-formatter-xI3g9Cd4.js";
|
|
3
3
|
import { a as C, c as f, n as q, o as h, t as k, u as H } from "./schemas-CLo8wCjs.js";
|
|
4
|
-
import { o as j } from "./runtime-
|
|
4
|
+
import { o as j } from "./runtime-CLcYqzoA.js";
|
|
5
5
|
var V = {
|
|
6
6
|
images: [
|
|
7
7
|
"images",
|
package/dist/simrel-runtime.js
CHANGED
package/dist/simrel.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(F){Object.defineProperty(F,Symbol.toStringTag,{value:"Module"});var Jr=({element:e,renderElement:t})=>{if(!e.children||e.children.length===0)return null;const r=document.createElement("div");for(const n of e.children){const o=t(n);o&&r.appendChild(o)}return r};function Wr(e){const t=document.createElement("div");if(t.className=e.containerClassName,!e.spec.elements[e.spec.root])return t;const r=e.unknownRenderer??Jr,n=i=>{const s=e.spec.elements[i];if(!s)return null;const a=e.registry[s.type];return a?a({elementId:i,element:s,spec:e.spec,context:e.context,renderElement:n}):r({elementId:i,element:s,spec:e.spec,context:e.context,renderElement:n})},o=n(e.spec.root);return o&&t.appendChild(o),t}function Hr(e,t){if(!t)return e;const r={...e};for(const[n,o]of Object.entries(t))o&&(r[n]=o);return r}function Kr(e,t){const r={event_name:"stream.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{endpoint:t.endpoint,request_id:t.request_id}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function ot(e,t){const r={event_name:"stream.done",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,latency_ms:t.latency_ms,chunk_count:t.chunk_count}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function Yr(e,t){const r={event_name:"stream.error",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,error_code:t.error_code,error_message:t.error_message}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function Xr(e,t){const r={event_name:"metering.summary",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function it(e,t){const r={event_name:"widget.history.snapshot",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.widget,payload:{message_count:t.message_count,history_ref:t.history_ref,redaction_level:t.redaction_level}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function Qr(e,t){const r={event_name:"basket.add",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items,sku:t.sku}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function en(e,t){const r={event_name:"checkout.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function tn(e,t){const r={event_name:"checkout.complete",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}var rn=new Set(["p","br","a","strong","b","em","i","u","ul","ol","li","h1","h2","h3","h4","h5","h6","span","div","table","thead","tbody","tr","th","td","hr","code","pre","blockquote","img","sup","sub"]),nn=new Set(["script","iframe","object","embed","form","input","textarea","select","button","style","link","meta","template","noscript"]),st={"*":new Set(["class"]),a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),div:new Set(["style"]),span:new Set(["style"]),p:new Set(["style"])};function on(e){return/^\s*javascript\s*:/i.test(e)}var sn=new Set(["color","background-color","font-size","font-weight","font-style","font-family","text-align","text-decoration","line-height","letter-spacing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-top","border-right","border-bottom","border-left","border-radius","border-color","border-width","border-style","width","max-width","min-width","height","max-height","min-height","display","vertical-align","white-space","word-break","overflow","opacity","visibility","list-style","list-style-type","text-transform","text-indent","text-overflow","box-sizing","flex","flex-direction","flex-wrap","justify-content","align-items","gap"]),an=/url\s*\(|expression\s*\(|javascript\s*:|\bimport\b|-moz-binding|behavior\s*:/i;function cn(e){const t=[];for(const r of e.split(";")){const n=r.trim();if(!n)continue;const o=n.indexOf(":");if(o===-1)continue;const i=n.slice(0,o).trim().toLowerCase(),s=n.slice(o+1).trim();sn.has(i)&&(an.test(s)||t.push(n))}return t.join("; ")}function xe(e,t){if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){e.parentNode?.removeChild(e);return}const r=e,n=r.tagName.toLowerCase();if(nn.has(n)){r.parentNode?.removeChild(r);return}if(!rn.has(n)){const c=Array.from(r.childNodes);for(const u of c)t.insertBefore(u,r);t.removeChild(r);for(const u of c)xe(u,t);return}const o=st["*"]??new Set,i=st[n]??new Set,s=Array.from(r.attributes);for(const c of s){const u=c.name.toLowerCase();if(!o.has(u)&&!i.has(u)){r.removeAttribute(c.name);continue}if(on(c.value)){r.removeAttribute(c.name);continue}if(u==="style"){const l=cn(c.value);l?r.setAttribute("style",l):r.removeAttribute("style");continue}}if(n==="a"){const c=r.getAttribute("href");if(c!==null){const u=c.trim().toLowerCase();!u.startsWith("http://")&&!u.startsWith("https://")&&!u.startsWith("mailto:")&&r.removeAttribute("href")}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer")}if(n==="img"){const c=r.getAttribute("src");c!==null&&(c.trim().toLowerCase().startsWith("https://")||r.removeAttribute("src"))}const a=Array.from(r.childNodes);for(const c of a)xe(c,r)}var at=["http:","https:"];function he(e){const t=e.trim();if(!t)return!1;if(t.startsWith("/")&&!t.startsWith("//"))return!0;try{return at.includes(new URL(t).protocol)}catch{return!1}}function ct(e){if(e.startsWith("/")&&!e.startsWith("//"))return!0;try{const t=new URL(e);return at.includes(t.protocol)}catch{return!1}}function un(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html").body,r=Array.from(t.childNodes);for(const n of r)xe(n,t);return t.innerHTML}function ln(){return typeof window<"u"&&Array.isArray(window.dataLayer)}function Oe(e,t){const r={event:e,...t};ln()&&window.dataLayer.push(r)}function dn(e){Oe("gengage-on-init",{gengage_widget:e})}function ut(e){Oe("gengage-show",{gengage_widget:e})}function fn(e,t){Oe("gengage-cart-add",{gengage_sku:e,gengage_quantity:t})}function oe(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!1}))}function lt(e,t){const r=n=>{t(n.detail)};return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}function pn(){const e=window.__gengageSessionId??sessionStorage.getItem("gengage_session_id")??null??crypto.randomUUID();return window.__gengageSessionId=e,sessionStorage.setItem("gengage_session_id",e),window.gengage||(window.gengage={}),window.gengage.sessionId=e,e}function gn(e){return{sessionId:e?.sessionId??pn(),...e}}var dt={"--gengage-chat-offset":"20px","--gengage-chat-launcher-size":"56px","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"72px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"1200px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"12px","--gengage-simrel-card-radius":"0.75rem","--radius-control":"12px","--radius-card":"16px","--radius-panel":"24px","--radius-pill":"999px","--surface-card-muted":"#f8fafc","--text-secondary":"#4b5563","--text-muted":"#6b7280","--border-default":"rgba(17, 24, 39, 0.10)"};function mn(e){return e?{...dt,...e}:{...dt}}var R={primaryColor:"#b7102a",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#111827",borderRadius:"0.75rem",fontFamily:'"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#f8f9fa","--root-wrapper-border-color":"#edeeef","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"72px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"1200px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"0.75rem","--gengage-simrel-card-radius":"0.75rem","--client-primary":"#b7102a","--client-primary-hover":"color-mix(in srgb, #b7102a 88%, black 12%)","--client-primary-active":"color-mix(in srgb, #b7102a 78%, black 22%)","--client-primary-subtle":"color-mix(in srgb, #b7102a 12%, white)","--client-primary-soft":"color-mix(in srgb, #b7102a 20%, white)","--client-on-primary":"#ffffff","--client-focus-ring":"color-mix(in srgb, #b7102a 32%, transparent)","--surface-page":"#f6f7fb","--surface-shell":"#10131a","--surface-card":"#ffffff","--surface-card-muted":"#f8fafc","--surface-card-soft":"#f8fafc","--surface-elevated":"#ffffff","--surface-input":"#ffffff","--surface-overlay":"rgba(16, 19, 26, 0.52)","--text-primary":"#111827","--text-secondary":"#4b5563","--text-muted":"#6b7280","--text-inverse":"#f9fafb","--border-subtle":"rgba(17, 24, 39, 0.06)","--border-default":"rgba(17, 24, 39, 0.10)","--border-strong":"rgba(17, 24, 39, 0.18)","--shadow-1":"0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06)","--shadow-2":"0 4px 12px rgba(16, 24, 40, 0.08)","--shadow-3":"0 10px 24px rgba(16, 24, 40, 0.12)","--radius-control":"12px","--radius-card":"16px","--radius-panel":"24px","--radius-pill":"999px","--success":"#16a34a","--warning":"#d97706","--error":"#dc2626","--info":"#2563eb","--rating":"#f5b301","--ai-accent-start":"#0b24d6","--ai-accent-end":"#f768f2","--ai-accent-soft":"linear-gradient(135deg, rgba(11, 36, 214, 0.08), rgba(247, 104, 242, 0.08))"},B="gengage-global-toast-root",ft="gengage-global-toast-style",Le="gengage-global-toast-root--visible",hn=4200,_n=1500,yn=15e3,vn=["--gengage-font-family","--surface-card","--text-primary","--text-muted","--border-default","--radius-card","--shadow-3","--error","--ds-toast-error-bg","--ds-toast-error-border","--ds-toast-error-accent","--ds-toast-error-fg","--ds-toast-error-shadow"],pt=!1,H=null,bn=[/failed to fetch/i,/networkerror/i,/network request failed/i,/load failed/i,/err_network/i,/fetch failed/i,/network error/i];function gt(e){return typeof e=="string"&&e.toLowerCase().startsWith("tr")}function wn(e){if(typeof navigator<"u"&&navigator.onLine===!1)return!0;const t=e instanceof Error?e.message.trim():"";return t?bn.some(r=>r.test(t)):!1}function kn(e,t){return wn(t)?gt(e)?"Bağlantı sorunu oluştu. Lütfen tekrar deneyin.":"Connection issue. Please try again.":gt(e)?"Bir hata oluştu. Lütfen tekrar deneyin.":"Something went wrong. Please try again."}function Cn(){pt||typeof window>"u"||typeof document>"u"||(pt=!0,lt("gengage:global:error",e=>{Ze(e)}))}function Ze(e){if(typeof document>"u")return;const t=e.message.trim();if(!t)return;In();const r=En();zn(r),r.innerHTML="";const n=document.createElement("section");n.className="gengage-global-toast gengage-global-toast--error",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");const o=document.createElement("div");o.className="gengage-global-toast-title",o.textContent=Sn(e.source);const i=document.createElement("div");i.className="gengage-global-toast-message",i.textContent=t,n.appendChild(o),n.appendChild(i),r.appendChild(n),r.classList.add(Le),H&&(clearTimeout(H),H=null),e.sticky!==!0&&(H=setTimeout(()=>{mt()},Tn(e.durationMs)))}function mt(){if(typeof document>"u")return;const e=document.getElementById(B);e&&(e.classList.remove(Le),e.innerHTML="",H&&(clearTimeout(H),H=null))}function Sn(e){switch(e){case"chat":return"Chat warning";case"qna":return"QnA warning";case"simrel":return"Widget warning";default:return"Connection warning"}}function En(){const e=document.getElementById(B);if(e instanceof HTMLElement)return e;const t=document.createElement("div");return t.id=B,t.className="gengage-global-toast-root",document.body.appendChild(t),t}function zn(e){if(typeof document>"u"||typeof window>"u")return;const t=document.querySelector(".gengage-chat-root, .gengage-qna-container, .gengage-simrel-container, .gengage-simbut-root");if(!t)return;const r=window.getComputedStyle(t);for(const n of vn){const o=r.getPropertyValue(n).trim();o?e.style.setProperty(n,o):e.style.removeProperty(n)}}function Tn(e){return typeof e!="number"||!Number.isFinite(e)?hn:Math.min(yn,Math.max(_n,Math.round(e)))}function In(){if(document.getElementById(ft))return;const e=document.createElement("style");e.id=ft;const t=R["--surface-card"]??R.backgroundColor??"#ffffff",r=R["--text-primary"]??R.foregroundColor??"#111827",n=R["--border-default"]??"rgba(17, 24, 39, 0.10)",o=R["--error"]??"#dc2626",i=R["--shadow-3"]??"0 10px 24px rgba(16, 24, 40, 0.12)",s=R["--radius-card"]??"16px",a=R["--text-muted"]??"#6b7280";e.textContent=`
|
|
1
|
+
(function(F){Object.defineProperty(F,Symbol.toStringTag,{value:"Module"});var Jr=({element:e,renderElement:t})=>{if(!e.children||e.children.length===0)return null;const r=document.createElement("div");for(const n of e.children){const o=t(n);o&&r.appendChild(o)}return r};function Wr(e){const t=document.createElement("div");if(t.className=e.containerClassName,!e.spec.elements[e.spec.root])return t;const r=e.unknownRenderer??Jr,n=i=>{const s=e.spec.elements[i];if(!s)return null;const a=e.registry[s.type];return a?a({elementId:i,element:s,spec:e.spec,context:e.context,renderElement:n}):r({elementId:i,element:s,spec:e.spec,context:e.context,renderElement:n})},o=n(e.spec.root);return o&&t.appendChild(o),t}function Hr(e,t){if(!t)return e;const r={...e};for(const[n,o]of Object.entries(t))o&&(r[n]=o);return r}function Kr(e,t){const r={event_name:"stream.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{endpoint:t.endpoint,request_id:t.request_id}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function ot(e,t){const r={event_name:"stream.done",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,latency_ms:t.latency_ms,chunk_count:t.chunk_count}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function Yr(e,t){const r={event_name:"stream.error",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,error_code:t.error_code,error_message:t.error_message}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function Xr(e,t){const r={event_name:"metering.summary",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function it(e,t){const r={event_name:"widget.history.snapshot",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.widget,payload:{message_count:t.message_count,history_ref:t.history_ref,redaction_level:t.redaction_level}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function Qr(e,t){const r={event_name:"basket.add",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items,sku:t.sku}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function en(e,t){const r={event_name:"checkout.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function tn(e,t){const r={event_name:"checkout.complete",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}var rn=new Set(["p","br","a","strong","b","em","i","u","ul","ol","li","h1","h2","h3","h4","h5","h6","span","div","table","thead","tbody","tr","th","td","hr","code","pre","blockquote","img","sup","sub"]),nn=new Set(["script","iframe","object","embed","form","input","textarea","select","button","style","link","meta","template","noscript"]),st={"*":new Set(["class"]),a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),div:new Set(["style"]),span:new Set(["style"]),p:new Set(["style"])};function on(e){return/^\s*javascript\s*:/i.test(e)}var sn=new Set(["color","background-color","font-size","font-weight","font-style","font-family","text-align","text-decoration","line-height","letter-spacing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-top","border-right","border-bottom","border-left","border-radius","border-color","border-width","border-style","width","max-width","min-width","height","max-height","min-height","display","vertical-align","white-space","word-break","overflow","opacity","visibility","list-style","list-style-type","text-transform","text-indent","text-overflow","box-sizing","flex","flex-direction","flex-wrap","justify-content","align-items","gap"]),an=/url\s*\(|expression\s*\(|javascript\s*:|\bimport\b|-moz-binding|behavior\s*:/i;function cn(e){const t=[];for(const r of e.split(";")){const n=r.trim();if(!n)continue;const o=n.indexOf(":");if(o===-1)continue;const i=n.slice(0,o).trim().toLowerCase(),s=n.slice(o+1).trim();sn.has(i)&&(an.test(s)||t.push(n))}return t.join("; ")}function xe(e,t){if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){e.parentNode?.removeChild(e);return}const r=e,n=r.tagName.toLowerCase();if(nn.has(n)){r.parentNode?.removeChild(r);return}if(!rn.has(n)){const c=Array.from(r.childNodes);for(const u of c)t.insertBefore(u,r);t.removeChild(r);for(const u of c)xe(u,t);return}const o=st["*"]??new Set,i=st[n]??new Set,s=Array.from(r.attributes);for(const c of s){const u=c.name.toLowerCase();if(!o.has(u)&&!i.has(u)){r.removeAttribute(c.name);continue}if(on(c.value)){r.removeAttribute(c.name);continue}if(u==="style"){const l=cn(c.value);l?r.setAttribute("style",l):r.removeAttribute("style");continue}}if(n==="a"){const c=r.getAttribute("href");if(c!==null){const u=c.trim().toLowerCase();!u.startsWith("http://")&&!u.startsWith("https://")&&!u.startsWith("mailto:")&&r.removeAttribute("href")}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer")}if(n==="img"){const c=r.getAttribute("src");c!==null&&(c.trim().toLowerCase().startsWith("https://")||r.removeAttribute("src"))}const a=Array.from(r.childNodes);for(const c of a)xe(c,r)}var at=["http:","https:"];function he(e){const t=e.trim();if(!t)return!1;if(t.startsWith("/")&&!t.startsWith("//"))return!0;try{return at.includes(new URL(t).protocol)}catch{return!1}}function ct(e){if(e.startsWith("/")&&!e.startsWith("//"))return!0;try{const t=new URL(e);return at.includes(t.protocol)}catch{return!1}}function un(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html").body,r=Array.from(t.childNodes);for(const n of r)xe(n,t);return t.innerHTML}function ln(){return typeof window<"u"&&Array.isArray(window.dataLayer)}function Oe(e,t){const r={event:e,...t};ln()&&window.dataLayer.push(r)}function dn(e){Oe("gengage-on-init",{gengage_widget:e})}function ut(e){Oe("gengage-show",{gengage_widget:e})}function fn(e,t){Oe("gengage-cart-add",{gengage_sku:e,gengage_quantity:t})}function oe(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!1}))}function lt(e,t){const r=n=>{t(n.detail)};return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}function pn(){const e=window.__gengageSessionId??sessionStorage.getItem("gengage_session_id")??null??crypto.randomUUID();return window.__gengageSessionId=e,sessionStorage.setItem("gengage_session_id",e),window.gengage||(window.gengage={}),window.gengage.sessionId=e,e}function gn(e){return{sessionId:e?.sessionId??pn(),...e}}var dt={"--gengage-chat-offset":"20px","--gengage-chat-launcher-width":"56px","--gengage-chat-launcher-height":"56px","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"72px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"1200px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"12px","--gengage-simrel-card-radius":"0.75rem","--radius-control":"12px","--radius-card":"16px","--radius-panel":"24px","--radius-pill":"999px","--surface-card-muted":"#f8fafc","--text-secondary":"#4b5563","--text-muted":"#6b7280","--border-default":"rgba(17, 24, 39, 0.10)"};function mn(e){if(!e)return{...dt};const t={...dt,...e},r=e["--gengage-chat-launcher-size"];return r!==void 0&&(e["--gengage-chat-launcher-width"]===void 0&&(t["--gengage-chat-launcher-width"]=r),e["--gengage-chat-launcher-height"]===void 0&&(t["--gengage-chat-launcher-height"]=r)),t}var R={primaryColor:"#b7102a",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#111827",borderRadius:"0.75rem",fontFamily:'"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#f8f9fa","--root-wrapper-border-color":"#edeeef","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"72px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"1200px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"0.75rem","--gengage-simrel-card-radius":"0.75rem","--client-primary":"#b7102a","--client-primary-hover":"color-mix(in srgb, #b7102a 88%, black 12%)","--client-primary-active":"color-mix(in srgb, #b7102a 78%, black 22%)","--client-primary-subtle":"color-mix(in srgb, #b7102a 12%, white)","--client-primary-soft":"color-mix(in srgb, #b7102a 20%, white)","--client-on-primary":"#ffffff","--client-focus-ring":"color-mix(in srgb, #b7102a 32%, transparent)","--surface-page":"#f6f7fb","--surface-shell":"#10131a","--surface-card":"#ffffff","--surface-card-muted":"#f8fafc","--surface-card-soft":"#f8fafc","--surface-elevated":"#ffffff","--surface-input":"#ffffff","--surface-overlay":"rgba(16, 19, 26, 0.52)","--text-primary":"#111827","--text-secondary":"#4b5563","--text-muted":"#6b7280","--text-inverse":"#f9fafb","--border-subtle":"rgba(17, 24, 39, 0.06)","--border-default":"rgba(17, 24, 39, 0.10)","--border-strong":"rgba(17, 24, 39, 0.18)","--shadow-1":"0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06)","--shadow-2":"0 4px 12px rgba(16, 24, 40, 0.08)","--shadow-3":"0 10px 24px rgba(16, 24, 40, 0.12)","--radius-control":"12px","--radius-card":"16px","--radius-panel":"24px","--radius-pill":"999px","--success":"#16a34a","--warning":"#d97706","--error":"#dc2626","--info":"#2563eb","--rating":"#f5b301","--ai-accent-start":"#0b24d6","--ai-accent-end":"#f768f2","--ai-accent-soft":"linear-gradient(135deg, rgba(11, 36, 214, 0.08), rgba(247, 104, 242, 0.08))"},B="gengage-global-toast-root",ft="gengage-global-toast-style",Le="gengage-global-toast-root--visible",hn=4200,_n=1500,yn=15e3,vn=["--gengage-font-family","--surface-card","--text-primary","--text-muted","--border-default","--radius-card","--shadow-3","--error","--ds-toast-error-bg","--ds-toast-error-border","--ds-toast-error-accent","--ds-toast-error-fg","--ds-toast-error-shadow"],pt=!1,H=null,bn=[/failed to fetch/i,/networkerror/i,/network request failed/i,/load failed/i,/err_network/i,/fetch failed/i,/network error/i];function gt(e){return typeof e=="string"&&e.toLowerCase().startsWith("tr")}function wn(e){if(typeof navigator<"u"&&navigator.onLine===!1)return!0;const t=e instanceof Error?e.message.trim():"";return t?bn.some(r=>r.test(t)):!1}function kn(e,t){return wn(t)?gt(e)?"Bağlantı sorunu oluştu. Lütfen tekrar deneyin.":"Connection issue. Please try again.":gt(e)?"Bir hata oluştu. Lütfen tekrar deneyin.":"Something went wrong. Please try again."}function Cn(){pt||typeof window>"u"||typeof document>"u"||(pt=!0,lt("gengage:global:error",e=>{Ze(e)}))}function Ze(e){if(typeof document>"u")return;const t=e.message.trim();if(!t)return;In();const r=En();zn(r),r.innerHTML="";const n=document.createElement("section");n.className="gengage-global-toast gengage-global-toast--error",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");const o=document.createElement("div");o.className="gengage-global-toast-title",o.textContent=Sn(e.source);const i=document.createElement("div");i.className="gengage-global-toast-message",i.textContent=t,n.appendChild(o),n.appendChild(i),r.appendChild(n),r.classList.add(Le),H&&(clearTimeout(H),H=null),e.sticky!==!0&&(H=setTimeout(()=>{mt()},Tn(e.durationMs)))}function mt(){if(typeof document>"u")return;const e=document.getElementById(B);e&&(e.classList.remove(Le),e.innerHTML="",H&&(clearTimeout(H),H=null))}function Sn(e){switch(e){case"chat":return"Chat warning";case"qna":return"QnA warning";case"simrel":return"Widget warning";default:return"Connection warning"}}function En(){const e=document.getElementById(B);if(e instanceof HTMLElement)return e;const t=document.createElement("div");return t.id=B,t.className="gengage-global-toast-root",document.body.appendChild(t),t}function zn(e){if(typeof document>"u"||typeof window>"u")return;const t=document.querySelector(".gengage-chat-root, .gengage-qna-container, .gengage-simrel-container, .gengage-simbut-root");if(!t)return;const r=window.getComputedStyle(t);for(const n of vn){const o=r.getPropertyValue(n).trim();o?e.style.setProperty(n,o):e.style.removeProperty(n)}}function Tn(e){return typeof e!="number"||!Number.isFinite(e)?hn:Math.min(yn,Math.max(_n,Math.round(e)))}function In(){if(document.getElementById(ft))return;const e=document.createElement("style");e.id=ft;const t=R["--surface-card"]??R.backgroundColor??"#ffffff",r=R["--text-primary"]??R.foregroundColor??"#111827",n=R["--border-default"]??"rgba(17, 24, 39, 0.10)",o=R["--error"]??"#dc2626",i=R["--shadow-3"]??"0 10px 24px rgba(16, 24, 40, 0.12)",s=R["--radius-card"]??"16px",a=R["--text-muted"]??"#6b7280";e.textContent=`
|
|
2
2
|
#${B} {
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 16px;
|
package/dist/simrel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, i as r, n as t, r as i, t as m } from "./runtime-
|
|
2
|
-
import { n as R, t as n } from "./simrel-
|
|
1
|
+
import { a, i as r, n as t, r as i, t as m } from "./runtime-CLcYqzoA.js";
|
|
2
|
+
import { n as R, t as n } from "./simrel-fQg2EIB8.js";
|
|
3
3
|
export {
|
|
4
4
|
m as GengageSimRel,
|
|
5
5
|
i as createDefaultSimRelUISpecRegistry,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as
|
|
1
|
+
import { o as p, r as y } from "./context-DGz5F81j.js";
|
|
2
2
|
function U(e, i) {
|
|
3
3
|
const t = {
|
|
4
4
|
event_name: "stream.start",
|
|
@@ -100,7 +100,7 @@ function J(e, i) {
|
|
|
100
100
|
};
|
|
101
101
|
return e.view_id !== void 0 && (t.view_id = e.view_id), e.user_id !== void 0 && (t.user_id = e.user_id), e.page_type !== void 0 && (t.page_type = e.page_type), e.sku !== void 0 && (t.sku = e.sku), t;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function w(e, i) {
|
|
104
104
|
const t = {
|
|
105
105
|
event_name: "metering.summary",
|
|
106
106
|
account_id: e.account_id,
|
|
@@ -161,7 +161,7 @@ function Q(e, i) {
|
|
|
161
161
|
};
|
|
162
162
|
return e.view_id !== void 0 && (t.view_id = e.view_id), e.user_id !== void 0 && (t.user_id = e.user_id), e.page_type !== void 0 && (t.page_type = e.page_type), e.sku !== void 0 && (t.sku = e.sku), t;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function b(e, i) {
|
|
165
165
|
const t = {
|
|
166
166
|
event_name: "checkout.start",
|
|
167
167
|
account_id: e.account_id,
|
|
@@ -197,7 +197,8 @@ function k(e, i) {
|
|
|
197
197
|
}
|
|
198
198
|
var _ = {
|
|
199
199
|
"--gengage-chat-offset": "20px",
|
|
200
|
-
"--gengage-chat-launcher-
|
|
200
|
+
"--gengage-chat-launcher-width": "56px",
|
|
201
|
+
"--gengage-chat-launcher-height": "56px",
|
|
201
202
|
"--gengage-chat-width": "400px",
|
|
202
203
|
"--gengage-chat-shell-radius": "1rem",
|
|
203
204
|
"--gengage-chat-header-height": "72px",
|
|
@@ -218,10 +219,12 @@ var _ = {
|
|
|
218
219
|
"--border-default": "rgba(17, 24, 39, 0.10)"
|
|
219
220
|
};
|
|
220
221
|
function E(e) {
|
|
221
|
-
|
|
222
|
+
if (!e) return { ..._ };
|
|
223
|
+
const i = {
|
|
222
224
|
..._,
|
|
223
225
|
...e
|
|
224
|
-
}
|
|
226
|
+
}, t = e["--gengage-chat-launcher-size"];
|
|
227
|
+
return t !== void 0 && (e["--gengage-chat-launcher-width"] === void 0 && (i["--gengage-chat-launcher-width"] = t), e["--gengage-chat-launcher-height"] === void 0 && (i["--gengage-chat-launcher-height"] = t)), i;
|
|
225
228
|
}
|
|
226
229
|
var s = {
|
|
227
230
|
primaryColor: "#b7102a",
|
|
@@ -325,12 +328,12 @@ function q(e) {
|
|
|
325
328
|
function Z(e, i) {
|
|
326
329
|
return q(i) ? l(e) ? "Bağlantı sorunu oluştu. Lütfen tekrar deneyin." : "Connection issue. Please try again." : l(e) ? "Bir hata oluştu. Lütfen tekrar deneyin." : "Something went wrong. Please try again.";
|
|
327
330
|
}
|
|
328
|
-
function
|
|
329
|
-
f || typeof window > "u" || typeof document > "u" || (f = !0,
|
|
330
|
-
|
|
331
|
+
function L() {
|
|
332
|
+
f || typeof window > "u" || typeof document > "u" || (f = !0, p("gengage:global:error", (e) => {
|
|
333
|
+
$(e);
|
|
331
334
|
}));
|
|
332
335
|
}
|
|
333
|
-
function
|
|
336
|
+
function $(e) {
|
|
334
337
|
if (typeof document > "u") return;
|
|
335
338
|
const i = e.message.trim();
|
|
336
339
|
if (!i) return;
|
|
@@ -445,7 +448,7 @@ function V() {
|
|
|
445
448
|
}
|
|
446
449
|
return u;
|
|
447
450
|
}
|
|
448
|
-
function
|
|
451
|
+
function h(e, i, t) {
|
|
449
452
|
if (!V()) return;
|
|
450
453
|
const r = [`[gengage:${e}]`, i];
|
|
451
454
|
t !== void 0 && r.push(t), console.debug(...r);
|
|
@@ -464,9 +467,9 @@ var x = class {
|
|
|
464
467
|
...e,
|
|
465
468
|
theme: i,
|
|
466
469
|
session: y(e.session)
|
|
467
|
-
}, this.root = this._resolveMount(e.mountTarget), this._applyTheme(i),
|
|
468
|
-
const t =
|
|
469
|
-
this._cleanups.push(t),
|
|
470
|
+
}, this.root = this._resolveMount(e.mountTarget), this._applyTheme(i), L();
|
|
471
|
+
const t = p("gengage:context:update", (r) => this.update(r));
|
|
472
|
+
this._cleanups.push(t), h("lifecycle", `${this.constructor.name}.init`, {
|
|
470
473
|
accountId: e.accountId,
|
|
471
474
|
sku: e.pageContext?.sku
|
|
472
475
|
});
|
|
@@ -475,7 +478,7 @@ var x = class {
|
|
|
475
478
|
} catch (r) {
|
|
476
479
|
throw this.destroy(), r;
|
|
477
480
|
}
|
|
478
|
-
this._destroying || (this.isInitialised = !0,
|
|
481
|
+
this._destroying || (this.isInitialised = !0, h("lifecycle", `${this.constructor.name} ready`), this.emit("ready"));
|
|
479
482
|
}
|
|
480
483
|
update(e) {
|
|
481
484
|
this.isInitialised && (this.config.pageContext ? this.config = {
|
|
@@ -505,11 +508,11 @@ var x = class {
|
|
|
505
508
|
return this._handlers.has(e) || this._handlers.set(e, /* @__PURE__ */ new Set()), this._handlers.get(e).add(i), () => this._handlers.get(e)?.delete(i);
|
|
506
509
|
}
|
|
507
510
|
trackCheckout(e, i) {
|
|
508
|
-
const t = e === "start" ?
|
|
511
|
+
const t = e === "start" ? b : k;
|
|
509
512
|
this.track(t(this.analyticsContext(), i));
|
|
510
513
|
}
|
|
511
514
|
flushMeteringSummary(e) {
|
|
512
|
-
this.track(
|
|
515
|
+
this.track(w(this.analyticsContext(), e));
|
|
513
516
|
}
|
|
514
517
|
emit(e, ...i) {
|
|
515
518
|
this._handlers.get(e)?.forEach((t) => t(...i));
|
|
@@ -560,18 +563,18 @@ export {
|
|
|
560
563
|
E as d,
|
|
561
564
|
Q as f,
|
|
562
565
|
Y as g,
|
|
563
|
-
|
|
566
|
+
b as h,
|
|
564
567
|
Z as i,
|
|
565
568
|
X as l,
|
|
566
569
|
k as m,
|
|
567
|
-
|
|
568
|
-
|
|
570
|
+
h as n,
|
|
571
|
+
L as o,
|
|
569
572
|
K as p,
|
|
570
573
|
R as r,
|
|
571
|
-
|
|
574
|
+
$ as s,
|
|
572
575
|
x as t,
|
|
573
576
|
_ as u,
|
|
574
|
-
|
|
577
|
+
w as v,
|
|
575
578
|
j as w,
|
|
576
579
|
G as x,
|
|
577
580
|
W as y
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gengage/assistant-fe",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "Source-available frontend widgets for Gengage AI Assistant — chat, Q&A, and similar-products. Backend is SaaS (gengage.ai).",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|