@gengage/assistant-fe 0.2.5 → 0.2.6

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 (64) hide show
  1. package/dist/chat/chat-presentation-state.d.ts +54 -0
  2. package/dist/chat/chat-presentation-state.d.ts.map +1 -0
  3. package/dist/chat/components/AIGroupingCards.d.ts.map +1 -1
  4. package/dist/chat/components/AISuggestedSearchCards.d.ts.map +1 -1
  5. package/dist/chat/components/AITopPicks.d.ts.map +1 -1
  6. package/dist/chat/components/ChatDrawer.d.ts +46 -0
  7. package/dist/chat/components/ChatDrawer.d.ts.map +1 -1
  8. package/dist/chat/components/ThumbnailsColumn.d.ts +2 -0
  9. package/dist/chat/components/ThumbnailsColumn.d.ts.map +1 -1
  10. package/dist/chat/index.d.ts +10 -0
  11. package/dist/chat/index.d.ts.map +1 -1
  12. package/dist/chat/locales/en.d.ts.map +1 -1
  13. package/dist/chat/locales/tr.d.ts.map +1 -1
  14. package/dist/chat/types.d.ts +7 -1
  15. package/dist/chat/types.d.ts.map +1 -1
  16. package/dist/chat/utils/chat-presentation-debug.d.ts +20 -0
  17. package/dist/chat/utils/chat-presentation-debug.d.ts.map +1 -0
  18. package/dist/chat/utils/get-chat-scroll-element.d.ts +11 -0
  19. package/dist/chat/utils/get-chat-scroll-element.d.ts.map +1 -0
  20. package/dist/chat.cjs +1 -1
  21. package/dist/chat.iife.js +22 -22
  22. package/dist/chat.iife.js.map +1 -1
  23. package/dist/chat.js +10 -6
  24. package/dist/common/index.d.ts +2 -0
  25. package/dist/common/index.d.ts.map +1 -1
  26. package/dist/common/protocol-adapter.d.ts.map +1 -1
  27. package/dist/common/suggested-search-keywords.d.ts +19 -0
  28. package/dist/common/suggested-search-keywords.d.ts.map +1 -0
  29. package/dist/common.cjs +1 -1
  30. package/dist/common.js +50 -48
  31. package/dist/index-BLq9Phmq.js +5101 -0
  32. package/dist/index-BLq9Phmq.js.map +1 -0
  33. package/dist/{index-B6xRdkMq.cjs → index-BeP3ETm1.cjs} +2 -2
  34. package/dist/{index-B6xRdkMq.cjs.map → index-BeP3ETm1.cjs.map} +1 -1
  35. package/dist/index-BwBJkYGY.cjs +13 -0
  36. package/dist/index-BwBJkYGY.cjs.map +1 -0
  37. package/dist/{index-BsvmfVa1.js → index-ZO_kMfUR.js} +3 -3
  38. package/dist/{index-BsvmfVa1.js.map → index-ZO_kMfUR.js.map} +1 -1
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.js +5 -5
  41. package/dist/native.cjs +1 -1
  42. package/dist/native.iife.js +28 -28
  43. package/dist/native.iife.js.map +1 -1
  44. package/dist/native.js +1 -1
  45. package/dist/qna.cjs +1 -1
  46. package/dist/qna.iife.js +6 -6
  47. package/dist/qna.iife.js.map +1 -1
  48. package/dist/qna.js +1 -1
  49. package/dist/schemas-CaaT5BuE.cjs +86 -0
  50. package/dist/schemas-CaaT5BuE.cjs.map +1 -0
  51. package/dist/{schemas-Fiaobs4L.js → schemas-DR_GaPQj.js} +900 -876
  52. package/dist/schemas-DR_GaPQj.js.map +1 -0
  53. package/dist/simrel.cjs +1 -1
  54. package/dist/simrel.iife.js +7 -7
  55. package/dist/simrel.iife.js.map +1 -1
  56. package/dist/simrel.js +1 -1
  57. package/package.json +2 -1
  58. package/dist/index-BzCc2DCm.cjs +0 -13
  59. package/dist/index-BzCc2DCm.cjs.map +0 -1
  60. package/dist/index-D5UPIXIA.js +0 -4831
  61. package/dist/index-D5UPIXIA.js.map +0 -1
  62. package/dist/schemas-CNzyBhf7.cjs +0 -86
  63. package/dist/schemas-CNzyBhf7.cjs.map +0 -1
  64. package/dist/schemas-Fiaobs4L.js.map +0 -1
package/dist/chat.js CHANGED
@@ -1,11 +1,15 @@
1
- import "./schemas-Fiaobs4L.js";
2
- import { G as r, e as c, c as s, a as n, d, b as g } from "./index-D5UPIXIA.js";
1
+ import "./schemas-DR_GaPQj.js";
2
+ import { C as r, e as s, G as C, f as c, c as h, a as n, d as l, g as o, h as g, b as S } from "./index-BLq9Phmq.js";
3
3
  export {
4
- r as GengageChat,
4
+ r as CHAT_SCROLL_ELEMENT_ID,
5
+ s as ChatPresentationState,
6
+ C as GengageChat,
5
7
  c as chatCatalog,
6
- s as createChatWidget,
8
+ h as createChatWidget,
7
9
  n as createDefaultChatUISpecRegistry,
8
- d as defaultChatUnknownUISpecRenderer,
9
- g as renderUISpec
10
+ l as defaultChatUnknownUISpecRenderer,
11
+ o as getChatScrollElement,
12
+ g as invalidateChatScrollCache,
13
+ S as renderUISpec
10
14
  };
