@ikas/storefront 1.0.15 → 1.0.16-alpha.2
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/api/blog/__generated__/getBlog.d.ts +1 -5
- package/build/api/blog/__generated__/listBlog.d.ts +1 -5
- package/build/api/blog/__generated__/listBlogCategory.d.ts +1 -5
- package/build/api/blog/__generated__/listBlogMetaData.d.ts +1 -5
- package/build/api/cart/__generated__/getCart.d.ts +2 -4
- package/build/api/cart/__generated__/saveItemToCart.d.ts +2 -4
- package/build/api/checkout/__generated__/getCheckoutById.d.ts +2 -4
- package/build/api/checkout/__generated__/getOrder.d.ts +5 -11
- package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +5 -11
- package/build/api/customer/__generated__/customerLogin.d.ts +1 -2
- package/build/api/customer/__generated__/customerSocialLogin.d.ts +161 -0
- package/build/api/customer/__generated__/getCustomerOrders.d.ts +5 -11
- package/build/api/customer/__generated__/getMyCustomer.d.ts +1 -2
- package/build/api/customer/__generated__/registerCustomer.d.ts +1 -2
- package/build/api/customer/__generated__/saveMyCustomer.d.ts +1 -2
- package/build/api/customer/index.d.ts +5 -0
- package/build/api/customer-review/__generated__/listCustomerReviews.d.ts +1 -5
- package/build/api/variant-type/__generated__/listVariantType.d.ts +2 -6
- package/build/index.es.js +592 -263
- package/build/index.js +592 -263
- package/build/models/data/product-option-set/index.d.ts +4 -0
- package/build/store/customer.d.ts +19 -0
- package/build/storefront/index.d.ts +3 -1
- package/package.json +4 -3
package/build/index.js
CHANGED
|
@@ -48,11 +48,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
48
48
|
var extendStatics = function(d, b) {
|
|
49
49
|
extendStatics = Object.setPrototypeOf ||
|
|
50
50
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
51
|
-
function (d, b) { for (var p in b) if (
|
|
51
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
52
52
|
return extendStatics(d, b);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
function __extends(d, b) {
|
|
56
|
+
if (typeof b !== "function" && b !== null)
|
|
57
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
56
58
|
extendStatics(d, b);
|
|
57
59
|
function __() { this.constructor = d; }
|
|
58
60
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -119,13 +121,16 @@ function __generator(thisArg, body) {
|
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
function __spreadArray(to, from, pack) {
|
|
125
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
126
|
+
if (ar || !(i in from)) {
|
|
127
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
128
|
+
ar[i] = from[i];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
128
132
|
}
|
|
133
|
+
|
|
129
134
|
function __makeTemplateObject(cooked, raw) {
|
|
130
135
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
131
136
|
return cooked;
|
|
@@ -3539,6 +3544,133 @@ gql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;
|
|
|
3539
3544
|
|
|
3540
3545
|
var src = gql;
|
|
3541
3546
|
|
|
3547
|
+
/*! *****************************************************************************
|
|
3548
|
+
Copyright (c) Microsoft Corporation.
|
|
3549
|
+
|
|
3550
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3551
|
+
purpose with or without fee is hereby granted.
|
|
3552
|
+
|
|
3553
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3554
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3555
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3556
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3557
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3558
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3559
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3560
|
+
***************************************************************************** */
|
|
3561
|
+
/* global Reflect, Promise */
|
|
3562
|
+
|
|
3563
|
+
var extendStatics$1 = function(d, b) {
|
|
3564
|
+
extendStatics$1 = Object.setPrototypeOf ||
|
|
3565
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3566
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3567
|
+
return extendStatics$1(d, b);
|
|
3568
|
+
};
|
|
3569
|
+
|
|
3570
|
+
function __extends$1(d, b) {
|
|
3571
|
+
extendStatics$1(d, b);
|
|
3572
|
+
function __() { this.constructor = d; }
|
|
3573
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
var __assign$1 = function() {
|
|
3577
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
3578
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3579
|
+
s = arguments[i];
|
|
3580
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3581
|
+
}
|
|
3582
|
+
return t;
|
|
3583
|
+
};
|
|
3584
|
+
return __assign$1.apply(this, arguments);
|
|
3585
|
+
};
|
|
3586
|
+
|
|
3587
|
+
function __rest$1(s, e) {
|
|
3588
|
+
var t = {};
|
|
3589
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3590
|
+
t[p] = s[p];
|
|
3591
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3592
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3593
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3594
|
+
t[p[i]] = s[p[i]];
|
|
3595
|
+
}
|
|
3596
|
+
return t;
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
function __awaiter$1(thisArg, _arguments, P, generator) {
|
|
3600
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3601
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3602
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
3603
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
3604
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
3605
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3606
|
+
});
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3609
|
+
function __generator$1(thisArg, body) {
|
|
3610
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
3611
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
3612
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
3613
|
+
function step(op) {
|
|
3614
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
3615
|
+
while (_) try {
|
|
3616
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3617
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
3618
|
+
switch (op[0]) {
|
|
3619
|
+
case 0: case 1: t = op; break;
|
|
3620
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
3621
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
3622
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
3623
|
+
default:
|
|
3624
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
3625
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
3626
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
3627
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
3628
|
+
if (t[2]) _.ops.pop();
|
|
3629
|
+
_.trys.pop(); continue;
|
|
3630
|
+
}
|
|
3631
|
+
op = body.call(thisArg, _);
|
|
3632
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
3633
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
function __spreadArrays() {
|
|
3638
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3639
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
3640
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
3641
|
+
r[k] = a[j];
|
|
3642
|
+
return r;
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
/*! *****************************************************************************
|
|
3646
|
+
Copyright (c) Microsoft Corporation.
|
|
3647
|
+
|
|
3648
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3649
|
+
purpose with or without fee is hereby granted.
|
|
3650
|
+
|
|
3651
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3652
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3653
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3654
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3655
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3656
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3657
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3658
|
+
***************************************************************************** */
|
|
3659
|
+
/* global Reflect, Promise */
|
|
3660
|
+
|
|
3661
|
+
var extendStatics$2 = function(d, b) {
|
|
3662
|
+
extendStatics$2 = Object.setPrototypeOf ||
|
|
3663
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3664
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3665
|
+
return extendStatics$2(d, b);
|
|
3666
|
+
};
|
|
3667
|
+
|
|
3668
|
+
function __extends$2(d, b) {
|
|
3669
|
+
extendStatics$2(d, b);
|
|
3670
|
+
function __() { this.constructor = d; }
|
|
3671
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3542
3674
|
(function (Object) {
|
|
3543
3675
|
typeof globalThis !== 'object' && (
|
|
3544
3676
|
this ?
|
|
@@ -3562,7 +3694,7 @@ var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj,
|
|
|
3562
3694
|
return obj;
|
|
3563
3695
|
} : _a;
|
|
3564
3696
|
var InvariantError = /** @class */ (function (_super) {
|
|
3565
|
-
__extends(InvariantError, _super);
|
|
3697
|
+
__extends$2(InvariantError, _super);
|
|
3566
3698
|
function InvariantError(message) {
|
|
3567
3699
|
if (message === void 0) { message = genericMessage; }
|
|
3568
3700
|
var _this = _super.call(this, typeof message === "number"
|
|
@@ -4321,7 +4453,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
4321
4453
|
process.env.NODE_ENV === "production" ? invariant$1(fragments.length === 1, 43) : invariant$1(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");
|
|
4322
4454
|
actualFragmentName = fragments[0].name.value;
|
|
4323
4455
|
}
|
|
4324
|
-
var query = __assign(__assign({}, document), { definitions: __spreadArrays([
|
|
4456
|
+
var query = __assign$1(__assign$1({}, document), { definitions: __spreadArrays([
|
|
4325
4457
|
{
|
|
4326
4458
|
kind: 'OperationDefinition',
|
|
4327
4459
|
operation: 'query',
|
|
@@ -4805,7 +4937,7 @@ function addTypenameToDocument(doc) {
|
|
|
4805
4937
|
field.directives.some(function (d) { return d.name.value === 'export'; })) {
|
|
4806
4938
|
return;
|
|
4807
4939
|
}
|
|
4808
|
-
return __assign(__assign({}, node), { selections: __spreadArrays(selections, [TYPENAME_FIELD]) });
|
|
4940
|
+
return __assign$1(__assign$1({}, node), { selections: __spreadArrays(selections, [TYPENAME_FIELD]) });
|
|
4809
4941
|
},
|
|
4810
4942
|
},
|
|
4811
4943
|
});
|
|
@@ -4845,7 +4977,7 @@ function removeArgumentsFromDocument(config, doc) {
|
|
|
4845
4977
|
return nullIfDocIsEmpty(visit(doc, {
|
|
4846
4978
|
OperationDefinition: {
|
|
4847
4979
|
enter: function (node) {
|
|
4848
|
-
return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) {
|
|
4980
|
+
return __assign$1(__assign$1({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) {
|
|
4849
4981
|
return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });
|
|
4850
4982
|
}) : [] });
|
|
4851
4983
|
},
|
|
@@ -4910,7 +5042,7 @@ function buildQueryFromSelectionSet(document) {
|
|
|
4910
5042
|
var modifiedDoc = visit(document, {
|
|
4911
5043
|
OperationDefinition: {
|
|
4912
5044
|
enter: function (node) {
|
|
4913
|
-
return __assign(__assign({}, node), { operation: 'query' });
|
|
5045
|
+
return __assign$1(__assign$1({}, node), { operation: 'query' });
|
|
4914
5046
|
},
|
|
4915
5047
|
},
|
|
4916
5048
|
});
|
|
@@ -5008,7 +5140,7 @@ var DeepMerger = (function () {
|
|
|
5008
5140
|
value = value.slice(0);
|
|
5009
5141
|
}
|
|
5010
5142
|
else {
|
|
5011
|
-
value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);
|
|
5143
|
+
value = __assign$1({ __proto__: Object.getPrototypeOf(value) }, value);
|
|
5012
5144
|
}
|
|
5013
5145
|
this.pastCopies.add(value);
|
|
5014
5146
|
}
|
|
@@ -5809,7 +5941,7 @@ function isPromiseLike(value) {
|
|
|
5809
5941
|
return value && typeof value.then === "function";
|
|
5810
5942
|
}
|
|
5811
5943
|
var Concast = (function (_super) {
|
|
5812
|
-
__extends(Concast, _super);
|
|
5944
|
+
__extends$1(Concast, _super);
|
|
5813
5945
|
function Concast(sources) {
|
|
5814
5946
|
var _this = _super.call(this, function (observer) {
|
|
5815
5947
|
_this.addObserver(observer);
|
|
@@ -6000,16 +6132,16 @@ function validateOperation(operation) {
|
|
|
6000
6132
|
}
|
|
6001
6133
|
|
|
6002
6134
|
function createOperation(starting, operation) {
|
|
6003
|
-
var context = __assign({}, starting);
|
|
6135
|
+
var context = __assign$1({}, starting);
|
|
6004
6136
|
var setContext = function (next) {
|
|
6005
6137
|
if (typeof next === 'function') {
|
|
6006
|
-
context = __assign(__assign({}, context), next(context));
|
|
6138
|
+
context = __assign$1(__assign$1({}, context), next(context));
|
|
6007
6139
|
}
|
|
6008
6140
|
else {
|
|
6009
|
-
context = __assign(__assign({}, context), next);
|
|
6141
|
+
context = __assign$1(__assign$1({}, context), next);
|
|
6010
6142
|
}
|
|
6011
6143
|
};
|
|
6012
|
-
var getContext = function () { return (__assign({}, context)); };
|
|
6144
|
+
var getContext = function () { return (__assign$1({}, context)); };
|
|
6013
6145
|
Object.defineProperty(operation, 'setContext', {
|
|
6014
6146
|
enumerable: false,
|
|
6015
6147
|
value: setContext,
|
|
@@ -6047,7 +6179,7 @@ function isTerminating(link) {
|
|
|
6047
6179
|
return link.request.length <= 1;
|
|
6048
6180
|
}
|
|
6049
6181
|
var LinkError = (function (_super) {
|
|
6050
|
-
__extends(LinkError, _super);
|
|
6182
|
+
__extends$1(LinkError, _super);
|
|
6051
6183
|
function LinkError(message, link) {
|
|
6052
6184
|
var _this = _super.call(this, message) || this;
|
|
6053
6185
|
_this.link = link;
|
|
@@ -6202,13 +6334,13 @@ var selectHttpOptionsAndBody = function (operation, fallbackConfig) {
|
|
|
6202
6334
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
6203
6335
|
configs[_i - 2] = arguments[_i];
|
|
6204
6336
|
}
|
|
6205
|
-
var options = __assign(__assign({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });
|
|
6337
|
+
var options = __assign$1(__assign$1({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });
|
|
6206
6338
|
var http = fallbackConfig.http || {};
|
|
6207
6339
|
configs.forEach(function (config) {
|
|
6208
|
-
options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });
|
|
6340
|
+
options = __assign$1(__assign$1(__assign$1({}, options), config.options), { headers: __assign$1(__assign$1({}, options.headers), config.headers) });
|
|
6209
6341
|
if (config.credentials)
|
|
6210
6342
|
options.credentials = config.credentials;
|
|
6211
|
-
http = __assign(__assign({}, http), config.http);
|
|
6343
|
+
http = __assign$1(__assign$1({}, http), config.http);
|
|
6212
6344
|
});
|
|
6213
6345
|
var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;
|
|
6214
6346
|
var body = { operationName: operationName, variables: variables };
|
|
@@ -6294,7 +6426,7 @@ function rewriteURIForGET(chosenURI, body) {
|
|
|
6294
6426
|
|
|
6295
6427
|
var createHttpLink = function (linkOptions) {
|
|
6296
6428
|
if (linkOptions === void 0) { linkOptions = {}; }
|
|
6297
|
-
var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, _b = linkOptions.includeUnusedVariables, includeUnusedVariables = _b === void 0 ? false : _b, requestOptions = __rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries", "includeUnusedVariables"]);
|
|
6429
|
+
var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, _b = linkOptions.includeUnusedVariables, includeUnusedVariables = _b === void 0 ? false : _b, requestOptions = __rest$1(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries", "includeUnusedVariables"]);
|
|
6298
6430
|
checkFetcher(fetcher);
|
|
6299
6431
|
if (!fetcher) {
|
|
6300
6432
|
fetcher = fetch;
|
|
@@ -6318,7 +6450,7 @@ var createHttpLink = function (linkOptions) {
|
|
|
6318
6450
|
clientAwarenessHeaders['apollographql-client-version'] = version;
|
|
6319
6451
|
}
|
|
6320
6452
|
}
|
|
6321
|
-
var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);
|
|
6453
|
+
var contextHeaders = __assign$1(__assign$1({}, clientAwarenessHeaders), context.headers);
|
|
6322
6454
|
var contextConfig = {
|
|
6323
6455
|
http: context.http,
|
|
6324
6456
|
options: context.fetchOptions,
|
|
@@ -6336,7 +6468,7 @@ var createHttpLink = function (linkOptions) {
|
|
|
6336
6468
|
},
|
|
6337
6469
|
});
|
|
6338
6470
|
if (unusedNames_1.size) {
|
|
6339
|
-
body.variables = __assign({}, body.variables);
|
|
6471
|
+
body.variables = __assign$1({}, body.variables);
|
|
6340
6472
|
unusedNames_1.forEach(function (name) {
|
|
6341
6473
|
delete body.variables[name];
|
|
6342
6474
|
});
|
|
@@ -6400,7 +6532,7 @@ var createHttpLink = function (linkOptions) {
|
|
|
6400
6532
|
};
|
|
6401
6533
|
|
|
6402
6534
|
var HttpLink = (function (_super) {
|
|
6403
|
-
__extends(HttpLink, _super);
|
|
6535
|
+
__extends$1(HttpLink, _super);
|
|
6404
6536
|
function HttpLink(options) {
|
|
6405
6537
|
if (options === void 0) { options = {}; }
|
|
6406
6538
|
var _this = _super.call(this, createHttpLink(options).request) || this;
|
|
@@ -6601,7 +6733,7 @@ var generateErrorMessage = function (err) {
|
|
|
6601
6733
|
return message;
|
|
6602
6734
|
};
|
|
6603
6735
|
var ApolloError = (function (_super) {
|
|
6604
|
-
__extends(ApolloError, _super);
|
|
6736
|
+
__extends$1(ApolloError, _super);
|
|
6605
6737
|
function ApolloError(_a) {
|
|
6606
6738
|
var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;
|
|
6607
6739
|
var _this = _super.call(this, errorMessage) || this;
|
|
@@ -6713,7 +6845,7 @@ var Reobserver = (function () {
|
|
|
6713
6845
|
|
|
6714
6846
|
var warnedAboutUpdateQuery = false;
|
|
6715
6847
|
var ObservableQuery = (function (_super) {
|
|
6716
|
-
__extends(ObservableQuery, _super);
|
|
6848
|
+
__extends$1(ObservableQuery, _super);
|
|
6717
6849
|
function ObservableQuery(_a) {
|
|
6718
6850
|
var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options;
|
|
6719
6851
|
var _this = _super.call(this, function (observer) {
|
|
@@ -6729,7 +6861,7 @@ var ObservableQuery = (function (_super) {
|
|
|
6729
6861
|
}
|
|
6730
6862
|
},
|
|
6731
6863
|
error: function (error) {
|
|
6732
|
-
_this.updateLastResult(__assign(__assign({}, _this.lastResult), { error: error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false }));
|
|
6864
|
+
_this.updateLastResult(__assign$1(__assign$1({}, _this.lastResult), { error: error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false }));
|
|
6733
6865
|
iterateObserversSafely(_this.observers, 'error', _this.lastError = error);
|
|
6734
6866
|
},
|
|
6735
6867
|
};
|
|
@@ -6774,7 +6906,7 @@ var ObservableQuery = (function (_super) {
|
|
|
6774
6906
|
var networkStatus = this.queryInfo.networkStatus ||
|
|
6775
6907
|
(lastResult && lastResult.networkStatus) ||
|
|
6776
6908
|
NetworkStatus.ready;
|
|
6777
|
-
var result = __assign(__assign({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });
|
|
6909
|
+
var result = __assign$1(__assign$1({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });
|
|
6778
6910
|
if (this.isTornDown) {
|
|
6779
6911
|
return result;
|
|
6780
6912
|
}
|
|
@@ -6835,13 +6967,13 @@ var ObservableQuery = (function (_super) {
|
|
|
6835
6967
|
reobserveOptions.nextFetchPolicy = fetchPolicy || "cache-first";
|
|
6836
6968
|
}
|
|
6837
6969
|
if (variables && !equal(this.options.variables, variables)) {
|
|
6838
|
-
reobserveOptions.variables = this.options.variables = __assign(__assign({}, this.options.variables), variables);
|
|
6970
|
+
reobserveOptions.variables = this.options.variables = __assign$1(__assign$1({}, this.options.variables), variables);
|
|
6839
6971
|
}
|
|
6840
6972
|
return this.newReobserver(false).reobserve(reobserveOptions, NetworkStatus.refetch);
|
|
6841
6973
|
};
|
|
6842
6974
|
ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {
|
|
6843
6975
|
var _this = this;
|
|
6844
|
-
var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign({}, this.options), fetchMoreOptions), { variables: __assign(__assign({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: "no-cache" });
|
|
6976
|
+
var combinedOptions = __assign$1(__assign$1({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign$1(__assign$1(__assign$1({}, this.options), fetchMoreOptions), { variables: __assign$1(__assign$1({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: "no-cache" });
|
|
6845
6977
|
var qid = this.queryManager.generateQueryId();
|
|
6846
6978
|
if (combinedOptions.notifyOnNetworkStatusChange) {
|
|
6847
6979
|
this.queryInfo.networkStatus = NetworkStatus.fetchMore;
|
|
@@ -7014,7 +7146,7 @@ var ObservableQuery = (function (_super) {
|
|
|
7014
7146
|
var _this = this;
|
|
7015
7147
|
var _a = this, queryManager = _a.queryManager, queryId = _a.queryId;
|
|
7016
7148
|
queryManager.setObservableQuery(this);
|
|
7017
|
-
return new Reobserver(this.observer, shareOptions ? this.options : __assign({}, this.options), function (currentOptions, newNetworkStatus) {
|
|
7149
|
+
return new Reobserver(this.observer, shareOptions ? this.options : __assign$1({}, this.options), function (currentOptions, newNetworkStatus) {
|
|
7018
7150
|
queryManager.setObservableQuery(_this);
|
|
7019
7151
|
return queryManager.fetchQueryObservable(queryId, currentOptions, newNetworkStatus);
|
|
7020
7152
|
}, !queryManager.ssrMode && (function () { return !isNetworkRequestInFlight(_this.queryInfo.networkStatus); }));
|
|
@@ -7848,7 +7980,7 @@ var EntityStore = (function () {
|
|
|
7848
7980
|
};
|
|
7849
7981
|
}
|
|
7850
7982
|
EntityStore.prototype.toObject = function () {
|
|
7851
|
-
return __assign({}, this.data);
|
|
7983
|
+
return __assign$1({}, this.data);
|
|
7852
7984
|
};
|
|
7853
7985
|
EntityStore.prototype.has = function (dataId) {
|
|
7854
7986
|
return this.lookup(dataId, true) !== void 0;
|
|
@@ -7938,7 +8070,7 @@ var EntityStore = (function () {
|
|
|
7938
8070
|
: fields[storeFieldName] || fields[fieldName];
|
|
7939
8071
|
if (modify) {
|
|
7940
8072
|
var newValue = modify === delModifier ? DELETE :
|
|
7941
|
-
modify(maybeDeepFreeze(fieldValue), __assign(__assign({}, sharedDetails_1), { fieldName: fieldName,
|
|
8073
|
+
modify(maybeDeepFreeze(fieldValue), __assign$1(__assign$1({}, sharedDetails_1), { fieldName: fieldName,
|
|
7942
8074
|
storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) }));
|
|
7943
8075
|
if (newValue === INVALIDATE) {
|
|
7944
8076
|
_this.group.dirty(dataId, storeFieldName);
|
|
@@ -8027,7 +8159,7 @@ var EntityStore = (function () {
|
|
|
8027
8159
|
}
|
|
8028
8160
|
});
|
|
8029
8161
|
if (newData) {
|
|
8030
|
-
var __META = newData.__META, rest_1 = __rest(newData, ["__META"]);
|
|
8162
|
+
var __META = newData.__META, rest_1 = __rest$1(newData, ["__META"]);
|
|
8031
8163
|
Object.keys(rest_1).forEach(function (dataId) {
|
|
8032
8164
|
_this.merge(dataId, rest_1[dataId]);
|
|
8033
8165
|
});
|
|
@@ -8133,7 +8265,7 @@ function makeDepKey(dataId, storeFieldName) {
|
|
|
8133
8265
|
}
|
|
8134
8266
|
(function (EntityStore) {
|
|
8135
8267
|
var Root = (function (_super) {
|
|
8136
|
-
__extends(Root, _super);
|
|
8268
|
+
__extends$1(Root, _super);
|
|
8137
8269
|
function Root(_a) {
|
|
8138
8270
|
var policies = _a.policies, _b = _a.resultCaching, resultCaching = _b === void 0 ? true : _b, seed = _a.seed;
|
|
8139
8271
|
var _this = _super.call(this, policies, new CacheGroup(resultCaching)) || this;
|
|
@@ -8157,7 +8289,7 @@ function makeDepKey(dataId, storeFieldName) {
|
|
|
8157
8289
|
EntityStore.Root = Root;
|
|
8158
8290
|
})(EntityStore || (EntityStore = {}));
|
|
8159
8291
|
var Layer = (function (_super) {
|
|
8160
|
-
__extends(Layer, _super);
|
|
8292
|
+
__extends$1(Layer, _super);
|
|
8161
8293
|
function Layer(id, parent, replay, group) {
|
|
8162
8294
|
var _this = _super.call(this, parent.policies, group) || this;
|
|
8163
8295
|
_this.id = id;
|
|
@@ -8188,11 +8320,11 @@ var Layer = (function (_super) {
|
|
|
8188
8320
|
return parent.addLayer(this.id, this.replay);
|
|
8189
8321
|
};
|
|
8190
8322
|
Layer.prototype.toObject = function () {
|
|
8191
|
-
return __assign(__assign({}, this.parent.toObject()), this.data);
|
|
8323
|
+
return __assign$1(__assign$1({}, this.parent.toObject()), this.data);
|
|
8192
8324
|
};
|
|
8193
8325
|
Layer.prototype.findChildRefIds = function (dataId) {
|
|
8194
8326
|
var fromParent = this.parent.findChildRefIds(dataId);
|
|
8195
|
-
return hasOwn.call(this.data, dataId) ? __assign(__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;
|
|
8327
|
+
return hasOwn.call(this.data, dataId) ? __assign$1(__assign$1({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;
|
|
8196
8328
|
};
|
|
8197
8329
|
Layer.prototype.getStorage = function () {
|
|
8198
8330
|
var p = this.parent;
|
|
@@ -8243,12 +8375,12 @@ var StoreReader = (function () {
|
|
|
8243
8375
|
}
|
|
8244
8376
|
}
|
|
8245
8377
|
});
|
|
8246
|
-
this.config = __assign({ addTypename: true }, config);
|
|
8378
|
+
this.config = __assign$1({ addTypename: true }, config);
|
|
8247
8379
|
}
|
|
8248
8380
|
StoreReader.prototype.diffQueryAgainstStore = function (_a) {
|
|
8249
8381
|
var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? 'ROOT_QUERY' : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c;
|
|
8250
8382
|
var policies = this.config.cache.policies;
|
|
8251
|
-
variables = __assign(__assign({}, getDefaultValues(getQueryDefinition(query))), variables);
|
|
8383
|
+
variables = __assign$1(__assign$1({}, getDefaultValues(getQueryDefinition(query))), variables);
|
|
8252
8384
|
var execResult = this.executeSelectionSet({
|
|
8253
8385
|
selectionSet: getMainDefinition(query).selectionSet,
|
|
8254
8386
|
objectOrReference: makeReference(rootId),
|
|
@@ -8444,7 +8576,7 @@ var StoreWriter = (function () {
|
|
|
8444
8576
|
var query = _a.query, result = _a.result, dataId = _a.dataId, store = _a.store, variables = _a.variables;
|
|
8445
8577
|
var operationDefinition = getOperationDefinition(query);
|
|
8446
8578
|
var merger = makeProcessedFieldsMerger();
|
|
8447
|
-
variables = __assign(__assign({}, getDefaultValues(operationDefinition)), variables);
|
|
8579
|
+
variables = __assign$1(__assign$1({}, getDefaultValues(operationDefinition)), variables);
|
|
8448
8580
|
var ref = this.processSelectionSet({
|
|
8449
8581
|
result: result || Object.create(null),
|
|
8450
8582
|
dataId: dataId,
|
|
@@ -8623,7 +8755,7 @@ var StoreWriter = (function () {
|
|
|
8623
8755
|
}
|
|
8624
8756
|
});
|
|
8625
8757
|
if (changedFields_1) {
|
|
8626
|
-
incoming = (Array.isArray(i_1) ? i_1.slice(0) : __assign({}, i_1));
|
|
8758
|
+
incoming = (Array.isArray(i_1) ? i_1.slice(0) : __assign$1({}, i_1));
|
|
8627
8759
|
changedFields_1.forEach(function (value, name) {
|
|
8628
8760
|
incoming[name] = value;
|
|
8629
8761
|
});
|
|
@@ -8804,7 +8936,7 @@ var Policies = (function () {
|
|
|
8804
8936
|
this.rootIdsByTypename = Object.create(null);
|
|
8805
8937
|
this.rootTypenamesById = Object.create(null);
|
|
8806
8938
|
this.usingPossibleTypes = false;
|
|
8807
|
-
this.config = __assign({ dataIdFromObject: defaultDataIdFromObject }, config);
|
|
8939
|
+
this.config = __assign$1({ dataIdFromObject: defaultDataIdFromObject }, config);
|
|
8808
8940
|
this.cache = this.config.cache;
|
|
8809
8941
|
this.setRootTypename("Query");
|
|
8810
8942
|
this.setRootTypename("Mutation");
|
|
@@ -8847,7 +8979,7 @@ var Policies = (function () {
|
|
|
8847
8979
|
Policies.prototype.addTypePolicies = function (typePolicies) {
|
|
8848
8980
|
var _this = this;
|
|
8849
8981
|
Object.keys(typePolicies).forEach(function (typename) {
|
|
8850
|
-
var _a = typePolicies[typename], queryType = _a.queryType, mutationType = _a.mutationType, subscriptionType = _a.subscriptionType, incoming = __rest(_a, ["queryType", "mutationType", "subscriptionType"]);
|
|
8982
|
+
var _a = typePolicies[typename], queryType = _a.queryType, mutationType = _a.mutationType, subscriptionType = _a.subscriptionType, incoming = __rest$1(_a, ["queryType", "mutationType", "subscriptionType"]);
|
|
8851
8983
|
if (queryType)
|
|
8852
8984
|
_this.setRootTypename("Query", typename);
|
|
8853
8985
|
if (mutationType)
|
|
@@ -8938,7 +9070,7 @@ var Policies = (function () {
|
|
|
8938
9070
|
var supertypes = this.supertypeMap.get(typename);
|
|
8939
9071
|
if (supertypes && supertypes.size) {
|
|
8940
9072
|
supertypes.forEach(function (supertype) {
|
|
8941
|
-
var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = __rest(_a, ["fields"]);
|
|
9073
|
+
var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = __rest$1(_a, ["fields"]);
|
|
8942
9074
|
Object.assign(policy_1, rest);
|
|
8943
9075
|
Object.assign(policy_1.fields, fields);
|
|
8944
9076
|
});
|
|
@@ -9117,7 +9249,7 @@ function makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, contex
|
|
|
9117
9249
|
var options = typeof fieldNameOrOptions === "string" ? {
|
|
9118
9250
|
fieldName: fieldNameOrOptions,
|
|
9119
9251
|
from: from,
|
|
9120
|
-
} : __assign({}, fieldNameOrOptions);
|
|
9252
|
+
} : __assign$1({}, fieldNameOrOptions);
|
|
9121
9253
|
if (void 0 === options.from) {
|
|
9122
9254
|
options.from = objectOrReference;
|
|
9123
9255
|
}
|
|
@@ -9144,7 +9276,7 @@ function makeMergeObjectsFunction(getFieldValue) {
|
|
|
9144
9276
|
!storeValueIsStoreObject(incoming)) {
|
|
9145
9277
|
return incoming;
|
|
9146
9278
|
}
|
|
9147
|
-
return __assign(__assign({}, existing), incoming);
|
|
9279
|
+
return __assign$1(__assign$1({}, existing), incoming);
|
|
9148
9280
|
}
|
|
9149
9281
|
return incoming;
|
|
9150
9282
|
};
|
|
@@ -9233,7 +9365,7 @@ var defaultConfig = {
|
|
|
9233
9365
|
typePolicies: {},
|
|
9234
9366
|
};
|
|
9235
9367
|
var InMemoryCache = (function (_super) {
|
|
9236
|
-
__extends(InMemoryCache, _super);
|
|
9368
|
+
__extends$1(InMemoryCache, _super);
|
|
9237
9369
|
function InMemoryCache(config) {
|
|
9238
9370
|
if (config === void 0) { config = {}; }
|
|
9239
9371
|
var _this = _super.call(this) || this;
|
|
@@ -9253,7 +9385,7 @@ var InMemoryCache = (function (_super) {
|
|
|
9253
9385
|
}
|
|
9254
9386
|
});
|
|
9255
9387
|
_this.watchDep = dep();
|
|
9256
|
-
_this.config = __assign(__assign({}, defaultConfig), config);
|
|
9388
|
+
_this.config = __assign$1(__assign$1({}, defaultConfig), config);
|
|
9257
9389
|
_this.addTypename = !!_this.config.addTypename;
|
|
9258
9390
|
_this.policies = new Policies({
|
|
9259
9391
|
cache: _this,
|
|
@@ -9376,7 +9508,7 @@ var InMemoryCache = (function (_super) {
|
|
|
9376
9508
|
if (hasOwn.call(options, "id")) {
|
|
9377
9509
|
return false;
|
|
9378
9510
|
}
|
|
9379
|
-
options = __assign(__assign({}, options), { id: "ROOT_QUERY" });
|
|
9511
|
+
options = __assign$1(__assign$1({}, options), { id: "ROOT_QUERY" });
|
|
9380
9512
|
}
|
|
9381
9513
|
try {
|
|
9382
9514
|
++this.txCount;
|
|
@@ -9500,10 +9632,10 @@ var LocalState = (function () {
|
|
|
9500
9632
|
};
|
|
9501
9633
|
LocalState.prototype.runResolvers = function (_a) {
|
|
9502
9634
|
var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b;
|
|
9503
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
9504
|
-
return __generator(this, function (_c) {
|
|
9635
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
9636
|
+
return __generator$1(this, function (_c) {
|
|
9505
9637
|
if (document) {
|
|
9506
|
-
return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })];
|
|
9638
|
+
return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign$1(__assign$1({}, remoteResult), { data: localResult.result })); })];
|
|
9507
9639
|
}
|
|
9508
9640
|
return [2, remoteResult];
|
|
9509
9641
|
});
|
|
@@ -9528,7 +9660,7 @@ var LocalState = (function () {
|
|
|
9528
9660
|
};
|
|
9529
9661
|
LocalState.prototype.prepareContext = function (context) {
|
|
9530
9662
|
var cache = this.cache;
|
|
9531
|
-
return __assign(__assign({}, context), { cache: cache,
|
|
9663
|
+
return __assign$1(__assign$1({}, context), { cache: cache,
|
|
9532
9664
|
getCacheKey: function (obj) {
|
|
9533
9665
|
return cache.identify(obj);
|
|
9534
9666
|
} });
|
|
@@ -9536,12 +9668,12 @@ var LocalState = (function () {
|
|
|
9536
9668
|
LocalState.prototype.addExportedVariables = function (document, variables, context) {
|
|
9537
9669
|
if (variables === void 0) { variables = {}; }
|
|
9538
9670
|
if (context === void 0) { context = {}; }
|
|
9539
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
9540
|
-
return __generator(this, function (_a) {
|
|
9671
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
9672
|
+
return __generator$1(this, function (_a) {
|
|
9541
9673
|
if (document) {
|
|
9542
|
-
return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign(__assign({}, variables), data.exportedVariables)); })];
|
|
9674
|
+
return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign$1(__assign$1({}, variables), data.exportedVariables)); })];
|
|
9543
9675
|
}
|
|
9544
|
-
return [2, __assign({}, variables)];
|
|
9676
|
+
return [2, __assign$1({}, variables)];
|
|
9545
9677
|
});
|
|
9546
9678
|
});
|
|
9547
9679
|
};
|
|
@@ -9578,9 +9710,9 @@ var LocalState = (function () {
|
|
|
9578
9710
|
if (variables === void 0) { variables = {}; }
|
|
9579
9711
|
if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }
|
|
9580
9712
|
if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }
|
|
9581
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
9713
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
9582
9714
|
var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext;
|
|
9583
|
-
return __generator(this, function (_b) {
|
|
9715
|
+
return __generator$1(this, function (_b) {
|
|
9584
9716
|
mainDefinition = getMainDefinition(document);
|
|
9585
9717
|
fragments = getFragmentDefinitions(document);
|
|
9586
9718
|
fragmentMap = createFragmentMap(fragments);
|
|
@@ -9593,7 +9725,7 @@ var LocalState = (function () {
|
|
|
9593
9725
|
_a = this, cache = _a.cache, client = _a.client;
|
|
9594
9726
|
execContext = {
|
|
9595
9727
|
fragmentMap: fragmentMap,
|
|
9596
|
-
context: __assign(__assign({}, context), { cache: cache,
|
|
9728
|
+
context: __assign$1(__assign$1({}, context), { cache: cache,
|
|
9597
9729
|
client: client }),
|
|
9598
9730
|
variables: variables,
|
|
9599
9731
|
fragmentMatcher: fragmentMatcher,
|
|
@@ -9609,15 +9741,15 @@ var LocalState = (function () {
|
|
|
9609
9741
|
});
|
|
9610
9742
|
};
|
|
9611
9743
|
LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) {
|
|
9612
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
9744
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
9613
9745
|
var fragmentMap, context, variables, resultsToMerge, execute;
|
|
9614
9746
|
var _this = this;
|
|
9615
|
-
return __generator(this, function (_a) {
|
|
9747
|
+
return __generator$1(this, function (_a) {
|
|
9616
9748
|
fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables;
|
|
9617
9749
|
resultsToMerge = [rootValue];
|
|
9618
|
-
execute = function (selection) { return __awaiter(_this, void 0, void 0, function () {
|
|
9750
|
+
execute = function (selection) { return __awaiter$1(_this, void 0, void 0, function () {
|
|
9619
9751
|
var fragment, typeCondition;
|
|
9620
|
-
return __generator(this, function (_a) {
|
|
9752
|
+
return __generator$1(this, function (_a) {
|
|
9621
9753
|
if (!shouldInclude(selection, variables)) {
|
|
9622
9754
|
return [2];
|
|
9623
9755
|
}
|
|
@@ -9656,10 +9788,10 @@ var LocalState = (function () {
|
|
|
9656
9788
|
});
|
|
9657
9789
|
};
|
|
9658
9790
|
LocalState.prototype.resolveField = function (field, rootValue, execContext) {
|
|
9659
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
9791
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
9660
9792
|
var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve;
|
|
9661
9793
|
var _this = this;
|
|
9662
|
-
return __generator(this, function (_a) {
|
|
9794
|
+
return __generator$1(this, function (_a) {
|
|
9663
9795
|
variables = execContext.variables;
|
|
9664
9796
|
fieldName = field.name.value;
|
|
9665
9797
|
aliasedFieldName = resultKeyNameFromField(field);
|
|
@@ -10008,9 +10140,9 @@ var QueryManager = (function () {
|
|
|
10008
10140
|
};
|
|
10009
10141
|
QueryManager.prototype.mutate = function (_a) {
|
|
10010
10142
|
var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueries = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e;
|
|
10011
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
10143
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
10012
10144
|
var mutationId, mutationStoreValue, self;
|
|
10013
|
-
return __generator(this, function (_f) {
|
|
10145
|
+
return __generator$1(this, function (_f) {
|
|
10014
10146
|
switch (_f.label) {
|
|
10015
10147
|
case 0:
|
|
10016
10148
|
process.env.NODE_ENV === "production" ? invariant$1(mutation, 13) : invariant$1(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.');
|
|
@@ -10046,7 +10178,7 @@ var QueryManager = (function () {
|
|
|
10046
10178
|
return [2, new Promise(function (resolve, reject) {
|
|
10047
10179
|
var storeResult;
|
|
10048
10180
|
var error;
|
|
10049
|
-
self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({
|
|
10181
|
+
self.getObservableFromLink(mutation, __assign$1(__assign$1({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({
|
|
10050
10182
|
next: function (result) {
|
|
10051
10183
|
if (graphQLResultHasError(result) && errorPolicy === 'none') {
|
|
10052
10184
|
error = new ApolloError({
|
|
@@ -10207,7 +10339,7 @@ var QueryManager = (function () {
|
|
|
10207
10339
|
: optimisticResponse;
|
|
10208
10340
|
return this.cache.recordOptimisticTransaction(function (cache) {
|
|
10209
10341
|
try {
|
|
10210
|
-
_this.markMutationResult(__assign(__assign({}, mutation), { result: { data: data } }), cache);
|
|
10342
|
+
_this.markMutationResult(__assign$1(__assign$1({}, mutation), { result: { data: data } }), cache);
|
|
10211
10343
|
}
|
|
10212
10344
|
catch (error) {
|
|
10213
10345
|
process.env.NODE_ENV === "production" || invariant$1.error(error);
|
|
@@ -10264,10 +10396,10 @@ var QueryManager = (function () {
|
|
|
10264
10396
|
return transformCache.get(document);
|
|
10265
10397
|
};
|
|
10266
10398
|
QueryManager.prototype.getVariables = function (document, variables) {
|
|
10267
|
-
return __assign(__assign({}, this.transform(document).defaultVars), variables);
|
|
10399
|
+
return __assign$1(__assign$1({}, this.transform(document).defaultVars), variables);
|
|
10268
10400
|
};
|
|
10269
10401
|
QueryManager.prototype.watchQuery = function (options) {
|
|
10270
|
-
options = __assign(__assign({}, options), { variables: this.getVariables(options.query, options.variables) });
|
|
10402
|
+
options = __assign$1(__assign$1({}, options), { variables: this.getVariables(options.query, options.variables) });
|
|
10271
10403
|
if (typeof options.notifyOnNetworkStatusChange === 'undefined') {
|
|
10272
10404
|
options.notifyOnNetworkStatusChange = false;
|
|
10273
10405
|
}
|
|
@@ -10425,7 +10557,7 @@ var QueryManager = (function () {
|
|
|
10425
10557
|
query: serverQuery,
|
|
10426
10558
|
variables: variables,
|
|
10427
10559
|
operationName: getOperationName(serverQuery) || void 0,
|
|
10428
|
-
context: this.prepareContext(__assign(__assign({}, context), { forceFetch: !deduplication })),
|
|
10560
|
+
context: this.prepareContext(__assign$1(__assign$1({}, context), { forceFetch: !deduplication })),
|
|
10429
10561
|
};
|
|
10430
10562
|
context = operation.context;
|
|
10431
10563
|
if (deduplication) {
|
|
@@ -10575,7 +10707,7 @@ var QueryManager = (function () {
|
|
|
10575
10707
|
!returnPartialData) {
|
|
10576
10708
|
process.env.NODE_ENV === "production" || invariant$1.warn("Missing cache result fields: " + diff.missing.map(function (m) { return m.path.join('.'); }).join(', '), diff.missing);
|
|
10577
10709
|
}
|
|
10578
|
-
var fromData = function (data) { return zenObservable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };
|
|
10710
|
+
var fromData = function (data) { return zenObservable.of(__assign$1({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };
|
|
10579
10711
|
if (_this.transform(query).hasForcedResolvers) {
|
|
10580
10712
|
return _this.localState.runResolvers({
|
|
10581
10713
|
document: query,
|
|
@@ -10647,7 +10779,7 @@ var QueryManager = (function () {
|
|
|
10647
10779
|
QueryManager.prototype.prepareContext = function (context) {
|
|
10648
10780
|
if (context === void 0) { context = {}; }
|
|
10649
10781
|
var newContext = this.localState.prepareContext(context);
|
|
10650
|
-
return __assign(__assign({}, newContext), { clientAwareness: this.clientAwareness });
|
|
10782
|
+
return __assign$1(__assign$1({}, newContext), { clientAwareness: this.clientAwareness });
|
|
10651
10783
|
};
|
|
10652
10784
|
return QueryManager;
|
|
10653
10785
|
}());
|
|
@@ -10655,7 +10787,7 @@ var QueryManager = (function () {
|
|
|
10655
10787
|
var hasSuggestedDevtools = false;
|
|
10656
10788
|
function mergeOptions(defaults, options) {
|
|
10657
10789
|
return compact(defaults, options, options.variables && {
|
|
10658
|
-
variables: __assign(__assign({}, defaults.variables), options.variables),
|
|
10790
|
+
variables: __assign$1(__assign$1({}, defaults.variables), options.variables),
|
|
10659
10791
|
});
|
|
10660
10792
|
}
|
|
10661
10793
|
var ApolloClient = (function () {
|
|
@@ -10761,7 +10893,7 @@ var ApolloClient = (function () {
|
|
|
10761
10893
|
if (this.disableNetworkFetches &&
|
|
10762
10894
|
(options.fetchPolicy === 'network-only' ||
|
|
10763
10895
|
options.fetchPolicy === 'cache-and-network')) {
|
|
10764
|
-
options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });
|
|
10896
|
+
options = __assign$1(__assign$1({}, options), { fetchPolicy: 'cache-first' });
|
|
10765
10897
|
}
|
|
10766
10898
|
return this.queryManager.watchQuery(options);
|
|
10767
10899
|
};
|
|
@@ -10774,7 +10906,7 @@ var ApolloClient = (function () {
|
|
|
10774
10906
|
'to receive multiple results from the cache and the network, or consider ' +
|
|
10775
10907
|
'using a different fetchPolicy, such as cache-first or network-only.');
|
|
10776
10908
|
if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {
|
|
10777
|
-
options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' });
|
|
10909
|
+
options = __assign$1(__assign$1({}, options), { fetchPolicy: 'cache-first' });
|
|
10778
10910
|
}
|
|
10779
10911
|
return this.queryManager.query(options);
|
|
10780
10912
|
};
|
|
@@ -10930,7 +11062,7 @@ function onError(errorHandler) {
|
|
|
10930
11062
|
});
|
|
10931
11063
|
}
|
|
10932
11064
|
((function (_super) {
|
|
10933
|
-
__extends(ErrorLink, _super);
|
|
11065
|
+
__extends$1(ErrorLink, _super);
|
|
10934
11066
|
function ErrorLink(errorHandler) {
|
|
10935
11067
|
var _this = _super.call(this) || this;
|
|
10936
11068
|
_this.link = onError(errorHandler);
|
|
@@ -10944,7 +11076,7 @@ function onError(errorHandler) {
|
|
|
10944
11076
|
|
|
10945
11077
|
function setContext(setter) {
|
|
10946
11078
|
return new ApolloLink(function (operation, forward) {
|
|
10947
|
-
var request = __rest(operation, []);
|
|
11079
|
+
var request = __rest$1(operation, []);
|
|
10948
11080
|
return new zenObservable(function (observer) {
|
|
10949
11081
|
var handle;
|
|
10950
11082
|
Promise.resolve(request)
|
|
@@ -10978,13 +11110,14 @@ var IkasStorefrontConfig = /** @class */ (function () {
|
|
|
10978
11110
|
this.storefrontId = config.storefrontId;
|
|
10979
11111
|
}
|
|
10980
11112
|
};
|
|
10981
|
-
IkasStorefrontConfig.initWithJson = function (json) {
|
|
11113
|
+
IkasStorefrontConfig.initWithJson = function (json, router) {
|
|
10982
11114
|
try {
|
|
10983
11115
|
Object.entries(json).forEach(function (_a) {
|
|
10984
11116
|
var key = _a[0], value = _a[1];
|
|
10985
11117
|
//@ts-ignore
|
|
10986
11118
|
IkasStorefrontConfig[key] = value;
|
|
10987
11119
|
});
|
|
11120
|
+
IkasStorefrontConfig.router = router;
|
|
10988
11121
|
}
|
|
10989
11122
|
catch (err) {
|
|
10990
11123
|
console.log(err);
|
|
@@ -11058,7 +11191,7 @@ var Apollo = /** @class */ (function () {
|
|
|
11058
11191
|
});
|
|
11059
11192
|
var customFetch = function (uri, options) {
|
|
11060
11193
|
var operationName = JSON.parse(options.body).operationName;
|
|
11061
|
-
return fetch(uri
|
|
11194
|
+
return fetch("".concat(uri, "?op=").concat(operationName), options);
|
|
11062
11195
|
};
|
|
11063
11196
|
var httpLink = createHttpLink({
|
|
11064
11197
|
uri: IkasStorefrontConfig.apiUrlOverride || process.env.NEXT_PUBLIC_GQL_URL,
|
|
@@ -13489,9 +13622,9 @@ var IkasImage = /** @class */ (function () {
|
|
|
13489
13622
|
});
|
|
13490
13623
|
IkasImage.prototype.getSrc = function (size) {
|
|
13491
13624
|
if (this.id.includes("/"))
|
|
13492
|
-
return process.env.NEXT_PUBLIC_IMG_BASE_URL
|
|
13625
|
+
return "".concat(process.env.NEXT_PUBLIC_IMG_BASE_URL, "images/").concat(this.id, "/image_").concat(size, ".webp");
|
|
13493
13626
|
var merchantId = decodeBase64(this.editorApiKey || IkasStorefrontConfig.config.apiKey || "");
|
|
13494
|
-
return process.env.NEXT_PUBLIC_IMG_BASE_URL
|
|
13627
|
+
return "".concat(process.env.NEXT_PUBLIC_IMG_BASE_URL, "images/").concat(merchantId, "/").concat(this.id, "/image_").concat(size, ".webp");
|
|
13495
13628
|
};
|
|
13496
13629
|
return IkasImage;
|
|
13497
13630
|
}());
|
|
@@ -13527,7 +13660,7 @@ var IkasBlog = /** @class */ (function () {
|
|
|
13527
13660
|
var _a;
|
|
13528
13661
|
if (!((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.slug))
|
|
13529
13662
|
return "";
|
|
13530
|
-
return "/blog/"
|
|
13663
|
+
return "/blog/".concat(this.metadata.slug);
|
|
13531
13664
|
},
|
|
13532
13665
|
enumerable: false,
|
|
13533
13666
|
configurable: true
|
|
@@ -13592,7 +13725,7 @@ var IkasBlogCategory = /** @class */ (function () {
|
|
|
13592
13725
|
var _a;
|
|
13593
13726
|
if (!((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.slug))
|
|
13594
13727
|
return "";
|
|
13595
|
-
return "/blog/"
|
|
13728
|
+
return "/blog/".concat(this.metadata.slug);
|
|
13596
13729
|
},
|
|
13597
13730
|
enumerable: false,
|
|
13598
13731
|
configurable: true
|
|
@@ -13872,7 +14005,7 @@ var IkasBrand = /** @class */ (function () {
|
|
|
13872
14005
|
var _a;
|
|
13873
14006
|
if (!((_a = this.metaData) === null || _a === void 0 ? void 0 : _a.slug))
|
|
13874
14007
|
return "";
|
|
13875
|
-
return "/"
|
|
14008
|
+
return "/".concat(this.metaData.slug);
|
|
13876
14009
|
},
|
|
13877
14010
|
enumerable: false,
|
|
13878
14011
|
configurable: true
|
|
@@ -13917,7 +14050,7 @@ var IkasCategory = /** @class */ (function () {
|
|
|
13917
14050
|
var _a;
|
|
13918
14051
|
if (!((_a = this.metaData) === null || _a === void 0 ? void 0 : _a.slug))
|
|
13919
14052
|
return "";
|
|
13920
|
-
return "/"
|
|
14053
|
+
return "/".concat(this.metaData.slug);
|
|
13921
14054
|
},
|
|
13922
14055
|
enumerable: false,
|
|
13923
14056
|
configurable: true
|
|
@@ -13945,7 +14078,7 @@ var IkasCategoryPath = /** @class */ (function () {
|
|
|
13945
14078
|
get: function () {
|
|
13946
14079
|
if (!this.slug)
|
|
13947
14080
|
return "";
|
|
13948
|
-
return "/"
|
|
14081
|
+
return "/".concat(this.slug);
|
|
13949
14082
|
},
|
|
13950
14083
|
enumerable: false,
|
|
13951
14084
|
configurable: true
|
|
@@ -13977,7 +14110,7 @@ var IkasFilterCategory = /** @class */ (function () {
|
|
|
13977
14110
|
get: function () {
|
|
13978
14111
|
if (!this.slug)
|
|
13979
14112
|
return "";
|
|
13980
|
-
return "/"
|
|
14113
|
+
return "/".concat(this.slug);
|
|
13981
14114
|
},
|
|
13982
14115
|
enumerable: false,
|
|
13983
14116
|
configurable: true
|
|
@@ -14192,13 +14325,13 @@ var IkasOrderLineVariant = /** @class */ (function () {
|
|
|
14192
14325
|
return;
|
|
14193
14326
|
var variantParams = this.variantValues
|
|
14194
14327
|
.map(function (vv) {
|
|
14195
|
-
return vv.variantTypeSlug
|
|
14328
|
+
return "".concat(vv.variantTypeSlug, "=").concat(vv.variantNameSlug);
|
|
14196
14329
|
})
|
|
14197
14330
|
.join("&");
|
|
14198
14331
|
if (variantParams)
|
|
14199
|
-
return "/"
|
|
14332
|
+
return "/".concat(this.slug, "?").concat(variantParams);
|
|
14200
14333
|
else
|
|
14201
|
-
return "/"
|
|
14334
|
+
return "/".concat(this.slug);
|
|
14202
14335
|
},
|
|
14203
14336
|
enumerable: false,
|
|
14204
14337
|
configurable: true
|
|
@@ -20267,7 +20400,7 @@ var IkasCheckout = /** @class */ (function () {
|
|
|
20267
20400
|
Object.defineProperty(IkasCheckout.prototype, "customerFullName", {
|
|
20268
20401
|
get: function () {
|
|
20269
20402
|
var _a, _b;
|
|
20270
|
-
return (((_a = this.customer) === null || _a === void 0 ? void 0 : _a.firstName) || ""
|
|
20403
|
+
return "".concat(((_a = this.customer) === null || _a === void 0 ? void 0 : _a.firstName) || "", " ").concat(((_b = this.customer) === null || _b === void 0 ? void 0 : _b.lastName) || "");
|
|
20271
20404
|
},
|
|
20272
20405
|
enumerable: false,
|
|
20273
20406
|
configurable: true
|
|
@@ -20275,7 +20408,7 @@ var IkasCheckout = /** @class */ (function () {
|
|
|
20275
20408
|
Object.defineProperty(IkasCheckout.prototype, "customerEmail", {
|
|
20276
20409
|
get: function () {
|
|
20277
20410
|
var _a;
|
|
20278
|
-
return ""
|
|
20411
|
+
return "".concat(((_a = this.customer) === null || _a === void 0 ? void 0 : _a.email) || "");
|
|
20279
20412
|
},
|
|
20280
20413
|
enumerable: false,
|
|
20281
20414
|
configurable: true
|
|
@@ -20680,7 +20813,8 @@ var IkasOrder = /** @class */ (function () {
|
|
|
20680
20813
|
exports.OrderLineItemStatusEnum.UNFULFILLED,
|
|
20681
20814
|
exports.OrderLineItemStatusEnum.DELIVERED,
|
|
20682
20815
|
].includes(item.status) &&
|
|
20683
|
-
(((_a = _this._refundSettings) === null || _a === void 0 ? void 0 : _a.orderRefundDayLimit)
|
|
20816
|
+
(((_a = _this._refundSettings) === null || _a === void 0 ? void 0 : _a.orderRefundDayLimit)
|
|
20817
|
+
? _this._refundSettings.orderRefundDayLimit >= item.orderedAtDays
|
|
20684
20818
|
: true);
|
|
20685
20819
|
});
|
|
20686
20820
|
},
|
|
@@ -22755,7 +22889,7 @@ var sortBy_1 = sortBy;
|
|
|
22755
22889
|
// IMAGE = "IMAGE",
|
|
22756
22890
|
// FILE = "FILE",
|
|
22757
22891
|
IkasProductOptionType["COLOR_PICKER"] = "COLOR_PICKER";
|
|
22758
|
-
|
|
22892
|
+
IkasProductOptionType["DATE_PICKER"] = "DATE_PICKER";
|
|
22759
22893
|
IkasProductOptionType["CHECKBOX"] = "CHECKBOX";
|
|
22760
22894
|
})(exports.IkasProductOptionType || (exports.IkasProductOptionType = {}));
|
|
22761
22895
|
(function (IkasProductOptionSelectType) {
|
|
@@ -22832,6 +22966,8 @@ var IkasProductOptionDateSettings = /** @class */ (function () {
|
|
|
22832
22966
|
function IkasProductOptionDateSettings(data) {
|
|
22833
22967
|
this.min = data.min || null;
|
|
22834
22968
|
this.max = data.max || null;
|
|
22969
|
+
this.minRelativeNextDate = data.minRelativeNextDate || null;
|
|
22970
|
+
this.maxRelativeNextDate = data.maxRelativeNextDate || null;
|
|
22835
22971
|
mobx.makeAutoObservable(this);
|
|
22836
22972
|
}
|
|
22837
22973
|
return IkasProductOptionDateSettings;
|
|
@@ -22898,6 +23034,40 @@ var IkasProductOption = /** @class */ (function () {
|
|
|
22898
23034
|
? _this.values.length <= _this.selectSettings.maxSelect
|
|
22899
23035
|
: true));
|
|
22900
23036
|
};
|
|
23037
|
+
this.isValidDateOptionValue = function () {
|
|
23038
|
+
if (!_this.values.length) {
|
|
23039
|
+
return !!_this.isOptional;
|
|
23040
|
+
}
|
|
23041
|
+
if (!!_this.dateSettings) {
|
|
23042
|
+
var minDate = new Date();
|
|
23043
|
+
var maxDate = new Date();
|
|
23044
|
+
if (_this.dateSettings.minRelativeNextDate !== null) {
|
|
23045
|
+
if (_this.dateSettings.minRelativeNextDate < 0) {
|
|
23046
|
+
minDate = new Date(minDate.setDate(minDate.getDate() -
|
|
23047
|
+
Math.abs(_this.dateSettings.minRelativeNextDate)));
|
|
23048
|
+
}
|
|
23049
|
+
else {
|
|
23050
|
+
minDate = new Date(minDate.setDate(minDate.getDate() +
|
|
23051
|
+
Math.abs(_this.dateSettings.minRelativeNextDate)));
|
|
23052
|
+
}
|
|
23053
|
+
}
|
|
23054
|
+
if (_this.dateSettings.maxRelativeNextDate !== null) {
|
|
23055
|
+
if (_this.dateSettings.maxRelativeNextDate < 0) {
|
|
23056
|
+
maxDate = new Date(maxDate.setDate(maxDate.getDate() -
|
|
23057
|
+
Math.abs(_this.dateSettings.maxRelativeNextDate)));
|
|
23058
|
+
}
|
|
23059
|
+
else {
|
|
23060
|
+
maxDate = new Date(maxDate.setDate(maxDate.getDate() +
|
|
23061
|
+
Math.abs(_this.dateSettings.maxRelativeNextDate)));
|
|
23062
|
+
}
|
|
23063
|
+
}
|
|
23064
|
+
var value = new Date(_this.values[0]);
|
|
23065
|
+
return (value.getTime() >= minDate.getTime() &&
|
|
23066
|
+
value.getTime() <= maxDate.getTime());
|
|
23067
|
+
}
|
|
23068
|
+
else
|
|
23069
|
+
return true;
|
|
23070
|
+
};
|
|
22901
23071
|
this.id = data.id || "";
|
|
22902
23072
|
this.productOptionSetId = data.productOptionSetId || "";
|
|
22903
23073
|
this.name = data.name || "";
|
|
@@ -22965,6 +23135,9 @@ var IkasProductOption = /** @class */ (function () {
|
|
|
22965
23135
|
case exports.IkasProductOptionType.CHOICE:
|
|
22966
23136
|
hasValidValues = this.isValidChoiceOptionValue();
|
|
22967
23137
|
break;
|
|
23138
|
+
case exports.IkasProductOptionType.DATE_PICKER:
|
|
23139
|
+
hasValidValues = this.isValidDateOptionValue();
|
|
23140
|
+
break;
|
|
22968
23141
|
}
|
|
22969
23142
|
return (hasValidValues &&
|
|
22970
23143
|
this.displayedChildOptions.every(function (co) { return co.hasValidValues; }));
|
|
@@ -23004,7 +23177,8 @@ var IkasProductOptionSet = /** @class */ (function () {
|
|
|
23004
23177
|
return new IkasProductOption(__assign(__assign({}, o), { productOptionSetId: _this.id }));
|
|
23005
23178
|
})) || [];
|
|
23006
23179
|
this.translations = data.translations
|
|
23007
|
-
? (_b = data.translations) === null || _b === void 0 ? void 0 : _b.map(function (o) { return new IkasProductOptionSetTranslations(o); })
|
|
23180
|
+
? (_b = data.translations) === null || _b === void 0 ? void 0 : _b.map(function (o) { return new IkasProductOptionSetTranslations(o); })
|
|
23181
|
+
: null;
|
|
23008
23182
|
this.setChildOptions();
|
|
23009
23183
|
this.setTranslations();
|
|
23010
23184
|
this.initOptionValues();
|
|
@@ -23118,7 +23292,7 @@ var IkasProduct = /** @class */ (function () {
|
|
|
23118
23292
|
var _a;
|
|
23119
23293
|
if (!((_a = this.metaData) === null || _a === void 0 ? void 0 : _a.slug))
|
|
23120
23294
|
return "";
|
|
23121
|
-
return "/"
|
|
23295
|
+
return "/".concat(this.metaData.slug);
|
|
23122
23296
|
},
|
|
23123
23297
|
enumerable: false,
|
|
23124
23298
|
configurable: true
|
|
@@ -24099,7 +24273,8 @@ var IkasProductFilter = /** @class */ (function () {
|
|
|
24099
24273
|
var newRange = new RangeValue(cloneDeep_1(numberRange));
|
|
24100
24274
|
if (newRange.from < this.numberRangeLimit.from)
|
|
24101
24275
|
newRange.from = this._numberRange.from;
|
|
24102
|
-
if (newRange.to &&
|
|
24276
|
+
if (newRange.to &&
|
|
24277
|
+
((_b = this.numberRangeLimit) === null || _b === void 0 ? void 0 : _b.to) &&
|
|
24103
24278
|
newRange.to > this.numberRangeLimit.to)
|
|
24104
24279
|
newRange.to = this.numberRangeLimit.to;
|
|
24105
24280
|
this._numberRange = newRange;
|
|
@@ -24147,7 +24322,7 @@ var IkasProductFilter = /** @class */ (function () {
|
|
|
24147
24322
|
}
|
|
24148
24323
|
};
|
|
24149
24324
|
IkasProductFilter.prototype.rangeToId = function (range) {
|
|
24150
|
-
return range.from
|
|
24325
|
+
return "".concat(range.from, ":").concat(range.to || "");
|
|
24151
24326
|
};
|
|
24152
24327
|
return IkasProductFilter;
|
|
24153
24328
|
}());
|
|
@@ -24651,7 +24826,8 @@ var IkasTheme = /** @class */ (function () {
|
|
|
24651
24826
|
? new IkasThemeSettings(data.settings)
|
|
24652
24827
|
: new IkasThemeSettings();
|
|
24653
24828
|
this.customData = data.customData
|
|
24654
|
-
? (_a = data.customData) === null || _a === void 0 ? void 0 : _a.map(function (cd) { return new IkasThemeCustomData(cd); })
|
|
24829
|
+
? (_a = data.customData) === null || _a === void 0 ? void 0 : _a.map(function (cd) { return new IkasThemeCustomData(cd); })
|
|
24830
|
+
: [];
|
|
24655
24831
|
this.createCheckoutData();
|
|
24656
24832
|
mobx.makeAutoObservable(this);
|
|
24657
24833
|
}
|
|
@@ -26342,7 +26518,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
26342
26518
|
this.checkout.availableShippingMethods.length === 1 &&
|
|
26343
26519
|
!this.checkoutSettings.isGiftPackageEnabled) {
|
|
26344
26520
|
this.step = CheckoutStep.PAYMENT;
|
|
26345
|
-
this.router.replace("/checkout?id="
|
|
26521
|
+
this.router.replace("/checkout?id=".concat(this.checkout.id, "&step=").concat(this.step), undefined, {
|
|
26346
26522
|
shallow: true,
|
|
26347
26523
|
});
|
|
26348
26524
|
}
|
|
@@ -26809,7 +26985,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
26809
26985
|
var year = parseInt(firstPart.slice(2));
|
|
26810
26986
|
var month = parseInt(lastPart);
|
|
26811
26987
|
if (!isNaN(year) && !isNaN(month)) {
|
|
26812
|
-
_this.cardData.expirationDate = (month < 10 ? "0" + month : month
|
|
26988
|
+
_this.cardData.expirationDate = "".concat(month < 10 ? "0" + month : month, " / ").concat(year < 10 ? "0" + year : year);
|
|
26813
26989
|
return;
|
|
26814
26990
|
}
|
|
26815
26991
|
}
|
|
@@ -26818,7 +26994,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
26818
26994
|
var month = parseInt(firstPart);
|
|
26819
26995
|
var year = parseInt(lastPart.slice(2));
|
|
26820
26996
|
if (!isNaN(year) && !isNaN(month)) {
|
|
26821
|
-
_this.cardData.expirationDate = (month < 10 ? "0" + month : month
|
|
26997
|
+
_this.cardData.expirationDate = "".concat(month < 10 ? "0" + month : month, " / ").concat(year < 10 ? "0" + year : year);
|
|
26822
26998
|
return;
|
|
26823
26999
|
}
|
|
26824
27000
|
}
|
|
@@ -27120,7 +27296,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
27120
27296
|
this.changeStep = function (step) { return __awaiter(_this, void 0, void 0, function () {
|
|
27121
27297
|
return __generator(this, function (_a) {
|
|
27122
27298
|
if (!isServer$1) {
|
|
27123
|
-
window.location.replace(window.location.pathname
|
|
27299
|
+
window.location.replace("".concat(window.location.pathname, "?id=").concat(this.checkout.id, "&step=").concat(step));
|
|
27124
27300
|
}
|
|
27125
27301
|
return [2 /*return*/];
|
|
27126
27302
|
});
|
|
@@ -27190,7 +27366,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
27190
27366
|
});
|
|
27191
27367
|
Object.defineProperty(CheckoutViewModel.prototype, "checkoutUrl", {
|
|
27192
27368
|
get: function () {
|
|
27193
|
-
return "/checkout?id="
|
|
27369
|
+
return "/checkout?id=".concat(this.checkout.id, "&step=info");
|
|
27194
27370
|
},
|
|
27195
27371
|
enumerable: false,
|
|
27196
27372
|
configurable: true
|
|
@@ -27278,7 +27454,8 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
27278
27454
|
!!((_a = this.checkout.billingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
|
|
27279
27455
|
((pg === null || pg === void 0 ? void 0 : pg.paymentMethodType) === IkasPaymentMethodType.CREDIT_CARD &&
|
|
27280
27456
|
pg.type === IkasPaymentGatewayType.INTERNAL
|
|
27281
|
-
? (_b = this.cardData) === null || _b === void 0 ? void 0 : _b.isValid
|
|
27457
|
+
? (_b = this.cardData) === null || _b === void 0 ? void 0 : _b.isValid
|
|
27458
|
+
: true));
|
|
27282
27459
|
},
|
|
27283
27460
|
enumerable: false,
|
|
27284
27461
|
configurable: true
|
|
@@ -27337,7 +27514,7 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
27337
27514
|
extraParams: {
|
|
27338
27515
|
parent_id: productDetail.product.id,
|
|
27339
27516
|
currency: productDetail.selectedVariant.price.currency,
|
|
27340
|
-
url: "https://"
|
|
27517
|
+
url: "https://".concat(window.location.hostname).concat(productDetail.href),
|
|
27341
27518
|
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
27342
27519
|
},
|
|
27343
27520
|
},
|
|
@@ -27733,7 +27910,7 @@ var StorefrontEventPageType;
|
|
|
27733
27910
|
StorefrontEventPageType[StorefrontEventPageType["CHECKOUT"] = 21] = "CHECKOUT";
|
|
27734
27911
|
})(StorefrontEventPageType || (StorefrontEventPageType = {}));
|
|
27735
27912
|
var ANALYTICS_URL = process.env.NEXT_PUBLIC_ANALYTICS_URL
|
|
27736
|
-
? process.env.NEXT_PUBLIC_ANALYTICS_URL
|
|
27913
|
+
? "".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL, "/sendEvent")
|
|
27737
27914
|
: "https://0.myikas.com/sendEvent";
|
|
27738
27915
|
var IkasAnalytics = /** @class */ (function () {
|
|
27739
27916
|
function IkasAnalytics() {
|
|
@@ -36709,10 +36886,10 @@ var AnalyticsHead = function (_a) {
|
|
|
36709
36886
|
__html: "dataLayer = [{'gtm.blocklist': ['html']}];",
|
|
36710
36887
|
} })),
|
|
36711
36888
|
gtmId && (React.createElement("script", { defer: true, dangerouslySetInnerHTML: {
|
|
36712
|
-
__html: "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','"
|
|
36889
|
+
__html: "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(gtmId, "');"),
|
|
36713
36890
|
} })),
|
|
36714
36891
|
fbpId && (React.createElement("script", { defer: true, dangerouslySetInnerHTML: {
|
|
36715
|
-
__html: "!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '"
|
|
36892
|
+
__html: "!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(fbpId, "');\n fbq('track', 'PageView');"),
|
|
36716
36893
|
} })),
|
|
36717
36894
|
htmlReactParser(getIkasEventsScript()),
|
|
36718
36895
|
storefrontJSScripts.map(function (script) { return htmlReactParser(script); })));
|
|
@@ -36722,10 +36899,10 @@ var AnalyticsBody = function () {
|
|
|
36722
36899
|
var fbpId = IkasStorefrontConfig.fbpId;
|
|
36723
36900
|
return (React.createElement(React.Fragment, null,
|
|
36724
36901
|
gtmId && (React.createElement("noscript", { dangerouslySetInnerHTML: {
|
|
36725
|
-
__html: "<iframe src=\"https://www.googletagmanager.com/ns.html?id="
|
|
36902
|
+
__html: "<iframe src=\"https://www.googletagmanager.com/ns.html?id=".concat(gtmId, "\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe>"),
|
|
36726
36903
|
} })),
|
|
36727
36904
|
fbpId && (React.createElement("noscript", { dangerouslySetInnerHTML: {
|
|
36728
|
-
__html: "<img height=\"1\" width=\"1\" style=\"display:none\" \n src=\"https://www.facebook.com/tr?id="
|
|
36905
|
+
__html: "<img height=\"1\" width=\"1\" style=\"display:none\" \n src=\"https://www.facebook.com/tr?id=".concat(fbpId, "&ev=PageView&noscript=1\"/>"),
|
|
36729
36906
|
} }))));
|
|
36730
36907
|
};
|
|
36731
36908
|
|
|
@@ -36773,14 +36950,14 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36773
36950
|
return _this.selectedVariantValues.some(function (svv) { return svv.id === vv.id; });
|
|
36774
36951
|
});
|
|
36775
36952
|
if (selectedVariant)
|
|
36776
|
-
return vt.slug
|
|
36953
|
+
return "".concat(vt.slug, "=").concat(selectedVariant.slug);
|
|
36777
36954
|
})
|
|
36778
36955
|
.filter(function (param) { return !!param; })
|
|
36779
36956
|
.join("&");
|
|
36780
36957
|
if (variantParams)
|
|
36781
|
-
return "/"
|
|
36958
|
+
return "/".concat(metaData.slug, "?").concat(variantParams);
|
|
36782
36959
|
else
|
|
36783
|
-
return "/"
|
|
36960
|
+
return "/".concat(metaData.slug);
|
|
36784
36961
|
},
|
|
36785
36962
|
enumerable: false,
|
|
36786
36963
|
configurable: true
|
|
@@ -36806,7 +36983,7 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36806
36983
|
});
|
|
36807
36984
|
}
|
|
36808
36985
|
variantType.values.forEach(function (variantValue) {
|
|
36809
|
-
var variantValues =
|
|
36986
|
+
var variantValues = __spreadArray(__spreadArray([], parentSelectedVariantValues, true), [variantValue], false);
|
|
36810
36987
|
var variant = _this.product.variants.find(function (variant) {
|
|
36811
36988
|
return variant.isActive &&
|
|
36812
36989
|
variantValues.every(function (vv) {
|
|
@@ -36898,7 +37075,7 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36898
37075
|
var selectedParentVariantValues = this.selectedVariantValues.filter(function (vv) {
|
|
36899
37076
|
return parentVariantTypes_1.some(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
36900
37077
|
});
|
|
36901
|
-
var allVariantValues_1 =
|
|
37078
|
+
var allVariantValues_1 = __spreadArray(__spreadArray([], selectedParentVariantValues, true), [variantValue], false);
|
|
36902
37079
|
selectedVariant = this.product.variants.find(function (variant) {
|
|
36903
37080
|
return variant.isActive &&
|
|
36904
37081
|
allVariantValues_1.every(function (avv) {
|
|
@@ -36934,13 +37111,13 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36934
37111
|
return _this.selectedVariantValues.some(function (svv) { return svv.id === vv.id; });
|
|
36935
37112
|
});
|
|
36936
37113
|
if (selectedVariantValue)
|
|
36937
|
-
return vt.slug
|
|
37114
|
+
return "".concat(vt.slug, "=").concat(selectedVariantValue.slug);
|
|
36938
37115
|
})
|
|
36939
37116
|
.filter(function (param) { return !!param; })
|
|
36940
37117
|
.join("&");
|
|
36941
|
-
var newUrl = "/"
|
|
37118
|
+
var newUrl = "/".concat(metaData.slug);
|
|
36942
37119
|
if (variantParams)
|
|
36943
|
-
newUrl = "/"
|
|
37120
|
+
newUrl = "/".concat(metaData.slug, "?").concat(variantParams);
|
|
36944
37121
|
if (newUrl === window.location.pathname)
|
|
36945
37122
|
return;
|
|
36946
37123
|
var isShallow = process.env.NODE_ENV !== "production";
|
|
@@ -38152,7 +38329,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38152
38329
|
return [2 /*return*/];
|
|
38153
38330
|
// Change url params
|
|
38154
38331
|
if (resultsSet && this.isBrowser() && !this.isSearch) {
|
|
38155
|
-
(_a = this.router) === null || _a === void 0 ? void 0 : _a.replace(""
|
|
38332
|
+
(_a = this.router) === null || _a === void 0 ? void 0 : _a.replace("".concat(location.pathname).concat(this.filterQueryParams ? "?" + this.filterQueryParams : ""), undefined, { shallow: true });
|
|
38156
38333
|
}
|
|
38157
38334
|
return [2 /*return*/];
|
|
38158
38335
|
}
|
|
@@ -38392,7 +38569,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38392
38569
|
if (_this._infiniteScrollPage === page)
|
|
38393
38570
|
return;
|
|
38394
38571
|
_this._infiniteScrollPage = page;
|
|
38395
|
-
(_a = _this.router) === null || _a === void 0 ? void 0 : _a.replace(""
|
|
38572
|
+
(_a = _this.router) === null || _a === void 0 ? void 0 : _a.replace("".concat(location.pathname).concat(_this.filterQueryParams ? "?" + _this.filterQueryParams : ""), undefined, { shallow: true });
|
|
38396
38573
|
};
|
|
38397
38574
|
this.searchDebouncer = debounce_1(function () {
|
|
38398
38575
|
_this.applyFilters();
|
|
@@ -38540,7 +38717,8 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38540
38717
|
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
38541
38718
|
!!this._searchKeyword ||
|
|
38542
38719
|
(this._pageType !== exports.IkasThemePageType.CATEGORY &&
|
|
38543
|
-
(!!this._filterCategoryId ||
|
|
38720
|
+
(!!this._filterCategoryId ||
|
|
38721
|
+
((_b = this._filterCategories) === null || _b === void 0 ? void 0 : _b.some(function (fc) { return fc.isSelected; })))));
|
|
38544
38722
|
},
|
|
38545
38723
|
enumerable: false,
|
|
38546
38724
|
configurable: true
|
|
@@ -38775,7 +38953,8 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38775
38953
|
page: page,
|
|
38776
38954
|
perPage: limit,
|
|
38777
38955
|
productIdList: this.isStatic
|
|
38778
|
-
? (_c = this._productListPropValue.productIds) === null || _c === void 0 ? void 0 : _c.map(function (p) { return p.productId; })
|
|
38956
|
+
? (_c = this._productListPropValue.productIds) === null || _c === void 0 ? void 0 : _c.map(function (p) { return p.productId; })
|
|
38957
|
+
: productIdList,
|
|
38779
38958
|
filterList: filterList,
|
|
38780
38959
|
facetList: facetList,
|
|
38781
38960
|
brandId: this._pageType === exports.IkasThemePageType.BRAND &&
|
|
@@ -39163,8 +39342,14 @@ var IkasAttributeList = /** @class */ (function () {
|
|
|
39163
39342
|
if (!this.productDetail)
|
|
39164
39343
|
return [];
|
|
39165
39344
|
var groupedValues = this.productDetail.product.hasVariant
|
|
39166
|
-
? groupBy_1(this.productDetail.selectedVariant.attributes.filter(function (a) {
|
|
39167
|
-
|
|
39345
|
+
? groupBy_1(this.productDetail.selectedVariant.attributes.filter(function (a) {
|
|
39346
|
+
var _a;
|
|
39347
|
+
return (_a = _this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.includes(a.productAttributeId || "");
|
|
39348
|
+
}), "productAttributeId")
|
|
39349
|
+
: groupBy_1(this.productDetail.product.attributes.filter(function (a) {
|
|
39350
|
+
var _a;
|
|
39351
|
+
return (_a = _this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.includes(a.productAttributeId || "");
|
|
39352
|
+
}), "productAttributeId");
|
|
39168
39353
|
return (((_a = this.attributeListPropValue.attributeIds) === null || _a === void 0 ? void 0 : _a.map(function (attributeId) {
|
|
39169
39354
|
var values = groupedValues[attributeId];
|
|
39170
39355
|
if ((values === null || values === void 0 ? void 0 : values.length) && values[0].productAttribute)
|
|
@@ -39962,7 +40147,7 @@ var AddressForm = /** @class */ (function () {
|
|
|
39962
40147
|
this._isDistrictsPending = false;
|
|
39963
40148
|
this.validatorRules = function (includePhoneRule) {
|
|
39964
40149
|
if (includePhoneRule === void 0) { includePhoneRule = false; }
|
|
39965
|
-
var rules =
|
|
40150
|
+
var rules = __spreadArray([
|
|
39966
40151
|
new RequiredRule({
|
|
39967
40152
|
model: _this.address,
|
|
39968
40153
|
fieldKey: "firstName",
|
|
@@ -40014,7 +40199,7 @@ var AddressForm = /** @class */ (function () {
|
|
|
40014
40199
|
message: _this.message.phoneRule,
|
|
40015
40200
|
}),
|
|
40016
40201
|
]
|
|
40017
|
-
: []));
|
|
40202
|
+
: []), true);
|
|
40018
40203
|
return rules;
|
|
40019
40204
|
};
|
|
40020
40205
|
this.onTitleChange = function (value) {
|
|
@@ -41049,7 +41234,7 @@ var AccountInfoForm = /** @class */ (function () {
|
|
|
41049
41234
|
var _this = this;
|
|
41050
41235
|
this.validatorRules = function (includePhoneRule) {
|
|
41051
41236
|
if (includePhoneRule === void 0) { includePhoneRule = false; }
|
|
41052
|
-
var rules =
|
|
41237
|
+
var rules = __spreadArray([
|
|
41053
41238
|
new RequiredRule({
|
|
41054
41239
|
model: _this.customer,
|
|
41055
41240
|
fieldKey: "firstName",
|
|
@@ -41071,7 +41256,7 @@ var AccountInfoForm = /** @class */ (function () {
|
|
|
41071
41256
|
message: _this.message.phoneRule,
|
|
41072
41257
|
}),
|
|
41073
41258
|
]
|
|
41074
|
-
: []));
|
|
41259
|
+
: []), true);
|
|
41075
41260
|
return rules;
|
|
41076
41261
|
};
|
|
41077
41262
|
this.onFirstNameChange = function (value) {
|
|
@@ -41492,10 +41677,11 @@ var IkasBrandAPI = /** @class */ (function () {
|
|
|
41492
41677
|
in: params.idList,
|
|
41493
41678
|
}
|
|
41494
41679
|
: undefined,
|
|
41495
|
-
pagination: (params === null || params === void 0 ? void 0 : params.page)
|
|
41496
|
-
|
|
41497
|
-
|
|
41498
|
-
|
|
41680
|
+
pagination: (params === null || params === void 0 ? void 0 : params.page)
|
|
41681
|
+
? {
|
|
41682
|
+
page: params.page,
|
|
41683
|
+
limit: params.limit || 10,
|
|
41684
|
+
}
|
|
41499
41685
|
: undefined,
|
|
41500
41686
|
search: params === null || params === void 0 ? void 0 : params.search,
|
|
41501
41687
|
sort: (params === null || params === void 0 ? void 0 : params.sort) || null,
|
|
@@ -41644,10 +41830,11 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
41644
41830
|
in: params.idList,
|
|
41645
41831
|
}
|
|
41646
41832
|
: undefined,
|
|
41647
|
-
pagination: (params === null || params === void 0 ? void 0 : params.page)
|
|
41648
|
-
|
|
41649
|
-
|
|
41650
|
-
|
|
41833
|
+
pagination: (params === null || params === void 0 ? void 0 : params.page)
|
|
41834
|
+
? {
|
|
41835
|
+
page: params.page,
|
|
41836
|
+
limit: params.limit || 10,
|
|
41837
|
+
}
|
|
41651
41838
|
: undefined,
|
|
41652
41839
|
search: params === null || params === void 0 ? void 0 : params.search,
|
|
41653
41840
|
sort: (params === null || params === void 0 ? void 0 : params.sort) || null,
|
|
@@ -41679,8 +41866,8 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
41679
41866
|
_b.trys.push([3, 8, , 9]);
|
|
41680
41867
|
_loop_1 = function (i) {
|
|
41681
41868
|
var categoryPathIds, path_1, categoryPathsResult_1;
|
|
41682
|
-
return __generator(this, function (
|
|
41683
|
-
switch (
|
|
41869
|
+
return __generator(this, function (_c) {
|
|
41870
|
+
switch (_c.label) {
|
|
41684
41871
|
case 0:
|
|
41685
41872
|
categoryPathIds = data.listCategory.data[i].categoryPath;
|
|
41686
41873
|
if (!(categoryPathIds && categoryPathIds.length)) return [3 /*break*/, 2];
|
|
@@ -41689,14 +41876,14 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
41689
41876
|
idList: categoryPathIds,
|
|
41690
41877
|
})];
|
|
41691
41878
|
case 1:
|
|
41692
|
-
categoryPathsResult_1 =
|
|
41879
|
+
categoryPathsResult_1 = _c.sent();
|
|
41693
41880
|
categoryPathIds.forEach(function (categoryId) {
|
|
41694
41881
|
var categoryPath = categoryPathsResult_1.find(function (c) { return c.id === categoryId; });
|
|
41695
41882
|
if (categoryPath)
|
|
41696
41883
|
path_1.push(categoryPath);
|
|
41697
41884
|
});
|
|
41698
41885
|
categories[i].path = path_1;
|
|
41699
|
-
|
|
41886
|
+
_c.label = 2;
|
|
41700
41887
|
case 2: return [2 /*return*/];
|
|
41701
41888
|
}
|
|
41702
41889
|
});
|
|
@@ -41754,10 +41941,11 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
41754
41941
|
in: params.idList,
|
|
41755
41942
|
}
|
|
41756
41943
|
: undefined,
|
|
41757
|
-
pagination: (params === null || params === void 0 ? void 0 : params.page)
|
|
41758
|
-
|
|
41759
|
-
|
|
41760
|
-
|
|
41944
|
+
pagination: (params === null || params === void 0 ? void 0 : params.page)
|
|
41945
|
+
? {
|
|
41946
|
+
page: params.page,
|
|
41947
|
+
limit: params.limit || 10,
|
|
41948
|
+
}
|
|
41761
41949
|
: undefined,
|
|
41762
41950
|
search: params === null || params === void 0 ? void 0 : params.search,
|
|
41763
41951
|
},
|
|
@@ -42418,13 +42606,50 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42418
42606
|
});
|
|
42419
42607
|
});
|
|
42420
42608
|
};
|
|
42609
|
+
IkasCustomerAPI.socialLogin = function (code) {
|
|
42610
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42611
|
+
var QUERY, _a, data, errors, err_2;
|
|
42612
|
+
return __generator(this, function (_b) {
|
|
42613
|
+
switch (_b.label) {
|
|
42614
|
+
case 0:
|
|
42615
|
+
QUERY = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n }\n }\n }\n "], ["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n }\n }\n }\n "])));
|
|
42616
|
+
_b.label = 1;
|
|
42617
|
+
case 1:
|
|
42618
|
+
_b.trys.push([1, 3, , 4]);
|
|
42619
|
+
return [4 /*yield*/, apollo
|
|
42620
|
+
.getClient()
|
|
42621
|
+
.query({
|
|
42622
|
+
query: QUERY,
|
|
42623
|
+
variables: { code: code },
|
|
42624
|
+
})];
|
|
42625
|
+
case 2:
|
|
42626
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
42627
|
+
if (errors && errors.length) {
|
|
42628
|
+
console.log(errors);
|
|
42629
|
+
}
|
|
42630
|
+
if (data && data.customerSocialLogin.customer)
|
|
42631
|
+
return [2 /*return*/, {
|
|
42632
|
+
customer: new IkasCustomer(data.customerSocialLogin.customer),
|
|
42633
|
+
token: data.customerSocialLogin.token,
|
|
42634
|
+
tokenExpiry: data.customerSocialLogin.tokenExpiry,
|
|
42635
|
+
}];
|
|
42636
|
+
return [3 /*break*/, 4];
|
|
42637
|
+
case 3:
|
|
42638
|
+
err_2 = _b.sent();
|
|
42639
|
+
console.log(err_2);
|
|
42640
|
+
return [3 /*break*/, 4];
|
|
42641
|
+
case 4: return [2 /*return*/];
|
|
42642
|
+
}
|
|
42643
|
+
});
|
|
42644
|
+
});
|
|
42645
|
+
};
|
|
42421
42646
|
IkasCustomerAPI.register = function (email, password, firstName, lastName, isAcceptMarketing) {
|
|
42422
42647
|
return __awaiter(this, void 0, void 0, function () {
|
|
42423
|
-
var MUTATION, _a, data, errors,
|
|
42648
|
+
var MUTATION, _a, data, errors, err_3;
|
|
42424
42649
|
return __generator(this, function (_b) {
|
|
42425
42650
|
switch (_b.label) {
|
|
42426
42651
|
case 0:
|
|
42427
|
-
MUTATION = src(
|
|
42652
|
+
MUTATION = src(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
42428
42653
|
_b.label = 1;
|
|
42429
42654
|
case 1:
|
|
42430
42655
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42450,8 +42675,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42450
42675
|
return [2 /*return*/, __assign(__assign({}, data.registerCustomer), { customer: new IkasCustomer(data.registerCustomer.customer) })];
|
|
42451
42676
|
return [3 /*break*/, 4];
|
|
42452
42677
|
case 3:
|
|
42453
|
-
|
|
42454
|
-
console.log(
|
|
42678
|
+
err_3 = _b.sent();
|
|
42679
|
+
console.log(err_3);
|
|
42455
42680
|
return [3 /*break*/, 4];
|
|
42456
42681
|
case 4: return [2 /*return*/];
|
|
42457
42682
|
}
|
|
@@ -42460,11 +42685,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42460
42685
|
};
|
|
42461
42686
|
IkasCustomerAPI.refreshToken = function (token) {
|
|
42462
42687
|
return __awaiter(this, void 0, void 0, function () {
|
|
42463
|
-
var MUTATION, _a, data, errors,
|
|
42688
|
+
var MUTATION, _a, data, errors, err_4;
|
|
42464
42689
|
return __generator(this, function (_b) {
|
|
42465
42690
|
switch (_b.label) {
|
|
42466
42691
|
case 0:
|
|
42467
|
-
MUTATION = src(
|
|
42692
|
+
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "], ["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "])));
|
|
42468
42693
|
_b.label = 1;
|
|
42469
42694
|
case 1:
|
|
42470
42695
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42485,8 +42710,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42485
42710
|
return [2 /*return*/, data.customerRefreshToken];
|
|
42486
42711
|
return [3 /*break*/, 4];
|
|
42487
42712
|
case 3:
|
|
42488
|
-
|
|
42489
|
-
console.log(
|
|
42713
|
+
err_4 = _b.sent();
|
|
42714
|
+
console.log(err_4);
|
|
42490
42715
|
return [3 /*break*/, 4];
|
|
42491
42716
|
case 4: return [2 /*return*/];
|
|
42492
42717
|
}
|
|
@@ -42495,11 +42720,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42495
42720
|
};
|
|
42496
42721
|
IkasCustomerAPI.forgotPassword = function (email) {
|
|
42497
42722
|
return __awaiter(this, void 0, void 0, function () {
|
|
42498
|
-
var MUTATION, _a, errors,
|
|
42723
|
+
var MUTATION, _a, errors, err_5;
|
|
42499
42724
|
return __generator(this, function (_b) {
|
|
42500
42725
|
switch (_b.label) {
|
|
42501
42726
|
case 0:
|
|
42502
|
-
MUTATION = src(
|
|
42727
|
+
MUTATION = src(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "], ["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "])));
|
|
42503
42728
|
_b.label = 1;
|
|
42504
42729
|
case 1:
|
|
42505
42730
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42520,8 +42745,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42520
42745
|
}
|
|
42521
42746
|
return [3 /*break*/, 4];
|
|
42522
42747
|
case 3:
|
|
42523
|
-
|
|
42524
|
-
console.log(
|
|
42748
|
+
err_5 = _b.sent();
|
|
42749
|
+
console.log(err_5);
|
|
42525
42750
|
return [3 /*break*/, 4];
|
|
42526
42751
|
case 4: return [2 /*return*/, true];
|
|
42527
42752
|
}
|
|
@@ -42530,11 +42755,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42530
42755
|
};
|
|
42531
42756
|
IkasCustomerAPI.recoverPassword = function (password, passwordAgain, token) {
|
|
42532
42757
|
return __awaiter(this, void 0, void 0, function () {
|
|
42533
|
-
var MUTATION, _a, errors,
|
|
42758
|
+
var MUTATION, _a, errors, err_6;
|
|
42534
42759
|
return __generator(this, function (_b) {
|
|
42535
42760
|
switch (_b.label) {
|
|
42536
42761
|
case 0:
|
|
42537
|
-
MUTATION = src(
|
|
42762
|
+
MUTATION = src(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "], ["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "])));
|
|
42538
42763
|
_b.label = 1;
|
|
42539
42764
|
case 1:
|
|
42540
42765
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42556,8 +42781,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42556
42781
|
}
|
|
42557
42782
|
return [3 /*break*/, 4];
|
|
42558
42783
|
case 3:
|
|
42559
|
-
|
|
42560
|
-
console.log(
|
|
42784
|
+
err_6 = _b.sent();
|
|
42785
|
+
console.log(err_6);
|
|
42561
42786
|
return [2 /*return*/, false];
|
|
42562
42787
|
case 4: return [2 /*return*/, true];
|
|
42563
42788
|
}
|
|
@@ -42566,11 +42791,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42566
42791
|
};
|
|
42567
42792
|
IkasCustomerAPI.checkEmail = function (email) {
|
|
42568
42793
|
return __awaiter(this, void 0, void 0, function () {
|
|
42569
|
-
var QUERY, _a, data, errors,
|
|
42794
|
+
var QUERY, _a, data, errors, err_7;
|
|
42570
42795
|
return __generator(this, function (_b) {
|
|
42571
42796
|
switch (_b.label) {
|
|
42572
42797
|
case 0:
|
|
42573
|
-
QUERY = src(
|
|
42798
|
+
QUERY = src(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "], ["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "])));
|
|
42574
42799
|
_b.label = 1;
|
|
42575
42800
|
case 1:
|
|
42576
42801
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42591,8 +42816,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42591
42816
|
return [2 /*return*/, data.checkCustomerEmail.exists];
|
|
42592
42817
|
return [3 /*break*/, 4];
|
|
42593
42818
|
case 3:
|
|
42594
|
-
|
|
42595
|
-
console.log(
|
|
42819
|
+
err_7 = _b.sent();
|
|
42820
|
+
console.log(err_7);
|
|
42596
42821
|
return [3 /*break*/, 4];
|
|
42597
42822
|
case 4: return [2 /*return*/, false];
|
|
42598
42823
|
}
|
|
@@ -42601,15 +42826,17 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42601
42826
|
};
|
|
42602
42827
|
IkasCustomerAPI.getCustomer = function () {
|
|
42603
42828
|
return __awaiter(this, void 0, void 0, function () {
|
|
42604
|
-
var QUERY, _a, data, errors,
|
|
42829
|
+
var QUERY, _a, data, errors, err_8;
|
|
42605
42830
|
return __generator(this, function (_b) {
|
|
42606
42831
|
switch (_b.label) {
|
|
42607
42832
|
case 0:
|
|
42608
|
-
QUERY = src(
|
|
42833
|
+
QUERY = src(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n query getMyCustomer {\n getMyCustomer {\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 query getMyCustomer {\n getMyCustomer {\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 "])));
|
|
42609
42834
|
_b.label = 1;
|
|
42610
42835
|
case 1:
|
|
42611
42836
|
_b.trys.push([1, 3, , 4]);
|
|
42612
|
-
return [4 /*yield*/, apollo
|
|
42837
|
+
return [4 /*yield*/, apollo
|
|
42838
|
+
.getClient()
|
|
42839
|
+
.query({
|
|
42613
42840
|
query: QUERY,
|
|
42614
42841
|
})];
|
|
42615
42842
|
case 2:
|
|
@@ -42621,8 +42848,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42621
42848
|
return [2 /*return*/, new IkasCustomer(data.getMyCustomer)];
|
|
42622
42849
|
return [3 /*break*/, 4];
|
|
42623
42850
|
case 3:
|
|
42624
|
-
|
|
42625
|
-
console.log(
|
|
42851
|
+
err_8 = _b.sent();
|
|
42852
|
+
console.log(err_8);
|
|
42626
42853
|
return [3 /*break*/, 4];
|
|
42627
42854
|
case 4: return [2 /*return*/];
|
|
42628
42855
|
}
|
|
@@ -42631,11 +42858,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42631
42858
|
};
|
|
42632
42859
|
IkasCustomerAPI.saveCustomer = function (customer) {
|
|
42633
42860
|
return __awaiter(this, void 0, void 0, function () {
|
|
42634
|
-
var MUTATION, _a, data, errors,
|
|
42861
|
+
var MUTATION, _a, data, errors, err_9;
|
|
42635
42862
|
return __generator(this, function (_b) {
|
|
42636
42863
|
switch (_b.label) {
|
|
42637
42864
|
case 0:
|
|
42638
|
-
MUTATION = src(
|
|
42865
|
+
MUTATION = src(templateObject_9$1 || (templateObject_9$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 iso2\n iso3\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 identityNumber\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 iso2\n iso3\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 identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
|
|
42639
42866
|
_b.label = 1;
|
|
42640
42867
|
case 1:
|
|
42641
42868
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42661,8 +42888,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42661
42888
|
return [2 /*return*/, new IkasCustomer(data.saveMyCustomer)];
|
|
42662
42889
|
return [3 /*break*/, 4];
|
|
42663
42890
|
case 3:
|
|
42664
|
-
|
|
42665
|
-
console.log(
|
|
42891
|
+
err_9 = _b.sent();
|
|
42892
|
+
console.log(err_9);
|
|
42666
42893
|
return [3 /*break*/, 4];
|
|
42667
42894
|
case 4: return [2 /*return*/];
|
|
42668
42895
|
}
|
|
@@ -42671,15 +42898,17 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42671
42898
|
};
|
|
42672
42899
|
IkasCustomerAPI.getOrders = function (id) {
|
|
42673
42900
|
return __awaiter(this, void 0, void 0, function () {
|
|
42674
|
-
var QUERY, _a, data, errors,
|
|
42901
|
+
var QUERY, _a, data, errors, err_10;
|
|
42675
42902
|
return __generator(this, function (_b) {
|
|
42676
42903
|
switch (_b.label) {
|
|
42677
42904
|
case 0:
|
|
42678
|
-
QUERY = src(
|
|
42905
|
+
QUERY = src(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
42679
42906
|
_b.label = 1;
|
|
42680
42907
|
case 1:
|
|
42681
42908
|
_b.trys.push([1, 3, , 4]);
|
|
42682
|
-
return [4 /*yield*/, apollo
|
|
42909
|
+
return [4 /*yield*/, apollo
|
|
42910
|
+
.getClient()
|
|
42911
|
+
.query({
|
|
42683
42912
|
query: QUERY,
|
|
42684
42913
|
variables: id
|
|
42685
42914
|
? {
|
|
@@ -42696,8 +42925,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42696
42925
|
return [2 /*return*/, data.getCustomerOrders.map(function (o) { return new IkasOrder(o); })];
|
|
42697
42926
|
return [3 /*break*/, 4];
|
|
42698
42927
|
case 3:
|
|
42699
|
-
|
|
42700
|
-
console.log(
|
|
42928
|
+
err_10 = _b.sent();
|
|
42929
|
+
console.log(err_10);
|
|
42701
42930
|
return [3 /*break*/, 4];
|
|
42702
42931
|
case 4: return [2 /*return*/];
|
|
42703
42932
|
}
|
|
@@ -42710,24 +42939,27 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42710
42939
|
return __generator(this, function (_b) {
|
|
42711
42940
|
switch (_b.label) {
|
|
42712
42941
|
case 0:
|
|
42713
|
-
LIST_ORDER_TRANSACTIONS = src(
|
|
42942
|
+
LIST_ORDER_TRANSACTIONS = src(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "], ["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "])));
|
|
42714
42943
|
_b.label = 1;
|
|
42715
42944
|
case 1:
|
|
42716
42945
|
_b.trys.push([1, 3, , 4]);
|
|
42717
42946
|
return [4 /*yield*/, apollo.getClient().query({
|
|
42718
42947
|
query: LIST_ORDER_TRANSACTIONS,
|
|
42719
42948
|
variables: {
|
|
42720
|
-
checkoutId: (params === null || params === void 0 ? void 0 : params.checkoutId)
|
|
42721
|
-
|
|
42722
|
-
|
|
42949
|
+
checkoutId: (params === null || params === void 0 ? void 0 : params.checkoutId)
|
|
42950
|
+
? {
|
|
42951
|
+
eq: params.checkoutId,
|
|
42952
|
+
}
|
|
42723
42953
|
: undefined,
|
|
42724
|
-
id: (params === null || params === void 0 ? void 0 : params.id)
|
|
42725
|
-
|
|
42726
|
-
|
|
42954
|
+
id: (params === null || params === void 0 ? void 0 : params.id)
|
|
42955
|
+
? {
|
|
42956
|
+
eq: params.id,
|
|
42957
|
+
}
|
|
42727
42958
|
: undefined,
|
|
42728
|
-
orderId: (params === null || params === void 0 ? void 0 : params.orderId)
|
|
42729
|
-
|
|
42730
|
-
|
|
42959
|
+
orderId: (params === null || params === void 0 ? void 0 : params.orderId)
|
|
42960
|
+
? {
|
|
42961
|
+
eq: params.orderId,
|
|
42962
|
+
}
|
|
42731
42963
|
: undefined,
|
|
42732
42964
|
},
|
|
42733
42965
|
})];
|
|
@@ -42747,11 +42979,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42747
42979
|
};
|
|
42748
42980
|
IkasCustomerAPI.saveIkasOrderRefund = function (input) {
|
|
42749
42981
|
return __awaiter(this, void 0, void 0, function () {
|
|
42750
|
-
var MUTATION, _a, data, errors,
|
|
42982
|
+
var MUTATION, _a, data, errors, err_11;
|
|
42751
42983
|
return __generator(this, function (_b) {
|
|
42752
42984
|
switch (_b.label) {
|
|
42753
42985
|
case 0:
|
|
42754
|
-
MUTATION = src(
|
|
42986
|
+
MUTATION = src(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "], ["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
42755
42987
|
_b.label = 1;
|
|
42756
42988
|
case 1:
|
|
42757
42989
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42771,8 +43003,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42771
43003
|
return [2 /*return*/, new IkasOrder(data === null || data === void 0 ? void 0 : data.createOrderRefundRequest)];
|
|
42772
43004
|
return [3 /*break*/, 4];
|
|
42773
43005
|
case 3:
|
|
42774
|
-
|
|
42775
|
-
console.log(
|
|
43006
|
+
err_11 = _b.sent();
|
|
43007
|
+
console.log(err_11);
|
|
42776
43008
|
return [3 /*break*/, 4];
|
|
42777
43009
|
case 4: return [2 /*return*/];
|
|
42778
43010
|
}
|
|
@@ -42781,11 +43013,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42781
43013
|
};
|
|
42782
43014
|
IkasCustomerAPI.createCustomerEmailSubscription = function (email) {
|
|
42783
43015
|
return __awaiter(this, void 0, void 0, function () {
|
|
42784
|
-
var MUTATION, errors,
|
|
43016
|
+
var MUTATION, errors, err_12;
|
|
42785
43017
|
return __generator(this, function (_a) {
|
|
42786
43018
|
switch (_a.label) {
|
|
42787
43019
|
case 0:
|
|
42788
|
-
MUTATION = src(
|
|
43020
|
+
MUTATION = src(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "], ["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "])));
|
|
42789
43021
|
_a.label = 1;
|
|
42790
43022
|
case 1:
|
|
42791
43023
|
_a.trys.push([1, 3, , 4]);
|
|
@@ -42805,8 +43037,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42805
43037
|
return [2 /*return*/, false];
|
|
42806
43038
|
return [3 /*break*/, 4];
|
|
42807
43039
|
case 3:
|
|
42808
|
-
|
|
42809
|
-
console.log(
|
|
43040
|
+
err_12 = _a.sent();
|
|
43041
|
+
console.log(err_12);
|
|
42810
43042
|
return [2 /*return*/, false];
|
|
42811
43043
|
case 4: return [2 /*return*/, true];
|
|
42812
43044
|
}
|
|
@@ -42820,7 +43052,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42820
43052
|
return __generator(this, function (_c) {
|
|
42821
43053
|
switch (_c.label) {
|
|
42822
43054
|
case 0:
|
|
42823
|
-
QUERY = src(
|
|
43055
|
+
QUERY = src(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "], ["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "])));
|
|
42824
43056
|
_c.label = 1;
|
|
42825
43057
|
case 1:
|
|
42826
43058
|
_c.trys.push([1, 3, , 4]);
|
|
@@ -42848,11 +43080,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42848
43080
|
};
|
|
42849
43081
|
IkasCustomerAPI.saveLastViewedProducts = function (input) {
|
|
42850
43082
|
return __awaiter(this, void 0, void 0, function () {
|
|
42851
|
-
var MUTATION, errors,
|
|
43083
|
+
var MUTATION, errors, err_13;
|
|
42852
43084
|
return __generator(this, function (_a) {
|
|
42853
43085
|
switch (_a.label) {
|
|
42854
43086
|
case 0:
|
|
42855
|
-
MUTATION = src(
|
|
43087
|
+
MUTATION = src(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "], ["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "])));
|
|
42856
43088
|
_a.label = 1;
|
|
42857
43089
|
case 1:
|
|
42858
43090
|
_a.trys.push([1, 3, , 4]);
|
|
@@ -42870,8 +43102,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42870
43102
|
return [2 /*return*/, false];
|
|
42871
43103
|
return [3 /*break*/, 4];
|
|
42872
43104
|
case 3:
|
|
42873
|
-
|
|
42874
|
-
console.log(
|
|
43105
|
+
err_13 = _a.sent();
|
|
43106
|
+
console.log(err_13);
|
|
42875
43107
|
return [2 /*return*/, false];
|
|
42876
43108
|
case 4: return [2 /*return*/, true];
|
|
42877
43109
|
}
|
|
@@ -42880,11 +43112,11 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42880
43112
|
};
|
|
42881
43113
|
IkasCustomerAPI.getOrderRefundSettings = function () {
|
|
42882
43114
|
return __awaiter(this, void 0, void 0, function () {
|
|
42883
|
-
var QUERY, _a, data, errors,
|
|
43115
|
+
var QUERY, _a, data, errors, err_14;
|
|
42884
43116
|
return __generator(this, function (_b) {
|
|
42885
43117
|
switch (_b.label) {
|
|
42886
43118
|
case 0:
|
|
42887
|
-
QUERY = src(
|
|
43119
|
+
QUERY = src(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "], ["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "])));
|
|
42888
43120
|
_b.label = 1;
|
|
42889
43121
|
case 1:
|
|
42890
43122
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42905,8 +43137,8 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42905
43137
|
return [2 /*return*/, new IkasOrderRefundSettings(data.listOrderRefundSettings[0])];
|
|
42906
43138
|
return [3 /*break*/, 4];
|
|
42907
43139
|
case 3:
|
|
42908
|
-
|
|
42909
|
-
console.log(
|
|
43140
|
+
err_14 = _b.sent();
|
|
43141
|
+
console.log(err_14);
|
|
42910
43142
|
return [3 /*break*/, 4];
|
|
42911
43143
|
case 4: return [2 /*return*/];
|
|
42912
43144
|
}
|
|
@@ -42915,7 +43147,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42915
43147
|
};
|
|
42916
43148
|
return IkasCustomerAPI;
|
|
42917
43149
|
}());
|
|
42918
|
-
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
43150
|
+
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16;
|
|
42919
43151
|
|
|
42920
43152
|
var IkasCustomerReviewAPI = /** @class */ (function () {
|
|
42921
43153
|
function IkasCustomerReviewAPI() {
|
|
@@ -43165,9 +43397,11 @@ var IkasProductAttributeTableCell = /** @class */ (function () {
|
|
|
43165
43397
|
|
|
43166
43398
|
var IkasProductAttributeTableTemplate = /** @class */ (function () {
|
|
43167
43399
|
function IkasProductAttributeTableTemplate(data) {
|
|
43168
|
-
this.columns = (data === null || data === void 0 ? void 0 : data.columns)
|
|
43400
|
+
this.columns = (data === null || data === void 0 ? void 0 : data.columns)
|
|
43401
|
+
? data.columns.map(function (c) { return new IkasProductAttributeTableCell(c); })
|
|
43169
43402
|
: [];
|
|
43170
|
-
this.rows = (data === null || data === void 0 ? void 0 : data.rows)
|
|
43403
|
+
this.rows = (data === null || data === void 0 ? void 0 : data.rows)
|
|
43404
|
+
? data.rows.map(function (r) { return new IkasProductAttributeTableCell(r); })
|
|
43171
43405
|
: [];
|
|
43172
43406
|
mobx.makeAutoObservable(this);
|
|
43173
43407
|
}
|
|
@@ -43281,7 +43515,8 @@ function simpleToProduct(simple) {
|
|
|
43281
43515
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
43282
43516
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
43283
43517
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
43284
|
-
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate)
|
|
43518
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate)
|
|
43519
|
+
? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
43285
43520
|
: null,
|
|
43286
43521
|
}),
|
|
43287
43522
|
productAttributeOption: a.productAttributeOption,
|
|
@@ -43351,7 +43586,8 @@ function simpleToProduct(simple) {
|
|
|
43351
43586
|
id: (_c = a.productAttribute) === null || _c === void 0 ? void 0 : _c.id,
|
|
43352
43587
|
name: (_d = a.productAttribute) === null || _d === void 0 ? void 0 : _d.name,
|
|
43353
43588
|
type: (_e = a.productAttribute) === null || _e === void 0 ? void 0 : _e.type,
|
|
43354
|
-
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate)
|
|
43589
|
+
tableTemplate: ((_f = a.productAttribute) === null || _f === void 0 ? void 0 : _f.tableTemplate)
|
|
43590
|
+
? new IkasProductAttributeTableTemplate(a.productAttribute.tableTemplate)
|
|
43355
43591
|
: null,
|
|
43356
43592
|
}),
|
|
43357
43593
|
productAttributeOption: a.productAttributeOption,
|
|
@@ -43369,7 +43605,8 @@ function simpleToProduct(simple) {
|
|
|
43369
43605
|
.filter(function (s) {
|
|
43370
43606
|
var _a;
|
|
43371
43607
|
return isLocal ||
|
|
43372
|
-
IkasStorefrontConfig.isEditor ||
|
|
43608
|
+
IkasStorefrontConfig.isEditor ||
|
|
43609
|
+
((_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId));
|
|
43373
43610
|
})
|
|
43374
43611
|
.reduce(function (total, current) { return current.stockCount + total; }, 0) || 0,
|
|
43375
43612
|
variantValues: (_d = v.variantValues) === null || _d === void 0 ? void 0 : _d.map(function (vv) {
|
|
@@ -43690,7 +43927,7 @@ var IkasProductOptionSetAPI = /** @class */ (function () {
|
|
|
43690
43927
|
switch (_b.label) {
|
|
43691
43928
|
case 0:
|
|
43692
43929
|
_b.trys.push([0, 2, , 3]);
|
|
43693
|
-
QUERY = src(templateObject_1$i || (templateObject_1$i = __makeTemplateObject(["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "], ["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "])));
|
|
43930
|
+
QUERY = src(templateObject_1$i || (templateObject_1$i = __makeTemplateObject(["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n minRelativeNextDate\n maxRelativeNextDate\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "], ["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n minRelativeNextDate\n maxRelativeNextDate\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "])));
|
|
43694
43931
|
return [4 /*yield*/, apollo
|
|
43695
43932
|
.getClient()
|
|
43696
43933
|
.query({
|
|
@@ -44649,7 +44886,8 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
|
44649
44886
|
return __generator(this, function (_b) {
|
|
44650
44887
|
switch (_b.label) {
|
|
44651
44888
|
case 0:
|
|
44652
|
-
if (!this.attributePropValue.attributeId ||
|
|
44889
|
+
if (!this.attributePropValue.attributeId ||
|
|
44890
|
+
((_a = this.attributePropValue) === null || _a === void 0 ? void 0 : _a.usePageData) ||
|
|
44653
44891
|
(!this.attributePropValue.usePageData &&
|
|
44654
44892
|
!this.attributePropValue.variantId)) {
|
|
44655
44893
|
return [2 /*return*/, {
|
|
@@ -45598,7 +45836,8 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45598
45836
|
return [2 /*return*/];
|
|
45599
45837
|
}
|
|
45600
45838
|
metaDataList = [];
|
|
45601
|
-
if (!(((_a = this.possiblePageTypes) === null || _a === void 0 ? void 0 : _a.includes(exports.IkasThemePageType.BLOG)) ||
|
|
45839
|
+
if (!(((_a = this.possiblePageTypes) === null || _a === void 0 ? void 0 : _a.includes(exports.IkasThemePageType.BLOG)) ||
|
|
45840
|
+
((_b = this.possiblePageTypes) === null || _b === void 0 ? void 0 : _b.includes(exports.IkasThemePageType.BLOG_CATEGORY)))) return [3 /*break*/, 2];
|
|
45602
45841
|
return [4 /*yield*/, IkasBlogAPI.listBlogMetaData(slug)];
|
|
45603
45842
|
case 1:
|
|
45604
45843
|
metaDataList = _d.sent();
|
|
@@ -46488,7 +46727,7 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
|
46488
46727
|
}, [pageSpecificDataStr]);
|
|
46489
46728
|
var href = React.useMemo(function () {
|
|
46490
46729
|
if (pageSpecificData && pageSpecificData.href) {
|
|
46491
|
-
return "https://"
|
|
46730
|
+
return "https://".concat(IkasStorefrontConfig.domain).concat(pageSpecificData.href);
|
|
46492
46731
|
}
|
|
46493
46732
|
}, [pageSpecificData]);
|
|
46494
46733
|
var ogpMetas = React.useMemo(function () {
|
|
@@ -46519,7 +46758,7 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
|
46519
46758
|
property: "og:url",
|
|
46520
46759
|
content: href ||
|
|
46521
46760
|
(isBrowser ? window.location.href : "") ||
|
|
46522
|
-
"https://"
|
|
46761
|
+
"https://".concat(IkasStorefrontConfig.domain),
|
|
46523
46762
|
});
|
|
46524
46763
|
if (pageSpecificData && pageType === exports.IkasThemePageType.PRODUCT) {
|
|
46525
46764
|
var productDetail = pageSpecificData;
|
|
@@ -46575,7 +46814,7 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
|
46575
46814
|
React.createElement("title", null, pageTitle || ""),
|
|
46576
46815
|
React.createElement("meta", { name: "description", content: pageDescription || "" }),
|
|
46577
46816
|
!!addOgpMetas &&
|
|
46578
|
-
ogpMetas.map(function (ogpMeta, index) { return (React.createElement("meta", { key: ogpMeta.content
|
|
46817
|
+
ogpMetas.map(function (ogpMeta, index) { return (React.createElement("meta", { key: "".concat(ogpMeta.content, "-").concat(index), property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
46579
46818
|
!!schemas.length &&
|
|
46580
46819
|
schemas.map(function (schema, index) { return (React.createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
46581
46820
|
__html: JSON.stringify(schema),
|
|
@@ -46606,7 +46845,7 @@ function createProductSchema(productDetail) {
|
|
|
46606
46845
|
if (isBrowser) {
|
|
46607
46846
|
IkasPageDataInit._initProductDetailOnBrowser(productDetail);
|
|
46608
46847
|
}
|
|
46609
|
-
var productUrl = "https://"
|
|
46848
|
+
var productUrl = "https://".concat(IkasStorefrontConfig.domain).concat(productDetail.href);
|
|
46610
46849
|
return {
|
|
46611
46850
|
"@context": "https://schema.org/",
|
|
46612
46851
|
"@type": "Product",
|
|
@@ -46640,7 +46879,7 @@ function createProductSchema(productDetail) {
|
|
|
46640
46879
|
function createCategorySchema(category) {
|
|
46641
46880
|
var _a, _b, _c;
|
|
46642
46881
|
try {
|
|
46643
|
-
var categoryUrl = "https://"
|
|
46882
|
+
var categoryUrl = "https://".concat(IkasStorefrontConfig.domain).concat(category.href);
|
|
46644
46883
|
return {
|
|
46645
46884
|
"@context": "http://schema.org",
|
|
46646
46885
|
"@type": "CollectionPage",
|
|
@@ -46670,10 +46909,10 @@ function createCategoryBreadcrumbSchema(category) {
|
|
|
46670
46909
|
|
|
46671
46910
|
var IkasPage = mobxReactLite.observer(function (_a) {
|
|
46672
46911
|
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas;
|
|
46673
|
-
|
|
46912
|
+
var router$1 = router.useRouter();
|
|
46913
|
+
IkasStorefrontConfig.initWithJson(configJson, router$1);
|
|
46674
46914
|
var store = IkasStorefrontConfig.store;
|
|
46675
46915
|
store.currentPageType = pageType;
|
|
46676
|
-
var router$1 = router.useRouter();
|
|
46677
46916
|
var _b = React.useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
|
|
46678
46917
|
var settings = React.useState(new IkasThemeSettings(JSON.parse(settingsStr)))[0];
|
|
46679
46918
|
var propValues = React.useMemo(function () {
|
|
@@ -70640,7 +70879,7 @@ var GiftPackage = mobxReactLite.observer(function (_a) {
|
|
|
70640
70879
|
}, [vm, vm.checkoutSettings, vm.cart]);
|
|
70641
70880
|
var checkboxLabel = t("checkout-page:giftPackageCta") +
|
|
70642
70881
|
(giftPackagePrice && giftPackagePrice.price
|
|
70643
|
-
? " (+ "
|
|
70882
|
+
? " (+ ".concat(formatMoney(giftPackagePrice.price, giftPackagePrice.currencyCode), ")")
|
|
70644
70883
|
: "");
|
|
70645
70884
|
if (!vm.checkoutSettings.isGiftPackageEnabled)
|
|
70646
70885
|
return null;
|
|
@@ -70732,7 +70971,7 @@ var Installments = mobxReactLite.observer(function (_a) {
|
|
|
70732
70971
|
React.createElement("div", { className: styles$a.InstallmentInfo },
|
|
70733
70972
|
React.createElement("div", { className: styles$a.InstallmentCount }, ip.installmentCount === 1
|
|
70734
70973
|
? t("checkout-page:singleInstallment")
|
|
70735
|
-
: ip.installmentCount
|
|
70974
|
+
: "".concat(ip.installmentCount, " ").concat(t("checkout-page:installments"))),
|
|
70736
70975
|
ip.installmentCount !== 1 && (React.createElement("div", { className: styles$a.InstallmentPrice }, formatMoney(ip.installmentPrice, vm.checkout.cart.currencyCode)))),
|
|
70737
70976
|
React.createElement("div", { className: styles$a.Price }, formatMoney(ip.totalPrice, vm.checkout.cart.currencyCode)))); }))));
|
|
70738
70977
|
});
|
|
@@ -70776,9 +71015,9 @@ var PaymentGateways = mobxReactLite.observer(function (_a) {
|
|
|
70776
71015
|
var getAdditionalPriceText = function (ap) {
|
|
70777
71016
|
if (ap.amount === 0)
|
|
70778
71017
|
return "";
|
|
70779
|
-
return ""
|
|
71018
|
+
return "".concat(ap.amountType === IkasPaymentGatewayAdditionalPriceAmountType.AMOUNT
|
|
70780
71019
|
? formatMoney(ap.amount, vm.cart.currencyCode)
|
|
70781
|
-
: " %" + ap.amount)
|
|
71020
|
+
: " %" + ap.amount).concat(ap.type === IkasPaymentMethodAdditionalPriceType.DECREMENT
|
|
70782
71021
|
? " " + t("checkout-page:paymentMethodDiscount")
|
|
70783
71022
|
: " " + t("checkout-page:paymentMethodAdditionalPrice"));
|
|
70784
71023
|
};
|
|
@@ -70921,6 +71160,11 @@ var CartItem = mobxReactLite.observer(function (_a) {
|
|
|
70921
71160
|
return ((_a = a.appliedOrderLines) === null || _a === void 0 ? void 0 : _a.filter(function (aol) { return aol.orderLineId === cartItem.id; }).reduce(function (total, current) { return total + (current.amount || 0); }, 0)) || 0;
|
|
70922
71161
|
});
|
|
70923
71162
|
var adjustmentTotal = adjustmentAmounts === null || adjustmentAmounts === void 0 ? void 0 : adjustmentAmounts.reduce(function (total, current) { return total + current; }, 0);
|
|
71163
|
+
var formatDateTheme = function (val) {
|
|
71164
|
+
var date = formatDate(new Date(val)).split(" ");
|
|
71165
|
+
date.splice(-1);
|
|
71166
|
+
return date.join(" ");
|
|
71167
|
+
};
|
|
70924
71168
|
var options = React.useMemo(function () {
|
|
70925
71169
|
var _a;
|
|
70926
71170
|
return (React.createElement("div", null, (_a = cartItem.options) === null || _a === void 0 ? void 0 : _a.map(function (option) {
|
|
@@ -70931,6 +71175,12 @@ var CartItem = mobxReactLite.observer(function (_a) {
|
|
|
70931
71175
|
return (React.createElement("div", { className: styles$e.OptionRow },
|
|
70932
71176
|
React.createElement("div", { className: styles$e.OptionName }, option.name),
|
|
70933
71177
|
React.createElement("div", { className: styles$e.OptionValue }, option.values.map(function (v) { return v.name || v.value; }).join(", "))));
|
|
71178
|
+
case exports.IkasProductOptionType.DATE_PICKER:
|
|
71179
|
+
return (React.createElement("div", { className: styles$e.OptionRow },
|
|
71180
|
+
React.createElement("div", { className: styles$e.OptionName }, option.name),
|
|
71181
|
+
React.createElement("div", { className: styles$e.OptionValue }, option.values
|
|
71182
|
+
.map(function (v) { return formatDateTheme(v.value); })
|
|
71183
|
+
.join(", "))));
|
|
70934
71184
|
case exports.IkasProductOptionType.CHECKBOX:
|
|
70935
71185
|
return (React.createElement("div", { className: styles$e.OptionRow },
|
|
70936
71186
|
React.createElement("div", { className: styles$e.OptionName }, option.name),
|
|
@@ -70949,7 +71199,7 @@ var CartItem = mobxReactLite.observer(function (_a) {
|
|
|
70949
71199
|
React.createElement("img", { className: styles$e.Image, src: (_c = cartItem.variant.mainImage) === null || _c === void 0 ? void 0 : _c.thumbnailSrc })),
|
|
70950
71200
|
React.createElement("div", { className: styles$e.Right },
|
|
70951
71201
|
React.createElement("div", { className: styles$e.Name }, cartItem.variant.name),
|
|
70952
|
-
React.createElement("div", { className: styles$e.LightText }, t("checkout-page:quantity")
|
|
71202
|
+
React.createElement("div", { className: styles$e.LightText }, "".concat(t("checkout-page:quantity"), ": ") + cartItem.quantity),
|
|
70953
71203
|
React.createElement("div", { className: styles$e.LightText }, cartItem.variant.variantValues
|
|
70954
71204
|
.map(function (vv) { return vv.variantValueName; })
|
|
70955
71205
|
.join(" / ")),
|
|
@@ -71055,7 +71305,7 @@ var CartSummary = mobxReactLite.observer(function (_a) {
|
|
|
71055
71305
|
!!allowExpand && (React.createElement("div", { className: styles$h.ExpandHeader, onClick: function () { return setExpanded(!isExpanded); } },
|
|
71056
71306
|
React.createElement("div", { className: styles$h.Left }, t("checkout-page:summary")),
|
|
71057
71307
|
React.createElement("div", { className: styles$h.Price },
|
|
71058
|
-
React.createElement("span", { className: styles$h.PriceText }, formatMoney(vm.finalPrice, cart.currencyCode)
|
|
71308
|
+
React.createElement("span", { className: styles$h.PriceText }, "".concat(formatMoney(vm.finalPrice, cart.currencyCode), " (").concat((_b = vm.cart) === null || _b === void 0 ? void 0 : _b.items.length, " ").concat(t("checkout-page:cartItemProduct"), ")")),
|
|
71059
71309
|
React.createElement("span", { className: arrowDownClasses },
|
|
71060
71310
|
React.createElement(SVGArrowDown, null))))),
|
|
71061
71311
|
React.createElement("div", { className: styles$h.DetailsContainer, style: detailsContainerStyle },
|
|
@@ -71346,7 +71596,9 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71346
71596
|
hasSameOptionValues =
|
|
71347
71597
|
hasSameOptionValues &&
|
|
71348
71598
|
existingOptionValues.length === (productOptionValues === null || productOptionValues === void 0 ? void 0 : productOptionValues.length) &&
|
|
71349
|
-
existingOptionValues.every(function (val) {
|
|
71599
|
+
existingOptionValues.every(function (val) {
|
|
71600
|
+
return productOptionValues === null || productOptionValues === void 0 ? void 0 : productOptionValues.includes(val);
|
|
71601
|
+
});
|
|
71350
71602
|
if (!hasSameOptionValues)
|
|
71351
71603
|
return "break";
|
|
71352
71604
|
};
|
|
@@ -71417,7 +71669,8 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71417
71669
|
cartId = ((_b = this.cart) === null || _b === void 0 ? void 0 : _b.id) || localStorage.getItem(CART_LS_KEY);
|
|
71418
71670
|
input = {
|
|
71419
71671
|
cartId: cartId,
|
|
71420
|
-
customerId: ((_c = this.cart) === null || _c === void 0 ? void 0 : _c.customerId) ||
|
|
71672
|
+
customerId: ((_c = this.cart) === null || _c === void 0 ? void 0 : _c.customerId) ||
|
|
71673
|
+
((_d = this.baseStore.customerStore.customer) === null || _d === void 0 ? void 0 : _d.id) ||
|
|
71421
71674
|
null,
|
|
71422
71675
|
item: {
|
|
71423
71676
|
id: null,
|
|
@@ -71444,7 +71697,7 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71444
71697
|
_f.label = 4;
|
|
71445
71698
|
case 4:
|
|
71446
71699
|
if (this.cart) {
|
|
71447
|
-
eventId = this.cart.id
|
|
71700
|
+
eventId = "".concat(this.cart.id, "-").concat(this.cart.updatedAt);
|
|
71448
71701
|
item = this.cart.items.find(function (i) { return i.variant.id; });
|
|
71449
71702
|
if (item) {
|
|
71450
71703
|
Analytics.addToCart(item, initialQuantity, eventId, this.cart);
|
|
@@ -71473,7 +71726,8 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71473
71726
|
_d.sent();
|
|
71474
71727
|
input = {
|
|
71475
71728
|
cartId: ((_a = this.cart) === null || _a === void 0 ? void 0 : _a.id) || null,
|
|
71476
|
-
customerId: ((_b = this.cart) === null || _b === void 0 ? void 0 : _b.customerId) ||
|
|
71729
|
+
customerId: ((_b = this.cart) === null || _b === void 0 ? void 0 : _b.customerId) ||
|
|
71730
|
+
((_c = this.baseStore.customerStore.customer) === null || _c === void 0 ? void 0 : _c.id) ||
|
|
71477
71731
|
null,
|
|
71478
71732
|
item: {
|
|
71479
71733
|
id: item.id,
|
|
@@ -71501,7 +71755,7 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71501
71755
|
case 4:
|
|
71502
71756
|
this.removeCardIfEmpty();
|
|
71503
71757
|
if (this.cart) {
|
|
71504
|
-
eventId = this.cart.id
|
|
71758
|
+
eventId = "".concat(this.cart.id, "-").concat(this.cart.updatedAt);
|
|
71505
71759
|
oldQuantity = item.quantity;
|
|
71506
71760
|
if (oldQuantity > quantity) {
|
|
71507
71761
|
Analytics.removeFromCart(item, oldQuantity - quantity, this.cart);
|
|
@@ -71585,7 +71839,7 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71585
71839
|
Object.defineProperty(IkasCartStore.prototype, "checkoutUrl", {
|
|
71586
71840
|
get: function () {
|
|
71587
71841
|
if (this._checkoutId)
|
|
71588
|
-
return "/checkout?id="
|
|
71842
|
+
return "/checkout?id=".concat(this._checkoutId, "&step=info");
|
|
71589
71843
|
},
|
|
71590
71844
|
enumerable: false,
|
|
71591
71845
|
configurable: true
|
|
@@ -71675,12 +71929,12 @@ var StepSuccess = mobxReactLite.observer(function (_a) {
|
|
|
71675
71929
|
((_a = vm.successTransaction) === null || _a === void 0 ? void 0 : _a.paymentMethod) === "CREDIT_CARD" && (React.createElement(React.Fragment, null,
|
|
71676
71930
|
React.createElement("div", { className: styles$i.InfoText },
|
|
71677
71931
|
React.createElement("div", { className: styles$i.CardLogoContainer }, getCardLogo()),
|
|
71678
|
-
React.createElement("span", null, "**** "
|
|
71932
|
+
React.createElement("span", null, "**** ".concat((paymentMethodDetail === null || paymentMethodDetail === void 0 ? void 0 : paymentMethodDetail.lastFourDigits) || ""))),
|
|
71679
71933
|
((_b = paymentMethodDetail === null || paymentMethodDetail === void 0 ? void 0 : paymentMethodDetail.installment) === null || _b === void 0 ? void 0 : _b.installmentCount) &&
|
|
71680
71934
|
paymentMethodDetail.installment.installmentCount > 1 && (React.createElement(React.Fragment, null,
|
|
71681
|
-
React.createElement("div", { className: styles$i.InfoText }, paymentMethodDetail.installment.installmentCount
|
|
71935
|
+
React.createElement("div", { className: styles$i.InfoText }, "".concat(paymentMethodDetail.installment.installmentCount, " ").concat(t("checkout-page:installments"))),
|
|
71682
71936
|
paymentMethodDetail.installment.installmentPrice !==
|
|
71683
|
-
null && (React.createElement("div", { className: styles$i.InfoText }, paymentMethodDetail.installment.installmentCount
|
|
71937
|
+
null && (React.createElement("div", { className: styles$i.InfoText }, "".concat(paymentMethodDetail.installment.installmentCount, " x ").concat(formatMoney(paymentMethodDetail.installment.installmentPrice, vm.checkout.cart.currencyCode))))))))),
|
|
71684
71938
|
React.createElement("div", null,
|
|
71685
71939
|
React.createElement("div", { className: styles$i.InfoTitle }, t("checkout-page:billingAddress")),
|
|
71686
71940
|
!!((_c = vm.checkout.billingAddress) === null || _c === void 0 ? void 0 : _c.company) && (React.createElement("div", { className: [styles$i.InfoText, styles$i.InfoTextBold].join(" ") }, vm.checkout.billingAddress.company)),
|
|
@@ -71804,9 +72058,11 @@ var OrderStatus = mobxReactLite.observer(function (_a) {
|
|
|
71804
72058
|
colorClass = styles$i.Red;
|
|
71805
72059
|
break;
|
|
71806
72060
|
}
|
|
71807
|
-
return (React.createElement("div", { className: [styles$i.OrderStatus, colorClass].join(" ") }, ((_c = vm.order) === null || _c === void 0 ? void 0 : _c.orderPackageStatus)
|
|
71808
|
-
|
|
71809
|
-
|
|
72061
|
+
return (React.createElement("div", { className: [styles$i.OrderStatus, colorClass].join(" ") }, ((_c = vm.order) === null || _c === void 0 ? void 0 : _c.orderPackageStatus)
|
|
72062
|
+
? (_d = getOrderPackageStatusText().find(function (o) {
|
|
72063
|
+
return o.types.includes(vm.order.orderPackageStatus);
|
|
72064
|
+
})) === null || _d === void 0 ? void 0 : _d.text
|
|
72065
|
+
: ""));
|
|
71810
72066
|
});
|
|
71811
72067
|
|
|
71812
72068
|
var IMAGE_SIZES = [
|
|
@@ -71847,15 +72103,15 @@ var StepContainer = mobxReactLite.observer(function (_a) {
|
|
|
71847
72103
|
if (selectedStepIndex === 0)
|
|
71848
72104
|
return;
|
|
71849
72105
|
if (selectedStepIndex === 2) {
|
|
71850
|
-
(_a = document.getElementById("step-"
|
|
72106
|
+
(_a = document.getElementById("step-".concat(1))) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
71851
72107
|
}
|
|
71852
72108
|
else {
|
|
71853
|
-
(_b = document.getElementById("step-"
|
|
72109
|
+
(_b = document.getElementById("step-".concat(selectedStepIndex))) === null || _b === void 0 ? void 0 : _b.scrollIntoView();
|
|
71854
72110
|
}
|
|
71855
72111
|
}
|
|
71856
72112
|
}, []);
|
|
71857
72113
|
return (React.createElement("div", { className: styles$k.StepContainer }, steps.map(function (step, index) { return (React.createElement("div", { className: styles$k.Step },
|
|
71858
|
-
React.createElement("div", { id: "step-"
|
|
72114
|
+
React.createElement("div", { id: "step-".concat(index), className: [
|
|
71859
72115
|
styles$k.StepTitleContainer,
|
|
71860
72116
|
index === 0 ? styles$k.First : "",
|
|
71861
72117
|
].join(" ") },
|
|
@@ -72207,12 +72463,15 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
|
|
|
72207
72463
|
var isHovered = mobx.computed(function () {
|
|
72208
72464
|
return vm.hoveredPageComponentId === pageComponent.id;
|
|
72209
72465
|
});
|
|
72210
|
-
var hasNullValue = mobx.computed(function () {
|
|
72211
|
-
|
|
72212
|
-
|
|
72213
|
-
|
|
72214
|
-
|
|
72215
|
-
|
|
72466
|
+
var hasNullValue = mobx.computed(function () {
|
|
72467
|
+
var _a;
|
|
72468
|
+
return (_a = pageComponentPropValue.get()) === null || _a === void 0 ? void 0 : _a.component.props.some(function (prop) {
|
|
72469
|
+
if (prop.isRequired) {
|
|
72470
|
+
var propValue = (propValues || {})[prop.name];
|
|
72471
|
+
return propValue === null || propValue == undefined;
|
|
72472
|
+
}
|
|
72473
|
+
});
|
|
72474
|
+
});
|
|
72216
72475
|
var onMouseEnter = function () {
|
|
72217
72476
|
vm.onMouseOver(pageComponent.id);
|
|
72218
72477
|
};
|
|
@@ -72575,7 +72834,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
72575
72834
|
? provider.theme.components.map(function (c) { return c.id; })
|
|
72576
72835
|
: provider.page.components.map(function (pc) { return pc.componentId; });
|
|
72577
72836
|
components = themeLocalization.themeJson.components.filter(function (c) { return isEditor || componentIds_1.includes(c.id); });
|
|
72578
|
-
namespaces =
|
|
72837
|
+
namespaces = __spreadArray(["common"], components.map(function (c) { return c.dir; }), true);
|
|
72579
72838
|
if (pageType === exports.IkasThemePageType.CHECKOUT || isEditor) {
|
|
72580
72839
|
namespaces.push("checkout-page");
|
|
72581
72840
|
}
|
|
@@ -72615,7 +72874,8 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
72615
72874
|
extraProps.returnPolicy = themeLocalization.returnPolicy;
|
|
72616
72875
|
extraProps.privacyPolicy = themeLocalization.privacyPolicy;
|
|
72617
72876
|
extraProps.termsOfService = themeLocalization.termsOfService;
|
|
72618
|
-
extraProps.checkoutSettingsStr = (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length)
|
|
72877
|
+
extraProps.checkoutSettingsStr = (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length)
|
|
72878
|
+
? JSON.stringify(checkoutSettings[0])
|
|
72619
72879
|
: null;
|
|
72620
72880
|
_c.label = 6;
|
|
72621
72881
|
case 6:
|
|
@@ -72659,11 +72919,11 @@ var IkasNextPageDataProvider = /** @class */ (function () {
|
|
|
72659
72919
|
IkasNextPageDataProvider.createColorScript = function (settings) {
|
|
72660
72920
|
if (!settings.colors)
|
|
72661
72921
|
return;
|
|
72662
|
-
return "<script>"
|
|
72922
|
+
return "<script>".concat(settings.colors
|
|
72663
72923
|
.map(function (sc) {
|
|
72664
|
-
return "document.documentElement.style.setProperty(\""
|
|
72924
|
+
return "document.documentElement.style.setProperty(\"".concat(sc.key, "\",\"").concat(sc.color, "\");");
|
|
72665
72925
|
})
|
|
72666
|
-
.join("\r\n")
|
|
72926
|
+
.join("\r\n"), "</script> \n ");
|
|
72667
72927
|
};
|
|
72668
72928
|
return IkasNextPageDataProvider;
|
|
72669
72929
|
}());
|
|
@@ -72791,7 +73051,7 @@ var CheckoutPage = function (_a) {
|
|
|
72791
73051
|
var merchantSettingsStr = _a.merchantSettingsStr, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["merchantSettingsStr", "checkoutSettingsStr", "customizationProps", "configJson"]);
|
|
72792
73052
|
var router$1 = router.useRouter();
|
|
72793
73053
|
var _b = React.useState(), checkout = _b[0], setCheckout = _b[1];
|
|
72794
|
-
IkasStorefrontConfig.initWithJson(configJson);
|
|
73054
|
+
IkasStorefrontConfig.initWithJson(configJson, router$1);
|
|
72795
73055
|
var store = IkasStorefrontConfig.store;
|
|
72796
73056
|
var checkoutSettings = React.useMemo(function () {
|
|
72797
73057
|
return checkoutSettingsStr
|
|
@@ -73043,8 +73303,9 @@ var cart$1 = /*#__PURE__*/Object.freeze({
|
|
|
73043
73303
|
var IkasPageEditor$1 = dynamic__default['default'](function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
|
|
73044
73304
|
var Page$c = function (_a) {
|
|
73045
73305
|
var configJson = _a.configJson;
|
|
73306
|
+
var router$1 = router.useRouter();
|
|
73046
73307
|
if (configJson) {
|
|
73047
|
-
IkasStorefrontConfig.initWithJson(configJson);
|
|
73308
|
+
IkasStorefrontConfig.initWithJson(configJson, router$1);
|
|
73048
73309
|
}
|
|
73049
73310
|
return React.createElement(IkasPageEditor$1, null);
|
|
73050
73311
|
};
|
|
@@ -73590,6 +73851,73 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
73590
73851
|
enumerable: false,
|
|
73591
73852
|
configurable: true
|
|
73592
73853
|
});
|
|
73854
|
+
/**
|
|
73855
|
+
* Call it when click the social login button
|
|
73856
|
+
* This will automaticly redirect to matched url.
|
|
73857
|
+
* @param provider
|
|
73858
|
+
* @returns undefined
|
|
73859
|
+
*/
|
|
73860
|
+
IkasCustomerStore.prototype.socialLogin = function (provider) {
|
|
73861
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73862
|
+
var redirect, url, result, resultJson;
|
|
73863
|
+
return __generator(this, function (_a) {
|
|
73864
|
+
switch (_a.label) {
|
|
73865
|
+
case 0:
|
|
73866
|
+
if (typeof window === "undefined")
|
|
73867
|
+
return [2 /*return*/];
|
|
73868
|
+
redirect = new URLSearchParams(window.location.search).get("redirect") || "";
|
|
73869
|
+
url = "".concat(process.env.NEXT_PUBLIC_BASE_URL, "/ms/").concat(provider, "/login/authenticate?redirect=").concat(redirect);
|
|
73870
|
+
return [4 /*yield*/, fetch(url, {
|
|
73871
|
+
headers: {
|
|
73872
|
+
"x-api-key": IkasStorefrontConfig.config.apiKey || "",
|
|
73873
|
+
"x-sfid": IkasStorefrontConfig.storefrontId || "",
|
|
73874
|
+
"x-sfrid": IkasStorefrontConfig.storefrontRoutingId || "",
|
|
73875
|
+
},
|
|
73876
|
+
})];
|
|
73877
|
+
case 1:
|
|
73878
|
+
result = _a.sent();
|
|
73879
|
+
return [4 /*yield*/, result.json()];
|
|
73880
|
+
case 2:
|
|
73881
|
+
resultJson = _a.sent();
|
|
73882
|
+
if (IkasStorefrontConfig.router)
|
|
73883
|
+
IkasStorefrontConfig.router.replace(resultJson.redirectUrl);
|
|
73884
|
+
else
|
|
73885
|
+
window.location.href = resultJson.redirectUrl;
|
|
73886
|
+
return [2 /*return*/];
|
|
73887
|
+
}
|
|
73888
|
+
});
|
|
73889
|
+
});
|
|
73890
|
+
};
|
|
73891
|
+
/**
|
|
73892
|
+
* When user click the social login ex. facebook login. We navigate to backend.
|
|
73893
|
+
* and backend navigate to provider. after user login into provider,
|
|
73894
|
+
* backend redirect to account/login with following params;
|
|
73895
|
+
* socialLoginStatus: success | fail
|
|
73896
|
+
* socialLoginError: string
|
|
73897
|
+
* socialLoginToken: string
|
|
73898
|
+
* if query params includes socialLoginToken call this function to verify
|
|
73899
|
+
* @param token
|
|
73900
|
+
* @returns boolean
|
|
73901
|
+
*/
|
|
73902
|
+
IkasCustomerStore.prototype.socialLoginToken = function (token) {
|
|
73903
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73904
|
+
var response;
|
|
73905
|
+
return __generator(this, function (_a) {
|
|
73906
|
+
switch (_a.label) {
|
|
73907
|
+
case 0: return [4 /*yield*/, IkasCustomerAPI.socialLogin(token)];
|
|
73908
|
+
case 1:
|
|
73909
|
+
response = _a.sent();
|
|
73910
|
+
if (!(response === null || response === void 0 ? void 0 : response.customer))
|
|
73911
|
+
return [2 /*return*/, false];
|
|
73912
|
+
this.setToken(response.token, response.tokenExpiry);
|
|
73913
|
+
this.setCustomer(response.customer);
|
|
73914
|
+
if (this.customer)
|
|
73915
|
+
Analytics.customerLogin();
|
|
73916
|
+
return [2 /*return*/, true];
|
|
73917
|
+
}
|
|
73918
|
+
});
|
|
73919
|
+
});
|
|
73920
|
+
};
|
|
73593
73921
|
IkasCustomerStore.prototype.init = function () {
|
|
73594
73922
|
return __awaiter(this, void 0, void 0, function () {
|
|
73595
73923
|
return __generator(this, function (_a) {
|
|
@@ -73785,7 +74113,8 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
73785
74113
|
IkasCustomerStore.prototype.loadCustomerConsent = function () {
|
|
73786
74114
|
if (isServer$3)
|
|
73787
74115
|
return;
|
|
73788
|
-
this._customerConsentGranted =
|
|
74116
|
+
this._customerConsentGranted =
|
|
74117
|
+
!!window.localStorage.getItem(LS_CUSTOMER_CONSENT);
|
|
73789
74118
|
};
|
|
73790
74119
|
IkasCustomerStore.prototype.removeCustomerConsent = function () {
|
|
73791
74120
|
if (isServer$3)
|