slice-machine-ui 1.26.1-beta.10 → 1.26.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/.eslintrc.js +6 -1
  2. package/.storybook/preview.tsx +2 -1
  3. package/components/App/index.tsx +6 -7
  4. package/components/AppLayout/index.tsx +4 -6
  5. package/components/AuthInstructions/index.jsx +1 -1
  6. package/components/Button/index.tsx +1 -2
  7. package/components/Card/Default.jsx +2 -1
  8. package/components/Card/Preview.jsx +1 -1
  9. package/components/Card/WithTabs/components.jsx +1 -1
  10. package/components/Card/WithTabs/index.jsx +4 -3
  11. package/components/Card/index.tsx +1 -0
  12. package/components/Changelog/index.tsx +6 -7
  13. package/components/Changelog/navigation/VersionBadge.tsx +2 -1
  14. package/components/Changelog/navigation/VersionTag.tsx +1 -0
  15. package/components/Changelog/navigation/index.tsx +3 -4
  16. package/components/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
  17. package/components/Changelog/versionDetails/UpdateCommandBox.tsx +4 -5
  18. package/components/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
  19. package/components/Changelog/versionDetails/index.tsx +4 -5
  20. package/components/ChangesEmptyState/AuthErrorPage.tsx +2 -3
  21. package/components/ChangesEmptyState/OfflinePage.tsx +1 -1
  22. package/components/ChangesEmptyState/index.ts +1 -1
  23. package/components/ChangesItems/ChangesItems.tsx +9 -10
  24. package/components/ChangesItems/DevCollaborationExperiment.tsx +2 -3
  25. package/components/ChangesItems/ErrorBanner.tsx +1 -1
  26. package/components/CodeBlock/index.tsx +3 -4
  27. package/components/ConfigErrors/index.jsx +1 -1
  28. package/components/CustomTypeTable/changesPage.tsx +6 -6
  29. package/components/DeleteCTModal/index.tsx +6 -7
  30. package/components/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +2 -3
  31. package/components/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +8 -9
  32. package/components/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +8 -8
  33. package/components/DeleteDocumentsDrawer/index.tsx +1 -1
  34. package/components/DeleteSliceModal/index.tsx +6 -7
  35. package/components/DeleteVariationModal/index.tsx +5 -6
  36. package/components/DropDownSelector/index.tsx +2 -4
  37. package/components/EmptyState/index.tsx +3 -4
  38. package/components/FormFields/Array.jsx +2 -4
  39. package/components/FormFields/Checkbox.jsx +1 -1
  40. package/components/FormFields/CheckboxControl.jsx +1 -1
  41. package/components/FormFields/Input.tsx +1 -1
  42. package/components/FormFields/SelectDefaultValue.jsx +1 -1
  43. package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +15 -16
  44. package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +9 -10
  45. package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +11 -12
  46. package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +6 -7
  47. package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +5 -6
  48. package/components/Forms/components/InputBox.tsx +2 -2
  49. package/components/Forms/components/SelectRepeatable.tsx +3 -3
  50. package/components/Forms/formsValidator.ts +3 -2
  51. package/components/FullPage/index.tsx +1 -1
  52. package/components/InputDeleteIcon/index.jsx +1 -1
  53. package/components/ItemHeader/index.tsx +1 -1
  54. package/components/ListItem/Header.tsx +1 -1
  55. package/components/ListItem/index.tsx +7 -10
  56. package/components/LoadingPage/index.tsx +1 -0
  57. package/components/LoginModal/index.tsx +22 -23
  58. package/components/ModalFormCard/index.tsx +5 -5
  59. package/components/Navigation/ChangesItem.tsx +8 -9
  60. package/components/Navigation/Environment.tsx +7 -8
  61. package/components/Navigation/RunningVersion.tsx +1 -2
  62. package/components/Navigation/UpdateBox.tsx +3 -4
  63. package/components/Navigation/VideoItem.tsx +16 -16
  64. package/components/Navigation/index.test.tsx +14 -12
  65. package/components/Navigation/index.tsx +18 -20
  66. package/components/ReviewModal/ReviewForm.tsx +12 -13
  67. package/components/ReviewModal/ReviewFormSelect.tsx +1 -1
  68. package/components/ReviewModal/ReviewModal.tsx +6 -7
  69. package/components/ScreenshotChangesModal/VariationDropZone.tsx +7 -8
  70. package/components/ScreenshotChangesModal/index.tsx +10 -14
  71. package/components/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -2
  72. package/components/ScreenshotPreview/index.tsx +1 -1
  73. package/components/ScreenshotPreviewModal/index.tsx +4 -4
  74. package/components/Simulator/components/FailedConnect/index.tsx +3 -4
  75. package/components/Simulator/components/Header/VariationsPopover/index.tsx +3 -5
  76. package/components/Simulator/components/Header/index.tsx +4 -5
  77. package/components/Simulator/components/IframeRenderer/index.tsx +3 -5
  78. package/components/Simulator/components/Toolbar/index.tsx +2 -4
  79. package/components/Simulator/index.tsx +19 -26
  80. package/components/SliceMachineDrawer/index.tsx +2 -2
  81. package/components/SliceMachineIconButton/index.tsx +1 -1
  82. package/components/SliceMachineModal/index.tsx +1 -1
  83. package/components/ToasterContainer/index.tsx +3 -5
  84. package/components/Tooltip/TextWithTooltip.tsx +2 -3
  85. package/components/Tooltip/index.jsx +2 -3
  86. package/components/Warnings/index.jsx +1 -1
  87. package/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +2 -3
  88. package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +4 -5
  89. package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +8 -9
  90. package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +2 -3
  91. package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +3 -3
  92. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +21 -22
  93. package/lib/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
  94. package/lib/builders/CustomTypeBuilder/TabModal/delete.tsx +1 -1
  95. package/lib/builders/CustomTypeBuilder/TabModal/update.tsx +1 -1
  96. package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +20 -21
  97. package/lib/builders/CustomTypeBuilder/index.tsx +4 -5
  98. package/lib/builders/SliceBuilder/FieldZones/index.tsx +17 -18
  99. package/lib/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +7 -8
  100. package/lib/builders/SliceBuilder/Sidebar/index.tsx +7 -8
  101. package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +9 -12
  102. package/lib/builders/SliceBuilder/index.tsx +6 -7
  103. package/lib/builders/common/EditModal/Field.jsx +2 -5
  104. package/lib/builders/common/EditModal/Form.jsx +1 -1
  105. package/lib/builders/common/EditModal/index.jsx +11 -17
  106. package/lib/builders/common/SelectFieldTypeModal/index.jsx +3 -5
  107. package/lib/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -3
  108. package/lib/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -6
  109. package/lib/builders/common/Zone/Card/components/Hints/index.tsx +1 -1
  110. package/lib/builders/common/Zone/Card/components/NewField.tsx +13 -14
  111. package/lib/builders/common/Zone/Card/index.jsx +2 -3
  112. package/lib/builders/common/Zone/components/EmptyState/index.tsx +1 -1
  113. package/lib/builders/common/Zone/index.jsx +3 -4
  114. package/lib/forms/defaults.ts +1 -1
  115. package/lib/forms/fields.ts +1 -2
  116. package/lib/forms/index.ts +1 -0
  117. package/lib/models/common/ComponentUI.ts +1 -1
  118. package/lib/models/common/CustomType/index.ts +5 -4
  119. package/lib/models/common/CustomType/sliceZone.ts +2 -1
  120. package/lib/models/common/CustomType/tab.ts +4 -4
  121. package/lib/models/common/DeprecatedMockConfigMessage.tsx +2 -2
  122. package/lib/models/common/Environment.ts +2 -2
  123. package/lib/models/common/Fields.ts +1 -1
  124. package/lib/models/common/Group.ts +3 -2
  125. package/lib/models/common/Library.ts +2 -1
  126. package/lib/models/common/LibraryUI.ts +1 -1
  127. package/lib/models/common/ModelData.ts +1 -1
  128. package/lib/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
  129. package/lib/models/common/ModelStatus/compareSliceModels.ts +2 -1
  130. package/lib/models/common/ModelStatus/index.ts +10 -9
  131. package/lib/models/common/Slice.ts +2 -2
  132. package/lib/models/common/Slices.ts +2 -2
  133. package/lib/models/common/normalizers/customType.ts +1 -1
  134. package/lib/models/common/normalizers/slices.ts +3 -2
  135. package/lib/models/common/widgets/Boolean/index.ts +5 -7
  136. package/lib/models/common/widgets/Color/index.ts +2 -3
  137. package/lib/models/common/widgets/ContentRelationship/Form.tsx +7 -9
  138. package/lib/models/common/widgets/ContentRelationship/index.ts +7 -8
  139. package/lib/models/common/widgets/Date/index.ts +2 -2
  140. package/lib/models/common/widgets/Embed/index.ts +2 -2
  141. package/lib/models/common/widgets/GeoPoint/index.ts +2 -3
  142. package/lib/models/common/widgets/Group/Form.jsx +3 -4
  143. package/lib/models/common/widgets/Group/ListItem/index.jsx +13 -23
  144. package/lib/models/common/widgets/Group/index.ts +4 -3
  145. package/lib/models/common/widgets/Image/Form.tsx +8 -11
  146. package/lib/models/common/widgets/Image/components.tsx +5 -5
  147. package/lib/models/common/widgets/Image/index.ts +3 -5
  148. package/lib/models/common/widgets/Link/Form.jsx +3 -5
  149. package/lib/models/common/widgets/Link/index.ts +3 -3
  150. package/lib/models/common/widgets/LinkToMedia/Form.jsx +2 -4
  151. package/lib/models/common/widgets/LinkToMedia/index.ts +3 -4
  152. package/lib/models/common/widgets/Number/index.ts +2 -2
  153. package/lib/models/common/widgets/Select/FormFields.jsx +7 -8
  154. package/lib/models/common/widgets/Select/index.ts +3 -6
  155. package/lib/models/common/widgets/StructuredText/Form.tsx +10 -10
  156. package/lib/models/common/widgets/StructuredText/index.ts +3 -6
  157. package/lib/models/common/widgets/StructuredText/options.tsx +2 -2
  158. package/lib/models/common/widgets/Text/index.ts +5 -5
  159. package/lib/models/common/widgets/Timestamp/index.ts +4 -5
  160. package/lib/models/common/widgets/UID/index.ts +4 -5
  161. package/lib/models/common/widgets/Widget.ts +2 -1
  162. package/lib/models/common/widgets/index.ts +1 -1
  163. package/lib/models/common/widgets/withGroup.ts +1 -2
  164. package/lib/models/server/ServerState.ts +4 -3
  165. package/lib/utils/index.ts +4 -5
  166. package/out/404.html +1 -1
  167. package/out/_next/static/{w56F6n1XbyP8jyJHeri22 → 6WrgMw0SELcypoJCYNiKd}/_buildManifest.js +1 -1
  168. package/out/_next/static/chunks/{25-792af14760d9df34.js → 25-607d5cfe6492f4e8.js} +1 -1
  169. package/out/_next/static/chunks/286-6ee80333008646b9.js +1 -0
  170. package/out/_next/static/chunks/318-c84322cba57be932.js +1 -0
  171. package/out/_next/static/chunks/382-8194eab141c7ea2f.js +1 -0
  172. package/out/_next/static/chunks/727-b53258380c1a11f1.js +1 -0
  173. package/out/_next/static/chunks/799-68887319f3169f78.js +1 -0
  174. package/out/_next/static/chunks/pages/{_app-f7ec0d037993439e.js → _app-6177e3581af44083.js} +1 -1
  175. package/out/_next/static/chunks/pages/changelog-2d061c06b2b82e28.js +1 -0
  176. package/out/_next/static/chunks/pages/changes-cde59d56dc849106.js +1 -0
  177. package/out/_next/static/chunks/pages/index-b5817351a77c6d40.js +1 -0
  178. package/out/_next/static/chunks/pages/labs-0fc7d01b8c9bfc2a.js +1 -0
  179. package/out/_next/static/chunks/pages/settings-897ad13a08f73048.js +1 -0
  180. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js +1 -0
  181. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js +1 -0
  182. package/out/_next/static/chunks/pages/slices-391f6c4b30af0759.js +1 -0
  183. package/out/_next/static/css/{fa4e416634515cbb.css → 243a4d347efcfd53.css} +1 -1
  184. package/out/_next/static/css/70e3649c6ba13fdc.css +1 -0
  185. package/out/changelog.html +1 -1
  186. package/out/changes.html +1 -1
  187. package/out/custom-types/[customTypeId].html +1 -1
  188. package/out/custom-types.html +1 -1
  189. package/out/index.html +1 -1
  190. package/out/labs.html +1 -1
  191. package/out/page-types/[pageTypeId].html +1 -1
  192. package/out/settings.html +1 -1
  193. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  194. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  195. package/out/slices.html +1 -1
  196. package/package.json +3 -3
  197. package/pages/_app.tsx +6 -8
  198. package/pages/changelog.tsx +1 -2
  199. package/pages/changes.tsx +14 -15
  200. package/pages/custom-types.tsx +1 -2
  201. package/pages/index.tsx +1 -2
  202. package/pages/slices/[lib]/[sliceName]/[variation]/index.tsx +2 -3
  203. package/pages/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -3
  204. package/pages/slices.tsx +18 -19
  205. package/sentry.client.config.ts +1 -1
  206. package/src/ErrorBoundary.tsx +1 -2
  207. package/src/apiClient.ts +7 -8
  208. package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
  209. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  210. package/src/components/BaseHoverCard/BaseHoverCard.tsx +1 -1
  211. package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
  212. package/src/components/BlankSlate/index.ts +1 -1
  213. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
  214. package/src/components/Card/Card.stories.tsx +1 -2
  215. package/src/components/Card/Card.tsx +3 -2
  216. package/src/components/CodeBlock/CodeBlock.tsx +6 -7
  217. package/src/components/ContentTabs/ContentTabs.tsx +1 -1
  218. package/src/components/Count/Count.tsx +1 -2
  219. package/src/components/Divider/Divider.stories.tsx +1 -1
  220. package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
  221. package/src/components/HoverCard/HoverCard.test.tsx +2 -2
  222. package/src/components/HoverCard/HoverCard.tsx +2 -3
  223. package/src/components/HoverCard/index.ts +3 -3
  224. package/src/components/SideNav/SideNav.stories.tsx +6 -7
  225. package/src/components/SideNav/SideNav.tsx +6 -6
  226. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -4
  227. package/src/components/Table/Table.stories.tsx +2 -2
  228. package/src/components/Table/Table.test.tsx +1 -2
  229. package/src/components/Table/Table.tsx +2 -2
  230. package/src/components/Table/index.ts +1 -1
  231. package/src/components/TextLink/TextLink.stories.tsx +1 -1
  232. package/src/components/TextLink/TextLink.tsx +1 -1
  233. package/src/domain/__tests__/customType.test.ts +1 -2
  234. package/src/domain/__tests__/slice.test.ts +3 -4
  235. package/src/domain/customType.ts +1 -2
  236. package/src/domain/slice.ts +4 -5
  237. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +1 -2
  238. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +0 -1
  239. package/src/features/changelog/useSliceMachineReleaseNotes.ts +0 -1
  240. package/src/features/changelog/useSliceMachineVersions.ts +0 -1
  241. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +9 -13
  242. package/src/features/changes/PushChangesButton.tsx +5 -6
  243. package/src/features/changes/StatusBadge.tsx +2 -3
  244. package/src/features/customTypes/EditDropdown.tsx +6 -10
  245. package/src/features/customTypes/PageTypeOnboarding.tsx +4 -5
  246. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +7 -9
  247. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +7 -7
  248. package/src/features/customTypes/actions/convertCustomToPageType.ts +2 -3
  249. package/src/features/customTypes/actions/createCustomType.ts +2 -3
  250. package/src/features/customTypes/actions/deleteCustomType.ts +2 -3
  251. package/src/features/customTypes/actions/renameCustomType.ts +2 -3
  252. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -9
  253. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +14 -13
  254. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +4 -5
  255. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +1 -2
  256. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +0 -1
  257. package/src/features/customTypes/customTypesConfig.ts +1 -2
  258. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +14 -15
  259. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +11 -12
  260. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +4 -5
  261. package/src/features/documentation/MarkdownRenderer/index.tsx +5 -7
  262. package/src/features/documentation/useDocumentation.ts +0 -1
  263. package/src/features/environments/actions/getActiveEnvironment.ts +0 -1
  264. package/src/features/environments/actions/setEnvironment.ts +1 -2
  265. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -3
  266. package/src/features/inAppGuide/InAppGuideDialog.tsx +2 -3
  267. package/src/features/inAppGuide/inAppGuideContent.tsx +1 -2
  268. package/src/features/labs/labsList/LabsList.tsx +2 -2
  269. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  270. package/src/features/labs/labsList/LabsPage.tsx +4 -5
  271. package/src/features/labs/labsList/useLab.tsx +0 -1
  272. package/src/features/settings/SettingsPage.tsx +5 -6
  273. package/src/features/settings/git/ConnectGitRepository.tsx +2 -3
  274. package/src/features/settings/git/GitOwnerSelect.tsx +1 -2
  275. package/src/features/settings/git/GitProvider.ts +0 -1
  276. package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -2
  277. package/src/features/settings/git/GitRepositoriesList.tsx +1 -2
  278. package/src/features/settings/git/GitRepositoriesSearch.tsx +1 -2
  279. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +3 -4
  280. package/src/features/settings/git/useGitOwners.ts +0 -1
  281. package/src/features/settings/git/useGitRepos.ts +0 -1
  282. package/src/features/settings/git/useLinkedGitRepos.ts +0 -1
  283. package/src/features/settings/git/useWriteAPIToken.ts +0 -1
  284. package/src/features/slices/actions/addSlicesToSliceZone.ts +1 -2
  285. package/src/features/slices/actions/createSlice.ts +3 -4
  286. package/src/features/slices/actions/deleteSlice.ts +1 -2
  287. package/src/features/slices/actions/renameSlice.ts +3 -4
  288. package/src/features/slices/actions/uploadSliceScreenshot.ts +1 -2
  289. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +8 -9
  290. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +6 -7
  291. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +10 -11
  292. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +3 -3
  293. package/src/features/slices/convertLegacySlice/types.ts +1 -1
  294. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -4
  295. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -10
  296. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +2 -3
  297. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +1 -2
  298. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +2 -3
  299. package/src/features/slices/sliceCards/SharedSliceCard.tsx +4 -5
  300. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -3
  301. package/src/features/sync/AutoSyncProvider.tsx +17 -18
  302. package/src/features/sync/actions/pushChanges.ts +1 -1
  303. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +2 -3
  304. package/src/features/sync/fetchUnSyncChanges.ts +1 -1
  305. package/src/features/sync/getUnSyncChanges.ts +4 -4
  306. package/src/features/sync/useUnSyncChanges.ts +4 -5
  307. package/src/hooks/useActionQueue.tsx +5 -5
  308. package/src/hooks/useAdapterName.ts +0 -1
  309. package/src/hooks/useAuthStatus.ts +1 -2
  310. package/src/hooks/useCurrentSlice.tsx +2 -3
  311. package/src/hooks/useEditorContent.ts +3 -3
  312. package/src/hooks/useExperimentVariant.ts +0 -1
  313. package/src/hooks/useIsEmptyProject.ts +0 -1
  314. package/src/hooks/useRepositoryInformation.ts +2 -3
  315. package/src/hooks/useRouteChange.tsx +1 -1
  316. package/src/hooks/useSMTracker.ts +4 -5
  317. package/src/hooks/useScreenshotChangesModal.ts +3 -3
  318. package/src/hooks/useServerState.ts +4 -5
  319. package/src/hooks/useSliceMachineConfig.ts +1 -2
  320. package/src/hooks/useSliceMachineRunningVersion.ts +0 -1
  321. package/src/hooks/useThrottle.ts +1 -1
  322. package/src/hooks/useUpdateAvailable.ts +0 -1
  323. package/src/hooks/useWindowDimensions.ts +1 -1
  324. package/src/hooks/useWindowSize.ts +2 -1
  325. package/src/modules/availableCustomTypes/index.ts +13 -12
  326. package/src/modules/environment/index.ts +9 -8
  327. package/src/modules/loading/index.ts +3 -2
  328. package/src/modules/modal/index.ts +3 -2
  329. package/src/modules/slices/index.ts +4 -4
  330. package/src/modules/slices/types.ts +1 -1
  331. package/src/modules/useSliceMachineActions.ts +22 -21
  332. package/src/modules/userContext/index.ts +5 -4
  333. package/src/redux/reducer.ts +5 -5
  334. package/src/redux/store.ts +6 -5
  335. package/src/redux/type.ts +4 -4
  336. package/src/theme.ts +1 -2
  337. package/vite.config.ts +4 -3
  338. package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
  339. package/out/_next/static/chunks/318-77a29f41c3a027e3.js +0 -1
  340. package/out/_next/static/chunks/382-aacd61be9adba45a.js +0 -1
  341. package/out/_next/static/chunks/727-d0d6a29f0793bde2.js +0 -1
  342. package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
  343. package/out/_next/static/chunks/pages/changelog-055db8139a22a592.js +0 -1
  344. package/out/_next/static/chunks/pages/changes-f43ad4ab5e00f9b9.js +0 -1
  345. package/out/_next/static/chunks/pages/index-cf93d16e9c63b6db.js +0 -1
  346. package/out/_next/static/chunks/pages/labs-73a12d2fe0233fb9.js +0 -1
  347. package/out/_next/static/chunks/pages/settings-417f1d5c1e558c88.js +0 -1
  348. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
  349. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-a8933b0ef10806cd.js +0 -1
  350. package/out/_next/static/chunks/pages/slices-3c9b08adf578b020.js +0 -1
  351. package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
  352. /package/out/_next/static/{w56F6n1XbyP8jyJHeri22 → 6WrgMw0SELcypoJCYNiKd}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[477],{37782:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changelog",function(){return r(60777)}])},39576:function(e,n,r){"use strict";r.d(n,{Z:function(){return d}});var t=r(62230),i=r(52322),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=r(61183);r(2784);var o=r(59326),c=r(75289);a.Z.registerLanguage("svelte",s);var l=["javascript","bash","xml","html","json"],d=function(e){var n,r=e.children,s=e.lang,d=e.sx,p=e.codeStyle,u=e.codeClass,x=e.Header,g=(0,o.B7)().theme,h=s?a.Z.highlight(r,{language:"vue"===s?"html":s}).value:a.Z.highlightAuto(r,l).value;return(0,i.jsxs)(c.kC,{as:"pre",sx:d,children:[x?(0,i.jsx)(x,{}):null,(0,i.jsx)("code",{className:"hljs".concat(u?" ".concat(u):""),style:(0,t.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=g.colors)||void 0===n?void 0:n.textClear)},p),dangerouslySetInnerHTML:{__html:h}})]})}},60777:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return I}});var t,i=r(52322),s=r(55156),a=r(22715),o=r(22710),c=r(99267),l=r(17329),d=r(81038);function p(){return u.apply(this,arguments)}function u(){return(u=(0,o.Z)(function(){var e;return(0,c.__generator)(this,function(e){switch(e.label){case 0:return[4,d.j.versions.getAllStableSliceMachineVersionsWithKind()];case 1:return[2,e.sent()]}})})).apply(this,arguments)}function x(){return(0,l.QT)(p,[])}var g=r(39092),h=r(2784),f=r(56580),v=r(65077);function b(){return j.apply(this,arguments)}function j(){return(j=(0,o.Z)(function(){var e;return(0,c.__generator)(this,function(e){switch(e.label){case 0:return[4,d.j.versions.getLatestNonBreakingSliceMachineVersion()];case 1:return[2,e.sent()]}})})).apply(this,arguments)}var m,k=r(32367),C=r(75165),y=r(75289),S=r(62230),T=r(12170),N=function(e){var n=e.type,r=e.hasUpToDateVersions;return(0,i.jsx)(y.xv,{sx:(0,S.Z)({padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase"},(n===t.Latest||n===t.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},n===t.Current&&r&&{bg:"lightGreen",color:"code.green"},n===t.Current&&!r&&{bg:"lightOrange",color:"code.orange"}),children:n})},L=function(e){var n=e.isSelected,r=e.onClick,t=e.versionNumber,s=e.tags,a=e.hasUpToDateVersions;return(0,i.jsxs)(y.kC,{sx:(0,S.Z)({p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center"},n?{color:"purple",bg:(0,T.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}),onClick:r,children:[(0,i.jsx)(y.xv,{children:t}),(0,i.jsx)(y.kC,{sx:{gap:"8px"},children:s.map(function(e){return(0,i.jsx)(N,{type:e,hasUpToDateVersions:a},e)})})]})};(m=t||(t={})).Latest="LATEST",m.LatestNonBreaking="LATEST-NON-BREAKING",m.Current="CURRENT";var V=function(e){var n,r=e.selectedVersion,s=e.selectVersion,o=function(e){var n=[];return e===f?n.push(t.Latest):e===g&&n.push(t.LatestNonBreaking),e===h&&n.push(t.Current),n},c=x(),d=(0,C.P)(),p=d.sliceMachineUpdateAvailable,u=d.adapterUpdateAvailable,g=(0,l.QT)(b,[]),h=(0,k.d)(),f=null===(n=c[0])||void 0===n?void 0:n.version;return(0,i.jsxs)(y.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:a.TV.color.greyLight6,flexDirection:"column",paddingRight:"48px"},children:[(0,i.jsxs)(y.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:a.TV.color.greyLight6,paddingBottom:"28px"},children:[(0,i.jsx)(y.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,i.jsx)(y.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,i.jsx)(y.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:c.map(function(e,n){return(0,i.jsx)(L,{isSelected:(null==r?void 0:r.version)===e.version,onClick:function(){return s(e)},versionNumber:e.version,tags:o(e.version),hasUpToDateVersions:!p&&!u},"versionBadge-".concat(e.version,"-").concat(n))})})]})};function _(e){return w.apply(this,arguments)}function w(){return(w=(0,o.Z)(function(e){var n;return(0,c.__generator)(this,function(n){switch(n.label){case 0:return[4,d.j.versions.getSliceMachineReleaseNotesForVersion({version:e})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}var M=r(951),E=r(19870),R=function(e){var n=e.releaseNotes;return(0,i.jsx)(y.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:E.TU.parse(n)}})},H=r(39576),z=r(36065),Z=function(e){var n,r,t,s,a,o=e.selectedVersion,c=e.packageManager,l=x(),d=(0,z.p)(),p=(0,C.P)(),u=p.sliceMachineUpdateAvailable,g=p.adapterUpdateAvailable,h=o.version===l[0].version,f=(n={sliceMachineVersionToInstall:h?"latest":o.version,isLatestSliceMachineVersion:h,adapterName:d},r=n.sliceMachineVersionToInstall,t=n.isLatestSliceMachineVersion,s=n.adapterName,a=["slice-machine-ui@".concat(r)],t&&a.push("".concat(s,"@latest")),a),v=function(e,n){var r=n.join(" ");switch(e){case"bun":return"bun add --development ".concat(r);case"npm":return"npm install --save-dev ".concat(r);case"pnpm":case"pnpm@6":return"pnpm add --save-dev ".concat(r);case"yarn":case"yarn@berry":return"yarn add --dev ".concat(r)}}(c,f);return(0,i.jsxs)(i.Fragment,{children:[g&&!u&&h&&(0,i.jsxs)(y.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,i.jsx)(M.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,i.jsxs)(y.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,i.jsx)(y.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,i.jsxs)(y.kC,{sx:{gap:"8px"},children:[(0,i.jsx)(H.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:v}),(0,i.jsx)(y.zx,{variant:"secondary",onClick:function(){navigator.clipboard.writeText(v)},children:"Copy"})]})]})]})},B=function(e){var n=e.versionKind,r=(0,S.Z)({fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase"},"MAJOR"===n?{color:"purple",bg:(0,T.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"});return(0,i.jsx)(y.xv,{sx:r,children:n})},A=function(){return(0,i.jsxs)(y.kC,{sx:{paddingLeft:"32px"},children:["Could not fetch release notes."," ",(0,i.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]})},D=function(e){var n,r=e.selectedVersion,t=e.packageManager,s=(n=r.version,(0,l.QT)(_,[n]));return(0,i.jsxs)(y.kC,{sx:{flexDirection:"column"},children:[(0,i.jsxs)(y.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:a.TV.color.greyLight6,justifyContent:"space-between",alignItems:"center"},children:[(0,i.jsx)(y.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(r.version)}),!!r.kind&&(0,i.jsx)(B,{versionKind:r.kind})]}),(0,i.jsxs)(y.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null==s?void 0:s.includes("# Breaking Change"))&&(0,i.jsxs)(y.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,i.jsx)(M.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,i.jsx)(Z,{selectedVersion:r,packageManager:t}),void 0!==s?(0,i.jsx)(R,{releaseNotes:s}):(0,i.jsx)(A,{})]})]})};function W(){var e=(0,f.v9)(function(e){return{packageManager:(0,g.Ak)(e)}}).packageManager,n=x(),r=n[0],t=(0,h.useState)(null!=r?r:void 0),o=t[0],c=t[1];(0,h.useEffect)(function(){c(r)},[r]);var l=0===n.length||!o;return(0,i.jsx)(s.LN,{children:(0,i.jsx)(s.RN,{children:(0,i.jsxs)(v.xR,{sx:{display:"flex",minWidth:0},children:[(0,i.jsx)(V,{selectedVersion:o,selectVersion:function(e){return c(e)}}),l?(0,i.jsx)(A,{}):(0,i.jsx)(a.SV,{renderError:function(){return(0,i.jsx)(A,{})},children:(0,i.jsx)(h.Suspense,{fallback:(0,i.jsx)(a._3,{}),children:(0,i.jsx)(D,{selectedVersion:o,packageManager:e})})})]})})})}var O=r(97729),U=r.n(O);function I(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(U(),{children:(0,i.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,i.jsx)(W,{})]})}}},function(e){e.O(0,[898,183,870,774,888,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(46563)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),s=t(98240),o=t(52322),c=t(2784),l=t(75289),a=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,h=e.form,x=e.isLoading,f=void 0!==x&&x,p=e.disabled,m=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,C=void 0===b?"primary":b,_=(0,s.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,o.jsx)(l.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),f?{cursor:"wait !important"}:{}),type:d,form:h,disabled:void 0!==p&&p||f,onClick:f?void 0:m,variant:C},_),{children:f?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.$j,{size:v,color:u(C),"data-testid":a(_["data-testid"],"spinner")}),c&&t]}):(0,o.jsxs)(o.Fragment,{children:[c&&(0,o.jsx)(c,{size:v,fill:y,"data-testid":a(_["data-testid"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var i=t(62230),r=t(52322),s=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,o=e.defineElementKey,c=e.gridTemplateMinPx,l=e.gridGap,a=e.sx;return(0,r.jsx)(s.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===c?"320px":c,", 1fr))"),gridGap:void 0===l?"16px":l,pt:2},a),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(o(e),"-").concat(n+1)):null})})}},46563:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return e_}});var i=t(22710),r=t(99267),s=t(52322),o=t(55156),c=t(22715),l=t(79096),a=t(90374),u=t(2784),d=function(e){var n=e.authStatus,t=(0,a.Z)().openLoginModal;return(0,s.jsxs)(c.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===l.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.xv,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,s.jsx)(c.xv,{align:"center",children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.xv,{variant:"h3",align:"center",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(c.xv,{align:"center",children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(c.xv,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(c.hh,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===l.t.FORBIDDEN&&(0,s.jsx)(c.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},h=t(91914),x=t(75289),f=function(){return(0,s.jsx)(x.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(x.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(h.wQ1,{size:48}),(0,s.jsx)(x.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,s.jsx)(x.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"Connect to the internet to sync your changes."})]})})},p=function(e){var n=e.children;return(0,s.jsx)(x.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px",width:"100%"},children:n})},m=t(7819),g=t(34728),j=t(67445),v=t(39097),y=t.n(v),b=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(x.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(x.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(x.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},C=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(x.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(x.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(x.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(x.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,m.TG)(e)?(0,s.jsx)(y(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-testid":"custom-type-".concat(e.local.id),children:(0,s.jsx)(b,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-testid":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(b,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r},e.remote.id)},e.remote.id)})})]})},_=t(59469),w=t(15836),k=t(32681),S=t(5479),Z=t(8564),T=t(71749),D=t(47731),z=t(951),L=t(82770),O=t(11563);function I(){var e=(0,O.L)("slicemachine-dev-collaboration"),n=(0,u.useState)(!1),t=n[0],i=n[1],r=null==e?void 0:e.payload;return((0,u.useEffect)(function(){(null==e?void 0:e.value)==="on"&&void 0!==r&&L.Xe.track({event:"dev-collab:workflow-stub-displayed"})},[e,r]),(null==e?void 0:e.value)!=="on"||void 0===r)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(c.xu,{alignItems:"flex-start",border:{bottom:!0,left:!0,right:!0,top:!0},borderRadius:6,borderStyle:"dashed",flexDirection:"column",flexShrink:0,gap:8,padding:16,width:320,children:[(0,s.jsxs)(c.xu,{flexDirection:"column",gap:2,children:[(0,s.jsx)(c.xv,{variant:"smallBold",children:r.cardTitle}),(0,s.jsx)(c.xv,{color:"grey11",variant:"small",children:r.cardDescription})]}),(0,s.jsx)(c.zx,{color:"grey",onClick:function(){L.Xe.track({event:"dev-collab:set-up-workflow-opened"}),i(!0)},children:r.cardButtonLabel})]}),(0,s.jsxs)(c.Vq,{onOpenChange:function(e){e||i(!1)},open:t,size:{height:"auto",width:448},children:[(0,s.jsx)(c.fK,{title:r.dialogTitle}),(0,s.jsx)(c.cZ,{children:(0,s.jsxs)(c.xu,{flexDirection:"column",children:[(0,s.jsx)(c.xu,{flexDirection:"column",padding:16,children:(0,s.jsx)(c.xv,{children:r.dialogDescription})}),(0,s.jsx)(c.kX,{cancel:{text:"Cancel"},ok:{text:r.dialogButtonLabel,onClick:function(){L.Xe.track({event:"dev-collab:join-beta-clicked"}),window.open(r.dialogButtonLink,"_blank"),i(!1)}},size:"medium"})]})})]})]})}var N=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,o=e.isOnline,l=(0,D.H)(),a=l.modalPayload,d=l.onOpenModal,h=a.sliceFilterFn,x=a.defaultVariationSelector,f=t.filter(function(e){return i.slices[e.model.id]!==k.GJ.Deleted});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(c.xu,{gap:16,alignItems:"flex-start",children:[(0,s.jsxs)(c.xu,{flexDirection:"column",flexGrow:1,children:[n.length>0&&(0,s.jsxs)(c.xu,{flexDirection:"column",children:[(0,s.jsx)(p,{children:(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(c.xv,{variant:"h5",children:"Types"}),(0,s.jsx)(c.xv,{variant:"h5",sx:{marginLeft:8},children:n.length})]})}),(0,s.jsx)(C,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:o})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.xu,{padding:{bottom:8},children:(0,s.jsxs)(p,{children:[(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(c.xv,{variant:"h5",children:"Slices"}),(0,s.jsx)(c.xv,{variant:"h5",sx:{marginLeft:8},children:t.length})]}),(0,s.jsxs)(c.xu,{children:[t.some(function(e){return(0,S.cx)(e)>0&&i.slices[e.model.id]!==k.GJ.Deleted})&&(0,s.jsxs)(c.xv,{color:"amber11",sx:{marginRight:8,alignSelf:"center"},children:[(0,s.jsx)(z.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(c.zx,{color:"dark",onClick:function(){return d({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(z.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(_.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)(T.b,{action:{type:"status",authStatus:r,isOnline:o,modelStatus:n},isDeleted:n===k.GJ.Deleted,mode:"navigation",onUpdateScreenshot:function(){d({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(w.Z,{slices:h(f),defaultVariationSelector:x})]})]}),(0,s.jsx)(Z.S,{children:(0,s.jsx)(u.Suspense,{children:(0,s.jsx)(I,{})})})]})})},R=t(56577),F=t(54132),H=t(79797),E=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,o=e.onClose;return(0,s.jsx)(H.Z,{placement:"right",open:n,level:null,onClose:o,width:496,children:(0,s.jsx)(F.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,s.jsxs)(x.kC,{sx:{p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,s.jsx)(x.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(x.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(x.x8,{type:"button",onClick:function(){return o()}})]})},Footer:function(){return(0,s.jsx)(x.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"white",padding:20},children:i})},children:r})})},B=t(31667),M=t(56580);t(78656);var A=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(x.Zb,{sx:{mb:12},variant:"drawerCard","data-testid":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(x.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(x.xv,{children:n}),(0,s.jsxs)(x.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(x.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},G=function(e){var n=e.pushChanges,t=e.modalData,i=e.onClose,r=(0,M.v9)(function(e){return{remoteOnlyCustomTypes:(0,B.Ch)(e).filter(m.yp)}}).remoteOnlyCustomTypes;if((null==t?void 0:t.type)!=="HARD")return null;var o=t.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,m.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(A,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(E,{isOpen:"HARD"===t.type,title:"Manual action required",onClose:i,footer:(0,s.jsx)(R.z,{label:"Try again",variant:"primary",onClick:function(){n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",t.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(x.xv,{sx:{mb:24},children:[t.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),o]})})},P=t(62230),W=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(x.kC,{sx:(0,P.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(x.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(x.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(x.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},U=function(e){var n=e.pushChanges,t=e.modalData,i=e.onClose,r=(0,u.useState)(!1),o=r[0],c=r[1],l=(0,M.v9)(function(e){return{remoteOnlyCustomTypes:(0,B.Ch)(e).filter(m.yp)}}).remoteOnlyCustomTypes;if((null==t?void 0:t.type)!=="SOFT")return null;var a=t.details.customTypes.map(function(e){var n,t=l.find(function(n){return(0,m.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(A,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(E,{isOpen:"SOFT"===t.type,title:"Confirm deletion",onClose:i,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(W,{onToggle:function(){c(!o)},isConfirmed:o,sx:{mb:10}}),(0,s.jsx)(R.z,{label:"Push changes",variant:"primary",onClick:function(){n(o)},disabled:!o,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(x.xv,{sx:{mb:24},children:[t.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),a]})})},V=t(41730),X=t(2754),Q=t(85244),K=t(98240),Y=t(6277),J=t(21052),$=t.n(J),q=function(e){var n=e.children,t=e.color,i=e.endIcon,r=e.href,o=e.textVariant,l=void 0===o?"smallBold":o,a=(0,K.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,Q.Z)((0,P.Z)({href:r,target:"_blank",rel:"noreferrer"},a),{className:(0,Y.W)($().root,$()["color-".concat(void 0===t?"primary":t)]),children:[(0,s.jsx)(c.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,u.isValidElement)(i)?(0,u.cloneElement)(i,{className:(0,Y.W)(i.props.className,$().endIcon,$()["icon-".concat(l)])}):null]}))},ee=t(39092),en=t(5632),et=t.n(en),ei=t(34543),er=function(){var e,n=(e=(0,M.v9)(function(e){return{repoName:(0,ee.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(X.R$,{style:{alignSelf:"center",marginTop:c.TV.size[72]},children:[(0,s.jsx)(X.u2,{children:(0,s.jsx)(c.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(X.T9,{children:[(0,s.jsx)(X._T,{children:"Everything up-to-date"}),(0,s.jsx)(X.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,s.jsxs)(X.Qj,{children:[(0,s.jsx)(c.zx,{onClick:function(){et().push("/")},children:"Create a page type"}),(0,s.jsx)(q,{endIcon:(0,s.jsx)(ei.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},es=t(80441),eo=t(80299),ec=t(75499),el=function(e){return(0,s.jsx)(Z.S,{renderError:eh,children:(0,s.jsx)(u.Suspense,{fallback:(0,s.jsx)(ex,{}),children:(0,s.jsx)(ea,(0,P.Z)({},e))})})},ea=function(e){return(0,eo.M)().eligible?(0,s.jsx)(eu,(0,P.Z)({},e)):(0,s.jsx)(ed,(0,P.Z)({},e))},eu=function(e){var n=(0,ec.G)().linkedGitRepos;if(!(n.length>0))return(0,s.jsx)(ed,(0,P.Z)({},e));var t=es.Q[n[0].provider];return(0,s.jsx)(c.u,{content:"This project uses the Git workflow. Update Prismic by pushing your changes to ".concat(t.name,"."),side:"bottom",children:(0,s.jsx)(ed,{disabled:!0})})},ed=(0,u.forwardRef)(function(e,n){return(0,s.jsx)(c.zx,(0,Q.Z)((0,P.Z)({},e),{ref:n,startIcon:"upload",children:"Push"}))});function eh(){return(0,s.jsx)(c.u,{content:"An error occurred while fetching the list of connected Git repositories.",side:"bottom",children:(0,s.jsx)(ed,{disabled:!0})})}var ex=function(){return(0,s.jsx)(c.Od,{height:32,width:71.32})},ef=t(46326),ep=t(50950),em=t(41834),eg=t(16847),ej=t(80262),ev=t(97729),ey=t.n(ev),eb=t(88932),eC=t(65077),e_=function(){var e,n=(0,em.X)(),t=n.unSyncedSlices,c=n.unSyncedCustomTypes,h=n.changedCustomTypes,x=n.changedSlices,p=n.modelsStatuses,m=(0,ej.L)(),g=(0,eg.n)(),j=(0,a.Z)(),v=j.pushChangesSuccess,y=j.refreshState,b=(0,u.useState)(!1),C=b[0],_=b[1],w=(0,u.useState)(void 0),k=w[0],S=w[1],Z=(0,ep.g)().autoSyncStatus,T=(0,en.useRouter)(),D=t.length+c.length;(0,u.useEffect)(function(){("synced"===Z||"failed"===Z||"syncing"===Z)&&T.push("/")},[Z,T]);var z=(e=(0,i.Z)(function(e){var n,t,i;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,5,,6]),_(!0),S(void 0),[4,(0,ef.t)({confirmDeleteDocuments:e,changedCustomTypes:h,changedSlices:x})];case 1:if(!(void 0!==(n=t.sent())))return[3,2];return S(n),[3,4];case 2:return[4,(0,L.y0)()];case 3:y(t.sent()),v(),eb.Am.success("All slices and types have been pushed"),t.label=4;case 4:return[3,6];case 5:return i=t.sent(),console.error("Something went wrong when manually pushing your changes",i),eb.Am.error("Something went wrong when pushing your changes. Check your terminal logs."),[3,6];case 6:return _(!1),[2]}})}),function(n){return e.apply(this,arguments)}),O=(0,u.useMemo)(function(){return m?g===l.t.UNAUTHORIZED||g===l.t.FORBIDDEN?(0,s.jsx)(d,{authStatus:g}):0===D?(0,s.jsx)(er,{}):(0,s.jsx)(N,{unSyncedSlices:t,unSyncedCustomTypes:c,modelsStatuses:p,authStatus:g,isOnline:m}):(0,s.jsx)(f,{})},[m,g,D,t,c,p,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ey(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(o.LN,{children:[(0,s.jsxs)(o.wd,{children:[(0,s.jsx)(o.Cx,{children:(0,s.jsx)(V.g,{children:"Changes"})}),(0,s.jsx)(o.K2,{children:(0,s.jsx)(el,{disabled:0===D||!m||g===l.t.UNAUTHORIZED||g===l.t.FORBIDDEN||C,loading:C,onClick:function(){z(!1)}})})]}),(0,s.jsx)(o.RN,{children:(0,s.jsxs)(eC.xR,{sx:{display:"flex",flexDirection:"column"},children:[O,(0,s.jsx)(U,{pushChanges:function(e){z(e)},modalData:k,onClose:function(){return S(void 0)}}),(0,s.jsx)(G,{pushChanges:function(e){z(e)},modalData:k,onClose:function(){return S(void 0)}})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return u},Qj:function(){return p},T9:function(){return h},nf:function(){return f},u2:function(){return d},_T:function(){return x}});var i=t(67557),r=t(62230),s=t(85244),o=t(98240),c=t(52322),l=t(22715),a=t(6277);t(69143);var u=function(e){var n=e.backgroundImage,t=e.style,l=(0,o.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,c.jsx)("article",(0,s.Z)((0,r.Z)({},l),{className:(0,a.W)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,i.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",u)),style:(0,r.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},h=function(e){return(0,c.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},x=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,r.Z)({},e),{className:"_18bjhbz4"}))},f=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,r.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},p=function(e){return(0,c.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},80441:function(e,n,t){"use strict";t.d(n,{Q:function(){return x}});var i=t(22710),r=t(99267);let s={GitHub:"gitHub"};var o=t(62230),c=t(85244),l=t(52322),a=function(e){return(0,l.jsx)("svg",(0,c.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,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},u=function(e){return(0,l.jsx)("svg",(0,c.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,l.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},d=function(e){return(0,l.jsx)("svg",(0,c.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,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},h=t(81038),x={gitHub:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("gitHub")];case 1:return[2,e.sent()]}})}),Icon:u,name:"GitHub",supported:m("gitHub")},bitbucket:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("bitbucket")];case 1:return[2,e.sent()]}})}),Icon:a,name:"Bitbucket",supported:m("bitbucket")},gitLab:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("gitLab")];case 1:return[2,e.sent()]}})}),Icon:d,name:"GitLab",supported:m("gitLab")}};function f(e){return p.apply(this,arguments)}function p(){return(p=(0,i.Z)(function(e){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:if(!m(e))throw Error("Not implemented.");return[4,h.j.git.getProviderAppInstallURL({provider:e})];case 1:return n=t.sent(),window.open(n,"git-provider-app-installation"),[2]}})})).apply(this,arguments)}function m(e){return Boolean(Object.values(s).includes(e))}},75499:function(e,n,t){"use strict";t.d(n,{G:function(){return a}});var i=t(22710),r=t(17064),s=t(99267),o=t(17329),c=t(19334),l=t(81038);function a(){var e,n,t=(0,r.Z)((0,c.f)(),1)[0];return{linkedGitRepos:(0,o.QT)(u,[t.repositoryName]),linkRepo:(e=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,o.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,o.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function u(e){return d.apply(this,arguments)}function d(){return(d=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return c}});var i=t(22710),r=t(99267),s=t(17329),o=t(81038);function c(){var e,n=(0,s.QT)(l,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,s.VA)(l,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function l(){return a.apply(this,arguments)}function a(){return(a=(0,i.Z)(function(){return(0,r.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},69143:function(){},21052:function(e){e.exports={root:"TextLink_root__lUIIv","color-primary":"TextLink_color-primary__WDK3_","color-secondary":"TextLink_color-secondary__mlUMF",endIcon:"TextLink_endIcon__f687_","icon-normal":"TextLink_icon-normal__CXnLk","icon-smallBold":"TextLink_icon-smallBold__Hp6aU","icon-inherit":"TextLink_icon-inherit__gbJsO"}}},function(e){e.O(0,[898,789,123,543,918,25,286,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(26971)}])},26971:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var r=t(52322),s=t(840),i=t(58882),o=t(17329),c=t(22715),a=t(93858),x=t(62230),l=t(85244),C=function(e){return(0,r.jsxs)("svg",(0,l.Z)((0,x.Z)({width:"127",height:"101",viewBox:"0 0 127 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,r.jsx)("line",{x1:"0.353553",y1:"35.9863",x2:"15.5467",y2:"51.1794",stroke:"#C8C7CB"}),(0,r.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,r.jsx)("line",{x1:"99.5522",y1:"8.40984",x2:"87.2281",y2:"26.0104",stroke:"#C8C7CB"}),(0,r.jsx)("line",{x1:"126.408",y1:"41.0854",x2:"108.807",y2:"53.4094",stroke:"#C8C7CB"}),(0,r.jsx)("path",{d:"M93.5 93L76 81.9883L93.5 87V93Z",fill:"#6F6E77"}),(0,r.jsx)("path",{d:"M92 100.488H36C34.8954 100.488 34 99.5929 34 98.4883V37.9883C34 36.8837 34.8954 35.9883 36 35.9883H92C93.1046 35.9883 94 36.8837 94 37.9883V98.4883C94 99.5929 93.1046 100.488 92 100.488Z",stroke:"#1A1523"}),(0,r.jsx)("path",{d:"M74.4297 58.7688C71.569 63.3138 63.3588 74.9883 54.5 74.9883L93.8417 86.9402C93.9471 86.9722 94.0473 87.0119 94.1481 87.0563C95.014 87.4377 99.5549 89.2156 104.5 86.9883C106.535 86.0718 109.03 82.7182 110.424 80.6551C111.04 79.7445 110.743 78.5257 109.805 77.9526L77.2788 58.0753C76.3086 57.4824 75.0354 57.8065 74.4297 58.7688Z",fill:"#5842C3"}),(0,r.jsx)("path",{d:"M34 47.9883C34 47.9883 42.3922 74.9883 54.5 74.9883M54.5 74.9883C63.3588 74.9883 71.569 63.3138 74.4297 58.7688C75.0354 57.8065 76.3086 57.4824 77.2788 58.0753L109.805 77.9526C110.743 78.5257 111.04 79.7445 110.424 80.6551C109.03 82.7182 106.535 86.0718 104.5 86.9883C99.5549 89.2156 95.014 87.4377 94.1481 87.0563C94.0473 87.0119 93.9471 86.9722 93.8417 86.9402L54.5 74.9883Z",stroke:"#1A1523"}),(0,r.jsx)("path",{d:"M34 48.4883H94",stroke:"#1A1523"}),(0,r.jsx)("circle",{cx:"40",cy:"41.9883",r:"1.5",stroke:"#1A1523"}),(0,r.jsx)("circle",{cx:"46",cy:"41.9883",r:"1.5",stroke:"#1A1523"}),(0,r.jsx)("circle",{cx:"52",cy:"41.9883",r:"1.5",stroke:"#1A1523"})]}))},u=t(2784);function h(){var e=(0,u.useState)(!1),n=e[0],t=e[1],s=(0,u.useState)(!1),x=s[0],l=s[1];return(0,r.jsx)(c.xu,{display:"flex",justifyContent:"center",height:"100vh",alignItems:"center",backgroundColor:"grey2",children:(0,r.jsxs)(c.xu,{display:"flex",flexDirection:"column",alignItems:"center",width:384,children:[(0,r.jsx)(C,{}),(0,r.jsx)(c.xv,{variant:"h3",align:"center",sx:{marginTop:16},children:"Blank page"}),(0,r.jsx)(c.xv,{color:"grey11",align:"center",sx:{marginBottom:16},children:"Welcome to Slice Machine. Your journey starts with your first page type — the model that you will use to create pages for your website."}),(0,r.jsx)(c.zx,{loading:n,onClick:function(){l(!0)},children:"Create a page type"}),(0,r.jsx)(i.M,{format:"page",isCreating:n,isOpen:x,origin:"onboarding",onCreateChange:function(e){t(e),o.Fs.clear(a.f,[])},onOpenChange:l})]})})}var f=function(){return(0,a.N)()?(0,r.jsx)(h,{}):(0,r.jsx)(s.F,{format:"page"})}}},function(e){e.O(0,[799,727,774,888,179],function(){return e(e.s=87314)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[274],{41535:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs",function(){return r(8951)}])},8951:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return p}});var t=r(52322),i=r(55156),s=r(22715),c=r(41730),a=r(8564),l=r(97729),o=r.n(l),u=r(2784),d=r(22710),h=r(17064),f=r(99267),x=r(88932),g=function(e){var n=e.title,r=e.enabled,i=e.onToggle,c=e.children;return(0,t.jsx)(s.Zb,{variant:"outlined",children:(0,t.jsxs)(s.xu,{gap:8,padding:16,children:[(0,t.jsx)(s.xu,{padding:{top:6},children:(0,t.jsx)(s.I5,{name:"viewDay",size:"medium",color:"grey11"})}),(0,t.jsxs)(s.xu,{flexDirection:"column",flexGrow:1,children:[(0,t.jsx)(s.xv,{variant:"h3",children:n}),(0,t.jsx)(s.xv,{variant:"normal",children:c})]}),(0,t.jsx)(s.xu,{width:128,justifyContent:"end",children:(0,t.jsx)(s.rs,{size:"medium",checked:r,onCheckedChange:function(e){return i(e)}})})]})})},b=r(63269),j=function(){var e,n,r,i,c,a,l=(0,h.Z)((e="legacySliceUpgrader",n="Legacy Slice Upgrader",i=(0,h.Z)((0,b.E)(e),2),c=i[0],a=i[1],[c,(r=(0,d.Z)(function(e){var r;return(0,f.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,a(e)];case 1:return t.sent(),x.Am.success(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n)),[3,3];case 2:return r=t.sent(),console.error(r),x.Am.error(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n)),[3,3];case 3:return[2]}})}),function(e){return r.apply(this,arguments)})]),2),o=l[0],u=l[1];return(0,t.jsxs)(s.xu,{flexDirection:"column",gap:32,children:[(0,t.jsx)("header",{children:(0,t.jsx)(s.xv,{variant:"normal",children:"Slice Machine Labs gives you early access to new features before they're widely released. Experimental features are works-in-progress and potentially unstable, so you may find some bugs and breaking changes along the way."})}),(0,t.jsx)(s.xu,{flexDirection:"column",gap:16,children:(0,t.jsxs)(g,{title:"Legacy Slice Upgrader",enabled:o.enabled,onToggle:function(e){u(e)},children:["The Legacy Slice Upgrader allows you to convert old slices (legacy and composite slices) to slices managed by Slice Machine (shared slices). This feature is experimental, and we strongly recommend that you test it with a"," ",(0,t.jsx)("a",{href:"https://prismic.io/docs/environments",target:"_blank",children:"Prismic environment"})," ","or you'll be at risk of losing past content."]})})]})},p=function(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o(),{children:(0,t.jsx)("title",{children:"Labs - Slice Machine"})}),(0,t.jsx)(a.S,{renderError:function(){return(0,t.jsx)(y,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your labs configuration."})})})},children:(0,t.jsx)(u.Suspense,{fallback:(0,t.jsx)(y,{withHeader:!0,children:(0,t.jsx)(s._3,{})}),children:(0,t.jsx)(y,{withHeader:!0,children:(0,t.jsx)(j,{})})})})]})},y=function(e){var n=e.children,r=e.withHeader;return(0,t.jsxs)(i.LN,{children:[void 0!==r&&r?(0,t.jsx)(i.wd,{children:(0,t.jsx)(i.Cx,{children:(0,t.jsx)(c.g,{children:"Labs"})})}):null,(0,t.jsx)(i.RN,{children:n})]})}},63269:function(e,n,r){"use strict";r.d(n,{E:function(){return o}});var t=r(22710),i=r(62230),s=r(85244),c=r(17064),a=r(99267),l=r(19334);function o(e){var n,r,o,u=(0,c.Z)((0,l.f)(),2),d=u[0],h=u[1],f=(o=(0,t.Z)(function(n){var r;return(0,a.__generator)(this,function(t){switch(t.label){case 0:return r=(0,s.Z)((0,i.Z)({},d),{labs:(0,i.Z)({},d.labs)}),n?r.labs[e]=n:e in r.labs&&delete r.labs[e],0===Object.keys(r.labs).length&&delete r.labs,[4,h(r)];case 1:return t.sent(),[2]}})}),function(e){return o.apply(this,arguments)});return[{enabled:null!==(r=null==d?void 0:null===(n=d.labs)||void 0===n?void 0:n[e])&&void 0!==r&&r},f]}},19334:function(e,n,r){"use strict";r.d(n,{f:function(){return a}});var t=r(22710),i=r(99267),s=r(17329),c=r(81038);function a(){var e,n=(0,s.QT)(l,[]),r=(e=(0,t.Z)(function(e){return(0,i.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,s.VA)(l,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,r]}function l(){return o.apply(this,arguments)}function o(){return(o=(0,t.Z)(function(){return(0,i.__generator)(this,function(e){return[2,c.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=41535)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{24994:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return t(96358)}])},96358:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ef}});var r=t(52322),i=t(55156),o=t(22715),c=t(41730),s=t(37792),l=t(62230),u=t(85244),a=t(98240),d=t(88921),h=t.n(d),f=function(e){return(0,r.jsx)("div",(0,u.Z)((0,l.Z)({},e),{className:h().root}))},x=function(e){var n=e.children,t=(0,a.Z)(e,["children"]);return(0,r.jsx)("div",(0,u.Z)((0,l.Z)({},t),{className:h().legend,children:(0,r.jsx)(o.xv,{color:"grey11",component:"span",noWrap:!0,variant:"smallBold",children:n})}))},p=function(e){return(0,r.jsx)("div",(0,u.Z)((0,l.Z)({},e),{className:h().header}))},_=function(e){return(0,r.jsx)("div",(0,u.Z)((0,l.Z)({},e),{className:h().content}))},g=function(e){return(0,r.jsx)("ul",(0,u.Z)((0,l.Z)({},e),{className:h().list}))},m=function(e){var n=e.action,t=e.children,i=(0,a.Z)(e,["action","children"]);return(0,r.jsxs)("li",(0,u.Z)((0,l.Z)({},i),{className:h().listItem,children:[(0,r.jsx)(o.xv,{className:h().listItemText,component:"span",noWrap:!0,variant:"bold",children:t}),n]}))},j=function(e){var n=e.action,t=e.children,i=(0,a.Z)(e,["action","children"]);return(0,r.jsxs)("div",(0,u.Z)((0,l.Z)({},i),{className:h().footer,children:[(0,r.jsx)(o.xv,{className:h().footerText,color:"grey11",component:"span",noWrap:!0,variant:"small",children:t}),n]}))},v=t(8564),w=function(e){var n=e.title,t=e.description,i=e.action;return(0,r.jsxs)(o.xu,{flexDirection:"column",padding:{block:72,inline:100},children:[(0,r.jsx)(o.xv,{align:"center",variant:"emphasized",children:n}),(0,r.jsx)(o.xv,{align:"center",color:"grey11",children:t}),Boolean(i)?(0,r.jsx)(o.hE,{sx:{alignSelf:"center",marginTop:8},children:i}):void 0]})},y=t(22710),b=t(99267),C=t(98863),S=t(80441),k=t(2784),Z=t(88932),F=function(){return(0,r.jsx)(o.hE,{children:(0,C.XP)(S.Q).map(function(e){return(0,r.jsx)(L,{provider:e,sx:{flexBasis:0,flexGrow:1}},e)})})},L=function(e){var n=e.provider,t=e.sx,i=S.Q[n],c=i.connect,s=i.Icon,l=i.name,u=i.supported,a=(0,k.useState)(!1),d=a[0],h=a[1];return(0,r.jsxs)(o.zx,{color:"grey",disabled:!u,loading:d,onClick:function(){(0,y.Z)(function(){var e,n;return(0,b.__generator)(this,function(t){switch(t.label){case 0:h(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,c()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),n="Could not connect to ".concat(l),console.error(n,e),Z.Am.error(n),h(!1),[3,4];case 4:return[2]}})})()},renderStartIcon:function(){return(0,r.jsx)(s,{color:o.TV.color.greyLight11})},sx:t,children:[l,u?void 0:(0,r.jsx)(o.xv,{color:"inherit",variant:"small",children:" (soon)"})]})},N=t(81541),I=function(e){var n=e.date,t=(0,a.Z)(e,["date"]);return(0,r.jsx)(o.xv,(0,u.Z)((0,l.Z)({},t),{color:"inherit",variant:"inherit",children:function(e){var n,t,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return T.format((n=e,t=o,r=R(n),i=R(t),Math.round((+r-+i)/864e5)),"day")}(n)}))},T=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"narrow"});function R(e){var n=new Date(e);return n.setHours(0,0,0,0),n}var P=t(17064),q=t(19334),A=t(81038),H=t(9979),G=t(63397),D=function(e){var n,t,i,c,s=e.linkRepo,l=e.repo,u=e.trigger,a=S.Q[l.provider],d=(n={git:l},t=(0,P.Z)((0,q.f)(),1)[0],{updateToken:(i=(0,y.Z)(function(e){return(0,b.__generator)(this,function(r){switch(r.label){case 0:return[4,A.j.git.updateWriteAPIToken({prismic:{domain:t.repositoryName},git:n.git,token:e})];case 1:return r.sent(),[2]}})}),function(e){return i.apply(this,arguments)})}).updateToken,h=(0,H.U)().repositoryUrl;return(0,r.jsxs)(o.Vq,{size:{width:448,height:"auto"},trigger:u,children:[(0,r.jsx)(o.fK,{title:"Prismic Write API token required"}),(0,r.jsx)(o.cZ,{children:(0,r.jsx)(G.J9,{initialValues:{writeAPIToken:""},validate:function(e){if(0===e.writeAPIToken.length)return{writeAPIToken:"Cannot be empty"}},onSubmit:(c=(0,y.Z)(function(e){var n,t;return(0,b.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,s(l)];case 1:return r.sent(),[4,d(e.writeAPIToken)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),t="Could not connect to ".concat(l.name),console.error(t,n),Z.Am.error(t),[3,4];case 4:return[2]}})}),function(e){return c.apply(this,arguments)}),children:function(e){return(0,r.jsxs)("form",{onSubmit:e.handleSubmit,children:[(0,r.jsxs)(o.xu,{flexDirection:"column",gap:4,padding:16,children:[(0,r.jsx)(o.yt,{disabled:e.isSubmitting,error:"string"==typeof e.errors.writeAPIToken,label:"Paste your Write API token",onValueChange:function(n){e.setFieldValue("writeAPIToken",n)},placeholder:"Write API token",value:e.values.writeAPIToken}),(0,r.jsxs)(o.xv,{color:"grey11",children:["Required to sync models from ",a.name," to Prismic."]})]}),(0,r.jsx)(o.kX,{cancel:{text:"Cancel"},link:(0,r.jsx)(o.hh,{href:new URL("/settings/apps",h).href,children:"Create a Prismic Write API token"}),ok:{disabled:!e.isValid,loading:e.isSubmitting,onClick:function(){e.submitForm()},text:"Save Token"},size:"medium"})]})}})})]})},E=function(e){var n=e.repo,t=e.trigger,i=e.unlinkRepo,c=(0,k.useState)(!1),s=c[0],l=c[1];return(0,r.jsxs)(o.Vq,{size:{width:448,height:"auto"},trigger:t,children:[(0,r.jsx)(o.fK,{title:"Remove Git Connection"}),(0,r.jsx)(o.cZ,{children:(0,r.jsx)(o.xu,{flexDirection:"column",padding:16,children:(0,r.jsx)(o.xv,{children:"You will not be able to push your code alongside your models anymore. Note that you can reconnect your Git repository at any time. Are you sure you want to continue?"})})}),(0,r.jsx)(o.kX,{asFooter:!0,cancel:{text:"Cancel"},ok:{color:"tomato",loading:s,onClick:function(){(0,y.Z)(function(){var e,t;return(0,b.__generator)(this,function(r){switch(r.label){case 0:l(!0),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i(n)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),t="Could not disconnect from ".concat(n.name),console.error(t,e),Z.Am.error(t),[3,4];case 4:return l(!1),[2]}})})()},text:"Disconnect"},size:"medium"})]})},Q=t(75499),B=function(e){var n=e.mode,t=e.repos,i=(0,Q.G)(),c=i.linkRepo,s=i.unlinkRepo;return(0,r.jsx)(g,{children:"link"===n?t.map(function(e){return(0,r.jsxs)(m,{action:(0,r.jsx)(D,{linkRepo:c,repo:e,trigger:(0,r.jsx)(o.zx,{color:"grey",children:"Connect"})}),children:[e.name,(0,r.jsxs)(o.xv,{color:"grey11",children:[" • ",(0,r.jsx)(I,{date:e.pushedAt})]})]},"".concat(e.provider,"@").concat(e.id))}):t.map(function(e){return(0,r.jsx)(m,{action:(0,r.jsx)(E,{repo:e,trigger:(0,r.jsx)(o.zx,{color:"grey",children:"Disconnect"}),unlinkRepo:s}),children:e.name},"".concat(e.provider,"@").concat(e.owner,"/").concat(e.name))})})},M=function(){return(0,r.jsx)(g,{children:(0,N.Z)([,,,,].keys()).map(function(e){return(0,r.jsx)(m,{action:(0,r.jsx)(o.Od,{height:32,width:67.59}),children:(0,r.jsx)(o.Od,{height:24,sx:{verticalAlign:"middle"},width:129.92})},e)})})},O=function(e){var n=e.disabled,t=e.owners,i=void 0===t?[]:t,c=e.selectedOwner,s=e.onSelectedOwnerChange,l=e.sx;return(0,r.jsx)(o.Ph,{color:"grey",constrainContentWidth:!0,disabled:n,flexContent:!0,onValueChange:function(e){var n,t=(0,P.Z)((n=e,n.split("@")),2),r=t[0],o=t[1],c=i.find(function(e){return e.provider===r&&e.id===o});c&&(null==s||s(c))},placeholder:"Owner",renderStartIcon:function(){return(0,r.jsx)(z,{owner:c})},size:"large",sx:l,value:c?V(c):void 0,children:i.map(function(e){return(0,r.jsx)(o.Ql,{renderStartIcon:function(){return(0,r.jsx)(z,{owner:e})},size:"large",value:V(e),children:e.name},V(e))})})},z=function(e){var n,t=e.owner,i=S.Q[null!==(n=null==t?void 0:t.provider)&&void 0!==n?n:"gitHub"].Icon;return(0,r.jsx)(i,{color:o.TV.color.greyLight11})};function V(e){return"".concat(e.provider,"@").concat(e.id)}var W=t(17329);function K(e,n,t,r){return U.apply(this,arguments)}function U(){return(U=(0,y.Z)(function(e,n,t,r){return(0,b.__generator)(this,function(i){switch(i.label){case 0:return[4,A.j.git.fetchRepos({provider:e,owner:n,query:t,page:r})];case 1:return[2,i.sent()]}})})).apply(this,arguments)}var X=function(e){var n=e.owners,t=(0,k.useState)(n[0]),i=t[0],o=t[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p,{children:(0,r.jsx)(O,{owners:n,selectedOwner:i,onSelectedOwnerChange:o,sx:{width:"calc(50% - 8px)"}})}),(0,r.jsx)(k.Suspense,{fallback:(0,r.jsx)(Y,{gitOwnerSelect:!1}),children:(0,r.jsx)(J,{owner:i})})]})},J=function(e){var n,t=e.owner,i=(n={provider:t.provider,owner:t.name},(0,W.QT)(K,[n.provider,n.owner,n.query,n.page,]));return i.length>0?(0,r.jsx)(B,{mode:"link",repos:i}):(0,r.jsx)(_,{children:(0,r.jsx)(w,{title:"No Results Found",description:"Try selecting a different Git account or organization on the top left."})})},Y=function(e){var n=e.gitOwnerSelect;return(0,r.jsxs)(r.Fragment,{children:[n?(0,r.jsx)(p,{children:(0,r.jsx)(O,{disabled:!0,sx:{width:"calc(50% - 8px)"}})}):void 0,(0,r.jsx)(M,{})]})};function $(){return ee.apply(this,arguments)}function ee(){return(ee=(0,y.Z)(function(){return(0,b.__generator)(this,function(e){switch(e.label){case 0:return[4,A.j.git.fetchOwners()];case 1:return[2,e.sent()]}})})).apply(this,arguments)}var en=t(90374),et=function(){return(0,r.jsxs)(f,{children:[(0,r.jsx)(x,{children:"Connected Git Repository"}),(0,r.jsx)(v.S,{renderError:eo,children:(0,r.jsx)(k.Suspense,{fallback:(0,r.jsx)(Y,{gitOwnerSelect:!0}),children:(0,r.jsx)(er,{})})}),(0,r.jsx)(j,{action:(0,r.jsx)(o.u,{content:"Documentation is coming soon.",side:"bottom",children:(0,r.jsx)(o.hU,{disabled:!0,icon:"openInNew"})}),children:"Learn more about Prismic for Git"})]})},er=function(){var e=(0,Q.G)().linkedGitRepos;return e.length>0?(0,r.jsx)(B,{mode:"unlink",repos:e}):(0,r.jsx)(ei,{})},ei=function(){var e=(0,W.QT)($,[]);return e.length>0?(0,r.jsx)(X,{owners:e}):(0,r.jsx)(_,{children:(0,r.jsx)(F,{})})};function eo(e,n){return(0,s.ff)(e)?(0,r.jsx)(ec,{}):(0,s.TW)(e)?(0,r.jsx)(es,{}):(0,r.jsx)(el,{reset:n})}var ec=function(){var e=(0,en.Z)().openLoginModal;return(0,r.jsx)(_,{children:(0,r.jsx)(w,{title:"It seems like you are logged out",description:"Log in to connect a Git repository.",action:(0,r.jsx)(o.zx,{onClick:e,children:"Log in to Prismic"})})})},es=function(){return(0,r.jsx)(_,{children:(0,r.jsx)(w,{title:"It seems like you do not have permission",description:"An owner or admin is required to connect a Git repository."})})},el=function(e){var n=e.reset;return(0,r.jsx)(_,{children:(0,r.jsx)(w,{title:"Unable to fetch data",description:"An error occurred while fetching the list of connected Git repositories.",action:(0,r.jsx)(o.zx,{color:"grey",onClick:n,children:"Retry"})})})},eu=t(80299),ea=t(97729),ed=t.n(ea),eh=t(5632),ef=function(){var e=(0,eu.M)(),n=(0,eh.useRouter)();return((0,k.useEffect)(function(){e.eligible||n.replace("/")},[e.eligible,n]),e.eligible)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ed(),{children:(0,r.jsx)("title",{children:"Settings - Slice Machine"})}),(0,r.jsxs)(i.LN,{children:[(0,r.jsx)(i.wd,{children:(0,r.jsx)(i.Cx,{children:(0,r.jsx)(c.g,{children:"Settings"})})}),(0,r.jsx)(i.RN,{children:(0,r.jsx)(o.xu,{flexDirection:"column",maxWidth:600,children:(0,r.jsx)(et,{})})})]})]}):null}},80441:function(e,n,t){"use strict";t.d(n,{Q:function(){return f}});var r=t(22710),i=t(99267);let o={GitHub:"gitHub"};var c=t(62230),s=t(85244),l=t(52322),u=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},a=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},d=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},h=t(81038),f={gitHub:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("gitHub")];case 1:return[2,e.sent()]}})}),Icon:a,name:"GitHub",supported:_("gitHub")},bitbucket:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("bitbucket")];case 1:return[2,e.sent()]}})}),Icon:u,name:"Bitbucket",supported:_("bitbucket")},gitLab:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("gitLab")];case 1:return[2,e.sent()]}})}),Icon:d,name:"GitLab",supported:_("gitLab")}};function x(e){return p.apply(this,arguments)}function p(){return(p=(0,r.Z)(function(e){var n;return(0,i.__generator)(this,function(t){switch(t.label){case 0:if(!_(e))throw Error("Not implemented.");return[4,h.j.git.getProviderAppInstallURL({provider:e})];case 1:return n=t.sent(),window.open(n,"git-provider-app-installation"),[2]}})})).apply(this,arguments)}function _(e){return Boolean(Object.values(o).includes(e))}},75499:function(e,n,t){"use strict";t.d(n,{G:function(){return u}});var r=t(22710),i=t(17064),o=t(99267),c=t(17329),s=t(19334),l=t(81038);function u(){var e,n,t=(0,i.Z)((0,s.f)(),1)[0];return{linkedGitRepos:(0,c.QT)(a,[t.repositoryName]),linkRepo:(e=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(a,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(a,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function a(e){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return s}});var r=t(22710),i=t(99267),o=t(17329),c=t(81038);function s(){var e,n=(0,o.QT)(l,[]),t=(e=(0,r.Z)(function(e){return(0,i.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,o.VA)(l,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function l(){return u.apply(this,arguments)}function u(){return(u=(0,r.Z)(function(){return(0,i.__generator)(this,function(e){return[2,c.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},88921:function(e){e.exports={flex:"FieldSet_flex__qy2tm",column:"FieldSet_column__NS4qQ FieldSet_flex__qy2tm",root:"FieldSet_root__XVbMv FieldSet_column__NS4qQ FieldSet_flex__qy2tm",row:"FieldSet_row__END9k FieldSet_flex__qy2tm",borderBottom:"FieldSet_borderBottom__L01vK",legend:"FieldSet_legend__JjRCM FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",header:"FieldSet_header__0Q7YD FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",content:"FieldSet_content__PDj3t FieldSet_column__NS4qQ FieldSet_flex__qy2tm",list:"FieldSet_list__HoMpl FieldSet_column__NS4qQ FieldSet_flex__qy2tm",listItem:"FieldSet_listItem__P0SKW FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",listItemText:"FieldSet_listItemText__J0_Fr",borderTop:"FieldSet_borderTop__qyC9U",footer:"FieldSet_footer__thBWh FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderTop__qyC9U",footerText:"FieldSet_footerText__mKIv2"}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=24994)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33],{30755:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]/simulator",function(){return t(68156)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),o=t(98240),s=t(52322),c=t(2784),a=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,x=e.form,f=e.isLoading,h=void 0!==f&&f,v=e.disabled,p=e.onClick,g=e.sx,m=e.iconSize,b=void 0===m?16:m,j=e.iconFill,C=e.variant,S=void 0===C?"primary":C,k=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(a.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),h?{cursor:"wait !important"}:{}),type:d,form:x,disabled:void 0!==v&&v||h,onClick:h?void 0:p,variant:S},k),{children:h?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$j,{size:b,color:u(S),"data-testid":l(k["data-testid"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:b,fill:j,"data-testid":l(k["data-testid"],"icon")}),t]})}))})},54132:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var i=t(62230),r=t(85244),o=t(98240),s=t(52322);t(2784);var c=t(75289),a=function(e){var n=e.bg,t=e.background,r=e.sx,o=e.withRadius,a=e.radius,l=e.children;return(0,s.jsx)(c.xu,{sx:(0,i.Z)({p:4,bg:n||t},o?{borderBottomLeftRadius:a,borderBottomRightRadius:a}:null,r),children:l})},l=function(e){var n=e.Header,t=void 0===n?null:n,l=e.SubHeader,u=void 0===l?null:l,d=e.Body,x=void 0===d?null:d,f=e.Footer,h=void 0===f?null:f,v=e.borderFooter,p=e.radius,g=void 0===p?"6px":p,m=e.bodySx,b=e.footerSx,j=e.sx,C=e.bg,S=e.background,k=e.children,y=(0,o.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,s.jsxs)(c.Zb,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:g},void 0===j?null:j)},y),{children:[t?(0,s.jsx)(t,{radius:g}):null,u?(0,s.jsx)(u,{radius:g}):null,(0,s.jsxs)(a,{bg:C,background:S,sx:void 0===m?{}:m,withRadius:!h,children:[x?(0,s.jsx)(x,{}):null,k||null]}),h?(0,s.jsx)(a,{bg:C,background:S,sx:(0,i.Z)({},void 0!==v&&v?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===b?{}:b),radius:g,withRadius:!0,children:"object"==typeof h?h:(0,s.jsx)(h,{})}):null]}))}},61931:function(e,n,t){"use strict";t.d(n,{q:function(){return l}});var i=t(62230),r=t(52322),o=t(2784),s=t(65186),c=t(75289),a=(0,o.memo)(function(e){var n=e.src;return(0,r.jsx)(c.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),l=function(e){var n=e.src,t=e.sx;return(0,r.jsx)(c.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"},t),children:void 0!==n?(0,r.jsx)(a,{src:n}):(0,r.jsxs)(c.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(s.eJU,{}),"You have no screenshot yet."]})})}},68156:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return es}});var i,r,o,s=t(52322),c=t(22710),a=t(62230),l=t(85244),u=t(99267),d=t(54132),x=t(61931),f=t(25812),h=t(77174),v=t(24340),p=t(90374),g=t(56580),m=t(75289),b=function(e){var n=e.sliceName,t=e.screenshotUrl,i=(0,g.v9)(function(e){return{isScreenshotModalOpen:(0,h.gP)(e,v.q.SCREENSHOT_PREVIEW)}}).isScreenshotModalOpen,r=(0,p.Z)().closeModals;return(0,s.jsx)(f.Z,{isOpen:i,shouldCloseOnOverlayClick:!0,contentLabel:"Screenshot Preview",portalClassName:"ScreenshotPreviewModal",onRequestClose:r,children:(0,s.jsx)(d.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},Header:function(){return(0,s.jsxs)(m.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,s.jsxs)(m.X6,{sx:{fontSize:"14px"},children:["Screenshot Preview for ",n]}),(0,s.jsx)(m.x8,{type:"button",onClick:function(){return r()}})]})},Footer:function(){return(0,s.jsx)(m.kC,{style:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:"1px solid #DCDBDD"},children:(0,s.jsx)(m.zx,{variant:"secondary",sx:{fontWeight:600},onClick:function(){return r()},children:"Close"})})},children:(0,s.jsx)(x.q,{src:t,sx:{height:"320px"}})})})},j=t(53559),C=t(71463),S=t(22715),k=t(25242),y=t(82770),w=t(8564),E=t(81541),R=t(2784),Z=function(e,n,t){var i=(0,R.useState)(e()),r=i[0],o=i[1],s=(0,R.useRef)(Date.now());return(0,R.useEffect)(function(){var t=setTimeout(function(){Date.now()-s.current>=n&&(o(e()),s.current=Date.now())},n-(Date.now()-s.current));return function(){clearTimeout(t)}},[n].concat((0,E.Z)(t))),r},D=t(39092),I=t(88932),z=t(65077),O=t(56577),M=t(85819),_=function(e){var n=e.children,t=e.sx;return(0,s.jsx)(m.kC,{sx:(0,a.Z)({bg:"grey07",height:"90%",width:"100%",justifyContent:"center",alignItems:"center",zIndex:"1"},t),children:(0,s.jsx)(m.kC,{sx:{marginTop:"-128px",justifyContent:"center",flexDirection:"column",alignItems:"center"},children:n})})},T=function(e){var n=e.onRetrigger;return(0,s.jsxs)(_,{children:[(0,s.jsx)(m.Ee,{src:"/iframe-not-running.png",sx:{width:"320px"}}),(0,s.jsx)(m.xv,{sx:{color:"textClear",mb:2,fontSize:"14px",lineHeight:"24px",fontWeight:"600"},children:"Slice Machine can't render your Slice"}),(0,s.jsxs)(m.xv,{sx:{color:"failedConnectText",maxWidth:"400px",textAlign:"center",fontSize:"12px",lineHeight:"22px"},children:["Ensure your website's development server is running by typing",(0,s.jsx)("br",{}),(0,s.jsx)(m.xv,{as:"code",variant:"styles.inlineCode",sx:{padding:"4px",borderRadius:"6px"},children:"npm run dev"}),"\xa0 in your terminal at the root of your website directory.",(0,s.jsx)("br",{})," If that doesn't work, see the\xa0",(0,s.jsx)(m.rU,{target:"_blank",href:"https://prismic.io/docs/slice-machine#simulate-slices",sx:{color:"link"},children:"troubleshooting instructions."})]}),(0,s.jsx)(O.z,{onClick:n,label:"Refresh",Icon:M.Fer,iconSize:20,iconFill:"#6F6E77",variant:"secondaryMedium",sx:{mt:"16px"}})]})},F=t(75100),N=t(19909),B=function(e){var n=e.defaultValue,t=e.variations,i=e.MenuItemAction,r=e.onChange;return(0,s.jsxs)(m.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"4px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:250,maxWidth:350,color:"text"},children:[(0,s.jsxs)(m.xv,{sx:{p:3,fontSize:12,color:"textClear"},children:[t.length," VARIATION",t.length>1?"S":""]}),(0,s.jsxs)(m.kC,{sx:{p:0,flexDirection:"column"},children:[t.map(function(e){return(0,s.jsx)(A,{value:e,isActive:e.id===n.id,onClick:r},e.id)}),i||null]})]})},A=function(e){var n=e.value,t=e.isActive,i=e.onClick;return(0,s.jsx)(m.xu,{sx:{px:3,py:2,color:t?"primary":"",cursor:"pointer",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(t?null==n?void 0:n.primary:null==n?void 0:n.background)},borderRadius:0,bg:"background",":hover":{bg:"hoverBackground",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(null==n?void 0:n.primary)}}},onClick:function(){return i(n)},children:n.name})},L=function(e){var n=e.buttonSx,t=e.defaultValue,i=e.variations,r=e.onNewVariation,o=e.onChange,c=e.sx,l=e.disabled,u=(0,R.useState)(!1),d=u[0],x=u[1],f=(0,R.useState)(t||i[0]),h=f[0],v=f[1];(0,R.useEffect)(function(){t&&v(t)},[t]);var p=function(e){x(!1),v(e),setTimeout(function(){return o(e)},210)},g=(0,s.jsx)(m.xu,{sx:{p:2},children:(0,s.jsx)(m.zx,{variant:"transparent",sx:{color:"text"},onClick:function(){x(!1),r&&r()},children:"+ Add new variation"})});return(0,s.jsx)(m.xu,{sx:c,children:(0,s.jsx)(N.Popover,{align:"start",isOpen:d,onClickOutside:function(){return x(!1)},positions:["bottom"],padding:10,content:function(){return(0,s.jsx)(B,{defaultValue:h,variations:i,onChange:p,MenuItemAction:r?g:void 0})},containerClassName:"variationSelectorContainer",children:(0,s.jsxs)(m.zx,{sx:(0,a.Z)({},n),variant:"dropDownButton",onClick:function(){return x(!d)},disabled:l,children:[h.name," ",d?(0,s.jsx)(F.bOz,{size:"16px","aria-label":"Collapse variations"}):(0,s.jsx)(F.mEq,{size:"16px","aria-label":"Expand variations"})]})})})},P=function(e){return(0,s.jsxs)("svg",(0,l.Z)((0,a.Z)({viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3304 19.693C50.9182 18.9787 50.2527 18.6526 50.2527 18.6526L64.7906 10.2077C65.5266 9.78011 66.4679 10.0339 66.8929 10.7745C67.3179 11.5151 67.0657 12.4622 66.3294 12.8898L52.639 20.8424C52.639 20.8424 51.7428 20.4072 51.3304 19.693Z",fill:"current"}),(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.6775 54.7814C58.0794 48.7394 61.6433 35.3572 55.6378 24.8917C54.7801 23.397 53.7736 22.0427 52.6481 20.8367L32.9428 32.2832C32.2068 32.7108 31.2655 32.457 30.8405 31.7165C30.4155 30.9757 30.6677 30.0287 31.4039 29.6011L50.2693 18.6425C43.486 13.2668 33.8645 12.2736 25.9299 16.8827C15.5282 22.9249 11.9642 36.3071 17.9697 46.7727C18.8274 48.2671 19.8339 49.6216 20.9595 50.8276L41.1791 39.0822C41.9151 38.6546 42.8564 38.9086 43.2814 39.6492C43.7064 40.3897 43.4542 41.3368 42.7182 41.7644L23.3384 53.0217C30.1217 58.3975 39.7432 59.3906 47.6775 54.7814Z",fill:"current"}),(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.20645 61.7656C4.78145 61.0248 5.03367 60.078 5.76978 59.6502L20.9371 50.8398C20.9371 50.8398 21.8578 51.2406 22.3053 51.7062C22.7528 52.1717 23.361 53.0078 23.361 53.0078L7.30887 62.3323C6.57274 62.7599 5.63144 62.5061 5.20645 61.7656Z",fill:"current"})]}))},W=t(5632),H=t.n(W),U=function(e,n,t){if(!n){H().push("/".concat(e.href,"/").concat(e.model.name));return}var i,r,o,s,c,a,l,u,d,x=(r=(i={lib:e.href,sliceName:e.model.name,variationId:null==n?void 0:n.id,isSimulator:t}).lib,o=i.sliceName,s=i.variationId,a=void 0===(c=i.options)?{}:c,l=i.isSimulator,u="/slices/[lib]/[sliceName]/[variation]".concat(l?"/simulator":""),d="/slices/".concat(r,"/").concat(o,"/").concat(s).concat(l?"/simulator":""),{href:u,as:d,options:a,all:[u,d,a]});H().push(x.href,x.as,x.options)},V=function(e){var n=e.slice,t=e.variation,i=e.isDisplayEditor,r=e.toggleIsDisplayEditor,o=e.onSaveMock,c=e.actionsDisabled,a=e.isSavingMock;return(0,s.jsxs)(m.kC,{sx:{p:"16px",display:"flex",bg:"grey07",gridTemplateRows:"1fr",borderBottom:"1px solid #DCDBDD",justifyContent:"space-between"},children:[(0,s.jsxs)(m.kC,{sx:{alignItems:"center"},children:[(0,s.jsx)(P,{height:"20px",width:"20px",fill:"#1A1523"}),(0,s.jsx)(m.xv,{sx:{ml:2,mr:"12px",fontSize:"14px",color:"#1A1523",fontWeight:"600",letterSpacing:"-0.15px"},children:n.model.name}),(0,s.jsx)(L,{defaultValue:t,variations:n.model.variations,onChange:function(e){return U(n,e,!0)},disabled:n.model.variations.length<=1||c})]}),(0,s.jsxs)(m.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,s.jsx)(m.kC,{sx:{alignItems:"center",justifyContent:"space-around"},children:(0,s.jsxs)(m.kC,{sx:{alignItems:"center",mr:4},children:[(0,s.jsx)(m.__,{htmlFor:"show-mock-editor",sx:{color:"#6F6E77",lineHeight:"16px",fontSize:"12px",fontWeight:"600",letterSpacing:"0px"},children:"Editor"}),(0,s.jsx)(m.rs,{id:"show-mock-editor",checked:i,onChange:r,disabled:c})]})}),(0,s.jsx)(O.z,{"data-testid":"save-mock",onClick:o,label:"Save mock content",disabled:a||c,variant:"primary",sx:{borderRadius:"6px",color:"#F1EEFE",fontWeight:"bold",border:"1px solid #5842C3",backgroundColor:"#6E56CF",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.04)","&:hover":{"&:not([disabled])":{backgroundColor:"#5842C3"}}}})]})]})},q=t(17064),X=t(16),K=function(e){var n,t,i,r,o,l,d,x=e.apiContent,f=e.screenDimensions,h=e.simulatorUrl,v=e.dryRun,p=e.isScreenshot,g=void 0!==p&&p,b=e.handleSimulatorConnectionResult,j=(0,q.Z)((t=(n=(0,R.useState)())[0],i=n[1],r=(0,R.useRef)(),o=(0,R.useRef)(),d=(0,R.useCallback)((l=(0,c.Z)(function(e){var n,t,s,a;return(0,u.__generator)(this,function(l){switch(l.label){case 0:if(null===(n=r.current)||void 0===n||n.disconnect(),null===(t=o.current)||void 0===t||t.disconnect(),i(void 0),!(null!=e))return[3,4];r.current=new X.SH(e),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r.current.connect()];case 2:var d;return l.sent(),i(r.current),d=(0,c.Z)(function(){var e;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return i(void 0),[4,null===(e=r.current)||void 0===e?void 0:e.connect({},!0)];case 1:return n.sent(),i(r.current),[2]}})}),s=function(){return d.apply(this,arguments)},o.current=new MutationObserver(function(e){e.forEach(function(e){"src"===e.attributeName&&s().catch(function(e){throw e})})}),o.current.observe(e,{attributeFilter:["src"]}),[3,4];case 3:return a=l.sent(),console.error(a),[3,4];case 4:return[2]}})}),function(e){return l.apply(this,arguments)}),[]),[t,d]),2),C=j[0],S=j[1];(0,R.useEffect)(function(){var e;if(!h){b("failed");return}if(void 0!==C){if(!C.connected){b("failed"),console.warn("Trying to use a disconnected simulator client.");return}(e=(0,c.Z)(function(){return(0,u.__generator)(this,function(e){switch(e.label){case 0:return[4,C.setSliceZone([x])];case 1:return e.sent(),[2]}})}),function(){return e.apply(this,arguments)})().then(function(){b("successful")}).catch(function(){b("failed")})}},[C,x,h]);var k,y,w,E,Z,D,I,z,O,M=(0,R.useState)(),_=M[0],T=M[1],F=(k=function(e){var n;T({height:e.blockSize,width:e.inlineSize})},w=(0,R.useRef)(),(0,R.useCallback)(function(e){var n;null===(n=w.current)||void 0===n||n.disconnect(),null!==e&&(w.current=new ResizeObserver(function(n){var t,i=(0,q.Z)(n,1)[0].contentRect;k({blockSize:i.height,inlineSize:i.width},e)}),w.current.observe(e))},[]));return(0,s.jsx)(m.kC,{ref:F,sx:(0,a.Z)({alignItems:"center",backgroundColor:"headSection",backgroundImage:"url(/pattern.png)",backgroundRepeat:"repeat",backgroundSize:"10px",border:g?void 0:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},borderRadius:g?void 0:8,display:"flex",height:"100%",justifyContent:"center",overflow:"hidden"},void 0!==v&&v?{display:"none"}:{}),children:h?(0,s.jsx)("iframe",{ref:S,src:h,style:(0,a.Z)({border:"none",maxHeight:"".concat(f.height,"px"),maxWidth:"".concat(f.width,"px"),minHeight:"".concat(f.height,"px"),minWidth:"".concat(f.width,"px"),overflowY:"auto"},_?{transform:"scale(".concat((E=f,Z=_,D=E.height,I=E.width,z=Z.height,O=Z.width,I>O||D>z?I-O>D-z?O/I:z/D:1),")")}:{display:"none"})}):null})},Y=function(e){var n=e.defaultValue,t=e.options,i=e.onChange;return(0,s.jsx)(m.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"6px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:180,maxWidth:350,color:"text"},children:(0,s.jsx)(m.kC,{sx:{p:0,flexDirection:"column"},children:t.map(function(e){return(0,s.jsx)(J,{value:e,isActive:e===n,onClick:i})})})})},J=function(e){var n=e.value,t=e.isActive,i=e.onClick;return(0,s.jsx)(m.xu,{sx:{p:2,cursor:"pointer",fontSize:"14px",borderRadius:0,bg:t?"hoverBackground":"background",":hover":{bg:"hoverBackground"}},onClick:function(){return i(n)},children:n})},$=function(e){var n=e.buttonSx,t=e.currentValue,i=e.options,r=e.onChange,o=e.disabled,c=(0,R.useState)(!1),a=c[0],l=c[1],u=function(e){l(!1),setTimeout(function(){return r(e)},210)};return(0,s.jsx)(m.xu,{children:(0,s.jsx)(N.Popover,{align:"start",isOpen:a,onClickOutside:function(){return l(!1)},positions:["bottom"],padding:2,content:function(){return(0,s.jsx)(Y,{defaultValue:t,options:i,onChange:u})},children:(0,s.jsxs)(m.zx,{sx:n,variant:"dropDownButton",onClick:function(){return l(!a)},disabled:o,children:[t," ",a?(0,s.jsx)(F.bOz,{size:"24px"}):(0,s.jsx)(F.mEq,{size:"24px"})]})})})},Q=t(67557);(o=i||(i={})).DESKTOP="Desktop",o.TABLET="Tablet",o.MOBILE="Mobile",o.CUSTOM="Custom";var G=(r={},(0,Q.Z)(r,i.DESKTOP,{width:1280,height:800}),(0,Q.Z)(r,i.TABLET,{width:1080,height:810}),(0,Q.Z)(r,i.MOBILE,{width:390,height:844}),r),ee=function(e){var n=e.label,t=e.startValue,i=e.onChange,r=e.sx,o=e.disabled,c=["e","-","+",",","."];return(0,s.jsxs)(m.kC,{sx:(0,a.Z)({alignItems:"center"},r),children:[(0,s.jsx)(m.__,{sx:{backgroundColor:"grey07",border:"transparent",borderRight:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorder))},borderRadius:"6px 0px 0px 6px",width:26,height:30,color:"greyIcon",fontWeight:"bold",fontSize:"14px",alignItems:"center",justifyContent:"center",position:"absolute",ml:"1px"},htmlFor:"".concat(n,"-screensize-input"),children:n}),(0,s.jsx)(m.II,{type:"number",name:"".concat(n,"-screensize-input"),disabled:o,sx:{width:80,height:32,p:0,border:"1px solid #E4E2E4",borderRadius:"6px","&::-webkit-outer-spin-button,&::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},color:"greyIcon",textAlign:"center",paddingLeft:26,"&:disabled":{cursor:"not-allowed","&:hover":{border:"1px solid #E4E2E4"},"&:active":{border:"1px solid #E4E2E4",boxShadow:"none"}}},onChange:i,value:t,min:"0",onKeyDown:function(e){c.includes(e.key)&&e.preventDefault()}})]})},en=function(e){var n=e.handleScreenSizeChange,t=e.screenDimensions,r=e.actionsDisabled,o=(0,R.useState)(i.DESKTOP),c=o[0],u=o[1],d=function(e){u(e),e!==i.CUSTOM&&n(G[e])},x=function(e){var t=Object.values(G).findIndex(function(n){return JSON.stringify(n)===JSON.stringify(e)}),r=t<0?i.CUSTOM:Object.keys(G)[t];u(r),n(e)};return(0,s.jsx)(m.kC,{sx:{alignItems:"center",pb:"16px",justifyContent:"space-between",variant:"small"},children:(0,s.jsxs)(m.kC,{sx:{alignItems:"center",flex:1},children:[(0,s.jsx)($,{options:Object.values(i),onChange:d,buttonSx:{alignSelf:"start"},currentValue:c,disabled:r}),(0,s.jsx)(ee,{label:"W",startValue:t.width.toString(),onChange:function(e){x((0,l.Z)((0,a.Z)({},t),{width:Number(e.target.value)}))},disabled:r,sx:{mx:2}}),(0,s.jsx)(F.eSQ,{size:16,color:"#6F6E77"}),(0,s.jsx)(ee,{label:"H",startValue:t.height.toString(),onChange:function(e){x((0,l.Z)((0,a.Z)({},t),{height:Number(e.target.value)}))},disabled:r,sx:{ml:2}})]})})},et=function(e){var n,t,r=e.slice,o=e.variation,d=(0,p.Z)().updateSliceMockSuccess,x=(0,g.v9)(function(e){return{simulatorUrl:(0,D.x0)(e),endpoints:(0,D.gZ)(e)}}),f=x.simulatorUrl,h=x.endpoints,v=(0,R.useMemo)(function(){return{embedsUrl:h.PrismicOembed,env:"prod",unsplashUrl:h.PrismicUnsplash}},[h.PrismicOembed,h.PrismicUnsplash]);(0,R.useEffect)(function(){y.Xe.track({event:"slice-simulator:open"})},[]);var E=(0,R.useRef)(!1);(0,R.useEffect)(function(){E.current=!0},[]);var O=function(e){E.current&&(E.current=!1,y.Xe.track({event:"editor:widget-used",sliceId:e}))},M=(0,R.useState)("waiting"),F=M[0],N=M[1];(0,R.useEffect)(function(){if("waiting"===F){var e=setTimeout(function(){N("failed")},2e4);return function(){return clearTimeout(e)}}},[F]);var B,A=function(e){"waiting"===F&&("failed"===e?y.Xe.track({event:"slice-simulator:is-not-running"}):er(!0),N(e))},L=function(){N("waiting")},P=(0,R.useState)(G[i.DESKTOP]),W=P[0],H=P[1],U=(0,R.useMemo)(function(){return j.id.fromSM(r.model)},[r.model]),q=(0,R.useState)(null),X=q[0],Y=q[1],J=(0,R.useMemo)(function(){var e,n;return(null==X?void 0:X.variation)===o.id?X:(null===(e=r.mocks)||void 0===e?void 0:e.find(function(e){return e.variation===o.id}))||{__TYPE__:"SharedSliceContent",variation:n=o.id,primary:{},items:[]}},[X,o.id]),$=(0,R.useMemo)(function(){return(0,k.renderSliceMock)(U,J).id},[]),Q=(0,R.useCallback)(function(){return function(){return(0,l.Z)((0,a.Z)({},(0,k.renderSliceMock)(U,J)),{id:$})}},[U,J]),ee=Z(Q,800,[U,J,]),et=(0,R.useState)(!1),ei=et[0],er=et[1],eo=(0,R.useState)(!1),es=eo[0],ec=eo[1],ea=(B=(0,c.Z)(function(){var e,n,t,i;return(0,u.__generator)(this,function(o){switch(o.label){case 0:if(!X)return[3,5];ec(!0),o.label=1;case 1:return o.trys.push([1,3,,4]),n={libraryID:r.from,sliceID:r.model.id,mocks:(null!==(e=r.mocks)&&void 0!==e?e:[]).filter(function(e){return e.variation!==X.variation}).concat(X)},[4,(0,y.y3)(n)];case 2:if((t=o.sent().errors).length>0)throw t;return d(n),I.Am.success("Saved"),[3,4];case 3:return i=o.sent(),console.error("Error while saving mock",i),I.Am.error("Error saving content"),[3,4];case 4:ec(!1),o.label=5;case 5:return[2]}})}),function(){return B.apply(this,arguments)});return(0,s.jsxs)(m.kC,{sx:{flexDirection:"column",height:"100vh"},children:[(0,s.jsx)(V,{slice:r,variation:o,isDisplayEditor:ei,actionsDisabled:"successful"!==F,toggleIsDisplayEditor:function(){return er(!ei)},onSaveMock:function(){ea()},isSavingMock:es}),(0,s.jsx)(m.xu,{sx:{flex:1,bg:"grey07",p:3,display:"flex",flexDirection:"column",height:"calc(100% - 73px - 16px)"},children:(0,s.jsxs)(m.kC,{sx:{flex:1,flexDirection:"row",position:"relative",width:"100%",height:"100%"},children:[(0,s.jsxs)(z.xR,{sx:{display:"flex",height:"100%",flexDirection:"column",flex:1,minWidth:0},children:[(0,s.jsx)(en,{handleScreenSizeChange:H,screenDimensions:W,actionsDisabled:"successful"!==F}),"failed"===F?(0,s.jsx)(T,{onRetrigger:L}):null,"successful"===F?(0,s.jsx)(K,{apiContent:ee,screenDimensions:W,simulatorUrl:f,handleSimulatorConnectionResult:A}):(0,s.jsx)(s.Fragment,{children:"waiting"===F?(0,s.jsxs)(_,{children:[(0,s.jsx)(m.$j,{variant:"styles.spinner"}),(0,s.jsx)(K,{apiContent:ee,screenDimensions:W,simulatorUrl:f,dryRun:!0,handleSimulatorConnectionResult:A})]}):null})]}),"successful"===F&&ei?(0,s.jsx)(m.kC,{className:"editor",sx:{flexDirection:"column",marginLeft:"16px",maxWidth:"440px",minWidth:"440px",overflowY:"auto"},children:(0,s.jsx)(w.S,{renderError:function(){return(0,s.jsx)(S.Iq,{title:"Editor error",description:"An error occurred while rendering the editor."})},children:(0,s.jsx)(R.Suspense,{children:(0,s.jsx)(C.kS,{config:v,content:J,onContentChange:function(e){Y(e),O(r.model.id)},sharedSlice:U},o.id)})})}):null]})}),!!(null===(n=r.screenshots[o.id])||void 0===n?void 0:n.url)&&(0,s.jsx)(b,{sliceName:r.model.name,screenshotUrl:null===(t=r.screenshots[o.id])||void 0===t?void 0:t.url})]})},ei=t(25998),er=t(97729),eo=t.n(er);function es(){var e=(0,W.useRouter)(),n=(0,ei.Z)(),t=n.slice,i=n.variation;return void 0===t||void 0===i?(e.replace("/"),null):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo(),{children:(0,s.jsx)("title",{children:"Simulator: ".concat(t.model.name," - Slice Machine")})}),(0,s.jsx)(et,{slice:t,variation:i})]})}},25998:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(95200),r=function(e,n,t){var r,o=null===(r=(0,i.Sd)(e))||void 0===r?void 0:r.find(function(e){return e.name.replace(/\//g,"--")===n});return null==o?void 0:o.components.find(function(e){return e.model.name===t})},o=t(5632),s=t(56580),c=function(){var e=(0,o.useRouter)(),n=(0,s.v9)(function(n){return{slice:r(n,e.query.lib,e.query.sliceName)}}).slice;if(!n)return{};var t=n.model.variations.find(function(n){return n.id===e.query.variation});return t?{slice:n,variation:t}:{}}}},function(e){e.O(0,[789,872,851,46,774,888,179],function(){return e(e.s=30755)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[136],{31314:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]",function(){return t(80809)}])},80809:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eS}});var i=t(52322),r=t(75329),o=t(22715),a=t(82770),s=t(76283),c=t(42189),l=t(17036),u=t(90374),d=t(5632),f=t(2784),p=t(56580),v=t(33710),m=function(e){var n=e.children,t=e.open,o=e.onClose;return(0,i.jsxs)(s.zs,{open:t,trigger:n,onClose:o,children:[(0,i.jsx)(s.Ev,{children:"Simulate your slices"}),(0,i.jsx)(s.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:r.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){a.Xe.track({event:"open-video-tutorials",video:r.Sn})}}),(0,i.jsx)(s.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(s.Rp,{children:"Got it"})]})},h=function(e){var n=e.disabled,t=(0,d.useRouter)(),a=(0,f.useRef)(null),s=(0,u.Z)().setSeenSimulatorToolTip,h=(0,p.v9)(function(e){return{hasSeenSimulatorTooltip:(0,l.bv)(e)}}).hasSeenSimulatorTooltip;(0,f.useEffect)(function(){var e=a.current;e&&!h&&setTimeout(function(){return v.Z.show(e)},5e3)},[h]);var y=function(){if(s(),a.current){var e=a.current;v.Z.hide(e)}};return(0,i.jsx)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:a,children:(0,i.jsx)(m,{open:!h,onClose:y,children:(0,i.jsx)(o.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){y(),window.open("".concat(t.asPath,"/simulator"),r.pq)},disabled:n,renderStartIcon:function(){return(0,i.jsx)(c.z,{color:o.TV.color.greyLight1,height:o.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:o.TV.size[24]})},children:"Simulate"})})})},y=t(55156),x=t(41730),g=t(47976),j=t(8564),b=t(22710),I=t(99267),Z=t(17329),w=t(81038);function S(e){return T.apply(this,arguments)}function T(){return(T=(0,b.Z)(function(e){var n,t,i;return(0,I.__generator)(this,function(r){switch(r.label){case 0:return[4,w.j.customTypes.readCustomType({id:e})];case 1:if(t=(n=r.sent()).errors,i=n.model,t.length>0)throw t;return[2,i]}})})).apply(this,arguments)}var k=t(67445),C=t(64722),F=t(20812),E=t(62230),R=t(85244),A=function(e){return(0,i.jsxs)("svg",(0,R.Z)((0,E.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M9.5 12L6 9.5L9.5 7V9.5V12Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M6 9.5H11C14.3 9.5 17 12.2 17 15.5V17.5M6 9.5L9.5 12V9.5V7L6 9.5Z",stroke:"currentColor",strokeLinecap:"round"})]}))},O=function(){var e,n,t=(e=(0,C.l)().source,n=(0,k.Ag)(e.query),void 0!==n&&(0,k.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(j.S,{children:(0,i.jsx)(f.Suspense,{children:(0,i.jsx)(o.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(_,{sourceCustomTypeId:t})})})}):null},_=function(e){var n,t=(n=e.sourceCustomTypeId,(0,Z.QT)(S,[n])),r=(0,f.useState)(!0),a=r[0],s=r[1],c=(0,d.useRouter)();if(void 0===t||!a)return null;var l=t.format,u=t.id,p=k.cd[l].getBuilderPagePathname(u);return(0,i.jsxs)(o.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(o.zx,{onClick:function(){c.push(p)},renderStartIcon:function(){return(0,i.jsx)(A,{})},children:["Return to ",t.label]}),(0,i.jsx)(o.zx,{onClick:function(){s(!1)},renderStartIcon:function(){return(0,i.jsx)(F.T,{})}})]})},D=t(74217),L=t(50950),N=t(26921),V=(0,f.createContext)(void 0);function M(e){var n=e.children,t=e.initialSlice,r=(0,d.useRouter)(),o=(0,f.useState)(t),s=o[0],c=o[1],l=(0,N.c)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),p=l.actionQueueStatus,v=l.setNextAction,m=(0,u.Z)().saveSliceSuccess,h=(0,D.R9)(m),y=(0,L.g)().syncChanges,x=(0,f.useMemo)(function(){var e=r.query.variation,n=s.model.variations.find(function(n){return n.id===e});if(n)return n;throw Error("Variation not found")},[s,r]),g=(0,f.useCallback)(function(e){c(e),v((0,b.Z)(function(){var n,t,i,r,o;return(0,I.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,a.Ve)(e)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,a.pL)({libraryID:e.from,sliceID:e.model.id})];case 2:if(r=(i=n.sent()).errors,o=i.mocks,r.length>0)throw r;return h((0,R.Z)((0,E.Z)({},e),{mocks:o})),y(),[2]}})}))},[v,h,y]),j=(0,f.useMemo)(function(){return{actionQueueStatus:p,slice:s,setSlice:g,variation:x}},[p,s,g,x]);return(0,i.jsx)(V.Provider,{value:j,children:"function"==typeof n?n(j):n})}function z(){var e=(0,f.useContext)(V);if(!e)throw Error("SliceBuilderProvider not found");return e}var P=t(4092),K=t(8482),q=t(53559),B=t(2353),H=t(44384),X=t(83462),U=t(28173),W=t(5479),G=t(11563),Q=t(38876),$=t(28316),J=function(){var e,n=z(),t=n.slice,r=n.setSlice,s=n.variation,c=(0,f.useState)(!1),l=c[0],u=c[1],d={eligible:(null==(e=(0,G.L)("slicemachine-groups-in-slices"))?void 0:e.value)==="on"},p=Boolean(s.items&&Object.keys(s.items).length>0),v=function(e){return function(n){if(d.eligible&&e===q.Rt.Items&&s.items&&Object.keys(s.items).length<=1){u(!0);return}var i=(0,W.AK)({slice:t,variationId:s.id,widgetArea:e,fieldId:n});r(i)}},m=function(e){return function(n){var i=n.apiId,o=n.newKey,a=n.value,c=(0,W.L4)({slice:t,variationId:s.id,widgetArea:e,previousFieldId:i,newFieldId:o,newField:a});r(c)}},h=function(e){return function(n){var i=n.id,o=n.label,c=n.widgetTypeName,l=B[c];l||console.log('Could not find widget with type name "'.concat(c,'". Please contact us!'));var u=l.create(o);if("Range"===u.type||"IntegrationFields"===u.type||"Separator"===u.type)throw Error("Unsupported Field Type: ".concat(u.type));try{B[u.type].schema.validateSync(u,{stripUnknown:!1})}catch(d){throw Error('Model is invalid for widget "'.concat(u.type,'".'))}var f=(0,W.xS)({slice:t,variationId:s.id,widgetArea:e,newFieldId:i,newField:u});r(f),a.Xe.track({event:"field:added",id:i,name:o,type:c,isInAGroup:!1,contentType:"slice"})}},y=function(e){return function(n){if(!(0,X.uS)(n)){var i=n.source,o=n.destination;if(o){var a=(0,W.gR)({slice:t,variationId:s.id,widgetArea:e,sourceIndex:i.index,destinationIndex:o.index});(0,$.flushSync)(function(){return r(a)})}}}},x=function(){var e=(0,W.Oh)({slice:t,variationId:s.id});r(e),u(!1)};return(0,i.jsxs)(U.aV,{children:[(0,i.jsx)(K.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,title:"Fields",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:s.primary,EditModal:P.Z,widgetsArray:H.Z,onDeleteItem:v(q.Rt.Primary),onSave:m(q.Rt.Primary),onSaveNewField:h(q.Rt.Primary),onDragEnd:y(q.Rt.Primary),poolOfFieldsToCheck:s.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,Q.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,Q.Ti)(e))},testId:"static-zone-content",isRepeatableCustomType:void 0}),!d.eligible||p?(0,i.jsx)(K.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,isRepeatable:!0,title:"Repeatable Zone",dataTip:"The repeatable zone is for a group<br/>\n of fields that you want to be able to repeat an<br/>\n indeterminate number of times, like FAQs",widgetsArray:H.Z,fields:s.items,EditModal:P.Z,onDeleteItem:v(q.Rt.Items),onSave:m(q.Rt.Items),onSaveNewField:h(q.Rt.Items),onDragEnd:y(q.Rt.Items),poolOfFieldsToCheck:s.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,Q.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,Q.Ti)(e))},testId:"slice-repeatable-zone",isRepeatableCustomType:void 0}):null,(0,i.jsxs)(o.Vq,{size:"small",open:l,onOpenChange:function(e){return u(e)},children:[(0,i.jsx)(o.fK,{icon:"delete",title:"Delete field"}),(0,i.jsxs)(o.cZ,{children:[(0,i.jsxs)(o.xu,{padding:24,gap:12,flexDirection:"column",children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the Repeatable Zone from the"," ",t.model.name," slice."]}),(0,i.jsx)("div",{children:"If you need repeatable fields again, use a repeatable group field in place of the repeatable zone."})]}),(0,i.jsx)(o.kX,{ok:{text:"Delete",color:"tomato",onClick:function(){return x()}},cancel:{text:"Cancel"}})]})]})]})},Y=t(75289),ee=t(54132),en=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,s=e.headerSx,c=void 0===s?{}:s;return(0,i.jsx)(ee.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,E.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(Y.kC,{sx:(0,E.Z)({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)}},c),children:[r,o?(0,i.jsx)(Y.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(Y.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(Y.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},et=t(25812),ei=t(63397),er=t(76635),eo=t(36131),ea=function(e){var n=e.msg;return(0,i.jsx)(Y.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},es=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,a=e.initialVariation,s=e.variations,c=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=s.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,a=t&&t.length?null:{name:"Required!"},c=i.value.length&&s.find(function(e){return e.id===i.value})?null:{id:"You must select an existing variation!"},l=n&&n.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(n)&&{id:"No special characters allowed"};return(0,E.Z)({},r,o,a,c,l)},l=function(e){j((0,er.camelCase)(e))},u=function(e){C(e),w&&l(e)},d=function(e){S(!1),l(e)},p=function(){v(),t()},v=function(){j(""),C(""),y({}),S(!0),O({value:a.id,label:a.name})},m=(0,f.useState)({}),h=m[0],y=m[1],x=(0,f.useState)(""),g=x[0],j=x[1],Z=(0,f.useState)(!0),w=Z[0],S=Z[1],T=(0,f.useState)(""),k=T[0],C=T[1],F=(0,f.useState)({value:a.id,label:a.name}),A=F[0],O=F[1],_=(0,f.useState)(!1),D=_[0],L=_[1];function N(){return V.apply(this,arguments)}function V(){return(V=(0,b.Z)(function(){var e,n;return(0,I.__generator)(this,function(t){switch(t.label){case 0:if(!Object.keys(e=c({id:g,name:k,origin:A})).length)return[3,1];return y(e),[3,3];case 1:if(!(n=s.find(function(e){return e.id===A.value})))return[3,3];return L(!0),[4,r(g,k,n)];case 2:t.sent(),L(!1),p(),t.label=3;case 3:return[2]}})})).apply(this,arguments)}return(0,f.useEffect)(function(){v()},[a,n]),(0,i.jsx)(et.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return p()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(ei.J9,{initialValues:{id:g,name:k,origin:A},onSubmit:N,children:(0,i.jsx)(ei.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),N())},children:(0,i.jsx)(o.xu,{children:(0,i.jsxs)(en,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(Y.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(o.xu,{gap:16,alignItems:"center",children:[(0,i.jsx)(o.zx,{onClick:p,color:"grey",children:"Cancel"}),(0,i.jsx)(o.zx,{loading:D,children:"Submit"})]}),close:p,children:[(0,i.jsxs)(o.xu,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(Y.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",h.name?(0,i.jsx)(ea,{msg:h.name}):""]}),(0,i.jsx)(ei.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:Y.II,maxLength:30,value:k,onChange:function(e){return u(e.currentTarget.value)}}),(0,i.jsx)(Y.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(o.xu,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(Y.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",h.id?(0,i.jsx)(ea,{msg:h.id}):""]}),(0,i.jsx)(ei.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:Y.II,maxLength:30,value:g,onChange:function(e){return d(e.currentTarget.value)}}),(0,i.jsx)(Y.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(o.xu,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(Y.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(eo.ZP,{name:"origin",options:s.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&O(e)},defaultValue:A,maxMenuHeight:150,theme:function(e){return(0,R.Z)((0,E.Z)({},e),{colors:(0,R.Z)((0,E.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},ec=t(49451),el=t(88932);function eu(){return(eu=(0,b.Z)(function(e){var n,t,i,r,o,s,c,l,u,d,f,p;return(0,I.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,(0,a.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,a.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id})];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,a.X$)(e.component.from,e.component.model.id)];case 3:if(s=(o=n.sent()).slice,(c=o.errors).length>0)throw c;if(!s)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,a.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return l=n.sent().mocks,u=ec.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:s.name,variationId:s.variations[0].id}),[4,e.router.replace(u)];case 5:return n.sent(),d=(0,R.Z)((0,E.Z)({},e.component),{model:s,mocks:l}),e.saveSliceSuccess(d),[2,d];case 6:throw f=n.sent(),p="Could not delete variation `".concat(e.variation.name,"`"),console.error(p,f),el.Am.error(p),f;case 7:return[2]}})})).apply(this,arguments)}var ed=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,a=e.variation,s=(0,d.useRouter)(),c=(0,f.useState)(!1),l=c[0],p=c[1],v=(0,u.Z)().saveSliceSuccess,m=z().setSlice;return(0,i.jsxs)(o.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(o.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(o.cZ,{children:(0,i.jsxs)(o.xu,{flexDirection:"column",children:[(0,i.jsxs)(o.xv,{color:"grey11",sx:{marginBlock:16,marginInline:16},children:["This action will remove the variation from the slice model and delete associated files. When you push your changes, the variation will disappear from your repository. This update will"," ",(0,i.jsx)(ef,{children:"not"})," affect your documents until you ",(0,i.jsx)(ef,{children:"edit"})," ","them manually."]}),(0,i.jsx)(o.kX,{ok:{text:"Delete",color:"tomato",onClick:function(){a&&(0,b.Z)(function(){var e;return(0,I.__generator)(this,function(e){switch(e.label){case 0:p(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,function(e){return eu.apply(this,arguments)}({component:r,router:s,saveSliceSuccess:v,variation:a})];case 2:return m(e.sent()),[3,4];case 3:return e.sent(),[3,4];case 4:return p(!1),t(),[2]}})})()},loading:l},cancel:{text:"Cancel"},size:"medium"})]})})]})},ef=function(e){return(0,i.jsx)(o.xv,(0,R.Z)((0,E.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))};function ep(){return(ep=(0,b.Z)(function(e){var n,t,i,r,o,s,c,l,u,d,f;return(0,I.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,(0,a.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,a.eH)(e.component,(0,R.Z)((0,E.Z)({},e.variation),{name:e.variationName}))];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,a.X$)(e.component.from,e.component.model.id)];case 3:if(s=(o=n.sent()).slice,(c=o.errors).length>0)throw c;if(!s)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,a.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return l=n.sent().mocks,u=(0,R.Z)((0,E.Z)({},e.component),{model:s,mocks:l}),e.saveSliceSuccess(u),[2,u];case 5:throw d=n.sent(),f="Could not rename variation `".concat(e.variation.name,"`"),console.error(f,d),el.Am.error(f),d;case 6:return[2]}})})).apply(this,arguments)}var ev=t(3833),em=t.n(ev),eh=function(e){var n,t,r=e.isOpen,a=e.onClose,s=e.slice,c=e.variation,l=(0,f.useState)(!1),d=l[0],p=l[1],v=z().setSlice,m=(0,u.Z)().saveSliceSuccess;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(o.Vq,{open:r,onOpenChange:function(e){return!e&&a()},size:{width:448,height:"auto"},children:[(0,i.jsx)(o.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(o.cZ,{children:(0,i.jsx)(ei.J9,{validateOnMount:!0,initialValues:{variationName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,b.Z)(function(e){var n;return(0,I.__generator)(this,function(n){switch(n.label){case 0:if(!c)return[2];p(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return ep.apply(this,arguments)}({component:s,saveSliceSuccess:m,variation:c,variationName:e.variationName.trim()})];case 2:return v(n.sent()),[3,4];case 3:return n.sent(),[3,4];case 4:return p(!1),a(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(o.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(o.xv,{variant:"normal",color:"grey11",children:"This action will rename the variation in the slice model. When you push your changes, the variation will be renamed in your repository."}),(0,i.jsxs)(o.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(o.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(o.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(o.yt,{placeholder:"Variation name",error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){e.setFieldValue("variationName",n.slice(0,30))}})]})]}),(0,i.jsx)(o.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:d,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},ey=t(15836),ex=t(71749),eg=t(47731),ej=function(){var e,n=z(),t=n.slice,r=n.variation,s=n.setSlice,c=(0,f.useState)(),l=c[0],p=c[1],v=(0,eg.H)(),m=v.modalPayload,h=m.sliceFilterFn,y=m.defaultVariationSelector,x=m.onUploadSuccess,g=(0,d.useRouter)(),j=(0,u.Z)().saveSliceSuccess;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o.xu,{flexDirection:"column",gap:16,children:[t.model.variations.map(function(e){return(0,i.jsx)(ex.b,{action:{type:"menu",onRename:function(){p({type:"RENAME_VARIATION",variation:e})},onRemove:function(){p({type:"DELETE_VARIATION",variation:e})},removeDisabled:t.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){v.onOpenModal({sliceFilterFn:function(e){return e},defaultVariationSelector:{sliceID:t.model.id,variationID:e.id},onUploadSuccess:function(e){s(e)}})},replace:!0,selected:e.id===r.id,slice:t,variant:"outlined",variationId:e.id},e.id)}),(0,i.jsxs)(o.xu,{backgroundColor:"grey2",bottom:0,flexDirection:"column",padding:{bottom:40,inline:24},position:"sticky",style:{marginBottom:"-16px"},children:[(0,i.jsx)(o.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(o.zx,{onClick:function(){p({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},color:"grey",children:"Add a new variation"})]})]}),(0,i.jsx)(ey.Z,{slices:h([t]),defaultVariationSelector:y,onUploadSuccess:x}),(0,i.jsx)(eh,{isOpen:(null==l?void 0:l.type)==="RENAME_VARIATION",onClose:function(){p(void 0)},slice:t,variation:null==l?void 0:l.variation}),(0,i.jsx)(ed,{isOpen:(null==l?void 0:l.type)==="DELETE_VARIATION",onClose:function(){p(void 0)},slice:t,variation:null==l?void 0:l.variation}),(0,i.jsx)(es,{initialVariation:r,isOpen:(null==l?void 0:l.type)==="ADD_VARIATION",onClose:function(){p(void 0)},onSubmit:(e=(0,b.Z)(function(e,n,i){var r,o,c,l,u,d;return(0,I.__generator)(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),o=(r=(0,W.Kp)({slice:t,id:e,name:n,copiedVariation:i})).slice,c=r.variation,[4,(0,a.Ve)(o)];case 1:return f.sent(),j(o),s(o),l=ec.Y.getBuilderPagePathname({libraryName:o.href,sliceName:o.model.name,variationId:c.id}),g.replace(l),[3,3];case 2:return u=f.sent(),d="Could not add variation `".concat(n,"`"),console.error(d,u),el.Am.error(d),[3,3];case 3:return[2]}})}),function(n,t,i){return e.apply(this,arguments)}),variations:t.model.variations})]})},eb=function(){var e=z(),n=e.slice,t=e.actionQueueStatus;return(0,i.jsxs)(y.LN,{children:[(0,i.jsxs)(y.wd,{children:[(0,i.jsx)(y.Xq,{url:"/slices"}),(0,i.jsxs)(y.Cx,{children:[(0,i.jsx)(x.g,{children:"Slices"}),(0,i.jsx)(x.g,{active:!0,children:n.model.name})]}),(0,i.jsxs)(y.K2,{children:[(0,i.jsx)(g.X,{status:t}),(0,i.jsx)(h,{disabled:"done"!==t})]})]}),(0,i.jsxs)(y.RN,{children:[(0,i.jsxs)(o.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(ej,{}),(0,i.jsx)(J,{})]}),(0,i.jsx)(O,{})]})]})},eI=t(25998),eZ=t(97729),ew=t.n(eZ);function eS(){var e=(0,d.useRouter)(),n=(0,eI.Z)(),t=n.slice,r=n.variation;return void 0===t||void 0===r?(e.replace("/"),null):(0,i.jsx)(M,{initialSlice:t,children:function(e){var n=e.slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ew(),{children:(0,i.jsxs)("title",{children:[n.model.name," - Slice Machine"]})}),(0,i.jsx)(eb,{})]})}})}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return v},EN:function(){return m},F$:function(){return x},GA:function(){return k},HO:function(){return g},L4:function(){return I},Tr:function(){return p},Ue:function(){return O},gR:function(){return Z},j6:function(){return S},kQ:function(){return w},l9:function(){return T},mf:function(){return h},vB:function(){return y},xS:function(){return j},y6:function(){return l}});var i=t(67557),r=t(62230),o=t(85244),a=t(17064),s=t(98863),c=t(88866);function l(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function u(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type===c.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,s=n),(p=(0,a.Z)(null!=d?d:[],2))[0],null!==(l=null==(v=p[1])?void 0:v.config)&&void 0!==l?l:void 0)return e;var t,s,l,d,p,v,m=function(e,n){var t,i=u(e),r=i.findIndex(function(e){return(0,a.Z)(e,1)[0]===n}),o=i.flatMap(function(e){var n=(0,a.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===c.SlicesFieldType})}),s=r;do t="slices".concat(0!==s?s.toString():""),s++;while(o.includes(t));return t}(e,n);return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,(0,o.Z)((0,r.Z)({},e.json[n]),(0,i.Z)({},m,{type:c.SlicesFieldType,fieldset:"Slice Zone"}))))})}function v(e,n){var t=d(e,n);if(void 0===t)return e;var a=Object.keys(t).find(function(e){return t[e].type===c.SlicesFieldType});if(void 0===a)return e;var l=(0,s.ud)(t,a);return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,l))})}function m(e){var n,t,a=e.customType,l=e.sectionId,u=e.sliceId,f=d(a,l);if(void 0===f)return a;var p=Object.keys(f).find(function(e){return f[e].type===c.SlicesFieldType});if(void 0===p)return a;var v=f[p];if(v.type!==c.SlicesFieldType)return a;var m=(0,s.ud)(null!==(t=null===(n=v.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},u);return(0,o.Z)((0,r.Z)({},a),{json:(0,o.Z)((0,r.Z)({},a.json),(0,i.Z)({},l,(0,o.Z)((0,r.Z)({},f),(0,i.Z)({},p,(0,o.Z)((0,r.Z)({},v),{config:(0,o.Z)((0,r.Z)({},v.config),{choices:m})})))))})}function h(e){var n,t=(0,o.Z)((0,r.Z)({},e),{format:"page"}),i=u(e)[0];if(i){var s=(0,a.Z)(i,1)[0];t=p(t,s)}return t}function y(e,n){return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,{}))})}function x(e,n){var t=(0,s.ud)(e.json,n);return(0,o.Z)((0,r.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var i=Object.keys(e.json).reduce(function(i,r){return r===n?i[t]=e.json[r]:i[r]=e.json[r],i},{});return(0,o.Z)((0,r.Z)({},e),{json:i})}function j(e){var n=e.customType,t=e.sectionId,s=e.newField,l=e.newFieldId,u=n.json[t],d=f(n,t),p=Object.fromEntries(Object.entries(u).filter(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),v=(0,o.Z)((0,r.Z)({},p),(0,i.Z)({},l,s));if(void 0!==d){var m=(0,a.Z)(d,2),h=m[0],y=m[1];v[h]=y}return C({customType:n,sectionId:t,updatedSection:v})}function b(e){var n=e.customType,t=e.sectionId,i=e.fieldId,r=(0,s.ud)(n.json[t],i);return C({customType:n,sectionId:t,updatedSection:r})}function I(e){var n=e.customType,t=e.sectionId,i=e.previousFieldId,r=e.newFieldId,o=e.newField,a=F({fields:n.json[t],previousFieldId:i,newFieldId:r,newField:o});return C({customType:n,sectionId:t,updatedSection:a})}function Z(e){var n=e.customType,t=e.sectionId,i=e.sourceIndex,r=e.destinationIndex,o=n.json[t],s=f(n,t),l=Object.fromEntries(Object.entries(o).filter(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),u=E({fields:l,sourceIndex:i,destinationIndex:r});if(void 0!==s){var d=(0,a.Z)(s,2),p=d[0],v=d[1];u[p]=v}return C({customType:n,sectionId:t,updatedSection:u})}function w(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.newField,l=e.newFieldId,u=R({customType:t,sectionId:a,groupFieldId:s}),d=null==u?void 0:null===(n=u.config)||void 0===n?void 0:n.fields;if(!u)return t;var f=A(u,(0,o.Z)((0,r.Z)({},d),(0,i.Z)({},l,c)));return C({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,f))})}function S(e){var n,t=e.customType,a=e.sectionId,c=e.groupFieldId,l=e.fieldId,u=R({customType:t,sectionId:a,groupFieldId:c}),d=null==u?void 0:null===(n=u.config)||void 0===n?void 0:n.fields;if(!u||!d)return t;var f=(0,s.ud)(d,l),p=A(u,f);return C({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},c,p))})}function T(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.previousFieldId,l=e.newFieldId,u=e.newField,d=R({customType:t,sectionId:a,groupFieldId:s}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var p=F({fields:f,previousFieldId:c,newFieldId:l,newField:u}),v=A(d,p);return C({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,v))})}function k(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.sourceIndex,l=e.destinationIndex,u=R({customType:t,sectionId:a,groupFieldId:s}),d=null==u?void 0:null===(n=u.config)||void 0===n?void 0:n.fields;if(!u||!d)return t;var f=E({fields:d,sourceIndex:c,destinationIndex:l}),p=A(u,f);return C({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,p))})}function C(e){var n=e.customType,t=e.sectionId,a=e.updatedSection;return(0,o.Z)((0,r.Z)({},n),{json:(0,o.Z)((0,r.Z)({},n.json),(0,i.Z)({},t,a))})}function F(e){var n=e.fields,t=e.previousFieldId,i=e.newFieldId,r=e.newField;return Object.entries(n).reduce(function(e,n){var o=(0,a.Z)(n,2),s=o[0],c=o[1];return s===t?e[i]=r:s!==i&&(e[s]=c),e},{})}function E(e){var n=e.fields,t=e.sourceIndex,i=e.destinationIndex,r=Object.entries(n),o=(0,a.Z)(r.splice(t,1),1)[0];return r.splice(i,0,o),Object.fromEntries(r)}function R(e){var n=e.customType,t=e.sectionId,i=e.groupFieldId,r=n.json[t][i];if(r.type===c.GroupFieldType)return r}function A(e,n){return(0,o.Z)((0,r.Z)({},e),{config:(0,o.Z)((0,r.Z)({},e.config),{fields:n})})}function O(e){var n,t,i=e.id,o=e.label,a=e.repeatable,s=e.format,c=(n=a,t=s,!1===n&&"page"===t?(0,r.Z)({},D,V):!1===n?_:"page"===t?(0,r.Z)({},N,V):L);return{format:s,id:i,json:c,label:o,repeatable:a,status:!0}}var _={Main:{}},D={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},L={Main:{uid:{config:{label:"UID"},type:"UID"}}},N={Main:(0,r.Z)({},L.Main,D.Main)},V={"SEO & Metadata":{meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"},meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"}}}},25998:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(95200),r=function(e,n,t){var r,o=null===(r=(0,i.Sd)(e))||void 0===r?void 0:r.find(function(e){return e.name.replace(/\//g,"--")===n});return null==o?void 0:o.components.find(function(e){return e.model.name===t})},o=t(5632),a=t(56580),s=function(){var e=(0,o.useRouter)(),n=(0,a.v9)(function(n){return{slice:r(n,e.query.lib,e.query.sliceName)}}).slice;if(!n)return{};var t=n.model.variations.find(function(n){return n.id===e.query.variation});return t?{slice:n,variation:t}:{}}},3833:function(e){e.exports={label:"RenameVariationModal_label__tZ5Ff"}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return j}});var i=t(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}t(52322);var o=["shift","alt","meta","mod","ctrl"],a={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function s(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,n){return void 0===n&&(n=","),e.split(n)}function l(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return s(e)});return r({},{alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod")},{keys:a.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([s(e.key),s(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&p([s(e.key),s(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var n;return!o.includes(e)&&u.delete(e.toLowerCase())}),n.forEach(function(e){return u.add(e.toLowerCase())})}function p(e){var n=Array.isArray(e)?e:[e];"meta"===e?u.clear():n.forEach(function(e){return u.delete(e.toLowerCase())})}function v(e,n){var t=e.target;void 0===n&&(n=!1);var i=t&&t.tagName;return d(n)?Boolean(i&&n&&n.some(function(e){return e.toLowerCase()===i.toLowerCase()})):Boolean(i&&n&&!0===n)}var m=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,c=n.mod,l=n.shift,f=n.ctrl,p=n.keys,v=e.key,m=e.code,h=e.ctrlKey,y=e.metaKey,x=e.shiftKey,g=e.altKey,j=s(m),b=v.toLowerCase();if(!t){if(!g===o&&"alt"!==b||!x===l&&"shift"!==b)return!1;if(c){if(!y&&!h)return!1}else if(!y===a&&"meta"!==b&&"os"!==b||!h===f&&"ctrl"!==b&&"control"!==b)return!1}return!!(p&&1===p.length&&(p.includes(b)||p.includes(j)))||(p?(void 0===r&&(r=","),(d(i=p)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!p)},h=(0,i.createContext)(void 0),y=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),x=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function j(e,n,t,r){var o,a,u=(0,i.useRef)(null),j=(0,i.useRef)(!1),b=t instanceof Array?r instanceof Array?void 0:r:t,I=d(e)?e.join(null==b?void 0:b.splitKey):e,Z=t instanceof Array?t:r instanceof Array?r:void 0,w=(0,i.useCallback)(n,null!=Z?Z:[]),S=(0,i.useRef)(w);Z?S.current=w:S.current=n;var T=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(i,r){return i&&e(n[r],t[r])},!0):n===t}((a=(0,i.useRef)(void 0)).current,b)&&(a.current=b),a.current),k=(0,i.useContext)(y).enabledScopes,C=(0,i.useContext)(h);return g(function(){if((null==T?void 0:T.enabled)!==!1&&(e=k,n=null==T?void 0:T.scopes,0===e.length&&n?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!n||e.some(function(e){return n.includes(e)})||e.includes("*")))){var e,n,t=function(e,n){var t,i;if(void 0===n&&(n=!1),!(v(e,["input","textarea","select"])&&!v(e,null==T?void 0:T.enableOnFormTags)||null!=T&&null!=T.ignoreEventWhen&&T.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){x(e);return}(null==(t=e.target)||!t.isContentEditable||null!=T&&T.enableOnContentEditable)&&c(I,null==T?void 0:T.splitKey).forEach(function(t){var i,r,o,a,s,c,u,d=l(t,null==T?void 0:T.combinationKey);if(m(e,d,null==T?void 0:T.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&j.current)return;if(i=e,r=d,("function"==typeof(o=null==T?void 0:T.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,s=d,"function"==typeof(c=null==T?void 0:T.enabled)?!c(a,s):!0!==c&&void 0!==c){x(e);return}S.current(e,d),n||(j.current=!0)}})}},i=function(e){void 0!==e.key&&(f(s(e.code)),((null==T?void 0:T.keydown)===void 0&&(null==T?void 0:T.keyup)!==!0||null!=T&&T.keydown)&&t(e))},r=function(e){void 0!==e.key&&(p(s(e.code)),j.current=!1,null!=T&&T.keyup&&t(e,!0))},o=u.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),C&&c(I,null==T?void 0:T.splitKey).forEach(function(e){return C.addHotkey(l(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),C&&c(I,null==T?void 0:T.splitKey).forEach(function(e){return C.removeHotkey(l(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))})}}},[I,T,k]),u}}},function(e){e.O(0,[898,789,917,525,461,139,183,50,543,696,25,318,286,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,n,t){var i=t(34311),r=t(23779),o=i(function(e,n,t){return e+(t?" ":"")+r(n)});e.exports=o},26688:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return t(72085)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),s=t(2784),c=t(75289),a=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,s.forwardRef)(function(e,n){var t=e.label,s=e.Icon,d=e.type,f=e.form,m=e.isLoading,p=void 0!==m&&m,h=e.disabled,x=e.onClick,v=e.sx,y=e.iconSize,b=void 0===y?16:y,g=e.iconFill,j=e.variant,S=void 0===j?"primary":j,C=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,l.jsx)(c.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===v?{}:v),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),p?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==h&&h||p,onClick:p?void 0:x,variant:S},C),{children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.$j,{size:b,color:u(S),"data-testid":a(C["data-testid"],"spinner")}),s&&t]}):(0,l.jsxs)(l.Fragment,{children:[s&&(0,l.jsx)(s,{size:b,fill:g,"data-testid":a(C["data-testid"],"icon")}),t]})}))})},45466:function(e,n,t){"use strict";t.d(n,{c:function(){return S}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),s=t(52322),c=t(68780),a=t(82770),u=t(38876),d=t(5479),f=t(81038),m=t(88932);function p(){return(p=(0,i.Z)(function(e){var n,t,i,r,o,s,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:n=e.sliceName,t=e.libraryName,i=e.onSuccess,l.label=1;case 1:return l.trys.push([1,4,,5]),r=(0,d.fo)(n),[4,f.j.slices.createSlice({libraryID:t,model:r})];case 2:if((o=l.sent().errors).length>0)throw o;return a.Xe.track({event:"slice:created",id:(0,u.MP)(n),name:n,library:t}),[4,i(r)];case 3:return l.sent(),[3,5];case 4:return s=l.sent(),c="An unexpected error happened while creating slice ".concat(n,"."),console.error(c,s),m.Am.error(c),[3,5];case 5:return[2]}})})).apply(this,arguments)}var h=t(50950),x=t(90374),v=t(2784),y=t(36131),b=t(75289),g=t(70041),j=t(66443),S=function(e){var n,t=e.onClose,u=e.onSuccess,d=e.localLibraries,f=e.remoteSlices,m=(0,x.Z)().createSliceSuccess,S=(0,v.useState)(!1),C=S[0],w=S[1],k=(0,h.g)().syncChanges,I=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var o;return n=e.sliceName,t=e.from,w(!0),[4,function(e){return p.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(o=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,a.y0)()];case 1:return m(n.sent().libraries),u(e,t),k(),[2]}})}),function(e){return o.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,s.jsx)(c.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:C,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){I(e)},initialValues:{sliceName:"",from:d[0].name},validate:function(e){return(0,j.h)(e,d,f)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,s.jsxs)(b.xu,{children:[(0,s.jsx)(g.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,testId:"slice-name-input"}),(0,s.jsx)(b.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,s.jsx)(y.ZP,{name:"from",options:d.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,o.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,o.Z)((0,r.Z)({},e),{colors:(0,o.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return s}});var i=t(62230),r=t(52322),o=t(63397);t(2784);var l=t(75289),s=function(e){var n=e.name,t=e.label,s=e.placeholder,c=e.error,a=e.testId,u=e.onChange;return(0,r.jsxs)(l.xu,{mb:3,children:[(0,r.jsx)(l.__,{htmlFor:n,mb:2,children:t}),(0,r.jsx)(o.gN,(0,i.Z)({name:n,type:"text",placeholder:s,as:l.II,autoComplete:"off"},u?{onChange:u}:null,a?{"data-testid":a}:null)),c?(0,r.jsx)(l.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return a}});var i=t(81541),r=t(75329),o=t(96009),l=t.n(o),s=t(74600),c=t.n(s);function a(e,n,t){var o=e.sliceName;if(!o)return{sliceName:"Cannot be empty"};if(!r.xo.exec(o))return{sliceName:"No special characters allowed"};if(c()(l()(o)).replace(/\s/gm,"")!==o.trim())return{sliceName:"Value has to be PascalCased"};if(o.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(o))return{sliceName:"".concat(o," is reserved for Slice Machine use")};var s=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),a=t.map(function(e){return e.name});if((0,i.Z)(s).concat((0,i.Z)(a)).includes(o))return{sliceName:"Slice name is already taken."}}},59469:function(e,n,t){"use strict";var i=t(62230),r=t(52322),o=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,s=e.gridTemplateMinPx,c=e.gridGap,a=e.sx;return(0,r.jsx)(o.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===s?"320px":s,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},a),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},68780:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(52322),l=t(56577),s=t(25812),c=t(63397),a=t(37149),u=t.n(a),d=t(75289),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,a=e.isOpen,m=e.formId,p=e.validate,h=e.onSubmit,x=e.widthInPx,v=e.initialValues,y=e.content.title,b=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,S=e.isLoading,C=void 0!==S&&S,w=e.buttonLabel,k=void 0===w?"Save":w,I=e.testId,N=e.actionMessage;return u().setAppElement("#__next"),(0,o.jsx)(s.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=x?x:"900px"}},children:(0,o.jsx)(c.J9,{initialValues:v,validate:function(e){return p?p(e):void 0},onSubmit:function(e){h(e)},children:function(e){var s=e.isValid,a=e.isSubmitting,u=e.values,p=e.errors,h=e.touched,x=e.setFieldValue,v=e.setValues;return(0,o.jsx)(c.l0,(0,r.Z)((0,i.Z)({id:m},null!=I?{"data-testid":I}:null),{children:(0,o.jsx)(f.Z,(0,r.Z)((0,i.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},b),{Header:function(e){var n=e.radius;return(0,o.jsxs)(d.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",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)(d.X6,{sx:{fontSize:"20px"},children:y}),(0,o.jsx)(d.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,o.jsxs)(d.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(d.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof N?N(e):N}),(0,o.jsxs)(d.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(d.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||C,children:"Cancel"}),(0,o.jsx)(l.z,{label:k,form:m,type:"submit",disabled:!s||a||C,isLoading:a||C,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:s,isSubmitting:a,values:u,errors:p,touched:h,setFieldValue:x,setValues:v})}))}))}})})}},72085:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Q}});var i=t(81541),r=t(52322),o=t(55156),l=t(22710),s=t(99267),c=t(56577),a=t(54132),u=t(25812),d=t(81038),f=t(88932);function m(){return(m=(0,l.Z)(function(e){var n,t,i,r,o,l,c;return(0,s.__generator)(this,function(s){switch(s.label){case 0:n=e.sliceName,t=e.sliceID,i=e.libraryID,r=e.onSuccess,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,d.j.slices.deleteSlice({libraryID:i,sliceID:t})];case 2:if((o=s.sent().errors).length>0)throw o;return r(),f.Am.success("Successfully deleted slice “".concat(n,"”")),[3,4];case 3:return l=s.sent(),c="An unexpected error happened while deleting slice “".concat(n,"”."),console.error(c,l),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var p=t(50950),h=t(90374),x=t(2784),v=t(65186),y=t(59326),b=t(75289),g=function(e){var n,t=e.sliceId,i=e.sliceName,o=e.libName,d=e.isOpen,f=e.onClose,g=(0,x.useState)(!1),j=g[0],S=g[1],C=(0,h.Z)().deleteSliceSuccess,w=(0,p.g)().syncChanges,k=(0,y.B7)().theme,I=(n=(0,l.Z)(function(){return(0,s.__generator)(this,function(e){switch(e.label){case 0:return S(!0),[4,function(e){return m.apply(this,arguments)}({sliceID:t,sliceName:i,libraryID:o,onSuccess:function(){C(t,o),w()}})];case 1:return e.sent(),f(),S(!1),[2]}})}),function(){return n.apply(this,arguments)});return(0,r.jsx)(u.Z,{isOpen:d,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:f,children:(0,r.jsx)(a.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},borderFooter:!0,Header:function(){var e;return(0,r.jsxs)(b.kC,{sx:{position:"sticky",background:"gray",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,r.jsxs)(b.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(v.$vK,{size:20,color:null===(e=k.colors)||void 0===e?void 0:e.greyIcon}),(0,r.jsx)(b.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,r.jsx)(b.x8,{type:"button",onClick:f})]})},Footer:function(){return(0,r.jsxs)(b.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,r.jsx)(c.z,{label:"Cancel",variant:"secondary",onClick:f,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,r.jsx)(c.z,{label:"Delete",variant:"danger",isLoading:j,sx:{minHeight:39,minWidth:78},onClick:function(){I()}})]})},children:(0,r.jsxs)(b.nv,{children:["This action will immediately make the following changes:",(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:["Delete the"," ",(0,r.jsxs)(b.xv,{sx:{fontWeight:"bold"},children:[o,"/",i,"/"]})," ","directory."]}),(0,r.jsx)("li",{children:"Remove the Slice from all Slice Zones that use it."})]}),"The next time you push your changes to Prismic, the following change will happen:",(0,r.jsx)("ul",{children:(0,r.jsx)("li",{children:"Remove the Slice from the list of available Slices to use in the Page Builder."})}),"You will need to manually remove the Slice from any Pages that currently use it."]})})})},j=t(62230),S=t(85244),C=t(98240),w=t(82770),k=t(36887),I=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,o=e.documentationComponent,l=e.videoPublicIdUrl,s=(0,C.Z)(e,["title","onCreateNew","buttonText","documentationComponent","videoPublicIdUrl"]);return(0,r.jsxs)(b.xu,(0,S.Z)((0,j.Z)({sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"}},s),{children:[(0,r.jsx)(b.xu,{sx:function(e){var n;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:(0,r.jsx)(k.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){w.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,r.jsxs)(b.xu,{sx:function(e){var n;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,r.jsxs)(b.xu,{sx:function(e){var n;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:[(0,r.jsx)(b.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,r.jsx)(b.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,r.jsxs)(b.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,r.jsx)(b.zx,{onClick:t,"data-testid":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:i}),(0,r.jsx)(b.xv,{sx:{fontSize:"12px",color:"grey04",maxWidth:"280px"},children:"It will be stored locally and you will be able to push it to your repository"})]})]})]}))},N=t(45466),Z=t(53559),L=t(5479);function E(){return(E=(0,l.Z)(function(e){var n,t,i,r,o,l,c;return(0,s.__generator)(this,function(s){switch(s.label){case 0:n=e.slice,t=e.newSliceName,i=e.onSuccess,s.label=1;case 1:return s.trys.push([1,3,,4]),r=(0,L.PQ)(n,t),[4,d.j.slices.renameSlice({libraryID:n.from,model:Z.id.fromSM(r.model)})];case 2:if((o=s.sent().errors).length>0)throw o;return i(r),f.Am.success("Slice name updated"),[3,4];case 3:return l=s.sent(),c="An unexpected error happened while renaming “".concat(n.model.name,"”."),console.error(c,l),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=t(95200),P=t(56580),A=t(68780),O=t(70041),R=t(66443),z=function(e){var n,t,i,o=e.slice,c=e.isOpen,a=e.onClose,u=(0,h.Z)().renameSliceSuccess,d=(0,p.g)().syncChanges,f=(0,P.v9)(function(e){return{localLibs:(0,_.Sd)(e),remoteLibs:(0,_.sT)(e)}}),m=f.localLibs,x=f.remoteLibs,v=null!==(n=null==o?void 0:o.model.name)&&void 0!==n?n:"",y=(i=(0,l.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:if(!o)return[3,2];return[4,function(e){return E.apply(this,arguments)}({slice:o,newSliceName:e.sliceName,onSuccess:function(e){u(e.from,e.model),d()}})];case 1:n.sent(),a(),n.label=2;case 2:return[2]}})}),function(e){return i.apply(this,arguments)});return(0,r.jsx)(A.Z,{testId:"rename-slice-modal",isOpen:c,widthInPx:"530px",formId:"rename-slice-modal-".concat(null!==(t=null==o?void 0:o.model.id)&&void 0!==t?t:""),close:a,buttonLabel:"Rename",onSubmit:function(e){y(e)},initialValues:{sliceName:v},content:{title:"Rename a slice"},validate:function(e){return(0,R.h)(e,m,x)},children:function(e){var n=e.touched,t=e.errors;return(0,r.jsx)(b.xu,{children:(0,r.jsx)(O.W,{name:"sliceName",label:"Slice Name","data-testid":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?t.sliceName:void 0,testId:"slice-name-input"})})}})},F=t(59469),D=t(15836),W=t(13858),T=t(75329),V=t(22715),K=t(41730),B=t(71749),M=t(49451),H=t(47731),X=t(97729),U=t.n(X),q=t(5632),G=t(65077),Q=function(){var e,n,t,l=(0,q.useRouter)(),s=(0,H.H)(),c=s.modalPayload,a=s.onOpenModal,u=c.sliceFilterFn,d=c.defaultVariationSelector,m=(0,P.v9)(function(e){return{remoteSlices:(0,_.sT)(e),libraries:(0,_.Sd)(e)}}),p=m.remoteSlices,h=m.libraries,v=(0,x.useState)(!1),y=v[0],j=v[1],S=(0,x.useState)(!1),C=S[0],w=S[1],k=(0,x.useState)(!1),Z=k[0],L=k[1],E=h.filter(function(e){return e.isLocal}),A=h.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),O=(h||[]).map(function(e){return e.components}).flat(),R=O.length,X=(0,x.useState)(),Q=X[0],Y=X[1],$=function(){w(!0)},J=function(){L(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U(),{children:(0,r.jsx)("title",{children:"Slices - Slice Machine"})}),(0,r.jsxs)(o.LN,{children:[(0,r.jsxs)(o.wd,{children:[(0,r.jsx)(o.Cx,{children:(0,r.jsx)(K.g,{children:"Slices"})}),(null==E?void 0:E.length)!==0&&0!==R?(0,r.jsx)(o.K2,{children:(0,r.jsx)(V.zx,{"data-testid":"create-slice",onClick:function(){j(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,r.jsxs)(o.RN,{children:[(0,r.jsx)(G.xR,{sx:{display:"flex",flexDirection:"column"},children:A.length>0?(0,r.jsx)(b.kC,{sx:{flex:1,flexDirection:"column"},children:0===R?(0,r.jsx)(b.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(I,{title:"What are Slices?",onCreateNew:function(){j(!0)},buttonText:"Create one",videoPublicIdUrl:T.rd,documentationComponent:(0,r.jsxs)(r.Fragment,{children:['Slices are sections of your website. Prismic documents contain a dynamic "Slice Zone" that allows content creators to add, edit, and rearrange Slices to compose dynamic layouts for any page design.'," ",(0,r.jsx)(b.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:function(e){var n;return{color:null==e?void 0:null===(n=e.colors)||void 0===n?void 0:n.primary}},children:"Learn more"}),"."]}),"data-testid":"slices-table-blank-slate"})}):A.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,r.jsxs)(b.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,r.jsxs)(b.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,r.jsx)(b.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,r.jsx)(b.xv,{children:n})}),!t&&(0,r.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,r.jsx)(F.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return(0,r.jsx)(B.b,{action:{type:"menu",onRemove:function(){Y(e),$()},onRename:function(){Y(e),J()}},mode:"navigation",onUpdateScreenshot:function(){a({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})},gridGap:"32px 16px"})]},n)})}):void 0}),(null==E?void 0:E.length)>0&&(0,r.jsx)(D.Z,{slices:u(O),defaultVariationSelector:d}),(null==E?void 0:E.length)>0&&y&&(0,r.jsx)(N.c,{localLibraries:E,remoteSlices:p,onSuccess:function(e,n){var t=e.variations[0].id,i=M.Y.getBuilderPagePathname({libraryName:n,sliceName:e.name,variationId:t});l.push(i),f.Am.success((0,W.kQ)({path:"".concat(n,"/").concat(e.name,"/model.json")}))},onClose:function(){j(!1)}}),(0,r.jsx)(z,{isOpen:Z,slice:Q,onClose:function(){L(!1)},"data-testid":"rename-slice-modal"}),(0,r.jsx)(g,{isOpen:C,libName:null!==(e=null==Q?void 0:Q.from)&&void 0!==e?e:"",sliceId:null!==(n=null==Q?void 0:Q.model.id)&&void 0!==n?n:"",sliceName:null!==(t=null==Q?void 0:Q.model.name)&&void 0!==t?t:"",onClose:function(){w(!1)}})]})]})]})}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return g}});var i=t(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}t(52322);var o=["shift","alt","meta","mod","ctrl"],l={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function s(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,n){return void 0===n&&(n=","),e.split(n)}function a(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return s(e)});return r({},{alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod")},{keys:l.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([s(e.key),s(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([s(e.key),s(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var n;return!o.includes(e)&&u.delete(e.toLowerCase())}),n.forEach(function(e){return u.add(e.toLowerCase())})}function m(e){var n=Array.isArray(e)?e:[e];"meta"===e?u.clear():n.forEach(function(e){return u.delete(e.toLowerCase())})}function p(e,n){var t=e.target;void 0===n&&(n=!1);var i=t&&t.tagName;return d(n)?Boolean(i&&n&&n.some(function(e){return e.toLowerCase()===i.toLowerCase()})):Boolean(i&&n&&!0===n)}var h=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,l=n.meta,c=n.mod,a=n.shift,f=n.ctrl,m=n.keys,p=e.key,h=e.code,x=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=s(h),j=p.toLowerCase();if(!t){if(!b===o&&"alt"!==j||!y===a&&"shift"!==j)return!1;if(c){if(!v&&!x)return!1}else if(!v===l&&"meta"!==j&&"os"!==j||!x===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(g)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},x=(0,i.createContext)(void 0),v=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},b="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function g(e,n,t,r){var o,l,u=(0,i.useRef)(null),g=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,S=d(e)?e.join(null==j?void 0:j.splitKey):e,C=t instanceof Array?t:r instanceof Array?r:void 0,w=(0,i.useCallback)(n,null!=C?C:[]),k=(0,i.useRef)(w);C?k.current=w:k.current=n;var I=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(i,r){return i&&e(n[r],t[r])},!0):n===t}((l=(0,i.useRef)(void 0)).current,j)&&(l.current=j),l.current),N=(0,i.useContext)(v).enabledScopes,Z=(0,i.useContext)(x);return b(function(){if((null==I?void 0:I.enabled)!==!1&&(e=N,n=null==I?void 0:I.scopes,0===e.length&&n?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!n||e.some(function(e){return n.includes(e)})||e.includes("*")))){var e,n,t=function(e,n){var t,i;if(void 0===n&&(n=!1),!(p(e,["input","textarea","select"])&&!p(e,null==I?void 0:I.enableOnFormTags)||null!=I&&null!=I.ignoreEventWhen&&I.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){y(e);return}(null==(t=e.target)||!t.isContentEditable||null!=I&&I.enableOnContentEditable)&&c(S,null==I?void 0:I.splitKey).forEach(function(t){var i,r,o,l,s,c,u,d=a(t,null==I?void 0:I.combinationKey);if(h(e,d,null==I?void 0:I.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,r=d,("function"==typeof(o=null==I?void 0:I.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),l=e,s=d,"function"==typeof(c=null==I?void 0:I.enabled)?!c(l,s):!0!==c&&void 0!==c){y(e);return}k.current(e,d),n||(g.current=!0)}})}},i=function(e){void 0!==e.key&&(f(s(e.code)),((null==I?void 0:I.keydown)===void 0&&(null==I?void 0:I.keyup)!==!0||null!=I&&I.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(s(e.code)),g.current=!1,null!=I&&I.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),Z&&c(S,null==I?void 0:I.splitKey).forEach(function(e){return Z.addHotkey(a(e,null==I?void 0:I.combinationKey,null==I?void 0:I.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),Z&&c(S,null==I?void 0:I.splitKey).forEach(function(e){return Z.removeHotkey(a(e,null==I?void 0:I.combinationKey,null==I?void 0:I.description))})}}},[S,I,N]),u}}},function(e){e.O(0,[898,789,50,25,286,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);