@bigbinary/neeto-commons-frontend 0.0.1 → 0.0.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/README.md +41 -9
- package/initializers.cjs.js +438 -0
- package/initializers.d.ts +59 -0
- package/initializers.js +307 -74
- package/package.json +26 -7
- package/pure.cjs.js +418 -0
- package/pure.d.ts +186 -0
- package/pure.js +78 -99
- package/{react.js → react-utils.cjs.js} +228 -65
- package/react-utils.d.ts +99 -0
- package/react-utils.js +1309 -0
- package/utils.cjs.js +2781 -0
- package/utils.d.ts +43 -0
- package/utils.js +2203 -46
package/react-utils.js
ADDED
|
@@ -0,0 +1,1309 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { useState, useEffect, useRef, useReducer } from 'react';
|
|
3
|
+
import { Typography, Tooltip, Button, Toastr } from '@bigbinary/neetoui';
|
|
4
|
+
import { fromPairs, keys, values, mergeLeft, toLower, not, isNil, assocPath } from 'ramda';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
7
|
+
import updateLocale from 'dayjs/plugin/updateLocale';
|
|
8
|
+
import { Honeybadger, HoneybadgerErrorBoundary as HoneybadgerErrorBoundary$1 } from '@honeybadger-io/react';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { Route, Redirect, useLocation } from 'react-router-dom';
|
|
11
|
+
import { Settings, LeftArrow, Help, User } from '@bigbinary/neeto-icons';
|
|
12
|
+
import { Sidebar as Sidebar$1, AppSwitcher } from '@bigbinary/neetoui/layouts';
|
|
13
|
+
import i18next from 'i18next';
|
|
14
|
+
import axios from 'axios';
|
|
15
|
+
import * as Yup from 'yup';
|
|
16
|
+
import { Button as Button$1, Input } from '@bigbinary/neetoui/formik';
|
|
17
|
+
import { Formik, Form } from 'formik';
|
|
18
|
+
|
|
19
|
+
function _extends$3() {
|
|
20
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
21
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
22
|
+
var source = arguments[i];
|
|
23
|
+
|
|
24
|
+
for (var key in source) {
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
26
|
+
target[key] = source[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
return _extends$3.apply(this, arguments);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var capitalize = function capitalize(string) {
|
|
37
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
dayjs.extend(relativeTime);
|
|
41
|
+
dayjs.extend(updateLocale);
|
|
42
|
+
var timeFormat = {
|
|
43
|
+
fromNow: function fromNow(time) {
|
|
44
|
+
return dayjs(time).fromNow();
|
|
45
|
+
},
|
|
46
|
+
time: function time(_time) {
|
|
47
|
+
return dayjs(_time).format("h:mm A");
|
|
48
|
+
},
|
|
49
|
+
date: function date(time) {
|
|
50
|
+
return dayjs(time).format("MMM D, YYYY");
|
|
51
|
+
},
|
|
52
|
+
dateWeek: function dateWeek(time) {
|
|
53
|
+
return dayjs(time).format("MMM D, YYYY ddd");
|
|
54
|
+
},
|
|
55
|
+
dateWeekWithoutYear: function dateWeekWithoutYear(time) {
|
|
56
|
+
return dayjs(time).format("MMM D, ddd");
|
|
57
|
+
},
|
|
58
|
+
dateTime: function dateTime(time) {
|
|
59
|
+
return dayjs(time).format("MMM D, YYYY h:mm A");
|
|
60
|
+
},
|
|
61
|
+
dateWeekTime: function dateWeekTime(time) {
|
|
62
|
+
return dayjs(time).format("MMM D, YYYY ddd h:mm A");
|
|
63
|
+
},
|
|
64
|
+
extended: function extended(time) {
|
|
65
|
+
var dateTime = dayjs(time).format("dddd MMMM D, YYYY h:mm A");
|
|
66
|
+
var fromNow = dayjs(time).fromNow();
|
|
67
|
+
return "".concat(dateTime, " (").concat(fromNow, ")");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var DateFormat = fromPairs(keys(timeFormat).map(function (key) {
|
|
72
|
+
return [capitalize(key), function (_ref) {
|
|
73
|
+
var date = _ref.date,
|
|
74
|
+
_ref$tooltipProps = _ref.tooltipProps,
|
|
75
|
+
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
76
|
+
_ref$typographyProps = _ref.typographyProps,
|
|
77
|
+
typographyProps = _ref$typographyProps === void 0 ? {} : _ref$typographyProps;
|
|
78
|
+
var dateDisplay = /*#__PURE__*/React__default.createElement(Typography, _extends$3({
|
|
79
|
+
component: "span",
|
|
80
|
+
style: "body2"
|
|
81
|
+
}, typographyProps), timeFormat[key](date));
|
|
82
|
+
return key === "extended" ? dateDisplay : /*#__PURE__*/React__default.createElement(Tooltip, _extends$3({
|
|
83
|
+
position: "top",
|
|
84
|
+
content: timeFormat.extended(date)
|
|
85
|
+
}, tooltipProps), dateDisplay);
|
|
86
|
+
}];
|
|
87
|
+
}));
|
|
88
|
+
var TimeFormat = DateFormat;
|
|
89
|
+
|
|
90
|
+
var _path$2, _path2$1, _path3$1, _path4$1, _path5$1, _path6$1;
|
|
91
|
+
|
|
92
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
93
|
+
|
|
94
|
+
var SvgFallbackComponent = function SvgFallbackComponent(props) {
|
|
95
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
96
|
+
width: 230,
|
|
97
|
+
height: 230,
|
|
98
|
+
viewBox: "0 0 317 320",
|
|
99
|
+
fill: "none",
|
|
100
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
101
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
102
|
+
d: "M271.071 28.008c-8.563-12.544-25.317-10.81-38.577-10.717-30.899.206-159.103.047-168.105.497-13.866.713-27.79 6.33-30.041 20.132-1.216 7.456-.14 15.427.139 22.94 1.118 30.417 1.953 68.044 5.7 95.148 1.016 7.372 2.35 14.761 6.936 20.853 7.238 9.618 21.581 12.998 33.616 13.2.141.236 110.261 2.828 150.068-.154 11.579-.87 25.682-1.74 33.488-11.652 3.913-4.971 4.246-12.136 5.028-18.171 2.816-21.653 4.695-58.296 7.156-97.59.703-11.222 1.25-24.736-5.408-34.486Zm3.044 27.34c-.082 4.493-3.429 57.629-3.648 60.853-.746 10.901-3.144 45.195-6.244 55.905-3.064 10.571-16.833 13.173-26.189 14.167-7.926.857-15.906 1.35-23.877 1.608-40.911 1.322-129.772 1.044-133.332.949-14.415-.663-30.588-4.888-36.021-19.843a81.026 81.026 0 0 1-3.298-20.918c-2.712-32.616-2.294-42.461-4.372-92.667-.293-7.188-1.76-15.638 1.536-22.356C45.898 18.356 67.727 20.417 81.1 20.27c15.73-.172 149.231-.271 157.495-.338 7.347-.06 15.278-.433 22.12 2.756 12.343 5.744 13.613 20.671 13.399 32.649v.01Z",
|
|
103
|
+
fill: "#2F3941"
|
|
104
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
|
|
105
|
+
d: "M220.642 50.4a1.586 1.586 0 0 0-.415-1.21 1.607 1.607 0 0 0-1.177-.52c-35.537-.183-99.035-.669-135.303-.466a1.056 1.056 0 0 0-.76.238 1.044 1.044 0 0 0-.373.699c-.43 34.284-.24 68.58-.24 102.862 0 1.636.685 2.122 1.643 2.162 45.113 2.049 92.2.763 137.476.91a2.342 2.342 0 0 0 1.518-.675c.405-.403.648-.94.68-1.509-.443-33.909-1.227-68.635-3.049-102.49Zm-2.277.78c1.187 24.763 1.712 49.901 2.264 74.806-45.853 1.664-90.202.658-135.787.522 0-24.642-.313-50.868 0-76.093 43.482.375 89.992.537 133.523.764ZM91.463 151.855l16.27-22.423 18.964.294c-3.709 5.108-12.138 17.321-14.959 22.512-6.749-.114-20.275-.383-20.275-.383Zm42.769.671 15.24-22.699c6.347 0 12.699-.04 19.055-.12-3.627 6.705-10.492 16.8-14.739 22.976-6.51-.007-13.028-.059-19.556-.157Zm42.469.228c5.503-8.232 10.238-15.419 16.186-23.434 6.993-.163 13.993-.365 20.998-.605-4.761 6.22-12.597 17.04-15.361 23.986-7.274.037-14.548.054-21.823.053Z",
|
|
106
|
+
fill: "#2F3941"
|
|
107
|
+
})), _path3$1 || (_path3$1 = /*#__PURE__*/React.createElement("path", {
|
|
108
|
+
d: "M153.904 69.903c-3.722-.185-22.748 30.824-20.049 34.788 2.493 3.664 37.821 2.965 39.914 0 2.39-3.436-16.031-34.596-19.865-34.788Zm.745 10.224c.19 2.645.576 11.328.205 13.546-.27 1.633-1.778.747-1.796-.113-.065-4.437-.177-8.883-.27-13.32a.957.957 0 0 1 .224-.699.925.925 0 0 1 1.551.221.973.973 0 0 1 .086.365Zm.707 18.984c-.727 2.011-2.791 1.389-2.791-.259-.057-3.119 3.572-1.901 2.791.26v-.001ZM155.392 199.891c1.926 4.35 9.139 2.15 6.621-3.658a3.653 3.653 0 0 0-2.338-2.083 3.669 3.669 0 0 0-3.092.487c-1.534 1.051-2.876 3.875-1.144 5.376a.499.499 0 0 0 .85-.353c.107-1.148-.119-2.371.838-3.231a2.288 2.288 0 0 1 3.549.378 2.661 2.661 0 0 1-.467 3.601 3.032 3.032 0 0 1-4.019-.994c-.313-.517-1.037-.06-.798.477ZM145.571 226.664c3.876.66 7.809.928 11.739.798 4.292.127 8.604.273 12.894.248a1.103 1.103 0 0 0 0-2.204c-4.29-.174-8.602-.186-12.894-.206a57.817 57.817 0 0 0-11.739.39.508.508 0 0 0 0 .974Z",
|
|
109
|
+
fill: "#2F3941"
|
|
110
|
+
})), _path4$1 || (_path4$1 = /*#__PURE__*/React.createElement("path", {
|
|
111
|
+
d: "M290.099 17.651a26.343 26.343 0 0 0-14.443-13.727c-8.184-3.209-17.301-2.702-25.923-2.622-36.725.338-187.491.226-197.868.656a46.93 46.93 0 0 0-23.035 6.39c-15.658 9.89-12.084 26.386-11.458 44.885 1.203 35.566 2.12 79.713 6.107 111.322 1.049 8.324 2.204 16.755 6.676 24.05 7.983 13.016 24.148 17.93 39.357 17.867.586 0 34.396.811 73.168 1.099.06 2.045.465 4.305.694 6.462-.845-.102-23.612.467-30.303 1.419a.956.956 0 0 0-.771.893.982.982 0 0 0 .07.415c-3.429 2.898-6.462 6.492-9.588 9.661-3.848 3.879-7.906 7.645-11.5 11.758a.822.822 0 0 0 1.163 1.163c4.026-3.696 7.685-7.846 11.473-11.786 3.151-3.283 6.762-6.462 9.603-10.051a284.168 284.168 0 0 1 30.012-1.086c.02 1.633-.067 3.567 1.553 4.394.249.132.684.04.731-.3.119-2.158.03-4.322-.266-6.463a20.308 20.308 0 0 0-1.205-6.462c9.037.065 18.32.097 27.494.082a22.04 22.04 0 0 0-.498 11.488.589.589 0 0 0 .558.411.583.583 0 0 0 .558-.411c.323-1.081.516-2.196.575-3.323 5.085.679 9.298.204 22.997 1.059 2.081.132 5.048.161 6.8.151a49.891 49.891 0 0 0 9.03 9.507 126.265 126.265 0 0 0 10.551 9.276c.89.671 1.988-.798 1.188-1.541-3.547-3.244-7.275-6.278-10.814-9.542a93.19 93.19 0 0 0-8.62-8.122.687.687 0 0 0-.296-.8 16.466 16.466 0 0 0-6.571-1.034 303.46 303.46 0 0 0-8.896-.433 119.194 119.194 0 0 0-15.245-.532c.139-2.202.522-4.237.539-6.156 26.179-.057 51.28-.512 67.03-1.762 13.367-1.064 29.723-1.842 38.877-13.173 4.737-5.858 5.182-13.963 6.112-21.166 3.929-30.407 5.575-77.387 8.06-112.188.997-13.655 2.17-28.933-3.676-41.728Zm1.613 31.317c-.146 4.2-3.837 64.939-4.225 70.999-.84 12.757-3.594 52.564-7.069 65.039-3.355 12.052-18.191 15.578-28.953 16.886-9.22 1.123-18.553 1.715-27.836 2.028-47.201 1.6-152.146 1.016-154.02.947-17.12-.746-35.33-6.288-41.204-24.174-2.597-7.906-2.91-16.548-3.567-24.799-2.594-32.741-2.42-43.205-4.722-107.053-.313-8.463-1.814-17.863.596-26.12C26.38 3.355 51.897 4.623 67.642 4.416c18.621-.248 177.824-.437 187.33-.497 8.565-.045 17.791.174 25.046 5.349 12.02 8.565 12.159 26.432 11.694 39.692v.008ZM2.113 306.233c1.504-2.13 36.665-41.756 38.413-43.727a10.606 10.606 0 0 1 9.066-3.728c23.95-.139 47.907-.29 71.857.095 44.688.73 142.992-1.775 146.288-1.74 3.231.032 7.399-.711 9.864 1.66 2.352 2.264 26.674 35.343 35.177 44.204 1.322 1.374 3.407-.716 2.093-2.093-8.324-8.682-29.105-36.658-32.5-40.888a17.18 17.18 0 0 0-4.722-5.016c-4.243-2.115-53.46.465-74.499.942-24.904.57-18.499.127-150.918.092-5.858 0-10.004.249-13.864 5.043-4.439 5.52-35.989 42.114-37.403 44.477-.44.751.663 1.365 1.148.679ZM310.594 315.641c2.172-3.694 6.668-9.738 4.511-10.439-3.336-1.064-312.387 1.784-312.387 1.784s-5.946.154-.249 5.456c5.697 5.301 5.965 6.656 16.25 6.258 10.284-.397 262.609-1.203 269.642-1.091 7.034.112 20.856.37 22.233-1.968Z",
|
|
112
|
+
fill: "#2F3941"
|
|
113
|
+
})), _path5$1 || (_path5$1 = /*#__PURE__*/React.createElement("path", {
|
|
114
|
+
d: "M34.938 281.227c-2.187 2.709-11.898 12.69-12.29 15.161a1.074 1.074 0 0 0 .471 1.163c1.328.85 41.622 0 50.602-.032 18.968-.08 153.463.745 156.865.79 2.603.032 4.444-.519 3.169-3.435-4.347-9.942-8.664-19.883-13.081-29.795-1.123-2.513-2.02-2.851-4.722-2.839 0 0-161.347 0-166.45-.059a.918.918 0 0 0-.874.921.92.92 0 0 0 .874.92c31.896.311 159.016-.087 167.966.445.724.045-.248-1.638 13.958 30.395.199.445.147 1.242-2.207 1.3-1.633.034-157.686-.624-193.429-.358-1.899 0-9.956.338-9.897-.14.2-1.6 12.619-14.798 23.217-31.038.365-.559-.497-1.016-.875-.512-.02-.007-8.443 11.098-13.297 17.113ZM238.084 290.689a39.103 39.103 0 0 0 3.124 6.895c.746 1.022 1.243 1.009 2.486 1.049 6.929.216 26.206-.664 45.483-.286 1.275.027 6.532.83 6.463-1.243-.102-3.042-9.343-13.789-22.084-33.67-1.454-2.272-2.08-2.411-4.956-2.284-4.702.199-32.4 1.195-41.541 1.491-1.216.04-1.223 1.934 0 1.894 47.176-1.491 43.545-1.605 43.833-1.422.93.592 1.862 2.879 2.458 3.793 1.33 2.021 17.513 26.115 18.981 28.222.878 1.256.02 1.183-1.739 1.149-1.989-.045-45.168.233-46.573.221-1.739-.022-2.589-3.415-3.3-4.931-9.112-19.476-10.563-22.476-13.054-26.54-.392-.638-1.409-.445-1.131.207 4.36 10.205 7.591 16.5 11.55 25.455ZM285.242 112.053v.445c0 .04.067.04.067 0 0-.147 0-.298.02-.445-.002-.047-.087-.052-.087 0ZM91.163 240.165s131.381-1.695 132.656-1.416c1.275.278-.313 8.776-4.226 8.751-3.912-.025-121.276.922-123.175.171-1.9-.75-7.28-7.478-5.255-7.506Z",
|
|
115
|
+
fill: "#2F3941"
|
|
116
|
+
})), _path6$1 || (_path6$1 = /*#__PURE__*/React.createElement("path", {
|
|
117
|
+
d: "M45.82 293.676a.023.023 0 0 0 .014-.01.025.025 0 0 0 .005-.016.027.027 0 0 0-.019-.026.027.027 0 0 0-.014.042.023.023 0 0 0 .014.01ZM220.834 284.323c-2.237-.034-6-.062-10.973-.082-1.198-2.995.522 1.459-4.325-10.759 4.354 0 7.692 0 9.735.025a.767.767 0 0 0 .545-.226.767.767 0 0 0 0-1.09.77.77 0 0 0-.545-.225c-2.09-.03-5.666-.057-10.376-.077-1.134-2.734-1.506-3.154-2.411-3.637a.552.552 0 0 0-.798.319c-.291.832-.328 1.339.355 3.308-8.714-.03-20.504-.047-33.677-.05a23.38 23.38 0 0 0-2.021-4.446.51.51 0 0 0-.566-.224.509.509 0 0 0-.383.472c.033 1.409.199 2.811.497 4.188-11.212 0-23.326 0-35.336.027a706.988 706.988 0 0 0-.186-3.171.582.582 0 0 0-1.161 0 442.255 442.255 0 0 0-.313 3.174c-12.514.017-24.854.045-35.902.079a6.379 6.379 0 0 0-.378-2.835c-.107-.266-.457-.443-.676-.187a6.309 6.309 0 0 0-1.322 3.03c-12.572.042-23.276.094-30.335.154a18.732 18.732 0 0 0 1.8-3.577c.372-1.061-1.22-2.03-1.954-1.128-1.223 1.511-2.374 3.112-3.495 4.742-2.634.03-4.386.062-5.067.095a.503.503 0 0 0-.357.861.503.503 0 0 0 .357.148c1.155.087 2.55.164 4.158.236-5.903 8.771-5.418 7.829-7.526 11.008-3.607.032-5.985.067-6.83.104a.503.503 0 0 0-.505.505.505.505 0 0 0 .505.504c1.39.1 3.4.184 5.94.249a48.466 48.466 0 0 0-3.343 6.094.431.431 0 0 0 .746.433c1.491-2.168 3.149-4.337 4.859-6.462 8.45.191 21.417.268 36.556.28a22.934 22.934 0 0 0-1.295 5.891c-.048.723.89.823 1.242.338a22.61 22.61 0 0 0 2.963-6.214c12.082 0 25.401-.03 38.835-.079a13.904 13.904 0 0 0 .698 6.238.857.857 0 0 0 .746.429.857.857 0 0 0 .746-.429 13.875 13.875 0 0 0 .952-6.251c13.227-.052 26.474-.116 38.666-.171a25.556 25.556 0 0 0 2.281 5.572.781.781 0 0 0 1.442-.392 24.472 24.472 0 0 0-.816-5.193c13.586-.062 25.705-.111 34.797-.114a27.226 27.226 0 0 0 3.362 6.462c.353.47 1.362.41 1.283-.345a25.886 25.886 0 0 0-1.554-6.119c4.439 0 7.974.022 10.37.059a.761.761 0 0 0 .543-.229.766.766 0 0 0 .222-.546.77.77 0 0 0-.775-.766Zm-170.101.139c3.142-3.859 6.303-7.563 8.562-10.853 7.58.248 18.36.358 30.772.4a97.23 97.23 0 0 1-3.278 10.287c-15.024.045-27.84.102-36.056.166Zm38.892-.173c2.341-7.884 2.585-7.954 3.072-10.273 11.167.028 23.527 0 35.999-.057-.562 6.246-.38 6.529-.691 10.247-13.287.02-26.457.048-38.38.083Zm41.303-.087c-.144-3.319.03-4.226-.263-10.253 12.178-.057 24.392-.142 35.668-.221.621 2.423-.107-.639 2.838 10.439-12.059.01-25.167.017-38.243.035Zm41.164-.023c-.072-.248-3.022-10.14-3.122-10.471 13.235-.094 25.019-.181 33.668-.216 1.941 5.087 1.325 3.139 4.136 10.737-9.003-.032-21.099-.047-34.682-.05ZM281.202 286.259c-1.339-.479-2.53-.671-8.326-.591a140.94 140.94 0 0 0-7.491-12.89 25.902 25.902 0 0 0 7.379-.656.778.778 0 0 0 .398-1.209.778.778 0 0 0-.398-.282c-2.98-.66-6.05-.813-9.081-.452a201.697 201.697 0 0 0-2.486-3.634.674.674 0 0 0-1.163.679l1.695 3.022c-4.143.151-10.849.437-15.243.636a24.566 24.566 0 0 0-3.679-4.576.437.437 0 0 0-.251-.114.444.444 0 0 0-.479.539 25.034 25.034 0 0 0 1.613 4.28 45.342 45.342 0 0 0-8.833.763.515.515 0 0 0-.365.489.511.511 0 0 0 .365.488c3.286.677 6.655.86 9.996.542 1.327 2.443 2.833 4.824 4.079 7.126 1.006 1.854 1.953 3.842 2.965 5.798a40.865 40.865 0 0 0-9.527.716.499.499 0 0 0-.405.488.496.496 0 0 0 .405.489c3.549.665 7.169.868 10.769.604a28.675 28.675 0 0 0 3.542 5.078c.37.412.962-.035.868-.498a23.462 23.462 0 0 0-1.452-4.583 1830.64 1830.64 0 0 0 15.658-.134 30.665 30.665 0 0 0 2.662 4.012c.378.497 1.283.248 1.076-.45a29.948 29.948 0 0 0-1.337-3.587 23.018 23.018 0 0 0 7.071-.599.775.775 0 0 0 .542-.756.78.78 0 0 0-.567-.738Zm-26.223-.126c-1.213-2.414-2.63-4.75-3.865-6.989-1.029-1.859-2.068-3.91-3.211-5.911 3.728-.082 8.656-.218 15.263-.4 3.599 6.462 5.696 10.337 7.091 12.882-3.291.047-6.51.157-15.278.408v.01Z",
|
|
118
|
+
fill: "#2F3941"
|
|
119
|
+
})));
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var FallbackComponent = function FallbackComponent() {
|
|
123
|
+
var _useTranslation = useTranslation(),
|
|
124
|
+
t = _useTranslation.t;
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
127
|
+
className: "flex h-screen w-full flex-row items-start justify-start"
|
|
128
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
129
|
+
className: "m-auto text-center"
|
|
130
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
131
|
+
className: "m-auto mb-8 flex items-center justify-center"
|
|
132
|
+
}, /*#__PURE__*/React__default.createElement(SvgFallbackComponent, null)), /*#__PURE__*/React__default.createElement(Typography, {
|
|
133
|
+
component: "h2",
|
|
134
|
+
style: "h2",
|
|
135
|
+
weight: "semibold",
|
|
136
|
+
className: "mb-4"
|
|
137
|
+
}, t("neetoCommons.fallbackComponent.somethingWentWrong")), /*#__PURE__*/React__default.createElement(Typography, {
|
|
138
|
+
component: "p",
|
|
139
|
+
style: "body1",
|
|
140
|
+
weight: "normal",
|
|
141
|
+
className: "mb-8 text-gray-600"
|
|
142
|
+
}, t("neetoCommons.fallbackComponent.tryReloading")), /*#__PURE__*/React__default.createElement("div", {
|
|
143
|
+
className: "flex flex-row items-center justify-center"
|
|
144
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
145
|
+
style: "primary",
|
|
146
|
+
size: "large",
|
|
147
|
+
onClick: function onClick() {
|
|
148
|
+
return window.location.reload();
|
|
149
|
+
},
|
|
150
|
+
label: t("neetoCommons.fallbackComponent.reload")
|
|
151
|
+
}))));
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
|
|
155
|
+
var children = _ref.children,
|
|
156
|
+
_ref$ErrorComponent = _ref.ErrorComponent,
|
|
157
|
+
ErrorComponent = _ref$ErrorComponent === void 0 ? FallbackComponent : _ref$ErrorComponent;
|
|
158
|
+
Honeybadger.beforeNotify(function (notice) {
|
|
159
|
+
return !/ResizeObserver/.test(notice.message);
|
|
160
|
+
});
|
|
161
|
+
var honeybadger = Honeybadger.configure({
|
|
162
|
+
apiKey: globalProps.honeybadgerApiKey,
|
|
163
|
+
environment: globalProps.nodeEnv,
|
|
164
|
+
revision: globalProps.honeybadgerRevision,
|
|
165
|
+
developmentEnvironments: ["development", "test"],
|
|
166
|
+
enableUncaught: true,
|
|
167
|
+
async: true,
|
|
168
|
+
breadcrumbsEnabled: true,
|
|
169
|
+
projectRoot: "webpack:///./"
|
|
170
|
+
});
|
|
171
|
+
return /*#__PURE__*/React__default.createElement(HoneybadgerErrorBoundary$1, {
|
|
172
|
+
honeybadger: honeybadger,
|
|
173
|
+
ErrorComponent: ErrorComponent
|
|
174
|
+
}, children);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
178
|
+
if (source == null) return {};
|
|
179
|
+
var target = {};
|
|
180
|
+
var sourceKeys = Object.keys(source);
|
|
181
|
+
var key, i;
|
|
182
|
+
|
|
183
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
184
|
+
key = sourceKeys[i];
|
|
185
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
186
|
+
target[key] = source[key];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return target;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function _objectWithoutProperties(source, excluded) {
|
|
193
|
+
if (source == null) return {};
|
|
194
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
195
|
+
var key, i;
|
|
196
|
+
|
|
197
|
+
if (Object.getOwnPropertySymbols) {
|
|
198
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
199
|
+
|
|
200
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
201
|
+
key = sourceSymbolKeys[i];
|
|
202
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
203
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
204
|
+
target[key] = source[key];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return target;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var _excluded = ["condition", "redirectRoute"];
|
|
212
|
+
|
|
213
|
+
var PrivateRoute = function PrivateRoute(_ref) {
|
|
214
|
+
var _ref$condition = _ref.condition,
|
|
215
|
+
condition = _ref$condition === void 0 ? globalProps.authenticated : _ref$condition,
|
|
216
|
+
redirectRoute = _ref.redirectRoute,
|
|
217
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
218
|
+
|
|
219
|
+
return condition ? /*#__PURE__*/React__default.createElement(Route, props) : /*#__PURE__*/React__default.createElement(Redirect, {
|
|
220
|
+
to: {
|
|
221
|
+
pathname: redirectRoute
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
function _arrayWithHoles(arr) {
|
|
227
|
+
if (Array.isArray(arr)) return arr;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function _iterableToArrayLimit(arr, i) {
|
|
231
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
232
|
+
|
|
233
|
+
if (_i == null) return;
|
|
234
|
+
var _arr = [];
|
|
235
|
+
var _n = true;
|
|
236
|
+
var _d = false;
|
|
237
|
+
|
|
238
|
+
var _s, _e;
|
|
239
|
+
|
|
240
|
+
try {
|
|
241
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
242
|
+
_arr.push(_s.value);
|
|
243
|
+
|
|
244
|
+
if (i && _arr.length === i) break;
|
|
245
|
+
}
|
|
246
|
+
} catch (err) {
|
|
247
|
+
_d = true;
|
|
248
|
+
_e = err;
|
|
249
|
+
} finally {
|
|
250
|
+
try {
|
|
251
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
252
|
+
} finally {
|
|
253
|
+
if (_d) throw _e;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return _arr;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function _arrayLikeToArray(arr, len) {
|
|
261
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
262
|
+
|
|
263
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
264
|
+
arr2[i] = arr[i];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return arr2;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
271
|
+
if (!o) return;
|
|
272
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
273
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
274
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
275
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
276
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function _nonIterableRest() {
|
|
280
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function _slicedToArray(arr, i) {
|
|
284
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
var HEADERS_KEYS = {
|
|
288
|
+
xAuthEmail: "X-Auth-Email",
|
|
289
|
+
xAuthToken: "X-Auth-Token",
|
|
290
|
+
xCsrfToken: "X-CSRF-TOKEN"
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
var resetAuthTokens = function resetAuthTokens() {
|
|
294
|
+
values(HEADERS_KEYS).forEach(function (header) {
|
|
295
|
+
delete axios.defaults.headers[header];
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
300
|
+
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
301
|
+
var PERMITTED_DOMAINS = ["@bigbinary.com", "@example.com"];
|
|
302
|
+
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
303
|
+
|
|
304
|
+
var getTopLinks = function getTopLinks() {
|
|
305
|
+
var topLinks = [{
|
|
306
|
+
label: i18next.t("neetoCommons.sidebar.myProfile"),
|
|
307
|
+
icon: User,
|
|
308
|
+
onClick: function onClick() {
|
|
309
|
+
return window.open(MY_PROFILE_URL, "_blank");
|
|
310
|
+
},
|
|
311
|
+
"data-cy": "my-profile-button"
|
|
312
|
+
}];
|
|
313
|
+
return globalProps.isOwner ? topLinks.concat({
|
|
314
|
+
label: i18next.t("neetoCommons.sidebar.myOrganization"),
|
|
315
|
+
icon: Settings,
|
|
316
|
+
onClick: function onClick() {
|
|
317
|
+
return window.open(MY_ORGANIZATION_URL, "_blank");
|
|
318
|
+
},
|
|
319
|
+
"data-cy": "profile-organization-settings-button"
|
|
320
|
+
}) : topLinks;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
var Sidebar = function Sidebar(_ref) {
|
|
324
|
+
var navLinks = _ref.navLinks,
|
|
325
|
+
appName = _ref.appName,
|
|
326
|
+
_ref$profileInfoOverr = _ref.profileInfoOverrides,
|
|
327
|
+
profileInfoOverrides = _ref$profileInfoOverr === void 0 ? {} : _ref$profileInfoOverr,
|
|
328
|
+
_ref$organizationInfo = _ref.organizationInfoOverrides,
|
|
329
|
+
organizationInfoOverrides = _ref$organizationInfo === void 0 ? {} : _ref$organizationInfo,
|
|
330
|
+
_ref$extraTopLinks = _ref.extraTopLinks,
|
|
331
|
+
extraTopLinks = _ref$extraTopLinks === void 0 ? [] : _ref$extraTopLinks,
|
|
332
|
+
_ref$showAppSwitcher = _ref.showAppSwitcher,
|
|
333
|
+
showAppSwitcher = _ref$showAppSwitcher === void 0 ? true : _ref$showAppSwitcher;
|
|
334
|
+
|
|
335
|
+
var _useState = useState(false),
|
|
336
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
337
|
+
isAppSwitcherOpen = _useState2[0],
|
|
338
|
+
setIsAppSwitcherOpen = _useState2[1];
|
|
339
|
+
|
|
340
|
+
var location = useLocation();
|
|
341
|
+
useEffect(function () {
|
|
342
|
+
isAppSwitcherOpen && setIsAppSwitcherOpen(false); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
343
|
+
}, [location]);
|
|
344
|
+
|
|
345
|
+
var handleLogout = function handleLogout() {
|
|
346
|
+
resetAuthTokens();
|
|
347
|
+
window.location.href = "/logout";
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
var isWhatsNewAllowed = PERMITTED_DOMAINS.some(function (domain) {
|
|
351
|
+
return globalProps.user.email.includes(domain);
|
|
352
|
+
});
|
|
353
|
+
var profileInfo = mergeLeft(profileInfoOverrides, {
|
|
354
|
+
name: "".concat(globalProps.user.firstName, " ").concat(globalProps.user.lastName),
|
|
355
|
+
imageUrl: globalProps.user.profileImageUrl,
|
|
356
|
+
email: globalProps.user.email || globalProps.user.phoneNumber,
|
|
357
|
+
topLinks: extraTopLinks.concat(getTopLinks()),
|
|
358
|
+
bottomLinks: [{
|
|
359
|
+
icon: LeftArrow,
|
|
360
|
+
label: i18next.t("neetoCommons.sidebar.logout"),
|
|
361
|
+
onClick: handleLogout,
|
|
362
|
+
"data-cy": "profile-logout-button"
|
|
363
|
+
}],
|
|
364
|
+
helpProps: {
|
|
365
|
+
icon: Help,
|
|
366
|
+
label: i18next.t("neetoCommons.sidebar.help"),
|
|
367
|
+
onClick: function onClick() {
|
|
368
|
+
return window.open("https://neeto".concat(toLower(appName), "help.neetokb.com/"), "_blank");
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
changelogProps: isWhatsNewAllowed ? {
|
|
372
|
+
id: CHANGELOG_WIDGET_TRIGGER_ID
|
|
373
|
+
} : undefined
|
|
374
|
+
});
|
|
375
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Sidebar$1, {
|
|
376
|
+
isCollapsed: true,
|
|
377
|
+
appName: "neeto".concat(capitalize(appName)),
|
|
378
|
+
navLinks: navLinks,
|
|
379
|
+
profileInfo: profileInfo,
|
|
380
|
+
organizationInfo: mergeLeft(organizationInfoOverrides, globalProps.organization),
|
|
381
|
+
onAppSwitcherToggle: function onAppSwitcherToggle() {
|
|
382
|
+
return setIsAppSwitcherOpen(not);
|
|
383
|
+
},
|
|
384
|
+
showAppSwitcher: showAppSwitcher
|
|
385
|
+
}), showAppSwitcher && /*#__PURE__*/React__default.createElement(AppSwitcher, {
|
|
386
|
+
isOpen: isAppSwitcherOpen,
|
|
387
|
+
onClose: function onClose() {
|
|
388
|
+
return setIsAppSwitcherOpen(false);
|
|
389
|
+
},
|
|
390
|
+
neetoApps: globalProps.neetoApps,
|
|
391
|
+
activeApp: capitalize(appName),
|
|
392
|
+
environment: process.env.RAILS_ENV
|
|
393
|
+
}));
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
function useDebounce(value) {
|
|
397
|
+
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
|
|
398
|
+
|
|
399
|
+
var _useState = useState(value),
|
|
400
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
401
|
+
debouncedValue = _useState2[0],
|
|
402
|
+
setDebouncedValue = _useState2[1];
|
|
403
|
+
|
|
404
|
+
useEffect(function () {
|
|
405
|
+
var handler = setTimeout(function () {
|
|
406
|
+
setDebouncedValue(value);
|
|
407
|
+
}, delay);
|
|
408
|
+
return function () {
|
|
409
|
+
clearTimeout(handler);
|
|
410
|
+
};
|
|
411
|
+
}, [value]);
|
|
412
|
+
return debouncedValue;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
var useFuncDebounce = function useFuncDebounce(func) {
|
|
416
|
+
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
|
|
417
|
+
var timer = useRef(null);
|
|
418
|
+
|
|
419
|
+
var debouncedFunc = function debouncedFunc() {
|
|
420
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
421
|
+
args[_key] = arguments[_key];
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
clearTimeout(timer.current);
|
|
425
|
+
timer.current = setTimeout(function () {
|
|
426
|
+
return func.apply(void 0, args);
|
|
427
|
+
}, delay);
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
debouncedFunc.cancel = function () {
|
|
431
|
+
return clearTimeout(timer.current);
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
return debouncedFunc;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
var useForceUpdate = function useForceUpdate() {
|
|
438
|
+
var _useState = useState(0),
|
|
439
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
440
|
+
setValue = _useState2[1];
|
|
441
|
+
|
|
442
|
+
return function () {
|
|
443
|
+
return setValue(function (value) {
|
|
444
|
+
return value + 1;
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
var useIsElementVisibleInDom = function useIsElementVisibleInDom(target) {
|
|
450
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
451
|
+
|
|
452
|
+
var _useState = useState(false),
|
|
453
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
454
|
+
isIntersecting = _useState2[0],
|
|
455
|
+
setIntersecting = _useState2[1];
|
|
456
|
+
|
|
457
|
+
var forceUpdate = useForceUpdate();
|
|
458
|
+
useEffect(function () {
|
|
459
|
+
if (!target) return forceUpdate();
|
|
460
|
+
var observer = new IntersectionObserver(function (_ref) {
|
|
461
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
462
|
+
entry = _ref2[0];
|
|
463
|
+
|
|
464
|
+
return setIntersecting(entry.isIntersecting);
|
|
465
|
+
}, options);
|
|
466
|
+
observer.observe(target);
|
|
467
|
+
return function () {
|
|
468
|
+
return observer.unobserve(target);
|
|
469
|
+
};
|
|
470
|
+
}, [target, options]);
|
|
471
|
+
return isIntersecting;
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
var getStorageValue = function getStorageValue(key, defaultValue) {
|
|
475
|
+
var saved = localStorage.getItem(key);
|
|
476
|
+
return JSON.parse(saved) || defaultValue;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
var useLocalStorage = function useLocalStorage(key, defaultValue) {
|
|
480
|
+
var _useState = useState(function () {
|
|
481
|
+
return getStorageValue(key, defaultValue);
|
|
482
|
+
}),
|
|
483
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
484
|
+
storedValue = _useState2[0],
|
|
485
|
+
setStoredValue = _useState2[1];
|
|
486
|
+
|
|
487
|
+
var setValue = function setValue(value) {
|
|
488
|
+
if (isNil(value)) {
|
|
489
|
+
localStorage.removeItem(key);
|
|
490
|
+
} else {
|
|
491
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
setStoredValue(value);
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
return [storedValue, setValue];
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
var useOnClickOutside = function useOnClickOutside(ref, handler) {
|
|
501
|
+
useEffect(function () {
|
|
502
|
+
var listener = function listener(event) {
|
|
503
|
+
// Do nothing if clicking ref's element or descendent elements
|
|
504
|
+
if (!ref.current || ref.current.contains(event.target)) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
handler(event);
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
document.addEventListener("mousedown", listener);
|
|
512
|
+
document.addEventListener("touchstart", listener);
|
|
513
|
+
return function () {
|
|
514
|
+
document.removeEventListener("mousedown", listener);
|
|
515
|
+
document.removeEventListener("touchstart", listener);
|
|
516
|
+
};
|
|
517
|
+
}, [handler]);
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
var usePrevious = function usePrevious(value) {
|
|
521
|
+
var ref = useRef(value);
|
|
522
|
+
useEffect(function () {
|
|
523
|
+
ref.current = value;
|
|
524
|
+
}, [value]);
|
|
525
|
+
return ref.current;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
var useUpdateEffect = function useUpdateEffect(callback) {
|
|
529
|
+
var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
530
|
+
var isInitialMount = useRef(true);
|
|
531
|
+
useEffect(function () {
|
|
532
|
+
if (isInitialMount.current) {
|
|
533
|
+
isInitialMount.current = false;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
callback();
|
|
538
|
+
}, dependencies);
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
function _defineProperty(obj, key, value) {
|
|
542
|
+
if (key in obj) {
|
|
543
|
+
Object.defineProperty(obj, key, {
|
|
544
|
+
value: value,
|
|
545
|
+
enumerable: true,
|
|
546
|
+
configurable: true,
|
|
547
|
+
writable: true
|
|
548
|
+
});
|
|
549
|
+
} else {
|
|
550
|
+
obj[key] = value;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
return obj;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
var ReducerBasedProvider = function ReducerBasedProvider(initialValue, StateContext, DispatchContext, reducer) {
|
|
557
|
+
return function Provider(_ref) {
|
|
558
|
+
var children = _ref.children;
|
|
559
|
+
|
|
560
|
+
var _useReducer = useReducer(reducer, initialValue),
|
|
561
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
562
|
+
state = _useReducer2[0],
|
|
563
|
+
dispatch = _useReducer2[1];
|
|
564
|
+
|
|
565
|
+
return /*#__PURE__*/React__default.createElement(DispatchContext.Provider, {
|
|
566
|
+
value: dispatch
|
|
567
|
+
}, /*#__PURE__*/React__default.createElement(StateContext.Provider, {
|
|
568
|
+
value: state
|
|
569
|
+
}, children));
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
var StateBasedProvider = function StateBasedProvider(initialValue, StateContext, DispatchContext) {
|
|
574
|
+
return function Provider(_ref2) {
|
|
575
|
+
var children = _ref2.children;
|
|
576
|
+
|
|
577
|
+
var _useState = useState(initialValue),
|
|
578
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
579
|
+
state = _useState2[0],
|
|
580
|
+
setState = _useState2[1];
|
|
581
|
+
|
|
582
|
+
return /*#__PURE__*/React__default.createElement(DispatchContext.Provider, {
|
|
583
|
+
value: setState
|
|
584
|
+
}, /*#__PURE__*/React__default.createElement(StateContext.Provider, {
|
|
585
|
+
value: state
|
|
586
|
+
}, children));
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
var _useContext = function useContext(Context) {
|
|
591
|
+
var context = React__default.useContext(Context);
|
|
592
|
+
|
|
593
|
+
if (context === undefined) {
|
|
594
|
+
throw new Error("consumer hooks must be used within a Provider");
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return context;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* Creates a context and returns a provider and consumer hooks
|
|
601
|
+
* @param {Object} initialValue initial value of the context
|
|
602
|
+
* @param {Function} reducer reducer function (can be omitted to get a state based context)
|
|
603
|
+
* @returns {Object} a new context
|
|
604
|
+
*/
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
var createContext = function createContext(initialValue) {
|
|
608
|
+
var _ref3;
|
|
609
|
+
|
|
610
|
+
var reducer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
611
|
+
var StateContext = /*#__PURE__*/React__default.createContext();
|
|
612
|
+
var DispatchContext = /*#__PURE__*/React__default.createContext();
|
|
613
|
+
return _ref3 = {
|
|
614
|
+
Provider: reducer ? ReducerBasedProvider(initialValue, StateContext, DispatchContext, reducer) : StateBasedProvider(initialValue, StateContext, DispatchContext),
|
|
615
|
+
useState: function useState() {
|
|
616
|
+
return _useContext(StateContext);
|
|
617
|
+
}
|
|
618
|
+
}, _defineProperty(_ref3, reducer ? "useDispatch" : "useSetState", function () {
|
|
619
|
+
return _useContext(DispatchContext);
|
|
620
|
+
}), _defineProperty(_ref3, "useContext", function useContext() {
|
|
621
|
+
return [_useContext(StateContext), _useContext(DispatchContext)];
|
|
622
|
+
}), _ref3;
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
var _path$1, _path2, _path3, _path4, _path5, _path6, _path7;
|
|
626
|
+
|
|
627
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
628
|
+
|
|
629
|
+
var SvgErrorPage = function SvgErrorPage(props) {
|
|
630
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
631
|
+
width: 320,
|
|
632
|
+
height: 320,
|
|
633
|
+
viewBox: "0 0 240 240",
|
|
634
|
+
fill: "none",
|
|
635
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
636
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
637
|
+
d: "M168.161 166.069a41.16 41.16 0 0 1 1.784 22.647l14.369-1.59-8.004-22.059-8.149 1.002ZM59.88 183.248l2.29 4.953a48.712 48.712 0 0 0 22.135-10.56l2.327 1.147s.537-15.294-5.807-27.36c-3.7.557-7.26 1.811-10.492 3.697 0 0-1.927 9.223 5.338 15.681 0 .007-8.551 10.569-15.791 12.442ZM67.021 199.962s17.185-1.579 36.709-14.364c0 0 7.456 1.818 14.04 2.743a58.077 58.077 0 0 1-14.5 11.705l-35.16 2.527-1.089-2.611ZM99.977 151.92s3.488 13.944-3.016 31.38c0 0 2.76.918 9.042 2.676 0 0 8.244-14.513 4.62-31.286l-10.646-2.77ZM124.276 159.271s1.08 19.336-5.865 28.854c3.765.685 7.562 1.179 11.376 1.48 0 0 7.656-9.288 7.09-26.4 0-.005-12.568-3.658-12.601-3.934ZM146.933 165.253s3.452 14.268-1.9 25.168c0 0 10.428-.12 13.889-.749a55.916 55.916 0 0 0 .438-23.42 62.905 62.905 0 0 1-12.427-.999ZM44.304 162.181a.57.57 0 0 0-1.038-.12c-2.168 3.551-5.21 8.004-7.616 11.435a.804.804 0 0 0 .217 1.12 8.158 8.158 0 0 0 3.457 1.472c7.65.936 10.596-9.888 4.98-13.907Zm-.388 1.047a6.555 6.555 0 0 1 1.646 6.546 19.439 19.439 0 0 0-3.868-2.75c.764-1.255 1.506-2.52 2.226-3.796h-.004Zm-6.471 10.464c.433-.658.864-1.316 1.293-1.976a11.107 11.107 0 0 0 3.288 2.445 5.162 5.162 0 0 1-4.586-.469h.005Zm5.798-.22a20.607 20.607 0 0 0-3.76-2.908c.42-.654 1.454-2.302 1.56-2.469a14.387 14.387 0 0 0 4.052 3 6.406 6.406 0 0 1-1.852 2.377Z",
|
|
638
|
+
fill: "#2F3941"
|
|
639
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
640
|
+
d: "m58.862 179.071-.847-2.147a.74.74 0 0 0-.6-.388c-2.478-.216-1.941-.351-6.695-.6a14.66 14.66 0 0 0 1.73-3.48.575.575 0 0 0-.348-.733.574.574 0 0 0-.732.347c-2.15 5.625-8.716 10.29-14.313 7.119-3.48-1.885-5.82-5.307-7.935-8.674a3.763 3.763 0 0 0 2.528-1.477c.582-.849.96-1.82 1.108-2.839.371.876.817 1.719 1.332 2.52a.767.767 0 0 0 1.105.248l1.78-1.55a.572.572 0 0 0-.682-.915l-1.222.752c-.806-1.727-.967-2.026-1.453-2.901 1.08-.918 3.126.011 5.864-.223a5.501 5.501 0 0 0 4.52-2.67c1.252-2.098 1.098-4.512 3.454-8.68.568-.43-.218-1.303-.486-3.607a.572.572 0 0 0-.645-.489 26.254 26.254 0 0 0-6.851 2.312 58.82 58.82 0 0 0-14.664 8.986 9.7 9.7 0 0 0-.667-1.336.57.57 0 0 0-1.036-.098.571.571 0 0 0-.059.422 5.458 5.458 0 0 0 .447 2.202 19.463 19.463 0 0 0-2.04 2.28.832.832 0 0 0-.078.862c.297.677.63 1.338.998 1.98a9.6 9.6 0 0 0 5.383 4.143c2.295 4.215 4.32 7.811 8.488 10.2 4.889 2.679 10.238.652 13.698-3.663a23.755 23.755 0 0 0 6.988 1.002l.895 1.58a.574.574 0 0 0 .76.264.57.57 0 0 0 .267-.758l.008.009Zm-26.209-21.068a40.435 40.435 0 0 1 4.4-3.214h.027a.497.497 0 0 1 .466-.082.497.497 0 0 1 .327.341c1.253 2.576 1.086 3.97.942 4.48-.753 2.502-3.46 2.76-5.241.914a5.915 5.915 0 0 1-1.086-1.525.776.776 0 0 1 .165-.914Zm-7.518 6.545a.433.433 0 0 1-.177-.359.428.428 0 0 1 .198-.347v-.032a34.532 34.532 0 0 1 3.728-2.787.665.665 0 0 1 .787.096c2.184 1.947 1.82 5.337-1.09 5.32-1.581-.037-3.326-1.901-3.446-1.891Z",
|
|
641
|
+
fill: "#2F3941"
|
|
642
|
+
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
643
|
+
d: "M52.498 166.036c1.788.309 4.219.555 5.745.646a.572.572 0 0 1-.059 1.14 55.126 55.126 0 0 1-6.52-.498.707.707 0 0 1-.59-.704c0-3.24-1.305-7.038-2.253-9.954a.828.828 0 0 1 .438-1.004c1.701-.79 3.653-2.259 4.044-4.091a2.149 2.149 0 0 0-1.537-2.664 5.796 5.796 0 0 0-3.96.069.524.524 0 0 1-.436-.95 6.94 6.94 0 0 1 5.768.022 3.364 3.364 0 0 1 1.691 3.818 7.653 7.653 0 0 1-4.22 4.969 31.465 31.465 0 0 1 1.889 9.201ZM7.213 158.976c1.13.584 2.345.989 3.6 1.2 10.588 1.83 14.784-10.784 24.279-12.282a5.788 5.788 0 0 1 4.333.766.575.575 0 0 0 .777-.146.574.574 0 0 0-.11-.783 7.09 7.09 0 0 0-5.183-1.162c-10.18 1.233-14.309 13.509-23.916 12.369a10.87 10.87 0 0 1-3.313-.898.524.524 0 0 0-.467.936Z",
|
|
644
|
+
fill: "#2F3941"
|
|
645
|
+
})), _path4 || (_path4 = /*#__PURE__*/React.createElement("path", {
|
|
646
|
+
d: "M6.226 151.849a7.241 7.241 0 0 0 5.547 2.819 13.345 13.345 0 0 0 8.507-3.228.572.572 0 0 0 .122-.797.567.567 0 0 0-.798-.122 15.573 15.573 0 0 1-6.448 2.427 7.369 7.369 0 0 1-6.156-1.8.524.524 0 0 0-.774.701ZM42.307 140.682a6.532 6.532 0 0 1 1.654-.188c3.55.043 5.677 2.4 5.94 5.967a.575.575 0 0 1-.135.416.57.57 0 0 1-.806.064.571.571 0 0 1-.2-.39c-.26-2.825-1.886-4.73-4.8-4.68a5.04 5.04 0 0 0-1.688.307.71.71 0 0 1-.805-.24 9.952 9.952 0 0 0-12.335-2.751c-5.184 2.39-6.932 6.567-10.734 8.76-3.702 2.137-9.319 1.607-12.261-1.595a.524.524 0 1 1 .763-.72 8.102 8.102 0 0 0 5.204 2.232c7.893.644 8.679-6.689 16.34-10.183a11.68 11.68 0 0 1 8.899-.517 10.106 10.106 0 0 1 4.964 3.518ZM201.673 151.615a24.463 24.463 0 0 1-5.711 8.497.576.576 0 0 0-.075.79.574.574 0 0 0 .787.103 13.394 13.394 0 0 0 6-9.097.524.524 0 0 0-1.001-.293ZM205.2 152.462c-1.219 2.88-3.79 7.49-6.281 9.55a.572.572 0 1 0 .701.904c3.878-2.819 5.429-5.64 6.57-10.121a.524.524 0 0 0-.99-.333ZM208.56 154.134c-2.04 6.751-8.28 15.451-14.833 18.426a.568.568 0 0 0 .022 1.053.566.566 0 0 0 .436-.009c7.999-3.378 13.223-10.84 15.382-19.189a.521.521 0 0 0-.37-.621.519.519 0 0 0-.386.043.52.52 0 0 0-.251.297Z",
|
|
647
|
+
fill: "#2F3941"
|
|
648
|
+
})), _path5 || (_path5 = /*#__PURE__*/React.createElement("path", {
|
|
649
|
+
d: "M203.742 168.706c-5.676 5.708-14.826 9.308-21.815 9.034a410.807 410.807 0 0 1-3.371-9.336c.96-.055 2.421-.208 3.347-.337 1.095-.152-.12-1.707 2.509-4.347 4.179-4.178 13.809-5.832 14.566-13.478a.57.57 0 0 0-1.133-.14c-1.237 8.458-15.48 8.128-16.649 16.758-.943.182-2.04.386-3 .502l-.991-2.874a.826.826 0 0 0-1.007-.53c-4.327 1.232-8.703 1.235-13.2 1.394-24.056.848-38.991-8.964-61.192-14.04-15.686-3.579-32.202-1.299-41.88 11.554a.677.677 0 0 0-.096.636c2.264 6.23 3.584 13.838-.684 18.88a.626.626 0 0 0-.101.644c1.92 4.6 7.472 17.709 8.28 19.68a.574.574 0 0 0 .734.294.571.571 0 0 0 .324-.721c-.801-1.983-6.19-14.898-8.04-19.388 4.28-5.334 3.143-13.019.877-19.501 9.399-12.076 25.241-14.072 40.252-10.59 22.289 5.16 37.166 15.049 61.591 14.205 4.313.05 8.618-.369 12.84-1.249 2.442 7.102 4.885 13.906 7.749 20.851-27.428 4.069-54.752 4.515-81.408-2.239a72.364 72.364 0 0 1-21.724-9.917.527.527 0 0 0-.58-.028.534.534 0 0 0-.238.322.518.518 0 0 0 .196.546 73.386 73.386 0 0 0 22.023 10.257 162.974 162.974 0 0 0 15.325 3.213 47.83 47.83 0 0 0 3.739 8.209.57.57 0 0 0 1.059-.427 34.85 34.85 0 0 0-3.339-7.553c22.037 3.36 44.07 2.354 66.204-.916a.822.822 0 0 0 .592-.408c.33-.585.12-.161-3.136-8.751 8.193.747 16.416-3.159 22.2-9.425a.568.568 0 0 0-.432-.934.571.571 0 0 0-.391.15ZM95.45 49.08a5.227 5.227 0 0 0-8.81-3.607 5.147 5.147 0 0 0-.098 7.32 5.202 5.202 0 0 0 8.907-3.713Zm-5.21 3.618a3.72 3.72 0 1 1 2.68-6.299 3.748 3.748 0 0 1-2.68 6.299ZM110.052 51.031a5.225 5.225 0 0 0-8.814-3.607 5.144 5.144 0 0 0-.1 7.32 5.203 5.203 0 0 0 8.914-3.713Zm-5.204 3.618a3.724 3.724 0 0 1-3.103-1.668 3.722 3.722 0 0 1 4.242-5.593 3.712 3.712 0 0 1 1.541.961 3.75 3.75 0 0 1-.651 5.66c-.6.405-1.305.627-2.029.64ZM124.768 53.13a5.233 5.233 0 0 0-3.244-4.647 5.228 5.228 0 0 0-5.572 1.04 5.157 5.157 0 0 0-1.577 3.64 5.148 5.148 0 0 0 1.479 3.68 5.203 5.203 0 0 0 8.914-3.713Zm-5.206 3.618a3.716 3.716 0 0 1-3.102-1.668 3.723 3.723 0 0 1-.32-3.508 3.724 3.724 0 0 1 6.103-1.123 3.75 3.75 0 0 1-2.681 6.299ZM120.72 111.438s-1.034-.3-2.658-.76a104.539 104.539 0 0 0 2.658-17.841 1.936 1.936 0 0 0-.26-1.472 1.95 1.95 0 0 0-1.23-.85 1.94 1.94 0 0 0-2.306 1.514 104.366 104.366 0 0 0-4.767 17.015 263.097 263.097 0 0 0-10.287-2.59c1.56-5.04 3-10.92 4.108-16.12a1.944 1.944 0 0 0-3.691-1.211 190.895 190.895 0 0 0-7.296 18.637 3.081 3.081 0 0 0 2.28 3.96c4.873 1.044 9.643 1.876 13.979 2.566-.85 5.385-1.296 9.614-1.296 9.614a2.115 2.115 0 0 0 .857 2.216c.231.16.491.273.766.332a2.134 2.134 0 0 0 1.609-.305 2.102 2.102 0 0 0 .912-1.36s1.371-4.208 2.824-9.627c1.768.261 2.908.421 2.908.421a2.126 2.126 0 0 0 1.62-.271 2.13 2.13 0 0 0 .949-2.186 2.106 2.106 0 0 0-.907-1.369 2.111 2.111 0 0 0-.776-.318l.004.005ZM188.438 122.867s-1.033-.3-2.656-.76a104.455 104.455 0 0 0 2.662-17.841 1.94 1.94 0 0 0-3.795-.808 104.13 104.13 0 0 0-4.769 17.015 261.26 261.26 0 0 0-10.286-2.59c1.56-5.055 3-10.947 4.107-16.122a1.938 1.938 0 0 0-1.241-2.45 1.942 1.942 0 0 0-2.45 1.241 190.25 190.25 0 0 0-7.296 18.637 3.087 3.087 0 0 0 .262 2.486 3.07 3.07 0 0 0 2.018 1.474c4.862 1.041 9.629 1.873 13.979 2.565-.85 5.386-1.295 9.615-1.295 9.615a2.115 2.115 0 0 0 .857 2.216 2.115 2.115 0 0 0 1.602.341 2.119 2.119 0 0 0 1.686-1.674s1.37-4.208 2.822-9.628c1.768.262 2.909.422 2.909.422a2.124 2.124 0 0 0 1.595-.294c.471-.306.802-.786.92-1.335a2.124 2.124 0 0 0-1.629-2.515l-.002.005ZM156.774 103.806a12.619 12.619 0 0 0-5.298-8.143 12.613 12.613 0 0 0-9.516-1.957 12.936 12.936 0 0 0-10.32 10.32l-2.16 11.64a13.235 13.235 0 0 0 2.196 9.918 13.015 13.015 0 0 0 8.476 5.36 13.018 13.018 0 0 0 9.772-2.256 12.807 12.807 0 0 0 5.15-8.356l1.768-11.71a12.41 12.41 0 0 0-.068-4.816Zm-4.088 4.057c-2.64 12.315-2.489 12.589-3.686 14.333a7.593 7.593 0 0 1-4.854 3.12 7.407 7.407 0 0 1-8.594-5.752c-.395-1.896-.056-2.224 2.075-14.451a7.642 7.642 0 0 1 13.61-3.227 7.113 7.113 0 0 1 1.449 5.977Z",
|
|
650
|
+
fill: "#2F3941"
|
|
651
|
+
})), _path6 || (_path6 = /*#__PURE__*/React.createElement("path", {
|
|
652
|
+
d: "M70.08 149.16a9.079 9.079 0 0 1-4.046-1.136 8.404 8.404 0 0 1-4.158-8.6l14.564-93.97a8.16 8.16 0 0 1 9.284-6.821c147.683 22.46 140.142 20.52 142.785 22.106a8.194 8.194 0 0 1 3.879 8.227l-13.783 92.32a8.363 8.363 0 0 1-9.341 7.056l-3.016-.39a.571.571 0 0 0-.519.911.57.57 0 0 0 .372.219l3.013.402a9.54 9.54 0 0 0 10.68-8.018l14.093-92.28a9.719 9.719 0 0 0-8.15-11.066A262627.5 262627.5 0 0 0 85.966 37.044a9.74 9.74 0 0 0-11.075 8.173L60.764 139.25a9.503 9.503 0 0 0 4.749 9.699 10.314 10.314 0 0 0 4.457 1.243.521.521 0 0 0 .11-1.032Z",
|
|
653
|
+
fill: "#2F3941"
|
|
654
|
+
})), _path7 || (_path7 = /*#__PURE__*/React.createElement("path", {
|
|
655
|
+
d: "m74.215 56.362 157.429 23.14a.57.57 0 0 0 .166-1.13L74.37 55.332a.522.522 0 0 0-.155 1.03Z",
|
|
656
|
+
fill: "#2F3941"
|
|
657
|
+
})));
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
var _g, _path, _defs;
|
|
661
|
+
|
|
662
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
663
|
+
|
|
664
|
+
var SvgNeetoLogo = function SvgNeetoLogo(props) {
|
|
665
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
666
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
667
|
+
width: 80,
|
|
668
|
+
height: 21,
|
|
669
|
+
fill: "none"
|
|
670
|
+
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
671
|
+
clipPath: "url(#neeto-logo_svg__a)"
|
|
672
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
673
|
+
fill: "#212C4F",
|
|
674
|
+
d: "M15.985 8.65v2.286c0 .765 0 1.524.02 2.286a3.924 3.924 0 0 1-.346 1.844 2.436 2.436 0 0 1-1.305 1.204c-.634.262-1.21.363-1.783.242-.572-.122-1.141-.466-1.77-1.093a565.723 565.723 0 0 1-3.324-3.37l-3.31-3.38a3.533 3.533 0 0 0-.578-.538.828.828 0 0 0-.782-.066.908.908 0 0 0-.374.231.936.936 0 0 0-.226.384c-.071.286-.1.58-.087.875 0 1.245.004 2.492.012 3.74 0 1.247 0 2.501-.021 3.742-.013.312.04.624.155.913.11.27.31.49.564.622a.93.93 0 0 0 .842.024c.274-.129.522-.308.732-.529.506-.502 1.009-1.008 1.509-1.517.5-.51.992-1.024 1.476-1.544a1.101 1.101 0 0 1 .75-.39c.272.001.537.089.757.252.21.14.305.441.299.76.001.318-.112.626-.318.865-.6.62-1.196 1.249-1.795 1.87a50.555 50.555 0 0 1-1.841 1.822 2.884 2.884 0 0 1-1.69.8 3.651 3.651 0 0 1-1.856-.343 2.731 2.731 0 0 1-1.29-1.083A3.147 3.147 0 0 1 0 17.877c.015-1.537.013-3.074.011-4.613V8.65a4.077 4.077 0 0 1 .364-1.773A2.352 2.352 0 0 1 1.664 5.7a3.152 3.152 0 0 1 1.838-.186 3.248 3.248 0 0 1 1.656.988A315.665 315.665 0 0 0 8.544 9.98c1.139 1.152 2.274 2.306 3.406 3.462.154.172.332.322.527.443a.76.76 0 0 0 .652.057c.205-.063.39-.177.54-.333a.957.957 0 0 0 .212-.667c-.016-1.406-.016-2.805-.016-4.204V4.54a1.56 1.56 0 0 0-.096-.62.843.843 0 0 0-.47-.434 1.467 1.467 0 0 0-.636-.147 1.067 1.067 0 0 0-.617.254 16.238 16.238 0 0 0-1.736 1.615c-.546.57-1.08 1.156-1.65 1.703-.213.234-.495.39-.803.443a.872.872 0 0 1-.72-.311 1.062 1.062 0 0 1-.314-.81c.022-.322.16-.625.39-.848l1.729-1.767c.575-.59 1.154-1.174 1.737-1.754a3.163 3.163 0 0 1 1.284-.743c.48-.142.985-.166 1.475-.07.491.07.96.258 1.368.547.408.29.744.673.98 1.12a1.972 1.972 0 0 1 .212.938c-.006.83-.006 1.664 0 2.501.007.837.002 1.668-.013 2.493Z"
|
|
675
|
+
}))), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
676
|
+
fill: "#212C4F",
|
|
677
|
+
d: "M20.17 13V4.072h2.034l.18 1.512a3.157 3.157 0 0 1 1.188-1.26c.528-.312 1.146-.468 1.854-.468 1.104 0 1.962.348 2.574 1.044.612.696.918 1.716.918 3.06V13h-2.304V8.176c0-.768-.156-1.356-.468-1.764-.312-.408-.798-.612-1.458-.612-.648 0-1.182.228-1.602.684-.408.456-.612 1.092-.612 1.908V13H20.17Zm15.29.216c-.9 0-1.699-.192-2.395-.576a4.169 4.169 0 0 1-1.638-1.62c-.396-.696-.594-1.5-.594-2.412 0-.924.192-1.746.576-2.466a4.265 4.265 0 0 1 1.62-1.674c.696-.408 1.512-.612 2.448-.612.876 0 1.65.192 2.322.576a4.055 4.055 0 0 1 1.566 1.584c.384.66.576 1.398.576 2.214 0 .132-.006.27-.018.414 0 .144-.006.294-.018.45H33.12c.048.696.288 1.242.72 1.638.444.396.978.594 1.602.594.468 0 .858-.102 1.17-.306.324-.216.564-.492.72-.828h2.34a4.26 4.26 0 0 1-.846 1.548 4.067 4.067 0 0 1-1.44 1.08c-.564.264-1.206.396-1.926.396Zm.017-7.488c-.564 0-1.062.162-1.494.486-.432.312-.708.792-.828 1.44h4.446c-.036-.588-.252-1.056-.648-1.404-.396-.348-.888-.522-1.476-.522Zm10.74 7.488c-.9 0-1.698-.192-2.394-.576a4.169 4.169 0 0 1-1.638-1.62c-.396-.696-.594-1.5-.594-2.412 0-.924.192-1.746.576-2.466a4.265 4.265 0 0 1 1.62-1.674c.696-.408 1.512-.612 2.448-.612.876 0 1.65.192 2.322.576a4.055 4.055 0 0 1 1.566 1.584c.384.66.576 1.398.576 2.214 0 .132-.006.27-.018.414 0 .144-.006.294-.018.45h-6.786c.048.696.288 1.242.72 1.638.444.396.978.594 1.602.594.468 0 .858-.102 1.17-.306.324-.216.564-.492.72-.828h2.34a4.26 4.26 0 0 1-.846 1.548 4.067 4.067 0 0 1-1.44 1.08c-.564.264-1.206.396-1.926.396Zm.018-7.488c-.564 0-1.062.162-1.494.486-.432.312-.708.792-.828 1.44h4.446c-.036-.588-.252-1.056-.648-1.404-.396-.348-.888-.522-1.476-.522ZM56.457 13c-.936 0-1.686-.228-2.25-.684-.564-.456-.846-1.266-.846-2.43V5.998h-1.53V4.072h1.53l.27-2.394h2.034v2.394h2.412v1.926h-2.412v3.906c0 .432.09.732.27.9.192.156.516.234.972.234h1.116V13h-1.566Zm7.653.216c-.864 0-1.644-.198-2.34-.594a4.468 4.468 0 0 1-1.638-1.638c-.396-.708-.594-1.524-.594-2.448 0-.924.204-1.734.612-2.43a4.429 4.429 0 0 1 1.638-1.656c.696-.396 1.476-.594 2.34-.594.852 0 1.62.198 2.304.594a4.26 4.26 0 0 1 1.638 1.656c.408.696.612 1.506.612 2.43 0 .924-.204 1.74-.612 2.448a4.296 4.296 0 0 1-1.638 1.638 4.612 4.612 0 0 1-2.322.594Zm0-1.998c.6 0 1.122-.222 1.566-.666.444-.456.666-1.128.666-2.016 0-.888-.222-1.554-.666-1.998-.444-.456-.96-.684-1.548-.684-.612 0-1.14.228-1.584.684-.432.444-.648 1.11-.648 1.998 0 .888.216 1.56.648 2.016.444.444.966.666 1.566.666Z"
|
|
678
|
+
})), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
679
|
+
id: "neeto-logo_svg__a"
|
|
680
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
681
|
+
fill: "#fff",
|
|
682
|
+
d: "M0 1h16v20H0z"
|
|
683
|
+
})))));
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
var ErrorPage = function ErrorPage(_ref) {
|
|
687
|
+
var _ref$homeUrl = _ref.homeUrl,
|
|
688
|
+
homeUrl = _ref$homeUrl === void 0 ? "/" : _ref$homeUrl;
|
|
689
|
+
|
|
690
|
+
var _useTranslation = useTranslation(),
|
|
691
|
+
t = _useTranslation.t;
|
|
692
|
+
|
|
693
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
694
|
+
className: "flex min-h-screen w-full flex-col items-center"
|
|
695
|
+
}, /*#__PURE__*/React__default.createElement(SvgNeetoLogo, {
|
|
696
|
+
className: "mt-20 scale-150 transform"
|
|
697
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
698
|
+
className: "flex w-full flex-1 items-center justify-center"
|
|
699
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
700
|
+
"data-cy": "empty-state-container",
|
|
701
|
+
className: "flex h-full flex-row items-start justify-start"
|
|
702
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
703
|
+
className: "m-auto max-w-md text-center"
|
|
704
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
705
|
+
"data-cy": "empty-state-image-container",
|
|
706
|
+
className: "m-auto mb-8 flex items-center justify-center"
|
|
707
|
+
}, /*#__PURE__*/React__default.createElement(SvgErrorPage, null)), /*#__PURE__*/React__default.createElement(Typography, {
|
|
708
|
+
component: "h2",
|
|
709
|
+
style: "h2",
|
|
710
|
+
weight: "semibold",
|
|
711
|
+
className: "mb-4",
|
|
712
|
+
"data-cy": "empty-state-title"
|
|
713
|
+
}, t("neetoCommons.errorPage.pageDoesNotExist")), /*#__PURE__*/React__default.createElement("div", {
|
|
714
|
+
className: "flex flex-row items-center justify-center"
|
|
715
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
716
|
+
style: "primary",
|
|
717
|
+
href: homeUrl,
|
|
718
|
+
size: "large",
|
|
719
|
+
label: t("neetoCommons.errorPage.goToHome")
|
|
720
|
+
}))))));
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
724
|
+
try {
|
|
725
|
+
var info = gen[key](arg);
|
|
726
|
+
var value = info.value;
|
|
727
|
+
} catch (error) {
|
|
728
|
+
reject(error);
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (info.done) {
|
|
733
|
+
resolve(value);
|
|
734
|
+
} else {
|
|
735
|
+
Promise.resolve(value).then(_next, _throw);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
function _asyncToGenerator(fn) {
|
|
740
|
+
return function () {
|
|
741
|
+
var self = this,
|
|
742
|
+
args = arguments;
|
|
743
|
+
return new Promise(function (resolve, reject) {
|
|
744
|
+
var gen = fn.apply(self, args);
|
|
745
|
+
|
|
746
|
+
function _next(value) {
|
|
747
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function _throw(err) {
|
|
751
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
_next(undefined);
|
|
755
|
+
});
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
760
|
+
|
|
761
|
+
var _typeof = {exports: {}};
|
|
762
|
+
|
|
763
|
+
(function (module) {
|
|
764
|
+
function _typeof(obj) {
|
|
765
|
+
"@babel/helpers - typeof";
|
|
766
|
+
|
|
767
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
768
|
+
return typeof obj;
|
|
769
|
+
} : function (obj) {
|
|
770
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
771
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
775
|
+
} (_typeof));
|
|
776
|
+
|
|
777
|
+
(function (module) {
|
|
778
|
+
var _typeof$1 = _typeof.exports["default"];
|
|
779
|
+
|
|
780
|
+
function _regeneratorRuntime() {
|
|
781
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
782
|
+
|
|
783
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
784
|
+
return exports;
|
|
785
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
786
|
+
var exports = {},
|
|
787
|
+
Op = Object.prototype,
|
|
788
|
+
hasOwn = Op.hasOwnProperty,
|
|
789
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
790
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
791
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
792
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
793
|
+
|
|
794
|
+
function define(obj, key, value) {
|
|
795
|
+
return Object.defineProperty(obj, key, {
|
|
796
|
+
value: value,
|
|
797
|
+
enumerable: !0,
|
|
798
|
+
configurable: !0,
|
|
799
|
+
writable: !0
|
|
800
|
+
}), obj[key];
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
try {
|
|
804
|
+
define({}, "");
|
|
805
|
+
} catch (err) {
|
|
806
|
+
define = function define(obj, key, value) {
|
|
807
|
+
return obj[key] = value;
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
812
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
813
|
+
generator = Object.create(protoGenerator.prototype),
|
|
814
|
+
context = new Context(tryLocsList || []);
|
|
815
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
816
|
+
var state = "suspendedStart";
|
|
817
|
+
return function (method, arg) {
|
|
818
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
819
|
+
|
|
820
|
+
if ("completed" === state) {
|
|
821
|
+
if ("throw" === method) throw arg;
|
|
822
|
+
return doneResult();
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
for (context.method = method, context.arg = arg;;) {
|
|
826
|
+
var delegate = context.delegate;
|
|
827
|
+
|
|
828
|
+
if (delegate) {
|
|
829
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
830
|
+
|
|
831
|
+
if (delegateResult) {
|
|
832
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
833
|
+
return delegateResult;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
838
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
839
|
+
context.dispatchException(context.arg);
|
|
840
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
841
|
+
state = "executing";
|
|
842
|
+
var record = tryCatch(innerFn, self, context);
|
|
843
|
+
|
|
844
|
+
if ("normal" === record.type) {
|
|
845
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
846
|
+
return {
|
|
847
|
+
value: record.arg,
|
|
848
|
+
done: context.done
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
}(innerFn, self, context), generator;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
function tryCatch(fn, obj, arg) {
|
|
859
|
+
try {
|
|
860
|
+
return {
|
|
861
|
+
type: "normal",
|
|
862
|
+
arg: fn.call(obj, arg)
|
|
863
|
+
};
|
|
864
|
+
} catch (err) {
|
|
865
|
+
return {
|
|
866
|
+
type: "throw",
|
|
867
|
+
arg: err
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
exports.wrap = wrap;
|
|
873
|
+
var ContinueSentinel = {};
|
|
874
|
+
|
|
875
|
+
function Generator() {}
|
|
876
|
+
|
|
877
|
+
function GeneratorFunction() {}
|
|
878
|
+
|
|
879
|
+
function GeneratorFunctionPrototype() {}
|
|
880
|
+
|
|
881
|
+
var IteratorPrototype = {};
|
|
882
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
883
|
+
return this;
|
|
884
|
+
});
|
|
885
|
+
var getProto = Object.getPrototypeOf,
|
|
886
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
887
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
888
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
889
|
+
|
|
890
|
+
function defineIteratorMethods(prototype) {
|
|
891
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
892
|
+
define(prototype, method, function (arg) {
|
|
893
|
+
return this._invoke(method, arg);
|
|
894
|
+
});
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
899
|
+
function invoke(method, arg, resolve, reject) {
|
|
900
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
901
|
+
|
|
902
|
+
if ("throw" !== record.type) {
|
|
903
|
+
var result = record.arg,
|
|
904
|
+
value = result.value;
|
|
905
|
+
return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
906
|
+
invoke("next", value, resolve, reject);
|
|
907
|
+
}, function (err) {
|
|
908
|
+
invoke("throw", err, resolve, reject);
|
|
909
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
910
|
+
result.value = unwrapped, resolve(result);
|
|
911
|
+
}, function (error) {
|
|
912
|
+
return invoke("throw", error, resolve, reject);
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
reject(record.arg);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
var previousPromise;
|
|
920
|
+
|
|
921
|
+
this._invoke = function (method, arg) {
|
|
922
|
+
function callInvokeWithMethodAndArg() {
|
|
923
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
924
|
+
invoke(method, arg, resolve, reject);
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
933
|
+
var method = delegate.iterator[context.method];
|
|
934
|
+
|
|
935
|
+
if (undefined === method) {
|
|
936
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
937
|
+
if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
938
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
return ContinueSentinel;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
945
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
946
|
+
var info = record.arg;
|
|
947
|
+
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);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function pushTryEntry(locs) {
|
|
951
|
+
var entry = {
|
|
952
|
+
tryLoc: locs[0]
|
|
953
|
+
};
|
|
954
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
function resetTryEntry(entry) {
|
|
958
|
+
var record = entry.completion || {};
|
|
959
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
function Context(tryLocsList) {
|
|
963
|
+
this.tryEntries = [{
|
|
964
|
+
tryLoc: "root"
|
|
965
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
function values(iterable) {
|
|
969
|
+
if (iterable) {
|
|
970
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
971
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
972
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
973
|
+
|
|
974
|
+
if (!isNaN(iterable.length)) {
|
|
975
|
+
var i = -1,
|
|
976
|
+
next = function next() {
|
|
977
|
+
for (; ++i < iterable.length;) {
|
|
978
|
+
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
return next.value = undefined, next.done = !0, next;
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
return next.next = next;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
return {
|
|
989
|
+
next: doneResult
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
function doneResult() {
|
|
994
|
+
return {
|
|
995
|
+
value: undefined,
|
|
996
|
+
done: !0
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
1001
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
1002
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
1003
|
+
}, exports.mark = function (genFun) {
|
|
1004
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
1005
|
+
}, exports.awrap = function (arg) {
|
|
1006
|
+
return {
|
|
1007
|
+
__await: arg
|
|
1008
|
+
};
|
|
1009
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1010
|
+
return this;
|
|
1011
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1012
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
1013
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
1014
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
1015
|
+
return result.done ? result.value : iter.next();
|
|
1016
|
+
});
|
|
1017
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
1018
|
+
return this;
|
|
1019
|
+
}), define(Gp, "toString", function () {
|
|
1020
|
+
return "[object Generator]";
|
|
1021
|
+
}), exports.keys = function (object) {
|
|
1022
|
+
var keys = [];
|
|
1023
|
+
|
|
1024
|
+
for (var key in object) {
|
|
1025
|
+
keys.push(key);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
return keys.reverse(), function next() {
|
|
1029
|
+
for (; keys.length;) {
|
|
1030
|
+
var key = keys.pop();
|
|
1031
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
return next.done = !0, next;
|
|
1035
|
+
};
|
|
1036
|
+
}, exports.values = values, Context.prototype = {
|
|
1037
|
+
constructor: Context,
|
|
1038
|
+
reset: function reset(skipTempReset) {
|
|
1039
|
+
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) {
|
|
1040
|
+
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
stop: function stop() {
|
|
1044
|
+
this.done = !0;
|
|
1045
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
1046
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
1047
|
+
return this.rval;
|
|
1048
|
+
},
|
|
1049
|
+
dispatchException: function dispatchException(exception) {
|
|
1050
|
+
if (this.done) throw exception;
|
|
1051
|
+
var context = this;
|
|
1052
|
+
|
|
1053
|
+
function handle(loc, caught) {
|
|
1054
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1058
|
+
var entry = this.tryEntries[i],
|
|
1059
|
+
record = entry.completion;
|
|
1060
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
1061
|
+
|
|
1062
|
+
if (entry.tryLoc <= this.prev) {
|
|
1063
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
1064
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1065
|
+
|
|
1066
|
+
if (hasCatch && hasFinally) {
|
|
1067
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
1068
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
1069
|
+
} else if (hasCatch) {
|
|
1070
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
1071
|
+
} else {
|
|
1072
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
1073
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
abrupt: function abrupt(type, arg) {
|
|
1079
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1080
|
+
var entry = this.tryEntries[i];
|
|
1081
|
+
|
|
1082
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
1083
|
+
var finallyEntry = entry;
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
1089
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
1090
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
1091
|
+
},
|
|
1092
|
+
complete: function complete(record, afterLoc) {
|
|
1093
|
+
if ("throw" === record.type) throw record.arg;
|
|
1094
|
+
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;
|
|
1095
|
+
},
|
|
1096
|
+
finish: function finish(finallyLoc) {
|
|
1097
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1098
|
+
var entry = this.tryEntries[i];
|
|
1099
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
"catch": function _catch(tryLoc) {
|
|
1103
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1104
|
+
var entry = this.tryEntries[i];
|
|
1105
|
+
|
|
1106
|
+
if (entry.tryLoc === tryLoc) {
|
|
1107
|
+
var record = entry.completion;
|
|
1108
|
+
|
|
1109
|
+
if ("throw" === record.type) {
|
|
1110
|
+
var thrown = record.arg;
|
|
1111
|
+
resetTryEntry(entry);
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
return thrown;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
throw new Error("illegal catch attempt");
|
|
1119
|
+
},
|
|
1120
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
1121
|
+
return this.delegate = {
|
|
1122
|
+
iterator: values(iterable),
|
|
1123
|
+
resultName: resultName,
|
|
1124
|
+
nextLoc: nextLoc
|
|
1125
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
1126
|
+
}
|
|
1127
|
+
}, exports;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1131
|
+
} (regeneratorRuntime$1));
|
|
1132
|
+
|
|
1133
|
+
// TODO(Babel 8): Remove this file.
|
|
1134
|
+
|
|
1135
|
+
var runtime = regeneratorRuntime$1.exports();
|
|
1136
|
+
var regenerator = runtime;
|
|
1137
|
+
|
|
1138
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
1139
|
+
try {
|
|
1140
|
+
regeneratorRuntime = runtime;
|
|
1141
|
+
} catch (accidentalStrictMode) {
|
|
1142
|
+
if (typeof globalThis === "object") {
|
|
1143
|
+
globalThis.regeneratorRuntime = runtime;
|
|
1144
|
+
} else {
|
|
1145
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
var INITIAL_FORM_VALUES = {
|
|
1150
|
+
email: "",
|
|
1151
|
+
password: ""
|
|
1152
|
+
};
|
|
1153
|
+
var DEFAULT_EMAIL = "oliver@example.com";
|
|
1154
|
+
var DEFAULT_PASSWORD = "welcome";
|
|
1155
|
+
var LOGIN_FORM_VALIDATION_SCHEMA = Yup.object().shape({
|
|
1156
|
+
email: Yup.string().email("Please enter a valid email").required("Email is required"),
|
|
1157
|
+
password: Yup.string().required("Password is required")
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
function SignInForm(_ref) {
|
|
1161
|
+
var handleFormSubmit = _ref.handleFormSubmit;
|
|
1162
|
+
|
|
1163
|
+
var emailFromSearchParams = function emailFromSearchParams() {
|
|
1164
|
+
return new URLSearchParams(window.location.href).get("email");
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
var emailPrefilledInitialValues = function emailPrefilledInitialValues() {
|
|
1168
|
+
return assocPath(["user", "email"], emailFromSearchParams() || "", INITIAL_FORM_VALUES);
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
if (Button$1 === undefined) {
|
|
1172
|
+
return /*#__PURE__*/React__default.createElement("div", null, "You need to have @bigbinary/neetoui version ^3.5.11 installed to use the login form.", /*#__PURE__*/React__default.createElement("br", null), "Run the command:", /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("code", null, "yarn add @bigbinary/neetoui@^3.5.11"));
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
return /*#__PURE__*/React__default.createElement(Formik, {
|
|
1176
|
+
initialValues: emailPrefilledInitialValues(),
|
|
1177
|
+
validationSchema: LOGIN_FORM_VALIDATION_SCHEMA,
|
|
1178
|
+
onSubmit: handleFormSubmit
|
|
1179
|
+
}, /*#__PURE__*/React__default.createElement(Form, {
|
|
1180
|
+
className: "w-full"
|
|
1181
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1182
|
+
className: "mb-6"
|
|
1183
|
+
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
1184
|
+
required: true,
|
|
1185
|
+
label: "Email",
|
|
1186
|
+
name: "email",
|
|
1187
|
+
"data-test-id": "login-email",
|
|
1188
|
+
"data-cy": "login-email-text-field"
|
|
1189
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
1190
|
+
className: "mb-6"
|
|
1191
|
+
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
1192
|
+
required: true,
|
|
1193
|
+
type: "password",
|
|
1194
|
+
label: "Password",
|
|
1195
|
+
name: "password",
|
|
1196
|
+
"data-test-id": "login-password",
|
|
1197
|
+
"data-cy": "login-password-text-field"
|
|
1198
|
+
})), /*#__PURE__*/React__default.createElement(Button$1, {
|
|
1199
|
+
style: "secondary",
|
|
1200
|
+
type: "submit",
|
|
1201
|
+
"data-test-id": "login-submit-button",
|
|
1202
|
+
label: "Login",
|
|
1203
|
+
fullWidth: true,
|
|
1204
|
+
"data-cy": "login-submit-button"
|
|
1205
|
+
})));
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
function SignIn(_ref) {
|
|
1209
|
+
var handleSubmit = _ref.handleSubmit;
|
|
1210
|
+
|
|
1211
|
+
var _useState = useState(null),
|
|
1212
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1213
|
+
isSubmitting = _useState2[0],
|
|
1214
|
+
setIsSubmitting = _useState2[1];
|
|
1215
|
+
|
|
1216
|
+
var redirectAfterSuccessfulLogin = function redirectAfterSuccessfulLogin(redirectTo) {
|
|
1217
|
+
window.location.pathname = redirectTo || "/";
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
var handleFormSubmit = /*#__PURE__*/function () {
|
|
1221
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(formValues) {
|
|
1222
|
+
var response;
|
|
1223
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1224
|
+
while (1) {
|
|
1225
|
+
switch (_context.prev = _context.next) {
|
|
1226
|
+
case 0:
|
|
1227
|
+
_context.prev = 0;
|
|
1228
|
+
_context.next = 3;
|
|
1229
|
+
return handleSubmit({
|
|
1230
|
+
user: formValues
|
|
1231
|
+
});
|
|
1232
|
+
|
|
1233
|
+
case 3:
|
|
1234
|
+
response = _context.sent;
|
|
1235
|
+
Toastr.success("Logged in successfully.");
|
|
1236
|
+
redirectAfterSuccessfulLogin(response.redirectTo);
|
|
1237
|
+
_context.next = 10;
|
|
1238
|
+
break;
|
|
1239
|
+
|
|
1240
|
+
case 8:
|
|
1241
|
+
_context.prev = 8;
|
|
1242
|
+
_context.t0 = _context["catch"](0);
|
|
1243
|
+
|
|
1244
|
+
case 10:
|
|
1245
|
+
case "end":
|
|
1246
|
+
return _context.stop();
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
}, _callee, null, [[0, 8]]);
|
|
1250
|
+
}));
|
|
1251
|
+
|
|
1252
|
+
return function handleFormSubmit(_x) {
|
|
1253
|
+
return _ref2.apply(this, arguments);
|
|
1254
|
+
};
|
|
1255
|
+
}();
|
|
1256
|
+
|
|
1257
|
+
var loginAsOliver = /*#__PURE__*/function () {
|
|
1258
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
1259
|
+
return regenerator.wrap(function _callee2$(_context2) {
|
|
1260
|
+
while (1) {
|
|
1261
|
+
switch (_context2.prev = _context2.next) {
|
|
1262
|
+
case 0:
|
|
1263
|
+
setIsSubmitting(true);
|
|
1264
|
+
_context2.next = 3;
|
|
1265
|
+
return handleFormSubmit({
|
|
1266
|
+
email: DEFAULT_EMAIL,
|
|
1267
|
+
password: DEFAULT_PASSWORD
|
|
1268
|
+
});
|
|
1269
|
+
|
|
1270
|
+
case 3:
|
|
1271
|
+
setIsSubmitting(false);
|
|
1272
|
+
|
|
1273
|
+
case 4:
|
|
1274
|
+
case "end":
|
|
1275
|
+
return _context2.stop();
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}, _callee2);
|
|
1279
|
+
}));
|
|
1280
|
+
|
|
1281
|
+
return function loginAsOliver() {
|
|
1282
|
+
return _ref3.apply(this, arguments);
|
|
1283
|
+
};
|
|
1284
|
+
}();
|
|
1285
|
+
|
|
1286
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1287
|
+
className: "w-screen h-screen flex justify-center"
|
|
1288
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1289
|
+
className: "rounded-lg bg-white p-10 shadow self-center max-w-lg min-w-max w-2/3"
|
|
1290
|
+
}, /*#__PURE__*/React__default.createElement("h1", {
|
|
1291
|
+
className: "mb-6 text-xl font-medium text-gray-800"
|
|
1292
|
+
}, "Login to your", " ", /*#__PURE__*/React__default.createElement("b", {
|
|
1293
|
+
"data-test-id": "organization-name"
|
|
1294
|
+
}, globalProps.organization.name), " ", "account"), /*#__PURE__*/React__default.createElement(Button, {
|
|
1295
|
+
style: "primary",
|
|
1296
|
+
size: "large",
|
|
1297
|
+
label: "Login as Oliver",
|
|
1298
|
+
disabled: isSubmitting,
|
|
1299
|
+
loading: isSubmitting,
|
|
1300
|
+
onClick: loginAsOliver,
|
|
1301
|
+
fullWidth: true
|
|
1302
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1303
|
+
className: "my-6 text-center text-lg font-semibold"
|
|
1304
|
+
}, "OR"), /*#__PURE__*/React__default.createElement(SignInForm, {
|
|
1305
|
+
handleFormSubmit: handleFormSubmit
|
|
1306
|
+
})));
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
export { DateFormat, ErrorPage, HoneybadgerErrorBoundary, SignIn as LoginPage, PrivateRoute, Sidebar, TimeFormat, createContext, useDebounce, useFuncDebounce, useIsElementVisibleInDom, useLocalStorage, useOnClickOutside, usePrevious, useUpdateEffect };
|