slice-machine-ui 1.22.2-beta.1 → 1.22.2-beta.2

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 (27) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/{ALrNHXPZGeRwEXHdmh5-C → I-f60KuCY16vDTHxw5C1M}/_buildManifest.js +1 -1
  3. package/out/_next/static/chunks/{840-45aefe7b4d84745c.js → 840-c010c2547340976b.js} +1 -1
  4. package/out/_next/static/chunks/{904-e7c8c1ba265177fb.js → 904-9eb2a2038b2302b7.js} +1 -1
  5. package/out/_next/static/chunks/pages/{_app-cae1327f33c96711.js → _app-f14c7e60f2a0f2b2.js} +2 -2
  6. package/out/_next/static/chunks/pages/{changelog-cfda9d30715b6e2a.js → changelog-508bad6822a039ff.js} +1 -1
  7. package/out/_next/static/chunks/pages/{changes-a3cdb6251b224e4b.js → changes-c413fb6aa4bf4eca.js} +1 -1
  8. package/out/_next/static/chunks/pages/{labs-dfad3c3553469739.js → labs-d4462a72635f9ac0.js} +1 -1
  9. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-c228a7c42e87eb27.js → [variation]-8ba4b47fe4cf636a.js} +1 -1
  10. package/out/_next/static/chunks/pages/{slices-dc4f17b54c9a3eb5.js → slices-ed1190d3d37a63fd.js} +1 -1
  11. package/out/_next/static/css/{7ef90ba762e84cee.css → 29d73729eff3b961.css} +1 -1
  12. package/out/changelog.html +1 -1
  13. package/out/changes.html +1 -1
  14. package/out/custom-types/[customTypeId].html +1 -1
  15. package/out/custom-types.html +1 -1
  16. package/out/index.html +1 -1
  17. package/out/labs.html +1 -1
  18. package/out/page-types/[pageTypeId].html +1 -1
  19. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  20. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  21. package/out/slices.html +1 -1
  22. package/package.json +4 -3
  23. package/src/components/PageLayout/PageLayout.css.ts +6 -12
  24. package/src/components/PageLayout/PageLayout.tsx +4 -4
  25. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +36 -7
  26. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +1 -1
  27. /package/out/_next/static/{ALrNHXPZGeRwEXHdmh5-C → I-f60KuCY16vDTHxw5C1M}/_ssgManifest.js +0 -0