11
15
  //# sourceMappingURL=chat.js.map
@@ -40,4 +40,6 @@ export type { VoiceInputState, VoiceInputErrorCode, VoiceInputCallbacks, VoiceIn
40
40
  export { detectPageType, extractSkuFromUrl, autoDetectPageContext } from './page-detect.js';
41
41
  export type { DetectablePageType, PageDetectionRule } from './page-detect.js';
42
42
  export type { NormalizedProduct, SimilarProductsJsonResponse, ProductGroupingsJsonResponse, } from './protocol-adapter.js';
43
+ export { getSuggestedSearchKeywords, getSuggestedSearchKeywordsText } from './suggested-search-keywords.js';
44
+ export type { SuggestedSearchKeywordSource } from './suggested-search-keywords.js';
43
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,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MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC;KAC9B,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,2BAA2B,GAAG,iBAAiB,EAAE,CAEvG;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,4BAA4B,GAAG,KAAK,CAAC;IAC3F,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC,CASD"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Compact browse-card keyword line for `aiSuggestedSearches`.
3
+ *
4
+ * Prefer backend `display_keywords`; otherwise derive short fragments from
5
+ * `chosen_attribute` / `short_name`. Does not use `why_different` (avoids long
6
+ * explanatory sentences in the tertiary line).
7
+ */
8
+ export type SuggestedSearchKeywordSource = {
9
+ display_keywords?: string[];
10
+ chosen_attribute?: string;
11
+ short_name?: string;
12
+ };
13
+ /**
14
+ * Ordered unique keywords (max 3) for suggested-search browse cards.
15
+ */
16
+ export declare function getSuggestedSearchKeywords(search: SuggestedSearchKeywordSource): string[];
17
+ /** Join keywords for the tertiary browse line (e.g. "A • B • C"). */
18
+ export declare function getSuggestedSearchKeywordsText(search: SuggestedSearchKeywordSource): string;
19
+ //# sourceMappingURL=suggested-search-keywords.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggested-search-keywords.d.ts","sourceRoot":"","sources":["../../src/common/suggested-search-keywords.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,4BAA4B,GAAG;IACzC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAoCF;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,4BAA4B,GAAG,MAAM,EAAE,CAgBzF;AAED,qEAAqE;AACrE,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,4BAA4B,GAAG,MAAM,CAE3F"}
package/dist/common.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./schemas-CNzyBhf7.cjs"),l=require("./index-B6xRdkMq.cjs"),u=require("./index-BzCc2DCm.cjs");require("./qna.cjs");require("./simrel.cjs");const E={enabled:!0,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:0,batchSize:10,flushIntervalMs:250},T={mode:"none",key:"",headerName:"X-API-Key",bodyField:"api_key"};class f{constructor(t){this.queue=[],this.flushTimer=null,this.config={...E,...t,auth:{...T,...t.auth??{}}},this.onPageHideBound=()=>{this.queue.length!==0&&this.flushAllSync()},typeof window<"u"&&window.addEventListener("pagehide",this.onPageHideBound)}track(t){if(!this.config.enabled)return;const n=C(t);if(this.queue.push(n),this.queue.length>=this.config.batchSize){this.scheduleImmediateFlush();return}this.scheduleFlush()}flush(){if(!this.config.enabled||this.queue.length===0)return;const t=this.queue.splice(0,this.config.batchSize),n=this.buildTransportBody(t),o=g(this.config.endpoint,this.config.middlewareUrl);this.send(o,n)}flushAll(){for(;this.queue.length>0;)this.flush()}destroy(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.queue.length>0&&this.flushAllSync(),typeof window<"u"&&window.removeEventListener("pagehide",this.onPageHideBound)}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},this.config.flushIntervalMs))}scheduleImmediateFlush(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.flush()}buildTransportBody(t){const n={events:t};return this.config.auth.mode==="body-api-key"&&this.config.auth.key&&(n[this.config.auth.bodyField]=this.config.auth.key),n}send(t,n){try{const o=JSON.stringify(n);if(this.config.useBeacon&&this.config.auth.mode!=="x-api-key-header"&&this.config.auth.mode!=="bearer-header"&&m()){const r=new Blob([o],{type:"application/json"});navigator.sendBeacon(t,r);return}if(typeof fetch>"u")return;const a={"Content-Type":"application/json"};this.config.auth.mode==="x-api-key-header"&&this.config.auth.key&&(a[this.config.auth.headerName]=this.config.auth.key),this.config.auth.mode==="bearer-header"&&this.config.auth.key&&(a.Authorization=`Bearer ${this.config.auth.key}`),fetch(t,{method:"POST",headers:a,body:o,keepalive:!0}).catch(()=>{})}catch{}}flushAllSync(){if(!this.config.enabled)return;const t=g(this.config.endpoint,this.config.middlewareUrl);for(;this.queue.length>0;){const n=this.queue.splice(0,this.config.batchSize),o=this.buildTransportBody(n);try{const a=JSON.stringify(o);if(m()){const r=new Blob([a],{type:"application/json"});navigator.sendBeacon(t,r)}}catch{}}}}function S(e){return new f(e)}function C(e){const t={event_name:e.event_name,event_version:e.event_version??"1",timestamp_ms:e.timestamp_ms??Date.now(),account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:e.payload};return e.view_id!==void 0&&(t.view_id=e.view_id),e.user_id!==void 0&&(t.user_id=e.user_id),e.widget!==void 0&&(t.widget=e.widget),e.page_type!==void 0&&(t.page_type=e.page_type),e.sku!==void 0&&(t.sku=e.sku),t}function g(e,t){if(/^https?:\/\//i.test(e))return e;const n=i.normalizeMiddlewareUrl(t),o=e.startsWith("/")?e:`/${e}`;return`${n}${o}`}function m(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}const p={primaryColor:"#000000",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#222222",borderRadius:"8px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#F2F2F2","--root-wrapper-border-color":"#E5E5E5","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"12px","--gengage-chat-header-height":"60px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"860px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"14px","--gengage-simrel-card-radius":"14px"};function b(e){return{...p,...e}}const h="tr";function A(e){return{ACCOUNT_ID:e.accountId,MIDDLEWARE_URL:e.middlewareUrl,LOCALE:e.locale??h}}function k(e,t={}){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},variant:"floating",locale:e.locale??h,...t};return e.theme!==void 0&&(n.theme=e.theme),n}function I(e,t={}){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},pageContext:{pageType:"pdp",sku:e.sku},mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(n.theme=e.theme),n}function U(e,t={}){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},sku:e.sku,mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(n.theme=e.theme),n}function P(e,t={}){return{enabled:!0,middlewareUrl:e,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,...t}}function _(e){try{return document.querySelector(e),!0}catch{return!1}}function y(e,t){const n=[],o=e.mounts,a=[["qna",o.qna],["simrel",o.simrel],["chat",o.chat]];for(const[s,c]of a)if(c!==void 0){if(!_(c)){n.push({code:"INVALID_SELECTOR",message:`[gengage preflight] ${s} mount selector is invalid CSS: "${c}"`,severity:"error"});continue}document.querySelector(c)||n.push({code:"MOUNT_NOT_FOUND",message:`[gengage preflight] ${s} mount target not found: "${c}" — widget will skip or wait for DOM`,severity:"warn"})}const r=e.gtm.idempotencyKey;if(window[r]!==void 0&&n.push({code:"DUPLICATE_IDEMPOTENCY",message:`[gengage preflight] window["${r}"] already exists — widgets may have already initialized`,severity:"warn"}),!t?.skipCspCheck){let s=!1;const c=d=>{d.blockedURI&&e.middlewareUrl.startsWith(d.blockedURI)&&(s=!0)};document.addEventListener("securitypolicyviolation",c);try{fetch(e.middlewareUrl,{method:"HEAD",mode:"no-cors"}).catch(()=>{})}catch{s=!0}document.removeEventListener("securitypolicyviolation",c),s&&n.push({code:"CSP_BLOCKED",message:`[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,severity:"warn"})}for(const s of n)s.severity==="error"?console.error(s.message):console.warn(s.message);return{ok:n.every(s=>s.severity!=="error"),warnings:n}}function x(e){const t=l.safeParseAccountRuntimeConfig(e);if(!t.success){const n=t.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`).join("; ");throw new Error(`[gengage] Invalid runtime config: ${n}`)}return t.data}function R(e,t,n){const o={accountId:e.accountId,middlewareUrl:e.middlewareUrl,idempotencyKey:e.gtm.idempotencyKey};return e.locale!==void 0&&(o.locale=e.locale),n!==void 0&&(o.pageContext=n,n.sku!==void 0&&(o.sku=n.sku)),o.chat={enabled:e.widgets.chat.enabled},e.mounts.chat!==void 0&&(o.chat.mountTarget=e.mounts.chat),o.qna={enabled:e.widgets.qna.enabled},e.mounts.qna!==void 0&&(o.qna.mountTarget=e.mounts.qna),o.simrel={enabled:e.widgets.simrel.enabled},e.mounts.simrel!==void 0&&(o.simrel.mountTarget=e.mounts.simrel),t?.onAddToCart!==void 0&&(o.onAddToCart=t.onAddToCart),t?.onProductNavigate!==void 0&&(o.onProductNavigate=t.onProductNavigate),t?.onScriptCall!==void 0&&(o.onScriptCall=t.onScriptCall),o}async function D(e){const t=x(e.runtimeConfig);if(e.preflight!==!1){const r=y(t);if(!r.ok){const s=r.warnings.filter(c=>c.severity==="error");throw new Error(`[gengage] Preflight failed: ${s.map(c=>c.message).join("; ")}`)}}const n=e.contextResolver?.(),o=R(t,e.hostActions,n),a=await l.initOverlayWidgets(o);if(e.contextResolver!==void 0){const r=e.contextResolver,s=()=>{const d=r();a.updateContext(d)};window.addEventListener("gengage:context:update",s);const c=a.destroy.bind(a);a.destroy=()=>{window.removeEventListener("gengage:context:update",s),c()}}return a}const O=[{pageType:"home",urlPatterns:["^/$","^/index\\.html?$","^/anasayfa$"]},{pageType:"search",urlPatterns:["/arama","/search","/ara\\?"],queryParam:"q"},{pageType:"cart",urlPatterns:["/sepet","/cart","/basket","/sepetim"]},{pageType:"plp",urlPatterns:["/kategori/","/category/","/c/","/koleksiyon/","/collection/"]},{pageType:"pdp",urlPatterns:["/urun/","/product/","/p/","/-p-","/-pm-"]}];function v(e,t){const n=t??(typeof window<"u"?new URL(window.location.href):null);if(!n)return"other";const o=e??O,a=n.pathname;for(const r of o)if(!(r.urlPatterns&&!r.urlPatterns.some(c=>{try{return new RegExp(c,"i").test(a)}catch{return!1}}))&&!(r.queryParam&&!n.searchParams.has(r.queryParam))&&!(r.selector&&typeof document<"u"&&!document.querySelector(r.selector)))return r.pageType;return"other"}function w(e){const t=e??(typeof window<"u"?new URL(window.location.href):null);if(!t)return;const n=t.pathname,o=n.match(/\/(?:p|urun|product)\/([^/?#]+)/i);if(o?.[1])return o[1];const a=n.match(/-p-(\d+)/i);if(a?.[1])return a[1]}function L(e){const t=v(e),n={pageType:t};if(t==="pdp"){const o=w();o&&(n.sku=o)}return typeof window<"u"&&(n.url=window.location.href),n}exports.BaseWidget=i.BaseWidget;exports.DEFAULT_WIDGET_THEME_TOKENS=i.DEFAULT_WIDGET_THEME_TOKENS;exports.adaptBackendEvent=i.adaptBackendEvent;exports.basketAddEvent=i.basketAddEvent;exports.bootstrapSession=i.bootstrapSession;exports.buildChatEndpointUrl=i.buildChatEndpointUrl;exports.chatHistorySnapshotEvent=i.chatHistorySnapshotEvent;exports.checkoutCompleteEvent=i.checkoutCompleteEvent;exports.checkoutStartEvent=i.checkoutStartEvent;exports.consumeStream=i.consumeStream;exports.defaultUnknownUISpecRenderer=i.defaultUnknownUISpecRenderer;exports.dismissGlobalErrorToast=i.dismissGlobalErrorToast;exports.dispatch=i.dispatch;exports.getGlobalErrorMessage=i.getGlobalErrorMessage;exports.getWindowPageContext=i.getWindowPageContext;exports.listen=i.listen;exports.llmUsageEvent=i.llmUsageEvent;exports.mergeUISpecRegistry=i.mergeUISpecRegistry;exports.meteringIncrementEvent=i.meteringIncrementEvent;exports.meteringSummaryEvent=i.meteringSummaryEvent;exports.normalizeMiddlewareUrl=i.normalizeMiddlewareUrl;exports.normalizeProductGroupingsResponse=i.normalizeProductGroupingsResponse;exports.normalizeSimilarProductsResponse=i.normalizeSimilarProductsResponse;exports.productToNormalized=i.productToNormalized;exports.registerGlobalErrorToastListener=i.registerGlobalErrorToastListener;exports.renderUISpecWithRegistry=i.renderUISpecWithRegistry;exports.resolveSession=i.resolveSession;exports.sanitizeHtml=i.sanitizeHtml;exports.showGlobalErrorToast=i.showGlobalErrorToast;exports.streamChunkEvent=i.streamChunkEvent;exports.streamDoneEvent=i.streamDoneEvent;exports.streamErrorEvent=i.streamErrorEvent;exports.streamPost=i.streamPost;exports.streamStartEvent=i.streamStartEvent;exports.streamUiSpecEvent=i.streamUiSpecEvent;exports.updatePageContext=i.updatePageContext;exports.widgetHistorySnapshotEvent=i.widgetHistorySnapshotEvent;exports.wireGADataLayer=i.wireGADataLayer;exports.wireQNAToChat=i.wireQNAToChat;exports.wireSimilarToChat=i.wireSimilarToChat;exports.withDefaultWidgetTheme=i.withDefaultWidgetTheme;exports.AccountRuntimeConfigSchema=l.AccountRuntimeConfigSchema;exports.AnalyticsAuthModeSchema=l.AnalyticsAuthModeSchema;exports.UnknownActionPolicySchema=l.UnknownActionPolicySchema;exports.applyNativeSession=l.applyNativeSession;exports.buildOverlayIdempotencyKey=l.buildOverlayIdempotencyKey;exports.createDefaultAccountRuntimeConfig=l.createDefaultAccountRuntimeConfig;exports.createNativeWebViewBridge=l.createNativeWebViewBridge;exports.destroyOverlayWidgets=l.destroyOverlayWidgets;exports.detectNativeEnvironment=l.detectNativeEnvironment;exports.getOverlayWidgets=l.getOverlayWidgets;exports.initNativeOverlayWidgets=l.initNativeOverlayWidgets;exports.initOverlayWidgets=l.initOverlayWidgets;exports.parseAccountRuntimeConfig=l.parseAccountRuntimeConfig;exports.safeParseAccountRuntimeConfig=l.safeParseAccountRuntimeConfig;exports.VoiceInput=u.VoiceInput;exports.isVoiceInputSupported=u.isVoiceInputSupported;exports.routeStreamAction=u.routeStreamAction;exports.AnalyticsClient=f;exports.BASE_WIDGET_THEME=p;exports.DEFAULT_CUSTOMIZATION_LOCALE=h;exports.autoDetectPageContext=L;exports.createAccountIdentity=A;exports.createAnalyticsClient=S;exports.createDefaultAnalyticsConfig=P;exports.createFloatingChatConfig=k;exports.createPdpQnaConfig=I;exports.createPdpSimRelConfig=U;exports.detectPageType=v;exports.extractSkuFromUrl=w;exports.initGengageClient=D;exports.preflightDiagnostics=y;exports.withBaseTheme=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./schemas-CaaT5BuE.cjs"),d=require("./index-BeP3ETm1.cjs"),u=require("./index-BwBJkYGY.cjs");require("./qna.cjs");require("./simrel.cjs");const E={enabled:!0,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:0,batchSize:10,flushIntervalMs:250},S={mode:"none",key:"",headerName:"X-API-Key",bodyField:"api_key"};class f{constructor(t){this.queue=[],this.flushTimer=null,this.config={...E,...t,auth:{...S,...t.auth??{}}},this.onPageHideBound=()=>{this.queue.length!==0&&this.flushAllSync()},typeof window<"u"&&window.addEventListener("pagehide",this.onPageHideBound)}track(t){if(!this.config.enabled)return;const n=C(t);if(this.queue.push(n),this.queue.length>=this.config.batchSize){this.scheduleImmediateFlush();return}this.scheduleFlush()}flush(){if(!this.config.enabled||this.queue.length===0)return;const t=this.queue.splice(0,this.config.batchSize),n=this.buildTransportBody(t),r=g(this.config.endpoint,this.config.middlewareUrl);this.send(r,n)}flushAll(){for(;this.queue.length>0;)this.flush()}destroy(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.queue.length>0&&this.flushAllSync(),typeof window<"u"&&window.removeEventListener("pagehide",this.onPageHideBound)}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},this.config.flushIntervalMs))}scheduleImmediateFlush(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.flush()}buildTransportBody(t){const n={events:t};return this.config.auth.mode==="body-api-key"&&this.config.auth.key&&(n[this.config.auth.bodyField]=this.config.auth.key),n}send(t,n){try{const r=JSON.stringify(n);if(this.config.useBeacon&&this.config.auth.mode!=="x-api-key-header"&&this.config.auth.mode!=="bearer-header"&&m()){const o=new Blob([r],{type:"application/json"});navigator.sendBeacon(t,o);return}if(typeof fetch>"u")return;const a={"Content-Type":"application/json"};this.config.auth.mode==="x-api-key-header"&&this.config.auth.key&&(a[this.config.auth.headerName]=this.config.auth.key),this.config.auth.mode==="bearer-header"&&this.config.auth.key&&(a.Authorization=`Bearer ${this.config.auth.key}`),fetch(t,{method:"POST",headers:a,body:r,keepalive:!0}).catch(()=>{})}catch{}}flushAllSync(){if(!this.config.enabled)return;const t=g(this.config.endpoint,this.config.middlewareUrl);for(;this.queue.length>0;){const n=this.queue.splice(0,this.config.batchSize),r=this.buildTransportBody(n);try{const a=JSON.stringify(r);if(m()){const o=new Blob([a],{type:"application/json"});navigator.sendBeacon(t,o)}}catch{}}}}function T(e){return new f(e)}function C(e){const t={event_name:e.event_name,event_version:e.event_version??"1",timestamp_ms:e.timestamp_ms??Date.now(),account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:e.payload};return e.view_id!==void 0&&(t.view_id=e.view_id),e.user_id!==void 0&&(t.user_id=e.user_id),e.widget!==void 0&&(t.widget=e.widget),e.page_type!==void 0&&(t.page_type=e.page_type),e.sku!==void 0&&(t.sku=e.sku),t}function g(e,t){if(/^https?:\/\//i.test(e))return e;const n=i.normalizeMiddlewareUrl(t),r=e.startsWith("/")?e:`/${e}`;return`${n}${r}`}function m(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}const p={primaryColor:"#000000",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#222222",borderRadius:"8px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#F2F2F2","--root-wrapper-border-color":"#E5E5E5","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"12px","--gengage-chat-header-height":"60px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"860px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"14px","--gengage-simrel-card-radius":"14px"};function b(e){return{...p,...e}}const h="tr";function A(e){return{ACCOUNT_ID:e.accountId,MIDDLEWARE_URL:e.middlewareUrl,LOCALE:e.locale??h}}function k(e,t={}){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},variant:"floating",locale:e.locale??h,...t};return e.theme!==void 0&&(n.theme=e.theme),n}function I(e,t={}){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},pageContext:{pageType:"pdp",sku:e.sku},mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(n.theme=e.theme),n}function U(e,t={}){const n={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},sku:e.sku,mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(n.theme=e.theme),n}function P(e,t={}){return{enabled:!0,middlewareUrl:e,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,...t}}function _(e){try{return document.querySelector(e),!0}catch{return!1}}function y(e,t){const n=[],r=e.mounts,a=[["qna",r.qna],["simrel",r.simrel],["chat",r.chat]];for(const[s,c]of a)if(c!==void 0){if(!_(c)){n.push({code:"INVALID_SELECTOR",message:`[gengage preflight] ${s} mount selector is invalid CSS: "${c}"`,severity:"error"});continue}document.querySelector(c)||n.push({code:"MOUNT_NOT_FOUND",message:`[gengage preflight] ${s} mount target not found: "${c}" — widget will skip or wait for DOM`,severity:"warn"})}const o=e.gtm.idempotencyKey;if(window[o]!==void 0&&n.push({code:"DUPLICATE_IDEMPOTENCY",message:`[gengage preflight] window["${o}"] already exists — widgets may have already initialized`,severity:"warn"}),!t?.skipCspCheck){let s=!1;const c=l=>{l.blockedURI&&e.middlewareUrl.startsWith(l.blockedURI)&&(s=!0)};document.addEventListener("securitypolicyviolation",c);try{fetch(e.middlewareUrl,{method:"HEAD",mode:"no-cors"}).catch(()=>{})}catch{s=!0}document.removeEventListener("securitypolicyviolation",c),s&&n.push({code:"CSP_BLOCKED",message:`[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,severity:"warn"})}for(const s of n)s.severity==="error"?console.error(s.message):console.warn(s.message);return{ok:n.every(s=>s.severity!=="error"),warnings:n}}function x(e){const t=d.safeParseAccountRuntimeConfig(e);if(!t.success){const n=t.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`).join("; ");throw new Error(`[gengage] Invalid runtime config: ${n}`)}return t.data}function R(e,t,n){const r={accountId:e.accountId,middlewareUrl:e.middlewareUrl,idempotencyKey:e.gtm.idempotencyKey};return e.locale!==void 0&&(r.locale=e.locale),n!==void 0&&(r.pageContext=n,n.sku!==void 0&&(r.sku=n.sku)),r.chat={enabled:e.widgets.chat.enabled},e.mounts.chat!==void 0&&(r.chat.mountTarget=e.mounts.chat),r.qna={enabled:e.widgets.qna.enabled},e.mounts.qna!==void 0&&(r.qna.mountTarget=e.mounts.qna),r.simrel={enabled:e.widgets.simrel.enabled},e.mounts.simrel!==void 0&&(r.simrel.mountTarget=e.mounts.simrel),t?.onAddToCart!==void 0&&(r.onAddToCart=t.onAddToCart),t?.onProductNavigate!==void 0&&(r.onProductNavigate=t.onProductNavigate),t?.onScriptCall!==void 0&&(r.onScriptCall=t.onScriptCall),r}async function D(e){const t=x(e.runtimeConfig);if(e.preflight!==!1){const o=y(t);if(!o.ok){const s=o.warnings.filter(c=>c.severity==="error");throw new Error(`[gengage] Preflight failed: ${s.map(c=>c.message).join("; ")}`)}}const n=e.contextResolver?.(),r=R(t,e.hostActions,n),a=await d.initOverlayWidgets(r);if(e.contextResolver!==void 0){const o=e.contextResolver,s=()=>{const l=o();a.updateContext(l)};window.addEventListener("gengage:context:update",s);const c=a.destroy.bind(a);a.destroy=()=>{window.removeEventListener("gengage:context:update",s),c()}}return a}const O=[{pageType:"home",urlPatterns:["^/$","^/index\\.html?$","^/anasayfa$"]},{pageType:"search",urlPatterns:["/arama","/search","/ara\\?"],queryParam:"q"},{pageType:"cart",urlPatterns:["/sepet","/cart","/basket","/sepetim"]},{pageType:"plp",urlPatterns:["/kategori/","/category/","/c/","/koleksiyon/","/collection/"]},{pageType:"pdp",urlPatterns:["/urun/","/product/","/p/","/-p-","/-pm-"]}];function v(e,t){const n=t??(typeof window<"u"?new URL(window.location.href):null);if(!n)return"other";const r=e??O,a=n.pathname;for(const o of r)if(!(o.urlPatterns&&!o.urlPatterns.some(c=>{try{return new RegExp(c,"i").test(a)}catch{return!1}}))&&!(o.queryParam&&!n.searchParams.has(o.queryParam))&&!(o.selector&&typeof document<"u"&&!document.querySelector(o.selector)))return o.pageType;return"other"}function w(e){const t=e??(typeof window<"u"?new URL(window.location.href):null);if(!t)return;const n=t.pathname,r=n.match(/\/(?:p|urun|product)\/([^/?#]+)/i);if(r?.[1])return r[1];const a=n.match(/-p-(\d+)/i);if(a?.[1])return a[1]}function L(e){const t=v(e),n={pageType:t};if(t==="pdp"){const r=w();r&&(n.sku=r)}return typeof window<"u"&&(n.url=window.location.href),n}exports.BaseWidget=i.BaseWidget;exports.DEFAULT_WIDGET_THEME_TOKENS=i.DEFAULT_WIDGET_THEME_TOKENS;exports.adaptBackendEvent=i.adaptBackendEvent;exports.basketAddEvent=i.basketAddEvent;exports.bootstrapSession=i.bootstrapSession;exports.buildChatEndpointUrl=i.buildChatEndpointUrl;exports.chatHistorySnapshotEvent=i.chatHistorySnapshotEvent;exports.checkoutCompleteEvent=i.checkoutCompleteEvent;exports.checkoutStartEvent=i.checkoutStartEvent;exports.consumeStream=i.consumeStream;exports.defaultUnknownUISpecRenderer=i.defaultUnknownUISpecRenderer;exports.dismissGlobalErrorToast=i.dismissGlobalErrorToast;exports.dispatch=i.dispatch;exports.getGlobalErrorMessage=i.getGlobalErrorMessage;exports.getSuggestedSearchKeywords=i.getSuggestedSearchKeywords;exports.getSuggestedSearchKeywordsText=i.getSuggestedSearchKeywordsText;exports.getWindowPageContext=i.getWindowPageContext;exports.listen=i.listen;exports.llmUsageEvent=i.llmUsageEvent;exports.mergeUISpecRegistry=i.mergeUISpecRegistry;exports.meteringIncrementEvent=i.meteringIncrementEvent;exports.meteringSummaryEvent=i.meteringSummaryEvent;exports.normalizeMiddlewareUrl=i.normalizeMiddlewareUrl;exports.normalizeProductGroupingsResponse=i.normalizeProductGroupingsResponse;exports.normalizeSimilarProductsResponse=i.normalizeSimilarProductsResponse;exports.productToNormalized=i.productToNormalized;exports.registerGlobalErrorToastListener=i.registerGlobalErrorToastListener;exports.renderUISpecWithRegistry=i.renderUISpecWithRegistry;exports.resolveSession=i.resolveSession;exports.sanitizeHtml=i.sanitizeHtml;exports.showGlobalErrorToast=i.showGlobalErrorToast;exports.streamChunkEvent=i.streamChunkEvent;exports.streamDoneEvent=i.streamDoneEvent;exports.streamErrorEvent=i.streamErrorEvent;exports.streamPost=i.streamPost;exports.streamStartEvent=i.streamStartEvent;exports.streamUiSpecEvent=i.streamUiSpecEvent;exports.updatePageContext=i.updatePageContext;exports.widgetHistorySnapshotEvent=i.widgetHistorySnapshotEvent;exports.wireGADataLayer=i.wireGADataLayer;exports.wireQNAToChat=i.wireQNAToChat;exports.wireSimilarToChat=i.wireSimilarToChat;exports.withDefaultWidgetTheme=i.withDefaultWidgetTheme;exports.AccountRuntimeConfigSchema=d.AccountRuntimeConfigSchema;exports.AnalyticsAuthModeSchema=d.AnalyticsAuthModeSchema;exports.UnknownActionPolicySchema=d.UnknownActionPolicySchema;exports.applyNativeSession=d.applyNativeSession;exports.buildOverlayIdempotencyKey=d.buildOverlayIdempotencyKey;exports.createDefaultAccountRuntimeConfig=d.createDefaultAccountRuntimeConfig;exports.createNativeWebViewBridge=d.createNativeWebViewBridge;exports.destroyOverlayWidgets=d.destroyOverlayWidgets;exports.detectNativeEnvironment=d.detectNativeEnvironment;exports.getOverlayWidgets=d.getOverlayWidgets;exports.initNativeOverlayWidgets=d.initNativeOverlayWidgets;exports.initOverlayWidgets=d.initOverlayWidgets;exports.parseAccountRuntimeConfig=d.parseAccountRuntimeConfig;exports.safeParseAccountRuntimeConfig=d.safeParseAccountRuntimeConfig;exports.VoiceInput=u.VoiceInput;exports.isVoiceInputSupported=u.isVoiceInputSupported;exports.routeStreamAction=u.routeStreamAction;exports.AnalyticsClient=f;exports.BASE_WIDGET_THEME=p;exports.DEFAULT_CUSTOMIZATION_LOCALE=h;exports.autoDetectPageContext=L;exports.createAccountIdentity=A;exports.createAnalyticsClient=T;exports.createDefaultAnalyticsConfig=P;exports.createFloatingChatConfig=k;exports.createPdpQnaConfig=I;exports.createPdpSimRelConfig=U;exports.detectPageType=v;exports.extractSkuFromUrl=w;exports.initGengageClient=D;exports.preflightDiagnostics=y;exports.withBaseTheme=b;
2
2
  //# sourceMappingURL=common.cjs.map
package/dist/common.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a0 as h } from "./schemas-Fiaobs4L.js";
2
- import { B as z, a1 as W, a as H, C as G, a2 as j, b as K, R as V, a3 as Q, a4 as J, c as X, a5 as Y, a6 as Z, j as ee, k as te, a7 as ae, a8 as ne, T as oe, m as ie, Q as se, a9 as re, q as ce, p as de, aa as le, ab as ue, r as he, Z as fe, v as ge, ac as me, X as pe, h as ye, l as ve, ad as we, g as Te, U as be, ae as Ee, w as Se, af as ke, $ as Ce, ag as Ie, ah as Ue } from "./schemas-Fiaobs4L.js";
3
- import { i as f, s as g } from "./index-BsvmfVa1.js";
4
- import { A as _e, a as xe, U as Pe, b as Le, c as Re, d as qe, e as De, f as Be, g as Oe, h as Fe, j as Ne, p as Me } from "./index-BsvmfVa1.js";
5
- import { V as ze, i as We, r as He } from "./index-D5UPIXIA.js";
1
+ import { a0 as h } from "./schemas-DR_GaPQj.js";
2
+ import { B as z, a1 as W, a as H, C as G, a2 as K, b as j, R as V, a3 as Q, a4 as J, c as X, a5 as Y, a6 as Z, j as ee, k as te, a7 as ae, a8 as ne, a9 as oe, aa as ie, T as se, m as re, Q as ce, ab as de, q as le, p as ue, ac as he, ad as fe, r as ge, Z as me, v as pe, ae as ye, X as ve, h as we, l as Te, af as be, g as Ee, U as Se, ag as ke, w as Ce, ah as Ie, $ as Ue, ai as Ae, aj as xe } from "./schemas-DR_GaPQj.js";
3
+ import { i as f, s as g } from "./index-ZO_kMfUR.js";
4
+ import { A as Pe, a as Le, U as Re, b as qe, c as De, d as Be, e as Oe, f as Fe, g as Ne, h as Me, j as $e, p as ze } from "./index-ZO_kMfUR.js";
5
+ import { V as He, i as Ge, r as Ke } from "./index-BLq9Phmq.js";
6
6
  import "./qna.js";
