@bigbinary/neeto-molecules 1.1.10 → 1.1.11

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.
Files changed (474) hide show
  1. package/dist/AutoSaveInput/autosaveinput.scss +15 -0
  2. package/dist/AutoSaveInput/constants.js +13 -0
  3. package/dist/AutoSaveInput/index.js +124 -0
  4. package/dist/AutoSaveInput/utils.js +10 -0
  5. package/dist/Breadcrumbs/breadcrumbs.scss +33 -0
  6. package/dist/Breadcrumbs/index.js +31 -0
  7. package/dist/BrowserSupport/Callout.js +15 -0
  8. package/dist/BrowserSupport/ContactUs.js +21 -0
  9. package/dist/BrowserSupport/DownloadLink.js +17 -0
  10. package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +17 -0
  11. package/dist/BrowserSupport/UnknownBrowser.js +13 -0
  12. package/dist/BrowserSupport/UnsupportedBrowser.js +24 -0
  13. package/dist/BrowserSupport/UnsupportedBrowserMessage.js +22 -0
  14. package/dist/BrowserSupport/UnsupportedBrowserVersion.js +27 -0
  15. package/dist/BrowserSupport/UnsupportedVersionMessage.js +30 -0
  16. package/dist/BrowserSupport/browsersupport.scss +71 -0
  17. package/dist/BrowserSupport/constants.js +63 -0
  18. package/dist/BrowserSupport/index.js +58 -0
  19. package/dist/BrowserSupport/utils.js +32 -0
  20. package/dist/CalendarView/CustomDatePicker.js +87 -0
  21. package/dist/CalendarView/Header.js +53 -0
  22. package/dist/CalendarView/constants.js +19 -0
  23. package/dist/CalendarView/index.js +83 -0
  24. package/dist/CalendarView/utils.js +50 -0
  25. package/dist/Codeblock/index.js +30 -0
  26. package/dist/{Columns.js → Columns/index.js} +13 -130
  27. package/dist/Columns/utils.js +20 -0
  28. package/dist/ConfirmationModal/constants.js +3 -0
  29. package/dist/{ConfirmationModal.js → ConfirmationModal/index.js} +7 -23
  30. package/dist/ConfirmationModal/utils.js +10 -0
  31. package/dist/Container/container.scss +21 -0
  32. package/dist/Container/index.js +23 -0
  33. package/dist/CopyToClipboardButton/constants.js +13 -0
  34. package/dist/CopyToClipboardButton/copyToClipboard.scss +22 -0
  35. package/dist/CopyToClipboardButton/index.js +59 -0
  36. package/dist/CustomDomain/index.js +98 -0
  37. package/dist/CustomDomainDashboard/DeleteAlert.js +28 -0
  38. package/dist/CustomDomainDashboard/Header.js +32 -0
  39. package/dist/CustomDomainDashboard/Manage/Record.js +42 -0
  40. package/dist/CustomDomainDashboard/Manage/StatusInfo.js +21 -0
  41. package/dist/CustomDomainDashboard/Manage/TagBlock.js +36 -0
  42. package/dist/CustomDomainDashboard/Manage/constants.js +4 -0
  43. package/dist/CustomDomainDashboard/Manage/index.js +124 -0
  44. package/dist/CustomDomainDashboard/Manage/utils.js +8 -0
  45. package/dist/CustomDomainDashboard/api.js +35 -0
  46. package/dist/CustomDomainDashboard/constants.js +2 -0
  47. package/dist/CustomDomainDashboard/index.js +118 -0
  48. package/dist/CustomDomainDashboard/useCustomDomainApi.js +71 -0
  49. package/dist/CustomDomainDashboard/utils.js +84 -0
  50. package/dist/{DateFormat.js → DateFormat/index.js} +8 -25
  51. package/dist/DateRangeFilter/index.js +60 -0
  52. package/dist/DateRangeFilter/utils.js +113 -0
  53. package/dist/DynamicVariables/dynamic-variables.scss +34 -0
  54. package/dist/DynamicVariables/index.js +59 -0
  55. package/dist/DynamicVariables/utils.js +37 -0
  56. package/dist/EmailForm/EmailForm.js +97 -0
  57. package/dist/EmailForm/EmailFormProvider.js +45 -0
  58. package/dist/EmailForm/EmailPreview.js +129 -0
  59. package/dist/EmailForm/ReplyToField.js +55 -0
  60. package/dist/EmailForm/SendToField.js +27 -0
  61. package/dist/EmailForm/SubjectField.js +64 -0
  62. package/dist/EmailForm/constants.js +33 -0
  63. package/dist/EmailForm/contexts/EmailForm.js +7 -0
  64. package/dist/EmailForm/index.js +4 -0
  65. package/dist/EmailForm/utils.js +10 -0
  66. package/dist/EmailPreview/index.js +2 -0
  67. package/dist/{ErrorPage.js → ErrorPage/constants.js} +36 -175
  68. package/dist/ErrorPage/index.js +78 -0
  69. package/dist/Header/Breadcrumbs.js +31 -0
  70. package/dist/Header/Dropdown.js +12 -0
  71. package/dist/Header/constants.js +6 -0
  72. package/dist/Header/header.scss +121 -0
  73. package/dist/Header/index.js +61 -0
  74. package/dist/IconPicker/Icon.js +34 -0
  75. package/dist/IconPicker/NoResults.js +12 -0
  76. package/dist/IconPicker/constants.js +8 -0
  77. package/dist/IconPicker/icon-picker.scss +1 -0
  78. package/dist/IconPicker/index.js +164 -0
  79. package/dist/ImageWithFallback/ImagePlaceholder.js +16 -0
  80. package/dist/ImageWithFallback/index.js +31 -0
  81. package/dist/IntegrationCard/Dropdown.js +45 -0
  82. package/dist/IntegrationCard/Status.js +25 -0
  83. package/dist/IntegrationCard/index.js +128 -0
  84. package/dist/IntegrationDisconnectAlert/index.js +36 -0
  85. package/dist/{IntegrationWalkthroughModal.js → IntegrationWalkthroughModal/index.js} +6 -8
  86. package/dist/IpRestriction/AllowedIpRanges.js +72 -0
  87. package/dist/IpRestriction/CurrentIp.js +26 -0
  88. package/dist/IpRestriction/FormRow.js +77 -0
  89. package/dist/IpRestriction/Row.js +86 -0
  90. package/dist/IpRestriction/apis/allowed_ip_ranges.js +28 -0
  91. package/dist/IpRestriction/apis/current_ip.js +11 -0
  92. package/dist/IpRestriction/apis/ip_restriction.js +16 -0
  93. package/dist/IpRestriction/constants.js +11 -0
  94. package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +34 -0
  95. package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +10 -0
  96. package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +18 -0
  97. package/dist/IpRestriction/index.js +102 -0
  98. package/dist/IpRestriction/utils.js +67 -0
  99. package/dist/KeyboardShortcuts/Pane/HotKey.js +44 -0
  100. package/dist/KeyboardShortcuts/Pane/HotKeyList.js +42 -0
  101. package/dist/KeyboardShortcuts/Pane/constants.js +25 -0
  102. package/dist/KeyboardShortcuts/Pane/index.js +61 -0
  103. package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +5 -0
  104. package/dist/KeyboardShortcuts/Pane/utils.js +66 -0
  105. package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +31 -0
  106. package/dist/KeyboardShortcuts/index.js +9 -0
  107. package/dist/LoginPage/Form.js +57 -0
  108. package/dist/LoginPage/constants.js +12 -0
  109. package/dist/LoginPage/index.js +103 -0
  110. package/dist/MenuBar/AddNew.js +25 -0
  111. package/dist/MenuBar/Block.js +60 -0
  112. package/dist/MenuBar/Item.js +32 -0
  113. package/dist/MenuBar/Search.js +39 -0
  114. package/dist/MenuBar/SubTitle.js +23 -0
  115. package/dist/MenuBar/index.js +46 -0
  116. package/dist/MenuBar/menubar.scss +154 -0
  117. package/dist/Metadata/Block.js +30 -0
  118. package/dist/Metadata/DetailsBlock.js +86 -0
  119. package/dist/Metadata/constants.js +9 -0
  120. package/dist/Metadata/index.js +29 -0
  121. package/dist/Metadata/metadata.scss +15 -0
  122. package/dist/MoreDropdown/constants.js +25 -0
  123. package/dist/{MoreDropdown.js → MoreDropdown/index.js} +9 -102
  124. package/dist/NavigationHeader/LeftBlock.js +32 -0
  125. package/dist/NavigationHeader/Navigation.js +24 -0
  126. package/dist/NavigationHeader/RightBlock.js +68 -0
  127. package/dist/NavigationHeader/constants.js +11 -0
  128. package/dist/NavigationHeader/index.js +19 -0
  129. package/dist/NavigationHeader/navigation-header.scss +3 -0
  130. package/dist/NeetoWidget/CodeBlock.js +57 -0
  131. package/dist/NeetoWidget/CodeSnippet.js +119 -0
  132. package/dist/NeetoWidget/EmbedCode.js +281 -0
  133. package/dist/NeetoWidget/Main.js +19 -0
  134. package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +25 -0
  135. package/dist/NeetoWidget/SelectionSwitches/index.js +44 -0
  136. package/dist/NeetoWidget/SyntaxHighlighter.js +17 -0
  137. package/dist/NeetoWidget/api.js +20 -0
  138. package/dist/NeetoWidget/constants.js +62 -0
  139. package/dist/NeetoWidget/hooks/useForceUpdate.js +14 -0
  140. package/dist/NeetoWidget/index.js +7 -0
  141. package/dist/NeetoWidget/mutations.js +9 -0
  142. package/dist/NeetoWidget/queries.js +32 -0
  143. package/dist/NeetoWidget/utils.js +83 -0
  144. package/dist/PageLoader/index.js +81 -0
  145. package/dist/PageLoader/page-loader.scss +95 -0
  146. package/dist/PhoneNumber/CountryPicker/SingleValue.js +21 -0
  147. package/dist/PhoneNumber/CountryPicker/constants.js +26 -0
  148. package/dist/PhoneNumber/CountryPicker/index.js +59 -0
  149. package/dist/PhoneNumber/FormikPhoneNumberInput.js +21 -0
  150. package/dist/PhoneNumber/PhoneNumber.js +30 -0
  151. package/dist/PhoneNumber/PhoneNumberInput.js +79 -0
  152. package/dist/PhoneNumber/index.js +5 -0
  153. package/dist/PhoneNumber/utils.js +55 -0
  154. package/dist/PublishBlock/AlertBlock.js +14 -0
  155. package/dist/PublishBlock/index.js +100 -0
  156. package/dist/PublishBlock/publish-block.scss +25 -0
  157. package/dist/Rename/DummySpan.js +21 -0
  158. package/dist/Rename/constants.js +1 -0
  159. package/dist/Rename/index.js +191 -0
  160. package/dist/Rename/rename.scss +69 -0
  161. package/dist/Rename/utils.js +10 -0
  162. package/dist/ResponsiveDevicePicker/constants.js +19 -0
  163. package/dist/ResponsiveDevicePicker/index.js +36 -0
  164. package/dist/Schedule/DisplayAvailability.js +58 -0
  165. package/dist/Schedule/Fields.js +43 -0
  166. package/dist/Schedule/Form/ScheduleRow.js +125 -0
  167. package/dist/Schedule/Form/constants.js +20 -0
  168. package/dist/Schedule/Form/index.js +144 -0
  169. package/dist/Schedule/Form/utils.js +63 -0
  170. package/dist/Schedule/Header.js +76 -0
  171. package/dist/Schedule/ScheduleContext.js +8 -0
  172. package/dist/Schedule/constants.js +8 -0
  173. package/dist/Schedule/dayjsExtended/constants.js +1 -0
  174. package/dist/Schedule/dayjsExtended/index.js +14 -0
  175. package/dist/Schedule/dayjsExtended/range.js +73 -0
  176. package/dist/Schedule/index.js +80 -0
  177. package/dist/Schedule/utils.js +152 -0
  178. package/dist/Scrollable/constants.js +8 -0
  179. package/dist/Scrollable/index.js +26 -0
  180. package/dist/Scrollable/scrollable.scss +32 -0
  181. package/dist/Security/AllowedKeywords/Add.js +38 -0
  182. package/dist/Security/AllowedKeywords/index.js +38 -0
  183. package/dist/Security/PasswordBlock.js +31 -0
  184. package/dist/Security/RadioBlock.js +38 -0
  185. package/dist/Security/api.js +12 -0
  186. package/dist/Security/constants.js +58 -0
  187. package/dist/Security/index.js +68 -0
  188. package/dist/Security/useSecurityApi.js +22 -0
  189. package/dist/Security/utils.js +31 -0
  190. package/dist/SendToFields/FilePicker.js +34 -0
  191. package/dist/SendToFields/constants.js +6 -0
  192. package/dist/SendToFields/index.js +102 -0
  193. package/dist/SendToFields/utils.js +54 -0
  194. package/dist/Settings/Category.js +30 -0
  195. package/dist/Settings/Item.js +38 -0
  196. package/dist/Settings/index.js +37 -0
  197. package/dist/Settings/utils.js +4 -0
  198. package/dist/ShareViaEmail/EmailBodyEditor.js +22 -0
  199. package/dist/ShareViaEmail/FilePicker.js +43 -0
  200. package/dist/ShareViaEmail/Form.js +101 -0
  201. package/dist/ShareViaEmail/FormikDatePicker.js +24 -0
  202. package/dist/ShareViaEmail/constants.js +14 -0
  203. package/dist/ShareViaEmail/index.js +89 -0
  204. package/dist/ShareViaEmail/utils.js +72 -0
  205. package/dist/ShareViaLink/EditURL.js +74 -0
  206. package/dist/ShareViaLink/Link.js +105 -0
  207. package/dist/ShareViaLink/QRCode.js +41 -0
  208. package/dist/ShareViaLink/RegenerateURL.js +47 -0
  209. package/dist/ShareViaLink/SocialMedia.js +52 -0
  210. package/dist/ShareViaLink/constants.js +25 -0
  211. package/dist/ShareViaLink/edit-url.scss +8 -0
  212. package/dist/ShareViaLink/index.js +46 -0
  213. package/dist/ShareViaLink/utils.js +47 -0
  214. package/dist/Sidebar/AppSwitcher/AppLink.js +45 -0
  215. package/dist/Sidebar/AppSwitcher/Backdrop.js +13 -0
  216. package/dist/Sidebar/AppSwitcher/Body.js +65 -0
  217. package/dist/Sidebar/AppSwitcher/Portal.js +27 -0
  218. package/dist/Sidebar/AppSwitcher/appswitcher.scss +164 -0
  219. package/dist/Sidebar/AppSwitcher/index.js +47 -0
  220. package/dist/Sidebar/AppSwitcher/utils.js +25 -0
  221. package/dist/Sidebar/Chevron.js +14 -0
  222. package/dist/Sidebar/FeaturedTooltip.js +19 -0
  223. package/dist/Sidebar/Footer/AppSwitcherButton.js +48 -0
  224. package/dist/Sidebar/Footer/ProfileButton.js +30 -0
  225. package/dist/Sidebar/Footer/index.js +56 -0
  226. package/dist/Sidebar/Footer/utils.js +39 -0
  227. package/dist/Sidebar/Header.js +33 -0
  228. package/dist/Sidebar/HelpSection/HelpSectionMenu.js +52 -0
  229. package/dist/Sidebar/HelpSection/index.js +32 -0
  230. package/dist/Sidebar/Links.js +112 -0
  231. package/dist/Sidebar/NavIconWrapper.js +20 -0
  232. package/dist/Sidebar/ProfileSection/LinkSection.js +36 -0
  233. package/dist/Sidebar/ProfileSection/ProfileMenu.js +48 -0
  234. package/dist/Sidebar/ProfileSection/index.js +42 -0
  235. package/dist/Sidebar/constants.js +40 -0
  236. package/dist/Sidebar/index.js +94 -0
  237. package/dist/Sidebar/sidebar.scss +379 -0
  238. package/dist/Sidebar/utils.js +18 -0
  239. package/dist/SubHeader/RightBlock/Columns.js +35 -0
  240. package/dist/SubHeader/RightBlock/Download.js +28 -0
  241. package/dist/SubHeader/RightBlock/Filter.js +31 -0
  242. package/dist/SubHeader/RightBlock/index.js +21 -0
  243. package/dist/SubHeader/RightBlock/utils.js +13 -0
  244. package/dist/SubHeader/index.js +28 -0
  245. package/dist/SubHeader/subheader.scss +78 -0
  246. package/dist/TableWrapper/index.js +18 -0
  247. package/dist/ThemeSidebar/Customize/Logo.js +39 -0
  248. package/dist/ThemeSidebar/Customize/Properties.js +170 -0
  249. package/dist/ThemeSidebar/Customize/index.js +66 -0
  250. package/dist/ThemeSidebar/Themes/ThemeCard.js +135 -0
  251. package/dist/ThemeSidebar/Themes/index.js +110 -0
  252. package/dist/ThemeSidebar/TitleBar.js +62 -0
  253. package/dist/ThemeSidebar/constants.js +127 -0
  254. package/dist/ThemeSidebar/fields/AlignmentBlock.js +50 -0
  255. package/dist/ThemeSidebar/fields/Card.js +19 -0
  256. package/dist/ThemeSidebar/fields/ColorBlock.js +19 -0
  257. package/dist/ThemeSidebar/fields/FontPickerBlock.js +35 -0
  258. package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +67 -0
  259. package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +22 -0
  260. package/dist/ThemeSidebar/fields/ImageBlock/index.js +55 -0
  261. package/dist/ThemeSidebar/fields/SelectBlock.js +24 -0
  262. package/dist/ThemeSidebar/fields/SliderBlock.js +30 -0
  263. package/dist/ThemeSidebar/fields/SwitchBlock.js +17 -0
  264. package/dist/ThemeSidebar/fields/TextBlock.js +13 -0
  265. package/dist/ThemeSidebar/fields/slider.scss +199 -0
  266. package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +149 -0
  267. package/dist/ThemeSidebar/index.js +118 -0
  268. package/dist/ThemeSidebar/themeSidebar.scss +45 -0
  269. package/dist/ThemeSidebar/utils.js +169 -0
  270. package/dist/TimeFormat/index.js +3 -0
  271. package/dist/TimezoneMismatchModal/apis/time_zone.js +9 -0
  272. package/dist/TimezoneMismatchModal/index.js +83 -0
  273. package/dist/TimezoneMismatchModal/useTimeZoneApi.js +10 -0
  274. package/dist/TimezoneMismatchModal/utils.js +12 -0
  275. package/dist/ToggleFeatureCard/ToolTipSwitch.js +31 -0
  276. package/dist/ToggleFeatureCard/constants.js +5 -0
  277. package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +11 -0
  278. package/dist/ToggleFeatureCard/index.js +148 -0
  279. package/dist/ToggleFeatureCard/toggleFeatureCard.scss +4 -0
  280. package/package.json +27 -34
  281. package/dist/AutoSaveInput.cjs.js +0 -724
  282. package/dist/AutoSaveInput.cjs.js.map +0 -1
  283. package/dist/AutoSaveInput.js +0 -718
  284. package/dist/AutoSaveInput.js.map +0 -1
  285. package/dist/Breadcrumbs.cjs.js +0 -44
  286. package/dist/Breadcrumbs.cjs.js.map +0 -1
  287. package/dist/Breadcrumbs.js +0 -38
  288. package/dist/Breadcrumbs.js.map +0 -1
  289. package/dist/BrowserSupport.cjs.js +0 -1731
  290. package/dist/BrowserSupport.cjs.js.map +0 -1
  291. package/dist/BrowserSupport.js +0 -1725
  292. package/dist/BrowserSupport.js.map +0 -1
  293. package/dist/CalendarView.cjs.js +0 -610
  294. package/dist/CalendarView.cjs.js.map +0 -1
  295. package/dist/CalendarView.js +0 -598
  296. package/dist/CalendarView.js.map +0 -1
  297. package/dist/Codeblock.cjs.js +0 -302
  298. package/dist/Codeblock.cjs.js.map +0 -1
  299. package/dist/Codeblock.js +0 -296
  300. package/dist/Codeblock.js.map +0 -1
  301. package/dist/Columns.cjs.js +0 -248
  302. package/dist/Columns.cjs.js.map +0 -1
  303. package/dist/Columns.js.map +0 -1
  304. package/dist/ConfirmationModal.cjs.js +0 -87
  305. package/dist/ConfirmationModal.cjs.js.map +0 -1
  306. package/dist/ConfirmationModal.js.map +0 -1
  307. package/dist/Container.cjs.js +0 -1277
  308. package/dist/Container.cjs.js.map +0 -1
  309. package/dist/Container.js +0 -1271
  310. package/dist/Container.js.map +0 -1
  311. package/dist/CopyToClipboardButton.cjs.js +0 -275
  312. package/dist/CopyToClipboardButton.cjs.js.map +0 -1
  313. package/dist/CopyToClipboardButton.js +0 -269
  314. package/dist/CopyToClipboardButton.js.map +0 -1
  315. package/dist/CustomDomain.cjs.js +0 -774
  316. package/dist/CustomDomain.cjs.js.map +0 -1
  317. package/dist/CustomDomain.js +0 -747
  318. package/dist/CustomDomain.js.map +0 -1
  319. package/dist/CustomDomainDashboard.cjs.js +0 -2370
  320. package/dist/CustomDomainDashboard.cjs.js.map +0 -1
  321. package/dist/CustomDomainDashboard.js +0 -2342
  322. package/dist/CustomDomainDashboard.js.map +0 -1
  323. package/dist/DateFormat.cjs.js +0 -51
  324. package/dist/DateFormat.cjs.js.map +0 -1
  325. package/dist/DateFormat.js.map +0 -1
  326. package/dist/DateRangeFilter.cjs.js +0 -236
  327. package/dist/DateRangeFilter.cjs.js.map +0 -1
  328. package/dist/DateRangeFilter.js +0 -229
  329. package/dist/DateRangeFilter.js.map +0 -1
  330. package/dist/DynamicVariables.cjs.js +0 -189
  331. package/dist/DynamicVariables.cjs.js.map +0 -1
  332. package/dist/DynamicVariables.js +0 -183
  333. package/dist/DynamicVariables.js.map +0 -1
  334. package/dist/EmailForm.cjs.js +0 -4295
  335. package/dist/EmailForm.cjs.js.map +0 -1
  336. package/dist/EmailForm.js +0 -4265
  337. package/dist/EmailForm.js.map +0 -1
  338. package/dist/EmailPreview.cjs.js +0 -1419
  339. package/dist/EmailPreview.cjs.js.map +0 -1
  340. package/dist/EmailPreview.js +0 -1413
  341. package/dist/EmailPreview.js.map +0 -1
  342. package/dist/ErrorPage.cjs.js +0 -226
  343. package/dist/ErrorPage.cjs.js.map +0 -1
  344. package/dist/ErrorPage.js.map +0 -1
  345. package/dist/Header.cjs.js +0 -188
  346. package/dist/Header.cjs.js.map +0 -1
  347. package/dist/Header.js +0 -182
  348. package/dist/Header.js.map +0 -1
  349. package/dist/IconPicker.cjs.js +0 -1308
  350. package/dist/IconPicker.cjs.js.map +0 -1
  351. package/dist/IconPicker.js +0 -1302
  352. package/dist/IconPicker.js.map +0 -1
  353. package/dist/ImageWithFallback.cjs.js +0 -247
  354. package/dist/ImageWithFallback.cjs.js.map +0 -1
  355. package/dist/ImageWithFallback.js +0 -241
  356. package/dist/ImageWithFallback.js.map +0 -1
  357. package/dist/IntegrationCard.cjs.js +0 -409
  358. package/dist/IntegrationCard.cjs.js.map +0 -1
  359. package/dist/IntegrationCard.js +0 -403
  360. package/dist/IntegrationCard.js.map +0 -1
  361. package/dist/IntegrationDisconnectAlert.cjs.js +0 -89
  362. package/dist/IntegrationDisconnectAlert.cjs.js.map +0 -1
  363. package/dist/IntegrationDisconnectAlert.js +0 -80
  364. package/dist/IntegrationDisconnectAlert.js.map +0 -1
  365. package/dist/IntegrationWalkthroughModal.cjs.js +0 -50
  366. package/dist/IntegrationWalkthroughModal.cjs.js.map +0 -1
  367. package/dist/IntegrationWalkthroughModal.js.map +0 -1
  368. package/dist/IpRestriction.cjs.js +0 -3931
  369. package/dist/IpRestriction.cjs.js.map +0 -1
  370. package/dist/IpRestriction.js +0 -3905
  371. package/dist/IpRestriction.js.map +0 -1
  372. package/dist/KeyboardShortcuts.cjs.js +0 -2263
  373. package/dist/KeyboardShortcuts.cjs.js.map +0 -1
  374. package/dist/KeyboardShortcuts.js +0 -2256
  375. package/dist/KeyboardShortcuts.js.map +0 -1
  376. package/dist/LoginPage.cjs.js +0 -618
  377. package/dist/LoginPage.cjs.js.map +0 -1
  378. package/dist/LoginPage.js +0 -593
  379. package/dist/LoginPage.js.map +0 -1
  380. package/dist/MenuBar.cjs.js +0 -34273
  381. package/dist/MenuBar.cjs.js.map +0 -1
  382. package/dist/MenuBar.js +0 -34267
  383. package/dist/MenuBar.js.map +0 -1
  384. package/dist/Metadata.cjs.js +0 -272
  385. package/dist/Metadata.cjs.js.map +0 -1
  386. package/dist/Metadata.js +0 -266
  387. package/dist/Metadata.js.map +0 -1
  388. package/dist/MoreDropdown.cjs.js +0 -168
  389. package/dist/MoreDropdown.cjs.js.map +0 -1
  390. package/dist/MoreDropdown.js.map +0 -1
  391. package/dist/NavigationHeader.cjs.js +0 -756
  392. package/dist/NavigationHeader.cjs.js.map +0 -1
  393. package/dist/NavigationHeader.js +0 -750
  394. package/dist/NavigationHeader.js.map +0 -1
  395. package/dist/NeetoWidget.cjs.js +0 -3375
  396. package/dist/NeetoWidget.cjs.js.map +0 -1
  397. package/dist/NeetoWidget.js +0 -3348
  398. package/dist/NeetoWidget.js.map +0 -1
  399. package/dist/PageLoader.cjs.js +0 -158
  400. package/dist/PageLoader.cjs.js.map +0 -1
  401. package/dist/PageLoader.js +0 -134
  402. package/dist/PageLoader.js.map +0 -1
  403. package/dist/PhoneNumber.cjs.js +0 -7021
  404. package/dist/PhoneNumber.cjs.js.map +0 -1
  405. package/dist/PhoneNumber.js +0 -6989
  406. package/dist/PhoneNumber.js.map +0 -1
  407. package/dist/PublishBlock.cjs.js +0 -224
  408. package/dist/PublishBlock.cjs.js.map +0 -1
  409. package/dist/PublishBlock.js +0 -218
  410. package/dist/PublishBlock.js.map +0 -1
  411. package/dist/Rename.cjs.js +0 -516
  412. package/dist/Rename.cjs.js.map +0 -1
  413. package/dist/Rename.js +0 -510
  414. package/dist/Rename.js.map +0 -1
  415. package/dist/ResponsiveDevicePicker.cjs.js +0 -260
  416. package/dist/ResponsiveDevicePicker.cjs.js.map +0 -1
  417. package/dist/ResponsiveDevicePicker.js +0 -254
  418. package/dist/ResponsiveDevicePicker.js.map +0 -1
  419. package/dist/Schedule.cjs.js +0 -1077
  420. package/dist/Schedule.cjs.js.map +0 -1
  421. package/dist/Schedule.js +0 -1046
  422. package/dist/Schedule.js.map +0 -1
  423. package/dist/Scrollable.cjs.js +0 -188
  424. package/dist/Scrollable.cjs.js.map +0 -1
  425. package/dist/Scrollable.js +0 -182
  426. package/dist/Scrollable.js.map +0 -1
  427. package/dist/Security.cjs.js +0 -1921
  428. package/dist/Security.cjs.js.map +0 -1
  429. package/dist/Security.js +0 -1895
  430. package/dist/Security.js.map +0 -1
  431. package/dist/SendToFields.cjs.js +0 -2524
  432. package/dist/SendToFields.cjs.js.map +0 -1
  433. package/dist/SendToFields.js +0 -2517
  434. package/dist/SendToFields.js.map +0 -1
  435. package/dist/Settings.cjs.js +0 -501
  436. package/dist/Settings.cjs.js.map +0 -1
  437. package/dist/Settings.js +0 -495
  438. package/dist/Settings.js.map +0 -1
  439. package/dist/ShareViaEmail.cjs.js +0 -4272
  440. package/dist/ShareViaEmail.cjs.js.map +0 -1
  441. package/dist/ShareViaEmail.js +0 -4246
  442. package/dist/ShareViaEmail.js.map +0 -1
  443. package/dist/ShareViaLink.cjs.js +0 -1512
  444. package/dist/ShareViaLink.cjs.js.map +0 -1
  445. package/dist/ShareViaLink.js +0 -1486
  446. package/dist/ShareViaLink.js.map +0 -1
  447. package/dist/Sidebar.cjs.js +0 -34985
  448. package/dist/Sidebar.cjs.js.map +0 -1
  449. package/dist/Sidebar.js +0 -34959
  450. package/dist/Sidebar.js.map +0 -1
  451. package/dist/SubHeader.cjs.js +0 -283
  452. package/dist/SubHeader.cjs.js.map +0 -1
  453. package/dist/SubHeader.js +0 -276
  454. package/dist/SubHeader.js.map +0 -1
  455. package/dist/TableWrapper.cjs.js +0 -87
  456. package/dist/TableWrapper.cjs.js.map +0 -1
  457. package/dist/TableWrapper.js +0 -81
  458. package/dist/TableWrapper.js.map +0 -1
  459. package/dist/ThemeSidebar.cjs.js +0 -13705
  460. package/dist/ThemeSidebar.cjs.js.map +0 -1
  461. package/dist/ThemeSidebar.js +0 -13680
  462. package/dist/ThemeSidebar.js.map +0 -1
  463. package/dist/TimeFormat.cjs.js +0 -53
  464. package/dist/TimeFormat.cjs.js.map +0 -1
  465. package/dist/TimeFormat.js +0 -47
  466. package/dist/TimeFormat.js.map +0 -1
  467. package/dist/TimezoneMismatchModal.cjs.js +0 -176
  468. package/dist/TimezoneMismatchModal.cjs.js.map +0 -1
  469. package/dist/TimezoneMismatchModal.js +0 -168
  470. package/dist/TimezoneMismatchModal.js.map +0 -1
  471. package/dist/ToggleFeatureCard.cjs.js +0 -389
  472. package/dist/ToggleFeatureCard.cjs.js.map +0 -1
  473. package/dist/ToggleFeatureCard.js +0 -383
  474. package/dist/ToggleFeatureCard.js.map +0 -1
