@blotoutio/providers-shop-gpt-sdk 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1778 -947
- package/index.d.ts +1 -0
- package/index.js +1778 -947
- package/index.mjs +1778 -947
- package/package.json +3 -1
package/index.js
CHANGED
@@ -426,6 +426,7 @@ var ProvidersShopGptSdk = (function () {
|
|
426
426
|
'showThreads',
|
427
427
|
'queryInteractions',
|
428
428
|
'promptClicked',
|
429
|
+
'customPromptClicked',
|
429
430
|
'productRecommendationClicked',
|
430
431
|
'blotoutLinkClicked',
|
431
432
|
]);
|
@@ -1114,7 +1115,7 @@ var ProvidersShopGptSdk = (function () {
|
|
1114
1115
|
|
1115
1116
|
const scrollBarStyles = i$4 `
|
1116
1117
|
::-webkit-scrollbar {
|
1117
|
-
width:
|
1118
|
+
width: 15px;
|
1118
1119
|
}
|
1119
1120
|
|
1120
1121
|
::-webkit-scrollbar-track {
|
@@ -1164,15 +1165,15 @@ var ProvidersShopGptSdk = (function () {
|
|
1164
1165
|
}
|
1165
1166
|
|
1166
1167
|
#shop-gpt-modal {
|
1167
|
-
right:
|
1168
|
-
bottom:
|
1169
|
-
height:
|
1168
|
+
right: 20px;
|
1169
|
+
bottom: 91px;
|
1170
|
+
height: calc(90% - 91px);
|
1170
1171
|
width: 35%;
|
1171
1172
|
min-width: 475px;
|
1172
|
-
|
1173
|
+
box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.1),
|
1174
|
+
0px 10px 10px -5px rgba(0, 0, 0, 0.04);
|
1175
|
+
border-radius: 24px;
|
1173
1176
|
overflow: hidden;
|
1174
|
-
box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12),
|
1175
|
-
0px 20px 20px 0px rgba(0, 0, 0, 0.08);
|
1176
1177
|
position: fixed;
|
1177
1178
|
z-index: 2000;
|
1178
1179
|
background: var(--shopgpt-white);
|
@@ -1180,10 +1181,11 @@ var ProvidersShopGptSdk = (function () {
|
|
1180
1181
|
@media screen and (max-width: 768px) {
|
1181
1182
|
min-height: unset;
|
1182
1183
|
min-width: unset;
|
1183
|
-
width:
|
1184
|
-
height:
|
1185
|
-
bottom:
|
1186
|
-
right:
|
1184
|
+
width: 100vw;
|
1185
|
+
height: 100vh;
|
1186
|
+
bottom: 0;
|
1187
|
+
right: 0;
|
1188
|
+
border-radius: 0;
|
1187
1189
|
}
|
1188
1190
|
}
|
1189
1191
|
|
@@ -1194,17 +1196,9 @@ var ProvidersShopGptSdk = (function () {
|
|
1194
1196
|
z-index: 1000;
|
1195
1197
|
|
1196
1198
|
button {
|
1197
|
-
|
1198
|
-
border:
|
1199
|
-
|
1200
|
-
width: 56px;
|
1201
|
-
height: 56px;
|
1202
|
-
background-color: var(--shopgpt-primary);
|
1203
|
-
border-radius: 50%;
|
1204
|
-
display: flex;
|
1205
|
-
justify-content: center;
|
1206
|
-
align-items: center;
|
1207
|
-
box-shadow: 0 0 4px 1px var(--shopgpt-white);
|
1199
|
+
background: unset;
|
1200
|
+
border: unset;
|
1201
|
+
padding: 0;
|
1208
1202
|
}
|
1209
1203
|
|
1210
1204
|
.chatbot-hover-text {
|
@@ -1222,9 +1216,7 @@ var ProvidersShopGptSdk = (function () {
|
|
1222
1216
|
right: calc(100% + 5px);
|
1223
1217
|
|
1224
1218
|
border-radius: 5px 5px 0px;
|
1225
|
-
background:
|
1226
|
-
box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1),
|
1227
|
-
0px 2px 4px -1px rgba(0, 0, 0, 0.06);
|
1219
|
+
background: white;
|
1228
1220
|
|
1229
1221
|
font-weight: 400;
|
1230
1222
|
line-height: 150%;
|
@@ -1346,9 +1338,8 @@ var ProvidersShopGptSdk = (function () {
|
|
1346
1338
|
const trashIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
1347
1339
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 1.125H11.25V2.25H6.75V1.125ZM2.25 3.375V4.5H3.375V15.75C3.375 16.0484 3.49353 16.3345 3.7045 16.5455C3.91548 16.7565 4.20163 16.875 4.5 16.875H13.5C13.7984 16.875 14.0845 16.7565 14.2955 16.5455C14.5065 16.3345 14.625 16.0484 14.625 15.75V4.5H15.75V3.375H2.25ZM4.5 15.75V4.5H13.5V15.75H4.5ZM6.75 6.75H7.875V13.5H6.75V6.75ZM10.125 6.75H11.25V13.5H10.125V6.75Z" fill="#A3B2C6"/>
|
1348
1340
|
</svg>`;
|
1349
|
-
const
|
1350
|
-
|
1351
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="18" viewBox="0 0 12 18" fill="none">
|
1341
|
+
const botIcon = (width, height) => b `
|
1342
|
+
<svg xmlns="http://www.w3.org/2000/svg" width=${width || '12'} height=${height || '18'} viewBox="0 0 12 18" fill="none">
|
1352
1343
|
<g clip-path="url(#clip0_12438_1597)">
|
1353
1344
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.0703335 0.211252C0.0351569 0.281773 0.0351562 0.374089 0.0351562 0.55872V17.2552C0.0351562 17.4398 0.0351569 17.5321 0.0703335 17.6026C0.101276 17.6647 0.150648 17.7151 0.211375 17.7468C0.280413 17.7826 0.37079 17.7826 0.551541 17.7826H1.75313C1.93388 17.7826 2.02425 17.7826 2.09329 17.7468C2.15402 17.7151 2.20339 17.6647 2.23433 17.6026C2.26951 17.5321 2.26951 17.4398 2.26951 17.2552V16.6659C3.28957 17.5011 4.58438 18.0007 5.99343 18.0007C9.2841 18.0007 11.9517 15.2758 11.9517 11.9145C11.9517 8.55319 9.2841 5.82832 5.99343 5.82832C4.58438 5.82832 3.28957 6.32793 2.26951 7.1632V0.55872C2.26951 0.374089 2.26951 0.281773 2.23433 0.211252C2.20339 0.149221 2.15402 0.0987883 2.09329 0.0671818C2.02425 0.03125 1.93388 0.03125 1.75313 0.03125H0.551541C0.37079 0.03125 0.280413 0.03125 0.211375 0.0671818C0.150648 0.0987883 0.101276 0.149221 0.0703335 0.211252ZM2.26951 11.9145C2.26951 14.0154 3.93677 15.7184 5.99343 15.7184C8.05007 15.7184 9.71735 14.0154 9.71735 11.9145C9.71735 9.81372 8.05007 8.11064 5.99343 8.11064C3.93677 8.11064 2.26951 9.81372 2.26951 11.9145Z" fill="#F25C2B"/>
|
1354
1345
|
</g>
|
@@ -1365,10 +1356,10 @@ var ProvidersShopGptSdk = (function () {
|
|
1365
1356
|
const closeBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="36" height="37" viewBox="0 0 36 37" fill="none">
|
1366
1357
|
<path d="M27 11.075L25.425 9.5L18 16.925L10.575 9.5L9 11.075L16.425 18.5L9 25.925L10.575 27.5L18 20.075L25.425 27.5L27 25.925L19.575 18.5L27 11.075Z" fill="#A3B2C6"/>
|
1367
1358
|
</svg>`;
|
1368
|
-
const leftBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
1359
|
+
const leftBtn$1 = b `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
1369
1360
|
<path d="M6.64645 2.64645L6.9954 2.2975L7.34889 2.64184L8.06389 3.33834L8.42613 3.69121L8.06918 4.04942L5.12908 7H14H14.5V7.5V8.5V9H14H5.1329L8.06839 11.9328L8.42264 12.2867L8.06818 12.6404L7.35318 13.3539L6.99963 13.7067L6.64645 13.3536L1.64645 8.35355L1.29289 8L1.64645 7.64645L6.64645 2.64645Z" fill="#4E647F" stroke="#4E647F"/>
|
1370
1361
|
</svg>`;
|
1371
|
-
const rightBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
1362
|
+
const rightBtn$1 = b `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
1372
1363
|
<path d="M9.35355 2.64645L9.0046 2.2975L8.65111 2.64184L7.93611 3.33834L7.57387 3.69121L7.93082 4.04942L10.8709 7H2H1.5V7.5V8.5V9H2H10.8671L7.93161 11.9328L7.57736 12.2867L7.93182 12.6404L8.64682 13.3539L9.00037 13.7067L9.35355 13.3536L14.3536 8.35355L14.7071 8L14.3536 7.64645L9.35355 2.64645Z" fill="#4E647F" stroke="#4E647F"/>
|
1373
1364
|
</svg>`;
|
1374
1365
|
const searchIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none">
|
@@ -1400,6 +1391,46 @@ var ProvidersShopGptSdk = (function () {
|
|
1400
1391
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M80.8045 32.827C81.748 32.827 82.5129 32.0538 82.5129 31.0999C82.5129 30.1461 81.748 29.3728 80.8045 29.3728C79.8609 29.3728 79.096 30.1461 79.096 31.0999C79.096 32.0538 79.8609 32.827 80.8045 32.827ZM80.8045 33.8633C82.3141 33.8633 83.538 32.6261 83.538 31.0999C83.538 29.5738 82.3141 28.3366 80.8045 28.3366C79.2948 28.3366 78.0709 29.5738 78.0709 31.0999C78.0709 32.6261 79.2948 33.8633 80.8045 33.8633Z" fill="#F25C2B"/>
|
1401
1392
|
<path d="M75.2265 25.6998C75.1436 25.6998 75.1021 25.6998 75.0705 25.7161C75.0426 25.7305 75.02 25.7534 75.0058 25.7815C74.9896 25.8135 74.9896 25.8555 74.9896 25.9393V26.9083H74.6394C74.5593 26.9083 74.5183 26.9086 74.4872 26.9247C74.4593 26.939 74.4367 26.9619 74.4225 26.99C74.4063 27.0221 74.4063 27.064 74.4063 27.1478V27.7051C74.4063 27.7889 74.4063 27.8308 74.4225 27.8628C74.4367 27.891 74.4593 27.9139 74.4872 27.9282C74.5188 27.9446 74.5603 27.9446 74.6432 27.9446H74.9896V32.0994H74.9882C74.9878 32.1063 74.9874 32.1131 74.987 32.12C74.9876 32.1359 74.9885 32.1518 74.9896 32.1676V32.2073L74.9918 32.2072C75.0376 33.0766 75.7476 33.7581 76.6088 33.7595C76.7762 33.7594 76.9423 33.733 77.1013 33.6816C77.1703 33.6593 77.2245 33.5768 77.2243 33.5035L77.2261 32.7371C77.2261 32.7257 77.224 32.7075 77.2211 32.6964C77.2206 32.6945 77.22 32.6924 77.2194 32.6903C77.2148 32.6737 77.2005 32.6492 77.1865 32.6391C77.1828 32.6365 77.1347 32.6088 77.0944 32.6334C77.0512 32.6536 77.0505 32.654 77.0498 32.6543C77.0388 32.6596 77.0016 32.6737 76.9842 32.6839C76.8335 32.7484 76.8109 32.7469 76.7666 32.7532C76.7363 32.7575 76.7058 32.7596 76.6752 32.7596C76.6174 32.7596 76.56 32.752 76.5042 32.7369C76.4485 32.7218 76.3949 32.6993 76.3449 32.6702C76.3181 32.6523 76.2927 32.6326 76.2687 32.6111C76.2546 32.6011 76.241 32.5905 76.2278 32.5793C76.2212 32.5744 76.2146 32.5693 76.2081 32.5641C76.2064 32.5618 76.2047 32.5596 76.203 32.5573C76.0832 32.4441 76.0151 32.2858 76.0147 32.12C76.0151 32.1146 76.0157 32.1092 76.0163 32.1039C76.0157 32.0999 76.0152 32.0959 76.0147 32.092V27.9446H76.9737C77.0566 27.9446 77.0981 27.9446 77.1298 27.9282C77.1576 27.9139 77.1803 27.891 77.1945 27.8628C77.2106 27.8308 77.2106 27.7889 77.2106 27.7051V27.1478C77.2106 27.064 77.2106 27.0221 77.1945 26.99C77.1803 26.9619 77.1576 26.939 77.1298 26.9247C77.0981 26.9083 77.0566 26.9083 76.9737 26.9083H76.0147V25.9393C76.0147 25.8555 76.0147 25.8135 75.9985 25.7815C75.9843 25.7534 75.9617 25.7305 75.9338 25.7161C75.9021 25.6998 75.8607 25.6998 75.7778 25.6998H75.2265Z" fill="#F25C2B"/>
|
1402
1393
|
<path d="M90.323 25.7117C90.2401 25.7117 90.1986 25.7117 90.1669 25.7281C90.1391 25.7424 90.1165 25.7653 90.1022 25.7934C90.0861 25.8255 90.0861 25.8674 90.0861 25.9512V26.9203H89.7359C89.6558 26.9203 89.6148 26.9205 89.5836 26.9366C89.5558 26.9509 89.5331 26.9738 89.5189 27.002C89.5028 27.034 89.5028 27.0759 89.5028 27.1597V27.717C89.5028 27.8008 89.5028 27.8427 89.5189 27.8748C89.5331 27.9029 89.5558 27.9258 89.5836 27.9402C89.6153 27.9565 89.6568 27.9565 89.7397 27.9565H90.0861V32.1113H90.0847C90.0843 32.1182 90.0838 32.1251 90.0835 32.1319C90.0841 32.1478 90.085 32.1637 90.0861 32.1795V32.2192L90.0883 32.2191C90.1341 33.0885 90.844 33.7701 91.7052 33.7715C91.8727 33.7713 92.0388 33.745 92.1978 33.6936C92.2668 33.6713 92.321 33.5887 92.3208 33.5154L92.3225 32.749C92.3226 32.7376 92.3205 32.7194 92.3176 32.7084C92.317 32.7064 92.3165 32.7043 92.3159 32.7022C92.3113 32.6856 92.297 32.6611 92.283 32.651C92.2793 32.6484 92.2311 32.6207 92.1908 32.6453C92.1477 32.6656 92.147 32.6659 92.1463 32.6662C92.1353 32.6715 92.0981 32.6856 92.0807 32.6958C91.9299 32.7603 91.9074 32.7589 91.8631 32.7651C91.8328 32.7694 91.8023 32.7716 91.7716 32.7716C91.7139 32.7716 91.6565 32.7639 91.6007 32.7488C91.5449 32.7337 91.4914 32.7113 91.4414 32.6821C91.4146 32.6643 91.3891 32.6445 91.3652 32.623C91.3511 32.613 91.3375 32.6024 91.3243 32.5912C91.3176 32.5863 91.3111 32.5812 91.3046 32.576C91.3029 32.5738 91.3012 32.5715 91.2995 32.5692C91.1797 32.456 91.1115 32.2977 91.1112 32.1319C91.1116 32.1265 91.1121 32.1212 91.1127 32.1158C91.1122 32.1118 91.1116 32.1079 91.1112 32.1039V27.9565H92.0702C92.1531 27.9565 92.1946 27.9565 92.2262 27.9402C92.2541 27.9258 92.2767 27.9029 92.2909 27.8748C92.3071 27.8427 92.3071 27.8008 92.3071 27.717V27.1597C92.3071 27.0759 92.3071 27.034 92.2909 27.002C92.2767 26.9738 92.2541 26.9509 92.2262 26.9366C92.1946 26.9203 92.1531 26.9203 92.0702 26.9203H91.1112V25.9512C91.1112 25.8674 91.1112 25.8255 91.095 25.7934C91.0808 25.7653 91.0582 25.7424 91.0303 25.7281C90.9986 25.7117 90.9572 25.7117 90.8743 25.7117H90.323Z" fill="#F25C2B"/>
|
1394
|
+
</svg>`;
|
1395
|
+
const thumbsUpBtn = b `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
1396
|
+
<g clip-path="url(#clip0_158_630)">
|
1397
|
+
<path d="M4.08317 5.83335V12.8334M8.74984 3.43002L8.1665 5.83335H11.5673C11.7485 5.83335 11.9271 5.87552 12.0891 5.95652C12.2511 6.03752 12.392 6.15512 12.5007 6.30002C12.6093 6.44492 12.6828 6.61312 12.7152 6.79132C12.7476 6.96952 12.7381 7.15281 12.6873 7.32669L11.3282 11.9934C11.2575 12.2357 11.1101 12.4486 10.9082 12.6C10.7062 12.7515 10.4606 12.8334 10.2082 12.8334H2.33317C2.02375 12.8334 1.72701 12.7104 1.50821 12.4916C1.28942 12.2729 1.1665 11.9761 1.1665 11.6667V7.00002C1.1665 6.6906 1.28942 6.39385 1.50821 6.17506C1.72701 5.95627 2.02375 5.83335 2.33317 5.83335H3.94317C4.16022 5.83324 4.37293 5.77258 4.55739 5.65819C4.74186 5.5438 4.89075 5.38023 4.98734 5.18585L6.99984 1.16669C7.27492 1.17009 7.54568 1.23562 7.79189 1.35837C8.03809 1.48112 8.25338 1.65792 8.42166 1.87556C8.58993 2.09319 8.70686 2.34605 8.76368 2.61522C8.82051 2.8844 8.81578 3.16293 8.74984 3.43002Z" stroke="#18181B" stroke-linecap="round" stroke-linejoin="round"/>
|
1398
|
+
</g>
|
1399
|
+
<defs>
|
1400
|
+
<clipPath id="clip0_158_630">
|
1401
|
+
<rect width="14" height="14" fill="white"/>
|
1402
|
+
</clipPath>
|
1403
|
+
</defs>
|
1404
|
+
</svg>`;
|
1405
|
+
const thumbsUpFilledBtn = b `<svg width="14" height="14" viewBox="0 0 14 14" fill="#18181B" xmlns="http://www.w3.org/2000/svg">
|
1406
|
+
<g clip-path="url(#clip0_158_630_1)">
|
1407
|
+
<path d="M4.08317 5.83335V12.8334M8.74984 3.43002L8.1665 5.83335H11.5673C11.7485 5.83335 11.9271 5.87552 12.0891 5.95652C12.2511 6.03752 12.392 6.15512 12.5007 6.30002C12.6093 6.44492 12.6828 6.61312 12.7152 6.79132C12.7476 6.96952 12.7381 7.15281 12.6873 7.32669L11.3282 11.9934C11.2575 12.2357 11.1101 12.4486 10.9082 12.6C10.7062 12.7515 10.4606 12.8334 10.2082 12.8334H2.33317C2.02375 12.8334 1.72701 12.7104 1.50821 12.4916C1.28942 12.2729 1.1665 11.9761 1.1665 11.6667V7.00002C1.1665 6.6906 1.28942 6.39385 1.50821 6.17506C1.72701 5.95627 2.02375 5.83335 2.33317 5.83335H3.94317C4.16022 5.83324 4.37293 5.77258 4.55739 5.65819C4.74186 5.5438 4.89075 5.38023 4.98734 5.18585L6.99984 1.16669C7.27492 1.17009 7.54568 1.23562 7.79189 1.35837C8.03809 1.48112 8.25338 1.65792 8.42166 1.87556C8.58993 2.09319 8.70686 2.34605 8.76368 2.61522C8.82051 2.8844 8.81578 3.16293 8.74984 3.43002Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
1408
|
+
</g>
|
1409
|
+
<defs>
|
1410
|
+
<clipPath id="clip0_158_630_1">
|
1411
|
+
<rect width="14" height="14" fill="white"/>
|
1412
|
+
</clipPath>
|
1413
|
+
</defs>
|
1414
|
+
</svg>`;
|
1415
|
+
const thumbsDownBtn = b `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
1416
|
+
<g clip-path="url(#clip0_158_651)">
|
1417
|
+
<path d="M9.9165 8.16669V1.16669M5.24979 10.57L5.83312 8.16669H2.43229C2.25117 8.16669 2.07254 8.12452 1.91054 8.04352C1.74854 7.96252 1.60763 7.84492 1.49896 7.70002C1.39029 7.55512 1.31684 7.38692 1.28444 7.20872C1.25204 7.03052 1.26158 6.84723 1.31229 6.67335L2.67146 2.00669C2.74214 1.76435 2.88951 1.55148 3.09146 1.40002C3.2934 1.24856 3.53903 1.16669 3.79146 1.16669H11.6665C11.9759 1.16669 12.2726 1.2896 12.4914 1.5084C12.7102 1.72719 12.8331 2.02393 12.8331 2.33335V7.00002C12.8331 7.30944 12.7102 7.60619 12.4914 7.82498C12.2726 8.04377 11.9759 8.16669 11.6665 8.16669H10.0565C9.83941 8.1668 9.6267 8.22746 9.44223 8.34185C9.25777 8.45624 9.10888 8.61981 9.01229 8.81419L6.99979 12.8334C6.7247 12.8299 6.45394 12.7644 6.20774 12.6417C5.96153 12.5189 5.74625 12.3421 5.57797 12.1245C5.40969 11.9068 5.29277 11.654 5.23594 11.3848C5.17912 11.1156 5.18385 10.8371 5.24979 10.57Z" stroke="#18181B" stroke-linecap="round" stroke-linejoin="round"/>
|
1418
|
+
</g>
|
1419
|
+
<defs>
|
1420
|
+
<clipPath id="clip0_158_651">
|
1421
|
+
<rect width="14" height="14" fill="white"/>
|
1422
|
+
</clipPath>
|
1423
|
+
</defs>
|
1424
|
+
</svg>`;
|
1425
|
+
const thumbsDownFilledBtn = b `<svg width="14" height="14" viewBox="0 0 14 14" fill="#18181B" xmlns="http://www.w3.org/2000/svg">
|
1426
|
+
<g clip-path="url(#clip0_158_651_1)">
|
1427
|
+
<path d="M9.9165 8.16669V1.16669M5.24979 10.57L5.83312 8.16669H2.43229C2.25117 8.16669 2.07254 8.12452 1.91054 8.04352C1.74854 7.96252 1.60763 7.84492 1.49896 7.70002C1.39029 7.55512 1.31684 7.38692 1.28444 7.20872C1.25204 7.03052 1.26158 6.84723 1.31229 6.67335L2.67146 2.00669C2.74214 1.76435 2.88951 1.55148 3.09146 1.40002C3.2934 1.24856 3.53903 1.16669 3.79146 1.16669H11.6665C11.9759 1.16669 12.2726 1.2896 12.4914 1.5084C12.7102 1.72719 12.8331 2.02393 12.8331 2.33335V7.00002C12.8331 7.30944 12.7102 7.60619 12.4914 7.82498C12.2726 8.04377 11.9759 8.16669 11.6665 8.16669H10.0565C9.83941 8.1668 9.6267 8.22746 9.44223 8.34185C9.25777 8.45624 9.10888 8.61981 9.01229 8.81419L6.99979 12.8334C6.7247 12.8299 6.45394 12.7644 6.20774 12.6417C5.96153 12.5189 5.74625 12.3421 5.57797 12.1245C5.40969 11.9068 5.29277 11.654 5.23594 11.3848C5.17912 11.1156 5.18385 10.8371 5.24979 10.57Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
1428
|
+
</g>
|
1429
|
+
<defs>
|
1430
|
+
<clipPath id="clip0_158_651_1">
|
1431
|
+
<rect width="14" height="14" fill="white"/>
|
1432
|
+
</clipPath>
|
1433
|
+
</defs>
|
1403
1434
|
</svg>`;
|
1404
1435
|
|
1405
1436
|
const chatThreadsStyles = i$4 `
|
@@ -1870,7 +1901,6 @@ var ProvidersShopGptSdk = (function () {
|
|
1870
1901
|
}
|
1871
1902
|
|
1872
1903
|
button {
|
1873
|
-
border-style: none;
|
1874
1904
|
cursor: pointer;
|
1875
1905
|
}
|
1876
1906
|
}
|
@@ -1880,19 +1910,28 @@ var ProvidersShopGptSdk = (function () {
|
|
1880
1910
|
gap: 16px;
|
1881
1911
|
cursor: pointer;
|
1882
1912
|
text-decoration: none;
|
1883
|
-
height: 100%;
|
1884
1913
|
|
1885
1914
|
img {
|
1886
|
-
width:
|
1887
|
-
height:
|
1915
|
+
width: 160px;
|
1916
|
+
height: 160px;
|
1888
1917
|
object-position: center;
|
1889
1918
|
object-fit: contain;
|
1919
|
+
border-radius: 8px;
|
1890
1920
|
}
|
1891
1921
|
}
|
1892
1922
|
|
1923
|
+
.product.modal {
|
1924
|
+
padding: 8px;
|
1925
|
+
gap: 6px;
|
1926
|
+
border-radius: 10px;
|
1927
|
+
background-color: #fff;
|
1928
|
+
box-sizing: border-box;
|
1929
|
+
border: 0.5px solid #cbd5e1;
|
1930
|
+
}
|
1931
|
+
|
1893
1932
|
.content {
|
1894
1933
|
display: flex;
|
1895
|
-
gap:
|
1934
|
+
gap: 10px;
|
1896
1935
|
flex-direction: column;
|
1897
1936
|
|
1898
1937
|
*:last-child {
|
@@ -1902,29 +1941,42 @@ var ProvidersShopGptSdk = (function () {
|
|
1902
1941
|
|
1903
1942
|
.product-name {
|
1904
1943
|
display: -webkit-box;
|
1905
|
-
color: #
|
1906
|
-
line-height: 150%;
|
1944
|
+
color: #1e293b;
|
1907
1945
|
max-width: 100%;
|
1908
|
-
-webkit-line-clamp:
|
1946
|
+
-webkit-line-clamp: 1;
|
1909
1947
|
-webkit-box-orient: vertical;
|
1910
1948
|
overflow: hidden;
|
1911
1949
|
text-overflow: ellipsis;
|
1912
1950
|
word-break: break-word;
|
1913
1951
|
white-space: normal;
|
1952
|
+
|
1953
|
+
opacity: 0.7;
|
1954
|
+
font-weight: 400;
|
1955
|
+
font-size: 12px;
|
1956
|
+
line-height: 16px;
|
1914
1957
|
}
|
1915
1958
|
|
1916
1959
|
.product-variation-details {
|
1917
|
-
color: #
|
1918
|
-
font-weight:
|
1919
|
-
|
1960
|
+
color: #000000;
|
1961
|
+
font-weight: 600;
|
1962
|
+
font-size: 12px;
|
1963
|
+
line-height: 22px;
|
1964
|
+
display: -webkit-box;
|
1965
|
+
-webkit-line-clamp: 1;
|
1966
|
+
-webkit-box-orient: vertical;
|
1967
|
+
overflow: hidden;
|
1968
|
+
text-overflow: ellipsis;
|
1969
|
+
word-break: break-word;
|
1970
|
+
white-space: normal;
|
1920
1971
|
}
|
1921
1972
|
|
1922
1973
|
.prices {
|
1923
1974
|
display: flex;
|
1924
1975
|
gap: 0 8px;
|
1925
|
-
font-weight:
|
1926
|
-
|
1927
|
-
|
1976
|
+
font-weight: 600;
|
1977
|
+
font-size: 12px;
|
1978
|
+
line-height: 16px;
|
1979
|
+
color: #020617;
|
1928
1980
|
|
1929
1981
|
.price-compared {
|
1930
1982
|
color: #a1a1aa;
|
@@ -1932,26 +1984,44 @@ var ProvidersShopGptSdk = (function () {
|
|
1932
1984
|
}
|
1933
1985
|
}
|
1934
1986
|
|
1935
|
-
.
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1987
|
+
.product-description {
|
1988
|
+
display: -webkit-box;
|
1989
|
+
-webkit-box-orient: vertical;
|
1990
|
+
-webkit-line-clamp: 2;
|
1991
|
+
overflow: hidden;
|
1992
|
+
text-overflow: ellipsis;
|
1993
|
+
word-break: break-word;
|
1994
|
+
white-space: normal;
|
1995
|
+
max-height: 48px;
|
1996
|
+
margin: 4px 0 6px;
|
1942
1997
|
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1998
|
+
font-weight: 400;
|
1999
|
+
line-height: 16px;
|
2000
|
+
font-size: 12px;
|
2001
|
+
color: #475569;
|
2002
|
+
}
|
2003
|
+
|
2004
|
+
.btn-quick-view {
|
2005
|
+
color: #fafafa;
|
2006
|
+
font-weight: 500;
|
2007
|
+
font-size: 12px;
|
2008
|
+
text-transform: uppercase;
|
2009
|
+
max-width: 160px;
|
2010
|
+
padding: 8px 12px;
|
2011
|
+
text-align: center;
|
2012
|
+
background: #18181b;
|
2013
|
+
border-radius: 6px;
|
2014
|
+
display: flex;
|
2015
|
+
align-items: center;
|
2016
|
+
gap: 8px;
|
1947
2017
|
|
1948
2018
|
&:hover {
|
1949
|
-
|
2019
|
+
opacity: 0.7;
|
1950
2020
|
}
|
1951
2021
|
}
|
1952
2022
|
|
1953
|
-
@container productContainer (max-width:
|
1954
|
-
.btn-view
|
2023
|
+
@container productContainer (max-width: 216px) {
|
2024
|
+
.btn-quick-view {
|
1955
2025
|
display: none;
|
1956
2026
|
}
|
1957
2027
|
|
@@ -1964,18 +2034,33 @@ var ProvidersShopGptSdk = (function () {
|
|
1964
2034
|
gap: 0;
|
1965
2035
|
}
|
1966
2036
|
|
1967
|
-
.product-
|
1968
|
-
max-width: 150px;
|
2037
|
+
.product-variation-details {
|
1969
2038
|
font-size: 14px;
|
1970
2039
|
}
|
1971
2040
|
|
1972
|
-
.product
|
1973
|
-
|
2041
|
+
.product.modal {
|
2042
|
+
height: 100%;
|
2043
|
+
|
2044
|
+
.btn-quick-view {
|
2045
|
+
display: flex;
|
2046
|
+
text-transform: capitalize;
|
2047
|
+
max-width: 123px;
|
2048
|
+
}
|
2049
|
+
|
2050
|
+
.content {
|
2051
|
+
gap: 0px;
|
2052
|
+
}
|
2053
|
+
|
2054
|
+
.product-name,
|
2055
|
+
.product-variation-details {
|
2056
|
+
font-size: 12px;
|
2057
|
+
max-width: 160px;
|
2058
|
+
}
|
1974
2059
|
}
|
1975
2060
|
}
|
1976
2061
|
|
1977
2062
|
@container productContainer (max-height: 124px) {
|
1978
|
-
.btn-view
|
2063
|
+
.btn-quick-view {
|
1979
2064
|
display: none;
|
1980
2065
|
}
|
1981
2066
|
|
@@ -2000,9 +2085,54 @@ var ProvidersShopGptSdk = (function () {
|
|
2000
2085
|
.product-variation-details {
|
2001
2086
|
color: #172a41;
|
2002
2087
|
}
|
2088
|
+
|
2089
|
+
.product-description {
|
2090
|
+
display: none;
|
2091
|
+
}
|
2003
2092
|
}
|
2004
2093
|
`;
|
2005
2094
|
|
2095
|
+
const plusBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
2096
|
+
<path d="M12.75 11.25V6H11.25V11.25H6V12.75H11.25V18H12.75V12.75H18V11.25H12.75Z" fill="white"/>
|
2097
|
+
</svg>`;
|
2098
|
+
const historyBtn = b `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2099
|
+
<path d="M2.25 9C2.25 10.335 2.64588 11.6401 3.38758 12.7501C4.12928 13.8601 5.18349 14.7253 6.41689 15.2362C7.65029 15.7471 9.00749 15.8808 10.3169 15.6203C11.6262 15.3599 12.829 14.717 13.773 13.773C14.717 12.829 15.3599 11.6262 15.6203 10.3169C15.8808 9.00749 15.7471 7.65029 15.2362 6.41689C14.7253 5.18349 13.8601 4.12928 12.7501 3.38758C11.6401 2.64588 10.335 2.25 9 2.25C7.11296 2.2571 5.30173 2.99342 3.945 4.305L2.25 6M2.25 6V2.25M2.25 6H6M9 5.25V9L12 10.5" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
2100
|
+
</svg>`;
|
2101
|
+
const crossBtn = b `<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2102
|
+
<path d="M22.5 7.5L7.5 22.5M7.5 7.5L22.5 22.5" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
2103
|
+
</svg>`;
|
2104
|
+
const sendBtn = b `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2105
|
+
<path d="M4 8L2 2L14.6667 8M4 8L2 14L14.6667 8M4 8H14.6667" stroke="#1E293B" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"/>
|
2106
|
+
</svg>`;
|
2107
|
+
const sparklesSharp = b `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2108
|
+
<g clip-path="url(#clip0_172_31)">
|
2109
|
+
<path d="M6.62455 10.3334C6.56503 10.1026 6.44477 9.89209 6.27629 9.72361C6.10781 9.55513 5.89726 9.43487 5.66655 9.37536L1.57655 8.32069C1.50677 8.30088 1.44535 8.25886 1.40162 8.20099C1.35789 8.14312 1.33423 8.07256 1.33423 8.00002C1.33423 7.92749 1.35789 7.85693 1.40162 7.79906C1.44535 7.74119 1.50677 7.69916 1.57655 7.67936L5.66655 6.62402C5.89718 6.56456 6.10767 6.44441 6.27615 6.27605C6.44462 6.10769 6.56492 5.89728 6.62455 5.66669L7.67921 1.57669C7.69882 1.50664 7.7408 1.44492 7.79876 1.40095C7.85672 1.35699 7.92747 1.33319 8.00021 1.33319C8.07296 1.33319 8.14371 1.35699 8.20166 1.40095C8.25962 1.44492 8.30161 1.50664 8.32121 1.57669L9.37521 5.66669C9.43473 5.8974 9.55499 6.10795 9.72347 6.27644C9.89195 6.44492 10.1025 6.56517 10.3332 6.62469L14.4232 7.67869C14.4935 7.69809 14.5556 7.74003 14.5998 7.79807C14.644 7.85612 14.6679 7.92706 14.6679 8.00002C14.6679 8.07298 14.644 8.14393 14.5998 8.20197C14.5556 8.26002 14.4935 8.30196 14.4232 8.32136L10.3332 9.37536C10.1025 9.43487 9.89195 9.55513 9.72347 9.72361C9.55499 9.89209 9.43473 10.1026 9.37521 10.3334L8.32055 14.4234C8.30094 14.4934 8.25896 14.5551 8.201 14.5991C8.14304 14.6431 8.07229 14.6669 7.99955 14.6669C7.9268 14.6669 7.85605 14.6431 7.79809 14.5991C7.74014 14.5551 7.69815 14.4934 7.67854 14.4234L6.62455 10.3334Z" fill="#CBD5E1"/>
|
2110
|
+
<path d="M13.3333 2.00002V4.66669V2.00002Z" fill="#CBD5E1"/>
|
2111
|
+
<path d="M14.6666 3.33335H11.9999H14.6666Z" fill="#CBD5E1"/>
|
2112
|
+
<path d="M2.66659 11.3334V12.6667V11.3334Z" fill="#CBD5E1"/>
|
2113
|
+
<path d="M3.33325 12H1.99992H3.33325Z" fill="#CBD5E1"/>
|
2114
|
+
<path d="M13.3333 2.00002V4.66669M14.6666 3.33335H11.9999M2.66659 11.3334V12.6667M3.33325 12H1.99992M6.62455 10.3334C6.56503 10.1026 6.44477 9.89209 6.27629 9.72361C6.10781 9.55513 5.89726 9.43487 5.66655 9.37536L1.57655 8.32069C1.50677 8.30088 1.44535 8.25886 1.40162 8.20099C1.35789 8.14312 1.33423 8.07256 1.33423 8.00002C1.33423 7.92749 1.35789 7.85693 1.40162 7.79906C1.44535 7.74119 1.50677 7.69916 1.57655 7.67936L5.66655 6.62402C5.89718 6.56456 6.10767 6.44441 6.27615 6.27605C6.44462 6.10769 6.56492 5.89728 6.62455 5.66669L7.67921 1.57669C7.69882 1.50664 7.7408 1.44492 7.79876 1.40095C7.85672 1.35699 7.92747 1.33319 8.00021 1.33319C8.07296 1.33319 8.14371 1.35699 8.20166 1.40095C8.25962 1.44492 8.30161 1.50664 8.32121 1.57669L9.37521 5.66669C9.43473 5.8974 9.55499 6.10795 9.72347 6.27644C9.89195 6.44492 10.1025 6.56517 10.3332 6.62469L14.4232 7.67869C14.4935 7.69809 14.5556 7.74003 14.5998 7.79807C14.644 7.85612 14.6679 7.92706 14.6679 8.00002C14.6679 8.07298 14.644 8.14393 14.5998 8.20197C14.5556 8.26002 14.4935 8.30196 14.4232 8.32136L10.3332 9.37536C10.1025 9.43487 9.89195 9.55513 9.72347 9.72361C9.55499 9.89209 9.43473 10.1026 9.37521 10.3334L8.32055 14.4234C8.30094 14.4934 8.25896 14.5551 8.201 14.5991C8.14304 14.6431 8.07229 14.6669 7.99955 14.6669C7.9268 14.6669 7.85605 14.6431 7.79809 14.5991C7.74013 14.5551 7.69815 14.4934 7.67855 14.4234L6.62455 10.3334Z" stroke="#CBD5E1" stroke-linecap="round" stroke-linejoin="round"/>
|
2115
|
+
</g>
|
2116
|
+
<defs>
|
2117
|
+
<clipPath id="clip0_172_31">
|
2118
|
+
<rect width="16" height="16" fill="white"/>
|
2119
|
+
</clipPath>
|
2120
|
+
</defs>
|
2121
|
+
</svg>
|
2122
|
+
|
2123
|
+
`;
|
2124
|
+
const leftBtn = b `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2125
|
+
<path d="M12 19L5 12M5 12L12 5M5 12H19" stroke="#18181B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
2126
|
+
</svg>
|
2127
|
+
`;
|
2128
|
+
const rightBtn = b `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2129
|
+
<path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="#18181B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
2130
|
+
</svg>
|
2131
|
+
`;
|
2132
|
+
const chevronRight = b `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2133
|
+
<path d="M5.25 10.5L8.75 7L5.25 3.5" stroke="white" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"/>
|
2134
|
+
</svg>`;
|
2135
|
+
|
2006
2136
|
class ProductItem extends i$1 {
|
2007
2137
|
getLocalPrice(price) {
|
2008
2138
|
if (!this.siteCurrency) {
|
@@ -2036,7 +2166,12 @@ var ProvidersShopGptSdk = (function () {
|
|
2036
2166
|
return E;
|
2037
2167
|
}
|
2038
2168
|
return this.product.variants[0].selectedOptions.map((option) => x `
|
2039
|
-
<p
|
2169
|
+
<p
|
2170
|
+
class="product-variation-details"
|
2171
|
+
title=${`${option.name}: ${option.value}`}
|
2172
|
+
>
|
2173
|
+
${option.name}: ${option.value}
|
2174
|
+
</p>
|
2040
2175
|
`);
|
2041
2176
|
}
|
2042
2177
|
productClicked(product) {
|
@@ -2061,21 +2196,28 @@ var ProvidersShopGptSdk = (function () {
|
|
2061
2196
|
render() {
|
2062
2197
|
return x `
|
2063
2198
|
<a
|
2064
|
-
class
|
2199
|
+
class=${e$1({ product: true, modal: this.viewType === 'modal' })}
|
2065
2200
|
href=${this.getProductUrl(this.product.url)}
|
2066
2201
|
@click=${() => this.productClicked(this.product)}
|
2067
2202
|
>
|
2068
2203
|
<img src=${this.product.image.url} alt=${this.product.image.alt} />
|
2069
2204
|
<div class="content">
|
2070
|
-
<
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2205
|
+
<div>
|
2206
|
+
<p class="product-name" title=${this.product.title}>
|
2207
|
+
${this.product.title}
|
2208
|
+
</p>
|
2209
|
+
${this.renderVariantTitles()}
|
2210
|
+
</div>
|
2074
2211
|
<div class="prices">
|
2212
|
+
<p>From</p>
|
2075
2213
|
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price)}
|
2076
2214
|
<p>${this.getLocalPrice(this.product.variants[0].price)}</p>
|
2077
2215
|
</div>
|
2078
|
-
<
|
2216
|
+
<div class="product-description">${this.product.description}</div>
|
2217
|
+
<button class="btn-quick-view">
|
2218
|
+
<span> View Product </span>
|
2219
|
+
${chevronRight}
|
2220
|
+
</button>
|
2079
2221
|
</div>
|
2080
2222
|
</a>
|
2081
2223
|
`;
|
@@ -2106,6 +2248,10 @@ var ProvidersShopGptSdk = (function () {
|
|
2106
2248
|
n({ type: String }),
|
2107
2249
|
__metadata("design:type", String)
|
2108
2250
|
], ProductItem.prototype, "userId", void 0);
|
2251
|
+
__decorate([
|
2252
|
+
n({ type: String }),
|
2253
|
+
__metadata("design:type", String)
|
2254
|
+
], ProductItem.prototype, "viewType", void 0);
|
2109
2255
|
if (!customElements.get('product-item')) {
|
2110
2256
|
customElements.define('product-item', ProductItem);
|
2111
2257
|
}
|
@@ -2116,28 +2262,17 @@ var ProvidersShopGptSdk = (function () {
|
|
2116
2262
|
}
|
2117
2263
|
|
2118
2264
|
.product-container {
|
2119
|
-
flex: 0 0
|
2265
|
+
flex: 0 0 176px;
|
2120
2266
|
container-type: inline-size;
|
2121
2267
|
container-name: productContainer;
|
2122
2268
|
}
|
2123
2269
|
|
2124
|
-
.product-container.modal {
|
2125
|
-
padding: 8px;
|
2126
|
-
margin-bottom: 4px;
|
2127
|
-
border-radius: 10px;
|
2128
|
-
background: #fff;
|
2129
|
-
box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1),
|
2130
|
-
0px 2px 4px -1px rgba(0, 0, 0, 0.06);
|
2131
|
-
}
|
2132
|
-
|
2133
2270
|
.products {
|
2134
2271
|
flex: 1;
|
2135
2272
|
display: flex;
|
2136
|
-
gap:
|
2273
|
+
gap: 12px;
|
2137
2274
|
overflow-x: auto;
|
2138
2275
|
scrollbar-width: none;
|
2139
|
-
margin-left: -10px;
|
2140
|
-
padding-left: 10px;
|
2141
2276
|
}
|
2142
2277
|
|
2143
2278
|
.scroll-btns {
|
@@ -2163,12 +2298,31 @@ var ProvidersShopGptSdk = (function () {
|
|
2163
2298
|
|
2164
2299
|
.disabled {
|
2165
2300
|
opacity: 0.5;
|
2301
|
+
cursor: not-allowed;
|
2302
|
+
}
|
2303
|
+
}
|
2304
|
+
|
2305
|
+
.scroll-btns.modal {
|
2306
|
+
flex-direction: row;
|
2307
|
+
align-items: center;
|
2308
|
+
position: absolute;
|
2309
|
+
bottom: -33px;
|
2310
|
+
right: 0;
|
2311
|
+
height: unset;
|
2312
|
+
gap: 10px;
|
2313
|
+
|
2314
|
+
div {
|
2315
|
+
padding: 5px;
|
2316
|
+
background: #f8fafc;
|
2317
|
+
border: unset;
|
2318
|
+
border-radius: 12.5px;
|
2166
2319
|
}
|
2167
2320
|
}
|
2168
2321
|
|
2169
2322
|
.products-wrapper {
|
2170
2323
|
display: flex;
|
2171
2324
|
gap: 24px;
|
2325
|
+
position: relative;
|
2172
2326
|
}
|
2173
2327
|
`;
|
2174
2328
|
|
@@ -2193,18 +2347,12 @@ var ProvidersShopGptSdk = (function () {
|
|
2193
2347
|
}
|
2194
2348
|
connectedCallback() {
|
2195
2349
|
super.connectedCallback();
|
2196
|
-
this.updateButtonsState();
|
2197
|
-
window.addEventListener('resize', this.updateButtonsState);
|
2350
|
+
this.resizeObserver = new ResizeObserver(() => this.updateButtonsState());
|
2198
2351
|
}
|
2199
2352
|
disconnectedCallback() {
|
2200
|
-
|
2353
|
+
this.resizeObserver.disconnect();
|
2201
2354
|
super.disconnectedCallback();
|
2202
2355
|
}
|
2203
|
-
updated(_changedProperties) {
|
2204
|
-
if (_changedProperties.has('products')) {
|
2205
|
-
this.updateButtonsState();
|
2206
|
-
}
|
2207
|
-
}
|
2208
2356
|
scrollToLeft(e) {
|
2209
2357
|
var _a;
|
2210
2358
|
e.preventDefault();
|
@@ -2215,20 +2363,27 @@ var ProvidersShopGptSdk = (function () {
|
|
2215
2363
|
e.preventDefault();
|
2216
2364
|
(_a = this.productsEle) === null || _a === void 0 ? void 0 : _a.scrollBy({ left: 186, behavior: 'smooth' });
|
2217
2365
|
}
|
2366
|
+
firstUpdated(changedProperties) {
|
2367
|
+
super.firstUpdated(changedProperties);
|
2368
|
+
if (!this.productsEle) {
|
2369
|
+
return;
|
2370
|
+
}
|
2371
|
+
this.resizeObserver.observe(this.productsEle);
|
2372
|
+
Array.from(this.productsEle.children).forEach((child) => {
|
2373
|
+
this.resizeObserver.observe(child);
|
2374
|
+
});
|
2375
|
+
this.updateButtonsState();
|
2376
|
+
}
|
2218
2377
|
render() {
|
2219
2378
|
if (!this.products.length) {
|
2220
2379
|
return E;
|
2221
2380
|
}
|
2381
|
+
const isPopupView = this.viewType === 'modal';
|
2222
2382
|
return x `
|
2223
2383
|
<div class="products-wrapper">
|
2224
2384
|
<div class="products" @scroll=${this.updateButtonsState}>
|
2225
2385
|
${o$1(this.products, (product, index) => x `
|
2226
|
-
<div
|
2227
|
-
class=${e$1({
|
2228
|
-
'product-container': true,
|
2229
|
-
modal: this.viewType === 'modal',
|
2230
|
-
})}
|
2231
|
-
>
|
2386
|
+
<div class=${'product-container'}>
|
2232
2387
|
<product-item
|
2233
2388
|
.query=${this.query}
|
2234
2389
|
.response=${this.response}
|
@@ -2236,17 +2391,24 @@ var ProvidersShopGptSdk = (function () {
|
|
2236
2391
|
.siteCurrency=${this.siteCurrency}
|
2237
2392
|
.rank=${index + 1}
|
2238
2393
|
.userId=${this.userId}
|
2394
|
+
.viewType=${this.viewType}
|
2239
2395
|
></product-item>
|
2240
2396
|
</div>
|
2241
2397
|
`)}
|
2242
2398
|
</div>
|
2243
2399
|
${this.showButtons
|
2244
|
-
? x
|
2400
|
+
? x `<div
|
2401
|
+
class="scroll-btns"
|
2402
|
+
class=${e$1({
|
2403
|
+
'scroll-btns': true,
|
2404
|
+
modal: isPopupView,
|
2405
|
+
})}
|
2406
|
+
>
|
2245
2407
|
<div class="left-btn disabled" @click=${this.scrollToLeft}>
|
2246
|
-
${leftBtn}
|
2408
|
+
${isPopupView ? leftBtn : leftBtn$1}
|
2247
2409
|
</div>
|
2248
2410
|
<div class="right-btn" @click=${this.scrollToRight}>
|
2249
|
-
${rightBtn}
|
2411
|
+
${isPopupView ? rightBtn : rightBtn$1}
|
2250
2412
|
</div>
|
2251
2413
|
</div>`
|
2252
2414
|
: E}
|
@@ -2289,7 +2451,7 @@ var ProvidersShopGptSdk = (function () {
|
|
2289
2451
|
], ProductsList.prototype, "rightBtnEle", void 0);
|
2290
2452
|
__decorate([
|
2291
2453
|
e$3('.products'),
|
2292
|
-
__metadata("design:type",
|
2454
|
+
__metadata("design:type", HTMLDivElement)
|
2293
2455
|
], ProductsList.prototype, "productsEle", void 0);
|
2294
2456
|
if (!customElements.get('products-list')) {
|
2295
2457
|
customElements.define('products-list', ProductsList);
|
@@ -2410,7 +2572,7 @@ var ProvidersShopGptSdk = (function () {
|
|
2410
2572
|
customElements.define('products-section', ProductsSection);
|
2411
2573
|
}
|
2412
2574
|
|
2413
|
-
const chatSectionStyles = i$4 `
|
2575
|
+
const chatSectionStyles$1 = i$4 `
|
2414
2576
|
:host {
|
2415
2577
|
font-family: 'Inter', sans-serif;
|
2416
2578
|
font-size: 16px;
|
@@ -2487,33 +2649,6 @@ var ProvidersShopGptSdk = (function () {
|
|
2487
2649
|
align-items: center;
|
2488
2650
|
justify-content: center;
|
2489
2651
|
}
|
2490
|
-
|
2491
|
-
.threads-btn.active {
|
2492
|
-
background: #2b65cf;
|
2493
|
-
opacity: 1;
|
2494
|
-
}
|
2495
|
-
|
2496
|
-
.close-btn:hover {
|
2497
|
-
background: #dc3545;
|
2498
|
-
}
|
2499
|
-
|
2500
|
-
.threads-btn:hover,
|
2501
|
-
.new-search-btn:hover {
|
2502
|
-
background: #2b65cf;
|
2503
|
-
opacity: 0.8;
|
2504
|
-
}
|
2505
|
-
|
2506
|
-
.threads-btn:active,
|
2507
|
-
.new-search-btn:active {
|
2508
|
-
background: #2b65cf;
|
2509
|
-
opacity: 1;
|
2510
|
-
}
|
2511
|
-
|
2512
|
-
.new-search-btn:disabled {
|
2513
|
-
background: #808080;
|
2514
|
-
cursor: not-allowed;
|
2515
|
-
opacity: 0.5;
|
2516
|
-
}
|
2517
2652
|
}
|
2518
2653
|
}
|
2519
2654
|
|
@@ -2527,12 +2662,6 @@ var ProvidersShopGptSdk = (function () {
|
|
2527
2662
|
gap: 25px;
|
2528
2663
|
}
|
2529
2664
|
|
2530
|
-
.chatbot-section.modal-view {
|
2531
|
-
height: calc(100% - 93px);
|
2532
|
-
padding: 0px 16px 16px;
|
2533
|
-
gap: 16px;
|
2534
|
-
}
|
2535
|
-
|
2536
2665
|
.chat-form {
|
2537
2666
|
display: flex;
|
2538
2667
|
align-items: center;
|
@@ -2581,10 +2710,6 @@ var ProvidersShopGptSdk = (function () {
|
|
2581
2710
|
cursor: unset;
|
2582
2711
|
}
|
2583
2712
|
}
|
2584
|
-
|
2585
|
-
button.modal {
|
2586
|
-
right: 26px;
|
2587
|
-
}
|
2588
2713
|
}
|
2589
2714
|
|
2590
2715
|
.messages {
|
@@ -2764,46 +2889,6 @@ var ProvidersShopGptSdk = (function () {
|
|
2764
2889
|
gap: 24px;
|
2765
2890
|
}
|
2766
2891
|
|
2767
|
-
.typing-dots {
|
2768
|
-
display: flex;
|
2769
|
-
align-items: center;
|
2770
|
-
justify-content: center;
|
2771
|
-
gap: 8px;
|
2772
|
-
}
|
2773
|
-
|
2774
|
-
.dot {
|
2775
|
-
width: 6px;
|
2776
|
-
height: 6px;
|
2777
|
-
background-color: #b6b6b6;
|
2778
|
-
border-radius: 50%;
|
2779
|
-
animation: bounce 1.2s infinite ease-in-out;
|
2780
|
-
}
|
2781
|
-
|
2782
|
-
.dot:nth-child(1) {
|
2783
|
-
animation-delay: 0s;
|
2784
|
-
}
|
2785
|
-
|
2786
|
-
.dot:nth-child(2) {
|
2787
|
-
animation-delay: 0.2s;
|
2788
|
-
}
|
2789
|
-
|
2790
|
-
.dot:nth-child(3) {
|
2791
|
-
animation-delay: 0.4s;
|
2792
|
-
}
|
2793
|
-
|
2794
|
-
@keyframes bounce {
|
2795
|
-
0%,
|
2796
|
-
80%,
|
2797
|
-
100% {
|
2798
|
-
transform: translateY(0);
|
2799
|
-
background-color: #b6b6b6;
|
2800
|
-
}
|
2801
|
-
40% {
|
2802
|
-
transform: translateY(-4px);
|
2803
|
-
background-color: #8b8b8b;
|
2804
|
-
}
|
2805
|
-
}
|
2806
|
-
|
2807
2892
|
.prompts {
|
2808
2893
|
display: flex;
|
2809
2894
|
justify-content: center;
|
@@ -2831,170 +2916,45 @@ var ProvidersShopGptSdk = (function () {
|
|
2831
2916
|
}
|
2832
2917
|
}
|
2833
2918
|
|
2834
|
-
|
2835
|
-
|
2836
|
-
position: absolute;
|
2837
|
-
overflow: hidden;
|
2838
|
-
z-index: 1;
|
2839
|
-
top: 78px;
|
2840
|
-
height: 30%;
|
2841
|
-
width: 100%;
|
2842
|
-
background: #fff;
|
2843
|
-
box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12),
|
2844
|
-
0px 20px 20px 0px rgba(0, 0, 0, 0.08);
|
2845
|
-
border-radius: 0px 0px 10px 10px;
|
2919
|
+
${scrollBarStyles}
|
2920
|
+
`;
|
2846
2921
|
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2922
|
+
const capitalizeEachWord = (str) => {
|
2923
|
+
return str === null || str === void 0 ? void 0 : str.replace(/^\w/, (char) => char.toUpperCase());
|
2924
|
+
};
|
2925
|
+
const adParams = new Set([
|
2926
|
+
'fbclid',
|
2927
|
+
'gclid',
|
2928
|
+
'sccid',
|
2929
|
+
'ttclid',
|
2930
|
+
'epik',
|
2931
|
+
'li_fat_id',
|
2932
|
+
'twclid',
|
2933
|
+
'rdt_cid',
|
2934
|
+
'aleid',
|
2935
|
+
'tabclid',
|
2936
|
+
'msclkid',
|
2937
|
+
'dclid',
|
2938
|
+
'wbraid',
|
2939
|
+
]);
|
2940
|
+
const isFromAd = (params) => [...params.keys()].some((key) => adParams.has(key.toLowerCase()));
|
2853
2941
|
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2859
|
-
}
|
2860
|
-
}
|
2942
|
+
const personalizeDialogStyles = i$4 `
|
2943
|
+
:host {
|
2944
|
+
font-family: 'Inter', sans-serif;
|
2945
|
+
font-size: 16px;
|
2946
|
+
font-weight: 400;
|
2861
2947
|
|
2862
|
-
|
2863
|
-
|
2864
|
-
|
2865
|
-
|
2948
|
+
h2,
|
2949
|
+
p {
|
2950
|
+
margin: 0;
|
2951
|
+
}
|
2866
2952
|
|
2867
|
-
|
2868
|
-
|
2869
|
-
|
2870
|
-
|
2871
|
-
|
2872
|
-
cursor: pointer;
|
2873
|
-
|
2874
|
-
p {
|
2875
|
-
font-size: 14px;
|
2876
|
-
font-weight: 400;
|
2877
|
-
line-height: 20px;
|
2878
|
-
}
|
2879
|
-
|
2880
|
-
.trash-icon {
|
2881
|
-
display: none;
|
2882
|
-
}
|
2883
|
-
|
2884
|
-
&:hover {
|
2885
|
-
background: #f1f4f8;
|
2886
|
-
|
2887
|
-
.trash-icon {
|
2888
|
-
display: flex;
|
2889
|
-
}
|
2890
|
-
}
|
2891
|
-
}
|
2892
|
-
|
2893
|
-
.thread-title.disabled {
|
2894
|
-
cursor: not-allowed;
|
2895
|
-
}
|
2896
|
-
}
|
2897
|
-
|
2898
|
-
.trash-icon {
|
2899
|
-
display: flex;
|
2900
|
-
justify-content: center;
|
2901
|
-
align-items: center;
|
2902
|
-
padding: 2px;
|
2903
|
-
cursor: pointer;
|
2904
|
-
|
2905
|
-
&:hover {
|
2906
|
-
border-radius: 5px;
|
2907
|
-
background: #dc3545;
|
2908
|
-
|
2909
|
-
path {
|
2910
|
-
fill: white;
|
2911
|
-
}
|
2912
|
-
}
|
2913
|
-
}
|
2914
|
-
|
2915
|
-
.chat-threads-background {
|
2916
|
-
position: absolute;
|
2917
|
-
top: 78px;
|
2918
|
-
height: 100%;
|
2919
|
-
width: 100%;
|
2920
|
-
opacity: 0.5;
|
2921
|
-
background: #000;
|
2922
|
-
z-index: 0;
|
2923
|
-
}
|
2924
|
-
}
|
2925
|
-
|
2926
|
-
footer {
|
2927
|
-
text-align: center;
|
2928
|
-
font-size: 10px;
|
2929
|
-
color: #4e647f;
|
2930
|
-
font-weight: 500;
|
2931
|
-
|
2932
|
-
a {
|
2933
|
-
text-decoration: none;
|
2934
|
-
}
|
2935
|
-
}
|
2936
|
-
|
2937
|
-
${scrollBarStyles}
|
2938
|
-
`;
|
2939
|
-
|
2940
|
-
const capitalizeEachWord = (str) => {
|
2941
|
-
return str === null || str === void 0 ? void 0 : str.replace(/^\w/, (char) => char.toUpperCase());
|
2942
|
-
};
|
2943
|
-
const adParams = new Set([
|
2944
|
-
'fbclid',
|
2945
|
-
'gclid',
|
2946
|
-
'sccid',
|
2947
|
-
'ttclid',
|
2948
|
-
'epik',
|
2949
|
-
'li_fat_id',
|
2950
|
-
'twclid',
|
2951
|
-
'rdt_cid',
|
2952
|
-
'aleid',
|
2953
|
-
'tabclid',
|
2954
|
-
'msclkid',
|
2955
|
-
'dclid',
|
2956
|
-
'wbraid',
|
2957
|
-
]);
|
2958
|
-
const isFromAd = (params) => [...params.keys()].some((key) => adParams.has(key.toLowerCase()));
|
2959
|
-
|
2960
|
-
const plusBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
2961
|
-
<path d="M12.75 11.25V6H11.25V11.25H6V12.75H11.25V18H12.75V12.75H18V11.25H12.75Z" fill="white"/>
|
2962
|
-
</svg>`;
|
2963
|
-
const timerBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
2964
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.16652 20.7304C7.89323 21.8842 9.9233 22.5 12 22.5C14.7848 22.5 17.4555 21.3938 19.4246 19.4246C21.3938 17.4555 22.5 14.7848 22.5 12C22.5 9.9233 21.8842 7.89323 20.7304 6.16652C19.5767 4.4398 17.9368 3.09399 16.0182 2.29927C14.0996 1.50455 11.9884 1.29661 9.95156 1.70176C7.91476 2.1069 6.04383 3.10693 4.57538 4.57538C3.10693 6.04383 2.1069 7.91476 1.70176 9.95156C1.29661 11.9884 1.50455 14.0996 2.29927 16.0182C3.09399 17.9368 4.4398 19.5767 6.16652 20.7304ZM6.99987 4.51678C8.47992 3.52785 10.22 3 12 3C14.387 3 16.6761 3.94822 18.364 5.63604C20.0518 7.32387 21 9.61306 21 12C21 13.78 20.4722 15.5201 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89472 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17294 13.7558C2.82567 12.01 3.0039 10.2004 3.68509 8.55585C4.36628 6.91132 5.51983 5.50571 6.99987 4.51678ZM11.25 12.3075L15.4425 16.5L16.5 15.4425L12.75 11.685V5.25H11.25V12.3075Z" fill="white"/>
|
2965
|
-
</svg>`;
|
2966
|
-
const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
2967
|
-
<path d="M18 7.05L16.95 6L12 10.95L7.05 6L6 7.05L10.95 12L6 16.95L7.05 18L12 13.05L16.95 18L18 16.95L13.05 12L18 7.05Z" fill="white"/>
|
2968
|
-
</svg>`;
|
2969
|
-
const thumbsUpBtn = b `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--tabler" font-size="1.375rem" width="1em" height="1em" viewBox="0 0 24 24">
|
2970
|
-
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 11v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3a4 4 0 0 0 4-4V6a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1-2 2h-7a3 3 0 0 1-3-3"></path>
|
2971
|
-
</svg>`;
|
2972
|
-
const thumbsUpFilledBtn = b `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--tabler" font-size="1.375rem" width="1em" height="1em" viewBox="0 0 24 24">
|
2973
|
-
<path fill="currentColor" d="M13 3a3 3 0 0 1 2.995 2.824L16 6v4h2a3 3 0 0 1 2.98 2.65l.015.174L21 13l-.02.196l-1.006 5.032c-.381 1.626-1.502 2.796-2.81 2.78L17 21H9a1 1 0 0 1-.993-.883L8 20l.001-9.536a1 1 0 0 1 .5-.865a3 3 0 0 0 1.492-2.397L10 7V6a3 3 0 0 1 3-3m-8 7a1 1 0 0 1 .993.883L6 11v9a1 1 0 0 1-.883.993L5 21H4a2 2 0 0 1-1.995-1.85L2 19v-7a2 2 0 0 1 1.85-1.995L4 10z"></path>
|
2974
|
-
</svg>`;
|
2975
|
-
const thumbsDownBtn = b `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--tabler" font-size="1.375rem" width="1em" height="1em" viewBox="0 0 24 24">
|
2976
|
-
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 13V5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h3a4 4 0 0 1 4 4v1a2 2 0 0 0 4 0v-5h3a2 2 0 0 0 2-2l-1-5a2 3 0 0 0-2-2h-7a3 3 0 0 0-3 3"></path>
|
2977
|
-
</svg>`;
|
2978
|
-
const thumbsDownFilledBtn = b `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--tabler" font-size="1.375rem" width="1em" height="1em" viewBox="0 0 24 24">
|
2979
|
-
<path fill="currentColor" d="M13 21.008a3 3 0 0 0 2.995-2.823l.005-.177v-4h2a3 3 0 0 0 2.98-2.65l.015-.173l.005-.177l-.02-.196l-1.006-5.032c-.381-1.625-1.502-2.796-2.81-2.78L17 3.008H9a1 1 0 0 0-.993.884L8 4.008l.001 9.536a1 1 0 0 0 .5.866a3 3 0 0 1 1.492 2.396l.007.202v1a3 3 0 0 0 3 3m-8-7a1 1 0 0 0 .993-.883L6 13.008v-9a1 1 0 0 0-.883-.993L5 3.008H4A2 2 0 0 0 2.005 4.86L2 5.01v7a2 2 0 0 0 1.85 1.994l.15.005h1z"></path>
|
2980
|
-
</svg>`;
|
2981
|
-
|
2982
|
-
const personalizeDialogStyles = i$4 `
|
2983
|
-
:host {
|
2984
|
-
font-family: 'Inter', sans-serif;
|
2985
|
-
font-size: 16px;
|
2986
|
-
font-weight: 400;
|
2987
|
-
|
2988
|
-
h2,
|
2989
|
-
p {
|
2990
|
-
margin: 0;
|
2991
|
-
}
|
2992
|
-
|
2993
|
-
button {
|
2994
|
-
border-style: none;
|
2995
|
-
cursor: pointer;
|
2996
|
-
}
|
2997
|
-
}
|
2953
|
+
button {
|
2954
|
+
border-style: none;
|
2955
|
+
cursor: pointer;
|
2956
|
+
}
|
2957
|
+
}
|
2998
2958
|
|
2999
2959
|
dialog::backdrop {
|
3000
2960
|
background: rgba(0, 0, 0, 0.5);
|
@@ -3630,7 +3590,7 @@ var ProvidersShopGptSdk = (function () {
|
|
3630
3590
|
MarkdownRenderer.styles = i$4 `
|
3631
3591
|
:host {
|
3632
3592
|
font-family: 'Inter', sans-serif;
|
3633
|
-
font-size:
|
3593
|
+
font-size: 14px;
|
3634
3594
|
font-weight: 400;
|
3635
3595
|
|
3636
3596
|
p {
|
@@ -3646,131 +3606,11 @@ var ProvidersShopGptSdk = (function () {
|
|
3646
3606
|
customElements.define('markdown-renderer', MarkdownRenderer);
|
3647
3607
|
}
|
3648
3608
|
|
3649
|
-
|
3650
|
-
constructor() {
|
3651
|
-
super(...arguments);
|
3652
|
-
this.position = 'bottom-left';
|
3653
|
-
this.text = '';
|
3654
|
-
}
|
3655
|
-
render() {
|
3656
|
-
return x `
|
3657
|
-
<slot></slot>
|
3658
|
-
<div class="tooltip ${this.position}">${this.text}</div>
|
3659
|
-
`;
|
3660
|
-
}
|
3661
|
-
}
|
3662
|
-
TooltipComponent.styles = [
|
3663
|
-
i$4 `
|
3664
|
-
:host {
|
3665
|
-
position: relative;
|
3666
|
-
display: inline-block;
|
3667
|
-
}
|
3668
|
-
|
3669
|
-
.tooltip {
|
3670
|
-
position: absolute;
|
3671
|
-
color: #172a41;
|
3672
|
-
padding: 4px 8px;
|
3673
|
-
white-space: nowrap;
|
3674
|
-
font-size: 12px;
|
3675
|
-
opacity: 0;
|
3676
|
-
transition: opacity 0.2s;
|
3677
|
-
pointer-events: none;
|
3678
|
-
|
3679
|
-
border-radius: 5px;
|
3680
|
-
background: #ffcc81;
|
3681
|
-
box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1),
|
3682
|
-
0px 2px 4px -1px rgba(0, 0, 0, 0.06);
|
3683
|
-
|
3684
|
-
font-style: normal;
|
3685
|
-
font-weight: 400;
|
3686
|
-
line-height: 150%;
|
3687
|
-
}
|
3688
|
-
|
3689
|
-
:host(:hover) .tooltip {
|
3690
|
-
opacity: 1;
|
3691
|
-
}
|
3692
|
-
|
3693
|
-
.top-center {
|
3694
|
-
bottom: calc(100% + 2px);
|
3695
|
-
left: 50%;
|
3696
|
-
transform: translateX(-50%);
|
3697
|
-
}
|
3698
|
-
|
3699
|
-
.top-left {
|
3700
|
-
bottom: calc(100% + 2px);
|
3701
|
-
left: 0;
|
3702
|
-
}
|
3703
|
-
|
3704
|
-
.top-right {
|
3705
|
-
bottom: calc(100% + 2px);
|
3706
|
-
right: 0;
|
3707
|
-
}
|
3708
|
-
|
3709
|
-
.bottom-center {
|
3710
|
-
top: calc(100% + 2px);
|
3711
|
-
left: 50%;
|
3712
|
-
transform: translateX(-50%);
|
3713
|
-
}
|
3714
|
-
|
3715
|
-
.bottom-left {
|
3716
|
-
top: calc(100% + 2px);
|
3717
|
-
left: 0;
|
3718
|
-
}
|
3719
|
-
|
3720
|
-
.bottom-right {
|
3721
|
-
top: calc(100% + 2px);
|
3722
|
-
right: 0;
|
3723
|
-
}
|
3724
|
-
|
3725
|
-
.left-center {
|
3726
|
-
right: calc(100% + 2px);
|
3727
|
-
top: 50%;
|
3728
|
-
transform: translateY(-50%);
|
3729
|
-
}
|
3730
|
-
|
3731
|
-
.left-top {
|
3732
|
-
right: calc(100% + 2px);
|
3733
|
-
top: 0;
|
3734
|
-
}
|
3735
|
-
|
3736
|
-
.left-bottom {
|
3737
|
-
right: calc(100% + 2px);
|
3738
|
-
bottom: 0;
|
3739
|
-
}
|
3740
|
-
|
3741
|
-
.right-center {
|
3742
|
-
left: calc(100% + 2px);
|
3743
|
-
top: 50%;
|
3744
|
-
transform: translateY(-50%);
|
3745
|
-
}
|
3746
|
-
|
3747
|
-
.right-top {
|
3748
|
-
left: calc(100% + 2px);
|
3749
|
-
top: 0;
|
3750
|
-
}
|
3751
|
-
|
3752
|
-
.right-bottom {
|
3753
|
-
left: calc(100% + 2px);
|
3754
|
-
bottom: 0;
|
3755
|
-
}
|
3756
|
-
`,
|
3757
|
-
];
|
3758
|
-
__decorate([
|
3759
|
-
n({ type: String }),
|
3760
|
-
__metadata("design:type", String)
|
3761
|
-
], TooltipComponent.prototype, "position", void 0);
|
3762
|
-
__decorate([
|
3763
|
-
n({ type: String }),
|
3764
|
-
__metadata("design:type", Object)
|
3765
|
-
], TooltipComponent.prototype, "text", void 0);
|
3766
|
-
if (!customElements.get('tooltip-component')) {
|
3767
|
-
customElements.define('tooltip-component', TooltipComponent);
|
3768
|
-
}
|
3769
|
-
|
3770
|
-
const confirmDialogStyles = i$4 `
|
3609
|
+
const feedbackDialogStyles = i$4 `
|
3771
3610
|
:host {
|
3772
3611
|
font-family: 'Inter', sans-serif;
|
3773
3612
|
font-size: 16px;
|
3613
|
+
line-height: 24px;
|
3774
3614
|
font-weight: 400;
|
3775
3615
|
|
3776
3616
|
display: flex;
|
@@ -3784,141 +3624,22 @@ var ProvidersShopGptSdk = (function () {
|
|
3784
3624
|
|
3785
3625
|
.modal {
|
3786
3626
|
width: 75%;
|
3787
|
-
max-width:
|
3627
|
+
max-width: 400px;
|
3788
3628
|
background: #fff;
|
3789
|
-
padding:
|
3629
|
+
padding: 24px;
|
3790
3630
|
margin: auto;
|
3791
3631
|
|
3792
|
-
border-radius:
|
3793
|
-
box-shadow:
|
3794
|
-
0px 20px 20px 0px rgba(0, 0, 0, 0.08);
|
3632
|
+
border-radius: 8px;
|
3633
|
+
box-shadow: rgba(47, 43, 61, 0.28) 0px 8px 23px 0px;
|
3795
3634
|
|
3796
3635
|
z-index: 2000;
|
3797
3636
|
}
|
3798
3637
|
|
3799
|
-
|
3800
|
-
|
3801
|
-
|
3802
|
-
|
3803
|
-
|
3804
|
-
line-height: 150%;
|
3805
|
-
}
|
3806
|
-
|
3807
|
-
::slotted([slot='content']) {
|
3808
|
-
color: #4e647f;
|
3809
|
-
line-height: 150%;
|
3810
|
-
}
|
3811
|
-
|
3812
|
-
.button-wrapper {
|
3813
|
-
margin-top: 12px;
|
3814
|
-
display: flex;
|
3815
|
-
gap: 12px;
|
3816
|
-
|
3817
|
-
.btn {
|
3818
|
-
justify-self: stretch;
|
3819
|
-
padding: 10px;
|
3820
|
-
cursor: pointer;
|
3821
|
-
text-align: center;
|
3822
|
-
width: 100%;
|
3823
|
-
border: 0;
|
3824
|
-
color: #fff;
|
3825
|
-
line-height: 150%;
|
3826
|
-
text-transform: capitalize;
|
3827
|
-
}
|
3828
|
-
|
3829
|
-
.accept-btn {
|
3830
|
-
border-radius: 5px;
|
3831
|
-
background: #dc3545;
|
3832
|
-
|
3833
|
-
&:hover {
|
3834
|
-
background: rgb(176, 62, 25);
|
3835
|
-
}
|
3836
|
-
}
|
3837
|
-
|
3838
|
-
.decline-btn {
|
3839
|
-
border-radius: 5px;
|
3840
|
-
background: #4e647f;
|
3841
|
-
|
3842
|
-
&:hover {
|
3843
|
-
background: rgb(57, 77, 102);
|
3844
|
-
}
|
3845
|
-
}
|
3846
|
-
}
|
3847
|
-
`;
|
3848
|
-
|
3849
|
-
class ConfirmDialog extends i$1 {
|
3850
|
-
onAcceptClick(e) {
|
3851
|
-
e.preventDefault();
|
3852
|
-
this.dispatchEvent(new CustomEvent('accept', {
|
3853
|
-
composed: true,
|
3854
|
-
}));
|
3855
|
-
}
|
3856
|
-
onCancelClick(e) {
|
3857
|
-
e.preventDefault();
|
3858
|
-
this.dispatchEvent(new CustomEvent('decline', {
|
3859
|
-
composed: true,
|
3860
|
-
}));
|
3861
|
-
}
|
3862
|
-
render() {
|
3863
|
-
return x `
|
3864
|
-
<div class="modal">
|
3865
|
-
<slot name="title"></slot>
|
3866
|
-
<slot name="content"></slot>
|
3867
|
-
<div class="button-wrapper">
|
3868
|
-
<slot name="accept-btn">
|
3869
|
-
<button class="btn accept-btn" @click=${this.onAcceptClick}>
|
3870
|
-
Delete
|
3871
|
-
</button>
|
3872
|
-
</slot>
|
3873
|
-
<slot name="decline-btn">
|
3874
|
-
<button class="btn decline-btn" @click=${this.onCancelClick}>
|
3875
|
-
Cancel
|
3876
|
-
</button>
|
3877
|
-
</slot>
|
3878
|
-
</div>
|
3879
|
-
</div>
|
3880
|
-
`;
|
3881
|
-
}
|
3882
|
-
}
|
3883
|
-
ConfirmDialog.styles = [confirmDialogStyles];
|
3884
|
-
if (!customElements.get('confirm-dialog')) {
|
3885
|
-
customElements.define('confirm-dialog', ConfirmDialog);
|
3886
|
-
}
|
3887
|
-
|
3888
|
-
const feedbackDialogStyles = i$4 `
|
3889
|
-
:host {
|
3890
|
-
font-family: 'Inter', sans-serif;
|
3891
|
-
font-size: 16px;
|
3892
|
-
line-height: 24px;
|
3893
|
-
font-weight: 400;
|
3894
|
-
|
3895
|
-
display: flex;
|
3896
|
-
position: absolute;
|
3897
|
-
top: 0;
|
3898
|
-
left: 0;
|
3899
|
-
width: 100%;
|
3900
|
-
height: 100%;
|
3901
|
-
background: #00000050;
|
3902
|
-
}
|
3903
|
-
|
3904
|
-
.modal {
|
3905
|
-
width: 75%;
|
3906
|
-
max-width: 400px;
|
3907
|
-
background: #fff;
|
3908
|
-
padding: 24px;
|
3909
|
-
margin: auto;
|
3910
|
-
|
3911
|
-
border-radius: 8px;
|
3912
|
-
box-shadow: rgba(47, 43, 61, 0.28) 0px 8px 23px 0px;
|
3913
|
-
|
3914
|
-
z-index: 2000;
|
3915
|
-
}
|
3916
|
-
|
3917
|
-
.header {
|
3918
|
-
display: flex;
|
3919
|
-
justify-content: space-between;
|
3920
|
-
align-items: center;
|
3921
|
-
margin-bottom: 16px;
|
3638
|
+
.header {
|
3639
|
+
display: flex;
|
3640
|
+
justify-content: space-between;
|
3641
|
+
align-items: center;
|
3642
|
+
margin-bottom: 16px;
|
3922
3643
|
}
|
3923
3644
|
|
3924
3645
|
.close {
|
@@ -4101,11 +3822,80 @@ ${this.comment ? this.comment : E}</textarea
|
|
4101
3822
|
customElements.define('feedback-dialog', FeedbackDialog);
|
4102
3823
|
}
|
4103
3824
|
|
3825
|
+
class TypingIndicator extends i$1 {
|
3826
|
+
constructor() {
|
3827
|
+
super(...arguments);
|
3828
|
+
this.position = 'bottom-left';
|
3829
|
+
this.text = '';
|
3830
|
+
}
|
3831
|
+
render() {
|
3832
|
+
return x `
|
3833
|
+
<div class="typing-dots">
|
3834
|
+
<div class="dot"></div>
|
3835
|
+
<div class="dot"></div>
|
3836
|
+
<div class="dot"></div>
|
3837
|
+
</div>
|
3838
|
+
`;
|
3839
|
+
}
|
3840
|
+
}
|
3841
|
+
TypingIndicator.styles = [
|
3842
|
+
i$4 `
|
3843
|
+
.typing-dots {
|
3844
|
+
display: flex;
|
3845
|
+
align-items: center;
|
3846
|
+
justify-content: center;
|
3847
|
+
gap: 8px;
|
3848
|
+
}
|
3849
|
+
|
3850
|
+
.dot {
|
3851
|
+
width: 6px;
|
3852
|
+
height: 6px;
|
3853
|
+
background-color: #b6b6b6;
|
3854
|
+
border-radius: 50%;
|
3855
|
+
animation: bounce 1.2s infinite ease-in-out;
|
3856
|
+
}
|
3857
|
+
|
3858
|
+
.dot:nth-child(1) {
|
3859
|
+
animation-delay: 0s;
|
3860
|
+
}
|
3861
|
+
|
3862
|
+
.dot:nth-child(2) {
|
3863
|
+
animation-delay: 0.2s;
|
3864
|
+
}
|
3865
|
+
|
3866
|
+
.dot:nth-child(3) {
|
3867
|
+
animation-delay: 0.4s;
|
3868
|
+
}
|
3869
|
+
|
3870
|
+
@keyframes bounce {
|
3871
|
+
0%,
|
3872
|
+
80%,
|
3873
|
+
100% {
|
3874
|
+
transform: translateY(0);
|
3875
|
+
background-color: #b6b6b6;
|
3876
|
+
}
|
3877
|
+
40% {
|
3878
|
+
transform: translateY(-4px);
|
3879
|
+
background-color: #8b8b8b;
|
3880
|
+
}
|
3881
|
+
}
|
3882
|
+
`,
|
3883
|
+
];
|
3884
|
+
__decorate([
|
3885
|
+
n({ type: String }),
|
3886
|
+
__metadata("design:type", String)
|
3887
|
+
], TypingIndicator.prototype, "position", void 0);
|
3888
|
+
__decorate([
|
3889
|
+
n({ type: String }),
|
3890
|
+
__metadata("design:type", Object)
|
3891
|
+
], TypingIndicator.prototype, "text", void 0);
|
3892
|
+
if (!customElements.get('typing-indicator')) {
|
3893
|
+
customElements.define('typing-indicator', TypingIndicator);
|
3894
|
+
}
|
3895
|
+
|
4104
3896
|
class ChatSection extends i$1 {
|
4105
3897
|
constructor() {
|
4106
3898
|
super(...arguments);
|
4107
|
-
this.showChatThreads = false;
|
4108
|
-
this.deleteAllThreads = false;
|
4109
3899
|
this.userQuery = '';
|
4110
3900
|
this.isStylesheetInjected = false;
|
4111
3901
|
}
|
@@ -4146,25 +3936,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
4146
3936
|
this.userQuery = '';
|
4147
3937
|
await this.processMessage(e, message, false);
|
4148
3938
|
}
|
4149
|
-
handleThreadDelete() {
|
4150
|
-
if (this.deleteAllThreads) {
|
4151
|
-
this.dispatchEvent(new CustomEvent('delete-all-threads', {
|
4152
|
-
composed: true,
|
4153
|
-
bubbles: true,
|
4154
|
-
}));
|
4155
|
-
this.deleteAllThreads = false;
|
4156
|
-
return;
|
4157
|
-
}
|
4158
|
-
if (!this.deleteThreadId) {
|
4159
|
-
return;
|
4160
|
-
}
|
4161
|
-
this.dispatchEvent(new CustomEvent('delete-thread', {
|
4162
|
-
detail: { threadId: this.deleteThreadId },
|
4163
|
-
composed: true,
|
4164
|
-
bubbles: true,
|
4165
|
-
}));
|
4166
|
-
this.deleteThreadId = '';
|
4167
|
-
}
|
4168
3939
|
handleFeedback(rating, messageId, queryMessageId, comment, query, response) {
|
4169
3940
|
var _a, _b, _c, _d;
|
4170
3941
|
if (rating === 'bad') {
|
@@ -4206,13 +3977,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
4206
3977
|
bubbles: true,
|
4207
3978
|
}));
|
4208
3979
|
}
|
4209
|
-
typingIndicator() {
|
4210
|
-
return x ` <div class="typing-dots">
|
4211
|
-
<div class="dot"></div>
|
4212
|
-
<div class="dot"></div>
|
4213
|
-
<div class="dot"></div>
|
4214
|
-
</div>`;
|
4215
|
-
}
|
4216
3980
|
botMessage(message, index) {
|
4217
3981
|
var _a, _b, _c, _d, _e;
|
4218
3982
|
const queryMessage = this.messages[index + 1];
|
@@ -4226,7 +3990,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
4226
3990
|
.content=${message.message}
|
4227
3991
|
></markdown-renderer>`
|
4228
3992
|
: E}
|
4229
|
-
${
|
3993
|
+
${((_a = message.products) === null || _a === void 0 ? void 0 : _a[0])
|
4230
3994
|
? x `
|
4231
3995
|
<span class="line"></span>
|
4232
3996
|
<div class="product-container">
|
@@ -4243,16 +4007,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
4243
4007
|
: E}
|
4244
4008
|
</div>
|
4245
4009
|
</div>
|
4246
|
-
${this.viewType === 'modal' && message.products
|
4247
|
-
? x ` <products-list
|
4248
|
-
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
4249
|
-
.response=${message.message}
|
4250
|
-
.products=${message.products}
|
4251
|
-
.siteCurrency=${this.siteCurrency}
|
4252
|
-
.viewType=${this.viewType}
|
4253
|
-
.userId=${this.userId}
|
4254
|
-
></products-list>`
|
4255
|
-
: E}
|
4256
4010
|
${message.messageId && (queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId)
|
4257
4011
|
? x ` <div class="bot-response-actions">
|
4258
4012
|
<button
|
@@ -4282,7 +4036,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
4282
4036
|
<img src=${this.botIconUrl} width="30" height="30" />
|
4283
4037
|
</div>`;
|
4284
4038
|
}
|
4285
|
-
return x ` <div class="bot-icon">${botIcon}</div> `;
|
4039
|
+
return x ` <div class="bot-icon">${botIcon()}</div> `;
|
4286
4040
|
}
|
4287
4041
|
chatWindow() {
|
4288
4042
|
if (this.isLoadingHistory || this.isLoadingThreads) {
|
@@ -4294,13 +4048,1230 @@ ${this.comment ? this.comment : E}</textarea
|
|
4294
4048
|
<div class="messages">
|
4295
4049
|
${this.isTyping
|
4296
4050
|
? x ` <div class="message bot">
|
4297
|
-
<div>${this.renderBotIcon()}</div>
|
4298
|
-
|
4051
|
+
<div>${this.renderBotIcon()}</div>
|
4052
|
+
<typing-indicator></typing-indicator>
|
4053
|
+
</div>`
|
4054
|
+
: ''}
|
4055
|
+
${this.isFailed
|
4056
|
+
? x ` <div class="message bot">
|
4057
|
+
<div>${this.renderBotIcon()}</div>
|
4058
|
+
<div>
|
4059
|
+
<p>
|
4060
|
+
Uh-oh! Looks like I tripped over some alpha-stage wires.
|
4061
|
+
Things are still a bit wobbly here, buy hey, that's what
|
4062
|
+
testing is for, Let's try that again; or feel free to throw
|
4063
|
+
another challenge my way!
|
4064
|
+
</p>
|
4065
|
+
</div>
|
4066
|
+
</div>`
|
4067
|
+
: E}
|
4068
|
+
${o$1(this.messages, (message, index) => {
|
4069
|
+
if (message.sender === 'bot') {
|
4070
|
+
return this.botMessage(message, index);
|
4071
|
+
}
|
4072
|
+
return x ` <div class="message user">${message.message}</div> `;
|
4073
|
+
})}
|
4074
|
+
${!this.welcomeFlowTriggered || !this.thread
|
4075
|
+
? x `
|
4076
|
+
<div class="message bot">
|
4077
|
+
<div>${this.renderBotIcon()}</div>
|
4078
|
+
<div>
|
4079
|
+
<p>
|
4080
|
+
Hi,
|
4081
|
+
${this.brandName
|
4082
|
+
? x `Welcome to ${this.brandName}.`
|
4083
|
+
: E}
|
4084
|
+
I'm here to help you find the perfect product. Pick a suggested
|
4085
|
+
prompt from below, or enter your own query.
|
4086
|
+
</p>
|
4087
|
+
</div>
|
4088
|
+
</div>
|
4089
|
+
</div>`
|
4090
|
+
: E}
|
4091
|
+
</div>
|
4092
|
+
`;
|
4093
|
+
}
|
4094
|
+
renderPrompts() {
|
4095
|
+
var _a;
|
4096
|
+
if (this.isLoadingHistory || this.isStreaming || this.isLoadingThreads) {
|
4097
|
+
return E;
|
4098
|
+
}
|
4099
|
+
const latestMessage = this.messages[0];
|
4100
|
+
const isWelcomeMessage = this.messages.length === 1 && (latestMessage === null || latestMessage === void 0 ? void 0 : latestMessage.sender) === 'bot';
|
4101
|
+
const isLLMPrompt = !!((_a = latestMessage === null || latestMessage === void 0 ? void 0 : latestMessage.prompts) === null || _a === void 0 ? void 0 : _a.length);
|
4102
|
+
const prompts = this.messages.length
|
4103
|
+
? this.messages[0].prompts
|
4104
|
+
: this.prompts
|
4105
|
+
? this.prompts.split(',').map((prompt) => prompt.trim())
|
4106
|
+
: ['Best Sellers'];
|
4107
|
+
const customPrompts = !this.messages.length || isWelcomeMessage ? this.customPrompts : undefined;
|
4108
|
+
if (!prompts && !customPrompts) {
|
4109
|
+
return E;
|
4110
|
+
}
|
4111
|
+
return x `
|
4112
|
+
<div class="prompts btn">
|
4113
|
+
${o$1(prompts, (prompt) => {
|
4114
|
+
return x `
|
4115
|
+
<div
|
4116
|
+
class="prompt"
|
4117
|
+
@click=${(e) => {
|
4118
|
+
this.processMessage(e, prompt, true);
|
4119
|
+
const eventName = isLLMPrompt
|
4120
|
+
? 'customPromptClicked'
|
4121
|
+
: 'promptClicked';
|
4122
|
+
this.sendEvent(eventName, undefined, {
|
4123
|
+
promptName: prompt,
|
4124
|
+
});
|
4125
|
+
}}
|
4126
|
+
>
|
4127
|
+
${prompt}
|
4128
|
+
</div>
|
4129
|
+
`;
|
4130
|
+
})}
|
4131
|
+
${o$1(customPrompts, ({ prompt, link }) => {
|
4132
|
+
return x `
|
4133
|
+
<a
|
4134
|
+
class="prompt"
|
4135
|
+
href=${link}
|
4136
|
+
target="_blank"
|
4137
|
+
rel="noopener"
|
4138
|
+
@click=${() => this.sendEvent('promptClicked', undefined, {
|
4139
|
+
promptName: prompt,
|
4140
|
+
})}
|
4141
|
+
>
|
4142
|
+
${prompt}
|
4143
|
+
</a>
|
4144
|
+
`;
|
4145
|
+
})}
|
4146
|
+
</div>
|
4147
|
+
`;
|
4148
|
+
}
|
4149
|
+
showContext() {
|
4150
|
+
var _a;
|
4151
|
+
if (!((_a = this.thread) === null || _a === void 0 ? void 0 : _a.devContext)) {
|
4152
|
+
return x `
|
4153
|
+
<div class="context-container">
|
4154
|
+
<div class="context-title">
|
4155
|
+
<p>Context</p>
|
4156
|
+
<div
|
4157
|
+
class="btn"
|
4158
|
+
@click=${() => {
|
4159
|
+
if (!this.contextContainerElement) {
|
4160
|
+
return;
|
4161
|
+
}
|
4162
|
+
this.contextContainerElement.classList.remove('show');
|
4163
|
+
}}
|
4164
|
+
>
|
4165
|
+
${closeBtn}
|
4166
|
+
</div>
|
4167
|
+
</div>
|
4168
|
+
<p>
|
4169
|
+
This search thread has no pre-defined context. Start a new search to
|
4170
|
+
personalize.
|
4171
|
+
</p>
|
4172
|
+
</div>
|
4173
|
+
`;
|
4174
|
+
}
|
4175
|
+
const devContext = this.thread.devContext;
|
4176
|
+
const profileType = devContext.email
|
4177
|
+
? 'Pick your profile'
|
4178
|
+
: 'Stay Anonymous';
|
4179
|
+
const userDetails = devContext.email
|
4180
|
+
? `${capitalizeEachWord(devContext.firstName)} / ${capitalizeEachWord(devContext.gender)} / ${devContext.city} / ${devContext.state ? `- ${capitalizeEachWord(devContext.state)}` : ''} - ${devContext.preferences
|
4181
|
+
? `${devContext.preferences.size},${capitalizeEachWord(devContext.preferences.color)},${capitalizeEachWord(devContext.preferences.material)}`
|
4182
|
+
: ''}`
|
4183
|
+
: '';
|
4184
|
+
const visitationType = devContext.productHandle ? 'Via Ad' : 'Direct Visit';
|
4185
|
+
return x `
|
4186
|
+
<div class="context-container">
|
4187
|
+
<div class="context-title">
|
4188
|
+
<p>Context</p>
|
4189
|
+
<div
|
4190
|
+
class="btn"
|
4191
|
+
@click=${() => {
|
4192
|
+
var _a;
|
4193
|
+
(_a = this.contextContainerElement) === null || _a === void 0 ? void 0 : _a.classList.remove('show');
|
4194
|
+
}}
|
4195
|
+
>
|
4196
|
+
${closeBtn}
|
4197
|
+
</div>
|
4198
|
+
</div>
|
4199
|
+
<div>
|
4200
|
+
<div class="context">
|
4201
|
+
<span>Profile Type:</span>${' '}
|
4202
|
+
<span class="context-type-value"> ${profileType} </span>
|
4203
|
+
</div>
|
4204
|
+
${userDetails
|
4205
|
+
? x ` <div class="context user-details">${userDetails}</div>`
|
4206
|
+
: E}
|
4207
|
+
</div>
|
4208
|
+
<div>
|
4209
|
+
<div class="context">
|
4210
|
+
<span>Visitation Context:</span>${' '}
|
4211
|
+
<span class="context-type-value">${visitationType}</span>
|
4212
|
+
</div>
|
4213
|
+
${devContext.productHandle
|
4214
|
+
? x ` <div class="context product-handle">
|
4215
|
+
${devContext.productHandle}
|
4216
|
+
</div>`
|
4217
|
+
: E}
|
4218
|
+
</div>
|
4219
|
+
</div>
|
4220
|
+
`;
|
4221
|
+
}
|
4222
|
+
contextButton() {
|
4223
|
+
var _a, _b, _c, _d;
|
4224
|
+
if (!this.devMode) {
|
4225
|
+
return ((_a = this.thread) === null || _a === void 0 ? void 0 : _a.threadId)
|
4226
|
+
? x `<h2>${((_b = this.thread) === null || _b === void 0 ? void 0 : _b.title) || 'New Search'}</h2>`
|
4227
|
+
: x `<h2>New Search</h2>`;
|
4228
|
+
}
|
4229
|
+
if ((_c = this.thread) === null || _c === void 0 ? void 0 : _c.threadId) {
|
4230
|
+
return x `
|
4231
|
+
<h2>${((_d = this.thread) === null || _d === void 0 ? void 0 : _d.title) || 'New Search'}</h2>
|
4232
|
+
<button
|
4233
|
+
class="btn-context btn"
|
4234
|
+
@click=${() => {
|
4235
|
+
if (!this.contextContainerElement) {
|
4236
|
+
return;
|
4237
|
+
}
|
4238
|
+
this.contextContainerElement.classList.toggle('show');
|
4239
|
+
}}
|
4240
|
+
>
|
4241
|
+
SHOW CONTEXT
|
4242
|
+
</button>
|
4243
|
+
${this.showContext()}
|
4244
|
+
`;
|
4245
|
+
}
|
4246
|
+
return x `
|
4247
|
+
<h2>Click personalize for hyper Contextual</h2>
|
4248
|
+
<button
|
4249
|
+
class="btn-context active btn"
|
4250
|
+
@click=${() => this.personalizeDialogElement.showModal()}
|
4251
|
+
>
|
4252
|
+
Personalize
|
4253
|
+
</button>
|
4254
|
+
`;
|
4255
|
+
}
|
4256
|
+
render() {
|
4257
|
+
if (this.merchantImage) {
|
4258
|
+
// set the merchant image as a css variable
|
4259
|
+
this.style.setProperty('--shopgpt-merchant-img-url', `url('${this.merchantImage}')`);
|
4260
|
+
}
|
4261
|
+
else {
|
4262
|
+
this.style.removeProperty('--shopgpt-merchant-img-url');
|
4263
|
+
}
|
4264
|
+
return x `
|
4265
|
+
<div class="chat-header">${this.contextButton()}</div>
|
4266
|
+
<div class="chatbot-section">
|
4267
|
+
${this.chatWindow()} ${this.renderPrompts()}
|
4268
|
+
<form class="chat-form" @submit=${this.onSubmit}>
|
4269
|
+
<input
|
4270
|
+
type="text"
|
4271
|
+
.value=${this.userQuery}
|
4272
|
+
@input=${(e) => (this.userQuery = e.target.value)}
|
4273
|
+
placeholder="Type your search here..."
|
4274
|
+
/>
|
4275
|
+
<button
|
4276
|
+
class="btn"
|
4277
|
+
type="submit"
|
4278
|
+
?disabled=${this.isStreaming || this.isLoadingHistory}
|
4279
|
+
>
|
4280
|
+
${sendFilledIcon}
|
4281
|
+
</button>
|
4282
|
+
</form>
|
4283
|
+
</div>
|
4284
|
+
<personalize-dialog
|
4285
|
+
.createChatThread=${this.createChatThread.bind(this)}
|
4286
|
+
.defaultProductHandles=${this.productHandles}
|
4287
|
+
.defaultProfiles=${this.profiles}
|
4288
|
+
></personalize-dialog>
|
4289
|
+
${this.feedbackDetails
|
4290
|
+
? x `
|
4291
|
+
<feedback-dialog
|
4292
|
+
.messageId=${this.feedbackDetails.messageId}
|
4293
|
+
.queryMessageId=${this.feedbackDetails.queryMessageId}
|
4294
|
+
.threadId=${this.feedbackDetails.threadId}
|
4295
|
+
.comment=${this.feedbackDetails.comment}
|
4296
|
+
@submit-feedback=${() => {
|
4297
|
+
this.feedbackDetails = undefined;
|
4298
|
+
}}
|
4299
|
+
@close=${(e) => {
|
4300
|
+
e.stopPropagation();
|
4301
|
+
this.feedbackDetails = undefined;
|
4302
|
+
}}
|
4303
|
+
></feedback-dialog>
|
4304
|
+
`
|
4305
|
+
: E}
|
4306
|
+
`;
|
4307
|
+
}
|
4308
|
+
}
|
4309
|
+
ChatSection.styles = [chatSectionStyles$1];
|
4310
|
+
__decorate([
|
4311
|
+
n({ type: String }),
|
4312
|
+
__metadata("design:type", Object)
|
4313
|
+
], ChatSection.prototype, "merchantImage", void 0);
|
4314
|
+
__decorate([
|
4315
|
+
n({ type: String }),
|
4316
|
+
__metadata("design:type", Object)
|
4317
|
+
], ChatSection.prototype, "botIconUrl", void 0);
|
4318
|
+
__decorate([
|
4319
|
+
n({ type: String }),
|
4320
|
+
__metadata("design:type", Object)
|
4321
|
+
], ChatSection.prototype, "brandName", void 0);
|
4322
|
+
__decorate([
|
4323
|
+
n({ type: String }),
|
4324
|
+
__metadata("design:type", Object)
|
4325
|
+
], ChatSection.prototype, "prompts", void 0);
|
4326
|
+
__decorate([
|
4327
|
+
n({ type: Array }),
|
4328
|
+
__metadata("design:type", Object)
|
4329
|
+
], ChatSection.prototype, "customPrompts", void 0);
|
4330
|
+
__decorate([
|
4331
|
+
n({ type: Boolean }),
|
4332
|
+
__metadata("design:type", Boolean)
|
4333
|
+
], ChatSection.prototype, "isLoadingThreads", void 0);
|
4334
|
+
__decorate([
|
4335
|
+
n({ type: Boolean }),
|
4336
|
+
__metadata("design:type", Boolean)
|
4337
|
+
], ChatSection.prototype, "isLoadingHistory", void 0);
|
4338
|
+
__decorate([
|
4339
|
+
n({ type: Boolean }),
|
4340
|
+
__metadata("design:type", Object)
|
4341
|
+
], ChatSection.prototype, "devMode", void 0);
|
4342
|
+
__decorate([
|
4343
|
+
n({ type: Boolean }),
|
4344
|
+
__metadata("design:type", Boolean)
|
4345
|
+
], ChatSection.prototype, "isTyping", void 0);
|
4346
|
+
__decorate([
|
4347
|
+
n({ type: Boolean }),
|
4348
|
+
__metadata("design:type", Boolean)
|
4349
|
+
], ChatSection.prototype, "isStreaming", void 0);
|
4350
|
+
__decorate([
|
4351
|
+
n({ type: Boolean }),
|
4352
|
+
__metadata("design:type", Boolean)
|
4353
|
+
], ChatSection.prototype, "isFailed", void 0);
|
4354
|
+
__decorate([
|
4355
|
+
n({ type: Array }),
|
4356
|
+
__metadata("design:type", Array)
|
4357
|
+
], ChatSection.prototype, "messages", void 0);
|
4358
|
+
__decorate([
|
4359
|
+
n({ type: Array }),
|
4360
|
+
__metadata("design:type", Array)
|
4361
|
+
], ChatSection.prototype, "profiles", void 0);
|
4362
|
+
__decorate([
|
4363
|
+
n({ type: Array }),
|
4364
|
+
__metadata("design:type", Array)
|
4365
|
+
], ChatSection.prototype, "productHandles", void 0);
|
4366
|
+
__decorate([
|
4367
|
+
n({ type: Object }),
|
4368
|
+
__metadata("design:type", Object)
|
4369
|
+
], ChatSection.prototype, "thread", void 0);
|
4370
|
+
__decorate([
|
4371
|
+
n({ type: Object }),
|
4372
|
+
__metadata("design:type", Object)
|
4373
|
+
], ChatSection.prototype, "siteCurrency", void 0);
|
4374
|
+
__decorate([
|
4375
|
+
e$3('.context-container'),
|
4376
|
+
__metadata("design:type", Object)
|
4377
|
+
], ChatSection.prototype, "contextContainerElement", void 0);
|
4378
|
+
__decorate([
|
4379
|
+
e$3('.chat-window'),
|
4380
|
+
__metadata("design:type", Object)
|
4381
|
+
], ChatSection.prototype, "chatWindowElement", void 0);
|
4382
|
+
__decorate([
|
4383
|
+
e$3('personalize-dialog'),
|
4384
|
+
__metadata("design:type", Object)
|
4385
|
+
], ChatSection.prototype, "personalizeDialogElement", void 0);
|
4386
|
+
__decorate([
|
4387
|
+
r(),
|
4388
|
+
__metadata("design:type", Object)
|
4389
|
+
], ChatSection.prototype, "feedbackDetails", void 0);
|
4390
|
+
__decorate([
|
4391
|
+
n({ type: String }),
|
4392
|
+
__metadata("design:type", Object)
|
4393
|
+
], ChatSection.prototype, "userQuery", void 0);
|
4394
|
+
__decorate([
|
4395
|
+
n({ type: String }),
|
4396
|
+
__metadata("design:type", String)
|
4397
|
+
], ChatSection.prototype, "css", void 0);
|
4398
|
+
__decorate([
|
4399
|
+
n({ type: Boolean }),
|
4400
|
+
__metadata("design:type", Boolean)
|
4401
|
+
], ChatSection.prototype, "welcomeFlowTriggered", void 0);
|
4402
|
+
__decorate([
|
4403
|
+
n({ type: String }),
|
4404
|
+
__metadata("design:type", String)
|
4405
|
+
], ChatSection.prototype, "userId", void 0);
|
4406
|
+
if (!customElements.get('chat-section')) {
|
4407
|
+
customElements.define('chat-section', ChatSection);
|
4408
|
+
}
|
4409
|
+
|
4410
|
+
const chatSectionStyles = i$4 `
|
4411
|
+
:host {
|
4412
|
+
font-family: 'Inter', sans-serif;
|
4413
|
+
font-size: 16px;
|
4414
|
+
font-weight: 400;
|
4415
|
+
|
4416
|
+
h2,
|
4417
|
+
p {
|
4418
|
+
margin: 0;
|
4419
|
+
}
|
4420
|
+
|
4421
|
+
button {
|
4422
|
+
border-style: none;
|
4423
|
+
cursor: pointer;
|
4424
|
+
}
|
4425
|
+
}
|
4426
|
+
|
4427
|
+
.btn {
|
4428
|
+
cursor: pointer;
|
4429
|
+
}
|
4430
|
+
|
4431
|
+
.chat-header {
|
4432
|
+
padding: 15px 19px;
|
4433
|
+
display: flex;
|
4434
|
+
justify-content: space-between;
|
4435
|
+
align-items: center;
|
4436
|
+
background: #020617;
|
4437
|
+
gap: 8px;
|
4438
|
+
height: 60px;
|
4439
|
+
box-sizing: border-box;
|
4440
|
+
|
4441
|
+
h2 {
|
4442
|
+
color: #ffffff;
|
4443
|
+
font-size: 16px;
|
4444
|
+
font-weight: 400;
|
4445
|
+
line-height: 24px;
|
4446
|
+
text-transform: capitalize;
|
4447
|
+
white-space: nowrap;
|
4448
|
+
overflow: hidden;
|
4449
|
+
text-overflow: ellipsis;
|
4450
|
+
}
|
4451
|
+
|
4452
|
+
.btns-wrapper {
|
4453
|
+
margin-left: auto;
|
4454
|
+
display: flex;
|
4455
|
+
align-items: center;
|
4456
|
+
gap: 20px;
|
4457
|
+
|
4458
|
+
.btn-icon {
|
4459
|
+
border-radius: 50%;
|
4460
|
+
padding: 0;
|
4461
|
+
background: transparent;
|
4462
|
+
margin: 0;
|
4463
|
+
display: flex;
|
4464
|
+
align-items: center;
|
4465
|
+
justify-content: center;
|
4466
|
+
height: 24px;
|
4467
|
+
width: 24px;
|
4468
|
+
opacity: 1;
|
4469
|
+
|
4470
|
+
&:hover {
|
4471
|
+
opacity: 0.7;
|
4472
|
+
}
|
4473
|
+
|
4474
|
+
&.active {
|
4475
|
+
opacity: 1;
|
4476
|
+
}
|
4477
|
+
|
4478
|
+
&:disabled {
|
4479
|
+
cursor: not-allowed;
|
4480
|
+
opacity: 0.5;
|
4481
|
+
}
|
4482
|
+
}
|
4483
|
+
}
|
4484
|
+
}
|
4485
|
+
|
4486
|
+
.chatbot-section {
|
4487
|
+
display: flex;
|
4488
|
+
flex-direction: column;
|
4489
|
+
background-color: #fff;
|
4490
|
+
height: calc(100% - 73px);
|
4491
|
+
padding: 0px 20px 13px;
|
4492
|
+
gap: 11px;
|
4493
|
+
}
|
4494
|
+
|
4495
|
+
.chat-form {
|
4496
|
+
display: flex;
|
4497
|
+
align-items: center;
|
4498
|
+
margin: 0;
|
4499
|
+
position: relative;
|
4500
|
+
|
4501
|
+
.sparkles-icon {
|
4502
|
+
position: absolute;
|
4503
|
+
left: 15px;
|
4504
|
+
top: 50%;
|
4505
|
+
transform: translateY(-50%);
|
4506
|
+
pointer-events: none;
|
4507
|
+
transition: opacity 0.2s;
|
4508
|
+
}
|
4509
|
+
|
4510
|
+
input {
|
4511
|
+
flex: 1;
|
4512
|
+
padding: 10px 38px 12px 35px;
|
4513
|
+
font-weight: 500;
|
4514
|
+
font-size: 14px;
|
4515
|
+
line-height: 20px;
|
4516
|
+
color: #201d2f;
|
4517
|
+
|
4518
|
+
background: #fff;
|
4519
|
+
border-radius: 6px;
|
4520
|
+
border: 0.5px solid #bbbbce;
|
4521
|
+
box-shadow: 0px 4px 10px 0px #0000000d;
|
4522
|
+
|
4523
|
+
&:focus {
|
4524
|
+
outline-width: 0;
|
4525
|
+
}
|
4526
|
+
|
4527
|
+
&::placeholder {
|
4528
|
+
font-weight: 400;
|
4529
|
+
font-size: 14px;
|
4530
|
+
color: #94a3b8;
|
4531
|
+
}
|
4532
|
+
}
|
4533
|
+
|
4534
|
+
.send-btn {
|
4535
|
+
position: absolute;
|
4536
|
+
padding: 0;
|
4537
|
+
display: flex;
|
4538
|
+
justify-content: center;
|
4539
|
+
align-items: center;
|
4540
|
+
right: 11px;
|
4541
|
+
background-color: unset;
|
4542
|
+
|
4543
|
+
&:disabled {
|
4544
|
+
opacity: 0.3;
|
4545
|
+
cursor: not-allowed;
|
4546
|
+
}
|
4547
|
+
}
|
4548
|
+
}
|
4549
|
+
|
4550
|
+
.chat-welcome {
|
4551
|
+
display: flex;
|
4552
|
+
flex-direction: column;
|
4553
|
+
gap: 24px;
|
4554
|
+
flex: 1;
|
4555
|
+
align-items: center;
|
4556
|
+
justify-content: center;
|
4557
|
+
|
4558
|
+
.bot-icon {
|
4559
|
+
border-radius: 50px;
|
4560
|
+
width: 100px;
|
4561
|
+
height: 100px;
|
4562
|
+
}
|
4563
|
+
|
4564
|
+
.welcome-title {
|
4565
|
+
font-weight: 700;
|
4566
|
+
font-style: normal;
|
4567
|
+
font-size: 36px;
|
4568
|
+
line-height: 100%;
|
4569
|
+
text-align: center;
|
4570
|
+
color: #020617;
|
4571
|
+
margin-bottom: 8px;
|
4572
|
+
}
|
4573
|
+
|
4574
|
+
.welcome-message {
|
4575
|
+
font-style: normal;
|
4576
|
+
font-size: 14px;
|
4577
|
+
font-weight: 500;
|
4578
|
+
line-height: 20px;
|
4579
|
+
text-align: center;
|
4580
|
+
color: #64748b;
|
4581
|
+
margin: 0 32px 8px;
|
4582
|
+
}
|
4583
|
+
}
|
4584
|
+
|
4585
|
+
.messages {
|
4586
|
+
flex: 1;
|
4587
|
+
overflow-y: auto;
|
4588
|
+
display: flex;
|
4589
|
+
flex-direction: column-reverse;
|
4590
|
+
gap: 12px;
|
4591
|
+
padding-bottom: 10px;
|
4592
|
+
margin-bottom: -10px;
|
4593
|
+
margin-right: -10px;
|
4594
|
+
padding-right: 10px;
|
4595
|
+
margin-left: -10px;
|
4596
|
+
padding-left: 10px;
|
4597
|
+
background: linear-gradient(#f7f8fa80, #f7f8fa80),
|
4598
|
+
var(--shopgpt-merchant-img-url);
|
4599
|
+
background-position: center;
|
4600
|
+
background-repeat: no-repeat;
|
4601
|
+
background-size: contain;
|
4602
|
+
|
4603
|
+
&.loading {
|
4604
|
+
justify-content: center;
|
4605
|
+
align-items: center;
|
4606
|
+
}
|
4607
|
+
|
4608
|
+
.message:last-child {
|
4609
|
+
margin-top: 10px;
|
4610
|
+
}
|
4611
|
+
}
|
4612
|
+
|
4613
|
+
.message-wrapper {
|
4614
|
+
display: flex;
|
4615
|
+
flex-direction: column;
|
4616
|
+
gap: 16px;
|
4617
|
+
margin-bottom: 10px;
|
4618
|
+
}
|
4619
|
+
|
4620
|
+
.message {
|
4621
|
+
font-size: 14px;
|
4622
|
+
line-height: 20px;
|
4623
|
+
}
|
4624
|
+
|
4625
|
+
.message.user {
|
4626
|
+
background: #18181b;
|
4627
|
+
color: #fafafa;
|
4628
|
+
max-width: 75%;
|
4629
|
+
align-self: flex-end;
|
4630
|
+
padding: 8px 12px;
|
4631
|
+
border-radius: 6px;
|
4632
|
+
}
|
4633
|
+
|
4634
|
+
.message.bot {
|
4635
|
+
display: flex;
|
4636
|
+
gap: 16px;
|
4637
|
+
color: #000000;
|
4638
|
+
max-width: 80%;
|
4639
|
+
}
|
4640
|
+
|
4641
|
+
.bot-response-actions {
|
4642
|
+
display: flex;
|
4643
|
+
gap: 20px;
|
4644
|
+
margin-top: -2px;
|
4645
|
+
|
4646
|
+
button {
|
4647
|
+
display: flex;
|
4648
|
+
align-items: center;
|
4649
|
+
justify-content: center;
|
4650
|
+
background: none;
|
4651
|
+
padding: 0px;
|
4652
|
+
|
4653
|
+
&:hover {
|
4654
|
+
opacity: 0.7;
|
4655
|
+
}
|
4656
|
+
}
|
4657
|
+
}
|
4658
|
+
|
4659
|
+
.bot-icon {
|
4660
|
+
display: flex;
|
4661
|
+
padding: 8px 11px;
|
4662
|
+
justify-content: center;
|
4663
|
+
align-items: center;
|
4664
|
+
border-radius: 70px;
|
4665
|
+
border: 1px solid #dbe2eb;
|
4666
|
+
background: #fff;
|
4667
|
+
width: 36px;
|
4668
|
+
height: 36px;
|
4669
|
+
box-sizing: border-box;
|
4670
|
+
}
|
4671
|
+
|
4672
|
+
.prompts {
|
4673
|
+
display: flex;
|
4674
|
+
justify-content: center;
|
4675
|
+
gap: 10px;
|
4676
|
+
flex-wrap: wrap;
|
4677
|
+
|
4678
|
+
.prompt {
|
4679
|
+
padding: 8px 12px;
|
4680
|
+
border-radius: 6px;
|
4681
|
+
border: 1px solid #e4e4e7;
|
4682
|
+
text-decoration: none;
|
4683
|
+
white-space: nowrap;
|
4684
|
+
display: inline-flex;
|
4685
|
+
|
4686
|
+
color: #18181b;
|
4687
|
+
font-size: 14px;
|
4688
|
+
font-weight: 500;
|
4689
|
+
line-height: 20px;
|
4690
|
+
|
4691
|
+
&:hover {
|
4692
|
+
opacity: 0.7;
|
4693
|
+
}
|
4694
|
+
|
4695
|
+
&:active {
|
4696
|
+
opacity: 1;
|
4697
|
+
}
|
4698
|
+
}
|
4699
|
+
|
4700
|
+
&.left-align {
|
4701
|
+
justify-content: flex-start;
|
4702
|
+
}
|
4703
|
+
}
|
4704
|
+
|
4705
|
+
#modal-chat-threads {
|
4706
|
+
.chat-threads {
|
4707
|
+
position: absolute;
|
4708
|
+
overflow: hidden;
|
4709
|
+
z-index: 1;
|
4710
|
+
top: 60px;
|
4711
|
+
height: 30%;
|
4712
|
+
width: 100%;
|
4713
|
+
background: #fff;
|
4714
|
+
box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12),
|
4715
|
+
0px 20px 20px 0px rgba(0, 0, 0, 0.08);
|
4716
|
+
border-radius: 0px 0px 10px 10px;
|
4717
|
+
|
4718
|
+
.title-wrapper {
|
4719
|
+
display: flex;
|
4720
|
+
justify-content: space-between;
|
4721
|
+
align-items: center;
|
4722
|
+
border-bottom: 1px solid #dbe2eb;
|
4723
|
+
padding: 10px 16px;
|
4724
|
+
|
4725
|
+
h2 {
|
4726
|
+
color: #172a41;
|
4727
|
+
font-size: 16px;
|
4728
|
+
font-weight: 700;
|
4729
|
+
line-height: 20px;
|
4730
|
+
}
|
4731
|
+
}
|
4732
|
+
|
4733
|
+
.thread-titles-wrapper {
|
4734
|
+
overflow-y: auto;
|
4735
|
+
height: calc(100% - 40px);
|
4736
|
+
}
|
4737
|
+
|
4738
|
+
.thread-title {
|
4739
|
+
display: flex;
|
4740
|
+
justify-content: space-between;
|
4741
|
+
padding: 10px 16px;
|
4742
|
+
color: #4e647f;
|
4743
|
+
cursor: pointer;
|
4744
|
+
|
4745
|
+
p {
|
4746
|
+
font-size: 14px;
|
4747
|
+
font-weight: 400;
|
4748
|
+
line-height: 20px;
|
4749
|
+
width: 100%;
|
4750
|
+
}
|
4751
|
+
|
4752
|
+
.trash-icon {
|
4753
|
+
display: none;
|
4754
|
+
}
|
4755
|
+
|
4756
|
+
&:hover {
|
4757
|
+
background: #f1f4f8;
|
4758
|
+
|
4759
|
+
.trash-icon {
|
4760
|
+
display: flex;
|
4761
|
+
}
|
4762
|
+
}
|
4763
|
+
}
|
4764
|
+
|
4765
|
+
.thread-title.disabled {
|
4766
|
+
cursor: not-allowed;
|
4767
|
+
}
|
4768
|
+
}
|
4769
|
+
|
4770
|
+
.trash-icon {
|
4771
|
+
display: flex;
|
4772
|
+
justify-content: center;
|
4773
|
+
align-items: center;
|
4774
|
+
padding: 2px;
|
4775
|
+
cursor: pointer;
|
4776
|
+
|
4777
|
+
&:hover {
|
4778
|
+
border-radius: 5px;
|
4779
|
+
background: #dc3545;
|
4780
|
+
|
4781
|
+
path {
|
4782
|
+
fill: white;
|
4783
|
+
}
|
4784
|
+
}
|
4785
|
+
}
|
4786
|
+
|
4787
|
+
.chat-threads-background {
|
4788
|
+
position: absolute;
|
4789
|
+
top: 78px;
|
4790
|
+
height: 100%;
|
4791
|
+
width: 100%;
|
4792
|
+
opacity: 0.5;
|
4793
|
+
background: #000;
|
4794
|
+
z-index: 0;
|
4795
|
+
}
|
4796
|
+
}
|
4797
|
+
|
4798
|
+
footer {
|
4799
|
+
text-align: center;
|
4800
|
+
font-size: 12px;
|
4801
|
+
line-height: 16px;
|
4802
|
+
color: #64748b;
|
4803
|
+
font-weight: 500;
|
4804
|
+
|
4805
|
+
a {
|
4806
|
+
color: #ef4444;
|
4807
|
+
text-decoration: none;
|
4808
|
+
}
|
4809
|
+
}
|
4810
|
+
|
4811
|
+
${scrollBarStyles}
|
4812
|
+
`;
|
4813
|
+
|
4814
|
+
class TooltipComponent extends i$1 {
|
4815
|
+
constructor() {
|
4816
|
+
super(...arguments);
|
4817
|
+
this.position = 'bottom-left';
|
4818
|
+
this.text = '';
|
4819
|
+
}
|
4820
|
+
render() {
|
4821
|
+
return x `
|
4822
|
+
<slot></slot>
|
4823
|
+
<div class="tooltip ${this.position}">${this.text}</div>
|
4824
|
+
`;
|
4825
|
+
}
|
4826
|
+
}
|
4827
|
+
TooltipComponent.styles = [
|
4828
|
+
i$4 `
|
4829
|
+
:host {
|
4830
|
+
position: relative;
|
4831
|
+
display: inline-block;
|
4832
|
+
}
|
4833
|
+
|
4834
|
+
.tooltip {
|
4835
|
+
position: absolute;
|
4836
|
+
color: #172a41;
|
4837
|
+
padding: 4px 8px;
|
4838
|
+
white-space: nowrap;
|
4839
|
+
font-size: 12px;
|
4840
|
+
opacity: 0;
|
4841
|
+
transition: opacity 0.2s;
|
4842
|
+
pointer-events: none;
|
4843
|
+
|
4844
|
+
border-radius: 5px;
|
4845
|
+
background: #fff;
|
4846
|
+
|
4847
|
+
font-style: normal;
|
4848
|
+
font-weight: 400;
|
4849
|
+
line-height: 150%;
|
4850
|
+
}
|
4851
|
+
|
4852
|
+
:host(:hover) .tooltip {
|
4853
|
+
opacity: 1;
|
4854
|
+
}
|
4855
|
+
|
4856
|
+
.top-center {
|
4857
|
+
bottom: calc(100% + 2px);
|
4858
|
+
left: 50%;
|
4859
|
+
transform: translateX(-50%);
|
4860
|
+
}
|
4861
|
+
|
4862
|
+
.top-left {
|
4863
|
+
bottom: calc(100% + 2px);
|
4864
|
+
left: 0;
|
4865
|
+
}
|
4866
|
+
|
4867
|
+
.top-right {
|
4868
|
+
bottom: calc(100% + 2px);
|
4869
|
+
right: 0;
|
4870
|
+
}
|
4871
|
+
|
4872
|
+
.bottom-center {
|
4873
|
+
top: calc(100% + 2px);
|
4874
|
+
left: 50%;
|
4875
|
+
transform: translateX(-50%);
|
4876
|
+
}
|
4877
|
+
|
4878
|
+
.bottom-left {
|
4879
|
+
top: calc(100% + 2px);
|
4880
|
+
left: 0;
|
4881
|
+
}
|
4882
|
+
|
4883
|
+
.bottom-right {
|
4884
|
+
top: calc(100% + 2px);
|
4885
|
+
right: 0;
|
4886
|
+
}
|
4887
|
+
|
4888
|
+
.left-center {
|
4889
|
+
right: calc(100% + 2px);
|
4890
|
+
top: 50%;
|
4891
|
+
transform: translateY(-50%);
|
4892
|
+
}
|
4893
|
+
|
4894
|
+
.left-top {
|
4895
|
+
right: calc(100% + 2px);
|
4896
|
+
top: 0;
|
4897
|
+
}
|
4898
|
+
|
4899
|
+
.left-bottom {
|
4900
|
+
right: calc(100% + 2px);
|
4901
|
+
bottom: 0;
|
4902
|
+
}
|
4903
|
+
|
4904
|
+
.right-center {
|
4905
|
+
left: calc(100% + 2px);
|
4906
|
+
top: 50%;
|
4907
|
+
transform: translateY(-50%);
|
4908
|
+
}
|
4909
|
+
|
4910
|
+
.right-top {
|
4911
|
+
left: calc(100% + 2px);
|
4912
|
+
top: 0;
|
4913
|
+
}
|
4914
|
+
|
4915
|
+
.right-bottom {
|
4916
|
+
left: calc(100% + 2px);
|
4917
|
+
bottom: 0;
|
4918
|
+
}
|
4919
|
+
`,
|
4920
|
+
];
|
4921
|
+
__decorate([
|
4922
|
+
n({ type: String }),
|
4923
|
+
__metadata("design:type", String)
|
4924
|
+
], TooltipComponent.prototype, "position", void 0);
|
4925
|
+
__decorate([
|
4926
|
+
n({ type: String }),
|
4927
|
+
__metadata("design:type", Object)
|
4928
|
+
], TooltipComponent.prototype, "text", void 0);
|
4929
|
+
if (!customElements.get('tooltip-component')) {
|
4930
|
+
customElements.define('tooltip-component', TooltipComponent);
|
4931
|
+
}
|
4932
|
+
|
4933
|
+
const confirmDialogStyles = i$4 `
|
4934
|
+
:host {
|
4935
|
+
font-family: 'Inter', sans-serif;
|
4936
|
+
font-size: 16px;
|
4937
|
+
font-weight: 400;
|
4938
|
+
|
4939
|
+
display: flex;
|
4940
|
+
position: absolute;
|
4941
|
+
top: 0;
|
4942
|
+
left: 0;
|
4943
|
+
width: 100%;
|
4944
|
+
height: 100%;
|
4945
|
+
background: #00000050;
|
4946
|
+
}
|
4947
|
+
|
4948
|
+
.modal {
|
4949
|
+
width: 75%;
|
4950
|
+
max-width: 350px;
|
4951
|
+
background: #fff;
|
4952
|
+
padding: 16px;
|
4953
|
+
margin: auto;
|
4954
|
+
|
4955
|
+
border-radius: 10px;
|
4956
|
+
box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12),
|
4957
|
+
0px 20px 20px 0px rgba(0, 0, 0, 0.08);
|
4958
|
+
|
4959
|
+
z-index: 2000;
|
4960
|
+
}
|
4961
|
+
|
4962
|
+
::slotted([slot='title']) {
|
4963
|
+
margin-bottom: 8px !important;
|
4964
|
+
color: #172a41;
|
4965
|
+
font-size: 18px;
|
4966
|
+
font-weight: 700;
|
4967
|
+
line-height: 150%;
|
4968
|
+
}
|
4969
|
+
|
4970
|
+
::slotted([slot='content']) {
|
4971
|
+
color: #4e647f;
|
4972
|
+
line-height: 150%;
|
4973
|
+
}
|
4974
|
+
|
4975
|
+
.button-wrapper {
|
4976
|
+
margin-top: 12px;
|
4977
|
+
display: flex;
|
4978
|
+
gap: 12px;
|
4979
|
+
|
4980
|
+
.btn {
|
4981
|
+
justify-self: stretch;
|
4982
|
+
padding: 10px;
|
4983
|
+
cursor: pointer;
|
4984
|
+
text-align: center;
|
4985
|
+
width: 100%;
|
4986
|
+
border: 0;
|
4987
|
+
color: #fff;
|
4988
|
+
line-height: 150%;
|
4989
|
+
text-transform: capitalize;
|
4990
|
+
}
|
4991
|
+
|
4992
|
+
.accept-btn {
|
4993
|
+
border-radius: 5px;
|
4994
|
+
background: #dc3545;
|
4995
|
+
|
4996
|
+
&:hover {
|
4997
|
+
background: rgb(176, 62, 25);
|
4998
|
+
}
|
4999
|
+
}
|
5000
|
+
|
5001
|
+
.decline-btn {
|
5002
|
+
border-radius: 5px;
|
5003
|
+
background: #4e647f;
|
5004
|
+
|
5005
|
+
&:hover {
|
5006
|
+
background: rgb(57, 77, 102);
|
5007
|
+
}
|
5008
|
+
}
|
5009
|
+
}
|
5010
|
+
`;
|
5011
|
+
|
5012
|
+
class ConfirmDialog extends i$1 {
|
5013
|
+
onAcceptClick(e) {
|
5014
|
+
e.preventDefault();
|
5015
|
+
this.dispatchEvent(new CustomEvent('accept', {
|
5016
|
+
composed: true,
|
5017
|
+
}));
|
5018
|
+
}
|
5019
|
+
onCancelClick(e) {
|
5020
|
+
e.preventDefault();
|
5021
|
+
this.dispatchEvent(new CustomEvent('decline', {
|
5022
|
+
composed: true,
|
5023
|
+
}));
|
5024
|
+
}
|
5025
|
+
render() {
|
5026
|
+
return x `
|
5027
|
+
<div class="modal">
|
5028
|
+
<slot name="title"></slot>
|
5029
|
+
<slot name="content"></slot>
|
5030
|
+
<div class="button-wrapper">
|
5031
|
+
<slot name="accept-btn">
|
5032
|
+
<button class="btn accept-btn" @click=${this.onAcceptClick}>
|
5033
|
+
Delete
|
5034
|
+
</button>
|
5035
|
+
</slot>
|
5036
|
+
<slot name="decline-btn">
|
5037
|
+
<button class="btn decline-btn" @click=${this.onCancelClick}>
|
5038
|
+
Cancel
|
5039
|
+
</button>
|
5040
|
+
</slot>
|
5041
|
+
</div>
|
5042
|
+
</div>
|
5043
|
+
`;
|
5044
|
+
}
|
5045
|
+
}
|
5046
|
+
ConfirmDialog.styles = [confirmDialogStyles];
|
5047
|
+
if (!customElements.get('confirm-dialog')) {
|
5048
|
+
customElements.define('confirm-dialog', ConfirmDialog);
|
5049
|
+
}
|
5050
|
+
|
5051
|
+
const chatbotIcon = b `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
5052
|
+
<path d="M13.9999 6.99999V2.33333H9.33325M2.33325 14H4.66659M10.4999 12.8333V15.1667M17.4999 12.8333V15.1667M23.3333 14H25.6666M9.33325 21L4.66659 25.6667V9.33333C4.66659 8.71449 4.91242 8.121 5.35 7.68341C5.78759 7.24583 6.38108 6.99999 6.99992 6.99999H20.9999C21.6188 6.99999 22.2122 7.24583 22.6498 7.68341C23.0874 8.121 23.3333 8.71449 23.3333 9.33333V18.6667C23.3333 19.2855 23.0874 19.879 22.6498 20.3166C22.2122 20.7542 21.6188 21 20.9999 21H9.33325Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
5053
|
+
</svg>`;
|
5054
|
+
class ChatbotIcon extends i$1 {
|
5055
|
+
render() {
|
5056
|
+
return x ` <div class="chatbot-icon">${chatbotIcon}</div> `;
|
5057
|
+
}
|
5058
|
+
}
|
5059
|
+
ChatbotIcon.styles = [
|
5060
|
+
i$4 `
|
5061
|
+
.chatbot-icon {
|
5062
|
+
border: none;
|
5063
|
+
cursor: pointer;
|
5064
|
+
width: 60px;
|
5065
|
+
height: 58px;
|
5066
|
+
background-color: #020617;
|
5067
|
+
border-radius: 50%;
|
5068
|
+
display: flex;
|
5069
|
+
justify-content: center;
|
5070
|
+
align-items: center;
|
5071
|
+
box-shadow: 0px 10px 10px -5px #0000000a;
|
5072
|
+
}
|
5073
|
+
`,
|
5074
|
+
];
|
5075
|
+
if (!customElements.get('chatbot-icon')) {
|
5076
|
+
customElements.define('chatbot-icon', ChatbotIcon);
|
5077
|
+
}
|
5078
|
+
|
5079
|
+
class PopupView extends i$1 {
|
5080
|
+
constructor() {
|
5081
|
+
super(...arguments);
|
5082
|
+
this.showChatThreads = false;
|
5083
|
+
this.deleteAllThreads = false;
|
5084
|
+
this.userQuery = '';
|
5085
|
+
this.isStylesheetInjected = false;
|
5086
|
+
}
|
5087
|
+
connectedCallback() {
|
5088
|
+
super.connectedCallback();
|
5089
|
+
this.injectCustomCSS();
|
5090
|
+
}
|
5091
|
+
injectCustomCSS() {
|
5092
|
+
if (!this.isStylesheetInjected && this.css) {
|
5093
|
+
const sheet = new CSSStyleSheet();
|
5094
|
+
sheet.replaceSync(this.css);
|
5095
|
+
this.shadowRoot.adoptedStyleSheets.push(sheet);
|
5096
|
+
this.isStylesheetInjected = true;
|
5097
|
+
}
|
5098
|
+
}
|
5099
|
+
scrollToBottom() {
|
5100
|
+
var _a;
|
5101
|
+
(_a = this.chatWindowElement) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
5102
|
+
top: this.chatWindowElement.scrollHeight,
|
5103
|
+
behavior: 'smooth',
|
5104
|
+
});
|
5105
|
+
}
|
5106
|
+
async processMessage(e, message, isPrompt = false) {
|
5107
|
+
this.scrollToBottom();
|
5108
|
+
if (!this.thread) {
|
5109
|
+
await this.createChatThread({ title: '' }, false);
|
5110
|
+
}
|
5111
|
+
await this.sendMessageToServer(e, message, isPrompt);
|
5112
|
+
}
|
5113
|
+
sendEvent(action, actionData, clickData) {
|
5114
|
+
this.dispatchEvent(new CustomEvent('send-event', {
|
5115
|
+
detail: { action, actionData, clickData },
|
5116
|
+
composed: true,
|
5117
|
+
bubbles: true,
|
5118
|
+
}));
|
5119
|
+
}
|
5120
|
+
async onSubmit(e) {
|
5121
|
+
var _a;
|
5122
|
+
e.preventDefault();
|
5123
|
+
const message = (_a = this.userQuery) === null || _a === void 0 ? void 0 : _a.trim();
|
5124
|
+
this.userQuery = '';
|
5125
|
+
await this.processMessage(e, message, false);
|
5126
|
+
}
|
5127
|
+
handleThreadDelete() {
|
5128
|
+
if (this.deleteAllThreads) {
|
5129
|
+
this.dispatchEvent(new CustomEvent('delete-all-threads', {
|
5130
|
+
composed: true,
|
5131
|
+
bubbles: true,
|
5132
|
+
}));
|
5133
|
+
this.deleteAllThreads = false;
|
5134
|
+
return;
|
5135
|
+
}
|
5136
|
+
if (!this.deleteThreadId) {
|
5137
|
+
return;
|
5138
|
+
}
|
5139
|
+
this.dispatchEvent(new CustomEvent('delete-thread', {
|
5140
|
+
detail: { threadId: this.deleteThreadId },
|
5141
|
+
composed: true,
|
5142
|
+
bubbles: true,
|
5143
|
+
}));
|
5144
|
+
this.deleteThreadId = '';
|
5145
|
+
}
|
5146
|
+
handleFeedback(rating, messageId, queryMessageId, comment, query, response) {
|
5147
|
+
var _a, _b, _c, _d;
|
5148
|
+
if (rating === 'bad') {
|
5149
|
+
this.sendEvent('thumbsDown', undefined, {
|
5150
|
+
messageId,
|
5151
|
+
threadId: ((_a = this.thread) === null || _a === void 0 ? void 0 : _a.threadId) || '',
|
5152
|
+
rating,
|
5153
|
+
comment: comment !== null && comment !== void 0 ? comment : '',
|
5154
|
+
query: query !== null && query !== void 0 ? query : '',
|
5155
|
+
response: response !== null && response !== void 0 ? response : '',
|
5156
|
+
});
|
5157
|
+
this.feedbackDetails = {
|
5158
|
+
messageId,
|
5159
|
+
queryMessageId,
|
5160
|
+
threadId: ((_b = this.thread) === null || _b === void 0 ? void 0 : _b.threadId) || '',
|
5161
|
+
comment,
|
5162
|
+
};
|
5163
|
+
return;
|
5164
|
+
}
|
5165
|
+
this.sendEvent('thumbsUp', undefined, {
|
5166
|
+
messageId,
|
5167
|
+
threadId: ((_c = this.thread) === null || _c === void 0 ? void 0 : _c.threadId) || '',
|
5168
|
+
rating,
|
5169
|
+
comment: comment !== null && comment !== void 0 ? comment : '',
|
5170
|
+
query: query !== null && query !== void 0 ? query : '',
|
5171
|
+
response: response !== null && response !== void 0 ? response : '',
|
5172
|
+
});
|
5173
|
+
this.dispatchEvent(new CustomEvent('submit-feedback', {
|
5174
|
+
detail: {
|
5175
|
+
messageId: messageId,
|
5176
|
+
queryMessageId: queryMessageId,
|
5177
|
+
threadId: (_d = this.thread) === null || _d === void 0 ? void 0 : _d.threadId,
|
5178
|
+
feedback: {
|
5179
|
+
rating,
|
5180
|
+
comment: null,
|
5181
|
+
},
|
5182
|
+
},
|
5183
|
+
composed: true,
|
5184
|
+
bubbles: true,
|
5185
|
+
}));
|
5186
|
+
}
|
5187
|
+
botMessage(message, index) {
|
5188
|
+
var _a, _b, _c, _d;
|
5189
|
+
const queryMessage = this.messages[index + 1];
|
5190
|
+
return x `
|
5191
|
+
<div class="message-wrapper">
|
5192
|
+
<div class="message bot">
|
5193
|
+
<div>
|
5194
|
+
${message.message
|
5195
|
+
? x ` <markdown-renderer
|
5196
|
+
.content=${message.message}
|
5197
|
+
></markdown-renderer>`
|
5198
|
+
: E}
|
5199
|
+
</div>
|
5200
|
+
</div>
|
5201
|
+
${message.products
|
5202
|
+
? x ` <products-list
|
5203
|
+
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
5204
|
+
.response=${message.message}
|
5205
|
+
.products=${message.products}
|
5206
|
+
.siteCurrency=${this.siteCurrency}
|
5207
|
+
.viewType=${this.viewType}
|
5208
|
+
.userId=${this.userId}
|
5209
|
+
></products-list>`
|
5210
|
+
: E}
|
5211
|
+
${message.messageId && (queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId)
|
5212
|
+
? x ` <div class="bot-response-actions">
|
5213
|
+
<button
|
5214
|
+
type="button"
|
5215
|
+
@click=${this.handleFeedback.bind(this, 'good', message.messageId, queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId, (_a = message.feedback) === null || _a === void 0 ? void 0 : _a.comment, queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message, message === null || message === void 0 ? void 0 : message.message)}
|
5216
|
+
>
|
5217
|
+
${((_b = message.feedback) === null || _b === void 0 ? void 0 : _b.rating) === 'good'
|
5218
|
+
? thumbsUpFilledBtn
|
5219
|
+
: thumbsUpBtn}
|
5220
|
+
</button>
|
5221
|
+
<button
|
5222
|
+
type="button"
|
5223
|
+
@click=${this.handleFeedback.bind(this, 'bad', message.messageId, queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId, (_c = message.feedback) === null || _c === void 0 ? void 0 : _c.comment, queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message, message === null || message === void 0 ? void 0 : message.message)}
|
5224
|
+
>
|
5225
|
+
${((_d = message.feedback) === null || _d === void 0 ? void 0 : _d.rating) === 'bad'
|
5226
|
+
? thumbsDownFilledBtn
|
5227
|
+
: thumbsDownBtn}
|
5228
|
+
</button>
|
5229
|
+
</div>`
|
5230
|
+
: E}
|
5231
|
+
${index === 0 ? this.renderPrompts() : E}
|
5232
|
+
</div>
|
5233
|
+
`;
|
5234
|
+
}
|
5235
|
+
renderBotIcon(width = 30, height = 30) {
|
5236
|
+
if (!this.botIconUrl) {
|
5237
|
+
return E;
|
5238
|
+
}
|
5239
|
+
return x ` <div class="bot-icon">
|
5240
|
+
<img src=${this.botIconUrl} width=${width} height=${height} />
|
5241
|
+
</div>`;
|
5242
|
+
}
|
5243
|
+
chatWindow() {
|
5244
|
+
if (this.isLoadingHistory || this.isLoadingThreads) {
|
5245
|
+
return x ` <div class="messages loading">
|
5246
|
+
<load-spinner></load-spinner>
|
5247
|
+
</div>`;
|
5248
|
+
}
|
5249
|
+
if (this.messages.length === 0) {
|
5250
|
+
return x `
|
5251
|
+
<div class="chat-welcome">
|
5252
|
+
${this.botIconUrl
|
5253
|
+
? this.renderBotIcon(60, 60)
|
5254
|
+
: x `<chatbot-icon></chatbot-icon>`}
|
5255
|
+
<div>
|
5256
|
+
<h2 class="welcome-title">Hello!</h2>
|
5257
|
+
<p class="welcome-message">
|
5258
|
+
I’m your personal AI concierge and I’m here to help you. What are
|
5259
|
+
you looking for today?
|
5260
|
+
</p>
|
5261
|
+
</div>
|
5262
|
+
${this.renderPrompts()}
|
5263
|
+
</div>
|
5264
|
+
`;
|
5265
|
+
}
|
5266
|
+
return x `
|
5267
|
+
<div class="messages">
|
5268
|
+
${this.isTyping
|
5269
|
+
? x ` <div class="message bot">
|
5270
|
+
<typing-indicator></typing-indicator>
|
4299
5271
|
</div>`
|
4300
5272
|
: ''}
|
4301
5273
|
${this.isFailed
|
4302
5274
|
? x ` <div class="message bot">
|
4303
|
-
<div>${this.renderBotIcon()}</div>
|
4304
5275
|
<div>
|
4305
5276
|
<p>
|
4306
5277
|
Uh-oh! Looks like I tripped over some alpha-stage wires.
|
@@ -4317,33 +5288,19 @@ ${this.comment ? this.comment : E}</textarea
|
|
4317
5288
|
}
|
4318
5289
|
return x ` <div class="message user">${message.message}</div> `;
|
4319
5290
|
})}
|
4320
|
-
${!this.fromAd || !this.thread
|
4321
|
-
? x `
|
4322
|
-
<div class="message bot">
|
4323
|
-
<div>${this.renderBotIcon()}</div>
|
4324
|
-
<div>
|
4325
|
-
<p>
|
4326
|
-
Hi,
|
4327
|
-
${this.brandName
|
4328
|
-
? x `Welcome to ${this.brandName}.`
|
4329
|
-
: E}
|
4330
|
-
I'm here to help you find the perfect product. Pick a suggested
|
4331
|
-
prompt from below, or enter your own query.
|
4332
|
-
</p>
|
4333
|
-
</div>
|
4334
|
-
</div>
|
4335
|
-
</div>`
|
4336
|
-
: E}
|
4337
5291
|
</div>
|
4338
5292
|
`;
|
4339
5293
|
}
|
4340
5294
|
renderPrompts() {
|
5295
|
+
var _a, _b;
|
4341
5296
|
if (this.isLoadingHistory || this.isStreaming || this.isLoadingThreads) {
|
4342
5297
|
return E;
|
4343
5298
|
}
|
4344
|
-
const
|
4345
|
-
const
|
4346
|
-
|
5299
|
+
const latestMessage = this.messages[0];
|
5300
|
+
const isWelcomeMessage = this.messages.length === 1 && (latestMessage === null || latestMessage === void 0 ? void 0 : latestMessage.sender) === 'bot';
|
5301
|
+
const isLLMPrompt = !!((_a = latestMessage === null || latestMessage === void 0 ? void 0 : latestMessage.prompts) === null || _a === void 0 ? void 0 : _a.length);
|
5302
|
+
let prompts = this.messages.length
|
5303
|
+
? this.messages[0].prompts
|
4347
5304
|
: this.prompts
|
4348
5305
|
? this.prompts.split(',').map((prompt) => prompt.trim())
|
4349
5306
|
: ['Best Sellers'];
|
@@ -4351,15 +5308,26 @@ ${this.comment ? this.comment : E}</textarea
|
|
4351
5308
|
if (!prompts && !customPrompts) {
|
4352
5309
|
return E;
|
4353
5310
|
}
|
5311
|
+
// limit the prompts to 5
|
5312
|
+
prompts = prompts === null || prompts === void 0 ? void 0 : prompts.slice(0, 5);
|
4354
5313
|
return x `
|
4355
|
-
<div
|
5314
|
+
<div
|
5315
|
+
class=${e$1({
|
5316
|
+
prompts: true,
|
5317
|
+
btn: true,
|
5318
|
+
'left-align': ((_b = this.messages) === null || _b === void 0 ? void 0 : _b.length) > 0,
|
5319
|
+
})}
|
5320
|
+
>
|
4356
5321
|
${o$1(prompts, (prompt) => {
|
4357
5322
|
return x `
|
4358
5323
|
<div
|
4359
5324
|
class="prompt"
|
4360
5325
|
@click=${(e) => {
|
4361
5326
|
this.processMessage(e, prompt, true);
|
4362
|
-
|
5327
|
+
const eventName = isLLMPrompt
|
5328
|
+
? 'customPromptClicked'
|
5329
|
+
: 'promptClicked';
|
5330
|
+
this.sendEvent(eventName, undefined, {
|
4363
5331
|
promptName: prompt,
|
4364
5332
|
});
|
4365
5333
|
}}
|
@@ -4386,93 +5354,20 @@ ${this.comment ? this.comment : E}</textarea
|
|
4386
5354
|
</div>
|
4387
5355
|
`;
|
4388
5356
|
}
|
4389
|
-
|
4390
|
-
var _a;
|
4391
|
-
if (!((_a = this.thread) === null || _a === void 0 ? void 0 : _a.devContext)) {
|
4392
|
-
return x `
|
4393
|
-
<div class="context-container">
|
4394
|
-
<div class="context-title">
|
4395
|
-
<p>Context</p>
|
4396
|
-
<div
|
4397
|
-
class="btn"
|
4398
|
-
@click=${() => {
|
4399
|
-
if (!this.contextContainerElement) {
|
4400
|
-
return;
|
4401
|
-
}
|
4402
|
-
this.contextContainerElement.classList.remove('show');
|
4403
|
-
}}
|
4404
|
-
>
|
4405
|
-
${closeBtn}
|
4406
|
-
</div>
|
4407
|
-
</div>
|
4408
|
-
<p>
|
4409
|
-
This search thread has no pre-defined context. Start a new search to
|
4410
|
-
personalize.
|
4411
|
-
</p>
|
4412
|
-
</div>
|
4413
|
-
`;
|
4414
|
-
}
|
4415
|
-
const devContext = this.thread.devContext;
|
4416
|
-
const profileType = devContext.email
|
4417
|
-
? 'Pick your profile'
|
4418
|
-
: 'Stay Anonymous';
|
4419
|
-
const userDetails = devContext.email
|
4420
|
-
? `${capitalizeEachWord(devContext.firstName)} / ${capitalizeEachWord(devContext.gender)} / ${devContext.city} / ${devContext.state ? `- ${capitalizeEachWord(devContext.state)}` : ''} - ${devContext.preferences
|
4421
|
-
? `${devContext.preferences.size},${capitalizeEachWord(devContext.preferences.color)},${capitalizeEachWord(devContext.preferences.material)}`
|
4422
|
-
: ''}`
|
4423
|
-
: '';
|
4424
|
-
const visitationType = devContext.productHandle ? 'Via Ad' : 'Direct Visit';
|
4425
|
-
return x `
|
4426
|
-
<div class="context-container">
|
4427
|
-
<div class="context-title">
|
4428
|
-
<p>Context</p>
|
4429
|
-
<div
|
4430
|
-
class="btn"
|
4431
|
-
@click=${() => {
|
4432
|
-
var _a;
|
4433
|
-
(_a = this.contextContainerElement) === null || _a === void 0 ? void 0 : _a.classList.remove('show');
|
4434
|
-
}}
|
4435
|
-
>
|
4436
|
-
${closeBtn}
|
4437
|
-
</div>
|
4438
|
-
</div>
|
4439
|
-
<div>
|
4440
|
-
<div class="context">
|
4441
|
-
<span>Profile Type:</span>${' '}
|
4442
|
-
<span class="context-type-value"> ${profileType} </span>
|
4443
|
-
</div>
|
4444
|
-
${userDetails
|
4445
|
-
? x ` <div class="context user-details">${userDetails}</div>`
|
4446
|
-
: E}
|
4447
|
-
</div>
|
4448
|
-
<div>
|
4449
|
-
<div class="context">
|
4450
|
-
<span>Visitation Context:</span>${' '}
|
4451
|
-
<span class="context-type-value">${visitationType}</span>
|
4452
|
-
</div>
|
4453
|
-
${devContext.productHandle
|
4454
|
-
? x ` <div class="context product-handle">
|
4455
|
-
${devContext.productHandle}
|
4456
|
-
</div>`
|
4457
|
-
: E}
|
4458
|
-
</div>
|
4459
|
-
</div>
|
4460
|
-
`;
|
4461
|
-
}
|
4462
|
-
modalViewHeader() {
|
5357
|
+
chatHeader() {
|
4463
5358
|
var _a;
|
4464
5359
|
return x `
|
4465
|
-
<div>
|
4466
|
-
${this.
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
5360
|
+
<div class="chat-header">
|
5361
|
+
${this.renderBotIcon()}
|
5362
|
+
<h2>
|
5363
|
+
${this.brandName && !this.botIconUrl ? this.brandName : E}
|
5364
|
+
${((_a = this.thread) === null || _a === void 0 ? void 0 : _a.title) || 'AI Concierge'}
|
5365
|
+
</h2>
|
5366
|
+
<div class="btns-wrapper">
|
5367
|
+
<tooltip-component .position=${'bottom-right'} .text=${'New Chat'}>
|
5368
|
+
<button
|
5369
|
+
class="btn btn-icon new-search-btn"
|
5370
|
+
@click=${(e) => {
|
4476
5371
|
var _a, _b;
|
4477
5372
|
e.preventDefault();
|
4478
5373
|
if ((_a = this.thread) === null || _a === void 0 ? void 0 : _a.threadId) {
|
@@ -4480,83 +5375,47 @@ ${this.comment ? this.comment : E}</textarea
|
|
4480
5375
|
}
|
4481
5376
|
(_b = this.setSelectedThreadId) === null || _b === void 0 ? void 0 : _b.call(this, '');
|
4482
5377
|
}}
|
4483
|
-
|
5378
|
+
?disabled=${this.isStreaming}
|
5379
|
+
>
|
5380
|
+
${plusBtn}
|
5381
|
+
</button>
|
5382
|
+
</tooltip-component>
|
5383
|
+
<tooltip-component
|
5384
|
+
.position=${'bottom-right'}
|
5385
|
+
.text=${'Search History'}
|
4484
5386
|
>
|
4485
|
-
|
4486
|
-
|
4487
|
-
</tooltip-component>
|
4488
|
-
<tooltip-component
|
4489
|
-
.position=${'bottom-right'}
|
4490
|
-
.text=${'Search History'}
|
4491
|
-
>
|
4492
|
-
<button
|
4493
|
-
class=${e$1({
|
5387
|
+
<button
|
5388
|
+
class=${e$1({
|
4494
5389
|
btn: true,
|
4495
5390
|
'btn-icon': true,
|
4496
5391
|
'threads-btn': true,
|
4497
5392
|
active: this.showChatThreads,
|
4498
5393
|
})}
|
4499
|
-
|
5394
|
+
@click=${(e) => {
|
4500
5395
|
e.preventDefault();
|
4501
5396
|
this.showChatThreads = !this.showChatThreads;
|
4502
5397
|
if (this.showChatThreads) {
|
4503
5398
|
this.sendEvent('showThreads');
|
4504
5399
|
}
|
4505
5400
|
}}
|
4506
|
-
|
4507
|
-
|
4508
|
-
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
5401
|
+
>
|
5402
|
+
${historyBtn}
|
5403
|
+
</button>
|
5404
|
+
</tooltip-component>
|
5405
|
+
<tooltip-component .position=${'bottom-right'} .text=${'Close Chat'}>
|
5406
|
+
<button
|
5407
|
+
class="btn btn-icon close-btn"
|
5408
|
+
@click=${(e) => {
|
4514
5409
|
var _a;
|
4515
5410
|
e.preventDefault();
|
4516
5411
|
(_a = this.closeModal) === null || _a === void 0 ? void 0 : _a.call(this);
|
4517
5412
|
}}
|
4518
|
-
|
4519
|
-
|
4520
|
-
|
4521
|
-
|
5413
|
+
>
|
5414
|
+
${crossBtn}
|
5415
|
+
</button>
|
5416
|
+
</tooltip-component>
|
5417
|
+
</div>
|
4522
5418
|
</div>
|
4523
|
-
`;
|
4524
|
-
}
|
4525
|
-
contextButton() {
|
4526
|
-
var _a, _b, _c, _d;
|
4527
|
-
if (this.viewType === 'modal') {
|
4528
|
-
return this.modalViewHeader();
|
4529
|
-
}
|
4530
|
-
if (!this.devMode) {
|
4531
|
-
return ((_a = this.thread) === null || _a === void 0 ? void 0 : _a.threadId)
|
4532
|
-
? x `<h2>${((_b = this.thread) === null || _b === void 0 ? void 0 : _b.title) || 'New Search'}</h2>`
|
4533
|
-
: x `<h2>New Search</h2>`;
|
4534
|
-
}
|
4535
|
-
if ((_c = this.thread) === null || _c === void 0 ? void 0 : _c.threadId) {
|
4536
|
-
return x `
|
4537
|
-
<h2>${((_d = this.thread) === null || _d === void 0 ? void 0 : _d.title) || 'New Search'}</h2>
|
4538
|
-
<button
|
4539
|
-
class="btn-context btn"
|
4540
|
-
@click=${() => {
|
4541
|
-
if (!this.contextContainerElement) {
|
4542
|
-
return;
|
4543
|
-
}
|
4544
|
-
this.contextContainerElement.classList.toggle('show');
|
4545
|
-
}}
|
4546
|
-
>
|
4547
|
-
SHOW CONTEXT
|
4548
|
-
</button>
|
4549
|
-
${this.showContext()}
|
4550
|
-
`;
|
4551
|
-
}
|
4552
|
-
return x `
|
4553
|
-
<h2>Click personalize for hyper Contextual</h2>
|
4554
|
-
<button
|
4555
|
-
class="btn-context active btn"
|
4556
|
-
@click=${() => this.personalizeDialogElement.showModal()}
|
4557
|
-
>
|
4558
|
-
Personalize
|
4559
|
-
</button>
|
4560
5419
|
`;
|
4561
5420
|
}
|
4562
5421
|
renderChatThreads() {
|
@@ -4634,52 +5493,38 @@ ${this.comment ? this.comment : E}</textarea
|
|
4634
5493
|
this.style.removeProperty('--shopgpt-merchant-img-url');
|
4635
5494
|
}
|
4636
5495
|
return x `
|
4637
|
-
|
4638
|
-
<div
|
4639
|
-
|
4640
|
-
'chatbot-section': true,
|
4641
|
-
'modal-view': this.viewType === 'modal',
|
4642
|
-
})}
|
4643
|
-
>
|
4644
|
-
${this.chatWindow()} ${this.renderPrompts()}
|
5496
|
+
${this.chatHeader()}
|
5497
|
+
<div class="chatbot-section">
|
5498
|
+
${this.chatWindow()}
|
4645
5499
|
<form class="chat-form" @submit=${this.onSubmit}>
|
5500
|
+
<span class="sparkles-icon"> ${sparklesSharp} </span>
|
4646
5501
|
<input
|
4647
5502
|
type="text"
|
4648
5503
|
.value=${this.userQuery}
|
4649
5504
|
@input=${(e) => (this.userQuery = e.target.value)}
|
4650
|
-
placeholder="
|
5505
|
+
placeholder="What are you looking for?"
|
4651
5506
|
/>
|
4652
5507
|
<button
|
4653
|
-
class
|
4654
|
-
btn: true,
|
4655
|
-
modal: this.viewType === 'modal',
|
4656
|
-
})}
|
5508
|
+
class="btn send-btn"
|
4657
5509
|
type="submit"
|
4658
5510
|
?disabled=${this.isStreaming || this.isLoadingHistory}
|
4659
5511
|
>
|
4660
|
-
${
|
5512
|
+
${sendBtn}
|
4661
5513
|
</button>
|
4662
5514
|
</form>
|
4663
|
-
|
4664
|
-
|
4665
|
-
|
4666
|
-
|
4667
|
-
|
4668
|
-
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4675
|
-
</footer>`
|
4676
|
-
: E}
|
5515
|
+
<footer>
|
5516
|
+
Powered by
|
5517
|
+
<a
|
5518
|
+
target="_blank"
|
5519
|
+
href="https://shopgpt.edgeagents.ai"
|
5520
|
+
@click=${() => {
|
5521
|
+
this.sendEvent('blotoutLinkClicked');
|
5522
|
+
}}
|
5523
|
+
>
|
5524
|
+
Blotout
|
5525
|
+
</a>
|
5526
|
+
</footer>
|
4677
5527
|
</div>
|
4678
|
-
<personalize-dialog
|
4679
|
-
.createChatThread=${this.createChatThread.bind(this)}
|
4680
|
-
.defaultProductHandles=${this.productHandles}
|
4681
|
-
.defaultProfiles=${this.profiles}
|
4682
|
-
></personalize-dialog>
|
4683
5528
|
${this.renderChatThreads()}
|
4684
5529
|
${this.deleteThreadId || this.deleteAllThreads
|
4685
5530
|
? x `
|
@@ -4727,121 +5572,97 @@ ${this.comment ? this.comment : E}</textarea
|
|
4727
5572
|
`;
|
4728
5573
|
}
|
4729
5574
|
}
|
4730
|
-
|
5575
|
+
PopupView.styles = [chatSectionStyles];
|
4731
5576
|
__decorate([
|
4732
5577
|
n({ type: String }),
|
4733
5578
|
__metadata("design:type", Object)
|
4734
|
-
],
|
5579
|
+
], PopupView.prototype, "merchantImage", void 0);
|
4735
5580
|
__decorate([
|
4736
5581
|
n({ type: String }),
|
4737
5582
|
__metadata("design:type", Object)
|
4738
|
-
],
|
5583
|
+
], PopupView.prototype, "botIconUrl", void 0);
|
4739
5584
|
__decorate([
|
4740
5585
|
n({ type: String }),
|
4741
5586
|
__metadata("design:type", Object)
|
4742
|
-
],
|
5587
|
+
], PopupView.prototype, "brandName", void 0);
|
4743
5588
|
__decorate([
|
4744
5589
|
n({ type: String }),
|
4745
5590
|
__metadata("design:type", Object)
|
4746
|
-
],
|
5591
|
+
], PopupView.prototype, "prompts", void 0);
|
4747
5592
|
__decorate([
|
4748
5593
|
n({ type: Array }),
|
4749
5594
|
__metadata("design:type", Object)
|
4750
|
-
],
|
5595
|
+
], PopupView.prototype, "customPrompts", void 0);
|
4751
5596
|
__decorate([
|
4752
5597
|
n({ type: Boolean }),
|
4753
5598
|
__metadata("design:type", Boolean)
|
4754
|
-
],
|
5599
|
+
], PopupView.prototype, "isLoadingThreads", void 0);
|
4755
5600
|
__decorate([
|
4756
5601
|
n({ type: Object }),
|
4757
5602
|
__metadata("design:type", Map)
|
4758
|
-
],
|
5603
|
+
], PopupView.prototype, "chatThreads", void 0);
|
4759
5604
|
__decorate([
|
4760
5605
|
r(),
|
4761
5606
|
__metadata("design:type", String)
|
4762
|
-
],
|
5607
|
+
], PopupView.prototype, "deleteThreadId", void 0);
|
4763
5608
|
__decorate([
|
4764
5609
|
n({ type: Boolean }),
|
4765
5610
|
__metadata("design:type", Object)
|
4766
|
-
],
|
5611
|
+
], PopupView.prototype, "showChatThreads", void 0);
|
4767
5612
|
__decorate([
|
4768
5613
|
n({ type: Boolean }),
|
4769
5614
|
__metadata("design:type", Boolean)
|
4770
|
-
],
|
4771
|
-
__decorate([
|
4772
|
-
n({ type: Boolean }),
|
4773
|
-
__metadata("design:type", Object)
|
4774
|
-
], ChatSection.prototype, "devMode", void 0);
|
5615
|
+
], PopupView.prototype, "isLoadingHistory", void 0);
|
4775
5616
|
__decorate([
|
4776
5617
|
n({ type: Boolean }),
|
4777
5618
|
__metadata("design:type", Boolean)
|
4778
|
-
],
|
5619
|
+
], PopupView.prototype, "isTyping", void 0);
|
4779
5620
|
__decorate([
|
4780
5621
|
n({ type: Boolean }),
|
4781
5622
|
__metadata("design:type", Boolean)
|
4782
|
-
],
|
5623
|
+
], PopupView.prototype, "isStreaming", void 0);
|
4783
5624
|
__decorate([
|
4784
5625
|
n({ type: Boolean }),
|
4785
5626
|
__metadata("design:type", Boolean)
|
4786
|
-
],
|
4787
|
-
__decorate([
|
4788
|
-
n({ type: Array }),
|
4789
|
-
__metadata("design:type", Array)
|
4790
|
-
], ChatSection.prototype, "messages", void 0);
|
4791
|
-
__decorate([
|
4792
|
-
n({ type: Array }),
|
4793
|
-
__metadata("design:type", Array)
|
4794
|
-
], ChatSection.prototype, "profiles", void 0);
|
5627
|
+
], PopupView.prototype, "isFailed", void 0);
|
4795
5628
|
__decorate([
|
4796
5629
|
n({ type: Array }),
|
4797
5630
|
__metadata("design:type", Array)
|
4798
|
-
],
|
5631
|
+
], PopupView.prototype, "messages", void 0);
|
4799
5632
|
__decorate([
|
4800
5633
|
n({ type: Object }),
|
4801
5634
|
__metadata("design:type", Object)
|
4802
|
-
],
|
5635
|
+
], PopupView.prototype, "thread", void 0);
|
4803
5636
|
__decorate([
|
4804
5637
|
n({ type: Object }),
|
4805
5638
|
__metadata("design:type", Object)
|
4806
|
-
],
|
5639
|
+
], PopupView.prototype, "siteCurrency", void 0);
|
4807
5640
|
__decorate([
|
4808
5641
|
r(),
|
4809
5642
|
__metadata("design:type", Object)
|
4810
|
-
],
|
4811
|
-
__decorate([
|
4812
|
-
e$3('.context-container'),
|
4813
|
-
__metadata("design:type", Object)
|
4814
|
-
], ChatSection.prototype, "contextContainerElement", void 0);
|
5643
|
+
], PopupView.prototype, "deleteAllThreads", void 0);
|
4815
5644
|
__decorate([
|
4816
5645
|
e$3('.chat-window'),
|
4817
5646
|
__metadata("design:type", Object)
|
4818
|
-
],
|
4819
|
-
__decorate([
|
4820
|
-
e$3('personalize-dialog'),
|
4821
|
-
__metadata("design:type", Object)
|
4822
|
-
], ChatSection.prototype, "personalizeDialogElement", void 0);
|
5647
|
+
], PopupView.prototype, "chatWindowElement", void 0);
|
4823
5648
|
__decorate([
|
4824
5649
|
r(),
|
4825
5650
|
__metadata("design:type", Object)
|
4826
|
-
],
|
5651
|
+
], PopupView.prototype, "feedbackDetails", void 0);
|
4827
5652
|
__decorate([
|
4828
5653
|
n({ type: String }),
|
4829
5654
|
__metadata("design:type", Object)
|
4830
|
-
],
|
5655
|
+
], PopupView.prototype, "userQuery", void 0);
|
4831
5656
|
__decorate([
|
4832
5657
|
n({ type: String }),
|
4833
5658
|
__metadata("design:type", String)
|
4834
|
-
],
|
4835
|
-
__decorate([
|
4836
|
-
n({ type: Boolean }),
|
4837
|
-
__metadata("design:type", Boolean)
|
4838
|
-
], ChatSection.prototype, "fromAd", void 0);
|
5659
|
+
], PopupView.prototype, "css", void 0);
|
4839
5660
|
__decorate([
|
4840
5661
|
n({ type: String }),
|
4841
5662
|
__metadata("design:type", String)
|
4842
|
-
],
|
4843
|
-
if (!customElements.get('
|
4844
|
-
customElements.define('
|
5663
|
+
], PopupView.prototype, "userId", void 0);
|
5664
|
+
if (!customElements.get('popup-view')) {
|
5665
|
+
customElements.define('popup-view', PopupView);
|
4845
5666
|
}
|
4846
5667
|
|
4847
5668
|
async function* streamToIterable(stream) {
|
@@ -4937,15 +5758,20 @@ ${this.comment ? this.comment : E}</textarea
|
|
4937
5758
|
this.modalState = 'close';
|
4938
5759
|
(_a = this.shopGPTDialog) === null || _a === void 0 ? void 0 : _a.close();
|
4939
5760
|
};
|
4940
|
-
this.
|
4941
|
-
var _a;
|
5761
|
+
this.isWelcomeFlowRequired = () => {
|
5762
|
+
var _a, _b;
|
4942
5763
|
if (this.devMode) {
|
4943
5764
|
const thread = this.chatThreads.get(this.selectedThreadId);
|
4944
|
-
return
|
5765
|
+
return ((_a = thread === null || thread === void 0 ? void 0 : thread.devContext) === null || _a === void 0 ? void 0 : _a.email)
|
5766
|
+
? true
|
5767
|
+
: !!((_b = thread === null || thread === void 0 ? void 0 : thread.devContext) === null || _b === void 0 ? void 0 : _b.productHandle);
|
4945
5768
|
}
|
4946
5769
|
const searchParams = new URLSearchParams(window.location.search);
|
4947
|
-
|
4948
|
-
|
5770
|
+
const userType = getUserType(this.destination, this.sessionId);
|
5771
|
+
if (userType === 'known') {
|
5772
|
+
return true;
|
5773
|
+
}
|
5774
|
+
return isFromAd(searchParams) || searchParams.get('shopGPT') === '1';
|
4949
5775
|
};
|
4950
5776
|
this.submitQuery = (message) => {
|
4951
5777
|
if (!message) {
|
@@ -5010,6 +5836,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
5010
5836
|
// If the url has `utm_source` open the popup when reloaded
|
5011
5837
|
if (hasSource && isDesktop) {
|
5012
5838
|
this.modalState = 'open';
|
5839
|
+
setUserInteracted(this.destination);
|
5013
5840
|
}
|
5014
5841
|
}
|
5015
5842
|
}
|
@@ -5038,15 +5865,17 @@ ${this.comment ? this.comment : E}</textarea
|
|
5038
5865
|
if (!thread) {
|
5039
5866
|
return;
|
5040
5867
|
}
|
5041
|
-
const
|
5042
|
-
|
5043
|
-
|
5044
|
-
: fromAd
|
5045
|
-
? this.storeAPI.getCurrentProductHandle()
|
5046
|
-
: undefined;
|
5047
|
-
if (!fromAd) {
|
5868
|
+
const welcomeFlow = this.isWelcomeFlowRequired();
|
5869
|
+
let productHandle;
|
5870
|
+
if (!welcomeFlow) {
|
5048
5871
|
return;
|
5049
5872
|
}
|
5873
|
+
if (this.devMode) {
|
5874
|
+
productHandle = (_a = thread === null || thread === void 0 ? void 0 : thread.devContext) === null || _a === void 0 ? void 0 : _a.productHandle;
|
5875
|
+
}
|
5876
|
+
else if (welcomeFlow) {
|
5877
|
+
productHandle = this.storeAPI.getCurrentProductHandle();
|
5878
|
+
}
|
5050
5879
|
try {
|
5051
5880
|
this.isTyping = true;
|
5052
5881
|
this.isStreaming = true;
|
@@ -5086,7 +5915,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
5086
5915
|
if (latestThread) {
|
5087
5916
|
this.setSelectedThreadId(latestThread.threadId, true);
|
5088
5917
|
}
|
5089
|
-
else if (!this.devMode && this.
|
5918
|
+
else if (!this.devMode && this.isWelcomeFlowRequired()) {
|
5090
5919
|
this.createChatThread({ title: '' }, true);
|
5091
5920
|
}
|
5092
5921
|
}
|
@@ -5114,7 +5943,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
5114
5943
|
message: message.message,
|
5115
5944
|
sender: message.sender,
|
5116
5945
|
products,
|
5117
|
-
|
5946
|
+
prompts: message.prompts,
|
5118
5947
|
feedback: message.feedback,
|
5119
5948
|
};
|
5120
5949
|
});
|
@@ -5246,7 +6075,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
5246
6075
|
...latestMessage,
|
5247
6076
|
message: messageData.message || '',
|
5248
6077
|
messageId: messageData.messageId,
|
5249
|
-
|
6078
|
+
prompts: messageData.prompts,
|
5250
6079
|
sender: 'bot',
|
5251
6080
|
isChunk: false,
|
5252
6081
|
},
|
@@ -5428,7 +6257,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
5428
6257
|
.customPrompts=${this.customPrompts}
|
5429
6258
|
.botIconUrl=${this.botIconUrl}
|
5430
6259
|
.css=${this.css}
|
5431
|
-
.
|
6260
|
+
.welcomeFlowTriggered=${this.isWelcomeFlowRequired()}
|
5432
6261
|
.userId=${this.userId}
|
5433
6262
|
></chat-section>
|
5434
6263
|
</div>
|
@@ -5442,74 +6271,76 @@ ${this.comment ? this.comment : E}</textarea
|
|
5442
6271
|
this.modalState = 'close';
|
5443
6272
|
this.shopGPTAPI.sendEvent('chatbotClosed');
|
5444
6273
|
};
|
5445
|
-
|
5446
|
-
|
6274
|
+
return x `
|
6275
|
+
${this.modalState === 'open'
|
6276
|
+
? x `<div
|
6277
|
+
id="shop-gpt-modal"
|
6278
|
+
@delete-thread=${this.handleThreadDelete}
|
6279
|
+
@delete-all-threads=${this.handleAllThreadsDelete}
|
6280
|
+
@submit-feedback=${this.submitFeedback}
|
6281
|
+
@click=${this.handleUserInteraction}
|
6282
|
+
@send-event=${this.sendEvent}
|
6283
|
+
@product-clicked=${this.productClicked}
|
6284
|
+
>
|
6285
|
+
<popup-view
|
6286
|
+
.prompts=${this.quickPrompts}
|
6287
|
+
.brandName=${this.brandName}
|
6288
|
+
.isFailed=${this.isFailed}
|
6289
|
+
.isLoadingHistory=${this.isLoadingHistory}
|
6290
|
+
.isTyping=${this.isTyping}
|
6291
|
+
.isStreaming=${this.isStreaming}
|
6292
|
+
.messages=${this.messages}
|
6293
|
+
.siteCurrency=${this.getSiteCurrency()}
|
6294
|
+
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
6295
|
+
.thread=${thread}
|
6296
|
+
.createChatThread=${this.createChatThread.bind(this)}
|
6297
|
+
.viewType=${'modal'}
|
6298
|
+
.closeModal=${closeModal}
|
6299
|
+
.setSelectedThreadId=${this.setSelectedThreadId.bind(this)}
|
6300
|
+
.chatThreads=${this.chatThreads}
|
6301
|
+
.isLoadingThreads=${this.isLoadingThreads}
|
6302
|
+
.merchantImage=${this.merchantImage}
|
6303
|
+
.customPrompts=${this.customPrompts}
|
6304
|
+
.botIconUrl=${this.botIconUrl}
|
6305
|
+
.css=${this.css}
|
6306
|
+
.userId=${this.userId}
|
6307
|
+
></popup-view>
|
6308
|
+
</div>`
|
6309
|
+
: E}
|
6310
|
+
<div class="chatbot-widget">
|
5447
6311
|
<button
|
5448
6312
|
@click=${(e) => {
|
5449
|
-
|
6313
|
+
e.preventDefault();
|
6314
|
+
if (this.modalState === 'open') {
|
6315
|
+
closeModal();
|
6316
|
+
}
|
6317
|
+
else {
|
5450
6318
|
this.openModal();
|
5451
|
-
}
|
6319
|
+
}
|
6320
|
+
}}
|
5452
6321
|
>
|
5453
|
-
|
6322
|
+
<chatbot-icon></chatbot-icon>
|
5454
6323
|
</button>
|
5455
6324
|
${((_a = this.nudge) === null || _a === void 0 ? void 0 : _a.show) && this.showNudge
|
5456
|
-
|
6325
|
+
? x ` <div
|
5457
6326
|
class="nudge"
|
5458
6327
|
@click=${(e) => {
|
5459
|
-
|
5460
|
-
|
5461
|
-
|
6328
|
+
e.preventDefault();
|
6329
|
+
this.openModal();
|
6330
|
+
}}
|
5462
6331
|
>
|
5463
6332
|
Hi there! I'm an AI Agent to help you find the perfect product.
|
5464
6333
|
What are you looking for today?
|
5465
6334
|
</div>`
|
5466
|
-
|
6335
|
+
: x ` <div class="chatbot-hover-text">
|
5467
6336
|
What are you looking for today?
|
5468
6337
|
</div>`}
|
5469
|
-
</div>`;
|
5470
|
-
}
|
5471
|
-
return x `
|
5472
|
-
<div
|
5473
|
-
id="shop-gpt-modal"
|
5474
|
-
@delete-thread=${this.handleThreadDelete}
|
5475
|
-
@delete-all-threads=${this.handleAllThreadsDelete}
|
5476
|
-
@submit-feedback=${this.submitFeedback}
|
5477
|
-
@click=${this.handleUserInteraction}
|
5478
|
-
@send-event=${this.sendEvent}
|
5479
|
-
@product-clicked=${this.productClicked}
|
5480
|
-
>
|
5481
|
-
<chat-section
|
5482
|
-
.prompts=${this.quickPrompts}
|
5483
|
-
.brandName=${this.brandName}
|
5484
|
-
.isFailed=${this.isFailed}
|
5485
|
-
.isLoadingHistory=${this.isLoadingHistory}
|
5486
|
-
.isTyping=${this.isTyping}
|
5487
|
-
.isStreaming=${this.isStreaming}
|
5488
|
-
.messages=${this.messages}
|
5489
|
-
.siteCurrency=${this.getSiteCurrency()}
|
5490
|
-
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
5491
|
-
.thread=${thread}
|
5492
|
-
.createChatThread=${this.createChatThread.bind(this)}
|
5493
|
-
.devMode=${this.devMode}
|
5494
|
-
.productHandles=${this.productHandles}
|
5495
|
-
.profiles=${this.profiles}
|
5496
|
-
.viewType=${'modal'}
|
5497
|
-
.closeModal=${closeModal}
|
5498
|
-
.setSelectedThreadId=${this.setSelectedThreadId.bind(this)}
|
5499
|
-
.chatThreads=${this.chatThreads}
|
5500
|
-
.isLoadingThreads=${this.isLoadingThreads}
|
5501
|
-
.merchantImage=${this.merchantImage}
|
5502
|
-
.customPrompts=${this.customPrompts}
|
5503
|
-
.botIconUrl=${this.botIconUrl}
|
5504
|
-
.css=${this.css}
|
5505
|
-
.fromAd=${this.isFromAd()}
|
5506
|
-
.userId=${this.userId}
|
5507
|
-
></chat-section>
|
5508
6338
|
</div>
|
5509
6339
|
`;
|
5510
6340
|
}
|
5511
6341
|
openModal() {
|
5512
6342
|
setIsBotOpened(this.destination, this.sessionId, true);
|
6343
|
+
setUserInteracted(this.destination);
|
5513
6344
|
this.shopGPTAPI.sendEvent('chatbotOpened');
|
5514
6345
|
this.modalState = 'open';
|
5515
6346
|
this.handleUserInteraction();
|