@ikas/storefront 0.1.24-alpha.8 → 0.2.0-alpha.10
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/build/__generated__/global-types.d.ts +45 -0
- package/build/analytics/analytics.d.ts +3 -2
- package/build/analytics/events.d.ts +1 -0
- package/build/analytics/ikas.d.ts +133 -0
- package/build/api/back-in-stock-reminder/__generated__/listProductBackInStockRemind.d.ts +24 -0
- package/build/api/back-in-stock-reminder/__generated__/saveProductBackInStockRemind.d.ts +19 -0
- package/build/api/back-in-stock-reminder/index.d.ts +23 -0
- package/build/api/checkout/__generated__/getCheckoutById.d.ts +0 -4
- package/build/api/checkout/__generated__/listPaymentGateway.d.ts +1 -3
- package/build/api/customer/__generated__/customerForgotPassword.d.ts +0 -1
- package/build/api/customer/__generated__/registerCustomer.d.ts +0 -1
- package/build/api/customer-review/__generated__/createCustomerReview.d.ts +11 -0
- package/build/api/customer-review/__generated__/listCustomerReviews.d.ts +25 -0
- package/build/api/customer-review/index.d.ts +24 -0
- package/build/api/index.d.ts +3 -0
- package/build/api/merchant/__generated__/listMerchantSettings.d.ts +0 -4
- package/build/api/merchant/index.d.ts +1 -1
- package/build/api/product-option-set/__generated__/ListProductOptionSet.d.ts +90 -0
- package/build/api/product-option-set/index.d.ts +6 -0
- package/build/components/page/index.d.ts +1 -0
- package/build/index.es.js +1569 -293
- package/build/index.js +1584 -293
- package/build/models/data/cart/index.d.ts +0 -1
- package/build/models/data/customer-review/index.d.ts +23 -0
- package/build/models/data/customer-review-settings/index.d.ts +4 -0
- package/build/models/data/index.d.ts +4 -1
- package/build/models/data/order/index.d.ts +0 -1
- package/build/models/data/order/line-item/index.d.ts +0 -1
- package/build/models/data/order-transaction/index.d.ts +0 -1
- package/build/models/data/product/index.d.ts +4 -0
- package/build/models/data/product/variant/index.d.ts +7 -0
- package/build/models/data/product/variant/price/index.d.ts +0 -1
- package/build/models/data/product-back-in-stock-settings/index.d.ts +3 -0
- package/build/models/data/product-option-set/index.d.ts +85 -0
- package/build/models/data/simple-product/index.d.ts +1 -0
- package/build/models/ui/customer-review-list/index.d.ts +43 -0
- package/build/models/ui/index.d.ts +2 -0
- package/build/models/ui/product-detail/index.d.ts +4 -1
- package/build/models/ui/validator/form/customer-review.d.ts +37 -0
- package/build/pages/editor.d.ts +1 -0
- package/build/pages/index.d.ts +19 -20
- package/build/providers/page-data-get.d.ts +2 -0
- package/build/providers/page-data-init.d.ts +1 -1
- package/build/providers/page-data-next.d.ts +18 -2
- package/build/store/customer.d.ts +7 -0
- package/build/storefront/index.d.ts +8 -2
- package/build/utils/currency.d.ts +0 -6
- package/package.json +5 -2
- package/build/providers/prop-value/checkout.d.ts +0 -4
package/build/index.es.js
CHANGED
|
@@ -10952,9 +10952,8 @@ function setContext(setter) {
|
|
|
10952
10952
|
var IkasStorefrontConfig = /** @class */ (function () {
|
|
10953
10953
|
function IkasStorefrontConfig() {
|
|
10954
10954
|
}
|
|
10955
|
-
IkasStorefrontConfig.init = function (store,
|
|
10955
|
+
IkasStorefrontConfig.init = function (store, config, apiUrlOverride) {
|
|
10956
10956
|
IkasStorefrontConfig.store = store;
|
|
10957
|
-
IkasStorefrontConfig.components = components;
|
|
10958
10957
|
IkasStorefrontConfig.config = config;
|
|
10959
10958
|
IkasStorefrontConfig.apiUrlOverride = apiUrlOverride || null;
|
|
10960
10959
|
if (process.env.NEXT_PUBLIC_ENV === "local") {
|
|
@@ -10995,9 +10994,12 @@ var IkasStorefrontConfig = /** @class */ (function () {
|
|
|
10995
10994
|
stockPreference: IkasStorefrontConfig.stockPreference || null,
|
|
10996
10995
|
storefrontJSScripts: IkasStorefrontConfig.storefrontJSScripts || [],
|
|
10997
10996
|
translations: this.translations,
|
|
10997
|
+
customerReviewSettings: IkasStorefrontConfig.customerReviewSettings,
|
|
10998
|
+
productBackInStockSettings: IkasStorefrontConfig.productBackInStockSettings
|
|
10999
|
+
? JSON.parse(JSON.stringify(IkasStorefrontConfig.productBackInStockSettings))
|
|
11000
|
+
: null,
|
|
10998
11001
|
};
|
|
10999
11002
|
};
|
|
11000
|
-
IkasStorefrontConfig.components = {};
|
|
11001
11003
|
IkasStorefrontConfig.config = {};
|
|
11002
11004
|
IkasStorefrontConfig.apiUrlOverride = null;
|
|
11003
11005
|
IkasStorefrontConfig.routings = [];
|
|
@@ -12090,194 +12092,15 @@ function tryForEach(items, callback, printErrors) {
|
|
|
12090
12092
|
});
|
|
12091
12093
|
}
|
|
12092
12094
|
|
|
12093
|
-
/**
|
|
12094
|
-
*
|
|
12095
|
-
* @param price Price to format
|
|
12096
|
-
* @param currency Code for the currency, USD, EUR, TRY, etc..
|
|
12097
|
-
*/
|
|
12098
12095
|
var formatMoney = function (price, currency) {
|
|
12099
|
-
var
|
|
12096
|
+
var locale = typeof navigator !== "undefined"
|
|
12097
|
+
? navigator.languages
|
|
12098
|
+
: "en-GB";
|
|
12099
|
+
var formatter = new Intl.NumberFormat(locale, {
|
|
12100
12100
|
style: "currency",
|
|
12101
12101
|
currency: currency || "TRY",
|
|
12102
12102
|
});
|
|
12103
12103
|
return formatter.format(price);
|
|
12104
|
-
};
|
|
12105
|
-
function getCurrencySymbol(currencyCode) {
|
|
12106
|
-
return CURRENCIES[currencyCode] || currencyCode;
|
|
12107
|
-
}
|
|
12108
|
-
var CURRENCIES = {
|
|
12109
|
-
TRY: "₺",
|
|
12110
|
-
USD: "$",
|
|
12111
|
-
EUR: "€",
|
|
12112
|
-
AZN: "₼",
|
|
12113
|
-
AED: "د.إ.",
|
|
12114
|
-
AFN: "؋",
|
|
12115
|
-
ALL: "L",
|
|
12116
|
-
AMD: "դր",
|
|
12117
|
-
ANG: "ƒ",
|
|
12118
|
-
AOA: "Kz",
|
|
12119
|
-
ARS: "$",
|
|
12120
|
-
AUD: "$",
|
|
12121
|
-
AWG: "ƒ",
|
|
12122
|
-
BAM: "КМ",
|
|
12123
|
-
BBD: "$",
|
|
12124
|
-
BDT: "৳",
|
|
12125
|
-
BGN: "лв.",
|
|
12126
|
-
BHD: "د.ب.",
|
|
12127
|
-
BIF: "FBu",
|
|
12128
|
-
BMD: "$",
|
|
12129
|
-
BND: "$",
|
|
12130
|
-
BOB: "Bs.",
|
|
12131
|
-
BRL: "R$",
|
|
12132
|
-
BSD: "$",
|
|
12133
|
-
BTN: "Nu.",
|
|
12134
|
-
BWP: "P",
|
|
12135
|
-
BYN: "руб.",
|
|
12136
|
-
BZD: "$",
|
|
12137
|
-
CAD: "$",
|
|
12138
|
-
CDF: "₣",
|
|
12139
|
-
CHF: "₣",
|
|
12140
|
-
CKD: "$",
|
|
12141
|
-
CLP: "$",
|
|
12142
|
-
CNY: "¥元",
|
|
12143
|
-
COP: "$",
|
|
12144
|
-
CRC: "₡",
|
|
12145
|
-
CUC: "$",
|
|
12146
|
-
CUP: "₱",
|
|
12147
|
-
CVE: "$",
|
|
12148
|
-
CZK: "Kč",
|
|
12149
|
-
DJF: "ف.ج.",
|
|
12150
|
-
DKK: "kr.",
|
|
12151
|
-
DOP: "$",
|
|
12152
|
-
DZD: "د.ج.",
|
|
12153
|
-
EGP: "ج.م.",
|
|
12154
|
-
EHP: "Ptas.",
|
|
12155
|
-
ERN: "ناكفا",
|
|
12156
|
-
ETB: "ብር",
|
|
12157
|
-
FJD: "$",
|
|
12158
|
-
FKP: "£",
|
|
12159
|
-
FOK: "kr",
|
|
12160
|
-
GBP: "£",
|
|
12161
|
-
GEL: "₾",
|
|
12162
|
-
GGP: "£",
|
|
12163
|
-
GHS: "₵",
|
|
12164
|
-
GIP: "£",
|
|
12165
|
-
GMD: "D",
|
|
12166
|
-
GNF: "FG",
|
|
12167
|
-
GTQ: "$",
|
|
12168
|
-
GYD: "$",
|
|
12169
|
-
HKD: "$",
|
|
12170
|
-
HNL: "L",
|
|
12171
|
-
HRK: "kn",
|
|
12172
|
-
HTG: "G",
|
|
12173
|
-
HUF: "Ft",
|
|
12174
|
-
IDR: "Rp",
|
|
12175
|
-
ILS: "₪",
|
|
12176
|
-
IMP: "£",
|
|
12177
|
-
INR: "₹",
|
|
12178
|
-
IQD: "د.ع.",
|
|
12179
|
-
IRR: "﷼",
|
|
12180
|
-
ISK: "kr",
|
|
12181
|
-
JEP: "£",
|
|
12182
|
-
JMD: "$",
|
|
12183
|
-
JOD: "د.أ.",
|
|
12184
|
-
JPY: "¥",
|
|
12185
|
-
KES: "KSh",
|
|
12186
|
-
KGS: "с",
|
|
12187
|
-
KHR: "៛",
|
|
12188
|
-
KID: "$",
|
|
12189
|
-
KMF: "CF",
|
|
12190
|
-
KPW: "₩",
|
|
12191
|
-
KRW: "₩",
|
|
12192
|
-
KWD: "د.ك.",
|
|
12193
|
-
KYD: "$",
|
|
12194
|
-
KZT: "₸",
|
|
12195
|
-
LAK: "₭",
|
|
12196
|
-
LBP: "ل.ل.",
|
|
12197
|
-
LKR: "රු or ரூ",
|
|
12198
|
-
LRD: "$",
|
|
12199
|
-
LSL: "L",
|
|
12200
|
-
LYD: "ل.د.",
|
|
12201
|
-
MAD: "د.م.",
|
|
12202
|
-
MDL: "L",
|
|
12203
|
-
MGA: "Ar",
|
|
12204
|
-
MKD: "ден",
|
|
12205
|
-
MMK: "Ks",
|
|
12206
|
-
MNT: "₮",
|
|
12207
|
-
MOP: "MOP$",
|
|
12208
|
-
MRU: "أ.م.",
|
|
12209
|
-
MUR: "रु ",
|
|
12210
|
-
MVR: ".ރ",
|
|
12211
|
-
MWK: "MK",
|
|
12212
|
-
MXN: "$",
|
|
12213
|
-
MYR: "RM",
|
|
12214
|
-
MZN: "MT",
|
|
12215
|
-
NAD: "$",
|
|
12216
|
-
NGN: "₦",
|
|
12217
|
-
NIO: "C$",
|
|
12218
|
-
NOK: "kr",
|
|
12219
|
-
NPR: "रू",
|
|
12220
|
-
NZD: "$",
|
|
12221
|
-
OMR: "ر.ع.",
|
|
12222
|
-
PAB: "B/.",
|
|
12223
|
-
PEN: "S/.",
|
|
12224
|
-
PGK: "K",
|
|
12225
|
-
PHP: "₱",
|
|
12226
|
-
PKR: "Rs",
|
|
12227
|
-
PLN: "zł",
|
|
12228
|
-
PND: "$",
|
|
12229
|
-
PRB: "р.",
|
|
12230
|
-
PYG: "₲",
|
|
12231
|
-
QAR: "ر.ق.",
|
|
12232
|
-
RON: "L",
|
|
12233
|
-
RSD: "дин",
|
|
12234
|
-
RUB: "₽",
|
|
12235
|
-
RWF: "R₣",
|
|
12236
|
-
SAR: "ر.س.",
|
|
12237
|
-
SBD: "$",
|
|
12238
|
-
SCR: "Rs",
|
|
12239
|
-
SDG: "ج.س.",
|
|
12240
|
-
SEK: "kr",
|
|
12241
|
-
SGD: "$",
|
|
12242
|
-
SHP: "£",
|
|
12243
|
-
SLL: "Le",
|
|
12244
|
-
SLS: "Sl",
|
|
12245
|
-
SOS: "Ssh",
|
|
12246
|
-
SRD: "$",
|
|
12247
|
-
SSP: "SS£",
|
|
12248
|
-
STN: "Db",
|
|
12249
|
-
SVC: "₡",
|
|
12250
|
-
SYP: "ل.س.",
|
|
12251
|
-
SZL: "L",
|
|
12252
|
-
THB: "฿",
|
|
12253
|
-
TJS: "SM",
|
|
12254
|
-
TMT: "T",
|
|
12255
|
-
TND: "د.ت.",
|
|
12256
|
-
TOP: "PT",
|
|
12257
|
-
TTD: "$",
|
|
12258
|
-
TVD: "$",
|
|
12259
|
-
TWD: "圓",
|
|
12260
|
-
TZS: "TSh",
|
|
12261
|
-
UAH: "грн",
|
|
12262
|
-
UGX: "Sh",
|
|
12263
|
-
UYU: "$",
|
|
12264
|
-
UZS: "сум",
|
|
12265
|
-
VED: "Bs.",
|
|
12266
|
-
VES: "Bs.F",
|
|
12267
|
-
VND: "₫",
|
|
12268
|
-
VUV: "VT",
|
|
12269
|
-
WST: "ST",
|
|
12270
|
-
XAF: "Fr.",
|
|
12271
|
-
XCD: "$",
|
|
12272
|
-
XOF: "₣",
|
|
12273
|
-
XPF: "₣",
|
|
12274
|
-
YER: "ر.ي.",
|
|
12275
|
-
ZAR: "R",
|
|
12276
|
-
ZMW: "ZK",
|
|
12277
|
-
ZWB: "",
|
|
12278
|
-
ZWL: "$",
|
|
12279
|
-
Abkhazia: "",
|
|
12280
|
-
Artsakh: "դր.",
|
|
12281
12104
|
};
|
|
12282
12105
|
|
|
12283
12106
|
/** `Object#toString` result references. */
|
|
@@ -19859,7 +19682,6 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
19859
19682
|
this.orderedAt = data.orderedAt || 0;
|
|
19860
19683
|
this.deleted = data.deleted || false;
|
|
19861
19684
|
this.currencyCode = data.currencyCode || "";
|
|
19862
|
-
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
19863
19685
|
this.discount = data.discount
|
|
19864
19686
|
? new IkasOrderLineDiscount(data.discount)
|
|
19865
19687
|
: undefined;
|
|
@@ -19970,7 +19792,6 @@ var IkasCart = /** @class */ (function () {
|
|
|
19970
19792
|
this.updatedAt = data.updatedAt || "";
|
|
19971
19793
|
this.dueDate = data.dueDate;
|
|
19972
19794
|
this.currencyCode = data.currencyCode || "";
|
|
19973
|
-
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
19974
19795
|
this.customerId = data.customerId;
|
|
19975
19796
|
this.itemCount = data.itemCount || 0;
|
|
19976
19797
|
this.items = data.items
|
|
@@ -19991,6 +19812,7 @@ var IkasCart = /** @class */ (function () {
|
|
|
19991
19812
|
get: function () {
|
|
19992
19813
|
var _a;
|
|
19993
19814
|
return (((_a = this.taxLines) === null || _a === void 0 ? void 0 : _a.reduce(function (total, current) { return total + current.price; }, 0)) || 0);
|
|
19815
|
+
// return this.items.reduce((total, current) => total + current.tax, 0);
|
|
19994
19816
|
},
|
|
19995
19817
|
enumerable: false,
|
|
19996
19818
|
configurable: true
|
|
@@ -20476,6 +20298,33 @@ var IkasCustomerEmailSubscriptionStatus;
|
|
|
20476
20298
|
IkasCustomerEmailSubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
|
|
20477
20299
|
})(IkasCustomerEmailSubscriptionStatus || (IkasCustomerEmailSubscriptionStatus = {}));
|
|
20478
20300
|
|
|
20301
|
+
var IkasCustomerReview = /** @class */ (function () {
|
|
20302
|
+
function IkasCustomerReview(data) {
|
|
20303
|
+
this.comment = data.comment || "";
|
|
20304
|
+
this.createdAt = data.createdAt || "";
|
|
20305
|
+
this.customerId = data.customerId || "";
|
|
20306
|
+
this.deleted = data.deleted || false;
|
|
20307
|
+
this.id = data.id || "";
|
|
20308
|
+
this.orderId = data.orderId || "";
|
|
20309
|
+
this.orderNumber = data.orderNumber || "";
|
|
20310
|
+
this.productId = data.productId || "";
|
|
20311
|
+
this.salesChannelId = data.salesChannelId || "";
|
|
20312
|
+
this.star = data.star || 0;
|
|
20313
|
+
this.status = data.status || CustomerReviewStatusEnum.APPROVED;
|
|
20314
|
+
this.storefrontId = data.storefrontId || "";
|
|
20315
|
+
this.title = data.title || "";
|
|
20316
|
+
this.updatedAt = data.updatedAt || "";
|
|
20317
|
+
makeAutoObservable(this);
|
|
20318
|
+
}
|
|
20319
|
+
return IkasCustomerReview;
|
|
20320
|
+
}());
|
|
20321
|
+
var CustomerReviewStatusEnum;
|
|
20322
|
+
(function (CustomerReviewStatusEnum) {
|
|
20323
|
+
CustomerReviewStatusEnum["APPROVED"] = "APPROVED";
|
|
20324
|
+
CustomerReviewStatusEnum["REJECTED"] = "REJECTED";
|
|
20325
|
+
CustomerReviewStatusEnum["WAITING"] = "WAITING";
|
|
20326
|
+
})(CustomerReviewStatusEnum || (CustomerReviewStatusEnum = {}));
|
|
20327
|
+
|
|
20479
20328
|
var IkasCardAssociation;
|
|
20480
20329
|
(function (IkasCardAssociation) {
|
|
20481
20330
|
IkasCardAssociation["AMERICAN_EXPRESS"] = "AMERICAN_EXPRESS";
|
|
@@ -20552,7 +20401,6 @@ var IkasOrder = /** @class */ (function () {
|
|
|
20552
20401
|
// this.totalDiscountPrice = data.totalDiscountPrice;
|
|
20553
20402
|
// this.totalWeight = data.totalWeight;
|
|
20554
20403
|
this.currencyCode = data.currencyCode;
|
|
20555
|
-
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
20556
20404
|
this.orderedAt = data.orderedAt;
|
|
20557
20405
|
this.cancelledAt = data.cancelledAt;
|
|
20558
20406
|
this.status = data.status;
|
|
@@ -20722,7 +20570,6 @@ var IkasProductPrice = /** @class */ (function () {
|
|
|
20722
20570
|
this.discountPrice =
|
|
20723
20571
|
data.discountPrice !== undefined ? data.discountPrice : null;
|
|
20724
20572
|
this.currency = data.currency || "";
|
|
20725
|
-
this.currencySymbol = getCurrencySymbol(this.currency);
|
|
20726
20573
|
makeAutoObservable(this);
|
|
20727
20574
|
}
|
|
20728
20575
|
Object.defineProperty(IkasProductPrice.prototype, "finalPrice", {
|
|
@@ -20870,7 +20717,9 @@ var IkasProductAttributeValue = /** @class */ (function () {
|
|
|
20870
20717
|
var IkasProductVariant = /** @class */ (function () {
|
|
20871
20718
|
function IkasProductVariant(data) {
|
|
20872
20719
|
if (data === void 0) { data = {}; }
|
|
20720
|
+
this._backInStockReminderSaved = false;
|
|
20873
20721
|
this.id = data.id || Date.now() + "";
|
|
20722
|
+
this.productId = data.productId || "";
|
|
20874
20723
|
this.sku = data.sku || null;
|
|
20875
20724
|
this.barcodeList = data.barcodeList || [];
|
|
20876
20725
|
this.variantValues = data.variantValues
|
|
@@ -20896,6 +20745,70 @@ var IkasProductVariant = /** @class */ (function () {
|
|
|
20896
20745
|
enumerable: false,
|
|
20897
20746
|
configurable: true
|
|
20898
20747
|
});
|
|
20748
|
+
Object.defineProperty(IkasProductVariant.prototype, "hasStock", {
|
|
20749
|
+
get: function () {
|
|
20750
|
+
return this.stock > 0;
|
|
20751
|
+
},
|
|
20752
|
+
enumerable: false,
|
|
20753
|
+
configurable: true
|
|
20754
|
+
});
|
|
20755
|
+
Object.defineProperty(IkasProductVariant.prototype, "isBackInStockEnabled", {
|
|
20756
|
+
get: function () {
|
|
20757
|
+
return IkasStorefrontConfig.productBackInStockSettings !== null;
|
|
20758
|
+
},
|
|
20759
|
+
enumerable: false,
|
|
20760
|
+
configurable: true
|
|
20761
|
+
});
|
|
20762
|
+
Object.defineProperty(IkasProductVariant.prototype, "isBackInStockCustomerLoginRequired", {
|
|
20763
|
+
get: function () {
|
|
20764
|
+
return (IkasStorefrontConfig.productBackInStockSettings &&
|
|
20765
|
+
IkasStorefrontConfig.productBackInStockSettings.customerLoginRequired);
|
|
20766
|
+
},
|
|
20767
|
+
enumerable: false,
|
|
20768
|
+
configurable: true
|
|
20769
|
+
});
|
|
20770
|
+
Object.defineProperty(IkasProductVariant.prototype, "isBackInStockReminderSaved", {
|
|
20771
|
+
get: function () {
|
|
20772
|
+
return this._backInStockReminderSaved;
|
|
20773
|
+
},
|
|
20774
|
+
enumerable: false,
|
|
20775
|
+
configurable: true
|
|
20776
|
+
});
|
|
20777
|
+
IkasProductVariant.prototype.saveBackInStockReminder = function (email) {
|
|
20778
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20779
|
+
var listResponse, saveResponseSuccess;
|
|
20780
|
+
return __generator(this, function (_a) {
|
|
20781
|
+
switch (_a.label) {
|
|
20782
|
+
case 0: return [4 /*yield*/, IkasProductBackInStockReminderAPI.list({
|
|
20783
|
+
email: email,
|
|
20784
|
+
productId: this.productId,
|
|
20785
|
+
variantId: this.id,
|
|
20786
|
+
})];
|
|
20787
|
+
case 1:
|
|
20788
|
+
listResponse = _a.sent();
|
|
20789
|
+
if (!(listResponse && listResponse.data.length)) return [3 /*break*/, 2];
|
|
20790
|
+
this._backInStockReminderSaved = true;
|
|
20791
|
+
return [2 /*return*/, false];
|
|
20792
|
+
case 2: return [4 /*yield*/, IkasProductBackInStockReminderAPI.save({
|
|
20793
|
+
email: email,
|
|
20794
|
+
productId: this.productId,
|
|
20795
|
+
variantId: this.id,
|
|
20796
|
+
})];
|
|
20797
|
+
case 3:
|
|
20798
|
+
saveResponseSuccess = _a.sent();
|
|
20799
|
+
if (saveResponseSuccess) {
|
|
20800
|
+
this._backInStockReminderSaved = true;
|
|
20801
|
+
return [2 /*return*/, true];
|
|
20802
|
+
}
|
|
20803
|
+
else {
|
|
20804
|
+
this._backInStockReminderSaved = false;
|
|
20805
|
+
return [2 /*return*/, false];
|
|
20806
|
+
}
|
|
20807
|
+
case 4: return [2 /*return*/];
|
|
20808
|
+
}
|
|
20809
|
+
});
|
|
20810
|
+
});
|
|
20811
|
+
};
|
|
20899
20812
|
return IkasProductVariant;
|
|
20900
20813
|
}());
|
|
20901
20814
|
|
|
@@ -21008,6 +20921,8 @@ var IkasProduct = /** @class */ (function () {
|
|
|
21008
20921
|
this.variantTypes = data.variantTypes
|
|
21009
20922
|
? data.variantTypes.map(function (v) { return new IkasProductVariantType(v); })
|
|
21010
20923
|
: [];
|
|
20924
|
+
this.productOptionSetId = data.productOptionSetId || null;
|
|
20925
|
+
this.productOptionSet = data.productOptionSet || null;
|
|
21011
20926
|
makeAutoObservable(this);
|
|
21012
20927
|
}
|
|
21013
20928
|
Object.defineProperty(IkasProduct.prototype, "hasVariant", {
|
|
@@ -21017,6 +20932,13 @@ var IkasProduct = /** @class */ (function () {
|
|
|
21017
20932
|
enumerable: false,
|
|
21018
20933
|
configurable: true
|
|
21019
20934
|
});
|
|
20935
|
+
Object.defineProperty(IkasProduct.prototype, "hasStock", {
|
|
20936
|
+
get: function () {
|
|
20937
|
+
return this.variants.some(function (v) { return v.stock > 0; });
|
|
20938
|
+
},
|
|
20939
|
+
enumerable: false,
|
|
20940
|
+
configurable: true
|
|
20941
|
+
});
|
|
21020
20942
|
Object.defineProperty(IkasProduct.prototype, "mainVariantType", {
|
|
21021
20943
|
get: function () {
|
|
21022
20944
|
if (!this.hasVariant)
|
|
@@ -23830,9 +23752,6 @@ var IkasOrderTransaction = /** @class */ (function () {
|
|
|
23830
23752
|
this.checkoutId = data.checkoutId || null;
|
|
23831
23753
|
this.createdAt = data.createdAt || null;
|
|
23832
23754
|
this.currencyCode = data.currencyCode || null;
|
|
23833
|
-
this.currencySymbol = this.currencyCode
|
|
23834
|
-
? getCurrencySymbol(this.currencyCode)
|
|
23835
|
-
: null;
|
|
23836
23755
|
this.customerId = data.customerId || null;
|
|
23837
23756
|
this.error = data.error || null;
|
|
23838
23757
|
this.id = data.id || null;
|
|
@@ -23887,6 +23806,147 @@ var IkasTransactionTypeEnum;
|
|
|
23887
23806
|
IkasTransactionTypeEnum["VOID"] = "VOID";
|
|
23888
23807
|
})(IkasTransactionTypeEnum || (IkasTransactionTypeEnum = {}));
|
|
23889
23808
|
|
|
23809
|
+
var IkasProductOptionType;
|
|
23810
|
+
(function (IkasProductOptionType) {
|
|
23811
|
+
IkasProductOptionType["CHOICE"] = "CHOICE";
|
|
23812
|
+
IkasProductOptionType["TEXT"] = "TEXT";
|
|
23813
|
+
IkasProductOptionType["TEXT_AREA"] = "TEXT_AREA";
|
|
23814
|
+
IkasProductOptionType["IMAGE"] = "IMAGE";
|
|
23815
|
+
IkasProductOptionType["FILE"] = "FILE";
|
|
23816
|
+
IkasProductOptionType["COLOR_PICKER"] = "COLOR_PICKER";
|
|
23817
|
+
// DATE_PICKER = "DATE_PICKER",
|
|
23818
|
+
IkasProductOptionType["CHECKBOX"] = "CHECKBOX";
|
|
23819
|
+
})(IkasProductOptionType || (IkasProductOptionType = {}));
|
|
23820
|
+
var IkasProductOptionSelectType;
|
|
23821
|
+
(function (IkasProductOptionSelectType) {
|
|
23822
|
+
IkasProductOptionSelectType["SELECT"] = "SELECT";
|
|
23823
|
+
IkasProductOptionSelectType["BOX"] = "BOX";
|
|
23824
|
+
IkasProductOptionSelectType["SWATCH"] = "SWATCH";
|
|
23825
|
+
})(IkasProductOptionSelectType || (IkasProductOptionSelectType = {}));
|
|
23826
|
+
var IkasProductOptionSelectValueTranslations = /** @class */ (function () {
|
|
23827
|
+
function IkasProductOptionSelectValueTranslations(data) {
|
|
23828
|
+
this.id = data.id || "";
|
|
23829
|
+
this.value = data.value || null;
|
|
23830
|
+
makeAutoObservable(this);
|
|
23831
|
+
}
|
|
23832
|
+
return IkasProductOptionSelectValueTranslations;
|
|
23833
|
+
}());
|
|
23834
|
+
var IkasProductOptionTranslations = /** @class */ (function () {
|
|
23835
|
+
function IkasProductOptionTranslations(data) {
|
|
23836
|
+
var _a;
|
|
23837
|
+
this.id = data.id || "";
|
|
23838
|
+
this.name = data.name || null;
|
|
23839
|
+
this.optionalText = data.optionalText || null;
|
|
23840
|
+
this.values =
|
|
23841
|
+
((_a = data.values) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOptionSelectValueTranslations(o); })) || [];
|
|
23842
|
+
makeAutoObservable(this);
|
|
23843
|
+
}
|
|
23844
|
+
return IkasProductOptionTranslations;
|
|
23845
|
+
}());
|
|
23846
|
+
var IkasProductOptionSetTranslations = /** @class */ (function () {
|
|
23847
|
+
function IkasProductOptionSetTranslations(data) {
|
|
23848
|
+
var _a;
|
|
23849
|
+
this.locale = data.locale || "";
|
|
23850
|
+
this.options =
|
|
23851
|
+
((_a = data.options) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOptionTranslations(o); })) || [];
|
|
23852
|
+
makeAutoObservable(this);
|
|
23853
|
+
}
|
|
23854
|
+
return IkasProductOptionSetTranslations;
|
|
23855
|
+
}());
|
|
23856
|
+
var IkasProductOptionSelectValue = /** @class */ (function () {
|
|
23857
|
+
function IkasProductOptionSelectValue(data) {
|
|
23858
|
+
if (data === void 0) { data = {}; }
|
|
23859
|
+
this.order = data.order || 0;
|
|
23860
|
+
this.value = data.value || "";
|
|
23861
|
+
this.price = data.price || null;
|
|
23862
|
+
this.thumbnailImageId = data.thumbnailImageId || null;
|
|
23863
|
+
this.colorCode = data.colorCode || null;
|
|
23864
|
+
this.thumbnailImage =
|
|
23865
|
+
data.thumbnailImage ||
|
|
23866
|
+
(this.thumbnailImageId
|
|
23867
|
+
? new IkasImage(this.thumbnailImageId)
|
|
23868
|
+
: undefined);
|
|
23869
|
+
makeAutoObservable(this);
|
|
23870
|
+
}
|
|
23871
|
+
return IkasProductOptionSelectValue;
|
|
23872
|
+
}());
|
|
23873
|
+
var IkasProductOptionSelectSettings = /** @class */ (function () {
|
|
23874
|
+
function IkasProductOptionSelectSettings(data) {
|
|
23875
|
+
if (data === void 0) { data = {}; }
|
|
23876
|
+
var _a;
|
|
23877
|
+
this.type = data.type || IkasProductOptionSelectType.BOX;
|
|
23878
|
+
this.minSelect = data.minSelect || null;
|
|
23879
|
+
this.maxSelect = data.maxSelect || null;
|
|
23880
|
+
this.values =
|
|
23881
|
+
((_a = data.values) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOptionSelectValue(o); })) || [];
|
|
23882
|
+
makeAutoObservable(this);
|
|
23883
|
+
}
|
|
23884
|
+
return IkasProductOptionSelectSettings;
|
|
23885
|
+
}());
|
|
23886
|
+
var IkasProductOptionDateSettings = /** @class */ (function () {
|
|
23887
|
+
function IkasProductOptionDateSettings(data) {
|
|
23888
|
+
this.min = data.min || null;
|
|
23889
|
+
this.max = data.max || null;
|
|
23890
|
+
makeAutoObservable(this);
|
|
23891
|
+
}
|
|
23892
|
+
return IkasProductOptionDateSettings;
|
|
23893
|
+
}());
|
|
23894
|
+
var IkasProductOptionTextSettings = /** @class */ (function () {
|
|
23895
|
+
function IkasProductOptionTextSettings(data) {
|
|
23896
|
+
if (data === void 0) { data = {}; }
|
|
23897
|
+
this.min = data.min || null;
|
|
23898
|
+
this.max = data.max || null;
|
|
23899
|
+
makeAutoObservable(this);
|
|
23900
|
+
}
|
|
23901
|
+
return IkasProductOptionTextSettings;
|
|
23902
|
+
}());
|
|
23903
|
+
var IkasProductOptionFileSettings = /** @class */ (function () {
|
|
23904
|
+
function IkasProductOptionFileSettings(data) {
|
|
23905
|
+
this.allowedExtensions = data.allowedExtensions || null;
|
|
23906
|
+
this.minQuantity = data.minQuantity || null;
|
|
23907
|
+
this.maxQuantity = data.maxQuantity || null;
|
|
23908
|
+
makeAutoObservable(this);
|
|
23909
|
+
}
|
|
23910
|
+
return IkasProductOptionFileSettings;
|
|
23911
|
+
}());
|
|
23912
|
+
var IkasProductOption = /** @class */ (function () {
|
|
23913
|
+
function IkasProductOption(data) {
|
|
23914
|
+
this.name = data.name || "";
|
|
23915
|
+
this.order = data.order || 0;
|
|
23916
|
+
this.type = data.type || IkasProductOptionType.CHOICE;
|
|
23917
|
+
this.selectSettings = data.selectSettings
|
|
23918
|
+
? new IkasProductOptionSelectSettings(data.selectSettings || {})
|
|
23919
|
+
: null;
|
|
23920
|
+
this.textSettings = data.textSettings
|
|
23921
|
+
? new IkasProductOptionTextSettings(data.textSettings || {})
|
|
23922
|
+
: null;
|
|
23923
|
+
this.fileSettings = data.fileSettings
|
|
23924
|
+
? new IkasProductOptionFileSettings(data.fileSettings || {})
|
|
23925
|
+
: null;
|
|
23926
|
+
this.dateSettings = data.dateSettings
|
|
23927
|
+
? new IkasProductOptionDateSettings(data.dateSettings || {})
|
|
23928
|
+
: null;
|
|
23929
|
+
this.price = data.price || null;
|
|
23930
|
+
this.isOptional = data.isOptional || null;
|
|
23931
|
+
this.optionalText = data.optionalText || null;
|
|
23932
|
+
this.requiredOptionId = data.requiredOptionId || null;
|
|
23933
|
+
this.requiredOptionValueIds = data.requiredOptionValueIds || null;
|
|
23934
|
+
makeAutoObservable(this);
|
|
23935
|
+
}
|
|
23936
|
+
return IkasProductOption;
|
|
23937
|
+
}());
|
|
23938
|
+
var IkasProductOptionSet = /** @class */ (function () {
|
|
23939
|
+
function IkasProductOptionSet(data) {
|
|
23940
|
+
var _a, _b;
|
|
23941
|
+
this.name = data.name || "";
|
|
23942
|
+
this.options = ((_a = data.options) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOption(o); })) || [];
|
|
23943
|
+
this.translations = data.translations
|
|
23944
|
+
? (_b = data.translations) === null || _b === void 0 ? void 0 : _b.map(function (o) { return new IkasProductOptionSetTranslations(o); }) : null;
|
|
23945
|
+
makeAutoObservable(this);
|
|
23946
|
+
}
|
|
23947
|
+
return IkasProductOptionSet;
|
|
23948
|
+
}());
|
|
23949
|
+
|
|
23890
23950
|
var IkasThemeComponentProp = /** @class */ (function () {
|
|
23891
23951
|
function IkasThemeComponentProp(data) {
|
|
23892
23952
|
this.id = data.id || Date.now() + "";
|
|
@@ -25940,14 +26000,13 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
25940
26000
|
});
|
|
25941
26001
|
}); };
|
|
25942
26002
|
this.getMerchantSettings = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
25943
|
-
var
|
|
26003
|
+
var _a;
|
|
25944
26004
|
return __generator(this, function (_b) {
|
|
25945
26005
|
switch (_b.label) {
|
|
25946
26006
|
case 0:
|
|
25947
26007
|
if (!!this.merchantSettings) return [3 /*break*/, 2];
|
|
25948
|
-
merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
|
|
25949
26008
|
_a = this;
|
|
25950
|
-
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(
|
|
26009
|
+
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings()];
|
|
25951
26010
|
case 1:
|
|
25952
26011
|
_a.merchantSettings = _b.sent();
|
|
25953
26012
|
_b.label = 2;
|
|
@@ -27221,11 +27280,512 @@ var IkasEventType;
|
|
|
27221
27280
|
IkasEventType["CUSTOMER_VISIT"] = "CUSTOMER_VISIT";
|
|
27222
27281
|
IkasEventType["VIEW_CART"] = "VIEW_CART";
|
|
27223
27282
|
IkasEventType["VIEW_CATEGORY"] = "VIEW_CATEGORY";
|
|
27283
|
+
IkasEventType["VIEW_BRAND"] = "VIEW_BRAND";
|
|
27224
27284
|
IkasEventType["VIEW_SEARCH_RESULTS"] = "VIEW_SEARCH_RESULTS";
|
|
27225
27285
|
IkasEventType["VIEW_LISTING"] = "VIEW_LISTING";
|
|
27226
27286
|
IkasEventType["CONTACT_FORM"] = "CONTACT_FORM";
|
|
27227
27287
|
})(IkasEventType || (IkasEventType = {}));
|
|
27228
27288
|
|
|
27289
|
+
var StorefrontEventType;
|
|
27290
|
+
(function (StorefrontEventType) {
|
|
27291
|
+
StorefrontEventType[StorefrontEventType["SESSION_START"] = 1] = "SESSION_START";
|
|
27292
|
+
StorefrontEventType[StorefrontEventType["PAGE_VIEW"] = 2] = "PAGE_VIEW";
|
|
27293
|
+
StorefrontEventType[StorefrontEventType["PRODUCT_VIEW"] = 3] = "PRODUCT_VIEW";
|
|
27294
|
+
StorefrontEventType[StorefrontEventType["ADD_TO_CART"] = 4] = "ADD_TO_CART";
|
|
27295
|
+
StorefrontEventType[StorefrontEventType["VIEW_CART"] = 5] = "VIEW_CART";
|
|
27296
|
+
StorefrontEventType[StorefrontEventType["ORDER_SUCCESS"] = 6] = "ORDER_SUCCESS";
|
|
27297
|
+
StorefrontEventType[StorefrontEventType["BEGIN_CHECKOUT"] = 7] = "BEGIN_CHECKOUT";
|
|
27298
|
+
StorefrontEventType[StorefrontEventType["CHECKOUT_STEP"] = 8] = "CHECKOUT_STEP";
|
|
27299
|
+
StorefrontEventType[StorefrontEventType["CUSTOMER_REGISTER"] = 9] = "CUSTOMER_REGISTER";
|
|
27300
|
+
StorefrontEventType[StorefrontEventType["CUSTOMER_VISIT"] = 10] = "CUSTOMER_VISIT";
|
|
27301
|
+
StorefrontEventType[StorefrontEventType["CUSTOMER_LOGIN"] = 11] = "CUSTOMER_LOGIN";
|
|
27302
|
+
StorefrontEventType[StorefrontEventType["BRAND_VIEW"] = 12] = "BRAND_VIEW";
|
|
27303
|
+
StorefrontEventType[StorefrontEventType["CATEGORY_VIEW"] = 13] = "CATEGORY_VIEW";
|
|
27304
|
+
})(StorefrontEventType || (StorefrontEventType = {}));
|
|
27305
|
+
var StorefrontEventPageType;
|
|
27306
|
+
(function (StorefrontEventPageType) {
|
|
27307
|
+
StorefrontEventPageType[StorefrontEventPageType["INDEX"] = 1] = "INDEX";
|
|
27308
|
+
StorefrontEventPageType[StorefrontEventPageType["CATEGORY"] = 2] = "CATEGORY";
|
|
27309
|
+
StorefrontEventPageType[StorefrontEventPageType["BRAND"] = 3] = "BRAND";
|
|
27310
|
+
StorefrontEventPageType[StorefrontEventPageType["PRODUCT"] = 4] = "PRODUCT";
|
|
27311
|
+
StorefrontEventPageType[StorefrontEventPageType["CUSTOM"] = 5] = "CUSTOM";
|
|
27312
|
+
StorefrontEventPageType[StorefrontEventPageType["ACCOUNT"] = 6] = "ACCOUNT";
|
|
27313
|
+
StorefrontEventPageType[StorefrontEventPageType["ADDRESSES"] = 7] = "ADDRESSES";
|
|
27314
|
+
StorefrontEventPageType[StorefrontEventPageType["ORDERS"] = 8] = "ORDERS";
|
|
27315
|
+
StorefrontEventPageType[StorefrontEventPageType["ORDER_DETAIL"] = 9] = "ORDER_DETAIL";
|
|
27316
|
+
StorefrontEventPageType[StorefrontEventPageType["LOGIN"] = 10] = "LOGIN";
|
|
27317
|
+
StorefrontEventPageType[StorefrontEventPageType["REGISTER"] = 11] = "REGISTER";
|
|
27318
|
+
StorefrontEventPageType[StorefrontEventPageType["FORGOT_PASSWORD"] = 12] = "FORGOT_PASSWORD";
|
|
27319
|
+
StorefrontEventPageType[StorefrontEventPageType["RECOVER_PASSWORD"] = 13] = "RECOVER_PASSWORD";
|
|
27320
|
+
StorefrontEventPageType[StorefrontEventPageType["CART"] = 14] = "CART";
|
|
27321
|
+
StorefrontEventPageType[StorefrontEventPageType["FAVORITE_PRODUCTS"] = 15] = "FAVORITE_PRODUCTS";
|
|
27322
|
+
StorefrontEventPageType[StorefrontEventPageType["SEARCH"] = 16] = "SEARCH";
|
|
27323
|
+
StorefrontEventPageType[StorefrontEventPageType["NOT_FOUND"] = 17] = "NOT_FOUND";
|
|
27324
|
+
StorefrontEventPageType[StorefrontEventPageType["BLOG"] = 18] = "BLOG";
|
|
27325
|
+
StorefrontEventPageType[StorefrontEventPageType["BLOG_INDEX"] = 19] = "BLOG_INDEX";
|
|
27326
|
+
StorefrontEventPageType[StorefrontEventPageType["BLOG_CATEGORY"] = 20] = "BLOG_CATEGORY";
|
|
27327
|
+
StorefrontEventPageType[StorefrontEventPageType["CHECKOUT"] = 21] = "CHECKOUT";
|
|
27328
|
+
})(StorefrontEventPageType || (StorefrontEventPageType = {}));
|
|
27329
|
+
var ANALYTICS_URL = "https://0.myikas.dev/sendEvent";
|
|
27330
|
+
var IkasAnalytics = /** @class */ (function () {
|
|
27331
|
+
function IkasAnalytics() {
|
|
27332
|
+
}
|
|
27333
|
+
IkasAnalytics.createSessionId = function () {
|
|
27334
|
+
try {
|
|
27335
|
+
var idWithExpiry = {
|
|
27336
|
+
id: v4(),
|
|
27337
|
+
expiry: Date.now() + this.EXPIRY_LENGTH,
|
|
27338
|
+
};
|
|
27339
|
+
localStorage.setItem(this.SESSION_ID_KEY, JSON.stringify(idWithExpiry));
|
|
27340
|
+
this.sessionId = idWithExpiry.id;
|
|
27341
|
+
this.sessionStart();
|
|
27342
|
+
}
|
|
27343
|
+
catch (err) {
|
|
27344
|
+
console.error(err);
|
|
27345
|
+
}
|
|
27346
|
+
};
|
|
27347
|
+
IkasAnalytics.checkSessionId = function () {
|
|
27348
|
+
try {
|
|
27349
|
+
var existingSessionIdData = localStorage.getItem(this.SESSION_ID_KEY);
|
|
27350
|
+
if (existingSessionIdData) {
|
|
27351
|
+
var idWithExpiry = JSON.parse(existingSessionIdData);
|
|
27352
|
+
if (idWithExpiry.expiry < Date.now()) {
|
|
27353
|
+
this.createSessionId();
|
|
27354
|
+
}
|
|
27355
|
+
else {
|
|
27356
|
+
// Extend the duration of the sessionId
|
|
27357
|
+
idWithExpiry.expiry = Date.now() + this.EXPIRY_LENGTH;
|
|
27358
|
+
localStorage.setItem(this.SESSION_ID_KEY, JSON.stringify(idWithExpiry));
|
|
27359
|
+
this.sessionId = idWithExpiry.id;
|
|
27360
|
+
}
|
|
27361
|
+
}
|
|
27362
|
+
else {
|
|
27363
|
+
this.createSessionId();
|
|
27364
|
+
}
|
|
27365
|
+
}
|
|
27366
|
+
catch (err) {
|
|
27367
|
+
console.error(err);
|
|
27368
|
+
}
|
|
27369
|
+
};
|
|
27370
|
+
IkasAnalytics.checkVisitorId = function () {
|
|
27371
|
+
try {
|
|
27372
|
+
var existingVisitorId = localStorage.getItem(this.VISITOR_ID_KEY);
|
|
27373
|
+
if (existingVisitorId) {
|
|
27374
|
+
this.visitorId = existingVisitorId;
|
|
27375
|
+
}
|
|
27376
|
+
else {
|
|
27377
|
+
this.visitorId = v4();
|
|
27378
|
+
localStorage.setItem(this.VISITOR_ID_KEY, this.visitorId);
|
|
27379
|
+
}
|
|
27380
|
+
}
|
|
27381
|
+
catch (err) {
|
|
27382
|
+
console.error(err);
|
|
27383
|
+
}
|
|
27384
|
+
};
|
|
27385
|
+
IkasAnalytics.getPageType = function (pageType) {
|
|
27386
|
+
switch (pageType) {
|
|
27387
|
+
case IkasThemePageType.INDEX:
|
|
27388
|
+
return StorefrontEventPageType.INDEX;
|
|
27389
|
+
case IkasThemePageType.CATEGORY:
|
|
27390
|
+
return StorefrontEventPageType.CATEGORY;
|
|
27391
|
+
case IkasThemePageType.BRAND:
|
|
27392
|
+
return StorefrontEventPageType.BRAND;
|
|
27393
|
+
case IkasThemePageType.PRODUCT:
|
|
27394
|
+
return StorefrontEventPageType.PRODUCT;
|
|
27395
|
+
case IkasThemePageType.CUSTOM:
|
|
27396
|
+
return StorefrontEventPageType.CUSTOM;
|
|
27397
|
+
case IkasThemePageType.ACCOUNT:
|
|
27398
|
+
return StorefrontEventPageType.ACCOUNT;
|
|
27399
|
+
case IkasThemePageType.ADDRESSES:
|
|
27400
|
+
return StorefrontEventPageType.ADDRESSES;
|
|
27401
|
+
case IkasThemePageType.ORDERS:
|
|
27402
|
+
return StorefrontEventPageType.ORDERS;
|
|
27403
|
+
case IkasThemePageType.ORDER_DETAIL:
|
|
27404
|
+
return StorefrontEventPageType.ORDER_DETAIL;
|
|
27405
|
+
case IkasThemePageType.LOGIN:
|
|
27406
|
+
return StorefrontEventPageType.LOGIN;
|
|
27407
|
+
case IkasThemePageType.REGISTER:
|
|
27408
|
+
return StorefrontEventPageType.REGISTER;
|
|
27409
|
+
case IkasThemePageType.FORGOT_PASSWORD:
|
|
27410
|
+
return StorefrontEventPageType.FORGOT_PASSWORD;
|
|
27411
|
+
case IkasThemePageType.RECOVER_PASSWORD:
|
|
27412
|
+
return StorefrontEventPageType.RECOVER_PASSWORD;
|
|
27413
|
+
case IkasThemePageType.CART:
|
|
27414
|
+
return StorefrontEventPageType.CART;
|
|
27415
|
+
case IkasThemePageType.FAVORITE_PRODUCTS:
|
|
27416
|
+
return StorefrontEventPageType.FAVORITE_PRODUCTS;
|
|
27417
|
+
case IkasThemePageType.SEARCH:
|
|
27418
|
+
return StorefrontEventPageType.SEARCH;
|
|
27419
|
+
case IkasThemePageType.NOT_FOUND:
|
|
27420
|
+
return StorefrontEventPageType.NOT_FOUND;
|
|
27421
|
+
case IkasThemePageType.BLOG:
|
|
27422
|
+
return StorefrontEventPageType.BLOG;
|
|
27423
|
+
case IkasThemePageType.BLOG_INDEX:
|
|
27424
|
+
return StorefrontEventPageType.BLOG_INDEX;
|
|
27425
|
+
case IkasThemePageType.BLOG_CATEGORY:
|
|
27426
|
+
return StorefrontEventPageType.BLOG_CATEGORY;
|
|
27427
|
+
case IkasThemePageType.CHECKOUT:
|
|
27428
|
+
return StorefrontEventPageType.CHECKOUT;
|
|
27429
|
+
}
|
|
27430
|
+
};
|
|
27431
|
+
IkasAnalytics.getCustomerData = function () {
|
|
27432
|
+
var customer = IkasStorefrontConfig.store.customerStore.customer;
|
|
27433
|
+
return {
|
|
27434
|
+
id: customer === null || customer === void 0 ? void 0 : customer.id,
|
|
27435
|
+
e: customer === null || customer === void 0 ? void 0 : customer.email,
|
|
27436
|
+
c: IkasStorefrontConfig.store.customerStore.customerConsentGranted,
|
|
27437
|
+
};
|
|
27438
|
+
};
|
|
27439
|
+
IkasAnalytics.getCommonEventData = function () {
|
|
27440
|
+
return {
|
|
27441
|
+
u: window.location.href,
|
|
27442
|
+
r: document.referrer,
|
|
27443
|
+
pt: IkasStorefrontConfig.store.currentPageType
|
|
27444
|
+
? this.getPageType(IkasStorefrontConfig.store.currentPageType)
|
|
27445
|
+
: undefined,
|
|
27446
|
+
};
|
|
27447
|
+
};
|
|
27448
|
+
IkasAnalytics.sendEvents = function (events) {
|
|
27449
|
+
var _a;
|
|
27450
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27451
|
+
var cloudFrontEvent, err_1;
|
|
27452
|
+
return __generator(this, function (_b) {
|
|
27453
|
+
switch (_b.label) {
|
|
27454
|
+
case 0:
|
|
27455
|
+
_b.trys.push([0, 2, , 3]);
|
|
27456
|
+
this.checkSessionId();
|
|
27457
|
+
this.checkVisitorId();
|
|
27458
|
+
cloudFrontEvent = {
|
|
27459
|
+
e: events,
|
|
27460
|
+
scid: IkasStorefrontConfig.salesChannelId,
|
|
27461
|
+
sfid: IkasStorefrontConfig.storefrontId,
|
|
27462
|
+
sid: this.sessionId,
|
|
27463
|
+
vid: this.visitorId,
|
|
27464
|
+
cid: (_a = IkasStorefrontConfig.store.customerStore.customer) === null || _a === void 0 ? void 0 : _a.id,
|
|
27465
|
+
};
|
|
27466
|
+
return [4 /*yield*/, fetch(ANALYTICS_URL, {
|
|
27467
|
+
method: "POST",
|
|
27468
|
+
body: JSON.stringify(cloudFrontEvent),
|
|
27469
|
+
headers: {
|
|
27470
|
+
"Content-Type": "application/json",
|
|
27471
|
+
"x-api-key": IkasStorefrontConfig.config.apiKey,
|
|
27472
|
+
},
|
|
27473
|
+
})];
|
|
27474
|
+
case 1:
|
|
27475
|
+
_b.sent();
|
|
27476
|
+
return [3 /*break*/, 3];
|
|
27477
|
+
case 2:
|
|
27478
|
+
err_1 = _b.sent();
|
|
27479
|
+
console.error(err_1);
|
|
27480
|
+
return [3 /*break*/, 3];
|
|
27481
|
+
case 3: return [2 /*return*/];
|
|
27482
|
+
}
|
|
27483
|
+
});
|
|
27484
|
+
});
|
|
27485
|
+
};
|
|
27486
|
+
// EVENTS
|
|
27487
|
+
IkasAnalytics.sessionStart = function () {
|
|
27488
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27489
|
+
var event;
|
|
27490
|
+
return __generator(this, function (_a) {
|
|
27491
|
+
switch (_a.label) {
|
|
27492
|
+
case 0:
|
|
27493
|
+
event = {
|
|
27494
|
+
t: StorefrontEventType.SESSION_START,
|
|
27495
|
+
ts: Date.now(),
|
|
27496
|
+
d: __assign({}, this.getCommonEventData()),
|
|
27497
|
+
};
|
|
27498
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27499
|
+
case 1:
|
|
27500
|
+
_a.sent();
|
|
27501
|
+
return [2 /*return*/];
|
|
27502
|
+
}
|
|
27503
|
+
});
|
|
27504
|
+
});
|
|
27505
|
+
};
|
|
27506
|
+
IkasAnalytics.pageView = function (pageType) {
|
|
27507
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27508
|
+
var event;
|
|
27509
|
+
return __generator(this, function (_a) {
|
|
27510
|
+
switch (_a.label) {
|
|
27511
|
+
case 0:
|
|
27512
|
+
event = {
|
|
27513
|
+
t: StorefrontEventType.PAGE_VIEW,
|
|
27514
|
+
ts: Date.now(),
|
|
27515
|
+
d: __assign(__assign({}, this.getCommonEventData()), { pt: this.getPageType(pageType) }),
|
|
27516
|
+
};
|
|
27517
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27518
|
+
case 1:
|
|
27519
|
+
_a.sent();
|
|
27520
|
+
return [2 /*return*/];
|
|
27521
|
+
}
|
|
27522
|
+
});
|
|
27523
|
+
});
|
|
27524
|
+
};
|
|
27525
|
+
IkasAnalytics.productView = function (productDetail) {
|
|
27526
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27527
|
+
var event;
|
|
27528
|
+
return __generator(this, function (_a) {
|
|
27529
|
+
switch (_a.label) {
|
|
27530
|
+
case 0:
|
|
27531
|
+
event = {
|
|
27532
|
+
t: StorefrontEventType.PRODUCT_VIEW,
|
|
27533
|
+
ts: Date.now(),
|
|
27534
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27535
|
+
pr: {
|
|
27536
|
+
id: productDetail.product.id,
|
|
27537
|
+
vid: productDetail.selectedVariant.id,
|
|
27538
|
+
},
|
|
27539
|
+
} }),
|
|
27540
|
+
};
|
|
27541
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27542
|
+
case 1:
|
|
27543
|
+
_a.sent();
|
|
27544
|
+
return [2 /*return*/];
|
|
27545
|
+
}
|
|
27546
|
+
});
|
|
27547
|
+
});
|
|
27548
|
+
};
|
|
27549
|
+
IkasAnalytics.addToCart = function (item, quantity, cart) {
|
|
27550
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27551
|
+
var event;
|
|
27552
|
+
return __generator(this, function (_a) {
|
|
27553
|
+
switch (_a.label) {
|
|
27554
|
+
case 0:
|
|
27555
|
+
event = {
|
|
27556
|
+
t: StorefrontEventType.ADD_TO_CART,
|
|
27557
|
+
ts: Date.now(),
|
|
27558
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27559
|
+
crt: {
|
|
27560
|
+
id: cart.id,
|
|
27561
|
+
c: cart.itemCount,
|
|
27562
|
+
},
|
|
27563
|
+
crtItm: {
|
|
27564
|
+
id: item.id,
|
|
27565
|
+
c: quantity,
|
|
27566
|
+
},
|
|
27567
|
+
} }),
|
|
27568
|
+
};
|
|
27569
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27570
|
+
case 1:
|
|
27571
|
+
_a.sent();
|
|
27572
|
+
return [2 /*return*/];
|
|
27573
|
+
}
|
|
27574
|
+
});
|
|
27575
|
+
});
|
|
27576
|
+
};
|
|
27577
|
+
IkasAnalytics.viewCart = function (cart) {
|
|
27578
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27579
|
+
var event;
|
|
27580
|
+
return __generator(this, function (_a) {
|
|
27581
|
+
switch (_a.label) {
|
|
27582
|
+
case 0:
|
|
27583
|
+
event = {
|
|
27584
|
+
t: StorefrontEventType.VIEW_CART,
|
|
27585
|
+
ts: Date.now(),
|
|
27586
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27587
|
+
crt: {
|
|
27588
|
+
id: cart.id,
|
|
27589
|
+
c: cart.itemCount,
|
|
27590
|
+
},
|
|
27591
|
+
} }),
|
|
27592
|
+
};
|
|
27593
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27594
|
+
case 1:
|
|
27595
|
+
_a.sent();
|
|
27596
|
+
return [2 /*return*/];
|
|
27597
|
+
}
|
|
27598
|
+
});
|
|
27599
|
+
});
|
|
27600
|
+
};
|
|
27601
|
+
IkasAnalytics.orderSuccess = function (checkout) {
|
|
27602
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27603
|
+
var event;
|
|
27604
|
+
return __generator(this, function (_a) {
|
|
27605
|
+
switch (_a.label) {
|
|
27606
|
+
case 0:
|
|
27607
|
+
event = {
|
|
27608
|
+
t: StorefrontEventType.ORDER_SUCCESS,
|
|
27609
|
+
ts: Date.now(),
|
|
27610
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27611
|
+
chk: {
|
|
27612
|
+
id: checkout.id,
|
|
27613
|
+
s: "success",
|
|
27614
|
+
},
|
|
27615
|
+
} }),
|
|
27616
|
+
};
|
|
27617
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27618
|
+
case 1:
|
|
27619
|
+
_a.sent();
|
|
27620
|
+
return [2 /*return*/];
|
|
27621
|
+
}
|
|
27622
|
+
});
|
|
27623
|
+
});
|
|
27624
|
+
};
|
|
27625
|
+
IkasAnalytics.beginCheckout = function (checkout) {
|
|
27626
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27627
|
+
var event;
|
|
27628
|
+
return __generator(this, function (_a) {
|
|
27629
|
+
switch (_a.label) {
|
|
27630
|
+
case 0:
|
|
27631
|
+
event = {
|
|
27632
|
+
t: StorefrontEventType.BEGIN_CHECKOUT,
|
|
27633
|
+
ts: Date.now(),
|
|
27634
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27635
|
+
chk: {
|
|
27636
|
+
id: checkout.id,
|
|
27637
|
+
},
|
|
27638
|
+
} }),
|
|
27639
|
+
};
|
|
27640
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27641
|
+
case 1:
|
|
27642
|
+
_a.sent();
|
|
27643
|
+
return [2 /*return*/];
|
|
27644
|
+
}
|
|
27645
|
+
});
|
|
27646
|
+
});
|
|
27647
|
+
};
|
|
27648
|
+
IkasAnalytics.checkoutStep = function (checkout, step) {
|
|
27649
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27650
|
+
var event;
|
|
27651
|
+
return __generator(this, function (_a) {
|
|
27652
|
+
switch (_a.label) {
|
|
27653
|
+
case 0:
|
|
27654
|
+
event = {
|
|
27655
|
+
t: StorefrontEventType.CHECKOUT_STEP,
|
|
27656
|
+
ts: Date.now(),
|
|
27657
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27658
|
+
chk: {
|
|
27659
|
+
id: checkout.id,
|
|
27660
|
+
s: step,
|
|
27661
|
+
},
|
|
27662
|
+
} }),
|
|
27663
|
+
};
|
|
27664
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27665
|
+
case 1:
|
|
27666
|
+
_a.sent();
|
|
27667
|
+
return [2 /*return*/];
|
|
27668
|
+
}
|
|
27669
|
+
});
|
|
27670
|
+
});
|
|
27671
|
+
};
|
|
27672
|
+
IkasAnalytics.customerRegister = function () {
|
|
27673
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27674
|
+
var event;
|
|
27675
|
+
return __generator(this, function (_a) {
|
|
27676
|
+
switch (_a.label) {
|
|
27677
|
+
case 0:
|
|
27678
|
+
event = {
|
|
27679
|
+
t: StorefrontEventType.CUSTOMER_REGISTER,
|
|
27680
|
+
ts: Date.now(),
|
|
27681
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27682
|
+
cst: this.getCustomerData(),
|
|
27683
|
+
} }),
|
|
27684
|
+
};
|
|
27685
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27686
|
+
case 1:
|
|
27687
|
+
_a.sent();
|
|
27688
|
+
return [2 /*return*/];
|
|
27689
|
+
}
|
|
27690
|
+
});
|
|
27691
|
+
});
|
|
27692
|
+
};
|
|
27693
|
+
IkasAnalytics.customerLogin = function () {
|
|
27694
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27695
|
+
var event;
|
|
27696
|
+
return __generator(this, function (_a) {
|
|
27697
|
+
switch (_a.label) {
|
|
27698
|
+
case 0:
|
|
27699
|
+
event = {
|
|
27700
|
+
t: StorefrontEventType.CUSTOMER_LOGIN,
|
|
27701
|
+
ts: Date.now(),
|
|
27702
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27703
|
+
cst: this.getCustomerData(),
|
|
27704
|
+
} }),
|
|
27705
|
+
};
|
|
27706
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27707
|
+
case 1:
|
|
27708
|
+
_a.sent();
|
|
27709
|
+
return [2 /*return*/];
|
|
27710
|
+
}
|
|
27711
|
+
});
|
|
27712
|
+
});
|
|
27713
|
+
};
|
|
27714
|
+
IkasAnalytics.customerVisit = function () {
|
|
27715
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27716
|
+
var event;
|
|
27717
|
+
return __generator(this, function (_a) {
|
|
27718
|
+
switch (_a.label) {
|
|
27719
|
+
case 0:
|
|
27720
|
+
event = {
|
|
27721
|
+
t: StorefrontEventType.CUSTOMER_VISIT,
|
|
27722
|
+
ts: Date.now(),
|
|
27723
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27724
|
+
cst: this.getCustomerData(),
|
|
27725
|
+
} }),
|
|
27726
|
+
};
|
|
27727
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27728
|
+
case 1:
|
|
27729
|
+
_a.sent();
|
|
27730
|
+
return [2 /*return*/];
|
|
27731
|
+
}
|
|
27732
|
+
});
|
|
27733
|
+
});
|
|
27734
|
+
};
|
|
27735
|
+
IkasAnalytics.viewBrand = function (brand) {
|
|
27736
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27737
|
+
var event;
|
|
27738
|
+
return __generator(this, function (_a) {
|
|
27739
|
+
switch (_a.label) {
|
|
27740
|
+
case 0:
|
|
27741
|
+
event = {
|
|
27742
|
+
t: StorefrontEventType.BRAND_VIEW,
|
|
27743
|
+
ts: Date.now(),
|
|
27744
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27745
|
+
cst: this.getCustomerData(),
|
|
27746
|
+
br: {
|
|
27747
|
+
id: brand.id,
|
|
27748
|
+
},
|
|
27749
|
+
} }),
|
|
27750
|
+
};
|
|
27751
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27752
|
+
case 1:
|
|
27753
|
+
_a.sent();
|
|
27754
|
+
return [2 /*return*/];
|
|
27755
|
+
}
|
|
27756
|
+
});
|
|
27757
|
+
});
|
|
27758
|
+
};
|
|
27759
|
+
IkasAnalytics.viewCategory = function (category) {
|
|
27760
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27761
|
+
var event;
|
|
27762
|
+
return __generator(this, function (_a) {
|
|
27763
|
+
switch (_a.label) {
|
|
27764
|
+
case 0:
|
|
27765
|
+
event = {
|
|
27766
|
+
t: StorefrontEventType.CATEGORY_VIEW,
|
|
27767
|
+
ts: Date.now(),
|
|
27768
|
+
d: __assign(__assign({}, this.getCommonEventData()), { d: {
|
|
27769
|
+
cst: this.getCustomerData(),
|
|
27770
|
+
ctg: {
|
|
27771
|
+
id: category.id,
|
|
27772
|
+
},
|
|
27773
|
+
} }),
|
|
27774
|
+
};
|
|
27775
|
+
return [4 /*yield*/, this.sendEvents([event])];
|
|
27776
|
+
case 1:
|
|
27777
|
+
_a.sent();
|
|
27778
|
+
return [2 /*return*/];
|
|
27779
|
+
}
|
|
27780
|
+
});
|
|
27781
|
+
});
|
|
27782
|
+
};
|
|
27783
|
+
IkasAnalytics.SESSION_ID_KEY = "ikas_session_id";
|
|
27784
|
+
IkasAnalytics.VISITOR_ID_KEY = "ikas_visitor_id";
|
|
27785
|
+
IkasAnalytics.EXPIRY_LENGTH = 1000 * 60 * 30; // ms - 30mins
|
|
27786
|
+
return IkasAnalytics;
|
|
27787
|
+
}());
|
|
27788
|
+
|
|
27229
27789
|
var LS_BEGIN_CHECKOUT_KEY = "gtmBeginCheckout";
|
|
27230
27790
|
var Analytics = /** @class */ (function () {
|
|
27231
27791
|
function Analytics() {
|
|
@@ -27262,6 +27822,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27262
27822
|
case 1:
|
|
27263
27823
|
customerInfo_1 = _a.sent();
|
|
27264
27824
|
GoogleTagManager.pageView(url_1);
|
|
27825
|
+
IkasAnalytics.pageView(pageType);
|
|
27265
27826
|
tryForEach(Analytics.subscribers, function (s) {
|
|
27266
27827
|
s.callback({
|
|
27267
27828
|
type: IkasEventType.PAGE_VIEW,
|
|
@@ -27286,6 +27847,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27286
27847
|
try {
|
|
27287
27848
|
FacebookPixel.productView(productDetail);
|
|
27288
27849
|
GoogleTagManager.productView(productDetail);
|
|
27850
|
+
IkasAnalytics.productView(productDetail);
|
|
27289
27851
|
if (Analytics.subscribers.length) {
|
|
27290
27852
|
var clone = cloneDeep_1(productDetail);
|
|
27291
27853
|
var cloneProductDetail_1 = new IkasProductDetail(clone.product, clone.selectedVariantValues);
|
|
@@ -27307,6 +27869,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27307
27869
|
try {
|
|
27308
27870
|
FacebookPixel.addToCart(item, quantity, eventId);
|
|
27309
27871
|
GoogleTagManager.addToCart(item, quantity);
|
|
27872
|
+
IkasAnalytics.addToCart(item, quantity, cart);
|
|
27310
27873
|
if (Analytics.subscribers.length) {
|
|
27311
27874
|
var cloneItem_1 = cloneDeep_1(item);
|
|
27312
27875
|
var cloneCart_1 = new IkasCart(cloneDeep_1(cart));
|
|
@@ -27356,6 +27919,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27356
27919
|
localStorage.setItem(LS_BEGIN_CHECKOUT_KEY, checkout.id);
|
|
27357
27920
|
FacebookPixel.beginCheckout(checkout);
|
|
27358
27921
|
GoogleTagManager.beginCheckout(checkout);
|
|
27922
|
+
IkasAnalytics.beginCheckout(checkout);
|
|
27359
27923
|
if (Analytics.subscribers.length) {
|
|
27360
27924
|
var cloneCheckout_1 = new IkasCheckout(cloneDeep_1(checkout));
|
|
27361
27925
|
tryForEach(Analytics.subscribers, function (s) {
|
|
@@ -27377,6 +27941,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27377
27941
|
localStorage.removeItem(LS_BEGIN_CHECKOUT_KEY);
|
|
27378
27942
|
FacebookPixel.purchase(checkout, transaction.id || "");
|
|
27379
27943
|
GoogleTagManager.purchase(checkout, transaction.id || "");
|
|
27944
|
+
IkasAnalytics.orderSuccess(checkout);
|
|
27380
27945
|
if (Analytics.subscribers.length) {
|
|
27381
27946
|
var cloneCheckout_2 = new IkasCheckout(cloneDeep_1(checkout));
|
|
27382
27947
|
var cloneTransaction_1 = cloneDeep_1(transaction);
|
|
@@ -27398,6 +27963,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27398
27963
|
Analytics.checkoutStep = function (checkout, step) {
|
|
27399
27964
|
try {
|
|
27400
27965
|
GoogleTagManager.checkoutStep(checkout, step);
|
|
27966
|
+
IkasAnalytics.checkoutStep(checkout, step);
|
|
27401
27967
|
if (Analytics.subscribers.length) {
|
|
27402
27968
|
var cloneCheckout_3 = new IkasCheckout(cloneDeep_1(checkout));
|
|
27403
27969
|
tryForEach(Analytics.subscribers, function (s) {
|
|
@@ -27460,10 +28026,11 @@ var Analytics = /** @class */ (function () {
|
|
|
27460
28026
|
console.error(err);
|
|
27461
28027
|
}
|
|
27462
28028
|
};
|
|
27463
|
-
Analytics.completeRegistration = function (email) {
|
|
28029
|
+
Analytics.completeRegistration = function (email, customerId) {
|
|
27464
28030
|
try {
|
|
27465
28031
|
FacebookPixel.completeRegistration();
|
|
27466
28032
|
GoogleTagManager.completeRegistration();
|
|
28033
|
+
IkasAnalytics.customerRegister();
|
|
27467
28034
|
if (Analytics.subscribers.length) {
|
|
27468
28035
|
tryForEach(Analytics.subscribers, function (s) {
|
|
27469
28036
|
s.callback({
|
|
@@ -27492,6 +28059,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27492
28059
|
if (!customerInfo_2 || !customerInfo_2.email)
|
|
27493
28060
|
return [2 /*return*/];
|
|
27494
28061
|
GoogleTagManager.customerLogin(customerInfo_2.email);
|
|
28062
|
+
IkasAnalytics.customerLogin();
|
|
27495
28063
|
if (Analytics.subscribers.length) {
|
|
27496
28064
|
tryForEach(Analytics.subscribers, function (s) {
|
|
27497
28065
|
s.callback({
|
|
@@ -27545,6 +28113,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27545
28113
|
if (!customerInfo_3 || !customerInfo_3.email)
|
|
27546
28114
|
return [2 /*return*/];
|
|
27547
28115
|
GoogleTagManager.customerVisit(customerInfo_3.email);
|
|
28116
|
+
IkasAnalytics.customerVisit();
|
|
27548
28117
|
if (Analytics.subscribers.length) {
|
|
27549
28118
|
tryForEach(Analytics.subscribers, function (s) {
|
|
27550
28119
|
s.callback({
|
|
@@ -27569,6 +28138,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27569
28138
|
try {
|
|
27570
28139
|
if (cart) {
|
|
27571
28140
|
FacebookPixel.viewCart(cart);
|
|
28141
|
+
IkasAnalytics.viewCart(cart);
|
|
27572
28142
|
if (Analytics.subscribers.length) {
|
|
27573
28143
|
var cloneCart_3 = new IkasCart(cloneDeep_1(cart));
|
|
27574
28144
|
tryForEach(Analytics.subscribers, function (s) {
|
|
@@ -27590,6 +28160,7 @@ var Analytics = /** @class */ (function () {
|
|
|
27590
28160
|
try {
|
|
27591
28161
|
FacebookPixel.viewCategory(categoryPath);
|
|
27592
28162
|
GoogleTagManager.viewCategory(category, categoryPath);
|
|
28163
|
+
IkasAnalytics.viewCategory(category);
|
|
27593
28164
|
if (Analytics.subscribers.length) {
|
|
27594
28165
|
var cloneCategory_1 = new IkasCategory(cloneDeep_1(category));
|
|
27595
28166
|
tryForEach(Analytics.subscribers, function (s) {
|
|
@@ -27607,6 +28178,25 @@ var Analytics = /** @class */ (function () {
|
|
|
27607
28178
|
console.error(err);
|
|
27608
28179
|
}
|
|
27609
28180
|
};
|
|
28181
|
+
Analytics.viewBrand = function (brand) {
|
|
28182
|
+
try {
|
|
28183
|
+
IkasAnalytics.viewBrand(brand);
|
|
28184
|
+
if (Analytics.subscribers.length) {
|
|
28185
|
+
var cloneBrand_1 = new IkasBrand(cloneDeep_1(brand));
|
|
28186
|
+
tryForEach(Analytics.subscribers, function (s) {
|
|
28187
|
+
s.callback({
|
|
28188
|
+
type: IkasEventType.VIEW_BRAND,
|
|
28189
|
+
data: {
|
|
28190
|
+
brand: cloneBrand_1,
|
|
28191
|
+
},
|
|
28192
|
+
});
|
|
28193
|
+
});
|
|
28194
|
+
}
|
|
28195
|
+
}
|
|
28196
|
+
catch (err) {
|
|
28197
|
+
console.error(err);
|
|
28198
|
+
}
|
|
28199
|
+
};
|
|
27610
28200
|
Analytics.viewSearchResults = function (searchKeyword, productDetails) {
|
|
27611
28201
|
try {
|
|
27612
28202
|
if (Analytics.subscribers.length) {
|
|
@@ -35789,7 +36379,7 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
35789
36379
|
});
|
|
35790
36380
|
Object.defineProperty(IkasProductDetail.prototype, "hasStock", {
|
|
35791
36381
|
get: function () {
|
|
35792
|
-
return this.product.
|
|
36382
|
+
return this.product.hasStock;
|
|
35793
36383
|
},
|
|
35794
36384
|
enumerable: false,
|
|
35795
36385
|
configurable: true
|
|
@@ -35835,6 +36425,42 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
35835
36425
|
enumerable: false,
|
|
35836
36426
|
configurable: true
|
|
35837
36427
|
});
|
|
36428
|
+
Object.defineProperty(IkasProductDetail.prototype, "isCustomerReviewEnabled", {
|
|
36429
|
+
get: function () {
|
|
36430
|
+
return (!!IkasStorefrontConfig.customerReviewSettings &&
|
|
36431
|
+
!IkasStorefrontConfig.customerReviewSettings.customerPurchaseRequired);
|
|
36432
|
+
},
|
|
36433
|
+
enumerable: false,
|
|
36434
|
+
configurable: true
|
|
36435
|
+
});
|
|
36436
|
+
Object.defineProperty(IkasProductDetail.prototype, "isCustomerReviewLoginRequired", {
|
|
36437
|
+
get: function () {
|
|
36438
|
+
if (!IkasStorefrontConfig.customerReviewSettings)
|
|
36439
|
+
return true;
|
|
36440
|
+
return IkasStorefrontConfig.customerReviewSettings.customerLoginRequired;
|
|
36441
|
+
},
|
|
36442
|
+
enumerable: false,
|
|
36443
|
+
configurable: true
|
|
36444
|
+
});
|
|
36445
|
+
IkasProductDetail.prototype.getCustomerReviews = function () {
|
|
36446
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
36447
|
+
var customerReviews;
|
|
36448
|
+
return __generator(this, function (_a) {
|
|
36449
|
+
switch (_a.label) {
|
|
36450
|
+
case 0:
|
|
36451
|
+
customerReviews = new IkasCustomerReviewList({
|
|
36452
|
+
productId: this.product.id,
|
|
36453
|
+
});
|
|
36454
|
+
//@ts-ignore
|
|
36455
|
+
return [4 /*yield*/, customerReviews.getInitial()];
|
|
36456
|
+
case 1:
|
|
36457
|
+
//@ts-ignore
|
|
36458
|
+
_a.sent();
|
|
36459
|
+
return [2 /*return*/, customerReviews];
|
|
36460
|
+
}
|
|
36461
|
+
});
|
|
36462
|
+
});
|
|
36463
|
+
};
|
|
35838
36464
|
IkasProductDetail.prototype.selectVariantValue = function (variantValue) {
|
|
35839
36465
|
var _this = this;
|
|
35840
36466
|
var _a;
|
|
@@ -36927,6 +37553,23 @@ var ProductFilterTypeEnum;
|
|
|
36927
37553
|
ProductFilterTypeEnum["TAG"] = "TAG";
|
|
36928
37554
|
ProductFilterTypeEnum["VARIANT_TYPE"] = "VARIANT_TYPE";
|
|
36929
37555
|
})(ProductFilterTypeEnum || (ProductFilterTypeEnum = {}));
|
|
37556
|
+
var ProductOptionSelectTypeEnum;
|
|
37557
|
+
(function (ProductOptionSelectTypeEnum) {
|
|
37558
|
+
ProductOptionSelectTypeEnum["BOX"] = "BOX";
|
|
37559
|
+
ProductOptionSelectTypeEnum["SELECT"] = "SELECT";
|
|
37560
|
+
ProductOptionSelectTypeEnum["SWATCH"] = "SWATCH";
|
|
37561
|
+
})(ProductOptionSelectTypeEnum || (ProductOptionSelectTypeEnum = {}));
|
|
37562
|
+
var ProductOptionTypeEnum;
|
|
37563
|
+
(function (ProductOptionTypeEnum) {
|
|
37564
|
+
ProductOptionTypeEnum["CHECKBOX"] = "CHECKBOX";
|
|
37565
|
+
ProductOptionTypeEnum["CHOICE"] = "CHOICE";
|
|
37566
|
+
ProductOptionTypeEnum["COLOR_PICKER"] = "COLOR_PICKER";
|
|
37567
|
+
ProductOptionTypeEnum["DATE_PICKER"] = "DATE_PICKER";
|
|
37568
|
+
ProductOptionTypeEnum["FILE"] = "FILE";
|
|
37569
|
+
ProductOptionTypeEnum["IMAGE"] = "IMAGE";
|
|
37570
|
+
ProductOptionTypeEnum["TEXT"] = "TEXT";
|
|
37571
|
+
ProductOptionTypeEnum["TEXT_AREA"] = "TEXT_AREA";
|
|
37572
|
+
})(ProductOptionTypeEnum || (ProductOptionTypeEnum = {}));
|
|
36930
37573
|
var ProductSearchShowStockOptionEnum;
|
|
36931
37574
|
(function (ProductSearchShowStockOptionEnum) {
|
|
36932
37575
|
ProductSearchShowStockOptionEnum["HIDE_OUT_OF_STOCK"] = "HIDE_OUT_OF_STOCK";
|
|
@@ -38072,6 +38715,230 @@ var IkasAttributeList = /** @class */ (function () {
|
|
|
38072
38715
|
return IkasAttributeList;
|
|
38073
38716
|
}());
|
|
38074
38717
|
|
|
38718
|
+
var IkasCustomerReviewList = /** @class */ (function () {
|
|
38719
|
+
function IkasCustomerReviewList(data) {
|
|
38720
|
+
var _this = this;
|
|
38721
|
+
this._initialized = false;
|
|
38722
|
+
this._minPage = null;
|
|
38723
|
+
this._isLoading = false;
|
|
38724
|
+
// Used by the provider
|
|
38725
|
+
this.getInitial = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
38726
|
+
var response, err_1;
|
|
38727
|
+
return __generator(this, function (_a) {
|
|
38728
|
+
switch (_a.label) {
|
|
38729
|
+
case 0:
|
|
38730
|
+
if (this._isLoading)
|
|
38731
|
+
return [2 /*return*/];
|
|
38732
|
+
this._isLoading = true;
|
|
38733
|
+
_a.label = 1;
|
|
38734
|
+
case 1:
|
|
38735
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
38736
|
+
return [4 /*yield*/, this.listCustomerReviews(this.page, this.limit)];
|
|
38737
|
+
case 2:
|
|
38738
|
+
response = _a.sent();
|
|
38739
|
+
this.data = response.data;
|
|
38740
|
+
this._count = response.count;
|
|
38741
|
+
this._initialized = true;
|
|
38742
|
+
this._minPage = this.page;
|
|
38743
|
+
return [3 /*break*/, 5];
|
|
38744
|
+
case 3:
|
|
38745
|
+
err_1 = _a.sent();
|
|
38746
|
+
console.log(err_1);
|
|
38747
|
+
return [3 /*break*/, 5];
|
|
38748
|
+
case 4:
|
|
38749
|
+
this._isLoading = false;
|
|
38750
|
+
return [7 /*endfinally*/];
|
|
38751
|
+
case 5: return [2 /*return*/];
|
|
38752
|
+
}
|
|
38753
|
+
});
|
|
38754
|
+
}); };
|
|
38755
|
+
this.getPrev = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
38756
|
+
var minPage, response, err_2;
|
|
38757
|
+
return __generator(this, function (_a) {
|
|
38758
|
+
switch (_a.label) {
|
|
38759
|
+
case 0:
|
|
38760
|
+
if (this._isLoading || !this.hasPrev)
|
|
38761
|
+
return [2 /*return*/];
|
|
38762
|
+
this._isLoading = true;
|
|
38763
|
+
_a.label = 1;
|
|
38764
|
+
case 1:
|
|
38765
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
38766
|
+
minPage = this._minPage - 1;
|
|
38767
|
+
return [4 /*yield*/, this.listCustomerReviews(minPage, this.limit)];
|
|
38768
|
+
case 2:
|
|
38769
|
+
response = _a.sent();
|
|
38770
|
+
this.data = response.data.concat(this.data);
|
|
38771
|
+
this._count = response.count;
|
|
38772
|
+
this._minPage = minPage;
|
|
38773
|
+
return [3 /*break*/, 5];
|
|
38774
|
+
case 3:
|
|
38775
|
+
err_2 = _a.sent();
|
|
38776
|
+
console.log(err_2);
|
|
38777
|
+
return [3 /*break*/, 5];
|
|
38778
|
+
case 4:
|
|
38779
|
+
this._isLoading = false;
|
|
38780
|
+
return [7 /*endfinally*/];
|
|
38781
|
+
case 5: return [2 /*return*/];
|
|
38782
|
+
}
|
|
38783
|
+
});
|
|
38784
|
+
}); };
|
|
38785
|
+
this.getNext = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
38786
|
+
var response, err_3;
|
|
38787
|
+
return __generator(this, function (_a) {
|
|
38788
|
+
switch (_a.label) {
|
|
38789
|
+
case 0:
|
|
38790
|
+
if (this._isLoading || !this.hasNext)
|
|
38791
|
+
return [2 /*return*/];
|
|
38792
|
+
this._isLoading = true;
|
|
38793
|
+
_a.label = 1;
|
|
38794
|
+
case 1:
|
|
38795
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
38796
|
+
return [4 /*yield*/, this.listCustomerReviews(this.page + 1, this.limit)];
|
|
38797
|
+
case 2:
|
|
38798
|
+
response = _a.sent();
|
|
38799
|
+
this.data = this.data.concat(response.data);
|
|
38800
|
+
this._count = response.count;
|
|
38801
|
+
this._page = this.page + 1;
|
|
38802
|
+
return [3 /*break*/, 5];
|
|
38803
|
+
case 3:
|
|
38804
|
+
err_3 = _a.sent();
|
|
38805
|
+
console.log(err_3);
|
|
38806
|
+
return [3 /*break*/, 5];
|
|
38807
|
+
case 4:
|
|
38808
|
+
this._isLoading = false;
|
|
38809
|
+
return [7 /*endfinally*/];
|
|
38810
|
+
case 5: return [2 /*return*/];
|
|
38811
|
+
}
|
|
38812
|
+
});
|
|
38813
|
+
}); };
|
|
38814
|
+
this.getPage = function (page) { return __awaiter(_this, void 0, void 0, function () {
|
|
38815
|
+
var response, err_4;
|
|
38816
|
+
return __generator(this, function (_a) {
|
|
38817
|
+
switch (_a.label) {
|
|
38818
|
+
case 0:
|
|
38819
|
+
if (this._isLoading)
|
|
38820
|
+
return [2 /*return*/];
|
|
38821
|
+
this._isLoading = true;
|
|
38822
|
+
_a.label = 1;
|
|
38823
|
+
case 1:
|
|
38824
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
38825
|
+
return [4 /*yield*/, this.listCustomerReviews(page, this.limit)];
|
|
38826
|
+
case 2:
|
|
38827
|
+
response = _a.sent();
|
|
38828
|
+
this.data = response.data;
|
|
38829
|
+
this._count = response.count;
|
|
38830
|
+
this._page = page;
|
|
38831
|
+
this._minPage = page;
|
|
38832
|
+
return [3 /*break*/, 5];
|
|
38833
|
+
case 3:
|
|
38834
|
+
err_4 = _a.sent();
|
|
38835
|
+
console.log(err_4);
|
|
38836
|
+
return [3 /*break*/, 5];
|
|
38837
|
+
case 4:
|
|
38838
|
+
this._isLoading = false;
|
|
38839
|
+
return [7 /*endfinally*/];
|
|
38840
|
+
case 5: return [2 /*return*/];
|
|
38841
|
+
}
|
|
38842
|
+
});
|
|
38843
|
+
}); };
|
|
38844
|
+
this.data = data.data
|
|
38845
|
+
? data.data.map(function (b) { return new IkasCustomerReview(b); })
|
|
38846
|
+
: [];
|
|
38847
|
+
this._limit = data.limit || 5;
|
|
38848
|
+
this._page = data.page || 1;
|
|
38849
|
+
this._count = data.count || 0;
|
|
38850
|
+
this._initialized = data.initialized || false;
|
|
38851
|
+
this._minPage = data.minPage;
|
|
38852
|
+
this._productId = data.productId;
|
|
38853
|
+
makeAutoObservable(this);
|
|
38854
|
+
}
|
|
38855
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "limit", {
|
|
38856
|
+
get: function () {
|
|
38857
|
+
return this._limit;
|
|
38858
|
+
},
|
|
38859
|
+
enumerable: false,
|
|
38860
|
+
configurable: true
|
|
38861
|
+
});
|
|
38862
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "page", {
|
|
38863
|
+
get: function () {
|
|
38864
|
+
return this._page;
|
|
38865
|
+
},
|
|
38866
|
+
enumerable: false,
|
|
38867
|
+
configurable: true
|
|
38868
|
+
});
|
|
38869
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "count", {
|
|
38870
|
+
get: function () {
|
|
38871
|
+
return this._count;
|
|
38872
|
+
},
|
|
38873
|
+
enumerable: false,
|
|
38874
|
+
configurable: true
|
|
38875
|
+
});
|
|
38876
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "pageCount", {
|
|
38877
|
+
get: function () {
|
|
38878
|
+
return Math.ceil(this._count / this._limit);
|
|
38879
|
+
},
|
|
38880
|
+
enumerable: false,
|
|
38881
|
+
configurable: true
|
|
38882
|
+
});
|
|
38883
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "isInitialized", {
|
|
38884
|
+
get: function () {
|
|
38885
|
+
return this._initialized;
|
|
38886
|
+
},
|
|
38887
|
+
enumerable: false,
|
|
38888
|
+
configurable: true
|
|
38889
|
+
});
|
|
38890
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "hasPrev", {
|
|
38891
|
+
get: function () {
|
|
38892
|
+
if (!this._minPage)
|
|
38893
|
+
return false;
|
|
38894
|
+
return this._minPage > 1;
|
|
38895
|
+
},
|
|
38896
|
+
enumerable: false,
|
|
38897
|
+
configurable: true
|
|
38898
|
+
});
|
|
38899
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "hasNext", {
|
|
38900
|
+
get: function () {
|
|
38901
|
+
return this.page * this.limit < this.count;
|
|
38902
|
+
},
|
|
38903
|
+
enumerable: false,
|
|
38904
|
+
configurable: true
|
|
38905
|
+
});
|
|
38906
|
+
Object.defineProperty(IkasCustomerReviewList.prototype, "isLoading", {
|
|
38907
|
+
get: function () {
|
|
38908
|
+
return this._isLoading;
|
|
38909
|
+
},
|
|
38910
|
+
enumerable: false,
|
|
38911
|
+
configurable: true
|
|
38912
|
+
});
|
|
38913
|
+
IkasCustomerReviewList.prototype.listCustomerReviews = function (page, limit) {
|
|
38914
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
38915
|
+
return __generator(this, function (_a) {
|
|
38916
|
+
switch (_a.label) {
|
|
38917
|
+
case 0: return [4 /*yield*/, IkasCustomerReviewAPI.listCustomerReviews({
|
|
38918
|
+
productId: this._productId,
|
|
38919
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId || "",
|
|
38920
|
+
page: page,
|
|
38921
|
+
limit: limit,
|
|
38922
|
+
})];
|
|
38923
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
38924
|
+
}
|
|
38925
|
+
});
|
|
38926
|
+
});
|
|
38927
|
+
};
|
|
38928
|
+
IkasCustomerReviewList.prototype.toJSON = function () {
|
|
38929
|
+
return {
|
|
38930
|
+
data: this.data,
|
|
38931
|
+
limit: this._limit,
|
|
38932
|
+
page: this._page,
|
|
38933
|
+
count: this._count,
|
|
38934
|
+
initialized: this._initialized,
|
|
38935
|
+
minPage: this._minPage,
|
|
38936
|
+
productId: this._productId,
|
|
38937
|
+
};
|
|
38938
|
+
};
|
|
38939
|
+
return IkasCustomerReviewList;
|
|
38940
|
+
}());
|
|
38941
|
+
|
|
38075
38942
|
var Validator = /** @class */ (function () {
|
|
38076
38943
|
function Validator(model, rules) {
|
|
38077
38944
|
var _this = this;
|
|
@@ -39236,32 +40103,33 @@ var RegisterForm = /** @class */ (function () {
|
|
|
39236
40103
|
return this.validator.validateAll();
|
|
39237
40104
|
};
|
|
39238
40105
|
RegisterForm.prototype.register = function () {
|
|
40106
|
+
var _a;
|
|
39239
40107
|
return __awaiter(this, void 0, void 0, function () {
|
|
39240
40108
|
var response, hasFormError, isRegisterSuccess;
|
|
39241
|
-
return __generator(this, function (
|
|
39242
|
-
switch (
|
|
40109
|
+
return __generator(this, function (_c) {
|
|
40110
|
+
switch (_c.label) {
|
|
39243
40111
|
case 0:
|
|
39244
40112
|
response = { isFormError: false, isSuccess: false };
|
|
39245
40113
|
return [4 /*yield*/, this.validateAll()];
|
|
39246
40114
|
case 1:
|
|
39247
|
-
hasFormError =
|
|
40115
|
+
hasFormError = _c.sent();
|
|
39248
40116
|
if (hasFormError) {
|
|
39249
40117
|
response.isFormError = true;
|
|
39250
40118
|
return [2 /*return*/, response];
|
|
39251
40119
|
}
|
|
39252
|
-
|
|
40120
|
+
_c.label = 2;
|
|
39253
40121
|
case 2:
|
|
39254
|
-
|
|
40122
|
+
_c.trys.push([2, 4, , 5]);
|
|
39255
40123
|
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password, this.model.isMarketingAccepted)];
|
|
39256
40124
|
case 3:
|
|
39257
|
-
isRegisterSuccess =
|
|
40125
|
+
isRegisterSuccess = _c.sent();
|
|
39258
40126
|
if (isRegisterSuccess) {
|
|
39259
40127
|
response.isSuccess = true;
|
|
39260
|
-
Analytics.completeRegistration(this.model.email);
|
|
40128
|
+
Analytics.completeRegistration(this.model.email, (_a = this.store.customerStore.customer) === null || _a === void 0 ? void 0 : _a.id);
|
|
39261
40129
|
}
|
|
39262
40130
|
return [2 /*return*/, response];
|
|
39263
40131
|
case 4:
|
|
39264
|
-
|
|
40132
|
+
_c.sent();
|
|
39265
40133
|
return [2 /*return*/, response];
|
|
39266
40134
|
case 5: return [2 /*return*/];
|
|
39267
40135
|
}
|
|
@@ -39876,6 +40744,139 @@ var AccountInfoForm = /** @class */ (function () {
|
|
|
39876
40744
|
return AccountInfoForm;
|
|
39877
40745
|
}());
|
|
39878
40746
|
|
|
40747
|
+
var CustomerReviewForm = /** @class */ (function () {
|
|
40748
|
+
function CustomerReviewForm(props) {
|
|
40749
|
+
var _this = this;
|
|
40750
|
+
this.model = {
|
|
40751
|
+
title: "",
|
|
40752
|
+
comment: "",
|
|
40753
|
+
star: 0,
|
|
40754
|
+
};
|
|
40755
|
+
this.onTitleChange = function (value) {
|
|
40756
|
+
_this.title = value;
|
|
40757
|
+
};
|
|
40758
|
+
this.onCommentChange = function (value) {
|
|
40759
|
+
_this.comment = value;
|
|
40760
|
+
};
|
|
40761
|
+
this.onStarChange = function (value) {
|
|
40762
|
+
_this.star = value;
|
|
40763
|
+
};
|
|
40764
|
+
makeObservable(this, {
|
|
40765
|
+
starErrorMessage: computed,
|
|
40766
|
+
hasError: computed,
|
|
40767
|
+
model: observable,
|
|
40768
|
+
validateAll: action,
|
|
40769
|
+
submit: action,
|
|
40770
|
+
});
|
|
40771
|
+
this.productId = props.productId;
|
|
40772
|
+
this.store = props.store;
|
|
40773
|
+
this.validator = new Validator(this.model, [
|
|
40774
|
+
new RequiredRule({
|
|
40775
|
+
fieldKey: "star",
|
|
40776
|
+
valuePath: "star",
|
|
40777
|
+
message: props.message.starRule,
|
|
40778
|
+
}),
|
|
40779
|
+
new MinRule({
|
|
40780
|
+
fieldKey: "star",
|
|
40781
|
+
valuePath: "star",
|
|
40782
|
+
minValue: 1,
|
|
40783
|
+
message: props.message.starRule,
|
|
40784
|
+
}),
|
|
40785
|
+
new MaxRule({
|
|
40786
|
+
fieldKey: "star",
|
|
40787
|
+
valuePath: "star",
|
|
40788
|
+
maxValue: 5,
|
|
40789
|
+
message: props.message.starRule,
|
|
40790
|
+
}),
|
|
40791
|
+
]);
|
|
40792
|
+
}
|
|
40793
|
+
Object.defineProperty(CustomerReviewForm.prototype, "title", {
|
|
40794
|
+
get: function () {
|
|
40795
|
+
return this.model.title;
|
|
40796
|
+
},
|
|
40797
|
+
set: function (value) {
|
|
40798
|
+
this.model.title = value;
|
|
40799
|
+
},
|
|
40800
|
+
enumerable: false,
|
|
40801
|
+
configurable: true
|
|
40802
|
+
});
|
|
40803
|
+
Object.defineProperty(CustomerReviewForm.prototype, "comment", {
|
|
40804
|
+
get: function () {
|
|
40805
|
+
return this.model.comment;
|
|
40806
|
+
},
|
|
40807
|
+
set: function (value) {
|
|
40808
|
+
this.model.comment = value;
|
|
40809
|
+
},
|
|
40810
|
+
enumerable: false,
|
|
40811
|
+
configurable: true
|
|
40812
|
+
});
|
|
40813
|
+
Object.defineProperty(CustomerReviewForm.prototype, "star", {
|
|
40814
|
+
get: function () {
|
|
40815
|
+
return this.model.star;
|
|
40816
|
+
},
|
|
40817
|
+
set: function (value) {
|
|
40818
|
+
this.model.star = value;
|
|
40819
|
+
},
|
|
40820
|
+
enumerable: false,
|
|
40821
|
+
configurable: true
|
|
40822
|
+
});
|
|
40823
|
+
Object.defineProperty(CustomerReviewForm.prototype, "hasError", {
|
|
40824
|
+
get: function () {
|
|
40825
|
+
return this.validator.hasError;
|
|
40826
|
+
},
|
|
40827
|
+
enumerable: false,
|
|
40828
|
+
configurable: true
|
|
40829
|
+
});
|
|
40830
|
+
Object.defineProperty(CustomerReviewForm.prototype, "starErrorMessage", {
|
|
40831
|
+
get: function () {
|
|
40832
|
+
return this.validator.results.star.errorMessage;
|
|
40833
|
+
},
|
|
40834
|
+
enumerable: false,
|
|
40835
|
+
configurable: true
|
|
40836
|
+
});
|
|
40837
|
+
CustomerReviewForm.prototype.validateAll = function () {
|
|
40838
|
+
return this.validator.validateAll();
|
|
40839
|
+
};
|
|
40840
|
+
CustomerReviewForm.prototype.submit = function () {
|
|
40841
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
40842
|
+
var response, hasFormError, isContactFormSuccess;
|
|
40843
|
+
return __generator(this, function (_b) {
|
|
40844
|
+
switch (_b.label) {
|
|
40845
|
+
case 0:
|
|
40846
|
+
response = { isFormError: false, isSuccess: false };
|
|
40847
|
+
return [4 /*yield*/, this.validateAll()];
|
|
40848
|
+
case 1:
|
|
40849
|
+
hasFormError = _b.sent();
|
|
40850
|
+
if (hasFormError) {
|
|
40851
|
+
response.isFormError = true;
|
|
40852
|
+
return [2 /*return*/, response];
|
|
40853
|
+
}
|
|
40854
|
+
_b.label = 2;
|
|
40855
|
+
case 2:
|
|
40856
|
+
_b.trys.push([2, 4, , 5]);
|
|
40857
|
+
return [4 /*yield*/, this.store.customerStore.sendReview({
|
|
40858
|
+
title: this.model.title,
|
|
40859
|
+
comment: this.model.comment,
|
|
40860
|
+
star: this.model.star,
|
|
40861
|
+
productId: this.productId,
|
|
40862
|
+
})];
|
|
40863
|
+
case 3:
|
|
40864
|
+
isContactFormSuccess = _b.sent();
|
|
40865
|
+
if (isContactFormSuccess) {
|
|
40866
|
+
response.isSuccess = true;
|
|
40867
|
+
}
|
|
40868
|
+
return [2 /*return*/, response];
|
|
40869
|
+
case 4:
|
|
40870
|
+
_b.sent();
|
|
40871
|
+
return [2 /*return*/, response];
|
|
40872
|
+
case 5: return [2 /*return*/];
|
|
40873
|
+
}
|
|
40874
|
+
});
|
|
40875
|
+
});
|
|
40876
|
+
};
|
|
40877
|
+
return CustomerReviewForm;
|
|
40878
|
+
}());
|
|
40879
|
+
|
|
39879
40880
|
var IkasComponentRenderer = /** @class */ (function () {
|
|
39880
40881
|
function IkasComponentRenderer(render) {
|
|
39881
40882
|
this.render = render;
|
|
@@ -40959,7 +41960,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
40959
41960
|
return __generator(this, function (_b) {
|
|
40960
41961
|
switch (_b.label) {
|
|
40961
41962
|
case 0:
|
|
40962
|
-
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n
|
|
41963
|
+
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
40963
41964
|
_b.label = 1;
|
|
40964
41965
|
case 1:
|
|
40965
41966
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -40973,7 +41974,6 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
40973
41974
|
firstName: firstName,
|
|
40974
41975
|
lastName: lastName,
|
|
40975
41976
|
isAcceptMarketing: isAcceptMarketing,
|
|
40976
|
-
locale: IkasStorefrontConfig.getCurrentLocale(),
|
|
40977
41977
|
},
|
|
40978
41978
|
})];
|
|
40979
41979
|
case 2:
|
|
@@ -41034,7 +42034,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41034
42034
|
return __generator(this, function (_b) {
|
|
41035
42035
|
switch (_b.label) {
|
|
41036
42036
|
case 0:
|
|
41037
|
-
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String
|
|
42037
|
+
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "], ["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "])));
|
|
41038
42038
|
_b.label = 1;
|
|
41039
42039
|
case 1:
|
|
41040
42040
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41044,7 +42044,6 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41044
42044
|
mutation: MUTATION,
|
|
41045
42045
|
variables: {
|
|
41046
42046
|
email: email,
|
|
41047
|
-
locale: IkasStorefrontConfig.getCurrentLocale(),
|
|
41048
42047
|
},
|
|
41049
42048
|
})];
|
|
41050
42049
|
case 2:
|
|
@@ -41452,6 +42451,93 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41452
42451
|
}());
|
|
41453
42452
|
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
41454
42453
|
|
|
42454
|
+
var IkasCustomerReviewAPI = /** @class */ (function () {
|
|
42455
|
+
function IkasCustomerReviewAPI() {
|
|
42456
|
+
}
|
|
42457
|
+
IkasCustomerReviewAPI.listCustomerReviews = function (params) {
|
|
42458
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42459
|
+
var LIST_CUSTOMER_REVIEWS, _a, data, errors, err_1;
|
|
42460
|
+
return __generator(this, function (_b) {
|
|
42461
|
+
switch (_b.label) {
|
|
42462
|
+
case 0:
|
|
42463
|
+
LIST_CUSTOMER_REVIEWS = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listCustomerReviews(\n $input: ListCustomerReviewInput!\n $productId: String\n $pagination: PaginationInput\n ) {\n listCustomerReviews(\n input: $input\n productId: $productId\n pagination: $pagination\n ) {\n count\n data {\n comment\n createdAt\n id\n star\n title\n }\n hasNext\n limit\n page\n }\n }\n "], ["\n query listCustomerReviews(\n $input: ListCustomerReviewInput!\n $productId: String\n $pagination: PaginationInput\n ) {\n listCustomerReviews(\n input: $input\n productId: $productId\n pagination: $pagination\n ) {\n count\n data {\n comment\n createdAt\n id\n star\n title\n }\n hasNext\n limit\n page\n }\n }\n "])));
|
|
42464
|
+
_b.label = 1;
|
|
42465
|
+
case 1:
|
|
42466
|
+
_b.trys.push([1, 3, , 4]);
|
|
42467
|
+
return [4 /*yield*/, apollo
|
|
42468
|
+
.getClient()
|
|
42469
|
+
.query({
|
|
42470
|
+
query: LIST_CUSTOMER_REVIEWS,
|
|
42471
|
+
variables: {
|
|
42472
|
+
input: {
|
|
42473
|
+
salesChannelId: params.salesChannelId,
|
|
42474
|
+
},
|
|
42475
|
+
productId: params.productId,
|
|
42476
|
+
pagination: {
|
|
42477
|
+
page: params.page,
|
|
42478
|
+
limit: params.limit,
|
|
42479
|
+
},
|
|
42480
|
+
},
|
|
42481
|
+
})];
|
|
42482
|
+
case 2:
|
|
42483
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
42484
|
+
if (errors && errors.length)
|
|
42485
|
+
return [2 /*return*/, {
|
|
42486
|
+
data: [],
|
|
42487
|
+
count: 0,
|
|
42488
|
+
}];
|
|
42489
|
+
return [2 /*return*/, {
|
|
42490
|
+
data: data.listCustomerReviews.data.map(function (fP) { return new IkasCustomerReview(fP); }),
|
|
42491
|
+
count: data.listCustomerReviews.count,
|
|
42492
|
+
}];
|
|
42493
|
+
case 3:
|
|
42494
|
+
err_1 = _b.sent();
|
|
42495
|
+
console.log(err_1);
|
|
42496
|
+
return [2 /*return*/, {
|
|
42497
|
+
data: [],
|
|
42498
|
+
count: 0,
|
|
42499
|
+
}];
|
|
42500
|
+
case 4: return [2 /*return*/];
|
|
42501
|
+
}
|
|
42502
|
+
});
|
|
42503
|
+
});
|
|
42504
|
+
};
|
|
42505
|
+
IkasCustomerReviewAPI.createCustomerReview = function (params) {
|
|
42506
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42507
|
+
var CREATE_CUSTOMER_REVIEW, _a, data, errors, err_2;
|
|
42508
|
+
return __generator(this, function (_b) {
|
|
42509
|
+
switch (_b.label) {
|
|
42510
|
+
case 0:
|
|
42511
|
+
CREATE_CUSTOMER_REVIEW = src(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n mutation createCustomerReview($input: CreateCustomerReviewInput!) {\n createCustomerReview(input: $input) {\n id\n }\n }\n "], ["\n mutation createCustomerReview($input: CreateCustomerReviewInput!) {\n createCustomerReview(input: $input) {\n id\n }\n }\n "])));
|
|
42512
|
+
_b.label = 1;
|
|
42513
|
+
case 1:
|
|
42514
|
+
_b.trys.push([1, 3, , 4]);
|
|
42515
|
+
return [4 /*yield*/, apollo
|
|
42516
|
+
.getClient()
|
|
42517
|
+
.mutate({
|
|
42518
|
+
mutation: CREATE_CUSTOMER_REVIEW,
|
|
42519
|
+
variables: {
|
|
42520
|
+
input: __assign({}, params),
|
|
42521
|
+
},
|
|
42522
|
+
})];
|
|
42523
|
+
case 2:
|
|
42524
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
42525
|
+
if (errors && errors.length)
|
|
42526
|
+
return [2 /*return*/, false];
|
|
42527
|
+
return [2 /*return*/, data === null || data === void 0 ? void 0 : data.createCustomerReview];
|
|
42528
|
+
case 3:
|
|
42529
|
+
err_2 = _b.sent();
|
|
42530
|
+
console.log(err_2);
|
|
42531
|
+
return [3 /*break*/, 4];
|
|
42532
|
+
case 4: return [2 /*return*/];
|
|
42533
|
+
}
|
|
42534
|
+
});
|
|
42535
|
+
});
|
|
42536
|
+
};
|
|
42537
|
+
return IkasCustomerReviewAPI;
|
|
42538
|
+
}());
|
|
42539
|
+
var templateObject_1$8, templateObject_2$6;
|
|
42540
|
+
|
|
41455
42541
|
var IkasDistrictAPI = /** @class */ (function () {
|
|
41456
42542
|
function IkasDistrictAPI() {
|
|
41457
42543
|
}
|
|
@@ -41461,7 +42547,7 @@ var IkasDistrictAPI = /** @class */ (function () {
|
|
|
41461
42547
|
return __generator(this, function (_b) {
|
|
41462
42548
|
switch (_b.label) {
|
|
41463
42549
|
case 0:
|
|
41464
|
-
QUERY = src(templateObject_1$
|
|
42550
|
+
QUERY = src(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n query listDistrict(\n $cityId: StringFilterInput!\n $stateId: StringFilterInput\n ) {\n listDistrict(cityId: $cityId, stateId: $stateId) {\n id\n name\n }\n }\n "], ["\n query listDistrict(\n $cityId: StringFilterInput!\n $stateId: StringFilterInput\n ) {\n listDistrict(cityId: $cityId, stateId: $stateId) {\n id\n name\n }\n }\n "])));
|
|
41465
42551
|
_b.label = 1;
|
|
41466
42552
|
case 1:
|
|
41467
42553
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41502,7 +42588,7 @@ var IkasDistrictAPI = /** @class */ (function () {
|
|
|
41502
42588
|
};
|
|
41503
42589
|
return IkasDistrictAPI;
|
|
41504
42590
|
}());
|
|
41505
|
-
var templateObject_1$
|
|
42591
|
+
var templateObject_1$9;
|
|
41506
42592
|
|
|
41507
42593
|
var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
41508
42594
|
function IkasHTMLMetaDataAPI() {
|
|
@@ -41513,7 +42599,7 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
|
41513
42599
|
return __generator(this, function (_b) {
|
|
41514
42600
|
switch (_b.label) {
|
|
41515
42601
|
case 0:
|
|
41516
|
-
LIST_QUERY = src(templateObject_1$
|
|
42602
|
+
LIST_QUERY = src(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
|
|
41517
42603
|
_b.label = 1;
|
|
41518
42604
|
case 1:
|
|
41519
42605
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41556,18 +42642,18 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
|
41556
42642
|
};
|
|
41557
42643
|
return IkasHTMLMetaDataAPI;
|
|
41558
42644
|
}());
|
|
41559
|
-
var templateObject_1$
|
|
42645
|
+
var templateObject_1$a;
|
|
41560
42646
|
|
|
41561
42647
|
var IkasMerchantAPI = /** @class */ (function () {
|
|
41562
42648
|
function IkasMerchantAPI() {
|
|
41563
42649
|
}
|
|
41564
|
-
IkasMerchantAPI.listMerchantSettings = function (
|
|
42650
|
+
IkasMerchantAPI.listMerchantSettings = function () {
|
|
41565
42651
|
return __awaiter(this, void 0, void 0, function () {
|
|
41566
42652
|
var QUERY, _a, data, errors;
|
|
41567
42653
|
return __generator(this, function (_b) {
|
|
41568
42654
|
switch (_b.label) {
|
|
41569
42655
|
case 0:
|
|
41570
|
-
QUERY = src(templateObject_1$
|
|
42656
|
+
QUERY = src(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n query listMerchantSettings {\n listMerchantSettings {\n id\n logoId\n merchantName\n }\n }\n "], ["\n query listMerchantSettings {\n listMerchantSettings {\n id\n logoId\n merchantName\n }\n }\n "])));
|
|
41571
42657
|
_b.label = 1;
|
|
41572
42658
|
case 1:
|
|
41573
42659
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41575,11 +42661,6 @@ var IkasMerchantAPI = /** @class */ (function () {
|
|
|
41575
42661
|
.getClient()
|
|
41576
42662
|
.query({
|
|
41577
42663
|
query: QUERY,
|
|
41578
|
-
variables: {
|
|
41579
|
-
merchantId: {
|
|
41580
|
-
eq: merchantId,
|
|
41581
|
-
},
|
|
41582
|
-
},
|
|
41583
42664
|
})];
|
|
41584
42665
|
case 2:
|
|
41585
42666
|
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
@@ -41599,7 +42680,7 @@ var IkasMerchantAPI = /** @class */ (function () {
|
|
|
41599
42680
|
};
|
|
41600
42681
|
return IkasMerchantAPI;
|
|
41601
42682
|
}());
|
|
41602
|
-
var templateObject_1$
|
|
42683
|
+
var templateObject_1$b;
|
|
41603
42684
|
|
|
41604
42685
|
var IkasProductAttributeTableCell = /** @class */ (function () {
|
|
41605
42686
|
function IkasProductAttributeTableCell(data) {
|
|
@@ -41632,7 +42713,7 @@ var IkasProductSearchAPI = /** @class */ (function () {
|
|
|
41632
42713
|
switch (_b.label) {
|
|
41633
42714
|
case 0:
|
|
41634
42715
|
_b.trys.push([0, 2, , 3]);
|
|
41635
|
-
SEARCH_PRODUCTS = src(templateObject_1$
|
|
42716
|
+
SEARCH_PRODUCTS = src(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "], ["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "])));
|
|
41636
42717
|
return [4 /*yield*/, apollo
|
|
41637
42718
|
.getClient()
|
|
41638
42719
|
.query({
|
|
@@ -41668,7 +42749,7 @@ var IkasProductSearchAPI = /** @class */ (function () {
|
|
|
41668
42749
|
switch (_b.label) {
|
|
41669
42750
|
case 0:
|
|
41670
42751
|
_b.trys.push([0, 2, , 3]);
|
|
41671
|
-
QUERY = src(templateObject_2$
|
|
42752
|
+
QUERY = src(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "], ["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "])));
|
|
41672
42753
|
return [4 /*yield*/, apollo
|
|
41673
42754
|
.getClient()
|
|
41674
42755
|
.query({
|
|
@@ -41761,6 +42842,7 @@ function simpleToProduct(simple) {
|
|
|
41761
42842
|
metaData: new IkasHTMLMetaData(simple.metaData || undefined),
|
|
41762
42843
|
name: simple.name,
|
|
41763
42844
|
shortDescription: simple.shortDescription || undefined,
|
|
42845
|
+
productOptionSetId: simple.productOptionSetId,
|
|
41764
42846
|
variantTypes: simple.productVariantTypes.map(function (pvt) {
|
|
41765
42847
|
return new IkasProductVariantType({
|
|
41766
42848
|
variantType: new IkasVariantType({
|
|
@@ -41786,6 +42868,7 @@ function simpleToProduct(simple) {
|
|
|
41786
42868
|
var _a, _b, _c, _d;
|
|
41787
42869
|
return new IkasProductVariant({
|
|
41788
42870
|
id: v.id,
|
|
42871
|
+
productId: simple.id,
|
|
41789
42872
|
attributes: (_a = v.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
41790
42873
|
var _a, _b, _c, _d, _e, _f;
|
|
41791
42874
|
return new IkasProductAttributeValue({
|
|
@@ -41833,7 +42916,7 @@ function simpleToProduct(simple) {
|
|
|
41833
42916
|
}),
|
|
41834
42917
|
});
|
|
41835
42918
|
}
|
|
41836
|
-
var templateObject_1$
|
|
42919
|
+
var templateObject_1$c, templateObject_2$7;
|
|
41837
42920
|
|
|
41838
42921
|
var IkasProductAttributeAPI = /** @class */ (function () {
|
|
41839
42922
|
function IkasProductAttributeAPI() {
|
|
@@ -41844,7 +42927,7 @@ var IkasProductAttributeAPI = /** @class */ (function () {
|
|
|
41844
42927
|
return __generator(this, function (_b) {
|
|
41845
42928
|
switch (_b.label) {
|
|
41846
42929
|
case 0:
|
|
41847
|
-
LIST_PRODUCT_ATTRIBUTES = src(templateObject_1$
|
|
42930
|
+
LIST_PRODUCT_ATTRIBUTES = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProductAttribute($id: StringFilterInput!) {\n listProductAttribute(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n type\n options {\n id\n createdAt\n updatedAt\n deleted\n name\n }\n translations {\n description\n locale\n name\n options {\n id\n name\n }\n }\n }\n }\n "], ["\n query listProductAttribute($id: StringFilterInput!) {\n listProductAttribute(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n type\n options {\n id\n createdAt\n updatedAt\n deleted\n name\n }\n translations {\n description\n locale\n name\n options {\n id\n name\n }\n }\n }\n }\n "])));
|
|
41848
42931
|
_b.label = 1;
|
|
41849
42932
|
case 1:
|
|
41850
42933
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41877,7 +42960,7 @@ var IkasProductAttributeAPI = /** @class */ (function () {
|
|
|
41877
42960
|
};
|
|
41878
42961
|
return IkasProductAttributeAPI;
|
|
41879
42962
|
}());
|
|
41880
|
-
var templateObject_1$
|
|
42963
|
+
var templateObject_1$d;
|
|
41881
42964
|
|
|
41882
42965
|
var IkasFavoriteProductAPI = /** @class */ (function () {
|
|
41883
42966
|
function IkasFavoriteProductAPI() {
|
|
@@ -41888,7 +42971,7 @@ var IkasFavoriteProductAPI = /** @class */ (function () {
|
|
|
41888
42971
|
return __generator(this, function (_b) {
|
|
41889
42972
|
switch (_b.label) {
|
|
41890
42973
|
case 0:
|
|
41891
|
-
LIST_FAVORITE_PRODUCTS = src(templateObject_1$
|
|
42974
|
+
LIST_FAVORITE_PRODUCTS = src(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "], ["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "])));
|
|
41892
42975
|
_b.label = 1;
|
|
41893
42976
|
case 1:
|
|
41894
42977
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41917,7 +43000,7 @@ var IkasFavoriteProductAPI = /** @class */ (function () {
|
|
|
41917
43000
|
return __generator(this, function (_b) {
|
|
41918
43001
|
switch (_b.label) {
|
|
41919
43002
|
case 0:
|
|
41920
|
-
IS_FAVORITE_PRODUCT = src(templateObject_2$
|
|
43003
|
+
IS_FAVORITE_PRODUCT = src(templateObject_2$8 || (templateObject_2$8 = __makeTemplateObject(["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "], ["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "])));
|
|
41921
43004
|
_b.label = 1;
|
|
41922
43005
|
case 1:
|
|
41923
43006
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41973,7 +43056,7 @@ var IkasFavoriteProductAPI = /** @class */ (function () {
|
|
|
41973
43056
|
};
|
|
41974
43057
|
return IkasFavoriteProductAPI;
|
|
41975
43058
|
}());
|
|
41976
|
-
var templateObject_1$
|
|
43059
|
+
var templateObject_1$e, templateObject_2$8, templateObject_3$4;
|
|
41977
43060
|
|
|
41978
43061
|
var IkasContactFormAPI = /** @class */ (function () {
|
|
41979
43062
|
function IkasContactFormAPI() {
|
|
@@ -41984,7 +43067,7 @@ var IkasContactFormAPI = /** @class */ (function () {
|
|
|
41984
43067
|
return __generator(this, function (_b) {
|
|
41985
43068
|
switch (_b.label) {
|
|
41986
43069
|
case 0:
|
|
41987
|
-
MUTATION = src(templateObject_1$
|
|
43070
|
+
MUTATION = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n mutation sendContactFormToMerchant(\n $email: String!\n $message: String!\n $firstName: String!\n $lastName: String!\n ) {\n sendContactFormToMerchant(\n email: $email\n message: $message\n firstName: $firstName\n lastName: $lastName\n )\n }\n "], ["\n mutation sendContactFormToMerchant(\n $email: String!\n $message: String!\n $firstName: String!\n $lastName: String!\n ) {\n sendContactFormToMerchant(\n email: $email\n message: $message\n firstName: $firstName\n lastName: $lastName\n )\n }\n "])));
|
|
41988
43071
|
_b.label = 1;
|
|
41989
43072
|
case 1:
|
|
41990
43073
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42016,7 +43099,7 @@ var IkasContactFormAPI = /** @class */ (function () {
|
|
|
42016
43099
|
};
|
|
42017
43100
|
return IkasContactFormAPI;
|
|
42018
43101
|
}());
|
|
42019
|
-
var templateObject_1$
|
|
43102
|
+
var templateObject_1$f;
|
|
42020
43103
|
|
|
42021
43104
|
var IkasStateAPI = /** @class */ (function () {
|
|
42022
43105
|
function IkasStateAPI() {
|
|
@@ -42027,7 +43110,7 @@ var IkasStateAPI = /** @class */ (function () {
|
|
|
42027
43110
|
return __generator(this, function (_b) {
|
|
42028
43111
|
switch (_b.label) {
|
|
42029
43112
|
case 0:
|
|
42030
|
-
QUERY = src(templateObject_1$
|
|
43113
|
+
QUERY = src(templateObject_1$g || (templateObject_1$g = __makeTemplateObject(["\n query listState($countryId: StringFilterInput!) {\n listState(countryId: $countryId) {\n id\n name\n stateCode\n }\n }\n "], ["\n query listState($countryId: StringFilterInput!) {\n listState(countryId: $countryId) {\n id\n name\n stateCode\n }\n }\n "])));
|
|
42031
43114
|
_b.label = 1;
|
|
42032
43115
|
case 1:
|
|
42033
43116
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42064,7 +43147,7 @@ var IkasStateAPI = /** @class */ (function () {
|
|
|
42064
43147
|
};
|
|
42065
43148
|
return IkasStateAPI;
|
|
42066
43149
|
}());
|
|
42067
|
-
var templateObject_1$
|
|
43150
|
+
var templateObject_1$g;
|
|
42068
43151
|
|
|
42069
43152
|
var IkasVariantTypeAPI = /** @class */ (function () {
|
|
42070
43153
|
function IkasVariantTypeAPI() {
|
|
@@ -42075,7 +43158,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
42075
43158
|
return __generator(this, function (_b) {
|
|
42076
43159
|
switch (_b.label) {
|
|
42077
43160
|
case 0:
|
|
42078
|
-
LIST_VARIANT_TYPE = src(templateObject_1$
|
|
43161
|
+
LIST_VARIANT_TYPE = src(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n translations {\n locale\n name\n values {\n id\n name\n }\n }\n }\n }\n "], ["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n translations {\n locale\n name\n values {\n id\n name\n }\n }\n }\n }\n "])));
|
|
42079
43162
|
_b.label = 1;
|
|
42080
43163
|
case 1:
|
|
42081
43164
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42122,7 +43205,133 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
42122
43205
|
};
|
|
42123
43206
|
return IkasVariantTypeAPI;
|
|
42124
43207
|
}());
|
|
42125
|
-
var templateObject_1$
|
|
43208
|
+
var templateObject_1$h;
|
|
43209
|
+
|
|
43210
|
+
var IkasProductOptionSetAPI = /** @class */ (function () {
|
|
43211
|
+
function IkasProductOptionSetAPI() {
|
|
43212
|
+
}
|
|
43213
|
+
IkasProductOptionSetAPI.list = function (searchId, updatedAt, includeDeleted) {
|
|
43214
|
+
if (includeDeleted === void 0) { includeDeleted = false; }
|
|
43215
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43216
|
+
var QUERY, _a, data, errors, err_1;
|
|
43217
|
+
return __generator(this, function (_b) {
|
|
43218
|
+
switch (_b.label) {
|
|
43219
|
+
case 0:
|
|
43220
|
+
_b.trys.push([0, 2, , 3]);
|
|
43221
|
+
QUERY = src(templateObject_1$i || (templateObject_1$i = __makeTemplateObject(["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "], ["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "])));
|
|
43222
|
+
return [4 /*yield*/, apollo
|
|
43223
|
+
.getClient()
|
|
43224
|
+
.query({
|
|
43225
|
+
query: QUERY,
|
|
43226
|
+
variables: {
|
|
43227
|
+
includeDeleted: includeDeleted,
|
|
43228
|
+
updatedAt: { gt: updatedAt },
|
|
43229
|
+
id: { eq: searchId },
|
|
43230
|
+
},
|
|
43231
|
+
})];
|
|
43232
|
+
case 1:
|
|
43233
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
43234
|
+
if (errors && errors.length) {
|
|
43235
|
+
console.log(errors);
|
|
43236
|
+
return [2 /*return*/];
|
|
43237
|
+
}
|
|
43238
|
+
return [2 /*return*/, {
|
|
43239
|
+
data: data.listProductOptionSet.map(function (c) { return new IkasProductOptionSet(c); }),
|
|
43240
|
+
}];
|
|
43241
|
+
case 2:
|
|
43242
|
+
err_1 = _b.sent();
|
|
43243
|
+
console.log(err_1);
|
|
43244
|
+
return [3 /*break*/, 3];
|
|
43245
|
+
case 3: return [2 /*return*/];
|
|
43246
|
+
}
|
|
43247
|
+
});
|
|
43248
|
+
});
|
|
43249
|
+
};
|
|
43250
|
+
return IkasProductOptionSetAPI;
|
|
43251
|
+
}());
|
|
43252
|
+
var templateObject_1$i;
|
|
43253
|
+
|
|
43254
|
+
var IkasProductBackInStockReminderAPI = /** @class */ (function () {
|
|
43255
|
+
function IkasProductBackInStockReminderAPI() {
|
|
43256
|
+
}
|
|
43257
|
+
IkasProductBackInStockReminderAPI.list = function (listParams) {
|
|
43258
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43259
|
+
var QUERY, _a, data, errors, err_1;
|
|
43260
|
+
return __generator(this, function (_b) {
|
|
43261
|
+
switch (_b.label) {
|
|
43262
|
+
case 0:
|
|
43263
|
+
QUERY = src(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n query listProductBackInStockRemind(\n $id: StringFilterInput\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean\n $email: StringFilterInput\n $productId: StringFilterInput\n $variantId: StringFilterInput\n ) {\n listProductBackInStockRemind(\n id: $id\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n email: $email\n productId: $productId\n variantId: $variantId\n ) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "], ["\n query listProductBackInStockRemind(\n $id: StringFilterInput\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean\n $email: StringFilterInput\n $productId: StringFilterInput\n $variantId: StringFilterInput\n ) {\n listProductBackInStockRemind(\n id: $id\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n email: $email\n productId: $productId\n variantId: $variantId\n ) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "])));
|
|
43264
|
+
_b.label = 1;
|
|
43265
|
+
case 1:
|
|
43266
|
+
_b.trys.push([1, 3, , 4]);
|
|
43267
|
+
return [4 /*yield*/, apollo
|
|
43268
|
+
.getClient()
|
|
43269
|
+
.query({
|
|
43270
|
+
query: QUERY,
|
|
43271
|
+
variables: {
|
|
43272
|
+
includeDeleted: listParams.includeDeleted,
|
|
43273
|
+
updatedAt: { gt: listParams.updatedAt },
|
|
43274
|
+
id: { eq: listParams.id },
|
|
43275
|
+
email: { eq: listParams.email },
|
|
43276
|
+
productId: { eq: listParams.productId },
|
|
43277
|
+
variantId: { eq: listParams.variantId },
|
|
43278
|
+
},
|
|
43279
|
+
})];
|
|
43280
|
+
case 2:
|
|
43281
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
43282
|
+
if (errors && errors.length) {
|
|
43283
|
+
return [2 /*return*/];
|
|
43284
|
+
}
|
|
43285
|
+
return [2 /*return*/, {
|
|
43286
|
+
data: data.listProductBackInStockRemind,
|
|
43287
|
+
}];
|
|
43288
|
+
case 3:
|
|
43289
|
+
err_1 = _b.sent();
|
|
43290
|
+
console.log(err_1);
|
|
43291
|
+
return [2 /*return*/];
|
|
43292
|
+
case 4: return [2 /*return*/];
|
|
43293
|
+
}
|
|
43294
|
+
});
|
|
43295
|
+
});
|
|
43296
|
+
};
|
|
43297
|
+
IkasProductBackInStockReminderAPI.save = function (input) {
|
|
43298
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43299
|
+
var MUTATION, _a, data, errors, err_2;
|
|
43300
|
+
return __generator(this, function (_b) {
|
|
43301
|
+
switch (_b.label) {
|
|
43302
|
+
case 0:
|
|
43303
|
+
MUTATION = src(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject(["\n mutation saveProductBackInStockRemind(\n $input: ProductBackInStockRemindInput!\n ) {\n saveProductBackInStockRemind(input: $input) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "], ["\n mutation saveProductBackInStockRemind(\n $input: ProductBackInStockRemindInput!\n ) {\n saveProductBackInStockRemind(input: $input) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "])));
|
|
43304
|
+
_b.label = 1;
|
|
43305
|
+
case 1:
|
|
43306
|
+
_b.trys.push([1, 3, , 4]);
|
|
43307
|
+
return [4 /*yield*/, apollo
|
|
43308
|
+
.getClient()
|
|
43309
|
+
.mutate({
|
|
43310
|
+
mutation: MUTATION,
|
|
43311
|
+
variables: {
|
|
43312
|
+
input: input,
|
|
43313
|
+
},
|
|
43314
|
+
})];
|
|
43315
|
+
case 2:
|
|
43316
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
43317
|
+
if (errors && errors.length) {
|
|
43318
|
+
console.log(errors);
|
|
43319
|
+
}
|
|
43320
|
+
if (data && data.saveProductBackInStockRemind)
|
|
43321
|
+
return [2 /*return*/, data.saveProductBackInStockRemind];
|
|
43322
|
+
return [3 /*break*/, 4];
|
|
43323
|
+
case 3:
|
|
43324
|
+
err_2 = _b.sent();
|
|
43325
|
+
console.log(err_2);
|
|
43326
|
+
return [3 /*break*/, 4];
|
|
43327
|
+
case 4: return [2 /*return*/];
|
|
43328
|
+
}
|
|
43329
|
+
});
|
|
43330
|
+
});
|
|
43331
|
+
};
|
|
43332
|
+
return IkasProductBackInStockReminderAPI;
|
|
43333
|
+
}());
|
|
43334
|
+
var templateObject_1$j, templateObject_2$9;
|
|
42126
43335
|
|
|
42127
43336
|
var IkasProductListPropValueProvider = /** @class */ (function () {
|
|
42128
43337
|
function IkasProductListPropValueProvider(pageType, productListPropValue, pageSpecificData) {
|
|
@@ -42203,7 +43412,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
42203
43412
|
IkasProductDetailPropValueProvider.prototype.getValue = function () {
|
|
42204
43413
|
var _a;
|
|
42205
43414
|
return __awaiter(this, void 0, void 0, function () {
|
|
42206
|
-
var productSearchResponse, productList, product, variant;
|
|
43415
|
+
var productSearchResponse, productList, product, optionSetResponse, variant;
|
|
42207
43416
|
var _this = this;
|
|
42208
43417
|
return __generator(this, function (_b) {
|
|
42209
43418
|
switch (_b.label) {
|
|
@@ -42223,36 +43432,41 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
42223
43432
|
})];
|
|
42224
43433
|
case 1:
|
|
42225
43434
|
productSearchResponse = _b.sent();
|
|
42226
|
-
if (productSearchResponse)
|
|
42227
|
-
|
|
42228
|
-
|
|
42229
|
-
|
|
42230
|
-
|
|
42231
|
-
|
|
42232
|
-
|
|
42233
|
-
|
|
42234
|
-
|
|
42235
|
-
|
|
42236
|
-
|
|
42237
|
-
|
|
42238
|
-
|
|
42239
|
-
|
|
42240
|
-
|
|
42241
|
-
|
|
42242
|
-
return [2 /*return*/, {
|
|
42243
|
-
productDetailPropValue: this.productDetailPropValue,
|
|
42244
|
-
productDetail: new IkasProductDetail(product, product.variants[0].variantValues),
|
|
42245
|
-
}];
|
|
42246
|
-
}
|
|
42247
|
-
}
|
|
42248
|
-
else {
|
|
43435
|
+
if (!productSearchResponse) return [3 /*break*/, 5];
|
|
43436
|
+
productList = productSearchResponse.data;
|
|
43437
|
+
if (!productList.length) return [3 /*break*/, 4];
|
|
43438
|
+
product = productList[0];
|
|
43439
|
+
if (!product.productOptionSetId) return [3 /*break*/, 3];
|
|
43440
|
+
return [4 /*yield*/, IkasProductOptionSetAPI.list(product.productOptionSetId)];
|
|
43441
|
+
case 2:
|
|
43442
|
+
optionSetResponse = _b.sent();
|
|
43443
|
+
if (optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data.length) {
|
|
43444
|
+
product.productOptionSet = optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data[0];
|
|
43445
|
+
}
|
|
43446
|
+
_b.label = 3;
|
|
43447
|
+
case 3:
|
|
43448
|
+
if (product === null || product === void 0 ? void 0 : product.hasVariant) {
|
|
43449
|
+
variant = product.variants.find(function (v) { return v.id === _this.productDetailPropValue.variantId; });
|
|
43450
|
+
if (variant) {
|
|
42249
43451
|
return [2 /*return*/, {
|
|
42250
43452
|
productDetailPropValue: this.productDetailPropValue,
|
|
42251
|
-
productDetail:
|
|
43453
|
+
productDetail: new IkasProductDetail(product, variant.variantValues),
|
|
42252
43454
|
}];
|
|
42253
43455
|
}
|
|
43456
|
+
else
|
|
43457
|
+
return [2 /*return*/, null];
|
|
42254
43458
|
}
|
|
42255
|
-
|
|
43459
|
+
else {
|
|
43460
|
+
return [2 /*return*/, {
|
|
43461
|
+
productDetailPropValue: this.productDetailPropValue,
|
|
43462
|
+
productDetail: new IkasProductDetail(product, product.variants[0].variantValues),
|
|
43463
|
+
}];
|
|
43464
|
+
}
|
|
43465
|
+
case 4: return [2 /*return*/, {
|
|
43466
|
+
productDetailPropValue: this.productDetailPropValue,
|
|
43467
|
+
productDetail: getPlaceholderProduct(),
|
|
43468
|
+
}];
|
|
43469
|
+
case 5: return [2 /*return*/, null];
|
|
42256
43470
|
}
|
|
42257
43471
|
});
|
|
42258
43472
|
});
|
|
@@ -43584,12 +44798,10 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
43584
44798
|
});
|
|
43585
44799
|
IkasPageDataProvider.prototype.getMerchantSettings = function () {
|
|
43586
44800
|
return __awaiter(this, void 0, void 0, function () {
|
|
43587
|
-
var
|
|
44801
|
+
var merchantSettingsResponse;
|
|
43588
44802
|
return __generator(this, function (_a) {
|
|
43589
44803
|
switch (_a.label) {
|
|
43590
|
-
case 0:
|
|
43591
|
-
merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
|
|
43592
|
-
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
|
|
44804
|
+
case 0: return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings()];
|
|
43593
44805
|
case 1:
|
|
43594
44806
|
merchantSettingsResponse = _a.sent();
|
|
43595
44807
|
if (merchantSettingsResponse) {
|
|
@@ -43669,7 +44881,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
43669
44881
|
if (!metaData.targetId)
|
|
43670
44882
|
return [2 /*return*/];
|
|
43671
44883
|
handleProductPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
43672
|
-
var productsResponse, product, displayedVariantType, inStockVariant;
|
|
44884
|
+
var productsResponse, product, optionSetResponse, displayedVariantType, inStockVariant;
|
|
43673
44885
|
return __generator(this, function (_a) {
|
|
43674
44886
|
switch (_a.label) {
|
|
43675
44887
|
case 0: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
@@ -43683,6 +44895,15 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
43683
44895
|
return [2 /*return*/];
|
|
43684
44896
|
}
|
|
43685
44897
|
product = productsResponse.data[0];
|
|
44898
|
+
if (!product.productOptionSetId) return [3 /*break*/, 3];
|
|
44899
|
+
return [4 /*yield*/, IkasProductOptionSetAPI.list(product.productOptionSetId)];
|
|
44900
|
+
case 2:
|
|
44901
|
+
optionSetResponse = _a.sent();
|
|
44902
|
+
if (optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data.length) {
|
|
44903
|
+
product.productOptionSet = optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data[0];
|
|
44904
|
+
}
|
|
44905
|
+
_a.label = 3;
|
|
44906
|
+
case 3:
|
|
43686
44907
|
this.pageSpecificData = new IkasProductDetail(product, product.variants[0].variantValues);
|
|
43687
44908
|
// Select the first displayed in stock variant
|
|
43688
44909
|
if (this.pageSpecificData.displayedVariantTypes.length) {
|
|
@@ -44377,7 +45598,7 @@ var IkasPageDataInit = /** @class */ (function () {
|
|
|
44377
45598
|
|
|
44378
45599
|
var ThemeComponent = observer(function (_a) {
|
|
44379
45600
|
var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
|
|
44380
|
-
var store = IkasStorefrontConfig.store,
|
|
45601
|
+
var store = IkasStorefrontConfig.store, currentPageComponents = IkasStorefrontConfig.currentPageComponents;
|
|
44381
45602
|
var pageComponent = pageComponentPropValue.pageComponent;
|
|
44382
45603
|
var propValues = pageComponentPropValue.propValues;
|
|
44383
45604
|
var hasNullValue = computed(function () {
|
|
@@ -44388,9 +45609,14 @@ var ThemeComponent = observer(function (_a) {
|
|
|
44388
45609
|
}
|
|
44389
45610
|
});
|
|
44390
45611
|
});
|
|
44391
|
-
|
|
45612
|
+
if (!currentPageComponents) {
|
|
45613
|
+
console.error("Components for the page not found.");
|
|
45614
|
+
return null;
|
|
45615
|
+
}
|
|
45616
|
+
var Component = currentPageComponents[pageComponent.componentId];
|
|
44392
45617
|
if (!Component) {
|
|
44393
|
-
console.error("COMPONENT NOT FOUND!",
|
|
45618
|
+
console.error("COMPONENT NOT FOUND!", JSON.stringify(pageComponentPropValue.component, null, 2));
|
|
45619
|
+
return null;
|
|
44394
45620
|
}
|
|
44395
45621
|
return (createElement("div", { id: index + "" }, hasNullValue.get() ? null : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store, pageSpecificData: IkasPageDataInit.pageSpecificData })))));
|
|
44396
45622
|
});
|
|
@@ -44403,7 +45629,7 @@ var IkasPageHead = observer(function (_a) {
|
|
|
44403
45629
|
var _a;
|
|
44404
45630
|
document.documentElement.lang =
|
|
44405
45631
|
((_a = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _a === void 0 ? void 0 : _a.locale) || "tr";
|
|
44406
|
-
}, []);
|
|
45632
|
+
}, [pageType]);
|
|
44407
45633
|
var merchantSettings = useMemo(function () {
|
|
44408
45634
|
if (merchantSettingsStr)
|
|
44409
45635
|
return new IkasMerchantSettings(JSON.parse(merchantSettingsStr));
|
|
@@ -44606,9 +45832,11 @@ function createCategoryBreadcrumbSchema(category) {
|
|
|
44606
45832
|
}
|
|
44607
45833
|
|
|
44608
45834
|
var IkasPage = observer(function (_a) {
|
|
44609
|
-
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas;
|
|
45835
|
+
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas, components = _a.components;
|
|
44610
45836
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
45837
|
+
IkasStorefrontConfig.currentPageComponents = components;
|
|
44611
45838
|
var store = IkasStorefrontConfig.store;
|
|
45839
|
+
store.currentPageType = pageType;
|
|
44612
45840
|
var router = useRouter();
|
|
44613
45841
|
var _b = useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
|
|
44614
45842
|
var settings = useState(new IkasThemeSettings(JSON.parse(settingsStr)))[0];
|
|
@@ -44616,7 +45844,6 @@ var IkasPage = observer(function (_a) {
|
|
|
44616
45844
|
IkasPageDataInit.setPageSpecificData(pageSpecificDataStr, pageType, isBrowser);
|
|
44617
45845
|
return IkasPageDataInit.initPropValues(propValuesStr, router, settingsStr, isBrowser);
|
|
44618
45846
|
}, [isBrowser, propValuesStr, pageType, settingsStr, pageSpecificDataStr]);
|
|
44619
|
-
store.currentPageType = pageType;
|
|
44620
45847
|
useEffect(function () {
|
|
44621
45848
|
if (reInitOnBrowser)
|
|
44622
45849
|
setIsBrowser(typeof window !== "undefined");
|
|
@@ -67815,7 +69042,7 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
67815
69042
|
});
|
|
67816
69043
|
}); };
|
|
67817
69044
|
this.listCountries = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
67818
|
-
var _a, countries, currentRouting_1,
|
|
69045
|
+
var _a, countries, currentRouting_1, currentCountry;
|
|
67819
69046
|
var _this = this;
|
|
67820
69047
|
var _b, _c;
|
|
67821
69048
|
return __generator(this, function (_d) {
|
|
@@ -67835,13 +69062,6 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
67835
69062
|
if ((_c = currentRouting_1 === null || currentRouting_1 === void 0 ? void 0 : currentRouting_1.countryCodes) === null || _c === void 0 ? void 0 : _c.length) {
|
|
67836
69063
|
countries = countries.filter(function (c) { var _a; return c.iso2 && ((_a = currentRouting_1.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2)); });
|
|
67837
69064
|
}
|
|
67838
|
-
else {
|
|
67839
|
-
otherRoutings_1 = IkasStorefrontConfig.routings.filter(function (r) { return r.id !== IkasStorefrontConfig.storefrontRoutingId; });
|
|
67840
|
-
countries = countries.filter(function (c) {
|
|
67841
|
-
return c.iso2 &&
|
|
67842
|
-
!otherRoutings_1.some(function (otherRouting) { var _a; return (_a = otherRouting.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2); });
|
|
67843
|
-
});
|
|
67844
|
-
}
|
|
67845
69065
|
this.countries = countries;
|
|
67846
69066
|
if (this.countries.length === 1 && !this.country)
|
|
67847
69067
|
this.onCountryChange(this.countries[0].id);
|
|
@@ -69701,7 +70921,7 @@ var Image = function (_a) {
|
|
|
69701
70921
|
});
|
|
69702
70922
|
return image.getSrc(closest);
|
|
69703
70923
|
};
|
|
69704
|
-
return (createElement(NextImage, __assign({}, others, { loader: loader, quality: 100, src: image.src, alt: others.alt || "Image", placeholder: useBlur ? "blur" : "empty", blurDataURL: useBlur ? image.getSrc(
|
|
70924
|
+
return (createElement(NextImage, __assign({}, others, { loader: loader, quality: 100, src: image.src, alt: others.alt || "Image", placeholder: useBlur ? "blur" : "empty", blurDataURL: useBlur ? image.getSrc(10) : undefined })));
|
|
69705
70925
|
};
|
|
69706
70926
|
|
|
69707
70927
|
var styles$k = {"StepContainer":"style-module_StepContainer__1O2dD","Step":"style-module_Step__1iOYA","StepTitleContainer":"style-module_StepTitleContainer__2GUg2","First":"style-module_First__cAzdJ","StepTitleTop":"style-module_StepTitleTop__3zfsj","WithRightContent":"style-module_WithRightContent__2fqb1","StepCircle":"style-module_StepCircle__36A5q","Selected":"style-module_Selected__3j91L","StepTitle":"style-module_StepTitle__10YDP","Light":"style-module_Light__15wSX","StepTitleRightContent":"style-module_StepTitleRightContent__2Q43m","StepContent":"style-module_StepContent__20QIi"};
|
|
@@ -69974,7 +71194,7 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
69974
71194
|
var _b, _c, _d;
|
|
69975
71195
|
var vm = _a.vm, pageComponent = _a.pageComponent;
|
|
69976
71196
|
var ref = useRef(null);
|
|
69977
|
-
var store = IkasStorefrontConfig.store,
|
|
71197
|
+
var store = IkasStorefrontConfig.store, currentPageComponents = IkasStorefrontConfig.currentPageComponents;
|
|
69978
71198
|
useEffect(function () {
|
|
69979
71199
|
vm.setComponentRef(ref.current, pageComponent);
|
|
69980
71200
|
}, []);
|
|
@@ -69990,7 +71210,11 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
69990
71210
|
var propValues = (_c = pageComponentPropValue.get()) === null || _c === void 0 ? void 0 : _c.propValues;
|
|
69991
71211
|
if (!propValues)
|
|
69992
71212
|
return null;
|
|
69993
|
-
|
|
71213
|
+
if (!currentPageComponents) {
|
|
71214
|
+
console.error("Components for the page not found.");
|
|
71215
|
+
return null;
|
|
71216
|
+
}
|
|
71217
|
+
var Component = currentPageComponents[pageComponent.componentId];
|
|
69994
71218
|
if (((_d = vm.page) === null || _d === void 0 ? void 0 : _d.type) === IkasThemePageType.CHECKOUT) {
|
|
69995
71219
|
//@ts-ignore
|
|
69996
71220
|
Component = IkasCheckoutPage$1;
|
|
@@ -69999,7 +71223,7 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
69999
71223
|
cart: new IkasCart({
|
|
70000
71224
|
items: [
|
|
70001
71225
|
new IkasOrderLineItem({
|
|
70002
|
-
currencyCode: "
|
|
71226
|
+
currencyCode: "₺",
|
|
70003
71227
|
finalPrice: 100,
|
|
70004
71228
|
finalPriceWithQuantity: 100,
|
|
70005
71229
|
price: 100,
|
|
@@ -70149,7 +71373,7 @@ var IkasStorefrontAPI = /** @class */ (function () {
|
|
|
70149
71373
|
return __generator(this, function (_b) {
|
|
70150
71374
|
switch (_b.label) {
|
|
70151
71375
|
case 0:
|
|
70152
|
-
QUERY = src(templateObject_1$
|
|
71376
|
+
QUERY = src(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "], ["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "])));
|
|
70153
71377
|
_b.label = 1;
|
|
70154
71378
|
case 1:
|
|
70155
71379
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -70180,7 +71404,7 @@ var IkasStorefrontAPI = /** @class */ (function () {
|
|
|
70180
71404
|
};
|
|
70181
71405
|
return IkasStorefrontAPI;
|
|
70182
71406
|
}());
|
|
70183
|
-
var templateObject_1$
|
|
71407
|
+
var templateObject_1$k;
|
|
70184
71408
|
|
|
70185
71409
|
var IkasNextPageDataProvider = /** @class */ (function () {
|
|
70186
71410
|
function IkasNextPageDataProvider() {
|
|
@@ -70219,7 +71443,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
70219
71443
|
IkasNextPageDataProvider.getSettings = function (locale) {
|
|
70220
71444
|
var _this = this;
|
|
70221
71445
|
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
70222
|
-
var isLocal, storefrontResponse, storefront, localTheme, colorScript, settings, storefront_1, salesChannel_1, localizationMap, storefrontJSScripts_1, domain_1, themeLocalizationPath, routing_1;
|
|
71446
|
+
var isLocal, storefrontResponse, storefront, localTheme, colorScript, settings, storefront_1, salesChannel_1, localizationMap, storefrontJSScripts_1, domain_1, productBackInStockSettings_1, customerReviewSettings_1, themeLocalizationPath, routing_1;
|
|
70223
71447
|
return __generator(this, function (_a) {
|
|
70224
71448
|
switch (_a.label) {
|
|
70225
71449
|
case 0:
|
|
@@ -70255,18 +71479,36 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
70255
71479
|
stockPreference: localTheme.settings.stockPreference,
|
|
70256
71480
|
storefrontJSScripts: colorScript ? [colorScript] : [],
|
|
70257
71481
|
domain: "",
|
|
71482
|
+
productBackInStockSettings: {
|
|
71483
|
+
customerLoginRequired: true,
|
|
71484
|
+
},
|
|
71485
|
+
customerReviewSettings: {
|
|
71486
|
+
customerLoginRequired: true,
|
|
71487
|
+
customerPurchaseRequired: false,
|
|
71488
|
+
},
|
|
70258
71489
|
});
|
|
70259
71490
|
return [3 /*break*/, 5];
|
|
70260
71491
|
case 3: return [4 /*yield*/, IkasNextPageDataProvider.readSettingsFile()];
|
|
70261
71492
|
case 4:
|
|
70262
71493
|
settings = _a.sent();
|
|
70263
|
-
if (!settings)
|
|
71494
|
+
if (!settings || !settings.localizationMap)
|
|
70264
71495
|
return [2 /*return*/, resolve(null)];
|
|
70265
71496
|
storefront_1 = new IkasStorefront(settings.storefront);
|
|
70266
71497
|
salesChannel_1 = new IkasSalesChannel(settings.salesChannel);
|
|
70267
71498
|
localizationMap = settings.localizationMap;
|
|
70268
71499
|
storefrontJSScripts_1 = settings.storefrontJSScripts || [];
|
|
70269
71500
|
domain_1 = settings.domain;
|
|
71501
|
+
productBackInStockSettings_1 = settings.productBackInStockSettings
|
|
71502
|
+
? {
|
|
71503
|
+
customerLoginRequired: settings.productBackInStockSettings.customerLoginRequired,
|
|
71504
|
+
}
|
|
71505
|
+
: null;
|
|
71506
|
+
customerReviewSettings_1 = settings.customerReviewSettings
|
|
71507
|
+
? {
|
|
71508
|
+
customerLoginRequired: settings.customerReviewSettings.customerLoginRequired,
|
|
71509
|
+
customerPurchaseRequired: settings.customerReviewSettings.customerPurchaseRequired,
|
|
71510
|
+
}
|
|
71511
|
+
: null;
|
|
70270
71512
|
themeLocalizationPath = localizationMap[locale];
|
|
70271
71513
|
routing_1 = storefront_1.routings.find(function (r) { return r.id === locale || r.path === locale; });
|
|
70272
71514
|
if (!themeLocalizationPath || !routing_1) {
|
|
@@ -70299,6 +71541,8 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
70299
71541
|
stockPreference: stockPreference,
|
|
70300
71542
|
storefrontJSScripts: storefrontJSScripts_1,
|
|
70301
71543
|
domain: domain_1,
|
|
71544
|
+
productBackInStockSettings: productBackInStockSettings_1,
|
|
71545
|
+
customerReviewSettings: customerReviewSettings_1,
|
|
70302
71546
|
});
|
|
70303
71547
|
});
|
|
70304
71548
|
_a.label = 5;
|
|
@@ -70310,7 +71554,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
70310
71554
|
IkasNextPageDataProvider.getPageData = function (context, isServer, pageType, possiblePageTypes, isEditor) {
|
|
70311
71555
|
var _a, _b;
|
|
70312
71556
|
return __awaiter(this, void 0, void 0, function () {
|
|
70313
|
-
var isLocal, isProdEditor, serverRuntimeConfig, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, storefrontJSScripts, domain, provider, componentIds_1, components, namespaces, nextI18nConf, currentLocale, i18nReader, translations, extraProps, checkoutComponent, checkoutSettings, customizationProps;
|
|
71557
|
+
var isLocal, isProdEditor, serverRuntimeConfig, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, storefrontJSScripts, domain, productBackInStockSettings, customerReviewSettings, provider, componentIds_1, components, namespaces, nextI18nConf, currentLocale, i18nReader, translations, extraProps, checkoutComponent, checkoutSettings, customizationProps;
|
|
70314
71558
|
return __generator(this, function (_c) {
|
|
70315
71559
|
switch (_c.label) {
|
|
70316
71560
|
case 0:
|
|
@@ -70336,7 +71580,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
70336
71580
|
notFound: true,
|
|
70337
71581
|
}];
|
|
70338
71582
|
}
|
|
70339
|
-
storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing, favicon = settings.favicon, stockPreference = settings.stockPreference, storefrontJSScripts = settings.storefrontJSScripts, domain = settings.domain;
|
|
71583
|
+
storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing, favicon = settings.favicon, stockPreference = settings.stockPreference, storefrontJSScripts = settings.storefrontJSScripts, domain = settings.domain, productBackInStockSettings = settings.productBackInStockSettings, customerReviewSettings = settings.customerReviewSettings;
|
|
70340
71584
|
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
70341
71585
|
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
70342
71586
|
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
@@ -70351,6 +71595,8 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
70351
71595
|
IkasStorefrontConfig.stockPreference = stockPreference || null;
|
|
70352
71596
|
IkasStorefrontConfig.storefrontJSScripts = storefrontJSScripts || [];
|
|
70353
71597
|
IkasStorefrontConfig.domain = domain;
|
|
71598
|
+
IkasStorefrontConfig.productBackInStockSettings = productBackInStockSettings;
|
|
71599
|
+
IkasStorefrontConfig.customerReviewSettings = customerReviewSettings;
|
|
70354
71600
|
provider = new IkasPageDataProvider(themeLocalization.themeJson, context.params, pageType);
|
|
70355
71601
|
provider.possiblePageTypes = possiblePageTypes;
|
|
70356
71602
|
if (!!isEditor) return [3 /*break*/, 3];
|
|
@@ -70836,10 +72082,13 @@ var cart$1 = /*#__PURE__*/Object.freeze({
|
|
|
70836
72082
|
|
|
70837
72083
|
var IkasPageEditor$1 = dynamic(function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
|
|
70838
72084
|
var Page$c = function (_a) {
|
|
70839
|
-
var configJson = _a.configJson;
|
|
72085
|
+
var configJson = _a.configJson, components = _a.components;
|
|
70840
72086
|
if (configJson) {
|
|
70841
72087
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
70842
72088
|
}
|
|
72089
|
+
if (components) {
|
|
72090
|
+
IkasStorefrontConfig.currentPageComponents = components;
|
|
72091
|
+
}
|
|
70843
72092
|
return createElement(IkasPageEditor$1, null);
|
|
70844
72093
|
};
|
|
70845
72094
|
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -71533,6 +72782,33 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
71533
72782
|
}
|
|
71534
72783
|
});
|
|
71535
72784
|
}); };
|
|
72785
|
+
this.sendReview = function (input) { return __awaiter(_this, void 0, void 0, function () {
|
|
72786
|
+
var customerReviewSettings, salesChannelId, customerId, response, error_1;
|
|
72787
|
+
var _a;
|
|
72788
|
+
return __generator(this, function (_b) {
|
|
72789
|
+
switch (_b.label) {
|
|
72790
|
+
case 0:
|
|
72791
|
+
_b.trys.push([0, 2, , 3]);
|
|
72792
|
+
customerReviewSettings = IkasStorefrontConfig.customerReviewSettings, salesChannelId = IkasStorefrontConfig.salesChannelId;
|
|
72793
|
+
if (!customerReviewSettings)
|
|
72794
|
+
return [2 /*return*/];
|
|
72795
|
+
customerId = (_a = this.customer) === null || _a === void 0 ? void 0 : _a.id;
|
|
72796
|
+
if (!customerId && customerReviewSettings.customerLoginRequired)
|
|
72797
|
+
throw Error("Unauthorized");
|
|
72798
|
+
return [4 /*yield*/, IkasCustomerReviewAPI.createCustomerReview(__assign(__assign({}, input), { customerId: customerReviewSettings.customerLoginRequired
|
|
72799
|
+
? customerId
|
|
72800
|
+
: undefined, salesChannelId: salesChannelId || "" }))];
|
|
72801
|
+
case 1:
|
|
72802
|
+
response = _b.sent();
|
|
72803
|
+
return [2 /*return*/, response];
|
|
72804
|
+
case 2:
|
|
72805
|
+
error_1 = _b.sent();
|
|
72806
|
+
console.log(error_1);
|
|
72807
|
+
return [3 /*break*/, 3];
|
|
72808
|
+
case 3: return [2 /*return*/];
|
|
72809
|
+
}
|
|
72810
|
+
});
|
|
72811
|
+
}); };
|
|
71536
72812
|
this.onCustomerConsentGrant = function () {
|
|
71537
72813
|
_this.saveCustomerConsent();
|
|
71538
72814
|
};
|
|
@@ -72252,4 +73528,4 @@ var en$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Ob
|
|
|
72252
73528
|
'default': en
|
|
72253
73529
|
}));
|
|
72254
73530
|
|
|
72255
|
-
export { AccountInfoForm, index$4 as AccountPage, AddressForm, addresses$1 as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$8 as BlogPage, _slug_$3 as BlogSlugPage, cart$1 as CartPage, checkout$1 as CheckoutPage, ContactForm, _slug_$1 as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts$1 as FavoriteProductsPage, ForgotPasswordForm, forgotPassword$1 as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasAttributeDetail, IkasAttributeList, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogCategoryList, IkasBlogCategoryListPropValue, IkasBlogCategoryListType, IkasBlogCategoryPropValue, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutCustomer, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderRefundSettings, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeType, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home$1 as IndexPage, LessThanRule, LoginForm, login$1 as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$1 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$6 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword$1 as RecoverPasswordPage, RegisterForm, register$1 as RegisterPage, RequiredRule, search$1 as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, createTranslationInputData, decodeBase64, findAllIndexes, formatDate, formatMoney,
|
|
73531
|
+
export { AccountInfoForm, index$4 as AccountPage, AddressForm, addresses$1 as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$8 as BlogPage, _slug_$3 as BlogSlugPage, cart$1 as CartPage, checkout$1 as CheckoutPage, ContactForm, _slug_$1 as CustomPage, CustomerReviewForm, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts$1 as FavoriteProductsPage, ForgotPasswordForm, forgotPassword$1 as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasAttributeDetail, IkasAttributeList, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogCategoryList, IkasBlogCategoryListPropValue, IkasBlogCategoryListType, IkasBlogCategoryPropValue, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPath, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutCustomer, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasCustomerReview, IkasCustomerReviewAPI, IkasCustomerReviewList, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasFilterCategory, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderRefundSettings, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeType, IkasProductAttributeValue, IkasProductBackInStockReminderAPI, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductOption, IkasProductOptionDateSettings, IkasProductOptionFileSettings, IkasProductOptionSelectSettings, IkasProductOptionSelectType, IkasProductOptionSelectValue, IkasProductOptionSelectValueTranslations, IkasProductOptionSet, IkasProductOptionSetAPI, IkasProductOptionSetTranslations, IkasProductOptionTextSettings, IkasProductOptionTranslations, IkasProductOptionType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home$1 as IndexPage, LessThanRule, LoginForm, login$1 as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$1 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$6 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword$1 as RecoverPasswordPage, RegisterForm, register$1 as RegisterPage, RequiredRule, search$1 as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, createTranslationInputData, decodeBase64, findAllIndexes, formatDate, formatMoney, parseRangeStr, pascalCase, stringSorter, stringToSlug, tryForEach, useTranslation, validatePhoneNumber };
|