@ikas/storefront 0.0.108 → 0.0.110

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/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.phone
12647
- ? this.phone.length >= 10 && validatePhoneNumber(this.phone)
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.storefrontId)];
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
- (!!this.cardData ? (_b = this.cardData) === null || _b === void 0 ? void 0 : _b.isValid : true));
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,
@@ -24713,7 +24784,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24713
24784
  return __generator(this, function (_b) {
24714
24785
  switch (_b.label) {
24715
24786
  case 0:
24716
- QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n testMode\n }\n }\n "], ["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n testMode\n }\n }\n "])));
24787
+ QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "], ["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "])));
24717
24788
  _b.label = 1;
24718
24789
  case 1:
24719
24790
  _b.trys.push([1, 3, , 4]);
@@ -24790,7 +24861,9 @@ var IkasCheckoutAPI = /** @class */ (function () {
24790
24861
  query: QUERY,
24791
24862
  variables: {
24792
24863
  lines: lines,
24793
- stockLocationIdList: stockLocationIdList,
24864
+ stockLocationIdList: stockLocationIdList.length
24865
+ ? stockLocationIdList
24866
+ : null,
24794
24867
  },
24795
24868
  })];
24796
24869
  case 2:
@@ -24810,9 +24883,44 @@ var IkasCheckoutAPI = /** @class */ (function () {
24810
24883
  });
24811
24884
  });
24812
24885
  };
24886
+ IkasCheckoutAPI.listCheckoutSettings = function () {
24887
+ return __awaiter(this, void 0, void 0, function () {
24888
+ var QUERY, _a, data, errors, err_8;
24889
+ return __generator(this, function (_b) {
24890
+ switch (_b.label) {
24891
+ case 0:
24892
+ 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 "])));
24893
+ _b.label = 1;
24894
+ case 1:
24895
+ _b.trys.push([1, 3, , 4]);
24896
+ return [4 /*yield*/, apollo
24897
+ .getClient()
24898
+ .query({
24899
+ query: QUERY,
24900
+ variables: {
24901
+ storefrontId: { eq: IkasStorefrontConfig.storefrontId },
24902
+ },
24903
+ })];
24904
+ case 2:
24905
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
24906
+ if (errors && errors.length) {
24907
+ console.log(errors);
24908
+ }
24909
+ if (data)
24910
+ return [2 /*return*/, data.listCheckoutSettings.map(function (cs) { return new IkasCheckoutSettings(cs); })];
24911
+ return [3 /*break*/, 4];
24912
+ case 3:
24913
+ err_8 = _b.sent();
24914
+ console.log(err_8);
24915
+ return [3 /*break*/, 4];
24916
+ case 4: return [2 /*return*/];
24917
+ }
24918
+ });
24919
+ });
24920
+ };
24813
24921
  return IkasCheckoutAPI;
24814
24922
  }());
24815
- var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
24923
+ var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
24816
24924
 
24817
24925
  var IkasCityAPI = /** @class */ (function () {
24818
24926
  function IkasCityAPI() {
@@ -24904,13 +25012,13 @@ var IkasCountryAPI = /** @class */ (function () {
24904
25012
  });
24905
25013
  });
24906
25014
  };
