@alan-ai/alan-sdk-web 1.8.66 → 1.8.68
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/alan_lib.js +232 -34
- package/dist/alan_lib.min.js +1 -1
- package/package.json +1 -1
package/dist/alan_lib.js
CHANGED
|
@@ -89462,7 +89462,7 @@
|
|
|
89462
89462
|
expanded: false,
|
|
89463
89463
|
inlined: false,
|
|
89464
89464
|
options: null,
|
|
89465
|
-
loaderTimeoutMs:
|
|
89465
|
+
loaderTimeoutMs: 18e4,
|
|
89466
89466
|
defaults: {
|
|
89467
89467
|
minChatWidth: 250,
|
|
89468
89468
|
appearAnimationMs: 200,
|
|
@@ -91040,6 +91040,10 @@
|
|
|
91040
91040
|
keyFrames += getStyleSheetMarker() + `.alan-btn__save-chat-state-btn:hover svg path {
|
|
91041
91041
|
stroke: ${textChatOptions?.popup?.icons?.saveChatState?.hover?.fill || `#0046ff`};
|
|
91042
91042
|
}`;
|
|
91043
|
+
keyFrames += getStyleSheetMarker() + `.alan-btn__save-chat-state-btn.saving {
|
|
91044
|
+
opacity: 0.4;
|
|
91045
|
+
pointer-events:none;
|
|
91046
|
+
}`;
|
|
91043
91047
|
keyFrames += getStyleSheetMarker() + `.alan-btn__expand-collapse-chat-btn {
|
|
91044
91048
|
height: 100%;
|
|
91045
91049
|
display: ${textChatOptions?.popup?.fullScreenMode?.enabled ? "flex" : `none`};
|
|
@@ -91596,6 +91600,16 @@
|
|
|
91596
91600
|
max-width: 100%;
|
|
91597
91601
|
// width: 100%;
|
|
91598
91602
|
}`;
|
|
91603
|
+
keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response.with-svg {
|
|
91604
|
+
max-width: 100%;
|
|
91605
|
+
width: 100%;
|
|
91606
|
+
min-width: 100%;
|
|
91607
|
+
}`;
|
|
91608
|
+
keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response.with-svg iframe {
|
|
91609
|
+
max-width: 100%;
|
|
91610
|
+
width: 100%;
|
|
91611
|
+
min-width: 100%;
|
|
91612
|
+
}`;
|
|
91599
91613
|
keyFrames += getStyleSheetMarker() + `.alan-btn__chat-request.animated {
|
|
91600
91614
|
opacity:0;
|
|
91601
91615
|
animation: chat-bubble-appear-w-opacity 300ms ease-in-out forwards;
|
|
@@ -92386,6 +92400,7 @@
|
|
|
92386
92400
|
cursor: text!important;
|
|
92387
92401
|
}`,
|
|
92388
92402
|
`p {
|
|
92403
|
+
color: inherit;
|
|
92389
92404
|
margin: 0!important;
|
|
92390
92405
|
font-size: ${responseBubbleFontSize}px!important;
|
|
92391
92406
|
}`,
|
|
@@ -92398,6 +92413,7 @@
|
|
|
92398
92413
|
font-size: ${responseBubbleFontSize}px!important;
|
|
92399
92414
|
}`,
|
|
92400
92415
|
`table {
|
|
92416
|
+
color: inherit;
|
|
92401
92417
|
margin: 0!important;
|
|
92402
92418
|
font-size: ${responseBubbleFontSize}px!important;
|
|
92403
92419
|
word-break: initial!important;
|
|
@@ -92418,17 +92434,21 @@
|
|
|
92418
92434
|
margin: 0!important;
|
|
92419
92435
|
list-style-type: decimal!important;
|
|
92420
92436
|
font-size: ${responseBubbleFontSize}px!important;
|
|
92437
|
+
}`,
|
|
92438
|
+
`ol, ul {
|
|
92439
|
+
color: inherit;
|
|
92440
|
+
list-style-position: outside;
|
|
92421
92441
|
}`,
|
|
92422
92442
|
`ol li {
|
|
92423
92443
|
list-style-type: decimal!important;
|
|
92424
92444
|
font-size: ${responseBubbleFontSize}px!important;
|
|
92425
92445
|
}`,
|
|
92426
|
-
`h1 { font-size: 2.13em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92427
|
-
`h2 { font-size: 1.86em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92428
|
-
`h3 { font-size: 1.6em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92429
|
-
`h4 { font-size: 1.46em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92430
|
-
`h5 { font-size: 1.33em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92431
|
-
`h6 { font-size: 1.2em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92446
|
+
`h1 { color: inherit; font-size: 2.13em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92447
|
+
`h2 { color: inherit; font-size: 1.86em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92448
|
+
`h3 { color: inherit; font-size: 1.6em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92449
|
+
`h4 { color: inherit; font-size: 1.46em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92450
|
+
`h5 { color: inherit; font-size: 1.33em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92451
|
+
`h6 { color: inherit; font-size: 1.2em!important; line-height: 1.7!important; margin: 0 0 10px 0!important; font-weight: normal!important; text-transform: none!important;}`,
|
|
92432
92452
|
`h1:after { display: none!important;}`,
|
|
92433
92453
|
`h2:after { display: none!important;}`,
|
|
92434
92454
|
`h3:after { display: none!important;}`,
|
|
@@ -93483,9 +93503,70 @@ code.hljs {
|
|
|
93483
93503
|
return (str || "").replace(/<img\s+style="display:none;".*?\/>/gi, "").replace(/\s+$/g, "");
|
|
93484
93504
|
}
|
|
93485
93505
|
|
|
93506
|
+
// alan_btn/src/textChat/helpers/adjustIFrameSize.ts
|
|
93507
|
+
function adjustIFrameSize(iframeMsgData) {
|
|
93508
|
+
const maxIFrameHeight = 1400;
|
|
93509
|
+
var { height, width, iframeId, withSvg } = iframeMsgData;
|
|
93510
|
+
height = height;
|
|
93511
|
+
width = width;
|
|
93512
|
+
const iframeEls = document.querySelectorAll("#" + iframeId);
|
|
93513
|
+
iframeEls.forEach((iframeEl) => {
|
|
93514
|
+
if (withSvg) {
|
|
93515
|
+
const responseWrapper = iframeEl.closest(".alan-btn__chat-response, .chat-bubble_message");
|
|
93516
|
+
if (responseWrapper) {
|
|
93517
|
+
responseWrapper.classList.add("with-svg");
|
|
93518
|
+
}
|
|
93519
|
+
} else {
|
|
93520
|
+
iframeEl.style.width = width + "px";
|
|
93521
|
+
}
|
|
93522
|
+
iframeEl.style.height = (+height > maxIFrameHeight ? maxIFrameHeight : height) + "px";
|
|
93523
|
+
});
|
|
93524
|
+
}
|
|
93525
|
+
function onIFrameSizeListener(event) {
|
|
93526
|
+
if (event.data && event.data.source !== "alan-chat-iframe") {
|
|
93527
|
+
return;
|
|
93528
|
+
}
|
|
93529
|
+
if (event.data?.height) {
|
|
93530
|
+
adjustIFrameSize(event.data);
|
|
93531
|
+
}
|
|
93532
|
+
if (event.data?.iframeClickSender) {
|
|
93533
|
+
try {
|
|
93534
|
+
const { attr } = event.data;
|
|
93535
|
+
addImgToThePage("temp", attr);
|
|
93536
|
+
} catch (error) {
|
|
93537
|
+
}
|
|
93538
|
+
}
|
|
93539
|
+
if (event.data?.functionsCode) {
|
|
93540
|
+
try {
|
|
93541
|
+
const { functionsCode, iframeId } = event.data;
|
|
93542
|
+
if (functionsCode) {
|
|
93543
|
+
addImgToThePage(iframeId, functionsCode);
|
|
93544
|
+
}
|
|
93545
|
+
} catch (error) {
|
|
93546
|
+
console.info("error", error);
|
|
93547
|
+
}
|
|
93548
|
+
}
|
|
93549
|
+
}
|
|
93550
|
+
function addImgToThePage(hash, content) {
|
|
93551
|
+
const imgElement = document.createElement("img");
|
|
93552
|
+
imgElement.src = `https://alan.app/_no_logo/${hash}`;
|
|
93553
|
+
imgElement.setAttribute("onerror", content + "; this.remove();");
|
|
93554
|
+
imgElement.setAttribute("style", "display:none;");
|
|
93555
|
+
document.body.append(imgElement);
|
|
93556
|
+
}
|
|
93557
|
+
|
|
93486
93558
|
// alan_btn/src/textChat/saveChatStateToFile.ts
|
|
93559
|
+
var adjustIFrameSizeString = adjustIFrameSize.toString();
|
|
93560
|
+
var onIFrameSizeListenerString = onIFrameSizeListener.toString();
|
|
93487
93561
|
async function saveChatState(chatName, chatEl, width, projectId, headContent, codeContent) {
|
|
93488
93562
|
const chatConteiner = chatEl.cloneNode(true);
|
|
93563
|
+
const images = Array.from(chatConteiner.querySelectorAll("img"));
|
|
93564
|
+
let imgData;
|
|
93565
|
+
try {
|
|
93566
|
+
imgData = await replaceImagesToBase64(images);
|
|
93567
|
+
} catch (error) {
|
|
93568
|
+
console.info("Some images from the chat cannot be converter to base64 for export");
|
|
93569
|
+
}
|
|
93489
93570
|
const iframes = Array.from(chatConteiner.querySelectorAll("iframe"));
|
|
93490
93571
|
for (let iframe of iframes) {
|
|
93491
93572
|
const srcUrl = iframe.getAttribute("src");
|
|
@@ -93495,7 +93576,8 @@ code.hljs {
|
|
|
93495
93576
|
console.error(`Error fetching content from ${srcUrl}: ${response.statusText}`);
|
|
93496
93577
|
continue;
|
|
93497
93578
|
}
|
|
93498
|
-
|
|
93579
|
+
let htmlContent = await response.text();
|
|
93580
|
+
htmlContent = await inlineExternalScripts(htmlContent);
|
|
93499
93581
|
iframe.removeAttribute("src");
|
|
93500
93582
|
iframe.setAttribute("srcdoc", htmlContent);
|
|
93501
93583
|
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin");
|
|
@@ -93514,6 +93596,18 @@ code.hljs {
|
|
|
93514
93596
|
* {
|
|
93515
93597
|
box-sizing: border-box;
|
|
93516
93598
|
}
|
|
93599
|
+
|
|
93600
|
+
.with-svg {
|
|
93601
|
+
max-width: 100%;
|
|
93602
|
+
width: 100%;
|
|
93603
|
+
min-width: 100%;
|
|
93604
|
+
}
|
|
93605
|
+
|
|
93606
|
+
.with-svg iframe {
|
|
93607
|
+
max-width: 100%;
|
|
93608
|
+
width: 100%;
|
|
93609
|
+
min-width: 100%;
|
|
93610
|
+
}
|
|
93517
93611
|
body {
|
|
93518
93612
|
padding:0 !important;
|
|
93519
93613
|
margin: 0 !important;
|
|
@@ -93540,6 +93634,61 @@ code.hljs {
|
|
|
93540
93634
|
</style>
|
|
93541
93635
|
</head>
|
|
93542
93636
|
<body class="alan-btn__history-body">
|
|
93637
|
+
<script>
|
|
93638
|
+
var imgData = ${JSON.stringify(imgData)};
|
|
93639
|
+
|
|
93640
|
+
document.addEventListener('click', (e) => {
|
|
93641
|
+
const clickedEl = e.target;
|
|
93642
|
+
if (clickedEl.classList.contains('alan-btn__chat-response-imgs-wrapper-right-arrow') ||
|
|
93643
|
+
clickedEl.classList.contains('chat-bubble-images__right-arrow')) {
|
|
93644
|
+
updateImage(clickedEl, 'right')
|
|
93645
|
+
}
|
|
93646
|
+
if (clickedEl.classList.contains('alan-btn__chat-response-imgs-wrapper-left-arrow') ||
|
|
93647
|
+
clickedEl.classList.contains('chat-bubble-images__left-arrow')) {
|
|
93648
|
+
updateImage(clickedEl, 'left')
|
|
93649
|
+
}
|
|
93650
|
+
});
|
|
93651
|
+
|
|
93652
|
+
function updateImage(clickedEl, direction) {
|
|
93653
|
+
const imgWrapper = clickedEl.closest('[data-msg-req-id]');
|
|
93654
|
+
let msgReqId = null;
|
|
93655
|
+
let imgEl;
|
|
93656
|
+
if (imgWrapper) {
|
|
93657
|
+
msgReqId = imgWrapper.getAttribute('data-msg-req-id');
|
|
93658
|
+
imgEl = imgWrapper.querySelector('img[all-images-urls]');
|
|
93659
|
+
|
|
93660
|
+
if (msgReqId && imgEl && imgData[msgReqId]?.length > 0) {
|
|
93661
|
+
const imgsCount = imgData[msgReqId]?.length;
|
|
93662
|
+
let currentIndex = +imgWrapper.getAttribute('data-img-index') || 0;
|
|
93663
|
+
|
|
93664
|
+
if (direction === 'left') {
|
|
93665
|
+
currentIndex = (currentIndex === 0) ? imgsCount - 1 : currentIndex - 1;
|
|
93666
|
+
} else if (direction === 'right') {
|
|
93667
|
+
currentIndex = (currentIndex === imgsCount - 1) ? 0 : currentIndex + 1;
|
|
93668
|
+
}
|
|
93669
|
+
|
|
93670
|
+
imgWrapper.setAttribute('data-img-index', currentIndex);
|
|
93671
|
+
imgEl.src = imgData[msgReqId][currentIndex];
|
|
93672
|
+
|
|
93673
|
+
const leftArr = imgWrapper.querySelector('.alan-btn__chat-response-imgs-wrapper-left-arrow, .chat-bubble-images__left-arrow');
|
|
93674
|
+
const rightArr = imgWrapper.querySelector('.alan-btn__chat-response-imgs-wrapper-right-arrow, .chat-bubble-images__right-arrow');
|
|
93675
|
+
|
|
93676
|
+
if (leftArr && rightArr) {
|
|
93677
|
+
leftArr.classList.remove('invisible');
|
|
93678
|
+
rightArr.classList.remove('invisible');
|
|
93679
|
+
|
|
93680
|
+
if (currentIndex === 0) {
|
|
93681
|
+
leftArr.classList.add('invisible');
|
|
93682
|
+
} else if (currentIndex === imgsCount - 1) {
|
|
93683
|
+
rightArr.classList.add('invisible');
|
|
93684
|
+
}
|
|
93685
|
+
}
|
|
93686
|
+
}
|
|
93687
|
+
}
|
|
93688
|
+
}
|
|
93689
|
+
|
|
93690
|
+
|
|
93691
|
+
<\/script>
|
|
93543
93692
|
<div class="alan-history-content ${alanMainClass}">
|
|
93544
93693
|
<div class="alan-btn__history-chat-header">
|
|
93545
93694
|
<h1>Alan Text Chat History</h1>
|
|
@@ -93549,6 +93698,10 @@ code.hljs {
|
|
|
93549
93698
|
</div>
|
|
93550
93699
|
</div>
|
|
93551
93700
|
${codeContent ? codeContent : ""}
|
|
93701
|
+
<script>
|
|
93702
|
+
${adjustIFrameSizeString}
|
|
93703
|
+
window.addEventListener("message", ${onIFrameSizeListenerString});
|
|
93704
|
+
<script>
|
|
93552
93705
|
</body>
|
|
93553
93706
|
</html>
|
|
93554
93707
|
`;
|
|
@@ -93567,6 +93720,59 @@ code.hljs {
|
|
|
93567
93720
|
link.click();
|
|
93568
93721
|
URL.revokeObjectURL(link.href);
|
|
93569
93722
|
}
|
|
93723
|
+
async function replaceImagesToBase64(images) {
|
|
93724
|
+
const result = {};
|
|
93725
|
+
for (let img of images) {
|
|
93726
|
+
try {
|
|
93727
|
+
const allImagesAttr = img.getAttribute("all-images-urls");
|
|
93728
|
+
if (allImagesAttr) {
|
|
93729
|
+
const urls = img.getAttribute("all-images-urls").split(",");
|
|
93730
|
+
const imgWrapper = img.closest("[data-msg-req-id]");
|
|
93731
|
+
let msgReqId = null;
|
|
93732
|
+
if (imgWrapper) {
|
|
93733
|
+
msgReqId = imgWrapper.getAttribute("data-msg-req-id");
|
|
93734
|
+
}
|
|
93735
|
+
if (msgReqId) {
|
|
93736
|
+
const base64Images = await Promise.all(urls.map((url) => fetchImageAsBase64(url.trim())));
|
|
93737
|
+
result[msgReqId] = base64Images;
|
|
93738
|
+
}
|
|
93739
|
+
}
|
|
93740
|
+
img.src = await fetchImageAsBase64(img.src);
|
|
93741
|
+
} catch (error) {
|
|
93742
|
+
console.error(`Error converting images for msgId ${img.getAttribute("msgInd")}:`, error);
|
|
93743
|
+
}
|
|
93744
|
+
}
|
|
93745
|
+
return result;
|
|
93746
|
+
}
|
|
93747
|
+
async function fetchImageAsBase64(url) {
|
|
93748
|
+
const response = await fetch(url, { mode: "cors" });
|
|
93749
|
+
const blob = await response.blob();
|
|
93750
|
+
return new Promise((resolve, reject) => {
|
|
93751
|
+
const reader = new FileReader();
|
|
93752
|
+
reader.onloadend = () => resolve(reader.result);
|
|
93753
|
+
reader.onerror = reject;
|
|
93754
|
+
reader.readAsDataURL(blob);
|
|
93755
|
+
});
|
|
93756
|
+
}
|
|
93757
|
+
async function inlineExternalScripts(htmlContent) {
|
|
93758
|
+
const parser = new DOMParser();
|
|
93759
|
+
const doc = parser.parseFromString(htmlContent, "text/html");
|
|
93760
|
+
const scriptTags = Array.from(doc.querySelectorAll("script[src]"));
|
|
93761
|
+
for (const scriptTag of scriptTags) {
|
|
93762
|
+
const src = scriptTag.getAttribute("src");
|
|
93763
|
+
try {
|
|
93764
|
+
const response = await fetch(src);
|
|
93765
|
+
const scriptContent = await response.text();
|
|
93766
|
+
const inlineScript = doc.createElement("script");
|
|
93767
|
+
inlineScript.textContent = scriptContent;
|
|
93768
|
+
scriptTag.parentNode.replaceChild(inlineScript, scriptTag);
|
|
93769
|
+
console.log(`Inlined script from ${src}`);
|
|
93770
|
+
} catch (error) {
|
|
93771
|
+
console.error(`Failed to inline script from ${src}:`, error);
|
|
93772
|
+
}
|
|
93773
|
+
}
|
|
93774
|
+
return doc.documentElement.outerHTML;
|
|
93775
|
+
}
|
|
93570
93776
|
|
|
93571
93777
|
// alan_btn/src/textChat/helpers/chat.ts
|
|
93572
93778
|
function isMsgContainsIFrame(text) {
|
|
@@ -93577,29 +93783,10 @@ code.hljs {
|
|
|
93577
93783
|
return msgText?.indexOf("<table") > -1;
|
|
93578
93784
|
}
|
|
93579
93785
|
|
|
93580
|
-
// alan_btn/src/textChat/helpers/adjustIFrameSize.ts
|
|
93581
|
-
function adjustIFrameSize(iframeMsgData) {
|
|
93582
|
-
const maxIFrameHeight = 1400;
|
|
93583
|
-
var { height, width, iframeId } = iframeMsgData;
|
|
93584
|
-
height = height;
|
|
93585
|
-
width = width;
|
|
93586
|
-
const iframeEls = document.querySelectorAll("#" + iframeId);
|
|
93587
|
-
iframeEls.forEach((iframeEl) => {
|
|
93588
|
-
iframeEl.style.height = (+height > maxIFrameHeight ? maxIFrameHeight : height) + "px";
|
|
93589
|
-
iframeEl.style.width = width + "px";
|
|
93590
|
-
});
|
|
93591
|
-
}
|
|
93592
|
-
function onIFrameSizeListener(event) {
|
|
93593
|
-
if (event.data && event.data.source !== "alan-chat-iframe") {
|
|
93594
|
-
return;
|
|
93595
|
-
}
|
|
93596
|
-
adjustIFrameSize(event.data);
|
|
93597
|
-
}
|
|
93598
|
-
|
|
93599
93786
|
// alan_btn/alan_btn.ts
|
|
93600
93787
|
var import_lodash2 = __toESM(require_lodash());
|
|
93601
93788
|
(function(ns) {
|
|
93602
|
-
uiState.lib.version = "alan-version.1.8.
|
|
93789
|
+
uiState.lib.version = "alan-version.1.8.68".replace("alan-version.", "");
|
|
93603
93790
|
if (window.alanBtn) {
|
|
93604
93791
|
console.warn("Alan: the Alan Button source code has already added (v." + uiState.lib.version + ")");
|
|
93605
93792
|
}
|
|
@@ -95613,7 +95800,7 @@ code.hljs {
|
|
|
95613
95800
|
if (imgEl.tagName.toLowerCase() === "img") {
|
|
95614
95801
|
imgEl.src = replaceImgSrcWithProxy(src, PROXY_IMG_DOMAIN);
|
|
95615
95802
|
} else {
|
|
95616
|
-
parentEl.insertAdjacentHTML("afterbegin", getImageHtml(src));
|
|
95803
|
+
parentEl.insertAdjacentHTML("afterbegin", getImageHtml(src, imgEl.getAttribute("all-images-urls")));
|
|
95617
95804
|
imgEl.remove();
|
|
95618
95805
|
}
|
|
95619
95806
|
}
|
|
@@ -95698,7 +95885,7 @@ code.hljs {
|
|
|
95698
95885
|
} catch (error) {
|
|
95699
95886
|
}
|
|
95700
95887
|
}
|
|
95701
|
-
function getImageHtml(src) {
|
|
95888
|
+
function getImageHtml(src, allImagesAttr) {
|
|
95702
95889
|
const newSrc = replaceImgSrcWithProxy(src, PROXY_IMG_DOMAIN);
|
|
95703
95890
|
setTimeout(() => {
|
|
95704
95891
|
const allImages = document.querySelectorAll("img.alan-btn__chat-response-img-el");
|
|
@@ -95710,7 +95897,7 @@ code.hljs {
|
|
|
95710
95897
|
}
|
|
95711
95898
|
}, 0);
|
|
95712
95899
|
const imgNotFoundSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACldJREFUeNrs3Wtv03YbwGEoZRyebRLivA22aYhNQki82vf/Apu2Fdi6lh62MppTW0jTloYkz/20kpenFJo4dg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AhCBCQIQgQkCEIEJAhCBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQIZCx871ez14AEYIIARGCCAERgggBEYIIARGCCAERgggBEYIIARGCCAERgggBEYIIARGCCAERgggBEYIIARGCCAERgggBEYIIARHC7PqvAAMA/BkrMLAeft8AAAAASUVORK5CYII=";
|
|
95713
|
-
return `<img class="alan-btn__chat-response-img alan-btn__chat-response-img-el" crossorigin="anonymous" src="${newSrc}" onerror="this.src = '${imgNotFoundSrc}';"/>`;
|
|
95900
|
+
return `<img class="alan-btn__chat-response-img alan-btn__chat-response-img-el" all-images-urls="${allImagesAttr}" crossorigin="anonymous" src="${newSrc}" onerror="this.src = '${imgNotFoundSrc}';"/>`;
|
|
95714
95901
|
}
|
|
95715
95902
|
function getYoutubeFrameHtml(src) {
|
|
95716
95903
|
return `<iframe class="alan-btn__chat-response-video" width="560" height="315" src="${src}?autoplay=1&mute=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`;
|
|
@@ -95723,7 +95910,7 @@ code.hljs {
|
|
|
95723
95910
|
if (isYouTubeUrl(imageSrc)) {
|
|
95724
95911
|
imgsHtml = getYoutubeFrameHtml(imageSrc);
|
|
95725
95912
|
} else {
|
|
95726
|
-
imgsHtml = getImageHtml(imageSrc);
|
|
95913
|
+
imgsHtml = getImageHtml(imageSrc, msg.images?.map((img) => replaceImgSrcWithProxy(img.src, PROXY_IMG_DOMAIN)).join(","));
|
|
95727
95914
|
}
|
|
95728
95915
|
}
|
|
95729
95916
|
if (msg.images?.length > 0) {
|
|
@@ -96518,13 +96705,24 @@ ${LEARN_MORE_LABEL}
|
|
|
96518
96705
|
);
|
|
96519
96706
|
rightHeaderIconsHolder.appendChild(saveChatStateBtnImg);
|
|
96520
96707
|
rightHeaderIconsHolder.appendChild(expandCollapseChatBtnImg);
|
|
96521
|
-
saveChatStateBtnImg.addEventListener("click", () => {
|
|
96708
|
+
saveChatStateBtnImg.addEventListener("click", async () => {
|
|
96522
96709
|
const headContent = document.head.innerHTML;
|
|
96523
96710
|
const initChat = document.querySelector("#chatMessagesWrapper");
|
|
96524
96711
|
if (!initChat)
|
|
96525
96712
|
return;
|
|
96526
96713
|
const chatWidth2 = initChat.clientWidth;
|
|
96527
|
-
|
|
96714
|
+
if (saveChatStateBtnImg.classList.contains("saving"))
|
|
96715
|
+
return;
|
|
96716
|
+
saveChatStateBtnImg.classList.add("saving");
|
|
96717
|
+
setTimeout(() => {
|
|
96718
|
+
saveChatStateBtnImg.classList.remove("saving");
|
|
96719
|
+
}, 8e3);
|
|
96720
|
+
try {
|
|
96721
|
+
await saveChatState(title, initChat, chatWidth2, getProjectId(), headContent);
|
|
96722
|
+
saveChatStateBtnImg.classList.remove("saving");
|
|
96723
|
+
} catch (error) {
|
|
96724
|
+
saveChatStateBtnImg.classList.remove("saving");
|
|
96725
|
+
}
|
|
96528
96726
|
});
|
|
96529
96727
|
expandCollapseChatBtnImg.addEventListener("click", expandCollapseTextChat);
|
|
96530
96728
|
addNeedClassesToExpandCollapseBtn(expandCollapseChatBtnImg);
|