slice-machine-ui 2.7.2-beta.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/NHNPoIm5ZybAGepO-LVh5/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/{150-84da9b485587e8c4.js → 150-96a0c443c430ec4b.js} +1 -1
  4. package/out/_next/static/chunks/18539003-9b393c900c89e552.js +22 -0
  5. package/out/_next/static/chunks/372-cfee53700e416e09.js +1 -0
  6. package/out/_next/static/chunks/441-76bd8e7cf8cc22da.js +12 -0
  7. package/out/_next/static/chunks/588-d017e0fe2a651a87.js +1 -0
  8. package/out/_next/static/chunks/{918-38ab72e6ee071fec.js → 591-a272f15a4bf9830a.js} +2 -2
  9. package/out/_next/static/chunks/{479-6205c85aa978fc0b.js → 627-092c9e4c99442c08.js} +2 -2
  10. package/out/_next/static/chunks/750-aa35f21031ee1f96.js +1 -0
  11. package/out/_next/static/chunks/{772-58d0c8f8ae1c6791.js → 772-db5f72095641ec1d.js} +1 -1
  12. package/out/_next/static/chunks/{882-1ccb9dbd9bd4734b.js → 882-32959ffa63fa455c.js} +1 -1
  13. package/out/_next/static/chunks/pages/{_app-8405076cd58a41f0.js → _app-51bef5d3c62d085e.js} +156 -154
  14. package/out/_next/static/chunks/pages/{changelog-f9055af0d38a0c24.js → changelog-86f30b15d852e710.js} +1 -1
  15. package/out/_next/static/chunks/pages/changes-6c05ef623617785e.js +1 -0
  16. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-2eb64c9ea82fcd0a.js → [customTypeId]-fd2416081ef2ffca.js} +1 -1
  17. package/out/_next/static/chunks/pages/{custom-types-ddc20cfdd8049c04.js → custom-types-5de2dd7b9b93236e.js} +1 -1
  18. package/out/_next/static/chunks/pages/{index-17f953c11b46cb20.js → index-2d7f95201a656c12.js} +1 -1
  19. package/out/_next/static/chunks/pages/{labs-867606e5aff179cd.js → labs-81cf5c5f09fa0bda.js} +1 -1
  20. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-e5a5e6b345081e0a.js → [pageTypeId]-59e143620505f73f.js} +1 -1
  21. package/out/_next/static/chunks/pages/settings-80e0d6f1c79282d3.js +1 -0
  22. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-783b6577bd4e3728.js → simulator-908e779f6d24760d.js} +1 -1
  23. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-0b6162eb591ee324.js +1 -0
  24. package/out/_next/static/chunks/pages/{slices-0f6e50acfb5957ed.js → slices-317ec2bd3451566e.js} +1 -1
  25. package/out/_next/static/css/{22103e0fe77e9b53.css → 4e475d945cf8a890.css} +1 -1
  26. package/out/_next/static/css/850c81be38195a0f.css +1 -0
  27. package/out/_next/static/css/{00e9fba6d8022425.css → 9d17b7d9f44c5c5d.css} +1 -1
  28. package/out/_next/static/css/{cc20f7c46912c5dc.css → e5c7f63f02ff4d0f.css} +1 -1
  29. package/out/_next/static/css/{7f2ebc8f03a13272.css → e5f781f20e24a5ea.css} +1 -1
  30. package/out/changelog.html +1 -1
  31. package/out/changes.html +1 -1
  32. package/out/custom-types/[customTypeId].html +1 -1
  33. package/out/custom-types.html +1 -1
  34. package/out/index.html +1 -1
  35. package/out/labs.html +1 -1
  36. package/out/page-types/[pageTypeId].html +1 -1
  37. package/out/settings.html +1 -1
  38. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  39. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  40. package/out/slices.html +1 -1
  41. package/package.json +9 -10
  42. package/src/components/BlankSlate/BlankSlate.module.css +0 -10
  43. package/src/components/BlankSlate/BlankSlate.module.css.d.ts +0 -1
  44. package/src/components/BlankSlate/BlankSlate.tsx +2 -2
  45. package/src/components/Breadcrumb/Breadcrumb.module.css +0 -4
  46. package/src/components/Breadcrumb/Breadcrumb.module.css.d.ts +0 -1
  47. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -2
  48. package/src/components/ContentTabs/ContentTabs.tsx +2 -1
  49. package/src/components/FieldSet/FieldSet.module.css +0 -8
  50. package/src/components/FieldSet/FieldSet.module.css.d.ts +0 -2
  51. package/src/components/FieldSet/FieldSet.tsx +2 -7
  52. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +2 -1
  53. package/src/features/builder/AddFieldDropdown.tsx +1 -1
  54. package/src/features/documentation/MarkdownRenderer/index.tsx +4 -2
  55. package/src/features/onboarding/OnboardingProgressStepper.tsx +2 -1
  56. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +5 -1
  57. package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -0
  58. package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +3 -0
  59. package/src/legacy/lib/models/common/widgets/Group/ListItem/index.jsx +3 -0
  60. package/src/legacy/lib/models/common/widgets/Link/Form.jsx +43 -3
  61. package/src/legacy/lib/models/common/widgets/Link/components.tsx +56 -0
  62. package/src/legacy/lib/models/common/widgets/Link/index.ts +8 -3
  63. package/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx +14 -1
  64. package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +1 -0
  65. package/out/_next/static/E30Hv5Nt7vNi3zj5fcpLn/_buildManifest.js +0 -1
  66. package/out/_next/static/chunks/18539003-080f6b8eec027936.js +0 -22
  67. package/out/_next/static/chunks/372-a86e2c479a721702.js +0 -1
  68. package/out/_next/static/chunks/441-126d623f1b578785.js +0 -12
  69. package/out/_next/static/chunks/50-586dc7ab5e584e76.js +0 -1
  70. package/out/_next/static/chunks/764-e040bcebe6027fea.js +0 -1
  71. package/out/_next/static/chunks/pages/changes-72a49635f1ee5057.js +0 -1
  72. package/out/_next/static/chunks/pages/settings-0edb6f6c78439c20.js +0 -1
  73. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-68074c174d83cf1e.js +0 -1
  74. package/out/_next/static/css/34067e4b880866ca.css +0 -1
  75. /package/out/_next/static/{E30Hv5Nt7vNi3zj5fcpLn → NHNPoIm5ZybAGepO-LVh5}/_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(27132)}])},47760:function(e,n,r){"use strict";r.d(n,{Z:function(){return l}});var t=r(52322),i=r(61183);r(2784);var s=r(59326),o=r(75289);i.Z.registerLanguage("svelte",e=>({subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"}]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10}]}]}));let a=["javascript","bash","xml","html","json"];var l=e=>{var n;let{children:r,lang:l,sx:c,codeStyle:x,codeClass:d,Header:p}=e,{theme:g}=(0,s.B7)(),u=l?i.Z.highlight(r,{language:"vue"===l?"html":l}).value:i.Z.highlightAuto(r,a).value;return(0,t.jsxs)(o.kC,{as:"pre",sx:c,children:[p?(0,t.jsx)(p,{}):null,(0,t.jsx)("code",{className:"hljs".concat(d?" ".concat(d):""),style:{overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=g.colors)||void 0===n?void 0:n.textClear),...x},dangerouslySetInnerHTML:{__html:u}})]})}},27132:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return A}});var t,i,s=r(52322),o=r(97729),a=r.n(o),l=r(33760),c=r(2784),x=r(56580),d=r(65077),p=r(18566),g=r(70647);async function u(){return await g.j.versions.getAllStableSliceMachineVersionsWithKind()}function h(){return(0,p.QT)(u,[])}var v=r(28948),f=r(79546),j=r(75289);async function m(){return await g.j.versions.getLatestNonBreakingSliceMachineVersion()}var b=r(54991),k=r(85404),C=r(12170);let y=e=>{let{type:n,hasUpToDateVersions:r}=e;return(0,s.jsx)(j.xv,{sx:{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})},S=e=>{let{isSelected:n,onClick:r,versionNumber:t,tags:i,hasUpToDateVersions:o}=e;return(0,s.jsxs)(j.kC,{sx:{p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center",...n?{color:"purple",bg:(0,C.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}},onClick:r,children:[(0,s.jsx)(j.xv,{children:t}),(0,s.jsx)(j.kC,{sx:{gap:"8px"},children:i.map(e=>(0,s.jsx)(y,{type:e,hasUpToDateVersions:o},e))})]})};(t=i||(i={})).Latest="LATEST",t.LatestNonBreaking="LATEST-NON-BREAKING",t.Current="CURRENT";let T=e=>{var n;let{selectedVersion:r,selectVersion:t}=e,i=h(),{sliceMachineUpdateAvailable:o,adapterUpdateAvailable:a}=(0,k.P)(),c=(0,p.QT)(m,[]),x=(0,b.d)(),d=null===(n=i[0])||void 0===n?void 0:n.version;return(0,s.jsxs)(j.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:l.rS.color.grey6,flexDirection:"column",paddingRight:"48px"},children:[(0,s.jsxs)(j.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:l.rS.color.grey6,paddingBottom:"28px"},children:[(0,s.jsx)(j.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,s.jsx)(j.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,s.jsx)(j.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:i.map((e,n)=>(0,s.jsx)(S,{isSelected:(null==r?void 0:r.version)===e.version,onClick:()=>t(e),versionNumber:e.version,tags:function(e){let n=[];return e===d?n.push("LATEST"):e===c&&n.push("LATEST-NON-BREAKING"),e===x&&n.push("CURRENT"),n}(e.version),hasUpToDateVersions:!o&&!a},"versionBadge-".concat(e.version,"-").concat(n)))})]})};var N=r(951);async function w(e){return await g.j.versions.getSliceMachineReleaseNotesForVersion({version:e})}var E=r(19870);let L=e=>{let{releaseNotes:n}=e;return(0,s.jsx)(j.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:E.TU.parse(n)}})};var R=r(58133),_=r(47760);let z=e=>{let{selectedVersion:n,packageManager:r}=e,t=h(),i=(0,R.p)(),{sliceMachineUpdateAvailable:o,adapterUpdateAvailable:a}=(0,k.P)(),l=n.version===t[0].version,c=function(e,n){let 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)}}(r,function(e){let{sliceMachineVersionToInstall:n,isLatestSliceMachineVersion:r,adapterName:t}=e,i=["slice-machine-ui@".concat(n)];return r&&i.push("".concat(t,"@latest")),i}({sliceMachineVersionToInstall:l?"latest":n.version,isLatestSliceMachineVersion:l,adapterName:i}));return(0,s.jsxs)(s.Fragment,{children:[a&&!o&&l&&(0,s.jsxs)(j.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)(j.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,s.jsx)(j.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,s.jsxs)(j.kC,{sx:{gap:"8px"},children:[(0,s.jsx)(_.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:c}),(0,s.jsx)(j.zx,{variant:"secondary",onClick:()=>void navigator.clipboard.writeText(c),children:"Copy"})]})]})]})},H=e=>{let{versionKind:n}=e,r={fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase",..."MAJOR"===n?{color:"purple",bg:(0,C.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"}};return(0,s.jsx)(j.xv,{sx:r,children:n})},B=()=>(0,s.jsxs)(j.kC,{sx:{paddingLeft:"32px"},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=e=>{var n;let{selectedVersion:r,packageManager:t}=e,i=(n=r.version,(0,p.QT)(w,[n]));return(0,s.jsxs)(j.kC,{sx:{flexDirection:"column"},children:[(0,s.jsxs)(j.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:l.rS.color.grey6,justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(j.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(r.version)}),!!r.kind&&(0,s.jsx)(H,{versionKind:r.kind})]}),(0,s.jsxs)(j.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null==i?void 0:i.includes("# Breaking Change"))&&(0,s.jsxs)(j.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)(z,{selectedVersion:r,packageManager:t}),void 0!==i?(0,s.jsx)(L,{releaseNotes:i}):(0,s.jsx)(B,{})]})]})};function V(){let{packageManager:e}=(0,x.v9)(e=>({packageManager:(0,f.Ak)(e)})),n=h(),r=n[0],[t,i]=(0,c.useState)(null!=r?r:void 0);(0,c.useEffect)(()=>{i(r)},[r]);let o=0===n.length||!t;return(0,s.jsx)(v.LN,{children:(0,s.jsx)(v.RN,{children:(0,s.jsxs)(d.xR,{sx:{display:"flex",minWidth:0},children:[(0,s.jsx)(T,{selectedVersion:t,selectVersion:e=>i(e)}),o?(0,s.jsx)(B,{}):(0,s.jsx)(l.SV,{renderError:()=>(0,s.jsx)(B,{}),children:(0,s.jsx)(c.Suspense,{fallback:(0,s.jsx)(l._3,{}),children:(0,s.jsx)(M,{selectedVersion:t,packageManager:e})})})]})})})}function A(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,s.jsx)(V,{})]})}}},function(e){e.O(0,[898,183,870,888,774,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(27132)}])},47760:function(e,n,r){"use strict";r.d(n,{Z:function(){return l}});var t=r(52322),i=r(61183);r(2784);var s=r(59326),o=r(75289);i.Z.registerLanguage("svelte",e=>({subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"}]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10}]}]}));let a=["javascript","bash","xml","html","json"];var l=e=>{var n;let{children:r,lang:l,sx:c,codeStyle:x,codeClass:d,Header:p}=e,{theme:g}=(0,s.B7)(),u=l?i.Z.highlight(r,{language:"vue"===l?"html":l}).value:i.Z.highlightAuto(r,a).value;return(0,t.jsxs)(o.kC,{as:"pre",sx:c,children:[p?(0,t.jsx)(p,{}):null,(0,t.jsx)("code",{className:"hljs".concat(d?" ".concat(d):""),style:{overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=g.colors)||void 0===n?void 0:n.textClear),...x},dangerouslySetInnerHTML:{__html:u}})]})}},27132:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return A}});var t,i,s=r(52322),o=r(97729),a=r.n(o),l=r(38392),c=r(2784),x=r(56580),d=r(65077),p=r(18566),g=r(70647);async function u(){return await g.j.versions.getAllStableSliceMachineVersionsWithKind()}function h(){return(0,p.QT)(u,[])}var v=r(28948),f=r(79546),j=r(75289);async function m(){return await g.j.versions.getLatestNonBreakingSliceMachineVersion()}var b=r(54991),k=r(85404),C=r(12170);let y=e=>{let{type:n,hasUpToDateVersions:r}=e;return(0,s.jsx)(j.xv,{sx:{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})},S=e=>{let{isSelected:n,onClick:r,versionNumber:t,tags:i,hasUpToDateVersions:o}=e;return(0,s.jsxs)(j.kC,{sx:{p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center",...n?{color:"purple",bg:(0,C.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}},onClick:r,children:[(0,s.jsx)(j.xv,{children:t}),(0,s.jsx)(j.kC,{sx:{gap:"8px"},children:i.map(e=>(0,s.jsx)(y,{type:e,hasUpToDateVersions:o},e))})]})};(t=i||(i={})).Latest="LATEST",t.LatestNonBreaking="LATEST-NON-BREAKING",t.Current="CURRENT";let T=e=>{var n;let{selectedVersion:r,selectVersion:t}=e,i=h(),{sliceMachineUpdateAvailable:o,adapterUpdateAvailable:a}=(0,k.P)(),c=(0,p.QT)(m,[]),x=(0,b.d)(),d=null===(n=i[0])||void 0===n?void 0:n.version;return(0,s.jsxs)(j.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:l.rS.color.grey6,flexDirection:"column",paddingRight:"48px"},children:[(0,s.jsxs)(j.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:l.rS.color.grey6,paddingBottom:"28px"},children:[(0,s.jsx)(j.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,s.jsx)(j.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,s.jsx)(j.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:i.map((e,n)=>(0,s.jsx)(S,{isSelected:(null==r?void 0:r.version)===e.version,onClick:()=>t(e),versionNumber:e.version,tags:function(e){let n=[];return e===d?n.push("LATEST"):e===c&&n.push("LATEST-NON-BREAKING"),e===x&&n.push("CURRENT"),n}(e.version),hasUpToDateVersions:!o&&!a},"versionBadge-".concat(e.version,"-").concat(n)))})]})};var N=r(951);async function w(e){return await g.j.versions.getSliceMachineReleaseNotesForVersion({version:e})}var E=r(19870);let L=e=>{let{releaseNotes:n}=e;return(0,s.jsx)(j.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:E.TU.parse(n)}})};var R=r(58133),_=r(47760);let z=e=>{let{selectedVersion:n,packageManager:r}=e,t=h(),i=(0,R.p)(),{sliceMachineUpdateAvailable:o,adapterUpdateAvailable:a}=(0,k.P)(),l=n.version===t[0].version,c=function(e,n){let 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)}}(r,function(e){let{sliceMachineVersionToInstall:n,isLatestSliceMachineVersion:r,adapterName:t}=e,i=["slice-machine-ui@".concat(n)];return r&&i.push("".concat(t,"@latest")),i}({sliceMachineVersionToInstall:l?"latest":n.version,isLatestSliceMachineVersion:l,adapterName:i}));return(0,s.jsxs)(s.Fragment,{children:[a&&!o&&l&&(0,s.jsxs)(j.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)(j.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,s.jsx)(j.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,s.jsxs)(j.kC,{sx:{gap:"8px"},children:[(0,s.jsx)(_.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:c}),(0,s.jsx)(j.zx,{variant:"secondary",onClick:()=>void navigator.clipboard.writeText(c),children:"Copy"})]})]})]})},H=e=>{let{versionKind:n}=e,r={fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase",..."MAJOR"===n?{color:"purple",bg:(0,C.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"}};return(0,s.jsx)(j.xv,{sx:r,children:n})},B=()=>(0,s.jsxs)(j.kC,{sx:{paddingLeft:"32px"},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=e=>{var n;let{selectedVersion:r,packageManager:t}=e,i=(n=r.version,(0,p.QT)(w,[n]));return(0,s.jsxs)(j.kC,{sx:{flexDirection:"column"},children:[(0,s.jsxs)(j.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:l.rS.color.grey6,justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(j.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(r.version)}),!!r.kind&&(0,s.jsx)(H,{versionKind:r.kind})]}),(0,s.jsxs)(j.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null==i?void 0:i.includes("# Breaking Change"))&&(0,s.jsxs)(j.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)(z,{selectedVersion:r,packageManager:t}),void 0!==i?(0,s.jsx)(L,{releaseNotes:i}):(0,s.jsx)(B,{})]})]})};function V(){let{packageManager:e}=(0,x.v9)(e=>({packageManager:(0,f.Ak)(e)})),n=h(),r=n[0],[t,i]=(0,c.useState)(null!=r?r:void 0);(0,c.useEffect)(()=>{i(r)},[r]);let o=0===n.length||!t;return(0,s.jsx)(v.LN,{children:(0,s.jsx)(v.RN,{children:(0,s.jsxs)(d.xR,{sx:{display:"flex",minWidth:0},children:[(0,s.jsx)(T,{selectedVersion:t,selectVersion:e=>i(e)}),o?(0,s.jsx)(B,{}):(0,s.jsx)(l.SV,{renderError:()=>(0,s.jsx)(B,{}),children:(0,s.jsx)(c.Suspense,{fallback:(0,s.jsx)(l._3,{}),children:(0,s.jsx)(M,{selectedVersion:t,packageManager:e})})})]})})})}function A(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,s.jsx)(V,{})]})}}},function(e){e.O(0,[898,183,870,888,774,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return n(79566)}])},28574:function(e,t,n){"use strict";n.d(t,{R$:function(){return a},Qj:function(){return h},T9:function(){return d},nf:function(){return x},u2:function(){return c},_T:function(){return u}});var i=n(52322),s=n(38392),r=n(6277),l=n(43217),o=n.n(l);let a=e=>{let{backgroundImage:t,style:n,...s}=e,l=void 0!==t;return(0,i.jsx)("article",{...s,className:(0,r.W)(o().root,{[o().withBackground]:l}),style:{backgroundImage:l?"url(".concat(t,")"):void 0,...n}})},c=e=>(0,i.jsx)("div",{...e,className:o().image}),d=e=>(0,i.jsx)("div",{...e,className:o().content}),u=e=>(0,i.jsx)(s.xv,{...e,variant:"h3"}),x=e=>(0,i.jsx)(s.xv,{...e,color:"grey11"}),h=e=>(0,i.jsx)("div",{...e,className:o().actions,color:"grey"})},68587:function(e,t,n){"use strict";n.d(t,{Q:function(){return l}});let i={GitHub:"gitHub"};var s=n(52322),r=n(70647);let l={gitHub:{connect:async()=>await o("gitHub"),Icon:e=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}),name:"GitHub",supported:a("gitHub")},bitbucket:{connect:async()=>await o("bitbucket"),Icon:e=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}),name:"Bitbucket",supported:a("bitbucket")},gitLab:{connect:async()=>await o("gitLab"),Icon:e=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}),name:"GitLab",supported:a("gitLab")}};async function o(e){if(!a(e))throw Error("Not implemented.");let t=await r.j.git.getProviderAppInstallURL({provider:e});window.open(t,"git-provider-app-installation")}function a(e){return!!Object.values(i).includes(e)}},6407:function(e,t,n){"use strict";n.d(t,{G:function(){return l}});var i=n(18566),s=n(29806),r=n(70647);function l(){let[e]=(0,s.f)();return{linkedGitRepos:(0,i.QT)(o,[e.repositoryName]),linkRepo:async t=>{await r.j.git.linkRepo({prismic:{domain:e.repositoryName},git:t}),await (0,i.gw)(o,[e.repositoryName])},unlinkRepo:async t=>{await r.j.git.unlinkRepo({prismic:{domain:e.repositoryName},git:t}),await (0,i.gw)(o,[e.repositoryName])}}}async function o(e){return await r.j.git.fetchLinkedRepos({prismic:{domain:e}})}},29806:function(e,t,n){"use strict";n.d(t,{f:function(){return r}});var i=n(18566),s=n(70647);function r(){return[(0,i.QT)(l,[]),async e=>{await s.j.project.writeSliceMachineConfig({config:e}),(0,i.VA)(l,[],e)}]}async function l(){return s.j.project.getSliceMachineConfig()}},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var i=n(52322),s=n(2784),r=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",o=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,s.forwardRef)((e,t)=>{let{label:n,Icon:s,type:a,form:c,isLoading:d=!1,disabled:u=!1,onClick:x,sx:h={},iconSize:p=16,iconFill:m,variant:g="primary",...j}=e;return(0,i.jsx)(r.zx,{ref:t,sx:{...h,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:a,form:c,disabled:u||d,onClick:d?void 0:x,variant:g,...j,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$j,{size:p,color:o(g),"data-testid":l(j["data-testid"],"spinner")}),s&&n]}):(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(s,{size:p,fill:m,"data-testid":l(j["data-testid"],"icon")}),n]})})})},42849:function(e,t,n){"use strict";var i=n(52322),s=n(75289);t.Z=function(e){let{elems:t,renderElem:n,defineElementKey:r,gridTemplateMinPx:l="320px",gridGap:o="16px",sx:a}=e;return(0,i.jsx)(s.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(l,", 1fr))"),gridGap:o,pt:2,...a},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:n(e,t)},"".concat(r(e),"-").concat(t+1)):null)})}},79566:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return em}});var i=n(52322),s=n(38392),r=n(97729),l=n.n(r),o=n(5632),a=n(2784),c=n(88932),d=n(65077),u=n(93188),x=n(23335),h=n(28574);function p(e){let{isPostPush:t,documentsListEndpoint:n}=e,r=t?g:m;return(0,i.jsxs)(h.R$,{style:{alignSelf:"center",marginTop:s.rS.space[72]},children:[(0,i.jsx)(h.u2,{children:(0,i.jsx)(s.Ee,{src:r.img,sizing:"cover"})}),(0,i.jsxs)(h.T9,{children:[(0,i.jsx)(h._T,{children:r.title}),(0,i.jsx)(h.nf,{children:r.description}),t&&(0,i.jsx)(h.Qj,{children:(0,i.jsx)(s.zx,{onClick:()=>{u.Xe.track({event:"post-push:empty-state-cta-clicked"}),window.open(n,"_blank")},size:"large",children:"Create content in the Page Builder"})})]})]})}let m={img:"/blank-slate-changes-uptodate.png",title:"Everything is up-to-date",description:"No changes are staged. Saved updates will appear here, ready to be pushed to the Page Builder."},g={img:"/blank-slate-push-success.png",title:"Success! Your changes have been pushed to the Page Builder.",description:"Add content to your website to bring it to life!"};var j=n(30988),f=n(68587),v=n(52677),y=n(6407);let b=e=>(0,i.jsx)(j.S,{renderError:S,children:(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)(_,{}),children:(0,i.jsx)(C,{...e})})}),C=e=>(0,v.M)().eligible?(0,i.jsx)(w,{...e}):(0,i.jsx)(k,{...e}),w=e=>{let{linkedGitRepos:t}=(0,y.G)();if(!(t.length>0))return(0,i.jsx)(k,{...e});{let e=f.Q[t[0].provider];return(0,i.jsx)(s.u,{content:"This project uses the Git workflow. Update Prismic by pushing your changes to ".concat(e.name,"."),side:"bottom",children:(0,i.jsx)(k,{disabled:!0})})}},k=(0,a.forwardRef)((e,t)=>(0,i.jsx)(s.zx,{...e,ref:t,startIcon:"upload",children:"Push"}));function S(){return(0,i.jsx)(s.u,{content:"An error occurred while fetching the list of connected Git repositories.",side:"bottom",children:(0,i.jsx)(k,{disabled:!0})})}let _=()=>(0,i.jsx)(s.Od,{height:32,width:71.32});var D=n(6529),T=n(80546),L=n(65821),R=n(52762),B=n(85647),O=n(99579),I=n(28948),N=n(58161),F=n(41067);let H=e=>{let{authStatus:t}=e,{openLoginModal:n}=(0,F.Z)();return(0,i.jsxs)(s.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[t===N.t.FORBIDDEN?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xv,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,i.jsx)(s.xv,{align:"center",children:"Log in to connect to your repository."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xv,{variant:"h3",align:"center",children:"It seems like you don't have access to this repository"}),(0,i.jsx)(s.xv,{align:"center",children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,i.jsxs)(s.xv,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,i.jsx)(s.xv,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),t===N.t.FORBIDDEN&&(0,i.jsx)(s.zx,{onClick:()=>n(),children:"Log in to Prismic"})]})};var E=n(91914),z=n(75289);let P=()=>(0,i.jsx)(z.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,i.jsxs)(z.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,i.jsx)(E.wQ1,{size:48}),(0,i.jsx)(z.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,i.jsx)(z.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"Connect to the internet to sync your changes."})]})});var A=n(951),Z=n(3181),G=n(53850),M=n(76787);let W=e=>{let{children:t}=e;return(0,i.jsx)(z.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px",width:"100%"},children:t})};var X=n(39097),U=n.n(X),Q=n(51159),Y=n(63447),V=n(1744);let J=e=>{let{ct:t,status:n,authStatus:s,isOnline:r}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(z.xu,{as:"td",style:{width:"40%"},children:(0,i.jsx)(z.xv,{sx:{fontWeight:500},children:t.label})}),(0,i.jsx)(z.xu,{as:"td",style:{width:"40%"},children:t.id}),(0,i.jsx)(z.xu,{as:"td",style:{width:"20%"},children:(0,i.jsx)(Q.O,{authStatus:s,isOnline:r,modelStatus:n,modelType:"CustomType"})})]})},q=e=>{let{customTypes:t,modelsStatuses:n,authStatus:s,isOnline:r}=e;return(0,i.jsxs)(z.xu,{as:"table","data-legacy-component":!0,children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:"transparent small",children:[(0,i.jsx)(z.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,i.jsx)(z.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,i.jsx)(z.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,i.jsx)("tbody",{children:t.map(e=>(0,V.TG)(e)?(0,i.jsx)(U(),{passHref:!0,href:Y.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,i.jsx)("tr",{tabIndex:0,"data-testid":"custom-type-".concat(e.local.id),children:(0,i.jsx)(J,{ct:e.local,status:n.customTypes[e.local.id],authStatus:s,isOnline:r},e.local.id)})},e.local.id):(0,i.jsx)("tr",{tabIndex:0,className:"disabled","data-testid":"custom-type-".concat(e.remote.id),children:(0,i.jsx)(J,{ct:e.remote,status:n.customTypes[e.remote.id],authStatus:s,isOnline:r},e.remote.id)},e.remote.id))})]})};var K=n(42849),$=n(39283),ee=n(5274),et=n(53085);function en(){let e=(0,et.L)("slicemachine-dev-collaboration"),[t,n]=(0,a.useState)(!1),r=null==e?void 0:e.payload;return((0,a.useEffect)(()=>{(null==e?void 0:e.value)==="on"&&void 0!==r&&u.Xe.track({event:"dev-collab:workflow-stub-displayed"})},[e,r]),(null==e?void 0:e.value)!=="on"||void 0===r)?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.xu,{alignItems:"flex-start",border:{bottom:!0,left:!0,right:!0,top:!0},borderRadius:6,borderStyle:"dashed",flexDirection:"column",flexShrink:0,gap:8,padding:16,width:320,children:[(0,i.jsxs)(s.xu,{flexDirection:"column",gap:2,children:[(0,i.jsx)(s.xv,{variant:"smallBold",children:r.cardTitle}),(0,i.jsx)(s.xv,{color:"grey11",variant:"small",children:r.cardDescription})]}),(0,i.jsx)(s.zx,{color:"grey",onClick:()=>{u.Xe.track({event:"dev-collab:set-up-workflow-opened"}),n(!0)},children:r.cardButtonLabel})]}),(0,i.jsxs)(s.Vq,{onOpenChange:e=>{e||n(!1)},open:t,size:{height:"auto",width:448},children:[(0,i.jsx)(s.fK,{title:r.dialogTitle}),(0,i.jsx)(s.cZ,{children:(0,i.jsxs)(s.xu,{flexDirection:"column",children:[(0,i.jsx)(s.xu,{flexDirection:"column",padding:16,children:(0,i.jsx)(s.xv,{children:r.dialogDescription})}),(0,i.jsxs)(s.kX,{children:[(0,i.jsx)(s.PO,{size:"medium"}),(0,i.jsx)(s._d,{size:"medium",onClick:()=>{u.Xe.track({event:"dev-collab:join-beta-clicked"}),window.open(r.dialogButtonLink,"_blank"),n(!1)},children:r.dialogButtonLabel})]})]})})]})]})}let ei=e=>{let{unSyncedCustomTypes:t,unSyncedSlices:n,modelsStatuses:r,authStatus:l,isOnline:o}=e,{modalPayload:c,onOpenModal:d}=(0,M.H)(),{sliceFilterFn:u,defaultVariationSelector:x}=c,h=n.filter(e=>r.slices[e.model.id]!==ee.GJ.Deleted);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(s.xu,{gap:16,alignItems:"flex-start",children:[(0,i.jsxs)(s.xu,{flexDirection:"column",flexGrow:1,children:[t.length>0&&(0,i.jsxs)(s.xu,{flexDirection:"column",children:[(0,i.jsx)(W,{children:(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(s.xv,{variant:"h5",children:"Types"}),(0,i.jsx)(s.xv,{variant:"h5",sx:{marginLeft:8},children:t.length})]})}),(0,i.jsx)(q,{customTypes:t,modelsStatuses:r,authStatus:l,isOnline:o})]}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xu,{padding:{bottom:8},children:(0,i.jsxs)(W,{children:[(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(s.xv,{variant:"h5",children:"Slices"}),(0,i.jsx)(s.xv,{variant:"h5",sx:{marginLeft:8},children:n.length})]}),(0,i.jsxs)(s.xu,{children:[n.some(e=>(0,Z.cx)(e)>0&&r.slices[e.model.id]!==ee.GJ.Deleted)&&(0,i.jsxs)(s.xv,{color:"amber11",sx:{marginRight:8,alignSelf:"center"},children:[(0,i.jsx)(A.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,i.jsxs)(s.zx,{color:"dark",onClick:()=>d({sliceFilterFn:e=>e}),children:[(0,i.jsx)(A.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,i.jsx)(K.Z,{gridGap:"32px 16px",elems:n,gridTemplateMinPx:"305px",defineElementKey:e=>e.model.name,renderElem:e=>{let t=r.slices[e.model.id];return(0,i.jsx)(G.b,{action:{type:"status",authStatus:l,isOnline:o,modelStatus:t},isDeleted:t===ee.GJ.Deleted,mode:"navigation",onUpdateScreenshot:()=>{d({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"})}}),(0,i.jsx)($.Z,{slices:u(h),defaultVariationSelector:x})]})]}),(0,i.jsx)(j.S,{children:(0,i.jsx)(a.Suspense,{children:(0,i.jsx)(en,{})})})]})})};var es=n(56580),er=n(47861),el=n(79797),eo=n(76805);let ea=e=>{let{isOpen:t,title:n,footer:s,explanations:r,onClose:l}=e;return(0,i.jsx)(el.Z,{placement:"right",open:t,level:null,onClose:l,width:496,children:(0,i.jsx)(eo.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:()=>(0,i.jsxs)(z.kC,{sx:{p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsx)(z.kC,{sx:{alignItems:"center"},children:(0,i.jsx)(z.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:n})}),(0,i.jsx)(z.x8,{type:"button",onClick:()=>l()})]}),Footer:()=>(0,i.jsx)(z.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"white",padding:20},children:s}),children:r})})};var ec=n(40572);n(77507);let ed=e=>{let{ctName:t,numberOfDocuments:n,link:s,isOverLimit:r=!1}=e;return(0,i.jsxs)(z.Zb,{sx:{mb:12},variant:"drawerCard","data-testid":"AssociatedDocumentsCard-".concat(t),children:[(0,i.jsxs)(z.kC,{sx:{flexDirection:"column"},children:[(0,i.jsx)(z.xv,{children:t}),(0,i.jsxs)(z.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[n," documents"]})]}),(0,i.jsx)(z.rU,{href:s,target:"_blank",variant:"cardSmall",sx:{color:r?"danger":"purple08"},children:"View documents"})]})},eu=e=>{let{pushChanges:t,modalData:n,onClose:s}=e,{remoteOnlyCustomTypes:r}=(0,es.v9)(e=>({remoteOnlyCustomTypes:(0,ec.Ch)(e).filter(V.yp)}));if((null==n?void 0:n.type)!=="HARD")return null;let l=n.details.customTypes.map(e=>{var t;let n=r.find(t=>(0,V.n5)(t)===e.id);return void 0===n?null:(0,i.jsx)(ed,{isOverLimit:!0,ctName:null!==(t=n.remote.label)&&void 0!==t?t:n.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,i.jsx)(ea,{isOpen:"HARD"===n.type,title:"Manual action required",onClose:s,footer:(0,i.jsx)(er.z,{label:"Try again",variant:"primary",onClick:()=>{t(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(z.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",n.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,i.jsxs)(z.xv,{sx:{mb:24},children:[n.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."]}),l]})})},ex=e=>{let{onToggle:t,isConfirmed:n,sx:s}=e;return(0,i.jsxs)(z.kC,{sx:{borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%",...s},children:[(0,i.jsx)(z.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,i.jsxs)(z.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,i.jsx)(z.XZ,{defaultChecked:n,onChange:t,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eh=e=>{let{pushChanges:t,modalData:n,onClose:s}=e,[r,l]=(0,a.useState)(!1),{remoteOnlyCustomTypes:o}=(0,es.v9)(e=>({remoteOnlyCustomTypes:(0,ec.Ch)(e).filter(V.yp)}));if((null==n?void 0:n.type)!=="SOFT")return null;let c=n.details.customTypes.map(e=>{var t;let n=o.find(t=>(0,V.n5)(t)===e.id);return void 0===n?null:(0,i.jsx)(ed,{isOverLimit:!0,ctName:null!==(t=n.remote.label)&&void 0!==t?t:n.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,i.jsx)(ea,{isOpen:"SOFT"===n.type,title:"Confirm deletion",onClose:s,footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ex,{onToggle:()=>{l(!r)},isConfirmed:r,sx:{mb:10}}),(0,i.jsx)(er.z,{label:"Push changes",variant:"primary",onClick:()=>{t(r)},disabled:!r,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(z.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,i.jsxs)(z.xv,{sx:{mb:24},children:[n.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."]}),c]})})},ep=e=>"https://".concat(e,".prismic.io/documents/working");var em=()=>{let{unSyncedSlices:e,unSyncedCustomTypes:t,changedCustomTypes:n,changedSlices:r,modelsStatuses:h}=(0,L.X)(),m=(0,B.L)(),g=(0,R.n)(),{pushChangesSuccess:j,refreshState:f}=(0,F.Z)(),[v,y]=(0,a.useState)(!1),[C,w]=(0,a.useState)(void 0),{autoSyncStatus:k}=(0,T.g)(),S=(0,o.useRouter)(),[_,E]=(0,a.useState)(!1),[z,A]=(0,a.useState)(!1),{repositoryName:Z}=(0,O.U)(),G=ep(Z),M=e.length+t.length;(0,a.useEffect)(()=>{("synced"===k||"failed"===k||"syncing"===k)&&S.push("/")},[k,S]);let W=async e=>{try{y(!0),w(void 0);let t=await (0,D.t)({confirmDeleteDocuments:e,changedCustomTypes:n,changedSlices:r});if(void 0!==t)w(t);else{let e=await (0,u.y0)();f(e),j(),E(!0),A(!0)}}catch(e){console.error("Something went wrong when manually pushing your changes",e),c.Am.error("Something went wrong when pushing your changes. Check your terminal logs.")}y(!1)},X=(0,a.useMemo)(()=>m?g===N.t.UNAUTHORIZED||g===N.t.FORBIDDEN?(0,i.jsx)(H,{authStatus:g}):0===M?(0,i.jsx)(p,{isPostPush:_,documentsListEndpoint:G}):(0,i.jsx)(ei,{unSyncedSlices:e,unSyncedCustomTypes:t,modelsStatuses:h,authStatus:g,isOnline:m}):(0,i.jsx)(P,{}),[m,g,M,e,t,h,_,G]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Changes - Slice Machine"})}),(0,i.jsxs)(I.LN,{children:[(0,i.jsxs)(I.wd,{children:[(0,i.jsx)(I.Cx,{children:(0,i.jsx)(x.g,{children:"Changes"})}),(0,i.jsxs)(I.K2,{children:[(0,i.jsx)(b,{disabled:0===M||!m||g===N.t.UNAUTHORIZED||g===N.t.FORBIDDEN||v,loading:v,onClick:()=>{W(!1)}}),(0,i.jsx)(s.FN,{anchor:(0,i.jsx)(s.xu,{position:"fixed",top:32,right:32,width:322}),open:z,variant:"card",seconds:20,title:"Success! \uD83C\uDF89",subtitle:"Your changes have been pushed.",action:{title:"Create content in the Page Builder",onClick:()=>{u.Xe.track({event:"post-push:toast-cta-clicked"}),window.open(G,"_blank")}},cancel:{onClick:()=>A(!1)},onOpenChange:A})]})]}),(0,i.jsx)(I.RN,{children:(0,i.jsxs)(d.xR,{sx:{display:"flex",flexDirection:"column"},children:[X,(0,i.jsx)(eh,{pushChanges:e=>void W(e),modalData:C,onClose:()=>w(void 0)}),(0,i.jsx)(eu,{pushChanges:e=>void W(e),modalData:C,onClose:()=>w(void 0)})]})})]})]})}},43217:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}},function(e){e.O(0,[898,789,123,591,772,639,888,774,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{95759:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types/[customTypeId]",function(){return t(12375)}])},12375:function(n,u,t){"use strict";t.r(u),t.d(u,{default:function(){return _.H}});var _=t(9150)}},function(n){n.O(0,[898,917,525,461,139,183,50,349,479,772,372,882,150,888,774,179],function(){return n(n.s=95759)}),_N_E=n.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{95759:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types/[customTypeId]",function(){return t(12375)}])},12375:function(n,u,t){"use strict";t.r(u),t.d(u,{default:function(){return _.H}});var _=t(9150)}},function(n){n.O(0,[898,917,525,461,139,183,588,349,627,772,372,882,150,888,774,179],function(){return n(n.s=95759)}),_N_E=n.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[379],{70320:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types",function(){return t(43737)}])},43737:function(n,u,t){"use strict";t.r(u);var _=t(52322),s=t(5726);u.default=()=>(0,_.jsx)(s.F,{format:"custom"})}},function(n){n.O(0,[372,764,888,774,179],function(){return n(n.s=70320)}),_N_E=n.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[379],{70320:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types",function(){return t(43737)}])},43737:function(n,u,t){"use strict";t.r(u);var _=t(52322),s=t(5726);u.default=()=>(0,_.jsx)(s.F,{format:"custom"})}},function(n){n.O(0,[372,750,888,774,179],function(){return n(n.s=70320)}),_N_E=n.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(n,u,_){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return _(62564)}])},62564:function(n,u,_){"use strict";_.r(u);var t=_(52322),e=_(5726);u.default=()=>(0,t.jsx)(e.F,{format:"page"})}},function(n){n.O(0,[372,764,888,774,179],function(){return n(n.s=87314)}),_N_E=n.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(n,u,_){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return _(62564)}])},62564:function(n,u,_){"use strict";_.r(u);var t=_(52322),e=_(5726);u.default=()=>(0,t.jsx)(e.F,{format:"page"})}},function(n){n.O(0,[372,750,888,774,179],function(){return n(n.s=87314)}),_N_E=n.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[274],{41535:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs",function(){return i(84468)}])},61502:function(e,n,i){"use strict";i.d(n,{E:function(){return s}});var r=i(29806);function s(e){var n,i;let[s,t]=(0,r.f)(),a=async n=>{let i={...s,labs:{...s.labs}};n?i.labs[e]=n:e in i.labs&&delete i.labs[e],0===Object.keys(i.labs).length&&delete i.labs,await t(i)};return[{enabled:null!==(i=null==s?void 0:null===(n=s.labs)||void 0===n?void 0:n[e])&&void 0!==i&&i},a]}},29806:function(e,n,i){"use strict";i.d(n,{f:function(){return t}});var r=i(18566),s=i(70647);function t(){return[(0,r.QT)(a,[]),async e=>{await s.j.project.writeSliceMachineConfig({config:e}),(0,r.VA)(a,[],e)}]}async function a(){return s.j.project.getSliceMachineConfig()}},84468:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return j}});var r=i(52322),s=i(33760),t=i(97729),a=i.n(t),l=i(2784),c=i(23335),o=i(30988),d=i(28948),u=i(88932);let h=e=>{let{title:n,enabled:i,onToggle:t,children:a}=e;return(0,r.jsx)(s.Zb,{variant:"outlined",children:(0,r.jsxs)(s.xu,{gap:8,padding:16,children:[(0,r.jsx)(s.xu,{padding:{top:6},children:(0,r.jsx)(s.I5,{name:"viewDay",size:"medium",color:"grey11"})}),(0,r.jsxs)(s.xu,{flexDirection:"column",flexGrow:1,children:[(0,r.jsx)(s.xv,{variant:"h3",children:n}),(0,r.jsx)(s.xv,{variant:"normal",children:a})]}),(0,r.jsx)(s.xu,{width:128,justifyContent:"end",children:(0,r.jsx)(s.rs,{size:"medium",checked:i,onCheckedChange:e=>t(e)})})]})})};var x=i(61502);let f=()=>{let[e,n]=function(e,n){let[i,r]=(0,x.E)(e);return[i,async e=>{try{await r(e),u.Am.success(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n))}catch(i){console.error(i),u.Am.error(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n))}}]}("legacySliceUpgrader","Legacy Slice Upgrader");return(0,r.jsxs)(s.xu,{flexDirection:"column",gap:32,children:[(0,r.jsx)("header",{children:(0,r.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,r.jsx)(s.xu,{flexDirection:"column",gap:16,children:(0,r.jsxs)(h,{title:"Legacy Slice Upgrader",enabled:e.enabled,onToggle:e=>void n(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,r.jsx)("a",{href:"https://prismic.io/docs/environments",target:"_blank",children:"Prismic environment"})," ","or you'll be at risk of losing past content."]})})]})},j=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:"Labs - Slice Machine"})}),(0,r.jsx)(o.S,{renderError:()=>(0,r.jsx)(g,{children:(0,r.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your labs configuration."})})}),children:(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(g,{withHeader:!0,children:(0,r.jsx)(s._3,{})}),children:(0,r.jsx)(g,{withHeader:!0,children:(0,r.jsx)(f,{})})})})]}),g=e=>{let{children:n,withHeader:i=!1}=e;return(0,r.jsxs)(d.LN,{children:[i?(0,r.jsx)(d.wd,{children:(0,r.jsx)(d.Cx,{children:(0,r.jsx)(c.g,{children:"Labs"})})}):null,(0,r.jsx)(d.RN,{children:n})]})}}},function(e){e.O(0,[888,774,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,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs",function(){return i(84468)}])},61502:function(e,n,i){"use strict";i.d(n,{E:function(){return s}});var r=i(29806);function s(e){var n,i;let[s,t]=(0,r.f)(),a=async n=>{let i={...s,labs:{...s.labs}};n?i.labs[e]=n:e in i.labs&&delete i.labs[e],0===Object.keys(i.labs).length&&delete i.labs,await t(i)};return[{enabled:null!==(i=null==s?void 0:null===(n=s.labs)||void 0===n?void 0:n[e])&&void 0!==i&&i},a]}},29806:function(e,n,i){"use strict";i.d(n,{f:function(){return t}});var r=i(18566),s=i(70647);function t(){return[(0,r.QT)(a,[]),async e=>{await s.j.project.writeSliceMachineConfig({config:e}),(0,r.VA)(a,[],e)}]}async function a(){return s.j.project.getSliceMachineConfig()}},84468:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return j}});var r=i(52322),s=i(38392),t=i(97729),a=i.n(t),l=i(2784),c=i(23335),o=i(30988),d=i(28948),u=i(88932);let h=e=>{let{title:n,enabled:i,onToggle:t,children:a}=e;return(0,r.jsx)(s.Zb,{variant:"outlined",children:(0,r.jsxs)(s.xu,{gap:8,padding:16,children:[(0,r.jsx)(s.xu,{padding:{top:6},children:(0,r.jsx)(s.I5,{name:"viewDay",size:"medium",color:"grey11"})}),(0,r.jsxs)(s.xu,{flexDirection:"column",flexGrow:1,children:[(0,r.jsx)(s.xv,{variant:"h3",children:n}),(0,r.jsx)(s.xv,{variant:"normal",children:a})]}),(0,r.jsx)(s.xu,{width:128,justifyContent:"end",children:(0,r.jsx)(s.rs,{size:"medium",checked:i,onCheckedChange:e=>t(e)})})]})})};var x=i(61502);let f=()=>{let[e,n]=function(e,n){let[i,r]=(0,x.E)(e);return[i,async e=>{try{await r(e),u.Am.success(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n))}catch(i){console.error(i),u.Am.error(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n))}}]}("legacySliceUpgrader","Legacy Slice Upgrader");return(0,r.jsxs)(s.xu,{flexDirection:"column",gap:32,children:[(0,r.jsx)("header",{children:(0,r.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,r.jsx)(s.xu,{flexDirection:"column",gap:16,children:(0,r.jsxs)(h,{title:"Legacy Slice Upgrader",enabled:e.enabled,onToggle:e=>void n(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,r.jsx)("a",{href:"https://prismic.io/docs/environments",target:"_blank",children:"Prismic environment"})," ","or you'll be at risk of losing past content."]})})]})},j=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:"Labs - Slice Machine"})}),(0,r.jsx)(o.S,{renderError:()=>(0,r.jsx)(g,{children:(0,r.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your labs configuration."})})}),children:(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(g,{withHeader:!0,children:(0,r.jsx)(s._3,{})}),children:(0,r.jsx)(g,{withHeader:!0,children:(0,r.jsx)(f,{})})})})]}),g=e=>{let{children:n,withHeader:i=!1}=e;return(0,r.jsxs)(d.LN,{children:[i?(0,r.jsx)(d.wd,{children:(0,r.jsx)(d.Cx,{children:(0,r.jsx)(c.g,{children:"Labs"})})}):null,(0,r.jsx)(d.RN,{children:n})]})}}},function(e){e.O(0,[888,774,179],function(){return e(e.s=41535)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[936],{61367:function(n,u,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page-types/[pageTypeId]",function(){return e(3244)}])},3244:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return t.H}});var t=e(9150)}},function(n){n.O(0,[898,917,525,461,139,183,50,349,479,772,372,882,150,888,774,179],function(){return n(n.s=61367)}),_N_E=n.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[936],{61367:function(n,u,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page-types/[pageTypeId]",function(){return e(3244)}])},3244:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return t.H}});var t=e(9150)}},function(n){n.O(0,[898,917,525,461,139,183,588,349,627,772,372,882,150,888,774,179],function(){return n(n.s=61367)}),_N_E=n.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{98863:function(e,t,n){"use strict";function r(e,...t){let n={...e};return t.forEach(e=>{delete n[e]}),n}function i(e){return Object.keys(e)}n.d(t,{XP:function(){return i},ud:function(){return r}})},24994:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return n(99176)}])},68587:function(e,t,n){"use strict";n.d(t,{Q:function(){return l}});let r={GitHub:"gitHub"};var i=n(52322),o=n(70647);let l={gitHub:{connect:async()=>await s("gitHub"),Icon:e=>(0,i.jsx)("svg",{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:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}),name:"GitHub",supported:c("gitHub")},bitbucket:{connect:async()=>await s("bitbucket"),Icon:e=>(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}),name:"Bitbucket",supported:c("bitbucket")},gitLab:{connect:async()=>await s("gitLab"),Icon:e=>(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}),name:"GitLab",supported:c("gitLab")}};async function s(e){if(!c(e))throw Error("Not implemented.");let t=await o.j.git.getProviderAppInstallURL({provider:e});window.open(t,"git-provider-app-installation")}function c(e){return!!Object.values(r).includes(e)}},6407:function(e,t,n){"use strict";n.d(t,{G:function(){return l}});var r=n(18566),i=n(29806),o=n(70647);function l(){let[e]=(0,i.f)();return{linkedGitRepos:(0,r.QT)(s,[e.repositoryName]),linkRepo:async t=>{await o.j.git.linkRepo({prismic:{domain:e.repositoryName},git:t}),await (0,r.gw)(s,[e.repositoryName])},unlinkRepo:async t=>{await o.j.git.unlinkRepo({prismic:{domain:e.repositoryName},git:t}),await (0,r.gw)(s,[e.repositoryName])}}}async function s(e){return await o.j.git.fetchLinkedRepos({prismic:{domain:e}})}},29806:function(e,t,n){"use strict";n.d(t,{f:function(){return o}});var r=n(18566),i=n(70647);function o(){return[(0,r.QT)(l,[]),async e=>{await i.j.project.writeSliceMachineConfig({config:e}),(0,r.VA)(l,[],e)}]}async function l(){return i.j.project.getSliceMachineConfig()}},99176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ei}});var r=n(52322),i=n(38392),o=n(97729),l=n.n(o),s=n(5632),c=n(2784),a=n(23335),d=n(37792),u=n(17783),x=n.n(u);let h=e=>(0,r.jsx)("div",{...e,className:x().root}),j=e=>{let{children:t,...n}=e;return(0,r.jsx)("div",{...n,className:x().legend,children:(0,r.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"smallBold",children:t})})},g=e=>(0,r.jsx)("div",{...e,className:x().header}),m=e=>(0,r.jsx)("div",{...e,className:x().content}),_=e=>(0,r.jsx)("ul",{...e,className:x().list}),p=e=>{let{action:t,children:n,...o}=e;return(0,r.jsxs)("li",{...o,className:x().listItem,children:[(0,r.jsx)(i.xv,{component:"span",noWrap:!0,variant:"bold",sx:{flexGrow:1},children:n}),t]})},f=e=>{let{action:t,children:n,...o}=e;return(0,r.jsxs)("div",{...o,className:x().footer,children:[(0,r.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",sx:{flexGrow:1},children:n}),t]})};var w=n(30988);let v=e=>{let{title:t,description:n,action:o}=e;return(0,r.jsxs)(i.xu,{flexDirection:"column",padding:{block:72,inline:100},children:[(0,r.jsx)(i.xv,{align:"center",variant:"emphasized",children:t}),(0,r.jsx)(i.xv,{align:"center",color:"grey11",children:n}),o?(0,r.jsx)(i.hE,{sx:{alignSelf:"center",marginTop:8},children:o}):void 0]})};var C=n(98863),b=n(88932),y=n(68587);let S=()=>(0,r.jsx)(i.hE,{children:(0,C.XP)(y.Q).map(e=>(0,r.jsx)(k,{provider:e,sx:{flexBasis:0,flexGrow:1}},e))}),k=e=>{let{provider:t,sx:n}=e,{connect:o,Icon:l,name:s,supported:a}=y.Q[t],[d,u]=(0,c.useState)(!1);return(0,r.jsxs)(i.zx,{color:"grey",disabled:!a,loading:d,onClick:()=>{(async()=>{u(!0);try{await o()}catch(t){let e="Could not connect to ".concat(s);console.error(e,t),b.Am.error(e),u(!1)}})()},renderStartIcon:()=>(0,r.jsx)(l,{color:i.rS.color.grey11}),sx:n,children:[s,a?void 0:(0,r.jsx)(i.xv,{color:"inherit",variant:"small",children:" (soon)"})]})},F=e=>{let{date:t,...n}=e;return(0,r.jsx)(i.xv,{...n,color:"inherit",variant:"inherit",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return L.format(Math.round((+Z(e)-+Z(t))/864e5),"day")}(t)})},L=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"narrow"});function Z(e){let t=new Date(e);return t.setHours(0,0,0,0),t}var I=n(63397),P=n(29806),R=n(70647),N=n(99579);let H=e=>{let{linkRepo:t,repo:n,trigger:o}=e,l=y.Q[n.provider],{updateToken:s}=function(e){let[t]=(0,P.f)();return{updateToken:async n=>{await R.j.git.updateWriteAPIToken({prismic:{domain:t.repositoryName},git:e.git,token:n})}}}({git:n}),{repositoryUrl:c}=(0,N.U)();return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:o,children:[(0,r.jsx)(i.fK,{title:"Prismic Write API token required"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(I.J9,{initialValues:{writeAPIToken:""},validate:e=>{if(0===e.writeAPIToken.length)return{writeAPIToken:"Cannot be empty"}},onSubmit:async e=>{try{await t(n),await s(e.writeAPIToken)}catch(t){let e="Could not connect to ".concat(n.name);console.error(e,t),b.Am.error(e)}},children:e=>(0,r.jsxs)("form",{onSubmit:e.handleSubmit,children:[(0,r.jsxs)(i.xu,{flexDirection:"column",gap:4,padding:16,children:[(0,r.jsx)(i.yt,{disabled:e.isSubmitting,error:"string"==typeof e.errors.writeAPIToken,label:"Paste your Write API token",onValueChange:t=>{e.setFieldValue("writeAPIToken",t)},placeholder:"Write API token",value:e.values.writeAPIToken}),(0,r.jsxs)(i.xv,{color:"grey11",children:["Required to sync models from ",l.name," to Prismic."]})]}),(0,r.jsxs)(i.kX,{children:[(0,r.jsx)(i.Bb,{href:new URL("/settings/apps",c).href,children:"Create a Prismic Write API token"}),(0,r.jsx)(i.PO,{size:"medium"}),(0,r.jsx)(i._d,{disabled:!e.isValid,loading:e.isSubmitting,onClick:()=>void e.submitForm(),size:"medium",children:"Save Token"})]})]})})})]})},T=e=>{let{repo:t,trigger:n,unlinkRepo:o}=e,[l,s]=(0,c.useState)(!1);return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:n,children:[(0,r.jsx)(i.fK,{title:"Remove Git Connection"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(i.xu,{flexDirection:"column",padding:16,children:(0,r.jsx)(i.xv,{children:"You will not be able to push your code alongside your models anymore. Note that you can reconnect your Git repository at any time. Are you sure you want to continue?"})})}),(0,r.jsxs)(i.kX,{children:[(0,r.jsx)(i.PO,{size:"medium"}),(0,r.jsx)(i._d,{size:"medium",color:"tomato",loading:l,onClick:()=>{(async()=>{s(!0);try{await o(t)}catch(n){let e="Could not disconnect from ".concat(t.name);console.error(e,n),b.Am.error(e)}s(!1)})()},children:"Disconnect"})]})]})};var A=n(6407);let W=e=>{let{mode:t,repos:n}=e,{linkRepo:o,unlinkRepo:l}=(0,A.G)();return(0,r.jsx)(_,{children:"link"===t?n.map(e=>(0,r.jsxs)(p,{action:(0,r.jsx)(H,{linkRepo:o,repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Connect"})}),children:[e.name,(0,r.jsxs)(i.xv,{color:"grey11",children:[" • ",(0,r.jsx)(F,{date:e.pushedAt})]})]},"".concat(e.provider,"@").concat(e.id))):n.map(e=>(0,r.jsx)(p,{action:(0,r.jsx)(T,{repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Disconnect"}),unlinkRepo:l}),children:e.name},"".concat(e.provider,"@").concat(e.owner,"/").concat(e.name)))})},D=()=>(0,r.jsx)(_,{children:[...[,,,,].keys()].map(e=>(0,r.jsx)(p,{action:(0,r.jsx)(i.Od,{height:32,width:67.59}),children:(0,r.jsx)(i.Od,{height:24,sx:{verticalAlign:"middle"},width:129.92})},e))}),G=e=>{let{disabled:t,owners:n=[],selectedOwner:o,onSelectedOwnerChange:l,sx:s}=e;return(0,r.jsx)(i.Ph,{color:"grey",constrainContentWidth:!0,disabled:t,flexContent:!0,onValueChange:e=>{let[t,r]=e.split("@"),i=n.find(e=>e.provider===t&&e.id===r);i&&(null==l||l(i))},placeholder:"Owner",renderStartIcon:()=>(0,r.jsx)(z,{owner:o}),size:"large",sx:s,value:o?M(o):void 0,children:n.map(e=>(0,r.jsx)(i.Ql,{renderStartIcon:()=>(0,r.jsx)(z,{owner:e}),size:"large",value:M(e),children:e.name},M(e)))})},z=e=>{var t;let{owner:n}=e,{Icon:o}=y.Q[null!==(t=null==n?void 0:n.provider)&&void 0!==t?t:"gitHub"];return(0,r.jsx)(o,{color:i.rS.color.grey11})};function M(e){return"".concat(e.provider,"@").concat(e.id)}var O=n(18566);async function V(e,t,n,r){return await R.j.git.fetchRepos({provider:e,owner:t,query:n,page:r})}let B=e=>{let{owners:t}=e,[n,i]=(0,c.useState)(t[0]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g,{children:(0,r.jsx)(G,{owners:t,selectedOwner:n,onSelectedOwnerChange:i,sx:{width:"calc(50% - 8px)"}})}),(0,r.jsx)(c.Suspense,{fallback:(0,r.jsx)(Q,{gitOwnerSelect:!1}),children:(0,r.jsx)(E,{owner:n})})]})},E=e=>{var t;let{owner:n}=e,i=(t={provider:n.provider,owner:n.name},(0,O.QT)(V,[t.provider,t.owner,t.query,t.page]));return i.length>0?(0,r.jsx)(W,{mode:"link",repos:i}):(0,r.jsx)(m,{children:(0,r.jsx)(v,{title:"No Results Found",description:"Try selecting a different Git account or organization on the top left."})})},Q=e=>{let{gitOwnerSelect:t}=e;return(0,r.jsxs)(r.Fragment,{children:[t?(0,r.jsx)(g,{children:(0,r.jsx)(G,{disabled:!0,sx:{width:"calc(50% - 8px)"}})}):void 0,(0,r.jsx)(D,{})]})};async function K(){return await R.j.git.fetchOwners()}var q=n(41067);let X=()=>(0,r.jsxs)(h,{children:[(0,r.jsx)(j,{children:"Connected Git Repository"}),(0,r.jsx)(w.S,{renderError:J,children:(0,r.jsx)(c.Suspense,{fallback:(0,r.jsx)(Q,{gitOwnerSelect:!0}),children:(0,r.jsx)(U,{})})}),(0,r.jsx)(f,{action:(0,r.jsx)(i.u,{content:"Documentation is coming soon.",side:"bottom",children:(0,r.jsx)(i.hU,{disabled:!0,icon:"openInNew"})}),children:"Learn more about Prismic for Git"})]}),U=()=>{let{linkedGitRepos:e}=(0,A.G)();return e.length>0?(0,r.jsx)(W,{mode:"unlink",repos:e}):(0,r.jsx)(Y,{})},Y=()=>{let e=(0,O.QT)(K,[]);return e.length>0?(0,r.jsx)(B,{owners:e}):(0,r.jsx)(m,{children:(0,r.jsx)(S,{})})};function J(e,t){return(0,d.ff)(e)?(0,r.jsx)($,{}):(0,d.TW)(e)?(0,r.jsx)(ee,{}):(0,r.jsx)(et,{reset:t})}let $=()=>{let{openLoginModal:e}=(0,q.Z)();return(0,r.jsx)(m,{children:(0,r.jsx)(v,{title:"It seems like you are logged out",description:"Log in to connect a Git repository.",action:(0,r.jsx)(i.zx,{onClick:e,children:"Log in to Prismic"})})})},ee=()=>(0,r.jsx)(m,{children:(0,r.jsx)(v,{title:"It seems like you do not have permission",description:"An owner or admin is required to connect a Git repository."})}),et=e=>{let{reset:t}=e;return(0,r.jsx)(m,{children:(0,r.jsx)(v,{title:"Unable to fetch data",description:"An error occurred while fetching the list of connected Git repositories.",action:(0,r.jsx)(i.zx,{color:"grey",onClick:t,children:"Retry"})})})};var en=n(52677),er=n(28948);let ei=()=>{let e=(0,en.M)(),t=(0,s.useRouter)();return((0,c.useEffect)(()=>{e.eligible||t.replace("/")},[e.eligible,t]),e.eligible)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l(),{children:(0,r.jsx)("title",{children:"Settings - Slice Machine"})}),(0,r.jsxs)(er.LN,{children:[(0,r.jsx)(er.wd,{children:(0,r.jsx)(er.Cx,{children:(0,r.jsx)(a.g,{children:"Settings"})})}),(0,r.jsx)(er.RN,{children:(0,r.jsx)(i.xu,{flexDirection:"column",maxWidth:600,children:(0,r.jsx)(X,{})})})]})]}):null}},17783:function(e){e.exports={flex:"FieldSet_flex__r2Zbg",column:"FieldSet_column__esHjW FieldSet_flex__r2Zbg",root:"FieldSet_root__MYqY8 FieldSet_column__esHjW FieldSet_flex__r2Zbg",row:"FieldSet_row__DZZjD FieldSet_flex__r2Zbg",borderBottom:"FieldSet_borderBottom__WVCMK",legend:"FieldSet_legend__4k9_l FieldSet_row__DZZjD FieldSet_flex__r2Zbg FieldSet_borderBottom__WVCMK",header:"FieldSet_header__cR_f3 FieldSet_row__DZZjD FieldSet_flex__r2Zbg FieldSet_borderBottom__WVCMK",content:"FieldSet_content__WzxRs FieldSet_column__esHjW FieldSet_flex__r2Zbg",list:"FieldSet_list__mILoo FieldSet_column__esHjW FieldSet_flex__r2Zbg",listItem:"FieldSet_listItem__QOhSB FieldSet_row__DZZjD FieldSet_flex__r2Zbg FieldSet_borderBottom__WVCMK",borderTop:"FieldSet_borderTop__KfoL_",footer:"FieldSet_footer__1VWxY FieldSet_row__DZZjD FieldSet_flex__r2Zbg FieldSet_borderTop__KfoL_"}}},function(e){e.O(0,[888,774,179],function(){return e(e.s=24994)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33],{30755:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]/simulator",function(){return n(96562)}])},44570:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5632),i=n(56580),o=n(68916);let s=(e,t,n)=>{var r;let i=null===(r=(0,o.Sd)(e))||void 0===r?void 0:r.find(e=>e.name.replace(/\//g,"--")===t);return null==i?void 0:i.components.find(e=>e.model.name===n)};var l=()=>{let e=(0,r.useRouter)(),{slice:t}=(0,i.v9)(t=>({slice:s(t,e.query.lib,e.query.sliceName)}));if(!t)return{};let n=t.model.variations.find(t=>t.id===e.query.variation);return n?{slice:t,variation:n}:{}}},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var r=n(52322),i=n(2784),o=n(75289);let s=(e,t)=>e?"".concat(e,"-").concat(t):"",l=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,i.forwardRef)((e,t)=>{let{label:n,Icon:i,type:a,form:c,isLoading:d=!1,disabled:u=!1,onClick:x,sx:h={},iconSize:p=16,iconFill:m,variant:g="primary",...f}=e;return(0,r.jsx)(o.zx,{ref:t,sx:{...h,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:a,form:c,disabled:u||d,onClick:d?void 0:x,variant:g,...f,children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.$j,{size:p,color:l(g),"data-testid":s(f["data-testid"],"spinner")}),i&&n]}):(0,r.jsxs)(r.Fragment,{children:[i&&(0,r.jsx)(i,{size:p,fill:m,"data-testid":s(f["data-testid"],"icon")}),n]})})})},76805:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(52322);n(2784);var i=n(75289);let o=e=>{let{bg:t,background:n,sx:o,withRadius:s,radius:l,children:a}=e;return(0,r.jsx)(i.xu,{sx:{p:4,bg:t||n,...s?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,...o},children:a})};var s=e=>{let{Header:t=null,SubHeader:n=null,Body:s=null,Footer:l=null,borderFooter:a=!1,radius:c="6px",bodySx:d={},footerSx:u={},sx:x=null,bg:h,background:p,children:m,...g}=e;return(0,r.jsxs)(i.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:c,...x},...g,children:[t?(0,r.jsx)(t,{radius:c}):null,n?(0,r.jsx)(n,{radius:c}):null,(0,r.jsxs)(o,{bg:h,background:p,sx:d,withRadius:!l,children:[s?(0,r.jsx)(s,{}):null,m||null]}),l?(0,r.jsx)(o,{bg:h,background:p,sx:{...a?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...u},radius:c,withRadius:!0,children:"object"==typeof l?l:(0,r.jsx)(l,{})}):null]})}},23240:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(52322),i=n(2784),o=n(65186),s=n(75289);let l=(0,i.memo)(e=>{let{src:t}=e;return(0,r.jsx)(s.Ee,{src:t,alt:"Preview image",sx:{maxHeight:"100%"}})}),a=e=>{let{src:t,sx:n}=e;return(0,r.jsx)(s.kC,{sx:{position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px",...n},children:void 0!==t?(0,r.jsx)(l,{src:t}):(0,r.jsxs)(s.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(o.eJU,{}),"You have no screenshot yet."]})})}},96562:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return G}});var r,i,o=n(52322),s=n(97729),l=n.n(s),a=n(5632),c=n.n(a),d=n(44570),u=n(71463),x=n(33760),h=n(25242),p=n(2784),m=n(56580),g=n(88932),f=n(75289),v=n(65077),b=n(93188),j=n(30988),C=function(e,t,n){let[r,i]=(0,p.useState)(e()),o=(0,p.useRef)(Date.now());return(0,p.useEffect)(()=>{let n=setTimeout(function(){Date.now()-o.current>=t&&(i(e()),o.current=Date.now())},t-(Date.now()-o.current));return()=>{clearTimeout(n)}},[t,...n]),r},k=n(76805),S=n(23240),w=n(11104),y=n(27078),E=n(46962),R=n(41067),D=e=>{let{sliceName:t,screenshotUrl:n}=e,{isScreenshotModalOpen:r}=(0,m.v9)(e=>({isScreenshotModalOpen:(0,y.gP)(e,E.q.SCREENSHOT_PREVIEW)})),{closeModals:i}=(0,R.Z)();return(0,o.jsx)(w.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,contentLabel:"Screenshot Preview",portalClassName:"ScreenshotPreviewModal",onRequestClose:i,children:(0,o.jsx)(k.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},Header:()=>(0,o.jsxs)(f.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,o.jsxs)(f.X6,{sx:{fontSize:"14px"},children:["Screenshot Preview for ",t]}),(0,o.jsx)(f.x8,{type:"button",onClick:()=>i()})]}),Footer:()=>(0,o.jsx)(f.kC,{style:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:"1px solid #DCDBDD"},children:(0,o.jsx)(f.zx,{variant:"secondary",sx:{fontWeight:600},onClick:()=>i(),children:"Close"})}),children:(0,o.jsx)(S.q,{src:n,sx:{height:"320px"}})})})},I=n(80410),z=n(79546);let O=e=>({__TYPE__:"SharedSliceContent",variation:e,primary:{},items:[]});var T=n(85819),M=n(47861),_=e=>{let{children:t,sx:n}=e;return(0,o.jsx)(f.kC,{sx:{bg:"grey07",height:"90%",width:"100%",justifyContent:"center",alignItems:"center",zIndex:"1",...n},children:(0,o.jsx)(f.kC,{sx:{marginTop:"-128px",justifyContent:"center",flexDirection:"column",alignItems:"center"},children:t})})},W=e=>{let{onRetrigger:t}=e;return(0,o.jsxs)(_,{children:[(0,o.jsx)(f.Ee,{src:"/iframe-not-running.png",sx:{width:"320px"}}),(0,o.jsx)(f.xv,{sx:{color:"textClear",mb:2,fontSize:"14px",lineHeight:"24px",fontWeight:"600"},children:"Slice Machine can't render your Slice"}),(0,o.jsxs)(f.xv,{sx:{color:"failedConnectText",maxWidth:"400px",textAlign:"center",fontSize:"12px",lineHeight:"22px"},children:["Ensure your website's development server is running by typing",(0,o.jsx)("br",{}),(0,o.jsx)(f.xv,{as:"code",variant:"styles.inlineCode",sx:{padding:"4px",borderRadius:"6px"},children:"npm run dev"}),"\xa0 in your terminal at the root of your website directory.",(0,o.jsx)("br",{})," If that doesn't work, see the\xa0",(0,o.jsx)(f.rU,{target:"_blank",href:"https://prismic.io/docs/slice-machine#simulate-slices",sx:{color:"link"},children:"troubleshooting instructions."})]}),(0,o.jsx)(M.z,{onClick:t,label:"Refresh",Icon:T.Fer,iconSize:20,iconFill:"#6F6E77",variant:"secondaryMedium",sx:{mt:"16px"}})]})},N=e=>(0,o.jsxs)("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3304 19.693C50.9182 18.9787 50.2527 18.6526 50.2527 18.6526L64.7906 10.2077C65.5266 9.78011 66.4679 10.0339 66.8929 10.7745C67.3179 11.5151 67.0657 12.4622 66.3294 12.8898L52.639 20.8424C52.639 20.8424 51.7428 20.4072 51.3304 19.693Z",fill:"current"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.6775 54.7814C58.0794 48.7394 61.6433 35.3572 55.6378 24.8917C54.7801 23.397 53.7736 22.0427 52.6481 20.8367L32.9428 32.2832C32.2068 32.7108 31.2655 32.457 30.8405 31.7165C30.4155 30.9757 30.6677 30.0287 31.4039 29.6011L50.2693 18.6425C43.486 13.2668 33.8645 12.2736 25.9299 16.8827C15.5282 22.9249 11.9642 36.3071 17.9697 46.7727C18.8274 48.2671 19.8339 49.6216 20.9595 50.8276L41.1791 39.0822C41.9151 38.6546 42.8564 38.9086 43.2814 39.6492C43.7064 40.3897 43.4542 41.3368 42.7182 41.7644L23.3384 53.0217C30.1217 58.3975 39.7432 59.3906 47.6775 54.7814Z",fill:"current"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.20645 61.7656C4.78145 61.0248 5.03367 60.078 5.76978 59.6502L20.9371 50.8398C20.9371 50.8398 21.8578 51.2406 22.3053 51.7062C22.7528 52.1717 23.361 53.0078 23.361 53.0078L7.30887 62.3323C6.57274 62.7599 5.63144 62.5061 5.20645 61.7656Z",fill:"current"})]}),P=n(75100),F=n(19909),L=e=>{let{defaultValue:t,variations:n,MenuItemAction:r,onChange:i}=e;return(0,o.jsxs)(f.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"4px",border:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:250,maxWidth:350,color:"text"},children:[(0,o.jsxs)(f.xv,{sx:{p:3,fontSize:12,color:"textClear"},children:[n.length," VARIATION",n.length>1?"S":""]}),(0,o.jsxs)(f.kC,{sx:{p:0,flexDirection:"column"},children:[n.map(e=>(0,o.jsx)(A,{value:e,isActive:e.id===t.id,onClick:i},e.id)),r||null]})]})};let A=e=>{let{value:t,isActive:n,onClick:r}=e;return(0,o.jsx)(f.xu,{sx:{px:3,py:2,color:n?"primary":"",cursor:"pointer",borderLeft:e=>{let{colors:t}=e;return"2px solid ".concat(n?null==t?void 0:t.primary:null==t?void 0:t.background)},borderRadius:0,bg:"background",":hover":{bg:"hoverBackground",borderLeft:e=>{let{colors:t}=e;return"2px solid ".concat(null==t?void 0:t.primary)}}},onClick:()=>r(t),children:t.name})};var B=e=>{let{buttonSx:t,defaultValue:n,variations:r,onNewVariation:i,onChange:s,sx:l,disabled:a}=e,[c,d]=(0,p.useState)(!1),[u,x]=(0,p.useState)(n||r[0]);(0,p.useEffect)(()=>{n&&x(n)},[n]);let h=function(e){d(!1),x(e),setTimeout(()=>s(e),210)},m=(0,o.jsx)(f.xu,{sx:{p:2},children:(0,o.jsx)(f.zx,{variant:"transparent",sx:{color:"text"},onClick:()=>{d(!1),i&&i()},children:"+ Add new variation"})});return(0,o.jsx)(f.xu,{sx:l,children:(0,o.jsx)(F.Popover,{align:"start",isOpen:c,onClickOutside:()=>d(!1),positions:["bottom"],padding:10,content:()=>(0,o.jsx)(L,{defaultValue:u,variations:r,onChange:h,MenuItemAction:i?m:void 0}),containerClassName:"variationSelectorContainer",children:(0,o.jsxs)(f.zx,{sx:{...t},variant:"dropDownButton",onClick:()=>d(!c),disabled:a,children:[u.name," ",c?(0,o.jsx)(P.bOz,{size:"16px","aria-label":"Collapse variations"}):(0,o.jsx)(P.mEq,{size:"16px","aria-label":"Expand variations"})]})})})};let U=(e,t,n)=>{if(!t){c().push("/".concat(e.href,"/").concat(e.model.name));return}let r=function(e){let{lib:t,sliceName:n,variationId:r,options:i={},isSimulator:o}=e,s="/slices/[lib]/[sliceName]/[variation]".concat(o?"/simulator":""),l="/slices/".concat(t,"/").concat(n,"/").concat(r).concat(o?"/simulator":"");return{href:s,as:l,options:i,all:[s,l,i]}}({lib:e.href,sliceName:e.model.name,variationId:null==t?void 0:t.id,isSimulator:n});c().push(r.href,r.as,r.options)};var Z=e=>{let{slice:t,variation:n,isDisplayEditor:r,toggleIsDisplayEditor:i,onSaveMock:s,actionsDisabled:l,isSavingMock:a}=e;return(0,o.jsxs)(f.kC,{sx:{p:"16px",display:"flex",bg:"grey07",gridTemplateRows:"1fr",borderBottom:"1px solid #DCDBDD",justifyContent:"space-between"},children:[(0,o.jsxs)(f.kC,{sx:{alignItems:"center"},children:[(0,o.jsx)(N,{height:"20px",width:"20px",fill:"#1A1523"}),(0,o.jsx)(f.xv,{sx:{ml:2,mr:"12px",fontSize:"14px",color:"#1A1523",fontWeight:"600",letterSpacing:"-0.15px"},children:t.model.name}),(0,o.jsx)(B,{defaultValue:n,variations:t.model.variations,onChange:e=>U(t,e,!0),disabled:t.model.variations.length<=1||l})]}),(0,o.jsxs)(f.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,o.jsx)(f.kC,{sx:{alignItems:"center",justifyContent:"space-around"},children:(0,o.jsxs)(f.kC,{sx:{alignItems:"center",mr:4},children:[(0,o.jsx)(f.__,{htmlFor:"show-mock-editor",sx:{color:"#6F6E77",lineHeight:"16px",fontSize:"12px",fontWeight:"600",letterSpacing:"0px"},children:"Editor"}),(0,o.jsx)(f.rs,{id:"show-mock-editor",checked:r,onChange:i,disabled:l})]})}),(0,o.jsx)(M.z,{"data-testid":"save-mock",onClick:s,label:"Save mock content",disabled:a||l,variant:"primary",sx:{borderRadius:"6px",color:"#F1EEFE",fontWeight:"bold",border:"1px solid #5842C3",backgroundColor:"#6E56CF",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.04)","&:hover":{"&:not([disabled])":{backgroundColor:"#5842C3"}}}})]})]})},H=n(16),q=e=>{let{apiContent:t,screenDimensions:n,simulatorUrl:r,dryRun:i=!1,isScreenshot:s=!1,handleSimulatorConnectionResult:l}=e,[a,c]=function(){let[e,t]=(0,p.useState)(),n=(0,p.useRef)(),r=(0,p.useRef)();return[e,(0,p.useCallback)(async e=>{var i,o;if(null===(i=n.current)||void 0===i||i.disconnect(),null===(o=r.current)||void 0===o||o.disconnect(),t(void 0),null!=e){n.current=new H.SH(e);try{await n.current.connect(),t(n.current);let i=async()=>{var e;t(void 0),await (null===(e=n.current)||void 0===e?void 0:e.connect({},!0)),t(n.current)};r.current=new MutationObserver(e=>{e.forEach(e=>{"src"===e.attributeName&&i().catch(e=>{throw e})})}),r.current.observe(e,{attributeFilter:["src"]})}catch(e){console.error(e)}}},[])]}();(0,p.useEffect)(()=>{if(!r){l("failed");return}if(void 0!==a){if(!a.connected){l("failed"),console.warn("Trying to use a disconnected simulator client.");return}(async()=>{await a.setSliceZone([t])})().then(()=>{l("successful")}).catch(()=>{l("failed")})}},[a,t,r]);let[d,u]=(0,p.useState)(),x=function(e,t){let n=(0,p.useRef)();return(0,p.useCallback)(t=>{var r;null===(r=n.current)||void 0===r||r.disconnect(),null!==t&&(n.current=new ResizeObserver(n=>{let[r]=n,{height:i,width:o}=r.contentRect;e({blockSize:i,inlineSize:o},t)}),n.current.observe(t))},t)}(e=>{let{blockSize:t,inlineSize:n}=e;u({height:t,width:n})},[]);return(0,o.jsx)(f.kC,{ref:x,sx:{alignItems:"center",backgroundColor:"headSection",backgroundImage:"url(/pattern.png)",backgroundRepeat:"repeat",backgroundSize:"10px",border:s?void 0:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorder))},borderRadius:s?void 0:8,display:"flex",height:"100%",justifyContent:"center",overflow:"hidden",...i?{display:"none"}:{}},children:r?(0,o.jsx)("iframe",{ref:c,src:r,style:{border:"none",maxHeight:"".concat(n.height,"px"),maxWidth:"".concat(n.width,"px"),minHeight:"".concat(n.height,"px"),minWidth:"".concat(n.width,"px"),overflowY:"auto",...d?{transform:"scale(".concat(function(e,t){let{height:n,width:r}=e,{height:i,width:o}=t;return r>o||n>i?r-o>n-i?o/r:i/n:1}(n,d),")")}:{display:"none"}}}):null})},V=e=>{let{defaultValue:t,options:n,onChange:r}=e;return(0,o.jsx)(f.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"6px",border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorder))},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:180,maxWidth:350,color:"text"},children:(0,o.jsx)(f.kC,{sx:{p:0,flexDirection:"column"},children:n.map(e=>(0,o.jsx)(X,{value:e,isActive:e===t,onClick:r}))})})};let X=e=>{let{value:t,isActive:n,onClick:r}=e;return(0,o.jsx)(f.xu,{sx:{p:2,cursor:"pointer",fontSize:"14px",borderRadius:0,bg:n?"hoverBackground":"background",":hover":{bg:"hoverBackground"}},onClick:()=>r(t),children:t})},K=e=>{let{buttonSx:t,currentValue:n,options:r,onChange:i,disabled:s}=e,[l,a]=(0,p.useState)(!1),c=function(e){a(!1),setTimeout(()=>i(e),210)};return(0,o.jsx)(f.xu,{children:(0,o.jsx)(F.Popover,{align:"start",isOpen:l,onClickOutside:()=>a(!1),positions:["bottom"],padding:2,content:()=>(0,o.jsx)(V,{defaultValue:n,options:r,onChange:c}),children:(0,o.jsxs)(f.zx,{sx:t,variant:"dropDownButton",onClick:()=>a(!l),disabled:s,children:[n," ",l?(0,o.jsx)(P.bOz,{size:"24px"}):(0,o.jsx)(P.mEq,{size:"24px"})]})})})};(r=i||(i={})).DESKTOP="Desktop",r.TABLET="Tablet",r.MOBILE="Mobile",r.CUSTOM="Custom";let Y={Desktop:{width:1280,height:800},Tablet:{width:1080,height:810},Mobile:{width:390,height:844}},J=e=>{let{label:t,startValue:n,onChange:r,sx:i,disabled:s}=e,l=["e","-","+",",","."];return(0,o.jsxs)(f.kC,{sx:{alignItems:"center",...i},children:[(0,o.jsx)(f.__,{sx:{backgroundColor:"grey07",border:"transparent",borderRight:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorder))},borderRadius:"6px 0px 0px 6px",width:26,height:30,color:"greyIcon",fontWeight:"bold",fontSize:"14px",alignItems:"center",justifyContent:"center",position:"absolute",ml:"1px"},htmlFor:"".concat(t,"-screensize-input"),children:t}),(0,o.jsx)(f.II,{type:"number",name:"".concat(t,"-screensize-input"),disabled:s,sx:{width:80,height:32,p:0,border:"1px solid #E4E2E4",borderRadius:"6px","&::-webkit-outer-spin-button,&::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},color:"greyIcon",textAlign:"center",paddingLeft:26,"&:disabled":{cursor:"not-allowed","&:hover":{border:"1px solid #E4E2E4"},"&:active":{border:"1px solid #E4E2E4",boxShadow:"none"}}},onChange:r,value:n,min:"0",onKeyDown:e=>{l.includes(e.key)&&e.preventDefault()}})]})},$=e=>{let{handleScreenSizeChange:t,screenDimensions:n,actionsDisabled:r}=e,[s,l]=(0,p.useState)(i.DESKTOP),a=e=>{let n=Object.values(Y).findIndex(t=>JSON.stringify(t)===JSON.stringify(e));l(n<0?i.CUSTOM:Object.keys(Y)[n]),t(e)};return(0,o.jsx)(f.kC,{sx:{alignItems:"center",pb:"16px",justifyContent:"space-between",variant:"small"},children:(0,o.jsxs)(f.kC,{sx:{alignItems:"center",flex:1},children:[(0,o.jsx)(K,{options:Object.values(i),onChange:e=>{l(e),e!==i.CUSTOM.toString()&&t(Y[e])},buttonSx:{alignSelf:"start"},currentValue:s,disabled:r}),(0,o.jsx)(J,{label:"W",startValue:n.width.toString(),onChange:e=>{a({...n,width:Number(e.target.value)})},disabled:r,sx:{mx:2}}),(0,o.jsx)(P.eSQ,{size:16,color:"#6F6E77"}),(0,o.jsx)(J,{label:"H",startValue:n.height.toString(),onChange:e=>{a({...n,height:Number(e.target.value)})},disabled:r,sx:{ml:2}})]})})};var Q=e=>{var t,n;let{slice:r,variation:s}=e,{updateSliceMockSuccess:l}=(0,R.Z)(),{simulatorUrl:a,endpoints:c}=(0,m.v9)(e=>({simulatorUrl:(0,z.x0)(e),endpoints:(0,z.gZ)(e)})),d=(0,p.useMemo)(()=>({embedApiEndpoint:new URL(c.PrismicEmbed),authStrategy:"cookie",unsplashApiBaseUrl:new URL(c.PrismicUnsplash),baseUrl:new URL("builder/",c.PrismicWroom)}),[c.PrismicEmbed,c.PrismicUnsplash,c.PrismicWroom]);(0,p.useEffect)(()=>{b.Xe.track({event:"slice-simulator:open"})},[]);let k=(0,p.useRef)(!1);(0,p.useEffect)(()=>{k.current=!0},[]);let S=e=>{k.current&&(k.current=!1,b.Xe.track({event:"editor:widget-used",sliceId:e}))},[w,y]=(0,p.useState)("waiting");(0,p.useEffect)(()=>{if("waiting"===w){let e=setTimeout(()=>{y("failed")},2e4);return()=>clearTimeout(e)}},[w]);let E=e=>{"waiting"===w&&("failed"===e?b.Xe.track({event:"slice-simulator:is-not-running"}):H(!0),y(e))},[T,M]=(0,p.useState)(Y[i.DESKTOP]),N=(0,p.useMemo)(()=>I.id.fromSM(r.model),[r.model]),[P,F]=(0,p.useState)(null),L=(0,p.useMemo)(()=>{var e;return(null==P?void 0:P.variation)===s.id?P:(null===(e=r.mocks)||void 0===e?void 0:e.find(e=>e.variation===s.id))||O(s.id)},[P,s.id]),A=(0,p.useMemo)(()=>(0,h.renderSliceMock)(N,L).id,[]),B=C((0,p.useCallback)(()=>()=>({...(0,h.renderSliceMock)(N,L),id:A}),[N,L]),800,[N,L]),[U,H]=(0,p.useState)(!1),[V,X]=(0,p.useState)(!1),K=async()=>{if(P){X(!0);try{var e;let t={libraryID:r.from,sliceID:r.model.id,mocks:(null!==(e=r.mocks)&&void 0!==e?e:[]).filter(e=>e.variation!==P.variation).concat(P)},{errors:n}=await (0,b.y3)(t);if(n.length>0)throw n;l(t),g.Am.success("Saved")}catch(e){console.error("Error while saving mock",e),g.Am.error("Error saving content")}X(!1)}};return(0,o.jsxs)(f.kC,{sx:{flexDirection:"column",height:"100vh"},children:[(0,o.jsx)(Z,{slice:r,variation:s,isDisplayEditor:U,actionsDisabled:"successful"!==w,toggleIsDisplayEditor:()=>H(!U),onSaveMock:()=>void K(),isSavingMock:V}),(0,o.jsx)(f.xu,{sx:{flex:1,bg:"grey07",p:3,display:"flex",flexDirection:"column",height:"calc(100% - 73px - 16px)"},children:(0,o.jsxs)(f.kC,{sx:{flex:1,flexDirection:"row",position:"relative",width:"100%",height:"100%"},children:[(0,o.jsxs)(v.xR,{sx:{display:"flex",height:"100%",flexDirection:"column",flex:1,minWidth:0},children:[(0,o.jsx)($,{handleScreenSizeChange:M,screenDimensions:T,actionsDisabled:"successful"!==w}),"failed"===w?(0,o.jsx)(W,{onRetrigger:()=>{y("waiting")}}):null,"successful"===w?(0,o.jsx)(q,{apiContent:B,screenDimensions:T,simulatorUrl:a,handleSimulatorConnectionResult:E}):(0,o.jsx)(o.Fragment,{children:"waiting"===w?(0,o.jsxs)(_,{children:[(0,o.jsx)(f.$j,{variant:"styles.spinner"}),(0,o.jsx)(q,{apiContent:B,screenDimensions:T,simulatorUrl:a,dryRun:!0,handleSimulatorConnectionResult:E})]}):null})]}),"successful"===w&&U?(0,o.jsx)(f.kC,{className:"editor",sx:{flexDirection:"column",marginLeft:"16px",maxWidth:"440px",minWidth:"440px",overflowY:"auto"},children:(0,o.jsx)(j.S,{renderError:()=>(0,o.jsx)(x.Iq,{title:"Editor error",description:"An error occurred while rendering the editor."}),children:(0,o.jsx)(p.Suspense,{children:(0,o.jsx)(u.kS,{config:d,content:L,onContentChange:e=>{F(e),S(r.model.id)},sharedSlice:N},s.id)})})}):null]})}),!!(null===(t=r.screenshots[s.id])||void 0===t?void 0:t.url)&&(0,o.jsx)(D,{sliceName:r.model.name,screenshotUrl:null===(n=r.screenshots[s.id])||void 0===n?void 0:n.url})]})};function G(){let e=(0,a.useRouter)(),{slice:t,variation:n}=(0,d.Z)();return void 0===t||void 0===n?(e.replace("/"),null):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l(),{children:(0,o.jsx)("title",{children:"Simulator: ".concat(t.model.name," - Slice Machine")})}),(0,o.jsx)(Q,{slice:t,variation:n})]})}}},function(e){e.O(0,[789,872,851,441,888,774,179],function(){return e(e.s=30755)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33],{30755:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]/simulator",function(){return n(96562)}])},44570:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5632),i=n(56580),o=n(68916);let s=(e,t,n)=>{var r;let i=null===(r=(0,o.Sd)(e))||void 0===r?void 0:r.find(e=>e.name.replace(/\//g,"--")===t);return null==i?void 0:i.components.find(e=>e.model.name===n)};var l=()=>{let e=(0,r.useRouter)(),{slice:t}=(0,i.v9)(t=>({slice:s(t,e.query.lib,e.query.sliceName)}));if(!t)return{};let n=t.model.variations.find(t=>t.id===e.query.variation);return n?{slice:t,variation:n}:{}}},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var r=n(52322),i=n(2784),o=n(75289);let s=(e,t)=>e?"".concat(e,"-").concat(t):"",l=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,i.forwardRef)((e,t)=>{let{label:n,Icon:i,type:a,form:c,isLoading:d=!1,disabled:u=!1,onClick:x,sx:h={},iconSize:p=16,iconFill:m,variant:g="primary",...f}=e;return(0,r.jsx)(o.zx,{ref:t,sx:{...h,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:a,form:c,disabled:u||d,onClick:d?void 0:x,variant:g,...f,children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.$j,{size:p,color:l(g),"data-testid":s(f["data-testid"],"spinner")}),i&&n]}):(0,r.jsxs)(r.Fragment,{children:[i&&(0,r.jsx)(i,{size:p,fill:m,"data-testid":s(f["data-testid"],"icon")}),n]})})})},76805:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(52322);n(2784);var i=n(75289);let o=e=>{let{bg:t,background:n,sx:o,withRadius:s,radius:l,children:a}=e;return(0,r.jsx)(i.xu,{sx:{p:4,bg:t||n,...s?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,...o},children:a})};var s=e=>{let{Header:t=null,SubHeader:n=null,Body:s=null,Footer:l=null,borderFooter:a=!1,radius:c="6px",bodySx:d={},footerSx:u={},sx:x=null,bg:h,background:p,children:m,...g}=e;return(0,r.jsxs)(i.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:c,...x},...g,children:[t?(0,r.jsx)(t,{radius:c}):null,n?(0,r.jsx)(n,{radius:c}):null,(0,r.jsxs)(o,{bg:h,background:p,sx:d,withRadius:!l,children:[s?(0,r.jsx)(s,{}):null,m||null]}),l?(0,r.jsx)(o,{bg:h,background:p,sx:{...a?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...u},radius:c,withRadius:!0,children:"object"==typeof l?l:(0,r.jsx)(l,{})}):null]})}},23240:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(52322),i=n(2784),o=n(65186),s=n(75289);let l=(0,i.memo)(e=>{let{src:t}=e;return(0,r.jsx)(s.Ee,{src:t,alt:"Preview image",sx:{maxHeight:"100%"}})}),a=e=>{let{src:t,sx:n}=e;return(0,r.jsx)(s.kC,{sx:{position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px",...n},children:void 0!==t?(0,r.jsx)(l,{src:t}):(0,r.jsxs)(s.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(o.eJU,{}),"You have no screenshot yet."]})})}},96562:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return G}});var r,i,o=n(52322),s=n(97729),l=n.n(s),a=n(5632),c=n.n(a),d=n(44570),u=n(71463),x=n(38392),h=n(25242),p=n(2784),m=n(56580),g=n(88932),f=n(75289),v=n(65077),b=n(93188),j=n(30988),C=function(e,t,n){let[r,i]=(0,p.useState)(e()),o=(0,p.useRef)(Date.now());return(0,p.useEffect)(()=>{let n=setTimeout(function(){Date.now()-o.current>=t&&(i(e()),o.current=Date.now())},t-(Date.now()-o.current));return()=>{clearTimeout(n)}},[t,...n]),r},k=n(76805),S=n(23240),w=n(11104),y=n(27078),E=n(46962),R=n(41067),D=e=>{let{sliceName:t,screenshotUrl:n}=e,{isScreenshotModalOpen:r}=(0,m.v9)(e=>({isScreenshotModalOpen:(0,y.gP)(e,E.q.SCREENSHOT_PREVIEW)})),{closeModals:i}=(0,R.Z)();return(0,o.jsx)(w.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,contentLabel:"Screenshot Preview",portalClassName:"ScreenshotPreviewModal",onRequestClose:i,children:(0,o.jsx)(k.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},Header:()=>(0,o.jsxs)(f.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,o.jsxs)(f.X6,{sx:{fontSize:"14px"},children:["Screenshot Preview for ",t]}),(0,o.jsx)(f.x8,{type:"button",onClick:()=>i()})]}),Footer:()=>(0,o.jsx)(f.kC,{style:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:"1px solid #DCDBDD"},children:(0,o.jsx)(f.zx,{variant:"secondary",sx:{fontWeight:600},onClick:()=>i(),children:"Close"})}),children:(0,o.jsx)(S.q,{src:n,sx:{height:"320px"}})})})},I=n(80410),z=n(79546);let O=e=>({__TYPE__:"SharedSliceContent",variation:e,primary:{},items:[]});var T=n(85819),M=n(47861),_=e=>{let{children:t,sx:n}=e;return(0,o.jsx)(f.kC,{sx:{bg:"grey07",height:"90%",width:"100%",justifyContent:"center",alignItems:"center",zIndex:"1",...n},children:(0,o.jsx)(f.kC,{sx:{marginTop:"-128px",justifyContent:"center",flexDirection:"column",alignItems:"center"},children:t})})},W=e=>{let{onRetrigger:t}=e;return(0,o.jsxs)(_,{children:[(0,o.jsx)(f.Ee,{src:"/iframe-not-running.png",sx:{width:"320px"}}),(0,o.jsx)(f.xv,{sx:{color:"textClear",mb:2,fontSize:"14px",lineHeight:"24px",fontWeight:"600"},children:"Slice Machine can't render your Slice"}),(0,o.jsxs)(f.xv,{sx:{color:"failedConnectText",maxWidth:"400px",textAlign:"center",fontSize:"12px",lineHeight:"22px"},children:["Ensure your website's development server is running by typing",(0,o.jsx)("br",{}),(0,o.jsx)(f.xv,{as:"code",variant:"styles.inlineCode",sx:{padding:"4px",borderRadius:"6px"},children:"npm run dev"}),"\xa0 in your terminal at the root of your website directory.",(0,o.jsx)("br",{})," If that doesn't work, see the\xa0",(0,o.jsx)(f.rU,{target:"_blank",href:"https://prismic.io/docs/slice-machine#simulate-slices",sx:{color:"link"},children:"troubleshooting instructions."})]}),(0,o.jsx)(M.z,{onClick:t,label:"Refresh",Icon:T.Fer,iconSize:20,iconFill:"#6F6E77",variant:"secondaryMedium",sx:{mt:"16px"}})]})},N=e=>(0,o.jsxs)("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3304 19.693C50.9182 18.9787 50.2527 18.6526 50.2527 18.6526L64.7906 10.2077C65.5266 9.78011 66.4679 10.0339 66.8929 10.7745C67.3179 11.5151 67.0657 12.4622 66.3294 12.8898L52.639 20.8424C52.639 20.8424 51.7428 20.4072 51.3304 19.693Z",fill:"current"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.6775 54.7814C58.0794 48.7394 61.6433 35.3572 55.6378 24.8917C54.7801 23.397 53.7736 22.0427 52.6481 20.8367L32.9428 32.2832C32.2068 32.7108 31.2655 32.457 30.8405 31.7165C30.4155 30.9757 30.6677 30.0287 31.4039 29.6011L50.2693 18.6425C43.486 13.2668 33.8645 12.2736 25.9299 16.8827C15.5282 22.9249 11.9642 36.3071 17.9697 46.7727C18.8274 48.2671 19.8339 49.6216 20.9595 50.8276L41.1791 39.0822C41.9151 38.6546 42.8564 38.9086 43.2814 39.6492C43.7064 40.3897 43.4542 41.3368 42.7182 41.7644L23.3384 53.0217C30.1217 58.3975 39.7432 59.3906 47.6775 54.7814Z",fill:"current"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.20645 61.7656C4.78145 61.0248 5.03367 60.078 5.76978 59.6502L20.9371 50.8398C20.9371 50.8398 21.8578 51.2406 22.3053 51.7062C22.7528 52.1717 23.361 53.0078 23.361 53.0078L7.30887 62.3323C6.57274 62.7599 5.63144 62.5061 5.20645 61.7656Z",fill:"current"})]}),P=n(75100),F=n(19909),L=e=>{let{defaultValue:t,variations:n,MenuItemAction:r,onChange:i}=e;return(0,o.jsxs)(f.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"4px",border:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:250,maxWidth:350,color:"text"},children:[(0,o.jsxs)(f.xv,{sx:{p:3,fontSize:12,color:"textClear"},children:[n.length," VARIATION",n.length>1?"S":""]}),(0,o.jsxs)(f.kC,{sx:{p:0,flexDirection:"column"},children:[n.map(e=>(0,o.jsx)(A,{value:e,isActive:e.id===t.id,onClick:i},e.id)),r||null]})]})};let A=e=>{let{value:t,isActive:n,onClick:r}=e;return(0,o.jsx)(f.xu,{sx:{px:3,py:2,color:n?"primary":"",cursor:"pointer",borderLeft:e=>{let{colors:t}=e;return"2px solid ".concat(n?null==t?void 0:t.primary:null==t?void 0:t.background)},borderRadius:0,bg:"background",":hover":{bg:"hoverBackground",borderLeft:e=>{let{colors:t}=e;return"2px solid ".concat(null==t?void 0:t.primary)}}},onClick:()=>r(t),children:t.name})};var B=e=>{let{buttonSx:t,defaultValue:n,variations:r,onNewVariation:i,onChange:s,sx:l,disabled:a}=e,[c,d]=(0,p.useState)(!1),[u,x]=(0,p.useState)(n||r[0]);(0,p.useEffect)(()=>{n&&x(n)},[n]);let h=function(e){d(!1),x(e),setTimeout(()=>s(e),210)},m=(0,o.jsx)(f.xu,{sx:{p:2},children:(0,o.jsx)(f.zx,{variant:"transparent",sx:{color:"text"},onClick:()=>{d(!1),i&&i()},children:"+ Add new variation"})});return(0,o.jsx)(f.xu,{sx:l,children:(0,o.jsx)(F.Popover,{align:"start",isOpen:c,onClickOutside:()=>d(!1),positions:["bottom"],padding:10,content:()=>(0,o.jsx)(L,{defaultValue:u,variations:r,onChange:h,MenuItemAction:i?m:void 0}),containerClassName:"variationSelectorContainer",children:(0,o.jsxs)(f.zx,{sx:{...t},variant:"dropDownButton",onClick:()=>d(!c),disabled:a,children:[u.name," ",c?(0,o.jsx)(P.bOz,{size:"16px","aria-label":"Collapse variations"}):(0,o.jsx)(P.mEq,{size:"16px","aria-label":"Expand variations"})]})})})};let U=(e,t,n)=>{if(!t){c().push("/".concat(e.href,"/").concat(e.model.name));return}let r=function(e){let{lib:t,sliceName:n,variationId:r,options:i={},isSimulator:o}=e,s="/slices/[lib]/[sliceName]/[variation]".concat(o?"/simulator":""),l="/slices/".concat(t,"/").concat(n,"/").concat(r).concat(o?"/simulator":"");return{href:s,as:l,options:i,all:[s,l,i]}}({lib:e.href,sliceName:e.model.name,variationId:null==t?void 0:t.id,isSimulator:n});c().push(r.href,r.as,r.options)};var Z=e=>{let{slice:t,variation:n,isDisplayEditor:r,toggleIsDisplayEditor:i,onSaveMock:s,actionsDisabled:l,isSavingMock:a}=e;return(0,o.jsxs)(f.kC,{sx:{p:"16px",display:"flex",bg:"grey07",gridTemplateRows:"1fr",borderBottom:"1px solid #DCDBDD",justifyContent:"space-between"},children:[(0,o.jsxs)(f.kC,{sx:{alignItems:"center"},children:[(0,o.jsx)(N,{height:"20px",width:"20px",fill:"#1A1523"}),(0,o.jsx)(f.xv,{sx:{ml:2,mr:"12px",fontSize:"14px",color:"#1A1523",fontWeight:"600",letterSpacing:"-0.15px"},children:t.model.name}),(0,o.jsx)(B,{defaultValue:n,variations:t.model.variations,onChange:e=>U(t,e,!0),disabled:t.model.variations.length<=1||l})]}),(0,o.jsxs)(f.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,o.jsx)(f.kC,{sx:{alignItems:"center",justifyContent:"space-around"},children:(0,o.jsxs)(f.kC,{sx:{alignItems:"center",mr:4},children:[(0,o.jsx)(f.__,{htmlFor:"show-mock-editor",sx:{color:"#6F6E77",lineHeight:"16px",fontSize:"12px",fontWeight:"600",letterSpacing:"0px"},children:"Editor"}),(0,o.jsx)(f.rs,{id:"show-mock-editor",checked:r,onChange:i,disabled:l})]})}),(0,o.jsx)(M.z,{"data-testid":"save-mock",onClick:s,label:"Save mock content",disabled:a||l,variant:"primary",sx:{borderRadius:"6px",color:"#F1EEFE",fontWeight:"bold",border:"1px solid #5842C3",backgroundColor:"#6E56CF",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.04)","&:hover":{"&:not([disabled])":{backgroundColor:"#5842C3"}}}})]})]})},H=n(16),q=e=>{let{apiContent:t,screenDimensions:n,simulatorUrl:r,dryRun:i=!1,isScreenshot:s=!1,handleSimulatorConnectionResult:l}=e,[a,c]=function(){let[e,t]=(0,p.useState)(),n=(0,p.useRef)(),r=(0,p.useRef)();return[e,(0,p.useCallback)(async e=>{var i,o;if(null===(i=n.current)||void 0===i||i.disconnect(),null===(o=r.current)||void 0===o||o.disconnect(),t(void 0),null!=e){n.current=new H.SH(e);try{await n.current.connect(),t(n.current);let i=async()=>{var e;t(void 0),await (null===(e=n.current)||void 0===e?void 0:e.connect({},!0)),t(n.current)};r.current=new MutationObserver(e=>{e.forEach(e=>{"src"===e.attributeName&&i().catch(e=>{throw e})})}),r.current.observe(e,{attributeFilter:["src"]})}catch(e){console.error(e)}}},[])]}();(0,p.useEffect)(()=>{if(!r){l("failed");return}if(void 0!==a){if(!a.connected){l("failed"),console.warn("Trying to use a disconnected simulator client.");return}(async()=>{await a.setSliceZone([t])})().then(()=>{l("successful")}).catch(()=>{l("failed")})}},[a,t,r]);let[d,u]=(0,p.useState)(),x=function(e,t){let n=(0,p.useRef)();return(0,p.useCallback)(t=>{var r;null===(r=n.current)||void 0===r||r.disconnect(),null!==t&&(n.current=new ResizeObserver(n=>{let[r]=n,{height:i,width:o}=r.contentRect;e({blockSize:i,inlineSize:o},t)}),n.current.observe(t))},t)}(e=>{let{blockSize:t,inlineSize:n}=e;u({height:t,width:n})},[]);return(0,o.jsx)(f.kC,{ref:x,sx:{alignItems:"center",backgroundColor:"headSection",backgroundImage:"url(/pattern.png)",backgroundRepeat:"repeat",backgroundSize:"10px",border:s?void 0:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorder))},borderRadius:s?void 0:8,display:"flex",height:"100%",justifyContent:"center",overflow:"hidden",...i?{display:"none"}:{}},children:r?(0,o.jsx)("iframe",{ref:c,src:r,style:{border:"none",maxHeight:"".concat(n.height,"px"),maxWidth:"".concat(n.width,"px"),minHeight:"".concat(n.height,"px"),minWidth:"".concat(n.width,"px"),overflowY:"auto",...d?{transform:"scale(".concat(function(e,t){let{height:n,width:r}=e,{height:i,width:o}=t;return r>o||n>i?r-o>n-i?o/r:i/n:1}(n,d),")")}:{display:"none"}}}):null})},V=e=>{let{defaultValue:t,options:n,onChange:r}=e;return(0,o.jsx)(f.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"6px",border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorder))},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:180,maxWidth:350,color:"text"},children:(0,o.jsx)(f.kC,{sx:{p:0,flexDirection:"column"},children:n.map(e=>(0,o.jsx)(X,{value:e,isActive:e===t,onClick:r}))})})};let X=e=>{let{value:t,isActive:n,onClick:r}=e;return(0,o.jsx)(f.xu,{sx:{p:2,cursor:"pointer",fontSize:"14px",borderRadius:0,bg:n?"hoverBackground":"background",":hover":{bg:"hoverBackground"}},onClick:()=>r(t),children:t})},K=e=>{let{buttonSx:t,currentValue:n,options:r,onChange:i,disabled:s}=e,[l,a]=(0,p.useState)(!1),c=function(e){a(!1),setTimeout(()=>i(e),210)};return(0,o.jsx)(f.xu,{children:(0,o.jsx)(F.Popover,{align:"start",isOpen:l,onClickOutside:()=>a(!1),positions:["bottom"],padding:2,content:()=>(0,o.jsx)(V,{defaultValue:n,options:r,onChange:c}),children:(0,o.jsxs)(f.zx,{sx:t,variant:"dropDownButton",onClick:()=>a(!l),disabled:s,children:[n," ",l?(0,o.jsx)(P.bOz,{size:"24px"}):(0,o.jsx)(P.mEq,{size:"24px"})]})})})};(r=i||(i={})).DESKTOP="Desktop",r.TABLET="Tablet",r.MOBILE="Mobile",r.CUSTOM="Custom";let Y={Desktop:{width:1280,height:800},Tablet:{width:1080,height:810},Mobile:{width:390,height:844}},J=e=>{let{label:t,startValue:n,onChange:r,sx:i,disabled:s}=e,l=["e","-","+",",","."];return(0,o.jsxs)(f.kC,{sx:{alignItems:"center",...i},children:[(0,o.jsx)(f.__,{sx:{backgroundColor:"grey07",border:"transparent",borderRight:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorder))},borderRadius:"6px 0px 0px 6px",width:26,height:30,color:"greyIcon",fontWeight:"bold",fontSize:"14px",alignItems:"center",justifyContent:"center",position:"absolute",ml:"1px"},htmlFor:"".concat(t,"-screensize-input"),children:t}),(0,o.jsx)(f.II,{type:"number",name:"".concat(t,"-screensize-input"),disabled:s,sx:{width:80,height:32,p:0,border:"1px solid #E4E2E4",borderRadius:"6px","&::-webkit-outer-spin-button,&::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},color:"greyIcon",textAlign:"center",paddingLeft:26,"&:disabled":{cursor:"not-allowed","&:hover":{border:"1px solid #E4E2E4"},"&:active":{border:"1px solid #E4E2E4",boxShadow:"none"}}},onChange:r,value:n,min:"0",onKeyDown:e=>{l.includes(e.key)&&e.preventDefault()}})]})},$=e=>{let{handleScreenSizeChange:t,screenDimensions:n,actionsDisabled:r}=e,[s,l]=(0,p.useState)(i.DESKTOP),a=e=>{let n=Object.values(Y).findIndex(t=>JSON.stringify(t)===JSON.stringify(e));l(n<0?i.CUSTOM:Object.keys(Y)[n]),t(e)};return(0,o.jsx)(f.kC,{sx:{alignItems:"center",pb:"16px",justifyContent:"space-between",variant:"small"},children:(0,o.jsxs)(f.kC,{sx:{alignItems:"center",flex:1},children:[(0,o.jsx)(K,{options:Object.values(i),onChange:e=>{l(e),e!==i.CUSTOM.toString()&&t(Y[e])},buttonSx:{alignSelf:"start"},currentValue:s,disabled:r}),(0,o.jsx)(J,{label:"W",startValue:n.width.toString(),onChange:e=>{a({...n,width:Number(e.target.value)})},disabled:r,sx:{mx:2}}),(0,o.jsx)(P.eSQ,{size:16,color:"#6F6E77"}),(0,o.jsx)(J,{label:"H",startValue:n.height.toString(),onChange:e=>{a({...n,height:Number(e.target.value)})},disabled:r,sx:{ml:2}})]})})};var Q=e=>{var t,n;let{slice:r,variation:s}=e,{updateSliceMockSuccess:l}=(0,R.Z)(),{simulatorUrl:a,endpoints:c}=(0,m.v9)(e=>({simulatorUrl:(0,z.x0)(e),endpoints:(0,z.gZ)(e)})),d=(0,p.useMemo)(()=>({embedApiEndpoint:new URL(c.PrismicEmbed),authStrategy:"cookie",unsplashApiBaseUrl:new URL(c.PrismicUnsplash),baseUrl:new URL("builder/",c.PrismicWroom)}),[c.PrismicEmbed,c.PrismicUnsplash,c.PrismicWroom]);(0,p.useEffect)(()=>{b.Xe.track({event:"slice-simulator:open"})},[]);let k=(0,p.useRef)(!1);(0,p.useEffect)(()=>{k.current=!0},[]);let S=e=>{k.current&&(k.current=!1,b.Xe.track({event:"editor:widget-used",sliceId:e}))},[w,y]=(0,p.useState)("waiting");(0,p.useEffect)(()=>{if("waiting"===w){let e=setTimeout(()=>{y("failed")},2e4);return()=>clearTimeout(e)}},[w]);let E=e=>{"waiting"===w&&("failed"===e?b.Xe.track({event:"slice-simulator:is-not-running"}):H(!0),y(e))},[T,M]=(0,p.useState)(Y[i.DESKTOP]),N=(0,p.useMemo)(()=>I.id.fromSM(r.model),[r.model]),[P,F]=(0,p.useState)(null),L=(0,p.useMemo)(()=>{var e;return(null==P?void 0:P.variation)===s.id?P:(null===(e=r.mocks)||void 0===e?void 0:e.find(e=>e.variation===s.id))||O(s.id)},[P,s.id]),A=(0,p.useMemo)(()=>(0,h.renderSliceMock)(N,L).id,[]),B=C((0,p.useCallback)(()=>()=>({...(0,h.renderSliceMock)(N,L),id:A}),[N,L]),800,[N,L]),[U,H]=(0,p.useState)(!1),[V,X]=(0,p.useState)(!1),K=async()=>{if(P){X(!0);try{var e;let t={libraryID:r.from,sliceID:r.model.id,mocks:(null!==(e=r.mocks)&&void 0!==e?e:[]).filter(e=>e.variation!==P.variation).concat(P)},{errors:n}=await (0,b.y3)(t);if(n.length>0)throw n;l(t),g.Am.success("Saved")}catch(e){console.error("Error while saving mock",e),g.Am.error("Error saving content")}X(!1)}};return(0,o.jsxs)(f.kC,{sx:{flexDirection:"column",height:"100vh"},children:[(0,o.jsx)(Z,{slice:r,variation:s,isDisplayEditor:U,actionsDisabled:"successful"!==w,toggleIsDisplayEditor:()=>H(!U),onSaveMock:()=>void K(),isSavingMock:V}),(0,o.jsx)(f.xu,{sx:{flex:1,bg:"grey07",p:3,display:"flex",flexDirection:"column",height:"calc(100% - 73px - 16px)"},children:(0,o.jsxs)(f.kC,{sx:{flex:1,flexDirection:"row",position:"relative",width:"100%",height:"100%"},children:[(0,o.jsxs)(v.xR,{sx:{display:"flex",height:"100%",flexDirection:"column",flex:1,minWidth:0},children:[(0,o.jsx)($,{handleScreenSizeChange:M,screenDimensions:T,actionsDisabled:"successful"!==w}),"failed"===w?(0,o.jsx)(W,{onRetrigger:()=>{y("waiting")}}):null,"successful"===w?(0,o.jsx)(q,{apiContent:B,screenDimensions:T,simulatorUrl:a,handleSimulatorConnectionResult:E}):(0,o.jsx)(o.Fragment,{children:"waiting"===w?(0,o.jsxs)(_,{children:[(0,o.jsx)(f.$j,{variant:"styles.spinner"}),(0,o.jsx)(q,{apiContent:B,screenDimensions:T,simulatorUrl:a,dryRun:!0,handleSimulatorConnectionResult:E})]}):null})]}),"successful"===w&&U?(0,o.jsx)(f.kC,{className:"editor",sx:{flexDirection:"column",marginLeft:"16px",maxWidth:"440px",minWidth:"440px",overflowY:"auto"},children:(0,o.jsx)(j.S,{renderError:()=>(0,o.jsx)(x.Iq,{title:"Editor error",description:"An error occurred while rendering the editor."}),children:(0,o.jsx)(p.Suspense,{children:(0,o.jsx)(u.kS,{config:d,content:L,onContentChange:e=>{F(e),S(r.model.id)},sharedSlice:N},s.id)})})}):null]})}),!!(null===(t=r.screenshots[s.id])||void 0===t?void 0:t.url)&&(0,o.jsx)(D,{sliceName:r.model.name,screenshotUrl:null===(n=r.screenshots[s.id])||void 0===n?void 0:n.url})]})};function G(){let e=(0,a.useRouter)(),{slice:t,variation:n}=(0,d.Z)();return void 0===t||void 0===n?(e.replace("/"),null):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l(),{children:(0,o.jsx)("title",{children:"Simulator: ".concat(t.model.name," - Slice Machine")})}),(0,o.jsx)(Q,{slice:t,variation:n})]})}}},function(e){e.O(0,[789,872,851,441,888,774,179],function(){return e(e.s=30755)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[136],{31314:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]",function(){return n(6988)}])},44570:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(5632),o=n(56580),r=n(68916);let a=(e,t,n)=>{var i;let o=null===(i=(0,r.Sd)(e))||void 0===i?void 0:i.find(e=>e.name.replace(/\//g,"--")===t);return null==o?void 0:o.components.find(e=>e.model.name===n)};var l=()=>{let e=(0,i.useRouter)(),{slice:t}=(0,o.v9)(t=>({slice:a(t,e.query.lib,e.query.sliceName)}));if(!t)return{};let n=t.model.variations.find(t=>t.id===e.query.variation);return n?{slice:t,variation:n}:{}}},6988:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eR}});var i=n(52322),o=n(97729),r=n.n(o),a=n(5632),l=n(74217),s=n(2784),d=n(93188),c=n(80546),u=n(43874),m=n(41067);let h=(0,s.createContext)(void 0);function p(e){let{children:t,initialSlice:n}=e,o=(0,a.useRouter)(),[r,p]=(0,s.useState)(n),{actionQueueStatus:v,setNextAction:f}=(0,u.c)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),{saveSliceSuccess:x}=(0,m.Z)(),y=(0,l.R9)(x),{syncChanges:g}=(0,c.g)(),j=(0,s.useMemo)(()=>{let e=o.query.variation,t=r.model.variations.find(t=>t.id===e);if(t)return t;throw Error("Variation not found")},[r,o]),b=(0,s.useCallback)((e,t)=>{p(e),f(async()=>{let{errors:n}=await (0,d.Ve)(e);if(n.length>0)throw n;let{errors:i,mocks:o}=await (0,d.pL)({libraryID:e.from,sliceID:e.model.id});if(i.length>0)throw i;y({...e,mocks:o}),g(),null==t||t()})},[f,y,g]),w=(0,s.useMemo)(()=>({actionQueueStatus:v,slice:r,setSlice:b,variation:j}),[v,r,b,j]);return(0,i.jsx)(h.Provider,{value:w,children:"function"==typeof t?t(w):t})}function v(){let e=(0,s.useContext)(h);if(!e)throw Error("SliceBuilderProvider not found");return e}var f=n(44570),x=n(38392),y=n(23335),g=n(6697),j=n(30988),b=n(18566),w=n(70647);async function C(e){let{errors:t,model:n}=await w.j.customTypes.readCustomType({id:e});if(t.length>0)throw t;return n}var I=n(63447),S=n(5813),k=n(10635);let T=e=>(0,i.jsxs)("svg",{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"})]}),R=()=>{let{source:e}=(0,S.l)(),t=function(e){let t=(0,I.Ag)(e.query);return void 0!==t&&(0,I.ne)(e.asPath,t)?t:void 0}(e);return void 0!==t?(0,i.jsx)(j.S,{children:(0,i.jsx)(s.Suspense,{children:(0,i.jsx)(x.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(E,{sourceCustomTypeId:t})})})}):null},E=e=>{let{sourceCustomTypeId:t}=e,n=(0,b.QT)(C,[t]),[o,r]=(0,s.useState)(!0),l=(0,a.useRouter)();if(void 0===n||!o)return null;{let{format:e,id:t}=n,o=I.cd[e].getBuilderPagePathname(t);return(0,i.jsxs)(x.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(x.zx,{onClick:()=>{l.push(o)},renderStartIcon:()=>(0,i.jsx)(T,{}),children:["Return to ",n.label]}),(0,i.jsx)(x.zx,{onClick:()=>{r(!1)},renderStartIcon:()=>(0,i.jsx)(k.T,{})})]})}};var A=n(28948),D=n(56580),L=n(33710),N=n(99044);let O=e=>(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 16C23 19.866 19.866 23 16 23C12.134 23 9 19.866 9 16C9 12.134 12.134 9 16 9C19.866 9 23 12.134 23 16ZM24 16C24 20.4183 20.4183 24 16 24C11.5817 24 8 20.4183 8 16C8 11.5817 11.5817 8 16 8C20.4183 8 24 11.5817 24 16ZM14.75 18.5981L18.5 16L14.75 13.4019V18.5981Z",fill:"currentColor"})});var F=n(17186),V=n(17467);let _=e=>{let{children:t,open:n,onClose:o}=e;return(0,i.jsxs)(N.zs,{open:n,trigger:t,onClose:o,children:[(0,i.jsx)(N.Ev,{children:"Simulate your slices"}),(0,i.jsx)(N.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:F.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:()=>{d.Xe.track({event:"open-video-tutorials",video:F.Sn})}}),(0,i.jsx)(N.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(N.Rp,{children:"Got it"})]})};var z=e=>{let{disabled:t}=e,n=(0,a.useRouter)(),o=(0,s.useRef)(null),{setSeenSimulatorToolTip:r}=(0,m.Z)(),{hasSeenSimulatorTooltip:l}=(0,D.v9)(e=>({hasSeenSimulatorTooltip:(0,V.bv)(e)}));(0,s.useEffect)(()=>{let e=o.current;e&&!l&&setTimeout(()=>L.Z.show(e),5e3)},[l]);let d=()=>{if(r(),o.current){let{current:e}=o;L.Z.hide(e)}};return(0,i.jsx)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:(0,i.jsx)(_,{open:!l,onClose:d,children:(0,i.jsx)(x.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:()=>{d(),window.open("".concat(n.asPath,"/simulator"),F.pq)},disabled:t,renderStartIcon:()=>(0,i.jsx)(O,{color:x.rS.color.grey1,height:"24px",style:{transform:"scale(calc(4 / 3))"},width:"24px"}),children:"Simulate"})})})},M=n(88866),P=n(28316),Z=n(88932),K=n(80775),q=n(3181),H=n(64602),B=n(18183),X=n(2439),G=n(80410),W=n(67875),U=n(85357),Y=n(99510),J=n(46622);let $=[W.C.Image,W.C.Text,W.C.StructuredText,W.C.Link,W.C.Select,W.C.Boolean,W.C.Number,W.C.Color,W.C.Date,W.C.Embed,W.C.Timestamp,W.C.GeoPoint,W.C.ContentRelationship,W.C.LinkToMedia],Q=[W.C.Group,...$];var ee=()=>{let{slice:e,setSlice:t,variation:n}=v(),[o,r]=(0,s.useState)(!1),a=!!(n.items&&Object.keys(n.items).length>0),l=i=>o=>{if(i===G.Rt.Items&&n.items&&Object.keys(n.items).length<=1){r(!0);return}t((0,q.AK)({slice:e,variationId:n.id,widgetArea:i,fieldId:o}))},c=(i,o)=>{let{apiId:r,newKey:a,value:l,isNewGroupField:s}=o;t((0,q.L4)({slice:e,variationId:n.id,widgetArea:i,previousFieldId:r,newFieldId:a,newField:l}),()=>{!0===s&&Z.Am.success("Group added")})},u=(i,o)=>{var r,a;let{apiId:l,value:s}=o,{type:c,config:u}=s,m=null!==(a=null==u?void 0:u.label)&&void 0!==a?a:"",h=Q.find(e=>e.CUSTOM_NAME===c||e.TYPE_NAME===c);if(!h)throw Error("Unsupported Field Type: ".concat(c));try{h.schema.validateSync(s,{stripUnknown:!1})}catch(e){throw Error('Model is invalid for widget "'.concat(s.type,'".'))}t((0,q.xS)({slice:e,variationId:n.id,widgetArea:i,newFieldId:l,newField:s.type===M.GroupFieldType?X.Fl.fromSM(s):s}),()=>{Z.Am.success("".concat("Group"===c?"Group":"Field"," added"))}),d.Xe.track({event:"field:added",id:l,name:m,type:s.type,isInAGroup:!1,contentType:(0,J.T)(window.location.pathname),..."Link"===s.type&&{allowText:null===(r=s.config)||void 0===r?void 0:r.allowText}})},m=e=>t=>""===t.apiId?u(e,{...t,apiId:t.newKey}):c(e,t),h=i=>o=>{if((0,U.uS)(o))return;let{source:r,destination:a}=o;if(!a)return;let l=(0,q.gR)({slice:e,variationId:n.id,widgetArea:i,sourceIndex:r.index,destinationIndex:a.index});(0,P.flushSync)(()=>t(l))};return(0,i.jsxs)(K.aV,{children:[(0,i.jsx)(B.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,title:"Fields",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:n.primary,EditModal:H.Z,widgetsArray:Q,onDeleteItem:l(G.Rt.Primary),onSave:m(G.Rt.Primary),onDragEnd:h(G.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:e=>{let{item:t}=e;return"slice.primary".concat((0,Y.Ti)(t.key))},renderFieldAccessor:e=>"slice.primary".concat((0,Y.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:void 0,emptyStateHeading:void 0}),a?(0,i.jsx)(B.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,isRepeatable:!0,title:"Repeatable Zone",dataTip:"The repeatable zone is for a group<br/>\n of fields that you want to be able to repeat an<br/>\n indeterminate number of times, like FAQs",widgetsArray:$,fields:n.items,EditModal:H.Z,onDeleteItem:l(G.Rt.Items),onSave:m(G.Rt.Items),onDragEnd:h(G.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:e=>{let{item:t}=e;return"item".concat((0,Y.Ti)(t.key))},renderFieldAccessor:e=>"slice.items[i]".concat((0,Y.Ti)(e)),testId:"slice-repeatable-zone",isRepeatableCustomType:void 0,emptyStateHeading:"No fields"}):null,(0,i.jsxs)(x.Vq,{size:"small",open:o,onOpenChange:e=>r(e),children:[(0,i.jsx)(x.fK,{icon:"delete",title:"Delete field"}),(0,i.jsxs)(x.cZ,{children:[(0,i.jsx)(x.xu,{padding:24,gap:12,flexDirection:"column",children:e.model.variations.length>1?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the ",e.model.name," slice ",n.name," variation."]}),(0,i.jsx)("div",{children:"Other variations will be left untouched. To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the ",e.model.name,"."]}),(0,i.jsx)("div",{children:"To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]})}),(0,i.jsxs)(x.kX,{children:[(0,i.jsx)(x.PO,{}),(0,i.jsx)(x._d,{color:"tomato",onClick:()=>{t((0,q.Oh)({slice:e,variationId:n.id})),r(!1)},children:"Delete"})]})]})]})]})},et=n(20659),en=n(53850),ei=n(89513),eo=n(76787);async function er(e){try{let{errors:t}=await (0,d.Ve)(e.component);if(t.length>0)throw t;let{errors:n}=await (0,d.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id});if(n.length>0)throw n;let{slice:i,errors:o}=await (0,d.X$)(e.component.from,e.component.model.id);if(o.length>0)throw o;if(!i)throw Error("Could not read variation `".concat(e.variation.name,"`"));let{mocks:r}=await (0,d.pL)({libraryID:e.component.from,sliceID:e.component.model.id}),a=ei.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:i.name,variationId:i.variations[0].id});await e.router.replace(a);let l={...e.component,model:i,mocks:r};return e.saveSliceSuccess(l),l}catch(n){let t="Could not delete variation `".concat(e.variation.name,"`");throw console.error(t,n),Z.Am.error(t),n}}let ea=e=>{let{isOpen:t,onClose:n,slice:o,variation:r}=e,l=(0,a.useRouter)(),[d,c]=(0,s.useState)(!1),{saveSliceSuccess:u}=(0,m.Z)(),{setSlice:h}=v();return(0,i.jsxs)(x.Vq,{open:t,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(x.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(x.cZ,{children:(0,i.jsxs)(x.xu,{flexDirection:"column",children:[(0,i.jsxs)(x.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)(el,{children:"not"})," affect your documents until you ",(0,i.jsx)(el,{children:"edit"})," ","them manually."]}),(0,i.jsxs)(x.kX,{children:[(0,i.jsx)(x.PO,{size:"medium"}),(0,i.jsx)(x._d,{size:"medium",color:"tomato",onClick:()=>{r&&(async()=>{c(!0);try{let e=await er({component:o,router:l,saveSliceSuccess:u,variation:r});h(e)}catch(e){}c(!1),n()})()},loading:d,children:"Delete"})]})]})})]})},el=e=>(0,i.jsx)(x.xv,{...e,color:"inherit",component:"span",variant:"bold"});var es=n(63397);async function ed(e){try{let{errors:t}=await (0,d.Ve)(e.component);if(t.length>0)throw t;let{errors:n}=await (0,d.eH)(e.component,{...e.variation,name:e.variationName});if(n.length>0)throw n;let{slice:i,errors:o}=await (0,d.X$)(e.component.from,e.component.model.id);if(o.length>0)throw o;if(!i)throw Error("Could not read variation `".concat(e.variation.name,"`"));let{mocks:r}=await (0,d.pL)({libraryID:e.component.from,sliceID:e.component.model.id}),a={...e.component,model:i,mocks:r};return e.saveSliceSuccess(a),a}catch(n){let t="Could not rename variation `".concat(e.variation.name,"`");throw console.error(t,n),Z.Am.error(t),n}}var ec=n(16387),eu=n.n(ec);let em=e=>{var t;let{isOpen:n,onClose:o,slice:r,variation:a}=e,[l,d]=(0,s.useState)(!1),{setSlice:c}=v(),{saveSliceSuccess:u}=(0,m.Z)();return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(x.Vq,{open:n,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,i.jsx)(x.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(x.cZ,{children:(0,i.jsx)(es.J9,{validateOnMount:!0,initialValues:{variationName:null!==(t=null==a?void 0:a.name)&&void 0!==t?t:""},validate:e=>{if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:async e=>{if(a){d(!0);try{let t=await ed({component:r,saveSliceSuccess:u,variation:a,variationName:e.variationName.trim()});c(t)}catch(e){}d(!1),o()}},children:e=>(0,i.jsxs)("form",{children:[(0,i.jsxs)(x.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(x.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)(x.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eu().label,children:[(0,i.jsx)(x.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(x.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(x.yt,{placeholder:"Variation name",error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:t=>void e.setFieldValue("variationName",t.slice(0,30))})]})]}),(0,i.jsxs)(x.kX,{children:[(0,i.jsx)(x.PO,{size:"medium"}),(0,i.jsx)(x._d,{size:"medium",onClick:()=>void e.submitForm(),loading:l,disabled:!e.isValid,children:"Rename"})]})]})})})]})})};var eh=n(39283),ep=n(96009),ev=n.n(ep),ef=n(36131),ex=n(75289),ey=n(76805),eg=e=>{let{children:t,FooterContent:n,HeaderContent:o,close:r,sx:a={},headerSx:l={}}=e;return(0,i.jsx)(ey.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:{border:"none",...a},Header:e=>{let{radius:t}=e;return(0,i.jsxs)(ex.kC,{sx:{p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)},...l},children:[o,r?(0,i.jsx)(ex.x8,{onClick:r,type:"button"}):null]})},Footer:n?(0,i.jsxs)(ex.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(ex.xu,{sx:{ml:"auto"}}),n]}):null,children:t})},ej=n(11104);let eb=e=>{let{msg:t}=e;return(0,i.jsx)(ex.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:t||"Error!"})};var ew=e=>{let{isOpen:t,onClose:n,onSubmit:o,initialVariation:r,variations:a}=e,[l,d]=(0,s.useState)({}),[c,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(!0),[p,v]=(0,s.useState)(""),[f,y]=(0,s.useState)({value:r.id,label:r.name}),[g,j]=(0,s.useState)(!1);function b(){w(),n()}function w(){u(""),v(""),d({}),h(!0),y({value:r.id,label:r.name})}async function C(){let e=function(e){let{id:t,name:n,origin:i}=e,o=t&&t.length?null:{id:"Required!"},r=a.find(e=>e.id===t)?{id:"This id already exists!"}:null,l=n&&n.length?null:{name:"Required!"},s=i.value.length&&a.find(e=>e.id===i.value)?null:{id:"You must select an existing variation!"},d=t&&t.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(t)&&{id:"No special characters allowed"};return{...o,...r,...l,...s,...d}}({id:c,name:p,origin:f});if(Object.keys(e).length)d(e);else{let e=a.find(e=>e.id===f.value);e&&(j(!0),await o(c,p,e),j(!1),b())}}return(0,s.useEffect)(()=>{w()},[r,t]),(0,i.jsx)(ej.Z,{isOpen:t,shouldCloseOnOverlayClick:!0,onRequestClose:()=>b(),contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(es.J9,{initialValues:{id:c,name:p,origin:f},onSubmit:C,children:(0,i.jsx)(es.l0,{id:"variation-add",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),C())},children:(0,i.jsx)(x.xu,{children:(0,i.jsxs)(eg,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(ex.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(x.xu,{gap:16,alignItems:"center",children:[(0,i.jsx)(x.zx,{onClick:b,color:"grey",children:"Cancel"}),(0,i.jsx)(x.zx,{loading:g,children:"Submit"})]}),close:b,children:[(0,i.jsxs)(x.xu,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(ex.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",l.name?(0,i.jsx)(eb,{msg:l.name}):""]}),(0,i.jsx)(es.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:ex.II,maxLength:30,value:p,onChange:e=>{var t;v(t=e.currentTarget.value),m&&u(ev()(t))}}),(0,i.jsx)(ex.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(x.xu,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(ex.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",l.id?(0,i.jsx)(eb,{msg:l.id}):""]}),(0,i.jsx)(es.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:ex.II,maxLength:30,value:c,onChange:e=>{var t;return t=e.currentTarget.value,void(h(!1),u(ev()(t)))}}),(0,i.jsx)(ex.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(x.xu,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(ex.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(ef.ZP,{name:"origin",options:a.map(e=>({value:e.id,label:e.name})),onChange:e=>{e&&y(e)},defaultValue:f,maxMenuHeight:150,theme:e=>({...e,colors:{...e.colors,text:"text",primary:"background"}})})]})]})})})})})},eC=n(828),eI=n.n(eC);let eS=e=>{let{horizontalScroll:t=!1}=e,{slice:n,variation:o,setSlice:r}=v(),[l,c]=(0,s.useState)(),u=(0,eo.H)(),{sliceFilterFn:h,defaultVariationSelector:p,onUploadSuccess:f}=u.modalPayload,y=(0,a.useRouter)(),{saveSliceSuccess:g}=(0,m.Z)(),j=n.model.variations.length;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.xu,{flexDirection:"column",gap:16,children:t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(et.i,{variant:"edgeFaded",color:"grey6"}),(0,i.jsxs)(x.xu,{justifyContent:"space-between",children:[(0,i.jsxs)(x.xv,{color:"grey11",children:[j," variation",1!==j&&"s"]}),(0,i.jsx)(x.zx,{onClick:()=>{c({type:"ADD_VARIATION"})},startIcon:"add",color:"grey",children:"Add a variation"})]}),(0,i.jsx)("div",{className:eI().hideScrollbar,style:{height:"240px",position:"relative",marginRight:"-32px",overflowX:"scroll",scrollSnapType:"x mandatory"},children:(0,i.jsx)("div",{style:{position:"absolute",paddingRight:"32px"},children:(0,i.jsx)(x.xu,{flexDirection:"row",gap:16,children:(0,i.jsx)(ek,{screenshotChangesModal:u,setDialog:c,width:320})})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ek,{screenshotChangesModal:u,setDialog:c}),(0,i.jsx)("div",{style:{bottom:x.rS.space[0],marginBottom:"-".concat(x.rS.space[16]),position:"sticky"},children:(0,i.jsxs)(x.xu,{backgroundColor:"grey2",flexDirection:"column",padding:{bottom:40,inline:24},children:[(0,i.jsx)(x.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(x.zx,{color:"grey",onClick:()=>{c({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},children:"Add a variation"})]})})]})}),(0,i.jsx)(eh.Z,{slices:h([n]),defaultVariationSelector:p,onUploadSuccess:f}),(0,i.jsx)(em,{isOpen:(null==l?void 0:l.type)==="RENAME_VARIATION",onClose:()=>{c(void 0)},slice:n,variation:null==l?void 0:l.variation}),(0,i.jsx)(ea,{isOpen:(null==l?void 0:l.type)==="DELETE_VARIATION",onClose:()=>{c(void 0)},slice:n,variation:null==l?void 0:l.variation}),(0,i.jsx)(ew,{initialVariation:o,isOpen:(null==l?void 0:l.type)==="ADD_VARIATION",onClose:()=>{c(void 0)},onSubmit:async(e,t,i)=>{try{let{slice:o,variation:a}=(0,q.Kp)({slice:n,id:e,name:t,copiedVariation:i});await (0,d.Ve)(o),g(o),r(o);let l=ei.Y.getBuilderPagePathname({libraryName:o.href,sliceName:o.model.name,variationId:a.id});y.replace(l)}catch(n){let e="Could not add variation `".concat(t,"`");console.error(e,n),Z.Am.error(e)}},variations:n.model.variations})]})},ek=e=>{let{screenshotChangesModal:t,setDialog:n,width:o}=e,{slice:r,variation:a,setSlice:l}=v(),s={scrollSnapAlign:"start"};return(0,i.jsx)(i.Fragment,{children:r.model.variations.map(e=>(0,i.jsx)("div",{style:void 0!==o?{...s,width:o}:s,children:(0,i.jsx)(en.b,{action:{type:"menu",onRename:()=>{n({type:"RENAME_VARIATION",variation:e})},onRemove:()=>{n({type:"DELETE_VARIATION",variation:e})},removeDisabled:r.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:()=>{t.onOpenModal({sliceFilterFn:e=>e,defaultVariationSelector:{sliceID:r.model.id,variationID:e.id},onUploadSuccess:e=>{l(e)}})},replace:!0,selected:e.id===a.id,slice:r,variant:"outlined",variationId:e.id},e.id)},e.id))})};var eT=()=>{let{slice:e,actionQueueStatus:t}=v(),n=(0,x.ac)({max:"large"});return(0,i.jsxs)(A.LN,{children:[(0,i.jsxs)(A.wd,{children:[(0,i.jsx)(A.Xq,{url:"/slices"}),(0,i.jsxs)(A.Cx,{children:[(0,i.jsx)(y.g,{children:"Slices"}),(0,i.jsx)(y.g,{active:!0,children:e.model.name})]}),(0,i.jsxs)(A.K2,{children:[(0,i.jsx)(g.X,{status:t}),(0,i.jsx)(z,{disabled:"done"!==t})]})]}),(0,i.jsxs)(A.RN,{children:[(0,i.jsxs)(x.xu,{display:"grid",alignItems:"flex-start",gap:16,...n?{gridTemplateRows:"304px 1fr"}:{gridTemplateColumns:"320px 1fr"},children:[(0,i.jsx)(eS,{horizontalScroll:n}),(0,i.jsx)(ee,{})]}),(0,i.jsx)(R,{})]})]})};function eR(){let e=(0,a.useRouter)(),{slice:t,variation:n}=(0,f.Z)();return void 0===t||void 0===n?(e.replace("/"),null):(0,i.jsx)(p,{initialSlice:t,children:e=>{let{slice:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsxs)("title",{children:[t.model.name," - Slice Machine"]})}),(0,i.jsx)(eT,{})]})}})}},16387:function(e){e.exports={label:"RenameVariationModal_label__LI5jL"}},828:function(e){e.exports={hideScrollbar:"VariationsList_hideScrollbar__cHCIS"}},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return j}});var i=n(2784);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n(52322);var r=["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,t){return void 0===t&&(t=","),e.split(t)}function d(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return l(e)}),a={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},s=i.filter(function(e){return!r.includes(e)});return o({},a,{keys:s,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&m([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&h([l(e.key),l(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){c.clear()});var c=new Set;function u(e){return Array.isArray(e)}function m(e){var t=Array.isArray(e)?e:[e];c.has("meta")&&c.forEach(function(e){return!r.includes(e)&&c.delete(e.toLowerCase())}),t.forEach(function(e){return c.add(e.toLowerCase())})}function h(e){var t=Array.isArray(e)?e:[e];"meta"===e?c.clear():t.forEach(function(e){return c.delete(e.toLowerCase())})}function p(e,t){var n=e.target;void 0===t&&(t=!1);var i=n&&n.tagName;return u(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i.toLowerCase()})):!!(i&&t&&!0===t)}var v=function(e,t,n){void 0===n&&(n=!1);var i,o=t.alt,r=t.meta,a=t.mod,s=t.shift,d=t.ctrl,m=t.keys,h=e.key,p=e.code,v=e.ctrlKey,f=e.metaKey,x=e.shiftKey,y=e.altKey,g=l(p),j=h.toLowerCase();if(!n){if(!y===o&&"alt"!==j||!x===s&&"shift"!==j)return!1;if(a){if(!f&&!v)return!1}else if(!f===r&&"meta"!==j&&"os"!==j||!v===d&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(g)))||(m?(void 0===i&&(i=","),(u(m)?m:m.split(i)).every(function(e){return c.has(e.trim().toLowerCase())})):!m)},f=(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 j(e,t,n,o){var r,a=(0,i.useRef)(null),c=(0,i.useRef)(!1),j=n instanceof Array?o instanceof Array?void 0:o:n,b=u(e)?e.join(null==j?void 0:j.splitKey):e,w=n instanceof Array?n:o instanceof Array?o:void 0,C=(0,i.useCallback)(t,null!=w?w:[]),I=(0,i.useRef)(C);w?I.current=C:I.current=t;var S=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(i,o){return i&&e(t[o],n[o])},!0):t===n}((r=(0,i.useRef)(void 0)).current,j)&&(r.current=j),r.current),k=(0,i.useContext)(x).enabledScopes,T=(0,i.useContext)(f);return g(function(){if((null==S?void 0:S.enabled)!==!1&&(e=null==S?void 0:S.scopes,0===k.length&&e?(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):!!(!e||k.some(function(t){return e.includes(t)})||k.includes("*")))){var e,t=function(e,t){var n;if(void 0===t&&(t=!1),!(p(e,["input","textarea","select"])&&!p(e,null==S?void 0:S.enableOnFormTags)||null!=S&&null!=S.ignoreEventWhen&&S.ignoreEventWhen(e))){if(null!==a.current&&document.activeElement!==a.current&&!a.current.contains(document.activeElement)){y(e);return}(null==(n=e.target)||!n.isContentEditable||null!=S&&S.enableOnContentEditable)&&s(b,null==S?void 0:S.splitKey).forEach(function(n){var i,o,r,a=d(n,null==S?void 0:S.combinationKey);if(v(e,a,null==S?void 0:S.ignoreModifiers)||null!=(r=a.keys)&&r.includes("*")){if(t&&c.current)return;if(("function"==typeof(i=null==S?void 0:S.preventDefault)&&i(e,a)||!0===i)&&e.preventDefault(),"function"==typeof(o=null==S?void 0:S.enabled)?!o(e,a):!0!==o&&void 0!==o){y(e);return}I.current(e,a),t||(c.current=!0)}})}},n=function(e){void 0!==e.key&&(m(l(e.code)),((null==S?void 0:S.keydown)===void 0&&(null==S?void 0:S.keyup)!==!0||null!=S&&S.keydown)&&t(e))},i=function(e){void 0!==e.key&&(h(l(e.code)),c.current=!1,null!=S&&S.keyup&&t(e,!0))},o=a.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",i),o.addEventListener("keydown",n),T&&s(b,null==S?void 0:S.splitKey).forEach(function(e){return T.addHotkey(d(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))}),function(){o.removeEventListener("keyup",i),o.removeEventListener("keydown",n),T&&s(b,null==S?void 0:S.splitKey).forEach(function(e){return T.removeHotkey(d(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))})}}},[b,S,k]),a}}},function(e){e.O(0,[898,789,917,525,461,139,183,588,349,772,882,639,888,774,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,t,n){var i=n(34311),r=n(23779),o=i(function(e,t,n){return e+(n?" ":"")+r(t)});e.exports=o},26688:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return n(20713)}])},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var i=n(52322),r=n(2784),o=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",a=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},s=(0,r.forwardRef)((e,t)=>{let{label:n,Icon:r,type:s,form:c,isLoading:d=!1,disabled:u=!1,onClick:m,sx:x={},iconSize:f=16,iconFill:p,variant:h="primary",...v}=e;return(0,i.jsx)(o.zx,{ref:t,sx:{...x,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:s,form:c,disabled:u||d,onClick:d?void 0:m,variant:h,...v,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.$j,{size:f,color:a(h),"data-testid":l(v["data-testid"],"spinner")}),r&&n]}):(0,i.jsxs)(i.Fragment,{children:[r&&(0,i.jsx)(r,{size:f,fill:p,"data-testid":l(v["data-testid"],"icon")}),n]})})})},17889:function(e,t,n){"use strict";n.d(t,{c:function(){return y}});var i=n(52322),r=n(2784),o=n(36131),l=n(75289),a=n(93188),s=n(88932),c=n(3181),d=n(99510),u=n(70647);async function m(e){let{sliceName:t,libraryName:n,onSuccess:i}=e;try{let e=(0,c.fo)(t),{errors:r}=await u.j.slices.createSlice({libraryID:n,model:e});if(r.length>0)throw r;a.Xe.track({event:"slice:created",id:(0,d.MP)(t),name:t,library:n}),await i(e)}catch(n){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,n),s.Am.error(e)}}var x=n(80546),f=n(1490),p=n(41067),h=n(28801),v=n(99923);let y=e=>{let{onClose:t,onSuccess:n,localLibraries:s,remoteSlices:c}=e,{createSliceSuccess:d}=(0,p.Z)(),[u,y]=(0,r.useState)(!1),{syncChanges:g}=(0,x.g)(),b=async e=>{let t=e.sliceName,i=e.from;y(!0),await m({sliceName:t,libraryName:i,onSuccess:async e=>{d((await (0,a.y0)()).libraries),n(e,i),g()}})};return(0,i.jsx)(f.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:u,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{b(e)},initialValues:{sliceName:"",from:s[0].name},validate:e=>(0,v.h)(e,s,c,"create"),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:n,setFieldValue:r,errors:a}=e;return(0,i.jsxs)(l.xu,{children:[(0,i.jsx)(h.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?a.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(l.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(o.ZP,{name:"from",options:s.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void r("from",e.value):null,defaultValue:{value:n.from,label:n.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},28801:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var i=n(52322),r=n(63397);n(2784);var o=n(75289);let l=e=>{let{name:t,label:n,placeholder:l,error:a,testId:s,onChange:c}=e;return(0,i.jsxs)(o.xu,{mb:3,children:[(0,i.jsx)(o.__,{htmlFor:t,mb:2,children:n}),(0,i.jsx)(r.gN,{name:t,type:"text",placeholder:l,as:o.II,autoComplete:"off",...c?{onChange:c}:null,...s?{"data-testid":s}:null}),a?(0,i.jsx)(o.xv,{"data-testid":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},99923:function(e,t,n){"use strict";n.d(t,{h:function(){return c}});var i=n(96009),r=n.n(i),o=n(74600),l=n.n(o),a=n(93188),s=n(17186);function c(e,t,n,i){let{sliceName:o}=e;return o?s.xo.exec(o)?l()(r()(o)).replace(/\s/gm,"")!==o.trim()?(a.Xe.track({event:"slice-name-error:pascal-case",errorType:i}),{sliceName:"Value has to be PascalCased"}):o.match(/^\d/)?{sliceName:"Value cannot start with a number"}:s.lS.includes(o)?{sliceName:"".concat(o," is reserved for Slice Machine use")}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...n.map(e=>e.name)].includes(o)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed"}:{sliceName:"Cannot be empty"}}},42849:function(e,t,n){"use strict";var i=n(52322),r=n(75289);t.Z=function(e){let{elems:t,renderElem:n,defineElementKey:o,gridTemplateMinPx:l="320px",gridGap:a="16px",sx:s}=e;return(0,i.jsx)(r.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(l,", 1fr))"),gridGap:a,pt:2,...s},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:n(e,t)},"".concat(o(e),"-").concat(t+1)):null)})}},1490:function(e,t,n){"use strict";var i=n(52322),r=n(63397),o=n(37149),l=n.n(o),a=n(75289),s=n(47861),c=n(11104),d=n(76805);t.Z=function(e){let{children:t,close:n,isOpen:o,formId:u,validate:m,onSubmit:x,widthInPx:f,initialValues:p,content:{title:h},cardProps:v,omitFooter:y=!1,isLoading:g=!1,buttonLabel:b="Save",testId:j,actionMessage:k}=e;return l().setAppElement("#__next"),(0,i.jsx)(c.Z,{isOpen:o,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:h,style:{content:{width:null!=f?f:"900px"}},children:(0,i.jsx)(r.J9,{initialValues:p,validate:e=>m?m(e):void 0,onSubmit:e=>{x(e)},children:e=>{let{isValid:o,isSubmitting:l,values:c,errors:m,touched:x,setFieldValue:f,setValues:p}=e;return(0,i.jsx)(r.l0,{id:u,...null!=j?{"data-testid":j}:null,children:(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"},...v,Header:e=>{let{radius:t}=e;return(0,i.jsxs)(a.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:[(0,i.jsx)(a.X6,{sx:{fontSize:"20px"},children:h}),(0,i.jsx)(a.x8,{type:"button",onClick:n})]})},Footer:y?null:(0,i.jsxs)(a.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(a.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof k?k(e):k}),(0,i.jsxs)(a.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||g,children:"Cancel"}),(0,i.jsx)(s.z,{label:b,form:u,type:"submit",disabled:!o||l||g,isLoading:l||g,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:o,isSubmitting:l,values:c,errors:m,touched:x,setFieldValue:f,setValues:p})})})}})})}},20713:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=n(52322),r=n(33760),o=n(97729),l=n.n(o),a=n(5632),s=n(2784),c=n(56580),d=n(88932),u=n(65077),m=n(75289),x=n(23335),f=n(53850),p=n(89513),h=n(76787),v=n(28948),y=n(65186),g=n(59326),b=n(70647);async function j(e){let{sliceName:t,sliceID:n,libraryID:i,onSuccess:r}=e;try{let{errors:e}=await b.j.slices.deleteSlice({libraryID:i,sliceID:n});if(e.length>0)throw e;r(),d.Am.success("Successfully deleted slice “".concat(t,"”"))}catch(n){let e="An unexpected error happened while deleting slice “".concat(t,"”.");console.error(e,n),d.Am.error(e)}}var k=n(80546),w=n(47861),S=n(76805),C=n(11104),I=n(41067);let L=e=>{let{sliceId:t,sliceName:n,libName:r,isOpen:o,onClose:l}=e,[a,c]=(0,s.useState)(!1),{deleteSliceSuccess:d}=(0,I.Z)(),{syncChanges:u}=(0,k.g)(),{theme:x}=(0,g.B7)(),f=async()=>{c(!0),await j({sliceID:t,sliceName:n,libraryID:r,onSuccess:()=>{d(t,r),u()}}),l(),c(!1)};return(0,i.jsx)(C.Z,{isOpen:o,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,i.jsx)(S.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:()=>{var e;return(0,i.jsxs)(m.kC,{sx:{position:"sticky",background:"gray",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(m.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(y.$vK,{size:20,color:null===(e=x.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsx)(m.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,i.jsx)(m.x8,{type:"button",onClick:l})]})},Footer:()=>(0,i.jsxs)(m.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(w.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(w.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:()=>{f()}})]}),children:(0,i.jsxs)(m.nv,{children:["This action will immediately make the following changes:",(0,i.jsxs)("ul",{children:[(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(m.xv,{sx:{fontWeight:"bold"},children:[r,"/",n,"/"]})," ","directory."]}),(0,i.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,i.jsx)("ul",{children:(0,i.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."]})})})};var N=n(36887),E=n(93188),A=e=>{let{title:t,onCreateNew:n,buttonText:r,documentationComponent:o,videoPublicIdUrl:l,...a}=e;return(0,i.jsxs)(m.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},...a,children:[(0,i.jsx)(m.xu,{sx:e=>{var t;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:(0,i.jsx)(N.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:()=>{E.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,i.jsxs)(m.xu,{sx:e=>{var t;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,i.jsxs)(m.xu,{sx:e=>{var t;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:[(0,i.jsx)(m.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:t}),(0,i.jsx)(m.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,i.jsxs)(m.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,i.jsx)(m.zx,{onClick:n,"data-testid":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:r}),(0,i.jsx)(m.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"})]})]})]})},R=n(17889),P=n(3181),O=n(80410);async function z(e){let{slice:t,newSliceName:n,onSuccess:i}=e;try{let e=(0,P.PQ)(t,n),{errors:r}=await b.j.slices.renameSlice({libraryID:t.from,model:O.id.fromSM(e.model)});if(r.length>0)throw r;i(e),d.Am.success("Slice name updated")}catch(n){let e="An unexpected error happened while renaming “".concat(t.model.name,"”.");console.error(e,n),d.Am.error(e)}}var W=n(68916),_=n(1490),D=n(28801),T=n(99923);let Z=e=>{var t,n;let{slice:r,isOpen:o,onClose:l}=e,{renameSliceSuccess:a}=(0,I.Z)(),{syncChanges:s}=(0,k.g)(),{localLibs:d,remoteLibs:u}=(0,c.v9)(e=>({localLibs:(0,W.Sd)(e),remoteLibs:(0,W.sT)(e)})),x=null!==(t=null==r?void 0:r.model.name)&&void 0!==t?t:"",f=async e=>{r&&(await z({slice:r,newSliceName:e.sliceName,onSuccess:e=>{a(e.from,e.model),s()}}),l())};return(0,i.jsx)(_.Z,{testId:"rename-slice-modal",isOpen:o,widthInPx:"530px",formId:"rename-slice-modal-".concat(null!==(n=null==r?void 0:r.model.id)&&void 0!==n?n:""),close:l,buttonLabel:"Rename",onSubmit:e=>void f(e),initialValues:{sliceName:x},content:{title:"Rename a slice"},validate:e=>(0,T.h)(e,d,u,"update"),children:e=>{let{touched:t,errors:n}=e;return(0,i.jsx)(m.xu,{children:(0,i.jsx)(D.W,{name:"sliceName",label:"Slice Name","data-testid":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?n.sliceName:void 0,testId:"slice-name-input"})})}})};var F=n(42849),K=n(39283),B=n(91133),H=n(17186),M=()=>{var e,t,n;let o=(0,a.useRouter)(),{modalPayload:y,onOpenModal:g}=(0,h.H)(),{sliceFilterFn:b,defaultVariationSelector:j}=y,{remoteSlices:k,libraries:w}=(0,c.v9)(e=>({remoteSlices:(0,W.sT)(e),libraries:(0,W.Sd)(e)})),[S,C]=(0,s.useState)(!1),[I,N]=(0,s.useState)(!1),[E,P]=(0,s.useState)(!1),O=w.filter(e=>e.isLocal),z=w.map(e=>(e.components=[...e.components].sort((e,t)=>e.model.name.localeCompare(t.model.name)),e)),_=(w||[]).map(e=>e.components).flat(),D=_.length,[T,M]=(0,s.useState)(),X=()=>{N(!0)},V=()=>{P(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Slices - Slice Machine"})}),(0,i.jsxs)(v.LN,{children:[(0,i.jsxs)(v.wd,{children:[(0,i.jsx)(v.Cx,{children:(0,i.jsx)(x.g,{children:"Slices"})}),(null==O?void 0:O.length)!==0&&0!==D?(0,i.jsx)(v.K2,{children:(0,i.jsx)(r.zx,{"data-testid":"create-slice",onClick:()=>{C(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,i.jsxs)(v.RN,{children:[(0,i.jsx)(u.xR,{sx:{display:"flex",flexDirection:"column"},children:z.length>0?(0,i.jsx)(m.kC,{sx:{flex:1,flexDirection:"column"},children:0===D?(0,i.jsx)(m.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(A,{title:"What are Slices?",onCreateNew:()=>{C(!0)},buttonText:"Create one",videoPublicIdUrl:H.rd,documentationComponent:(0,i.jsxs)(i.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,i.jsx)(m.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:e=>{var t;return{color:null==e?void 0:null===(t=e.colors)||void 0===t?void 0:t.primary}},children:"Learn more"}),"."]}),"data-testid":"slices-table-blank-slate"})}):z.map(e=>{let{name:t,isLocal:n,components:r}=e;return(0,i.jsxs)(m.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,i.jsxs)(m.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(m.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,i.jsx)(m.xv,{children:t})}),!n&&(0,i.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,i.jsx)(F.Z,{elems:r,defineElementKey:e=>e.model.name,renderElem:e=>(0,i.jsx)(f.b,{action:{type:"menu",onRemove:()=>{M(e),X()},onRename:()=>{M(e),V()}},mode:"navigation",onUpdateScreenshot:()=>{g({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"}),gridGap:"32px 16px"})]},t)})}):void 0}),(null==O?void 0:O.length)>0&&(0,i.jsx)(K.Z,{slices:b(_),defaultVariationSelector:j}),(null==O?void 0:O.length)>0&&S&&(0,i.jsx)(R.c,{localLibraries:O,remoteSlices:k,onSuccess:(e,t)=>{let n=e.variations[0].id,i=p.Y.getBuilderPagePathname({libraryName:t,sliceName:e.name,variationId:n});o.push(i),d.Am.success((0,B.kQ)({path:"".concat(t,"/").concat(e.name,"/model.json")}))},onClose:()=>{C(!1)}}),(0,i.jsx)(Z,{isOpen:E,slice:T,onClose:()=>{P(!1)},"data-testid":"rename-slice-modal"}),(0,i.jsx)(L,{isOpen:I,libName:null!==(e=null==T?void 0:T.from)&&void 0!==e?e:"",sliceId:null!==(t=null==T?void 0:T.model.id)&&void 0!==t?t:"",sliceName:null!==(n=null==T?void 0:T.model.name)&&void 0!==n?n:"",onClose:()=>{N(!1)}})]})]})]})}},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return b}});var i=n(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n(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 s(e,t){return void 0===t&&(t=","),e.split(t)}function c(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return a(e)}),l={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},s=i.filter(function(e){return!o.includes(e)});return r({},l,{keys:s,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&m([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&x([a(e.key),a(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){d.clear()});var d=new Set;function u(e){return Array.isArray(e)}function m(e){var t=Array.isArray(e)?e:[e];d.has("meta")&&d.forEach(function(e){return!o.includes(e)&&d.delete(e.toLowerCase())}),t.forEach(function(e){return d.add(e.toLowerCase())})}function x(e){var t=Array.isArray(e)?e:[e];"meta"===e?d.clear():t.forEach(function(e){return d.delete(e.toLowerCase())})}function f(e,t){var n=e.target;void 0===t&&(t=!1);var i=n&&n.tagName;return u(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i.toLowerCase()})):!!(i&&t&&!0===t)}var p=function(e,t,n){void 0===n&&(n=!1);var i,r=t.alt,o=t.meta,l=t.mod,s=t.shift,c=t.ctrl,m=t.keys,x=e.key,f=e.code,p=e.ctrlKey,h=e.metaKey,v=e.shiftKey,y=e.altKey,g=a(f),b=x.toLowerCase();if(!n){if(!y===r&&"alt"!==b||!v===s&&"shift"!==b)return!1;if(l){if(!h&&!p)return!1}else if(!h===o&&"meta"!==b&&"os"!==b||!p===c&&"ctrl"!==b&&"control"!==b)return!1}return!!(m&&1===m.length&&(m.includes(b)||m.includes(g)))||(m?(void 0===i&&(i=","),(u(m)?m:m.split(i)).every(function(e){return d.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()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,t,n,r){var o,l=(0,i.useRef)(null),d=(0,i.useRef)(!1),b=n instanceof Array?r instanceof Array?void 0:r:n,j=u(e)?e.join(null==b?void 0:b.splitKey):e,k=n instanceof Array?n:r instanceof Array?r:void 0,w=(0,i.useCallback)(t,null!=k?k:[]),S=(0,i.useRef)(w);k?S.current=w:S.current=t;var C=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(i,r){return i&&e(t[r],n[r])},!0):t===n}((o=(0,i.useRef)(void 0)).current,b)&&(o.current=b),o.current),I=(0,i.useContext)(v).enabledScopes,L=(0,i.useContext)(h);return g(function(){if((null==C?void 0:C.enabled)!==!1&&(e=null==C?void 0:C.scopes,0===I.length&&e?(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):!!(!e||I.some(function(t){return e.includes(t)})||I.includes("*")))){var e,t=function(e,t){var n;if(void 0===t&&(t=!1),!(f(e,["input","textarea","select"])&&!f(e,null==C?void 0:C.enableOnFormTags)||null!=C&&null!=C.ignoreEventWhen&&C.ignoreEventWhen(e))){if(null!==l.current&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){y(e);return}(null==(n=e.target)||!n.isContentEditable||null!=C&&C.enableOnContentEditable)&&s(j,null==C?void 0:C.splitKey).forEach(function(n){var i,r,o,l=c(n,null==C?void 0:C.combinationKey);if(p(e,l,null==C?void 0:C.ignoreModifiers)||null!=(o=l.keys)&&o.includes("*")){if(t&&d.current)return;if(("function"==typeof(i=null==C?void 0:C.preventDefault)&&i(e,l)||!0===i)&&e.preventDefault(),"function"==typeof(r=null==C?void 0:C.enabled)?!r(e,l):!0!==r&&void 0!==r){y(e);return}S.current(e,l),t||(d.current=!0)}})}},n=function(e){void 0!==e.key&&(m(a(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&t(e))},i=function(e){void 0!==e.key&&(x(a(e.code)),d.current=!1,null!=C&&C.keyup&&t(e,!0))},r=l.current||(null==b?void 0:b.document)||document;return r.addEventListener("keyup",i),r.addEventListener("keydown",n),L&&s(j,null==C?void 0:C.splitKey).forEach(function(e){return L.addHotkey(c(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))}),function(){r.removeEventListener("keyup",i),r.removeEventListener("keydown",n),L&&s(j,null==C?void 0:C.splitKey).forEach(function(e){return L.removeHotkey(c(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))})}}},[j,C,I]),l}}},function(e){e.O(0,[898,789,50,772,639,888,774,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,t,n){var i=n(34311),r=n(23779),o=i(function(e,t,n){return e+(n?" ":"")+r(t)});e.exports=o},26688:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return n(20713)}])},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var i=n(52322),r=n(2784),o=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",a=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},s=(0,r.forwardRef)((e,t)=>{let{label:n,Icon:r,type:s,form:c,isLoading:d=!1,disabled:u=!1,onClick:m,sx:x={},iconSize:f=16,iconFill:p,variant:h="primary",...v}=e;return(0,i.jsx)(o.zx,{ref:t,sx:{...x,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:s,form:c,disabled:u||d,onClick:d?void 0:m,variant:h,...v,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.$j,{size:f,color:a(h),"data-testid":l(v["data-testid"],"spinner")}),r&&n]}):(0,i.jsxs)(i.Fragment,{children:[r&&(0,i.jsx)(r,{size:f,fill:p,"data-testid":l(v["data-testid"],"icon")}),n]})})})},17889:function(e,t,n){"use strict";n.d(t,{c:function(){return y}});var i=n(52322),r=n(2784),o=n(36131),l=n(75289),a=n(93188),s=n(88932),c=n(3181),d=n(99510),u=n(70647);async function m(e){let{sliceName:t,libraryName:n,onSuccess:i}=e;try{let e=(0,c.fo)(t),{errors:r}=await u.j.slices.createSlice({libraryID:n,model:e});if(r.length>0)throw r;a.Xe.track({event:"slice:created",id:(0,d.MP)(t),name:t,library:n}),await i(e)}catch(n){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,n),s.Am.error(e)}}var x=n(80546),f=n(1490),p=n(41067),h=n(28801),v=n(99923);let y=e=>{let{onClose:t,onSuccess:n,localLibraries:s,remoteSlices:c}=e,{createSliceSuccess:d}=(0,p.Z)(),[u,y]=(0,r.useState)(!1),{syncChanges:g}=(0,x.g)(),b=async e=>{let t=e.sliceName,i=e.from;y(!0),await m({sliceName:t,libraryName:i,onSuccess:async e=>{d((await (0,a.y0)()).libraries),n(e,i),g()}})};return(0,i.jsx)(f.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:u,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{b(e)},initialValues:{sliceName:"",from:s[0].name},validate:e=>(0,v.h)(e,s,c,"create"),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:n,setFieldValue:r,errors:a}=e;return(0,i.jsxs)(l.xu,{children:[(0,i.jsx)(h.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?a.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(l.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(o.ZP,{name:"from",options:s.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void r("from",e.value):null,defaultValue:{value:n.from,label:n.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},28801:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var i=n(52322),r=n(63397);n(2784);var o=n(75289);let l=e=>{let{name:t,label:n,placeholder:l,error:a,testId:s,onChange:c}=e;return(0,i.jsxs)(o.xu,{mb:3,children:[(0,i.jsx)(o.__,{htmlFor:t,mb:2,children:n}),(0,i.jsx)(r.gN,{name:t,type:"text",placeholder:l,as:o.II,autoComplete:"off",...c?{onChange:c}:null,...s?{"data-testid":s}:null}),a?(0,i.jsx)(o.xv,{"data-testid":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},99923:function(e,t,n){"use strict";n.d(t,{h:function(){return c}});var i=n(96009),r=n.n(i),o=n(74600),l=n.n(o),a=n(93188),s=n(17186);function c(e,t,n,i){let{sliceName:o}=e;return o?s.xo.exec(o)?l()(r()(o)).replace(/\s/gm,"")!==o.trim()?(a.Xe.track({event:"slice-name-error:pascal-case",errorType:i}),{sliceName:"Value has to be PascalCased"}):o.match(/^\d/)?{sliceName:"Value cannot start with a number"}:s.lS.includes(o)?{sliceName:"".concat(o," is reserved for Slice Machine use")}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...n.map(e=>e.name)].includes(o)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed"}:{sliceName:"Cannot be empty"}}},42849:function(e,t,n){"use strict";var i=n(52322),r=n(75289);t.Z=function(e){let{elems:t,renderElem:n,defineElementKey:o,gridTemplateMinPx:l="320px",gridGap:a="16px",sx:s}=e;return(0,i.jsx)(r.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(l,", 1fr))"),gridGap:a,pt:2,...s},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:n(e,t)},"".concat(o(e),"-").concat(t+1)):null)})}},1490:function(e,t,n){"use strict";var i=n(52322),r=n(63397),o=n(37149),l=n.n(o),a=n(75289),s=n(47861),c=n(11104),d=n(76805);t.Z=function(e){let{children:t,close:n,isOpen:o,formId:u,validate:m,onSubmit:x,widthInPx:f,initialValues:p,content:{title:h},cardProps:v,omitFooter:y=!1,isLoading:g=!1,buttonLabel:b="Save",testId:j,actionMessage:k}=e;return l().setAppElement("#__next"),(0,i.jsx)(c.Z,{isOpen:o,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:h,style:{content:{width:null!=f?f:"900px"}},children:(0,i.jsx)(r.J9,{initialValues:p,validate:e=>m?m(e):void 0,onSubmit:e=>{x(e)},children:e=>{let{isValid:o,isSubmitting:l,values:c,errors:m,touched:x,setFieldValue:f,setValues:p}=e;return(0,i.jsx)(r.l0,{id:u,...null!=j?{"data-testid":j}:null,children:(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"},...v,Header:e=>{let{radius:t}=e;return(0,i.jsxs)(a.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:[(0,i.jsx)(a.X6,{sx:{fontSize:"20px"},children:h}),(0,i.jsx)(a.x8,{type:"button",onClick:n})]})},Footer:y?null:(0,i.jsxs)(a.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(a.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof k?k(e):k}),(0,i.jsxs)(a.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||g,children:"Cancel"}),(0,i.jsx)(s.z,{label:b,form:u,type:"submit",disabled:!o||l||g,isLoading:l||g,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:o,isSubmitting:l,values:c,errors:m,touched:x,setFieldValue:f,setValues:p})})})}})})}},20713:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=n(52322),r=n(38392),o=n(97729),l=n.n(o),a=n(5632),s=n(2784),c=n(56580),d=n(88932),u=n(65077),m=n(75289),x=n(23335),f=n(53850),p=n(89513),h=n(76787),v=n(28948),y=n(65186),g=n(59326),b=n(70647);async function j(e){let{sliceName:t,sliceID:n,libraryID:i,onSuccess:r}=e;try{let{errors:e}=await b.j.slices.deleteSlice({libraryID:i,sliceID:n});if(e.length>0)throw e;r(),d.Am.success("Successfully deleted slice “".concat(t,"”"))}catch(n){let e="An unexpected error happened while deleting slice “".concat(t,"”.");console.error(e,n),d.Am.error(e)}}var k=n(80546),w=n(47861),S=n(76805),C=n(11104),I=n(41067);let L=e=>{let{sliceId:t,sliceName:n,libName:r,isOpen:o,onClose:l}=e,[a,c]=(0,s.useState)(!1),{deleteSliceSuccess:d}=(0,I.Z)(),{syncChanges:u}=(0,k.g)(),{theme:x}=(0,g.B7)(),f=async()=>{c(!0),await j({sliceID:t,sliceName:n,libraryID:r,onSuccess:()=>{d(t,r),u()}}),l(),c(!1)};return(0,i.jsx)(C.Z,{isOpen:o,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,i.jsx)(S.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:()=>{var e;return(0,i.jsxs)(m.kC,{sx:{position:"sticky",background:"gray",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(m.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(y.$vK,{size:20,color:null===(e=x.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsx)(m.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,i.jsx)(m.x8,{type:"button",onClick:l})]})},Footer:()=>(0,i.jsxs)(m.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(w.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(w.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:()=>{f()}})]}),children:(0,i.jsxs)(m.nv,{children:["This action will immediately make the following changes:",(0,i.jsxs)("ul",{children:[(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(m.xv,{sx:{fontWeight:"bold"},children:[r,"/",n,"/"]})," ","directory."]}),(0,i.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,i.jsx)("ul",{children:(0,i.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."]})})})};var N=n(36887),E=n(93188),A=e=>{let{title:t,onCreateNew:n,buttonText:r,documentationComponent:o,videoPublicIdUrl:l,...a}=e;return(0,i.jsxs)(m.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},...a,children:[(0,i.jsx)(m.xu,{sx:e=>{var t;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:(0,i.jsx)(N.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:()=>{E.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,i.jsxs)(m.xu,{sx:e=>{var t;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,i.jsxs)(m.xu,{sx:e=>{var t;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:[(0,i.jsx)(m.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:t}),(0,i.jsx)(m.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,i.jsxs)(m.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,i.jsx)(m.zx,{onClick:n,"data-testid":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:r}),(0,i.jsx)(m.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"})]})]})]})},R=n(17889),P=n(3181),O=n(80410);async function z(e){let{slice:t,newSliceName:n,onSuccess:i}=e;try{let e=(0,P.PQ)(t,n),{errors:r}=await b.j.slices.renameSlice({libraryID:t.from,model:O.id.fromSM(e.model)});if(r.length>0)throw r;i(e),d.Am.success("Slice name updated")}catch(n){let e="An unexpected error happened while renaming “".concat(t.model.name,"”.");console.error(e,n),d.Am.error(e)}}var W=n(68916),_=n(1490),D=n(28801),T=n(99923);let Z=e=>{var t,n;let{slice:r,isOpen:o,onClose:l}=e,{renameSliceSuccess:a}=(0,I.Z)(),{syncChanges:s}=(0,k.g)(),{localLibs:d,remoteLibs:u}=(0,c.v9)(e=>({localLibs:(0,W.Sd)(e),remoteLibs:(0,W.sT)(e)})),x=null!==(t=null==r?void 0:r.model.name)&&void 0!==t?t:"",f=async e=>{r&&(await z({slice:r,newSliceName:e.sliceName,onSuccess:e=>{a(e.from,e.model),s()}}),l())};return(0,i.jsx)(_.Z,{testId:"rename-slice-modal",isOpen:o,widthInPx:"530px",formId:"rename-slice-modal-".concat(null!==(n=null==r?void 0:r.model.id)&&void 0!==n?n:""),close:l,buttonLabel:"Rename",onSubmit:e=>void f(e),initialValues:{sliceName:x},content:{title:"Rename a slice"},validate:e=>(0,T.h)(e,d,u,"update"),children:e=>{let{touched:t,errors:n}=e;return(0,i.jsx)(m.xu,{children:(0,i.jsx)(D.W,{name:"sliceName",label:"Slice Name","data-testid":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?n.sliceName:void 0,testId:"slice-name-input"})})}})};var F=n(42849),K=n(39283),B=n(91133),H=n(17186),M=()=>{var e,t,n;let o=(0,a.useRouter)(),{modalPayload:y,onOpenModal:g}=(0,h.H)(),{sliceFilterFn:b,defaultVariationSelector:j}=y,{remoteSlices:k,libraries:w}=(0,c.v9)(e=>({remoteSlices:(0,W.sT)(e),libraries:(0,W.Sd)(e)})),[S,C]=(0,s.useState)(!1),[I,N]=(0,s.useState)(!1),[E,P]=(0,s.useState)(!1),O=w.filter(e=>e.isLocal),z=w.map(e=>(e.components=[...e.components].sort((e,t)=>e.model.name.localeCompare(t.model.name)),e)),_=(w||[]).map(e=>e.components).flat(),D=_.length,[T,M]=(0,s.useState)(),X=()=>{N(!0)},V=()=>{P(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Slices - Slice Machine"})}),(0,i.jsxs)(v.LN,{children:[(0,i.jsxs)(v.wd,{children:[(0,i.jsx)(v.Cx,{children:(0,i.jsx)(x.g,{children:"Slices"})}),(null==O?void 0:O.length)!==0&&0!==D?(0,i.jsx)(v.K2,{children:(0,i.jsx)(r.zx,{"data-testid":"create-slice",onClick:()=>{C(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,i.jsxs)(v.RN,{children:[(0,i.jsx)(u.xR,{sx:{display:"flex",flexDirection:"column"},children:z.length>0?(0,i.jsx)(m.kC,{sx:{flex:1,flexDirection:"column"},children:0===D?(0,i.jsx)(m.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(A,{title:"What are Slices?",onCreateNew:()=>{C(!0)},buttonText:"Create one",videoPublicIdUrl:H.rd,documentationComponent:(0,i.jsxs)(i.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,i.jsx)(m.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:e=>{var t;return{color:null==e?void 0:null===(t=e.colors)||void 0===t?void 0:t.primary}},children:"Learn more"}),"."]}),"data-testid":"slices-table-blank-slate"})}):z.map(e=>{let{name:t,isLocal:n,components:r}=e;return(0,i.jsxs)(m.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,i.jsxs)(m.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(m.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,i.jsx)(m.xv,{children:t})}),!n&&(0,i.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,i.jsx)(F.Z,{elems:r,defineElementKey:e=>e.model.name,renderElem:e=>(0,i.jsx)(f.b,{action:{type:"menu",onRemove:()=>{M(e),X()},onRename:()=>{M(e),V()}},mode:"navigation",onUpdateScreenshot:()=>{g({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"}),gridGap:"32px 16px"})]},t)})}):void 0}),(null==O?void 0:O.length)>0&&(0,i.jsx)(K.Z,{slices:b(_),defaultVariationSelector:j}),(null==O?void 0:O.length)>0&&S&&(0,i.jsx)(R.c,{localLibraries:O,remoteSlices:k,onSuccess:(e,t)=>{let n=e.variations[0].id,i=p.Y.getBuilderPagePathname({libraryName:t,sliceName:e.name,variationId:n});o.push(i),d.Am.success((0,B.kQ)({path:"".concat(t,"/").concat(e.name,"/model.json")}))},onClose:()=>{C(!1)}}),(0,i.jsx)(Z,{isOpen:E,slice:T,onClose:()=>{P(!1)},"data-testid":"rename-slice-modal"}),(0,i.jsx)(L,{isOpen:I,libName:null!==(e=null==T?void 0:T.from)&&void 0!==e?e:"",sliceId:null!==(t=null==T?void 0:T.model.id)&&void 0!==t?t:"",sliceName:null!==(n=null==T?void 0:T.model.name)&&void 0!==n?n:"",onClose:()=>{N(!1)}})]})]})]})}},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return b}});var i=n(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n(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 s(e,t){return void 0===t&&(t=","),e.split(t)}function c(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return a(e)}),l={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},s=i.filter(function(e){return!o.includes(e)});return r({},l,{keys:s,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&m([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&x([a(e.key),a(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){d.clear()});var d=new Set;function u(e){return Array.isArray(e)}function m(e){var t=Array.isArray(e)?e:[e];d.has("meta")&&d.forEach(function(e){return!o.includes(e)&&d.delete(e.toLowerCase())}),t.forEach(function(e){return d.add(e.toLowerCase())})}function x(e){var t=Array.isArray(e)?e:[e];"meta"===e?d.clear():t.forEach(function(e){return d.delete(e.toLowerCase())})}function f(e,t){var n=e.target;void 0===t&&(t=!1);var i=n&&n.tagName;return u(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i.toLowerCase()})):!!(i&&t&&!0===t)}var p=function(e,t,n){void 0===n&&(n=!1);var i,r=t.alt,o=t.meta,l=t.mod,s=t.shift,c=t.ctrl,m=t.keys,x=e.key,f=e.code,p=e.ctrlKey,h=e.metaKey,v=e.shiftKey,y=e.altKey,g=a(f),b=x.toLowerCase();if(!n){if(!y===r&&"alt"!==b||!v===s&&"shift"!==b)return!1;if(l){if(!h&&!p)return!1}else if(!h===o&&"meta"!==b&&"os"!==b||!p===c&&"ctrl"!==b&&"control"!==b)return!1}return!!(m&&1===m.length&&(m.includes(b)||m.includes(g)))||(m?(void 0===i&&(i=","),(u(m)?m:m.split(i)).every(function(e){return d.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()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,t,n,r){var o,l=(0,i.useRef)(null),d=(0,i.useRef)(!1),b=n instanceof Array?r instanceof Array?void 0:r:n,j=u(e)?e.join(null==b?void 0:b.splitKey):e,k=n instanceof Array?n:r instanceof Array?r:void 0,w=(0,i.useCallback)(t,null!=k?k:[]),S=(0,i.useRef)(w);k?S.current=w:S.current=t;var C=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(i,r){return i&&e(t[r],n[r])},!0):t===n}((o=(0,i.useRef)(void 0)).current,b)&&(o.current=b),o.current),I=(0,i.useContext)(v).enabledScopes,L=(0,i.useContext)(h);return g(function(){if((null==C?void 0:C.enabled)!==!1&&(e=null==C?void 0:C.scopes,0===I.length&&e?(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):!!(!e||I.some(function(t){return e.includes(t)})||I.includes("*")))){var e,t=function(e,t){var n;if(void 0===t&&(t=!1),!(f(e,["input","textarea","select"])&&!f(e,null==C?void 0:C.enableOnFormTags)||null!=C&&null!=C.ignoreEventWhen&&C.ignoreEventWhen(e))){if(null!==l.current&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){y(e);return}(null==(n=e.target)||!n.isContentEditable||null!=C&&C.enableOnContentEditable)&&s(j,null==C?void 0:C.splitKey).forEach(function(n){var i,r,o,l=c(n,null==C?void 0:C.combinationKey);if(p(e,l,null==C?void 0:C.ignoreModifiers)||null!=(o=l.keys)&&o.includes("*")){if(t&&d.current)return;if(("function"==typeof(i=null==C?void 0:C.preventDefault)&&i(e,l)||!0===i)&&e.preventDefault(),"function"==typeof(r=null==C?void 0:C.enabled)?!r(e,l):!0!==r&&void 0!==r){y(e);return}S.current(e,l),t||(d.current=!0)}})}},n=function(e){void 0!==e.key&&(m(a(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&t(e))},i=function(e){void 0!==e.key&&(x(a(e.code)),d.current=!1,null!=C&&C.keyup&&t(e,!0))},r=l.current||(null==b?void 0:b.document)||document;return r.addEventListener("keyup",i),r.addEventListener("keydown",n),L&&s(j,null==C?void 0:C.splitKey).forEach(function(e){return L.addHotkey(c(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))}),function(){r.removeEventListener("keyup",i),r.removeEventListener("keydown",n),L&&s(j,null==C?void 0:C.splitKey).forEach(function(e){return L.removeHotkey(c(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))})}}},[j,C,I]),l}}},function(e){e.O(0,[898,789,588,772,639,888,774,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- .BlankSlate_column__genEe{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__CmSqW{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__mAfi5 ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground__mLYij{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__Jn90S{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__0Yt2d{padding:32px}.BlankSlate_withBackground__mLYij .BlankSlate_content__0Yt2d{padding:64px}.BlankSlate_title__08TNY{font-size:18px;font-weight:600;line-height:32px}.BlankSlate_desc___Dl7e{font-weight:400;line-height:24px}.BlankSlate_withBackground__mLYij .BlankSlate_desc___Dl7e{max-width:464px;align-self:center}.BlankSlate_actions__OYRj4{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground__mLYij .BlankSlate_actions__OYRj4{justify-content:center}
1
+ .BlankSlate_column__genEe{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__CmSqW{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__mAfi5 ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground__mLYij{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__Jn90S{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__0Yt2d{padding:32px}.BlankSlate_withBackground__mLYij .BlankSlate_content__0Yt2d{padding:64px}.BlankSlate_withBackground__mLYij .BlankSlate_desc___Dl7e{max-width:464px;align-self:center}.BlankSlate_actions__OYRj4{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground__mLYij .BlankSlate_actions__OYRj4{justify-content:center}
@@ -0,0 +1 @@
1
+ .List_flex__b6acG{all:unset;display:flex}.List_row__zKnOI{flex-direction:row}.List_root__m_SiQ{border-color:var(--grey6);flex-direction:column;overflow-x:hidden}.List_root-border__UW3vp{border-radius:6px;border-style:solid;border-width:1px}.List_child__MJ49i{align-items:center;border-bottom-color:var(--grey6);border-bottom-width:1px;box-sizing:border-box;height:48px;padding-right:8px}.List_child__MJ49i:last-child{border-bottom-color:transparent}.List_header__T0WM5{background-color:var(--grey2);border-bottom-style:solid;gap:8px;padding-left:16px}.List_headerActions__mNgLY{align-items:center;flex-grow:1;gap:8px;justify-content:end;min-width:0}.List_item__LMBx4{background-color:var(--grey1);border-bottom-style:dashed;padding-left:12px}.ZoneEmptyState_root__DAfG2{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background-color:var(--grey3);text-align:center;padding-top:32px;padding-bottom:32px;min-height:288px}.BlankSlate_column__genEe{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__CmSqW{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__mAfi5 ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground__mLYij{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__Jn90S{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__0Yt2d{padding:32px}.BlankSlate_withBackground__mLYij .BlankSlate_content__0Yt2d{padding:64px}.BlankSlate_withBackground__mLYij .BlankSlate_desc___Dl7e{max-width:464px;align-self:center}.BlankSlate_actions__OYRj4{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground__mLYij .BlankSlate_actions__OYRj4{justify-content:center}.Card_flex__opby1{all:unset;display:flex}.Card_grid__VAvIS{all:unset;display:grid}.Card_column__W4ACG{flex-direction:column}.Card_root__YVuvU{position:relative;box-sizing:border-box;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow-x:hidden}.Card_size-small__aIlxd{height:240px}.Card_size-medium__xegz0{height:320px}.Card_solid__GNGar{background-color:var(--grey3)}.Card_solid__GNGar[data-state=checked]{border-color:var(--purple10)}.Card_outlined__W_dxI{background-color:var(--grey2)}.Card_outlined__W_dxI[data-state=checked]{border-color:var(--purple8)}.Card_interactive__rXw5L:focus-visible{box-shadow:var(--box-shadow-purple-focus)}.Card_interactive__rXw5L[data-disabled]{opacity:.5}.Card_interactive__rXw5L:not([data-disabled]){cursor:pointer}.Card_interactive__rXw5L.Card_solid__GNGar:focus-visible{background-color:var(--grey5);border-color:var(--purple10)}.Card_interactive__rXw5L.Card_outlined__W_dxI:active{background-color:var(--grey4);border-color:var(--purple9)}.Card_interactive__rXw5L.Card_outlined__W_dxI:focus-visible{background-color:var(--grey1);border-color:var(--purple8)}.Card_interactive__rXw5L.Card_outlined__W_dxI:hover{background-color:var(--grey4)}.Card_media__l0kHL{flex-basis:0;flex-grow:1;min-height:0;position:relative;order:0}.Card_solid__GNGar>.Card_media__l0kHL{padding:32px}.Card_outlined__W_dxI>.Card_media__l0kHL{background-color:var(--light-grey3);margin-inline:16px;margin-top:16px;padding:16px}.Card_mediaComponent-div__Y2_PZ{flex-grow:1}.Card_mediaComponent-img__ezOTu{height:100%;-o-object-fit:contain;object-fit:contain}.Card_mediaComponent-img__ezOTu:not([src]){visibility:hidden}.Card_mediaOverlay__Aa__Q{inset:0;position:absolute;visibility:hidden}.Card_mediaOverlay__Aa__Q:before{background-color:var(--light-grey12);content:"";inset:0;opacity:.1;position:absolute}.Card_interactive__rXw5L:focus-visible .Card_mediaOverlay__Aa__Q,.Card_interactive__rXw5L:not([data-disabled]) .Card_mediaOverlay__Aa__Q:has(:focus-visible),.Card_interactive__rXw5L:not([data-disabled]) .Card_media__l0kHL:hover>.Card_mediaOverlay__Aa__Q{visibility:visible}.Card_nonMedia__Fv3Mz{align-items:center;box-sizing:border-box;flex-direction:row}.Card_solid__GNGar>.Card_nonMedia__Fv3Mz{background-color:var(--light-grey1)}.Card_solid__GNGar>.Card_nonMedia__Fv3Mz:not(:first-child){border-top-color:var(--light-grey6);border-top-style:solid;border-top-width:inherit}.Card_actions__XdhOt{height:48px;justify-content:space-between;order:1}.Card_solid__GNGar>.Card_actions__XdhOt{padding-left:12px;padding-right:8px}.Card_outlined__W_dxI>.Card_actions__XdhOt{padding-inline:16px}.Card_footer__U0HS1{gap:8px;height:60px;order:2}.Card_solid__GNGar>.Card_footer__U0HS1{padding-inline:12px}.Card_outlined__W_dxI>.Card_footer__U0HS1{padding-inline:16px}.Card_footerTexts__rTXup{flex-basis:0;flex-grow:1;min-width:0;margin-bottom:4px}.Card_status__PNN2a{height:24px;inset-inline:0;justify-content:center;padding-inline:8px;position:absolute;background-color:var(--purple4);color:var(--purple11)}.ConvertLegacySliceButton_scrollArea__xf3vM{width:448px;height:100%;display:flex;gap:8px;padding-inline:16px;padding-block:16px}.ConvertLegacySliceButton_label__BK0Gd{display:inline-flex;align-items:center;gap:4px}.ContentTabs_flex__T21Oc{all:unset;display:flex}.ContentTabs_column__1f8b8{flex-direction:column}.ContentTabs_root__Gn3Zg{background-color:var(--grey1);min-height:0}.ContentTabs_list__rAZtl{border-bottom:1px solid var(--grey5);padding-inline:16px}.ContentTabs_trigger__cTyPN{color:var(--grey11);cursor:pointer;padding-block:8px}.ContentTabs_trigger__cTyPN:not(:last-child){margin-right:16px}.ContentTabs_trigger__cTyPN[data-state=active]{box-shadow:inset 0 -1px 0 0 currentColor,0 1px 0 0 currentColor;color:var(--purple9)}.ContentTabs_triggerText__p_ZBl{line-height:32px}.ContentTabs_content__H1Stj{min-height:0;outline:none;flex:1 1}.ContentTabs_content__H1Stj[data-state=inactive]{display:none}.ContentTabs_scrollArea__DuDcQ{padding:16px}.MarkdownRenderer_section__uNS1M{padding-bottom:16px}.MarkdownRenderer_inlineCode__lmGTi{font-family:var(--font-family-code);background-color:var(--grey2);border-radius:6px;padding-block:2px;padding-inline:4px}.PageSnippetDialog_content__jIN6d{display:flex;flex-direction:column;min-height:0;gap:12px;overflow:hidden;grid-area:content}
@@ -1 +1 @@
1
- .List_flex__b6acG{all:unset;display:flex}.List_row__zKnOI{flex-direction:row}.List_root__m_SiQ{border-color:var(--grey6);flex-direction:column;overflow-x:hidden}.List_root-border__UW3vp{border-radius:6px;border-style:solid;border-width:1px}.List_child__MJ49i{align-items:center;border-bottom-color:var(--grey6);border-bottom-width:1px;box-sizing:border-box;height:48px;padding-right:8px}.List_child__MJ49i:last-child{border-bottom-color:transparent}.List_header__T0WM5{background-color:var(--grey2);border-bottom-style:solid;gap:8px;padding-left:16px}.List_headerActions__mNgLY{align-items:center;flex-grow:1;gap:8px;justify-content:end;min-width:0}.List_item__LMBx4{background-color:var(--grey1);border-bottom-style:dashed;padding-left:12px}.ZoneEmptyState_root__DAfG2{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background-color:var(--grey3);text-align:center;padding-top:32px;padding-bottom:32px;min-height:288px}.BlankSlate_column__genEe{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__CmSqW{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__mAfi5 ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground__mLYij{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__Jn90S{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__0Yt2d{padding:32px}.BlankSlate_withBackground__mLYij .BlankSlate_content__0Yt2d{padding:64px}.BlankSlate_title__08TNY{font-size:18px;font-weight:600;line-height:32px}.BlankSlate_desc___Dl7e{font-weight:400;line-height:24px}.BlankSlate_withBackground__mLYij .BlankSlate_desc___Dl7e{max-width:464px;align-self:center}.BlankSlate_actions__OYRj4{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground__mLYij .BlankSlate_actions__OYRj4{justify-content:center}.Card_flex__opby1{all:unset;display:flex}.Card_grid__VAvIS{all:unset;display:grid}.Card_column__W4ACG{flex-direction:column}.Card_root__YVuvU{position:relative;box-sizing:border-box;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow-x:hidden}.Card_size-small__aIlxd{height:240px}.Card_size-medium__xegz0{height:320px}.Card_solid__GNGar{background-color:var(--grey3)}.Card_solid__GNGar[data-state=checked]{border-color:var(--purple10)}.Card_outlined__W_dxI{background-color:var(--grey2)}.Card_outlined__W_dxI[data-state=checked]{border-color:var(--purple8)}.Card_interactive__rXw5L:focus-visible{box-shadow:var(--box-shadow-purple-focus)}.Card_interactive__rXw5L[data-disabled]{opacity:.5}.Card_interactive__rXw5L:not([data-disabled]){cursor:pointer}.Card_interactive__rXw5L.Card_solid__GNGar:focus-visible{background-color:var(--grey5);border-color:var(--purple10)}.Card_interactive__rXw5L.Card_outlined__W_dxI:active{background-color:var(--grey4);border-color:var(--purple9)}.Card_interactive__rXw5L.Card_outlined__W_dxI:focus-visible{background-color:var(--grey1);border-color:var(--purple8)}.Card_interactive__rXw5L.Card_outlined__W_dxI:hover{background-color:var(--grey4)}.Card_media__l0kHL{flex-basis:0;flex-grow:1;min-height:0;position:relative;order:0}.Card_solid__GNGar>.Card_media__l0kHL{padding:32px}.Card_outlined__W_dxI>.Card_media__l0kHL{background-color:var(--light-grey3);margin-inline:16px;margin-top:16px;padding:16px}.Card_mediaComponent-div__Y2_PZ{flex-grow:1}.Card_mediaComponent-img__ezOTu{height:100%;-o-object-fit:contain;object-fit:contain}.Card_mediaComponent-img__ezOTu:not([src]){visibility:hidden}.Card_mediaOverlay__Aa__Q{inset:0;position:absolute;visibility:hidden}.Card_mediaOverlay__Aa__Q:before{background-color:var(--light-grey12);content:"";inset:0;opacity:.1;position:absolute}.Card_interactive__rXw5L:focus-visible .Card_mediaOverlay__Aa__Q,.Card_interactive__rXw5L:not([data-disabled]) .Card_mediaOverlay__Aa__Q:has(:focus-visible),.Card_interactive__rXw5L:not([data-disabled]) .Card_media__l0kHL:hover>.Card_mediaOverlay__Aa__Q{visibility:visible}.Card_nonMedia__Fv3Mz{align-items:center;box-sizing:border-box;flex-direction:row}.Card_solid__GNGar>.Card_nonMedia__Fv3Mz{background-color:var(--light-grey1)}.Card_solid__GNGar>.Card_nonMedia__Fv3Mz:not(:first-child){border-top-color:var(--light-grey6);border-top-style:solid;border-top-width:inherit}.Card_actions__XdhOt{height:48px;justify-content:space-between;order:1}.Card_solid__GNGar>.Card_actions__XdhOt{padding-left:12px;padding-right:8px}.Card_outlined__W_dxI>.Card_actions__XdhOt{padding-inline:16px}.Card_footer__U0HS1{gap:8px;height:60px;order:2}.Card_solid__GNGar>.Card_footer__U0HS1{padding-inline:12px}.Card_outlined__W_dxI>.Card_footer__U0HS1{padding-inline:16px}.Card_footerTexts__rTXup{flex-basis:0;flex-grow:1;min-width:0;margin-bottom:4px}.Card_status__PNN2a{height:24px;inset-inline:0;justify-content:center;padding-inline:8px;position:absolute;background-color:var(--purple4);color:var(--purple11)}.ConvertLegacySliceButton_scrollArea__xf3vM{width:448px;height:100%;display:flex;gap:8px;padding-inline:16px;padding-block:16px}.ConvertLegacySliceButton_label__BK0Gd{display:inline-flex;align-items:center;gap:4px}.ContentTabs_flex__T21Oc{all:unset;display:flex}.ContentTabs_column__1f8b8{flex-direction:column}.ContentTabs_root__Gn3Zg{background-color:var(--grey1);min-height:0}.ContentTabs_list__rAZtl{border-bottom:1px solid var(--grey5);padding-inline:16px}.ContentTabs_trigger__cTyPN{color:var(--grey11);cursor:pointer;padding-block:8px}.ContentTabs_trigger__cTyPN:not(:last-child){margin-right:16px}.ContentTabs_trigger__cTyPN[data-state=active]{box-shadow:inset 0 -1px 0 0 currentColor,0 1px 0 0 currentColor;color:var(--purple9)}.ContentTabs_triggerText__p_ZBl{line-height:32px}.ContentTabs_content__H1Stj{min-height:0;outline:none;flex:1 1}.ContentTabs_content__H1Stj[data-state=inactive]{display:none}.ContentTabs_scrollArea__DuDcQ{padding:16px}.MarkdownRenderer_section__uNS1M{padding-bottom:16px}.MarkdownRenderer_inlineCode__lmGTi{font-family:var(--font-family-code);background-color:var(--grey2);border-radius:6px;padding-block:2px;padding-inline:4px}.PageSnippetDialog_content__jIN6d{display:flex;flex-direction:column;min-height:0;gap:12px;overflow:hidden;grid-area:content}
1
+ .BlankSlate_column__genEe{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__CmSqW{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__mAfi5 ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground__mLYij{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__Jn90S{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__0Yt2d{padding:32px}.BlankSlate_withBackground__mLYij .BlankSlate_content__0Yt2d{padding:64px}.BlankSlate_withBackground__mLYij .BlankSlate_desc___Dl7e{max-width:464px;align-self:center}.BlankSlate_actions__OYRj4{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground__mLYij .BlankSlate_actions__OYRj4{justify-content:center}.Card_flex__opby1{all:unset;display:flex}.Card_grid__VAvIS{all:unset;display:grid}.Card_column__W4ACG{flex-direction:column}.Card_root__YVuvU{position:relative;box-sizing:border-box;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow-x:hidden}.Card_size-small__aIlxd{height:240px}.Card_size-medium__xegz0{height:320px}.Card_solid__GNGar{background-color:var(--grey3)}.Card_solid__GNGar[data-state=checked]{border-color:var(--purple10)}.Card_outlined__W_dxI{background-color:var(--grey2)}.Card_outlined__W_dxI[data-state=checked]{border-color:var(--purple8)}.Card_interactive__rXw5L:focus-visible{box-shadow:var(--box-shadow-purple-focus)}.Card_interactive__rXw5L[data-disabled]{opacity:.5}.Card_interactive__rXw5L:not([data-disabled]){cursor:pointer}.Card_interactive__rXw5L.Card_solid__GNGar:focus-visible{background-color:var(--grey5);border-color:var(--purple10)}.Card_interactive__rXw5L.Card_outlined__W_dxI:active{background-color:var(--grey4);border-color:var(--purple9)}.Card_interactive__rXw5L.Card_outlined__W_dxI:focus-visible{background-color:var(--grey1);border-color:var(--purple8)}.Card_interactive__rXw5L.Card_outlined__W_dxI:hover{background-color:var(--grey4)}.Card_media__l0kHL{flex-basis:0;flex-grow:1;min-height:0;position:relative;order:0}.Card_solid__GNGar>.Card_media__l0kHL{padding:32px}.Card_outlined__W_dxI>.Card_media__l0kHL{background-color:var(--light-grey3);margin-inline:16px;margin-top:16px;padding:16px}.Card_mediaComponent-div__Y2_PZ{flex-grow:1}.Card_mediaComponent-img__ezOTu{height:100%;-o-object-fit:contain;object-fit:contain}.Card_mediaComponent-img__ezOTu:not([src]){visibility:hidden}.Card_mediaOverlay__Aa__Q{inset:0;position:absolute;visibility:hidden}.Card_mediaOverlay__Aa__Q:before{background-color:var(--light-grey12);content:"";inset:0;opacity:.1;position:absolute}.Card_interactive__rXw5L:focus-visible .Card_mediaOverlay__Aa__Q,.Card_interactive__rXw5L:not([data-disabled]) .Card_mediaOverlay__Aa__Q:has(:focus-visible),.Card_interactive__rXw5L:not([data-disabled]) .Card_media__l0kHL:hover>.Card_mediaOverlay__Aa__Q{visibility:visible}.Card_nonMedia__Fv3Mz{align-items:center;box-sizing:border-box;flex-direction:row}.Card_solid__GNGar>.Card_nonMedia__Fv3Mz{background-color:var(--light-grey1)}.Card_solid__GNGar>.Card_nonMedia__Fv3Mz:not(:first-child){border-top-color:var(--light-grey6);border-top-style:solid;border-top-width:inherit}.Card_actions__XdhOt{height:48px;justify-content:space-between;order:1}.Card_solid__GNGar>.Card_actions__XdhOt{padding-left:12px;padding-right:8px}.Card_outlined__W_dxI>.Card_actions__XdhOt{padding-inline:16px}.Card_footer__U0HS1{gap:8px;height:60px;order:2}.Card_solid__GNGar>.Card_footer__U0HS1{padding-inline:12px}.Card_outlined__W_dxI>.Card_footer__U0HS1{padding-inline:16px}.Card_footerTexts__rTXup{flex-basis:0;flex-grow:1;min-width:0;margin-bottom:4px}.Card_status__PNN2a{height:24px;inset-inline:0;justify-content:center;padding-inline:8px;position:absolute;background-color:var(--purple4);color:var(--purple11)}.Kbd_root__LRA1F{background-color:var(--grey2);border-color:var(--grey6);border-radius:3px;border-style:solid;border-width:1px;color:var(--grey11);padding-inline:4px}