7
7
  import "./simrel.js";
8
8
  const m = {
@@ -367,78 +367,80 @@ function N(e) {
367
367
  return typeof window < "u" && (a.url = window.location.href), a;
368
368
  }
369
369
  export {
370
- _e as AccountRuntimeConfigSchema,
371
- xe as AnalyticsAuthModeSchema,
370
+ Pe as AccountRuntimeConfigSchema,
371
+ Le as AnalyticsAuthModeSchema,
372
372
  y as AnalyticsClient,
373
373
  w as BASE_WIDGET_THEME,
374
374
  z as BaseWidget,
375
375
  u as DEFAULT_CUSTOMIZATION_LOCALE,
376
376
  W as DEFAULT_WIDGET_THEME_TOKENS,
377
- Pe as UnknownActionPolicySchema,
378
- ze as VoiceInput,
377
+ Re as UnknownActionPolicySchema,
378
+ He as VoiceInput,
379
379
  H as adaptBackendEvent,
380
- Le as applyNativeSession,
380
+ qe as applyNativeSession,
381
381
  N as autoDetectPageContext,
382
382
  G as basketAddEvent,
383
- j as bootstrapSession,
384
- K as buildChatEndpointUrl,
385
- Re as buildOverlayIdempotencyKey,
383
+ K as bootstrapSession,
384
+ j as buildChatEndpointUrl,
385
+ De as buildOverlayIdempotencyKey,
386
386
  V as chatHistorySnapshotEvent,
387
387
  Q as checkoutCompleteEvent,
388
388
  J as checkoutStartEvent,
389
389
  X as consumeStream,
390
390
  R as createAccountIdentity,
391
391
  P as createAnalyticsClient,
392
- qe as createDefaultAccountRuntimeConfig,
392
+ Be as createDefaultAccountRuntimeConfig,
393
393
  O as createDefaultAnalyticsConfig,
394
394
  q as createFloatingChatConfig,
395
- De as createNativeWebViewBridge,
395
+ Oe as createNativeWebViewBridge,
396
396
  D as createPdpQnaConfig,
397
397
  B as createPdpSimRelConfig,
398
398
  Y as defaultUnknownUISpecRenderer,
399
- Be as destroyOverlayWidgets,
400
- Oe as detectNativeEnvironment,
399
+ Fe as destroyOverlayWidgets,
400
+ Ne as detectNativeEnvironment,
401
401
  C as detectPageType,
402
402
  Z as dismissGlobalErrorToast,
403
403
  ee as dispatch,
404
404
  I as extractSkuFromUrl,
405
405
  te as getGlobalErrorMessage,
406
- Fe as getOverlayWidgets,
407
- ae as getWindowPageContext,
406
+ Me as getOverlayWidgets,
407
+ ae as getSuggestedSearchKeywords,
408
+ ne as getSuggestedSearchKeywordsText,
409
+ oe as getWindowPageContext,
408
410
  F as initGengageClient,
409
- Ne as initNativeOverlayWidgets,
411
+ $e as initNativeOverlayWidgets,
410
412
  f as initOverlayWidgets,
411
- We as isVoiceInputSupported,
412
- ne as listen,
413
- oe as llmUsageEvent,
414
- ie as mergeUISpecRegistry,
415
- se as meteringIncrementEvent,
416
- re as meteringSummaryEvent,
413
+ Ge as isVoiceInputSupported,
414
+ ie as listen,
415
+ se as llmUsageEvent,
416
+ re as mergeUISpecRegistry,
417
+ ce as meteringIncrementEvent,
418
+ de as meteringSummaryEvent,
417
419
  h as normalizeMiddlewareUrl,
418
- ce as normalizeProductGroupingsResponse,
419
- de as normalizeSimilarProductsResponse,
420
- Me as parseAccountRuntimeConfig,
420
+ le as normalizeProductGroupingsResponse,
421
+ ue as normalizeSimilarProductsResponse,
422
+ ze as parseAccountRuntimeConfig,
421
423
  b as preflightDiagnostics,
422
- le as productToNormalized,
423
- ue as registerGlobalErrorToastListener,
424
- he as renderUISpecWithRegistry,
425
- fe as resolveSession,
426
- He as routeStreamAction,
424
+ he as productToNormalized,
425
+ fe as registerGlobalErrorToastListener,
426
+ ge as renderUISpecWithRegistry,
427
+ me as resolveSession,
428
+ Ke as routeStreamAction,
427
429
  g as safeParseAccountRuntimeConfig,
428
- ge as sanitizeHtml,
429
- me as showGlobalErrorToast,
430
- pe as streamChunkEvent,
431
- ye as streamDoneEvent,
432
- ve as streamErrorEvent,
433
- we as streamPost,
434
- Te as streamStartEvent,
435
- be as streamUiSpecEvent,
436
- Ee as updatePageContext,
437
- Se as widgetHistorySnapshotEvent,
438
- ke as wireGADataLayer,
439
- Ce as wireQNAToChat,
440
- Ie as wireSimilarToChat,
430
+ pe as sanitizeHtml,
431
+ ye as showGlobalErrorToast,
432
+ ve as streamChunkEvent,
433
+ we as streamDoneEvent,
434
+ Te as streamErrorEvent,
435
+ be as streamPost,
436
+ Ee as streamStartEvent,
437
+ Se as streamUiSpecEvent,
438
+ ke as updatePageContext,
439
+ Ce as widgetHistorySnapshotEvent,
440
+ Ie as wireGADataLayer,
441
+ Ue as wireQNAToChat,
442
+ Ae as wireSimilarToChat,
441
443
  L as withBaseTheme,
442
- Ue as withDefaultWidgetTheme
444
+ xe as withDefaultWidgetTheme
443
445
  };
444
446
  //# sourceMappingURL=common.js.map