@bigbinary/neeto-commons-frontend 2.0.30 → 2.0.32

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.
@@ -0,0 +1,1760 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var common = require('Support/utils/common');
6
+ require('@bigbinary/neetoui');
7
+ require('i18next');
8
+ var ramda = require('ramda');
9
+ var dayjs = require('dayjs');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
14
+
15
+ function _typeof$1(obj) {
16
+ "@babel/helpers - typeof";
17
+
18
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
19
+ return typeof obj;
20
+ } : function (obj) {
21
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
22
+ }, _typeof$1(obj);
23
+ }
24
+
25
+ function _toPrimitive(input, hint) {
26
+ if (_typeof$1(input) !== "object" || input === null) return input;
27
+ var prim = input[Symbol.toPrimitive];
28
+ if (prim !== undefined) {
29
+ var res = prim.call(input, hint || "default");
30
+ if (_typeof$1(res) !== "object") return res;
31
+ throw new TypeError("@@toPrimitive must return a primitive value.");
32
+ }
33
+ return (hint === "string" ? String : Number)(input);
34
+ }
35
+
36
+ function _toPropertyKey(arg) {
37
+ var key = _toPrimitive(arg, "string");
38
+ return _typeof$1(key) === "symbol" ? key : String(key);
39
+ }
40
+
41
+ function _defineProperty(obj, key, value) {
42
+ key = _toPropertyKey(key);
43
+ if (key in obj) {
44
+ Object.defineProperty(obj, key, {
45
+ value: value,
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true
49
+ });
50
+ } else {
51
+ obj[key] = value;
52
+ }
53
+ return obj;
54
+ }
55
+
56
+ function _arrayLikeToArray(arr, len) {
57
+ if (len == null || len > arr.length) len = arr.length;
58
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
59
+ return arr2;
60
+ }
61
+
62
+ function _arrayWithoutHoles(arr) {
63
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
64
+ }
65
+
66
+ function _iterableToArray(iter) {
67
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
68
+ }
69
+
70
+ function _unsupportedIterableToArray(o, minLen) {
71
+ if (!o) return;
72
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
73
+ var n = Object.prototype.toString.call(o).slice(8, -1);
74
+ if (n === "Object" && o.constructor) n = o.constructor.name;
75
+ if (n === "Map" || n === "Set") return Array.from(o);
76
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
77
+ }
78
+
79
+ function _nonIterableSpread() {
80
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
81
+ }
82
+
83
+ function _toConsumableArray(arr) {
84
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
85
+ }
86
+
87
+ var environment = {
88
+ development: "development",
89
+ staging: "staging"
90
+ };
91
+ var isStagingEnv = Cypress.env("configFile") === environment.staging;
92
+
93
+ var getCountFromText = function getCountFromText(countText) {
94
+ return Number(countText.text().trim().split(" ")[0]);
95
+ };
96
+ var dataCy = function dataCy(value) {
97
+ var suffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
98
+ return "[data-cy='".concat(value, "']").concat(suffix);
99
+ };
100
+ var setListCount = function setListCount(countSelector, alias) {
101
+ return cy.get(countSelector).then(function (countText) {
102
+ cy.wrap(getCountFromText(countText)).as(alias);
103
+ });
104
+ };
105
+ var verifyListCount = function verifyListCount(countSelector, count) {
106
+ return cy.get(countSelector).then(function (countText) {
107
+ cy.wrap(getCountFromText(countText)).should("eq", count);
108
+ });
109
+ };
110
+ var getUrl = function getUrl(path) {
111
+ return "/api/v1/".concat(path);
112
+ };
113
+ var getTestTitle = function getTestTitle() {
114
+ var ctx = Cypress.mocha.getRunner().suite.ctx;
115
+ return ctx.currentTest.parent.title;
116
+ };
117
+ var initializeCredentials = function initializeCredentials(stagingData) {
118
+ cy.task("getGlobalState").then(function (state) {
119
+ var newState = {
120
+ businessName: state.businessName || stagingData.businessName,
121
+ currentUserName: state.currentUserName || stagingData.currentUserName,
122
+ email: state.email || stagingData.email,
123
+ firstName: state.firstName || stagingData.firstName,
124
+ lastName: state.lastName || stagingData.lastName,
125
+ subdomainName: state.subdomainName || stagingData.subdomainName,
126
+ skipSetup: state.skipSetup
127
+ };
128
+ if (isStagingEnv) {
129
+ var baseUrl = "https://".concat(newState.subdomainName, ".").concat(stagingData.domain);
130
+ Cypress.config("baseUrl", baseUrl);
131
+ }
132
+ cy.task("bulkUpdateGlobalState", newState);
133
+ });
134
+ };
135
+
136
+ var allPath = function allPath() {
137
+ return "".concat(Cypress.config("baseUrl")).concat(getUrl("**"));
138
+ };
139
+ var requestApis = {
140
+ countries: getUrl("countries"),
141
+ signUp: getUrl("signups/**"),
142
+ subdomainAvailablity: getUrl("subdomain_availability/**"),
143
+ teamMembers: {
144
+ all: "/team_members*/**",
145
+ bulkUpdate: "/team_members/teams/bulk_update",
146
+ index: "/team_members/teams"
147
+ }
148
+ };
149
+ var urlPaths = {
150
+ members: "/desk/members"
151
+ };
152
+ Object.defineProperty(requestApis, "allPath", {
153
+ get: allPath
154
+ });
155
+
156
+ var commonSelectors = {
157
+ alertTitle: dataCy("alert-title"),
158
+ alertModalMessage: dataCy("alert-message"),
159
+ alertModalSubmitButton: dataCy("alert-submit-button"),
160
+ checkbox: ".neeto-ui-checkbox",
161
+ checkboxLabel: dataCy("nui-checkbox-label"),
162
+ dropdownContainer: dataCy("nui-dropdown-container"),
163
+ dropdownIcon: dataCy("nui-dropdown-icon"),
164
+ heading: dataCy("main-header"),
165
+ paneBody: ".neeto-ui-pane__body",
166
+ paneHeader: ".neeto-ui-pane__header",
167
+ profileSidebar: ".neeto-ui-profile-sidebar",
168
+ selectOption: ".neeto-ui-react-select__option",
169
+ toastMessage: dataCy("toastr-message-container"),
170
+ toastCloseButton: ".neeto-ui-toastr__close-button",
171
+ windowAlert: "#alert-box"
172
+ };
173
+ var tableSelectors = {
174
+ nthColumn: function nthColumn(n) {
175
+ return "td:nth-child(".concat(n, ")");
176
+ },
177
+ tableBody: ".ant-table-body",
178
+ tableHeader: ".ant-table-thead th",
179
+ tableRow: ".ant-table-tbody tr",
180
+ spinner: ".ant-spin"
181
+ };
182
+ var profileSelectors = {
183
+ logoutLink: dataCy("profile-logout-button"),
184
+ profileOptionsContainer: '[class="tippy-box sidebar-featured-tooltip__content"]'
185
+ };
186
+
187
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
188
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
189
+ Cypress.Commands.add("clearAndType", function (selector, text) {
190
+ cy.get(selector).clear().type(text);
191
+ });
192
+ Cypress.Commands.add("clearAndTypeFast", function (selector, text) {
193
+ cy.get(selector).clear().type(text, {
194
+ delay: 0
195
+ });
196
+ });
197
+ Cypress.Commands.add("clearByClickAndTypeFast", function (selector, text) {
198
+ cy.get(selector).click().clear().type(text, {
199
+ delay: 0
200
+ });
201
+ });
202
+ Cypress.Commands.add("typeFast", function (selector, text) {
203
+ cy.get(selector).type(text, {
204
+ delay: 0
205
+ });
206
+ });
207
+ Cypress.Commands.add("typeAndEnter", function (selector, text) {
208
+ cy.get(selector).clear().type("".concat(text, "{enter}"));
209
+ });
210
+ Cypress.Commands.add("verifyToastMessage", function (message) {
211
+ cy.get(commonSelectors.toastMessage).should("be.visible").should("have.text", message);
212
+
213
+ // close toast message
214
+ cy.get(commonSelectors.toastCloseButton).click();
215
+ cy.get(commonSelectors.toastMessage).should("not.exist");
216
+ });
217
+ Cypress.Commands.add("continueOnAlert", function (args) {
218
+ var props = _typeof$1(args) === "object" ? args : {
219
+ alias: args
220
+ };
221
+ var alias = props.alias,
222
+ title = props.title,
223
+ description = props.description,
224
+ _props$requestCount = props.requestCount,
225
+ requestCount = _props$requestCount === void 0 ? 1 : _props$requestCount,
226
+ toastMessage = props.toastMessage;
227
+ var hasMoreThanOneRequest = requestCount > 1;
228
+ title && cy.get(commonSelectors.alertTitle).should("have.text", title);
229
+ description && cy.get(commonSelectors.alertModalMessage).should("have.text", description);
230
+ cy.interceptApi(alias, requestCount);
231
+ cy.get(commonSelectors.alertModalSubmitButton).click();
232
+ cy.wait("@".concat(alias));
233
+ toastMessage && cy.verifyToastMessage(toastMessage);
234
+ hasMoreThanOneRequest && cy.waitForMultipleRequest("@".concat(alias), requestCount - 1);
235
+ });
236
+ Cypress.Commands.add("interceptApi", function (alias) {
237
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
238
+ return cy.intercept({
239
+ url: requestApis.allPath,
240
+ times: times
241
+ }).as(alias);
242
+ });
243
+ Cypress.Commands.add("waitForMultipleRequest", function (alias) {
244
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
245
+ return cy.wrap(_toConsumableArray(new Array(times))).each(function () {
246
+ return cy.wait(alias);
247
+ });
248
+ });
249
+ Cypress.Commands.add("apiRequest", function (options) {
250
+ return cy.get("@requestHeaders").then(function (requestHeaders) {
251
+ return requestHeaders ? cy.request(_objectSpread(_objectSpread({}, options), {}, {
252
+ headers: requestHeaders
253
+ })) : cy.log("No request headers found");
254
+ });
255
+ });
256
+ Cypress.Commands.add("reloadAndWait", function () {
257
+ var requestCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
258
+ if (requestCount > 0) {
259
+ cy.interceptApi("reloadAllRequests", requestCount);
260
+ cy.reload();
261
+ cy.waitForMultipleRequest("@reloadAllRequests", requestCount);
262
+ }
263
+ });
264
+ Cypress.Commands.add("selectOption", function (containerSelector, optionText) {
265
+ cy.openInSameTabOnClick;
266
+ cy.get(containerSelector).click().type(optionText);
267
+ cy.contains(commonSelectors.selectOption, optionText).invoke("click");
268
+ });
269
+ Cypress.Commands.add("clickDropdownOption", function (optionText) {
270
+ var dropdownSelector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : commonSelectors.dropdownIcon;
271
+ cy.get(dropdownSelector).click();
272
+ cy.get(commonSelectors.dropdownContainer).contains(optionText).invoke("click");
273
+ });
274
+ Cypress.Commands.add("getText", function (selector) {
275
+ return cy.get(selector).invoke("text");
276
+ });
277
+ Cypress.Commands.add("getValue", function (selector) {
278
+ return cy.get(selector).invoke("val");
279
+ });
280
+ Cypress.Commands.add("getIframe", function (iframeSelector) {
281
+ return cy.get(iframeSelector).its("0.contentDocument.body").should("not.be.empty");
282
+ });
283
+ Cypress.Commands.add("openInSameTabOnClick", function (_ref) {
284
+ var url = _ref.url,
285
+ alias = _ref.alias,
286
+ selector = _ref.selector;
287
+ cy.window().then(function (win) {
288
+ cy.stub(win, "open").as(alias).callsFake(function (newUrl) {
289
+ return win.location.href = newUrl;
290
+ });
291
+ });
292
+ cy.get(selector).click();
293
+ cy.get("@".concat(alias)).should("be.called");
294
+ cy.url().should("include", url);
295
+ });
296
+ Cypress.Commands.add("globalState", function (key) {
297
+ return cy.task("getGlobalState", key);
298
+ });
299
+
300
+ var loginSelectors = {
301
+ appleAuthenticationButton: dataCy("apple-authentication-button"),
302
+ emailTextField: dataCy("login-email-text-field"),
303
+ googleAuthenticationButton: dataCy("google-authentication-button"),
304
+ githubAuthenticationButton: dataCy("github-authentication-button"),
305
+ loginViaEmailButton: dataCy("login-via-email-button"),
306
+ otpField: dataCy("otpinput-otp-number"),
307
+ passwordTextField: dataCy("login-password-text-field"),
308
+ rememberMeCheckBox: dataCy("login-remember-me-check-box"),
309
+ submitButton: dataCy("login-submit-button"),
310
+ twitterAuthenticationButton: dataCy("twitter-authentication-button")
311
+ };
312
+
313
+ function _arrayWithHoles(arr) {
314
+ if (Array.isArray(arr)) return arr;
315
+ }
316
+
317
+ function _iterableToArrayLimit(arr, i) {
318
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
319
+ if (null != _i) {
320
+ var _s,
321
+ _e,
322
+ _x,
323
+ _r,
324
+ _arr = [],
325
+ _n = !0,
326
+ _d = !1;
327
+ try {
328
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
329
+ if (Object(_i) !== _i) return;
330
+ _n = !1;
331
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
332
+ } catch (err) {
333
+ _d = !0, _e = err;
334
+ } finally {
335
+ try {
336
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
337
+ } finally {
338
+ if (_d) throw _e;
339
+ }
340
+ }
341
+ return _arr;
342
+ }
343
+ }
344
+
345
+ function _nonIterableRest() {
346
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
347
+ }
348
+
349
+ function _slicedToArray(arr, i) {
350
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
351
+ }
352
+
353
+ var regeneratorRuntime$1 = {exports: {}};
354
+
355
+ var _typeof = {exports: {}};
356
+
357
+ (function (module) {
358
+ function _typeof(obj) {
359
+ "@babel/helpers - typeof";
360
+
361
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
362
+ return typeof obj;
363
+ } : function (obj) {
364
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
365
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
366
+ }
367
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
368
+ } (_typeof));
369
+
370
+ (function (module) {
371
+ var _typeof$1 = _typeof.exports["default"];
372
+ function _regeneratorRuntime() {
373
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
374
+ return exports;
375
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
376
+ var exports = {},
377
+ Op = Object.prototype,
378
+ hasOwn = Op.hasOwnProperty,
379
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
380
+ obj[key] = desc.value;
381
+ },
382
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
383
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
384
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
385
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
386
+ function define(obj, key, value) {
387
+ return Object.defineProperty(obj, key, {
388
+ value: value,
389
+ enumerable: !0,
390
+ configurable: !0,
391
+ writable: !0
392
+ }), obj[key];
393
+ }
394
+ try {
395
+ define({}, "");
396
+ } catch (err) {
397
+ define = function define(obj, key, value) {
398
+ return obj[key] = value;
399
+ };
400
+ }
401
+ function wrap(innerFn, outerFn, self, tryLocsList) {
402
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
403
+ generator = Object.create(protoGenerator.prototype),
404
+ context = new Context(tryLocsList || []);
405
+ return defineProperty(generator, "_invoke", {
406
+ value: makeInvokeMethod(innerFn, self, context)
407
+ }), generator;
408
+ }
409
+ function tryCatch(fn, obj, arg) {
410
+ try {
411
+ return {
412
+ type: "normal",
413
+ arg: fn.call(obj, arg)
414
+ };
415
+ } catch (err) {
416
+ return {
417
+ type: "throw",
418
+ arg: err
419
+ };
420
+ }
421
+ }
422
+ exports.wrap = wrap;
423
+ var ContinueSentinel = {};
424
+ function Generator() {}
425
+ function GeneratorFunction() {}
426
+ function GeneratorFunctionPrototype() {}
427
+ var IteratorPrototype = {};
428
+ define(IteratorPrototype, iteratorSymbol, function () {
429
+ return this;
430
+ });
431
+ var getProto = Object.getPrototypeOf,
432
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
433
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
434
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
435
+ function defineIteratorMethods(prototype) {
436
+ ["next", "throw", "return"].forEach(function (method) {
437
+ define(prototype, method, function (arg) {
438
+ return this._invoke(method, arg);
439
+ });
440
+ });
441
+ }
442
+ function AsyncIterator(generator, PromiseImpl) {
443
+ function invoke(method, arg, resolve, reject) {
444
+ var record = tryCatch(generator[method], generator, arg);
445
+ if ("throw" !== record.type) {
446
+ var result = record.arg,
447
+ value = result.value;
448
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
449
+ invoke("next", value, resolve, reject);
450
+ }, function (err) {
451
+ invoke("throw", err, resolve, reject);
452
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
453
+ result.value = unwrapped, resolve(result);
454
+ }, function (error) {
455
+ return invoke("throw", error, resolve, reject);
456
+ });
457
+ }
458
+ reject(record.arg);
459
+ }
460
+ var previousPromise;
461
+ defineProperty(this, "_invoke", {
462
+ value: function value(method, arg) {
463
+ function callInvokeWithMethodAndArg() {
464
+ return new PromiseImpl(function (resolve, reject) {
465
+ invoke(method, arg, resolve, reject);
466
+ });
467
+ }
468
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
469
+ }
470
+ });
471
+ }
472
+ function makeInvokeMethod(innerFn, self, context) {
473
+ var state = "suspendedStart";
474
+ return function (method, arg) {
475
+ if ("executing" === state) throw new Error("Generator is already running");
476
+ if ("completed" === state) {
477
+ if ("throw" === method) throw arg;
478
+ return doneResult();
479
+ }
480
+ for (context.method = method, context.arg = arg;;) {
481
+ var delegate = context.delegate;
482
+ if (delegate) {
483
+ var delegateResult = maybeInvokeDelegate(delegate, context);
484
+ if (delegateResult) {
485
+ if (delegateResult === ContinueSentinel) continue;
486
+ return delegateResult;
487
+ }
488
+ }
489
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
490
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
491
+ context.dispatchException(context.arg);
492
+ } else "return" === context.method && context.abrupt("return", context.arg);
493
+ state = "executing";
494
+ var record = tryCatch(innerFn, self, context);
495
+ if ("normal" === record.type) {
496
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
497
+ return {
498
+ value: record.arg,
499
+ done: context.done
500
+ };
501
+ }
502
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
503
+ }
504
+ };
505
+ }
506
+ function maybeInvokeDelegate(delegate, context) {
507
+ var methodName = context.method,
508
+ method = delegate.iterator[methodName];
509
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
510
+ var record = tryCatch(method, delegate.iterator, context.arg);
511
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
512
+ var info = record.arg;
513
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
514
+ }
515
+ function pushTryEntry(locs) {
516
+ var entry = {
517
+ tryLoc: locs[0]
518
+ };
519
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
520
+ }
521
+ function resetTryEntry(entry) {
522
+ var record = entry.completion || {};
523
+ record.type = "normal", delete record.arg, entry.completion = record;
524
+ }
525
+ function Context(tryLocsList) {
526
+ this.tryEntries = [{
527
+ tryLoc: "root"
528
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
529
+ }
530
+ function values(iterable) {
531
+ if (iterable) {
532
+ var iteratorMethod = iterable[iteratorSymbol];
533
+ if (iteratorMethod) return iteratorMethod.call(iterable);
534
+ if ("function" == typeof iterable.next) return iterable;
535
+ if (!isNaN(iterable.length)) {
536
+ var i = -1,
537
+ next = function next() {
538
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
539
+ return next.value = undefined, next.done = !0, next;
540
+ };
541
+ return next.next = next;
542
+ }
543
+ }
544
+ return {
545
+ next: doneResult
546
+ };
547
+ }
548
+ function doneResult() {
549
+ return {
550
+ value: undefined,
551
+ done: !0
552
+ };
553
+ }
554
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
555
+ value: GeneratorFunctionPrototype,
556
+ configurable: !0
557
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
558
+ value: GeneratorFunction,
559
+ configurable: !0
560
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
561
+ var ctor = "function" == typeof genFun && genFun.constructor;
562
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
563
+ }, exports.mark = function (genFun) {
564
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
565
+ }, exports.awrap = function (arg) {
566
+ return {
567
+ __await: arg
568
+ };
569
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
570
+ return this;
571
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
572
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
573
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
574
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
575
+ return result.done ? result.value : iter.next();
576
+ });
577
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
578
+ return this;
579
+ }), define(Gp, "toString", function () {
580
+ return "[object Generator]";
581
+ }), exports.keys = function (val) {
582
+ var object = Object(val),
583
+ keys = [];
584
+ for (var key in object) keys.push(key);
585
+ return keys.reverse(), function next() {
586
+ for (; keys.length;) {
587
+ var key = keys.pop();
588
+ if (key in object) return next.value = key, next.done = !1, next;
589
+ }
590
+ return next.done = !0, next;
591
+ };
592
+ }, exports.values = values, Context.prototype = {
593
+ constructor: Context,
594
+ reset: function reset(skipTempReset) {
595
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
596
+ },
597
+ stop: function stop() {
598
+ this.done = !0;
599
+ var rootRecord = this.tryEntries[0].completion;
600
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
601
+ return this.rval;
602
+ },
603
+ dispatchException: function dispatchException(exception) {
604
+ if (this.done) throw exception;
605
+ var context = this;
606
+ function handle(loc, caught) {
607
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
608
+ }
609
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
610
+ var entry = this.tryEntries[i],
611
+ record = entry.completion;
612
+ if ("root" === entry.tryLoc) return handle("end");
613
+ if (entry.tryLoc <= this.prev) {
614
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
615
+ hasFinally = hasOwn.call(entry, "finallyLoc");
616
+ if (hasCatch && hasFinally) {
617
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
618
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
619
+ } else if (hasCatch) {
620
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
621
+ } else {
622
+ if (!hasFinally) throw new Error("try statement without catch or finally");
623
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
624
+ }
625
+ }
626
+ }
627
+ },
628
+ abrupt: function abrupt(type, arg) {
629
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
630
+ var entry = this.tryEntries[i];
631
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
632
+ var finallyEntry = entry;
633
+ break;
634
+ }
635
+ }
636
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
637
+ var record = finallyEntry ? finallyEntry.completion : {};
638
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
639
+ },
640
+ complete: function complete(record, afterLoc) {
641
+ if ("throw" === record.type) throw record.arg;
642
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
643
+ },
644
+ finish: function finish(finallyLoc) {
645
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
646
+ var entry = this.tryEntries[i];
647
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
648
+ }
649
+ },
650
+ "catch": function _catch(tryLoc) {
651
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
652
+ var entry = this.tryEntries[i];
653
+ if (entry.tryLoc === tryLoc) {
654
+ var record = entry.completion;
655
+ if ("throw" === record.type) {
656
+ var thrown = record.arg;
657
+ resetTryEntry(entry);
658
+ }
659
+ return thrown;
660
+ }
661
+ }
662
+ throw new Error("illegal catch attempt");
663
+ },
664
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
665
+ return this.delegate = {
666
+ iterator: values(iterable),
667
+ resultName: resultName,
668
+ nextLoc: nextLoc
669
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
670
+ }
671
+ }, exports;
672
+ }
673
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
674
+ } (regeneratorRuntime$1));
675
+
676
+ // TODO(Babel 8): Remove this file.
677
+
678
+ var runtime = regeneratorRuntime$1.exports();
679
+
680
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
681
+ try {
682
+ regeneratorRuntime = runtime;
683
+ } catch (accidentalStrictMode) {
684
+ if (typeof globalThis === "object") {
685
+ globalThis.regeneratorRuntime = runtime;
686
+ } else {
687
+ Function("r", "regeneratorRuntime = r")(runtime);
688
+ }
689
+ }
690
+
691
+ /**
692
+ * @template {Function} T
693
+ * @param {T} func
694
+ * @returns {T}
695
+ */
696
+ var nullSafe = function nullSafe(func) {
697
+ return (
698
+ // @ts-ignore
699
+ ramda.curryN(func.length, function () {
700
+ var _ref;
701
+ var dataArg = (_ref = func.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]);
702
+ return ramda.isNil(dataArg) ? dataArg : func.apply(void 0, arguments);
703
+ })
704
+ );
705
+ };
706
+
707
+ var slugify = function slugify(string) {
708
+ return string.toString().toLowerCase().replace(/\s+/g, "-") // Replace spaces with -
709
+ .replace(/&/g, "-and-") // Replace & with 'and'
710
+ .replace(/[^\w-]+/g, "") // Remove all non-word characters
711
+ .replace(/--+/g, "-") // Replace multiple - with single -
712
+ .replace(/^-+/, "") // Trim - from start of text
713
+ .replace(/-+$/, "");
714
+ }; // Trim - from end of text
715
+
716
+ var humanize = function humanize(string) {
717
+ string = string.replace(/[_-]+/g, " ").replace(/\s{2,}/g, " ").replace(/([a-z\d])([A-Z])/g, "$1" + " " + "$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1" + " " + "$2").toLowerCase().trim();
718
+ string = string.charAt(0).toUpperCase() + string.slice(1);
719
+ return string;
720
+ };
721
+ var snakeToCamelCase = function snakeToCamelCase(string) {
722
+ return string.replace(/(_\w)/g, function (letter) {
723
+ return letter[1].toUpperCase();
724
+ });
725
+ };
726
+ var camelToSnakeCase = function camelToSnakeCase(string) {
727
+ return string.replace(/[A-Z]/g, function (letter) {
728
+ return "_".concat(letter.toLowerCase());
729
+ });
730
+ };
731
+ var capitalize = function capitalize(string) {
732
+ return string.charAt(0).toUpperCase() + string.slice(1);
733
+ };
734
+ nullSafe(slugify);
735
+ nullSafe(humanize);
736
+ nullSafe(snakeToCamelCase);
737
+ nullSafe(camelToSnakeCase);
738
+ nullSafe(capitalize);
739
+
740
+ var filterNonNull = function filterNonNull(object) {
741
+ return Object.fromEntries(Object.entries(object).filter(function (_ref5) {
742
+ var _ref6 = _slicedToArray(_ref5, 2),
743
+ v = _ref6[1];
744
+ return !ramda.isNil(v);
745
+ }).map(function (_ref7) {
746
+ var _ref8 = _slicedToArray(_ref7, 2),
747
+ k = _ref8[0],
748
+ v = _ref8[1];
749
+ return [k, _typeof$1(v) === "object" && !Array.isArray(v) ? filterNonNull(v) : v];
750
+ }));
751
+ };
752
+ nullSafe(filterNonNull);
753
+
754
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
755
+ var shams = function hasSymbols() {
756
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
757
+ if (typeof Symbol.iterator === 'symbol') { return true; }
758
+
759
+ var obj = {};
760
+ var sym = Symbol('test');
761
+ var symObj = Object(sym);
762
+ if (typeof sym === 'string') { return false; }
763
+
764
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
765
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
766
+
767
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
768
+ // if (sym instanceof Symbol) { return false; }
769
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
770
+ // if (!(symObj instanceof Symbol)) { return false; }
771
+
772
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
773
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
774
+
775
+ var symVal = 42;
776
+ obj[sym] = symVal;
777
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
778
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
779
+
780
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
781
+
782
+ var syms = Object.getOwnPropertySymbols(obj);
783
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
784
+
785
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
786
+
787
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
788
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
789
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
790
+ }
791
+
792
+ return true;
793
+ };
794
+
795
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
796
+ var hasSymbolSham = shams;
797
+
798
+ var hasSymbols$1 = function hasNativeSymbols() {
799
+ if (typeof origSymbol !== 'function') { return false; }
800
+ if (typeof Symbol !== 'function') { return false; }
801
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
802
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
803
+
804
+ return hasSymbolSham();
805
+ };
806
+
807
+ /* eslint no-invalid-this: 1 */
808
+
809
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
810
+ var slice = Array.prototype.slice;
811
+ var toStr = Object.prototype.toString;
812
+ var funcType = '[object Function]';
813
+
814
+ var implementation$1 = function bind(that) {
815
+ var target = this;
816
+ if (typeof target !== 'function' || toStr.call(target) !== funcType) {
817
+ throw new TypeError(ERROR_MESSAGE + target);
818
+ }
819
+ var args = slice.call(arguments, 1);
820
+
821
+ var bound;
822
+ var binder = function () {
823
+ if (this instanceof bound) {
824
+ var result = target.apply(
825
+ this,
826
+ args.concat(slice.call(arguments))
827
+ );
828
+ if (Object(result) === result) {
829
+ return result;
830
+ }
831
+ return this;
832
+ } else {
833
+ return target.apply(
834
+ that,
835
+ args.concat(slice.call(arguments))
836
+ );
837
+ }
838
+ };
839
+
840
+ var boundLength = Math.max(0, target.length - args.length);
841
+ var boundArgs = [];
842
+ for (var i = 0; i < boundLength; i++) {
843
+ boundArgs.push('$' + i);
844
+ }
845
+
846
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
847
+
848
+ if (target.prototype) {
849
+ var Empty = function Empty() {};
850
+ Empty.prototype = target.prototype;
851
+ bound.prototype = new Empty();
852
+ Empty.prototype = null;
853
+ }
854
+
855
+ return bound;
856
+ };
857
+
858
+ var implementation = implementation$1;
859
+
860
+ var functionBind = Function.prototype.bind || implementation;
861
+
862
+ var bind$1 = functionBind;
863
+
864
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
865
+
866
+ var undefined$1;
867
+
868
+ var $SyntaxError = SyntaxError;
869
+ var $Function = Function;
870
+ var $TypeError = TypeError;
871
+
872
+ // eslint-disable-next-line consistent-return
873
+ var getEvalledConstructor = function (expressionSyntax) {
874
+ try {
875
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
876
+ } catch (e) {}
877
+ };
878
+
879
+ var $gOPD = Object.getOwnPropertyDescriptor;
880
+ if ($gOPD) {
881
+ try {
882
+ $gOPD({}, '');
883
+ } catch (e) {
884
+ $gOPD = null; // this is IE 8, which has a broken gOPD
885
+ }
886
+ }
887
+
888
+ var throwTypeError = function () {
889
+ throw new $TypeError();
890
+ };
891
+ var ThrowTypeError = $gOPD
892
+ ? (function () {
893
+ try {
894
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
895
+ arguments.callee; // IE 8 does not throw here
896
+ return throwTypeError;
897
+ } catch (calleeThrows) {
898
+ try {
899
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
900
+ return $gOPD(arguments, 'callee').get;
901
+ } catch (gOPDthrows) {
902
+ return throwTypeError;
903
+ }
904
+ }
905
+ }())
906
+ : throwTypeError;
907
+
908
+ var hasSymbols = hasSymbols$1();
909
+
910
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
911
+
912
+ var needsEval = {};
913
+
914
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
915
+
916
+ var INTRINSICS = {
917
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
918
+ '%Array%': Array,
919
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
920
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
921
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
922
+ '%AsyncFunction%': needsEval,
923
+ '%AsyncGenerator%': needsEval,
924
+ '%AsyncGeneratorFunction%': needsEval,
925
+ '%AsyncIteratorPrototype%': needsEval,
926
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
927
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
928
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
929
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
930
+ '%Boolean%': Boolean,
931
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
932
+ '%Date%': Date,
933
+ '%decodeURI%': decodeURI,
934
+ '%decodeURIComponent%': decodeURIComponent,
935
+ '%encodeURI%': encodeURI,
936
+ '%encodeURIComponent%': encodeURIComponent,
937
+ '%Error%': Error,
938
+ '%eval%': eval, // eslint-disable-line no-eval
939
+ '%EvalError%': EvalError,
940
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
941
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
942
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
943
+ '%Function%': $Function,
944
+ '%GeneratorFunction%': needsEval,
945
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
946
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
947
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
948
+ '%isFinite%': isFinite,
949
+ '%isNaN%': isNaN,
950
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
951
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
952
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
953
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
954
+ '%Math%': Math,
955
+ '%Number%': Number,
956
+ '%Object%': Object,
957
+ '%parseFloat%': parseFloat,
958
+ '%parseInt%': parseInt,
959
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
960
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
961
+ '%RangeError%': RangeError,
962
+ '%ReferenceError%': ReferenceError,
963
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
964
+ '%RegExp%': RegExp,
965
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
966
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
967
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
968
+ '%String%': String,
969
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
970
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
971
+ '%SyntaxError%': $SyntaxError,
972
+ '%ThrowTypeError%': ThrowTypeError,
973
+ '%TypedArray%': TypedArray,
974
+ '%TypeError%': $TypeError,
975
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
976
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
977
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
978
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
979
+ '%URIError%': URIError,
980
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
981
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
982
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
983
+ };
984
+
985
+ try {
986
+ null.error; // eslint-disable-line no-unused-expressions
987
+ } catch (e) {
988
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
989
+ var errorProto = getProto(getProto(e));
990
+ INTRINSICS['%Error.prototype%'] = errorProto;
991
+ }
992
+
993
+ var doEval = function doEval(name) {
994
+ var value;
995
+ if (name === '%AsyncFunction%') {
996
+ value = getEvalledConstructor('async function () {}');
997
+ } else if (name === '%GeneratorFunction%') {
998
+ value = getEvalledConstructor('function* () {}');
999
+ } else if (name === '%AsyncGeneratorFunction%') {
1000
+ value = getEvalledConstructor('async function* () {}');
1001
+ } else if (name === '%AsyncGenerator%') {
1002
+ var fn = doEval('%AsyncGeneratorFunction%');
1003
+ if (fn) {
1004
+ value = fn.prototype;
1005
+ }
1006
+ } else if (name === '%AsyncIteratorPrototype%') {
1007
+ var gen = doEval('%AsyncGenerator%');
1008
+ if (gen) {
1009
+ value = getProto(gen.prototype);
1010
+ }
1011
+ }
1012
+
1013
+ INTRINSICS[name] = value;
1014
+
1015
+ return value;
1016
+ };
1017
+
1018
+ var LEGACY_ALIASES = {
1019
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1020
+ '%ArrayPrototype%': ['Array', 'prototype'],
1021
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1022
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1023
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1024
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1025
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1026
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1027
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1028
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
1029
+ '%DataViewPrototype%': ['DataView', 'prototype'],
1030
+ '%DatePrototype%': ['Date', 'prototype'],
1031
+ '%ErrorPrototype%': ['Error', 'prototype'],
1032
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1033
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1034
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1035
+ '%FunctionPrototype%': ['Function', 'prototype'],
1036
+ '%Generator%': ['GeneratorFunction', 'prototype'],
1037
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1038
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1039
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1040
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1041
+ '%JSONParse%': ['JSON', 'parse'],
1042
+ '%JSONStringify%': ['JSON', 'stringify'],
1043
+ '%MapPrototype%': ['Map', 'prototype'],
1044
+ '%NumberPrototype%': ['Number', 'prototype'],
1045
+ '%ObjectPrototype%': ['Object', 'prototype'],
1046
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1047
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1048
+ '%PromisePrototype%': ['Promise', 'prototype'],
1049
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1050
+ '%Promise_all%': ['Promise', 'all'],
1051
+ '%Promise_reject%': ['Promise', 'reject'],
1052
+ '%Promise_resolve%': ['Promise', 'resolve'],
1053
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1054
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1055
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
1056
+ '%SetPrototype%': ['Set', 'prototype'],
1057
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1058
+ '%StringPrototype%': ['String', 'prototype'],
1059
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
1060
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1061
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1062
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1063
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1064
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1065
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1066
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1067
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
1068
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1069
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
1070
+ };
1071
+
1072
+ var bind = functionBind;
1073
+ var hasOwn = src;
1074
+ var $concat = bind.call(Function.call, Array.prototype.concat);
1075
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
1076
+ var $replace = bind.call(Function.call, String.prototype.replace);
1077
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
1078
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
1079
+
1080
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1081
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1082
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1083
+ var stringToPath = function stringToPath(string) {
1084
+ var first = $strSlice(string, 0, 1);
1085
+ var last = $strSlice(string, -1);
1086
+ if (first === '%' && last !== '%') {
1087
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
1088
+ } else if (last === '%' && first !== '%') {
1089
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
1090
+ }
1091
+ var result = [];
1092
+ $replace(string, rePropName, function (match, number, quote, subString) {
1093
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
1094
+ });
1095
+ return result;
1096
+ };
1097
+ /* end adaptation */
1098
+
1099
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1100
+ var intrinsicName = name;
1101
+ var alias;
1102
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
1103
+ alias = LEGACY_ALIASES[intrinsicName];
1104
+ intrinsicName = '%' + alias[0] + '%';
1105
+ }
1106
+
1107
+ if (hasOwn(INTRINSICS, intrinsicName)) {
1108
+ var value = INTRINSICS[intrinsicName];
1109
+ if (value === needsEval) {
1110
+ value = doEval(intrinsicName);
1111
+ }
1112
+ if (typeof value === 'undefined' && !allowMissing) {
1113
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1114
+ }
1115
+
1116
+ return {
1117
+ alias: alias,
1118
+ name: intrinsicName,
1119
+ value: value
1120
+ };
1121
+ }
1122
+
1123
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
1124
+ };
1125
+
1126
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
1127
+ if (typeof name !== 'string' || name.length === 0) {
1128
+ throw new $TypeError('intrinsic name must be a non-empty string');
1129
+ }
1130
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1131
+ throw new $TypeError('"allowMissing" argument must be a boolean');
1132
+ }
1133
+
1134
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
1135
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
1136
+ }
1137
+ var parts = stringToPath(name);
1138
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1139
+
1140
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1141
+ var intrinsicRealName = intrinsic.name;
1142
+ var value = intrinsic.value;
1143
+ var skipFurtherCaching = false;
1144
+
1145
+ var alias = intrinsic.alias;
1146
+ if (alias) {
1147
+ intrinsicBaseName = alias[0];
1148
+ $spliceApply(parts, $concat([0, 1], alias));
1149
+ }
1150
+
1151
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1152
+ var part = parts[i];
1153
+ var first = $strSlice(part, 0, 1);
1154
+ var last = $strSlice(part, -1);
1155
+ if (
1156
+ (
1157
+ (first === '"' || first === "'" || first === '`')
1158
+ || (last === '"' || last === "'" || last === '`')
1159
+ )
1160
+ && first !== last
1161
+ ) {
1162
+ throw new $SyntaxError('property names with quotes must have matching quotes');
1163
+ }
1164
+ if (part === 'constructor' || !isOwn) {
1165
+ skipFurtherCaching = true;
1166
+ }
1167
+
1168
+ intrinsicBaseName += '.' + part;
1169
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
1170
+
1171
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
1172
+ value = INTRINSICS[intrinsicRealName];
1173
+ } else if (value != null) {
1174
+ if (!(part in value)) {
1175
+ if (!allowMissing) {
1176
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1177
+ }
1178
+ return void undefined$1;
1179
+ }
1180
+ if ($gOPD && (i + 1) >= parts.length) {
1181
+ var desc = $gOPD(value, part);
1182
+ isOwn = !!desc;
1183
+
1184
+ // By convention, when a data property is converted to an accessor
1185
+ // property to emulate a data property that does not suffer from
1186
+ // the override mistake, that accessor's getter is marked with
1187
+ // an `originalValue` property. Here, when we detect this, we
1188
+ // uphold the illusion by pretending to see that original data
1189
+ // property, i.e., returning the value rather than the getter
1190
+ // itself.
1191
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1192
+ value = desc.get;
1193
+ } else {
1194
+ value = value[part];
1195
+ }
1196
+ } else {
1197
+ isOwn = hasOwn(value, part);
1198
+ value = value[part];
1199
+ }
1200
+
1201
+ if (isOwn && !skipFurtherCaching) {
1202
+ INTRINSICS[intrinsicRealName] = value;
1203
+ }
1204
+ }
1205
+ }
1206
+ return value;
1207
+ };
1208
+
1209
+ var callBind$1 = {exports: {}};
1210
+
1211
+ (function (module) {
1212
+
1213
+ var bind = functionBind;
1214
+ var GetIntrinsic = getIntrinsic;
1215
+
1216
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
1217
+ var $call = GetIntrinsic('%Function.prototype.call%');
1218
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
1219
+
1220
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
1221
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
1222
+ var $max = GetIntrinsic('%Math.max%');
1223
+
1224
+ if ($defineProperty) {
1225
+ try {
1226
+ $defineProperty({}, 'a', { value: 1 });
1227
+ } catch (e) {
1228
+ // IE 8 has a broken defineProperty
1229
+ $defineProperty = null;
1230
+ }
1231
+ }
1232
+
1233
+ module.exports = function callBind(originalFunction) {
1234
+ var func = $reflectApply(bind, $call, arguments);
1235
+ if ($gOPD && $defineProperty) {
1236
+ var desc = $gOPD(func, 'length');
1237
+ if (desc.configurable) {
1238
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
1239
+ $defineProperty(
1240
+ func,
1241
+ 'length',
1242
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
1243
+ );
1244
+ }
1245
+ }
1246
+ return func;
1247
+ };
1248
+
1249
+ var applyBind = function applyBind() {
1250
+ return $reflectApply(bind, $apply, arguments);
1251
+ };
1252
+
1253
+ if ($defineProperty) {
1254
+ $defineProperty(module.exports, 'apply', { value: applyBind });
1255
+ } else {
1256
+ module.exports.apply = applyBind;
1257
+ }
1258
+ } (callBind$1));
1259
+
1260
+ var GetIntrinsic$1 = getIntrinsic;
1261
+
1262
+ var callBind = callBind$1.exports;
1263
+
1264
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
1265
+
1266
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
1267
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
1268
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1269
+ return callBind(intrinsic);
1270
+ }
1271
+ return intrinsic;
1272
+ };
1273
+
1274
+ var GetIntrinsic = getIntrinsic;
1275
+ var callBound = callBound$1;
1276
+
1277
+ GetIntrinsic('%TypeError%');
1278
+ GetIntrinsic('%WeakMap%', true);
1279
+ GetIntrinsic('%Map%', true);
1280
+
1281
+ callBound('WeakMap.prototype.get', true);
1282
+ callBound('WeakMap.prototype.set', true);
1283
+ callBound('WeakMap.prototype.has', true);
1284
+ callBound('Map.prototype.get', true);
1285
+ callBound('Map.prototype.set', true);
1286
+ callBound('Map.prototype.has', true);
1287
+
1288
+ ((function () {
1289
+ var array = [];
1290
+ for (var i = 0; i < 256; ++i) {
1291
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
1292
+ }
1293
+
1294
+ return array;
1295
+ })());
1296
+
1297
+ var joinHyphenCase = function joinHyphenCase() {
1298
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1299
+ args[_key] = arguments[_key];
1300
+ }
1301
+ return args.join(" ").replace(/\s+/g, "-").toLowerCase();
1302
+ };
1303
+
1304
+ var memberSelectors = {
1305
+ membersTab: common.dataCy("agent-nav-tab"),
1306
+ newButton: common.dataCy("ntm-add-member-button"),
1307
+ continueButton: common.dataCy("ntm-manage-member-continue-button"),
1308
+ submitButton: common.dataCy("ntm-manage-member-submit-button"),
1309
+ searchTextField: common.dataCy("ntm-search-members-input"),
1310
+ email: "td:nth-child(3)",
1311
+ role: "td:nth-child(4)",
1312
+ deactivatedAgentsButton: common.dataCy("ntm-members-menubar-deactivated-block"),
1313
+ activatedMembersButton: common.dataCy("ntm-members-menubar-active-block"),
1314
+ columnCheckBox: common.dataCy("neeto-ui-columns-checkbox"),
1315
+ roleLabel: function roleLabel(role) {
1316
+ return common.dataCy("".concat(joinHyphenCase(role), "-radio-label"));
1317
+ },
1318
+ dropDownIcon: common.dataCy("ntm-members-table-row-dropdown-button"),
1319
+ menuBarHeading: common.dataCy("ntm-members-menubar-heading")
1320
+ };
1321
+ var memberFormSelectors = {
1322
+ emailTextField: "input.neeto-ui-react-select__input:eq(0)"
1323
+ };
1324
+
1325
+ var signUpSelectors = {
1326
+ emailTextField: dataCy("signup-email-text-field"),
1327
+ firstNameTextField: dataCy("signup-profile-first-name-text-field"),
1328
+ lastNameTextField: dataCy("signup-profile-last-name-text-field"),
1329
+ organizationNameTextField: dataCy("signup-organization-name-text-field"),
1330
+ organizationSubmitButton: dataCy("signup-organization-submit-button"),
1331
+ otpTextBox: dataCy("otpinput-otp-number"),
1332
+ profileSubmitButton: dataCy("signup-profile-submit-button"),
1333
+ signupViaEmailButton: dataCy("signup-via-email-button"),
1334
+ submitButton: dataCy("signup-email-submit-button"),
1335
+ subdomainNameTextField: dataCy("signup-organization-subdomain-text-field")
1336
+ };
1337
+
1338
+ var commonTexts = {
1339
+ activate: "Activate",
1340
+ block: "Block",
1341
+ copiedToClipboard: "Copied to clipboard!",
1342
+ crossSiteScript: "<script>alert('XSS')</script>",
1343
+ deactivate: "Deactivate",
1344
+ "delete": "Delete",
1345
+ edit: "Edit",
1346
+ invalidEmailMessage: "Please enter a valid email.",
1347
+ invalidSearchInput: "Invalid search input",
1348
+ logout: "Log out",
1349
+ "new": "New",
1350
+ takeAction: "Take action",
1351
+ unblock: "Unblock"
1352
+ };
1353
+
1354
+ var memberTexts = {
1355
+ addMember: "Add new member",
1356
+ admin: "Admin",
1357
+ agent: "Agent",
1358
+ agents: "Agents",
1359
+ activeMembersHeading: "Active members",
1360
+ accountActivatedToastMessage: function accountActivatedToastMessage(name) {
1361
+ return "".concat(name, "'s account has been activated.");
1362
+ },
1363
+ activateMember: "Activate member",
1364
+ activateMemberAlertMessage: function activateMemberAlertMessage(email) {
1365
+ return "You are activating ".concat(email, ". Are you sure you want to proceed?");
1366
+ },
1367
+ addMemberToProducts: function addMemberToProducts(email) {
1368
+ return "Add ".concat(email, " to the following neeto products.");
1369
+ },
1370
+ deactivateAccountToastMessage: function deactivateAccountToastMessage(name) {
1371
+ return "".concat(name, "'s account has been deactivated.");
1372
+ },
1373
+ deactivateMember: "Deactivate member",
1374
+ deactivateMemberAlertMessage: function deactivateMemberAlertMessage(email) {
1375
+ return "You are deactivating ".concat(email, ". Are you sure you want to proceed?");
1376
+ },
1377
+ editMember: "Edit member",
1378
+ inviteMessage: function inviteMessage(_ref) {
1379
+ var email = _ref.email,
1380
+ role = _ref.role,
1381
+ appName = _ref.appName;
1382
+ return "".concat(email, " will be invited to ").concat(appName, " with a role of ").concat(role, ".");
1383
+ },
1384
+ memberAddedMessage: "Added member successfully!",
1385
+ members: "Members",
1386
+ newHeading: "Add new member",
1387
+ updatedMemberRole: function updatedMemberRole(email, role) {
1388
+ return "Updated ".concat(email, "'s role to ").concat(role, ".");
1389
+ }
1390
+ };
1391
+ var memberTableTexts = {
1392
+ assignedTickets: "Assigned Tickets",
1393
+ availabilityForDesk: "Availability for Desk",
1394
+ created: "Created",
1395
+ email: "Email",
1396
+ name: "Name",
1397
+ role: "Role",
1398
+ teams: "Teams"
1399
+ };
1400
+
1401
+ var signUpTexts = {
1402
+ email: "Email",
1403
+ profile: "profile",
1404
+ tryItFree: "Try it FREE"
1405
+ };
1406
+
1407
+ var verifySSOLoginPage = function verifySSOLoginPage() {
1408
+ cy.log("verify Login Page");
1409
+ cy.get(loginSelectors.githubAuthenticationButton).should("be.visible");
1410
+ cy.get(loginSelectors.twitterAuthenticationButton).should("be.visible");
1411
+ cy.get(loginSelectors.appleAuthenticationButton).should("be.visible");
1412
+ cy.get(loginSelectors.googleAuthenticationButton).should("be.visible");
1413
+ cy.log("verify Cross Site scripting");
1414
+ cy.get(loginSelectors.loginViaEmailButton).click();
1415
+ cy.clearAndType(loginSelectors.emailTextField, commonTexts.crossSiteScript);
1416
+ cy.get(loginSelectors.submitButton).click();
1417
+ cy.get(commonSelectors.windowAlert).should("not.exist");
1418
+ cy.log("verify email login");
1419
+ cy.get(commonSelectors.emailInputError).should("have.text", commonTexts.invalidEmailMessage);
1420
+ cy.get(loginSelectors.emailTextField).clear();
1421
+ cy.get(loginSelectors.submitButton).click();
1422
+ cy.get(commonSelectors.emailInputError).should("have.text", commonTexts.invalidEmailMessage);
1423
+ };
1424
+ var logout = function logout(homeUrl) {
1425
+ cy.get(profileSelectors.profileSidebar).click();
1426
+ cy.get(profileSelectors.logoutLink).should("have.text", commonTexts.logout).invoke("click");
1427
+ cy.url({
1428
+ timeout: 15000
1429
+ }).should("not.include", homeUrl);
1430
+ };
1431
+ var authUtils = {
1432
+ verifySSOLoginPage: verifySSOLoginPage,
1433
+ logout: logout
1434
+ };
1435
+
1436
+ var currentDate = function currentDate() {
1437
+ return dayjs__default["default"]().format("YYYY-MM-DD");
1438
+ };
1439
+ var futureDate = function futureDate() {
1440
+ var numberOfDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
1441
+ var date = dayjs__default["default"]().add(numberOfDays, "day").format("YYYY-MM-DD");
1442
+ return date;
1443
+ };
1444
+ var pastDate = function pastDate() {
1445
+ var numberOfDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
1446
+ var date = dayjs__default["default"]().subtract(numberOfDays, "day").format("YYYY-MM-DD");
1447
+ return date;
1448
+ };
1449
+ var dateUtils = {
1450
+ currentDate: currentDate,
1451
+ futureDate: futureDate,
1452
+ pastDate: pastDate
1453
+ };
1454
+
1455
+ var interceptMemberApi = function interceptMemberApi(alias) {
1456
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1457
+ return cy.intercept({
1458
+ url: requestApis.teamMembers.all,
1459
+ times: times
1460
+ }).as(alias);
1461
+ };
1462
+ var navigateToMembersPage = function navigateToMembersPage() {
1463
+ var waitForRequest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
1464
+ waitForRequest && interceptMemberApi("fetchMembers", 2);
1465
+ cy.get(memberSelectors.membersTab).click();
1466
+ cy.url().should("include", urlPaths.members);
1467
+ waitForRequest && cy.waitForMultipleRequest("@fetchMembers", 2);
1468
+ cy.get(commonSelectors.heading).should("have.text", memberTexts.activeMembersHeading);
1469
+ };
1470
+ var addMemberViaUI = function addMemberViaUI(email) {
1471
+ var role = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : memberTexts.agent;
1472
+ cy.get(memberSelectors.newButton).should("have.text", memberTexts.addMember).click();
1473
+ cy.get(commonSelectors.paneHeader).should("have.text", memberTexts.newHeading);
1474
+ cy.get(memberFormSelectors.emailTextField).should("be.focused");
1475
+ cy.typeAndEnter(memberFormSelectors.emailTextField, email);
1476
+ cy.get(memberSelectors.roleLabel(role)).click();
1477
+ cy.get(memberSelectors.continueButton).click();
1478
+ if (isStagingEnv) {
1479
+ cy.get(commonSelectors.checkboxLabel).should("have.text", memberTexts.addMemberToProducts(email));
1480
+ cy.get(commonSelectors.paneBody).within(function () {
1481
+ return cy.get(commonSelectors.checkbox).uncheck();
1482
+ });
1483
+ cy.get(memberSelectors.continueButton).click();
1484
+ }
1485
+ cy.get(commonSelectors.paneBody).should("contain.text", memberTexts.inviteMessage({
1486
+ email: email,
1487
+ role: role,
1488
+ appName: "neetoDesk"
1489
+ }));
1490
+ interceptMemberApi("createAndFetchMember", 2);
1491
+ cy.get(memberSelectors.submitButton).click();
1492
+ cy.wait("@createAndFetchMember");
1493
+ cy.verifyToastMessage(memberTexts.memberAddedMessage);
1494
+ cy.wait("@createAndFetchMember");
1495
+ cy.clearAndType(memberSelectors.searchTextField, email);
1496
+ interceptMemberApi("searchRequest");
1497
+ cy.clearAndType(memberSelectors.searchTextField, email);
1498
+ cy.wait("@searchRequest");
1499
+ cy.contains(tableSelectors.tableRow, email).should("be.visible");
1500
+ };
1501
+ var verifyMemberDetails = function verifyMemberDetails(_ref) {
1502
+ var email = _ref.email,
1503
+ role = _ref.role,
1504
+ _ref$skipSearchReques = _ref.skipSearchRequest,
1505
+ skipSearchRequest = _ref$skipSearchReques === void 0 ? true : _ref$skipSearchReques;
1506
+ !skipSearchRequest && interceptMemberApi("searchRequest");
1507
+ cy.clearAndTypeFast(memberSelectors.searchTextField, email);
1508
+ !skipSearchRequest && cy.wait("@searchRequest");
1509
+ return cy.contains(commonSelectors.tableRow, email).within(function () {
1510
+ cy.get(memberSelectors.email).should("have.text", email);
1511
+ role && cy.get(memberSelectors.role).should("have.text", role);
1512
+ });
1513
+ };
1514
+ var updateMemberRole = function updateMemberRole(_ref2) {
1515
+ var email = _ref2.email,
1516
+ role = _ref2.role,
1517
+ skipSearchRequest = _ref2.skipSearchRequest;
1518
+ verifyMemberDetails({
1519
+ email: email,
1520
+ skipSearchRequest: skipSearchRequest
1521
+ }).within(function () {
1522
+ return cy.clickDropdownOption(commonTexts.edit);
1523
+ });
1524
+ cy.get(commonSelectors.paneHeader).should("have.text", memberTexts.updateMemberRole);
1525
+ cy.get(memberSelectors.roleLabel(role)).click();
1526
+ interceptMemberApi("updateAndFetchMember", 2);
1527
+ cy.get(memberSelectors.submitButton).click();
1528
+ cy.wait("@updateAndFetchMember");
1529
+ cy.verifyToastMessage(memberTexts.updatedMemberRole(email, role.toLocaleLowerCase()));
1530
+ cy.wait("@updateAndFetchMember");
1531
+ verifyMemberDetails({
1532
+ email: email,
1533
+ role: role
1534
+ });
1535
+ };
1536
+ var verifyActivatedMember = function verifyActivatedMember(_ref3) {
1537
+ var email = _ref3.email,
1538
+ _ref3$skipFetchReques = _ref3.skipFetchRequest,
1539
+ skipFetchRequest = _ref3$skipFetchReques === void 0 ? false : _ref3$skipFetchReques,
1540
+ _ref3$skipSearchReque = _ref3.skipSearchRequest,
1541
+ skipSearchRequest = _ref3$skipSearchReque === void 0 ? true : _ref3$skipSearchReque;
1542
+ cy.get(commonSelectors.toggleButton).click();
1543
+ cy.get(memberSelectors.menuBarHeading).should("have.text", memberTexts.members);
1544
+ !skipFetchRequest && interceptMemberApi("fetchActivatedMembers");
1545
+ cy.get(memberSelectors.activatedMembersButton).click();
1546
+ !skipFetchRequest && cy.wait("@fetchActivatedMembers");
1547
+ verifyMemberDetails({
1548
+ email: email,
1549
+ skipSearchRequest: skipSearchRequest
1550
+ });
1551
+ cy.get(commonSelectors.toggleButton).click();
1552
+ };
1553
+ var verifyDeactivatedMember = function verifyDeactivatedMember(_ref4) {
1554
+ var email = _ref4.email,
1555
+ _ref4$skipFetchReques = _ref4.skipFetchRequest,
1556
+ skipFetchRequest = _ref4$skipFetchReques === void 0 ? false : _ref4$skipFetchReques,
1557
+ _ref4$skipSearchReque = _ref4.skipSearchRequest,
1558
+ skipSearchRequest = _ref4$skipSearchReque === void 0 ? true : _ref4$skipSearchReque;
1559
+ cy.get(commonSelectors.toggleButton).click();
1560
+ cy.get(memberSelectors.menuBarHeading).should("have.text", memberTexts.members);
1561
+ !skipFetchRequest && interceptMemberApi("fetchDeactivatedMembers");
1562
+ cy.get(memberSelectors.deactivatedAgentsButton).click();
1563
+ !skipFetchRequest && cy.wait("@fetchDeactivatedMembers");
1564
+ verifyMemberDetails({
1565
+ email: email,
1566
+ skipSearchRequest: skipSearchRequest
1567
+ });
1568
+ cy.get(commonSelectors.toggleButton).click();
1569
+ };
1570
+ var verifyActivateAlert = function verifyActivateAlert(email) {
1571
+ var skipSearchRequest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1572
+ verifyMemberDetails({
1573
+ email: email,
1574
+ skipSearchRequest: skipSearchRequest
1575
+ }).within(function () {
1576
+ return cy.clickDropdownOption(commonTexts.activate);
1577
+ });
1578
+ cy.get(commonSelectors.alertTitle).should("have.text", memberTexts.activateMember);
1579
+ cy.get(commonSelectors.alertModalMessage).should("have.text", memberTexts.activateMemberAlertMessage(email));
1580
+ };
1581
+ var deactivateMember = function deactivateMember(_ref5) {
1582
+ var email = _ref5.email,
1583
+ _ref5$skipSearchReque = _ref5.skipSearchRequest,
1584
+ skipSearchRequest = _ref5$skipSearchReque === void 0 ? true : _ref5$skipSearchReque;
1585
+ verifyMemberDetails({
1586
+ email: email,
1587
+ skipSearchRequest: skipSearchRequest
1588
+ }).within(function () {
1589
+ return cy.clickDropdownOption(commonTexts.deactivate);
1590
+ });
1591
+ interceptMemberApi("deactivateAndFetchMember", 2);
1592
+ cy.get(commonSelectors.alertModalSubmitButton).click();
1593
+ cy.wait("@deactivateAndFetchMember");
1594
+ cy.verifyToastMessage(memberTexts.deactivateAccountToastMessage(email));
1595
+ cy.wait("@deactivateAndFetchMember");
1596
+ verifyDeactivatedMember({
1597
+ email: email
1598
+ });
1599
+ };
1600
+ var activateMember = function activateMember(_ref6) {
1601
+ var email = _ref6.email,
1602
+ _ref6$skipSearchReque = _ref6.skipSearchRequest,
1603
+ skipSearchRequest = _ref6$skipSearchReque === void 0 ? true : _ref6$skipSearchReque;
1604
+ verifyActivateAlert(email, skipSearchRequest);
1605
+ interceptMemberApi("activateAndFetchMember", 2);
1606
+ cy.get(commonSelectors.alertModalSubmitButton).click();
1607
+ cy.wait("@activateAndFetchMember");
1608
+ cy.verifyToastMessage(memberTexts.accountActivatedToastMessage(email));
1609
+ cy.wait("@activateAndFetchMember");
1610
+ verifyActivatedMember({
1611
+ email: email
1612
+ });
1613
+ };
1614
+ var checkColumnCheckBox = function checkColumnCheckBox(fieldSelector) {
1615
+ return cy.get(fieldSelector).parent().within(function () {
1616
+ cy.get(memberSelectors.columnCheckBox).should("be.checked").uncheck().should("not.be.checked");
1617
+ });
1618
+ };
1619
+ var unCheckColumnCheckBox = function unCheckColumnCheckBox(fieldSelector) {
1620
+ return cy.get(fieldSelector).parent().within(function () {
1621
+ cy.get(memberSelectors.columnCheckBox).should("not.be.checked").check().should("be.checked");
1622
+ });
1623
+ };
1624
+ var addMemberViaRequest = function addMemberViaRequest(_ref7) {
1625
+ var email = _ref7.email,
1626
+ _ref7$role = _ref7.role,
1627
+ role = _ref7$role === void 0 ? memberTexts.agent : _ref7$role,
1628
+ _ref7$requestCount = _ref7.requestCount,
1629
+ requestCount = _ref7$requestCount === void 0 ? 0 : _ref7$requestCount,
1630
+ appName = _ref7.appName;
1631
+ cy.apiRequest({
1632
+ method: "POST",
1633
+ url: requestApis.teamMembers.index,
1634
+ body: {
1635
+ user: {
1636
+ emails: [email],
1637
+ organization_role: role,
1638
+ app_roles: [{
1639
+ app_name: appName,
1640
+ active_role: role,
1641
+ is_enabled: true
1642
+ }]
1643
+ }
1644
+ }
1645
+ });
1646
+ cy.reloadAndWait(requestCount);
1647
+ };
1648
+ var deactivateMemberViaRequest = function deactivateMemberViaRequest(email) {
1649
+ var requestCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1650
+ cy.apiRequest({
1651
+ method: "PATCH",
1652
+ url: requestApis.teamMembers.bulkUpdate,
1653
+ body: {
1654
+ users: {
1655
+ active: false,
1656
+ emails: [email]
1657
+ }
1658
+ }
1659
+ });
1660
+ cy.reloadAndWait(requestCount);
1661
+ };
1662
+ var memberUtils = {
1663
+ addMemberViaRequest: addMemberViaRequest,
1664
+ addMemberViaUI: addMemberViaUI,
1665
+ activateMember: activateMember,
1666
+ checkColumnCheckBox: checkColumnCheckBox,
1667
+ deactivateMember: deactivateMember,
1668
+ deactivateMemberViaRequest: deactivateMemberViaRequest,
1669
+ updateMemberRole: updateMemberRole,
1670
+ interceptMemberApi: interceptMemberApi,
1671
+ navigateToMembersPage: navigateToMembersPage,
1672
+ unCheckColumnCheckBox: unCheckColumnCheckBox,
1673
+ verifyMemberDetails: verifyMemberDetails
1674
+ };
1675
+
1676
+ var createOrganization = function createOrganization(_ref) {
1677
+ var email = _ref.email,
1678
+ businessName = _ref.businessName,
1679
+ subdomainName = _ref.subdomainName,
1680
+ firstName = _ref.firstName,
1681
+ lastName = _ref.lastName,
1682
+ baseUrl = _ref.baseUrl;
1683
+ var otp = "123456";
1684
+ cy.visit(baseUrl);
1685
+ cy.contains(signUpTexts.tryItFree).click();
1686
+ cy.get(signUpSelectors.signupViaEmailButton).should("contain.text", signUpTexts.email).click();
1687
+ cy.clearAndType(signUpSelectors.emailTextField, email);
1688
+ cy.intercept({
1689
+ url: requestApis.signUp,
1690
+ times: 2
1691
+ }).as("signupRequest");
1692
+ cy.get(signUpSelectors.submitButton).click();
1693
+ cy.wait("@signupRequest");
1694
+ cy.get(signUpSelectors.otpTextBox).type(otp);
1695
+ cy.wait("@signupRequest");
1696
+ cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
1697
+ cy.intercept({
1698
+ url: requestApis.subdomainAvailablity,
1699
+ times: 1
1700
+ }).as("subdomainRequest");
1701
+ cy.clearAndType(signUpSelectors.subdomainNameTextField, subdomainName);
1702
+ cy.wait("@subdomainRequest");
1703
+ cy.get(signUpSelectors.organizationNameTextField).should("have.value", businessName);
1704
+ cy.get(signUpSelectors.subdomainNameTextField).should("have.value", subdomainName);
1705
+ cy.intercept({
1706
+ url: requestApis.signUp,
1707
+ times: 1
1708
+ }).as("signupRequest");
1709
+ cy.intercept({
1710
+ url: requestApis.countries,
1711
+ times: 1
1712
+ }).as("fetchCountries");
1713
+ cy.get(signUpSelectors.organizationSubmitButton).click();
1714
+ cy.wait("@signupRequest");
1715
+ cy.url({
1716
+ timeout: 15000
1717
+ }).should("include", signUpTexts.profile);
1718
+ cy.wait("@fetchCountries");
1719
+ cy.clearAndType(signUpSelectors.firstNameTextField, firstName);
1720
+ cy.clearAndType(signUpSelectors.lastNameTextField, lastName);
1721
+ cy.intercept({
1722
+ url: requestApis.signUp,
1723
+ times: 1
1724
+ }).as("setupProfile");
1725
+ cy.get(signUpSelectors.profileSubmitButton).click();
1726
+ cy.wait("@setupProfile");
1727
+ };
1728
+
1729
+ var verifyCrossSiteScript = function verifyCrossSiteScript(inputSelector, submitSelector) {
1730
+ cy.interceptApi("searchRequest");
1731
+ cy.clearAndType(inputSelector, commonTexts.crossSiteScript);
1732
+ submitSelector && cy.get(submitSelector).click();
1733
+ cy.wait("@searchRequest");
1734
+ cy.get(commonSelectors.windowAlert).should("not.exist");
1735
+ };
1736
+
1737
+ exports.authUtils = authUtils;
1738
+ exports.commonSelectors = commonSelectors;
1739
+ exports.commonTexts = commonTexts;
1740
+ exports.createOrganization = createOrganization;
1741
+ exports.dataCy = dataCy;
1742
+ exports.dateUtils = dateUtils;
1743
+ exports.environment = environment;
1744
+ exports.getTestTitle = getTestTitle;
1745
+ exports.getUrl = getUrl;
1746
+ exports.initializeCredentials = initializeCredentials;
1747
+ exports.isStagingEnv = isStagingEnv;
1748
+ exports.loginSelectors = loginSelectors;
1749
+ exports.memberFormSelectors = memberFormSelectors;
1750
+ exports.memberSelectors = memberSelectors;
1751
+ exports.memberTableTexts = memberTableTexts;
1752
+ exports.memberTexts = memberTexts;
1753
+ exports.memberUtils = memberUtils;
1754
+ exports.profileSelectors = profileSelectors;
1755
+ exports.setListCount = setListCount;
1756
+ exports.signUpSelectors = signUpSelectors;
1757
+ exports.signUpTexts = signUpTexts;
1758
+ exports.tableSelectors = tableSelectors;
1759
+ exports.verifyCrossSiteScript = verifyCrossSiteScript;
1760
+ exports.verifyListCount = verifyListCount;