24907
- IkasCountryAPI.listShippingCountries = function (storefrontId) {
25015
+ IkasCountryAPI.listShippingCountries = function (salesChannelId) {
24908
25016
  return __awaiter(this, void 0, void 0, function () {
24909
25017
  var QUERY, _a, data, errors, err_2;
24910
25018
  return __generator(this, function (_b) {
24911
25019
  switch (_b.label) {
24912
25020
  case 0:
24913
- QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "], ["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "])));
25021
+ 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
25022
  _b.label = 1;
24915
25023
  case 1:
24916
25024
  _b.trys.push([1, 3, , 4]);
@@ -24919,7 +25027,7 @@ var IkasCountryAPI = /** @class */ (function () {
24919
25027
  .query({
24920
25028
  query: QUERY,
24921
25029
  variables: {
24922
- storefrontId: storefrontId,
25030
+ salesChannelId: salesChannelId,
24923
25031
  },
24924
25032
  })];
24925
25033
  case 2:
@@ -25221,7 +25329,7 @@ var IkasCustomerAPI = /** @class */ (function () {
25221
25329
  return __generator(this, function (_b) {
25222
25330
  switch (_b.label) {
25223
25331
  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 "])));
25332
+ 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
25333
  _b.label = 1;
25226
25334
  case 1:
25227
25335
  _b.trys.push([1, 3, , 4]);
@@ -25367,7 +25475,7 @@ var IkasCustomerAPI = /** @class */ (function () {
25367
25475
  };
25368
25476
  return IkasCustomerAPI;
25369
25477
  }());
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;
25478
+ 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
25479
 
25372
25480
  var IkasDistrictAPI = /** @class */ (function () {
25373
25481
  function IkasDistrictAPI() {
@@ -26332,6 +26440,9 @@ var AddressFormViewModel = /** @class */ (function () {
26332
26440
  this.onPhoneChange = function (value) {
26333
26441
  _this.address.phone = value;
26334
26442
  };
26443
+ this.onIdentityNumberChange = function (value) {
26444
+ _this.address.identityNumber = value;
26445
+ };
26335
26446
  this.onAddressLine1Change = function (value) {
26336
26447
  _this.address.addressLine1 = value;
26337
26448
  };
@@ -26436,6 +26547,13 @@ var AddressFormViewModel = /** @class */ (function () {
26436
26547
  enumerable: false,
26437
26548
  configurable: true
26438
26549
  });
26550
+ Object.defineProperty(AddressFormViewModel.prototype, "identityNumber", {
26551
+ get: function () {
26552
+ return this.address.identityNumber;
26553
+ },
26554
+ enumerable: false,
26555
+ configurable: true
26556
+ });
26439
26557
  Object.defineProperty(AddressFormViewModel.prototype, "country", {
26440
26558
  get: function () {
26441
26559
  return this.address.country;
@@ -26511,7 +26629,7 @@ var css_248z$2 = ".common-module_FormSectionTitle___Mykh {\n width: 100%;\n di
26511
26629
  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
26630
  styleInject(css_248z$2);
26513
26631
 
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";
26632
+ 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
26633
  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
26634
  styleInject(css_248z$3);
26517
26635
 
@@ -26544,9 +26662,12 @@ var AddressForm$1 = mobxReactLite.observer(function (_a) {
26544
26662
  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
26663
  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
26664
  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
- !vm.hasState && (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" }))),
26548
- vm.hasState && (React.createElement("div", { className: [styles$2.RowPB, commonStyles.mtFormRow].join(" ") },
26549
- 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
+ !!vm.address.checkoutSettings &&
26666
+ vm.address.checkoutSettings.phoneRequirement !==
26667
+ 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" })),
26668
+ !!vm.address.checkoutSettings &&
26669
+ vm.address.checkoutSettings.identityNumberRequirement !==
26670
+ 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
26671
  });
26551
26672
 
26552
26673
  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";
@@ -26813,7 +26934,7 @@ var PaymentGateways = mobxReactLite.observer(function (_a) {
26813
26934
  : pg.name)),
26814
26935
  expandContent: pg.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD ? (React.createElement("div", null,
26815
26936
  React.createElement(CreditCardForm, { vm: vm }),
26816
- vm.installmentInfo && React.createElement(Installments, { vm: vm }))) : undefined,
26937
+ vm.installmentInfo && React.createElement(Installments, { vm: vm }))) : pg.description ? (React.createElement("div", null, pg.description)) : undefined,
26817
26938
  rightContent: (React.createElement(PaymentMethodLogos, null, pg.paymentMethods.map(function (pm, index) {
26818
26939
  return pm.logoUrl ? (React.createElement("div", { className: styles$b.PaymentLogoContainer, key: index },
26819
26940
  React.createElement("img", { src: pm.logoUrl }))) : (React.createElement("div", { className: styles$b.PaymentLogoContainer, key: index }, pm.name));
@@ -26860,16 +26981,25 @@ var BillingAddress = mobxReactLite.observer(function (_a) {
26860
26981
  React.createElement(ExpandableList, { options: expandableListOptionsBilling.get(), selectedIndex: selectedBillingRowIndex, onRowSelect: onSelectedBillingRowIndexChange })));
26861
26982
  });
26862
26983
 
26863
- var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n";
26864
- var styles$d = {"StepPayment":"style-module_StepPayment__3STxe"};
26984
+ 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";
26985
+ var styles$d = {"StepPayment":"style-module_StepPayment__3STxe","TermsLabelSpan":"style-module_TermsLabelSpan__35xVC"};
26865
26986
  styleInject(css_248z$e);
26866
26987
 
26867
26988
  var CheckoutStepPayment = mobxReactLite.observer(function (_a) {
26868
26989
  var vm = _a.vm;
26990
+ var onShowTermsClick = function (e) {
26991
+ e.stopPropagation();
26992
+ vm.policyModalText = vm.termsOfService;
26993
+ };
26869
26994
  return (React.createElement("div", { className: [styles$d.StepPayment, commonStyles.FormContainer].join(" ") },
26870
26995
  React.createElement(InfoBox, { vm: vm, showShipping: true }),
26871
26996
  React.createElement(PaymentGateways, { vm: vm }),
26872
26997
  React.createElement(BillingAddress, { vm: vm }),
26998
+ React.createElement("div", { style: { marginTop: "12px" } },
26999
+ React.createElement(Checkbox, { value: vm.isTermsAndConditionsChecked, label: React.createElement(React.Fragment, null,
27000
+ React.createElement("span", { className: styles$d.TermsLabelSpan, onClick: onShowTermsClick }, "Mesafeli sat\u0131\u015F s\u00F6zle\u015Fmesini"),
27001
+ " ",
27002
+ "okudum ve onayl\u0131yorum"), onChange: vm.onTermsAndConditionsCheckedChange })),
26873
27003
  React.createElement(StepActionButtons, { mainBtnText: "Şimdi öde", mainBtnOnClick: vm.performPayment, backBtnText: "Kargoya Geri Dön", backBtnOnClick: vm.onBackToShippingClick, isLoading: vm.isStepLoading })));
26874
27004
  });
26875
27005
 
@@ -27600,17 +27730,18 @@ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
27600
27730
 
27601
27731
  var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27602
27732
  var _b, _c, _d;
27603
- var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27733
+ var checkout = _a.checkout, checkoutSettings = _a.checkoutSettings, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27604
27734
  var router$1 = router.useRouter();
27605
27735
  var vm = React.useState(function () {
27606
- return new CheckoutViewModel(checkout, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
27736
+ return new CheckoutViewModel(checkout, checkoutSettings, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
27607
27737
  })[0];
27608
27738
  React.useEffect(function () {
27739
+ if (vm.checkoutSettings.isAccountRequired && !vm.checkout.hasCustomer) {
27740
+ router$1.push("/account/login?redirect=" + encodeURIComponent(vm.checkoutUrl));
27741
+ }
27609
27742
  Analytics.beginCheckout(vm.checkout);
27610
27743
  Analytics.checkoutStep(vm.checkout, vm.step);
27611
27744
  }, []);
27612
- var _e = React.useState(""), policyModalTitle = _e[0], setPolicyModalTitle = _e[1];
27613
- var _f = React.useState(""), policyModalText = _f[0], setPolicyModalText = _f[1];
27614
27745
  var step;
27615
27746
  switch (vm.step) {
27616
27747
  case CheckoutStep.INFO:
@@ -27627,19 +27758,19 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27627
27758
  break;
27628
27759
  }
27629
27760
  var onPolicyModalClose = function () {
27630
- setPolicyModalText("");
27761
+ vm.policyModalText = "";
27631
27762
  };
27632
27763
  var onReturnPolicyClick = function () {
27633
- setPolicyModalTitle("Para İade Politikası");
27634
- setPolicyModalText(vm.returnPolicy);
27764
+ vm.policyModalTitle = "Para İade Politikası";
27765
+ vm.policyModalText = vm.returnPolicy;
27635
27766
  };
27636
27767
  var onPrivacyPolicyClick = function () {
27637
- setPolicyModalTitle("Gizlilik Politikası");
27638
- setPolicyModalText(vm.privacyPolicy);
27768
+ vm.policyModalTitle = "Gizlilik Politikası";
27769
+ vm.policyModalText = vm.returnPolicy;
27639
27770
  };
27640
27771
  var onTermsOfServiceClick = function () {
27641
- setPolicyModalTitle("Hizmet Şartları");
27642
- setPolicyModalText(vm.termsOfService);
27772
+ vm.policyModalTitle = "Hizmet Şartları";
27773
+ vm.policyModalText = vm.returnPolicy;
27643
27774
  };
27644
27775
  var onErrorClose = function () {
27645
27776
  vm.error = undefined;
@@ -27696,7 +27827,7 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27696
27827
  React.createElement("div", { className: styles$2.Right },
27697
27828
  React.createElement("div", { className: styles$2.RightContent },
27698
27829
  React.createElement(CartSummary, { vm: vm }))),
27699
- !!policyModalText && (React.createElement(PolicyModal, { title: policyModalTitle, modalContent: policyModalText, onClose: onPolicyModalClose })))));
27830
+ !!vm.policyModalText && (React.createElement(PolicyModal, { title: vm.policyModalTitle, modalContent: vm.policyModalText, onClose: onPolicyModalClose })))));
27700
27831
  });
27701
27832
 
27702
27833
  function ErrorComponent(_a) {
@@ -28535,11 +28666,12 @@ var SettingsHelper = /** @class */ (function () {
28535
28666
  SettingsHelper.getPageData = function (context, isServer, pageType) {
28536
28667
  var _a;
28537
28668
  return __awaiter(this, void 0, void 0, function () {
28538
- var locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
28669
+ var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
28539
28670
  return __generator(this, function (_b) {
28540
28671
  switch (_b.label) {
28541
28672
  case 0:
28542
- locale = context.locale;
28673
+ isLocal = process.env.NEXT_PUBLIC_ENV === "local";
28674
+ locale = isLocal ? "en" : context.locale;
28543
28675
  if (!locale) {
28544
28676
  return [2 /*return*/, {
28545
28677
  props: {},
@@ -28823,15 +28955,18 @@ var _slug_ = /*#__PURE__*/Object.freeze({
28823
28955
  });
28824
28956
 
28825
28957
  var CheckoutPage = function (_a) {
28826
- var checkoutStr = _a.checkoutStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "configJson"]);
28958
+ var checkoutStr = _a.checkoutStr, checkoutSettingsStr = _a.checkoutSettingsStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "checkoutSettingsStr", "configJson"]);
28827
28959
  IkasStorefrontConfig.initWithJson(configJson);
28828
28960
  Analytics.disableHTML();
28829
28961
  var checkout = new IkasCheckout(JSON.parse(checkoutStr));
28830
- return React.createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
28962
+ var checkoutSettings = checkoutSettingsStr
28963
+ ? new IkasCheckoutSettings(JSON.parse(checkoutSettingsStr))
28964
+ : new IkasCheckoutSettings();
28965
+ return (React.createElement(IkasCheckoutPage, __assign({ checkout: checkout, checkoutSettings: checkoutSettings }, others)));
28831
28966
  };
28832
28967
  var _id_ = mobxReactLite.observer(CheckoutPage);
28833
28968
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28834
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout;
28969
+ var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
28835
28970
  return __generator(this, function (_a) {
28836
28971
  switch (_a.label) {
28837
28972
  case 0:
@@ -28865,20 +29000,23 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
28865
29000
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
28866
29001
  case 2:
28867
29002
  checkout = _a.sent();
28868
- if (checkout) {
28869
- return [2 /*return*/, {
28870
- props: {
28871
- checkoutStr: JSON.stringify(checkout),
28872
- returnPolicy: themeLocalization.returnPolicy || "",
28873
- privacyPolicy: themeLocalization.privacyPolicy || "",
28874
- termsOfService: themeLocalization.termsOfService || "",
28875
- queryParams: context.query,
28876
- },
28877
- }];
28878
- }
28879
- else {
28880
- return [2 /*return*/, redirect()];
28881
- }
29003
+ if (!checkout) return [3 /*break*/, 4];
29004
+ return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29005
+ case 3:
29006
+ checkoutSettings = _a.sent();
29007
+ return [2 /*return*/, {
29008
+ props: {
29009
+ checkoutStr: JSON.stringify(checkout),
29010
+ checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
29011
+ : null,
29012
+ configJson: IkasStorefrontConfig.getJson(),
29013
+ returnPolicy: themeLocalization.returnPolicy || "",
29014
+ privacyPolicy: themeLocalization.privacyPolicy || "",
29015
+ termsOfService: themeLocalization.termsOfService || "",
29016
+ queryParams: context.query,
29017
+ },
29018
+ }];
29019
+ case 4: return [2 /*return*/, redirect()];
28882
29020
  }
28883
29021
  });
28884
29022
  }); };
@@ -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 {};
@@ -4,6 +4,7 @@ export declare type IkasPaymentGateway = {
4
4
  id: string | null;
5
5
  name: string;
6
6
  testMode: boolean | null;
7
+ description: string | null;
7
8
  };
8
9
  export declare type IkasPaymentMethod = {
9
10
  name: string;
@@ -4,6 +4,7 @@ import { GetServerSideProps } from "next";
4
4
  import { ParsedUrlQuery } from "querystring";
5
5
  declare type Props = {
6
6
  checkoutStr: string;
7
+ checkoutSettingsStr: string | null;
7
8
  returnPolicy: string;
8
9
  privacyPolicy: string;
9
10
  termsOfService: string;
@@ -22,13 +22,15 @@ export declare class IkasPageDataProvider {
22
22
  settingsStr: string;
23
23
  merchantSettings: string | null;
24
24
  configJson: {
25
- storefrontId: string | undefined;
26
- storefrontRoutingId: string | undefined;
27
- storefrontThemeId: string | undefined;
28
- salesChannelId: string | undefined;
29
- priceListId: string | undefined;
30
- stockLocationIds: string[] | undefined;
31
- routings: import("../../models/data/storefront/routing/index").IkasStorefrontRouting[];
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
  };