slice-machine-ui 1.26.1-beta.8 → 2.0.0

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 (534) hide show
  1. package/.eslintrc.js +6 -1
  2. package/.storybook/preview.tsx +2 -1
  3. package/out/404.html +1 -1
  4. package/out/_next/static/QWi-WrYk9EtyMIs1RfQ3_/_buildManifest.js +1 -0
  5. package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad1d7303abecd2b.js} +1 -1
  6. package/out/_next/static/chunks/18539003-32a73014bab3a789.js +22 -0
  7. package/out/_next/static/chunks/188-2e42d5ebef697946.js +1 -0
  8. package/out/_next/static/chunks/569-2ae3e9666f3bf991.js +1 -0
  9. package/out/_next/static/chunks/614-5130fbdbcfab2d35.js +1 -0
  10. package/out/_next/static/chunks/661-78c8c89d258133b8.js +1 -0
  11. package/out/_next/static/chunks/756-b11a3060cdc2f2d3.js +10 -0
  12. package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
  13. package/out/_next/static/chunks/91-67c244a4a034c8de.js +1 -0
  14. package/out/_next/static/chunks/pages/_app-0fe871bb1059a05c.js +532 -0
  15. package/out/_next/static/chunks/pages/changelog-3f04a3d8747ae383.js +1 -0
  16. package/out/_next/static/chunks/pages/changes-ec62e7eb50d6f2be.js +1 -0
  17. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-982ecf1d799b6bcf.js +1 -0
  18. package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-900b40b54b74e6d6.js} +1 -1
  19. package/out/_next/static/chunks/pages/{index-cf93d16e9c63b6db.js → index-ccd2975faba412f6.js} +1 -1
  20. package/out/_next/static/chunks/pages/labs-830dde0b85d6dd01.js +1 -0
  21. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-886fc28240831dae.js +1 -0
  22. package/out/_next/static/chunks/pages/settings-f61144a9387fd6f1.js +1 -0
  23. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js +1 -0
  24. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ad66e6c755798ce7.js +1 -0
  25. package/out/_next/static/chunks/pages/slices-d65be4ca817a766d.js +1 -0
  26. package/out/_next/static/css/037ba37d121d4afe.css +1 -0
  27. package/out/_next/static/css/22f264c93bd9d85f.css +1 -0
  28. package/out/_next/static/css/6279e95f6aff22d5.css +1 -0
  29. package/out/_next/static/css/824d6e761aed01d2.css +1 -0
  30. package/out/_next/static/css/e3ffbc7931a47375.css +1 -0
  31. package/out/_next/static/css/f01f60095c76c7fb.css +1 -0
  32. package/out/changelog.html +1 -1
  33. package/out/changes.html +1 -1
  34. package/out/custom-types/[customTypeId].html +1 -1
  35. package/out/custom-types.html +1 -1
  36. package/out/index.html +1 -1
  37. package/out/labs.html +1 -1
  38. package/out/page-types/[pageTypeId].html +1 -1
  39. package/out/settings.html +1 -1
  40. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  41. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  42. package/out/slices.html +1 -1
  43. package/package.json +10 -11
  44. package/sentry.client.config.ts +2 -1
  45. package/src/ErrorBoundary.tsx +1 -1
  46. package/src/apiClient.ts +13 -9
  47. package/src/components/BaseHoverCard/BaseHoverCard.module.css +18 -0
  48. package/src/components/BaseHoverCard/BaseHoverCard.module.css.d.ts +7 -0
  49. package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
  50. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  51. package/src/components/BaseHoverCard/BaseHoverCard.tsx +2 -2
  52. package/src/components/BlankSlate/BlankSlate.module.css +74 -0
  53. package/src/components/BlankSlate/BlankSlate.module.css.d.ts +13 -0
  54. package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
  55. package/src/components/BlankSlate/BlankSlate.tsx +1 -1
  56. package/src/components/BlankSlate/index.ts +1 -1
  57. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
  58. package/src/components/Card/Card.module.css +202 -0
  59. package/src/components/Card/Card.module.css.d.ts +22 -0
  60. package/src/components/Card/Card.stories.tsx +3 -3
  61. package/src/components/Card/Card.tsx +8 -8
  62. package/src/components/CodeBlock/CodeBlock.module.css +46 -0
  63. package/src/components/CodeBlock/CodeBlock.module.css.d.ts +10 -0
  64. package/src/components/CodeBlock/CodeBlock.tsx +7 -7
  65. package/src/components/ContentTabs/ContentTabs.module.css +60 -0
  66. package/src/components/ContentTabs/ContentTabs.module.css.d.ts +12 -0
  67. package/src/components/ContentTabs/ContentTabs.tsx +2 -2
  68. package/src/components/Count/Count.tsx +1 -1
  69. package/src/components/Divider/Divider.module.css +23 -0
  70. package/src/components/Divider/Divider.module.css.d.ts +7 -0
  71. package/src/components/Divider/Divider.stories.tsx +3 -4
  72. package/src/components/Divider/Divider.tsx +5 -8
  73. package/src/components/HoverCard/HoverCard.module.css +79 -0
  74. package/src/components/HoverCard/HoverCard.module.css.d.ts +13 -0
  75. package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
  76. package/src/components/HoverCard/HoverCard.test.tsx +2 -2
  77. package/src/components/HoverCard/HoverCard.tsx +3 -3
  78. package/src/components/HoverCard/index.ts +3 -3
  79. package/src/components/List/List.css.ts +4 -2
  80. package/src/components/PageLayout/PageLayout.module.css +1 -1
  81. package/src/components/SideNav/SideNav.module.css +1 -1
  82. package/src/components/SideNav/SideNav.stories.tsx +6 -6
  83. package/src/components/SideNav/SideNav.tsx +8 -8
  84. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +10 -12
  85. package/src/components/Table/Table.stories.tsx +2 -2
  86. package/src/components/Table/Table.test.tsx +2 -2
  87. package/src/components/Table/Table.tsx +2 -2
  88. package/src/components/Table/index.ts +1 -1
  89. package/src/components/TextLink/TextLink.module.css +58 -0
  90. package/src/components/TextLink/TextLink.module.css.d.ts +11 -0
  91. package/src/components/TextLink/TextLink.stories.tsx +1 -1
  92. package/src/components/TextLink/TextLink.tsx +5 -5
  93. package/src/domain/__tests__/customType.test.ts +1 -186
  94. package/src/domain/__tests__/group.test.ts +161 -0
  95. package/src/domain/__tests__/slice.test.ts +3 -3
  96. package/src/domain/customType.ts +1 -193
  97. package/src/domain/group.ts +89 -0
  98. package/src/domain/slice.ts +28 -12
  99. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -2
  100. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +1 -1
  101. package/src/features/changelog/useSliceMachineReleaseNotes.ts +1 -1
  102. package/src/features/changelog/useSliceMachineVersions.ts +2 -2
  103. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +11 -14
  104. package/src/features/changes/PushChangesButton.tsx +5 -5
  105. package/src/features/changes/StatusBadge.tsx +2 -2
  106. package/src/features/customTypes/EditDropdown.tsx +6 -9
  107. package/src/features/customTypes/PageTypeOnboarding.tsx +5 -5
  108. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +11 -12
  109. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +11 -10
  110. package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -4
  111. package/src/features/customTypes/actions/createCustomType.ts +5 -5
  112. package/src/features/customTypes/actions/deleteCustomType.ts +3 -3
  113. package/src/features/customTypes/actions/renameCustomType.ts +3 -3
  114. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -8
  115. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +17 -12
  116. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css +8 -0
  117. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css.d.ts +5 -0
  118. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +8 -8
  119. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +3 -3
  120. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +1 -1
  121. package/src/features/customTypes/customTypesConfig.ts +2 -2
  122. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +16 -16
  123. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +9 -9
  124. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +8 -8
  125. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css +11 -0
  126. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css.d.ts +6 -0
  127. package/src/features/documentation/MarkdownRenderer/index.tsx +6 -7
  128. package/src/features/documentation/useDocumentation.ts +1 -1
  129. package/src/features/environments/actions/getActiveEnvironment.ts +1 -1
  130. package/src/features/environments/actions/getEnvironments.ts +1 -1
  131. package/src/features/environments/actions/setEnvironment.ts +3 -3
  132. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -2
  133. package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -4
  134. package/src/features/inAppGuide/inAppGuideContent.tsx +4 -4
  135. package/src/features/labs/labsList/LabsList.tsx +2 -2
  136. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  137. package/src/features/labs/labsList/LabsPage.tsx +5 -5
  138. package/src/features/labs/labsList/useLab.tsx +1 -1
  139. package/src/features/settings/SettingsPage.tsx +4 -4
  140. package/src/features/settings/git/ConnectGitRepository.tsx +9 -9
  141. package/src/features/settings/git/GitOwnerSelect.tsx +1 -1
  142. package/src/features/settings/git/GitProvider.ts +4 -4
  143. package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -1
  144. package/src/features/settings/git/GitRepositoriesList.tsx +5 -5
  145. package/src/features/settings/git/GitRepositoriesSearch.tsx +5 -5
  146. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +5 -8
  147. package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
  148. package/src/features/settings/git/useGitOwners.ts +1 -1
  149. package/src/features/settings/git/useGitRepos.ts +1 -1
  150. package/src/features/settings/git/useLinkedGitRepos.ts +2 -2
  151. package/src/features/settings/git/useWriteAPIToken.ts +2 -2
  152. package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -2
  153. package/src/features/slices/actions/createSlice.ts +5 -5
  154. package/src/features/slices/actions/deleteSlice.ts +1 -1
  155. package/src/features/slices/actions/renameSlice.ts +4 -4
  156. package/src/features/slices/actions/uploadSliceScreenshot.ts +2 -2
  157. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +10 -10
  158. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +7 -7
  159. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css +14 -0
  160. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css.d.ts +6 -0
  161. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +12 -12
  162. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +5 -8
  163. package/src/features/slices/convertLegacySlice/types.ts +2 -2
  164. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +6 -6
  165. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -9
  166. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +4 -4
  167. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +3 -3
  168. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +4 -4
  169. package/src/features/slices/sliceCards/SharedSliceCard.tsx +7 -7
  170. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -2
  171. package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
  172. package/src/features/sync/AutoSyncProvider.tsx +17 -17
  173. package/src/features/sync/actions/pushChanges.ts +4 -3
  174. package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
  175. package/src/features/sync/components/AutoSyncStatusIndicator.module.css +1 -1
  176. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -4
  177. package/src/features/sync/fetchUnSyncChanges.ts +5 -5
  178. package/src/features/sync/getUnSyncChanges.ts +9 -9
  179. package/src/features/sync/useUnSyncChanges.ts +5 -5
  180. package/src/hooks/useActionQueue.tsx +5 -5
  181. package/src/hooks/useAdapterName.ts +1 -1
  182. package/src/hooks/useAuthStatus.ts +2 -2
  183. package/src/hooks/useCurrentSlice.tsx +4 -4
  184. package/src/hooks/useEditorContent.ts +5 -4
  185. package/src/hooks/useExperimentVariant.ts +2 -2
  186. package/src/hooks/useIsEmptyProject.ts +1 -1
  187. package/src/hooks/useRepositoryInformation.ts +2 -2
  188. package/src/hooks/useRouteChange.tsx +1 -1
  189. package/src/hooks/useSMTracker.ts +6 -6
  190. package/src/hooks/useScreenshotChangesModal.ts +5 -4
  191. package/src/hooks/useServerState.ts +4 -4
  192. package/src/hooks/useSliceMachineConfig.ts +2 -2
  193. package/src/hooks/useSliceMachineRunningVersion.ts +1 -1
  194. package/src/hooks/useThrottle.ts +1 -1
  195. package/src/hooks/useUpdateAvailable.ts +1 -1
  196. package/src/hooks/useWindowDimensions.ts +1 -1
  197. package/src/hooks/useWindowSize.ts +2 -1
  198. package/{components → src/legacy/components}/App/index.tsx +8 -8
  199. package/{components → src/legacy/components}/AppLayout/index.tsx +5 -6
  200. package/{components → src/legacy/components}/AuthInstructions/index.jsx +1 -1
  201. package/{components → src/legacy/components}/Button/index.tsx +1 -2
  202. package/{components → src/legacy/components}/Card/Default.jsx +2 -1
  203. package/{components → src/legacy/components}/Card/Preview.jsx +1 -1
  204. package/{components → src/legacy/components}/Card/WithTabs/index.jsx +4 -3
  205. package/{components → src/legacy/components}/Card/index.tsx +1 -0
  206. package/{components → src/legacy/components}/Changelog/index.tsx +8 -8
  207. package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +2 -1
  208. package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +1 -0
  209. package/{components → src/legacy/components}/Changelog/navigation/index.tsx +6 -6
  210. package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +6 -6
  211. package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
  212. package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +5 -5
  213. package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +5 -5
  214. package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -14
  215. package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -3
  216. package/{components → src/legacy/components}/CodeBlock/index.tsx +3 -3
  217. package/{components → src/legacy/components}/ConfigErrors/index.jsx +4 -3
  218. package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +9 -8
  219. package/{components → src/legacy/components}/DeleteCTModal/index.tsx +9 -9
  220. package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +4 -4
  221. package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +9 -9
  222. package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +9 -8
  223. package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +6 -6
  224. package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -6
  225. package/{components → src/legacy/components}/DropDownSelector/index.tsx +2 -4
  226. package/{components → src/legacy/components}/EmptyState/index.tsx +3 -3
  227. package/{components → src/legacy/components}/FormFields/Array.jsx +2 -4
  228. package/{components → src/legacy/components}/FormFields/Checkbox.jsx +1 -1
  229. package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +1 -1
  230. package/{components → src/legacy/components}/FormFields/Input.tsx +3 -2
  231. package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +1 -1
  232. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +18 -18
  233. package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +10 -10
  234. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +12 -12
  235. package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +8 -8
  236. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css +5 -0
  237. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
  238. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +7 -7
  239. package/{components → src/legacy/components}/Forms/components/InputBox.tsx +2 -2
  240. package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +4 -3
  241. package/{components → src/legacy/components}/Forms/formsValidator.ts +6 -4
  242. package/{components → src/legacy/components}/FullPage/index.tsx +1 -1
  243. package/{components → src/legacy/components}/ListItem/Header.tsx +3 -2
  244. package/{components → src/legacy/components}/ListItem/index.tsx +8 -10
  245. package/{components → src/legacy/components}/LoadingPage/index.tsx +1 -0
  246. package/{components → src/legacy/components}/LoginModal/index.tsx +22 -22
  247. package/{components → src/legacy/components}/ModalFormCard/index.tsx +7 -6
  248. package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +18 -16
  249. package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -13
  250. package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +2 -2
  251. package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -3
  252. package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
  253. package/{components → src/legacy/components}/Navigation/VideoItem.tsx +14 -13
  254. package/src/legacy/components/Navigation/index.module.css +3 -0
  255. package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
  256. package/{components → src/legacy/components}/Navigation/index.test.tsx +12 -12
  257. package/{components → src/legacy/components}/Navigation/index.tsx +20 -21
  258. package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +12 -12
  259. package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +6 -6
  260. package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +7 -7
  261. package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +12 -15
  262. package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -1
  263. package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
  264. package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +3 -3
  265. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
  266. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +4 -5
  267. package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -7
  268. package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -4
  269. package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
  270. package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +4 -5
  271. package/{components → src/legacy/components}/Simulator/index.tsx +25 -30
  272. package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +3 -2
  273. package/{components → src/legacy/components}/ToasterContainer/index.tsx +3 -5
  274. package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -2
  275. package/{components → src/legacy/components}/Tooltip/index.jsx +2 -2
  276. package/{components → src/legacy/components}/Warnings/index.jsx +1 -1
  277. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -4
  278. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +8 -8
  279. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +11 -11
  280. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -3
  281. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
  282. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -23
  283. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
  284. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
  285. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
  286. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +2 -2
  287. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +3 -2
  288. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +34 -32
  289. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +5 -5
  290. package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +43 -52
  291. package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +12 -11
  292. package/{lib/builders/SliceBuilder/Sidebar → src/legacy/lib/builders/SliceBuilder/VariationsList}/AddVariationModal.tsx +7 -7
  293. package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css +10 -0
  294. package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css.d.ts +5 -0
  295. package/src/legacy/lib/builders/SliceBuilder/VariationsList/index.tsx +253 -0
  296. package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +18 -13
  297. package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +3 -5
  298. package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +1 -1
  299. package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +14 -16
  300. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +3 -4
  301. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -2
  302. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -5
  303. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
  304. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +16 -13
  305. package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +15 -9
  306. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css +12 -0
  307. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css.d.ts +5 -0
  308. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +39 -0
  309. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/index.tsx +1 -0
  310. package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +37 -19
  311. package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
  312. package/{lib → src/legacy/lib}/forms/fields.ts +1 -2
  313. package/{lib → src/legacy/lib}/forms/index.ts +1 -0
  314. package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +5 -4
  315. package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +2 -1
  316. package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +3 -2
  317. package/{lib → src/legacy/lib}/models/common/Environment.ts +2 -2
  318. package/{lib → src/legacy/lib}/models/common/Group.ts +3 -2
  319. package/{lib → src/legacy/lib}/models/common/Library.ts +2 -1
  320. package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +1 -1
  321. package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
  322. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
  323. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +2 -1
  324. package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +10 -9
  325. package/{lib → src/legacy/lib}/models/common/Slice.ts +19 -5
  326. package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
  327. package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +3 -2
  328. package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +5 -7
  329. package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +2 -3
  330. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +9 -10
  331. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +7 -7
  332. package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +2 -3
  333. package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -6
  334. package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +63 -76
  335. package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +6 -4
  336. package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +9 -11
  337. package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +6 -5
  338. package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +3 -5
  339. package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -7
  340. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -6
  341. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +4 -4
  342. package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +7 -7
  343. package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +3 -6
  344. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +12 -11
  345. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +3 -6
  346. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +2 -2
  347. package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +4 -5
  348. package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +4 -5
  349. package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +3 -1
  350. package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
  351. package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
  352. package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
  353. package/{lib → src/legacy/lib}/models/server/ServerState.ts +4 -3
  354. package/{lib → src/legacy/lib}/utils/index.ts +4 -5
  355. package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
  356. package/src/modules/availableCustomTypes/index.ts +15 -13
  357. package/src/modules/availableCustomTypes/types.ts +2 -2
  358. package/src/modules/environment/index.ts +10 -8
  359. package/src/modules/environment/types.ts +1 -1
  360. package/src/modules/loading/index.ts +3 -2
  361. package/src/modules/modal/index.ts +4 -2
  362. package/src/modules/slices/index.ts +13 -9
  363. package/src/modules/slices/selector.ts +1 -1
  364. package/src/modules/slices/types.ts +2 -2
  365. package/src/modules/useSliceMachineActions.ts +25 -20
  366. package/src/modules/userContext/index.ts +5 -3
  367. package/{pages → src/pages}/_app.tsx +23 -25
  368. package/{pages → src/pages}/changelog.tsx +1 -1
  369. package/{pages → src/pages}/changes.tsx +22 -19
  370. package/src/pages/custom-types/[customTypeId].tsx +1 -0
  371. package/{pages → src/pages}/custom-types.tsx +1 -1
  372. package/{pages → src/pages}/index.tsx +3 -3
  373. package/src/pages/labs.tsx +1 -0
  374. package/src/pages/page-types/[pageTypeId].tsx +1 -0
  375. package/src/pages/settings.tsx +1 -0
  376. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +3 -3
  377. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -2
  378. package/{pages → src/pages}/slices.tsx +21 -21
  379. package/src/redux/reducer.ts +8 -7
  380. package/src/redux/store.ts +8 -6
  381. package/src/redux/type.ts +7 -6
  382. package/src/theme.ts +1 -2
  383. package/src/utils/getContentTypeForTracking.ts +21 -0
  384. package/test/__setup__.ts +10 -8
  385. package/test/__testutils__/createTestPlugin.ts +3 -2
  386. package/test/__testutils__/createTestProject.ts +5 -4
  387. package/test/__testutils__/index.tsx +6 -5
  388. package/test/__testutils__/mockAWSACLAPI.ts +1 -1
  389. package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
  390. package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
  391. package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
  392. package/test/__testutils__/readMSWFormData.ts +1 -1
  393. package/test/components/IframeRenderer.test.ts +3 -2
  394. package/test/lib/builders/EditModal.test.tsx +5 -3
  395. package/test/lib/builders/buildersUtils.test.ts +3 -3
  396. package/test/lib/consts.test.ts +6 -2
  397. package/test/lib/models/common/CustomType.test.ts +6 -2
  398. package/test/lib/models/common/ModelStatus.test.ts +6 -4
  399. package/test/lib/models/common/Slice.test.ts +3 -2
  400. package/test/lib/models/common/widgets/index.test.ts +8 -4
  401. package/test/lib/utils/index.test.ts +3 -2
  402. package/test/lib/utils/preferWroomBase.test.ts +3 -2
  403. package/test/lib/utils/shared/customTypes.test.ts +2 -1
  404. package/test/pages/slices.test.tsx +10 -10
  405. package/test/src/modules/__fixtures__/serverState.ts +3 -3
  406. package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
  407. package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
  408. package/test/src/modules/environment.test.ts +3 -5
  409. package/test/src/modules/loading.test.ts +3 -3
  410. package/test/src/modules/modal.test.ts +5 -5
  411. package/test/src/modules/slices.test.ts +3 -2
  412. package/test/src/modules/userContext.test.ts +3 -3
  413. package/test/src/normalizers/customType.test.ts +16 -3
  414. package/test/src/utils/fieldNameCreator.test.ts +1 -1
  415. package/tsconfig.json +1 -6
  416. package/vite.config.ts +5 -10
  417. package/components/Forms/RenameVariationModal/RenameVariationModal.css.ts +0 -7
  418. package/components/Navigation/index.css.ts +0 -5
  419. package/lib/builders/SliceBuilder/Sidebar/index.tsx +0 -157
  420. package/lib/builders/common/Zone/components/EmptyState/index.tsx +0 -33
  421. package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
  422. package/lib/models/common/widgets/withGroup.ts +0 -20
  423. package/out/_next/static/DDGXqSbSEqwX8wX_VNauB/_buildManifest.js +0 -1
  424. package/out/_next/static/chunks/18539003-a5a5d48f20a7b261.js +0 -97
  425. package/out/_next/static/chunks/25-792af14760d9df34.js +0 -1
  426. package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
  427. package/out/_next/static/chunks/318-77a29f41c3a027e3.js +0 -1
  428. package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
  429. package/out/_next/static/chunks/727-7536690b0938f88f.js +0 -1
  430. package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
  431. package/out/_next/static/chunks/904-cac58924044acc83.js +0 -1
  432. package/out/_next/static/chunks/pages/_app-07e1633e9adb1796.js +0 -436
  433. package/out/_next/static/chunks/pages/changelog-4cee9fbfd4fdfc70.js +0 -1
  434. package/out/_next/static/chunks/pages/changes-b1d7cb1c845848ee.js +0 -1
  435. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-d1a4a07e6b600fa6.js +0 -1
  436. package/out/_next/static/chunks/pages/labs-566a982a3e954547.js +0 -1
  437. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-a724ff12ef322020.js +0 -1
  438. package/out/_next/static/chunks/pages/settings-6c2777758905c784.js +0 -1
  439. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
  440. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-a32fd588b27e92d7.js +0 -1
  441. package/out/_next/static/chunks/pages/slices-a633527fee62b6cd.js +0 -1
  442. package/out/_next/static/css/72465cc1225f28a2.css +0 -1
  443. package/out/_next/static/css/82840c077aa9a9d5.css +0 -1
  444. package/out/_next/static/css/838fd8bb5a7c32b0.css +0 -1
  445. package/out/_next/static/css/b22c0750c14cc089.css +0 -1
  446. package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
  447. package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
  448. package/pages/custom-types/[customTypeId].tsx +0 -1
  449. package/pages/labs.tsx +0 -1
  450. package/pages/page-types/[pageTypeId].tsx +0 -1
  451. package/pages/settings.tsx +0 -1
  452. package/src/components/BaseHoverCard/BaseHoverCard.css.ts +0 -25
  453. package/src/components/BlankSlate/BlankSlate.css.ts +0 -96
  454. package/src/components/Card/Card.css.ts +0 -188
  455. package/src/components/CodeBlock/CodeBlock.css.ts +0 -37
  456. package/src/components/ContentTabs/ContentTabs.css.ts +0 -49
  457. package/src/components/Divider/Divider.css.ts +0 -31
  458. package/src/components/HoverCard/HoverCard.css.ts +0 -105
  459. package/src/components/TextLink/TextLink.css.ts +0 -65
  460. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.css.ts +0 -12
  461. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.css.ts +0 -13
  462. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.css.ts +0 -15
  463. package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +0 -8
  464. package/out/_next/static/{DDGXqSbSEqwX8wX_VNauB → QWi-WrYk9EtyMIs1RfQ3_}/_ssgManifest.js +0 -0
  465. package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
  466. package/{components → src/legacy/components}/Card/WithTabs/components.jsx +1 -1
  467. package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
  468. package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +1 -1
  469. package/{components → src/legacy/components}/ChangesEmptyState/index.ts +1 -1
  470. package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +1 -1
  471. package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
  472. package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
  473. package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
  474. package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +1 -1
  475. package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
  476. package/{components → src/legacy/components}/Flex/index.tsx +0 -0
  477. package/{components → src/legacy/components}/FormFields/index.ts +0 -0
  478. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
  479. package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
  480. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
  481. package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
  482. package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
  483. package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
  484. package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
  485. package/{components → src/legacy/components}/Grid/index.tsx +0 -0
  486. package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +1 -1
  487. package/{components → src/legacy/components}/ItemHeader/index.tsx +1 -1
  488. package/{components → src/legacy/components}/Li/index.tsx +0 -0
  489. package/{components → src/legacy/components}/ListItem/utils.js +0 -0
  490. package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
  491. package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
  492. package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
  493. package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +1 -1
  494. package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
  495. package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +1 -1
  496. package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
  497. package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
  498. package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +1 -1
  499. package/{components → src/legacy/components}/SliceMachineModal/index.tsx +1 -1
  500. package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
  501. package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
  502. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
  503. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
  504. package/{lib → src/legacy/lib}/consts.ts +0 -0
  505. package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
  506. package/{lib → src/legacy/lib}/forms/defaults.ts +1 -1
  507. package/{lib → src/legacy/lib}/forms/types.ts +0 -0
  508. package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
  509. package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
  510. package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +1 -1
  511. package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +4 -4
  512. package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
  513. package/{lib → src/legacy/lib}/models/common/Fields.ts +1 -1
  514. package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
  515. package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
  516. package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
  517. package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
  518. package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
  519. package/{lib → src/legacy/lib}/models/common/Slices.ts +2 -2
  520. package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
  521. package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
  522. package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +2 -2
  523. package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +2 -2
  524. package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +3 -3
  525. package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +2 -2
  526. package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +5 -5
  527. package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
  528. package/{lib → src/legacy/lib}/models/common/widgets/index.ts +1 -1
  529. /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
  530. /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
  531. /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
  532. /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
  533. /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
  534. /package/{pages → src/pages}/api/embed.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{54132:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var o=t(62230),i=t(85244),r=t(98240),c=t(52322);t(2784);var d=t(75289),s=function(e){var n=e.bg,t=e.background,i=e.sx,r=e.withRadius,s=e.radius,a=e.children;return(0,c.jsx)(d.xu,{sx:(0,o.Z)({p:4,bg:n||t},r?{borderBottomLeftRadius:s,borderBottomRightRadius:s}:null,i),children:a})},a=function(e){var n=e.Header,t=void 0===n?null:n,a=e.SubHeader,l=void 0===a?null:a,u=e.Body,h=void 0===u?null:u,v=e.Footer,m=void 0===v?null:v,f=e.borderFooter,b=e.radius,_=void 0===b?"6px":b,p=e.bodySx,x=e.footerSx,g=e.sx,C=e.bg,j=e.background,Z=e.children,k=(0,r.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,c.jsxs)(d.Zb,(0,i.Z)((0,o.Z)({sx:(0,o.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:_},void 0===g?null:g)},k),{children:[t?(0,c.jsx)(t,{radius:_}):null,l?(0,c.jsx)(l,{radius:_}):null,(0,c.jsxs)(s,{bg:C,background:j,sx:void 0===p?{}:p,withRadius:!m,children:[h?(0,c.jsx)(h,{}):null,Z||null]}),m?(0,c.jsx)(s,{bg:C,background:j,sx:(0,o.Z)({},void 0!==f&&f?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===x?{}:x),radius:_,withRadius:!0,children:"object"==typeof m?m:(0,c.jsx)(m,{})}):null]}))}},75329:function(e,n,t){"use strict";t.d(n,{Sn:function(){return d},lS:function(){return o},nG:function(){return i},pq:function(){return s},rd:function(){return c},xo:function(){return r}});var o=["components"],i=["png","jpg","jpeg"],r=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,c="placeholders/What_are_Slices_mrvome",d="SM_HELP_VIDEOS/mock_data",s="slice-machine-simulator"},24804:function(e,n,t){"use strict";t.d(n,{Zb:function(){return b},T$:function(){return p},eW:function(){return x},ZB:function(){return _},Lm:function(){return g}});var o=t(67557),i=t(62230),r=t(85244),c=t(98240),d=t(52322),s=t(50002),a=t(22715),l=t(6277),u=t(2784);t(71457);var h={solid:"_1ecs97d3c _1ecs97dap _1ecs97d4pk _1ecs97d4wx",outlined:"_1ecs97d2i _1ecs97d9v _1ecs97dw _1ecs97d89 _1ecs97d2w _1ecs97da9 _1ecs97d4oq _1ecs97d4w3 _1ecs97d4oc _1ecs97d4vp"},v={div:"_1ecs97dez0 _1ecs97dez3 _1ecs97dezd",img:"kedahr9 _1ecs97df77 _1ecs97dezn"},m={small:"kedahr2",medium:"kedahr3"},f={solid:"kedahr4 _1ecs97d1u _1ecs97d97 _1ecs97d4pe _1ecs97d4wr",outlined:"kedahr5 _1ecs97d18 _1ecs97d8l _1ecs97d4o6 _1ecs97d4vj"},b=function(e){var n,t=e.checked,a=e.size,v=e.variant,b=void 0===v?"solid":v,_=(e.interactive,e.disabled,e.onClick,e.href,e.component),p=void 0===_?"a":_,x=(e.replace,(0,c.Z)(e,["checked","size","variant","interactive","disabled","onClick","href","component","replace"])),g=(0,r.Z)((0,i.Z)({},x),{className:(0,l.W)("_1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dez1 _1ecs97dezr _1ecs97dezv",m[void 0===a?"medium":a],f[b],(n={},(0,o.Z)(n,"kedahr6",e.interactive),(0,o.Z)(n,h[b],e.interactive),n)),"data-state":!0===(void 0!==t&&t)?"checked":void 0});return!0===e.interactive&&void 0===e.href?(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},g),{"data-disabled":!0===e.disabled?"":void 0,onClick:function(n){if(!0!==e.disabled&&void 0!==e.onClick){var t=n.target;(0,s.JY)(t)===n.currentTarget&&e.onClick(n)}},tabIndex:!0===e.disabled?void 0:0})):!0===e.interactive?(0,u.createElement)(p,(0,i.Z)((0,r.Z)((0,i.Z)({},g),{href:e.href,onClick:function(e){var n=e.target;(0,s.JY)(n)!==e.currentTarget&&e.preventDefault()}}),"a"===p?{}:{replace:e.replace})):(0,d.jsx)("div",(0,i.Z)({},g))},_=function(e){var n=e.className,t=e.component,o=void 0===t?"img":t,s=e.overlay,a=(0,c.Z)(e,["className","component","overlay"]);return(0,d.jsxs)("div",{className:"kedahr7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df7d _1ecs97dezv",children:[(0,u.createElement)(o,(0,r.Z)((0,i.Z)({},a),{className:(0,l.W)(v[o],n)})),Boolean(s)?(0,d.jsx)("div",{className:"kedahra _1ecs97dez0 _1ecs97dez3 _1ecs97df9d _1ecs97dezt _1ecs97df0i",children:s}):void 0]})},p=function(e){return(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"kedahrc kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df71 _1ecs97dezi"}))},x=function(e){var n=e.action,t=e.subtitle,o=e.title,s=(0,c.Z)(e,["action","subtitle","title"]);return(0,d.jsxs)("div",(0,r.Z)((0,i.Z)({},s),{className:"kedahrd kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df92 _1ecs97df73",children:[(0,d.jsxs)("div",{className:"kedahre _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df51",children:[(0,d.jsx)(a.xv,{component:"span",noWrap:!0,variant:"bold",children:o}),(0,d.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",children:t})]}),n]}))},g=function(e){var n=e.children,t=(0,c.Z)(e,["children"]);return(0,d.jsx)("div",(0,r.Z)((0,i.Z)({},t),{className:"kedahrf _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97df6v _1ecs97dfb5 _1ecs97dezh _1ecs97dfhi _1ecs97dezt",children:(0,d.jsx)(a.xv,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:n})}))}},34728:function(e,n,t){"use strict";t.d(n,{O:function(){return d}});var o=t(52322),i=t(22715),r=t(32681),c=t(79096),d=function(e){var n=function(e){var n=s[e.modelType];switch(e.modelStatus){case r.GJ.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(n," exists only locally. Upon sync, it will be pushed to your remote repository.")};case r.GJ.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(n," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case r.GJ.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(n," is in sync with the remote repository.")};case r.GJ.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(n," has been deleted locally.")};case r.GJ.Unknown:if(!e.isOnline)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (no internet connection)."};if(e.authStatus===c.t.UNAUTHORIZED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};if(e.authStatus===c.t.FORBIDDEN)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (you don't have access to the repository)."};default:return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (unknown error)."}}}(e),t=n.badgeColor,d=n.badgeTitle,a=n.tooltipContent;return(0,o.jsx)(i.u,{content:a,side:"bottom",children:(0,o.jsx)(i.Ct,{color:t,title:d})})},s={CustomType:"type",Slice:"slice"}},71749:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var o=t(62230),i=t(85244),r=t(52322),c=t(22715),d=t(39097),s=t.n(d),a=t(67557),l=t(17064),u={build:function(e){var n;return(0,i.Z)((0,o.Z)({},e),{screenshots:(n=e.screenshots)?Object.entries(n).reduce(function(e,n){var t,r=(0,l.Z)(n,2),c=r[0],d=r[1];return d.hash?(0,i.Z)((0,o.Z)({},e),(0,a.Z)({},c,(0,o.Z)({},d,{hash:d.hash}))):e},{}):{}})},variation:function(e,n){if(e.model.variations.length)return n?e.model.variations.find(function(e){return e.id===n}):e.model.variations[0]}},h=t(24804),v=t(5479),m=t(34728),f=t(49451),b=function(e){return(0,r.jsx)("svg",(0,i.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.5C4 4.67157 4.67157 4 5.5 4H18.5C19.3284 4 20 4.67157 20 5.5V12.4413C20 12.4512 19.9997 12.461 19.9991 12.4707C20.0072 12.6083 19.9586 12.7485 19.8536 12.8536C19.6583 13.0488 19.3417 13.0488 19.1464 12.8536L16.3536 10.0607C16.1583 9.8654 15.8417 9.8654 15.6464 10.0607L11.8536 13.8536C11.6583 14.0488 11.3417 14.0488 11.1464 13.8536L9.35355 12.0607C9.15829 11.8654 8.84171 11.8654 8.64645 12.0607L5 15.7071V18.5C5 18.7761 5.22386 19 5.5 19H12.5C12.7761 19 13 19.2239 13 19.5C13 19.7761 12.7761 20 12.5 20H5.5C4.67157 20 4 19.3284 4 18.5V15.5003V15.4997V5.5ZM11.5 12.7929L14.9393 9.35355C15.5251 8.76777 16.4749 8.76777 17.0607 9.35355L19 11.2929V5.5C19 5.22386 18.7761 5 18.5 5H5.5C5.22386 5 5 5.22386 5 5.5V14.2929L7.93934 11.3536C8.52513 10.7678 9.47487 10.7678 10.0607 11.3536L11.5 12.7929ZM16.5 13C16.7761 13 17 13.2239 17 13.5V16H19.5C19.7761 16 20 16.2239 20 16.5C20 16.7761 19.7761 17 19.5 17H17V19.5C17 19.7761 16.7761 20 16.5 20C16.2239 20 16 19.7761 16 19.5V17H13.5C13.2239 17 13 16.7761 13 16.5C13 16.2239 13.2239 16 13.5 16H16V13.5C16 13.2239 16.2239 13 16.5 13Z",fill:"currentColor"})}))},_=function(e){var n,t=e.action,d=e.isComingSoon,a=void 0!==d&&d,l=e.isDeleted,_=e.onUpdateScreenshot,g=e.selected,C=void 0!==g&&g,j=e.slice,Z=e.variant,k=e.variationId,y=u.variation(j,k);if(!y)return null;var z=(0,v.d7)(j,y),S=a||void 0!==l&&l,w=!S&&!!_,T="outlined"===Z,N=void 0!==k;return n="selection"===e.mode?{disabled:S,interactive:!0,onClick:function(){e.onSelectedChange(!C)}}:S?{interactive:!1}:{component:s(),href:f.Y.getBuilderPagePathname({libraryName:j.href,sliceName:j.model.name,variationId:y.id}),interactive:!0,replace:e.replace},(0,r.jsxs)(h.Zb,(0,i.Z)((0,o.Z)({"aria-label":"".concat(j.model.name," ").concat(y.name," slice card"),checked:C,"data-testid":"shared-slice-card"},n,"outlined"===Z?{size:"small",variant:"outlined"}:{}),{children:[void 0!==z?(0,r.jsx)(h.ZB,{alt:"Preview image",overlay:w&&!T?(0,r.jsx)(c.xu,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(p,{onClick:_})}):void 0,src:z}):(0,r.jsx)(h.ZB,{component:"div",children:(0,r.jsxs)(c.xu,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,r.jsx)(c.xv,{color:"grey11",component:"span",children:"No screenshot available"}),w&&!T?(0,r.jsx)(p,{onClick:_}):void 0]})}),(0,r.jsx)(h.eW,{action:"checkbox"===t.type&&"selection"===e.mode?(0,r.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(c.XZ,{checked:C,disabled:S,onCheckedChange:e.onSelectedChange})}):"menu"===t.type?(0,r.jsxs)(c.h_,{modal:!0,children:[(0,r.jsx)(c.$F,{disabled:S,children:(0,r.jsx)(c.hU,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,r.jsxs)(c.AW,{align:"end","data-testid":"slice-action-icon-dropdown",children:[w&&T?(0,r.jsx)(c.Xi,{onSelect:_,startIcon:(0,r.jsx)(b,{}),children:"Update screenshot"}):void 0,(0,r.jsx)(c.Xi,{onSelect:t.onRename,startIcon:(0,r.jsx)(c.I5,{name:"edit"}),children:"Rename"}),!0===t.removeDisabled&&N?(0,r.jsx)(c.u,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,r.jsx)(x,{disabled:!0,onSelect:t.onRemove})}):(0,r.jsx)(x,{disabled:!0===t.removeDisabled,onSelect:t.onRemove})]})]}):"remove"===t.type?(0,r.jsx)(c.hU,{icon:"close",onClick:function(){return!S&&t.onRemove()},hiddenLabel:"Remove slice"}):"status"===t.type?(0,r.jsx)(m.O,{authStatus:t.authStatus,isOnline:t.isOnline,modelStatus:t.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,r.jsxs)(r.Fragment,{children:[N?y.id:"".concat(j.model.variations.length," variation").concat(j.model.variations.length>1?"s":""),a?(0,r.jsxs)(c.xv,{color:"purple11",component:"span",variant:"small",children:[" ","• (coming soon)"]}):void 0]}),title:N?y.name:j.model.name}),w&&!N&&(0,v.cx)(j)>0?(0,r.jsx)(h.Lm,{children:"Missing screenshot"}):void 0]}))},p=function(e){return(0,r.jsx)(c.zx,{onClick:e.onClick,renderStartIcon:function(){return(0,r.jsx)(b,{color:c.TV.color.greyLight11})},color:"grey",children:"Update screenshot"})},x=function(e){return(0,r.jsx)(c.Xi,(0,i.Z)((0,o.Z)({},e),{color:"tomato",startIcon:(0,r.jsx)(c.I5,{name:"delete"}),children:"Delete"}))}},49451:function(e,n,t){"use strict";t.d(n,{Y:function(){return o}});var o={getBuilderPagePathname:function(e){return"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}}},71457:function(){}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[286],{15836:function(e,n,r){"use strict";r.d(n,{Z:function(){return L}});var i,t=r(62230),s=r(85244),o=r(52322),a=r(2784),l=r(56580),c=r(75289),u=r(54132),d=r(951),x=r(75100),p=r(25812),h=r(77174),f=r(24340),v=r(90374),g=r(22710),m=r(99267),j=r(76473),b=r(88932),y=r(75329),C=r(61931),F=r(67557),w=r(82770);function E(e){return I.apply(this,arguments)}function I(){return(I=(0,g.Z)(function(e){var n,r,i,o,a,l,c,u,d,x;return(0,m.__generator)(this,function(p){switch(p.label){case 0:n=e.variationId,r=e.slice,i=e.file,o=e.method,p.label=1;case 1:return p.trys.push([1,3,,4]),(a=new FormData).append("file",i),a.append("libraryName",r.from),a.append("sliceName",r.model.name),a.append("variationId",n),[4,(0,w.XQ)({libraryName:r.from,sliceId:r.model.id,variationId:n,file:i})];case 2:if(c=(l=p.sent()).errors,u=l.url,c.length>0)throw c;return w.Xe.track({event:"screenshot-taken",type:"custom",method:o}),[2,(0,s.Z)((0,t.Z)({},r),{screenshots:(0,s.Z)((0,t.Z)({},r.screenshots),(0,F.Z)({},n,{url:u}))})];case 3:return d=p.sent(),x="Screenshot not saved",console.error(x,d),b.Am.error(x),[3,4];case 4:return[2]}})})).apply(this,arguments)}var S,D=function(e){var n=e.inputFile,r=e.handleFile,i=e.children,t=e.isDragActive;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.__,{htmlFor:"input-file",variant:"buttons.white",sx:{p:2,px:0,display:"flex",justifyContent:"center",width:200,alignItems:"center",flex:1},children:i||"Select file"}),(0,o.jsx)("input",{id:"input-file",type:"file",ref:n,style:{display:"none"},accept:y.nG.map(function(e){return"image/".concat(e)}).join(","),onChange:function(e){var n;r(null===(n=e.target.files)||void 0===n?void 0:n[0],t)}})]})},k=function(){return(0,o.jsx)(c.kC,{variant:"boxes.centered",sx:{p:2,position:"absolute",height:"100%",width:"100%",background:"rgba(249, 248, 249, 0.7)",backdropFilter:"blur(5px)",zIndex:"1",pointerEvents:"none"},children:(0,o.jsxs)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,o.jsx)(Z,{isActive:!0}),(0,o.jsx)(c.xv,{sx:{my:2},children:"Drop file here"}),(0,o.jsx)(c.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})})},Z=function(e){var n=e.isActive;return(0,o.jsx)(c.kC,{sx:{p:1,borderRadius:"50%",bg:n?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,o.jsx)(d.IEK,{style:{color:n?"#6E56CF":"#6F6E77",fontSize:"34px"}})})},_=function(e){var n,r,i,l,u,d,x=e.variationID,p=e.slice,h=e.imageTypes,f=void 0===h?y.nG:h,F=e.onUploadSuccess,w=p.screenshots[x],I=(0,v.Z)().saveSliceCustomScreenshotSuccess,S=(0,a.useState)(!1),_=S[0],M=S[1],R=(0,a.useState)(!1),H=R[0],A=R[1],z=(0,a.useState)(!1),O=z[0],V=z[1];(0,j.y1)(["meta+v","ctrl+v"],function(){q()},[x,p,]);var P,B,L=(i=(r={onHandleFile:(n=(0,g.Z)(function(e,n){var r,i;return(0,m.__generator)(this,function(t){switch(t.label){case 0:return V(!0),[4,E({slice:p,file:e,method:n?"dragAndDrop":"upload",variationId:x})];case 1:return r=t.sent(),A(!1),(i=null==r?void 0:r.screenshots[x])&&(I(x,i,r),F&&F(r)),V(!1),[2]}})}),function(e,r){return n.apply(this,arguments)})}).onHandleFile,l=(0,a.useRef)(null),u=(0,g.Z)(function(e,n){return(0,m.__generator)(this,function(r){switch(r.label){case 0:if(!e)return[3,2];return[4,i(e,n)];case 1:r.sent(),(null==l?void 0:l.current)&&(l.current.value=""),r.label=2;case 2:return[2]}})}),{handleFile:d=function(e,n){return u.apply(this,arguments)},inputFile:l,FileInputRenderer:D,fileInputProps:{inputFile:l,handleFile:d}}),N=L.FileInputRenderer,T=L.fileInputProps,U=(P=(0,g.Z)(function(e){var n,r;return(0,m.__generator)(this,function(i){switch(i.label){case 0:if(e.size>128e6)return[2,b.Am.error("File is too big. Max file size: 128Mb.")];return V(!0),[4,E({slice:p,file:e,method:"dragAndDrop",variationId:x})];case 1:return(r=null==(n=i.sent())?void 0:n.screenshots[x])&&(I(x,r,n),F&&F(n)),V(!1),[2]}})}),function(e){return P.apply(this,arguments)}),W="function"==typeof navigator.clipboard.read,q=(B=(0,g.Z)(function(){var e,n,r,i,t;return(0,m.__generator)(this,function(s){switch(s.label){case 0:if(!W)return[2];s.label=1;case 1:return s.trys.push([1,5,,6]),[4,navigator.clipboard.read()];case 2:if(!(void 0!==(e=s.sent())[0])||!(void 0!==(n=e[0].types.find(function(e){return f.map(function(e){return"image/".concat(e)}).includes(e)}))))return[3,4];return[4,e[0].getType(n)];case 3:return r=s.sent(),i=new File([r],"file"),[2,U(i)];case 4:return[3,6];case 5:return t=s.sent(),console.error("Could not paste file",t),[3,6];case 6:return[2]}})}),function(){return B.apply(this,arguments)}),G=function(e){e.preventDefault(),M(!1);var n,r=null===(n=e.dataTransfer.files)||void 0===n?void 0:n[0];if(void 0!==r)return f.some(function(e){return"image/".concat(e)===r.type})?void U(r):b.Am.error("Only files of type ".concat(f.join(", ")," are accepted."))},X=function(e){return function(n){n.preventDefault(),M(e)}},K=function(e){return function(n){n.preventDefault(),A(e)}};return(0,o.jsxs)(c.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:X(!0),onDragLeave:X(!1),onDragOver:X(!0),onMouseEnter:K(!0),onMouseLeave:K(!1),onSubmit:function(e){return e.preventDefault()},onDrop:G,children:[O?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.$j,{}),(0,o.jsx)(c.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,O||void 0===w?null:(0,o.jsx)(C.q,{src:w.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),O?null:(0,o.jsx)(c.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:H||void 0===w?"visible":"hidden"},children:(0,o.jsx)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,o.jsxs)(c.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,o.jsx)(Z,{isActive:_}),(0,o.jsx)(c.xv,{sx:{my:2},children:W?"Paste, drop or ...":"Drop or ..."}),(0,o.jsx)(N,(0,s.Z)((0,t.Z)({},T),{isDragActive:_})),(0,o.jsx)(c.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),_?(0,o.jsx)(k,{}):null]})},M=function(e){return(0,o.jsxs)("svg",(0,s.Z)((0,t.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,o.jsx)("path",{d:"M9.66862 19.9993C11.1406 19.9993 12.3353 18.8047 12.3353 17.3327V14.666H9.66862C8.19662 14.666 7.00195 15.8607 7.00195 17.3327C7.00195 18.8047 8.19662 19.9993 9.66862 19.9993Z",fill:"#0ACF83"}),(0,o.jsx)("path",{d:"M7.00195 12.0007C7.00195 10.5287 8.19662 9.33398 9.66862 9.33398H12.3353V14.6673H9.66862C8.19662 14.6673 7.00195 13.4727 7.00195 12.0007Z",fill:"#A259FF"}),(0,o.jsx)("path",{d:"M7.00195 6.66667C7.00195 5.19467 8.19662 4 9.66862 4H12.3353V9.33333H9.66862C8.19662 9.33333 7.00195 8.13867 7.00195 6.66667Z",fill:"#F24E1E"}),(0,o.jsx)("path",{d:"M12.334 4H15.0007C16.4727 4 17.6673 5.19467 17.6673 6.66667C17.6673 8.13867 16.4727 9.33333 15.0007 9.33333H12.334V4Z",fill:"#FF7262"}),(0,o.jsx)("path",{d:"M17.6673 12.0007C17.6673 13.4727 16.4727 14.6673 15.0007 14.6673C13.5287 14.6673 12.334 13.4727 12.334 12.0007C12.334 10.5287 13.5287 9.33398 15.0007 9.33398C16.4727 9.33398 17.6673 10.5287 17.6673 12.0007Z",fill:"#1ABCFE"})]}),(0,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,o.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]}))};(S=i||(i={})).Mac="Mac",S.Linux="Linux",S.Windows="Windows";var R=function(){var e=navigator.userAgent,n=i.Linux;return Object.values(i).forEach(function(r){e.includes(r)&&(n=r)}),n},H=r(36416),A=r.n(H),z=function(e){var n=e.children;return(0,o.jsx)("kbd",{className:A().root,children:n})},O=function(){var e,n=[i.Windows,i.Linux].includes(R())?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(z,{children:"ctrl"})," + ",(0,o.jsx)(z,{children:"shift"})," + ",(0,o.jsx)(z,{children:"c"})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(z,{children:"cmd"})," + ",(0,o.jsx)(z,{children:"shift"})," + ",(0,o.jsx)(z,{children:"c"})]});return(0,o.jsxs)(c.kC,{sx:{pl:"4px",alignItems:"center",color:"#000",borderRadius:"6px",fontSize:"12px",lineHeight:"24px",border:"1px solid #E4E2E4",boxShadow:"0px 1px 0px 0px rgba(0, 0, 0, 0.04)",width:"100%",minHeight:"40px"},children:[(0,o.jsx)(M,{}),(0,o.jsxs)("div",{children:["Use\xa0",n," to copy any frame as .png, then just paste it here"]})]})},V=function(e){var n=e.isValid;return(0,o.jsx)(c.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:n?(0,o.jsx)(d.Ypm,{style:{fontSize:"16px"}}):(0,o.jsx)(x.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},P=function(e){var n=e.slice,r=e.onSelectVariation,i=e.variationSelector;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.model.name}),(0,o.jsx)(c.xu,{children:(0,o.jsx)(c.xu,{as:"ul",sx:{pl:0,my:3},children:n.model.variations.map(function(e){var a=i.sliceID,l=i.variationID,u=a===n.model.id&&l===e.id;return(0,o.jsx)(c.xu,{as:"li",sx:(0,s.Z)((0,t.Z)({listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px"},u&&{bg:"#EDECEE",fontWeight:"500"}),{":hover":{bg:"#EDECEE"}}),onClick:function(){return r({sliceID:n.model.id,variationID:e.id})},children:(0,o.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,o.jsx)(V,{isValid:!!n.screenshots[e.id]}),(0,o.jsx)(c.xv,{sx:{ml:2},children:e.name})]})},"".concat(n.model.id,"-").concat(e.id))})})})]})},B=function(e,n){return e||(n.length?{sliceID:n[0].model.id,variationID:n[0].model.variations[0].id}:void 0)},L=function(e){var n=e.slices,r=e.defaultVariationSelector,i=e.onUploadSuccess,t=(0,v.Z)().closeModals,s=(0,l.v9)(function(e){return{isOpen:(0,h.gP)(e,f.q.SCREENSHOTS)}}).isOpen,d=(0,a.useState)(B(r,n)),x=d[0],g=d[1];if((0,a.useEffect)(function(){g(B(r,n))},[null==r?void 0:r.sliceID,null==r?void 0:r.variationID,s,]),0===n.length||!x)return null;var m,j="function"==typeof navigator.clipboard.read;return(0,o.jsx)(p.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return t()},children:(0,o.jsx)(u.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,background:"gray",p:"16px",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsx)(c.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,o.jsx)(c.x8,{type:"button",onClick:function(){return t()}})]})},Footer:null,children:(0,o.jsxs)(c.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,o.jsx)(c.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:n.map(function(e,n){return(0,o.jsx)(P,{slice:e,variationSelector:x,onSelectVariation:g},"".concat(e.model.id,"-").concat(n))})}),(0,o.jsxs)(c.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[j?(0,o.jsx)(O,{}):void 0,(m=n.find(function(e){return e.model.id===x.sliceID}))?(0,o.jsx)(_,{variationID:x.variationID,slice:m,onUploadSuccess:i}):null]})]})})})}},61931:function(e,n,r){"use strict";r.d(n,{q:function(){return c}});var i=r(62230),t=r(52322),s=r(2784),o=r(75289),a=r(65186),l=(0,s.memo)(function(e){var n=e.src;return(0,t.jsx)(o.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),c=function(e){var n=e.src,r=e.sx;return(0,t.jsx)(o.kC,{sx:(0,i.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},r),children:void 0!==n?(0,t.jsx)(l,{src:n}):(0,t.jsxs)(o.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,t.jsx)(a.eJU,{}),"You have no screenshot yet."]})})}},47731:function(e,n,r){"use strict";r.d(n,{H:function(){return s}});var i=r(2784),t=r(90374),s=function(){var e=(0,t.Z)().openScreenshotsModal,n=(0,i.useState)({sliceFilterFn:function(e){return e}}),r=n[0],s=n[1];return{modalPayload:r,onOpenModal:function(n){s(n),e()}}}},36416:function(e){e.exports={root:"Kbd_root__nBos2"}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[318],{39576:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322);t(2784);var o=t(59326),l=t(75289),a=t(61183),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};a.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],u=function(e){var n,t=e.children,s=e.lang,u=e.sx,d=e.codeStyle,f=e.codeClass,p=e.Header,x=(0,o.B7)().theme,m=s?a.Z.highlight(t,{language:"vue"===s?"html":s}).value:a.Z.highlightAuto(t,c).value;return(0,r.jsxs)(l.kC,{as:"pre",sx:u,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=x.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:m}})]})}},3026:function(e,n,t){"use strict";t.d(n,{J:function(){return c},k:function(){return s}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322);t(2784);var a=t(75289),s=function(e){var n=e.children,t=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},t)},s),{children:n}))},c=function(e){var n=e.children,t=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===t?2:t)-1,"%"),mb:1},children:n})}},59872:function(e,n,t){"use strict";t.d(n,{$w:function(){return i},Hq:function(){return d},tM:function(){return u}});var i,r=t(62230),o=t(85244),l=t(52322),a=t(63397);t(2784);var s,c=t(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var u=function(e){var n={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}});case i.WARNING:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}});default:return n}},d=function(e){var n=e.sx,t=e.field,s=e.meta,d=e.formField,f=e.fieldName,p=e.fields,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||d.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===n?{}:n,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[d.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:d.placeholder||d.label||f},d.fieldLevelValidation&&x?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,t),{as:c.II,sx:u(h),disabled:m||d.disabled}))]})}},34066:function(e,n,t){"use strict";t.d(n,{kp:function(){return c},sP:function(){return d},w8:function(){return f},Hq:function(){return p.Hq}});var i=t(62230),r=t(85244),o=t(52322),l=t(2784),a=t(63397),s=t(75289),c=function(e){var n=e.field,t=e.meta,c=e.fieldName,u=e.label,d=e.focusOnNewEntry,f=void 0===d||d,p=e.inputPlaceholder,x=e.buttonLabel,m=(0,l.useState)(t.value.length),h=m[0],v=m[1],g=(0,l.useRef)(Array(t.value.length));return(0,l.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,l.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(0,o.jsxs)(l.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[u,t.touched&&t.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:t.error}):null]}),(0,o.jsx)(a.F2,(0,r.Z)((0,i.Z)({name:c,id:c},n),{render:function(e){return(0,o.jsxs)("div",{children:[n.value&&n.value.length>0?n.value.map(function(n,t){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(t),value:n,ref:function(e){return g.current[t]=e},onChange:function(n){var i=n.target.value;return e.replace(t,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(t)},children:"-"})]},"".concat(c,"-").concat(+t+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(n.value.length,"")},children:x})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,l=e.fieldName,c=e.onChange,d=(0,u.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},d),{children:[(0,o.jsx)(a.gN,{as:s.XZ,type:"checkbox",name:l,onChange:function(){return c(!n.value)},checked:n.value}),t]}))},f=function(e){var n=e.field,t=e.label,i=e.defaultValue,r=e.onChange,a=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,l.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,l.useEffect)(function(){c?s(c(a,f)):s(c)},[f,a,c]),(0,o.jsx)(d,{meta:{value:f},fieldName:n.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof t?t(a,f):t})},p=t(59872)},71168:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(75289),c=(0,a.forwardRef)(function(e,n){var t=e.children,a=e.Component,c=void 0===a?s.kC:a,u=e.sx,d=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===u?{}:u),ref:n},d),{children:t}))});n.Z=c},28728:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(62230),r=t(85244),o=t(52322),l=t(2784),a=t(40023),s=t(5446),c=t(59326),u=t(75289),d=t(71168),f=t(39031),p=t(98240),x=t(33710),m=t(39295),h=function(e){var n=e.text,t=e.as,a=e.sx,s=(0,p.Z)(e,["text","as","sx"]),c=(0,l.useRef)(null),d=(0,l.useState)(null),f=d[0],h=d[1],v=function(){h(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,l.useEffect)(function(){return v(),window.addEventListener("resize",v),function(){window.removeEventListener("resize",v)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.xv,(0,r.Z)((0,i.Z)({"data-for":n,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===a?{}:a),as:t,ref:c},s),{children:n})),f&&(0,o.jsx)(m.X,{children:(0,o.jsx)(x.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},v=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(u.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(n=l.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=l.colors)||void 0===t?void 0:t.primary}}),(0,o.jsx)(h,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},g=t(951),b=t(8799),y=t(18978),j=function(e){var n=e.item,t=e.index,p=e.deleteItem,x=e.enterEditMode,m=e.modelFieldName,h=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,k=e.CustomEditElements,C=e.widget,S=e.draggableId,I=e.testId,F=e.isRepeatableCustomType,E=e.children,w=(0,c.B7)().theme,T=n.key,A=n.value,_=A.config,N=A.type;return(0,o.jsx)(l.Fragment,{children:(0,o.jsx)(a._l,{draggableId:S,index:t,children:function(e){var a,c,S,A,R;return(0,o.jsx)(l.Fragment,{children:(0,o.jsxs)(d.Z,(0,r.Z)((0,i.Z)({"data-testid":I,ref:e.innerRef},e.draggableProps),{Component:u.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(u.kC,{sx:{width:"100%"},children:[(0,o.jsx)(f.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:y.Fm7,color:null===(a=w.colors)||void 0===a?void 0:a.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(u.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(u.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(v,{theme:w,text:(null==_?void 0:_.label)||T,sliceFieldName:h&&h(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(u.kC,{children:[k||null,Z||(0,o.jsx)(f.Z,{size:22,Icon:g.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(c=w.colors)||void 0===c?void 0:c.icons},onClick:function(){return x([T,n.value],m,t)}}),!(!0===F&&"UID"==N)&&(0,o.jsxs)(s.v2,{children:[(0,o.jsx)(s.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(b.FQA,{size:20,color:null===(S=w.colors)||void 0===S?void 0:S.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(s.qy,{style:{background:null===(A=w.colors)||void 0===A?void 0:A.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(R=w.colors)||void 0===R?void 0:R.borders,outline:"0"},children:(0,o.jsx)(s.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return p(T)},children:"Delete field"})})]})]})]}),j||null]})]}),E]}))})}})})}},39031:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(75289),s=function(e,n){return n?{border:function(e){var n=e.colors;return"1px solid ".concat(n.error)}}:e?{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)}}:{border:function(e){var n=e.colors;return"1px solid ".concat(n.borders)}}},c=function(e){var n=e.sx,t=e.onClick,c=e.label,u=e.Icon,d=e.error,f=e.size,p=void 0===f?16:f,x=e.fitButton,m=e.active,h=e.useActive,v=e.activeSx,g=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===t?function(){return null}:t,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==m&&m,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},89853:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(2784),a=t(63397),s=t(34066),c=t(78610),u=t(75289),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,a.U$)(n),3),x=p[0],m=p[1],h=p[2],v=t.component;return(0,o.jsx)(u.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===c.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:m,field:x,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(l.Fragment,{children:[t.type===c.h.INPUT?(0,o.jsx)(s.Hq,{meta:m,field:x,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===c.h.CHECKBOX&&(0,o.jsx)(s.sP,{meta:m,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},4092:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(25812),u=t(59326),d=t(75289),f=t(65413),p=t(83239),x=t(60113),m=t(2784),h=t(92928),v=t(98240),g=function(e){var n=e.children,t=(0,v.Z)(e,["children"]);return(0,l.jsx)(d.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},t),{children:n}))};g.tabsRole="TabList";var b=function(e){var n=e.children,t=(0,v.Z)(e,["children"]),o=(0,u.B7)().theme;return(0,l.jsx)(h.OK,(0,r.Z)((0,i.Z)({},t),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},t.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:n}))};b.tabsRole="Tab";var y=t(54132),j=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,u=void 0===c?0:c,f=(0,m.useState)(u),p=f[0],x=f[1];return(0,l.jsx)(y.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:t,children:(0,l.jsxs)(h.mQ,{defaultIndex:u,onSelect:function(e){return x(e)},children:[(0,l.jsx)(g,{children:(o||[]).map(function(e){return(0,l.jsx)(b,{children:e},e)})}),m.Children.map(n,function(e,n){return(0,l.jsx)(d.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===p?"block":"none"},children:(0,l.jsx)(h.x4,{children:e})})})]})})},Z=(0,m.memo)(j),k=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(n=o.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=o.colors)||void 0===t?void 0:t.primary}}),(0,l.jsx)(d.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(d.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},C=t(3026),S=t(67557),I=t(77033),F=t(63397),E=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,u=e.children;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(F.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,v.Z)(e,["id"])).reduce(function(e,n){var t=(0,o.Z)(n,2),l=t[0],a=t[1];if((void 0===a?"undefined":(0,I.Z)(a))!==Boolean&&!a){var s,u=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==u)return(0,r.Z)((0,i.Z)({},e),(0,S.Z)({},l,u))}return(0,r.Z)((0,i.Z)({},e),(0,S.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(F.l0,{id:n,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},w=(0,m.memo)(E),T=t(89853),A=t(99968),_=t(83462),N=t(5632),R=t(75329),M=t(65186),z=function(){var e=(0,N.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(M.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(d.xu,{sx:{height:"12px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(d.xu,{sx:{height:"8px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(d.xu,{sx:{height:"24px"}}),(0,l.jsx)(d.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),R.pq)},children:"Go to the Slice Simulator"})]})};s().setAppElement("#__next");var B=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,m=e.zoneType,h=(0,u.B7)().theme;if(!t.isOpen)return null;var v=(0,o.Z)(t.field,2),g=v[0],b=v[1],y=(0,A.t)(p,b.config,b.type);if(!y)return(0,l.jsxs)("div",{children:[b.type," not found"]});var j=y.Meta.icon,S=y.FormFields,I=y.Form,F=y.schema,E=(0,i.Z)({},(0,x.f7)((0,_.B9)(S,"id")),y.prepareInitialValues?y.prepareInitialValues(b.config):b.config),N=function(){try{return{res:F.validateSync({type:b.type,config:E},{stripUnknown:!0})}}catch(e){return{err:e}}}(),R=N.res,M=N.err;M&&(console.error("[EditModal] Failed to validate field of type ".concat(b.type,".\n Please update model.json accordingly.")),console.error(M));var B={id:g,config:R?R.config:E},q=(0,o.Z)(S.id.validate.matches,2),D=q[0],O=q[1],P=f.object().shape({id:f.string().matches(D,O).min(3).max(35).required(),config:F.fields.config}),V="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(c.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(w,{apiId:g,formId:V,initialValues:B,validationSchema:P,FormFields:S,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:g,newKey:t,value:(0,i.Z)({},b,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,u=e.isValid,f=e.isSubmitting,p=e.initialValues,v=I?(0,l.jsx)(I,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(C.k,{children:Object.entries(S).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(C.J,{children:(0,l.jsx)(T.Z,{fieldName:(0,x.lm)(t),formField:i,fields:a,initialValues:p})},t)})},"field-model-tab-content"),g=["Field Model"],b=[v];if("slice"===m){var y=(0,l.jsx)(d.xu,{children:(0,l.jsx)(z,{})},"mock-data-tab-content");g.push("Mock Data"),b.push(y)}return(0,l.jsx)(Z,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:function(e){var t=e.radius;return(0,l.jsxs)(d.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t},children:[(0,l.jsx)(k,{theme:h,text:c||s,WidgetIcon:j}),(0,l.jsx)(d.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(d.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(d.xu,{sx:{ml:"auto"}}),(0,l.jsx)(d.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(d.zx,{form:V,type:"submit",disabled:!u&&f,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:b})}})})}},75012:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(25812),c=t(75289),u=t(54132),d=t(3026),f=t(59326),p=function(e){var n=e.title,t=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(c.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},"&:hover":{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":n,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(n,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(c.xu,{ml:1,children:[(0,o.jsx)(c.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(c.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var x=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(s.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(u.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(c.X6,{children:"Add a new field"}),(0,o.jsx)(c.x8,{onClick:t})]})},children:(0,o.jsx)(d.k,{children:a.filter(function(e){return e}).map(function(e){var n=e.Meta,t=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(d.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},70697:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(49857),s=t(81038),c=t(59326),u=t(75289),d=t(8799),f=t(77245),p=t(65186),x=t(39576),m={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,c.B7)().theme,h=(0,l.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(u.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(u.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.vcz,{size:26,color:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(x.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(u.xu,{children:(0,o.jsxs)(u.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(p.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(f.LhG,{size:16,style:m}),(0,o.jsx)(u.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=function(e){var n=e.show,t=e.renderHintBase,l=e.item,c=t({item:l}),u=(0,a.ZP)(c,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:c.split("."),model:l.value})];case 1:return[2,e.sent()]}})})),d=u.data,f=u.error;if(f&&console.error(f),!d||f)return null;var p=d.snippets||[];return p[0]?(0,o.jsx)("div",{style:{display:n?"initial":"none"},children:(0,o.jsx)(h,{code:p[0].code,lang:p[0].language})}):null}},9620:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(63397),c=t(75289),u=t(59326),d=t(22715),f=t(90569),p=t(60113),x=t(83239),m=t(38876),h=t(33710),v=t(18978),g=t(39295),b=function(e){var n=e.error;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.X,{children:(0,l.jsx)(h.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(v.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},y=t(59872),j=function(e){var n=e.innerRef,t=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(c.II,(0,r.Z)((0,i.Z)({},t),{ref:n}))},Z=function(e){var n=e.widgetTypeName,t=e.fields,o=e.onSave,h=e.onCancelNewField,v=(0,a.useRef)(null),g=(0,u.B7)().theme,Z=(0,a.useState)(!0),k=Z[0],C=Z[1];(0,a.useEffect)(function(){v.current&&v.current.focus()},[v]);var S=x[n];if(!S)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var I=S.FormFields,F=S.Meta.icon,E={id:I.id,label:I.label},w=(0,r.Z)((0,i.Z)({},(0,p.f7)(E),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,p.gc)(E),A=function(e,n,t){t(k&&!E.id.disabled?(0,r.Z)((0,i.Z)({},n),{label:e.target.value,id:(0,m.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},n),{label:e.target.value}))},_=function(e,n){n("id",e.target.value),C(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:w,children:function(e){var n,o,a=e.errors,u=e.values,p=e.setValues,x=e.setFieldValue,m=e.submitForm;return(0,l.jsx)(s.l0,{"data-testid":"new-field-form",children:(0,l.jsxs)(c.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var n,t;return"1px solid ".concat((null===(n=e.colors)||void 0===n?void 0:null===(t=n.borders)||void 0===t?void 0:t.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,l.jsx)(F,{style:{color:null===(n=g.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=g.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(c.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(c.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return A(e,u,p)},onKeyDown:function(e){"Enter"===e.key&&m()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:v,sx:(0,r.Z)((0,i.Z)({},(0,y.tM)(E.label.disabled?y.$w.DISABLED:a.label?y.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,l.jsx)(b,{error:a.label})]}),(0,l.jsxs)(c.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(c.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return _(e,x)},onKeyDown:function(e){"Enter"===e.key&&m()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:E.id.disabled,validate:function(e){return(0,f.u)({value:e,fields:t,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,y.tM)(E.id.disabled?y.$w.DISABLED:a.id?y.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,l.jsx)(b,{error:a.id})]}),(0,l.jsxs)(c.kC,{sx:{gap:2},children:[(0,l.jsx)(d.zx,{onClick:h,color:"grey",children:"Cancel"}),(0,l.jsx)(d.zx,{onClick:function(){m()},children:"Add"})]})]})})}})}},8482:function(e,n,t){"use strict";t.d(n,{Z:function(){return I}});var i=t(62230),r=t(85244),o=t(17064),l=t(81541),a=t(52322),s=t(22715),c=t(13980),u=t(2784),d=t(65077),f=t(28173),p=t(82770),x=t(75012),m=t(9620),h=t(40023),v=t(75289),g=t(71168),b=t(28728),y=t(83239),j=t(99968),Z=t(70697),k=function(e){var n=e.fields,t=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,u=e.renderFieldAccessor,d=e.onDeleteItem,f=e.showHints,p=e.newField,x=e.renderHintBase,m=e.isRepeatable,k=e.testId,C=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:c,children:(0,a.jsx)(h.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(v.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":k,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,p=c.config,h=c.type,k=(0,j.t)(y,p,h);if(!k)return(0,a.jsx)(g.Z,{children:(0,a.jsxs)(v.xv,{children:['Field type "',h,'" not supported']})});var S={item:e,index:n,tabId:o,widget:k,showHints:f,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:C,testId:"list-item-".concat(e.key)};if(k.CustomListItem){var I=k.CustomListItem;return(0,a.jsx)(I,(0,i.Z)({},S))}var F=(0,a.jsx)(Z.Z,{item:e,show:f,isRepeatable:m,renderHintBase:x,Widgets:y,typeName:k.CUSTOM_NAME||k.TYPE_NAME});return(0,a.jsx)(b.Z,(0,r.Z)((0,i.Z)({},S),{HintElement:F}))}),e.placeholder,p]}))}})})},C=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(v.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(v.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(v.xu,{sx:{my:2},children:(0,a.jsx)(v.xv,{sx:{color:"textClear"},children:"Fields are inputs for content (e.g. text, images, links)."})}),(0,a.jsx)(v.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return n()},"data-testid":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},S=function(e){var n=e.zoneType,t=e.zoneTypeFormat,c=e.tabId,h=e.title,v=e.fields,g=e.poolOfFieldsToCheck,b=e.widgetsArray,y=e.isRepeatable,j=e.onDeleteItem,Z=e.onSaveNewField,S=e.onDragEnd,I=e.EditModal,F=e.onSave,E=e.dataTip,w=e.renderHintBase,T=e.renderFieldAccessor,A=e.testId,_=e.isRepeatableCustomType,N=Object.entries(g).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?b.filter(function(e){return"UID"!==e.TYPE_NAME}):b,R=(0,u.useState)(!1),M=R[0],z=R[1],B=(0,u.useState)({isOpen:!1}),q=B[0],D=B[1],O=(0,u.useState)({isOpen:!1}),P=O[0],V=O[1],L=(0,u.useState)(null),H=L[0],J=L[1],U=function(e){D({isOpen:!0,field:e});var i=(0,o.Z)(e,2),r=i[0],l=i[1];p.Xe.track({event:"field:settings-opened",id:r,name:l.config.label,type:l.type,isInAGroup:!1,contentType:"customType"===n?"page"===t?"page type":"custom type":"slice"})},W=function(){V({isOpen:!0})},$=function(){D({isOpen:!1})},G=function(){return V({isOpen:!1})},Y=function(e){J({widgetTypeName:e,fields:v}),V({isOpen:!1})},X=function(){return J(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Bu,{actions:v.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:M,onCheckedChange:z,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(y?"Repeatable":"Static","-field"),onClick:W,startIcon:"add",color:"grey",disabled:null!==H,children:"Add a new field"})]}):void 0,children:h}),0!==v.length||H?v.length>0||H?(0,a.jsx)(d.xR,{children:(0,a.jsx)(k,{tabId:c,isRepeatable:y,fields:v,showHints:M,dataTip:E,title:h,renderFieldAccessor:T,renderHintBase:w,enterEditMode:U,enterSelectMode:W,onDragEnd:S,onDeleteItem:j,testId:A,isRepeatableCustomType:_,newField:H&&(0,a.jsx)(m.Z,(0,r.Z)((0,i.Z)({},H),{fields:g||v,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];Z.apply(void 0,(0,l.Z)(n)),J(null)},onCancelNewField:X}))})}):void 0:(0,a.jsx)(d.xR,{children:(0,a.jsx)(C,{onEnterSelectMode:function(){return W()},zoneName:y?"Repeatable":"Static"})}),(0,a.jsx)(I,{data:q,close:$,onSave:F,fields:g,zoneType:n}),(0,a.jsx)(x.Z,{data:P,close:G,onSelect:Y,widgetsArray:N})]})};S.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var I=S},99968:function(e,n,t){"use strict";t.d(n,{t:function(){return i}});var i=function(e,n,t){if("Link"===t)switch(null==n?void 0:n.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}return e[t]}},90569:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(34671),r=t(75329),o=function(e){var n=e.value,t=e.fields,i=e.initialId;return n?t.find(function(e){return e.key===n})&&n!==i?'Field "'.concat(n,'" already exists.'):void 0:"Field is required"},l={label:(0,i.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,i.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[r.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,i.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},34671:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(78610),r=t(60113),o=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:i.h.CHECKBOX,validate:{required:(0,r.MJ)(n,s)},required:n,label:e,defaultValue:t,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,u=n||{},d=u.min,f=u.max,p=u.required,x=u.matches;return{type:i.h.INPUT,label:e,validate:{required:(0,r.MJ)(p,s),min:(0,r.MJ)(d,l),max:(0,r.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},60113:function(e,n,t){"use strict";t.d(n,{MJ:function(){return d},f7:function(){return f},gc:function(){return p},lm:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),l=t(17064),a=t(81541),s=t(65413),c=t(78610),u=function(e){return"id"===e?"id":"config.".concat(e)},d=function(e,n){return Array.isArray(e)?e:"boolean"==typeof e&&e?n:null},f=function(e){return Object.entries(e).reduce(function(e,n){var t,a=(0,l.Z)(n,2),s=a[0],u=null===(t=a[1]).defaultValue?void 0:void 0!==t.defaultValue?t.defaultValue:t.type===c.h.CHECKBOX||(t.type===c.h.INPUT?"":t.type===c.h.SELECT?[]:void 0);return void 0!==u?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,u)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,n){var t=(0,l.Z)(n,2),c=t[0],u=t[1],d=u.validate,f=u.yupType;if(!d)return e;if("function"==typeof d)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,d(c,u)));var p=s[f]();return Object.entries(d).filter(function(e){return e&&e[1]}).forEach(function(e){var n,t=(0,l.Z)(e,2),i=t[0],r=t[1];if(r&&p[i]){p=(n=p)[i].apply(n,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},78610:function(e,n,t){"use strict";var i,r;t.d(n,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},82910:function(e,n,t){"use strict";t.d(n,{H:function(){return f}});var i=t(65413),r=t(8799),o=t(83462),l=t(60113),a=t(90569),s=t(34671),c={icon:r.XGl,title:"Boolean",description:"An input that is either true or false"},u={label:a.J.label,id:a.J.id,placeholder_false:(0,s.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,s.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,s.Jg)("Default to true")},d=i.object().shape({type:i.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,o.B9)(u,"id"))}),f={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:c,schema:d,FormFields:u}},12174:function(e,n,t){"use strict";t.d(n,{S:function(){return c}});var i,r=t(65186),o=t(83462),l={icon:r.jqW,title:"Color",description:"A color picker"},a=(0,o.zg)("Color"),s=a.TYPE_NAME,c={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:a.FormFields,TYPE_NAME:s,schema:a.schema,Meta:l}},86495:function(e,n,t){"use strict";t.d(n,{l:function(){return C}});var i=t(62230),r=t(85244),o=t(65413),l=t(17064),a=t(52322),s=t(75289),c=t(90569),u=t(89853),d=t(36131),f=t(3026),p=t(60113),x=t(56580),m=t(31667),h=t(7819),v={label:c.J.label,id:c.J.id,customtypes:{validate:function(){return o.array().of(o.string())}}},g=function(e){var n=e.initialValues,t=e.values,o=e.fields,c=e.setFieldValue,g=(0,x.v9)(m.Ch).filter(h.TG),b=g.map(function(e){return{value:e.local.id,label:e.local.label}}),y=t.config.customtypes?t.config.customtypes.map(function(e){var n=g.find(function(n){return n.local.id===e});return{value:null==n?void 0:n.local.id,label:null==n?void 0:n.local.label}}):null;return(0,a.jsxs)(f.k,{children:[Object.entries(v).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1];return(0,a.jsx)(f.J,{children:(0,a.jsx)(u.Z,{fieldName:(0,p.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,a.jsx)(f.J,{children:(0,a.jsxs)(s.xu,{sx:{mt:2,alignItems:"center"},children:[(0,a.jsx)(s.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,a.jsx)(d.ZP,{isMulti:!0,name:"origin",options:b,onChange:function(e){e&&c("config.customtypes",e.map(function(e){return e.value}))},value:y,theme:function(e){return(0,r.Z)((0,i.Z)({},e),{colors:(0,r.Z)((0,i.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},b=t(65186),y=t(348),j={icon:b.I2R,title:"Content Relationship",description:"Define content relations & internal links"},Z=y.I.shape({label:o.string().max(35,"String is too long. Max: 35"),select:o.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:o.array(o.string()).strict().optional()}),k=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:Z}),C={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:j,schema:k,TYPE_NAME:"Link",FormFields:v,CUSTOM_NAME:"ContentRelationship",Form:g,prepareInitialValues:function(e){var n=(0,x.v9)(m.Ch).filter(h.TG);return(null==e?void 0:e.customtypes)?(0,r.Z)((0,i.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}}},71516:function(e,n,t){"use strict";t.d(n,{v:function(){return a}});var i,r=t(65186),o=(0,t(83462).zg)("Date"),l=o.FormFields,a={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Date",schema:o.schema,Meta:{icon:r.f$3,title:"Date",description:"A calendar date picker"}}},79583:function(e,n,t){"use strict";t.d(n,{S:function(){return a}});var i,r=t(34543),o=(0,t(83462).zg)("Embed"),l=o.FormFields,a={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Embed",schema:o.schema,Meta:{icon:r.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}}},37191:function(e,n,t){"use strict";t.d(n,{X:function(){return s}});var i,r=t(65413),o=t(65186),l=t(90569),a={label:l.J.label,id:l.J.id},s={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:a,TYPE_NAME:"GeoPoint",schema:r.object().shape({type:r.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:r.object().shape({label:r.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:o.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}}},64118:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var i=t(65413),r=t(62230),o=t(85244),l=t(17064),a=t(52322),s=t(2784),c=t(90569),u=t(60113),d=t(89853),f=t(63397),p=t(75289),x=t(3026),m=t(98240),h=t(8799),v=t(65186),g=t(39031),b=t(34066),y=function(e){var n=e.onClick,t=e.error,i=e.onDelete,o=e.active,l=e.text,c=e.sx;return(0,a.jsx)(g.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:o,sx:(0,r.Z)({position:"relative",width:"64px",height:"64px"},c),Icon:function(){return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,a.jsx)(h.jnY,{size:22}),(0,a.jsx)(p.xv,{mt:1,children:l})]}),i?(0,a.jsx)(p.Ct,{onClick:i,variant:"circle-right",children:(0,a.jsx)(v.B4e,{})}):null]})}})},j=function(e){var n=e.onClick;return(0,a.jsx)(g.Z,{fitButton:!0,onClick:n,sx:{width:"64px",height:"64px",border:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}},Icon:function(){return(0,a.jsx)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,a.jsx)(h.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},Z=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,l.Z)((0,f.U$)(n),2),o=(r[0],r[1]),c=void 0!==t&&t?"*":"";return i?(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)(k,{name:"".concat(n,".name"),label:"Name".concat(c),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,a.jsx)(C,{name:"".concat(n,".width"),label:"Width (px)".concat(c),placeholder:" ",sx:{mb:3}}),(0,a.jsx)(C,{name:"".concat(n,".height"),label:"Height (px)".concat(c),placeholder:" "})]}):null},k=function(e){var n=e.name,t=e.label,i=e.placeholder,s=e.meta,c=e.isConstraint,u=(0,m.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,l.Z)((0,f.U$)(n),1)[0];return(0,a.jsx)(b.Hq,(0,o.Z)((0,r.Z)({},u),{fieldName:n,meta:s,formField:{label:t,placeholder:i},field:c?{value:"main",readOnly:!0}:{value:d.value},variant:c?"disabled":"primary"}))},C=function(e){var n=e.name,t=e.label,i=e.placeholder,s=(0,m.Z)(e,["name","label","placeholder"]),c=(0,l.Z)((0,f.U$)(n),2),u=c[0],d=c[1];return(0,a.jsx)(b.Hq,(0,o.Z)((0,r.Z)({},s),{fieldName:n,formField:{label:t,placeholder:i},meta:d,field:{min:0,type:"number",value:u.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},S=function(){return i.number().nullable().transform(function(e,n){return""===n?null:e})},I={label:c.J.label,id:c.J.id,constraint:{validate:function(){return i.object().defined().shape({width:S(),height:S()})}},thumbnails:{validate:function(){return i.array().defined().of(i.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var n="number"==typeof e.width&&e.width,t="number"==typeof e.height&&e.height;return e.name&&(n||t)}}))}}},F={name:"",width:"",height:""},E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,t=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||n||t?n||t?"".concat(n||"auto","x").concat(t||"auto"):"...":"auto"},w=function(e){var n=e.initialValues,t=e.values,i=e.errors,c=e.fields,m=e.touched,h=(0,s.useState)(0),v=h[0],g=h[1],b=t.config,k=b.thumbnails,C=b.constraint;return(0,s.useEffect)(function(){g(k.length)},[k.length]),(0,a.jsxs)(x.k,{children:[Object.entries(I).map(function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1];return(0,a.jsx)(x.J,{children:(0,a.jsx)(d.Z,{fieldName:(0,u.lm)(i),formField:r,fields:c,initialValues:n})},i)}),(0,a.jsxs)(x.J,{children:[(0,a.jsx)(p.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,a.jsx)(p.Zb,{p:3,children:(0,a.jsx)(f.F2,{name:"config.thumbnails",render:function(n){var t=n.push,l=n.remove;return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)(p.kC,{mb:3,children:[(0,a.jsx)(y,{active:0===v,text:E(C,!0),sx:{mr:2},onClick:function(){return g(0)}}),k.map(function(e,n){return(0,a.jsx)(y,{sx:{mr:3},active:v===+n+1,text:E(e),error:!!i.thumbnails&&!!m.thumbnails&&!!m.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return l(n)},onClick:function(){return g(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,a.jsx)(j,{onClick:function(){t(F)}})]}),(0,a.jsx)(Z,(0,o.Z)((0,r.Z)({},e),{display:0===v,prefix:"config.constraint"})),k.map(function(n,t){return(0,s.createElement)(Z,(0,o.Z)((0,r.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:v===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},T=t(83462),A=i.object().shape({type:i.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,T.B9)(I,"id"))}),_={Meta:{icon:h.jnY,title:"Image",description:"A responsive image field with constraints"},Form:w,schema:A,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:I,TYPE_NAME:"Image"}},348:function(e,n,t){"use strict";t.d(n,{h:function(){return v},I:function(){return h}});var i=t(65413),r=t(62230),o=t(85244),l=t(17064),a=t(52322),s=t(90569),c=t(89853),u=t(34671),d=t(3026),f=t(60113),p=(0,o.Z)((0,r.Z)({},s.J),{allowTargetBlank:(0,u.Jg)("Allow target blank",!1,!1)}),x=function(e){var n=e.initialValues,t=e.fields;return(0,a.jsx)(d.k,{children:Object.entries(p).map(function(e){var i=(0,l.Z)(e,2),r=i[0],o=i[1];return(0,a.jsx)(d.J,{children:(0,a.jsx)(c.Z,{fieldName:(0,f.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:t(34543).eR7,title:"Link",description:"A link to web, media or Prismic document"},h=i.object().shape({label:i.string().optional(),useAsTitle:i.boolean().optional(),placeholder:i.string().optional(),select:i.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:i.array(i.string()).strict().optional(),masks:i.array(i.string()).optional(),tags:i.array(i.string()).optional(),allowTargetBlank:i.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),v={Meta:m,FormFields:p,schema:i.object().shape({type:i.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"}},33949:function(e,n,t){"use strict";t.d(n,{H:function(){return v}});var i=t(65413),r=t(65186),o=t(348),l=t(62230),a=t(17064),s=t(52322),c=t(90569),u=t(89853),d=t(3026),f=t(60113),p=(0,l.Z)({},c.J),x=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(d.k,{children:Object.entries(p).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(d.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,f.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:r.x2k,title:"Link to media",description:"A link to files, document and media"},h=o.I.shape({select:i.string().required().matches(/^media$/,{excludeEmptyString:!0})}),v={Meta:m,FormFields:p,schema:i.object().shape({type:i.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"}},51490:function(e,n,t){"use strict";t.d(n,{L:function(){return a}});var i,r=t(951),o=(0,t(83462).zg)("Number"),l=o.FormFields,a={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Number",schema:o.schema,Meta:{icon:r.JUs,title:"Number",description:"A number input field"}}},74269:function(e,n,t){"use strict";t.d(n,{u:function(){return b}});var i=t(65413),r=t(65186),o=t(60113),l=t(83462),a=t(62230),s=t(85244),c=t(52322),u=t(63397),d=t(34066),f=t(78610),p=t(90569),x=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},m=function(e,n){return n?e:void 0},h=(0,s.Z)((0,a.Z)({},p.J),{default_value:{type:f.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return i.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(n){return n===e})}})},component:function(e){var n,t=null===(n=(0,u.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,c.jsx)(d.w8,(0,s.Z)((0,a.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:m,label:x}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,c.jsx)(d.kp,(0,a.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),v={icon:r.dzP,title:"Select",description:"A dropdown field of options for content creators."},g=i.object().shape({type:i.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(h,"id"))}),b={FormFields:h,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:g,Meta:v,TYPE_NAME:"Select"}},810:function(e,n,t){"use strict";t.d(n,{P:function(){return M}});var i=t(62230),r=t(65413),o=t(85244),l=t(17064),a=t(81541),s=t(52322),c=t(2784),u=t(60113),d=t(34671),f=t(90569),p=t(34543),x=t(8799),m=function(e){return function(n){var t=n.size;return(0,s.jsx)("span",{style:{fontSize:t},children:e})}},h=[{value:"paragraph",label:"P",icon:m("p")},{value:"preformatted",label:"PRE",icon:m("pre")},{value:"heading1",label:"H1",icon:m("h1")},{value:"heading2",label:"H2",icon:m("h2")},{value:"heading3",label:"H3",icon:m("h3")},{value:"heading4",label:"H4",icon:m("h4")},{value:"heading5",label:"H5",icon:m("h5")},{value:"heading6",label:"H6",icon:m("h6")},{value:"strong",label:"Strong",icon:m((0,s.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:m((0,s.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:m((0,s.jsx)(p.eR7,{}))},{value:"image",label:"image",icon:m((0,s.jsx)(p.LFN,{}))},{value:"embed",label:"embed",icon:m((0,s.jsx)(p.xqv,{}))},{value:"list-item",label:"list",icon:m((0,s.jsx)(p.SnF,{}))},{value:"o-list-item",label:"o",icon:m((0,s.jsx)(x.KyO,{}))},{value:"rtl",label:"rtl",icon:m("rtl")},],v=h.map(function(e){return e.value}),g=t(89853),b=t(75289),y=t(3026),j=t(39031),Z=t(47927),k=t(76635),C=function(e){return!v.find(function(n){return!e.includes(n)})},S=function(e){var n=e.split(",");return h.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,a.Z)(e).concat([i]):e},[])};function I(e,n){return(0,Z.has)("parent",e)&&(0,k.isObject)(e.parent)&&(0,Z.has)(n,e.parent)&&(0,k.isString)(e.parent[n])?e.parent[n]:null}function F(e){return function(){return r.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=I(t,e),r=I(t,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!v.includes(e)})}})}}var E=(0,o.Z)((0,i.Z)({},f.J),{allowTargetBlank:(0,d.Jg)("Allow target blank for links"),single:{validate:F("single")},multi:{validate:F("multi")}}),w=["config.single","config.multi"],T=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,d=e.setFieldValue,f=i.config,p=f.single,x=f.multi,m=p?S(p):x&&S(x)||v,Z=(0,c.useState)(!p),k=Z[0],I=Z[1],F=(0,c.useState)(m),T=F[0],A=F[1];return(0,c.useEffect)(function(){var e=k?1:0;d(w[e],T.join(",")),setTimeout(function(){d(w[1-e],void 0)},100)},[k,T]),(0,s.jsxs)(y.k,{children:[Object.entries(E).map(function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];return(0,s.jsx)(y.J,{children:(0,s.jsx)(g.Z,{fieldName:(0,u.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,s.jsxs)(y.J,{children:[(0,s.jsxs)(b.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,s.jsx)(b.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(C(T))return A([]);A(v)},children:C(T)?"Unselect All":"Select all"})]}),h.map(function(e){return(0,s.jsx)(j.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:T.includes(e.value),onClick:function(){if(T.find(function(n){return n===e.value}))return A(T.filter(function(n){return n!==e.value}));A((0,a.Z)(T).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[k?"multi":"single"])?(0,s.jsx)(b.xu,{sx:{position:"absolute"},children:(0,s.jsx)(b.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[k?"multi":"single"]})}):null]}),(0,s.jsx)(y.J,{children:(0,s.jsx)(b.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,s.jsxs)(b.__,{variant:"label.border",children:[(0,s.jsx)(b.XZ,{checked:k,onChange:function(){return I(!k)}}),"Allow multiple paragraphs"]})})})]})},A=t(65186),_=t(83462),N={icon:A.BAW,title:"Rich Text",description:"A rich text field with formatting options"},R=r.object().shape({type:r.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,_.B9)((0,i.Z)({},E,{labels:{yupType:"array",validate:{}}}),"id"))}),M={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:v.join(",")}}},FormFields:E,Meta:N,schema:R,TYPE_NAME:"StructuredText",Form:T}},89928:function(e,n,t){"use strict";t.d(n,{y:function(){return u}});var i=t(65413),r=t(65186),o=t(83462),l=t(90569),a=t(60113),s=l.J,c=i.object().shape({type:i.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,a.gc)((0,o.B9)(s,"id"))}),u={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:r.SQS,title:"Key Text",description:"A simple text string field"},schema:c,TYPE_NAME:"Text",FormFields:s}},64797:function(e,n,t){"use strict";t.d(n,{d:function(){return u}});var i,r=t(65413),o=t(65186),l=t(83462),a=t(90569),s=t(60113),c=a.J,u={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:r.object().shape({type:r.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,s.gc)((0,l.B9)(c,"id"))}),FormFields:c,TYPE_NAME:"Timestamp",Meta:{icon:o.f$3,title:"Timestamp",description:"A calendar date picker with time"}}},2353:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.H},Color:function(){return r.S},ContentRelationship:function(){return o.l},Date:function(){return l.v},Embed:function(){return a.S},GeoPoint:function(){return s.X},Image:function(){return c.b},Link:function(){return u.h},LinkToMedia:function(){return d.H},Number:function(){return f.L},Select:function(){return p.u},StructuredText:function(){return x.P},Text:function(){return m.y},Timestamp:function(){return h.d},UID:function(){return I}});var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797),v=t(62230),g=t(85244),b=t(65413),y=t(65186),j=t(83462),Z=t(90569),k=t(60113),C={label:Z.J.label,id:(0,g.Z)((0,v.Z)({},Z.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:Z.J.placeholder},S=b.object().shape({type:b.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,k.gc)((0,j.B9)(C,"id"))}),I={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:y.izl,title:"UID",description:"Unique Identifier"},schema:S,TYPE_NAME:"UID",FormFields:C}},44384:function(e,n,t){"use strict";var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797);n.Z=[x.P,c.b,u.h,d.H,o.l,p.u,i.H,l.v,h.d,a.S,f.L,s.X,r.S,m.y,]},83239:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return r.Boolean},Color:function(){return r.Color},ContentRelationship:function(){return r.ContentRelationship},Date:function(){return r.Date},Embed:function(){return r.Embed},GeoPoint:function(){return r.GeoPoint},Group:function(){return q},Image:function(){return r.Image},Link:function(){return r.Link},LinkToMedia:function(){return r.LinkToMedia},Number:function(){return r.Number},Select:function(){return r.Select},SharedSlice:function(){return D},SliceZone:function(){return O},StructuredText:function(){return r.StructuredText},Text:function(){return r.Text},Timestamp:function(){return r.Timestamp},UID:function(){return r.UID}});var i,r=t(2353),o=t(65413),l=t(65186),a=t(62230),s=t(85244),c=t(98240),u=t(17064),d=t(81541),f=t(52322),p=t(2784),x=t(28316),m=t(40023),h=t(75289),v=t(83462),g=t(38876),b=t(75012),y=t(9620),j=t(4092),Z=t(99968),k=t(44384),C=t(70697),S=t(28728),I=t(81787),F=t(14137),E=t(91061),w=t(82770),T=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),o=e.isRepeatable,l=e.item,T=e.draggableId,A=(e.renderFieldAccessor,(0,c.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","renderFieldAccessor"])),_=(0,p.useState)(!1),N=_[0],R=_[1],M=(0,p.useState)(null),z=M[0],B=M[1],q=(0,p.useState)({isOpen:!1}),D=q[0],O=q[1],P=(0,I.G)(),V=P.customType,L=P.setCustomType,H=function(e){B({widgetTypeName:e}),R(!1)},J=function(){B(null)},U=function(){O({isOpen:!1})},W=function(e){var t=e.id,i=e.label,o=e.widgetTypeName,a=r[o].create(i),s=F.L$.fromSM(a),c=(0,E.kQ)({customType:V,sectionId:n,groupFieldId:l.key,newField:s,newFieldId:t});L(c),w.Xe.track({event:"field:added",id:t,name:i,type:o,isInAGroup:!0,contentType:"page"===V.format?"page type":"custom type"})},$=function(e){var t=e.apiId,i=e.newKey,o=e.value;if(!(0,v.Ss)(r,o.type)){var a=F.L$.fromSM(o),s=(0,E.l9)({customType:V,sectionId:n,groupFieldId:l.key,previousFieldId:t,newFieldId:i,newField:a});L(s)}},G=function(e){if(!(0,v.uS)(e)){var t=e.source,i=e.destination;if(i){var r=t.index,o=i.index,a=(0,E.GA)({customType:V,sectionId:n,groupFieldId:l.key,sourceIndex:r,destinationIndex:o});(0,x.flushSync)(function(){return L(a)})}}},Y=function(e){var t=(0,E.j6)({customType:V,sectionId:n,groupFieldId:l.key,fieldId:e});L(t)},X=function(e){O({isOpen:!0,field:e});var n=(0,u.Z)(e,2),t=n[0],i=n[1];w.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:"page"===V.format?"page type":"custom type"})};return(0,f.jsxs)(p.Fragment,{children:[(0,f.jsx)(S.Z,(0,s.Z)((0,a.Z)({item:l,widget:t,draggableId:T,renderFieldAccessor:function(e){return"data.".concat(l.key,".[...]")}},A),{CustomEditElements:[(0,f.jsx)(h.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return R(!0)},children:"Add Field"},"custom-edit-element-".concat(l.key)),],children:(0,f.jsx)(h.xu,{sx:{ml:4},children:(0,f.jsx)(m.Z5,{onDragEnd:G,children:(0,f.jsx)(m.bK,{droppableId:"".concat(n,"-").concat(l.key,"-zone"),children:function(e){return(0,f.jsxs)("ul",(0,s.Z)((0,a.Z)({ref:e.innerRef},e.droppableProps),{children:[l.value.config.fields.map(function(e,n){var t=e.value,c=t.config,u=t.type,d=(0,Z.t)(r,c,u);if(!d)return null;var p={item:e,index:n,widget:d,key:e.key,enterEditMode:X,deleteItem:Y,renderFieldAccessor:function(e){return"data.".concat(l.key,".").concat(e)},draggableId:"group-".concat(l.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(l.key,"-").concat(e.key)},x=(0,f.jsx)(C.Z,{item:e,show:i,isRepeatable:o,renderHintBase:function(e){var n=e.item;return"data.".concat(l.key).concat((0,g.Ti)(n.key))},Widgets:r,typeName:d.CUSTOM_NAME||d.TYPE_NAME});return(0,f.jsx)(S.Z,(0,s.Z)((0,a.Z)({},p),{HintElement:x}))}),e.placeholder,z&&(0,f.jsx)(y.Z,(0,s.Z)((0,a.Z)({},z),{fields:l.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];W.apply(void 0,(0,d.Z)(n)),B(null)},onCancelNewField:J}))]}))}})})})})),(0,f.jsx)(b.Z,{data:{isOpen:N},close:function(){return R(!1)},onSelect:H,widgetsArray:k.Z}),(0,f.jsx)(j.Z,{data:D,close:U,onSave:$,fields:l.value.config.fields})]})},A=t(3026),_=t(90569),N=t(89853),R=t(34671),M=t(60113),z=(0,s.Z)((0,a.Z)({},_.J),{repeat:(0,R.Jg)("Repeatable",!1,!0)}),B=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,f.jsxs)(A.k,{children:[Object.entries(z).filter(function(e){return"repeat"!==(0,u.Z)(e,1)[0]}).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,f.jsx)(A.J,{children:(0,f.jsx)(N.Z,{fieldName:(0,M.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,f.jsx)(A.J,{children:(0,f.jsx)(h.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,f.jsxs)(h.__,{variant:"label.border",sx:{mb:0},children:[(0,f.jsx)(h.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},q={Meta:{icon:l.cC1,title:"Group",description:"A Group of Prismic fields"},Form:B,FormFields:z,schema:o.object().shape({type:o.string().matches(/^Group$/,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),placeholder:o.string(),repeat:o.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:T,TYPE_NAME:"Group"},D=null,O=null},83462:function(e,n,t){"use strict";t.d(n,{B9:function(){return s},Ss:function(){return u},uS:function(){return c},zg:function(){return d}});var i=t(98240),r=t(9849),o=t(65413),l=t(90569),a=t(60113),s=function(e,n){return e[n],(0,i.Z)(e,[n].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},u=function(e,n){return!e[n]&&(console.log('Could not find widget with type name "'.concat(n,'".')),!0)},d=function(e){return{TYPE_NAME:e,FormFields:l.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,a.gc)(s(l.J,"id"))}),create:function(){return{type:e,config:(0,a.f7)(s(l.J,"id"))}}}}},28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return s},Bu:function(){return c}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715);t(82432),t(84779);var s=function(e){return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_2a96i71 _1ecs97dez0 _1ecs97dez2 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezb _1ecs97dezr"}))},c=function(e){var n=e.actions,t=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:"_2a96i73 _2a96i72 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97d6r8 _1ecs97d6yl _1ecs97df2l _1ecs97dez1 _1ecs97df71 _1ecs97dfie _1ecs97d18 _1ecs97d8l _1ecs97df29 _1ecs97df92 _1ecs97dfi1",children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dezd _1ecs97df92 _1ecs97dezj _1ecs97df51",children:n}):null]}))}},47976:function(e,n,t){"use strict";t.d(n,{X:function(){return o}});var i=t(52322),r=t(22715),o=function(e){var n,t=e.status;switch(t){case"pending":n={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":n={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":n={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[n.icon,(0,i.jsx)(r.xv,{color:"grey11",children:n.text})]})}},81787:function(e,n,t){"use strict";t.d(n,{G:function(){return h},k:function(){return m}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(74217),s=t(90374),c=t(50950),u=t(91061),d=t(82770),f=t(26921),p=t(78656),x=(0,l.createContext)(void 0);function m(e){var n=e.children,t=e.initialCustomType,m=(0,l.useState)(t),h=m[0],v=m[1],g=(0,u.y6)(h),b=p.$[g],y=(0,f.c)({errorMessage:b.autoSaveFailed}),j=y.actionQueueStatus,Z=y.setNextAction,k=(0,s.Z)().saveCustomTypeSuccess,C=(0,a.R9)(k),S=(0,c.g)().syncChanges,I=(0,l.useCallback)(function(e){v(e),Z((0,i.Z)(function(){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,d.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return C(e),S(),[2]}})}))},[Z,C,S]),F=(0,l.useMemo)(function(){return{actionQueueStatus:j,customType:h,setCustomType:I}},[j,h,I]);return(0,o.jsx)(x.Provider,{value:F,children:"function"==typeof n?n(F):n})}function h(){var e=(0,l.useContext)(x);if(!e)throw Error("CustomTypeProvider not found");return e}},84779:function(){},82432:function(){}}]);