@blotoutio/providers-shop-gpt-sdk 1.22.3 → 1.22.4
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 +8 -53
- package/index.js +8 -53
- package/index.mjs +8 -53
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -778,7 +778,8 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
778
778
|
if (!threadId) {
|
779
779
|
return [];
|
780
780
|
}
|
781
|
-
const
|
781
|
+
const currency = (await storeAPI.getSiteCurrency()).currency;
|
782
|
+
const response = await fetchImpl(getURL(`/query-history?threadId=${threadId}¤cy=${currency}`), {
|
782
783
|
method: 'GET',
|
783
784
|
headers: getHeaders(),
|
784
785
|
credentials: 'include',
|
@@ -5913,35 +5914,17 @@ class ProductItem extends TWLitElement$3 {
|
|
5913
5914
|
this.isStylesheetInjected = true;
|
5914
5915
|
}
|
5915
5916
|
}
|
5916
|
-
|
5917
|
-
|
5918
|
-
if (changedProperties.has('siteCurrency') && this.siteCurrency) {
|
5919
|
-
this.resolveCurrency();
|
5920
|
-
}
|
5921
|
-
}
|
5922
|
-
async resolveCurrency() {
|
5923
|
-
if (this.siteCurrency instanceof Promise) {
|
5924
|
-
this.resolvedCurrency = await this.siteCurrency;
|
5925
|
-
}
|
5926
|
-
else {
|
5927
|
-
this.resolvedCurrency = this.siteCurrency;
|
5928
|
-
}
|
5929
|
-
}
|
5930
|
-
getLocalPrice(price) {
|
5931
|
-
if (!this.resolvedCurrency) {
|
5932
|
-
return price;
|
5933
|
-
}
|
5934
|
-
const localPrice = parseFloat(price) * this.resolvedCurrency.rate;
|
5935
|
-
return formatMoney(localPrice, this.resolvedCurrency.currency);
|
5917
|
+
getLocalPrice(price, currencyCode) {
|
5918
|
+
return formatMoney(parseFloat(price), currencyCode);
|
5936
5919
|
}
|
5937
|
-
getComparedAtPrice(comparedAtPrice, price) {
|
5920
|
+
getComparedAtPrice(comparedAtPrice, price, currencyCode) {
|
5938
5921
|
if (!comparedAtPrice ||
|
5939
5922
|
comparedAtPrice === price ||
|
5940
5923
|
parseFloat(comparedAtPrice) <= parseFloat(price)) {
|
5941
5924
|
return E;
|
5942
5925
|
}
|
5943
5926
|
return x `<p class="price-compared text-xs leading-xs font-semibold">
|
5944
|
-
${this.getLocalPrice(comparedAtPrice)}
|
5927
|
+
${this.getLocalPrice(comparedAtPrice, currencyCode)}
|
5945
5928
|
</p>`;
|
5946
5929
|
}
|
5947
5930
|
getProductUrl(url) {
|
@@ -6013,9 +5996,9 @@ class ProductItem extends TWLitElement$3 {
|
|
6013
5996
|
${this.renderVariantTitles()}
|
6014
5997
|
</div>
|
6015
5998
|
<div class="prices">
|
6016
|
-
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price)}
|
5999
|
+
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price, this.product.variants[0].currencyCode)}
|
6017
6000
|
<p class="text-xs leading-xs font-semibold">
|
6018
|
-
${this.getLocalPrice(this.product.variants[0].price)}
|
6001
|
+
${this.getLocalPrice(this.product.variants[0].price, this.product.variants[0].currencyCode)}
|
6019
6002
|
</p>
|
6020
6003
|
</div>
|
6021
6004
|
<div>
|
@@ -6048,10 +6031,6 @@ __decorate([
|
|
6048
6031
|
n$1({ type: Object }),
|
6049
6032
|
__metadata("design:type", Object)
|
6050
6033
|
], ProductItem.prototype, "product", void 0);
|
6051
|
-
__decorate([
|
6052
|
-
n$1({ type: Object }),
|
6053
|
-
__metadata("design:type", Object)
|
6054
|
-
], ProductItem.prototype, "siteCurrency", void 0);
|
6055
6034
|
__decorate([
|
6056
6035
|
n$1({ type: String }),
|
6057
6036
|
__metadata("design:type", Object)
|
@@ -6080,10 +6059,6 @@ __decorate([
|
|
6080
6059
|
n$1({ type: String }),
|
6081
6060
|
__metadata("design:type", String)
|
6082
6061
|
], ProductItem.prototype, "css", void 0);
|
6083
|
-
__decorate([
|
6084
|
-
r$1(),
|
6085
|
-
__metadata("design:type", Object)
|
6086
|
-
], ProductItem.prototype, "resolvedCurrency", void 0);
|
6087
6062
|
if (!customElements.get('product-item')) {
|
6088
6063
|
customElements.define('product-item', ProductItem);
|
6089
6064
|
}
|
@@ -6251,7 +6226,6 @@ class ProductsList extends i$1 {
|
|
6251
6226
|
.query=${this.query}
|
6252
6227
|
.response=${this.response}
|
6253
6228
|
.product=${product}
|
6254
|
-
.siteCurrency=${this.siteCurrency}
|
6255
6229
|
.rank=${index + 1}
|
6256
6230
|
.userId=${this.userId}
|
6257
6231
|
.viewType=${this.viewType}
|
@@ -6376,7 +6350,6 @@ class ProductsSection extends i$1 {
|
|
6376
6350
|
.query=${query === null || query === void 0 ? void 0 : query.message}
|
6377
6351
|
.response=${response === null || response === void 0 ? void 0 : response.message}
|
6378
6352
|
.product=${topResult}
|
6379
|
-
.siteCurrency=${this.siteCurrency}
|
6380
6353
|
.rank=${1}
|
6381
6354
|
.userId=${this.userId}
|
6382
6355
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -6390,7 +6363,6 @@ class ProductsSection extends i$1 {
|
|
6390
6363
|
.query=${query === null || query === void 0 ? void 0 : query.message}
|
6391
6364
|
.response=${response === null || response === void 0 ? void 0 : response.message}
|
6392
6365
|
.products=${others}
|
6393
|
-
.siteCurrency=${this.siteCurrency}
|
6394
6366
|
.viewType=${'overlay'}
|
6395
6367
|
.userId=${this.userId}
|
6396
6368
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -6413,10 +6385,6 @@ __decorate([
|
|
6413
6385
|
n$1({ type: Boolean }),
|
6414
6386
|
__metadata("design:type", Boolean)
|
6415
6387
|
], ProductsSection.prototype, "isLoadingHistory", void 0);
|
6416
|
-
__decorate([
|
6417
|
-
n$1({ type: Object }),
|
6418
|
-
__metadata("design:type", Object)
|
6419
|
-
], ProductsSection.prototype, "siteCurrency", void 0);
|
6420
6388
|
__decorate([
|
6421
6389
|
n$1({ type: Boolean }),
|
6422
6390
|
__metadata("design:type", Boolean)
|
@@ -8008,7 +7976,6 @@ class ChatSection extends i$1 {
|
|
8008
7976
|
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
8009
7977
|
.response=${message.message}
|
8010
7978
|
.product=${message.products[0]}
|
8011
|
-
.siteCurrency=${this.siteCurrency}
|
8012
7979
|
.rank=${1}
|
8013
7980
|
.userId=${this.userId}
|
8014
7981
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -8390,10 +8357,6 @@ __decorate([
|
|
8390
8357
|
n$1({ type: Object }),
|
8391
8358
|
__metadata("design:type", Object)
|
8392
8359
|
], ChatSection.prototype, "thread", void 0);
|
8393
|
-
__decorate([
|
8394
|
-
n$1({ type: Object }),
|
8395
|
-
__metadata("design:type", Object)
|
8396
|
-
], ChatSection.prototype, "siteCurrency", void 0);
|
8397
8360
|
__decorate([
|
8398
8361
|
n$1({ type: String }),
|
8399
8362
|
__metadata("design:type", Object)
|
@@ -9425,7 +9388,6 @@ class PopupView extends TWLitElement$1 {
|
|
9425
9388
|
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
9426
9389
|
.response=${message.message}
|
9427
9390
|
.products=${message.products}
|
9428
|
-
.siteCurrency=${this.siteCurrency}
|
9429
9391
|
.viewType=${this.viewType}
|
9430
9392
|
.userId=${this.userId}
|
9431
9393
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -9904,10 +9866,6 @@ __decorate([
|
|
9904
9866
|
n$1({ type: Object }),
|
9905
9867
|
__metadata("design:type", Object)
|
9906
9868
|
], PopupView.prototype, "thread", void 0);
|
9907
|
-
__decorate([
|
9908
|
-
n$1({ type: Object }),
|
9909
|
-
__metadata("design:type", Object)
|
9910
|
-
], PopupView.prototype, "siteCurrency", void 0);
|
9911
9869
|
__decorate([
|
9912
9870
|
n$1({ type: Boolean }),
|
9913
9871
|
__metadata("design:type", Object)
|
@@ -10686,7 +10644,6 @@ class ShopGPT extends i$1 {
|
|
10686
10644
|
.merchantImage=${this.merchantImage}
|
10687
10645
|
.products=${this.products}
|
10688
10646
|
.isLoadingHistory=${this.isLoadingHistory}
|
10689
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10690
10647
|
.isLoadingThreads=${this.isLoadingThreads}
|
10691
10648
|
.css=${this.css}
|
10692
10649
|
.userId=${this.userId}
|
@@ -10700,7 +10657,6 @@ class ShopGPT extends i$1 {
|
|
10700
10657
|
.isTyping=${this.isTyping}
|
10701
10658
|
.isStreaming=${this.isStreaming}
|
10702
10659
|
.messages=${this.messages}
|
10703
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10704
10660
|
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
10705
10661
|
.thread=${thread}
|
10706
10662
|
.createChatThread=${this.createChatThread.bind(this)}
|
@@ -10750,7 +10706,6 @@ class ShopGPT extends i$1 {
|
|
10750
10706
|
.isTyping=${this.isTyping}
|
10751
10707
|
.isStreaming=${this.isStreaming}
|
10752
10708
|
.messages=${this.messages}
|
10753
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10754
10709
|
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
10755
10710
|
.thread=${thread}
|
10756
10711
|
.createChatThread=${this.createChatThread.bind(this)}
|
package/index.js
CHANGED
@@ -779,7 +779,8 @@ var ProvidersShopGptSdk = (function () {
|
|
779
779
|
if (!threadId) {
|
780
780
|
return [];
|
781
781
|
}
|
782
|
-
const
|
782
|
+
const currency = (await storeAPI.getSiteCurrency()).currency;
|
783
|
+
const response = await fetchImpl(getURL(`/query-history?threadId=${threadId}¤cy=${currency}`), {
|
783
784
|
method: 'GET',
|
784
785
|
headers: getHeaders(),
|
785
786
|
credentials: 'include',
|
@@ -5914,35 +5915,17 @@ var ProvidersShopGptSdk = (function () {
|
|
5914
5915
|
this.isStylesheetInjected = true;
|
5915
5916
|
}
|
5916
5917
|
}
|
5917
|
-
|
5918
|
-
|
5919
|
-
if (changedProperties.has('siteCurrency') && this.siteCurrency) {
|
5920
|
-
this.resolveCurrency();
|
5921
|
-
}
|
5922
|
-
}
|
5923
|
-
async resolveCurrency() {
|
5924
|
-
if (this.siteCurrency instanceof Promise) {
|
5925
|
-
this.resolvedCurrency = await this.siteCurrency;
|
5926
|
-
}
|
5927
|
-
else {
|
5928
|
-
this.resolvedCurrency = this.siteCurrency;
|
5929
|
-
}
|
5930
|
-
}
|
5931
|
-
getLocalPrice(price) {
|
5932
|
-
if (!this.resolvedCurrency) {
|
5933
|
-
return price;
|
5934
|
-
}
|
5935
|
-
const localPrice = parseFloat(price) * this.resolvedCurrency.rate;
|
5936
|
-
return formatMoney(localPrice, this.resolvedCurrency.currency);
|
5918
|
+
getLocalPrice(price, currencyCode) {
|
5919
|
+
return formatMoney(parseFloat(price), currencyCode);
|
5937
5920
|
}
|
5938
|
-
getComparedAtPrice(comparedAtPrice, price) {
|
5921
|
+
getComparedAtPrice(comparedAtPrice, price, currencyCode) {
|
5939
5922
|
if (!comparedAtPrice ||
|
5940
5923
|
comparedAtPrice === price ||
|
5941
5924
|
parseFloat(comparedAtPrice) <= parseFloat(price)) {
|
5942
5925
|
return E;
|
5943
5926
|
}
|
5944
5927
|
return x `<p class="price-compared text-xs leading-xs font-semibold">
|
5945
|
-
${this.getLocalPrice(comparedAtPrice)}
|
5928
|
+
${this.getLocalPrice(comparedAtPrice, currencyCode)}
|
5946
5929
|
</p>`;
|
5947
5930
|
}
|
5948
5931
|
getProductUrl(url) {
|
@@ -6014,9 +5997,9 @@ var ProvidersShopGptSdk = (function () {
|
|
6014
5997
|
${this.renderVariantTitles()}
|
6015
5998
|
</div>
|
6016
5999
|
<div class="prices">
|
6017
|
-
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price)}
|
6000
|
+
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price, this.product.variants[0].currencyCode)}
|
6018
6001
|
<p class="text-xs leading-xs font-semibold">
|
6019
|
-
${this.getLocalPrice(this.product.variants[0].price)}
|
6002
|
+
${this.getLocalPrice(this.product.variants[0].price, this.product.variants[0].currencyCode)}
|
6020
6003
|
</p>
|
6021
6004
|
</div>
|
6022
6005
|
<div>
|
@@ -6049,10 +6032,6 @@ var ProvidersShopGptSdk = (function () {
|
|
6049
6032
|
n$1({ type: Object }),
|
6050
6033
|
__metadata("design:type", Object)
|
6051
6034
|
], ProductItem.prototype, "product", void 0);
|
6052
|
-
__decorate([
|
6053
|
-
n$1({ type: Object }),
|
6054
|
-
__metadata("design:type", Object)
|
6055
|
-
], ProductItem.prototype, "siteCurrency", void 0);
|
6056
6035
|
__decorate([
|
6057
6036
|
n$1({ type: String }),
|
6058
6037
|
__metadata("design:type", Object)
|
@@ -6081,10 +6060,6 @@ var ProvidersShopGptSdk = (function () {
|
|
6081
6060
|
n$1({ type: String }),
|
6082
6061
|
__metadata("design:type", String)
|
6083
6062
|
], ProductItem.prototype, "css", void 0);
|
6084
|
-
__decorate([
|
6085
|
-
r$1(),
|
6086
|
-
__metadata("design:type", Object)
|
6087
|
-
], ProductItem.prototype, "resolvedCurrency", void 0);
|
6088
6063
|
if (!customElements.get('product-item')) {
|
6089
6064
|
customElements.define('product-item', ProductItem);
|
6090
6065
|
}
|
@@ -6252,7 +6227,6 @@ var ProvidersShopGptSdk = (function () {
|
|
6252
6227
|
.query=${this.query}
|
6253
6228
|
.response=${this.response}
|
6254
6229
|
.product=${product}
|
6255
|
-
.siteCurrency=${this.siteCurrency}
|
6256
6230
|
.rank=${index + 1}
|
6257
6231
|
.userId=${this.userId}
|
6258
6232
|
.viewType=${this.viewType}
|
@@ -6377,7 +6351,6 @@ var ProvidersShopGptSdk = (function () {
|
|
6377
6351
|
.query=${query === null || query === void 0 ? void 0 : query.message}
|
6378
6352
|
.response=${response === null || response === void 0 ? void 0 : response.message}
|
6379
6353
|
.product=${topResult}
|
6380
|
-
.siteCurrency=${this.siteCurrency}
|
6381
6354
|
.rank=${1}
|
6382
6355
|
.userId=${this.userId}
|
6383
6356
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -6391,7 +6364,6 @@ var ProvidersShopGptSdk = (function () {
|
|
6391
6364
|
.query=${query === null || query === void 0 ? void 0 : query.message}
|
6392
6365
|
.response=${response === null || response === void 0 ? void 0 : response.message}
|
6393
6366
|
.products=${others}
|
6394
|
-
.siteCurrency=${this.siteCurrency}
|
6395
6367
|
.viewType=${'overlay'}
|
6396
6368
|
.userId=${this.userId}
|
6397
6369
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -6414,10 +6386,6 @@ var ProvidersShopGptSdk = (function () {
|
|
6414
6386
|
n$1({ type: Boolean }),
|
6415
6387
|
__metadata("design:type", Boolean)
|
6416
6388
|
], ProductsSection.prototype, "isLoadingHistory", void 0);
|
6417
|
-
__decorate([
|
6418
|
-
n$1({ type: Object }),
|
6419
|
-
__metadata("design:type", Object)
|
6420
|
-
], ProductsSection.prototype, "siteCurrency", void 0);
|
6421
6389
|
__decorate([
|
6422
6390
|
n$1({ type: Boolean }),
|
6423
6391
|
__metadata("design:type", Boolean)
|
@@ -8009,7 +7977,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
8009
7977
|
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
8010
7978
|
.response=${message.message}
|
8011
7979
|
.product=${message.products[0]}
|
8012
|
-
.siteCurrency=${this.siteCurrency}
|
8013
7980
|
.rank=${1}
|
8014
7981
|
.userId=${this.userId}
|
8015
7982
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -8391,10 +8358,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
8391
8358
|
n$1({ type: Object }),
|
8392
8359
|
__metadata("design:type", Object)
|
8393
8360
|
], ChatSection.prototype, "thread", void 0);
|
8394
|
-
__decorate([
|
8395
|
-
n$1({ type: Object }),
|
8396
|
-
__metadata("design:type", Object)
|
8397
|
-
], ChatSection.prototype, "siteCurrency", void 0);
|
8398
8361
|
__decorate([
|
8399
8362
|
n$1({ type: String }),
|
8400
8363
|
__metadata("design:type", Object)
|
@@ -9426,7 +9389,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
9426
9389
|
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
9427
9390
|
.response=${message.message}
|
9428
9391
|
.products=${message.products}
|
9429
|
-
.siteCurrency=${this.siteCurrency}
|
9430
9392
|
.viewType=${this.viewType}
|
9431
9393
|
.userId=${this.userId}
|
9432
9394
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -9905,10 +9867,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
9905
9867
|
n$1({ type: Object }),
|
9906
9868
|
__metadata("design:type", Object)
|
9907
9869
|
], PopupView.prototype, "thread", void 0);
|
9908
|
-
__decorate([
|
9909
|
-
n$1({ type: Object }),
|
9910
|
-
__metadata("design:type", Object)
|
9911
|
-
], PopupView.prototype, "siteCurrency", void 0);
|
9912
9870
|
__decorate([
|
9913
9871
|
n$1({ type: Boolean }),
|
9914
9872
|
__metadata("design:type", Object)
|
@@ -10687,7 +10645,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
10687
10645
|
.merchantImage=${this.merchantImage}
|
10688
10646
|
.products=${this.products}
|
10689
10647
|
.isLoadingHistory=${this.isLoadingHistory}
|
10690
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10691
10648
|
.isLoadingThreads=${this.isLoadingThreads}
|
10692
10649
|
.css=${this.css}
|
10693
10650
|
.userId=${this.userId}
|
@@ -10701,7 +10658,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
10701
10658
|
.isTyping=${this.isTyping}
|
10702
10659
|
.isStreaming=${this.isStreaming}
|
10703
10660
|
.messages=${this.messages}
|
10704
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10705
10661
|
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
10706
10662
|
.thread=${thread}
|
10707
10663
|
.createChatThread=${this.createChatThread.bind(this)}
|
@@ -10751,7 +10707,6 @@ ${this.comment ? this.comment : E}</textarea
|
|
10751
10707
|
.isTyping=${this.isTyping}
|
10752
10708
|
.isStreaming=${this.isStreaming}
|
10753
10709
|
.messages=${this.messages}
|
10754
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10755
10710
|
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
10756
10711
|
.thread=${thread}
|
10757
10712
|
.createChatThread=${this.createChatThread.bind(this)}
|
package/index.mjs
CHANGED
@@ -776,7 +776,8 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
776
776
|
if (!threadId) {
|
777
777
|
return [];
|
778
778
|
}
|
779
|
-
const
|
779
|
+
const currency = (await storeAPI.getSiteCurrency()).currency;
|
780
|
+
const response = await fetchImpl(getURL(`/query-history?threadId=${threadId}¤cy=${currency}`), {
|
780
781
|
method: 'GET',
|
781
782
|
headers: getHeaders(),
|
782
783
|
credentials: 'include',
|
@@ -5911,35 +5912,17 @@ class ProductItem extends TWLitElement$3 {
|
|
5911
5912
|
this.isStylesheetInjected = true;
|
5912
5913
|
}
|
5913
5914
|
}
|
5914
|
-
|
5915
|
-
|
5916
|
-
if (changedProperties.has('siteCurrency') && this.siteCurrency) {
|
5917
|
-
this.resolveCurrency();
|
5918
|
-
}
|
5919
|
-
}
|
5920
|
-
async resolveCurrency() {
|
5921
|
-
if (this.siteCurrency instanceof Promise) {
|
5922
|
-
this.resolvedCurrency = await this.siteCurrency;
|
5923
|
-
}
|
5924
|
-
else {
|
5925
|
-
this.resolvedCurrency = this.siteCurrency;
|
5926
|
-
}
|
5927
|
-
}
|
5928
|
-
getLocalPrice(price) {
|
5929
|
-
if (!this.resolvedCurrency) {
|
5930
|
-
return price;
|
5931
|
-
}
|
5932
|
-
const localPrice = parseFloat(price) * this.resolvedCurrency.rate;
|
5933
|
-
return formatMoney(localPrice, this.resolvedCurrency.currency);
|
5915
|
+
getLocalPrice(price, currencyCode) {
|
5916
|
+
return formatMoney(parseFloat(price), currencyCode);
|
5934
5917
|
}
|
5935
|
-
getComparedAtPrice(comparedAtPrice, price) {
|
5918
|
+
getComparedAtPrice(comparedAtPrice, price, currencyCode) {
|
5936
5919
|
if (!comparedAtPrice ||
|
5937
5920
|
comparedAtPrice === price ||
|
5938
5921
|
parseFloat(comparedAtPrice) <= parseFloat(price)) {
|
5939
5922
|
return E;
|
5940
5923
|
}
|
5941
5924
|
return x `<p class="price-compared text-xs leading-xs font-semibold">
|
5942
|
-
${this.getLocalPrice(comparedAtPrice)}
|
5925
|
+
${this.getLocalPrice(comparedAtPrice, currencyCode)}
|
5943
5926
|
</p>`;
|
5944
5927
|
}
|
5945
5928
|
getProductUrl(url) {
|
@@ -6011,9 +5994,9 @@ class ProductItem extends TWLitElement$3 {
|
|
6011
5994
|
${this.renderVariantTitles()}
|
6012
5995
|
</div>
|
6013
5996
|
<div class="prices">
|
6014
|
-
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price)}
|
5997
|
+
${this.getComparedAtPrice(this.product.variants[0].comparedAtPrice, this.product.variants[0].price, this.product.variants[0].currencyCode)}
|
6015
5998
|
<p class="text-xs leading-xs font-semibold">
|
6016
|
-
${this.getLocalPrice(this.product.variants[0].price)}
|
5999
|
+
${this.getLocalPrice(this.product.variants[0].price, this.product.variants[0].currencyCode)}
|
6017
6000
|
</p>
|
6018
6001
|
</div>
|
6019
6002
|
<div>
|
@@ -6046,10 +6029,6 @@ __decorate([
|
|
6046
6029
|
n$1({ type: Object }),
|
6047
6030
|
__metadata("design:type", Object)
|
6048
6031
|
], ProductItem.prototype, "product", void 0);
|
6049
|
-
__decorate([
|
6050
|
-
n$1({ type: Object }),
|
6051
|
-
__metadata("design:type", Object)
|
6052
|
-
], ProductItem.prototype, "siteCurrency", void 0);
|
6053
6032
|
__decorate([
|
6054
6033
|
n$1({ type: String }),
|
6055
6034
|
__metadata("design:type", Object)
|
@@ -6078,10 +6057,6 @@ __decorate([
|
|
6078
6057
|
n$1({ type: String }),
|
6079
6058
|
__metadata("design:type", String)
|
6080
6059
|
], ProductItem.prototype, "css", void 0);
|
6081
|
-
__decorate([
|
6082
|
-
r$1(),
|
6083
|
-
__metadata("design:type", Object)
|
6084
|
-
], ProductItem.prototype, "resolvedCurrency", void 0);
|
6085
6060
|
if (!customElements.get('product-item')) {
|
6086
6061
|
customElements.define('product-item', ProductItem);
|
6087
6062
|
}
|
@@ -6249,7 +6224,6 @@ class ProductsList extends i$1 {
|
|
6249
6224
|
.query=${this.query}
|
6250
6225
|
.response=${this.response}
|
6251
6226
|
.product=${product}
|
6252
|
-
.siteCurrency=${this.siteCurrency}
|
6253
6227
|
.rank=${index + 1}
|
6254
6228
|
.userId=${this.userId}
|
6255
6229
|
.viewType=${this.viewType}
|
@@ -6374,7 +6348,6 @@ class ProductsSection extends i$1 {
|
|
6374
6348
|
.query=${query === null || query === void 0 ? void 0 : query.message}
|
6375
6349
|
.response=${response === null || response === void 0 ? void 0 : response.message}
|
6376
6350
|
.product=${topResult}
|
6377
|
-
.siteCurrency=${this.siteCurrency}
|
6378
6351
|
.rank=${1}
|
6379
6352
|
.userId=${this.userId}
|
6380
6353
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -6388,7 +6361,6 @@ class ProductsSection extends i$1 {
|
|
6388
6361
|
.query=${query === null || query === void 0 ? void 0 : query.message}
|
6389
6362
|
.response=${response === null || response === void 0 ? void 0 : response.message}
|
6390
6363
|
.products=${others}
|
6391
|
-
.siteCurrency=${this.siteCurrency}
|
6392
6364
|
.viewType=${'overlay'}
|
6393
6365
|
.userId=${this.userId}
|
6394
6366
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -6411,10 +6383,6 @@ __decorate([
|
|
6411
6383
|
n$1({ type: Boolean }),
|
6412
6384
|
__metadata("design:type", Boolean)
|
6413
6385
|
], ProductsSection.prototype, "isLoadingHistory", void 0);
|
6414
|
-
__decorate([
|
6415
|
-
n$1({ type: Object }),
|
6416
|
-
__metadata("design:type", Object)
|
6417
|
-
], ProductsSection.prototype, "siteCurrency", void 0);
|
6418
6386
|
__decorate([
|
6419
6387
|
n$1({ type: Boolean }),
|
6420
6388
|
__metadata("design:type", Boolean)
|
@@ -8006,7 +7974,6 @@ class ChatSection extends i$1 {
|
|
8006
7974
|
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
8007
7975
|
.response=${message.message}
|
8008
7976
|
.product=${message.products[0]}
|
8009
|
-
.siteCurrency=${this.siteCurrency}
|
8010
7977
|
.rank=${1}
|
8011
7978
|
.userId=${this.userId}
|
8012
7979
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -8388,10 +8355,6 @@ __decorate([
|
|
8388
8355
|
n$1({ type: Object }),
|
8389
8356
|
__metadata("design:type", Object)
|
8390
8357
|
], ChatSection.prototype, "thread", void 0);
|
8391
|
-
__decorate([
|
8392
|
-
n$1({ type: Object }),
|
8393
|
-
__metadata("design:type", Object)
|
8394
|
-
], ChatSection.prototype, "siteCurrency", void 0);
|
8395
8358
|
__decorate([
|
8396
8359
|
n$1({ type: String }),
|
8397
8360
|
__metadata("design:type", Object)
|
@@ -9423,7 +9386,6 @@ class PopupView extends TWLitElement$1 {
|
|
9423
9386
|
.query=${queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.message}
|
9424
9387
|
.response=${message.message}
|
9425
9388
|
.products=${message.products}
|
9426
|
-
.siteCurrency=${this.siteCurrency}
|
9427
9389
|
.viewType=${this.viewType}
|
9428
9390
|
.userId=${this.userId}
|
9429
9391
|
.metafieldDisplayName=${this.metafieldDisplayName}
|
@@ -9902,10 +9864,6 @@ __decorate([
|
|
9902
9864
|
n$1({ type: Object }),
|
9903
9865
|
__metadata("design:type", Object)
|
9904
9866
|
], PopupView.prototype, "thread", void 0);
|
9905
|
-
__decorate([
|
9906
|
-
n$1({ type: Object }),
|
9907
|
-
__metadata("design:type", Object)
|
9908
|
-
], PopupView.prototype, "siteCurrency", void 0);
|
9909
9867
|
__decorate([
|
9910
9868
|
n$1({ type: Boolean }),
|
9911
9869
|
__metadata("design:type", Object)
|
@@ -10684,7 +10642,6 @@ class ShopGPT extends i$1 {
|
|
10684
10642
|
.merchantImage=${this.merchantImage}
|
10685
10643
|
.products=${this.products}
|
10686
10644
|
.isLoadingHistory=${this.isLoadingHistory}
|
10687
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10688
10645
|
.isLoadingThreads=${this.isLoadingThreads}
|
10689
10646
|
.css=${this.css}
|
10690
10647
|
.userId=${this.userId}
|
@@ -10698,7 +10655,6 @@ class ShopGPT extends i$1 {
|
|
10698
10655
|
.isTyping=${this.isTyping}
|
10699
10656
|
.isStreaming=${this.isStreaming}
|
10700
10657
|
.messages=${this.messages}
|
10701
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10702
10658
|
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
10703
10659
|
.thread=${thread}
|
10704
10660
|
.createChatThread=${this.createChatThread.bind(this)}
|
@@ -10748,7 +10704,6 @@ class ShopGPT extends i$1 {
|
|
10748
10704
|
.isTyping=${this.isTyping}
|
10749
10705
|
.isStreaming=${this.isStreaming}
|
10750
10706
|
.messages=${this.messages}
|
10751
|
-
.siteCurrency=${this.getSiteCurrency()}
|
10752
10707
|
.sendMessageToServer=${this.sendMessageToServer.bind(this)}
|
10753
10708
|
.thread=${thread}
|
10754
10709
|
.createChatThread=${this.createChatThread.bind(this)}
|