@@ -1,3348 +0,0 @@
1
- import { values, last, identity, assoc, pluck, any, prop, fromPairs, isEmpty } from 'ramda';
2
- import * as React from 'react';
3
- import React__default, { useEffect, useState, useRef } from 'react';
4
- import { Info } from '@bigbinary/neeto-icons';
5
- import { Typography, Select, Button, Pane, Toastr, Tooltip, Switch, Label, Callout } from '@bigbinary/neetoui';
6
- import { useTranslation, Trans } from 'react-i18next';
7
- import { useMutation, useQuery, useQueryClient, QueryClient, QueryClientProvider } from 'react-query';
8
- import { capitalize, noop, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
9
- import { withT, usePrevious } from '@bigbinary/neeto-commons-frontend/react-utils';
10
- import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
11
- import { Formik, Form } from 'formik';
12
- import { MultiEmailInput, Input } from '@bigbinary/neetoui/formik';
13
- import i18next from 'i18next';
14
- import * as yup from 'yup';
15
-
16
- function _typeof$1(obj) {
17
- "@babel/helpers - typeof";
18
-
19
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
20
- return typeof obj;
21
- } : function (obj) {
22
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
23
- }, _typeof$1(obj);
24
- }
25
-
26
- function _toPrimitive(input, hint) {
27
- if (_typeof$1(input) !== "object" || input === null) return input;
28
- var prim = input[Symbol.toPrimitive];
29
- if (prim !== undefined) {
30
- var res = prim.call(input, hint || "default");
31
- if (_typeof$1(res) !== "object") return res;
32
- throw new TypeError("@@toPrimitive must return a primitive value.");
33
- }
34
- return (hint === "string" ? String : Number)(input);
35
- }
36
-
37
- function _toPropertyKey(arg) {
38
- var key = _toPrimitive(arg, "string");
39
- return _typeof$1(key) === "symbol" ? key : String(key);
40
- }
41
-
42
- function _defineProperty(obj, key, value) {
43
- key = _toPropertyKey(key);
44
- if (key in obj) {
45
- Object.defineProperty(obj, key, {
46
- value: value,
47
- enumerable: true,
48
- configurable: true,
49
- writable: true
50
- });
51
- } else {
52
- obj[key] = value;
53
- }
54
- return obj;
55
- }
56
-
57
- var _SAMPLE_USER_IDENTITY;
58
- var NEETO_WIDGET_USER_IDENTITY_KEY = "NeetoWidgetUserIdentity";
59
- var SESSION_CONTEXT_KEY = "NeetoReplayWidgetSessionContext";
60
- var INSTALLATION_HELP_EMAIL = "support@neeto.com";
61
- var SAMPLE_CONTEXT_CODE_STRING = "window.".concat(SESSION_CONTEXT_KEY, " = {\n key1: \"value\",\n key2: [\"array\", \"of\", \"values\"],\n /* More key-value pairs */\n}");
62
- var WIDGET_TYPES = {
63
- changelog: "changelog",
64
- chat: "chat",
65
- replay: "replay"
66
- };
67
- var WIDGET_TYPES_VALUES = values(WIDGET_TYPES);
68
- var QUERY_KEYS = {
69
- apiKey: "neetoWidgetApiKey",
70
- configuration: "neetoWidgetConfiguration"
71
- };
72
- var DEFAULT_QUERY_STALE_TIME = 60 * 60 * 1000; // 1 hour in milliseconds
73
-
74
- var EMAIL_TYPES = {
75
- embedCode: "embedCode",
76
- userIdentity: "userIdentity",
77
- sessionContext: "sessionContext",
78
- "null": ""
79
- };
80
- var RAILS_ENV = {
81
- production: "production",
82
- staging: "staging",
83
- development: "development"
84
- };
85
- var NEETO_WIDGET_SCRIPT_URL = {
86
- staging: "https://d13nryxs46eypn.cloudfront.net/neeto-widget-staging.js",
87
- production: "https://d13nryxs46eypn.cloudfront.net/neeto-widget.js"
88
- };
89
- var AVAILABLE_FRAMEWORK_OPTIONS = Object.freeze({
90
- rails: "rails",
91
- django: "django",
92
- php: "php"
93
- });
94
- var FRAMEWORK_SELECT_OPTIONS = [{
95
- label: "Ruby(Rails)",
96
- value: AVAILABLE_FRAMEWORK_OPTIONS.rails
97
- }, {
98
- label: "Python(Django)",
99
- value: AVAILABLE_FRAMEWORK_OPTIONS.django
100
- }, {
101
- label: "PHP",
102
- value: AVAILABLE_FRAMEWORK_OPTIONS.php
103
- }];
104
- var SAMPLE_USER_IDENTITY_CODE_STRING = (_SAMPLE_USER_IDENTITY = {}, _defineProperty(_SAMPLE_USER_IDENTITY, AVAILABLE_FRAMEWORK_OPTIONS.rails, "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {\n user_identifier: \"<%= current_user.id %>\", // User identifier\"\n name: \"<%= current_user.name %>\", // Full name\n email: \"<%= current_user.email %>\", // Email address\n started_at: \"<%= current_user.created_at.to_i %>\" // Signup date as a Unix timestamp ,\n}")), _defineProperty(_SAMPLE_USER_IDENTITY, AVAILABLE_FRAMEWORK_OPTIONS.django, "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {\n user_identifier: \"{{ request.user.id|escapejs }}\", // User identifier\n name: \"{{ request.user.name|escapejs }}\", // Full name\n email: \"{{ request.user.email|escapejs }}\", // Email address\n started_at: \"{{ request.user.created_at|date:'U' }}\" // Signup date as a Unix timestamp\"\n}")), _defineProperty(_SAMPLE_USER_IDENTITY, AVAILABLE_FRAMEWORK_OPTIONS.php, "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {\n user_identifier: <?php echo json_encode($current_user->id) ?>, // User identifier\n name: <?php echo json_encode($current_user->name) ?>, // Full name\n email: <?php echo json_encode($current_user->email) ?>, // Email address\n started_at: <?php echo strtotime($current_user->created_at) ?> // Signup date as a Unix timestamp\" ,\n}")), _SAMPLE_USER_IDENTITY);
105
- var WIDGET_CONFIG_URL = "api/widget/v1/neeto_widget_tokens";
106
- var EMBED_CODE_EMAIL_URL = "api/widget/v1/email_snippets";
107
- var CHAT_WIDGET_KB_BASE_URL = "https://help.neetochat.com";
108
- var CHANGELOG_WIDGET_KB_BASE_URL = "https://help.neetochangelog.com";
109
- var REPLAY_WIDGET_KB_BASE_URL = "https://help.neetoreplay.com";
110
- var NEETO_REPLAY_CONFIGURE_URL = "".concat(REPLAY_WIDGET_KB_BASE_URL, "/articles/configure-widget");
111
- var NEETO_CHAT_USER_IDENTITY_URL = "".concat(CHAT_WIDGET_KB_BASE_URL, "/articles/info-about-logged-in-users");
112
- var WIDGET_KB_HELP_URL = {
113
- changelog: "".concat(CHANGELOG_WIDGET_KB_BASE_URL, "/categories/widget-installation-usage"),
114
- chat: "".concat(CHAT_WIDGET_KB_BASE_URL, "/categories/installation"),
115
- replay: "".concat(REPLAY_WIDGET_KB_BASE_URL, "/categories/widget-installation-usage")
116
- };
117
-
118
- function _extends$1() {
119
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
120
- for (var i = 1; i < arguments.length; i++) {
121
- var source = arguments[i];
122
- for (var key in source) {
123
- if (Object.prototype.hasOwnProperty.call(source, key)) {
124
- target[key] = source[key];
125
- }
126
- }
127
- }
128
- return target;
129
- };
130
- return _extends$1.apply(this, arguments);
131
- }
132
-
133
- function _arrayWithHoles(arr) {
134
- if (Array.isArray(arr)) return arr;
135
- }
136
-
137
- function _iterableToArrayLimit(arr, i) {
138
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
139
- if (null != _i) {
140
- var _s,
141
- _e,
142
- _x,
143
- _r,
144
- _arr = [],
145
- _n = !0,
146
- _d = !1;
147
- try {
148
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
149
- if (Object(_i) !== _i) return;
150
- _n = !1;
151
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
152
- } catch (err) {
153
- _d = !0, _e = err;
154
- } finally {
155
- try {
156
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
157
- } finally {
158
- if (_d) throw _e;
159
- }
160
- }
161
- return _arr;
162
- }
163
- }
164
-
165
- function _arrayLikeToArray(arr, len) {
166
- if (len == null || len > arr.length) len = arr.length;
167
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
168
- return arr2;
169
- }
170
-
171
- function _unsupportedIterableToArray(o, minLen) {
172
- if (!o) return;
173
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
174
- var n = Object.prototype.toString.call(o).slice(8, -1);
175
- if (n === "Object" && o.constructor) n = o.constructor.name;
176
- if (n === "Map" || n === "Set") return Array.from(o);
177
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
178
- }
179
-
180
- function _nonIterableRest() {
181
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
182
- }
183
-
184
- function _slicedToArray(arr, i) {
185
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
186
- }
187
-
188
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
189
-
190
- var classnames$1 = {exports: {}};
191
-
192
- /*!
193
- Copyright (c) 2018 Jed Watson.
194
- Licensed under the MIT License (MIT), see
195
- http://jedwatson.github.io/classnames
196
- */
197
-
198
- (function (module) {
199
- /* global define */
200
-
201
- (function () {
202
-
203
- var hasOwn = {}.hasOwnProperty;
204
-
205
- function classNames() {
206
- var classes = [];
207
-
208
- for (var i = 0; i < arguments.length; i++) {
209
- var arg = arguments[i];
210
- if (!arg) continue;
211
-
212
- var argType = typeof arg;
213
-
214
- if (argType === 'string' || argType === 'number') {
215
- classes.push(arg);
216
- } else if (Array.isArray(arg)) {
217
- if (arg.length) {
218
- var inner = classNames.apply(null, arg);
219
- if (inner) {
220
- classes.push(inner);
221
- }
222
- }
223
- } else if (argType === 'object') {
224
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
225
- classes.push(arg.toString());
226
- continue;
227
- }
228
-
229
- for (var key in arg) {
230
- if (hasOwn.call(arg, key) && arg[key]) {
231
- classes.push(key);
232
- }
233
- }
234
- }
235
- }
236
-
237
- return classes.join(' ');
238
- }
239
-
240
- if (module.exports) {
241
- classNames.default = classNames;
242
- module.exports = classNames;
243
- } else {
244
- window.classNames = classNames;
245
- }
246
- }());
247
- } (classnames$1));
248
-
249
- var classnames = classnames$1.exports;
250
-
251
- function _objectWithoutPropertiesLoose(source, excluded) {
252
- if (source == null) return {};
253
- var target = {};
254
- var sourceKeys = Object.keys(source);
255
- var key, i;
256
- for (i = 0; i < sourceKeys.length; i++) {
257
- key = sourceKeys[i];
258
- if (excluded.indexOf(key) >= 0) continue;
259
- target[key] = source[key];
260
- }
261
- return target;
262
- }
263
-
264
- function _objectWithoutProperties(source, excluded) {
265
- if (source == null) return {};
266
- var target = _objectWithoutPropertiesLoose(source, excluded);
267
- var key, i;
268
- if (Object.getOwnPropertySymbols) {
269
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
270
- for (i = 0; i < sourceSymbolKeys.length; i++) {
271
- key = sourceSymbolKeys[i];
272
- if (excluded.indexOf(key) >= 0) continue;
273
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
274
- target[key] = source[key];
275
- }
276
- }
277
- return target;
278
- }
279
-
280
- var _path, _path2, _g, _defs;
281
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
282
- var SvgNeeto = function SvgNeeto(props) {
283
- return /*#__PURE__*/React.createElement("svg", _extends({
284
- width: 50,
285
- height: 50,
286
- viewBox: "0 0 415 415",
287
- fill: "none",
288
- xmlns: "http://www.w3.org/2000/svg"
289
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
290
- d: "M414.989 207.495C414.989 92.899 322.091 0 207.495 0H0v414.989h414.989V207.495Z",
291
- fill: "#0043AC"
292
- })), /*#__PURE__*/React.createElement("mask", {
293
- id: "neeto_svg__a",
294
- style: {
295
- maskType: "alpha"
296
- },
297
- maskUnits: "userSpaceOnUse",
298
- x: 0,
299
- y: 0,
300
- width: 415,
301
- height: 415
302
- }, _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
303
- d: "M414.989 207.495C414.989 92.899 322.091 0 207.495 0H0v414.989h414.989V207.495Z",
304
- fill: "#0043AC"
305
- }))), _g || (_g = /*#__PURE__*/React.createElement("g", {
306
- mask: "url(#neeto_svg__a)"
307
- }, /*#__PURE__*/React.createElement("path", {
308
- d: "M233.747 348.74c88.579 101.145 172.015 116.411 202.661 111.401v32.491H-8.032V230.487c43.685-2.726 153.2 17.108 241.779 118.253Z",
309
- fill: "url(#neeto_svg__b)"
310
- }))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("radialGradient", {
311
- id: "neeto_svg__b",
312
- cx: 0,
313
- cy: 0,
314
- r: 1,
315
- gradientUnits: "userSpaceOnUse",
316
- gradientTransform: "rotate(47.118 -220.556 214.818) scale(427.964 725.049)"
317
- }, /*#__PURE__*/React.createElement("stop", {
318
- stopColor: "#0043AC"
319
- }), /*#__PURE__*/React.createElement("stop", {
320
- offset: 1,
321
- stopColor: "#3DB1CA",
322
- stopOpacity: 0.8
323
- })))));
324
- };
325
-
326
- 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}}
327
-
328
- var css$1 = ".neeto-molecules-pageloader__wrapper{height:100%;position:relative;width:100%}.neeto-molecules-pageloader__wrapper .neeto-molecules-pageloader{height:100%;left:0;position:absolute;top:0;width:100%}.neeto-molecules-pageloader__wrapper .neeto-molecules-pageloader__content{height:66px;margin-bottom:16px;overflow:hidden;padding:8px;position:relative;width:66px}.neeto-molecules-pageloader__wrapper .neeto-molecules-pageloader__text{color:rgb(var(--neeto-ui-gray-800));font-size:1.25rem;line-height:1.75rem;margin-bottom:4rem;text-align:center}.neeto-molecules-pageloader__spinner{display:flex;gap:2px;height:25px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.neeto-molecules-pageloader__spinner>div{animation:neeto-ui-stretch-delay 1.2s ease-in-out infinite;background-color:#fff;border-radius:2px;display:inline-flex;height:100%;width:2px}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect2{animation-delay:-1.1s}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect3{animation-delay:-1s}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect4{animation-delay:-.9s}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect5{animation-delay:-.8s}@keyframes neeto-ui-stretch-delay{0%,40%,to{transform:scaleY(.4);-webkit-transform:scaleY(.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}";
329
- n(css$1,{});
330
-
331
- var _excluded = ["text"];
332
- var PageLoader = function PageLoader(_ref) {
333
- var _ref$text = _ref.text,
334
- text = _ref$text === void 0 ? "" : _ref$text,
335
- otherProps = _objectWithoutProperties(_ref, _excluded);
336
- return /*#__PURE__*/React__default.createElement("div", _extends$1({
337
- className: "neeto-molecules-pageloader__wrapper"
338
- }, otherProps), /*#__PURE__*/React__default.createElement("div", {
339
- className: "neeto-molecules-pageloader neeto-ui-flex neeto-ui-flex-col neeto-ui-items-center neeto-ui-justify-center"
340
- }, /*#__PURE__*/React__default.createElement("div", {
341
- className: "neeto-molecules-pageloader__content neeto-ui-flex neeto-ui-flex-shrink-0 neeto-ui-items-center neeto-ui-justify-center"
342
- }, /*#__PURE__*/React__default.createElement(SvgNeeto, {
343
- className: "neeto-molecules-pageloader__logo",
344
- size: 50
345
- }), /*#__PURE__*/React__default.createElement("div", {
346
- className: "neeto-molecules-pageloader__spinner"
347
- }, /*#__PURE__*/React__default.createElement("div", {
348
- className: "neeto-molecules-pageloader__rect1"
349
- }), /*#__PURE__*/React__default.createElement("div", {
350
- className: "neeto-molecules-pageloader__rect2"
351
- }), /*#__PURE__*/React__default.createElement("div", {
352
- className: "neeto-molecules-pageloader__rect3"
353
- }), /*#__PURE__*/React__default.createElement("div", {
354
- className: "neeto-molecules-pageloader__rect4"
355
- }), /*#__PURE__*/React__default.createElement("div", {
356
- className: "neeto-molecules-pageloader__rect5"
357
- }))), text && /*#__PURE__*/React__default.createElement(Typography, {
358
- style: "h5",
359
- weight: "semibold"
360
- }, text)));
361
- };
362
- var PageLoader$1 = /*#__PURE__*/React__default.memo(PageLoader);
363
-
364
- var prism = {exports: {}};
365
-
366
- (function (module) {
367
- /* **********************************************
368
- Begin prism-core.js
369
- ********************************************** */
370
-
371
- /// <reference lib="WebWorker"/>
372
-
373
- var _self = (typeof window !== 'undefined')
374
- ? window // if in browser
375
- : (
376
- (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
377
- ? self // if in worker
378
- : {} // if in node js
379
- );
380
-
381
- /**
382
- * Prism: Lightweight, robust, elegant syntax highlighting
383
- *
384
- * @license MIT <https://opensource.org/licenses/MIT>
385
- * @author Lea Verou <https://lea.verou.me>
386
- * @namespace
387
- * @public
388
- */
389
- var Prism = (function (_self) {
390
-
391
- // Private helper vars
392
- var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
393
- var uniqueId = 0;
394
-
395
- // The grammar object for plaintext
396
- var plainTextGrammar = {};
397
-
398
-
399
- var _ = {
400
- /**
401
- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
402
- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
403
- * additional languages or plugins yourself.
404
- *
405
- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
406
- *
407
- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
408
- * empty Prism object into the global scope before loading the Prism script like this:
409
- *
410
- * ```js
411
- * window.Prism = window.Prism || {};
412
- * Prism.manual = true;
413
- * // add a new <script> to load Prism's script
414
- * ```
415
- *
416
- * @default false
417
- * @type {boolean}
418
- * @memberof Prism
419
- * @public
420
- */
421
- manual: _self.Prism && _self.Prism.manual,
422
- /**
423
- * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
424
- * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
425
- * own worker, you don't want it to do this.
426
- *
427
- * By setting this value to `true`, Prism will not add its own listeners to the worker.
428
- *
429
- * You obviously have to change this value before Prism executes. To do this, you can add an
430
- * empty Prism object into the global scope before loading the Prism script like this:
431
- *
432
- * ```js
433
- * window.Prism = window.Prism || {};
434
- * Prism.disableWorkerMessageHandler = true;
435
- * // Load Prism's script
436
- * ```
437
- *
438
- * @default false
439
- * @type {boolean}
440
- * @memberof Prism
441
- * @public
442
- */
443
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
444
-
445
- /**
446
- * A namespace for utility methods.
447
- *
448
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
449
- * change or disappear at any time.
450
- *
451
- * @namespace
452
- * @memberof Prism
453
- */
454
- util: {
455
- encode: function encode(tokens) {
456
- if (tokens instanceof Token) {
457
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
458
- } else if (Array.isArray(tokens)) {
459
- return tokens.map(encode);
460
- } else {
461
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
462
- }
463
- },
464
-
465
- /**
466
- * Returns the name of the type of the given value.
467
- *
468
- * @param {any} o
469
- * @returns {string}
470
- * @example
471
- * type(null) === 'Null'
472
- * type(undefined) === 'Undefined'
473
- * type(123) === 'Number'
474
- * type('foo') === 'String'
475
- * type(true) === 'Boolean'
476
- * type([1, 2]) === 'Array'
477
- * type({}) === 'Object'
478
- * type(String) === 'Function'
479
- * type(/abc+/) === 'RegExp'
480
- */
481
- type: function (o) {
482
- return Object.prototype.toString.call(o).slice(8, -1);
483
- },
484
-
485
- /**
486
- * Returns a unique number for the given object. Later calls will still return the same number.
487
- *
488
- * @param {Object} obj
489
- * @returns {number}
490
- */
491
- objId: function (obj) {
492
- if (!obj['__id']) {
493
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
494
- }
495
- return obj['__id'];
496
- },
497
-
498
- /**
499
- * Creates a deep clone of the given object.
500
- *
501
- * The main intended use of this function is to clone language definitions.
502
- *
503
- * @param {T} o
504
- * @param {Record<number, any>} [visited]
505
- * @returns {T}
506
- * @template T
507
- */
508
- clone: function deepClone(o, visited) {
509
- visited = visited || {};
510
-
511
- var clone; var id;
512
- switch (_.util.type(o)) {
513
- case 'Object':
514
- id = _.util.objId(o);
515
- if (visited[id]) {
516
- return visited[id];
517
- }
518
- clone = /** @type {Record<string, any>} */ ({});
519
- visited[id] = clone;
520
-
521
- for (var key in o) {
522
- if (o.hasOwnProperty(key)) {
523
- clone[key] = deepClone(o[key], visited);
524
- }
525
- }
526
-
527
- return /** @type {any} */ (clone);
528
-
529
- case 'Array':
530
- id = _.util.objId(o);
531
- if (visited[id]) {
532
- return visited[id];
533
- }
534
- clone = [];
535
- visited[id] = clone;
536
-
537
- (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
538
- clone[i] = deepClone(v, visited);
539
- });
540
-
541
- return /** @type {any} */ (clone);
542
-
543
- default:
544
- return o;
545
- }
546
- },
547
-
548
- /**
549
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
550
- *
551
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
552
- *
553
- * @param {Element} element
554
- * @returns {string}
555
- */
556
- getLanguage: function (element) {
557
- while (element) {
558
- var m = lang.exec(element.className);
559
- if (m) {
560
- return m[1].toLowerCase();
561
- }
562
- element = element.parentElement;
563
- }
564
- return 'none';
565
- },
566
-
567
- /**
568
- * Sets the Prism `language-xxxx` class of the given element.
569
- *
570
- * @param {Element} element
571
- * @param {string} language
572
- * @returns {void}
573
- */
574
- setLanguage: function (element, language) {
575
- // remove all `language-xxxx` classes
576
- // (this might leave behind a leading space)
577
- element.className = element.className.replace(RegExp(lang, 'gi'), '');
578
-
579
- // add the new `language-xxxx` class
580
- // (using `classList` will automatically clean up spaces for us)
581
- element.classList.add('language-' + language);
582
- },
583
-
584
- /**
585
- * Returns the script element that is currently executing.
586
- *
587
- * This does __not__ work for line script element.
588
- *
589
- * @returns {HTMLScriptElement | null}
590
- */
591
- currentScript: function () {
592
- if (typeof document === 'undefined') {
593
- return null;
594
- }
595
- if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
596
- return /** @type {any} */ (document.currentScript);
597
- }
598
-
599
- // IE11 workaround
600
- // we'll get the src of the current script by parsing IE11's error stack trace
601
- // this will not work for inline scripts
602
-
603
- try {
604
- throw new Error();
605
- } catch (err) {
606
- // Get file src url from stack. Specifically works with the format of stack traces in IE.
607
- // A stack will look like this:
608
- //
609
- // Error
610
- // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
611
- // at Global code (http://localhost/components/prism-core.js:606:1)
612
-
613
- var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
614
- if (src) {
615
- var scripts = document.getElementsByTagName('script');
616
- for (var i in scripts) {
617
- if (scripts[i].src == src) {
618
- return scripts[i];
619
- }
620
- }
621
- }
622
- return null;
623
- }
624
- },
625
-
626
- /**
627
- * Returns whether a given class is active for `element`.
628
- *
629
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
630
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
631
- * given class is just the given class with a `no-` prefix.
632
- *
633
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
634
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
635
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
636
- *
637
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
638
- * version of it, the class is considered active.
639
- *
640
- * @param {Element} element
641
- * @param {string} className
642
- * @param {boolean} [defaultActivation=false]
643
- * @returns {boolean}
644
- */
645
- isActive: function (element, className, defaultActivation) {
646
- var no = 'no-' + className;
647
-
648
- while (element) {
649
- var classList = element.classList;
650
- if (classList.contains(className)) {
651
- return true;
652
- }
653
- if (classList.contains(no)) {
654
- return false;
655
- }
656
- element = element.parentElement;
657
- }
658
- return !!defaultActivation;
659
- }
660
- },
661
-
662
- /**
663
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
664
- *
665
- * @namespace
666
- * @memberof Prism
667
- * @public
668
- */
669
- languages: {
670
- /**
671
- * The grammar for plain, unformatted text.
672
- */
673
- plain: plainTextGrammar,
674
- plaintext: plainTextGrammar,
675
- text: plainTextGrammar,
676
- txt: plainTextGrammar,
677
-
678
- /**
679
- * Creates a deep copy of the language with the given id and appends the given tokens.
680
- *
681
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
682
- * will be overwritten at its original position.
683
- *
684
- * ## Best practices
685
- *
686
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
687
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
688
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
689
- *
690
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
691
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
692
- *
693
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
694
- * @param {Grammar} redef The new tokens to append.
695
- * @returns {Grammar} The new language created.
696
- * @public
697
- * @example
698
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
699
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
700
- * // at its original position
701
- * 'comment': { ... },
702
- * // CSS doesn't have a 'color' token, so this token will be appended
703
- * 'color': /\b(?:red|green|blue)\b/
704
- * });
705
- */
706
- extend: function (id, redef) {
707
- var lang = _.util.clone(_.languages[id]);
708
-
709
- for (var key in redef) {
710
- lang[key] = redef[key];
711
- }
712
-
713
- return lang;
714
- },
715
-
716
- /**
717
- * Inserts tokens _before_ another token in a language definition or any other grammar.
718
- *
719
- * ## Usage
720
- *
721
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
722
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
723
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
724
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
725
- * this:
726
- *
727
- * ```js
728
- * Prism.languages.markup.style = {
729
- * // token
730
- * };
731
- * ```
732
- *
733
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
734
- * before existing tokens. For the CSS example above, you would use it like this:
735
- *
736
- * ```js
737
- * Prism.languages.insertBefore('markup', 'cdata', {
738
- * 'style': {
739
- * // token
740
- * }
741
- * });
742
- * ```
743
- *
744
- * ## Special cases
745
- *
746
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
747
- * will be ignored.
748
- *
749
- * This behavior can be used to insert tokens after `before`:
750
- *
751
- * ```js
752
- * Prism.languages.insertBefore('markup', 'comment', {
753
- * 'comment': Prism.languages.markup.comment,
754
- * // tokens after 'comment'
755
- * });
756
- * ```
757
- *
758
- * ## Limitations
759
- *
760
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
761
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
762
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
763
- * deleting properties which is necessary to insert at arbitrary positions.
764
- *
765
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
766
- * Instead, it will create a new object and replace all references to the target object with the new one. This
767
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
768
- *
769
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
770
- * you hold the target object in a variable, then the value of the variable will not change.
771
- *
772
- * ```js
773
- * var oldMarkup = Prism.languages.markup;
774
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
775
- *
776
- * assert(oldMarkup !== Prism.languages.markup);
777
- * assert(newMarkup === Prism.languages.markup);
778
- * ```
779
- *
780
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
781
- * object to be modified.
782
- * @param {string} before The key to insert before.
783
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
784
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
785
- * object to be modified.
786
- *
787
- * Defaults to `Prism.languages`.
788
- * @returns {Grammar} The new grammar object.
789
- * @public
790
- */
791
- insertBefore: function (inside, before, insert, root) {
792
- root = root || /** @type {any} */ (_.languages);
793
- var grammar = root[inside];
794
- /** @type {Grammar} */
795
- var ret = {};
796
-
797
- for (var token in grammar) {
798
- if (grammar.hasOwnProperty(token)) {
799
-
800
- if (token == before) {
801
- for (var newToken in insert) {
802
- if (insert.hasOwnProperty(newToken)) {
803
- ret[newToken] = insert[newToken];
804
- }
805
- }
806
- }
807
-
808
- // Do not insert token which also occur in insert. See #1525
809
- if (!insert.hasOwnProperty(token)) {
810
- ret[token] = grammar[token];
811
- }
812
- }
813
- }
814
-
815
- var old = root[inside];
816
- root[inside] = ret;
817
-
818
- // Update references in other language definitions
819
- _.languages.DFS(_.languages, function (key, value) {
820
- if (value === old && key != inside) {
821
- this[key] = ret;
822
- }
823
- });
824
-
825
- return ret;
826
- },
827
-
828
- // Traverse a language definition with Depth First Search
829
- DFS: function DFS(o, callback, type, visited) {
830
- visited = visited || {};
831
-
832
- var objId = _.util.objId;
833
-
834
- for (var i in o) {
835
- if (o.hasOwnProperty(i)) {
836
- callback.call(o, i, o[i], type || i);
837
-
838
- var property = o[i];
839
- var propertyType = _.util.type(property);
840
-
841
- if (propertyType === 'Object' && !visited[objId(property)]) {
842
- visited[objId(property)] = true;
843
- DFS(property, callback, null, visited);
844
- } else if (propertyType === 'Array' && !visited[objId(property)]) {
845
- visited[objId(property)] = true;
846
- DFS(property, callback, i, visited);
847
- }
848
- }
849
- }
850
- }
851
- },
852
-
853
- plugins: {},
854
-
855
- /**
856
- * This is the most high-level function in Prism’s API.
857
- * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
858
- * each one of them.
859
- *
860
- * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
861
- *
862
- * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
863
- * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
864
- * @memberof Prism
865
- * @public
866
- */
867
- highlightAll: function (async, callback) {
868
- _.highlightAllUnder(document, async, callback);
869
- },
870
-
871
- /**
872
- * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
873
- * {@link Prism.highlightElement} on each one of them.
874
- *
875
- * The following hooks will be run:
876
- * 1. `before-highlightall`
877
- * 2. `before-all-elements-highlight`
878
- * 3. All hooks of {@link Prism.highlightElement} for each element.
879
- *
880
- * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
881
- * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
882
- * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
883
- * @memberof Prism
884
- * @public
885
- */
886
- highlightAllUnder: function (container, async, callback) {
887
- var env = {
888
- callback: callback,
889
- container: container,
890
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
891
- };
892
-
893
- _.hooks.run('before-highlightall', env);
894
-
895
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
896
-
897
- _.hooks.run('before-all-elements-highlight', env);
898
-
899
- for (var i = 0, element; (element = env.elements[i++]);) {
900
- _.highlightElement(element, async === true, env.callback);
901
- }
902
- },
903
-
904
- /**
905
- * Highlights the code inside a single element.
906
- *
907
- * The following hooks will be run:
908
- * 1. `before-sanity-check`
909
- * 2. `before-highlight`
910
- * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
911
- * 4. `before-insert`
912
- * 5. `after-highlight`
913
- * 6. `complete`
914
- *
915
- * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
916
- * the element's language.
917
- *
918
- * @param {Element} element The element containing the code.
919
- * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
920
- * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
921
- * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
922
- * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
923
- *
924
- * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
925
- * asynchronous highlighting to work. You can build your own bundle on the
926
- * [Download page](https://prismjs.com/download.html).
927
- * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
928
- * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
929
- * @memberof Prism
930
- * @public
931
- */
932
- highlightElement: function (element, async, callback) {
933
- // Find language
934
- var language = _.util.getLanguage(element);
935
- var grammar = _.languages[language];
936
-
937
- // Set language on the element, if not present
938
- _.util.setLanguage(element, language);
939
-
940
- // Set language on the parent, for styling
941
- var parent = element.parentElement;
942
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
943
- _.util.setLanguage(parent, language);
944
- }
945
-
946
- var code = element.textContent;
947
-
948
- var env = {
949
- element: element,
950
- language: language,
951
- grammar: grammar,
952
- code: code
953
- };
954
-
955
- function insertHighlightedCode(highlightedCode) {
956
- env.highlightedCode = highlightedCode;
957
-
958
- _.hooks.run('before-insert', env);
959
-
960
- env.element.innerHTML = env.highlightedCode;
961
-
962
- _.hooks.run('after-highlight', env);
963
- _.hooks.run('complete', env);
964
- callback && callback.call(env.element);
965
- }
966
-
967
- _.hooks.run('before-sanity-check', env);
968
-
969
- // plugins may change/add the parent/element
970
- parent = env.element.parentElement;
971
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
972
- parent.setAttribute('tabindex', '0');
973
- }
974
-
975
- if (!env.code) {
976
- _.hooks.run('complete', env);
977
- callback && callback.call(env.element);
978
- return;
979
- }
980
-
981
- _.hooks.run('before-highlight', env);
982
-
983
- if (!env.grammar) {
984
- insertHighlightedCode(_.util.encode(env.code));
985
- return;
986
- }
987
-
988
- if (async && _self.Worker) {
989
- var worker = new Worker(_.filename);
990
-
991
- worker.onmessage = function (evt) {
992
- insertHighlightedCode(evt.data);
993
- };
994
-
995
- worker.postMessage(JSON.stringify({
996
- language: env.language,
997
- code: env.code,
998
- immediateClose: true
999
- }));
1000
- } else {
1001
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
1002
- }
1003
- },
1004
-
1005
- /**
1006
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
1007
- * and the language definitions to use, and returns a string with the HTML produced.
1008
- *
1009
- * The following hooks will be run:
1010
- * 1. `before-tokenize`
1011
- * 2. `after-tokenize`
1012
- * 3. `wrap`: On each {@link Token}.
1013
- *
1014
- * @param {string} text A string with the code to be highlighted.
1015
- * @param {Grammar} grammar An object containing the tokens to use.
1016
- *
1017
- * Usually a language definition like `Prism.languages.markup`.
1018
- * @param {string} language The name of the language definition passed to `grammar`.
1019
- * @returns {string} The highlighted HTML.
1020
- * @memberof Prism
1021
- * @public
1022
- * @example
1023
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
1024
- */
1025
- highlight: function (text, grammar, language) {
1026
- var env = {
1027
- code: text,
1028
- grammar: grammar,
1029
- language: language
1030
- };
1031
- _.hooks.run('before-tokenize', env);
1032
- if (!env.grammar) {
1033
- throw new Error('The language "' + env.language + '" has no grammar.');
1034
- }
1035
- env.tokens = _.tokenize(env.code, env.grammar);
1036
- _.hooks.run('after-tokenize', env);
1037
- return Token.stringify(_.util.encode(env.tokens), env.language);
1038
- },
1039
-
1040
- /**
1041
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
1042
- * and the language definitions to use, and returns an array with the tokenized code.
1043
- *
1044
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
1045
- *
1046
- * This method could be useful in other contexts as well, as a very crude parser.
1047
- *
1048
- * @param {string} text A string with the code to be highlighted.
1049
- * @param {Grammar} grammar An object containing the tokens to use.
1050
- *
1051
- * Usually a language definition like `Prism.languages.markup`.
1052
- * @returns {TokenStream} An array of strings and tokens, a token stream.
1053
- * @memberof Prism
1054
- * @public
1055
- * @example
1056
- * let code = `var foo = 0;`;
1057
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
1058
- * tokens.forEach(token => {
1059
- * if (token instanceof Prism.Token && token.type === 'number') {
1060
- * console.log(`Found numeric literal: ${token.content}`);
1061
- * }
1062
- * });
1063
- */
1064
- tokenize: function (text, grammar) {
1065
- var rest = grammar.rest;
1066
- if (rest) {
1067
- for (var token in rest) {
1068
- grammar[token] = rest[token];
1069
- }
1070
-
1071
- delete grammar.rest;
1072
- }
1073
-
1074
- var tokenList = new LinkedList();
1075
- addAfter(tokenList, tokenList.head, text);
1076
-
1077
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
1078
-
1079
- return toArray(tokenList);
1080
- },
1081
-
1082
- /**
1083
- * @namespace
1084
- * @memberof Prism
1085
- * @public
1086
- */
1087
- hooks: {
1088
- all: {},
1089
-
1090
- /**
1091
- * Adds the given callback to the list of callbacks for the given hook.
1092
- *
1093
- * The callback will be invoked when the hook it is registered for is run.
1094
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
1095
- *
1096
- * One callback function can be registered to multiple hooks and the same hook multiple times.
1097
- *
1098
- * @param {string} name The name of the hook.
1099
- * @param {HookCallback} callback The callback function which is given environment variables.
1100
- * @public
1101
- */
1102
- add: function (name, callback) {
1103
- var hooks = _.hooks.all;
1104
-
1105
- hooks[name] = hooks[name] || [];
1106
-
1107
- hooks[name].push(callback);
1108
- },
1109
-
1110
- /**
1111
- * Runs a hook invoking all registered callbacks with the given environment variables.
1112
- *
1113
- * Callbacks will be invoked synchronously and in the order in which they were registered.
1114
- *
1115
- * @param {string} name The name of the hook.
1116
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
1117
- * @public
1118
- */
1119
- run: function (name, env) {
1120
- var callbacks = _.hooks.all[name];
1121
-
1122
- if (!callbacks || !callbacks.length) {
1123
- return;
1124
- }
1125
-
1126
- for (var i = 0, callback; (callback = callbacks[i++]);) {
1127
- callback(env);
1128
- }
1129
- }
1130
- },
1131
-
1132
- Token: Token
1133
- };
1134
- _self.Prism = _;
1135
-
1136
-
1137
- // Typescript note:
1138
- // The following can be used to import the Token type in JSDoc:
1139
- //
1140
- // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
1141
-
1142
- /**
1143
- * Creates a new token.
1144
- *
1145
- * @param {string} type See {@link Token#type type}
1146
- * @param {string | TokenStream} content See {@link Token#content content}
1147
- * @param {string|string[]} [alias] The alias(es) of the token.
1148
- * @param {string} [matchedStr=""] A copy of the full string this token was created from.
1149
- * @class
1150
- * @global
1151
- * @public
1152
- */
1153
- function Token(type, content, alias, matchedStr) {
1154
- /**
1155
- * The type of the token.
1156
- *
1157
- * This is usually the key of a pattern in a {@link Grammar}.
1158
- *
1159
- * @type {string}
1160
- * @see GrammarToken
1161
- * @public
1162
- */
1163
- this.type = type;
1164
- /**
1165
- * The strings or tokens contained by this token.
1166
- *
1167
- * This will be a token stream if the pattern matched also defined an `inside` grammar.
1168
- *
1169
- * @type {string | TokenStream}
1170
- * @public
1171
- */
1172
- this.content = content;
1173
- /**
1174
- * The alias(es) of the token.
1175
- *
1176
- * @type {string|string[]}
1177
- * @see GrammarToken
1178
- * @public
1179
- */
1180
- this.alias = alias;
1181
- // Copy of the full string this token was created from
1182
- this.length = (matchedStr || '').length | 0;
1183
- }
1184
-
1185
- /**
1186
- * A token stream is an array of strings and {@link Token Token} objects.
1187
- *
1188
- * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
1189
- * them.
1190
- *
1191
- * 1. No adjacent strings.
1192
- * 2. No empty strings.
1193
- *
1194
- * The only exception here is the token stream that only contains the empty string and nothing else.
1195
- *
1196
- * @typedef {Array<string | Token>} TokenStream
1197
- * @global
1198
- * @public
1199
- */
1200
-
1201
- /**
1202
- * Converts the given token or token stream to an HTML representation.
1203
- *
1204
- * The following hooks will be run:
1205
- * 1. `wrap`: On each {@link Token}.
1206
- *
1207
- * @param {string | Token | TokenStream} o The token or token stream to be converted.
1208
- * @param {string} language The name of current language.
1209
- * @returns {string} The HTML representation of the token or token stream.
1210
- * @memberof Token
1211
- * @static
1212
- */
1213
- Token.stringify = function stringify(o, language) {
1214
- if (typeof o == 'string') {
1215
- return o;
1216
- }
1217
- if (Array.isArray(o)) {
1218
- var s = '';
1219
- o.forEach(function (e) {
1220
- s += stringify(e, language);
1221
- });
1222
- return s;
1223
- }
1224
-
1225
- var env = {
1226
- type: o.type,
1227
- content: stringify(o.content, language),
1228
- tag: 'span',
1229
- classes: ['token', o.type],
1230
- attributes: {},
1231
- language: language
1232
- };
1233
-
1234
- var aliases = o.alias;
1235
- if (aliases) {
1236
- if (Array.isArray(aliases)) {
1237
- Array.prototype.push.apply(env.classes, aliases);
1238
- } else {
1239
- env.classes.push(aliases);
1240
- }
1241
- }
1242
-
1243
- _.hooks.run('wrap', env);
1244
-
1245
- var attributes = '';
1246
- for (var name in env.attributes) {
1247
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
1248
- }
1249
-
1250
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
1251
- };
1252
-
1253
- /**
1254
- * @param {RegExp} pattern
1255
- * @param {number} pos
1256
- * @param {string} text
1257
- * @param {boolean} lookbehind
1258
- * @returns {RegExpExecArray | null}
1259
- */
1260
- function matchPattern(pattern, pos, text, lookbehind) {
1261
- pattern.lastIndex = pos;
1262
- var match = pattern.exec(text);
1263
- if (match && lookbehind && match[1]) {
1264
- // change the match to remove the text matched by the Prism lookbehind group
1265
- var lookbehindLength = match[1].length;
1266
- match.index += lookbehindLength;
1267
- match[0] = match[0].slice(lookbehindLength);
1268
- }
1269
- return match;
1270
- }
1271
-
1272
- /**
1273
- * @param {string} text
1274
- * @param {LinkedList<string | Token>} tokenList
1275
- * @param {any} grammar
1276
- * @param {LinkedListNode<string | Token>} startNode
1277
- * @param {number} startPos
1278
- * @param {RematchOptions} [rematch]
1279
- * @returns {void}
1280
- * @private
1281
- *
1282
- * @typedef RematchOptions
1283
- * @property {string} cause
1284
- * @property {number} reach
1285
- */
1286
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
1287
- for (var token in grammar) {
1288
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
1289
- continue;
1290
- }
1291
-
1292
- var patterns = grammar[token];
1293
- patterns = Array.isArray(patterns) ? patterns : [patterns];
1294
-
1295
- for (var j = 0; j < patterns.length; ++j) {
1296
- if (rematch && rematch.cause == token + ',' + j) {
1297
- return;
1298
- }
1299
-
1300
- var patternObj = patterns[j];
1301
- var inside = patternObj.inside;
1302
- var lookbehind = !!patternObj.lookbehind;
1303
- var greedy = !!patternObj.greedy;
1304
- var alias = patternObj.alias;
1305
-
1306
- if (greedy && !patternObj.pattern.global) {
1307
- // Without the global flag, lastIndex won't work
1308
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
1309
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
1310
- }
1311
-
1312
- /** @type {RegExp} */
1313
- var pattern = patternObj.pattern || patternObj;
1314
-
1315
- for ( // iterate the token list and keep track of the current token/string position
1316
- var currentNode = startNode.next, pos = startPos;
1317
- currentNode !== tokenList.tail;
1318
- pos += currentNode.value.length, currentNode = currentNode.next
1319
- ) {
1320
-
1321
- if (rematch && pos >= rematch.reach) {
1322
- break;
1323
- }
1324
-
1325
- var str = currentNode.value;
1326
-
1327
- if (tokenList.length > text.length) {
1328
- // Something went terribly wrong, ABORT, ABORT!
1329
- return;
1330
- }
1331
-
1332
- if (str instanceof Token) {
1333
- continue;
1334
- }
1335
-
1336
- var removeCount = 1; // this is the to parameter of removeBetween
1337
- var match;
1338
-
1339
- if (greedy) {
1340
- match = matchPattern(pattern, pos, text, lookbehind);
1341
- if (!match || match.index >= text.length) {
1342
- break;
1343
- }
1344
-
1345
- var from = match.index;
1346
- var to = match.index + match[0].length;
1347
- var p = pos;
1348
-
1349
- // find the node that contains the match
1350
- p += currentNode.value.length;
1351
- while (from >= p) {
1352
- currentNode = currentNode.next;
1353
- p += currentNode.value.length;
1354
- }
1355
- // adjust pos (and p)
1356
- p -= currentNode.value.length;
1357
- pos = p;
1358
-
1359
- // the current node is a Token, then the match starts inside another Token, which is invalid
1360
- if (currentNode.value instanceof Token) {
1361
- continue;
1362
- }
1363
-
1364
- // find the last node which is affected by this match
1365
- for (
1366
- var k = currentNode;
1367
- k !== tokenList.tail && (p < to || typeof k.value === 'string');
1368
- k = k.next
1369
- ) {
1370
- removeCount++;
1371
- p += k.value.length;
1372
- }
1373
- removeCount--;
1374
-
1375
- // replace with the new match
1376
- str = text.slice(pos, p);
1377
- match.index -= pos;
1378
- } else {
1379
- match = matchPattern(pattern, 0, str, lookbehind);
1380
- if (!match) {
1381
- continue;
1382
- }
1383
- }
1384
-
1385
- // eslint-disable-next-line no-redeclare
1386
- var from = match.index;
1387
- var matchStr = match[0];
1388
- var before = str.slice(0, from);
1389
- var after = str.slice(from + matchStr.length);
1390
-
1391
- var reach = pos + str.length;
1392
- if (rematch && reach > rematch.reach) {
1393
- rematch.reach = reach;
1394
- }
1395
-
1396
- var removeFrom = currentNode.prev;
1397
-
1398
- if (before) {
1399
- removeFrom = addAfter(tokenList, removeFrom, before);
1400
- pos += before.length;
1401
- }
1402
-
1403
- removeRange(tokenList, removeFrom, removeCount);
1404
-
1405
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
1406
- currentNode = addAfter(tokenList, removeFrom, wrapped);
1407
-
1408
- if (after) {
1409
- addAfter(tokenList, currentNode, after);
1410
- }
1411
-
1412
- if (removeCount > 1) {
1413
- // at least one Token object was removed, so we have to do some rematching
1414
- // this can only happen if the current pattern is greedy
1415
-
1416
- /** @type {RematchOptions} */
1417
- var nestedRematch = {
1418
- cause: token + ',' + j,
1419
- reach: reach
1420
- };
1421
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
1422
-
1423
- // the reach might have been extended because of the rematching
1424
- if (rematch && nestedRematch.reach > rematch.reach) {
1425
- rematch.reach = nestedRematch.reach;
1426
- }
1427
- }
1428
- }
1429
- }
1430
- }
1431
- }
1432
-
1433
- /**
1434
- * @typedef LinkedListNode
1435
- * @property {T} value
1436
- * @property {LinkedListNode<T> | null} prev The previous node.
1437
- * @property {LinkedListNode<T> | null} next The next node.
1438
- * @template T
1439
- * @private
1440
- */
1441
-
1442
- /**
1443
- * @template T
1444
- * @private
1445
- */
1446
- function LinkedList() {
1447
- /** @type {LinkedListNode<T>} */
1448
- var head = { value: null, prev: null, next: null };
1449
- /** @type {LinkedListNode<T>} */
1450
- var tail = { value: null, prev: head, next: null };
1451
- head.next = tail;
1452
-
1453
- /** @type {LinkedListNode<T>} */
1454
- this.head = head;
1455
- /** @type {LinkedListNode<T>} */
1456
- this.tail = tail;
1457
- this.length = 0;
1458
- }
1459
-
1460
- /**
1461
- * Adds a new node with the given value to the list.
1462
- *
1463
- * @param {LinkedList<T>} list
1464
- * @param {LinkedListNode<T>} node
1465
- * @param {T} value
1466
- * @returns {LinkedListNode<T>} The added node.
1467
- * @template T
1468
- */
1469
- function addAfter(list, node, value) {
1470
- // assumes that node != list.tail && values.length >= 0
1471
- var next = node.next;
1472
-
1473
- var newNode = { value: value, prev: node, next: next };
1474
- node.next = newNode;
1475
- next.prev = newNode;
1476
- list.length++;
1477
-
1478
- return newNode;
1479
- }
1480
- /**
1481
- * Removes `count` nodes after the given node. The given node will not be removed.
1482
- *
1483
- * @param {LinkedList<T>} list
1484
- * @param {LinkedListNode<T>} node
1485
- * @param {number} count
1486
- * @template T
1487
- */
1488
- function removeRange(list, node, count) {
1489
- var next = node.next;
1490
- for (var i = 0; i < count && next !== list.tail; i++) {
1491
- next = next.next;
1492
- }
1493
- node.next = next;
1494
- next.prev = node;
1495
- list.length -= i;
1496
- }
1497
- /**
1498
- * @param {LinkedList<T>} list
1499
- * @returns {T[]}
1500
- * @template T
1501
- */
1502
- function toArray(list) {
1503
- var array = [];
1504
- var node = list.head.next;
1505
- while (node !== list.tail) {
1506
- array.push(node.value);
1507
- node = node.next;
1508
- }
1509
- return array;
1510
- }
1511
-
1512
-
1513
- if (!_self.document) {
1514
- if (!_self.addEventListener) {
1515
- // in Node.js
1516
- return _;
1517
- }
1518
-
1519
- if (!_.disableWorkerMessageHandler) {
1520
- // In worker
1521
- _self.addEventListener('message', function (evt) {
1522
- var message = JSON.parse(evt.data);
1523
- var lang = message.language;
1524
- var code = message.code;
1525
- var immediateClose = message.immediateClose;
1526
-
1527
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
1528
- if (immediateClose) {
1529
- _self.close();
1530
- }
1531
- }, false);
1532
- }
1533
-
1534
- return _;
1535
- }
1536
-
1537
- // Get current script and highlight
1538
- var script = _.util.currentScript();
1539
-
1540
- if (script) {
1541
- _.filename = script.src;
1542
-
1543
- if (script.hasAttribute('data-manual')) {
1544
- _.manual = true;
1545
- }
1546
- }
1547
-
1548
- function highlightAutomaticallyCallback() {
1549
- if (!_.manual) {
1550
- _.highlightAll();
1551
- }
1552
- }
1553
-
1554
- if (!_.manual) {
1555
- // If the document state is "loading", then we'll use DOMContentLoaded.
1556
- // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1557
- // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1558
- // might take longer one animation frame to execute which can create a race condition where only some plugins have
1559
- // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1560
- // See https://github.com/PrismJS/prism/issues/2102
1561
- var readyState = document.readyState;
1562
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
1563
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
1564
- } else {
1565
- if (window.requestAnimationFrame) {
1566
- window.requestAnimationFrame(highlightAutomaticallyCallback);
1567
- } else {
1568
- window.setTimeout(highlightAutomaticallyCallback, 16);
1569
- }
1570
- }
1571
- }
1572
-
1573
- return _;
1574
-
1575
- }(_self));
1576
-
1577
- if (module.exports) {
1578
- module.exports = Prism;
1579
- }
1580
-
1581
- // hack for components to work correctly in node.js
1582
- if (typeof commonjsGlobal !== 'undefined') {
1583
- commonjsGlobal.Prism = Prism;
1584
- }
1585
-
1586
- // some additional documentation/types
1587
-
1588
- /**
1589
- * The expansion of a simple `RegExp` literal to support additional properties.
1590
- *
1591
- * @typedef GrammarToken
1592
- * @property {RegExp} pattern The regular expression of the token.
1593
- * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
1594
- * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
1595
- * @property {boolean} [greedy=false] Whether the token is greedy.
1596
- * @property {string|string[]} [alias] An optional alias or list of aliases.
1597
- * @property {Grammar} [inside] The nested grammar of this token.
1598
- *
1599
- * The `inside` grammar will be used to tokenize the text value of each token of this kind.
1600
- *
1601
- * This can be used to make nested and even recursive language definitions.
1602
- *
1603
- * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
1604
- * each another.
1605
- * @global
1606
- * @public
1607
- */
1608
-
1609
- /**
1610
- * @typedef Grammar
1611
- * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
1612
- * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
1613
- * @global
1614
- * @public
1615
- */
1616
-
1617
- /**
1618
- * A function which will invoked after an element was successfully highlighted.
1619
- *
1620
- * @callback HighlightCallback
1621
- * @param {Element} element The element successfully highlighted.
1622
- * @returns {void}
1623
- * @global
1624
- * @public
1625
- */
1626
-
1627
- /**
1628
- * @callback HookCallback
1629
- * @param {Object<string, any>} env The environment variables of the hook.
1630
- * @returns {void}
1631
- * @global
1632
- * @public
1633
- */
1634
-
1635
-
1636
- /* **********************************************
1637
- Begin prism-markup.js
1638
- ********************************************** */
1639
-
1640
- Prism.languages.markup = {
1641
- 'comment': {
1642
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1643
- greedy: true
1644
- },
1645
- 'prolog': {
1646
- pattern: /<\?[\s\S]+?\?>/,
1647
- greedy: true
1648
- },
1649
- 'doctype': {
1650
- // https://www.w3.org/TR/xml/#NT-doctypedecl
1651
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1652
- greedy: true,
1653
- inside: {
1654
- 'internal-subset': {
1655
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1656
- lookbehind: true,
1657
- greedy: true,
1658
- inside: null // see below
1659
- },
1660
- 'string': {
1661
- pattern: /"[^"]*"|'[^']*'/,
1662
- greedy: true
1663
- },
1664
- 'punctuation': /^<!|>$|[[\]]/,
1665
- 'doctype-tag': /^DOCTYPE/i,
1666
- 'name': /[^\s<>'"]+/
1667
- }
1668
- },
1669
- 'cdata': {
1670
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1671
- greedy: true
1672
- },
1673
- 'tag': {
1674
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1675
- greedy: true,
1676
- inside: {
1677
- 'tag': {
1678
- pattern: /^<\/?[^\s>\/]+/,
1679
- inside: {
1680
- 'punctuation': /^<\/?/,
1681
- 'namespace': /^[^\s>\/:]+:/
1682
- }
1683
- },
1684
- 'special-attr': [],
1685
- 'attr-value': {
1686
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1687
- inside: {
1688
- 'punctuation': [
1689
- {
1690
- pattern: /^=/,
1691
- alias: 'attr-equals'
1692
- },
1693
- {
1694
- pattern: /^(\s*)["']|["']$/,
1695
- lookbehind: true
1696
- }
1697
- ]
1698
- }
1699
- },
1700
- 'punctuation': /\/?>/,
1701
- 'attr-name': {
1702
- pattern: /[^\s>\/]+/,
1703
- inside: {
1704
- 'namespace': /^[^\s>\/:]+:/
1705
- }
1706
- }
1707
-
1708
- }
1709
- },
1710
- 'entity': [
1711
- {
1712
- pattern: /&[\da-z]{1,8};/i,
1713
- alias: 'named-entity'
1714
- },
1715
- /&#x?[\da-f]{1,8};/i
1716
- ]
1717
- };
1718
-
1719
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
1720
- Prism.languages.markup['entity'];
1721
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1722
-
1723
- // Plugin to make entity title show the real entity, idea by Roman Komarov
1724
- Prism.hooks.add('wrap', function (env) {
1725
-
1726
- if (env.type === 'entity') {
1727
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1728
- }
1729
- });
1730
-
1731
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1732
- /**
1733
- * Adds an inlined language to markup.
1734
- *
1735
- * An example of an inlined language is CSS with `<style>` tags.
1736
- *
1737
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1738
- * case insensitive.
1739
- * @param {string} lang The language key.
1740
- * @example
1741
- * addInlined('style', 'css');
1742
- */
1743
- value: function addInlined(tagName, lang) {
1744
- var includedCdataInside = {};
1745
- includedCdataInside['language-' + lang] = {
1746
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1747
- lookbehind: true,
1748
- inside: Prism.languages[lang]
1749
- };
1750
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1751
-
1752
- var inside = {
1753
- 'included-cdata': {
1754
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1755
- inside: includedCdataInside
1756
- }
1757
- };
1758
- inside['language-' + lang] = {
1759
- pattern: /[\s\S]+/,
1760
- inside: Prism.languages[lang]
1761
- };
1762
-
1763
- var def = {};
1764
- def[tagName] = {
1765
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
1766
- lookbehind: true,
1767
- greedy: true,
1768
- inside: inside
1769
- };
1770
-
1771
- Prism.languages.insertBefore('markup', 'cdata', def);
1772
- }
1773
- });
1774
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1775
- /**
1776
- * Adds an pattern to highlight languages embedded in HTML attributes.
1777
- *
1778
- * An example of an inlined language is CSS with `style` attributes.
1779
- *
1780
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1781
- * case insensitive.
1782
- * @param {string} lang The language key.
1783
- * @example
1784
- * addAttribute('style', 'css');
1785
- */
1786
- value: function (attrName, lang) {
1787
- Prism.languages.markup.tag.inside['special-attr'].push({
1788
- pattern: RegExp(
1789
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1790
- 'i'
1791
- ),
1792
- lookbehind: true,
1793
- inside: {
1794
- 'attr-name': /^[^\s=]+/,
1795
- 'attr-value': {
1796
- pattern: /=[\s\S]+/,
1797
- inside: {
1798
- 'value': {
1799
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1800
- lookbehind: true,
1801
- alias: [lang, 'language-' + lang],
1802
- inside: Prism.languages[lang]
1803
- },
1804
- 'punctuation': [
1805
- {
1806
- pattern: /^=/,
1807
- alias: 'attr-equals'
1808
- },
1809
- /"|'/
1810
- ]
1811
- }
1812
- }
1813
- }
1814
- });
1815
- }
1816
- });
1817
-
1818
- Prism.languages.html = Prism.languages.markup;
1819
- Prism.languages.mathml = Prism.languages.markup;
1820
- Prism.languages.svg = Prism.languages.markup;
1821
-
1822
- Prism.languages.xml = Prism.languages.extend('markup', {});
1823
- Prism.languages.ssml = Prism.languages.xml;
1824
- Prism.languages.atom = Prism.languages.xml;
1825
- Prism.languages.rss = Prism.languages.xml;
1826
-
1827
-
1828
- /* **********************************************
1829
- Begin prism-css.js
1830
- ********************************************** */
1831
-
1832
- (function (Prism) {
1833
-
1834
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1835
-
1836
- Prism.languages.css = {
1837
- 'comment': /\/\*[\s\S]*?\*\//,
1838
- 'atrule': {
1839
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
1840
- inside: {
1841
- 'rule': /^@[\w-]+/,
1842
- 'selector-function-argument': {
1843
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1844
- lookbehind: true,
1845
- alias: 'selector'
1846
- },
1847
- 'keyword': {
1848
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1849
- lookbehind: true
1850
- }
1851
- // See rest below
1852
- }
1853
- },
1854
- 'url': {
1855
- // https://drafts.csswg.org/css-values-3/#urls
1856
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1857
- greedy: true,
1858
- inside: {
1859
- 'function': /^url/i,
1860
- 'punctuation': /^\(|\)$/,
1861
- 'string': {
1862
- pattern: RegExp('^' + string.source + '$'),
1863
- alias: 'url'
1864
- }
1865
- }
1866
- },
1867
- 'selector': {
1868
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1869
- lookbehind: true
1870
- },
1871
- 'string': {
1872
- pattern: string,
1873
- greedy: true
1874
- },
1875
- 'property': {
1876
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1877
- lookbehind: true
1878
- },
1879
- 'important': /!important\b/i,
1880
- 'function': {
1881
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1882
- lookbehind: true
1883
- },
1884
- 'punctuation': /[(){};:,]/
1885
- };
1886
-
1887
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1888
-
1889
- var markup = Prism.languages.markup;
1890
- if (markup) {
1891
- markup.tag.addInlined('style', 'css');
1892
- markup.tag.addAttribute('style', 'css');
1893
- }
1894
-
1895
- }(Prism));
1896
-
1897
-
1898
- /* **********************************************
1899
- Begin prism-clike.js
1900
- ********************************************** */
1901
-
1902
- Prism.languages.clike = {
1903
- 'comment': [
1904
- {
1905
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1906
- lookbehind: true,
1907
- greedy: true
1908
- },
1909
- {
1910
- pattern: /(^|[^\\:])\/\/.*/,
1911
- lookbehind: true,
1912
- greedy: true
1913
- }
1914
- ],
1915
- 'string': {
1916
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1917
- greedy: true
1918
- },
1919
- 'class-name': {
1920
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1921
- lookbehind: true,
1922
- inside: {
1923
- 'punctuation': /[.\\]/
1924
- }
1925
- },
1926
- 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1927
- 'boolean': /\b(?:false|true)\b/,
1928
- 'function': /\b\w+(?=\()/,
1929
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1930
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1931
- 'punctuation': /[{}[\];(),.:]/
1932
- };
1933
-
1934
-
1935
- /* **********************************************
1936
- Begin prism-javascript.js
1937
- ********************************************** */
1938
-
1939
- Prism.languages.javascript = Prism.languages.extend('clike', {
1940
- 'class-name': [
1941
- Prism.languages.clike['class-name'],
1942
- {
1943
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1944
- lookbehind: true
1945
- }
1946
- ],
1947
- 'keyword': [
1948
- {
1949
- pattern: /((?:^|\})\s*)catch\b/,
1950
- lookbehind: true
1951
- },
1952
- {
1953
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1954
- lookbehind: true
1955
- },
1956
- ],
1957
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1958
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1959
- 'number': {
1960
- pattern: RegExp(
1961
- /(^|[^\w$])/.source +
1962
- '(?:' +
1963
- (
1964
- // constant
1965
- /NaN|Infinity/.source +
1966
- '|' +
1967
- // binary integer
1968
- /0[bB][01]+(?:_[01]+)*n?/.source +
1969
- '|' +
1970
- // octal integer
1971
- /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
1972
- '|' +
1973
- // hexadecimal integer
1974
- /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
1975
- '|' +
1976
- // decimal bigint
1977
- /\d+(?:_\d+)*n/.source +
1978
- '|' +
1979
- // decimal number (integer or float) but no bigint
1980
- /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
1981
- ) +
1982
- ')' +
1983
- /(?![\w$])/.source
1984
- ),
1985
- lookbehind: true
1986
- },
1987
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1988
- });
1989
-
1990
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1991
-
1992
- Prism.languages.insertBefore('javascript', 'keyword', {
1993
- 'regex': {
1994
- pattern: RegExp(
1995
- // lookbehind
1996
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
1997
- /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
1998
- // Regex pattern:
1999
- // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
2000
- // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
2001
- // with the only syntax, so we have to define 2 different regex patterns.
2002
- /\//.source +
2003
- '(?:' +
2004
- /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
2005
- '|' +
2006
- // `v` flag syntax. This supports 3 levels of nested character classes.
2007
- /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
2008
- ')' +
2009
- // lookahead
2010
- /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
2011
- ),
2012
- lookbehind: true,
2013
- greedy: true,
2014
- inside: {
2015
- 'regex-source': {
2016
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
2017
- lookbehind: true,
2018
- alias: 'language-regex',
2019
- inside: Prism.languages.regex
2020
- },
2021
- 'regex-delimiter': /^\/|\/$/,
2022
- 'regex-flags': /^[a-z]+$/,
2023
- }
2024
- },
2025
- // This must be declared before keyword because we use "function" inside the look-forward
2026
- 'function-variable': {
2027
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
2028
- alias: 'function'
2029
- },
2030
- 'parameter': [
2031
- {
2032
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
2033
- lookbehind: true,
2034
- inside: Prism.languages.javascript
2035
- },
2036
- {
2037
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
2038
- lookbehind: true,
2039
- inside: Prism.languages.javascript
2040
- },
2041
- {
2042
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
2043
- lookbehind: true,
2044
- inside: Prism.languages.javascript
2045
- },
2046
- {
2047
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
2048
- lookbehind: true,
2049
- inside: Prism.languages.javascript
2050
- }
2051
- ],
2052
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
2053
- });
2054
-
2055
- Prism.languages.insertBefore('javascript', 'string', {
2056
- 'hashbang': {
2057
- pattern: /^#!.*/,
2058
- greedy: true,
2059
- alias: 'comment'
2060
- },
2061
- 'template-string': {
2062
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
2063
- greedy: true,
2064
- inside: {
2065
- 'template-punctuation': {
2066
- pattern: /^`|`$/,
2067
- alias: 'string'
2068
- },
2069
- 'interpolation': {
2070
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
2071
- lookbehind: true,
2072
- inside: {
2073
- 'interpolation-punctuation': {
2074
- pattern: /^\$\{|\}$/,
2075
- alias: 'punctuation'
2076
- },
2077
- rest: Prism.languages.javascript
2078
- }
2079
- },
2080
- 'string': /[\s\S]+/
2081
- }
2082
- },
2083
- 'string-property': {
2084
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
2085
- lookbehind: true,
2086
- greedy: true,
2087
- alias: 'property'
2088
- }
2089
- });
2090
-
2091
- Prism.languages.insertBefore('javascript', 'operator', {
2092
- 'literal-property': {
2093
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
2094
- lookbehind: true,
2095
- alias: 'property'
2096
- },
2097
- });
2098
-
2099
- if (Prism.languages.markup) {
2100
- Prism.languages.markup.tag.addInlined('script', 'javascript');
2101
-
2102
- // add attribute support for all DOM events.
2103
- // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
2104
- Prism.languages.markup.tag.addAttribute(
2105
- /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
2106
- 'javascript'
2107
- );
2108
- }
2109
-
2110
- Prism.languages.js = Prism.languages.javascript;
2111
-
2112
-
2113
- /* **********************************************
2114
- Begin prism-file-highlight.js
2115
- ********************************************** */
2116
-
2117
- (function () {
2118
-
2119
- if (typeof Prism === 'undefined' || typeof document === 'undefined') {
2120
- return;
2121
- }
2122
-
2123
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
2124
- if (!Element.prototype.matches) {
2125
- Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
2126
- }
2127
-
2128
- var LOADING_MESSAGE = 'Loading…';
2129
- var FAILURE_MESSAGE = function (status, message) {
2130
- return '✖ Error ' + status + ' while fetching file: ' + message;
2131
- };
2132
- var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
2133
-
2134
- var EXTENSIONS = {
2135
- 'js': 'javascript',
2136
- 'py': 'python',
2137
- 'rb': 'ruby',
2138
- 'ps1': 'powershell',
2139
- 'psm1': 'powershell',
2140
- 'sh': 'bash',
2141
- 'bat': 'batch',
2142
- 'h': 'c',
2143
- 'tex': 'latex'
2144
- };
2145
-
2146
- var STATUS_ATTR = 'data-src-status';
2147
- var STATUS_LOADING = 'loading';
2148
- var STATUS_LOADED = 'loaded';
2149
- var STATUS_FAILED = 'failed';
2150
-
2151
- var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
2152
- + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
2153
-
2154
- /**
2155
- * Loads the given file.
2156
- *
2157
- * @param {string} src The URL or path of the source file to load.
2158
- * @param {(result: string) => void} success
2159
- * @param {(reason: string) => void} error
2160
- */
2161
- function loadFile(src, success, error) {
2162
- var xhr = new XMLHttpRequest();
2163
- xhr.open('GET', src, true);
2164
- xhr.onreadystatechange = function () {
2165
- if (xhr.readyState == 4) {
2166
- if (xhr.status < 400 && xhr.responseText) {
2167
- success(xhr.responseText);
2168
- } else {
2169
- if (xhr.status >= 400) {
2170
- error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
2171
- } else {
2172
- error(FAILURE_EMPTY_MESSAGE);
2173
- }
2174
- }
2175
- }
2176
- };
2177
- xhr.send(null);
2178
- }
2179
-
2180
- /**
2181
- * Parses the given range.
2182
- *
2183
- * This returns a range with inclusive ends.
2184
- *
2185
- * @param {string | null | undefined} range
2186
- * @returns {[number, number | undefined] | undefined}
2187
- */
2188
- function parseRange(range) {
2189
- var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
2190
- if (m) {
2191
- var start = Number(m[1]);
2192
- var comma = m[2];
2193
- var end = m[3];
2194
-
2195
- if (!comma) {
2196
- return [start, start];
2197
- }
2198
- if (!end) {
2199
- return [start, undefined];
2200
- }
2201
- return [start, Number(end)];
2202
- }
2203
- return undefined;
2204
- }
2205
-
2206
- Prism.hooks.add('before-highlightall', function (env) {
2207
- env.selector += ', ' + SELECTOR;
2208
- });
2209
-
2210
- Prism.hooks.add('before-sanity-check', function (env) {
2211
- var pre = /** @type {HTMLPreElement} */ (env.element);
2212
- if (pre.matches(SELECTOR)) {
2213
- env.code = ''; // fast-path the whole thing and go to complete
2214
-
2215
- pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
2216
-
2217
- // add code element with loading message
2218
- var code = pre.appendChild(document.createElement('CODE'));
2219
- code.textContent = LOADING_MESSAGE;
2220
-
2221
- var src = pre.getAttribute('data-src');
2222
-
2223
- var language = env.language;
2224
- if (language === 'none') {
2225
- // the language might be 'none' because there is no language set;
2226
- // in this case, we want to use the extension as the language
2227
- var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
2228
- language = EXTENSIONS[extension] || extension;
2229
- }
2230
-
2231
- // set language classes
2232
- Prism.util.setLanguage(code, language);
2233
- Prism.util.setLanguage(pre, language);
2234
-
2235
- // preload the language
2236
- var autoloader = Prism.plugins.autoloader;
2237
- if (autoloader) {
2238
- autoloader.loadLanguages(language);
2239
- }
2240
-
2241
- // load file
2242
- loadFile(
2243
- src,
2244
- function (text) {
2245
- // mark as loaded
2246
- pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
2247
-
2248
- // handle data-range
2249
- var range = parseRange(pre.getAttribute('data-range'));
2250
- if (range) {
2251
- var lines = text.split(/\r\n?|\n/g);
2252
-
2253
- // the range is one-based and inclusive on both ends
2254
- var start = range[0];
2255
- var end = range[1] == null ? lines.length : range[1];
2256
-
2257
- if (start < 0) { start += lines.length; }
2258
- start = Math.max(0, Math.min(start - 1, lines.length));
2259
- if (end < 0) { end += lines.length; }
2260
- end = Math.max(0, Math.min(end, lines.length));
2261
-
2262
- text = lines.slice(start, end).join('\n');
2263
-
2264
- // add data-start for line numbers
2265
- if (!pre.hasAttribute('data-start')) {
2266
- pre.setAttribute('data-start', String(start + 1));
2267
- }
2268
- }
2269
-
2270
- // highlight code
2271
- code.textContent = text;
2272
- Prism.highlightElement(code);
2273
- },
2274
- function (error) {
2275
- // mark as failed
2276
- pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
2277
-
2278
- code.textContent = error;
2279
- }
2280
- );
2281
- }
2282
- });
2283
-
2284
- Prism.plugins.fileHighlight = {
2285
- /**
2286
- * Executes the File Highlight plugin for all matching `pre` elements under the given container.
2287
- *
2288
- * Note: Elements which are already loaded or currently loading will not be touched by this method.
2289
- *
2290
- * @param {ParentNode} [container=document]
2291
- */
2292
- highlight: function highlight(container) {
2293
- var elements = (container || document).querySelectorAll(SELECTOR);
2294
-
2295
- for (var i = 0, element; (element = elements[i++]);) {
2296
- Prism.highlightElement(element);
2297
- }
2298
- }
2299
- };
2300
-
2301
- var logged = false;
2302
- /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
2303
- Prism.fileHighlight = function () {
2304
- if (!logged) {
2305
- console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
2306
- logged = true;
2307
- }
2308
- Prism.plugins.fileHighlight.highlight.apply(this, arguments);
2309
- };
2310
-
2311
- }());
2312
- } (prism));
2313
-
2314
- var Prism = prism.exports;
2315
-
2316
- var css = "code[class*=language-],pre[class*=language-]{word-wrap:normal;background:none;color:#ccc;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;-webkit-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;white-space:pre;word-break:normal;word-spacing:normal}pre[class*=language-]{margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{border-radius:.3em;padding:.1em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}";
2317
- n(css,{});
2318
-
2319
- var SyntaxHighlighter = function SyntaxHighlighter(_ref) {
2320
- var className = _ref.className,
2321
- code = _ref.code,
2322
- language = _ref.language;
2323
- useEffect(function () {
2324
- Prism.highlightAll();
2325
- }, [code]);
2326
- return /*#__PURE__*/React__default.createElement("pre", {
2327
- className: className
2328
- }, /*#__PURE__*/React__default.createElement("code", {
2329
- className: "language-".concat(language)
2330
- }, code));
2331
- };
2332
- var SyntaxHighlighter$1 = /*#__PURE__*/React__default.memo(SyntaxHighlighter);
2333
-
2334
- var CodeBlock = function CodeBlock(_ref) {
2335
- var _ref$title = _ref.title,
2336
- title = _ref$title === void 0 ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Trans, {
2337
- i18nKey: "neetoMolecules.codeblock.codeSnippet"
2338
- })) : _ref$title,
2339
- codeString = _ref.codeString,
2340
- _ref$showCopyButton = _ref.showCopyButton,
2341
- showCopyButton = _ref$showCopyButton === void 0 ? true : _ref$showCopyButton,
2342
- _ref$className = _ref.className,
2343
- className = _ref$className === void 0 ? "" : _ref$className,
2344
- _ref$sendViaEmail = _ref.sendViaEmail,
2345
- sendViaEmail = _ref$sendViaEmail === void 0 ? undefined : _ref$sendViaEmail,
2346
- _ref$frameworkProps = _ref.frameworkProps,
2347
- frameworkProps = _ref$frameworkProps === void 0 ? {} : _ref$frameworkProps;
2348
- var _useTranslation = useTranslation(),
2349
- t = _useTranslation.t;
2350
- var _ref2 = frameworkProps !== null && frameworkProps !== void 0 ? frameworkProps : {},
2351
- selectedFramework = _ref2.selectedFramework,
2352
- setSelectedFramework = _ref2.setSelectedFramework;
2353
- return /*#__PURE__*/React__default.createElement("div", {
2354
- className: classnames(["relative", className])
2355
- }, /*#__PURE__*/React__default.createElement("div", {
2356
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg flex w-full flex-wrap items-center justify-between gap-2 rounded-b-none p-3"
2357
- }, title && /*#__PURE__*/React__default.createElement(Typography, {
2358
- className: "m-0 flex-shrink-0",
2359
- "data-cy": "code-block-title-text",
2360
- style: "h4"
2361
- }, title), selectedFramework && /*#__PURE__*/React__default.createElement(Select, {
2362
- className: "w-40",
2363
- "data-testid": "framework-select",
2364
- options: FRAMEWORK_SELECT_OPTIONS,
2365
- value: selectedFramework,
2366
- onChange: setSelectedFramework
2367
- }), /*#__PURE__*/React__default.createElement("div", {
2368
- className: "ml-auto flex flex-shrink-0 items-center justify-end gap-2"
2369
- }, sendViaEmail ? /*#__PURE__*/React__default.createElement(Button, {
2370
- style: "text",
2371
- label: t("neetoMolecules.widget.installation.snippet.sendViaEmail"),
2372
- onClick: sendViaEmail
2373
- }) : null, showCopyButton && /*#__PURE__*/React__default.createElement(CopyToClipboardButton, {
2374
- label: t("neetoMolecules.widget.installation.snippet.copy"),
2375
- style: "primary",
2376
- value: codeString
2377
- }))), /*#__PURE__*/React__default.createElement(SyntaxHighlighter$1, {
2378
- className: "neeto-ui-bg-gray-800 neeto-ui-rounded-lg m-0 rounded-t-none",
2379
- code: codeString,
2380
- language: "javascript"
2381
- }));
2382
- };
2383
-
2384
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2385
- try {
2386
- var info = gen[key](arg);
2387
- var value = info.value;
2388
- } catch (error) {
2389
- reject(error);
2390
- return;
2391
- }
2392
- if (info.done) {
2393
- resolve(value);
2394
- } else {
2395
- Promise.resolve(value).then(_next, _throw);
2396
- }
2397
- }
2398
- function _asyncToGenerator(fn) {
2399
- return function () {
2400
- var self = this,
2401
- args = arguments;
2402
- return new Promise(function (resolve, reject) {
2403
- var gen = fn.apply(self, args);
2404
- function _next(value) {
2405
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
2406
- }
2407
- function _throw(err) {
2408
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
2409
- }
2410
- _next(undefined);
2411
- });
2412
- };
2413
- }
2414
-
2415
- var regeneratorRuntime$1 = {exports: {}};
2416
-
2417
- var _typeof = {exports: {}};
2418
-
2419
- (function (module) {
2420
- function _typeof(obj) {
2421
- "@babel/helpers - typeof";
2422
-
2423
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
2424
- return typeof obj;
2425
- } : function (obj) {
2426
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2427
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
2428
- }
2429
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2430
- } (_typeof));
2431
-
2432
- (function (module) {
2433
- var _typeof$1 = _typeof.exports["default"];
2434
- function _regeneratorRuntime() {
2435
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2436
- return exports;
2437
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
2438
- var exports = {},
2439
- Op = Object.prototype,
2440
- hasOwn = Op.hasOwnProperty,
2441
- defineProperty = Object.defineProperty || function (obj, key, desc) {
2442
- obj[key] = desc.value;
2443
- },
2444
- $Symbol = "function" == typeof Symbol ? Symbol : {},
2445
- iteratorSymbol = $Symbol.iterator || "@@iterator",
2446
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
2447
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
2448
- function define(obj, key, value) {
2449
- return Object.defineProperty(obj, key, {
2450
- value: value,
2451
- enumerable: !0,
2452
- configurable: !0,
2453
- writable: !0
2454
- }), obj[key];
2455
- }
2456
- try {
2457
- define({}, "");
2458
- } catch (err) {
2459
- define = function define(obj, key, value) {
2460
- return obj[key] = value;
2461
- };
2462
- }
2463
- function wrap(innerFn, outerFn, self, tryLocsList) {
2464
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
2465
- generator = Object.create(protoGenerator.prototype),
2466
- context = new Context(tryLocsList || []);
2467
- return defineProperty(generator, "_invoke", {
2468
- value: makeInvokeMethod(innerFn, self, context)
2469
- }), generator;
2470
- }
2471
- function tryCatch(fn, obj, arg) {
2472
- try {
2473
- return {
2474
- type: "normal",
2475
- arg: fn.call(obj, arg)
2476
- };
2477
- } catch (err) {
2478
- return {
2479
- type: "throw",
2480
- arg: err
2481
- };
2482
- }
2483
- }
2484
- exports.wrap = wrap;
2485
- var ContinueSentinel = {};
2486
- function Generator() {}
2487
- function GeneratorFunction() {}
2488
- function GeneratorFunctionPrototype() {}
2489
- var IteratorPrototype = {};
2490
- define(IteratorPrototype, iteratorSymbol, function () {
2491
- return this;
2492
- });
2493
- var getProto = Object.getPrototypeOf,
2494
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
2495
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
2496
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
2497
- function defineIteratorMethods(prototype) {
2498
- ["next", "throw", "return"].forEach(function (method) {
2499
- define(prototype, method, function (arg) {
2500
- return this._invoke(method, arg);
2501
- });
2502
- });
2503
- }
2504
- function AsyncIterator(generator, PromiseImpl) {
2505
- function invoke(method, arg, resolve, reject) {
2506
- var record = tryCatch(generator[method], generator, arg);
2507
- if ("throw" !== record.type) {
2508
- var result = record.arg,
2509
- value = result.value;
2510
- return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
2511
- invoke("next", value, resolve, reject);
2512
- }, function (err) {
2513
- invoke("throw", err, resolve, reject);
2514
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
2515
- result.value = unwrapped, resolve(result);
2516
- }, function (error) {
2517
- return invoke("throw", error, resolve, reject);
2518
- });
2519
- }
2520
- reject(record.arg);
2521
- }
2522
- var previousPromise;
2523
- defineProperty(this, "_invoke", {
2524
- value: function value(method, arg) {
2525
- function callInvokeWithMethodAndArg() {
2526
- return new PromiseImpl(function (resolve, reject) {
2527
- invoke(method, arg, resolve, reject);
2528
- });
2529
- }
2530
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
2531
- }
2532
- });
2533
- }
2534
- function makeInvokeMethod(innerFn, self, context) {
2535
- var state = "suspendedStart";
2536
- return function (method, arg) {
2537
- if ("executing" === state) throw new Error("Generator is already running");
2538
- if ("completed" === state) {
2539
- if ("throw" === method) throw arg;
2540
- return doneResult();
2541
- }
2542
- for (context.method = method, context.arg = arg;;) {
2543
- var delegate = context.delegate;
2544
- if (delegate) {
2545
- var delegateResult = maybeInvokeDelegate(delegate, context);
2546
- if (delegateResult) {
2547
- if (delegateResult === ContinueSentinel) continue;
2548
- return delegateResult;
2549
- }
2550
- }
2551
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
2552
- if ("suspendedStart" === state) throw state = "completed", context.arg;
2553
- context.dispatchException(context.arg);
2554
- } else "return" === context.method && context.abrupt("return", context.arg);
2555
- state = "executing";
2556
- var record = tryCatch(innerFn, self, context);
2557
- if ("normal" === record.type) {
2558
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
2559
- return {
2560
- value: record.arg,
2561
- done: context.done
2562
- };
2563
- }
2564
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
2565
- }
2566
- };
2567
- }
2568
- function maybeInvokeDelegate(delegate, context) {
2569
- var methodName = context.method,
2570
- method = delegate.iterator[methodName];
2571
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
2572
- var record = tryCatch(method, delegate.iterator, context.arg);
2573
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
2574
- var info = record.arg;
2575
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
2576
- }
2577
- function pushTryEntry(locs) {
2578
- var entry = {
2579
- tryLoc: locs[0]
2580
- };
2581
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
2582
- }
2583
- function resetTryEntry(entry) {
2584
- var record = entry.completion || {};
2585
- record.type = "normal", delete record.arg, entry.completion = record;
2586
- }
2587
- function Context(tryLocsList) {
2588
- this.tryEntries = [{
2589
- tryLoc: "root"
2590
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
2591
- }
2592
- function values(iterable) {
2593
- if (iterable) {
2594
- var iteratorMethod = iterable[iteratorSymbol];
2595
- if (iteratorMethod) return iteratorMethod.call(iterable);
2596
- if ("function" == typeof iterable.next) return iterable;
2597
- if (!isNaN(iterable.length)) {
2598
- var i = -1,
2599
- next = function next() {
2600
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
2601
- return next.value = undefined, next.done = !0, next;
2602
- };
2603
- return next.next = next;
2604
- }
2605
- }
2606
- return {
2607
- next: doneResult
2608
- };
2609
- }
2610
- function doneResult() {
2611
- return {
2612
- value: undefined,
2613
- done: !0
2614
- };
2615
- }
2616
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
2617
- value: GeneratorFunctionPrototype,
2618
- configurable: !0
2619
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
2620
- value: GeneratorFunction,
2621
- configurable: !0
2622
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
2623
- var ctor = "function" == typeof genFun && genFun.constructor;
2624
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
2625
- }, exports.mark = function (genFun) {
2626
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
2627
- }, exports.awrap = function (arg) {
2628
- return {
2629
- __await: arg
2630
- };
2631
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
2632
- return this;
2633
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
2634
- void 0 === PromiseImpl && (PromiseImpl = Promise);
2635
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
2636
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
2637
- return result.done ? result.value : iter.next();
2638
- });
2639
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
2640
- return this;
2641
- }), define(Gp, "toString", function () {
2642
- return "[object Generator]";
2643
- }), exports.keys = function (val) {
2644
- var object = Object(val),
2645
- keys = [];
2646
- for (var key in object) keys.push(key);
2647
- return keys.reverse(), function next() {
2648
- for (; keys.length;) {
2649
- var key = keys.pop();
2650
- if (key in object) return next.value = key, next.done = !1, next;
2651
- }
2652
- return next.done = !0, next;
2653
- };
2654
- }, exports.values = values, Context.prototype = {
2655
- constructor: Context,
2656
- reset: function reset(skipTempReset) {
2657
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
2658
- },
2659
- stop: function stop() {
2660
- this.done = !0;
2661
- var rootRecord = this.tryEntries[0].completion;
2662
- if ("throw" === rootRecord.type) throw rootRecord.arg;
2663
- return this.rval;
2664
- },
2665
- dispatchException: function dispatchException(exception) {
2666
- if (this.done) throw exception;
2667
- var context = this;
2668
- function handle(loc, caught) {
2669
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
2670
- }
2671
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2672
- var entry = this.tryEntries[i],
2673
- record = entry.completion;
2674
- if ("root" === entry.tryLoc) return handle("end");
2675
- if (entry.tryLoc <= this.prev) {
2676
- var hasCatch = hasOwn.call(entry, "catchLoc"),
2677
- hasFinally = hasOwn.call(entry, "finallyLoc");
2678
- if (hasCatch && hasFinally) {
2679
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
2680
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
2681
- } else if (hasCatch) {
2682
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
2683
- } else {
2684
- if (!hasFinally) throw new Error("try statement without catch or finally");
2685
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
2686
- }
2687
- }
2688
- }
2689
- },
2690
- abrupt: function abrupt(type, arg) {
2691
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2692
- var entry = this.tryEntries[i];
2693
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
2694
- var finallyEntry = entry;
2695
- break;
2696
- }
2697
- }
2698
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
2699
- var record = finallyEntry ? finallyEntry.completion : {};
2700
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
2701
- },
2702
- complete: function complete(record, afterLoc) {
2703
- if ("throw" === record.type) throw record.arg;
2704
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
2705
- },
2706
- finish: function finish(finallyLoc) {
2707
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2708
- var entry = this.tryEntries[i];
2709
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
2710
- }
2711
- },
2712
- "catch": function _catch(tryLoc) {
2713
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2714
- var entry = this.tryEntries[i];
2715
- if (entry.tryLoc === tryLoc) {
2716
- var record = entry.completion;
2717
- if ("throw" === record.type) {
2718
- var thrown = record.arg;
2719
- resetTryEntry(entry);
2720
- }
2721
- return thrown;
2722
- }
2723
- }
2724
- throw new Error("illegal catch attempt");
2725
- },
2726
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
2727
- return this.delegate = {
2728
- iterator: values(iterable),
2729
- resultName: resultName,
2730
- nextLoc: nextLoc
2731
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
2732
- }
2733
- }, exports;
2734
- }
2735
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2736
- } (regeneratorRuntime$1));
2737
-
2738
- // TODO(Babel 8): Remove this file.
2739
-
2740
- var runtime = regeneratorRuntime$1.exports();
2741
- var regenerator = runtime;
2742
-
2743
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2744
- try {
2745
- regeneratorRuntime = runtime;
2746
- } catch (accidentalStrictMode) {
2747
- if (typeof globalThis === "object") {
2748
- globalThis.regeneratorRuntime = runtime;
2749
- } else {
2750
- Function("r", "regeneratorRuntime = r")(runtime);
2751
- }
2752
- }
2753
-
2754
- var buildEmbedWidgetScript = function buildEmbedWidgetScript() {
2755
- var widgetScriptUrl = window.globalProps.railsEnv === RAILS_ENV.production ? NEETO_WIDGET_SCRIPT_URL.production : NEETO_WIDGET_SCRIPT_URL.staging;
2756
- return "<script src=\"".concat(widgetScriptUrl, "\"></script>");
2757
- };
2758
- var indentAndFormat = function indentAndFormat(str) {
2759
- var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
2760
- return str.split("\n").map(formatter).join("\n ");
2761
- };
2762
- var getCommentedCommand = function getCommentedCommand(command, isEnabled) {
2763
- return isEnabled ? command : "/// ".concat(command);
2764
- };
2765
- var embedWidgetEnvironment = function embedWidgetEnvironment() {
2766
- switch (window.globalProps.railsEnv) {
2767
- case RAILS_ENV.production:
2768
- return "";
2769
- case RAILS_ENV.development:
2770
- return "environment: \"".concat(RAILS_ENV.development, "\",");
2771
- case RAILS_ENV.staging:
2772
- return "environment: \"".concat(RAILS_ENV.staging, "\",");
2773
- default:
2774
- return "/* Unidentified RAILS_ENV, */";
2775
- }
2776
- };
2777
- var embedWidgetApiKey = function embedWidgetApiKey(apiKey) {
2778
- return "apiKey: \"".concat(apiKey, "\",");
2779
- };
2780
- var addChangelogOptions = function addChangelogOptions() {
2781
- return "neetoChangelogOptions: {\n elementId: \"neetochangelog-trigger\",\n},";
2782
- };
2783
- var wrapBlockInOnLoad = function wrapBlockInOnLoad(codeBlock) {
2784
- return "window.addEventListener(\"load\", () => ".concat(codeBlock, ");");
2785
- };
2786
- var embedWidgetFunctionCall = function embedWidgetFunctionCall(enabledWidgets, apiKey) {
2787
- return "embedNeetoWidget({\n ".concat(embedWidgetEnvironment(), "\n ").concat(indentAndFormat(embedWidgetApiKey(apiKey)), "\n ").concat(indentAndFormat(addChangelogOptions(), function (cmd) {
2788
- return getCommentedCommand(cmd, enabledWidgets.changelog);
2789
- }), "\n})");
2790
- };
2791
- var filterMarkedCommands = function filterMarkedCommands(queryString) {
2792
- return queryString.split("\n").filter(function (line) {
2793
- return !line.includes("///") && line.trim();
2794
- }).join("\n");
2795
- };
2796
- var getSampleUserIdentity = function getSampleUserIdentity(enabledWidgets, selectedFramework) {
2797
- var splitCodeLines = SAMPLE_USER_IDENTITY_CODE_STRING[selectedFramework].split("\n");
2798
- return filterMarkedCommands(splitCodeLines.map(function (cmd) {
2799
- var isEmailKey = cmd.includes("email");
2800
- var isObjectStartLine = cmd === splitCodeLines[0];
2801
- var isObjectEndLine = cmd === last(splitCodeLines);
2802
- var isLineHidden = !isEmailKey && !isObjectStartLine && !isObjectEndLine;
2803
- if (!enabledWidgets.chat && isLineHidden || !enabledWidgets.chat && !enabledWidgets.replay) {
2804
- return null;
2805
- }
2806
- return cmd;
2807
- }).join("\n"));
2808
- };
2809
- var sampleConsolidatedCodeString = function sampleConsolidatedCodeString(enabledWidgets, apiKey) {
2810
- return filterMarkedCommands("".concat(buildEmbedWidgetScript(), "\n<script>\n ").concat(enabledWidgets.chat || enabledWidgets.replay ? "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {};") : "", "\n ").concat(enabledWidgets.replay ? "window.".concat(SESSION_CONTEXT_KEY, " = {};") : "", "\n\n ").concat(indentAndFormat(wrapBlockInOnLoad(embedWidgetFunctionCall(enabledWidgets, apiKey))), "\n</script>"));
2811
- };
2812
- var getEmailWidgetSnippetFormInitialValues = function getEmailWidgetSnippetFormInitialValues(subject) {
2813
- return {
2814
- emails: "",
2815
- subject: subject
2816
- };
2817
- };
2818
- var getSortedPrefixedWidgets = function getSortedPrefixedWidgets(widgets) {
2819
- return widgets.sort().map(function (widget) {
2820
- return "neeto".concat(capitalize(widget));
2821
- });
2822
- };
2823
- var getEmailWidgetSnippetValidationSchema = function getEmailWidgetSnippetValidationSchema() {
2824
- return yup.object({
2825
- emails: yup.array().required().label(i18next.t("neetoMolecules.widget.email.fields.emails.label")),
2826
- subject: yup.string().required().label(i18next.t("neetoMolecules.widget.email.fields.subject.label"))
2827
- });
2828
- };
2829
- var getWidgetApiKeyUrl = function getWidgetApiKeyUrl() {
2830
- return "api/widget/v1/api_keys/".concat(window.globalProps.organization.subdomain);
2831
- };
2832
-
2833
- var _require = require("axios"),
2834
- axios = _require["default"];
2835
- var queryWidgetApiKey = function queryWidgetApiKey() {
2836
- return axios.get(getWidgetApiKeyUrl(), {
2837
- showToastr: false
2838
- });
2839
- };
2840
- var emailWidgetSnippet = function emailWidgetSnippet(data) {
2841
- return axios.post(EMBED_CODE_EMAIL_URL, data);
2842
- };
2843
- var fetchWidgetConfiguration = function fetchWidgetConfiguration() {
2844
- return axios.get(WIDGET_CONFIG_URL);
2845
- };
2846
- var updateWidgetConfiguration = function updateWidgetConfiguration(_ref) {
2847
- var id = _ref.id,
2848
- payload = _ref.payload;
2849
- return axios.put("".concat(WIDGET_CONFIG_URL, "/").concat(id), payload);
2850
- };
2851
-
2852
- var useEmailEmbedCode = function useEmailEmbedCode(onSuccess) {
2853
- return useMutation(function (emailData) {
2854
- return emailWidgetSnippet(emailData);
2855
- }, {
2856
- onSuccess: onSuccess
2857
- });
2858
- };
2859
-
2860
- var CodeSnippet = function CodeSnippet(_ref) {
2861
- var isPaneOpen = _ref.isPaneOpen,
2862
- onClose = _ref.onClose,
2863
- _ref$onSent = _ref.onSent,
2864
- onSent = _ref$onSent === void 0 ? noop : _ref$onSent,
2865
- codeString = _ref.codeString,
2866
- _ref$subject = _ref.subject,
2867
- subject = _ref$subject === void 0 ? "" : _ref$subject,
2868
- _ref$body = _ref.body,
2869
- body = _ref$body === void 0 ? "" : _ref$body,
2870
- _ref$emailType = _ref.emailType,
2871
- emailType = _ref$emailType === void 0 ? EMAIL_TYPES.embedCode : _ref$emailType,
2872
- _ref$enabledWidgets = _ref.enabledWidgets,
2873
- enabledWidgets = _ref$enabledWidgets === void 0 ? {} : _ref$enabledWidgets;
2874
- var _useTranslation = useTranslation(),
2875
- t = _useTranslation.t;
2876
- var _useState = useState(FRAMEWORK_SELECT_OPTIONS[0]),
2877
- _useState2 = _slicedToArray(_useState, 2),
2878
- selectedFramework = _useState2[0],
2879
- setSelectedFramework = _useState2[1];
2880
- var emailMutation = useEmailEmbedCode(onSent);
2881
- var codeToDisplay = emailType === EMAIL_TYPES.userIdentity ? getSampleUserIdentity(enabledWidgets, selectedFramework.value) : codeString;
2882
- var handleSubmit = /*#__PURE__*/function () {
2883
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(formData) {
2884
- var _body$ref$current$inn, _body$ref;
2885
- return regenerator.wrap(function _callee$(_context) {
2886
- while (1) switch (_context.prev = _context.next) {
2887
- case 0:
2888
- if (!any(function (_ref3) {
2889
- var valid = _ref3.valid;
2890
- return !valid;
2891
- }, formData.emails)) {
2892
- _context.next = 3;
2893
- break;
2894
- }
2895
- Toastr.error(t("neetoMolecules.widget.email.fields.emails.invalidError"));
2896
- return _context.abrupt("return");
2897
- case 3:
2898
- emailMutation.mutate({
2899
- subject: formData.subject,
2900
- emails: pluck("value", formData.emails),
2901
- message: (_body$ref$current$inn = (_body$ref = body.ref) === null || _body$ref === void 0 ? void 0 : _body$ref.current.innerHTML) !== null && _body$ref$current$inn !== void 0 ? _body$ref$current$inn : body,
2902
- snippet: codeToDisplay
2903
- });
2904
- case 4:
2905
- case "end":
2906
- return _context.stop();
2907
- }
2908
- }, _callee);
2909
- }));
2910
- return function handleSubmit(_x) {
2911
- return _ref2.apply(this, arguments);
2912
- };
2913
- }();
2914
- var renderCodeBlockProps = function renderCodeBlockProps() {
2915
- var props = {
2916
- codeString: codeToDisplay,
2917
- showCopyButton: false,
2918
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg"
2919
- };
2920
- if (emailType === EMAIL_TYPES.userIdentity) {
2921
- props = assoc("frameworkProps", {
2922
- selectedFramework: selectedFramework,
2923
- setSelectedFramework: setSelectedFramework
2924
- }, props);
2925
- }
2926
- return props;
2927
- };
2928
- return /*#__PURE__*/React__default.createElement(Pane, {
2929
- isOpen: isPaneOpen,
2930
- onClose: onClose
2931
- }, /*#__PURE__*/React__default.createElement(Formik, {
2932
- initialValues: getEmailWidgetSnippetFormInitialValues(subject),
2933
- validationSchema: getEmailWidgetSnippetValidationSchema(),
2934
- onSubmit: handleSubmit
2935
- }, /*#__PURE__*/React__default.createElement(Form, null, /*#__PURE__*/React__default.createElement(Pane.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
2936
- style: "h2"
2937
- }, t("neetoMolecules.widget.email.title"))), /*#__PURE__*/React__default.createElement(Pane.Body, null, /*#__PURE__*/React__default.createElement("div", {
2938
- className: "w-full space-y-4"
2939
- }, /*#__PURE__*/React__default.createElement(MultiEmailInput, {
2940
- required: true,
2941
- label: t("neetoMolecules.widget.email.fields.emails.label"),
2942
- name: "emails",
2943
- placeholder: t("neetoMolecules.widget.email.fields.emails.placeholder")
2944
- }), /*#__PURE__*/React__default.createElement(Input, {
2945
- required: true,
2946
- label: t("neetoMolecules.widget.email.fields.subject.label"),
2947
- name: "subject",
2948
- type: "text"
2949
- }), /*#__PURE__*/React__default.createElement(Typography, {
2950
- style: "body2"
2951
- }, body), /*#__PURE__*/React__default.createElement(CodeBlock, renderCodeBlockProps()))), /*#__PURE__*/React__default.createElement(Pane.Footer, {
2952
- className: "gap-x-2"
2953
- }, /*#__PURE__*/React__default.createElement(Button, {
2954
- disabled: emailMutation.isLoading,
2955
- label: t("neetoMolecules.widget.email.actions.send"),
2956
- loading: emailMutation.isLoading,
2957
- type: "submit"
2958
- }), /*#__PURE__*/React__default.createElement(Button, {
2959
- label: t("neetoMolecules.widget.email.actions.cancel"),
2960
- style: "text",
2961
- onClick: onClose
2962
- })))));
2963
- };
2964
-
2965
- var useForceUpdate = function useForceUpdate() {
2966
- // eslint-disable-next-line react/hook-use-state
2967
- var _useState = useState(0),
2968
- _useState2 = _slicedToArray(_useState, 2),
2969
- setValue = _useState2[1];
2970
- return function () {
2971
- return setValue(function (value) {
2972
- return value + 1;
2973
- });
2974
- };
2975
- };
2976
-
2977
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2978
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2979
- var useFetchApiKey = function useFetchApiKey() {
2980
- return useQuery(QUERY_KEYS.apiKey, function () {
2981
- if (window.globalProps.railsEnv === "heroku" || !process.env.ENABLE_SSO) {
2982
- return Promise.resolve({
2983
- widgetApiKey: "placeholder-api-key"
2984
- });
2985
- }
2986
- return queryWidgetApiKey();
2987
- }, {
2988
- staleTime: DEFAULT_QUERY_STALE_TIME
2989
- });
2990
- };
2991
- var useFetchConfigurations = function useFetchConfigurations() {
2992
- return useQuery(QUERY_KEYS.configuration, fetchWidgetConfiguration, {
2993
- staleTime: DEFAULT_QUERY_STALE_TIME
2994
- });
2995
- };
2996
- var useUpdateConfigurations = function useUpdateConfigurations() {
2997
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2998
- var queryClient = useQueryClient();
2999
- return useMutation(updateWidgetConfiguration, _objectSpread(_objectSpread({}, options), {}, {
3000
- onSuccess: function onSuccess() {
3001
- return queryClient.invalidateQueries(QUERY_KEYS.configuration);
3002
- }
3003
- }));
3004
- };
3005
-
3006
- var TooltipSwitch = withT(function (_ref) {
3007
- var t = _ref.t,
3008
- enabledClientApps = _ref.enabledClientApps,
3009
- widget = _ref.widget,
3010
- selectedWidgets = _ref.selectedWidgets,
3011
- updateSelectedWidgets = _ref.updateSelectedWidgets;
3012
- return /*#__PURE__*/React__default.createElement(Tooltip, {
3013
- disabled: enabledClientApps.includes(widget),
3014
- placement: "right",
3015
- content: t("neetoMolecules.widget.tooltips.productIsDisabled", {
3016
- productName: "neeto".concat(capitalize(widget))
3017
- })
3018
- }, /*#__PURE__*/React__default.createElement(Switch, {
3019
- checked: selectedWidgets.includes(widget),
3020
- disabled: !enabledClientApps.includes(widget),
3021
- onChange: function onChange() {
3022
- return updateSelectedWidgets(widget);
3023
- }
3024
- }));
3025
- });
3026
-
3027
- var SelectionSwitches = function SelectionSwitches(_ref) {
3028
- var selectedWidgets = _ref.selectedWidgets,
3029
- updateSelectedWidgets = _ref.updateSelectedWidgets,
3030
- primaryApp = _ref.primaryApp,
3031
- enabledClientApps = _ref.enabledClientApps;
3032
- var primaryWidget = WIDGET_TYPES_VALUES.includes(primaryApp) ? primaryApp : "";
3033
- return /*#__PURE__*/React__default.createElement("div", {
3034
- className: "mb-4 flex w-full items-center justify-between gap-2"
3035
- }, /*#__PURE__*/React__default.createElement("div", {
3036
- className: "flex items-center space-x-2"
3037
- }, isNotEmpty(primaryWidget) && /*#__PURE__*/React__default.createElement(TooltipSwitch, {
3038
- enabledClientApps: enabledClientApps,
3039
- selectedWidgets: selectedWidgets,
3040
- updateSelectedWidgets: updateSelectedWidgets,
3041
- widget: primaryWidget
3042
- }), /*#__PURE__*/React__default.createElement("div", {
3043
- className: "flex items-center space-x-1"
3044
- }, /*#__PURE__*/React__default.createElement(Label, null, "neeto", capitalize(primaryWidget)), /*#__PURE__*/React__default.createElement("a", {
3045
- href: WIDGET_KB_HELP_URL[primaryApp],
3046
- rel: "noreferrer",
3047
- target: "_blank"
3048
- }, /*#__PURE__*/React__default.createElement(Info, {
3049
- size: 16
3050
- })))), /*#__PURE__*/React__default.createElement("div", {
3051
- className: "flex items-center justify-end gap-6"
3052
- }, WIDGET_TYPES_VALUES.map(function (widget, index) {
3053
- return primaryApp !== widget && /*#__PURE__*/React__default.createElement("div", {
3054
- className: "flex items-center space-x-2",
3055
- key: index
3056
- }, /*#__PURE__*/React__default.createElement(TooltipSwitch, {
3057
- enabledClientApps: enabledClientApps,
3058
- selectedWidgets: selectedWidgets,
3059
- updateSelectedWidgets: updateSelectedWidgets,
3060
- widget: widget
3061
- }), /*#__PURE__*/React__default.createElement(Label, null, "neeto", capitalize(widget)));
3062
- })));
3063
- };
3064
-
3065
- var EmbedCode = function EmbedCode(_ref) {
3066
- var showSessionContext = _ref.showSessionContext,
3067
- showUserIdentity = _ref.showUserIdentity,
3068
- _ref$primaryApp = _ref.primaryApp,
3069
- primaryApp = _ref$primaryApp === void 0 ? "" : _ref$primaryApp,
3070
- _ref$maxWidth = _ref.maxWidth,
3071
- maxWidth = _ref$maxWidth === void 0 ? "max-w-3xl" : _ref$maxWidth;
3072
- var _useState = useState(EMAIL_TYPES["null"]),
3073
- _useState2 = _slicedToArray(_useState, 2),
3074
- emailType = _useState2[0],
3075
- setEmailType = _useState2[1];
3076
- var _useState3 = useState(FRAMEWORK_SELECT_OPTIONS[0]),
3077
- _useState4 = _slicedToArray(_useState3, 2),
3078
- selectedFramework = _useState4[0],
3079
- setSelectedFramework = _useState4[1];
3080
- var _useTranslation = useTranslation(),
3081
- t = _useTranslation.t;
3082
- var bodyRef = useRef();
3083
- var forceUpdate = useForceUpdate();
3084
- useEffect(function () {
3085
- forceUpdate();
3086
- }, []);
3087
- var _useFetchApiKey = useFetchApiKey(),
3088
- _useFetchApiKey$data = _useFetchApiKey.data,
3089
- _useFetchApiKey$data2 = _useFetchApiKey$data === void 0 ? {} : _useFetchApiKey$data,
3090
- _useFetchApiKey$data3 = _useFetchApiKey$data2.widgetApiKey,
3091
- widgetApiKey = _useFetchApiKey$data3 === void 0 ? "" : _useFetchApiKey$data3,
3092
- isLoadingApiKey = _useFetchApiKey.isLoading;
3093
- var _useFetchConfiguratio = useFetchConfigurations(),
3094
- _useFetchConfiguratio2 = _useFetchConfiguratio.data,
3095
- _useFetchConfiguratio3 = _useFetchConfiguratio2 === void 0 ? {} : _useFetchConfiguratio2,
3096
- _useFetchConfiguratio4 = _useFetchConfiguratio3.neetoWidgetTokens,
3097
- neetoWidgetTokens = _useFetchConfiguratio4 === void 0 ? [] : _useFetchConfiguratio4,
3098
- isLoadingConfigurations = _useFetchConfiguratio.isLoading;
3099
- var _useUpdateConfigurati = useUpdateConfigurations(),
3100
- updateWidgetConfiguration = _useUpdateConfigurati.mutate;
3101
- var previousEmailType = usePrevious(emailType);
3102
- var selectedWidgets = neetoWidgetTokens.filter(prop("enabled")).map(function (item) {
3103
- return item.clientApplicationName.toLowerCase();
3104
- });
3105
- var enabledClientApps = neetoWidgetTokens.filter(prop("clientApplicationEnabled")).map(function (item) {
3106
- return item.clientApplicationName.toLowerCase();
3107
- });
3108
- var enabledWidgets = fromPairs(selectedWidgets.map(function (widget) {
3109
- return [widget, true];
3110
- }));
3111
- var shouldShowUserIdentity = showUserIdentity !== null && showUserIdentity !== void 0 ? showUserIdentity : enabledWidgets.chat || enabledWidgets.replay;
3112
- var shouldShowSessionContext = showSessionContext !== null && showSessionContext !== void 0 ? showSessionContext : enabledWidgets.replay;
3113
- var updateSelectedWidgets = function updateSelectedWidgets(widget) {
3114
- var widgetId = neetoWidgetTokens.find(function (item) {
3115
- return item.clientApplicationName.toLowerCase() === widget;
3116
- }).id;
3117
- var isEnabled = !selectedWidgets.includes(widget);
3118
- updateWidgetConfiguration({
3119
- id: widgetId,
3120
- payload: {
3121
- enabled: isEnabled
3122
- }
3123
- }, {
3124
- onSuccess: function onSuccess() {
3125
- var productName = "neeto".concat(capitalize(widget));
3126
- var response = isEnabled ? "neetoMolecules.widget.installation.enabled" : "neetoMolecules.widget.installation.disabled";
3127
- Toastr.success(t(response, {
3128
- productName: productName
3129
- }));
3130
- }
3131
- });
3132
- };
3133
- var getEmbedCodeString = function getEmbedCodeString() {
3134
- return isNotEmpty(widgetApiKey) ? sampleConsolidatedCodeString(enabledWidgets, widgetApiKey) : "";
3135
- };
3136
- var getSnippetProps = function getSnippetProps(selectedEmailType) {
3137
- switch (selectedEmailType) {
3138
- case EMAIL_TYPES.embedCode:
3139
- return {
3140
- codeString: getEmbedCodeString(),
3141
- subject: t("neetoMolecules.widget.email.fields.subject.values.embedCode"),
3142
- body: /*#__PURE__*/React__default.createElement("div", {
3143
- ref: bodyRef
3144
- }, /*#__PURE__*/React__default.createElement(Trans, {
3145
- i18nKey: "neetoMolecules.widget.email.body.values.embedCode",
3146
- components: {
3147
- p: /*#__PURE__*/React__default.createElement("p", {
3148
- style: {
3149
- marginBottom: "8px"
3150
- }
3151
- }),
3152
- mail: /*#__PURE__*/React__default.createElement("a", {
3153
- className: "neeto-ui-text-primary-800",
3154
- href: "mailto:".concat(INSTALLATION_HELP_EMAIL),
3155
- rel: "noreferrer",
3156
- target: "_blank"
3157
- })
3158
- },
3159
- values: {
3160
- val: getSortedPrefixedWidgets(selectedWidgets),
3161
- helpEmail: INSTALLATION_HELP_EMAIL
3162
- }
3163
- }))
3164
- };
3165
- case EMAIL_TYPES.userIdentity:
3166
- return {
3167
- emailType: EMAIL_TYPES.userIdentity,
3168
- enabledWidgets: enabledWidgets,
3169
- subject: t("neetoMolecules.widget.email.fields.subject.values.userIdentity"),
3170
- body: /*#__PURE__*/React__default.createElement("div", {
3171
- ref: bodyRef
3172
- }, /*#__PURE__*/React__default.createElement(Trans, {
3173
- i18nKey: "neetoMolecules.widget.email.body.values.userIdentity",
3174
- components: {
3175
- p: /*#__PURE__*/React__default.createElement("p", {
3176
- style: {
3177
- marginBottom: "8px"
3178
- }
3179
- }),
3180
- configureLink: /*#__PURE__*/React__default.createElement("a", {
3181
- className: "neeto-ui-text-primary-800",
3182
- rel: "noreferrer",
3183
- target: "_blank",
3184
- href: enabledWidgets.chat ? NEETO_CHAT_USER_IDENTITY_URL : NEETO_REPLAY_CONFIGURE_URL
3185
- })
3186
- },
3187
- values: {
3188
- userIdentityKbUrl: enabledWidgets.chat ? NEETO_CHAT_USER_IDENTITY_URL : NEETO_REPLAY_CONFIGURE_URL
3189
- }
3190
- }))
3191
- };
3192
- case EMAIL_TYPES.sessionContext:
3193
- return {
3194
- codeString: SAMPLE_CONTEXT_CODE_STRING,
3195
- subject: t("neetoMolecules.widget.email.fields.subject.values.sessionContext"),
3196
- body: /*#__PURE__*/React__default.createElement("div", {
3197
- ref: bodyRef
3198
- }, /*#__PURE__*/React__default.createElement(Trans, {
3199
- i18nKey: "neetoMolecules.widget.email.body.values.sessionContext",
3200
- values: {
3201
- sessionContextKbUrl: NEETO_REPLAY_CONFIGURE_URL
3202
- },
3203
- components: {
3204
- p: /*#__PURE__*/React__default.createElement("p", {
3205
- style: {
3206
- marginBottom: "8px"
3207
- }
3208
- }),
3209
- configureLink: /*#__PURE__*/React__default.createElement("a", {
3210
- className: "neeto-ui-text-primary-800",
3211
- href: NEETO_REPLAY_CONFIGURE_URL,
3212
- rel: "noreferrer",
3213
- target: "_blank"
3214
- })
3215
- }
3216
- }))
3217
- };
3218
- case EMAIL_TYPES["null"]:
3219
- return previousEmailType !== EMAIL_TYPES["null"] ? getSnippetProps(previousEmailType) : {};
3220
- default:
3221
- throw new Error(t("neetoMolecules.widget.email.invalidType"));
3222
- }
3223
- };
3224
- var handleSendViaEmail = function handleSendViaEmail(selectedEmail) {
3225
- if (isEmpty(selectedWidgets)) {
3226
- Toastr.error(t("neetoMolecules.widget.installation.snippet.disabledError"));
3227
- return;
3228
- }
3229
- setEmailType(selectedEmail);
3230
- };
3231
- if (isLoadingApiKey || isLoadingConfigurations) {
3232
- return /*#__PURE__*/React__default.createElement("div", {
3233
- className: "h-full w-full"
3234
- }, /*#__PURE__*/React__default.createElement(PageLoader$1, null));
3235
- }
3236
- return /*#__PURE__*/React__default.createElement("div", {
3237
- className: "mx-auto mb-10 w-full flex-col items-center justify-start"
3238
- }, /*#__PURE__*/React__default.createElement("div", {
3239
- className: classnames("mx-auto", maxWidth)
3240
- }, /*#__PURE__*/React__default.createElement(SelectionSwitches, {
3241
- enabledClientApps: enabledClientApps,
3242
- primaryApp: primaryApp,
3243
- selectedWidgets: selectedWidgets,
3244
- updateSelectedWidgets: updateSelectedWidgets
3245
- }), /*#__PURE__*/React__default.createElement("div", {
3246
- className: "mb-8 w-full flex-grow flex-col items-center justify-start"
3247
- }, /*#__PURE__*/React__default.createElement("div", {
3248
- className: "mx-auto mb-2 w-full",
3249
- "data-testid": "embed-code-block"
3250
- }, /*#__PURE__*/React__default.createElement(CodeBlock, {
3251
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg",
3252
- codeString: getEmbedCodeString(),
3253
- sendViaEmail: function sendViaEmail() {
3254
- return handleSendViaEmail(EMAIL_TYPES.embedCode);
3255
- },
3256
- title: /*#__PURE__*/React__default.createElement("div", null, t("neetoMolecules.widget.title.embedCode"))
3257
- })), /*#__PURE__*/React__default.createElement("div", {
3258
- className: "w-full"
3259
- }, /*#__PURE__*/React__default.createElement(Trans, {
3260
- values: {
3261
- val: getSortedPrefixedWidgets(selectedWidgets)
3262
- },
3263
- components: {
3264
- fontBold: /*#__PURE__*/React__default.createElement("span", {
3265
- className: "font-semibold"
3266
- }),
3267
- fontNormal: /*#__PURE__*/React__default.createElement("span", {
3268
- className: "font-normal"
3269
- })
3270
- },
3271
- i18nKey: isNotEmpty(selectedWidgets) ? "neetoMolecules.widget.installation.instructions.placement.selectedWidgets" : "neetoMolecules.widget.installation.instructions.placement.noneOfThese"
3272
- }))), shouldShowUserIdentity ? /*#__PURE__*/React__default.createElement("div", {
3273
- className: "mb-8 w-full flex-grow flex-col items-center justify-start"
3274
- }, /*#__PURE__*/React__default.createElement("div", {
3275
- className: "mx-auto mb-2 w-full"
3276
- }, /*#__PURE__*/React__default.createElement(CodeBlock, {
3277
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg",
3278
- frameworkProps: {
3279
- selectedFramework: selectedFramework,
3280
- setSelectedFramework: setSelectedFramework
3281
- },
3282
- codeString: getSampleUserIdentity(enabledWidgets, selectedFramework.value),
3283
- sendViaEmail: function sendViaEmail() {
3284
- return handleSendViaEmail(EMAIL_TYPES.userIdentity);
3285
- },
3286
- title: /*#__PURE__*/React__default.createElement("div", {
3287
- className: "flex items-center justify-start"
3288
- }, /*#__PURE__*/React__default.createElement("div", null, t("neetoMolecules.widget.title.userIdentity")), /*#__PURE__*/React__default.createElement("a", {
3289
- className: "ml-1",
3290
- rel: "noreferrer",
3291
- target: "_blank",
3292
- href: enabledWidgets.chat ? NEETO_CHAT_USER_IDENTITY_URL : NEETO_REPLAY_CONFIGURE_URL
3293
- }, /*#__PURE__*/React__default.createElement(Info, {
3294
- size: 16
3295
- })))
3296
- })), /*#__PURE__*/React__default.createElement("div", {
3297
- className: "w-full"
3298
- }, t("neetoMolecules.widget.installation.instructions.userIdentity"))) : null, shouldShowSessionContext ? /*#__PURE__*/React__default.createElement("div", {
3299
- className: "w-full flex-grow flex-col items-center justify-start"
3300
- }, /*#__PURE__*/React__default.createElement("div", {
3301
- className: "mx-auto mb-2 w-full"
3302
- }, /*#__PURE__*/React__default.createElement(CodeBlock, {
3303
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg",
3304
- codeString: SAMPLE_CONTEXT_CODE_STRING,
3305
- sendViaEmail: function sendViaEmail() {
3306
- return handleSendViaEmail(EMAIL_TYPES.sessionContext);
3307
- },
3308
- title: /*#__PURE__*/React__default.createElement("div", {
3309
- className: "flex items-center justify-start"
3310
- }, /*#__PURE__*/React__default.createElement("div", null, t("neetoMolecules.widget.title.sessionContext")), /*#__PURE__*/React__default.createElement("a", {
3311
- className: "ml-1",
3312
- href: NEETO_REPLAY_CONFIGURE_URL,
3313
- rel: "noreferrer",
3314
- target: "_blank"
3315
- }, /*#__PURE__*/React__default.createElement(Info, {
3316
- size: 16
3317
- })))
3318
- })), /*#__PURE__*/React__default.createElement("div", {
3319
- className: "w-full"
3320
- }, t("neetoMolecules.widget.installation.instructions.sessionContext"))) : null), /*#__PURE__*/React__default.createElement(CodeSnippet, _extends$1({
3321
- isPaneOpen: !!emailType && isNotEmpty(selectedWidgets),
3322
- onClose: function onClose() {
3323
- return setEmailType(EMAIL_TYPES["null"]);
3324
- }
3325
- }, getSnippetProps(emailType))));
3326
- };
3327
- var EmbedCode$1 = /*#__PURE__*/React__default.memo(EmbedCode);
3328
-
3329
- var queryClient = new QueryClient();
3330
- var Main = function Main(props) {
3331
- var _useTranslation = useTranslation(),
3332
- t = _useTranslation.t;
3333
- var shouldRenderEmbedCode = window.globalProps.ssoEnabled;
3334
- return shouldRenderEmbedCode ? /*#__PURE__*/React__default.createElement(QueryClientProvider, {
3335
- client: queryClient
3336
- }, /*#__PURE__*/React__default.createElement(EmbedCode$1, props)) : /*#__PURE__*/React__default.createElement(Callout, {
3337
- icon: Info,
3338
- style: "info"
3339
- }, t("neetoMolecules.widget.developmentInfo"));
3340
- };
3341
-
3342
- var NeetoWidget = {
3343
- EmbedCode: Main,
3344
- WIDGET_TYPES: WIDGET_TYPES
3345
- };
3346
-
3347
- export { NeetoWidget as default };
3348
- //# sourceMappingURL=NeetoWidget.js.map