@bigbinary/neeto-molecules 1.1.78 → 1.2.0-beta1
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 +66 -52
- package/dist/Breadcrumbs.js +16 -19
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BrowserSupport.js +41 -138
- package/dist/BrowserSupport.js.map +1 -1
- package/dist/Builder.js +207 -364
- package/dist/Builder.js.map +1 -1
- package/dist/CalendarView.js +40 -288
- package/dist/CalendarView.js.map +1 -1
- package/dist/Chevron-c64ff676.js +190 -0
- package/dist/Chevron-c64ff676.js.map +1 -0
- package/dist/Codeblock.js +26 -209
- package/dist/Codeblock.js.map +1 -1
- package/dist/Columns.js +16 -240
- package/dist/Columns.js.map +1 -1
- package/dist/ConfigurePageSidebar.js +97 -0
- package/dist/ConfigurePageSidebar.js.map +1 -0
- package/dist/ConfirmationModal.js +10 -10
- package/dist/ConfirmationModal.js.map +1 -1
- package/dist/Container.js +5 -1187
- package/dist/Container.js.map +1 -1
- package/dist/CopyToClipboardButton.js +26 -155
- package/dist/CopyToClipboardButton.js.map +1 -1
- package/dist/Currency.js +912 -0
- package/dist/Currency.js.map +1 -0
- package/dist/CustomDomain.js +37 -633
- package/dist/CustomDomain.js.map +1 -1
- package/dist/CustomDomainDashboard.js +69 -2192
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/DateFormat.js +6 -20
- package/dist/DateFormat.js.map +1 -1
- package/dist/DateRangeFilter.js +19 -75
- package/dist/DateRangeFilter.js.map +1 -1
- package/dist/DeleteArchiveModal.js +86 -0
- package/dist/DeleteArchiveModal.js.map +1 -0
- package/dist/DocumentEditor.js +43 -133
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/DownloadMobileAppCallout.js +4 -4
- package/dist/DownloadMobileAppCallout.js.map +1 -1
- package/dist/DynamicVariables.js +12 -95
- package/dist/DynamicVariables.js.map +1 -1
- package/dist/EmailForm.js +79 -1741
- package/dist/EmailForm.js.map +1 -1
- package/dist/EmailPreview.js +32 -1213
- package/dist/EmailPreview.js.map +1 -1
- package/dist/EmojiPicker.js +67 -0
- package/dist/EmojiPicker.js.map +1 -0
- package/dist/EmojiReactions.js +69 -0
- package/dist/EmojiReactions.js.map +1 -0
- package/dist/ErrorPage.js +17 -26
- package/dist/ErrorPage.js.map +1 -1
- package/dist/FloatingActionMenu.js +646 -0
- package/dist/FloatingActionMenu.js.map +1 -0
- package/dist/Header.js +45 -117
- package/dist/Header.js.map +1 -1
- package/dist/HelpPopover.js +73 -0
- package/dist/HelpPopover.js.map +1 -0
- package/dist/IconPicker.js +36 -129
- package/dist/IconPicker.js.map +1 -1
- package/dist/ImageWithFallback.js +8 -144
- package/dist/ImageWithFallback.js.map +1 -1
- package/dist/InlineInput.js +22 -526
- package/dist/InlineInput.js.map +1 -1
- package/dist/Insights.js +304 -0
- package/dist/Insights.js.map +1 -0
- package/dist/IntegrationCard.js +42 -226
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IntegrationDisconnectAlert.js +6 -48
- package/dist/IntegrationDisconnectAlert.js.map +1 -1
- package/dist/IntegrationWalkthroughModal.js +10 -10
- package/dist/IntegrationWalkthroughModal.js.map +1 -1
- package/dist/IpRestriction.js +74 -221
- package/dist/IpRestriction.js.map +1 -1
- package/dist/KeyboardShortcuts.js +38 -128
- package/dist/KeyboardShortcuts.js.map +1 -1
- package/dist/LoginPage.js +39 -459
- package/dist/LoginPage.js.map +1 -1
- package/dist/MadeWith.js +32 -0
- package/dist/MadeWith.js.map +1 -0
- package/dist/MenuBar.js +34 -1295
- package/dist/MenuBar.js.map +1 -1
- package/dist/Metadata.js +65 -86
- package/dist/Metadata.js.map +1 -1
- package/dist/MoreDropdown.js +48 -107
- package/dist/MoreDropdown.js.map +1 -1
- package/dist/NavigationHeader.js +51 -730
- package/dist/NavigationHeader.js.map +1 -1
- package/dist/NeetoWidget.js +148 -316
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/Onboarding.js +343 -0
- package/dist/Onboarding.js.map +1 -0
- package/dist/OptionFields.js +507 -0
- package/dist/OptionFields.js.map +1 -0
- package/dist/PageLoader.js +5 -48
- package/dist/PageLoader.js.map +1 -1
- package/dist/PhoneNumber.js +122 -201
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/ProductEmbed.js +767 -0
- package/dist/ProductEmbed.js.map +1 -0
- package/dist/PublishBlock.js +19 -60
- package/dist/PublishBlock.js.map +1 -1
- package/dist/PublishYourItem.js +52 -0
- package/dist/PublishYourItem.js.map +1 -0
- package/dist/Rename.js +127 -394
- package/dist/Rename.js.map +1 -1
- package/dist/ResponsiveDevicePicker.js +7 -143
- package/dist/ResponsiveDevicePicker.js.map +1 -1
- package/dist/Schedule.js +131 -365
- package/dist/Schedule.js.map +1 -1
- package/dist/Scrollable.js +6 -89
- package/dist/Scrollable.js.map +1 -1
- package/dist/Search.js +54 -157
- package/dist/Search.js.map +1 -1
- package/dist/Security.js +72 -1567
- package/dist/Security.js.map +1 -1
- package/dist/SendToFields.js +51 -133
- package/dist/SendToFields.js.map +1 -1
- package/dist/Settings.js +141 -412
- package/dist/Settings.js.map +1 -1
- package/dist/ShareRecordingPane.js +189 -0
- package/dist/ShareRecordingPane.js.map +1 -0
- package/dist/ShareViaEmail.js +126 -551
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/ShareViaLink.js +127 -345
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/Sidebar.js +161 -758
- package/dist/Sidebar.js.map +1 -1
- package/dist/SubHeader.js +63 -108
- package/dist/SubHeader.js.map +1 -1
- package/dist/SuffixedInput.js +105 -0
- package/dist/SuffixedInput.js.map +1 -0
- package/dist/TableWrapper.js +8 -9
- package/dist/TableWrapper.js.map +1 -1
- package/dist/Taxonomy.js +112 -1774
- package/dist/Taxonomy.js.map +1 -1
- package/dist/ThemeSidebar.js +159 -776
- package/dist/ThemeSidebar.js.map +1 -1
- package/dist/TimeFormat.js +8 -44
- package/dist/TimeFormat.js.map +1 -1
- package/dist/TimezoneMismatchModal.js +49 -84
- package/dist/TimezoneMismatchModal.js.map +1 -1
- package/dist/ToggleFeatureCard.js +46 -169
- package/dist/ToggleFeatureCard.js.map +1 -1
- package/dist/cjs/Breadcrumbs.js +49 -0
- package/dist/cjs/Breadcrumbs.js.map +1 -0
- package/dist/cjs/BrowserSupport.js +329 -0
- package/dist/cjs/BrowserSupport.js.map +1 -0
- package/dist/cjs/Builder.js +556 -0
- package/dist/cjs/Builder.js.map +1 -0
- package/dist/cjs/CalendarView.js +299 -0
- package/dist/cjs/CalendarView.js.map +1 -0
- package/dist/cjs/Chevron-8a4ed9cd.js +203 -0
- package/dist/cjs/Chevron-8a4ed9cd.js.map +1 -0
- package/dist/cjs/Codeblock.js +58 -0
- package/dist/cjs/Codeblock.js.map +1 -0
- package/dist/cjs/Columns.js +31 -0
- package/dist/cjs/Columns.js.map +1 -0
- package/dist/cjs/ConfigurePageSidebar.js +104 -0
- package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
- package/dist/cjs/ConfirmationModal.js +120 -0
- package/dist/cjs/ConfirmationModal.js.map +1 -0
- package/dist/cjs/Container.js +36 -0
- package/dist/cjs/Container.js.map +1 -0
- package/dist/cjs/CopyToClipboardButton.js +86 -0
- package/dist/cjs/CopyToClipboardButton.js.map +1 -0
- package/dist/cjs/Currency.js +921 -0
- package/dist/cjs/Currency.js.map +1 -0
- package/dist/cjs/CustomDomain.js +125 -0
- package/dist/cjs/CustomDomain.js.map +1 -0
- package/dist/cjs/CustomDomainDashboard.js +200 -0
- package/dist/cjs/CustomDomainDashboard.js.map +1 -0
- package/dist/cjs/DateFormat.js +40 -0
- package/dist/cjs/DateFormat.js.map +1 -0
- package/dist/cjs/DateRangeFilter.js +180 -0
- package/dist/cjs/DateRangeFilter.js.map +1 -0
- package/dist/cjs/DeleteArchiveModal.js +92 -0
- package/dist/cjs/DeleteArchiveModal.js.map +1 -0
- package/dist/cjs/DocumentEditor.js +194 -0
- package/dist/cjs/DocumentEditor.js.map +1 -0
- package/dist/cjs/DownloadMobileAppCallout.js +45 -0
- package/dist/cjs/DownloadMobileAppCallout.js.map +1 -0
- package/dist/cjs/DynamicVariables.js +106 -0
- package/dist/cjs/DynamicVariables.js.map +1 -0
- package/dist/cjs/EmailForm.js +395 -0
- package/dist/cjs/EmailForm.js.map +1 -0
- package/dist/cjs/EmailPreview.js +139 -0
- package/dist/cjs/EmailPreview.js.map +1 -0
- package/dist/cjs/EmojiPicker.js +75 -0
- package/dist/cjs/EmojiPicker.js.map +1 -0
- package/dist/cjs/EmojiReactions.js +76 -0
- package/dist/cjs/EmojiReactions.js.map +1 -0
- package/dist/cjs/ErrorPage.js +179 -0
- package/dist/cjs/ErrorPage.js.map +1 -0
- package/dist/cjs/FloatingActionMenu.js +675 -0
- package/dist/cjs/FloatingActionMenu.js.map +1 -0
- package/dist/cjs/Header.js +104 -0
- package/dist/cjs/Header.js.map +1 -0
- package/dist/cjs/HelpPopover.js +80 -0
- package/dist/cjs/HelpPopover.js.map +1 -0
- package/dist/cjs/IconPicker.js +228 -0
- package/dist/cjs/IconPicker.js.map +1 -0
- package/dist/cjs/ImageWithFallback.js +52 -0
- package/dist/cjs/ImageWithFallback.js.map +1 -0
- package/dist/cjs/InlineInput.js +233 -0
- package/dist/cjs/InlineInput.js.map +1 -0
- package/dist/cjs/Insights.js +310 -0
- package/dist/cjs/Insights.js.map +1 -0
- package/dist/cjs/IntegrationCard.js +208 -0
- package/dist/cjs/IntegrationCard.js.map +1 -0
- package/dist/cjs/IntegrationDisconnectAlert.js +48 -0
- package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/cjs/IntegrationWalkthroughModal.js +51 -0
- package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/cjs/IpRestriction.js +525 -0
- package/dist/cjs/IpRestriction.js.map +1 -0
- package/dist/cjs/KeyboardShortcuts.js +282 -0
- package/dist/cjs/KeyboardShortcuts.js.map +1 -0
- package/dist/cjs/LoginPage.js +198 -0
- package/dist/cjs/LoginPage.js.map +1 -0
- package/dist/cjs/MadeWith.js +38 -0
- package/dist/cjs/MadeWith.js.map +1 -0
- package/dist/cjs/MenuBar.js +208 -0
- package/dist/cjs/MenuBar.js.map +1 -0
- package/dist/cjs/Metadata.js +195 -0
- package/dist/cjs/Metadata.js.map +1 -0
- package/dist/cjs/MoreDropdown.js +152 -0
- package/dist/cjs/MoreDropdown.js.map +1 -0
- package/dist/cjs/NavigationHeader.js +177 -0
- package/dist/cjs/NavigationHeader.js.map +1 -0
- package/dist/cjs/NeetoWidget.js +912 -0
- package/dist/cjs/NeetoWidget.js.map +1 -0
- package/dist/cjs/Onboarding.js +357 -0
- package/dist/cjs/Onboarding.js.map +1 -0
- package/dist/cjs/OptionFields.js +514 -0
- package/dist/cjs/OptionFields.js.map +1 -0
- package/dist/cjs/PageLoader.js +116 -0
- package/dist/cjs/PageLoader.js.map +1 -0
- package/dist/cjs/PhoneNumber.js +363 -0
- package/dist/cjs/PhoneNumber.js.map +1 -0
- package/dist/cjs/ProductEmbed.js +774 -0
- package/dist/cjs/ProductEmbed.js.map +1 -0
- package/dist/cjs/PublishBlock.js +125 -0
- package/dist/cjs/PublishBlock.js.map +1 -0
- package/dist/cjs/PublishYourItem.js +59 -0
- package/dist/cjs/PublishYourItem.js.map +1 -0
- package/dist/cjs/Rename.js +350 -0
- package/dist/cjs/Rename.js.map +1 -0
- package/dist/cjs/ResponsiveDevicePicker.js +64 -0
- package/dist/cjs/ResponsiveDevicePicker.js.map +1 -0
- package/dist/cjs/Schedule.js +889 -0
- package/dist/cjs/Schedule.js.map +1 -0
- package/dist/cjs/Scrollable.js +46 -0
- package/dist/cjs/Scrollable.js.map +1 -0
- package/dist/cjs/Search.js +117 -0
- package/dist/cjs/Search.js.map +1 -0
- package/dist/cjs/Security.js +376 -0
- package/dist/cjs/Security.js.map +1 -0
- package/dist/cjs/SendToFields.js +272 -0
- package/dist/cjs/SendToFields.js.map +1 -0
- package/dist/cjs/Settings.js +214 -0
- package/dist/cjs/Settings.js.map +1 -0
- package/dist/cjs/ShareRecordingPane.js +195 -0
- package/dist/cjs/ShareRecordingPane.js.map +1 -0
- package/dist/cjs/ShareViaEmail.js +348 -0
- package/dist/cjs/ShareViaEmail.js.map +1 -0
- package/dist/cjs/ShareViaLink.js +507 -0
- package/dist/cjs/ShareViaLink.js.map +1 -0
- package/dist/cjs/Sidebar.js +288 -0
- package/dist/cjs/Sidebar.js.map +1 -0
- package/dist/cjs/SubHeader.js +178 -0
- package/dist/cjs/SubHeader.js.map +1 -0
- package/dist/cjs/SuffixedInput.js +111 -0
- package/dist/cjs/SuffixedInput.js.map +1 -0
- package/dist/cjs/TableWrapper.js +32 -0
- package/dist/cjs/TableWrapper.js.map +1 -0
- package/dist/cjs/Taxonomy.js +442 -0
- package/dist/cjs/Taxonomy.js.map +1 -0
- package/dist/cjs/ThemeSidebar.js +1436 -0
- package/dist/cjs/ThemeSidebar.js.map +1 -0
- package/dist/cjs/TimeFormat.js +15 -0
- package/dist/cjs/TimeFormat.js.map +1 -0
- package/dist/cjs/TimezoneMismatchModal.js +143 -0
- package/dist/cjs/TimezoneMismatchModal.js.map +1 -0
- package/dist/cjs/ToggleFeatureCard.js +209 -0
- package/dist/cjs/ToggleFeatureCard.js.map +1 -0
- package/dist/cjs/defineProperty-886ed289.js +47 -0
- package/dist/cjs/defineProperty-886ed289.js.map +1 -0
- package/dist/cjs/extends-1b35a664.js +19 -0
- package/dist/cjs/extends-1b35a664.js.map +1 -0
- package/dist/cjs/index-00fdb8c2.js +542 -0
- package/dist/cjs/index-00fdb8c2.js.map +1 -0
- package/dist/cjs/index-248c4f4c.js +1186 -0
- package/dist/cjs/index-248c4f4c.js.map +1 -0
- package/dist/cjs/index-c55ad2bc.js +375 -0
- package/dist/cjs/index-c55ad2bc.js.map +1 -0
- package/dist/cjs/inject-css-80a5faa3.js +6 -0
- package/dist/cjs/inject-css-80a5faa3.js.map +1 -0
- package/dist/cjs/objectWithoutProperties-2fed2d7d.js +33 -0
- package/dist/cjs/objectWithoutProperties-2fed2d7d.js.map +1 -0
- package/dist/cjs/slicedToArray-f320d9e7.js +61 -0
- package/dist/cjs/slicedToArray-f320d9e7.js.map +1 -0
- package/dist/cjs/toConsumableArray-9abb3858.js +22 -0
- package/dist/cjs/toConsumableArray-9abb3858.js.map +1 -0
- package/dist/cjs/useColumns-a1c3668f.js +271 -0
- package/dist/cjs/useColumns-a1c3668f.js.map +1 -0
- package/dist/defineProperty-549061a7.js +43 -0
- package/dist/defineProperty-549061a7.js.map +1 -0
- package/dist/extends-093996c9.js +17 -0
- package/dist/extends-093996c9.js.map +1 -0
- package/dist/index-90c89467.js +509 -0
- package/dist/index-90c89467.js.map +1 -0
- package/dist/index-9720867c.js +372 -0
- package/dist/index-9720867c.js.map +1 -0
- package/dist/index-e5588516.js +1184 -0
- package/dist/index-e5588516.js.map +1 -0
- package/dist/inject-css-c86de496.js +4 -0
- package/dist/inject-css-c86de496.js.map +1 -0
- package/dist/objectWithoutProperties-a0edb288.js +31 -0
- package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
- package/dist/slicedToArray-b4278ecd.js +57 -0
- package/dist/slicedToArray-b4278ecd.js.map +1 -0
- package/dist/toConsumableArray-1cc38429.js +20 -0
- package/dist/toConsumableArray-1cc38429.js.map +1 -0
- package/dist/useColumns-d17d1f72.js +258 -0
- package/dist/useColumns-d17d1f72.js.map +1 -0
- package/package.json +29 -17
- package/src/translations/de.json +7 -0
- package/src/translations/en.json +191 -31
- package/src/translations/es.json +7 -0
- package/src/translations/fr.json +7 -0
- package/src/translations/nl.json +7 -0
- package/src/translations/pl.json +7 -0
- package/src/translations/pt.json +7 -0
- package/types/Breadcrumbs.d.ts +1 -0
- package/types/Builder.d.ts +61 -12
- package/types/Columns.d.ts +112 -5
- package/types/ConfigurePageSidebar.d.ts +43 -0
- package/types/CopyToClipboardButton.d.ts +3 -0
- package/types/Currency.d.ts +48 -0
- package/types/CustomDomain.d.ts +2 -0
- package/types/CustomDomainDashboard.d.ts +14 -0
- package/types/DateRangeFilter.d.ts +2 -0
- package/types/DeleteArchiveModal.d.ts +60 -0
- package/types/EmailForm.d.ts +1 -1
- package/types/EmojiPicker.d.ts +33 -0
- package/types/EmojiReactions.d.ts +60 -0
- package/types/ErrorPage.d.ts +1 -0
- package/types/FloatingActionMenu.d.ts +56 -0
- package/types/Header.d.ts +2 -1
- package/types/HelpPopover.d.ts +42 -0
- package/types/Insights.d.ts +108 -0
- package/types/IntegrationCard.d.ts +2 -0
- package/types/KeyboardShortcuts.d.ts +2 -2
- package/types/MadeWith.d.ts +16 -0
- package/types/MoreDropdown.d.ts +4 -1
- package/types/NavigationHeader.d.ts +3 -1
- package/types/Onboarding.d.ts +63 -0
- package/types/OptionFields.d.ts +63 -0
- package/types/PhoneNumber.d.ts +6 -2
- package/types/ProductEmbed.d.ts +43 -0
- package/types/Rename.d.ts +4 -1
- package/types/Schedule.d.ts +2 -0
- package/types/Search.d.ts +2 -0
- package/types/Settings.d.ts +13 -10
- package/types/ShareRecordingPane.d.ts +50 -0
- package/types/ShareViaLink.d.ts +15 -4
- package/types/Sidebar.d.ts +16 -32
- package/types/SubHeader.d.ts +0 -1
- package/types/SuffixedInput.d.ts +43 -0
- package/types/ToggleFeatureCard.d.ts +8 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { _ as _extends } from './extends-093996c9.js';
|
|
2
|
+
import { _ as _defineProperty } from './defineProperty-549061a7.js';
|
|
3
|
+
import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import { hyphenize } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
7
|
+
import { Left } from '@bigbinary/neeto-icons';
|
|
8
|
+
import { Typography } from '@bigbinary/neetoui';
|
|
9
|
+
import { curry, is, includes, __, all, equals, omit } from 'ramda';
|
|
10
|
+
import { isNotEmpty, hyphenate, isPresent } from '@bigbinary/neeto-cist';
|
|
11
|
+
import { Segments } from '@bigbinary/neeto-filters-frontend';
|
|
12
|
+
import { useNavigationCheckpoints } from '@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint';
|
|
13
|
+
import { NavLink } from 'react-router-dom';
|
|
14
|
+
import { n } from './inject-css-c86de496.js';
|
|
15
|
+
|
|
16
|
+
var _excluded$1 = ["checkpointKey", "to", "children"];
|
|
17
|
+
var CheckPointNavLinks = function CheckPointNavLinks(_ref) {
|
|
18
|
+
var checkpointKey = _ref.checkpointKey,
|
|
19
|
+
to = _ref.to,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
others = _objectWithoutProperties(_ref, _excluded$1);
|
|
22
|
+
var _useNavigationCheckpo = useNavigationCheckpoints(checkpointKey),
|
|
23
|
+
checkpoint = _useNavigationCheckpo[checkpointKey];
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(NavLink, _extends({
|
|
25
|
+
to: checkpoint || to
|
|
26
|
+
}, others, {
|
|
27
|
+
key: to
|
|
28
|
+
}), children);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var SUB_LINK_TYPES = {
|
|
32
|
+
SYSTEM_VIEW: "system_view",
|
|
33
|
+
SEGMENTS: "segments"
|
|
34
|
+
};
|
|
35
|
+
var SELECTED_NAV_LINK_ROUTE_STORAGE_KEY = "selectedNavLinkRoute";
|
|
36
|
+
|
|
37
|
+
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
38
|
+
var currentBrowserUrl = new URL(location.pathname + location.search + location.hash, window.location.origin);
|
|
39
|
+
var targetUrl = new URL(subRoute, window.location.origin);
|
|
40
|
+
var targetSearchParams = targetUrl.searchParams;
|
|
41
|
+
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
42
|
+
return all(function (key) {
|
|
43
|
+
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
44
|
+
}, targetSearchKeys) && equals(currentBrowserUrl.pathname, targetUrl.pathname);
|
|
45
|
+
};
|
|
46
|
+
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
47
|
+
var _globalProps$user, _globalProps$user2;
|
|
48
|
+
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);
|
|
49
|
+
return "sidebarState-".concat(user);
|
|
50
|
+
};
|
|
51
|
+
var filterByPermissions = curry(function (_ref) {
|
|
52
|
+
var permissions = _ref.permissions;
|
|
53
|
+
if (permissions && isNotEmpty(permissions)) {
|
|
54
|
+
return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var SubLink = function SubLink(_ref) {
|
|
60
|
+
var to = _ref.to,
|
|
61
|
+
label = _ref.label,
|
|
62
|
+
_ref$type = _ref.type,
|
|
63
|
+
type = _ref$type === void 0 ? SUB_LINK_TYPES.SYSTEM_VIEW : _ref$type,
|
|
64
|
+
count = _ref.count,
|
|
65
|
+
isSectionHeader = _ref.isSectionHeader,
|
|
66
|
+
isCountsLoading = _ref.isCountsLoading,
|
|
67
|
+
dataCy = _ref["data-cy"],
|
|
68
|
+
_ref$entity = _ref.entity,
|
|
69
|
+
entity = _ref$entity === void 0 ? "" : _ref$entity,
|
|
70
|
+
_ref$columns = _ref.columns,
|
|
71
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns;
|
|
72
|
+
if (type === SUB_LINK_TYPES.SEGMENTS) {
|
|
73
|
+
return /*#__PURE__*/React__default.createElement(Segments, {
|
|
74
|
+
columns: columns,
|
|
75
|
+
entity: entity,
|
|
76
|
+
isIndependent: false
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
var dataCyPrefix = dataCy || hyphenate(label);
|
|
80
|
+
var renderCount = function renderCount(count) {
|
|
81
|
+
return count > 999 ? "999+" : count;
|
|
82
|
+
};
|
|
83
|
+
return /*#__PURE__*/React__default.createElement(CheckPointNavLinks, {
|
|
84
|
+
to: to,
|
|
85
|
+
activeClassName: "active",
|
|
86
|
+
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
87
|
+
"data-cy": "".concat(dataCyPrefix, "-sub-link"),
|
|
88
|
+
isActive: function isActive() {
|
|
89
|
+
return !isSectionHeader && isSubRouteActive(to, location);
|
|
90
|
+
}
|
|
91
|
+
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
92
|
+
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
93
|
+
component: "span",
|
|
94
|
+
"data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
|
|
95
|
+
style: "body2"
|
|
96
|
+
}, label), /*#__PURE__*/React__default.createElement(Typography, {
|
|
97
|
+
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
98
|
+
component: "span",
|
|
99
|
+
"data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
|
|
100
|
+
style: "body2"
|
|
101
|
+
}, isCountsLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
102
|
+
className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
|
|
103
|
+
}) : renderCount(count)));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
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; }
|
|
107
|
+
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; }
|
|
108
|
+
var Items = function Items(_ref) {
|
|
109
|
+
var items = _ref.items,
|
|
110
|
+
_ref$isSettingsItems = _ref.isSettingsItems,
|
|
111
|
+
isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems,
|
|
112
|
+
isCountsLoading = _ref.isCountsLoading;
|
|
113
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
114
|
+
className: "neeto-molecules-sidebar__sublink-wrapper",
|
|
115
|
+
"data-cy": "sidebar-sub-link-wrapper"
|
|
116
|
+
}, items.filter(filterByPermissions).map(function (subItem, subIndex) {
|
|
117
|
+
var _subItem$to;
|
|
118
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
119
|
+
key: subIndex
|
|
120
|
+
}, /*#__PURE__*/React__default.createElement(SubLink, _extends({}, _objectSpread$1(_objectSpread$1({}, subItem), {}, {
|
|
121
|
+
isCountsLoading: isCountsLoading
|
|
122
|
+
}), {
|
|
123
|
+
isSectionHeader: isPresent(subItem.item),
|
|
124
|
+
to: (_subItem$to = subItem.to) !== null && _subItem$to !== void 0 ? _subItem$to : subItem.path
|
|
125
|
+
})), isSettingsItems && isPresent(subItem.items) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Items, {
|
|
126
|
+
isSettingsItems: isSettingsItems,
|
|
127
|
+
items: subItem.items
|
|
128
|
+
}), items.length - 1 !== subIndex && /*#__PURE__*/React__default.createElement("hr", {
|
|
129
|
+
className: "neeto-molecules-sidebar__separator"
|
|
130
|
+
})));
|
|
131
|
+
}));
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var _excluded = ["label", "items", "isConfigureNavLink"];
|
|
135
|
+
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; }
|
|
136
|
+
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; }
|
|
137
|
+
var SelectedLink = function SelectedLink(_ref) {
|
|
138
|
+
var _ref$navLink = _ref.navLink,
|
|
139
|
+
navLink = _ref$navLink === void 0 ? {
|
|
140
|
+
label: "",
|
|
141
|
+
items: [],
|
|
142
|
+
isConfigureNavLink: false
|
|
143
|
+
} : _ref$navLink,
|
|
144
|
+
handleGoBack = _ref.handleGoBack,
|
|
145
|
+
isConfigureSidebar = _ref.isConfigureSidebar;
|
|
146
|
+
var label = navLink.label,
|
|
147
|
+
items = navLink.items,
|
|
148
|
+
isConfigureNavLink = navLink.isConfigureNavLink,
|
|
149
|
+
otherProps = _objectWithoutProperties(navLink, _excluded);
|
|
150
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
151
|
+
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable",
|
|
152
|
+
"data-cy": "configure-nav-container"
|
|
153
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
154
|
+
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-molecules-sidebar__link neeto-ui-border-b hover:neeto-ui-bg-primary-100",
|
|
155
|
+
onClick: handleGoBack
|
|
156
|
+
}, _objectSpread({}, omit(["icon"], otherProps))), isConfigureNavLink && /*#__PURE__*/React__default.createElement("span", {
|
|
157
|
+
className: "neeto-molecules-sidebar__link-icon",
|
|
158
|
+
"data-cy": "".concat(hyphenize(label), "-go-back-button"),
|
|
159
|
+
"data-testid": "".concat(label, "-go-back-button")
|
|
160
|
+
}, /*#__PURE__*/React__default.createElement(Left, null)), /*#__PURE__*/React__default.createElement(Typography, {
|
|
161
|
+
component: "span",
|
|
162
|
+
style: "body1",
|
|
163
|
+
weight: "normal",
|
|
164
|
+
className: classnames("neeto-molecules-sidebar__link-label", _defineProperty({
|
|
165
|
+
"neeto-molecules-sidebar__configure-page-header": isConfigureNavLink
|
|
166
|
+
}, "pl-4", isConfigureSidebar))
|
|
167
|
+
}, label)), items && /*#__PURE__*/React__default.createElement(Items, {
|
|
168
|
+
items: items,
|
|
169
|
+
isSettingsItems: true
|
|
170
|
+
}));
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--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}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.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)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:240px;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper__configure-page .neeto-molecules-sidebar__toggler{right:20px}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper__configure-page .neeto-molecules-sidebar__toggler{right:auto}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-1)}.neeto-molecules-sidebar__wrapper__configure-page.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{top:70px}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-white));border-right:1px solid rgb(var(--neeto-ui-gray-200));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__separator{margin:3px auto 11px;width:90%}.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)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar__configure-page{border-right:1px solid rgb(var(--neeto-ui-gray-200));height:auto}@media screen and (max-width:768px){.neeto-molecules-sidebar__configure-page{height:100%}}.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__links{height:calc(100vh - 136px)!important}@media screen and (max-width:768px){.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__links{height:calc(100vh - 80px)!important}}.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__link span{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__toggler{display:none}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:36px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-black));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:color .3s,background-color .3s;width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0}.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{--neeto-ui-text-body2:15px;flex-grow:1;text-align:left}@media screen and (min-width:1536px){.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{--neeto-ui-text-body2:16px}}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-100));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-primary-100));color:rgb(var(--neeto-ui-primary-800));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-black))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{padding:4px 0}.neeto-molecules-sidebar__sublink{color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;margin-bottom:2px;padding:8px 24px 8px 58px;text-decoration:none;transition:color .3s,background-color .3s}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{--neeto-ui-text-body2:15px;opacity:.75}@media screen and (min-width:1536px){.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{--neeto-ui-text-body2:16px}}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-black));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-black));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-primary-800));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-product-switcher-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-product-switcher-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-product-switcher-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:15px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:15px}.neeto-molecules-product-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-product-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}.neeto-molecules-sidebar-segments-header{padding-left:58px}.neeto-molecules-sidebar-segment{margin-bottom:0!important;padding:4px 24px 4px 58px}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode{padding-top:0}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__header{padding-top:24px}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__links{display:flex;flex-direction:column;height:calc(100vh - 160px);margin-bottom:0}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper{flex-grow:1;margin:0 0 10px!important;min-height:0;overflow-y:auto;padding:11px 0 0!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink-wrapper{padding:0 8px!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{border-radius:var(--neeto-ui-rounded)}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link{cursor:pointer;gap:4px;padding:12px 4px;position:sticky;top:0;z-index:1}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link-sub-label{--neeto-ui-text-body2:15px}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);margin-bottom:5px}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{border-radius:var(--neeto-ui-rounded)}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink{cursor:pointer;padding:4px 20px!important;position:relative}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink:hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active{background-color:rgb(var(--neeto-ui-primary-100))!important}";
|
|
174
|
+
n(css,{});
|
|
175
|
+
|
|
176
|
+
var Chevron = function Chevron(_ref) {
|
|
177
|
+
var style = _ref.style;
|
|
178
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
179
|
+
style: style,
|
|
180
|
+
height: "16",
|
|
181
|
+
viewBox: "0 0 16 16",
|
|
182
|
+
width: "16"
|
|
183
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
184
|
+
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",
|
|
185
|
+
fill: "currentColor"
|
|
186
|
+
}));
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export { Chevron as C, Items as I, SelectedLink as S, CheckPointNavLinks as a, SELECTED_NAV_LINK_ROUTE_STORAGE_KEY as b, filterByPermissions as f, getSidebarStateLocalStorageKey as g };
|
|
190
|
+
//# sourceMappingURL=Chevron-c64ff676.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chevron-c64ff676.js","sources":["../src/components/Sidebar/Components/Links/CheckPointNavLink.jsx","../src/components/Sidebar/constants.js","../src/components/Sidebar/utils.js","../src/components/Sidebar/Components/Links/SubLink.jsx","../src/components/Sidebar/Components/Links/Items.jsx","../src/components/Sidebar/Components/Links/SelectedLink.jsx","../src/components/Sidebar/Components/Chevron.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { useNavigationCheckpoints } from \"neetocommons/react-utils/useRegisterNavigationCheckpoint\";\nimport { NavLink } from \"react-router-dom\";\n\nconst CheckPointNavLinks = ({ checkpointKey, to, children, ...others }) => {\n const { [checkpointKey]: checkpoint } =\n useNavigationCheckpoints(checkpointKey);\n\n return (\n <NavLink to={checkpoint || to} {...others} key={to}>\n {children}\n </NavLink>\n );\n};\n\nexport default CheckPointNavLinks;\n","export const SUB_LINK_TYPES = {\n SYSTEM_VIEW: \"system_view\",\n SEGMENTS: \"segments\",\n};\n\nexport const SELECTED_NAV_LINK_ROUTE_STORAGE_KEY = \"selectedNavLinkRoute\";\n","import { isNotEmpty } from \"neetocist\";\nimport { __, all, curry, equals, includes, is } from \"ramda\";\n\nexport const isSubRouteActive = (subRoute, location) => {\n const currentBrowserUrl = new URL(\n location.pathname + location.search + location.hash,\n window.location.origin\n );\n const targetUrl = new URL(subRoute, window.location.origin);\n\n const targetSearchParams = targetUrl.searchParams;\n const targetSearchKeys = Array.from(targetSearchParams.keys());\n\n return (\n all(\n key =>\n currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key),\n targetSearchKeys\n ) && equals(currentBrowserUrl.pathname, targetUrl.pathname)\n );\n};\n\nexport const getSidebarStateLocalStorageKey = () => {\n const user = globalProps.user?.email || globalProps.user?.phoneNumber;\n\n return `sidebarState-${user}`;\n};\n\nexport const filterByPermissions = curry(({ permissions }) => {\n if (permissions && isNotEmpty(permissions)) {\n return is(Array, permissions)\n ? permissions.some(includes(__, globalProps.permissions))\n : globalProps.permissions.includes(permissions);\n }\n\n return true;\n});\n","import React from \"react\";\n\nimport { hyphenate } from \"neetocist\";\nimport { Segments } from \"neetofilters\";\nimport { Typography } from \"neetoui\";\n\nimport CheckPointNavLinks from \"./CheckPointNavLink\";\n\nimport { SUB_LINK_TYPES } from \"../../constants\";\nimport { isSubRouteActive } from \"../../utils\";\n\nconst SubLink = ({\n to,\n label,\n type = SUB_LINK_TYPES.SYSTEM_VIEW,\n count,\n isSectionHeader,\n isCountsLoading,\n \"data-cy\": dataCy,\n entity = \"\",\n columns = [],\n}) => {\n if (type === SUB_LINK_TYPES.SEGMENTS) {\n return <Segments {...{ columns, entity }} isIndependent={false} />;\n }\n\n const dataCyPrefix = dataCy || hyphenate(label);\n\n const renderCount = count => (count > 999 ? \"999+\" : count);\n\n return (\n <CheckPointNavLinks\n {...{ to }}\n activeClassName=\"active\"\n className=\"neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none\"\n data-cy={`${dataCyPrefix}-sub-link`}\n isActive={() => !isSectionHeader && isSubRouteActive(to, location)}\n >\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-label`}\n style=\"body2\"\n >\n {label}\n </Typography>\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-count`}\n style=\"body2\"\n >\n {isCountsLoading ? (\n <div className=\"neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse\" />\n ) : (\n renderCount(count)\n )}\n </Typography>\n </CheckPointNavLinks>\n );\n};\n\nexport default SubLink;\n","import React from \"react\";\n\nimport { isPresent } from \"neetocist\";\n\nimport SubLink from \"./SubLink\";\n\nimport { filterByPermissions } from \"../../utils\";\n\nconst Items = ({ items, isSettingsItems = false, isCountsLoading }) => (\n <div\n className=\"neeto-molecules-sidebar__sublink-wrapper\"\n data-cy=\"sidebar-sub-link-wrapper\"\n >\n {items.filter(filterByPermissions).map((subItem, subIndex) => (\n <React.Fragment key={subIndex}>\n <SubLink\n {...{ ...subItem, isCountsLoading }}\n isSectionHeader={isPresent(subItem.item)}\n to={subItem.to ?? subItem.path}\n />\n {isSettingsItems && isPresent(subItem.items) && (\n <>\n <Items {...{ isSettingsItems }} items={subItem.items} />\n {items.length - 1 !== subIndex && (\n <hr className=\"neeto-molecules-sidebar__separator\" />\n )}\n </>\n )}\n </React.Fragment>\n ))}\n </div>\n);\n\nexport default Items;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { hyphenize } from \"neetocommons/utils/general\";\nimport { Left } from \"neetoicons\";\nimport { Typography } from \"neetoui\";\nimport { omit } from \"ramda\";\n\nimport Items from \"./Items\";\n\nconst SelectedLink = ({\n navLink = { label: \"\", items: [], isConfigureNavLink: false },\n handleGoBack,\n isConfigureSidebar,\n}) => {\n const { label, items, isConfigureNavLink, ...otherProps } = navLink;\n\n return (\n <div\n className=\"neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable\"\n data-cy=\"configure-nav-container\"\n >\n <div\n className=\"neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-molecules-sidebar__link neeto-ui-border-b hover:neeto-ui-bg-primary-100\"\n onClick={handleGoBack}\n {...{ ...omit([\"icon\"], otherProps) }}\n >\n {isConfigureNavLink && (\n <span\n className=\"neeto-molecules-sidebar__link-icon\"\n data-cy={`${hyphenize(label)}-go-back-button`}\n data-testid={`${label}-go-back-button`}\n >\n <Left />\n </span>\n )}\n <Typography\n component=\"span\"\n style=\"body1\"\n weight=\"normal\"\n className={classNames(\"neeto-molecules-sidebar__link-label\", {\n \"neeto-molecules-sidebar__configure-page-header\":\n isConfigureNavLink,\n [\"pl-4\"]: isConfigureSidebar,\n })}\n >\n {label}\n </Typography>\n </div>\n {items && <Items {...{ items }} isSettingsItems />}\n </div>\n );\n};\n\nexport default SelectedLink;\n","import React from \"react\";\n\nconst Chevron = ({ style }) => (\n <svg {...{ style }} height=\"16\" viewBox=\"0 0 16 16\" width=\"16\">\n <path\n 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\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default Chevron;\n"],"names":["CheckPointNavLinks","_ref","checkpointKey","to","children","others","_objectWithoutProperties","_excluded","_useNavigationCheckpo","useNavigationCheckpoints","checkpoint","React","createElement","NavLink","_extends","key","SUB_LINK_TYPES","SYSTEM_VIEW","SEGMENTS","SELECTED_NAV_LINK_ROUTE_STORAGE_KEY","isSubRouteActive","subRoute","location","currentBrowserUrl","URL","pathname","search","hash","window","origin","targetUrl","targetSearchParams","searchParams","targetSearchKeys","Array","from","keys","all","get","equals","getSidebarStateLocalStorageKey","_globalProps$user","_globalProps$user2","user","globalProps","email","phoneNumber","concat","filterByPermissions","curry","permissions","isNotEmpty","is","some","includes","__","SubLink","label","_ref$type","type","count","isSectionHeader","isCountsLoading","dataCy","_ref$entity","entity","_ref$columns","columns","Segments","isIndependent","dataCyPrefix","hyphenate","renderCount","activeClassName","className","isActive","Typography","component","style","Items","items","_ref$isSettingsItems","isSettingsItems","filter","map","subItem","subIndex","_subItem$to","Fragment","_objectSpread","isPresent","item","path","length","SelectedLink","_ref$navLink","navLink","isConfigureNavLink","handleGoBack","isConfigureSidebar","otherProps","onClick","omit","hyphenize","Left","weight","classNames","_defineProperty","Chevron","height","viewBox","width","d","fill"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,I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|
-
import
|
|
1
|
+
import { _ as _extends } from './extends-093996c9.js';
|
|
2
|
+
import React__default from 'react';
|
|
2
3
|
import { PrismLight } from 'react-syntax-highlighter';
|
|
3
4
|
import { dracula } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
target[key] = source[key];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return target;
|
|
20
|
-
};
|
|
21
|
-
return _extends.apply(this, arguments);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _typeof(o) {
|
|
25
|
-
"@babel/helpers - typeof";
|
|
26
|
-
|
|
27
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
28
|
-
return typeof o;
|
|
29
|
-
} : function (o) {
|
|
30
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
31
|
-
}, _typeof(o);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _toPrimitive(input, hint) {
|
|
35
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
36
|
-
var prim = input[Symbol.toPrimitive];
|
|
37
|
-
if (prim !== undefined) {
|
|
38
|
-
var res = prim.call(input, hint || "default");
|
|
39
|
-
if (_typeof(res) !== "object") return res;
|
|
40
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
41
|
-
}
|
|
42
|
-
return (hint === "string" ? String : Number)(input);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function _toPropertyKey(arg) {
|
|
46
|
-
var key = _toPrimitive(arg, "string");
|
|
47
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function _defineProperty(obj, key, value) {
|
|
51
|
-
key = _toPropertyKey(key);
|
|
52
|
-
if (key in obj) {
|
|
53
|
-
Object.defineProperty(obj, key, {
|
|
54
|
-
value: value,
|
|
55
|
-
enumerable: true,
|
|
56
|
-
configurable: true,
|
|
57
|
-
writable: true
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
obj[key] = value;
|
|
61
|
-
}
|
|
62
|
-
return obj;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function _arrayWithHoles(arr) {
|
|
66
|
-
if (Array.isArray(arr)) return arr;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _iterableToArrayLimit(r, l) {
|
|
70
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
71
|
-
if (null != t) {
|
|
72
|
-
var e,
|
|
73
|
-
n,
|
|
74
|
-
i,
|
|
75
|
-
u,
|
|
76
|
-
a = [],
|
|
77
|
-
f = !0,
|
|
78
|
-
o = !1;
|
|
79
|
-
try {
|
|
80
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
81
|
-
if (Object(t) !== t) return;
|
|
82
|
-
f = !1;
|
|
83
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
84
|
-
} catch (r) {
|
|
85
|
-
o = !0, n = r;
|
|
86
|
-
} finally {
|
|
87
|
-
try {
|
|
88
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
89
|
-
} finally {
|
|
90
|
-
if (o) throw n;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return a;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function _arrayLikeToArray(arr, len) {
|
|
98
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
99
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
100
|
-
return arr2;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
104
|
-
if (!o) return;
|
|
105
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
106
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
107
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
108
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
109
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _nonIterableRest() {
|
|
113
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function _slicedToArray(arr, i) {
|
|
117
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
121
|
-
if (source == null) return {};
|
|
122
|
-
var target = {};
|
|
123
|
-
var sourceKeys = Object.keys(source);
|
|
124
|
-
var key, i;
|
|
125
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
126
|
-
key = sourceKeys[i];
|
|
127
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
128
|
-
target[key] = source[key];
|
|
129
|
-
}
|
|
130
|
-
return target;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function _objectWithoutProperties(source, excluded) {
|
|
134
|
-
if (source == null) return {};
|
|
135
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
136
|
-
var key, i;
|
|
137
|
-
if (Object.getOwnPropertySymbols) {
|
|
138
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
139
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
140
|
-
key = sourceSymbolKeys[i];
|
|
141
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
142
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
143
|
-
target[key] = source[key];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return target;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
var TIME_OUT = 2000;
|
|
150
|
-
var TOOLTIP_CONFIG = {
|
|
151
|
-
content: "Copied",
|
|
152
|
-
trigger: "click",
|
|
153
|
-
hideAfter: TIME_OUT,
|
|
154
|
-
position: "top"
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
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}}
|
|
158
|
-
|
|
159
|
-
var css = ".neeto-molecules-copy-button{display:flex;justify-content:space-between}.neeto-molecules-copy-button .neeto-ui-btn:active,.neeto-molecules-copy-button .neeto-ui-btn:focus,.neeto-molecules-copy-button .neeto-ui-btn:hover{box-shadow:none}.neeto-molecules-copy-button--active{background:rgba(var(--neeto-ui-success-500));color:#fff}.neeto-molecules-copy-button--active.neeto-ui-btn:active,.neeto-molecules-copy-button--active.neeto-ui-btn:focus,.neeto-molecules-copy-button--active.neeto-ui-btn:hover{background:rgba(var(--neeto-ui-success-600));box-shadow:none;color:#fff}";
|
|
160
|
-
n(css,{});
|
|
161
|
-
|
|
162
|
-
var _excluded = ["className", "icon", "label", "value", "style"];
|
|
163
|
-
var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
|
|
164
|
-
var className = _ref.className,
|
|
165
|
-
_ref$icon = _ref.icon,
|
|
166
|
-
icon = _ref$icon === void 0 ? Copy : _ref$icon,
|
|
167
|
-
_ref$label = _ref.label,
|
|
168
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
169
|
-
value = _ref.value,
|
|
170
|
-
style = _ref.style,
|
|
171
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
172
|
-
var _useState = useState(false),
|
|
173
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
174
|
-
isChecked = _useState2[0],
|
|
175
|
-
setIsChecked = _useState2[1];
|
|
176
|
-
var ref = useRef();
|
|
177
|
-
var onHandleClick = function onHandleClick(event) {
|
|
178
|
-
event.preventDefault();
|
|
179
|
-
copyToClipboard(value, {
|
|
180
|
-
showToastr: false
|
|
181
|
-
});
|
|
182
|
-
setIsChecked(true);
|
|
183
|
-
setTimeout(function () {
|
|
184
|
-
setIsChecked(false);
|
|
185
|
-
}, TIME_OUT); // Reset copied state after 2 seconds
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
useEffect(function () {
|
|
189
|
-
if (ref.current) {
|
|
190
|
-
var buttonWidth = ref.current.clientWidth;
|
|
191
|
-
ref.current.style.minWidth = "".concat(buttonWidth, "px");
|
|
192
|
-
}
|
|
193
|
-
}, []);
|
|
194
|
-
var tooltipProps = label ? null : TOOLTIP_CONFIG;
|
|
195
|
-
var buttonLabel = isChecked && label ? "Copied" : label;
|
|
196
|
-
var buttonIcon = isChecked ? Check : icon;
|
|
197
|
-
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
198
|
-
ref: ref,
|
|
199
|
-
style: style,
|
|
200
|
-
tooltipProps: tooltipProps,
|
|
201
|
-
"data-testid": "copy-button",
|
|
202
|
-
icon: buttonIcon,
|
|
203
|
-
label: buttonLabel,
|
|
204
|
-
className: classnames("neeto-molecules-copy-button", _defineProperty(_defineProperty({}, className, className), "neeto-molecules-copy-button--active", isChecked)),
|
|
205
|
-
onClick: onHandleClick
|
|
206
|
-
}, otherProps));
|
|
207
|
-
};
|
|
5
|
+
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
6
|
+
import './defineProperty-549061a7.js';
|
|
7
|
+
import './slicedToArray-b4278ecd.js';
|
|
8
|
+
import './objectWithoutProperties-a0edb288.js';
|
|
9
|
+
import 'classnames';
|
|
10
|
+
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
11
|
+
import '@bigbinary/neeto-icons';
|
|
12
|
+
import '@bigbinary/neetoui';
|
|
13
|
+
import 'ramda';
|
|
14
|
+
import 'react-i18next';
|
|
15
|
+
import './inject-css-c86de496.js';
|
|
208
16
|
|
|
209
17
|
var Codeblock = function Codeblock(_ref) {
|
|
210
18
|
var code = _ref.code,
|
|
@@ -215,20 +23,29 @@ var Codeblock = function Codeblock(_ref) {
|
|
|
215
23
|
copyButtonProps = _ref$copyButtonProps === void 0 ? {
|
|
216
24
|
label: "Copy"
|
|
217
25
|
} : _ref$copyButtonProps;
|
|
218
|
-
|
|
26
|
+
var isLargerScreen = window.innerWidth > 768;
|
|
27
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
28
|
+
className: "relative"
|
|
29
|
+
}, /*#__PURE__*/React__default.createElement(PrismLight, _extends({
|
|
219
30
|
wrapLines: true,
|
|
31
|
+
className: "p-4 pr-12 md:pr-4",
|
|
32
|
+
codeTagProps: {
|
|
33
|
+
"data-cy": "code-block-content"
|
|
34
|
+
},
|
|
220
35
|
"data-cy": "code-block",
|
|
221
36
|
"data-testid": "codeblock-react-highlighter",
|
|
222
37
|
language: "javascript",
|
|
223
38
|
style: dracula
|
|
224
|
-
}, codeblockProps), code), showCopyButton && /*#__PURE__*/
|
|
225
|
-
className: "absolute top-
|
|
39
|
+
}, codeblockProps), code), showCopyButton && /*#__PURE__*/React__default.createElement(CopyToClipboardButton, _extends({
|
|
40
|
+
className: "absolute top-2 right-2",
|
|
226
41
|
"data-cy": "copy-button",
|
|
227
42
|
"data-testid": "codeblock-copy-button",
|
|
228
43
|
size: "small",
|
|
229
44
|
style: "secondary",
|
|
230
45
|
value: code
|
|
231
|
-
}, copyButtonProps
|
|
46
|
+
}, copyButtonProps, {
|
|
47
|
+
label: isLargerScreen ? copyButtonProps.label : ""
|
|
48
|
+
})));
|
|
232
49
|
};
|
|
233
50
|
|
|
234
51
|
export { Codeblock as default };
|
package/dist/Codeblock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Codeblock.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../src/components/CopyToClipboardButton/constants.js","../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../src/components/CopyToClipboardButton/index.jsx","../src/components/Codeblock.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","const TIME_OUT = 2000;\n\nconst TOOLTIP_CONFIG = {\n content: \"Copied\",\n trigger: \"click\",\n hideAfter: TIME_OUT,\n position: \"top\",\n};\n\nconst BUTTON_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n text: \"text\",\n};\n\nexport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES };\n","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}}export{n as default};\n","import React, { useState, useEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { copyToClipboard } from \"neetocommons/utils\";\nimport { Copy, Check } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES } from \"./constants\";\nimport \"./copyToClipboard.scss\";\n\nconst CopyToClipboardButton = ({\n className,\n icon = Copy,\n label = \"\",\n value,\n style,\n ...otherProps\n}) => {\n const [isChecked, setIsChecked] = useState(false);\n const ref = useRef();\n\n const onHandleClick = event => {\n event.preventDefault();\n copyToClipboard(value, { showToastr: false });\n setIsChecked(true);\n setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT); // Reset copied state after 2 seconds\n };\n\n useEffect(() => {\n if (ref.current) {\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }\n }, []);\n\n const tooltipProps = label ? null : TOOLTIP_CONFIG;\n const buttonLabel = isChecked && label ? \"Copied\" : label;\n const buttonIcon = isChecked ? Check : icon;\n\n return (\n <Button\n {...{ ref, style, tooltipProps }}\n data-testid=\"copy-button\"\n icon={buttonIcon}\n label={buttonLabel}\n className={classnames(\"neeto-molecules-copy-button\", {\n [className]: className,\n \"neeto-molecules-copy-button--active\": isChecked,\n })}\n onClick={onHandleClick}\n {...otherProps}\n />\n );\n};\n\nCopyToClipboardButton.propTypes = {\n /**\n * To provide additional classnames to the button.\n */\n className: PropTypes.string,\n /**\n * To provide the icon to be passed to the button. Defaults to the Copy icon.\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /**\n * To provide the label to the button. By default there is no label.\n */\n label: PropTypes.string,\n /**\n * The value to be copied to clipboard. (required)\n */\n value: PropTypes.string,\n /**\n * To specify the style of the Button.\n */\n style: PropTypes.oneOf(Object.values(BUTTON_STYLES)),\n};\n\nexport default CopyToClipboardButton;\n","import React from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => (\n <>\n <CodeBlock\n wrapLines\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute top-3 right-3\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n />\n )}\n </>\n);\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["toPrimitive","toPropertyKey","arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","objectWithoutPropertiesLoose","TIME_OUT","TOOLTIP_CONFIG","content","trigger","hideAfter","position","CopyToClipboardButton","_ref","className","_ref$icon","icon","Copy","_ref$label","label","value","style","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","onHandleClick","event","preventDefault","copyToClipboard","showToastr","setTimeout","useEffect","current","buttonWidth","clientWidth","minWidth","concat","tooltipProps","buttonLabel","buttonIcon","Check","React","createElement","Button","_extends","classnames","_defineProperty","onClick","Codeblock","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","Fragment","CodeBlock","wrapLines","language","dracula","CopyCode","size"],"mappings":";;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GA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AAA,CAAAD,KAAA,CAAAc,QAAA,EACEd,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACc,UAAS,EAAAZ,QAAA,CAAA;IACRa,SAAS,EAAA,IAAA;AACT,IAAA,SAAA,EAAQ,YAAY;AACpB,IAAA,aAAA,EAAY,6BAA6B;AACzCC,IAAAA,QAAQ,EAAC,YAAY;AACrB7C,IAAAA,KAAK,EAAE8C,OAAAA;AAAQ,GAAA,EACXP,cAAc,CAAA,EAEjBH,IACQ,CAAC,EACXE,cAAc,iBACbV,KAAA,CAAAC,aAAA,CAACkB,qBAAQ,EAAAhB,QAAA,CAAA;AACPtC,IAAAA,SAAS,EAAC,wBAAwB;AAClC,IAAA,SAAA,EAAQ,aAAa;AACrB,IAAA,aAAA,EAAY,uBAAuB;AACnCuD,IAAAA,IAAI,EAAC,OAAO;AACZhD,IAAAA,KAAK,EAAC,WAAW;AACjBD,IAAAA,KAAK,EAAEqC,IAAAA;GACHK,EAAAA,eAAe,CACpB,CAEH,CAAC,CAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"Codeblock.js","sources":["../src/components/Codeblock.jsx"],"sourcesContent":["import React from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute top-2 right-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","React","createElement","className","CodeBlock","_extends","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;AAQA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAAC,oBAAA,GAAAL,IAAA,CACdM,eAAe;IAAfA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,KAAK,EAAE,MAAA;AAAO,KAAC,GAAAF,oBAAA,CAAA;AAEnC,EAAA,IAAMG,cAAc,GAAGC,MAAM,CAACC,UAAU,GAAG,GAAG,CAAA;EAE9C,oBACEC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAA;AAAU,GAAA,eACvBF,cAAA,CAAAC,aAAA,CAACE,UA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