@xpert-ai/chatkit-ui5 0.18.1 → 0.18.3
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/chatkit.cjs +115 -40
- package/dist/chatkit.cjs.map +1 -1
- package/dist/chatkit.ui5.js +115 -40
- package/dist/chatkit.ui5.js.map +1 -1
- package/dist/index.js +115 -40
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/chatkit.ui5.js
CHANGED
|
@@ -51,7 +51,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
51
51
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
52
52
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
53
53
|
|
|
54
|
-
var _a, _b, _setTrainingOptOut_dec, _hideHistory_dec, _showHistory_dec, _sendCustomAction_dec, _shareThread_dec, _focusMessage_dec, _prepareLeave_dec, _setThreadId_dec, _setRuntimeCapabilities_dec, _setComposerValue_dec, _sendUserMessage_dec, _fetchUpdates_dec, _focusComposer_dec, _c, _opts, _frameUrl, _frame, _wrapper, _windowDrag, _launcherCloseButton, _launcherOpen, _chatMinimizedToPet, _framePetOptionsOverride, _petClosedByContextMenu, _shadow, _petOverlay, _resolveLoaded, _loaded, _channelId, _messenger, _ChatKitElementBase_instances, emitAndThrow_fn, setOptionsDataAttributes_fn, getDisplayMode_fn, getConfiguredPetOptions_fn, mergeConfiguredPetPositionDefaults_fn, getOverlayPetOptions_fn, resolvePetAssetUrl_fn, resolveOverlayPetOptions_fn,
|
|
54
|
+
var _a, _b, _setTrainingOptOut_dec, _hideHistory_dec, _showHistory_dec, _sendCustomAction_dec, _shareThread_dec, _focusMessage_dec, _prepareLeave_dec, _setThreadId_dec, _setRuntimeCapabilities_dec, _setComposerValue_dec, _sendUserMessage_dec, _fetchUpdates_dec, _focusComposer_dec, _c, _opts, _frameUrl, _frame, _wrapper, _windowDrag, _launcherCloseButton, _launcherOpen, _chatMinimizedToPet, _framePetOptionsOverride, _petClosedByContextMenu, _hostLauncherEnabled, _launcherVisible, _shadow, _petOverlay, _resolveLoaded, _loaded, _channelId, _messenger, _ChatKitElementBase_instances, emitAndThrow_fn, setOptionsDataAttributes_fn, getDisplayMode_fn, getConfiguredPetOptions_fn, mergeConfiguredPetPositionDefaults_fn, effectivePet_fn, innerOptions_fn, updateFrameOptions_fn, isLauncherHidden_fn, requestLauncherVisibility_fn, getOverlayPetOptions_fn, resolvePetAssetUrl_fn, resolveOverlayPetOptions_fn, setLauncherOpen_fn, setChatMinimizedToPet_fn, syncPetOverlayOptions_fn, handlePetActivate_fn, handlePetClose_fn, handlePetReply_fn, handlePetThreadSummaryActivate_fn, _handleLauncherClose, getFrameUrl_fn, setFrameUrl_fn, consumeFrameUrl_fn, _handleFrameLoad, _initialized, maybeInit_fn, _init;
|
|
55
55
|
class EventEmitter {
|
|
56
56
|
constructor() {
|
|
57
57
|
__publicField(this, "callbacks", /* @__PURE__ */ new Map());
|
|
@@ -1039,6 +1039,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1039
1039
|
const PET_OVERLAY_COPY = {
|
|
1040
1040
|
"en-US": {
|
|
1041
1041
|
closePetMenuItem: "Close pet",
|
|
1042
|
+
reopenPet: "Show pet",
|
|
1042
1043
|
hideMessage: "Hide message",
|
|
1043
1044
|
expandMessage: "Expand message",
|
|
1044
1045
|
collapseMessage: "Collapse message",
|
|
@@ -1051,6 +1052,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1051
1052
|
},
|
|
1052
1053
|
"zh-CN": {
|
|
1053
1054
|
closePetMenuItem: "关闭宠物",
|
|
1055
|
+
reopenPet: "显示宠物",
|
|
1054
1056
|
hideMessage: "隐藏消息",
|
|
1055
1057
|
expandMessage: "展开消息",
|
|
1056
1058
|
collapseMessage: "收起消息",
|
|
@@ -1261,6 +1263,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1261
1263
|
}
|
|
1262
1264
|
class PetOverlay {
|
|
1263
1265
|
constructor(root, options) {
|
|
1266
|
+
this.reopenButton = null;
|
|
1264
1267
|
this.overlayElement = null;
|
|
1265
1268
|
this.petElement = null;
|
|
1266
1269
|
this.contextMenuElement = null;
|
|
@@ -1508,6 +1511,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1508
1511
|
this.root = root;
|
|
1509
1512
|
this.onActivate = options == null ? void 0 : options.onActivate;
|
|
1510
1513
|
this.onClose = options == null ? void 0 : options.onClose;
|
|
1514
|
+
this.onReopen = options == null ? void 0 : options.onReopen;
|
|
1511
1515
|
this.onReply = options == null ? void 0 : options.onReply;
|
|
1512
1516
|
this.onThreadSummaryActivate = options == null ? void 0 : options.onThreadSummaryActivate;
|
|
1513
1517
|
this.connect();
|
|
@@ -1551,6 +1555,44 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1551
1555
|
this.resolveCharacter();
|
|
1552
1556
|
this.render();
|
|
1553
1557
|
}
|
|
1558
|
+
setReopenVisible(visible, zIndex) {
|
|
1559
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
1560
|
+
if (!visible) {
|
|
1561
|
+
(_a2 = this.reopenButton) == null ? void 0 : _a2.remove();
|
|
1562
|
+
this.reopenButton = null;
|
|
1563
|
+
return;
|
|
1564
|
+
}
|
|
1565
|
+
if (!this.reopenButton) {
|
|
1566
|
+
const button2 = document.createElement("button");
|
|
1567
|
+
button2.type = "button";
|
|
1568
|
+
button2.addEventListener("click", () => {
|
|
1569
|
+
var _a3;
|
|
1570
|
+
return (_a3 = this.onReopen) == null ? void 0 : _a3.call(this);
|
|
1571
|
+
});
|
|
1572
|
+
this.root.append(button2);
|
|
1573
|
+
this.reopenButton = button2;
|
|
1574
|
+
}
|
|
1575
|
+
const button = this.reopenButton;
|
|
1576
|
+
const theme = typeof this.theme === "object" ? this.theme : null;
|
|
1577
|
+
const metrics = getSummaryThemeMetrics(this.theme);
|
|
1578
|
+
button.textContent = this.copy.reopenPet;
|
|
1579
|
+
Object.assign(button.style, {
|
|
1580
|
+
position: "fixed",
|
|
1581
|
+
insetInlineEnd: `${PET_SUMMARY_MARGIN}px`,
|
|
1582
|
+
bottom: `${PET_SUMMARY_MARGIN}px`,
|
|
1583
|
+
zIndex: String(zIndex ?? ((_b2 = chatkitTypes.normalizePetOptions(true)) == null ? void 0 : _b2.position.zIndex)),
|
|
1584
|
+
pointerEvents: "auto",
|
|
1585
|
+
cursor: "pointer",
|
|
1586
|
+
colorScheme: typeof this.theme === "string" ? this.theme : (theme == null ? void 0 : theme.colorScheme) ?? "light",
|
|
1587
|
+
color: ((_d = (_c2 = theme == null ? void 0 : theme.color) == null ? void 0 : _c2.surface) == null ? void 0 : _d.foreground) ?? "ButtonText",
|
|
1588
|
+
background: ((_f = (_e = theme == null ? void 0 : theme.color) == null ? void 0 : _e.surface) == null ? void 0 : _f.background) ?? "ButtonFace",
|
|
1589
|
+
border: "1px solid ButtonBorder",
|
|
1590
|
+
borderRadius: `${metrics.radius}px`,
|
|
1591
|
+
padding: metrics.padding,
|
|
1592
|
+
fontFamily: metrics.fontFamily,
|
|
1593
|
+
fontSize: `${metrics.bodySize}px`
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1554
1596
|
setState(state) {
|
|
1555
1597
|
var _a2;
|
|
1556
1598
|
const previous = this.lastAutoState;
|
|
@@ -1614,6 +1656,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1614
1656
|
return;
|
|
1615
1657
|
}
|
|
1616
1658
|
this.connected = false;
|
|
1659
|
+
this.setReopenVisible(false);
|
|
1617
1660
|
this.clearRestingDelayTimer();
|
|
1618
1661
|
this.clearTimers();
|
|
1619
1662
|
this.removeDragListeners();
|
|
@@ -2521,9 +2564,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2521
2564
|
window.removeEventListener("pointercancel", this.handlePointerUp);
|
|
2522
2565
|
}
|
|
2523
2566
|
}
|
|
2524
|
-
function getInnerOptions(options) {
|
|
2525
|
-
return removeMethods(options);
|
|
2526
|
-
}
|
|
2527
2567
|
function requireCommandCapability(value, context) {
|
|
2528
2568
|
const command = String(context.name);
|
|
2529
2569
|
return function(...args) {
|
|
@@ -2550,10 +2590,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2550
2590
|
__privateAdd(this, _chatMinimizedToPet, false);
|
|
2551
2591
|
__privateAdd(this, _framePetOptionsOverride);
|
|
2552
2592
|
__privateAdd(this, _petClosedByContextMenu, false);
|
|
2593
|
+
__privateAdd(this, _hostLauncherEnabled, true);
|
|
2594
|
+
__privateAdd(this, _launcherVisible, true);
|
|
2553
2595
|
__privateAdd(this, _shadow, this.attachShadow({ mode: "open" }));
|
|
2554
2596
|
__privateAdd(this, _petOverlay, new PetOverlay(__privateGet(this, _shadow), {
|
|
2555
2597
|
onActivate: () => __privateMethod(this, _ChatKitElementBase_instances, handlePetActivate_fn).call(this),
|
|
2556
2598
|
onClose: () => __privateMethod(this, _ChatKitElementBase_instances, handlePetClose_fn).call(this),
|
|
2599
|
+
onReopen: () => __privateMethod(this, _ChatKitElementBase_instances, requestLauncherVisibility_fn).call(this, true),
|
|
2557
2600
|
onReply: (text) => __privateMethod(this, _ChatKitElementBase_instances, handlePetReply_fn).call(this, text),
|
|
2558
2601
|
onThreadSummaryActivate: (threadId) => void __privateMethod(this, _ChatKitElementBase_instances, handlePetThreadSummaryActivate_fn).call(this, threadId)
|
|
2559
2602
|
}));
|
|
@@ -2746,6 +2789,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2746
2789
|
}
|
|
2747
2790
|
connectedCallback() {
|
|
2748
2791
|
__privateGet(this, _petOverlay).connect();
|
|
2792
|
+
if (__privateGet(this, _opts)) __privateMethod(this, _ChatKitElementBase_instances, syncPetOverlayOptions_fn).call(this);
|
|
2749
2793
|
const style = document.createElement("style");
|
|
2750
2794
|
style.textContent = `
|
|
2751
2795
|
:host {
|
|
@@ -3024,19 +3068,26 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3024
3068
|
__privateGet(this, _petOverlay).destroy();
|
|
3025
3069
|
}
|
|
3026
3070
|
applySanitizedOptions(newOptions) {
|
|
3027
|
-
var _a2, _b2;
|
|
3071
|
+
var _a2, _b2, _c2, _d;
|
|
3072
|
+
const sessionChanged = ((_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.sessionKey) !== newOptions.sessionKey || ((_b2 = __privateGet(this, _opts)) == null ? void 0 : _b2.api.xpertId) !== newOptions.api.xpertId || __privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) !== __privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this, newOptions);
|
|
3073
|
+
const pet = newOptions.pet;
|
|
3074
|
+
const enabled = typeof pet === "boolean" ? pet : (pet == null ? void 0 : pet.enabled) ?? true;
|
|
3075
|
+
if (sessionChanged || enabled !== __privateGet(this, _hostLauncherEnabled)) {
|
|
3076
|
+
__privateSet(this, _launcherVisible, enabled);
|
|
3077
|
+
}
|
|
3078
|
+
__privateSet(this, _hostLauncherEnabled, enabled);
|
|
3079
|
+
if (sessionChanged) {
|
|
3080
|
+
__privateSet(this, _framePetOptionsOverride, void 0);
|
|
3081
|
+
__privateMethod(this, _ChatKitElementBase_instances, setLauncherOpen_fn).call(this, false);
|
|
3082
|
+
}
|
|
3028
3083
|
__privateSet(this, _opts, newOptions);
|
|
3029
|
-
if (!((
|
|
3084
|
+
if (!((_c2 = newOptions.header) == null ? void 0 : _c2.windowDrag)) (_d = __privateGet(this, _windowDrag)) == null ? void 0 : _d.clear();
|
|
3030
3085
|
__privateSet(this, _petClosedByContextMenu, false);
|
|
3031
3086
|
__privateGet(this, _petOverlay).setLocale(newOptions.locale);
|
|
3032
3087
|
__privateMethod(this, _ChatKitElementBase_instances, syncPetOverlayOptions_fn).call(this);
|
|
3033
3088
|
if (__privateGet(this, _initialized)) {
|
|
3034
3089
|
__privateMethod(this, _ChatKitElementBase_instances, setOptionsDataAttributes_fn).call(this, __privateGet(this, _opts));
|
|
3035
|
-
|
|
3036
|
-
__privateGet(this, _messenger).commands.setOptions(
|
|
3037
|
-
getInnerOptions(__privateMethod(this, _ChatKitElementBase_instances, getFrameOptions_fn).call(this, newOptions))
|
|
3038
|
-
);
|
|
3039
|
-
});
|
|
3090
|
+
__privateMethod(this, _ChatKitElementBase_instances, updateFrameOptions_fn).call(this);
|
|
3040
3091
|
} else {
|
|
3041
3092
|
__privateMethod(this, _ChatKitElementBase_instances, maybeInit_fn).call(this);
|
|
3042
3093
|
}
|
|
@@ -3128,6 +3179,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3128
3179
|
_chatMinimizedToPet = new WeakMap();
|
|
3129
3180
|
_framePetOptionsOverride = new WeakMap();
|
|
3130
3181
|
_petClosedByContextMenu = new WeakMap();
|
|
3182
|
+
_hostLauncherEnabled = new WeakMap();
|
|
3183
|
+
_launcherVisible = new WeakMap();
|
|
3131
3184
|
_shadow = new WeakMap();
|
|
3132
3185
|
_petOverlay = new WeakMap();
|
|
3133
3186
|
_resolveLoaded = new WeakMap();
|
|
@@ -3150,14 +3203,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3150
3203
|
getDisplayMode_fn = function(options = __privateGet(this, _opts)) {
|
|
3151
3204
|
return (options == null ? void 0 : options.displayMode) === "pet" ? "pet" : "chat";
|
|
3152
3205
|
};
|
|
3153
|
-
getConfiguredPetOptions_fn = function(
|
|
3154
|
-
if (!
|
|
3155
|
-
|
|
3156
|
-
}
|
|
3157
|
-
if (__privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this, options) === "pet" && !chatkitTypes.normalizePetOptions(options.pet ?? null)) {
|
|
3158
|
-
return typeof options.pet === "object" ? { ...options.pet, enabled: true } : true;
|
|
3159
|
-
}
|
|
3160
|
-
return options.pet ?? null;
|
|
3206
|
+
getConfiguredPetOptions_fn = function() {
|
|
3207
|
+
if (!__privateGet(this, _opts)) return null;
|
|
3208
|
+
return __privateMethod(this, _ChatKitElementBase_instances, effectivePet_fn).call(this, __privateGet(this, _opts)) ?? (__privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) === "pet" ? true : null);
|
|
3161
3209
|
};
|
|
3162
3210
|
mergeConfiguredPetPositionDefaults_fn = function(pet) {
|
|
3163
3211
|
if (!pet) {
|
|
@@ -3185,9 +3233,41 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3185
3233
|
}
|
|
3186
3234
|
};
|
|
3187
3235
|
};
|
|
3236
|
+
effectivePet_fn = function(options) {
|
|
3237
|
+
const pet = options.pet;
|
|
3238
|
+
if (options.displayMode !== "pet" || __privateGet(this, _launcherVisible) === __privateGet(this, _hostLauncherEnabled)) {
|
|
3239
|
+
return pet;
|
|
3240
|
+
}
|
|
3241
|
+
return typeof pet === "object" ? { ...pet, enabled: __privateGet(this, _launcherVisible) } : __privateGet(this, _launcherVisible);
|
|
3242
|
+
};
|
|
3243
|
+
innerOptions_fn = function(options) {
|
|
3244
|
+
return removeMethods({
|
|
3245
|
+
...options,
|
|
3246
|
+
pet: __privateMethod(this, _ChatKitElementBase_instances, effectivePet_fn).call(this, options)
|
|
3247
|
+
});
|
|
3248
|
+
};
|
|
3249
|
+
updateFrameOptions_fn = function() {
|
|
3250
|
+
__privateGet(this, _loaded).then(() => {
|
|
3251
|
+
if (__privateGet(this, _opts))
|
|
3252
|
+
__privateGet(this, _messenger).commands.setOptions(__privateMethod(this, _ChatKitElementBase_instances, innerOptions_fn).call(this, __privateGet(this, _opts)));
|
|
3253
|
+
});
|
|
3254
|
+
};
|
|
3255
|
+
isLauncherHidden_fn = function() {
|
|
3256
|
+
return __privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) === "pet" && !__privateGet(this, _launcherVisible);
|
|
3257
|
+
};
|
|
3258
|
+
requestLauncherVisibility_fn = function(visible) {
|
|
3259
|
+
__privateSet(this, _launcherVisible, visible);
|
|
3260
|
+
__privateMethod(this, _ChatKitElementBase_instances, syncPetOverlayOptions_fn).call(this);
|
|
3261
|
+
__privateMethod(this, _ChatKitElementBase_instances, updateFrameOptions_fn).call(this);
|
|
3262
|
+
this.dispatchEvent(
|
|
3263
|
+
new CustomEvent("chatkit.pet.launcher.visibility.change", {
|
|
3264
|
+
detail: { visible }
|
|
3265
|
+
})
|
|
3266
|
+
);
|
|
3267
|
+
};
|
|
3188
3268
|
getOverlayPetOptions_fn = function() {
|
|
3189
3269
|
var _a2;
|
|
3190
|
-
if (__privateGet(this, _petClosedByContextMenu) || ((_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.pet) === false && __privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) !== "pet") {
|
|
3270
|
+
if (__privateMethod(this, _ChatKitElementBase_instances, isLauncherHidden_fn).call(this) || __privateGet(this, _petClosedByContextMenu) || ((_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.pet) === false && __privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) !== "pet") {
|
|
3191
3271
|
return null;
|
|
3192
3272
|
}
|
|
3193
3273
|
let pet;
|
|
@@ -3197,7 +3277,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3197
3277
|
pet = __privateMethod(this, _ChatKitElementBase_instances, getConfiguredPetOptions_fn).call(this);
|
|
3198
3278
|
}
|
|
3199
3279
|
if (__privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) === "pet" && !chatkitTypes.normalizePetOptions(pet ?? null)) {
|
|
3200
|
-
pet =
|
|
3280
|
+
pet = __privateMethod(this, _ChatKitElementBase_instances, getConfiguredPetOptions_fn).call(this);
|
|
3201
3281
|
}
|
|
3202
3282
|
return __privateMethod(this, _ChatKitElementBase_instances, resolveOverlayPetOptions_fn).call(this, pet);
|
|
3203
3283
|
};
|
|
@@ -3232,19 +3312,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3232
3312
|
imageRendering: normalized.imageRendering
|
|
3233
3313
|
};
|
|
3234
3314
|
};
|
|
3235
|
-
getFrameOptions_fn = function(options) {
|
|
3236
|
-
const pet = __privateMethod(this, _ChatKitElementBase_instances, getConfiguredPetOptions_fn).call(this, options);
|
|
3237
|
-
if (pet === (options.pet ?? null)) {
|
|
3238
|
-
return options;
|
|
3239
|
-
}
|
|
3240
|
-
const nextOptions = { ...options };
|
|
3241
|
-
if (pet === null) {
|
|
3242
|
-
delete nextOptions.pet;
|
|
3243
|
-
} else {
|
|
3244
|
-
nextOptions.pet = pet;
|
|
3245
|
-
}
|
|
3246
|
-
return nextOptions;
|
|
3247
|
-
};
|
|
3248
3315
|
setLauncherOpen_fn = function(open) {
|
|
3249
3316
|
__privateSet(this, _launcherOpen, open);
|
|
3250
3317
|
if (open) {
|
|
@@ -3263,9 +3330,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3263
3330
|
}
|
|
3264
3331
|
};
|
|
3265
3332
|
syncPetOverlayOptions_fn = function() {
|
|
3266
|
-
var _a2;
|
|
3333
|
+
var _a2, _b2, _c2;
|
|
3334
|
+
if (__privateMethod(this, _ChatKitElementBase_instances, isLauncherHidden_fn).call(this)) __privateMethod(this, _ChatKitElementBase_instances, setLauncherOpen_fn).call(this, false);
|
|
3267
3335
|
const overlayPetOptions = __privateMethod(this, _ChatKitElementBase_instances, getOverlayPetOptions_fn).call(this);
|
|
3268
3336
|
__privateGet(this, _petOverlay).setOptions(overlayPetOptions, (_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.theme);
|
|
3337
|
+
__privateGet(this, _petOverlay).setReopenVisible(
|
|
3338
|
+
__privateMethod(this, _ChatKitElementBase_instances, isLauncherHidden_fn).call(this),
|
|
3339
|
+
typeof ((_b2 = __privateGet(this, _opts)) == null ? void 0 : _b2.pet) === "object" ? (_c2 = __privateGet(this, _opts).pet.position) == null ? void 0 : _c2.zIndex : void 0
|
|
3340
|
+
);
|
|
3269
3341
|
if (!overlayPetOptions) {
|
|
3270
3342
|
__privateMethod(this, _ChatKitElementBase_instances, setChatMinimizedToPet_fn).call(this, false);
|
|
3271
3343
|
}
|
|
@@ -3286,14 +3358,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3286
3358
|
__privateGet(this, _loaded).then(() => this.focusComposer()).catch(() => void 0);
|
|
3287
3359
|
};
|
|
3288
3360
|
handlePetClose_fn = function() {
|
|
3289
|
-
__privateSet(this, _petClosedByContextMenu, true);
|
|
3290
|
-
__privateSet(this, _framePetOptionsOverride, null);
|
|
3291
|
-
__privateMethod(this, _ChatKitElementBase_instances, setChatMinimizedToPet_fn).call(this, false);
|
|
3292
3361
|
__privateMethod(this, _ChatKitElementBase_instances, setLauncherOpen_fn).call(this, false);
|
|
3293
|
-
__privateGet(this, _petOverlay).setOptions(null);
|
|
3294
3362
|
if (__privateMethod(this, _ChatKitElementBase_instances, getDisplayMode_fn).call(this) === "pet") {
|
|
3363
|
+
__privateMethod(this, _ChatKitElementBase_instances, requestLauncherVisibility_fn).call(this, false);
|
|
3295
3364
|
return;
|
|
3296
3365
|
}
|
|
3366
|
+
__privateSet(this, _petClosedByContextMenu, true);
|
|
3367
|
+
__privateSet(this, _framePetOptionsOverride, null);
|
|
3368
|
+
__privateMethod(this, _ChatKitElementBase_instances, syncPetOverlayOptions_fn).call(this);
|
|
3297
3369
|
__privateGet(this, _loaded).then(() => __privateGet(this, _messenger).commands.setPetEnabled({ enabled: false })).catch(() => void 0);
|
|
3298
3370
|
};
|
|
3299
3371
|
handlePetReply_fn = async function(text) {
|
|
@@ -3346,7 +3418,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3346
3418
|
const frameURL = new URL(__privateMethod(this, _ChatKitElementBase_instances, getFrameUrl_fn).call(this), window.location.origin);
|
|
3347
3419
|
__privateGet(this, _messenger).setTargetOrigin(frameURL.origin);
|
|
3348
3420
|
frameURL.hash = encodeBase64({
|
|
3349
|
-
options:
|
|
3421
|
+
options: __privateMethod(this, _ChatKitElementBase_instances, innerOptions_fn).call(this, __privateGet(this, _opts)),
|
|
3350
3422
|
referrer: window.location.origin,
|
|
3351
3423
|
profile: this.profile,
|
|
3352
3424
|
...__privateGet(this, _channelId) ? { channelId: __privateGet(this, _channelId) } : {}
|
|
@@ -3395,6 +3467,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3395
3467
|
"chatkit.response.start": "onResponseStart",
|
|
3396
3468
|
"chatkit.log": "onLog",
|
|
3397
3469
|
"chatkit.thread.change": "onThreadChange",
|
|
3470
|
+
"chatkit.pet.launcher.visibility.change": "onPetLauncherVisibilityChange",
|
|
3398
3471
|
"chatkit.project.change": "onProjectChange",
|
|
3399
3472
|
"chatkit.connectors.change": "onConnectorsChange",
|
|
3400
3473
|
"chatkit.thread.load.start": "onThreadLoadStart",
|
|
@@ -3408,6 +3481,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3408
3481
|
"chatkit.response.start": "responseStart",
|
|
3409
3482
|
"chatkit.log": "log",
|
|
3410
3483
|
"chatkit.thread.change": "threadChange",
|
|
3484
|
+
"chatkit.pet.launcher.visibility.change": "petLauncherVisibilityChange",
|
|
3411
3485
|
"chatkit.project.change": "projectChange",
|
|
3412
3486
|
"chatkit.connectors.change": "connectorsChange",
|
|
3413
3487
|
"chatkit.thread.load.start": "threadLoadStart",
|
|
@@ -3474,6 +3548,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3474
3548
|
responseStart: { parameters: { detail: { type: "object" } } },
|
|
3475
3549
|
log: { parameters: { detail: { type: "object" } } },
|
|
3476
3550
|
threadChange: { parameters: { detail: { type: "object" } } },
|
|
3551
|
+
petLauncherVisibilityChange: { parameters: { detail: { type: "object" } } },
|
|
3477
3552
|
threadLoadStart: { parameters: { detail: { type: "object" } } },
|
|
3478
3553
|
threadLoadEnd: { parameters: { detail: { type: "object" } } },
|
|
3479
3554
|
ready: { parameters: { detail: { type: "object" } } },
|