@ikas/storefront 0.0.108 → 0.0.109
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 +12 -0
- package/build/api/checkout/__generated__/listCheckoutSettings.d.ts +25 -0
- package/build/api/checkout/index.d.ts +2 -0
- package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +1 -1
- package/build/api/country/index.d.ts +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +2 -0
- package/build/components/checkout/components/checkbox/index.d.ts +1 -1
- package/build/components/checkout/index.d.ts +2 -0
- package/build/components/checkout/model.d.ts +9 -2
- package/build/index.es.js +184 -50
- package/build/index.js +184 -50
- package/build/models/data/checkout-settings/index.d.ts +17 -0
- package/build/models/data/order/address/index.d.ts +4 -0
- package/build/pages/checkout/[id].d.ts +1 -0
- package/build/utils/providers/page-data.d.ts +9 -7
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -12576,6 +12576,32 @@ var IkasFilterCategory = /** @class */ (function () {
|
|
|
12576
12576
|
return IkasFilterCategory;
|
|
12577
12577
|
}());
|
|
12578
12578
|
|
|
12579
|
+
var IkasCheckoutSettings = /** @class */ (function () {
|
|
12580
|
+
function IkasCheckoutSettings(data) {
|
|
12581
|
+
if (data === void 0) { data = {}; }
|
|
12582
|
+
this.id = data.id || "";
|
|
12583
|
+
this.createdAt = data.createdAt || 0;
|
|
12584
|
+
this.updatedAt = data.updatedAt || 0;
|
|
12585
|
+
this.phoneRequirement =
|
|
12586
|
+
data.phoneRequirement || IkasCheckoutRequirementEnum.OPTIONAL;
|
|
12587
|
+
this.identityNumberRequirement =
|
|
12588
|
+
data.identityNumberRequirement || IkasCheckoutRequirementEnum.INVISIBLE;
|
|
12589
|
+
this.isAccountRequired = data.isAccountRequired || false;
|
|
12590
|
+
this.isTermsAndConditionsDefaultChecked =
|
|
12591
|
+
data.isTermsAndConditionsDefaultChecked || false;
|
|
12592
|
+
this.showTermsAndConditionsCheckbox =
|
|
12593
|
+
data.showTermsAndConditionsCheckbox || false;
|
|
12594
|
+
this.storefrontId = data.storefrontId || "";
|
|
12595
|
+
}
|
|
12596
|
+
return IkasCheckoutSettings;
|
|
12597
|
+
}());
|
|
12598
|
+
var IkasCheckoutRequirementEnum;
|
|
12599
|
+
(function (IkasCheckoutRequirementEnum) {
|
|
12600
|
+
IkasCheckoutRequirementEnum["INVISIBLE"] = "INVISIBLE";
|
|
12601
|
+
IkasCheckoutRequirementEnum["MANDATORY"] = "MANDATORY";
|
|
12602
|
+
IkasCheckoutRequirementEnum["OPTIONAL"] = "OPTIONAL";
|
|
12603
|
+
})(IkasCheckoutRequirementEnum || (IkasCheckoutRequirementEnum = {}));
|
|
12604
|
+
|
|
12579
12605
|
var IkasOrderAddress = /** @class */ (function () {
|
|
12580
12606
|
function IkasOrderAddress(data) {
|
|
12581
12607
|
if (data === void 0) { data = {}; }
|
|
@@ -12635,6 +12661,10 @@ var IkasOrderAddress = /** @class */ (function () {
|
|
|
12635
12661
|
});
|
|
12636
12662
|
Object.defineProperty(IkasOrderAddress.prototype, "validationResult", {
|
|
12637
12663
|
get: function () {
|
|
12664
|
+
var _a, _b, _c, _d;
|
|
12665
|
+
var isValidPhone = !!this.phone &&
|
|
12666
|
+
this.phone.length >= 10 &&
|
|
12667
|
+
validatePhoneNumber(this.phone);
|
|
12638
12668
|
var results = {
|
|
12639
12669
|
firstName: !!this.firstName,
|
|
12640
12670
|
lastName: !!this.lastName,
|
|
@@ -12643,8 +12673,19 @@ var IkasOrderAddress = /** @class */ (function () {
|
|
|
12643
12673
|
country: !!this.country,
|
|
12644
12674
|
state: !!this.state,
|
|
12645
12675
|
city: !!this.city,
|
|
12646
|
-
phone: this.
|
|
12647
|
-
|
|
12676
|
+
phone: ((_a = this.checkoutSettings) === null || _a === void 0 ? void 0 : _a.phoneRequirement) ===
|
|
12677
|
+
IkasCheckoutRequirementEnum.MANDATORY ||
|
|
12678
|
+
(((_b = this.checkoutSettings) === null || _b === void 0 ? void 0 : _b.phoneRequirement) ===
|
|
12679
|
+
IkasCheckoutRequirementEnum.OPTIONAL &&
|
|
12680
|
+
this.phone)
|
|
12681
|
+
? isValidPhone
|
|
12682
|
+
: true,
|
|
12683
|
+
identityNumber: ((_c = this.checkoutSettings) === null || _c === void 0 ? void 0 : _c.identityNumberRequirement) ===
|
|
12684
|
+
IkasCheckoutRequirementEnum.MANDATORY ||
|
|
12685
|
+
(((_d = this.checkoutSettings) === null || _d === void 0 ? void 0 : _d.identityNumberRequirement) ===
|
|
12686
|
+
IkasCheckoutRequirementEnum.OPTIONAL &&
|
|
12687
|
+
this.phone)
|
|
12688
|
+
? !!this.identityNumber
|
|
12648
12689
|
: true,
|
|
12649
12690
|
};
|
|
12650
12691
|
return results;
|
|
@@ -12659,6 +12700,11 @@ var IkasOrderAddress = /** @class */ (function () {
|
|
|
12659
12700
|
enumerable: false,
|
|
12660
12701
|
configurable: true
|
|
12661
12702
|
});
|
|
12703
|
+
IkasOrderAddress.prototype.toJSON = function () {
|
|
12704
|
+
var obj = __assign({}, this);
|
|
12705
|
+
delete obj.checkoutSettings;
|
|
12706
|
+
return obj;
|
|
12707
|
+
};
|
|
12662
12708
|
return IkasOrderAddress;
|
|
12663
12709
|
}());
|
|
12664
12710
|
|
|
@@ -15863,14 +15909,16 @@ var MAX_CVC_LENGTH = 4;
|
|
|
15863
15909
|
var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
|
|
15864
15910
|
var isServer$1 = typeof localStorage === "undefined";
|
|
15865
15911
|
var CheckoutViewModel = /** @class */ (function () {
|
|
15866
|
-
function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
|
|
15912
|
+
function CheckoutViewModel(checkout, checkoutSettings, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
|
|
15867
15913
|
var _this = this;
|
|
15868
15914
|
this.checkout = new IkasCheckout();
|
|
15915
|
+
this.checkoutSettings = new IkasCheckoutSettings();
|
|
15869
15916
|
this.storefront = null;
|
|
15870
15917
|
this.customerStore = new IkasCustomerStore();
|
|
15871
15918
|
this.isCheckoutLoaded = false;
|
|
15872
15919
|
this.isErrorsVisible = false;
|
|
15873
15920
|
this.isStepLoading = false;
|
|
15921
|
+
this.isTermsAndConditionsChecked = false;
|
|
15874
15922
|
this.step = CheckoutStep.INFO;
|
|
15875
15923
|
this.cardData = null;
|
|
15876
15924
|
this.paymentGatewayId = null;
|
|
@@ -15882,6 +15930,8 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15882
15930
|
this.shippingCountryIds = null;
|
|
15883
15931
|
this.selectedShippingAddressId = "-1";
|
|
15884
15932
|
this.selectedBillingAddressId = "-1";
|
|
15933
|
+
this.policyModalTitle = "";
|
|
15934
|
+
this.policyModalText = "";
|
|
15885
15935
|
this.error = null;
|
|
15886
15936
|
this.init = function (queryParams) { return __awaiter(_this, void 0, void 0, function () {
|
|
15887
15937
|
var merchantId, _a;
|
|
@@ -15999,7 +16049,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15999
16049
|
switch (_b.label) {
|
|
16000
16050
|
case 0:
|
|
16001
16051
|
_a = this;
|
|
16002
|
-
return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.
|
|
16052
|
+
return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.salesChannelId)];
|
|
16003
16053
|
case 1:
|
|
16004
16054
|
_a.shippingCountryIds = _b.sent();
|
|
16005
16055
|
return [2 /*return*/];
|
|
@@ -16085,6 +16135,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16085
16135
|
this.createShippingAddress = function () {
|
|
16086
16136
|
if (!_this.checkout.shippingAddress)
|
|
16087
16137
|
_this.checkout.shippingAddress = new IkasOrderAddress();
|
|
16138
|
+
_this.checkout.shippingAddress.checkoutSettings = _this.checkoutSettings;
|
|
16088
16139
|
};
|
|
16089
16140
|
this.createBillingAddress = function () {
|
|
16090
16141
|
if (typeof localStorage !== "undefined") {
|
|
@@ -16147,6 +16198,9 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16147
16198
|
_this.checkout.billingAddress = new IkasOrderAddress(address);
|
|
16148
16199
|
}
|
|
16149
16200
|
};
|
|
16201
|
+
this.onTermsAndConditionsCheckedChange = function (value) {
|
|
16202
|
+
_this.isTermsAndConditionsChecked = value;
|
|
16203
|
+
};
|
|
16150
16204
|
// CREDIT CARD START
|
|
16151
16205
|
this.onCardNumberChange = function (value) {
|
|
16152
16206
|
if (!_this.cardData)
|
|
@@ -16418,10 +16472,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16418
16472
|
});
|
|
16419
16473
|
}); };
|
|
16420
16474
|
this.checkout = checkout;
|
|
16475
|
+
this.checkoutSettings = checkoutSettings;
|
|
16421
16476
|
this.router = router;
|
|
16422
16477
|
this.returnPolicy = returnPolicy;
|
|
16423
16478
|
this.privacyPolicy = privacyPolicy;
|
|
16424
16479
|
this.termsOfService = termsOfService;
|
|
16480
|
+
this.isTermsAndConditionsChecked = this.checkoutSettings.isTermsAndConditionsDefaultChecked;
|
|
16425
16481
|
this.init(queryParams);
|
|
16426
16482
|
mobx.makeAutoObservable(this);
|
|
16427
16483
|
}
|
|
@@ -16440,6 +16496,14 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16440
16496
|
enumerable: false,
|
|
16441
16497
|
configurable: true
|
|
16442
16498
|
});
|
|
16499
|
+
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGateway", {
|
|
16500
|
+
get: function () {
|
|
16501
|
+
var _this = this;
|
|
16502
|
+
return this.paymentGateways.find(function (pg) { return pg.id === _this.paymentGatewayId; });
|
|
16503
|
+
},
|
|
16504
|
+
enumerable: false,
|
|
16505
|
+
configurable: true
|
|
16506
|
+
});
|
|
16443
16507
|
Object.defineProperty(CheckoutViewModel.prototype, "selectedInstallmentIndex", {
|
|
16444
16508
|
get: function () {
|
|
16445
16509
|
var _this = this;
|
|
@@ -16513,10 +16577,15 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16513
16577
|
});
|
|
16514
16578
|
Object.defineProperty(CheckoutViewModel.prototype, "canPerformPayment", {
|
|
16515
16579
|
get: function () {
|
|
16516
|
-
var _a, _b;
|
|
16580
|
+
var _a, _b, _c;
|
|
16581
|
+
if (this.checkoutSettings.showTermsAndConditionsCheckbox &&
|
|
16582
|
+
!this.isTermsAndConditionsChecked)
|
|
16583
|
+
return false;
|
|
16517
16584
|
return (this.canProceedToShipping &&
|
|
16518
16585
|
!!((_a = this.checkout.billingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
|
|
16519
|
-
(
|
|
16586
|
+
(((_b = this.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
|
|
16587
|
+
IkasPaymentMethodType.CREDIT_CARD
|
|
16588
|
+
? (_c = this.cardData) === null || _c === void 0 ? void 0 : _c.isValid : true));
|
|
16520
16589
|
},
|
|
16521
16590
|
enumerable: false,
|
|
16522
16591
|
configurable: true
|
|
@@ -24617,6 +24686,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24617
24686
|
taxNumber: checkout.billingAddress.taxNumber || null,
|
|
24618
24687
|
taxOffice: checkout.billingAddress.taxOffice || null,
|
|
24619
24688
|
isDefault: checkout.billingAddress.isDefault || false,
|
|
24689
|
+
identityNumber: checkout.billingAddress.identityNumber || null,
|
|
24620
24690
|
}
|
|
24621
24691
|
: null,
|
|
24622
24692
|
shippingAddress: checkout.shippingAddress &&
|
|
@@ -24636,6 +24706,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24636
24706
|
taxNumber: checkout.shippingAddress.taxNumber || null,
|
|
24637
24707
|
taxOffice: checkout.shippingAddress.taxOffice || null,
|
|
24638
24708
|
isDefault: checkout.shippingAddress.isDefault || false,
|
|
24709
|
+
identityNumber: checkout.shippingAddress.identityNumber || null,
|
|
24639
24710
|
}
|
|
24640
24711
|
: null,
|
|
24641
24712
|
couponCode: checkout.couponCode || null,
|
|
@@ -24810,9 +24881,44 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24810
24881
|
});
|
|
24811
24882
|
});
|
|
24812
24883
|
};
|
|
24884
|
+
IkasCheckoutAPI.listCheckoutSettings = function () {
|
|
24885
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24886
|
+
var QUERY, _a, data, errors, err_8;
|
|
24887
|
+
return __generator(this, function (_b) {
|
|
24888
|
+
switch (_b.label) {
|
|
24889
|
+
case 0:
|
|
24890
|
+
QUERY = src(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n }\n }\n "], ["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n }\n }\n "])));
|
|
24891
|
+
_b.label = 1;
|
|
24892
|
+
case 1:
|
|
24893
|
+
_b.trys.push([1, 3, , 4]);
|
|
24894
|
+
return [4 /*yield*/, apollo
|
|
24895
|
+
.getClient()
|
|
24896
|
+
.query({
|
|
24897
|
+
query: QUERY,
|
|
24898
|
+
variables: {
|
|
24899
|
+
storefrontId: { eq: IkasStorefrontConfig.storefrontId },
|
|
24900
|
+
},
|
|
24901
|
+
})];
|
|
24902
|
+
case 2:
|
|
24903
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
24904
|
+
if (errors && errors.length) {
|
|
24905
|
+
console.log(errors);
|
|
24906
|
+
}
|
|
24907
|
+
if (data)
|
|
24908
|
+
return [2 /*return*/, data.listCheckoutSettings.map(function (cs) { return new IkasCheckoutSettings(cs); })];
|
|
24909
|
+
return [3 /*break*/, 4];
|
|
24910
|
+
case 3:
|
|
24911
|
+
err_8 = _b.sent();
|
|
24912
|
+
console.log(err_8);
|
|
24913
|
+
return [3 /*break*/, 4];
|
|
24914
|
+
case 4: return [2 /*return*/];
|
|
24915
|
+
}
|
|
24916
|
+
});
|
|
24917
|
+
});
|
|
24918
|
+
};
|
|
24813
24919
|
return IkasCheckoutAPI;
|
|
24814
24920
|
}());
|
|
24815
|
-
var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
24921
|
+
var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
24816
24922
|
|
|
24817
24923
|
var IkasCityAPI = /** @class */ (function () {
|
|
24818
24924
|
function IkasCityAPI() {
|
|
@@ -24904,13 +25010,13 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24904
25010
|
});
|
|
24905
25011
|
});
|
|
24906
25012
|
};
|
|
24907
|
-
IkasCountryAPI.listShippingCountries = function (
|
|
25013
|
+
IkasCountryAPI.listShippingCountries = function (salesChannelId) {
|
|
24908
25014
|
return __awaiter(this, void 0, void 0, function () {
|
|
24909
25015
|
var QUERY, _a, data, errors, err_2;
|
|
24910
25016
|
return __generator(this, function (_b) {
|
|
24911
25017
|
switch (_b.label) {
|
|
24912
25018
|
case 0:
|
|
24913
|
-
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($
|
|
25019
|
+
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($salesChannelId: String!) {\n getAvailableShippingCountries(salesChannelId: $salesChannelId)\n }\n "], ["\n query getAvailableShippingCountries($salesChannelId: String!) {\n getAvailableShippingCountries(salesChannelId: $salesChannelId)\n }\n "])));
|
|
24914
25020
|
_b.label = 1;
|
|
24915
25021
|
case 1:
|
|
24916
25022
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24919,7 +25025,7 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24919
25025
|
.query({
|
|
24920
25026
|
query: QUERY,
|
|
24921
25027
|
variables: {
|
|
24922
|
-
|
|
25028
|
+
salesChannelId: salesChannelId,
|
|
24923
25029
|
},
|
|
24924
25030
|
})];
|
|
24925
25031
|
case 2:
|
|
@@ -25221,7 +25327,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
25221
25327
|
return __generator(this, function (_b) {
|
|
25222
25328
|
switch (_b.label) {
|
|
25223
25329
|
case 0:
|
|
25224
|
-
MUTATION = src(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "], ["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
|
|
25330
|
+
MUTATION = src(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "], ["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
|
|
25225
25331
|
_b.label = 1;
|
|
25226
25332
|
case 1:
|
|
25227
25333
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -25367,7 +25473,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
25367
25473
|
};
|
|
25368
25474
|
return IkasCustomerAPI;
|
|
25369
25475
|
}());
|
|
25370
|
-
var templateObject_1$6, templateObject_2$4, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
25476
|
+
var templateObject_1$6, templateObject_2$4, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9, templateObject_10, templateObject_11;
|
|
25371
25477
|
|
|
25372
25478
|
var IkasDistrictAPI = /** @class */ (function () {
|
|
25373
25479
|
function IkasDistrictAPI() {
|
|
@@ -26332,6 +26438,9 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
26332
26438
|
this.onPhoneChange = function (value) {
|
|
26333
26439
|
_this.address.phone = value;
|
|
26334
26440
|
};
|
|
26441
|
+
this.onIdentityNumberChange = function (value) {
|
|
26442
|
+
_this.address.identityNumber = value;
|
|
26443
|
+
};
|
|
26335
26444
|
this.onAddressLine1Change = function (value) {
|
|
26336
26445
|
_this.address.addressLine1 = value;
|
|
26337
26446
|
};
|
|
@@ -26436,6 +26545,13 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
26436
26545
|
enumerable: false,
|
|
26437
26546
|
configurable: true
|
|
26438
26547
|
});
|
|
26548
|
+
Object.defineProperty(AddressFormViewModel.prototype, "identityNumber", {
|
|
26549
|
+
get: function () {
|
|
26550
|
+
return this.address.identityNumber;
|
|
26551
|
+
},
|
|
26552
|
+
enumerable: false,
|
|
26553
|
+
configurable: true
|
|
26554
|
+
});
|
|
26439
26555
|
Object.defineProperty(AddressFormViewModel.prototype, "country", {
|
|
26440
26556
|
get: function () {
|
|
26441
26557
|
return this.address.country;
|
|
@@ -26511,12 +26627,12 @@ var css_248z$2 = ".common-module_FormSectionTitle___Mykh {\n width: 100%;\n di
|
|
|
26511
26627
|
var commonStyles = {"FormSectionTitle":"common-module_FormSectionTitle___Mykh","Title":"common-module_Title__3JTHt","WithSubTitle":"common-module_WithSubTitle__1VHWv","SubTitle":"common-module_SubTitle__1H4kH","Grid":"common-module_Grid__2CuvH","Grid2":"common-module_Grid2__9CCag","Grid3":"common-module_Grid3__3p0jJ","FormContainer":"common-module_FormContainer__2I_Lj","mtFormRow":"common-module_mtFormRow__2tsDn","mt1":"common-module_mt1__3tpC1","mt2":"common-module_mt2__2bl5q","fadeInFromRight":"common-module_fadeInFromRight__3RYk5"};
|
|
26512
26628
|
styleInject(css_248z$2);
|
|
26513
26629
|
|
|
26514
|
-
var css_248z$3 = ".style-module_CheckoutPage__A_f2V {\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 16px;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 40px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Space__1e2de {\n width: 100%;\n height: 100px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n flex: 0 0 auto;\n height: 50px;\n background-color: white;\n width: calc(100% - 1em);\n display: flex;\n align-items: center;\n border-top: 1px solid #d9d9d9; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc {\n font-size: 0.7em;\n margin-right: 1.4em;\n color: #737373;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc:hover {\n color: #111111; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n width: 100%;\n padding-left: 0.7em; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 {\n width: 100%;\n height: 96px;\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 1.5em;\n padding-left: 0.4em; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 a {\n width: 100%; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do {\n width: 100%;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do img {\n object-fit: contain;\n object-position: left;\n pointer-events: none; }\n @media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_MobileCartSummary__3NrcP {\n display: none; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_RowPB__3M7Tz {\n padding-bottom: 0.7em; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: auto;\n max-width: 100%; } }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: #FAFAFA;\n border-left: 1px solid #d9d9d9;\n display: flex;\n padding-left: 40px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto; }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f .style-module_RightContent__1TcO5 {\n width: 100%;\n max-width: 600px;\n padding-top: 80px; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n display: none; } }\n";
|
|
26630
|
+
var css_248z$3 = ".style-module_CheckoutPage__A_f2V {\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 16px;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex; }\n .style-module_CheckoutPage__A_f2V * {\n box-sizing: border-box !important; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 40px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Space__1e2de {\n width: 100%;\n height: 100px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n flex: 0 0 auto;\n height: 50px;\n background-color: white;\n width: calc(100% - 1em);\n display: flex;\n align-items: center;\n border-top: 1px solid #d9d9d9; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc {\n font-size: 0.7em;\n margin-right: 1.4em;\n color: #737373;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc:hover {\n color: #111111; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n width: 100%;\n padding-left: 0.7em; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 {\n width: 100%;\n height: 96px;\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 1.5em;\n padding-left: 0.4em; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 a {\n width: 100%; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do {\n width: 100%;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do img {\n object-fit: contain;\n object-position: left;\n pointer-events: none; }\n @media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_MobileCartSummary__3NrcP {\n display: none; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_RowPB__3M7Tz {\n padding-bottom: 0.7em; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: auto;\n max-width: 100%; } }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: #FAFAFA;\n border-left: 1px solid #d9d9d9;\n display: flex;\n padding-left: 40px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto; }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f .style-module_RightContent__1TcO5 {\n width: 100%;\n max-width: 600px;\n padding-top: 80px; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n display: none; } }\n";
|
|
26515
26631
|
var styles$2 = {"CheckoutPage":"style-module_CheckoutPage__A_f2V","Left":"style-module_Left__2dWz6","LeftContent":"style-module_LeftContent__1Tyb7","Space":"style-module_Space__1e2de","Footer":"style-module_Footer__ebdyg","FooterItem":"style-module_FooterItem__1ofBc","Header":"style-module_Header__1vfF1","Logo":"style-module_Logo__2E8Do","MobileCartSummary":"style-module_MobileCartSummary__3NrcP","RowPB":"style-module_RowPB__3M7Tz","Right":"style-module_Right__3AN4f","RightContent":"style-module_RightContent__1TcO5"};
|
|
26516
26632
|
styleInject(css_248z$3);
|
|
26517
26633
|
|
|
26518
26634
|
var AddressForm$1 = mobxReactLite.observer(function (_a) {
|
|
26519
|
-
var _b, _c, _d, _e, _f;
|
|
26635
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
26520
26636
|
var isErrorsVisible = _a.isErrorsVisible, validationResult = _a.validationResult, props = __rest(_a, ["isErrorsVisible", "validationResult"]);
|
|
26521
26637
|
var vm = React.useState(function () { return new AddressFormViewModel(props); })[0];
|
|
26522
26638
|
React.useEffect(function () {
|
|
@@ -26544,9 +26660,10 @@ var AddressForm$1 = mobxReactLite.observer(function (_a) {
|
|
|
26544
26660
|
vm.hasState && (React.createElement(FormItem, { type: FormItemType.SELECT, label: "Eyalet", value: ((_c = vm.state) === null || _c === void 0 ? void 0 : _c.id) || "", onChange: vm.onStateChange, options: vm.stateOptions, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.state), errorText: "Eyalet seçin" })),
|
|
26545
26661
|
React.createElement(FormItem, { type: FormItemType.SELECT, label: "\u0130l", value: ((_d = vm.city) === null || _d === void 0 ? void 0 : _d.id) || "", onChange: vm.onCityChange, options: vm.cityOptions, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.city), errorText: "Şehir seçin" }),
|
|
26546
26662
|
vm.districtOptions.length ? (React.createElement(FormItem, { type: FormItemType.SELECT, label: "\u0130l\u00E7e", value: ((_e = vm.district) === null || _e === void 0 ? void 0 : _e.id) || "", onChange: vm.onDistrictChange, options: vm.districtOptions, errorText: "İlçe seçin" })) : (React.createElement(FormItem, { type: FormItemType.TEXT, label: "\u0130l\u00E7e", value: ((_f = vm.district) === null || _f === void 0 ? void 0 : _f.name) || "", onChange: vm.onDistrictInputChange })),
|
|
26547
|
-
|
|
26548
|
-
|
|
26549
|
-
|
|
26663
|
+
((_g = vm.address.checkoutSettings) === null || _g === void 0 ? void 0 : _g.phoneRequirement) !==
|
|
26664
|
+
IkasCheckoutRequirementEnum.INVISIBLE && (React.createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" })),
|
|
26665
|
+
((_h = vm.address.checkoutSettings) === null || _h === void 0 ? void 0 : _h.identityNumberRequirement) !==
|
|
26666
|
+
IkasCheckoutRequirementEnum.INVISIBLE && (React.createElement(FormItem, { type: FormItemType.TEXT, label: "TC Kimlik No", value: vm.identityNumber || "", onChange: vm.onIdentityNumberChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.identityNumber), errorText: "TC kimlik no girin" })))));
|
|
26550
26667
|
});
|
|
26551
26668
|
|
|
26552
26669
|
var css_248z$4 = ".style-module_Button__1UPMN {\n cursor: pointer;\n border: 1px transparent solid;\n border-radius: 6px;\n font-weight: 500;\n text-align: center;\n position: relative;\n transition: all .2s;\n display: flex;\n justify-content: center;\n align-items: center; }\n .style-module_Button__1UPMN.style-module_Large__2wPlw {\n height: 64px;\n padding: 0 1.7em; }\n .style-module_Button__1UPMN.style-module_Dark__1Z_hs {\n background-color: #111111;\n color: white; }\n .style-module_Button__1UPMN.style-module_Disabled__3HYF_ {\n background-color: #c8c8c8;\n color: #545454;\n pointer-events: none; }\n @media only screen and (max-width: 1000px) {\n .style-module_Button__1UPMN.style-module_FullWidthMobile__3MTFv {\n width: 100%; } }\n .style-module_Button__1UPMN .style-module_loader__3v6kq,\n .style-module_Button__1UPMN .style-module_loader__3v6kq:after {\n border-radius: 50%;\n width: 5em;\n height: 5em; }\n .style-module_Button__1UPMN .style-module_loader__3v6kq {\n font-size: 6px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid #ffffff;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__2z7nj 1.1s infinite linear;\n animation: style-module_load8__2z7nj 1.1s infinite linear; }\n\n@-webkit-keyframes style-module_load8__2z7nj {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes style-module_load8__2z7nj {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n";
|
|
@@ -26860,16 +26977,25 @@ var BillingAddress = mobxReactLite.observer(function (_a) {
|
|
|
26860
26977
|
React.createElement(ExpandableList, { options: expandableListOptionsBilling.get(), selectedIndex: selectedBillingRowIndex, onRowSelect: onSelectedBillingRowIndexChange })));
|
|
26861
26978
|
});
|
|
26862
26979
|
|
|
26863
|
-
var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n";
|
|
26864
|
-
var styles$d = {"StepPayment":"style-module_StepPayment__3STxe"};
|
|
26980
|
+
var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n .style-module_StepPayment__3STxe .style-module_TermsLabelSpan__35xVC {\n text-decoration: underline; }\n";
|
|
26981
|
+
var styles$d = {"StepPayment":"style-module_StepPayment__3STxe","TermsLabelSpan":"style-module_TermsLabelSpan__35xVC"};
|
|
26865
26982
|
styleInject(css_248z$e);
|
|
26866
26983
|
|
|
26867
26984
|
var CheckoutStepPayment = mobxReactLite.observer(function (_a) {
|
|
26868
26985
|
var vm = _a.vm;
|
|
26986
|
+
var onShowTermsClick = function (e) {
|
|
26987
|
+
e.stopPropagation();
|
|
26988
|
+
vm.policyModalText = vm.termsOfService;
|
|
26989
|
+
};
|
|
26869
26990
|
return (React.createElement("div", { className: [styles$d.StepPayment, commonStyles.FormContainer].join(" ") },
|
|
26870
26991
|
React.createElement(InfoBox, { vm: vm, showShipping: true }),
|
|
26871
26992
|
React.createElement(PaymentGateways, { vm: vm }),
|
|
26872
26993
|
React.createElement(BillingAddress, { vm: vm }),
|
|
26994
|
+
React.createElement("div", { style: { marginTop: "12px" } },
|
|
26995
|
+
React.createElement(Checkbox, { value: vm.isTermsAndConditionsChecked, label: React.createElement(React.Fragment, null,
|
|
26996
|
+
React.createElement("span", { className: styles$d.TermsLabelSpan, onClick: onShowTermsClick }, "Mesafeli sat\u0131\u015F s\u00F6zle\u015Fmesini"),
|
|
26997
|
+
" ",
|
|
26998
|
+
"okudum ve onayl\u0131yorum"), onChange: vm.onTermsAndConditionsCheckedChange })),
|
|
26873
26999
|
React.createElement(StepActionButtons, { mainBtnText: "Şimdi öde", mainBtnOnClick: vm.performPayment, backBtnText: "Kargoya Geri Dön", backBtnOnClick: vm.onBackToShippingClick, isLoading: vm.isStepLoading })));
|
|
26874
27000
|
});
|
|
26875
27001
|
|
|
@@ -27600,17 +27726,18 @@ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
|
27600
27726
|
|
|
27601
27727
|
var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
27602
27728
|
var _b, _c, _d;
|
|
27603
|
-
var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
27729
|
+
var checkout = _a.checkout, checkoutSettings = _a.checkoutSettings, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
27604
27730
|
var router$1 = router.useRouter();
|
|
27605
27731
|
var vm = React.useState(function () {
|
|
27606
|
-
return new CheckoutViewModel(checkout, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
|
|
27732
|
+
return new CheckoutViewModel(checkout, checkoutSettings, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
|
|
27607
27733
|
})[0];
|
|
27608
27734
|
React.useEffect(function () {
|
|
27735
|
+
if (vm.checkoutSettings.isAccountRequired && !vm.checkout.hasCustomer) {
|
|
27736
|
+
router$1.push("/account/login?redirect=" + encodeURIComponent(vm.checkoutUrl));
|
|
27737
|
+
}
|
|
27609
27738
|
Analytics.beginCheckout(vm.checkout);
|
|
27610
27739
|
Analytics.checkoutStep(vm.checkout, vm.step);
|
|
27611
27740
|
}, []);
|
|
27612
|
-
var _e = React.useState(""), policyModalTitle = _e[0], setPolicyModalTitle = _e[1];
|
|
27613
|
-
var _f = React.useState(""), policyModalText = _f[0], setPolicyModalText = _f[1];
|
|
27614
27741
|
var step;
|
|
27615
27742
|
switch (vm.step) {
|
|
27616
27743
|
case CheckoutStep.INFO:
|
|
@@ -27627,19 +27754,19 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
|
27627
27754
|
break;
|
|
27628
27755
|
}
|
|
27629
27756
|
var onPolicyModalClose = function () {
|
|
27630
|
-
|
|
27757
|
+
vm.policyModalText = "";
|
|
27631
27758
|
};
|
|
27632
27759
|
var onReturnPolicyClick = function () {
|
|
27633
|
-
|
|
27634
|
-
|
|
27760
|
+
vm.policyModalTitle = "Para İade Politikası";
|
|
27761
|
+
vm.policyModalText = vm.returnPolicy;
|
|
27635
27762
|
};
|
|
27636
27763
|
var onPrivacyPolicyClick = function () {
|
|
27637
|
-
|
|
27638
|
-
|
|
27764
|
+
vm.policyModalTitle = "Gizlilik Politikası";
|
|
27765
|
+
vm.policyModalText = vm.returnPolicy;
|
|
27639
27766
|
};
|
|
27640
27767
|
var onTermsOfServiceClick = function () {
|
|
27641
|
-
|
|
27642
|
-
|
|
27768
|
+
vm.policyModalTitle = "Hizmet Şartları";
|
|
27769
|
+
vm.policyModalText = vm.returnPolicy;
|
|
27643
27770
|
};
|
|
27644
27771
|
var onErrorClose = function () {
|
|
27645
27772
|
vm.error = undefined;
|
|
@@ -27696,7 +27823,7 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
|
27696
27823
|
React.createElement("div", { className: styles$2.Right },
|
|
27697
27824
|
React.createElement("div", { className: styles$2.RightContent },
|
|
27698
27825
|
React.createElement(CartSummary, { vm: vm }))),
|
|
27699
|
-
!!policyModalText && (React.createElement(PolicyModal, { title: policyModalTitle, modalContent: policyModalText, onClose: onPolicyModalClose })))));
|
|
27826
|
+
!!vm.policyModalText && (React.createElement(PolicyModal, { title: vm.policyModalTitle, modalContent: vm.policyModalText, onClose: onPolicyModalClose })))));
|
|
27700
27827
|
});
|
|
27701
27828
|
|
|
27702
27829
|
function ErrorComponent(_a) {
|
|
@@ -28535,11 +28662,12 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
28535
28662
|
SettingsHelper.getPageData = function (context, isServer, pageType) {
|
|
28536
28663
|
var _a;
|
|
28537
28664
|
return __awaiter(this, void 0, void 0, function () {
|
|
28538
|
-
var locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
|
|
28665
|
+
var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
|
|
28539
28666
|
return __generator(this, function (_b) {
|
|
28540
28667
|
switch (_b.label) {
|
|
28541
28668
|
case 0:
|
|
28542
|
-
|
|
28669
|
+
isLocal = process.env.NEXT_PUBLIC_ENV === "local";
|
|
28670
|
+
locale = isLocal ? "en" : context.locale;
|
|
28543
28671
|
if (!locale) {
|
|
28544
28672
|
return [2 /*return*/, {
|
|
28545
28673
|
props: {},
|
|
@@ -28823,15 +28951,18 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
28823
28951
|
});
|
|
28824
28952
|
|
|
28825
28953
|
var CheckoutPage = function (_a) {
|
|
28826
|
-
var checkoutStr = _a.checkoutStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "configJson"]);
|
|
28954
|
+
var checkoutStr = _a.checkoutStr, checkoutSettingsStr = _a.checkoutSettingsStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "checkoutSettingsStr", "configJson"]);
|
|
28827
28955
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28828
28956
|
Analytics.disableHTML();
|
|
28829
28957
|
var checkout = new IkasCheckout(JSON.parse(checkoutStr));
|
|
28830
|
-
|
|
28958
|
+
var checkoutSettings = checkoutSettingsStr
|
|
28959
|
+
? new IkasCheckoutSettings(JSON.parse(checkoutSettingsStr))
|
|
28960
|
+
: new IkasCheckoutSettings();
|
|
28961
|
+
return (React.createElement(IkasCheckoutPage, __assign({ checkout: checkout, checkoutSettings: checkoutSettings }, others)));
|
|
28831
28962
|
};
|
|
28832
28963
|
var _id_ = mobxReactLite.observer(CheckoutPage);
|
|
28833
28964
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28834
|
-
var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout;
|
|
28965
|
+
var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
|
|
28835
28966
|
return __generator(this, function (_a) {
|
|
28836
28967
|
switch (_a.label) {
|
|
28837
28968
|
case 0:
|
|
@@ -28865,20 +28996,23 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
28865
28996
|
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
28866
28997
|
case 2:
|
|
28867
28998
|
checkout = _a.sent();
|
|
28868
|
-
if (checkout)
|
|
28869
|
-
|
|
28870
|
-
|
|
28871
|
-
|
|
28872
|
-
|
|
28873
|
-
|
|
28874
|
-
|
|
28875
|
-
|
|
28876
|
-
|
|
28877
|
-
|
|
28878
|
-
|
|
28879
|
-
|
|
28880
|
-
|
|
28881
|
-
|
|
28999
|
+
if (!checkout) return [3 /*break*/, 4];
|
|
29000
|
+
return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
|
|
29001
|
+
case 3:
|
|
29002
|
+
checkoutSettings = _a.sent();
|
|
29003
|
+
return [2 /*return*/, {
|
|
29004
|
+
props: {
|
|
29005
|
+
checkoutStr: JSON.stringify(checkout),
|
|
29006
|
+
checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
29007
|
+
: null,
|
|
29008
|
+
configJson: IkasStorefrontConfig.getJson(),
|
|
29009
|
+
returnPolicy: themeLocalization.returnPolicy || "",
|
|
29010
|
+
privacyPolicy: themeLocalization.privacyPolicy || "",
|
|
29011
|
+
termsOfService: themeLocalization.termsOfService || "",
|
|
29012
|
+
queryParams: context.query,
|
|
29013
|
+
},
|
|
29014
|
+
}];
|
|
29015
|
+
case 4: return [2 /*return*/, redirect()];
|
|
28882
29016
|
}
|
|
28883
29017
|
});
|
|
28884
29018
|
}); };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class IkasCheckoutSettings {
|
|
2
|
+
id: string;
|
|
3
|
+
createdAt: number;
|
|
4
|
+
updatedAt: number;
|
|
5
|
+
phoneRequirement: IkasCheckoutRequirementEnum | null;
|
|
6
|
+
identityNumberRequirement: IkasCheckoutRequirementEnum | null;
|
|
7
|
+
isAccountRequired: boolean;
|
|
8
|
+
isTermsAndConditionsDefaultChecked: boolean;
|
|
9
|
+
showTermsAndConditionsCheckbox: boolean;
|
|
10
|
+
storefrontId: string;
|
|
11
|
+
constructor(data?: Partial<IkasCheckoutSettings>);
|
|
12
|
+
}
|
|
13
|
+
export declare enum IkasCheckoutRequirementEnum {
|
|
14
|
+
INVISIBLE = "INVISIBLE",
|
|
15
|
+
MANDATORY = "MANDATORY",
|
|
16
|
+
OPTIONAL = "OPTIONAL"
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IkasCheckoutSettings } from "../../checkout-settings/index";
|
|
1
2
|
export declare class IkasOrderAddress {
|
|
2
3
|
addressLine1?: string | null;
|
|
3
4
|
addressLine2?: string | null;
|
|
@@ -14,10 +15,12 @@ export declare class IkasOrderAddress {
|
|
|
14
15
|
identityNumber?: string | null;
|
|
15
16
|
taxNumber?: string | null;
|
|
16
17
|
taxOffice?: string | null;
|
|
18
|
+
checkoutSettings?: IkasCheckoutSettings;
|
|
17
19
|
constructor(data?: Partial<IkasOrderAddress>);
|
|
18
20
|
get addressText(): string;
|
|
19
21
|
get validationResult(): IkasAddressValidationResult;
|
|
20
22
|
get isValid(): boolean;
|
|
23
|
+
toJSON(): this;
|
|
21
24
|
}
|
|
22
25
|
declare type IkasOrderAddressLocation = {
|
|
23
26
|
id?: string;
|
|
@@ -37,5 +40,6 @@ export declare type IkasAddressValidationResult = {
|
|
|
37
40
|
state: boolean;
|
|
38
41
|
city: boolean;
|
|
39
42
|
phone: boolean;
|
|
43
|
+
identityNumber: boolean;
|
|
40
44
|
};
|
|
41
45
|
export {};
|
|
@@ -22,13 +22,15 @@ export declare class IkasPageDataProvider {
|
|
|
22
22
|
settingsStr: string;
|
|
23
23
|
merchantSettings: string | null;
|
|
24
24
|
configJson: {
|
|
25
|
-
storefrontId: string |
|
|
26
|
-
storefrontRoutingId: string |
|
|
27
|
-
storefrontThemeId: string |
|
|
28
|
-
salesChannelId: string |
|
|
29
|
-
priceListId: string |
|
|
30
|
-
stockLocationIds: string[] |
|
|
31
|
-
routings:
|
|
25
|
+
storefrontId: string | null;
|
|
26
|
+
storefrontRoutingId: string | null;
|
|
27
|
+
storefrontThemeId: string | null;
|
|
28
|
+
salesChannelId: string | null;
|
|
29
|
+
priceListId: string | null;
|
|
30
|
+
stockLocationIds: string[] | null;
|
|
31
|
+
routings: any;
|
|
32
|
+
gtmId: string | null;
|
|
33
|
+
fbpId: string | null;
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
};
|