@bigbinary/neeto-molecules 1.1.69 → 1.1.71-beta

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/dist/Sidebar.js CHANGED
@@ -1,18 +1,16 @@
1
- import React, { forwardRef, useState, useRef, useEffect } from 'react';
1
+ import React, { useState, forwardRef, useEffect } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
4
- import { useFetchNeetoApps, useHotKeys, useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
5
- import { Typography, Button, Input, Spinner, Avatar, Tooltip } from '@bigbinary/neetoui';
6
- import { toLower, all, mergeDeepLeft, curry, is, includes, __, not } from 'ramda';
4
+ import { useFetchNeetoApps, useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
5
+ import { Typography, Input, Tooltip, Spinner, Avatar, Button } from '@bigbinary/neetoui';
7
6
  import { useTranslation } from 'react-i18next';
8
- import { Link, useLocation, NavLink } from 'react-router-dom';
9
- import { CSSTransition } from 'react-transition-group';
10
- import { NeetoIcon, Close, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
7
+ import { Link, NavLink, useLocation } from 'react-router-dom';
8
+ import { NeetoIcon, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
11
9
  import { capitalize, truncate, isPresent, findBy, isNotPresent } from '@bigbinary/neeto-cist';
12
10
  import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
13
- import { createPortal } from 'react-dom';
14
11
  import { t as t$1 } from 'i18next';
15
12
  import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
13
+ import { toLower, curry, is, includes, __, all, repeat, mergeDeepLeft, omit, inc, not } from 'ramda';
16
14
  import KeyboardShortcuts from '@bigbinary/neeto-molecules/KeyboardShortcuts';
17
15
  import * as ProductTypefaceLogos from '@bigbinary/neeto-icons/typeface-logos';
18
16
  import { Neeto } from '@bigbinary/neeto-icons/typeface-logos';
@@ -72,9 +70,22 @@ function _slicedToArray(arr, i) {
72
70
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
73
71
  }
74
72
 
73
+ var Chevron = function Chevron(_ref) {
74
+ var style = _ref.style;
75
+ return /*#__PURE__*/React.createElement("svg", {
76
+ height: "16",
77
+ viewBox: "0 0 16 16",
78
+ width: "16",
79
+ style: style
80
+ }, /*#__PURE__*/React.createElement("path", {
81
+ d: "M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z",
82
+ fill: "currentColor"
83
+ }));
84
+ };
85
+
75
86
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
76
87
 
77
- var css$1 = ".neeto-molecules-app-switcher__backdrop{align-items:center;background-color:rgba(27,31,35,.867);flex-direction:row;left:0;overflow:hidden;position:fixed;top:0;z-index:99998}.neeto-molecules-app-switcher__backdrop,.neeto-molecules-app-switcher__wrapper{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;height:100vh;justify-content:flex-start;transition:all .3s;width:100vw}.neeto-molecules-app-switcher__wrapper{align-items:flex-start;animation:nuifadeIn .3s ease-in;background-color:rgb(var(--neeto-ui-white));flex-direction:column;max-width:100%;overflow-y:auto;padding:40px;position:relative}.neeto-molecules-app-switcher__wrapper--collapsed{width:100vw}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:16px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}.neeto-molecules-app-switcher__header h1{font-size:40px;line-height:var(--neeto-ui-leading-tight);margin-top:-16px}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{width:316px}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}.neeto-molecules-app-switcher-enter.neeto-molecules-app-switcher__backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0}.neeto-molecules-app-switcher-enter-active.neeto-molecules-app-switcher__backdrop,.neeto-molecules-app-switcher-enter-done.neeto-molecules-app-switcher__backdrop,.neeto-molecules-app-switcher-exit.neeto-molecules-app-switcher__backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:1}.neeto-molecules-app-switcher-exit-active.neeto-molecules-app-switcher__backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0}";
88
+ var css$1 = ".neeto-molecules-app-switcher__wrapper{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;justify-content:flex-start;max-width:100%;overflow-y:auto;padding:40px;position:relative;transition:all .3s;width:100%}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__wrapper{padding:32px}}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:32px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}@media only screen and (max-width:768px){.neeto-molecules-app-switcher__header{align-items:flex-start;flex-direction:column-reverse;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__header h1{font-size:28px}}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-app-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}";
78
89
  n(css$1,{});
79
90
 
80
91
  function _extends() {
@@ -92,46 +103,6 @@ function _extends() {
92
103
  return _extends.apply(this, arguments);
93
104
  }
94
105
 
95
- function _objectWithoutPropertiesLoose(source, excluded) {
96
- if (source == null) return {};
97
- var target = {};
98
- var sourceKeys = Object.keys(source);
99
- var key, i;
100
- for (i = 0; i < sourceKeys.length; i++) {
101
- key = sourceKeys[i];
102
- if (excluded.indexOf(key) >= 0) continue;
103
- target[key] = source[key];
104
- }
105
- return target;
106
- }
107
-
108
- function _objectWithoutProperties(source, excluded) {
109
- if (source == null) return {};
110
- var target = _objectWithoutPropertiesLoose(source, excluded);
111
- var key, i;
112
- if (Object.getOwnPropertySymbols) {
113
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
114
- for (i = 0; i < sourceSymbolKeys.length; i++) {
115
- key = sourceSymbolKeys[i];
116
- if (excluded.indexOf(key) >= 0) continue;
117
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
118
- target[key] = source[key];
119
- }
120
- }
121
- return target;
122
- }
123
-
124
- var _excluded$3 = ["children"];
125
- var Backdrop = function Backdrop(_ref, ref) {
126
- var children = _ref.children,
127
- otherProps = _objectWithoutProperties(_ref, _excluded$3);
128
- return /*#__PURE__*/React.createElement("div", _extends({
129
- "data-testid": "neeto-backdrop",
130
- ref: ref
131
- }, otherProps), children);
132
- };
133
- var Backdrop$1 = /*#__PURE__*/forwardRef(Backdrop);
134
-
135
106
  var AppLink = function AppLink(_ref) {
136
107
  var name = _ref.name,
137
108
  description = _ref.description,
@@ -171,8 +142,7 @@ var AppLink = function AppLink(_ref) {
171
142
  };
172
143
  var AppLink$1 = /*#__PURE__*/React.memo(AppLink);
173
144
 
174
- var Body = function Body(_ref) {
175
- var onClose = _ref.onClose;
145
+ var Body = function Body() {
176
146
  var _useTranslation = useTranslation(),
177
147
  t = _useTranslation.t;
178
148
  var _useState = useState(""),
@@ -182,23 +152,14 @@ var Body = function Body(_ref) {
182
152
  var _useFetchNeetoApps = useFetchNeetoApps(),
183
153
  data = _useFetchNeetoApps.data;
184
154
  var substring = searchTerm.replace(/ /g, "").toLowerCase();
185
- var filteredApps = data === null || data === void 0 ? void 0 : data.neetoApps.filter(function (_ref2) {
186
- var name = _ref2.name;
155
+ var filteredApps = data === null || data === void 0 ? void 0 : data.neetoApps.filter(function (_ref) {
156
+ var name = _ref.name;
187
157
  return name.toLowerCase().includes(substring);
188
158
  });
189
159
  var handleSearch = function handleSearch(e) {
190
160
  return setSearchTerm(e.target.value);
191
161
  };
192
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
193
- className: "neeto-molecules-app-switcher__close-btn",
194
- "data-cy": "app-switcher-back-button",
195
- "data-testid": "app-switcher-back-button",
196
- icon: Close,
197
- iconPosition: "left",
198
- size: "small",
199
- style: "text",
200
- onClick: onClose
201
- }), /*#__PURE__*/React.createElement("div", {
162
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
202
163
  className: "neeto-molecules-app-switcher__header",
203
164
  "data-cy": "app-switcher-body-wrapper"
204
165
  }, /*#__PURE__*/React.createElement(Typography, {
@@ -227,112 +188,19 @@ var Body = function Body(_ref) {
227
188
  }, t("neetoMolecules.appSwitcher.noApps"))));
228
189
  };
229
190
 
230
- var Portal = function Portal(_ref) {
231
- var rootId = _ref.rootId,
232
- children = _ref.children;
233
- var target = useRef(null);
234
- useEffect(function () {
235
- var container = document.getElementById(rootId);
236
- if (!container) {
237
- container = document.createElement("div");
238
- container.setAttribute("id", rootId);
239
- document.body.appendChild(container);
240
- }
241
- container.appendChild(target.current);
242
- return function () {
243
- target.current.remove();
244
- if (container.childNodes.length === 0) {
245
- container.remove();
246
- }
247
- };
248
- }, [rootId]);
249
- if (!target.current) {
250
- target.current = document.createElement("div");
251
- }
252
- return /*#__PURE__*/createPortal(children, target.current);
253
- };
254
-
255
- var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handler) {
256
- useEffect(function () {
257
- var listener = function listener(event) {
258
- // Do nothing if clicking ref's element or descendent elements
259
- if (!insideRef.current || insideRef.current.contains(event.target)) {
260
- return;
261
- }
262
- if (outsideRef.current) {
263
- // If Outside ref exists, trigger the handler if it contains the event target.
264
- if (outsideRef.current.contains(event.target)) {
265
- handler(event);
266
- }
267
- return;
268
- }
269
- handler(event);
270
- };
271
- document.addEventListener("mousedown", listener);
272
- document.addEventListener("touchstart", listener);
273
- return function () {
274
- document.removeEventListener("mousedown", listener);
275
- document.removeEventListener("touchstart", listener);
276
- };
277
- }, [insideRef, outsideRef, handler]);
278
- };
279
-
280
- var AppSwitcher = function AppSwitcher(_ref) {
281
- var isOpen = _ref.isOpen,
282
- onClose = _ref.onClose,
283
- isSidebarCollapsed = _ref.isSidebarCollapsed;
284
- var paneWrapper = useRef(null);
285
- var backdropRef = useRef(null);
286
- useOnClickOutside(paneWrapper, backdropRef, onClose);
287
- useHotKeys("esc", onClose, {
288
- enabled: isOpen,
289
- mode: "global"
290
- });
291
- return /*#__PURE__*/React.createElement(Portal, {
292
- rootId: "neeto-ui-portal"
293
- }, /*#__PURE__*/React.createElement(CSSTransition, {
294
- appear: true,
295
- unmountOnExit: true,
296
- classNames: "neeto-molecules-app-switcher",
297
- "in": isOpen,
298
- timeout: 300
299
- }, /*#__PURE__*/React.createElement(Backdrop$1, {
300
- key: "switcher-backdrop",
301
- ref: backdropRef,
302
- className: classnames("neeto-molecules-app-switcher__backdrop", {
303
- "neeto-molecules-app-switcher__backdrop--collapsed": isSidebarCollapsed
304
- })
305
- }, /*#__PURE__*/React.createElement("div", {
191
+ var AppSwitcher = function AppSwitcher() {
192
+ return /*#__PURE__*/React.createElement("div", {
193
+ className: "neeto-molecules-app-switcher__wrapper",
306
194
  "data-cy": "switcher-wrapper",
307
195
  "data-testid": "switcher-wrapper",
308
- key: "switcher-wrapper",
309
- ref: paneWrapper,
310
- className: classnames("neeto-molecules-app-switcher__wrapper", {
311
- "neeto-molecules-app-switcher__wrapper--collapsed": isSidebarCollapsed
312
- })
313
- }, /*#__PURE__*/React.createElement(Body, {
314
- onClose: onClose
315
- })))));
196
+ key: "switcher-wrapper"
197
+ }, /*#__PURE__*/React.createElement(Body, null));
316
198
  };
317
199
 
318
- var Chevron = function Chevron(_ref) {
319
- var style = _ref.style;
320
- return /*#__PURE__*/React.createElement("svg", {
321
- height: "16",
322
- viewBox: "0 0 16 16",
323
- width: "16",
324
- style: style
325
- }, /*#__PURE__*/React.createElement("path", {
326
- d: "M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z",
327
- fill: "currentColor"
328
- }));
329
- };
330
-
331
- var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}";
200
+ var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:var(--neeto-molecules-sidebar-z-index-1)}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}";
332
201
  n(css,{});
333
202
 
334
- var AppSwitcherButton = function AppSwitcherButton(_ref) {
335
- var onAppSwitcherToggle = _ref.onAppSwitcherToggle;
203
+ var AppSwitcherButton = function AppSwitcherButton() {
336
204
  var _useTranslation = useTranslation(),
337
205
  t = _useTranslation.t;
338
206
  var _useState = useState(false),
@@ -343,19 +211,24 @@ var AppSwitcherButton = function AppSwitcherButton(_ref) {
343
211
  data = _useFetchNeetoApps.data,
344
212
  refetchNeetoApps = _useFetchNeetoApps.refetch,
345
213
  isStale = _useFetchNeetoApps.isStale;
346
- var handleAppSwitcherToggle = function handleAppSwitcherToggle(event) {
347
- if (!data) event.stopPropagation();else onAppSwitcherToggle();
348
- };
349
- return /*#__PURE__*/React.createElement("button", {
214
+ return /*#__PURE__*/React.createElement(Tooltip, {
215
+ interactive: true,
216
+ className: "neeto-molecules-app-switcher-popup-wrapper",
217
+ content: /*#__PURE__*/React.createElement(AppSwitcher, null),
218
+ disabled: !data,
219
+ hideOnClick: false,
220
+ interactiveDebounce: 20,
221
+ offset: [0, -70],
222
+ position: "right",
223
+ theme: "light"
224
+ }, /*#__PURE__*/React.createElement("button", {
350
225
  className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--app-switcher neeto-molecules-sidebar__link--button neeto-ui-flex neeto-ui-w-full neeto-ui-select-none neeto-ui-items-center neeto-ui-justify-start neeto-ui-shadow-none",
351
226
  "data-cy": "app-switcher-button",
352
227
  "data-testid": "app-switcher-button",
353
- onClick: handleAppSwitcherToggle,
354
228
  onMouseEnter: function onMouseEnter() {
355
- if (!hasHovered && isStale) {
356
- refetchNeetoApps();
357
- setHasHovered(true);
358
- }
229
+ if (hasHovered || !isStale) return;
230
+ refetchNeetoApps();
231
+ setHasHovered(true);
359
232
  }
360
233
  }, /*#__PURE__*/React.createElement("span", {
361
234
  className: "neeto-molecules-sidebar__link-icon neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center h-6 w-6"
@@ -368,7 +241,7 @@ var AppSwitcherButton = function AppSwitcherButton(_ref) {
368
241
  component: "span",
369
242
  style: "body2",
370
243
  weight: "normal"
371
- }, t("neetoMolecules.sidebar.productSwitcher")));
244
+ }, t("neetoMolecules.sidebar.productSwitcher"))));
372
245
  };
373
246
 
374
247
  var MY_PROFILE_URL = "/auth/profile/edit";
@@ -404,6 +277,7 @@ var DEFAULT_HELP_LINK_PROPS = {
404
277
  "data-cy": "help-link-keyboard-shortcut-button"
405
278
  }
406
279
  };
280
+ var NAVLINK_KEYS_TO_OMIT = ["Component", "component"];
407
281
 
408
282
  var isSubRouteActive = function isSubRouteActive(subRoute, location) {
409
283
  var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
@@ -422,6 +296,16 @@ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
422
296
  var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
423
297
  return "sidebarState-".concat(user);
424
298
  };
299
+ var filterByPermissions = curry(function (_ref) {
300
+ var permissions = _ref.permissions;
301
+ if (permissions) {
302
+ return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
303
+ }
304
+ return true;
305
+ });
306
+ var getInitialExpandedState = function getInitialExpandedState(items) {
307
+ return repeat(true, items.length);
308
+ };
425
309
 
426
310
  var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
427
311
  var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
@@ -551,7 +435,36 @@ function _defineProperty(obj, key, value) {
551
435
  return obj;
552
436
  }
553
437
 
554
- var _excluded$2 = ["onClick", "label", "icon"];
438
+ function _objectWithoutPropertiesLoose(source, excluded) {
439
+ if (source == null) return {};
440
+ var target = {};
441
+ var sourceKeys = Object.keys(source);
442
+ var key, i;
443
+ for (i = 0; i < sourceKeys.length; i++) {
444
+ key = sourceKeys[i];
445
+ if (excluded.indexOf(key) >= 0) continue;
446
+ target[key] = source[key];
447
+ }
448
+ return target;
449
+ }
450
+
451
+ function _objectWithoutProperties(source, excluded) {
452
+ if (source == null) return {};
453
+ var target = _objectWithoutPropertiesLoose(source, excluded);
454
+ var key, i;
455
+ if (Object.getOwnPropertySymbols) {
456
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
457
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
458
+ key = sourceSymbolKeys[i];
459
+ if (excluded.indexOf(key) >= 0) continue;
460
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
461
+ target[key] = source[key];
462
+ }
463
+ }
464
+ return target;
465
+ }
466
+
467
+ var _excluded$3 = ["onClick", "label", "icon"];
555
468
  function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
556
469
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
557
470
  var LinkSection = function LinkSection(_ref) {
@@ -563,7 +476,7 @@ var LinkSection = function LinkSection(_ref) {
563
476
  label = _ref2.label,
564
477
  _ref2$icon = _ref2.icon,
565
478
  icon = _ref2$icon === void 0 ? null : _ref2$icon,
566
- otherProps = _objectWithoutProperties(_ref2, _excluded$2);
479
+ otherProps = _objectWithoutProperties(_ref2, _excluded$3);
567
480
  return /*#__PURE__*/React.createElement("li", {
568
481
  className: "neeto-molecules-profile-sublist__item",
569
482
  key: idx
@@ -672,7 +585,7 @@ var HelpSection = function HelpSection(_ref, ref) {
672
585
  };
673
586
  var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
674
587
 
675
- var _excluded$1 = ["label"];
588
+ var _excluded$2 = ["label"];
676
589
  function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
677
590
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
678
591
  var HelpSectionMenu = function HelpSectionMenu(_ref) {
@@ -697,7 +610,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
697
610
  className: "neeto-molecules-help-sublist"
698
611
  }, helpLinks.map(function (_ref3, idx) {
699
612
  var label = _ref3.label,
700
- buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
613
+ buttonProps = _objectWithoutProperties(_ref3, _excluded$2);
701
614
  return /*#__PURE__*/React.createElement("li", {
702
615
  className: "neeto-molecules-help-sublist__item",
703
616
  key: idx
@@ -719,8 +632,7 @@ var Footer = function Footer(_ref) {
719
632
  helpLinkOverrides = _ref.helpLinkOverrides,
720
633
  profileInfoOverrides = _ref.profileInfoOverrides,
721
634
  _ref$showAppSwitcher = _ref.showAppSwitcher,
722
- showAppSwitcher = _ref$showAppSwitcher === void 0 ? false : _ref$showAppSwitcher,
723
- onAppSwitcherToggle = _ref.onAppSwitcherToggle;
635
+ showAppSwitcher = _ref$showAppSwitcher === void 0 ? false : _ref$showAppSwitcher;
724
636
  var _useState = useState(null),
725
637
  _useState2 = _slicedToArray(_useState, 2),
726
638
  changesCount = _useState2[0],
@@ -728,9 +640,8 @@ var Footer = function Footer(_ref) {
728
640
  useEffect(function () {
729
641
  var Nv = {
730
642
  onReceiveData: function onReceiveData(data) {
731
- if (data.unreadCount) {
732
- setChangesCount(data.unreadCount);
733
- }
643
+ if (!data.unreadCount) return;
644
+ setChangesCount(data.unreadCount);
734
645
  },
735
646
  onShow: function onShow() {
736
647
  setChangesCount(null);
@@ -754,9 +665,7 @@ var Footer = function Footer(_ref) {
754
665
  theme: "light"
755
666
  }, /*#__PURE__*/React.createElement(HelpSection$1, {
756
667
  changesCount: changesCount
757
- })), showAppSwitcher && /*#__PURE__*/React.createElement(AppSwitcherButton, {
758
- onAppSwitcherToggle: onAppSwitcherToggle
759
- }), /*#__PURE__*/React.createElement(ProfileButton, {
668
+ })), showAppSwitcher && /*#__PURE__*/React.createElement(AppSwitcherButton, null), /*#__PURE__*/React.createElement(ProfileButton, {
760
669
  extraTopLinks: extraTopLinks,
761
670
  profileInfoOverrides: profileInfoOverrides
762
671
  }));
@@ -790,23 +699,94 @@ var Header = function Header(_ref) {
790
699
  };
791
700
  var Header$1 = /*#__PURE__*/React.memo(Header);
792
701
 
793
- var _excluded = ["label", "to", "icon", "items"],
794
- _excluded2 = ["label", "to", "count", "dataCy"];
702
+ var _excluded$1 = ["label", "to", "count", "dataCy", "items"];
703
+ var Items = function Items(_ref) {
704
+ var items = _ref.items,
705
+ _ref$level = _ref.level,
706
+ level = _ref$level === void 0 ? 0 : _ref$level;
707
+ var _useState = useState(getInitialExpandedState(items)),
708
+ _useState2 = _slicedToArray(_useState, 2),
709
+ areItemsExpanded = _useState2[0],
710
+ setAreItemsExpanded = _useState2[1];
711
+ var handleNavLinkClick = function handleNavLinkClick(_ref2) {
712
+ var event = _ref2.event,
713
+ index = _ref2.index;
714
+ event.preventDefault();
715
+ setAreItemsExpanded(function (previousExpandedState) {
716
+ var newExpandedState = _toConsumableArray(previousExpandedState);
717
+ var oldIsExpandedOfCurrentIndex = newExpandedState[index];
718
+ newExpandedState[index] = not(oldIsExpandedOfCurrentIndex);
719
+ return newExpandedState;
720
+ });
721
+ };
722
+ return /*#__PURE__*/React.createElement("div", {
723
+ className: "neeto-molecules-sidebar__sublink-wrapper ml-".concat(level * 2),
724
+ "data-cy": "sidebar-sub-link-wrapper"
725
+ }, items.filter(filterByPermissions).map(function (_ref3, index) {
726
+ var label = _ref3.label,
727
+ to = _ref3.to,
728
+ count = _ref3.count,
729
+ dataCy = _ref3.dataCy,
730
+ subItems = _ref3.items,
731
+ otherProps = _objectWithoutProperties(_ref3, _excluded$1);
732
+ return /*#__PURE__*/React.createElement(React.Fragment, {
733
+ key: index
734
+ }, /*#__PURE__*/React.createElement(NavLink, _extends({
735
+ to: to,
736
+ activeClassName: "active",
737
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-select-none neeto-molecules-sidebar__sublink",
738
+ "data-cy": "".concat(dataCy, "-sub-link"),
739
+ isActive: function isActive() {
740
+ return isSubRouteActive(to, location);
741
+ },
742
+ key: index
743
+ }, omit(NAVLINK_KEYS_TO_OMIT, otherProps)), /*#__PURE__*/React.createElement(Typography, {
744
+ className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
745
+ component: "span",
746
+ "data-cy": "".concat(dataCy, "-sub-link-label"),
747
+ style: "body2"
748
+ }, label), /*#__PURE__*/React.createElement(Typography, {
749
+ className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
750
+ component: "span",
751
+ "data-cy": "".concat(dataCy, "-sub-link-count"),
752
+ style: "body2"
753
+ }, count > 999 ? "999+" : count), isPresent(subItems) && /*#__PURE__*/React.createElement("span", {
754
+ className: classnames("neeto-molecules-sidebar__link-icon", {
755
+ "neeto-molecules-sidebar__link-icon--rotate": areItemsExpanded[index]
756
+ }),
757
+ onClick: function onClick(event) {
758
+ return handleNavLinkClick({
759
+ event: event,
760
+ index: index
761
+ });
762
+ }
763
+ }, /*#__PURE__*/React.createElement(Down, {
764
+ size: 16
765
+ }))), isPresent(subItems) && areItemsExpanded[index] && /*#__PURE__*/React.createElement(Items, {
766
+ items: subItems,
767
+ level: inc(level)
768
+ }));
769
+ }));
770
+ };
771
+
772
+ var _excluded = ["label", "to", "icon", "items"];
795
773
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
796
774
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
797
775
  var Links = function Links(_ref) {
798
776
  var navLinks = _ref.navLinks;
799
- var location = useLocation();
800
777
  var _useState = useState(true),
801
778
  _useState2 = _slicedToArray(_useState, 2),
802
779
  isActiveLinkExpanded = _useState2[0],
803
780
  setIsActiveLinkExpanded = _useState2[1];
804
- var filterByPermissions = curry(function (_ref2) {
805
- var permissions = _ref2.permissions;
806
- if (permissions) {
807
- return is(Array, permissions) ? permissions.some(includes(__, globalProps$1.permissions)) : globalProps$1.permissions.includes(permissions);
808
- }
809
- return true;
781
+ var location = useLocation();
782
+ var sortedNavLinks = navLinks.filter(filterByPermissions).sort(function (_ref2, _ref3) {
783
+ var toA = _ref2.to;
784
+ var toB = _ref3.to;
785
+ var urlA = new URL(toA, window.location.href);
786
+ var urlB = new URL(toB, window.location.href);
787
+ var isActiveA = location.pathname.startsWith(urlA.pathname);
788
+ var isActiveB = location.pathname.startsWith(urlB.pathname);
789
+ return isActiveB - isActiveA;
810
790
  });
811
791
  var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
812
792
  if (isNotPresent(items)) return;
@@ -819,12 +799,12 @@ var Links = function Links(_ref) {
819
799
  };
820
800
  return /*#__PURE__*/React.createElement("div", {
821
801
  className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
822
- }, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
823
- var label = _ref3.label,
824
- to = _ref3.to,
825
- icon = _ref3.icon,
826
- items = _ref3.items,
827
- otherProps = _objectWithoutProperties(_ref3, _excluded);
802
+ }, sortedNavLinks.map(function (_ref4, index) {
803
+ var label = _ref4.label,
804
+ to = _ref4.to,
805
+ icon = _ref4.icon,
806
+ items = _ref4.items,
807
+ otherProps = _objectWithoutProperties(_ref4, _excluded);
828
808
  var IconSVG = icon;
829
809
  var url = new URL(to, window.location.href);
830
810
  var isActive = function isActive() {
@@ -832,7 +812,7 @@ var Links = function Links(_ref) {
832
812
  };
833
813
  var isMenuExpanded = isActive() && isActiveLinkExpanded;
834
814
  return /*#__PURE__*/React.createElement(React.Fragment, {
835
- key: mainIndex
815
+ key: index
836
816
  }, /*#__PURE__*/React.createElement(NavLink, _extends({
837
817
  activeClassName: "active",
838
818
  className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
@@ -856,36 +836,9 @@ var Links = function Links(_ref) {
856
836
  })
857
837
  }, /*#__PURE__*/React.createElement(Down, {
858
838
  size: 16
859
- }))), items && isMenuExpanded && /*#__PURE__*/React.createElement("div", {
860
- className: "neeto-molecules-sidebar__sublink-wrapper",
861
- "data-cy": "sidebar-sub-link-wrapper"
862
- }, items.filter(filterByPermissions).map(function (_ref4, subIndex) {
863
- var subLabel = _ref4.label,
864
- subRoute = _ref4.to,
865
- count = _ref4.count,
866
- dataCy = _ref4.dataCy,
867
- otherProps = _objectWithoutProperties(_ref4, _excluded2);
868
- return /*#__PURE__*/React.createElement(NavLink, _extends({
869
- activeClassName: "active",
870
- className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
871
- "data-cy": "".concat(dataCy, "-sub-link"),
872
- isActive: function isActive() {
873
- return isSubRouteActive(subRoute, location);
874
- },
875
- key: subIndex,
876
- to: subRoute
877
- }, otherProps), /*#__PURE__*/React.createElement(Typography, {
878
- className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
879
- component: "span",
880
- "data-cy": "".concat(dataCy, "-sub-link-label"),
881
- style: "body2"
882
- }, subLabel), /*#__PURE__*/React.createElement(Typography, {
883
- className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
884
- component: "span",
885
- "data-cy": "".concat(dataCy, "-sub-link-count"),
886
- style: "body2"
887
- }, count > 999 ? "999+" : count));
888
- })));
839
+ }))), items && isMenuExpanded && /*#__PURE__*/React.createElement(Items, {
840
+ items: items
841
+ }));
889
842
  }));
890
843
  };
891
844
 
@@ -916,7 +869,7 @@ var Sidebar = function Sidebar(_ref) {
916
869
  // eslint-disable-next-line react-hooks/exhaustive-deps
917
870
  }, [location]);
918
871
  var productName = globalProps$1.appName.substr(5).toLowerCase();
919
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
872
+ return /*#__PURE__*/React.createElement("div", {
920
873
  "data-testid": "sidebar-container",
921
874
  className: classnames("neeto-molecules-sidebar__wrapper", {
922
875
  "neeto-molecules-sidebar__wrapper--collapsed": isSidebarCollapsed
@@ -933,10 +886,7 @@ var Sidebar = function Sidebar(_ref) {
933
886
  extraTopLinks: extraTopLinks,
934
887
  helpLinkOverrides: helpLinkOverrides,
935
888
  profileInfoOverrides: profileInfoOverrides,
936
- showAppSwitcher: showAppSwitcher,
937
- onAppSwitcherToggle: function onAppSwitcherToggle() {
938
- return setIsAppSwitcherOpen(not);
939
- }
889
+ showAppSwitcher: showAppSwitcher
940
890
  })), /*#__PURE__*/React.createElement(Button, {
941
891
  className: "neeto-molecules-sidebar__toggler",
942
892
  "data-cy": "neeto-molecules-sidebar-toggler",
@@ -956,12 +906,6 @@ var Sidebar = function Sidebar(_ref) {
956
906
  onClick: function onClick() {
957
907
  setIsSidebarCollapsed(!isSidebarCollapsed);
958
908
  }
959
- })), showAppSwitcher && /*#__PURE__*/React.createElement(AppSwitcher, {
960
- isSidebarCollapsed: isSidebarCollapsed,
961
- isOpen: isAppSwitcherOpen,
962
- onClose: function onClose() {
963
- return setIsAppSwitcherOpen(false);
964
- }
965
909
  }));
966
910
  };
967
911