@@ -1 +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(57825)}])},57825:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return H}});var i,t,s=r(52322),o=r(97729),a=r.n(o),c=r(22715),l=r(65077),d=r(75289),p=r(56580),x=r(39092),g=r(2784),h=r(62230),u=r(12170),f=function(e){var n=e.type,r=e.hasUpToDateVersions;return(0,s.jsx)(d.xv,{sx:(0,h.Z)({padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase"},(n===i.Latest||n===i.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},n===i.Current&&r&&{bg:"lightGreen",color:"code.green"},n===i.Current&&!r&&{bg:"lightOrange",color:"code.orange"}),children:n})},v=function(e){var n=e.isSelected,r=e.onClick,i=e.versionNumber,t=e.tags,o=e.hasUpToDateVersions;return(0,s.jsxs)(d.kC,{sx:(0,h.Z)({p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center"},n?{color:"purple",bg:(0,u.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}),onClick:r,children:[(0,s.jsx)(d.xv,{children:i}),(0,s.jsx)(d.kC,{sx:{gap:"8px"},children:t.map(function(e){return(0,s.jsx)(f,{type:e,hasUpToDateVersions:o},e)})})]})};(t=i||(i={})).Latest="LATEST",t.LatestNonBreaking="LATEST-NON-BREAKING",t.Current="CURRENT";var m=function(e){var n,r=e.changelog,t=e.selectedVersion,o=e.selectVersion,a=function(e){var n=[];return e===l?n.push(i.Latest):e===r.sliceMachine.latestNonBreakingVersion&&n.push(i.LatestNonBreaking),e===r.sliceMachine.currentVersion&&n.push(i.Current),n},l=null===(n=r.sliceMachine.versions[0])||void 0===n?void 0:n.versionNumber,p=!r.adapter.updateAvailable&&!r.sliceMachine.updateAvailable;return(0,s.jsxs)(d.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:c.TV.color.greyLight6,flexDirection:"column",paddingRight:"48px"},children:[(0,s.jsxs)(d.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,paddingBottom:"28px"},children:[(0,s.jsx)(d.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,s.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,s.jsx)(d.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:r.sliceMachine.versions.map(function(e,n){return(0,s.jsx)(v,{isSelected:(null==t?void 0:t.versionNumber)===e.versionNumber,onClick:function(){return o(e)},versionNumber:e.versionNumber,tags:a(e.versionNumber),hasUpToDateVersions:p},"versionBadge-".concat(e.versionNumber,"-").concat(n))})})]})},b={MAJOR:"MAJOR",MINOR:"MINOR",PATCH:"PATCH",FIRST:"FIRST"},j=function(e){var n=e.versionKind,r=(0,h.Z)({fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase"},n===b.MAJOR?{color:"purple",bg:(0,u.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"});return(0,s.jsx)(d.xv,{sx:r,children:n})},k=r(19870),C=function(e){var n=e.releaseNote;return(0,s.jsx)(d.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:k.TU.parse(n)}})},N=r(951),T=r(8346),y=function(e){var n,r,i,t,o,a=e.changelog,c=e.selectedVersion,l=e.packageManager,p=c.versionNumber===a.sliceMachine.versions[0].versionNumber,x=(n={sliceMachineVersionToInstall:p?"latest":c.versionNumber,isLatestSliceMachineVersion:p,adapterName:a.adapter.name},r=n.sliceMachineVersionToInstall,i=n.isLatestSliceMachineVersion,t=n.adapterName,o=["slice-machine-ui@".concat(r)],i&&o.push("".concat(t,"@latest")),o),g=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)}}(l,x),h=a.adapter.updateAvailable&&!a.sliceMachine.updateAvailable;return(0,s.jsxs)(s.Fragment,{children:[h&&p&&(0,s.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,s.jsx)(N.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,s.jsxs)(d.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,s.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,s.jsxs)(d.kC,{sx:{gap:"8px"},children:[(0,s.jsx)(T.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:g}),(0,s.jsx)(d.zx,{variant:"secondary",onClick:function(){navigator.clipboard.writeText(g)},children:"Copy"})]})]})]})},S=function(){return(0,s.jsxs)("div",{children:["Could not fetch release notes."," ",(0,s.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]})},M=function(e){var n,r=e.changelog,i=e.selectedVersion,t=e.packageManager;return(0,s.jsxs)(d.kC,{sx:{flexDirection:"column"},children:[(0,s.jsxs)(d.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(d.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(i.versionNumber)}),!!i.kind&&(0,s.jsx)(j,{versionKind:i.kind})]}),(0,s.jsxs)(d.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null===(n=i.releaseNote)||void 0===n?void 0:n.includes("# Breaking Change"))&&(0,s.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,s.jsx)(N.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,s.jsx)(y,{changelog:r,selectedVersion:i,packageManager:t}),(null==i?void 0:i.releaseNote)?(0,s.jsx)(C,{releaseNote:i.releaseNote}):(0,s.jsx)(S,{})]})]})},V=r(32665),L=r(3098),R=r(76747);function w(){var e=(0,p.v9)(function(e){return{changelog:(0,x.Sx)(e),packageManager:(0,x.Ak)(e),isChangelogLoading:(0,V.hg)(e,L.z.CHANGELOG)}}),n=e.changelog,r=e.packageManager,i=e.isChangelogLoading,t=n.sliceMachine.versions[0],o=(0,g.useState)(t||void 0),a=o[0],h=o[1];(0,g.useEffect)(function(){h(t)},[t]);var u=0===n.sliceMachine.versions.length||!a;return(0,s.jsx)(R.LN,{children:(0,s.jsx)(R.RN,{children:(0,s.jsx)(l.xR,{sx:{display:"flex",minWidth:0},children:i?(0,s.jsx)(c._3,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m,{changelog:n,selectedVersion:a,selectVersion:function(e){return h(e)}}),u?(0,s.jsx)(d.kC,{sx:{paddingLeft:"32px"},children:(0,s.jsx)(S,{})}):(0,s.jsx)(M,{changelog:n,selectedVersion:a,packageManager:r})]})})})})}function H(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,s.jsx)(w,{})]})}}},function(e){e.O(0,[870,774,888,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
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(57825)}])},57825:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return H}});var i,t,s=r(52322),o=r(97729),a=r.n(o),c=r(22715),l=r(65077),d=r(75289),p=r(56580),x=r(39092),g=r(2784),h=r(62230),u=r(12170),f=function(e){var n=e.type,r=e.hasUpToDateVersions;return(0,s.jsx)(d.xv,{sx:(0,h.Z)({padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase"},(n===i.Latest||n===i.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},n===i.Current&&r&&{bg:"lightGreen",color:"code.green"},n===i.Current&&!r&&{bg:"lightOrange",color:"code.orange"}),children:n})},v=function(e){var n=e.isSelected,r=e.onClick,i=e.versionNumber,t=e.tags,o=e.hasUpToDateVersions;return(0,s.jsxs)(d.kC,{sx:(0,h.Z)({p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center"},n?{color:"purple",bg:(0,u.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}),onClick:r,children:[(0,s.jsx)(d.xv,{children:i}),(0,s.jsx)(d.kC,{sx:{gap:"8px"},children:t.map(function(e){return(0,s.jsx)(f,{type:e,hasUpToDateVersions:o},e)})})]})};(t=i||(i={})).Latest="LATEST",t.LatestNonBreaking="LATEST-NON-BREAKING",t.Current="CURRENT";var m=function(e){var n,r=e.changelog,t=e.selectedVersion,o=e.selectVersion,a=function(e){var n=[];return e===l?n.push(i.Latest):e===r.sliceMachine.latestNonBreakingVersion&&n.push(i.LatestNonBreaking),e===r.sliceMachine.currentVersion&&n.push(i.Current),n},l=null===(n=r.sliceMachine.versions[0])||void 0===n?void 0:n.versionNumber,p=!r.adapter.updateAvailable&&!r.sliceMachine.updateAvailable;return(0,s.jsxs)(d.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:c.TV.color.greyLight6,flexDirection:"column",paddingRight:"48px"},children:[(0,s.jsxs)(d.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,paddingBottom:"28px"},children:[(0,s.jsx)(d.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,s.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,s.jsx)(d.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:r.sliceMachine.versions.map(function(e,n){return(0,s.jsx)(v,{isSelected:(null==t?void 0:t.versionNumber)===e.versionNumber,onClick:function(){return o(e)},versionNumber:e.versionNumber,tags:a(e.versionNumber),hasUpToDateVersions:p},"versionBadge-".concat(e.versionNumber,"-").concat(n))})})]})},b={MAJOR:"MAJOR",MINOR:"MINOR",PATCH:"PATCH",FIRST:"FIRST"},j=function(e){var n=e.versionKind,r=(0,h.Z)({fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase"},n===b.MAJOR?{color:"purple",bg:(0,u.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"});return(0,s.jsx)(d.xv,{sx:r,children:n})},k=r(19870),C=function(e){var n=e.releaseNote;return(0,s.jsx)(d.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:k.TU.parse(n)}})},N=r(951),T=r(8346),y=function(e){var n,r,i,t,o,a=e.changelog,c=e.selectedVersion,l=e.packageManager,p=c.versionNumber===a.sliceMachine.versions[0].versionNumber,x=(n={sliceMachineVersionToInstall:p?"latest":c.versionNumber,isLatestSliceMachineVersion:p,adapterName:a.adapter.name},r=n.sliceMachineVersionToInstall,i=n.isLatestSliceMachineVersion,t=n.adapterName,o=["slice-machine-ui@".concat(r)],i&&o.push("".concat(t,"@latest")),o),g=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)}}(l,x),h=a.adapter.updateAvailable&&!a.sliceMachine.updateAvailable;return(0,s.jsxs)(s.Fragment,{children:[h&&p&&(0,s.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,s.jsx)(N.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,s.jsxs)(d.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,s.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,s.jsxs)(d.kC,{sx:{gap:"8px"},children:[(0,s.jsx)(T.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:g}),(0,s.jsx)(d.zx,{variant:"secondary",onClick:function(){navigator.clipboard.writeText(g)},children:"Copy"})]})]})]})},S=function(){return(0,s.jsxs)("div",{children:["Could not fetch release notes."," ",(0,s.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]})},M=function(e){var n,r=e.changelog,i=e.selectedVersion,t=e.packageManager;return(0,s.jsxs)(d.kC,{sx:{flexDirection:"column"},children:[(0,s.jsxs)(d.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(d.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(i.versionNumber)}),!!i.kind&&(0,s.jsx)(j,{versionKind:i.kind})]}),(0,s.jsxs)(d.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null===(n=i.releaseNote)||void 0===n?void 0:n.includes("# Breaking Change"))&&(0,s.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,s.jsx)(N.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,s.jsx)(y,{changelog:r,selectedVersion:i,packageManager:t}),(null==i?void 0:i.releaseNote)?(0,s.jsx)(C,{releaseNote:i.releaseNote}):(0,s.jsx)(S,{})]})]})},V=r(32665),L=r(3098),R=r(94975);function w(){var e=(0,p.v9)(function(e){return{changelog:(0,x.Sx)(e),packageManager:(0,x.Ak)(e),isChangelogLoading:(0,V.hg)(e,L.z.CHANGELOG)}}),n=e.changelog,r=e.packageManager,i=e.isChangelogLoading,t=n.sliceMachine.versions[0],o=(0,g.useState)(t||void 0),a=o[0],h=o[1];(0,g.useEffect)(function(){h(t)},[t]);var u=0===n.sliceMachine.versions.length||!a;return(0,s.jsx)(R.LN,{children:(0,s.jsx)(R.RN,{children:(0,s.jsx)(l.xR,{sx:{display:"flex",minWidth:0},children:i?(0,s.jsx)(c._3,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m,{changelog:n,selectedVersion:a,selectVersion:function(e){return h(e)}}),u?(0,s.jsx)(d.kC,{sx:{paddingLeft:"32px"},children:(0,s.jsx)(S,{})}):(0,s.jsx)(M,{changelog:n,selectedVersion:a,packageManager:r})]})})})})}function H(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,s.jsx)(w,{})]})}}},function(e){e.O(0,[870,774,888,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
@@ -1 +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(4920)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return u}});var s=t(62230),i=t(85244),r=t(98240),a=t(52322),o=t(2784),c=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,o.forwardRef)(function(e,n){var t=e.label,o=e.Icon,u=e.type,h=e.form,x=e.isLoading,m=void 0!==x&&x,f=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,_=void 0===b?"primary":b,C=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(c.zx,(0,i.Z)((0,s.Z)({ref:n,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:u,form:h,disabled:void 0!==f&&f||m,onClick:m?void 0:p,variant:_},C),{children:m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$j,{size:v,color:d(_),"data-cy":l(C["data-cy"],"spinner")}),o&&t]}):(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(o,{size:v,fill:y,"data-cy":l(C["data-cy"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var s=t(62230),i=t(52322),r=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,a=e.defineElementKey,o=e.gridTemplateMinPx,c=e.gridGap,l=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},l),children:n.map(function(e,n){return e?(0,i.jsx)("span",{children:t(e,n)},"".concat(a(e),"-").concat(n+1)):null})})}},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ed}});var s=t(52322),i=t(22715),r=t(2784),a=t(97729),o=t.n(a),c=t(65077),l=t(56580),d=t(76747),u=t(75289),h=t(951),x=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},m=t(39097),f=t.n(m),p=t(7819),g=t(34728),j=t(67445),v=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)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,p.TG)(e)?(0,s.jsx)(f(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-cy":"custom-type-".concat(e.local.id),children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-cy":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(84449),C=t(5479),S=t(47731),D=t(32681),T=t(65958),k=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,a=e.isOnline,o=(0,S.H)(),c=o.modalPayload,l=o.onOpenModal,d=c.sliceFilterFn,m=c.defaultVariationSelector,f=t.filter(function(e){return i.slices[e.model.id]!==D.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:a})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(x,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,C.cx)(e)>0&&i.slices[e.model.id]!==D.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(h.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return l({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(h.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.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:a,modelStatus:n},isDeleted:n===D.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){l({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(_.Z,{slices:d(f),defaultVariationSelector:m})]})]})},O=t(91914),w=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(O.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},z=t(90374),Z=t(79096),E=function(e){var n=e.authStatus,t=(0,z.Z)().openLoginModal;return(0,s.jsxs)(i.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===Z.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you are logged out"}),(0,s.jsx)(i.xv,{children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(i.xv,{children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(i.xv,{children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(i.hh,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===Z.t.FORBIDDEN&&(0,s.jsx)(i.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},R=t(5632),N=t.n(R),F=t(2754),I=t(34543),M=t(62230),P=t(85244),H=t(98240),W=t(6277);t(25977);var A={primary:"_1ecs97dbc8 _1ecs97dbjl _1ecs97dbc2 _1ecs97dbjf _1ecs97dbca _1ecs97dbjn",secondary:"_1ecs97daji _1ecs97dah3 _1ecs97dajc _1ecs97dagx _1ecs97dajk _1ecs97dah5"},B={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97df47"},G=function(e){var n=e.children,t=e.color,a=e.endIcon,o=e.href,c=e.textVariant,l=void 0===c?"smallBold":c,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,P.Z)((0,M.Z)({href:o,target:"_blank",rel:"noreferrer"},d),{className:(0,W.Z)("ovkapw0 _1ecs97dez0 _1ecs97df41 _1ecs97dez2 _1ecs97dez8",A[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{className:(0,W.Z)(a.props.className,"_1ecs97dfhw",B[l])}):null]}))},L=t(39092),U=function(){var e,n=(e=(0,l.v9)(function(e){return{repoName:(0,L.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(F.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(F.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(F.T9,{children:[(0,s.jsx)(F._T,{children:"Everything up-to-date"}),(0,s.jsx)(F.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)(F.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){N().push("/")},children:"Create a page type"}),(0,s.jsx)(G,{endIcon:(0,s.jsx)(I.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},V=t(67764),Y=t(32665),X=t(3098),q=t(56577),Q=t(24340),$=t(77174),J=t(49471),K=t(40432),ee=t(78656),en=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},et=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",ee.$[n].name({start:!1,plural:!1})]},t)]})},es=t(79797),ei=t(54132),er=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,a=(0,z.Z)().closeModals;return(0,s.jsx)(es.Z,{placement:"right",open:n,level:null,onClose:a,width:496,children:(0,s.jsx)(ei.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)(u.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)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,s.jsx)(u.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})})},ea=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,M.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eo=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],a=t[1],o=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),c=o.isDeleteDocumentsDrawerOpen,d=o.remoteOnlyCustomTypes,h=o.modalData,x=(0,z.Z)(),m=x.closeModals,f=x.openToaster;if(!c)return null;if((null==h?void 0:h.type)!=="SOFT")return f("No change data",K.Jf.ERROR),null;var g=h.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{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)(er,{isOpen:c,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea,{onToggle:function(){a(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(q.z,{label:"Push changes",variant:"primary",onClick:function(){m(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[h.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."]}),g]})})},ec=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,a=t.modalData,o=(0,z.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==a?void 0:a.type)!=="HARD")return d("No change data",K.Jf.ERROR),null;var h=a.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{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)(er,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",a.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[a.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."]}),h]})})},el=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isOpen:(0,$.gP)(e,Q.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,J.Ch)(e).filter(p.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,a=t.localCustomTypes,o=(0,z.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",K.Jf.ERROR),null;var h=(null==r?void 0:r.details.customTypes.length)>1,x=r.details.customTypes.map(function(e){var n,t=a.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(er,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",h?"":" a"," type",h?"s":""," that reference"," ",h?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",h?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),x]})})},ed=function(){var e=(0,V.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,a=e.modelsStatuses,u=e.authStatus,h=e.isOnline,x=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:a.slices[e.model.id]}}).filter(function(e){return V.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,p.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:a.customTypes[e.id]}}).filter(function(e){return V.O.includes(e.status)})}},[n,t,a]),m=x.changedSlices,f=x.changedCustomTypes,g=(0,z.Z)(),j=g.pushChanges,v=g.closeModals,y=(0,l.v9)(function(e){return{isSyncing:(0,Y.hg)(e,X.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:m,changedCustomTypes:f})},C=(0,r.useMemo)(function(){return h?u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN?(0,s.jsx)(E,{authStatus:u}):0===b?(0,s.jsx)(U,{}):(0,s.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:a,authStatus:u,isOnline:h}):(0,s.jsx)(w,{})},[h,u,b,n,t,a,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!h||u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(c.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(eo,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_}),(0,s.jsx)(el,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return f},T9:function(){return h},nf:function(){return m},u2:function(){return u},_T:function(){return x}});var s=t(67557),i=t(62230),r=t(85244),a=t(98240),o=t(52322),c=t(6277),l=t(22715);t(69143);var d=function(e){var n=e.backgroundImage,t=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},l),{className:(0,c.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,s.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},h=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},x=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,o.jsx)(l.hE,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97df95 _1ecs97dez8 _1ecs97dfdl",size:"medium",variant:"secondary"}))}},69143:function(){},25977:function(){}},function(e){e.O(0,[789,123,918,958,80,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
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(4920)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return u}});var s=t(62230),i=t(85244),r=t(98240),a=t(52322),o=t(2784),c=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,o.forwardRef)(function(e,n){var t=e.label,o=e.Icon,u=e.type,h=e.form,x=e.isLoading,m=void 0!==x&&x,f=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,_=void 0===b?"primary":b,C=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(c.zx,(0,i.Z)((0,s.Z)({ref:n,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:u,form:h,disabled:void 0!==f&&f||m,onClick:m?void 0:p,variant:_},C),{children:m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$j,{size:v,color:d(_),"data-cy":l(C["data-cy"],"spinner")}),o&&t]}):(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(o,{size:v,fill:y,"data-cy":l(C["data-cy"],"icon")}),t]})}))})},59469:function(e,n,t){"use strict";var s=t(62230),i=t(52322),r=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,a=e.defineElementKey,o=e.gridTemplateMinPx,c=e.gridGap,l=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},l),children:n.map(function(e,n){return e?(0,i.jsx)("span",{children:t(e,n)},"".concat(a(e),"-").concat(n+1)):null})})}},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ed}});var s=t(52322),i=t(22715),r=t(2784),a=t(97729),o=t.n(a),c=t(65077),l=t(56580),d=t(94975),u=t(75289),h=t(951),x=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},m=t(39097),f=t.n(m),p=t(7819),g=t(34728),j=t(67445),v=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)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(g.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,p.TG)(e)?(0,s.jsx)(f(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-cy":"custom-type-".concat(e.local.id),children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-cy":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(84449),C=t(5479),S=t(47731),D=t(32681),T=t(65958),k=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,a=e.isOnline,o=(0,S.H)(),c=o.modalPayload,l=o.onOpenModal,d=c.sliceFilterFn,m=c.defaultVariationSelector,f=t.filter(function(e){return i.slices[e.model.id]!==D.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:a})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(x,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,C.cx)(e)>0&&i.slices[e.model.id]!==D.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(h.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return l({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(h.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.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:a,modelStatus:n},isDeleted:n===D.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){l({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(_.Z,{slices:d(f),defaultVariationSelector:m})]})]})},O=t(91914),w=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(O.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},z=t(90374),Z=t(79096),E=function(e){var n=e.authStatus,t=(0,z.Z)().openLoginModal;return(0,s.jsxs)(i.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===Z.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you are logged out"}),(0,s.jsx)(i.xv,{children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.xv,{variant:"h3",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(i.xv,{children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(i.xv,{children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(i.hh,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===Z.t.FORBIDDEN&&(0,s.jsx)(i.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},R=t(5632),N=t.n(R),F=t(2754),I=t(34543),M=t(62230),P=t(85244),H=t(98240),W=t(6277);t(25977);var A={primary:"_1ecs97dbc8 _1ecs97dbjl _1ecs97dbc2 _1ecs97dbjf _1ecs97dbca _1ecs97dbjn",secondary:"_1ecs97daji _1ecs97dah3 _1ecs97dajc _1ecs97dagx _1ecs97dajk _1ecs97dah5"},B={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97df47"},G=function(e){var n=e.children,t=e.color,a=e.endIcon,o=e.href,c=e.textVariant,l=void 0===c?"smallBold":c,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,P.Z)((0,M.Z)({href:o,target:"_blank",rel:"noreferrer"},d),{className:(0,W.Z)("ovkapw0 _1ecs97dez0 _1ecs97df41 _1ecs97dez2 _1ecs97dez8",A[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{className:(0,W.Z)(a.props.className,"_1ecs97dfhw",B[l])}):null]}))},L=t(39092),U=function(){var e,n=(e=(0,l.v9)(function(e){return{repoName:(0,L.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(F.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(F.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(F.T9,{children:[(0,s.jsx)(F._T,{children:"Everything up-to-date"}),(0,s.jsx)(F.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)(F.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){N().push("/")},children:"Create a page type"}),(0,s.jsx)(G,{endIcon:(0,s.jsx)(I.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},V=t(67764),Y=t(32665),X=t(3098),q=t(56577),Q=t(24340),$=t(77174),J=t(49471),K=t(40432),ee=t(78656),en=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},et=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",ee.$[n].name({start:!1,plural:!1})]},t)]})},es=t(79797),ei=t(54132),er=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,a=(0,z.Z)().closeModals;return(0,s.jsx)(es.Z,{placement:"right",open:n,level:null,onClose:a,width:496,children:(0,s.jsx)(ei.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)(u.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)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,s.jsx)(u.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})})},ea=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,M.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eo=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],a=t[1],o=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),c=o.isDeleteDocumentsDrawerOpen,d=o.remoteOnlyCustomTypes,h=o.modalData,x=(0,z.Z)(),m=x.closeModals,f=x.openToaster;if(!c)return null;if((null==h?void 0:h.type)!=="SOFT")return f("No change data",K.Jf.ERROR),null;var g=h.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{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)(er,{isOpen:c,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea,{onToggle:function(){a(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(q.z,{label:"Push changes",variant:"primary",onClick:function(){m(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[h.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."]}),g]})})},ec=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,Q.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,J.Ch)(e).filter(p.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,a=t.modalData,o=(0,z.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==a?void 0:a.type)!=="HARD")return d("No change data",K.Jf.ERROR),null;var h=a.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(en,{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)(er,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",a.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[a.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."]}),h]})})},el=function(e){var n=e.pushChanges,t=(0,l.v9)(function(e){return{isOpen:(0,$.gP)(e,Q.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,J.Ch)(e).filter(p.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,a=t.localCustomTypes,o=(0,z.Z)(),c=o.closeModals,d=o.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",K.Jf.ERROR),null;var h=(null==r?void 0:r.details.customTypes.length)>1,x=r.details.customTypes.map(function(e){var n,t=a.find(function(n){return(0,p.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(er,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(q.z,{label:"Try again",variant:"primary",onClick:function(){c(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",h?"":" a"," type",h?"s":""," that reference"," ",h?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",h?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),x]})})},ed=function(){var e=(0,V.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,a=e.modelsStatuses,u=e.authStatus,h=e.isOnline,x=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:a.slices[e.model.id]}}).filter(function(e){return V.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,p.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:a.customTypes[e.id]}}).filter(function(e){return V.O.includes(e.status)})}},[n,t,a]),m=x.changedSlices,f=x.changedCustomTypes,g=(0,z.Z)(),j=g.pushChanges,v=g.closeModals,y=(0,l.v9)(function(e){return{isSyncing:(0,Y.hg)(e,X.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:m,changedCustomTypes:f})},C=(0,r.useMemo)(function(){return h?u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN?(0,s.jsx)(E,{authStatus:u}):0===b?(0,s.jsx)(U,{}):(0,s.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:a,authStatus:u,isOnline:h}):(0,s.jsx)(w,{})},[h,u,b,n,t,a,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!h||u===Z.t.UNAUTHORIZED||u===Z.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(c.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(eo,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_}),(0,s.jsx)(el,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return f},T9:function(){return h},nf:function(){return m},u2:function(){return u},_T:function(){return x}});var s=t(67557),i=t(62230),r=t(85244),a=t(98240),o=t(52322),c=t(6277),l=t(22715);t(69143);var d=function(e){var n=e.backgroundImage,t=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},l),{className:(0,c.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,s.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},h=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},x=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,o.jsx)(l.hE,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97df95 _1ecs97dez8 _1ecs97dfdl",size:"medium",variant:"secondary"}))}},69143:function(){},25977:function(){}},function(e){e.O(0,[789,123,918,958,80,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
@@ -1 +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 j}});var t=r(52322),i=r(2784),s=r(22715),a=r(97729),c=r.n(a),l=r(76747),o=r(22710),u=r(17064),d=r(99267),h=r(90374),f=r(40432),x=function(e){var n=e.title,r=e.enabled,i=e.onToggle,a=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:a})]}),(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)}})})]})})},g=r(65988),b=function(){var e,n,r,i,a,c,l,b=(0,u.Z)((e="legacySliceUpgrader",n="Legacy Slice Upgrader",i=(0,h.Z)().openToaster,a=(0,u.Z)((0,g.E)(e),2),c=a[0],l=a[1],[c,(r=(0,o.Z)(function(e){var r;return(0,d.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,l(e)];case 1:return t.sent(),i(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n),f.Jf.SUCCESS),[3,3];case 2:return r=t.sent(),console.error(r),i(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n),f.Jf.ERROR),[3,3];case 3:return[2]}})}),function(e){return r.apply(this,arguments)})]),2),j=b[0],p=b[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)(x,{title:"Legacy Slice Upgrader",enabled:j.enabled,onToggle:function(e){p(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."]})})]})},j=function(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c(),{children:(0,t.jsx)("title",{children:"Labs - Slice Machine"})}),(0,t.jsx)(s.SV,{renderError:function(){return(0,t.jsx)(p,{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)(i.Suspense,{fallback:(0,t.jsx)(p,{withHeader:!0,children:(0,t.jsx)(s._3,{})}),children:(0,t.jsx)(p,{withHeader:!0,children:(0,t.jsx)(b,{})})})})]})},p=function(e){var n=e.children,r=e.withHeader;return(0,t.jsxs)(l.LN,{children:[void 0!==r&&r?(0,t.jsx)(l.wd,{children:(0,t.jsx)(l.Cx,{folder:"Labs"})}):null,(0,t.jsx)(l.RN,{children:n})]})}},65988:function(e,n,r){"use strict";r.d(n,{E:function(){return h}});var t=r(22710),i=r(62230),s=r(85244),a=r(17064),c=r(99267),l=r(17329),o=r(81038);function u(){return d.apply(this,arguments)}function d(){return(d=(0,t.Z)(function(){return(0,c.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}function h(e){var n,r,d,h,f,x,g=(0,a.Z)((n=(0,l.QT)(u,[]),r=(0,t.Z)(function(e){return(0,c.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,l.VA)(u,[],e),[2]}})}),[n,d=function(e){return r.apply(this,arguments)}]),2),b=g[0],j=g[1],p=(x=(0,t.Z)(function(n){var r;return(0,c.__generator)(this,function(t){switch(t.label){case 0:return r=(0,s.Z)((0,i.Z)({},b),{labs:(0,i.Z)({},b.labs)}),n?r.labs[e]=n:e in r.labs&&delete r.labs[e],0===Object.keys(r.labs).length&&delete r.labs,[4,j(r)];case 1:return t.sent(),[2]}})}),function(e){return x.apply(this,arguments)});return[{enabled:null!==(f=null==b?void 0:null===(h=b.labs)||void 0===h?void 0:h[e])&&void 0!==f&&f},p]}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=41535)}),_N_E=e.O()}]);
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 j}});var t=r(52322),i=r(2784),s=r(22715),a=r(97729),c=r.n(a),l=r(94975),o=r(22710),u=r(17064),d=r(99267),h=r(90374),f=r(40432),x=function(e){var n=e.title,r=e.enabled,i=e.onToggle,a=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:a})]}),(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)}})})]})})},g=r(65988),b=function(){var e,n,r,i,a,c,l,b=(0,u.Z)((e="legacySliceUpgrader",n="Legacy Slice Upgrader",i=(0,h.Z)().openToaster,a=(0,u.Z)((0,g.E)(e),2),c=a[0],l=a[1],[c,(r=(0,o.Z)(function(e){var r;return(0,d.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,l(e)];case 1:return t.sent(),i(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n),f.Jf.SUCCESS),[3,3];case 2:return r=t.sent(),console.error(r),i(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n),f.Jf.ERROR),[3,3];case 3:return[2]}})}),function(e){return r.apply(this,arguments)})]),2),j=b[0],p=b[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)(x,{title:"Legacy Slice Upgrader",enabled:j.enabled,onToggle:function(e){p(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."]})})]})},j=function(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c(),{children:(0,t.jsx)("title",{children:"Labs - Slice Machine"})}),(0,t.jsx)(s.SV,{renderError:function(){return(0,t.jsx)(p,{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)(i.Suspense,{fallback:(0,t.jsx)(p,{withHeader:!0,children:(0,t.jsx)(s._3,{})}),children:(0,t.jsx)(p,{withHeader:!0,children:(0,t.jsx)(b,{})})})})]})},p=function(e){var n=e.children,r=e.withHeader;return(0,t.jsxs)(l.LN,{children:[void 0!==r&&r?(0,t.jsx)(l.wd,{children:(0,t.jsx)(l.Cx,{folder:"Labs"})}):null,(0,t.jsx)(l.RN,{children:n})]})}},65988:function(e,n,r){"use strict";r.d(n,{E:function(){return h}});var t=r(22710),i=r(62230),s=r(85244),a=r(17064),c=r(99267),l=r(17329),o=r(81038);function u(){return d.apply(this,arguments)}function d(){return(d=(0,t.Z)(function(){return(0,c.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}function h(e){var n,r,d,h,f,x,g=(0,a.Z)((n=(0,l.QT)(u,[]),r=(0,t.Z)(function(e){return(0,c.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,l.VA)(u,[],e),[2]}})}),[n,d=function(e){return r.apply(this,arguments)}]),2),b=g[0],j=g[1],p=(x=(0,t.Z)(function(n){var r;return(0,c.__generator)(this,function(t){switch(t.label){case 0:return r=(0,s.Z)((0,i.Z)({},b),{labs:(0,i.Z)({},b.labs)}),n?r.labs[e]=n:e in r.labs&&delete r.labs[e],0===Object.keys(r.labs).length&&delete r.labs,[4,j(r)];case 1:return t.sent(),[2]}})}),function(e){return x.apply(this,arguments)});return[{enabled:null!==(f=null==b?void 0:null===(h=b.labs)||void 0===h?void 0:h[e])&&void 0!==f&&f},p]}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=41535)}),_N_E=e.O()}]);
@@ -1 +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(47914)}])},47914:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ej}});var i=t(52322),r=t(97729),o=t.n(r),a=t(22715),l=t(2784),s=t(40432),c=t(47560),u=t(38876),d=t(8482),f=t(4092),m=t(2353),v=t(44384),p=t(28173),h=t(90374),x=t(53559),y=function(e){var n=e.variation,t=(0,h.Z)(),r=t.addSliceWidget,o=t.replaceSliceWidget,a=t.reorderSliceWidget,l=t.removeSliceWidget,s=t.updateSliceWidgetMock,y=t.deleteSliceWidgetMock,g=function(e){return function(t){y(n.id,e,t),l(n.id,e,t)}},b=function(e){return function(t){var i=t.apiId,r=t.newKey,a=t.value,l=t.mockValue;l?s(n.id,e,i,r,l):y(n.id,e,r),o(n.id,e,i,r,a)}},j=function(e){return function(t){var i=t.id,o=t.label,a=t.widgetTypeName,l=m[a];l||console.log('Could not find widget with type name "'.concat(a,'". Please contact us!')),r(n.id,e,i,l.create(o))}},S=function(e){return function(t){var i,r;(0,c.uS)(t)||a(n.id,e,t.source.index,null!==(r=null===(i=t.destination)||void 0===i?void 0:i.index)&&void 0!==r?r:void 0)}};return(0,i.jsxs)(p.aV,{children:[(0,i.jsx)(d.Z,{zoneType:"slice",tabId:void 0,title:"Non-Repeatable Zone",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:n.primary,EditModal:f.Z,widgetsArray:v.Z,onDeleteItem:g(x.Rt.Primary),onSave:b(x.Rt.Primary),onSaveNewField:j(x.Rt.Primary),onDragEnd:S(x.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,u.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,u.Ti)(e))},dataCy:"slice-non-repeatable-zone",isRepeatableCustomType:void 0}),(0,i.jsx)(d.Z,{zoneType:"slice",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:v.Z,fields:n.items,EditModal:f.Z,onDeleteItem:g(x.Rt.Items),onSave:b(x.Rt.Items),onSaveNewField:j(x.Rt.Items),onDragEnd:S(x.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,u.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,u.Ti)(e))},dataCy:"slice-repeatable-zone",isRepeatableCustomType:void 0})]})},g=t(62230),b=t(85244),j=t(81541),S=t(5632),w=t(22710),C=t(99267),k=t(55658),Z=t(63397),I=t(25812),T=t(75289),E=t(54132),R=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,l=e.headerSx,s=void 0===l?{}:l;return(0,i.jsx)(E.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,g.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(T.kC,{sx:(0,g.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)}},s),children:[r,o?(0,i.jsx)(T.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(T.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(T.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},A=t(36131),N=function(e){var n=e.msg;return(0,i.jsx)(T.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},L=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,s=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=a.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,l=t&&t.length?null:{name:"Required!"},s=i.value.length&&a.find(function(e){return e.id===i.value})?null:{id:"You must select an existing variation!"},c=n&&n.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(n)&&{id:"No special characters allowed"};return(0,g.Z)({},r,o,l,s,c)},c=function(e){j(k.e.generateId(e))},u=function(e){O(e),E&&c(e)},d=function(e){L(!1),c(e)},f=function(){m(),t()},m=function(){j(""),O(""),h({}),L(!0),F({value:o.id,label:o.name})},v=(0,l.useState)({}),p=v[0],h=v[1],x=(0,l.useState)(""),y=x[0],j=x[1],S=(0,l.useState)(!0),E=S[0],L=S[1],V=(0,l.useState)(""),_=V[0],O=V[1],D=(0,l.useState)({value:o.id,label:o.name}),B=D[0],F=D[1];function z(){return P.apply(this,arguments)}function P(){return(P=(0,w.Z)(function(){var e,n;return(0,C.__generator)(this,function(t){return Object.keys(e=s({id:y,name:_,origin:B})).length?h(e):(n=a.find(function(e){return e.id===B.value}))&&(r(y,_,n),f()),[2]})})).apply(this,arguments)}return(0,l.useEffect)(function(){m()},[o,n]),(0,i.jsx)(I.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return f()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(Z.J9,{initialValues:{id:y,name:_,origin:B},onSubmit:z,children:(0,i.jsx)(Z.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),z())},children:(0,i.jsx)(T.xu,{children:(0,i.jsxs)(R,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(T.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(T.kC,{sx:{justifyContent:"flex-end"},children:[(0,i.jsx)(T.zx,{onClick:f,mr:2,variant:"secondary",children:"Cancel"}),(0,i.jsx)(T.zx,{type:"submit",children:"Submit"})]}),close:f,children:[(0,i.jsxs)(T.xu,{sx:{pb:4,mt:4},children:[(0,i.jsxs)(T.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",p.name?(0,i.jsx)(N,{msg:p.name}):""]}),(0,i.jsx)(Z.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:T.II,maxLength:30,value:_,onChange:function(e){return u(e.currentTarget.value)}}),(0,i.jsx)(T.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(T.xu,{sx:{pb:4},children:[(0,i.jsxs)(T.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",p.id?(0,i.jsx)(N,{msg:p.id}):""]}),(0,i.jsx)(Z.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:T.II,maxLength:30,value:y,onChange:function(e){return d(e.currentTarget.value)}}),(0,i.jsx)(T.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(T.xu,{sx:{pb:4},children:[(0,i.jsx)(T.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(A.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&F(e)},defaultValue:B,maxMenuHeight:150,theme:function(e){return(0,b.Z)((0,g.Z)({},e),{colors:(0,b.Z)((0,g.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},V=t(13858),_=t(82770),O=t(49451);function D(){return(D=(0,w.Z)(function(e){var n,t,i,r,o,a,l,s,c,u,d,f;return(0,C.__generator)(this,function(n){switch(n.label){case 0:e.setSliceBuilderState({loading:!0,done:!1}),n.label=1;case 1:return n.trys.push([1,7,,8]),[4,(0,_.Ve)(e.component)];case 2:if((t=n.sent().errors).length>0)throw t;return[4,(0,_.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id})];case 3:if((r=n.sent().errors).length>0)throw r;return[4,(0,_.X$)(e.component.from,e.component.model.id)];case 4:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,_.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 5:return s=n.sent().mocks,c=O.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(c)];case 6:return n.sent(),e.updateAndSaveSlice((0,b.Z)((0,g.Z)({},e.component),{model:a,mocks:s})),u="".concat(e.component.from,"/").concat(e.component.model.name,"/model.json"),e.setSliceBuilderState({loading:!1,done:!0,error:!1,message:(0,V.kQ)({path:u})}),[3,8];case 7:throw d=n.sent(),f="Could not delete variation `".concat(e.variation.name,"`"),console.error(f,d),e.setSliceBuilderState({loading:!1,done:!0,error:!0,message:f}),d;case 8:return[2]}})})).apply(this,arguments)}var B=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,l=e.sliceBuilderState,s=e.setSliceBuilderState,c=(0,S.useRouter)(),u=(0,h.Z)().updateAndSaveSlice;return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsxs)(a.xu,{flexDirection:"column",children:[(0,i.jsxs)(a.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)(F,{children:"not"})," affect your documents until you ",(0,i.jsx)(F,{children:"edit"})," ","them manually."]}),(0,i.jsx)(a.kX,{ok:{text:"Delete",onClick:function(){o&&(0,w.Z)(function(){return(0,C.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,function(e){return D.apply(this,arguments)}({component:r,router:c,setSliceBuilderState:s,updateAndSaveSlice:u,variation:o})];case 1:case 2:return e.sent(),[3,3];case 3:return t(),[2]}})})()},loading:l.loading},cancel:{text:"Cancel"},size:"medium"})]})})]})},F=function(e){return(0,i.jsx)(a.xv,(0,b.Z)((0,g.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))};function z(){return(z=(0,w.Z)(function(e){var n,t,i,r,o,a,l,s,c,u,d;return(0,C.__generator)(this,function(n){switch(n.label){case 0:e.setSliceBuilderState({loading:!0,done:!1}),n.label=1;case 1:return n.trys.push([1,6,,7]),[4,(0,_.Ve)(e.component)];case 2:if((t=n.sent().errors).length>0)throw t;return[4,(0,_.eH)(e.component,(0,b.Z)((0,g.Z)({},e.variation),{name:e.variationName}))];case 3:if((r=n.sent().errors).length>0)throw r;return[4,(0,_.X$)(e.component.from,e.component.model.id)];case 4:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,_.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 5:return s=n.sent().mocks,e.updateAndSaveSlice((0,b.Z)((0,g.Z)({},e.component),{model:a,mocks:s})),c="".concat(e.component.from,"/").concat(e.component.model.name,"/model.json"),e.setSliceBuilderState({loading:!1,done:!0,error:!1,message:(0,V.kQ)({path:c})}),[3,7];case 6:throw u=n.sent(),d="Could not rename variation `".concat(e.variation.name,"`"),console.error(d,u),e.setSliceBuilderState({loading:!1,done:!0,error:!0,message:d}),u;case 7:return[2]}})})).apply(this,arguments)}var P=function(e){var n,t,r=e.isOpen,o=e.onClose,l=e.slice,s=e.variation,c=e.sliceBuilderState,u=e.setSliceBuilderState,d=(0,h.Z)().updateAndSaveSlice;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(a.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(Z.J9,{validateOnChange:!0,validateOnMount:!0,initialValues:{variationName:null!==(n=null==s?void 0:s.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,w.Z)(function(e){return(0,C.__generator)(this,function(n){switch(n.label){case 0:if(!s)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return z.apply(this,arguments)}({component:l,setSliceBuilderState:u,updateAndSaveSlice:d,variation:s,variationName:e.variationName.trim()})];case 2:case 3:return n.sent(),[3,4];case 4:return o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(a.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(a.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)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:"_1ecs97dez4 _1ecs97dez8 _1ecs97df90",children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(a.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)(a.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:c.loading,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},M=t(84449),K=t(65958),H=t(47731),W=function(e){var n=e.slice,t=e.variation,r=e.sliceBuilderState,o=e.setSliceBuilderState,s=(0,l.useState)(),c=s[0],u=s[1],d=(0,H.H)(),f=d.modalPayload,m=f.sliceFilterFn,v=f.defaultVariationSelector,p=(0,h.Z)(),x=p.copyVariationSlice,y=p.updateSlice,w=(0,S.useRouter)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.xu,{flexDirection:"column",gap:16,children:[n.model.variations.map(function(e){return(0,i.jsx)(K.b,{action:{type:"menu",onRename:function(){u({type:"RENAME_VARIATION",variation:e})},onRemove:function(){u({type:"DELETE_VARIATION",variation:e})},removeDisabled:n.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){d.onOpenModal({sliceFilterFn:function(e){return e},defaultVariationSelector:{sliceID:n.model.id,variationID:e.id}})},replace:!0,selected:e.id===t.id,slice:n,variant:"outlined",variationId:e.id},e.id)}),(0,i.jsxs)(a.xu,{backgroundColor:"grey2",bottom:0,flexDirection:"column",padding:{bottom:40,inline:24},position:"sticky",style:{marginBottom:"-16px"},children:[(0,i.jsx)(a.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(a.zx,{onClick:function(){u({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},variant:"secondary",children:"Add a new variation"})]})]}),(0,i.jsx)(M.Z,{slices:m([n]),defaultVariationSelector:v}),(0,i.jsx)(P,{isOpen:(null==c?void 0:c.type)==="RENAME_VARIATION",onClose:function(){u(void 0)},slice:n,variation:null==c?void 0:c.variation,sliceBuilderState:r,setSliceBuilderState:o}),(0,i.jsx)(B,{isOpen:(null==c?void 0:c.type)==="DELETE_VARIATION",onClose:function(){u(void 0)},slice:n,variation:null==c?void 0:c.variation,sliceBuilderState:r,setSliceBuilderState:o}),(0,i.jsx)(L,{initialVariation:t,isOpen:(null==c?void 0:c.type)==="ADD_VARIATION",onClose:function(){u(void 0)},onSubmit:function(e,t,i){x(e,t,i);var r=k.e.copyValue(i,e,t),a=(0,b.Z)((0,g.Z)({},n),{model:(0,b.Z)((0,g.Z)({},n.model),{variations:(0,j.Z)(n.model.variations).concat([r])})});y(a,o);var l=O.Y.getBuilderPagePathname({libraryName:a.href,sliceName:a.model.name,variationId:r.id});w.replace(l)},variations:n.model.variations})]})},q=t(56580),X=t(75329),J=t(33710),Q=t(42189),Y=t(17036),G=t(39295),$=t(22342),U=function(){return(0,i.jsx)(G.X,{children:(0,i.jsxs)(J.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:[(0,i.jsx)(T.xv,{as:"b",children:"Framework not supported"}),(0,i.jsx)(T.xv,{as:"p",children:"Slice Simulator does not support your framework yet."})]})})},ee=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)($.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)($.Ev,{children:"Simulate your slices"}),(0,i.jsx)($.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:X.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){_.Xe.track({event:"open-video-tutorials",video:X.Sn})}}),(0,i.jsx)($.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)($.Rp,{children:"Got It"})]})},en=function(){return(0,i.jsx)(G.X,{children:(0,i.jsx)(J.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:"Save your work in order to simulate"})})},et=function(e){var n=e.isSimulatorAvailableForFramework,t=e.isTouched,r=(0,S.useRouter)(),o=(0,l.useRef)(null),s=(0,h.Z)().setSeenSimulatorToolTip,c=(0,q.v9)(function(e){return{hasSeenSimulatorTooltip:(0,Y.bv)(e)}}).hasSeenSimulatorTooltip;(0,l.useEffect)(function(){var e=o.current;e&&n&&!c&&setTimeout(function(){return J.Z.show(e)},5e3)},[n,c]);var u=function(){if(s(),o.current){var e=o.current;J.Z.hide(e)}},d=n&&!c;return(0,i.jsxs)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:[(0,i.jsx)(ee,{open:d,onClose:u,children:(0,i.jsx)(a.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){u(),window.open("".concat(r.asPath,"/simulator"),X.pq)},disabled:!n||t,renderStartIcon:function(){return(0,i.jsx)(Q.z,{color:a.TV.color.greyLight11,height:a.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:a.TV.size[24]})},variant:"secondary",children:"Simulate"})}),!1===n?(0,i.jsx)(U,{}):n&&!1===d&&t?(0,i.jsx)(en,{}):null]})},ei=t(76747),er=t(17329),eo=t(81038);function ea(e){return el.apply(this,arguments)}function el(){return(el=(0,w.Z)(function(e){var n,t,i;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return[4,eo.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 es=t(67445),ec=t(64722),eu=t(20812),ed=function(e){return(0,i.jsxs)("svg",(0,b.Z)((0,g.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"})]}))},ef=function(){var e,n,t=(e=(0,ec.l)().source,n=(0,es.Ag)(e.query),void 0!==n&&(0,es.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(a.SV,{children:(0,i.jsx)(l.Suspense,{children:(0,i.jsx)(a.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(em,{sourceCustomTypeId:t})})})}):null},em=function(e){var n,t=(n=e.sourceCustomTypeId,(0,er.QT)(ea,[n])),r=(0,l.useState)(!0),o=r[0],s=r[1],c=(0,S.useRouter)();if(void 0===t||!o)return null;var u=t.format,d=t.id,f=es.cd[u].getBuilderPagePathname(d);return(0,i.jsxs)(a.hE,{density:"compact",variant:"tertiary",children:[(0,i.jsxs)(a.zx,{onClick:function(){c.push(f)},renderStartIcon:function(){return(0,i.jsx)(ed,{})},children:["Return to ",t.label]}),(0,i.jsx)(a.zx,{onClick:function(){s(!1)},renderStartIcon:function(){return(0,i.jsx)(eu.T,{})}})]})},ev=t(39092),ep=t(92521),eh={loading:!1,done:!1},ex=function(e){var n=e.slice,t=e.variation,r=(0,h.Z)().openToaster,o=(0,q.v9)(function(e){return(0,ep.sY)(e,n.from,n.model.id)}),a=(0,l.useState)(eh),c=a[0],u=a[1];return((0,l.useEffect)(function(){o&&u(eh)},[o]),(0,l.useEffect)(function(){if(c.done){var e,n;n=c,n.done&&r(n.message,n.error?s.Jf.ERROR:s.Jf.SUCCESS)}},[c]),t)?(0,i.jsx)(ey,{setState:u,slice:n,variation:t,isTouched:o,state:c}):(0,i.jsx)(ei.LN,{})},ey=function(e){var n=e.setState,t=e.slice,r=e.variation,o=e.isTouched,l=e.state,s=(0,q.v9)(ev.Ql),c=(0,h.Z)().updateSlice;return(0,i.jsxs)(ei.LN,{children:[(0,i.jsxs)(ei.wd,{children:[(0,i.jsx)(ei.Xq,{url:"/slices"}),(0,i.jsx)(ei.Cx,{folder:"Slices",page:t.model.name}),(0,i.jsxs)(ei.K2,{children:[(0,i.jsx)(et,{isSimulatorAvailableForFramework:s,isTouched:!!o}),(0,i.jsx)(a.zx,{loading:l.loading,disabled:!o||l.loading,onClick:function(){c(t,n)},"data-cy":"builder-save-button",children:"Save"})]})]}),(0,i.jsxs)(ei.RN,{children:[(0,i.jsxs)(a.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(W,{slice:t,variation:r,sliceBuilderState:l,setSliceBuilderState:n}),(0,i.jsx)(y,{variation:r})]}),(0,i.jsx)(ef,{})]})]})},eg=t(28684),eb=(0,t(57880).y)(ex);function ej(){var e=(0,eg.Z)().slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:e?(0,i.jsxs)("title",{children:[e.model.name," - Slice Machine"]}):null}),(0,i.jsx)(eb,{})]})}},28684:function(e,n,t){"use strict";var i=t(92521),r=t(90374),o=t(5632),a=t(2784),l=t(56580),s=function(){var e=(0,o.useRouter)(),n=(0,r.Z)().initSliceStore,t=(0,l.v9)(function(n){return{slice:(0,i.tL)(n,e.query.lib,e.query.sliceName)}}).slice;if((0,a.useEffect)(function(){t?n(t):e.replace("/")},[n,t,e]),!t)return{};var s=t.model.variations.find(function(n){return n.id===e.query.variation});return s?{slice:t,variation:s}:(e.replace("/"),{})};n.Z=s},57880:function(e,n,t){"use strict";t.d(n,{y:function(){return l}});var i=t(62230),r=t(52322);t(2784);var o=t(28684),a=t(95583),l=function(e){return function(n){var t=n.pageProps,l=(0,o.Z)(),s=l.slice,c=l.variation;return s&&c?(0,r.jsx)(e,(0,i.Z)({slice:s,variation:c},t)):((0,a.gx)("/"),null)}}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return b}});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 l(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,n){return void 0===n&&(n=","),e.split(n)}function c(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return l(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([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([l(e.key),l(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 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 p=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,s=n.mod,c=n.shift,f=n.ctrl,m=n.keys,v=e.key,p=e.code,h=e.ctrlKey,x=e.metaKey,y=e.shiftKey,g=e.altKey,b=l(p),j=v.toLowerCase();if(!t){if(!g===o&&"alt"!==j||!y===c&&"shift"!==j)return!1;if(s){if(!x&&!h)return!1}else if(!x===a&&"meta"!==j&&"os"!==j||!h===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(b)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},h=(0,i.createContext)(void 0),x=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,n,t,r){var o,a,u=(0,i.useRef)(null),b=(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,w=t instanceof Array?t:r instanceof Array?r:void 0,C=(0,i.useCallback)(n,null!=w?w:[]),k=(0,i.useRef)(C);w?k.current=C:k.current=n;var Z=(!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,j)&&(a.current=j),a.current),I=(0,i.useContext)(x).enabledScopes,T=(0,i.useContext)(h);return g(function(){if((null==Z?void 0:Z.enabled)!==!1&&(e=I,n=null==Z?void 0:Z.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==Z?void 0:Z.enableOnFormTags)||null!=Z&&null!=Z.ignoreEventWhen&&Z.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!=Z&&Z.enableOnContentEditable)&&s(S,null==Z?void 0:Z.splitKey).forEach(function(t){var i,r,o,a,l,s,u,d=c(t,null==Z?void 0:Z.combinationKey);if(p(e,d,null==Z?void 0:Z.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&b.current)return;if(i=e,r=d,("function"==typeof(o=null==Z?void 0:Z.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,l=d,"function"==typeof(s=null==Z?void 0:Z.enabled)?!s(a,l):!0!==s&&void 0!==s){y(e);return}k.current(e,d),n||(b.current=!0)}})}},i=function(e){void 0!==e.key&&(f(l(e.code)),((null==Z?void 0:Z.keydown)===void 0&&(null==Z?void 0:Z.keyup)!==!0||null!=Z&&Z.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(l(e.code)),b.current=!1,null!=Z&&Z.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),T&&s(S,null==Z?void 0:Z.splitKey).forEach(function(e){return T.addHotkey(c(e,null==Z?void 0:Z.combinationKey,null==Z?void 0:Z.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),T&&s(S,null==Z?void 0:Z.splitKey).forEach(function(e){return T.removeHotkey(c(e,null==Z?void 0:Z.combinationKey,null==Z?void 0:Z.description))})}}},[S,Z,I]),u}}},function(e){e.O(0,[789,958,80,482,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
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(47914)}])},47914:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ej}});var i=t(52322),r=t(97729),o=t.n(r),a=t(22715),l=t(2784),s=t(40432),c=t(47560),u=t(38876),d=t(8482),f=t(4092),m=t(2353),v=t(44384),p=t(28173),h=t(90374),x=t(53559),y=function(e){var n=e.variation,t=(0,h.Z)(),r=t.addSliceWidget,o=t.replaceSliceWidget,a=t.reorderSliceWidget,l=t.removeSliceWidget,s=t.updateSliceWidgetMock,y=t.deleteSliceWidgetMock,g=function(e){return function(t){y(n.id,e,t),l(n.id,e,t)}},b=function(e){return function(t){var i=t.apiId,r=t.newKey,a=t.value,l=t.mockValue;l?s(n.id,e,i,r,l):y(n.id,e,r),o(n.id,e,i,r,a)}},j=function(e){return function(t){var i=t.id,o=t.label,a=t.widgetTypeName,l=m[a];l||console.log('Could not find widget with type name "'.concat(a,'". Please contact us!')),r(n.id,e,i,l.create(o))}},S=function(e){return function(t){var i,r;(0,c.uS)(t)||a(n.id,e,t.source.index,null!==(r=null===(i=t.destination)||void 0===i?void 0:i.index)&&void 0!==r?r:void 0)}};return(0,i.jsxs)(p.aV,{children:[(0,i.jsx)(d.Z,{zoneType:"slice",tabId:void 0,title:"Non-Repeatable Zone",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:n.primary,EditModal:f.Z,widgetsArray:v.Z,onDeleteItem:g(x.Rt.Primary),onSave:b(x.Rt.Primary),onSaveNewField:j(x.Rt.Primary),onDragEnd:S(x.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,u.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,u.Ti)(e))},dataCy:"slice-non-repeatable-zone",isRepeatableCustomType:void 0}),(0,i.jsx)(d.Z,{zoneType:"slice",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:v.Z,fields:n.items,EditModal:f.Z,onDeleteItem:g(x.Rt.Items),onSave:b(x.Rt.Items),onSaveNewField:j(x.Rt.Items),onDragEnd:S(x.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,u.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,u.Ti)(e))},dataCy:"slice-repeatable-zone",isRepeatableCustomType:void 0})]})},g=t(62230),b=t(85244),j=t(81541),S=t(5632),w=t(22710),C=t(99267),k=t(55658),Z=t(63397),I=t(25812),T=t(75289),E=t(54132),R=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,l=e.headerSx,s=void 0===l?{}:l;return(0,i.jsx)(E.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,g.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(T.kC,{sx:(0,g.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)}},s),children:[r,o?(0,i.jsx)(T.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(T.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(T.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},A=t(36131),N=function(e){var n=e.msg;return(0,i.jsx)(T.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},L=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,s=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=a.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,l=t&&t.length?null:{name:"Required!"},s=i.value.length&&a.find(function(e){return e.id===i.value})?null:{id:"You must select an existing variation!"},c=n&&n.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(n)&&{id:"No special characters allowed"};return(0,g.Z)({},r,o,l,s,c)},c=function(e){j(k.e.generateId(e))},u=function(e){O(e),E&&c(e)},d=function(e){L(!1),c(e)},f=function(){m(),t()},m=function(){j(""),O(""),h({}),L(!0),F({value:o.id,label:o.name})},v=(0,l.useState)({}),p=v[0],h=v[1],x=(0,l.useState)(""),y=x[0],j=x[1],S=(0,l.useState)(!0),E=S[0],L=S[1],V=(0,l.useState)(""),_=V[0],O=V[1],D=(0,l.useState)({value:o.id,label:o.name}),B=D[0],F=D[1];function z(){return P.apply(this,arguments)}function P(){return(P=(0,w.Z)(function(){var e,n;return(0,C.__generator)(this,function(t){return Object.keys(e=s({id:y,name:_,origin:B})).length?h(e):(n=a.find(function(e){return e.id===B.value}))&&(r(y,_,n),f()),[2]})})).apply(this,arguments)}return(0,l.useEffect)(function(){m()},[o,n]),(0,i.jsx)(I.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return f()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(Z.J9,{initialValues:{id:y,name:_,origin:B},onSubmit:z,children:(0,i.jsx)(Z.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),z())},children:(0,i.jsx)(T.xu,{children:(0,i.jsxs)(R,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(T.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(T.kC,{sx:{justifyContent:"flex-end"},children:[(0,i.jsx)(T.zx,{onClick:f,mr:2,variant:"secondary",children:"Cancel"}),(0,i.jsx)(T.zx,{type:"submit",children:"Submit"})]}),close:f,children:[(0,i.jsxs)(T.xu,{sx:{pb:4,mt:4},children:[(0,i.jsxs)(T.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",p.name?(0,i.jsx)(N,{msg:p.name}):""]}),(0,i.jsx)(Z.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:T.II,maxLength:30,value:_,onChange:function(e){return u(e.currentTarget.value)}}),(0,i.jsx)(T.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(T.xu,{sx:{pb:4},children:[(0,i.jsxs)(T.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",p.id?(0,i.jsx)(N,{msg:p.id}):""]}),(0,i.jsx)(Z.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:T.II,maxLength:30,value:y,onChange:function(e){return d(e.currentTarget.value)}}),(0,i.jsx)(T.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(T.xu,{sx:{pb:4},children:[(0,i.jsx)(T.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(A.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&F(e)},defaultValue:B,maxMenuHeight:150,theme:function(e){return(0,b.Z)((0,g.Z)({},e),{colors:(0,b.Z)((0,g.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},V=t(13858),_=t(82770),O=t(49451);function D(){return(D=(0,w.Z)(function(e){var n,t,i,r,o,a,l,s,c,u,d,f;return(0,C.__generator)(this,function(n){switch(n.label){case 0:e.setSliceBuilderState({loading:!0,done:!1}),n.label=1;case 1:return n.trys.push([1,7,,8]),[4,(0,_.Ve)(e.component)];case 2:if((t=n.sent().errors).length>0)throw t;return[4,(0,_.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id})];case 3:if((r=n.sent().errors).length>0)throw r;return[4,(0,_.X$)(e.component.from,e.component.model.id)];case 4:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,_.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 5:return s=n.sent().mocks,c=O.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(c)];case 6:return n.sent(),e.updateAndSaveSlice((0,b.Z)((0,g.Z)({},e.component),{model:a,mocks:s})),u="".concat(e.component.from,"/").concat(e.component.model.name,"/model.json"),e.setSliceBuilderState({loading:!1,done:!0,error:!1,message:(0,V.kQ)({path:u})}),[3,8];case 7:throw d=n.sent(),f="Could not delete variation `".concat(e.variation.name,"`"),console.error(f,d),e.setSliceBuilderState({loading:!1,done:!0,error:!0,message:f}),d;case 8:return[2]}})})).apply(this,arguments)}var B=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,l=e.sliceBuilderState,s=e.setSliceBuilderState,c=(0,S.useRouter)(),u=(0,h.Z)().updateAndSaveSlice;return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsxs)(a.xu,{flexDirection:"column",children:[(0,i.jsxs)(a.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)(F,{children:"not"})," affect your documents until you ",(0,i.jsx)(F,{children:"edit"})," ","them manually."]}),(0,i.jsx)(a.kX,{ok:{text:"Delete",onClick:function(){o&&(0,w.Z)(function(){return(0,C.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,function(e){return D.apply(this,arguments)}({component:r,router:c,setSliceBuilderState:s,updateAndSaveSlice:u,variation:o})];case 1:case 2:return e.sent(),[3,3];case 3:return t(),[2]}})})()},loading:l.loading},cancel:{text:"Cancel"},size:"medium"})]})})]})},F=function(e){return(0,i.jsx)(a.xv,(0,b.Z)((0,g.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))};function z(){return(z=(0,w.Z)(function(e){var n,t,i,r,o,a,l,s,c,u,d;return(0,C.__generator)(this,function(n){switch(n.label){case 0:e.setSliceBuilderState({loading:!0,done:!1}),n.label=1;case 1:return n.trys.push([1,6,,7]),[4,(0,_.Ve)(e.component)];case 2:if((t=n.sent().errors).length>0)throw t;return[4,(0,_.eH)(e.component,(0,b.Z)((0,g.Z)({},e.variation),{name:e.variationName}))];case 3:if((r=n.sent().errors).length>0)throw r;return[4,(0,_.X$)(e.component.from,e.component.model.id)];case 4:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,_.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 5:return s=n.sent().mocks,e.updateAndSaveSlice((0,b.Z)((0,g.Z)({},e.component),{model:a,mocks:s})),c="".concat(e.component.from,"/").concat(e.component.model.name,"/model.json"),e.setSliceBuilderState({loading:!1,done:!0,error:!1,message:(0,V.kQ)({path:c})}),[3,7];case 6:throw u=n.sent(),d="Could not rename variation `".concat(e.variation.name,"`"),console.error(d,u),e.setSliceBuilderState({loading:!1,done:!0,error:!0,message:d}),u;case 7:return[2]}})})).apply(this,arguments)}var P=function(e){var n,t,r=e.isOpen,o=e.onClose,l=e.slice,s=e.variation,c=e.sliceBuilderState,u=e.setSliceBuilderState,d=(0,h.Z)().updateAndSaveSlice;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(a.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(Z.J9,{validateOnChange:!0,validateOnMount:!0,initialValues:{variationName:null!==(n=null==s?void 0:s.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,w.Z)(function(e){return(0,C.__generator)(this,function(n){switch(n.label){case 0:if(!s)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return z.apply(this,arguments)}({component:l,setSliceBuilderState:u,updateAndSaveSlice:d,variation:s,variationName:e.variationName.trim()})];case 2:case 3:return n.sent(),[3,4];case 4:return o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(a.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(a.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)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:"_1ecs97dez4 _1ecs97dez8 _1ecs97df90",children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(a.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)(a.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:c.loading,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},M=t(84449),K=t(65958),H=t(47731),W=function(e){var n=e.slice,t=e.variation,r=e.sliceBuilderState,o=e.setSliceBuilderState,s=(0,l.useState)(),c=s[0],u=s[1],d=(0,H.H)(),f=d.modalPayload,m=f.sliceFilterFn,v=f.defaultVariationSelector,p=(0,h.Z)(),x=p.copyVariationSlice,y=p.updateSlice,w=(0,S.useRouter)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.xu,{flexDirection:"column",gap:16,children:[n.model.variations.map(function(e){return(0,i.jsx)(K.b,{action:{type:"menu",onRename:function(){u({type:"RENAME_VARIATION",variation:e})},onRemove:function(){u({type:"DELETE_VARIATION",variation:e})},removeDisabled:n.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){d.onOpenModal({sliceFilterFn:function(e){return e},defaultVariationSelector:{sliceID:n.model.id,variationID:e.id}})},replace:!0,selected:e.id===t.id,slice:n,variant:"outlined",variationId:e.id},e.id)}),(0,i.jsxs)(a.xu,{backgroundColor:"grey2",bottom:0,flexDirection:"column",padding:{bottom:40,inline:24},position:"sticky",style:{marginBottom:"-16px"},children:[(0,i.jsx)(a.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(a.zx,{onClick:function(){u({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},variant:"secondary",children:"Add a new variation"})]})]}),(0,i.jsx)(M.Z,{slices:m([n]),defaultVariationSelector:v}),(0,i.jsx)(P,{isOpen:(null==c?void 0:c.type)==="RENAME_VARIATION",onClose:function(){u(void 0)},slice:n,variation:null==c?void 0:c.variation,sliceBuilderState:r,setSliceBuilderState:o}),(0,i.jsx)(B,{isOpen:(null==c?void 0:c.type)==="DELETE_VARIATION",onClose:function(){u(void 0)},slice:n,variation:null==c?void 0:c.variation,sliceBuilderState:r,setSliceBuilderState:o}),(0,i.jsx)(L,{initialVariation:t,isOpen:(null==c?void 0:c.type)==="ADD_VARIATION",onClose:function(){u(void 0)},onSubmit:function(e,t,i){x(e,t,i);var r=k.e.copyValue(i,e,t),a=(0,b.Z)((0,g.Z)({},n),{model:(0,b.Z)((0,g.Z)({},n.model),{variations:(0,j.Z)(n.model.variations).concat([r])})});y(a,o);var l=O.Y.getBuilderPagePathname({libraryName:a.href,sliceName:a.model.name,variationId:r.id});w.replace(l)},variations:n.model.variations})]})},q=t(56580),X=t(75329),J=t(33710),Q=t(42189),Y=t(17036),G=t(39295),$=t(22342),U=function(){return(0,i.jsx)(G.X,{children:(0,i.jsxs)(J.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:[(0,i.jsx)(T.xv,{as:"b",children:"Framework not supported"}),(0,i.jsx)(T.xv,{as:"p",children:"Slice Simulator does not support your framework yet."})]})})},ee=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)($.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)($.Ev,{children:"Simulate your slices"}),(0,i.jsx)($.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:X.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){_.Xe.track({event:"open-video-tutorials",video:X.Sn})}}),(0,i.jsx)($.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)($.Rp,{children:"Got It"})]})},en=function(){return(0,i.jsx)(G.X,{children:(0,i.jsx)(J.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:"Save your work in order to simulate"})})},et=function(e){var n=e.isSimulatorAvailableForFramework,t=e.isTouched,r=(0,S.useRouter)(),o=(0,l.useRef)(null),s=(0,h.Z)().setSeenSimulatorToolTip,c=(0,q.v9)(function(e){return{hasSeenSimulatorTooltip:(0,Y.bv)(e)}}).hasSeenSimulatorTooltip;(0,l.useEffect)(function(){var e=o.current;e&&n&&!c&&setTimeout(function(){return J.Z.show(e)},5e3)},[n,c]);var u=function(){if(s(),o.current){var e=o.current;J.Z.hide(e)}},d=n&&!c;return(0,i.jsxs)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:[(0,i.jsx)(ee,{open:d,onClose:u,children:(0,i.jsx)(a.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){u(),window.open("".concat(r.asPath,"/simulator"),X.pq)},disabled:!n||t,renderStartIcon:function(){return(0,i.jsx)(Q.z,{color:a.TV.color.greyLight11,height:a.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:a.TV.size[24]})},variant:"secondary",children:"Simulate"})}),!1===n?(0,i.jsx)(U,{}):n&&!1===d&&t?(0,i.jsx)(en,{}):null]})},ei=t(94975),er=t(17329),eo=t(81038);function ea(e){return el.apply(this,arguments)}function el(){return(el=(0,w.Z)(function(e){var n,t,i;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return[4,eo.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 es=t(67445),ec=t(64722),eu=t(20812),ed=function(e){return(0,i.jsxs)("svg",(0,b.Z)((0,g.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"})]}))},ef=function(){var e,n,t=(e=(0,ec.l)().source,n=(0,es.Ag)(e.query),void 0!==n&&(0,es.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(a.SV,{children:(0,i.jsx)(l.Suspense,{children:(0,i.jsx)(a.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(em,{sourceCustomTypeId:t})})})}):null},em=function(e){var n,t=(n=e.sourceCustomTypeId,(0,er.QT)(ea,[n])),r=(0,l.useState)(!0),o=r[0],s=r[1],c=(0,S.useRouter)();if(void 0===t||!o)return null;var u=t.format,d=t.id,f=es.cd[u].getBuilderPagePathname(d);return(0,i.jsxs)(a.hE,{density:"compact",variant:"tertiary",children:[(0,i.jsxs)(a.zx,{onClick:function(){c.push(f)},renderStartIcon:function(){return(0,i.jsx)(ed,{})},children:["Return to ",t.label]}),(0,i.jsx)(a.zx,{onClick:function(){s(!1)},renderStartIcon:function(){return(0,i.jsx)(eu.T,{})}})]})},ev=t(39092),ep=t(92521),eh={loading:!1,done:!1},ex=function(e){var n=e.slice,t=e.variation,r=(0,h.Z)().openToaster,o=(0,q.v9)(function(e){return(0,ep.sY)(e,n.from,n.model.id)}),a=(0,l.useState)(eh),c=a[0],u=a[1];return((0,l.useEffect)(function(){o&&u(eh)},[o]),(0,l.useEffect)(function(){if(c.done){var e,n;n=c,n.done&&r(n.message,n.error?s.Jf.ERROR:s.Jf.SUCCESS)}},[c]),t)?(0,i.jsx)(ey,{setState:u,slice:n,variation:t,isTouched:o,state:c}):(0,i.jsx)(ei.LN,{})},ey=function(e){var n=e.setState,t=e.slice,r=e.variation,o=e.isTouched,l=e.state,s=(0,q.v9)(ev.Ql),c=(0,h.Z)().updateSlice;return(0,i.jsxs)(ei.LN,{children:[(0,i.jsxs)(ei.wd,{children:[(0,i.jsx)(ei.Xq,{url:"/slices"}),(0,i.jsx)(ei.Cx,{folder:"Slices",page:t.model.name}),(0,i.jsxs)(ei.K2,{children:[(0,i.jsx)(et,{isSimulatorAvailableForFramework:s,isTouched:!!o}),(0,i.jsx)(a.zx,{loading:l.loading,disabled:!o||l.loading,onClick:function(){c(t,n)},"data-cy":"builder-save-button",children:"Save"})]})]}),(0,i.jsxs)(ei.RN,{children:[(0,i.jsxs)(a.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(W,{slice:t,variation:r,sliceBuilderState:l,setSliceBuilderState:n}),(0,i.jsx)(y,{variation:r})]}),(0,i.jsx)(ef,{})]})]})},eg=t(28684),eb=(0,t(57880).y)(ex);function ej(){var e=(0,eg.Z)().slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:e?(0,i.jsxs)("title",{children:[e.model.name," - Slice Machine"]}):null}),(0,i.jsx)(eb,{})]})}},28684:function(e,n,t){"use strict";var i=t(92521),r=t(90374),o=t(5632),a=t(2784),l=t(56580),s=function(){var e=(0,o.useRouter)(),n=(0,r.Z)().initSliceStore,t=(0,l.v9)(function(n){return{slice:(0,i.tL)(n,e.query.lib,e.query.sliceName)}}).slice;if((0,a.useEffect)(function(){t?n(t):e.replace("/")},[n,t,e]),!t)return{};var s=t.model.variations.find(function(n){return n.id===e.query.variation});return s?{slice:t,variation:s}:(e.replace("/"),{})};n.Z=s},57880:function(e,n,t){"use strict";t.d(n,{y:function(){return l}});var i=t(62230),r=t(52322);t(2784);var o=t(28684),a=t(95583),l=function(e){return function(n){var t=n.pageProps,l=(0,o.Z)(),s=l.slice,c=l.variation;return s&&c?(0,r.jsx)(e,(0,i.Z)({slice:s,variation:c},t)):((0,a.gx)("/"),null)}}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return b}});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 l(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,n){return void 0===n&&(n=","),e.split(n)}function c(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return l(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([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([l(e.key),l(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 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 p=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,s=n.mod,c=n.shift,f=n.ctrl,m=n.keys,v=e.key,p=e.code,h=e.ctrlKey,x=e.metaKey,y=e.shiftKey,g=e.altKey,b=l(p),j=v.toLowerCase();if(!t){if(!g===o&&"alt"!==j||!y===c&&"shift"!==j)return!1;if(s){if(!x&&!h)return!1}else if(!x===a&&"meta"!==j&&"os"!==j||!h===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(b)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},h=(0,i.createContext)(void 0),x=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,n,t,r){var o,a,u=(0,i.useRef)(null),b=(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,w=t instanceof Array?t:r instanceof Array?r:void 0,C=(0,i.useCallback)(n,null!=w?w:[]),k=(0,i.useRef)(C);w?k.current=C:k.current=n;var Z=(!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,j)&&(a.current=j),a.current),I=(0,i.useContext)(x).enabledScopes,T=(0,i.useContext)(h);return g(function(){if((null==Z?void 0:Z.enabled)!==!1&&(e=I,n=null==Z?void 0:Z.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==Z?void 0:Z.enableOnFormTags)||null!=Z&&null!=Z.ignoreEventWhen&&Z.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!=Z&&Z.enableOnContentEditable)&&s(S,null==Z?void 0:Z.splitKey).forEach(function(t){var i,r,o,a,l,s,u,d=c(t,null==Z?void 0:Z.combinationKey);if(p(e,d,null==Z?void 0:Z.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&b.current)return;if(i=e,r=d,("function"==typeof(o=null==Z?void 0:Z.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,l=d,"function"==typeof(s=null==Z?void 0:Z.enabled)?!s(a,l):!0!==s&&void 0!==s){y(e);return}k.current(e,d),n||(b.current=!0)}})}},i=function(e){void 0!==e.key&&(f(l(e.code)),((null==Z?void 0:Z.keydown)===void 0&&(null==Z?void 0:Z.keyup)!==!0||null!=Z&&Z.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(l(e.code)),b.current=!1,null!=Z&&Z.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),T&&s(S,null==Z?void 0:Z.splitKey).forEach(function(e){return T.addHotkey(c(e,null==Z?void 0:Z.combinationKey,null==Z?void 0:Z.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),T&&s(S,null==Z?void 0:Z.splitKey).forEach(function(e){return T.removeHotkey(c(e,null==Z?void 0:Z.combinationKey,null==Z?void 0:Z.description))})}}},[S,Z,I]),u}}},function(e){e.O(0,[789,958,80,482,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
@@ -1 +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(12472)}])},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),a=t(2784),c=t(75289),s=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,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,d=e.type,f=e.form,m=e.isLoading,p=void 0!==m&&m,x=e.disabled,h=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!==x&&x||p,onClick:p?void 0:h,variant:S},C),{children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.$j,{size:b,color:u(S),"data-cy":s(C["data-cy"],"spinner")}),a&&t]}):(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsx)(a,{size:b,fill:g,"data-cy":s(C["data-cy"],"icon")}),t]})}))})},45466:function(e,n,t){"use strict";t.d(n,{c:function(){return j}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),c=t(75289),s=t(2784),u=t(36131),d=t(68780),f=t(88932),m=t(38876),p=t(81038),x=t(82770);function h(){return(h=(0,i.Z)(function(e){var n,t,i,r,o,a,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:var s;return l.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,s=n,r={id:(0,m.T3)(s),type:"SharedSlice",name:s,description:s,variations:[{id:v,name:(0,m.MP)(v),docURL:"...",version:"initial",description:(0,m.MP)(v),imageUrl:""},]},[4,p.j.slices.createSlice({libraryID:t,model:r})];case 1:if((o=l.sent().errors).length>0)throw o;return x.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),c="Internal Error: Slice not created",console.error(c,a),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v="default",y=t(90374),b=t(66443),g=t(70041),j=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,p=e.remoteSlices,v=(0,y.Z)().createSliceSuccess,j=(0,s.useState)(!1),S=j[0],C=j[1],k=(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,C(!0),[4,function(e){return h.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,x.y0)()];case 1:return v(n.sent().libraries),[4,f(e,t)];case 2:return n.sent(),[2]}})}),function(e){return o.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,a.jsx)(d.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:S,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,b.h)(e,m,p)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,a.jsxs)(c.xu,{children:[(0,a.jsx)(g.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,a.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,a.jsx)(u.ZP,{name:"from",options:m.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 a}});var i=t(62230),r=t(52322);t(2784);var o=t(63397),l=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,s=e.dataCy,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:a,as:l.II,autoComplete:"off"},u?{onChange:u}:null,s?{"data-cy":s}:null)),c?(0,r.jsx)(l.xv,{"data-cy":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return s}});var i=t(81541),r=t(75329),o=t(96009),l=t.n(o),a=t(74600),c=t.n(a);function s(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 a=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),s=t.map(function(e){return e.name});if((0,i.Z)(a).concat((0,i.Z)(s)).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,a=e.gridTemplateMinPx,c=e.gridGap,s=e.sx;return(0,r.jsx)(o.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===a?"320px":a,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},s),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(37149),a=t.n(l),c=t(25812),s=t(63397),u=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,l=e.isOpen,m=e.formId,p=e.validate,x=e.onSubmit,h=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,k=e.buttonLabel,w=void 0===k?"Save":k,L=e.dataCy,I=e.actionMessage;return a().setAppElement("#__next"),(0,o.jsx)(c.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=h?h:"900px"}},children:(0,o.jsx)(s.J9,{validateOnChange:!0,initialValues:v,validate:function(e){return p?p(e):void 0},onSubmit:function(e){x(e)},children:function(e){var l=e.isValid,a=e.isSubmitting,c=e.values,p=e.errors,x=e.touched,h=e.setFieldValue,v=e.setValues;return(0,o.jsx)(s.l0,(0,r.Z)((0,i.Z)({id:m},null!=L?{"data-cy":L}: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)(u.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)(u.X6,{sx:{fontSize:"20px"},children:y}),(0,o.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,o.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof I?I(e):I}),(0,o.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||C,children:"Cancel"}),(0,o.jsx)(d.z,{label:w,form:m,type:"submit",disabled:!l||a||C,isLoading:a||C,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:l,isSubmitting:a,values:c,errors:p,touched:x,setFieldValue:h,setValues:v})}))}))}})})}},12472:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return V}});var i=t(81541),r=t(52322),o=t(22715),l=t(2784),a=t(97729),c=t.n(a),s=t(65077),u=t(75289),d=t(56580),f=t(5632),m=t(88932),p=t(75329),x=t(76747),h=t(45466),v=t(59469),y=t(36887),b=t(82770),g=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,o=e.documentationComponent,l=e.videoPublicIdUrl;return(0,r.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},children:[(0,r.jsx)(u.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)(y.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){b.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,r.jsxs)(u.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)(u.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)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,r.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,r.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,r.jsx)(u.zx,{onClick:t,"data-cy":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:i}),(0,r.jsx)(u.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"})]})]})]})},j=t(84449),S=t(90374),C=t(68780),k=t(70041),w=t(77174),L=t(24340),I=t(75992),E=t(66443),N=function(e){var n=e.sliceName,t=e.sliceId,i=e.libName,o=(0,S.Z)(),l=o.renameSlice,a=o.closeModals,c=(0,d.v9)(function(e){return{isRenameSliceModalOpen:(0,w.gP)(e,L.q.RENAME_SLICE),localLibs:(0,I.Sd)(e),remoteLibs:(0,I.sT)(e)}}),s=c.isRenameSliceModalOpen,f=c.localLibs,m=c.remoteLibs,p=function(e){l(i,t,e.sliceName)};return(0,r.jsx)(C.Z,{dataCy:"rename-slice-modal",isOpen:s,widthInPx:"530px",formId:"rename-slice-modal-".concat(t),close:a,buttonLabel:"Rename",onSubmit:p,initialValues:{sliceName:n},content:{title:"Rename a slice"},validate:function(e){return(0,E.h)(e,f,m)},children:function(e){var n=e.touched,t=e.errors;return(0,r.jsx)(u.xu,{children:(0,r.jsx)(k.W,{name:"sliceName",label:"Slice Name","data-cy":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?t.sliceName:void 0,dataCy:"slice-name-input"})})}})},Z=t(25812),P=t(59326),R=t(54132),O=t(65186),_=t(56577),z=t(3098),F=t(32665),M=function(e){var n=e.sliceId,t=e.sliceName,i=e.libName,o=(0,d.v9)(function(e){return{isSliceModalOpen:(0,w.gP)(e,L.q.DELETE_SLICE),isDeletingSlice:(0,F.hg)(e,z.z.DELETE_SLICE)}}),l=o.isSliceModalOpen,a=o.isDeletingSlice,c=(0,S.Z)(),s=c.closeModals,f=c.deleteSlice,m=(0,P.B7)().theme;return(0,r.jsx)(Z.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:s,children:(0,r.jsx)(R.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)(u.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)(u.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(O.$vK,{size:20,color:null===(e=m.colors)||void 0===e?void 0:e.greyIcon}),(0,r.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,r.jsx)(u.x8,{type:"button",onClick:s})]})},Footer:function(){return(0,r.jsxs)(u.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)(_.z,{label:"Cancel",variant:"secondary",onClick:function(){return s()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,r.jsx)(_.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:function(){return f(n,t,i)}})]})},children:(0,r.jsxs)(u.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)(u.xv,{sx:{fontWeight:"bold"},children:[i,"/",t,"/"]})," ","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."]})})})},A=t(47731),T=t(65958),W=t(49451),D=t(13858),V=function(){var e,n,t,a,y,b,C=(0,f.useRouter)(),k=(0,S.Z)(),w=k.openRenameSliceModal,L=k.openDeleteSliceModal,E=(0,A.H)(),Z=E.modalPayload,P=E.onOpenModal,R=Z.sliceFilterFn,O=Z.defaultVariationSelector,_=(0,d.v9)(function(e){return{remoteSlices:(0,I.sT)(e),libraries:(0,I.Sd)(e)}}),z=_.remoteSlices,F=_.libraries,V=(0,l.useState)(!1),K=V[0],B=V[1],H=F.filter(function(e){return e.isLocal}),X=F.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),q=(F||[]).map(function(e){return e.components}).flat(),U=q.length,G=(0,l.useState)(),Y=G[0],$=G[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Slices - Slice Machine"})}),(0,r.jsxs)(x.LN,{children:[(0,r.jsxs)(x.wd,{children:[(0,r.jsx)(x.Cx,{folder:"Slices"}),(null==H?void 0:H.length)!==0&&0!==U?(0,r.jsx)(x.K2,{children:(0,r.jsx)(o.zx,{"data-testid":"create-slice","data-cy":"create-slice",onClick:function(){B(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,r.jsxs)(x.RN,{children:[(0,r.jsx)(s.xR,{sx:{display:"flex",flexDirection:"column"},children:X.length>0?(0,r.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===U?(0,r.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(g,{title:"What are Slices?",onCreateNew:function(){B(!0)},buttonText:"Create one",videoPublicIdUrl:p.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)(u.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"}),"."]})})}):X.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,r.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,r.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,r.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,r.jsx)(u.xv,{children:n})}),!t&&(0,r.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,r.jsx)(v.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return(0,r.jsx)(T.b,{action:{type:"menu",onRemove:function(){$(e),L()},onRename:function(){$(e),w()}},mode:"navigation",onUpdateScreenshot:function(){P({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==H?void 0:H.length)>0&&(0,r.jsx)(j.Z,{slices:R(q),defaultVariationSelector:O}),(null==H?void 0:H.length)>0&&K&&(0,r.jsx)(h.c,{localLibraries:H,remoteSlices:z,onSuccess:function(e,n){var t=e.variations[0].id,i=W.Y.getBuilderPagePathname({libraryName:n,sliceName:e.name,variationId:t});C.push(i),m.Am.success((0,D.kQ)({path:"".concat(n,"/").concat(e.name,"/model.json")}))},onClose:function(){B(!1)}}),(0,r.jsx)(N,{sliceId:null!==(e=null==Y?void 0:Y.model.id)&&void 0!==e?e:"",sliceName:null!==(n=null==Y?void 0:Y.model.name)&&void 0!==n?n:"",libName:null!==(t=null==Y?void 0:Y.from)&&void 0!==t?t:"","data-cy":"rename-slice-modal"}),(0,r.jsx)(M,{sliceId:null!==(a=null==Y?void 0:Y.model.id)&&void 0!==a?a:"",sliceName:null!==(y=null==Y?void 0:Y.model.name)&&void 0!==y?y:"",libName:null!==(b=null==Y?void 0:Y.from)&&void 0!==b?b:""})]})]})]})}},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 a(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 s(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return a(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([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([a(e.key),a(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 x=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,l=n.meta,c=n.mod,s=n.shift,f=n.ctrl,m=n.keys,p=e.key,x=e.code,h=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=a(x),j=p.toLowerCase();if(!t){if(!b===o&&"alt"!==j||!y===s&&"shift"!==j)return!1;if(c){if(!v&&!h)return!1}else if(!v===l&&"meta"!==j&&"os"!==j||!h===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)},h=(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,k=(0,i.useCallback)(n,null!=C?C:[]),w=(0,i.useRef)(k);C?w.current=k:w.current=n;var L=(!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),I=(0,i.useContext)(v).enabledScopes,E=(0,i.useContext)(h);return b(function(){if((null==L?void 0:L.enabled)!==!1&&(e=I,n=null==L?void 0:L.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==L?void 0:L.enableOnFormTags)||null!=L&&null!=L.ignoreEventWhen&&L.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!=L&&L.enableOnContentEditable)&&c(S,null==L?void 0:L.splitKey).forEach(function(t){var i,r,o,l,a,c,u,d=s(t,null==L?void 0:L.combinationKey);if(x(e,d,null==L?void 0:L.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,r=d,("function"==typeof(o=null==L?void 0:L.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),l=e,a=d,"function"==typeof(c=null==L?void 0:L.enabled)?!c(l,a):!0!==c&&void 0!==c){y(e);return}w.current(e,d),n||(g.current=!0)}})}},i=function(e){void 0!==e.key&&(f(a(e.code)),((null==L?void 0:L.keydown)===void 0&&(null==L?void 0:L.keyup)!==!0||null!=L&&L.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(a(e.code)),g.current=!1,null!=L&&L.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),E&&c(S,null==L?void 0:L.splitKey).forEach(function(e){return E.addHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),E&&c(S,null==L?void 0:L.splitKey).forEach(function(e){return E.removeHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))})}}},[S,L,I]),u}}},function(e){e.O(0,[789,958,80,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
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(12472)}])},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),a=t(2784),c=t(75289),s=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,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,d=e.type,f=e.form,m=e.isLoading,p=void 0!==m&&m,x=e.disabled,h=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!==x&&x||p,onClick:p?void 0:h,variant:S},C),{children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.$j,{size:b,color:u(S),"data-cy":s(C["data-cy"],"spinner")}),a&&t]}):(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsx)(a,{size:b,fill:g,"data-cy":s(C["data-cy"],"icon")}),t]})}))})},45466:function(e,n,t){"use strict";t.d(n,{c:function(){return j}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),c=t(75289),s=t(2784),u=t(36131),d=t(68780),f=t(88932),m=t(38876),p=t(81038),x=t(82770);function h(){return(h=(0,i.Z)(function(e){var n,t,i,r,o,a,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:var s;return l.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,s=n,r={id:(0,m.T3)(s),type:"SharedSlice",name:s,description:s,variations:[{id:v,name:(0,m.MP)(v),docURL:"...",version:"initial",description:(0,m.MP)(v),imageUrl:""},]},[4,p.j.slices.createSlice({libraryID:t,model:r})];case 1:if((o=l.sent().errors).length>0)throw o;return x.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),c="Internal Error: Slice not created",console.error(c,a),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v="default",y=t(90374),b=t(66443),g=t(70041),j=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,p=e.remoteSlices,v=(0,y.Z)().createSliceSuccess,j=(0,s.useState)(!1),S=j[0],C=j[1],k=(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,C(!0),[4,function(e){return h.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,x.y0)()];case 1:return v(n.sent().libraries),[4,f(e,t)];case 2:return n.sent(),[2]}})}),function(e){return o.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,a.jsx)(d.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:S,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,b.h)(e,m,p)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,a.jsxs)(c.xu,{children:[(0,a.jsx)(g.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,a.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,a.jsx)(u.ZP,{name:"from",options:m.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 a}});var i=t(62230),r=t(52322);t(2784);var o=t(63397),l=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,s=e.dataCy,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:a,as:l.II,autoComplete:"off"},u?{onChange:u}:null,s?{"data-cy":s}:null)),c?(0,r.jsx)(l.xv,{"data-cy":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return s}});var i=t(81541),r=t(75329),o=t(96009),l=t.n(o),a=t(74600),c=t.n(a);function s(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 a=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),s=t.map(function(e){return e.name});if((0,i.Z)(a).concat((0,i.Z)(s)).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,a=e.gridTemplateMinPx,c=e.gridGap,s=e.sx;return(0,r.jsx)(o.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===a?"320px":a,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},s),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(37149),a=t.n(l),c=t(25812),s=t(63397),u=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,l=e.isOpen,m=e.formId,p=e.validate,x=e.onSubmit,h=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,k=e.buttonLabel,w=void 0===k?"Save":k,L=e.dataCy,I=e.actionMessage;return a().setAppElement("#__next"),(0,o.jsx)(c.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=h?h:"900px"}},children:(0,o.jsx)(s.J9,{validateOnChange:!0,initialValues:v,validate:function(e){return p?p(e):void 0},onSubmit:function(e){x(e)},children:function(e){var l=e.isValid,a=e.isSubmitting,c=e.values,p=e.errors,x=e.touched,h=e.setFieldValue,v=e.setValues;return(0,o.jsx)(s.l0,(0,r.Z)((0,i.Z)({id:m},null!=L?{"data-cy":L}: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)(u.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)(u.X6,{sx:{fontSize:"20px"},children:y}),(0,o.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,o.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof I?I(e):I}),(0,o.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||C,children:"Cancel"}),(0,o.jsx)(d.z,{label:w,form:m,type:"submit",disabled:!l||a||C,isLoading:a||C,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:l,isSubmitting:a,values:c,errors:p,touched:x,setFieldValue:h,setValues:v})}))}))}})})}},12472:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return V}});var i=t(81541),r=t(52322),o=t(22715),l=t(2784),a=t(97729),c=t.n(a),s=t(65077),u=t(75289),d=t(56580),f=t(5632),m=t(88932),p=t(75329),x=t(94975),h=t(45466),v=t(59469),y=t(36887),b=t(82770),g=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,o=e.documentationComponent,l=e.videoPublicIdUrl;return(0,r.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},children:[(0,r.jsx)(u.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)(y.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){b.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,r.jsxs)(u.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)(u.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)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,r.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,r.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,r.jsx)(u.zx,{onClick:t,"data-cy":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:i}),(0,r.jsx)(u.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"})]})]})]})},j=t(84449),S=t(90374),C=t(68780),k=t(70041),w=t(77174),L=t(24340),I=t(75992),E=t(66443),N=function(e){var n=e.sliceName,t=e.sliceId,i=e.libName,o=(0,S.Z)(),l=o.renameSlice,a=o.closeModals,c=(0,d.v9)(function(e){return{isRenameSliceModalOpen:(0,w.gP)(e,L.q.RENAME_SLICE),localLibs:(0,I.Sd)(e),remoteLibs:(0,I.sT)(e)}}),s=c.isRenameSliceModalOpen,f=c.localLibs,m=c.remoteLibs,p=function(e){l(i,t,e.sliceName)};return(0,r.jsx)(C.Z,{dataCy:"rename-slice-modal",isOpen:s,widthInPx:"530px",formId:"rename-slice-modal-".concat(t),close:a,buttonLabel:"Rename",onSubmit:p,initialValues:{sliceName:n},content:{title:"Rename a slice"},validate:function(e){return(0,E.h)(e,f,m)},children:function(e){var n=e.touched,t=e.errors;return(0,r.jsx)(u.xu,{children:(0,r.jsx)(k.W,{name:"sliceName",label:"Slice Name","data-cy":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?t.sliceName:void 0,dataCy:"slice-name-input"})})}})},Z=t(25812),P=t(59326),R=t(54132),O=t(65186),_=t(56577),z=t(3098),F=t(32665),M=function(e){var n=e.sliceId,t=e.sliceName,i=e.libName,o=(0,d.v9)(function(e){return{isSliceModalOpen:(0,w.gP)(e,L.q.DELETE_SLICE),isDeletingSlice:(0,F.hg)(e,z.z.DELETE_SLICE)}}),l=o.isSliceModalOpen,a=o.isDeletingSlice,c=(0,S.Z)(),s=c.closeModals,f=c.deleteSlice,m=(0,P.B7)().theme;return(0,r.jsx)(Z.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:s,children:(0,r.jsx)(R.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)(u.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)(u.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(O.$vK,{size:20,color:null===(e=m.colors)||void 0===e?void 0:e.greyIcon}),(0,r.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,r.jsx)(u.x8,{type:"button",onClick:s})]})},Footer:function(){return(0,r.jsxs)(u.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)(_.z,{label:"Cancel",variant:"secondary",onClick:function(){return s()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,r.jsx)(_.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:function(){return f(n,t,i)}})]})},children:(0,r.jsxs)(u.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)(u.xv,{sx:{fontWeight:"bold"},children:[i,"/",t,"/"]})," ","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."]})})})},A=t(47731),T=t(65958),W=t(49451),D=t(13858),V=function(){var e,n,t,a,y,b,C=(0,f.useRouter)(),k=(0,S.Z)(),w=k.openRenameSliceModal,L=k.openDeleteSliceModal,E=(0,A.H)(),Z=E.modalPayload,P=E.onOpenModal,R=Z.sliceFilterFn,O=Z.defaultVariationSelector,_=(0,d.v9)(function(e){return{remoteSlices:(0,I.sT)(e),libraries:(0,I.Sd)(e)}}),z=_.remoteSlices,F=_.libraries,V=(0,l.useState)(!1),K=V[0],B=V[1],H=F.filter(function(e){return e.isLocal}),X=F.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),q=(F||[]).map(function(e){return e.components}).flat(),U=q.length,G=(0,l.useState)(),Y=G[0],$=G[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Slices - Slice Machine"})}),(0,r.jsxs)(x.LN,{children:[(0,r.jsxs)(x.wd,{children:[(0,r.jsx)(x.Cx,{folder:"Slices"}),(null==H?void 0:H.length)!==0&&0!==U?(0,r.jsx)(x.K2,{children:(0,r.jsx)(o.zx,{"data-testid":"create-slice","data-cy":"create-slice",onClick:function(){B(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,r.jsxs)(x.RN,{children:[(0,r.jsx)(s.xR,{sx:{display:"flex",flexDirection:"column"},children:X.length>0?(0,r.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===U?(0,r.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(g,{title:"What are Slices?",onCreateNew:function(){B(!0)},buttonText:"Create one",videoPublicIdUrl:p.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)(u.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"}),"."]})})}):X.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,r.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,r.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,r.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,r.jsx)(u.xv,{children:n})}),!t&&(0,r.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,r.jsx)(v.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return(0,r.jsx)(T.b,{action:{type:"menu",onRemove:function(){$(e),L()},onRename:function(){$(e),w()}},mode:"navigation",onUpdateScreenshot:function(){P({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==H?void 0:H.length)>0&&(0,r.jsx)(j.Z,{slices:R(q),defaultVariationSelector:O}),(null==H?void 0:H.length)>0&&K&&(0,r.jsx)(h.c,{localLibraries:H,remoteSlices:z,onSuccess:function(e,n){var t=e.variations[0].id,i=W.Y.getBuilderPagePathname({libraryName:n,sliceName:e.name,variationId:t});C.push(i),m.Am.success((0,D.kQ)({path:"".concat(n,"/").concat(e.name,"/model.json")}))},onClose:function(){B(!1)}}),(0,r.jsx)(N,{sliceId:null!==(e=null==Y?void 0:Y.model.id)&&void 0!==e?e:"",sliceName:null!==(n=null==Y?void 0:Y.model.name)&&void 0!==n?n:"",libName:null!==(t=null==Y?void 0:Y.from)&&void 0!==t?t:"","data-cy":"rename-slice-modal"}),(0,r.jsx)(M,{sliceId:null!==(a=null==Y?void 0:Y.model.id)&&void 0!==a?a:"",sliceName:null!==(y=null==Y?void 0:Y.model.name)&&void 0!==y?y:"",libName:null!==(b=null==Y?void 0:Y.from)&&void 0!==b?b:""})]})]})]})}},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 a(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 s(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return a(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([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([a(e.key),a(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 x=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,l=n.meta,c=n.mod,s=n.shift,f=n.ctrl,m=n.keys,p=e.key,x=e.code,h=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=a(x),j=p.toLowerCase();if(!t){if(!b===o&&"alt"!==j||!y===s&&"shift"!==j)return!1;if(c){if(!v&&!h)return!1}else if(!v===l&&"meta"!==j&&"os"!==j||!h===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)},h=(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,k=(0,i.useCallback)(n,null!=C?C:[]),w=(0,i.useRef)(k);C?w.current=k:w.current=n;var L=(!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),I=(0,i.useContext)(v).enabledScopes,E=(0,i.useContext)(h);return b(function(){if((null==L?void 0:L.enabled)!==!1&&(e=I,n=null==L?void 0:L.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==L?void 0:L.enableOnFormTags)||null!=L&&null!=L.ignoreEventWhen&&L.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!=L&&L.enableOnContentEditable)&&c(S,null==L?void 0:L.splitKey).forEach(function(t){var i,r,o,l,a,c,u,d=s(t,null==L?void 0:L.combinationKey);if(x(e,d,null==L?void 0:L.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,r=d,("function"==typeof(o=null==L?void 0:L.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),l=e,a=d,"function"==typeof(c=null==L?void 0:L.enabled)?!c(l,a):!0!==c&&void 0!==c){y(e);return}w.current(e,d),n||(g.current=!0)}})}},i=function(e){void 0!==e.key&&(f(a(e.code)),((null==L?void 0:L.keydown)===void 0&&(null==L?void 0:L.keyup)!==!0||null!=L&&L.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(a(e.code)),g.current=!1,null!=L&&L.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),E&&c(S,null==L?void 0:L.splitKey).forEach(function(e){return E.addHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),E&&c(S,null==L?void 0:L.splitKey).forEach(function(e){return E.removeHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))})}}},[S,L,I]),u}}},function(e){e.O(0,[789,958,80,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);