@bigbinary/neeto-molecules 1.1.10 → 1.1.12
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/AutoSaveInput/autosaveinput.scss +15 -0
- package/dist/AutoSaveInput/constants.js +13 -0
- package/dist/AutoSaveInput/index.js +124 -0
- package/dist/AutoSaveInput/utils.js +10 -0
- package/dist/Breadcrumbs/breadcrumbs.scss +33 -0
- package/dist/Breadcrumbs/index.js +31 -0
- package/dist/BrowserSupport/Callout.js +15 -0
- package/dist/BrowserSupport/ContactUs.js +21 -0
- package/dist/BrowserSupport/DownloadLink.js +17 -0
- package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +17 -0
- package/dist/BrowserSupport/UnknownBrowser.js +13 -0
- package/dist/BrowserSupport/UnsupportedBrowser.js +24 -0
- package/dist/BrowserSupport/UnsupportedBrowserMessage.js +22 -0
- package/dist/BrowserSupport/UnsupportedBrowserVersion.js +27 -0
- package/dist/BrowserSupport/UnsupportedVersionMessage.js +30 -0
- package/dist/BrowserSupport/browsersupport.scss +71 -0
- package/dist/BrowserSupport/constants.js +63 -0
- package/dist/BrowserSupport/index.js +58 -0
- package/dist/BrowserSupport/utils.js +32 -0
- package/dist/CalendarView/CustomDatePicker.js +87 -0
- package/dist/CalendarView/Header.js +53 -0
- package/dist/CalendarView/constants.js +19 -0
- package/dist/CalendarView/index.js +83 -0
- package/dist/CalendarView/utils.js +50 -0
- package/dist/Codeblock/index.js +30 -0
- package/dist/{Columns.js → Columns/index.js} +13 -130
- package/dist/Columns/utils.js +20 -0
- package/dist/ConfirmationModal/constants.js +3 -0
- package/dist/{ConfirmationModal.js → ConfirmationModal/index.js} +7 -23
- package/dist/ConfirmationModal/utils.js +10 -0
- package/dist/Container/container.scss +21 -0
- package/dist/Container/index.js +23 -0
- package/dist/CopyToClipboardButton/constants.js +13 -0
- package/dist/CopyToClipboardButton/copyToClipboard.scss +22 -0
- package/dist/CopyToClipboardButton/index.js +59 -0
- package/dist/CustomDomain/index.js +98 -0
- package/dist/CustomDomainDashboard/DeleteAlert.js +28 -0
- package/dist/CustomDomainDashboard/Header.js +32 -0
- package/dist/CustomDomainDashboard/Manage/Record.js +42 -0
- package/dist/CustomDomainDashboard/Manage/StatusInfo.js +21 -0
- package/dist/CustomDomainDashboard/Manage/TagBlock.js +36 -0
- package/dist/CustomDomainDashboard/Manage/constants.js +4 -0
- package/dist/CustomDomainDashboard/Manage/index.js +124 -0
- package/dist/CustomDomainDashboard/Manage/utils.js +8 -0
- package/dist/CustomDomainDashboard/api.js +35 -0
- package/dist/CustomDomainDashboard/constants.js +2 -0
- package/dist/CustomDomainDashboard/index.js +118 -0
- package/dist/CustomDomainDashboard/useCustomDomainApi.js +71 -0
- package/dist/CustomDomainDashboard/utils.js +84 -0
- package/dist/{DateFormat.js → DateFormat/index.js} +8 -25
- package/dist/DateRangeFilter/index.js +60 -0
- package/dist/DateRangeFilter/utils.js +113 -0
- package/dist/DynamicVariables/dynamic-variables.scss +34 -0
- package/dist/DynamicVariables/index.js +59 -0
- package/dist/DynamicVariables/utils.js +37 -0
- package/dist/EmailForm/EmailForm.js +97 -0
- package/dist/EmailForm/EmailFormProvider.js +45 -0
- package/dist/EmailForm/EmailPreview.js +129 -0
- package/dist/EmailForm/ReplyToField.js +55 -0
- package/dist/EmailForm/SendToField.js +27 -0
- package/dist/EmailForm/SubjectField.js +64 -0
- package/dist/EmailForm/constants.js +33 -0
- package/dist/EmailForm/contexts/EmailForm.js +7 -0
- package/dist/EmailForm/index.js +4 -0
- package/dist/EmailForm/utils.js +10 -0
- package/dist/EmailPreview/index.js +2 -0
- package/dist/{ErrorPage.js → ErrorPage/constants.js} +36 -175
- package/dist/ErrorPage/index.js +78 -0
- package/dist/Header/Breadcrumbs.js +31 -0
- package/dist/Header/Dropdown.js +12 -0
- package/dist/Header/constants.js +6 -0
- package/dist/Header/header.scss +121 -0
- package/dist/Header/index.js +61 -0
- package/dist/IconPicker/Icon.js +34 -0
- package/dist/IconPicker/NoResults.js +12 -0
- package/dist/IconPicker/constants.js +8 -0
- package/dist/IconPicker/icon-picker.scss +1 -0
- package/dist/IconPicker/index.js +164 -0
- package/dist/ImageWithFallback/ImagePlaceholder.js +16 -0
- package/dist/ImageWithFallback/index.js +31 -0
- package/dist/IntegrationCard/Dropdown.js +45 -0
- package/dist/IntegrationCard/Status.js +25 -0
- package/dist/IntegrationCard/index.js +128 -0
- package/dist/IntegrationDisconnectAlert/index.js +36 -0
- package/dist/{IntegrationWalkthroughModal.js → IntegrationWalkthroughModal/index.js} +6 -8
- package/dist/IpRestriction/AllowedIpRanges.js +75 -0
- package/dist/IpRestriction/CurrentIp.js +26 -0
- package/dist/IpRestriction/FormRow.js +84 -0
- package/dist/IpRestriction/Row.js +91 -0
- package/dist/IpRestriction/apis/allowed_ip_ranges.js +28 -0
- package/dist/IpRestriction/apis/current_ip.js +11 -0
- package/dist/IpRestriction/apis/ip_restriction.js +16 -0
- package/dist/IpRestriction/constants.js +20 -0
- package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +34 -0
- package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +10 -0
- package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +18 -0
- package/dist/IpRestriction/index.js +102 -0
- package/dist/IpRestriction/utils.js +85 -0
- package/dist/KeyboardShortcuts/Pane/HotKey.js +44 -0
- package/dist/KeyboardShortcuts/Pane/HotKeyList.js +42 -0
- package/dist/KeyboardShortcuts/Pane/constants.js +25 -0
- package/dist/KeyboardShortcuts/Pane/index.js +61 -0
- package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +5 -0
- package/dist/KeyboardShortcuts/Pane/utils.js +66 -0
- package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +31 -0
- package/dist/KeyboardShortcuts/index.js +9 -0
- package/dist/LoginPage/Form.js +57 -0
- package/dist/LoginPage/constants.js +12 -0
- package/dist/LoginPage/index.js +103 -0
- package/dist/MenuBar/AddNew.js +25 -0
- package/dist/MenuBar/Block.js +60 -0
- package/dist/MenuBar/Item.js +32 -0
- package/dist/MenuBar/Search.js +39 -0
- package/dist/MenuBar/SubTitle.js +23 -0
- package/dist/MenuBar/index.js +46 -0
- package/dist/MenuBar/menubar.scss +154 -0
- package/dist/Metadata/Block.js +30 -0
- package/dist/Metadata/DetailsBlock.js +86 -0
- package/dist/Metadata/constants.js +9 -0
- package/dist/Metadata/index.js +29 -0
- package/dist/Metadata/metadata.scss +15 -0
- package/dist/MoreDropdown/constants.js +25 -0
- package/dist/{MoreDropdown.js → MoreDropdown/index.js} +9 -102
- package/dist/NavigationHeader/LeftBlock.js +32 -0
- package/dist/NavigationHeader/Navigation.js +24 -0
- package/dist/NavigationHeader/RightBlock.js +68 -0
- package/dist/NavigationHeader/constants.js +11 -0
- package/dist/NavigationHeader/index.js +19 -0
- package/dist/NavigationHeader/navigation-header.scss +3 -0
- package/dist/NeetoWidget/CodeBlock.js +57 -0
- package/dist/NeetoWidget/CodeSnippet.js +119 -0
- package/dist/NeetoWidget/EmbedCode.js +281 -0
- package/dist/NeetoWidget/Main.js +19 -0
- package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +25 -0
- package/dist/NeetoWidget/SelectionSwitches/index.js +44 -0
- package/dist/NeetoWidget/SyntaxHighlighter.js +17 -0
- package/dist/NeetoWidget/api.js +20 -0
- package/dist/NeetoWidget/constants.js +62 -0
- package/dist/NeetoWidget/hooks/useForceUpdate.js +14 -0
- package/dist/NeetoWidget/index.js +7 -0
- package/dist/NeetoWidget/mutations.js +9 -0
- package/dist/NeetoWidget/queries.js +32 -0
- package/dist/NeetoWidget/utils.js +83 -0
- package/dist/PageLoader/index.js +81 -0
- package/dist/PageLoader/page-loader.scss +95 -0
- package/dist/PhoneNumber/CountryPicker/SingleValue.js +21 -0
- package/dist/PhoneNumber/CountryPicker/constants.js +26 -0
- package/dist/PhoneNumber/CountryPicker/index.js +59 -0
- package/dist/PhoneNumber/FormikPhoneNumberInput.js +21 -0
- package/dist/PhoneNumber/PhoneNumber.js +30 -0
- package/dist/PhoneNumber/PhoneNumberInput.js +79 -0
- package/dist/PhoneNumber/index.js +5 -0
- package/dist/PhoneNumber/utils.js +55 -0
- package/dist/PublishBlock/AlertBlock.js +14 -0
- package/dist/PublishBlock/index.js +100 -0
- package/dist/PublishBlock/publish-block.scss +25 -0
- package/dist/Rename/DummySpan.js +21 -0
- package/dist/Rename/constants.js +1 -0
- package/dist/Rename/index.js +191 -0
- package/dist/Rename/rename.scss +69 -0
- package/dist/Rename/utils.js +10 -0
- package/dist/ResponsiveDevicePicker/constants.js +19 -0
- package/dist/ResponsiveDevicePicker/index.js +36 -0
- package/dist/Schedule/DisplayAvailability.js +58 -0
- package/dist/Schedule/Fields.js +43 -0
- package/dist/Schedule/Form/ScheduleRow.js +125 -0
- package/dist/Schedule/Form/constants.js +20 -0
- package/dist/Schedule/Form/index.js +144 -0
- package/dist/Schedule/Form/utils.js +63 -0
- package/dist/Schedule/Header.js +76 -0
- package/dist/Schedule/ScheduleContext.js +8 -0
- package/dist/Schedule/constants.js +8 -0
- package/dist/Schedule/dayjsExtended/constants.js +1 -0
- package/dist/Schedule/dayjsExtended/index.js +14 -0
- package/dist/Schedule/dayjsExtended/range.js +73 -0
- package/dist/Schedule/index.js +80 -0
- package/dist/Schedule/utils.js +152 -0
- package/dist/Scrollable/constants.js +8 -0
- package/dist/Scrollable/index.js +26 -0
- package/dist/Scrollable/scrollable.scss +32 -0
- package/dist/Search/index.js +52 -0
- package/dist/Security/AllowedKeywords/Add.js +38 -0
- package/dist/Security/AllowedKeywords/index.js +38 -0
- package/dist/Security/PasswordBlock.js +31 -0
- package/dist/Security/RadioBlock.js +38 -0
- package/dist/Security/api.js +12 -0
- package/dist/Security/constants.js +58 -0
- package/dist/Security/index.js +68 -0
- package/dist/Security/useSecurityApi.js +22 -0
- package/dist/Security/utils.js +31 -0
- package/dist/SendToFields/FilePicker.js +34 -0
- package/dist/SendToFields/constants.js +6 -0
- package/dist/SendToFields/index.js +102 -0
- package/dist/SendToFields/utils.js +54 -0
- package/dist/Settings/Category.js +30 -0
- package/dist/Settings/Item.js +38 -0
- package/dist/Settings/index.js +37 -0
- package/dist/Settings/utils.js +4 -0
- package/dist/ShareViaEmail/EmailBodyEditor.js +22 -0
- package/dist/ShareViaEmail/FilePicker.js +43 -0
- package/dist/ShareViaEmail/Form.js +101 -0
- package/dist/ShareViaEmail/FormikDatePicker.js +24 -0
- package/dist/ShareViaEmail/constants.js +14 -0
- package/dist/ShareViaEmail/index.js +89 -0
- package/dist/ShareViaEmail/utils.js +72 -0
- package/dist/ShareViaLink/EditURL.js +74 -0
- package/dist/ShareViaLink/Link.js +105 -0
- package/dist/ShareViaLink/QRCode.js +41 -0
- package/dist/ShareViaLink/RegenerateURL.js +47 -0
- package/dist/ShareViaLink/SocialMedia.js +52 -0
- package/dist/ShareViaLink/constants.js +25 -0
- package/dist/ShareViaLink/edit-url.scss +8 -0
- package/dist/ShareViaLink/index.js +46 -0
- package/dist/ShareViaLink/utils.js +47 -0
- package/dist/Sidebar/AppSwitcher/AppLink.js +45 -0
- package/dist/Sidebar/AppSwitcher/Backdrop.js +13 -0
- package/dist/Sidebar/AppSwitcher/Body.js +65 -0
- package/dist/Sidebar/AppSwitcher/Portal.js +27 -0
- package/dist/Sidebar/AppSwitcher/appswitcher.scss +164 -0
- package/dist/Sidebar/AppSwitcher/index.js +47 -0
- package/dist/Sidebar/AppSwitcher/utils.js +25 -0
- package/dist/Sidebar/Chevron.js +14 -0
- package/dist/Sidebar/FeaturedTooltip.js +19 -0
- package/dist/Sidebar/Footer/AppSwitcherButton.js +48 -0
- package/dist/Sidebar/Footer/ProfileButton.js +30 -0
- package/dist/Sidebar/Footer/index.js +56 -0
- package/dist/Sidebar/Footer/utils.js +39 -0
- package/dist/Sidebar/Header.js +33 -0
- package/dist/Sidebar/HelpSection/HelpSectionMenu.js +52 -0
- package/dist/Sidebar/HelpSection/index.js +32 -0
- package/dist/Sidebar/Links.js +112 -0
- package/dist/Sidebar/NavIconWrapper.js +20 -0
- package/dist/Sidebar/ProfileSection/LinkSection.js +36 -0
- package/dist/Sidebar/ProfileSection/ProfileMenu.js +48 -0
- package/dist/Sidebar/ProfileSection/index.js +42 -0
- package/dist/Sidebar/constants.js +40 -0
- package/dist/Sidebar/index.js +94 -0
- package/dist/Sidebar/sidebar.scss +379 -0
- package/dist/Sidebar/utils.js +18 -0
- package/dist/SubHeader/RightBlock/Columns.js +35 -0
- package/dist/SubHeader/RightBlock/Download.js +28 -0
- package/dist/SubHeader/RightBlock/Filter.js +31 -0
- package/dist/SubHeader/RightBlock/index.js +21 -0
- package/dist/SubHeader/RightBlock/utils.js +13 -0
- package/dist/SubHeader/index.js +28 -0
- package/dist/SubHeader/subheader.scss +78 -0
- package/dist/TableWrapper/index.js +18 -0
- package/dist/ThemeSidebar/Customize/Logo.js +39 -0
- package/dist/ThemeSidebar/Customize/Properties.js +170 -0
- package/dist/ThemeSidebar/Customize/index.js +66 -0
- package/dist/ThemeSidebar/Themes/ThemeCard.js +135 -0
- package/dist/ThemeSidebar/Themes/index.js +110 -0
- package/dist/ThemeSidebar/TitleBar.js +62 -0
- package/dist/ThemeSidebar/constants.js +127 -0
- package/dist/ThemeSidebar/fields/AlignmentBlock.js +50 -0
- package/dist/ThemeSidebar/fields/Card.js +19 -0
- package/dist/ThemeSidebar/fields/ColorBlock.js +19 -0
- package/dist/ThemeSidebar/fields/FontPickerBlock.js +35 -0
- package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +67 -0
- package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +22 -0
- package/dist/ThemeSidebar/fields/ImageBlock/index.js +55 -0
- package/dist/ThemeSidebar/fields/SelectBlock.js +24 -0
- package/dist/ThemeSidebar/fields/SliderBlock.js +30 -0
- package/dist/ThemeSidebar/fields/SwitchBlock.js +17 -0
- package/dist/ThemeSidebar/fields/TextBlock.js +13 -0
- package/dist/ThemeSidebar/fields/slider.scss +199 -0
- package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +149 -0
- package/dist/ThemeSidebar/index.js +118 -0
- package/dist/ThemeSidebar/themeSidebar.scss +45 -0
- package/dist/ThemeSidebar/utils.js +169 -0
- package/dist/TimeFormat/index.js +3 -0
- package/dist/TimezoneMismatchModal/apis/time_zone.js +9 -0
- package/dist/TimezoneMismatchModal/index.js +83 -0
- package/dist/TimezoneMismatchModal/useTimeZoneApi.js +10 -0
- package/dist/TimezoneMismatchModal/utils.js +12 -0
- package/dist/ToggleFeatureCard/ToolTipSwitch.js +31 -0
- package/dist/ToggleFeatureCard/constants.js +5 -0
- package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +11 -0
- package/dist/ToggleFeatureCard/index.js +148 -0
- package/dist/ToggleFeatureCard/toggleFeatureCard.scss +4 -0
- package/package.json +28 -34
- package/src/translations/en.json +5 -1
- package/types/Search.d.ts +19 -0
- package/dist/AutoSaveInput.cjs.js +0 -724
- package/dist/AutoSaveInput.cjs.js.map +0 -1
- package/dist/AutoSaveInput.js +0 -718
- package/dist/AutoSaveInput.js.map +0 -1
- package/dist/Breadcrumbs.cjs.js +0 -44
- package/dist/Breadcrumbs.cjs.js.map +0 -1
- package/dist/Breadcrumbs.js +0 -38
- package/dist/Breadcrumbs.js.map +0 -1
- package/dist/BrowserSupport.cjs.js +0 -1731
- package/dist/BrowserSupport.cjs.js.map +0 -1
- package/dist/BrowserSupport.js +0 -1725
- package/dist/BrowserSupport.js.map +0 -1
- package/dist/CalendarView.cjs.js +0 -610
- package/dist/CalendarView.cjs.js.map +0 -1
- package/dist/CalendarView.js +0 -598
- package/dist/CalendarView.js.map +0 -1
- package/dist/Codeblock.cjs.js +0 -302
- package/dist/Codeblock.cjs.js.map +0 -1
- package/dist/Codeblock.js +0 -296
- package/dist/Codeblock.js.map +0 -1
- package/dist/Columns.cjs.js +0 -248
- package/dist/Columns.cjs.js.map +0 -1
- package/dist/Columns.js.map +0 -1
- package/dist/ConfirmationModal.cjs.js +0 -87
- package/dist/ConfirmationModal.cjs.js.map +0 -1
- package/dist/ConfirmationModal.js.map +0 -1
- package/dist/Container.cjs.js +0 -1277
- package/dist/Container.cjs.js.map +0 -1
- package/dist/Container.js +0 -1271
- package/dist/Container.js.map +0 -1
- package/dist/CopyToClipboardButton.cjs.js +0 -275
- package/dist/CopyToClipboardButton.cjs.js.map +0 -1
- package/dist/CopyToClipboardButton.js +0 -269
- package/dist/CopyToClipboardButton.js.map +0 -1
- package/dist/CustomDomain.cjs.js +0 -774
- package/dist/CustomDomain.cjs.js.map +0 -1
- package/dist/CustomDomain.js +0 -747
- package/dist/CustomDomain.js.map +0 -1
- package/dist/CustomDomainDashboard.cjs.js +0 -2370
- package/dist/CustomDomainDashboard.cjs.js.map +0 -1
- package/dist/CustomDomainDashboard.js +0 -2342
- package/dist/CustomDomainDashboard.js.map +0 -1
- package/dist/DateFormat.cjs.js +0 -51
- package/dist/DateFormat.cjs.js.map +0 -1
- package/dist/DateFormat.js.map +0 -1
- package/dist/DateRangeFilter.cjs.js +0 -236
- package/dist/DateRangeFilter.cjs.js.map +0 -1
- package/dist/DateRangeFilter.js +0 -229
- package/dist/DateRangeFilter.js.map +0 -1
- package/dist/DynamicVariables.cjs.js +0 -189
- package/dist/DynamicVariables.cjs.js.map +0 -1
- package/dist/DynamicVariables.js +0 -183
- package/dist/DynamicVariables.js.map +0 -1
- package/dist/EmailForm.cjs.js +0 -4295
- package/dist/EmailForm.cjs.js.map +0 -1
- package/dist/EmailForm.js +0 -4265
- package/dist/EmailForm.js.map +0 -1
- package/dist/EmailPreview.cjs.js +0 -1419
- package/dist/EmailPreview.cjs.js.map +0 -1
- package/dist/EmailPreview.js +0 -1413
- package/dist/EmailPreview.js.map +0 -1
- package/dist/ErrorPage.cjs.js +0 -226
- package/dist/ErrorPage.cjs.js.map +0 -1
- package/dist/ErrorPage.js.map +0 -1
- package/dist/Header.cjs.js +0 -188
- package/dist/Header.cjs.js.map +0 -1
- package/dist/Header.js +0 -182
- package/dist/Header.js.map +0 -1
- package/dist/IconPicker.cjs.js +0 -1308
- package/dist/IconPicker.cjs.js.map +0 -1
- package/dist/IconPicker.js +0 -1302
- package/dist/IconPicker.js.map +0 -1
- package/dist/ImageWithFallback.cjs.js +0 -247
- package/dist/ImageWithFallback.cjs.js.map +0 -1
- package/dist/ImageWithFallback.js +0 -241
- package/dist/ImageWithFallback.js.map +0 -1
- package/dist/IntegrationCard.cjs.js +0 -409
- package/dist/IntegrationCard.cjs.js.map +0 -1
- package/dist/IntegrationCard.js +0 -403
- package/dist/IntegrationCard.js.map +0 -1
- package/dist/IntegrationDisconnectAlert.cjs.js +0 -89
- package/dist/IntegrationDisconnectAlert.cjs.js.map +0 -1
- package/dist/IntegrationDisconnectAlert.js +0 -80
- package/dist/IntegrationDisconnectAlert.js.map +0 -1
- package/dist/IntegrationWalkthroughModal.cjs.js +0 -50
- package/dist/IntegrationWalkthroughModal.cjs.js.map +0 -1
- package/dist/IntegrationWalkthroughModal.js.map +0 -1
- package/dist/IpRestriction.cjs.js +0 -3931
- package/dist/IpRestriction.cjs.js.map +0 -1
- package/dist/IpRestriction.js +0 -3905
- package/dist/IpRestriction.js.map +0 -1
- package/dist/KeyboardShortcuts.cjs.js +0 -2263
- package/dist/KeyboardShortcuts.cjs.js.map +0 -1
- package/dist/KeyboardShortcuts.js +0 -2256
- package/dist/KeyboardShortcuts.js.map +0 -1
- package/dist/LoginPage.cjs.js +0 -618
- package/dist/LoginPage.cjs.js.map +0 -1
- package/dist/LoginPage.js +0 -593
- package/dist/LoginPage.js.map +0 -1
- package/dist/MenuBar.cjs.js +0 -34273
- package/dist/MenuBar.cjs.js.map +0 -1
- package/dist/MenuBar.js +0 -34267
- package/dist/MenuBar.js.map +0 -1
- package/dist/Metadata.cjs.js +0 -272
- package/dist/Metadata.cjs.js.map +0 -1
- package/dist/Metadata.js +0 -266
- package/dist/Metadata.js.map +0 -1
- package/dist/MoreDropdown.cjs.js +0 -168
- package/dist/MoreDropdown.cjs.js.map +0 -1
- package/dist/MoreDropdown.js.map +0 -1
- package/dist/NavigationHeader.cjs.js +0 -756
- package/dist/NavigationHeader.cjs.js.map +0 -1
- package/dist/NavigationHeader.js +0 -750
- package/dist/NavigationHeader.js.map +0 -1
- package/dist/NeetoWidget.cjs.js +0 -3375
- package/dist/NeetoWidget.cjs.js.map +0 -1
- package/dist/NeetoWidget.js +0 -3348
- package/dist/NeetoWidget.js.map +0 -1
- package/dist/PageLoader.cjs.js +0 -158
- package/dist/PageLoader.cjs.js.map +0 -1
- package/dist/PageLoader.js +0 -134
- package/dist/PageLoader.js.map +0 -1
- package/dist/PhoneNumber.cjs.js +0 -7021
- package/dist/PhoneNumber.cjs.js.map +0 -1
- package/dist/PhoneNumber.js +0 -6989
- package/dist/PhoneNumber.js.map +0 -1
- package/dist/PublishBlock.cjs.js +0 -224
- package/dist/PublishBlock.cjs.js.map +0 -1
- package/dist/PublishBlock.js +0 -218
- package/dist/PublishBlock.js.map +0 -1
- package/dist/Rename.cjs.js +0 -516
- package/dist/Rename.cjs.js.map +0 -1
- package/dist/Rename.js +0 -510
- package/dist/Rename.js.map +0 -1
- package/dist/ResponsiveDevicePicker.cjs.js +0 -260
- package/dist/ResponsiveDevicePicker.cjs.js.map +0 -1
- package/dist/ResponsiveDevicePicker.js +0 -254
- package/dist/ResponsiveDevicePicker.js.map +0 -1
- package/dist/Schedule.cjs.js +0 -1077
- package/dist/Schedule.cjs.js.map +0 -1
- package/dist/Schedule.js +0 -1046
- package/dist/Schedule.js.map +0 -1
- package/dist/Scrollable.cjs.js +0 -188
- package/dist/Scrollable.cjs.js.map +0 -1
- package/dist/Scrollable.js +0 -182
- package/dist/Scrollable.js.map +0 -1
- package/dist/Security.cjs.js +0 -1921
- package/dist/Security.cjs.js.map +0 -1
- package/dist/Security.js +0 -1895
- package/dist/Security.js.map +0 -1
- package/dist/SendToFields.cjs.js +0 -2524
- package/dist/SendToFields.cjs.js.map +0 -1
- package/dist/SendToFields.js +0 -2517
- package/dist/SendToFields.js.map +0 -1
- package/dist/Settings.cjs.js +0 -501
- package/dist/Settings.cjs.js.map +0 -1
- package/dist/Settings.js +0 -495
- package/dist/Settings.js.map +0 -1
- package/dist/ShareViaEmail.cjs.js +0 -4272
- package/dist/ShareViaEmail.cjs.js.map +0 -1
- package/dist/ShareViaEmail.js +0 -4246
- package/dist/ShareViaEmail.js.map +0 -1
- package/dist/ShareViaLink.cjs.js +0 -1512
- package/dist/ShareViaLink.cjs.js.map +0 -1
- package/dist/ShareViaLink.js +0 -1486
- package/dist/ShareViaLink.js.map +0 -1
- package/dist/Sidebar.cjs.js +0 -34985
- package/dist/Sidebar.cjs.js.map +0 -1
- package/dist/Sidebar.js +0 -34959
- package/dist/Sidebar.js.map +0 -1
- package/dist/SubHeader.cjs.js +0 -283
- package/dist/SubHeader.cjs.js.map +0 -1
- package/dist/SubHeader.js +0 -276
- package/dist/SubHeader.js.map +0 -1
- package/dist/TableWrapper.cjs.js +0 -87
- package/dist/TableWrapper.cjs.js.map +0 -1
- package/dist/TableWrapper.js +0 -81
- package/dist/TableWrapper.js.map +0 -1
- package/dist/ThemeSidebar.cjs.js +0 -13705
- package/dist/ThemeSidebar.cjs.js.map +0 -1
- package/dist/ThemeSidebar.js +0 -13680
- package/dist/ThemeSidebar.js.map +0 -1
- package/dist/TimeFormat.cjs.js +0 -53
- package/dist/TimeFormat.cjs.js.map +0 -1
- package/dist/TimeFormat.js +0 -47
- package/dist/TimeFormat.js.map +0 -1
- package/dist/TimezoneMismatchModal.cjs.js +0 -176
- package/dist/TimezoneMismatchModal.cjs.js.map +0 -1
- package/dist/TimezoneMismatchModal.js +0 -168
- package/dist/TimezoneMismatchModal.js.map +0 -1
- package/dist/ToggleFeatureCard.cjs.js +0 -389
- package/dist/ToggleFeatureCard.cjs.js.map +0 -1
- package/dist/ToggleFeatureCard.js +0 -383
- package/dist/ToggleFeatureCard.js.map +0 -1
|
@@ -1,2263 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
6
|
-
var neetoui = require('@bigbinary/neetoui');
|
|
7
|
-
var managers = require('@bigbinary/neetoui/managers');
|
|
8
|
-
var reactI18next = require('react-i18next');
|
|
9
|
-
var i18next = require('i18next');
|
|
10
|
-
var ramda = require('ramda');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
16
|
-
|
|
17
|
-
const createStoreImpl = (createState) => {
|
|
18
|
-
let state;
|
|
19
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
20
|
-
const setState = (partial, replace) => {
|
|
21
|
-
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
22
|
-
if (!Object.is(nextState, state)) {
|
|
23
|
-
const previousState = state;
|
|
24
|
-
state = (replace != null ? replace : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState);
|
|
25
|
-
listeners.forEach((listener) => listener(state, previousState));
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const getState = () => state;
|
|
29
|
-
const subscribe = (listener) => {
|
|
30
|
-
listeners.add(listener);
|
|
31
|
-
return () => listeners.delete(listener);
|
|
32
|
-
};
|
|
33
|
-
const destroy = () => {
|
|
34
|
-
if ((undefined && undefined.MODE) !== "production") {
|
|
35
|
-
console.warn(
|
|
36
|
-
"[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected."
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
listeners.clear();
|
|
40
|
-
};
|
|
41
|
-
const api = { setState, getState, subscribe, destroy };
|
|
42
|
-
state = createState(setState, getState, api);
|
|
43
|
-
return api;
|
|
44
|
-
};
|
|
45
|
-
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
46
|
-
|
|
47
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
48
|
-
|
|
49
|
-
function getDefaultExportFromCjs (x) {
|
|
50
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var withSelector = {exports: {}};
|
|
54
|
-
|
|
55
|
-
var withSelector_production_min = {};
|
|
56
|
-
|
|
57
|
-
var shim = {exports: {}};
|
|
58
|
-
|
|
59
|
-
var useSyncExternalStoreShim_production_min = {};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @license React
|
|
63
|
-
* use-sync-external-store-shim.production.min.js
|
|
64
|
-
*
|
|
65
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the MIT license found in the
|
|
68
|
-
* LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
var hasRequiredUseSyncExternalStoreShim_production_min;
|
|
72
|
-
|
|
73
|
-
function requireUseSyncExternalStoreShim_production_min () {
|
|
74
|
-
if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
|
|
75
|
-
hasRequiredUseSyncExternalStoreShim_production_min = 1;
|
|
76
|
-
var e=React__default["default"];function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
|
|
77
|
-
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;
|
|
78
|
-
return useSyncExternalStoreShim_production_min;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var useSyncExternalStoreShim_development = {};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @license React
|
|
85
|
-
* use-sync-external-store-shim.development.js
|
|
86
|
-
*
|
|
87
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the MIT license found in the
|
|
90
|
-
* LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
var hasRequiredUseSyncExternalStoreShim_development;
|
|
94
|
-
|
|
95
|
-
function requireUseSyncExternalStoreShim_development () {
|
|
96
|
-
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
97
|
-
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
98
|
-
|
|
99
|
-
if (process.env.NODE_ENV !== "production") {
|
|
100
|
-
(function() {
|
|
101
|
-
|
|
102
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
103
|
-
if (
|
|
104
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
105
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
106
|
-
'function'
|
|
107
|
-
) {
|
|
108
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
109
|
-
}
|
|
110
|
-
var React = React__default["default"];
|
|
111
|
-
|
|
112
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
113
|
-
|
|
114
|
-
function error(format) {
|
|
115
|
-
{
|
|
116
|
-
{
|
|
117
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
118
|
-
args[_key2 - 1] = arguments[_key2];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
printWarning('error', format, args);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function printWarning(level, format, args) {
|
|
127
|
-
// When changing this logic, you might want to also
|
|
128
|
-
// update consoleWithStackDev.www.js as well.
|
|
129
|
-
{
|
|
130
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
131
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
132
|
-
|
|
133
|
-
if (stack !== '') {
|
|
134
|
-
format += '%s';
|
|
135
|
-
args = args.concat([stack]);
|
|
136
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var argsWithFormat = args.map(function (item) {
|
|
140
|
-
return String(item);
|
|
141
|
-
}); // Careful: RN currently depends on this prefix
|
|
142
|
-
|
|
143
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
144
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
145
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
146
|
-
|
|
147
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
153
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
154
|
-
*/
|
|
155
|
-
function is(x, y) {
|
|
156
|
-
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
157
|
-
;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
161
|
-
|
|
162
|
-
// dispatch for CommonJS interop named imports.
|
|
163
|
-
|
|
164
|
-
var useState = React.useState,
|
|
165
|
-
useEffect = React.useEffect,
|
|
166
|
-
useLayoutEffect = React.useLayoutEffect,
|
|
167
|
-
useDebugValue = React.useDebugValue;
|
|
168
|
-
var didWarnOld18Alpha = false;
|
|
169
|
-
var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
|
|
170
|
-
// because of a very particular set of implementation details and assumptions
|
|
171
|
-
// -- change any one of them and it will break. The most important assumption
|
|
172
|
-
// is that updates are always synchronous, because concurrent rendering is
|
|
173
|
-
// only available in versions of React that also have a built-in
|
|
174
|
-
// useSyncExternalStore API. And we only use this shim when the built-in API
|
|
175
|
-
// does not exist.
|
|
176
|
-
//
|
|
177
|
-
// Do not assume that the clever hacks used by this hook also work in general.
|
|
178
|
-
// The point of this shim is to replace the need for hacks by other libraries.
|
|
179
|
-
|
|
180
|
-
function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
181
|
-
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
182
|
-
// will need to track that themselves and return the correct value
|
|
183
|
-
// from `getSnapshot`.
|
|
184
|
-
getServerSnapshot) {
|
|
185
|
-
{
|
|
186
|
-
if (!didWarnOld18Alpha) {
|
|
187
|
-
if (React.startTransition !== undefined) {
|
|
188
|
-
didWarnOld18Alpha = true;
|
|
189
|
-
|
|
190
|
-
error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
} // Read the current snapshot from the store on every render. Again, this
|
|
194
|
-
// breaks the rules of React, and only works here because of specific
|
|
195
|
-
// implementation details, most importantly that updates are
|
|
196
|
-
// always synchronous.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
var value = getSnapshot();
|
|
200
|
-
|
|
201
|
-
{
|
|
202
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
203
|
-
var cachedValue = getSnapshot();
|
|
204
|
-
|
|
205
|
-
if (!objectIs(value, cachedValue)) {
|
|
206
|
-
error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
207
|
-
|
|
208
|
-
didWarnUncachedGetSnapshot = true;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
} // Because updates are synchronous, we don't queue them. Instead we force a
|
|
212
|
-
// re-render whenever the subscribed state changes by updating an some
|
|
213
|
-
// arbitrary useState hook. Then, during render, we call getSnapshot to read
|
|
214
|
-
// the current value.
|
|
215
|
-
//
|
|
216
|
-
// Because we don't actually use the state returned by the useState hook, we
|
|
217
|
-
// can save a bit of memory by storing other stuff in that slot.
|
|
218
|
-
//
|
|
219
|
-
// To implement the early bailout, we need to track some things on a mutable
|
|
220
|
-
// object. Usually, we would put that in a useRef hook, but we can stash it in
|
|
221
|
-
// our useState hook instead.
|
|
222
|
-
//
|
|
223
|
-
// To force a re-render, we call forceUpdate({inst}). That works because the
|
|
224
|
-
// new object always fails an equality check.
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var _useState = useState({
|
|
228
|
-
inst: {
|
|
229
|
-
value: value,
|
|
230
|
-
getSnapshot: getSnapshot
|
|
231
|
-
}
|
|
232
|
-
}),
|
|
233
|
-
inst = _useState[0].inst,
|
|
234
|
-
forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
|
|
235
|
-
// in the layout phase so we can access it during the tearing check that
|
|
236
|
-
// happens on subscribe.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
useLayoutEffect(function () {
|
|
240
|
-
inst.value = value;
|
|
241
|
-
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
242
|
-
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
243
|
-
// this can happen all the time, but even in synchronous mode, an earlier
|
|
244
|
-
// effect may have mutated the store.
|
|
245
|
-
|
|
246
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
247
|
-
// Force a re-render.
|
|
248
|
-
forceUpdate({
|
|
249
|
-
inst: inst
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}, [subscribe, value, getSnapshot]);
|
|
253
|
-
useEffect(function () {
|
|
254
|
-
// Check for changes right before subscribing. Subsequent changes will be
|
|
255
|
-
// detected in the subscription handler.
|
|
256
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
257
|
-
// Force a re-render.
|
|
258
|
-
forceUpdate({
|
|
259
|
-
inst: inst
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
var handleStoreChange = function () {
|
|
264
|
-
// TODO: Because there is no cross-renderer API for batching updates, it's
|
|
265
|
-
// up to the consumer of this library to wrap their subscription event
|
|
266
|
-
// with unstable_batchedUpdates. Should we try to detect when this isn't
|
|
267
|
-
// the case and print a warning in development?
|
|
268
|
-
// The store changed. Check if the snapshot changed since the last time we
|
|
269
|
-
// read from the store.
|
|
270
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
271
|
-
// Force a re-render.
|
|
272
|
-
forceUpdate({
|
|
273
|
-
inst: inst
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}; // Subscribe to the store and return a clean-up function.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return subscribe(handleStoreChange);
|
|
280
|
-
}, [subscribe]);
|
|
281
|
-
useDebugValue(value);
|
|
282
|
-
return value;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function checkIfSnapshotChanged(inst) {
|
|
286
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
287
|
-
var prevValue = inst.value;
|
|
288
|
-
|
|
289
|
-
try {
|
|
290
|
-
var nextValue = latestGetSnapshot();
|
|
291
|
-
return !objectIs(prevValue, nextValue);
|
|
292
|
-
} catch (error) {
|
|
293
|
-
return true;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
298
|
-
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
299
|
-
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
300
|
-
// will need to track that themselves and return the correct value
|
|
301
|
-
// from `getSnapshot`.
|
|
302
|
-
return getSnapshot();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
|
306
|
-
|
|
307
|
-
var isServerEnvironment = !canUseDOM;
|
|
308
|
-
|
|
309
|
-
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
310
|
-
var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
|
|
311
|
-
|
|
312
|
-
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
313
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
314
|
-
if (
|
|
315
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
316
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
317
|
-
'function'
|
|
318
|
-
) {
|
|
319
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
})();
|
|
323
|
-
}
|
|
324
|
-
return useSyncExternalStoreShim_development;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
var hasRequiredShim;
|
|
328
|
-
|
|
329
|
-
function requireShim () {
|
|
330
|
-
if (hasRequiredShim) return shim.exports;
|
|
331
|
-
hasRequiredShim = 1;
|
|
332
|
-
(function (module) {
|
|
333
|
-
|
|
334
|
-
if (process.env.NODE_ENV === 'production') {
|
|
335
|
-
module.exports = requireUseSyncExternalStoreShim_production_min();
|
|
336
|
-
} else {
|
|
337
|
-
module.exports = requireUseSyncExternalStoreShim_development();
|
|
338
|
-
}
|
|
339
|
-
} (shim));
|
|
340
|
-
return shim.exports;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* @license React
|
|
345
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
346
|
-
*
|
|
347
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the MIT license found in the
|
|
350
|
-
* LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/
|
|
352
|
-
|
|
353
|
-
var hasRequiredWithSelector_production_min;
|
|
354
|
-
|
|
355
|
-
function requireWithSelector_production_min () {
|
|
356
|
-
if (hasRequiredWithSelector_production_min) return withSelector_production_min;
|
|
357
|
-
hasRequiredWithSelector_production_min = 1;
|
|
358
|
-
var h=React__default["default"],n=requireShim();function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q="function"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;
|
|
359
|
-
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);
|
|
360
|
-
u(function(){f.hasValue=!0;f.value=d;},[d]);w(d);return d};
|
|
361
|
-
return withSelector_production_min;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
var withSelector_development = {};
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* @license React
|
|
368
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
369
|
-
*
|
|
370
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the MIT license found in the
|
|
373
|
-
* LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/
|
|
375
|
-
|
|
376
|
-
var hasRequiredWithSelector_development;
|
|
377
|
-
|
|
378
|
-
function requireWithSelector_development () {
|
|
379
|
-
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
380
|
-
hasRequiredWithSelector_development = 1;
|
|
381
|
-
|
|
382
|
-
if (process.env.NODE_ENV !== "production") {
|
|
383
|
-
(function() {
|
|
384
|
-
|
|
385
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
386
|
-
if (
|
|
387
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
388
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
389
|
-
'function'
|
|
390
|
-
) {
|
|
391
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
392
|
-
}
|
|
393
|
-
var React = React__default["default"];
|
|
394
|
-
var shim = requireShim();
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
398
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
399
|
-
*/
|
|
400
|
-
function is(x, y) {
|
|
401
|
-
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
402
|
-
;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
406
|
-
|
|
407
|
-
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
408
|
-
|
|
409
|
-
// for CommonJS interop.
|
|
410
|
-
|
|
411
|
-
var useRef = React.useRef,
|
|
412
|
-
useEffect = React.useEffect,
|
|
413
|
-
useMemo = React.useMemo,
|
|
414
|
-
useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.
|
|
415
|
-
|
|
416
|
-
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
417
|
-
// Use this to track the rendered snapshot.
|
|
418
|
-
var instRef = useRef(null);
|
|
419
|
-
var inst;
|
|
420
|
-
|
|
421
|
-
if (instRef.current === null) {
|
|
422
|
-
inst = {
|
|
423
|
-
hasValue: false,
|
|
424
|
-
value: null
|
|
425
|
-
};
|
|
426
|
-
instRef.current = inst;
|
|
427
|
-
} else {
|
|
428
|
-
inst = instRef.current;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
var _useMemo = useMemo(function () {
|
|
432
|
-
// Track the memoized state using closure variables that are local to this
|
|
433
|
-
// memoized instance of a getSnapshot function. Intentionally not using a
|
|
434
|
-
// useRef hook, because that state would be shared across all concurrent
|
|
435
|
-
// copies of the hook/component.
|
|
436
|
-
var hasMemo = false;
|
|
437
|
-
var memoizedSnapshot;
|
|
438
|
-
var memoizedSelection;
|
|
439
|
-
|
|
440
|
-
var memoizedSelector = function (nextSnapshot) {
|
|
441
|
-
if (!hasMemo) {
|
|
442
|
-
// The first time the hook is called, there is no memoized result.
|
|
443
|
-
hasMemo = true;
|
|
444
|
-
memoizedSnapshot = nextSnapshot;
|
|
445
|
-
|
|
446
|
-
var _nextSelection = selector(nextSnapshot);
|
|
447
|
-
|
|
448
|
-
if (isEqual !== undefined) {
|
|
449
|
-
// Even if the selector has changed, the currently rendered selection
|
|
450
|
-
// may be equal to the new selection. We should attempt to reuse the
|
|
451
|
-
// current value if possible, to preserve downstream memoizations.
|
|
452
|
-
if (inst.hasValue) {
|
|
453
|
-
var currentSelection = inst.value;
|
|
454
|
-
|
|
455
|
-
if (isEqual(currentSelection, _nextSelection)) {
|
|
456
|
-
memoizedSelection = currentSelection;
|
|
457
|
-
return currentSelection;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
memoizedSelection = _nextSelection;
|
|
463
|
-
return _nextSelection;
|
|
464
|
-
} // We may be able to reuse the previous invocation's result.
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
// We may be able to reuse the previous invocation's result.
|
|
468
|
-
var prevSnapshot = memoizedSnapshot;
|
|
469
|
-
var prevSelection = memoizedSelection;
|
|
470
|
-
|
|
471
|
-
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
472
|
-
// The snapshot is the same as last time. Reuse the previous selection.
|
|
473
|
-
return prevSelection;
|
|
474
|
-
} // The snapshot has changed, so we need to compute a new selection.
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
// The snapshot has changed, so we need to compute a new selection.
|
|
478
|
-
var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data
|
|
479
|
-
// has changed. If it hasn't, return the previous selection. That signals
|
|
480
|
-
// to React that the selections are conceptually equal, and we can bail
|
|
481
|
-
// out of rendering.
|
|
482
|
-
|
|
483
|
-
// If a custom isEqual function is provided, use that to check if the data
|
|
484
|
-
// has changed. If it hasn't, return the previous selection. That signals
|
|
485
|
-
// to React that the selections are conceptually equal, and we can bail
|
|
486
|
-
// out of rendering.
|
|
487
|
-
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
|
|
488
|
-
return prevSelection;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
memoizedSnapshot = nextSnapshot;
|
|
492
|
-
memoizedSelection = nextSelection;
|
|
493
|
-
return nextSelection;
|
|
494
|
-
}; // Assigning this to a constant so that Flow knows it can't change.
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
// Assigning this to a constant so that Flow knows it can't change.
|
|
498
|
-
var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;
|
|
499
|
-
|
|
500
|
-
var getSnapshotWithSelector = function () {
|
|
501
|
-
return memoizedSelector(getSnapshot());
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {
|
|
505
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
506
|
-
};
|
|
507
|
-
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
508
|
-
}, [getSnapshot, getServerSnapshot, selector, isEqual]),
|
|
509
|
-
getSelection = _useMemo[0],
|
|
510
|
-
getServerSelection = _useMemo[1];
|
|
511
|
-
|
|
512
|
-
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
513
|
-
useEffect(function () {
|
|
514
|
-
inst.hasValue = true;
|
|
515
|
-
inst.value = value;
|
|
516
|
-
}, [value]);
|
|
517
|
-
useDebugValue(value);
|
|
518
|
-
return value;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
withSelector_development.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
|
|
522
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
523
|
-
if (
|
|
524
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
525
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
526
|
-
'function'
|
|
527
|
-
) {
|
|
528
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
})();
|
|
532
|
-
}
|
|
533
|
-
return withSelector_development;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
(function (module) {
|
|
537
|
-
|
|
538
|
-
if (process.env.NODE_ENV === 'production') {
|
|
539
|
-
module.exports = requireWithSelector_production_min();
|
|
540
|
-
} else {
|
|
541
|
-
module.exports = requireWithSelector_development();
|
|
542
|
-
}
|
|
543
|
-
} (withSelector));
|
|
544
|
-
|
|
545
|
-
var useSyncExternalStoreExports = /*@__PURE__*/getDefaultExportFromCjs(withSelector.exports);
|
|
546
|
-
|
|
547
|
-
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
548
|
-
function useStore(api, selector = api.getState, equalityFn) {
|
|
549
|
-
const slice = useSyncExternalStoreWithSelector(
|
|
550
|
-
api.subscribe,
|
|
551
|
-
api.getState,
|
|
552
|
-
api.getServerState || api.getState,
|
|
553
|
-
selector,
|
|
554
|
-
equalityFn
|
|
555
|
-
);
|
|
556
|
-
React.useDebugValue(slice);
|
|
557
|
-
return slice;
|
|
558
|
-
}
|
|
559
|
-
const createImpl = (createState) => {
|
|
560
|
-
if ((undefined && undefined.MODE) !== "production" && typeof createState !== "function") {
|
|
561
|
-
console.warn(
|
|
562
|
-
'[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.'
|
|
563
|
-
);
|
|
564
|
-
}
|
|
565
|
-
const api = typeof createState === "function" ? createStore(createState) : createState;
|
|
566
|
-
const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
|
|
567
|
-
Object.assign(useBoundStore, api);
|
|
568
|
-
return useBoundStore;
|
|
569
|
-
};
|
|
570
|
-
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
571
|
-
|
|
572
|
-
function shallow(objA, objB) {
|
|
573
|
-
if (Object.is(objA, objB)) {
|
|
574
|
-
return true;
|
|
575
|
-
}
|
|
576
|
-
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
|
577
|
-
return false;
|
|
578
|
-
}
|
|
579
|
-
if (objA instanceof Map && objB instanceof Map) {
|
|
580
|
-
if (objA.size !== objB.size)
|
|
581
|
-
return false;
|
|
582
|
-
for (const [key, value] of objA) {
|
|
583
|
-
if (!Object.is(value, objB.get(key))) {
|
|
584
|
-
return false;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
return true;
|
|
588
|
-
}
|
|
589
|
-
if (objA instanceof Set && objB instanceof Set) {
|
|
590
|
-
if (objA.size !== objB.size)
|
|
591
|
-
return false;
|
|
592
|
-
for (const value of objA) {
|
|
593
|
-
if (!objB.has(value)) {
|
|
594
|
-
return false;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
return true;
|
|
598
|
-
}
|
|
599
|
-
const keysA = Object.keys(objA);
|
|
600
|
-
if (keysA.length !== Object.keys(objB).length) {
|
|
601
|
-
return false;
|
|
602
|
-
}
|
|
603
|
-
for (let i = 0; i < keysA.length; i++) {
|
|
604
|
-
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
|
|
605
|
-
return false;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
return true;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
612
|
-
var useKeyboardShortcutsStore = create(reactUtils.withImmutableActions(function (set) {
|
|
613
|
-
return {
|
|
614
|
-
isOpen: false,
|
|
615
|
-
setIsOpen: function setIsOpen(arg) {
|
|
616
|
-
if (typeof arg === "function") {
|
|
617
|
-
set(function (state) {
|
|
618
|
-
return {
|
|
619
|
-
isOpen: arg(state.isOpen)
|
|
620
|
-
};
|
|
621
|
-
});
|
|
622
|
-
} else {
|
|
623
|
-
set({
|
|
624
|
-
isOpen: arg
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
}));
|
|
630
|
-
var useKeyboardShortcutsPaneState = function useKeyboardShortcutsPaneState() {
|
|
631
|
-
return useKeyboardShortcutsStore(function (_ref) {
|
|
632
|
-
var isOpen = _ref.isOpen,
|
|
633
|
-
setIsOpen = _ref.setIsOpen;
|
|
634
|
-
return [isOpen, setIsOpen];
|
|
635
|
-
}, shallow);
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
function _arrayWithHoles(arr) {
|
|
639
|
-
if (Array.isArray(arr)) return arr;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
function _iterableToArrayLimit(arr, i) {
|
|
643
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
644
|
-
if (null != _i) {
|
|
645
|
-
var _s,
|
|
646
|
-
_e,
|
|
647
|
-
_x,
|
|
648
|
-
_r,
|
|
649
|
-
_arr = [],
|
|
650
|
-
_n = !0,
|
|
651
|
-
_d = !1;
|
|
652
|
-
try {
|
|
653
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
654
|
-
if (Object(_i) !== _i) return;
|
|
655
|
-
_n = !1;
|
|
656
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
657
|
-
} catch (err) {
|
|
658
|
-
_d = !0, _e = err;
|
|
659
|
-
} finally {
|
|
660
|
-
try {
|
|
661
|
-
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
662
|
-
} finally {
|
|
663
|
-
if (_d) throw _e;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
return _arr;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
function _arrayLikeToArray(arr, len) {
|
|
671
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
672
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
673
|
-
return arr2;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
677
|
-
if (!o) return;
|
|
678
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
679
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
680
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
681
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
682
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
function _nonIterableRest() {
|
|
686
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
function _slicedToArray(arr, i) {
|
|
690
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
var classnames$1 = {exports: {}};
|
|
694
|
-
|
|
695
|
-
/*!
|
|
696
|
-
Copyright (c) 2018 Jed Watson.
|
|
697
|
-
Licensed under the MIT License (MIT), see
|
|
698
|
-
http://jedwatson.github.io/classnames
|
|
699
|
-
*/
|
|
700
|
-
|
|
701
|
-
(function (module) {
|
|
702
|
-
/* global define */
|
|
703
|
-
|
|
704
|
-
(function () {
|
|
705
|
-
|
|
706
|
-
var hasOwn = {}.hasOwnProperty;
|
|
707
|
-
|
|
708
|
-
function classNames() {
|
|
709
|
-
var classes = [];
|
|
710
|
-
|
|
711
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
712
|
-
var arg = arguments[i];
|
|
713
|
-
if (!arg) continue;
|
|
714
|
-
|
|
715
|
-
var argType = typeof arg;
|
|
716
|
-
|
|
717
|
-
if (argType === 'string' || argType === 'number') {
|
|
718
|
-
classes.push(arg);
|
|
719
|
-
} else if (Array.isArray(arg)) {
|
|
720
|
-
if (arg.length) {
|
|
721
|
-
var inner = classNames.apply(null, arg);
|
|
722
|
-
if (inner) {
|
|
723
|
-
classes.push(inner);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
} else if (argType === 'object') {
|
|
727
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
728
|
-
classes.push(arg.toString());
|
|
729
|
-
continue;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
for (var key in arg) {
|
|
733
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
734
|
-
classes.push(key);
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
return classes.join(' ');
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
if (module.exports) {
|
|
744
|
-
classNames.default = classNames;
|
|
745
|
-
module.exports = classNames;
|
|
746
|
-
} else {
|
|
747
|
-
window.classNames = classNames;
|
|
748
|
-
}
|
|
749
|
-
}());
|
|
750
|
-
} (classnames$1));
|
|
751
|
-
|
|
752
|
-
var classnames = classnames$1.exports;
|
|
753
|
-
|
|
754
|
-
var KEY_SHORTFORM_MAP = {
|
|
755
|
-
command: "⌘",
|
|
756
|
-
escape: "esc",
|
|
757
|
-
control: "ctrl",
|
|
758
|
-
option: "opt",
|
|
759
|
-
"return": "enter"
|
|
760
|
-
};
|
|
761
|
-
var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
762
|
-
option: "alt",
|
|
763
|
-
command: "ctrl",
|
|
764
|
-
"return": "enter",
|
|
765
|
-
"delete": "backspace"
|
|
766
|
-
};
|
|
767
|
-
var OS = {
|
|
768
|
-
mac: "OS X",
|
|
769
|
-
windows: "Windows"
|
|
770
|
-
};
|
|
771
|
-
var FULL_SHORTCUTS_LINK_PROP_NAME = "fullShortcutsLink";
|
|
772
|
-
var TOOLTIP_CONTENT = {
|
|
773
|
-
"⌘": "command",
|
|
774
|
-
esc: "escape",
|
|
775
|
-
ctrl: "control",
|
|
776
|
-
opt: "option",
|
|
777
|
-
backspace: "delete"
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
function _typeof(obj) {
|
|
781
|
-
"@babel/helpers - typeof";
|
|
782
|
-
|
|
783
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
784
|
-
return typeof obj;
|
|
785
|
-
} : function (obj) {
|
|
786
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
787
|
-
}, _typeof(obj);
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
function _toPrimitive(input, hint) {
|
|
791
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
792
|
-
var prim = input[Symbol.toPrimitive];
|
|
793
|
-
if (prim !== undefined) {
|
|
794
|
-
var res = prim.call(input, hint || "default");
|
|
795
|
-
if (_typeof(res) !== "object") return res;
|
|
796
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
797
|
-
}
|
|
798
|
-
return (hint === "string" ? String : Number)(input);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
function _toPropertyKey(arg) {
|
|
802
|
-
var key = _toPrimitive(arg, "string");
|
|
803
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
function _defineProperty(obj, key, value) {
|
|
807
|
-
key = _toPropertyKey(key);
|
|
808
|
-
if (key in obj) {
|
|
809
|
-
Object.defineProperty(obj, key, {
|
|
810
|
-
value: value,
|
|
811
|
-
enumerable: true,
|
|
812
|
-
configurable: true,
|
|
813
|
-
writable: true
|
|
814
|
-
});
|
|
815
|
-
} else {
|
|
816
|
-
obj[key] = value;
|
|
817
|
-
}
|
|
818
|
-
return obj;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
var platform$1 = {exports: {}};
|
|
822
|
-
|
|
823
|
-
/*!
|
|
824
|
-
* Platform.js v1.3.6
|
|
825
|
-
* Copyright 2014-2020 Benjamin Tan
|
|
826
|
-
* Copyright 2011-2013 John-David Dalton
|
|
827
|
-
* Available under MIT license
|
|
828
|
-
*/
|
|
829
|
-
|
|
830
|
-
(function (module, exports) {
|
|
831
|
-
(function() {
|
|
832
|
-
|
|
833
|
-
/** Used to determine if values are of the language type `Object`. */
|
|
834
|
-
var objectTypes = {
|
|
835
|
-
'function': true,
|
|
836
|
-
'object': true
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
/** Used as a reference to the global object. */
|
|
840
|
-
var root = (objectTypes[typeof window] && window) || this;
|
|
841
|
-
|
|
842
|
-
/** Detect free variable `exports`. */
|
|
843
|
-
var freeExports = exports;
|
|
844
|
-
|
|
845
|
-
/** Detect free variable `module`. */
|
|
846
|
-
var freeModule = module && !module.nodeType && module;
|
|
847
|
-
|
|
848
|
-
/** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
|
|
849
|
-
var freeGlobal = freeExports && freeModule && typeof commonjsGlobal == 'object' && commonjsGlobal;
|
|
850
|
-
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
|
|
851
|
-
root = freeGlobal;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* Used as the maximum length of an array-like object.
|
|
856
|
-
* See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
|
|
857
|
-
* for more details.
|
|
858
|
-
*/
|
|
859
|
-
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
860
|
-
|
|
861
|
-
/** Regular expression to detect Opera. */
|
|
862
|
-
var reOpera = /\bOpera/;
|
|
863
|
-
|
|
864
|
-
/** Used for native method references. */
|
|
865
|
-
var objectProto = Object.prototype;
|
|
866
|
-
|
|
867
|
-
/** Used to check for own properties of an object. */
|
|
868
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
869
|
-
|
|
870
|
-
/** Used to resolve the internal `[[Class]]` of values. */
|
|
871
|
-
var toString = objectProto.toString;
|
|
872
|
-
|
|
873
|
-
/*--------------------------------------------------------------------------*/
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* Capitalizes a string value.
|
|
877
|
-
*
|
|
878
|
-
* @private
|
|
879
|
-
* @param {string} string The string to capitalize.
|
|
880
|
-
* @returns {string} The capitalized string.
|
|
881
|
-
*/
|
|
882
|
-
function capitalize(string) {
|
|
883
|
-
string = String(string);
|
|
884
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* A utility function to clean up the OS name.
|
|
889
|
-
*
|
|
890
|
-
* @private
|
|
891
|
-
* @param {string} os The OS name to clean up.
|
|
892
|
-
* @param {string} [pattern] A `RegExp` pattern matching the OS name.
|
|
893
|
-
* @param {string} [label] A label for the OS.
|
|
894
|
-
*/
|
|
895
|
-
function cleanupOS(os, pattern, label) {
|
|
896
|
-
// Platform tokens are defined at:
|
|
897
|
-
// http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
898
|
-
// http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
899
|
-
var data = {
|
|
900
|
-
'10.0': '10',
|
|
901
|
-
'6.4': '10 Technical Preview',
|
|
902
|
-
'6.3': '8.1',
|
|
903
|
-
'6.2': '8',
|
|
904
|
-
'6.1': 'Server 2008 R2 / 7',
|
|
905
|
-
'6.0': 'Server 2008 / Vista',
|
|
906
|
-
'5.2': 'Server 2003 / XP 64-bit',
|
|
907
|
-
'5.1': 'XP',
|
|
908
|
-
'5.01': '2000 SP1',
|
|
909
|
-
'5.0': '2000',
|
|
910
|
-
'4.0': 'NT',
|
|
911
|
-
'4.90': 'ME'
|
|
912
|
-
};
|
|
913
|
-
// Detect Windows version from platform tokens.
|
|
914
|
-
if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) &&
|
|
915
|
-
(data = data[/[\d.]+$/.exec(os)])) {
|
|
916
|
-
os = 'Windows ' + data;
|
|
917
|
-
}
|
|
918
|
-
// Correct character case and cleanup string.
|
|
919
|
-
os = String(os);
|
|
920
|
-
|
|
921
|
-
if (pattern && label) {
|
|
922
|
-
os = os.replace(RegExp(pattern, 'i'), label);
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
os = format(
|
|
926
|
-
os.replace(/ ce$/i, ' CE')
|
|
927
|
-
.replace(/\bhpw/i, 'web')
|
|
928
|
-
.replace(/\bMacintosh\b/, 'Mac OS')
|
|
929
|
-
.replace(/_PowerPC\b/i, ' OS')
|
|
930
|
-
.replace(/\b(OS X) [^ \d]+/i, '$1')
|
|
931
|
-
.replace(/\bMac (OS X)\b/, '$1')
|
|
932
|
-
.replace(/\/(\d)/, ' $1')
|
|
933
|
-
.replace(/_/g, '.')
|
|
934
|
-
.replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
|
|
935
|
-
.replace(/\bx86\.64\b/gi, 'x86_64')
|
|
936
|
-
.replace(/\b(Windows Phone) OS\b/, '$1')
|
|
937
|
-
.replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1')
|
|
938
|
-
.split(' on ')[0]
|
|
939
|
-
);
|
|
940
|
-
|
|
941
|
-
return os;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* An iteration utility for arrays and objects.
|
|
946
|
-
*
|
|
947
|
-
* @private
|
|
948
|
-
* @param {Array|Object} object The object to iterate over.
|
|
949
|
-
* @param {Function} callback The function called per iteration.
|
|
950
|
-
*/
|
|
951
|
-
function each(object, callback) {
|
|
952
|
-
var index = -1,
|
|
953
|
-
length = object ? object.length : 0;
|
|
954
|
-
|
|
955
|
-
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
|
|
956
|
-
while (++index < length) {
|
|
957
|
-
callback(object[index], index, object);
|
|
958
|
-
}
|
|
959
|
-
} else {
|
|
960
|
-
forOwn(object, callback);
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
/**
|
|
965
|
-
* Trim and conditionally capitalize string values.
|
|
966
|
-
*
|
|
967
|
-
* @private
|
|
968
|
-
* @param {string} string The string to format.
|
|
969
|
-
* @returns {string} The formatted string.
|
|
970
|
-
*/
|
|
971
|
-
function format(string) {
|
|
972
|
-
string = trim(string);
|
|
973
|
-
return /^(?:webOS|i(?:OS|P))/.test(string)
|
|
974
|
-
? string
|
|
975
|
-
: capitalize(string);
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* Iterates over an object's own properties, executing the `callback` for each.
|
|
980
|
-
*
|
|
981
|
-
* @private
|
|
982
|
-
* @param {Object} object The object to iterate over.
|
|
983
|
-
* @param {Function} callback The function executed per own property.
|
|
984
|
-
*/
|
|
985
|
-
function forOwn(object, callback) {
|
|
986
|
-
for (var key in object) {
|
|
987
|
-
if (hasOwnProperty.call(object, key)) {
|
|
988
|
-
callback(object[key], key, object);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* Gets the internal `[[Class]]` of a value.
|
|
995
|
-
*
|
|
996
|
-
* @private
|
|
997
|
-
* @param {*} value The value.
|
|
998
|
-
* @returns {string} The `[[Class]]`.
|
|
999
|
-
*/
|
|
1000
|
-
function getClassOf(value) {
|
|
1001
|
-
return value == null
|
|
1002
|
-
? capitalize(value)
|
|
1003
|
-
: toString.call(value).slice(8, -1);
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
/**
|
|
1007
|
-
* Host objects can return type values that are different from their actual
|
|
1008
|
-
* data type. The objects we are concerned with usually return non-primitive
|
|
1009
|
-
* types of "object", "function", or "unknown".
|
|
1010
|
-
*
|
|
1011
|
-
* @private
|
|
1012
|
-
* @param {*} object The owner of the property.
|
|
1013
|
-
* @param {string} property The property to check.
|
|
1014
|
-
* @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
|
|
1015
|
-
*/
|
|
1016
|
-
function isHostType(object, property) {
|
|
1017
|
-
var type = object != null ? typeof object[property] : 'number';
|
|
1018
|
-
return !/^(?:boolean|number|string|undefined)$/.test(type) &&
|
|
1019
|
-
(type == 'object' ? !!object[property] : true);
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
/**
|
|
1023
|
-
* Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
|
|
1024
|
-
*
|
|
1025
|
-
* @private
|
|
1026
|
-
* @param {string} string The string to qualify.
|
|
1027
|
-
* @returns {string} The qualified string.
|
|
1028
|
-
*/
|
|
1029
|
-
function qualify(string) {
|
|
1030
|
-
return String(string).replace(/([ -])(?!$)/g, '$1?');
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
/**
|
|
1034
|
-
* A bare-bones `Array#reduce` like utility function.
|
|
1035
|
-
*
|
|
1036
|
-
* @private
|
|
1037
|
-
* @param {Array} array The array to iterate over.
|
|
1038
|
-
* @param {Function} callback The function called per iteration.
|
|
1039
|
-
* @returns {*} The accumulated result.
|
|
1040
|
-
*/
|
|
1041
|
-
function reduce(array, callback) {
|
|
1042
|
-
var accumulator = null;
|
|
1043
|
-
each(array, function(value, index) {
|
|
1044
|
-
accumulator = callback(accumulator, value, index, array);
|
|
1045
|
-
});
|
|
1046
|
-
return accumulator;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* Removes leading and trailing whitespace from a string.
|
|
1051
|
-
*
|
|
1052
|
-
* @private
|
|
1053
|
-
* @param {string} string The string to trim.
|
|
1054
|
-
* @returns {string} The trimmed string.
|
|
1055
|
-
*/
|
|
1056
|
-
function trim(string) {
|
|
1057
|
-
return String(string).replace(/^ +| +$/g, '');
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
/*--------------------------------------------------------------------------*/
|
|
1061
|
-
|
|
1062
|
-
/**
|
|
1063
|
-
* Creates a new platform object.
|
|
1064
|
-
*
|
|
1065
|
-
* @memberOf platform
|
|
1066
|
-
* @param {Object|string} [ua=navigator.userAgent] The user agent string or
|
|
1067
|
-
* context object.
|
|
1068
|
-
* @returns {Object} A platform object.
|
|
1069
|
-
*/
|
|
1070
|
-
function parse(ua) {
|
|
1071
|
-
|
|
1072
|
-
/** The environment context object. */
|
|
1073
|
-
var context = root;
|
|
1074
|
-
|
|
1075
|
-
/** Used to flag when a custom context is provided. */
|
|
1076
|
-
var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String';
|
|
1077
|
-
|
|
1078
|
-
// Juggle arguments.
|
|
1079
|
-
if (isCustomContext) {
|
|
1080
|
-
context = ua;
|
|
1081
|
-
ua = null;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
/** Browser navigator object. */
|
|
1085
|
-
var nav = context.navigator || {};
|
|
1086
|
-
|
|
1087
|
-
/** Browser user agent string. */
|
|
1088
|
-
var userAgent = nav.userAgent || '';
|
|
1089
|
-
|
|
1090
|
-
ua || (ua = userAgent);
|
|
1091
|
-
|
|
1092
|
-
/** Used to detect if browser is like Chrome. */
|
|
1093
|
-
var likeChrome = isCustomContext
|
|
1094
|
-
? !!nav.likeChrome
|
|
1095
|
-
: /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
|
|
1096
|
-
|
|
1097
|
-
/** Internal `[[Class]]` value shortcuts. */
|
|
1098
|
-
var objectClass = 'Object',
|
|
1099
|
-
airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
|
|
1100
|
-
enviroClass = isCustomContext ? objectClass : 'Environment',
|
|
1101
|
-
javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java),
|
|
1102
|
-
phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
|
|
1103
|
-
|
|
1104
|
-
/** Detect Java environments. */
|
|
1105
|
-
var java = /\bJava/.test(javaClass) && context.java;
|
|
1106
|
-
|
|
1107
|
-
/** Detect Rhino. */
|
|
1108
|
-
var rhino = java && getClassOf(context.environment) == enviroClass;
|
|
1109
|
-
|
|
1110
|
-
/** A character to represent alpha. */
|
|
1111
|
-
var alpha = java ? 'a' : '\u03b1';
|
|
1112
|
-
|
|
1113
|
-
/** A character to represent beta. */
|
|
1114
|
-
var beta = java ? 'b' : '\u03b2';
|
|
1115
|
-
|
|
1116
|
-
/** Browser document object. */
|
|
1117
|
-
var doc = context.document || {};
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* Detect Opera browser (Presto-based).
|
|
1121
|
-
* http://www.howtocreate.co.uk/operaStuff/operaObject.html
|
|
1122
|
-
* http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
|
|
1123
|
-
*/
|
|
1124
|
-
var opera = context.operamini || context.opera;
|
|
1125
|
-
|
|
1126
|
-
/** Opera `[[Class]]`. */
|
|
1127
|
-
var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
|
|
1128
|
-
? operaClass
|
|
1129
|
-
: (opera = null);
|
|
1130
|
-
|
|
1131
|
-
/*------------------------------------------------------------------------*/
|
|
1132
|
-
|
|
1133
|
-
/** Temporary variable used over the script's lifetime. */
|
|
1134
|
-
var data;
|
|
1135
|
-
|
|
1136
|
-
/** The CPU architecture. */
|
|
1137
|
-
var arch = ua;
|
|
1138
|
-
|
|
1139
|
-
/** Platform description array. */
|
|
1140
|
-
var description = [];
|
|
1141
|
-
|
|
1142
|
-
/** Platform alpha/beta indicator. */
|
|
1143
|
-
var prerelease = null;
|
|
1144
|
-
|
|
1145
|
-
/** A flag to indicate that environment features should be used to resolve the platform. */
|
|
1146
|
-
var useFeatures = ua == userAgent;
|
|
1147
|
-
|
|
1148
|
-
/** The browser/environment version. */
|
|
1149
|
-
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
|
|
1150
|
-
|
|
1151
|
-
/** A flag to indicate if the OS ends with "/ Version" */
|
|
1152
|
-
var isSpecialCasedOS;
|
|
1153
|
-
|
|
1154
|
-
/* Detectable layout engines (order is important). */
|
|
1155
|
-
var layout = getLayout([
|
|
1156
|
-
{ 'label': 'EdgeHTML', 'pattern': 'Edge' },
|
|
1157
|
-
'Trident',
|
|
1158
|
-
{ 'label': 'WebKit', 'pattern': 'AppleWebKit' },
|
|
1159
|
-
'iCab',
|
|
1160
|
-
'Presto',
|
|
1161
|
-
'NetFront',
|
|
1162
|
-
'Tasman',
|
|
1163
|
-
'KHTML',
|
|
1164
|
-
'Gecko'
|
|
1165
|
-
]);
|
|
1166
|
-
|
|
1167
|
-
/* Detectable browser names (order is important). */
|
|
1168
|
-
var name = getName([
|
|
1169
|
-
'Adobe AIR',
|
|
1170
|
-
'Arora',
|
|
1171
|
-
'Avant Browser',
|
|
1172
|
-
'Breach',
|
|
1173
|
-
'Camino',
|
|
1174
|
-
'Electron',
|
|
1175
|
-
'Epiphany',
|
|
1176
|
-
'Fennec',
|
|
1177
|
-
'Flock',
|
|
1178
|
-
'Galeon',
|
|
1179
|
-
'GreenBrowser',
|
|
1180
|
-
'iCab',
|
|
1181
|
-
'Iceweasel',
|
|
1182
|
-
'K-Meleon',
|
|
1183
|
-
'Konqueror',
|
|
1184
|
-
'Lunascape',
|
|
1185
|
-
'Maxthon',
|
|
1186
|
-
{ 'label': 'Microsoft Edge', 'pattern': '(?:Edge|Edg|EdgA|EdgiOS)' },
|
|
1187
|
-
'Midori',
|
|
1188
|
-
'Nook Browser',
|
|
1189
|
-
'PaleMoon',
|
|
1190
|
-
'PhantomJS',
|
|
1191
|
-
'Raven',
|
|
1192
|
-
'Rekonq',
|
|
1193
|
-
'RockMelt',
|
|
1194
|
-
{ 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' },
|
|
1195
|
-
'SeaMonkey',
|
|
1196
|
-
{ 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
|
|
1197
|
-
'Sleipnir',
|
|
1198
|
-
'SlimBrowser',
|
|
1199
|
-
{ 'label': 'SRWare Iron', 'pattern': 'Iron' },
|
|
1200
|
-
'Sunrise',
|
|
1201
|
-
'Swiftfox',
|
|
1202
|
-
'Vivaldi',
|
|
1203
|
-
'Waterfox',
|
|
1204
|
-
'WebPositive',
|
|
1205
|
-
{ 'label': 'Yandex Browser', 'pattern': 'YaBrowser' },
|
|
1206
|
-
{ 'label': 'UC Browser', 'pattern': 'UCBrowser' },
|
|
1207
|
-
'Opera Mini',
|
|
1208
|
-
{ 'label': 'Opera Mini', 'pattern': 'OPiOS' },
|
|
1209
|
-
'Opera',
|
|
1210
|
-
{ 'label': 'Opera', 'pattern': 'OPR' },
|
|
1211
|
-
'Chromium',
|
|
1212
|
-
'Chrome',
|
|
1213
|
-
{ 'label': 'Chrome', 'pattern': '(?:HeadlessChrome)' },
|
|
1214
|
-
{ 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' },
|
|
1215
|
-
{ 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' },
|
|
1216
|
-
{ 'label': 'Firefox for iOS', 'pattern': 'FxiOS' },
|
|
1217
|
-
{ 'label': 'IE', 'pattern': 'IEMobile' },
|
|
1218
|
-
{ 'label': 'IE', 'pattern': 'MSIE' },
|
|
1219
|
-
'Safari'
|
|
1220
|
-
]);
|
|
1221
|
-
|
|
1222
|
-
/* Detectable products (order is important). */
|
|
1223
|
-
var product = getProduct([
|
|
1224
|
-
{ 'label': 'BlackBerry', 'pattern': 'BB10' },
|
|
1225
|
-
'BlackBerry',
|
|
1226
|
-
{ 'label': 'Galaxy S', 'pattern': 'GT-I9000' },
|
|
1227
|
-
{ 'label': 'Galaxy S2', 'pattern': 'GT-I9100' },
|
|
1228
|
-
{ 'label': 'Galaxy S3', 'pattern': 'GT-I9300' },
|
|
1229
|
-
{ 'label': 'Galaxy S4', 'pattern': 'GT-I9500' },
|
|
1230
|
-
{ 'label': 'Galaxy S5', 'pattern': 'SM-G900' },
|
|
1231
|
-
{ 'label': 'Galaxy S6', 'pattern': 'SM-G920' },
|
|
1232
|
-
{ 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' },
|
|
1233
|
-
{ 'label': 'Galaxy S7', 'pattern': 'SM-G930' },
|
|
1234
|
-
{ 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' },
|
|
1235
|
-
'Google TV',
|
|
1236
|
-
'Lumia',
|
|
1237
|
-
'iPad',
|
|
1238
|
-
'iPod',
|
|
1239
|
-
'iPhone',
|
|
1240
|
-
'Kindle',
|
|
1241
|
-
{ 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
|
|
1242
|
-
'Nexus',
|
|
1243
|
-
'Nook',
|
|
1244
|
-
'PlayBook',
|
|
1245
|
-
'PlayStation Vita',
|
|
1246
|
-
'PlayStation',
|
|
1247
|
-
'TouchPad',
|
|
1248
|
-
'Transformer',
|
|
1249
|
-
{ 'label': 'Wii U', 'pattern': 'WiiU' },
|
|
1250
|
-
'Wii',
|
|
1251
|
-
'Xbox One',
|
|
1252
|
-
{ 'label': 'Xbox 360', 'pattern': 'Xbox' },
|
|
1253
|
-
'Xoom'
|
|
1254
|
-
]);
|
|
1255
|
-
|
|
1256
|
-
/* Detectable manufacturers. */
|
|
1257
|
-
var manufacturer = getManufacturer({
|
|
1258
|
-
'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 },
|
|
1259
|
-
'Alcatel': {},
|
|
1260
|
-
'Archos': {},
|
|
1261
|
-
'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 },
|
|
1262
|
-
'Asus': { 'Transformer': 1 },
|
|
1263
|
-
'Barnes & Noble': { 'Nook': 1 },
|
|
1264
|
-
'BlackBerry': { 'PlayBook': 1 },
|
|
1265
|
-
'Google': { 'Google TV': 1, 'Nexus': 1 },
|
|
1266
|
-
'HP': { 'TouchPad': 1 },
|
|
1267
|
-
'HTC': {},
|
|
1268
|
-
'Huawei': {},
|
|
1269
|
-
'Lenovo': {},
|
|
1270
|
-
'LG': {},
|
|
1271
|
-
'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
|
|
1272
|
-
'Motorola': { 'Xoom': 1 },
|
|
1273
|
-
'Nintendo': { 'Wii U': 1, 'Wii': 1 },
|
|
1274
|
-
'Nokia': { 'Lumia': 1 },
|
|
1275
|
-
'Oppo': {},
|
|
1276
|
-
'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
|
|
1277
|
-
'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 },
|
|
1278
|
-
'Xiaomi': { 'Mi': 1, 'Redmi': 1 }
|
|
1279
|
-
});
|
|
1280
|
-
|
|
1281
|
-
/* Detectable operating systems (order is important). */
|
|
1282
|
-
var os = getOS([
|
|
1283
|
-
'Windows Phone',
|
|
1284
|
-
'KaiOS',
|
|
1285
|
-
'Android',
|
|
1286
|
-
'CentOS',
|
|
1287
|
-
{ 'label': 'Chrome OS', 'pattern': 'CrOS' },
|
|
1288
|
-
'Debian',
|
|
1289
|
-
{ 'label': 'DragonFly BSD', 'pattern': 'DragonFly' },
|
|
1290
|
-
'Fedora',
|
|
1291
|
-
'FreeBSD',
|
|
1292
|
-
'Gentoo',
|
|
1293
|
-
'Haiku',
|
|
1294
|
-
'Kubuntu',
|
|
1295
|
-
'Linux Mint',
|
|
1296
|
-
'OpenBSD',
|
|
1297
|
-
'Red Hat',
|
|
1298
|
-
'SuSE',
|
|
1299
|
-
'Ubuntu',
|
|
1300
|
-
'Xubuntu',
|
|
1301
|
-
'Cygwin',
|
|
1302
|
-
'Symbian OS',
|
|
1303
|
-
'hpwOS',
|
|
1304
|
-
'webOS ',
|
|
1305
|
-
'webOS',
|
|
1306
|
-
'Tablet OS',
|
|
1307
|
-
'Tizen',
|
|
1308
|
-
'Linux',
|
|
1309
|
-
'Mac OS X',
|
|
1310
|
-
'Macintosh',
|
|
1311
|
-
'Mac',
|
|
1312
|
-
'Windows 98;',
|
|
1313
|
-
'Windows '
|
|
1314
|
-
]);
|
|
1315
|
-
|
|
1316
|
-
/*------------------------------------------------------------------------*/
|
|
1317
|
-
|
|
1318
|
-
/**
|
|
1319
|
-
* Picks the layout engine from an array of guesses.
|
|
1320
|
-
*
|
|
1321
|
-
* @private
|
|
1322
|
-
* @param {Array} guesses An array of guesses.
|
|
1323
|
-
* @returns {null|string} The detected layout engine.
|
|
1324
|
-
*/
|
|
1325
|
-
function getLayout(guesses) {
|
|
1326
|
-
return reduce(guesses, function(result, guess) {
|
|
1327
|
-
return result || RegExp('\\b' + (
|
|
1328
|
-
guess.pattern || qualify(guess)
|
|
1329
|
-
) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
1330
|
-
});
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
/**
|
|
1334
|
-
* Picks the manufacturer from an array of guesses.
|
|
1335
|
-
*
|
|
1336
|
-
* @private
|
|
1337
|
-
* @param {Array} guesses An object of guesses.
|
|
1338
|
-
* @returns {null|string} The detected manufacturer.
|
|
1339
|
-
*/
|
|
1340
|
-
function getManufacturer(guesses) {
|
|
1341
|
-
return reduce(guesses, function(result, value, key) {
|
|
1342
|
-
// Lookup the manufacturer by product or scan the UA for the manufacturer.
|
|
1343
|
-
return result || (
|
|
1344
|
-
value[product] ||
|
|
1345
|
-
value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] ||
|
|
1346
|
-
RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)
|
|
1347
|
-
) && key;
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
/**
|
|
1352
|
-
* Picks the browser name from an array of guesses.
|
|
1353
|
-
*
|
|
1354
|
-
* @private
|
|
1355
|
-
* @param {Array} guesses An array of guesses.
|
|
1356
|
-
* @returns {null|string} The detected browser name.
|
|
1357
|
-
*/
|
|
1358
|
-
function getName(guesses) {
|
|
1359
|
-
return reduce(guesses, function(result, guess) {
|
|
1360
|
-
return result || RegExp('\\b' + (
|
|
1361
|
-
guess.pattern || qualify(guess)
|
|
1362
|
-
) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
1363
|
-
});
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
/**
|
|
1367
|
-
* Picks the OS name from an array of guesses.
|
|
1368
|
-
*
|
|
1369
|
-
* @private
|
|
1370
|
-
* @param {Array} guesses An array of guesses.
|
|
1371
|
-
* @returns {null|string} The detected OS name.
|
|
1372
|
-
*/
|
|
1373
|
-
function getOS(guesses) {
|
|
1374
|
-
return reduce(guesses, function(result, guess) {
|
|
1375
|
-
var pattern = guess.pattern || qualify(guess);
|
|
1376
|
-
if (!result && (result =
|
|
1377
|
-
RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
|
|
1378
|
-
)) {
|
|
1379
|
-
result = cleanupOS(result, pattern, guess.label || guess);
|
|
1380
|
-
}
|
|
1381
|
-
return result;
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* Picks the product name from an array of guesses.
|
|
1387
|
-
*
|
|
1388
|
-
* @private
|
|
1389
|
-
* @param {Array} guesses An array of guesses.
|
|
1390
|
-
* @returns {null|string} The detected product name.
|
|
1391
|
-
*/
|
|
1392
|
-
function getProduct(guesses) {
|
|
1393
|
-
return reduce(guesses, function(result, guess) {
|
|
1394
|
-
var pattern = guess.pattern || qualify(guess);
|
|
1395
|
-
if (!result && (result =
|
|
1396
|
-
RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) ||
|
|
1397
|
-
RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) ||
|
|
1398
|
-
RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua)
|
|
1399
|
-
)) {
|
|
1400
|
-
// Split by forward slash and append product version if needed.
|
|
1401
|
-
if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
|
|
1402
|
-
result[0] += ' ' + result[1];
|
|
1403
|
-
}
|
|
1404
|
-
// Correct character case and cleanup string.
|
|
1405
|
-
guess = guess.label || guess;
|
|
1406
|
-
result = format(result[0]
|
|
1407
|
-
.replace(RegExp(pattern, 'i'), guess)
|
|
1408
|
-
.replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ')
|
|
1409
|
-
.replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
|
|
1410
|
-
}
|
|
1411
|
-
return result;
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* Resolves the version using an array of UA patterns.
|
|
1417
|
-
*
|
|
1418
|
-
* @private
|
|
1419
|
-
* @param {Array} patterns An array of UA patterns.
|
|
1420
|
-
* @returns {null|string} The detected version.
|
|
1421
|
-
*/
|
|
1422
|
-
function getVersion(patterns) {
|
|
1423
|
-
return reduce(patterns, function(result, pattern) {
|
|
1424
|
-
return result || (RegExp(pattern +
|
|
1425
|
-
'(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
/**
|
|
1430
|
-
* Returns `platform.description` when the platform object is coerced to a string.
|
|
1431
|
-
*
|
|
1432
|
-
* @name toString
|
|
1433
|
-
* @memberOf platform
|
|
1434
|
-
* @returns {string} Returns `platform.description` if available, else an empty string.
|
|
1435
|
-
*/
|
|
1436
|
-
function toStringPlatform() {
|
|
1437
|
-
return this.description || '';
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
/*------------------------------------------------------------------------*/
|
|
1441
|
-
|
|
1442
|
-
// Convert layout to an array so we can add extra details.
|
|
1443
|
-
layout && (layout = [layout]);
|
|
1444
|
-
|
|
1445
|
-
// Detect Android products.
|
|
1446
|
-
// Browsers on Android devices typically provide their product IDS after "Android;"
|
|
1447
|
-
// up to "Build" or ") AppleWebKit".
|
|
1448
|
-
// Example:
|
|
1449
|
-
// "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36
|
|
1450
|
-
// (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
|
|
1451
|
-
if (/\bAndroid\b/.test(os) && !product &&
|
|
1452
|
-
(data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
|
|
1453
|
-
product = trim(data[1])
|
|
1454
|
-
// Replace any language codes (eg. "en-US").
|
|
1455
|
-
.replace(/^[a-z]{2}-[a-z]{2};\s*/i, '')
|
|
1456
|
-
|| null;
|
|
1457
|
-
}
|
|
1458
|
-
// Detect product names that contain their manufacturer's name.
|
|
1459
|
-
if (manufacturer && !product) {
|
|
1460
|
-
product = getProduct([manufacturer]);
|
|
1461
|
-
} else if (manufacturer && product) {
|
|
1462
|
-
product = product
|
|
1463
|
-
.replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ')
|
|
1464
|
-
.replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2');
|
|
1465
|
-
}
|
|
1466
|
-
// Clean up Google TV.
|
|
1467
|
-
if ((data = /\bGoogle TV\b/.exec(product))) {
|
|
1468
|
-
product = data[0];
|
|
1469
|
-
}
|
|
1470
|
-
// Detect simulators.
|
|
1471
|
-
if (/\bSimulator\b/i.test(ua)) {
|
|
1472
|
-
product = (product ? product + ' ' : '') + 'Simulator';
|
|
1473
|
-
}
|
|
1474
|
-
// Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
|
|
1475
|
-
if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
|
|
1476
|
-
description.push('running in Turbo/Uncompressed mode');
|
|
1477
|
-
}
|
|
1478
|
-
// Detect IE Mobile 11.
|
|
1479
|
-
if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
|
|
1480
|
-
data = parse(ua.replace(/like iPhone OS/, ''));
|
|
1481
|
-
manufacturer = data.manufacturer;
|
|
1482
|
-
product = data.product;
|
|
1483
|
-
}
|
|
1484
|
-
// Detect iOS.
|
|
1485
|
-
else if (/^iP/.test(product)) {
|
|
1486
|
-
name || (name = 'Safari');
|
|
1487
|
-
os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua))
|
|
1488
|
-
? ' ' + data[1].replace(/_/g, '.')
|
|
1489
|
-
: '');
|
|
1490
|
-
}
|
|
1491
|
-
// Detect Kubuntu.
|
|
1492
|
-
else if (name == 'Konqueror' && /^Linux\b/i.test(os)) {
|
|
1493
|
-
os = 'Kubuntu';
|
|
1494
|
-
}
|
|
1495
|
-
// Detect Android browsers.
|
|
1496
|
-
else if ((manufacturer && manufacturer != 'Google' &&
|
|
1497
|
-
((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) ||
|
|
1498
|
-
(/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) {
|
|
1499
|
-
name = 'Android Browser';
|
|
1500
|
-
os = /\bAndroid\b/.test(os) ? os : 'Android';
|
|
1501
|
-
}
|
|
1502
|
-
// Detect Silk desktop/accelerated modes.
|
|
1503
|
-
else if (name == 'Silk') {
|
|
1504
|
-
if (!/\bMobi/i.test(ua)) {
|
|
1505
|
-
os = 'Android';
|
|
1506
|
-
description.unshift('desktop mode');
|
|
1507
|
-
}
|
|
1508
|
-
if (/Accelerated *= *true/i.test(ua)) {
|
|
1509
|
-
description.unshift('accelerated');
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
// Detect UC Browser speed mode.
|
|
1513
|
-
else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) {
|
|
1514
|
-
description.push('speed mode');
|
|
1515
|
-
}
|
|
1516
|
-
// Detect PaleMoon identifying as Firefox.
|
|
1517
|
-
else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
|
|
1518
|
-
description.push('identifying as Firefox ' + data[1]);
|
|
1519
|
-
}
|
|
1520
|
-
// Detect Firefox OS and products running Firefox.
|
|
1521
|
-
else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
|
|
1522
|
-
os || (os = 'Firefox OS');
|
|
1523
|
-
product || (product = data[1]);
|
|
1524
|
-
}
|
|
1525
|
-
// Detect false positives for Firefox/Safari.
|
|
1526
|
-
else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
|
|
1527
|
-
// Escape the `/` for Firefox 1.
|
|
1528
|
-
if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
|
|
1529
|
-
// Clear name of false positives.
|
|
1530
|
-
name = null;
|
|
1531
|
-
}
|
|
1532
|
-
// Reassign a generic name.
|
|
1533
|
-
if ((data = product || manufacturer || os) &&
|
|
1534
|
-
(product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
|
|
1535
|
-
name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
// Add Chrome version to description for Electron.
|
|
1539
|
-
else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
|
|
1540
|
-
description.push('Chromium ' + data);
|
|
1541
|
-
}
|
|
1542
|
-
// Detect non-Opera (Presto-based) versions (order is important).
|
|
1543
|
-
if (!version) {
|
|
1544
|
-
version = getVersion([
|
|
1545
|
-
'(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)',
|
|
1546
|
-
'Version',
|
|
1547
|
-
qualify(name),
|
|
1548
|
-
'(?:Firefox|Minefield|NetFront)'
|
|
1549
|
-
]);
|
|
1550
|
-
}
|
|
1551
|
-
// Detect stubborn layout engines.
|
|
1552
|
-
if ((data =
|
|
1553
|
-
layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' ||
|
|
1554
|
-
/\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') ||
|
|
1555
|
-
/\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' ||
|
|
1556
|
-
!layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') ||
|
|
1557
|
-
layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront'
|
|
1558
|
-
)) {
|
|
1559
|
-
layout = [data];
|
|
1560
|
-
}
|
|
1561
|
-
// Detect Windows Phone 7 desktop mode.
|
|
1562
|
-
if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
|
|
1563
|
-
name += ' Mobile';
|
|
1564
|
-
os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
|
|
1565
|
-
description.unshift('desktop mode');
|
|
1566
|
-
}
|
|
1567
|
-
// Detect Windows Phone 8.x desktop mode.
|
|
1568
|
-
else if (/\bWPDesktop\b/i.test(ua)) {
|
|
1569
|
-
name = 'IE Mobile';
|
|
1570
|
-
os = 'Windows Phone 8.x';
|
|
1571
|
-
description.unshift('desktop mode');
|
|
1572
|
-
version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
|
|
1573
|
-
}
|
|
1574
|
-
// Detect IE 11 identifying as other browsers.
|
|
1575
|
-
else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
|
|
1576
|
-
if (name) {
|
|
1577
|
-
description.push('identifying as ' + name + (version ? ' ' + version : ''));
|
|
1578
|
-
}
|
|
1579
|
-
name = 'IE';
|
|
1580
|
-
version = data[1];
|
|
1581
|
-
}
|
|
1582
|
-
// Leverage environment features.
|
|
1583
|
-
if (useFeatures) {
|
|
1584
|
-
// Detect server-side environments.
|
|
1585
|
-
// Rhino has a global function while others have a global object.
|
|
1586
|
-
if (isHostType(context, 'global')) {
|
|
1587
|
-
if (java) {
|
|
1588
|
-
data = java.lang.System;
|
|
1589
|
-
arch = data.getProperty('os.arch');
|
|
1590
|
-
os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
|
|
1591
|
-
}
|
|
1592
|
-
if (rhino) {
|
|
1593
|
-
try {
|
|
1594
|
-
version = context.require('ringo/engine').version.join('.');
|
|
1595
|
-
name = 'RingoJS';
|
|
1596
|
-
} catch(e) {
|
|
1597
|
-
if ((data = context.system) && data.global.system == context.system) {
|
|
1598
|
-
name = 'Narwhal';
|
|
1599
|
-
os || (os = data[0].os || null);
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
if (!name) {
|
|
1603
|
-
name = 'Rhino';
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
else if (
|
|
1607
|
-
typeof context.process == 'object' && !context.process.browser &&
|
|
1608
|
-
(data = context.process)
|
|
1609
|
-
) {
|
|
1610
|
-
if (typeof data.versions == 'object') {
|
|
1611
|
-
if (typeof data.versions.electron == 'string') {
|
|
1612
|
-
description.push('Node ' + data.versions.node);
|
|
1613
|
-
name = 'Electron';
|
|
1614
|
-
version = data.versions.electron;
|
|
1615
|
-
} else if (typeof data.versions.nw == 'string') {
|
|
1616
|
-
description.push('Chromium ' + version, 'Node ' + data.versions.node);
|
|
1617
|
-
name = 'NW.js';
|
|
1618
|
-
version = data.versions.nw;
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
if (!name) {
|
|
1622
|
-
name = 'Node.js';
|
|
1623
|
-
arch = data.arch;
|
|
1624
|
-
os = data.platform;
|
|
1625
|
-
version = /[\d.]+/.exec(data.version);
|
|
1626
|
-
version = version ? version[0] : null;
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
// Detect Adobe AIR.
|
|
1631
|
-
else if (getClassOf((data = context.runtime)) == airRuntimeClass) {
|
|
1632
|
-
name = 'Adobe AIR';
|
|
1633
|
-
os = data.flash.system.Capabilities.os;
|
|
1634
|
-
}
|
|
1635
|
-
// Detect PhantomJS.
|
|
1636
|
-
else if (getClassOf((data = context.phantom)) == phantomClass) {
|
|
1637
|
-
name = 'PhantomJS';
|
|
1638
|
-
version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch);
|
|
1639
|
-
}
|
|
1640
|
-
// Detect IE compatibility modes.
|
|
1641
|
-
else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
|
|
1642
|
-
// We're in compatibility mode when the Trident version + 4 doesn't
|
|
1643
|
-
// equal the document mode.
|
|
1644
|
-
version = [version, doc.documentMode];
|
|
1645
|
-
if ((data = +data[1] + 4) != version[1]) {
|
|
1646
|
-
description.push('IE ' + version[1] + ' mode');
|
|
1647
|
-
layout && (layout[1] = '');
|
|
1648
|
-
version[1] = data;
|
|
1649
|
-
}
|
|
1650
|
-
version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
|
|
1651
|
-
}
|
|
1652
|
-
// Detect IE 11 masking as other browsers.
|
|
1653
|
-
else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) {
|
|
1654
|
-
description.push('masking as ' + name + ' ' + version);
|
|
1655
|
-
name = 'IE';
|
|
1656
|
-
version = '11.0';
|
|
1657
|
-
layout = ['Trident'];
|
|
1658
|
-
os = 'Windows';
|
|
1659
|
-
}
|
|
1660
|
-
os = os && format(os);
|
|
1661
|
-
}
|
|
1662
|
-
// Detect prerelease phases.
|
|
1663
|
-
if (version && (data =
|
|
1664
|
-
/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
|
|
1665
|
-
/(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
|
|
1666
|
-
/\bMinefield\b/i.test(ua) && 'a'
|
|
1667
|
-
)) {
|
|
1668
|
-
prerelease = /b/i.test(data) ? 'beta' : 'alpha';
|
|
1669
|
-
version = version.replace(RegExp(data + '\\+?$'), '') +
|
|
1670
|
-
(prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
|
|
1671
|
-
}
|
|
1672
|
-
// Detect Firefox Mobile.
|
|
1673
|
-
if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
|
|
1674
|
-
name = 'Firefox Mobile';
|
|
1675
|
-
}
|
|
1676
|
-
// Obscure Maxthon's unreliable version.
|
|
1677
|
-
else if (name == 'Maxthon' && version) {
|
|
1678
|
-
version = version.replace(/\.[\d.]+/, '.x');
|
|
1679
|
-
}
|
|
1680
|
-
// Detect Xbox 360 and Xbox One.
|
|
1681
|
-
else if (/\bXbox\b/i.test(product)) {
|
|
1682
|
-
if (product == 'Xbox 360') {
|
|
1683
|
-
os = null;
|
|
1684
|
-
}
|
|
1685
|
-
if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
|
|
1686
|
-
description.unshift('mobile mode');
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
// Add mobile postfix.
|
|
1690
|
-
else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) &&
|
|
1691
|
-
(os == 'Windows CE' || /Mobi/i.test(ua))) {
|
|
1692
|
-
name += ' Mobile';
|
|
1693
|
-
}
|
|
1694
|
-
// Detect IE platform preview.
|
|
1695
|
-
else if (name == 'IE' && useFeatures) {
|
|
1696
|
-
try {
|
|
1697
|
-
if (context.external === null) {
|
|
1698
|
-
description.unshift('platform preview');
|
|
1699
|
-
}
|
|
1700
|
-
} catch(e) {
|
|
1701
|
-
description.unshift('embedded');
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
// Detect BlackBerry OS version.
|
|
1705
|
-
// http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
|
|
1706
|
-
else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data =
|
|
1707
|
-
(RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
|
|
1708
|
-
version
|
|
1709
|
-
)) {
|
|
1710
|
-
data = [data, /BB10/.test(ua)];
|
|
1711
|
-
os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
|
|
1712
|
-
version = null;
|
|
1713
|
-
}
|
|
1714
|
-
// Detect Opera identifying/masking itself as another browser.
|
|
1715
|
-
// http://www.opera.com/support/kb/view/843/
|
|
1716
|
-
else if (this != forOwn && product != 'Wii' && (
|
|
1717
|
-
(useFeatures && opera) ||
|
|
1718
|
-
(/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) ||
|
|
1719
|
-
(name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) ||
|
|
1720
|
-
(name == 'IE' && (
|
|
1721
|
-
(os && !/^Win/.test(os) && version > 5.5) ||
|
|
1722
|
-
/\bWindows XP\b/.test(os) && version > 8 ||
|
|
1723
|
-
version == 8 && !/\bTrident\b/.test(ua)
|
|
1724
|
-
))
|
|
1725
|
-
) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) {
|
|
1726
|
-
// When "identifying", the UA contains both Opera and the other browser's name.
|
|
1727
|
-
data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
|
|
1728
|
-
if (reOpera.test(name)) {
|
|
1729
|
-
if (/\bIE\b/.test(data) && os == 'Mac OS') {
|
|
1730
|
-
os = null;
|
|
1731
|
-
}
|
|
1732
|
-
data = 'identify' + data;
|
|
1733
|
-
}
|
|
1734
|
-
// When "masking", the UA contains only the other browser's name.
|
|
1735
|
-
else {
|
|
1736
|
-
data = 'mask' + data;
|
|
1737
|
-
if (operaClass) {
|
|
1738
|
-
name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
|
|
1739
|
-
} else {
|
|
1740
|
-
name = 'Opera';
|
|
1741
|
-
}
|
|
1742
|
-
if (/\bIE\b/.test(data)) {
|
|
1743
|
-
os = null;
|
|
1744
|
-
}
|
|
1745
|
-
if (!useFeatures) {
|
|
1746
|
-
version = null;
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
layout = ['Presto'];
|
|
1750
|
-
description.push(data);
|
|
1751
|
-
}
|
|
1752
|
-
// Detect WebKit Nightly and approximate Chrome/Safari versions.
|
|
1753
|
-
if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
|
|
1754
|
-
// Correct build number for numeric comparison.
|
|
1755
|
-
// (e.g. "532.5" becomes "532.05")
|
|
1756
|
-
data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
|
|
1757
|
-
// Nightly builds are postfixed with a "+".
|
|
1758
|
-
if (name == 'Safari' && data[1].slice(-1) == '+') {
|
|
1759
|
-
name = 'WebKit Nightly';
|
|
1760
|
-
prerelease = 'alpha';
|
|
1761
|
-
version = data[1].slice(0, -1);
|
|
1762
|
-
}
|
|
1763
|
-
// Clear incorrect browser versions.
|
|
1764
|
-
else if (version == data[1] ||
|
|
1765
|
-
version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
|
|
1766
|
-
version = null;
|
|
1767
|
-
}
|
|
1768
|
-
// Use the full Chrome version when available.
|
|
1769
|
-
data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
|
|
1770
|
-
// Detect Blink layout engine.
|
|
1771
|
-
if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
|
|
1772
|
-
layout = ['Blink'];
|
|
1773
|
-
}
|
|
1774
|
-
// Detect JavaScriptCore.
|
|
1775
|
-
// http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
|
|
1776
|
-
if (!useFeatures || (!likeChrome && !data[1])) {
|
|
1777
|
-
layout && (layout[1] = 'like Safari');
|
|
1778
|
-
data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12');
|
|
1779
|
-
} else {
|
|
1780
|
-
layout && (layout[1] = 'like Chrome');
|
|
1781
|
-
data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28');
|
|
1782
|
-
}
|
|
1783
|
-
// Add the postfix of ".x" or "+" for approximate versions.
|
|
1784
|
-
layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
|
|
1785
|
-
// Obscure version for some Safari 1-2 releases.
|
|
1786
|
-
if (name == 'Safari' && (!version || parseInt(version) > 45)) {
|
|
1787
|
-
version = data;
|
|
1788
|
-
} else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) {
|
|
1789
|
-
description.unshift('headless');
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
// Detect Opera desktop modes.
|
|
1793
|
-
if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
|
|
1794
|
-
name += ' ';
|
|
1795
|
-
description.unshift('desktop mode');
|
|
1796
|
-
if (data == 'zvav') {
|
|
1797
|
-
name += 'Mini';
|
|
1798
|
-
version = null;
|
|
1799
|
-
} else {
|
|
1800
|
-
name += 'Mobile';
|
|
1801
|
-
}
|
|
1802
|
-
os = os.replace(RegExp(' *' + data + '$'), '');
|
|
1803
|
-
}
|
|
1804
|
-
// Detect Chrome desktop mode.
|
|
1805
|
-
else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
|
|
1806
|
-
description.unshift('desktop mode');
|
|
1807
|
-
name = 'Chrome Mobile';
|
|
1808
|
-
version = null;
|
|
1809
|
-
|
|
1810
|
-
if (/\bOS X\b/.test(os)) {
|
|
1811
|
-
manufacturer = 'Apple';
|
|
1812
|
-
os = 'iOS 4.3+';
|
|
1813
|
-
} else {
|
|
1814
|
-
os = null;
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
// Newer versions of SRWare Iron uses the Chrome tag to indicate its version number.
|
|
1818
|
-
else if (/\bSRWare Iron\b/.test(name) && !version) {
|
|
1819
|
-
version = getVersion('Chrome');
|
|
1820
|
-
}
|
|
1821
|
-
// Strip incorrect OS versions.
|
|
1822
|
-
if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 &&
|
|
1823
|
-
ua.indexOf('/' + data + '-') > -1) {
|
|
1824
|
-
os = trim(os.replace(data, ''));
|
|
1825
|
-
}
|
|
1826
|
-
// Ensure OS does not include the browser name.
|
|
1827
|
-
if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) {
|
|
1828
|
-
os = os.replace(RegExp(' *' + qualify(name) + ' *'), '');
|
|
1829
|
-
}
|
|
1830
|
-
// Add layout engine.
|
|
1831
|
-
if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (
|
|
1832
|
-
/Browser|Lunascape|Maxthon/.test(name) ||
|
|
1833
|
-
name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) ||
|
|
1834
|
-
/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
|
|
1835
|
-
// Don't add layout details to description if they are falsey.
|
|
1836
|
-
(data = layout[layout.length - 1]) && description.push(data);
|
|
1837
|
-
}
|
|
1838
|
-
// Combine contextual information.
|
|
1839
|
-
if (description.length) {
|
|
1840
|
-
description = ['(' + description.join('; ') + ')'];
|
|
1841
|
-
}
|
|
1842
|
-
// Append manufacturer to description.
|
|
1843
|
-
if (manufacturer && product && product.indexOf(manufacturer) < 0) {
|
|
1844
|
-
description.push('on ' + manufacturer);
|
|
1845
|
-
}
|
|
1846
|
-
// Append product to description.
|
|
1847
|
-
if (product) {
|
|
1848
|
-
description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
|
|
1849
|
-
}
|
|
1850
|
-
// Parse the OS into an object.
|
|
1851
|
-
if (os) {
|
|
1852
|
-
data = / ([\d.+]+)$/.exec(os);
|
|
1853
|
-
isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
|
|
1854
|
-
os = {
|
|
1855
|
-
'architecture': 32,
|
|
1856
|
-
'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
|
|
1857
|
-
'version': data ? data[1] : null,
|
|
1858
|
-
'toString': function() {
|
|
1859
|
-
var version = this.version;
|
|
1860
|
-
return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
|
|
1861
|
-
}
|
|
1862
|
-
};
|
|
1863
|
-
}
|
|
1864
|
-
// Add browser/OS architecture.
|
|
1865
|
-
if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
|
|
1866
|
-
if (os) {
|
|
1867
|
-
os.architecture = 64;
|
|
1868
|
-
os.family = os.family.replace(RegExp(' *' + data), '');
|
|
1869
|
-
}
|
|
1870
|
-
if (
|
|
1871
|
-
name && (/\bWOW64\b/i.test(ua) ||
|
|
1872
|
-
(useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua)))
|
|
1873
|
-
) {
|
|
1874
|
-
description.unshift('32-bit');
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
// Chrome 39 and above on OS X is always 64-bit.
|
|
1878
|
-
else if (
|
|
1879
|
-
os && /^OS X/.test(os.family) &&
|
|
1880
|
-
name == 'Chrome' && parseFloat(version) >= 39
|
|
1881
|
-
) {
|
|
1882
|
-
os.architecture = 64;
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
ua || (ua = null);
|
|
1886
|
-
|
|
1887
|
-
/*------------------------------------------------------------------------*/
|
|
1888
|
-
|
|
1889
|
-
/**
|
|
1890
|
-
* The platform object.
|
|
1891
|
-
*
|
|
1892
|
-
* @name platform
|
|
1893
|
-
* @type Object
|
|
1894
|
-
*/
|
|
1895
|
-
var platform = {};
|
|
1896
|
-
|
|
1897
|
-
/**
|
|
1898
|
-
* The platform description.
|
|
1899
|
-
*
|
|
1900
|
-
* @memberOf platform
|
|
1901
|
-
* @type string|null
|
|
1902
|
-
*/
|
|
1903
|
-
platform.description = ua;
|
|
1904
|
-
|
|
1905
|
-
/**
|
|
1906
|
-
* The name of the browser's layout engine.
|
|
1907
|
-
*
|
|
1908
|
-
* The list of common layout engines include:
|
|
1909
|
-
* "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
|
|
1910
|
-
*
|
|
1911
|
-
* @memberOf platform
|
|
1912
|
-
* @type string|null
|
|
1913
|
-
*/
|
|
1914
|
-
platform.layout = layout && layout[0];
|
|
1915
|
-
|
|
1916
|
-
/**
|
|
1917
|
-
* The name of the product's manufacturer.
|
|
1918
|
-
*
|
|
1919
|
-
* The list of manufacturers include:
|
|
1920
|
-
* "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
|
|
1921
|
-
* "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
|
|
1922
|
-
* "Nokia", "Samsung" and "Sony"
|
|
1923
|
-
*
|
|
1924
|
-
* @memberOf platform
|
|
1925
|
-
* @type string|null
|
|
1926
|
-
*/
|
|
1927
|
-
platform.manufacturer = manufacturer;
|
|
1928
|
-
|
|
1929
|
-
/**
|
|
1930
|
-
* The name of the browser/environment.
|
|
1931
|
-
*
|
|
1932
|
-
* The list of common browser names include:
|
|
1933
|
-
* "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
|
|
1934
|
-
* "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
|
|
1935
|
-
* "Opera Mini" and "Opera"
|
|
1936
|
-
*
|
|
1937
|
-
* Mobile versions of some browsers have "Mobile" appended to their name:
|
|
1938
|
-
* eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
|
|
1939
|
-
*
|
|
1940
|
-
* @memberOf platform
|
|
1941
|
-
* @type string|null
|
|
1942
|
-
*/
|
|
1943
|
-
platform.name = name;
|
|
1944
|
-
|
|
1945
|
-
/**
|
|
1946
|
-
* The alpha/beta release indicator.
|
|
1947
|
-
*
|
|
1948
|
-
* @memberOf platform
|
|
1949
|
-
* @type string|null
|
|
1950
|
-
*/
|
|
1951
|
-
platform.prerelease = prerelease;
|
|
1952
|
-
|
|
1953
|
-
/**
|
|
1954
|
-
* The name of the product hosting the browser.
|
|
1955
|
-
*
|
|
1956
|
-
* The list of common products include:
|
|
1957
|
-
*
|
|
1958
|
-
* "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
|
|
1959
|
-
* "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
|
|
1960
|
-
*
|
|
1961
|
-
* @memberOf platform
|
|
1962
|
-
* @type string|null
|
|
1963
|
-
*/
|
|
1964
|
-
platform.product = product;
|
|
1965
|
-
|
|
1966
|
-
/**
|
|
1967
|
-
* The browser's user agent string.
|
|
1968
|
-
*
|
|
1969
|
-
* @memberOf platform
|
|
1970
|
-
* @type string|null
|
|
1971
|
-
*/
|
|
1972
|
-
platform.ua = ua;
|
|
1973
|
-
|
|
1974
|
-
/**
|
|
1975
|
-
* The browser/environment version.
|
|
1976
|
-
*
|
|
1977
|
-
* @memberOf platform
|
|
1978
|
-
* @type string|null
|
|
1979
|
-
*/
|
|
1980
|
-
platform.version = name && version;
|
|
1981
|
-
|
|
1982
|
-
/**
|
|
1983
|
-
* The name of the operating system.
|
|
1984
|
-
*
|
|
1985
|
-
* @memberOf platform
|
|
1986
|
-
* @type Object
|
|
1987
|
-
*/
|
|
1988
|
-
platform.os = os || {
|
|
1989
|
-
|
|
1990
|
-
/**
|
|
1991
|
-
* The CPU architecture the OS is built for.
|
|
1992
|
-
*
|
|
1993
|
-
* @memberOf platform.os
|
|
1994
|
-
* @type number|null
|
|
1995
|
-
*/
|
|
1996
|
-
'architecture': null,
|
|
1997
|
-
|
|
1998
|
-
/**
|
|
1999
|
-
* The family of the OS.
|
|
2000
|
-
*
|
|
2001
|
-
* Common values include:
|
|
2002
|
-
* "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
|
|
2003
|
-
* "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
|
|
2004
|
-
* "SuSE", "Android", "iOS" and "Windows Phone"
|
|
2005
|
-
*
|
|
2006
|
-
* @memberOf platform.os
|
|
2007
|
-
* @type string|null
|
|
2008
|
-
*/
|
|
2009
|
-
'family': null,
|
|
2010
|
-
|
|
2011
|
-
/**
|
|
2012
|
-
* The version of the OS.
|
|
2013
|
-
*
|
|
2014
|
-
* @memberOf platform.os
|
|
2015
|
-
* @type string|null
|
|
2016
|
-
*/
|
|
2017
|
-
'version': null,
|
|
2018
|
-
|
|
2019
|
-
/**
|
|
2020
|
-
* Returns the OS string.
|
|
2021
|
-
*
|
|
2022
|
-
* @memberOf platform.os
|
|
2023
|
-
* @returns {string} The OS string.
|
|
2024
|
-
*/
|
|
2025
|
-
'toString': function() { return 'null'; }
|
|
2026
|
-
};
|
|
2027
|
-
|
|
2028
|
-
platform.parse = parse;
|
|
2029
|
-
platform.toString = toStringPlatform;
|
|
2030
|
-
|
|
2031
|
-
if (platform.version) {
|
|
2032
|
-
description.unshift(version);
|
|
2033
|
-
}
|
|
2034
|
-
if (platform.name) {
|
|
2035
|
-
description.unshift(name);
|
|
2036
|
-
}
|
|
2037
|
-
if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
|
|
2038
|
-
description.push(product ? '(' + os + ')' : 'on ' + os);
|
|
2039
|
-
}
|
|
2040
|
-
if (description.length) {
|
|
2041
|
-
platform.description = description.join(' ');
|
|
2042
|
-
}
|
|
2043
|
-
return platform;
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
/*--------------------------------------------------------------------------*/
|
|
2047
|
-
|
|
2048
|
-
// Export platform.
|
|
2049
|
-
var platform = parse();
|
|
2050
|
-
|
|
2051
|
-
// Some AMD build optimizers, like r.js, check for condition patterns like the following:
|
|
2052
|
-
if (freeExports && freeModule) {
|
|
2053
|
-
// Export for CommonJS support.
|
|
2054
|
-
forOwn(platform, function(value, key) {
|
|
2055
|
-
freeExports[key] = value;
|
|
2056
|
-
});
|
|
2057
|
-
}
|
|
2058
|
-
else {
|
|
2059
|
-
// Export to the global object.
|
|
2060
|
-
root.platform = platform;
|
|
2061
|
-
}
|
|
2062
|
-
}.call(commonjsGlobal));
|
|
2063
|
-
} (platform$1, platform$1.exports));
|
|
2064
|
-
|
|
2065
|
-
var platform = platform$1.exports;
|
|
2066
|
-
|
|
2067
|
-
var isMultipleHotkey = function isMultipleHotkey(hotkey) {
|
|
2068
|
-
return Array.isArray(hotkey);
|
|
2069
|
-
};
|
|
2070
|
-
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
2071
|
-
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
2072
|
-
return item.replaceAll(keyName, replaceWith);
|
|
2073
|
-
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
2074
|
-
};
|
|
2075
|
-
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
2076
|
-
ramda.toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
2077
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
2078
|
-
macKey = _ref2[0],
|
|
2079
|
-
windowsKey = _ref2[1];
|
|
2080
|
-
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
2081
|
-
});
|
|
2082
|
-
return hotkey;
|
|
2083
|
-
};
|
|
2084
|
-
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
2085
|
-
var _platformInfo$os, _platformInfo$os$fami;
|
|
2086
|
-
var platformInfo = platform.parse(navigator.userAgent);
|
|
2087
|
-
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
|
|
2088
|
-
if (isOSX) return hotkey;
|
|
2089
|
-
return convertHotKeyToWindows(hotkey);
|
|
2090
|
-
};
|
|
2091
|
-
var shortenHotKey = function shortenHotKey(hotkey) {
|
|
2092
|
-
var result = hotkey;
|
|
2093
|
-
Object.entries(KEY_SHORTFORM_MAP).forEach(function (_ref3) {
|
|
2094
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
2095
|
-
longform = _ref4[0],
|
|
2096
|
-
shortform = _ref4[1];
|
|
2097
|
-
result = result.replaceAll(longform, shortform);
|
|
2098
|
-
});
|
|
2099
|
-
return result;
|
|
2100
|
-
};
|
|
2101
|
-
var getGlobalShortcuts = function getGlobalShortcuts() {
|
|
2102
|
-
return _defineProperty({}, i18next__default["default"].t("neetoMolecules.keyboardShortcuts.global.categoryName"), {
|
|
2103
|
-
openKeyboardShortcutsPane: {
|
|
2104
|
-
sequence: "shift+/",
|
|
2105
|
-
description: i18next__default["default"].t("neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane")
|
|
2106
|
-
},
|
|
2107
|
-
close: {
|
|
2108
|
-
sequence: "esc",
|
|
2109
|
-
description: i18next__default["default"].t("neetoMolecules.keyboardShortcuts.global.close")
|
|
2110
|
-
},
|
|
2111
|
-
submitForm: {
|
|
2112
|
-
sequence: "command+return",
|
|
2113
|
-
description: i18next__default["default"].t("neetoMolecules.keyboardShortcuts.global.submitForm")
|
|
2114
|
-
}
|
|
2115
|
-
});
|
|
2116
|
-
};
|
|
2117
|
-
var getTooltipProps = function getTooltipProps(key) {
|
|
2118
|
-
if (TOOLTIP_CONTENT[key]) {
|
|
2119
|
-
return {
|
|
2120
|
-
position: "top",
|
|
2121
|
-
content: TOOLTIP_CONTENT[key],
|
|
2122
|
-
followCursor: "horizontal"
|
|
2123
|
-
};
|
|
2124
|
-
}
|
|
2125
|
-
return null;
|
|
2126
|
-
};
|
|
2127
|
-
|
|
2128
|
-
var HotKey = function HotKey(_ref) {
|
|
2129
|
-
var description = _ref.description,
|
|
2130
|
-
sequence = _ref.sequence;
|
|
2131
|
-
var hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));
|
|
2132
|
-
var isSequentialHotkey = hotkey.includes(" ");
|
|
2133
|
-
var isSimultaneousHotkey = hotkey.includes("+");
|
|
2134
|
-
var isSingleKeyHotkey = !isSequentialHotkey && !isSimultaneousHotkey;
|
|
2135
|
-
var sequences = [];
|
|
2136
|
-
if (isSingleKeyHotkey) {
|
|
2137
|
-
sequences = [hotkey];
|
|
2138
|
-
} else if (isSequentialHotkey) {
|
|
2139
|
-
sequences = hotkey.split(" ");
|
|
2140
|
-
} else if (isSimultaneousHotkey) {
|
|
2141
|
-
sequences = hotkey.split("+");
|
|
2142
|
-
}
|
|
2143
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2144
|
-
className: "my-3 w-full"
|
|
2145
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2146
|
-
className: "flex items-center justify-between gap-3",
|
|
2147
|
-
"data-cy": "hotkey-item",
|
|
2148
|
-
"data-testid": "hotkey-item"
|
|
2149
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2150
|
-
className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
|
|
2151
|
-
lineHeight: "normal",
|
|
2152
|
-
style: "body2"
|
|
2153
|
-
}, description), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2154
|
-
className: "flex flex-shrink-0 items-center gap-1"
|
|
2155
|
-
}, sequences.map(function (keyName, idx) {
|
|
2156
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
2157
|
-
key: idx
|
|
2158
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Kbd, {
|
|
2159
|
-
keyName: keyName,
|
|
2160
|
-
tooltipProps: getTooltipProps(keyName)
|
|
2161
|
-
}), isSequentialHotkey && idx + 1 !== sequences.length && /*#__PURE__*/React__default["default"].createElement(neetoui.Kbd, {
|
|
2162
|
-
keyName: "then"
|
|
2163
|
-
}));
|
|
2164
|
-
}))));
|
|
2165
|
-
};
|
|
2166
|
-
var HotKey$1 = /*#__PURE__*/React__default["default"].memo(HotKey);
|
|
2167
|
-
|
|
2168
|
-
var HotKeyList = function HotKeyList(_ref) {
|
|
2169
|
-
var hotkeys = _ref.hotkeys;
|
|
2170
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
2171
|
-
t = _useTranslation.t;
|
|
2172
|
-
return Object.keys(hotkeys).map(function (categoryName) {
|
|
2173
|
-
var categoryValues = hotkeys[categoryName];
|
|
2174
|
-
var fullShortcutsLink = categoryValues[FULL_SHORTCUTS_LINK_PROP_NAME];
|
|
2175
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2176
|
-
className: "mt-4 px-4",
|
|
2177
|
-
key: categoryName
|
|
2178
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2179
|
-
style: "h6",
|
|
2180
|
-
textTransform: "uppercase",
|
|
2181
|
-
weight: "bold"
|
|
2182
|
-
}, categoryName), Object.entries(categoryValues).map(function (_ref2) {
|
|
2183
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
2184
|
-
_ref3$ = _ref3[1],
|
|
2185
|
-
sequence = _ref3$.sequence,
|
|
2186
|
-
description = _ref3$.description;
|
|
2187
|
-
return sequence && /*#__PURE__*/React__default["default"].createElement(HotKey$1, {
|
|
2188
|
-
description: description,
|
|
2189
|
-
key: sequence,
|
|
2190
|
-
sequence: sequence
|
|
2191
|
-
});
|
|
2192
|
-
}), fullShortcutsLink && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
2193
|
-
className: "mb-3",
|
|
2194
|
-
href: fullShortcutsLink,
|
|
2195
|
-
style: "link",
|
|
2196
|
-
target: "_blank",
|
|
2197
|
-
label: t("neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts")
|
|
2198
|
-
}));
|
|
2199
|
-
});
|
|
2200
|
-
};
|
|
2201
|
-
var HotKeyList$1 = /*#__PURE__*/React__default["default"].memo(HotKeyList);
|
|
2202
|
-
|
|
2203
|
-
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}}
|
|
2204
|
-
|
|
2205
|
-
var css = ".neeto-molecules-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
|
|
2206
|
-
n(css,{});
|
|
2207
|
-
|
|
2208
|
-
var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
|
|
2209
|
-
var _ref$productShortcuts = _ref.productShortcuts,
|
|
2210
|
-
productShortcuts = _ref$productShortcuts === void 0 ? {} : _ref$productShortcuts;
|
|
2211
|
-
var _useKeyboardShortcuts = useKeyboardShortcutsPaneState(),
|
|
2212
|
-
_useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 2),
|
|
2213
|
-
isOpen = _useKeyboardShortcuts2[0],
|
|
2214
|
-
setIsOpen = _useKeyboardShortcuts2[1];
|
|
2215
|
-
var hasOverlays = managers.manager.hasOverlays();
|
|
2216
|
-
// eslint-disable-next-line @bigbinary/neeto/no-dangling-constants
|
|
2217
|
-
var GLOBAL_SHORTCUTS = getGlobalShortcuts();
|
|
2218
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
2219
|
-
t = _useTranslation.t;
|
|
2220
|
-
var shortcuts = GLOBAL_SHORTCUTS[t("neetoMolecules.keyboardShortcuts.global.categoryName")];
|
|
2221
|
-
reactUtils.useHotKeys(shortcuts.openKeyboardShortcutsPane.sequence, function () {
|
|
2222
|
-
return setIsOpen(function (prevIsOpen) {
|
|
2223
|
-
return !prevIsOpen;
|
|
2224
|
-
});
|
|
2225
|
-
});
|
|
2226
|
-
reactUtils.useHotKeys(shortcuts.close.sequence, function () {
|
|
2227
|
-
return setIsOpen(false);
|
|
2228
|
-
});
|
|
2229
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2230
|
-
"data-cy": "keyboard-shortcuts-pane",
|
|
2231
|
-
className: classnames("neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width neeto-ui-bg-white ml-auto h-screen overflow-hidden border-l duration-300 ease-in-out", {
|
|
2232
|
-
"w-80": isOpen,
|
|
2233
|
-
"w-0": !isOpen,
|
|
2234
|
-
absolute: hasOverlays,
|
|
2235
|
-
"right-0": hasOverlays
|
|
2236
|
-
})
|
|
2237
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2238
|
-
className: "h-full w-80 overflow-y-auto"
|
|
2239
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2240
|
-
className: "neeto-ui-border-gray-300 my-2 flex items-center justify-between border-b px-4 pb-2"
|
|
2241
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2242
|
-
style: "h4"
|
|
2243
|
-
}, t("neetoMolecules.keyboardShortcuts.title")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
2244
|
-
icon: neetoIcons.Close,
|
|
2245
|
-
style: "text",
|
|
2246
|
-
onClick: function onClick() {
|
|
2247
|
-
return setIsOpen(false);
|
|
2248
|
-
}
|
|
2249
|
-
})), /*#__PURE__*/React__default["default"].createElement(HotKeyList$1, {
|
|
2250
|
-
hotkeys: GLOBAL_SHORTCUTS
|
|
2251
|
-
}), /*#__PURE__*/React__default["default"].createElement(HotKeyList$1, {
|
|
2252
|
-
hotkeys: productShortcuts
|
|
2253
|
-
})));
|
|
2254
|
-
};
|
|
2255
|
-
|
|
2256
|
-
var KeyboardShortcuts = {
|
|
2257
|
-
Pane: KeyboardShortcutsPane,
|
|
2258
|
-
usePaneState: useKeyboardShortcutsPaneState,
|
|
2259
|
-
GLOBAL_SHORTCUTS: getGlobalShortcuts()
|
|
2260
|
-
};
|
|
2261
|
-
|
|
2262
|
-
module.exports = KeyboardShortcuts;
|
|
2263
|
-
//# sourceMappingURL=KeyboardShortcuts.cjs.js.map
|