slice-machine-ui 2.14.1-beta.3 → 2.14.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/{-VMvAKTmqJgCZu7L3OuoH → XvlX1hH1NJWoxu-ryMLd2}/_buildManifest.js +1 -1
  3. package/out/_next/static/chunks/182-d0d6fa5f9411cc91.js +1 -0
  4. package/out/_next/static/chunks/574-bbaa5391396443f5.js +1 -0
  5. package/out/_next/static/chunks/pages/{_app-d54bd34a04b6a5cd.js → _app-94d70342664d99e8.js} +1 -1
  6. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-cedaecc2d2d88e13.js +1 -0
  7. package/out/changelog.html +1 -1
  8. package/out/changes.html +1 -1
  9. package/out/custom-types/[customTypeId].html +1 -1
  10. package/out/custom-types.html +1 -1
  11. package/out/index.html +1 -1
  12. package/out/labs.html +1 -1
  13. package/out/page-types/[pageTypeId].html +1 -1
  14. package/out/settings.html +1 -1
  15. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  16. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  17. package/out/slices.html +1 -1
  18. package/package.json +3 -3
  19. package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +1 -7
  20. package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +2 -11
  21. package/src/legacy/lib/models/common/widgets/Group/index.tsx +0 -4
  22. package/src/legacy/lib/models/common/widgets/NestedGroup/index.tsx +1 -7
  23. package/out/_next/static/chunks/182-41d8530cc73708e9.js +0 -1
  24. package/out/_next/static/chunks/574-0c1b117bcea4181c.js +0 -1
  25. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-1628edd314d05be8.js +0 -1
  26. package/src/features/builder/useTableFieldExperiment.ts +0 -8
  27. /package/out/_next/static/{-VMvAKTmqJgCZu7L3OuoH → XvlX1hH1NJWoxu-ryMLd2}/_ssgManifest.js +0 -0
package/out/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/db6286456bd40214.css" as="style"/><link rel="stylesheet" href="/_next/static/css/db6286456bd40214.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d54bd34a04b6a5cd.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/-VMvAKTmqJgCZu7L3OuoH/_buildManifest.js" defer=""></script><script src="/_next/static/-VMvAKTmqJgCZu7L3OuoH/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"-VMvAKTmqJgCZu7L3OuoH","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/db6286456bd40214.css" as="style"/><link rel="stylesheet" href="/_next/static/css/db6286456bd40214.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-94d70342664d99e8.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/XvlX1hH1NJWoxu-ryMLd2/_buildManifest.js" defer=""></script><script src="/_next/static/XvlX1hH1NJWoxu-ryMLd2/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"XvlX1hH1NJWoxu-ryMLd2","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- self.__BUILD_MANIFEST=function(s,c,a,e,t,i,d,n,u,b,f,h,l,p,k,j,g,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[a,p,k,"static/chunks/pages/index-17f953c11b46cb20.js"],"/_error":["static/chunks/pages/_error-1b183d3cf5ea03f9.js"],"/changelog":[s,e,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-fd749acf98af82da.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38ab72e6ee071fec.js",c,d,"static/css/9d17b7d9f44c5c5d.css","static/chunks/pages/changes-abdcde22a1d96331.js"],"/custom-types":[a,p,k,"static/chunks/pages/custom-types-ddc20cfdd8049c04.js"],"/custom-types/[customTypeId]":[s,n,u,b,f,e,i,h,j,c,a,l,g,o,"static/chunks/pages/custom-types/[customTypeId]-64aa3bd4c9fcf0e6.js"],"/labs":["static/chunks/pages/labs-41db727cff0af1a9.js"],"/page-types/[pageTypeId]":[s,n,u,b,f,e,i,h,j,c,a,l,g,o,"static/chunks/pages/page-types/[pageTypeId]-3f474721052dae04.js"],"/settings":["static/css/e5f781f20e24a5ea.css","static/chunks/pages/settings-4efa7c64dc4f2468.js"],"/slices":[s,t,i,c,d,"static/css/b5323377600915db.css","static/chunks/pages/slices-f42c28ddc74a5b2b.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,n,u,b,f,e,i,h,c,l,d,"static/css/9740e73b8aa87666.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-1628edd314d05be8.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/157-c12435a018a2c5ce.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5b65c5cb79e1e66a.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-8e544a511d670317.js","static/chunks/772-7401e6c6e7ca075e.js","static/chunks/372-718a5541f567e738.js","static/chunks/183-b1a9f55f45cb8d8e.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/50-586dc7ab5e584e76.js","static/chunks/639-424b570eee9a37fb.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/434-c7ad3ff97354e3b7.js","static/chunks/574-0c1b117bcea4181c.js","static/chunks/764-14490100bc2b60a8.js","static/css/4e475d945cf8a890.css","static/chunks/479-6205c85aa978fc0b.js","static/chunks/182-41d8530cc73708e9.js","static/css/850c81be38195a0f.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
1
+ self.__BUILD_MANIFEST=function(s,c,a,e,t,i,d,n,u,b,f,h,l,p,k,j,g,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[a,p,k,"static/chunks/pages/index-17f953c11b46cb20.js"],"/_error":["static/chunks/pages/_error-1b183d3cf5ea03f9.js"],"/changelog":[s,e,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-fd749acf98af82da.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38ab72e6ee071fec.js",c,d,"static/css/9d17b7d9f44c5c5d.css","static/chunks/pages/changes-abdcde22a1d96331.js"],"/custom-types":[a,p,k,"static/chunks/pages/custom-types-ddc20cfdd8049c04.js"],"/custom-types/[customTypeId]":[s,n,u,b,f,e,i,h,j,c,a,l,g,o,"static/chunks/pages/custom-types/[customTypeId]-64aa3bd4c9fcf0e6.js"],"/labs":["static/chunks/pages/labs-41db727cff0af1a9.js"],"/page-types/[pageTypeId]":[s,n,u,b,f,e,i,h,j,c,a,l,g,o,"static/chunks/pages/page-types/[pageTypeId]-3f474721052dae04.js"],"/settings":["static/css/e5f781f20e24a5ea.css","static/chunks/pages/settings-4efa7c64dc4f2468.js"],"/slices":[s,t,i,c,d,"static/css/b5323377600915db.css","static/chunks/pages/slices-f42c28ddc74a5b2b.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,n,u,b,f,e,i,h,c,l,d,"static/css/9740e73b8aa87666.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-cedaecc2d2d88e13.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/157-c12435a018a2c5ce.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5b65c5cb79e1e66a.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-8e544a511d670317.js","static/chunks/772-7401e6c6e7ca075e.js","static/chunks/372-718a5541f567e738.js","static/chunks/183-b1a9f55f45cb8d8e.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/50-586dc7ab5e584e76.js","static/chunks/639-424b570eee9a37fb.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/434-c7ad3ff97354e3b7.js","static/chunks/574-bbaa5391396443f5.js","static/chunks/764-14490100bc2b60a8.js","static/css/4e475d945cf8a890.css","static/chunks/479-6205c85aa978fc0b.js","static/chunks/182-d0d6fa5f9411cc91.js","static/css/850c81be38195a0f.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{24182:function(e,t,l){"use strict";l.d(t,{H:function(){return e2}});var i=l(52322),n=l(7729),a=l(97729),r=l.n(a),o=l(5632),s=l(2784),c=l(56580),d=l(23335),u=l(93216),m=l(6697),h=l(63447),x=l(5335),p=l(74217),v=l(93188),y=l(80546),j=l(43874),f=l(41067),g=l(77507);let b=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:l}=e,[n,a]=(0,s.useState)(l),r=(0,u.y6)(n),o=g.$[r],{actionQueueStatus:c,setNextAction:d}=(0,j.c)({errorMessage:o.autoSaveFailed}),{saveCustomTypeSuccess:m}=(0,f.Z)(),h=(0,p.R9)(m),{syncChanges:x}=(0,y.g)(),S=(0,s.useCallback)((e,t)=>{a(e),d(async()=>{let{errors:l}=await (0,v.KA)(e);if(l.length>0)throw l;h(e),x(),null==t||t()})},[d,h,x]),C=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:n,setCustomType:S}),[c,n,S]);return(0,i.jsx)(b.Provider,{value:C,children:"function"==typeof t?t(C):t})}function C(){let e=(0,s.useContext)(b);if(!e)throw Error("CustomTypeProvider not found");return e}var I=l(30195);function T(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:r}=C(),[o,c]=null!==(e=(0,u.j5)(a))&&void 0!==e?e:[],d=c?(0,u.N3)(c):"",[m,h]=(0,s.useState)(null!=d?d:""),[x,v]=(0,s.useState)();(0,p.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let y=(0,s.useCallback)(()=>(0,i.jsx)(n.JO$,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,i.jsxs)(n.VqE,{open:t,onOpenChange:l,size:"small",trigger:(0,i.jsx)(n.zxk,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:y,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,i.jsx)(n.fKu,{title:"Edit the UID label"}),(0,i.jsx)(n.cZJ,{children:(0,i.jsxs)(n.l09,{onSubmit:function(){x||(r(c?(0,u.eK)(m,a):(0,u.H8)(m,a)),l(!1))},children:[(0,i.jsx)(n.xuv,{flexDirection:"column",padding:16,gap:4,children:(0,i.jsx)(n.ytj,{type:"text",label:"Label *",placeholder:"UID",value:m,onValueChange:function(e){h(e),v(function(e){let t=w.safeParse(e,{errorMap:k});if(t.error)return t.error.errors[0].message}(e))},error:x,description:"A label for the UID"})}),(0,i.jsxs)(n.kXR,{children:[(0,i.jsx)(n.POh,{size:"medium"}),(0,i.jsx)(n._dX,{type:"submit",size:"medium",disabled:!!x,children:"Save"})]})]})})]})}let w=I.z.string().max(35).min(1),k=e=>{switch(e.code){case I.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case I.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var _=l(95799),D=l(1490),A=l(63397),N=l(75289);let E=e=>{let{name:t,label:l,placeholder:n,error:a,...r}=e;return(0,i.jsxs)(N.xu,{mb:3,children:[(0,i.jsx)(N.__,{htmlFor:t,mb:2,children:l}),(0,i.jsx)(A.gN,{name:t,type:"text",placeholder:n,as:N.II,autoComplete:"off",...r}),a?(0,i.jsx)(N.xv,{sx:{color:"error",mt:1},children:a}):null]})};var M=e=>{let{isOpen:t,onSubmit:l,close:n,tabIds:a}=e;return(0,i.jsx)(D.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:n,onSubmit:e=>{l(e),n()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,i.jsx)(E,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},F=e=>{let{isOpen:t,onSubmit:l,close:n}=e;return(0,i.jsx)(D.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:n,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),n()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,i.jsxs)(N.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(N.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(N.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(N.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),n()},children:"Yes, remove tab"})]})})},Z=e=>{let{isOpen:t,onSubmit:l,close:n,tabIds:a,initialTabKey:r}=e;return(0,i.jsx)(D.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:n,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),n()},initialValues:{id:r},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:r,isValid:o}=e;return(0,i.jsxs)(N.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(E,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&r("id",e.target.value.trim())},onChange:e=>{r("id",e.target.value)}}),(0,i.jsx)(N.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!o,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),n()},children:"Save"})]})}})},O=l(28316),z=l(88932),V=l(80775),L=l(30988),P=l(18493),K=l(85357),H=l(99510),R=l(50268),X=l(44266),U=l(64602),B=l(47655),$=l(65077);function G(e){let{open:t,onClose:l}=e,a=e=>{console.log(e)};return(0,i.jsxs)(n.VqE,{open:t,onOpenChange:e=>{e||l()},children:[(0,i.jsx)(n.fKu,{title:"Generate with AI"}),(0,i.jsxs)(n.cZJ,{gap:0,children:[(0,i.jsx)(n.xuv,{padding:16,height:"100%",children:(0,i.jsx)(n.Zzl,{onFilesSelected:a,assetType:"image",overlay:(0,i.jsx)(J,{onFilesSelected:a,droppingFiles:!0}),children:(0,i.jsx)(J,{onFilesSelected:a})})}),(0,i.jsxs)(n.kXR,{children:[(0,i.jsx)(n.POh,{}),(0,i.jsx)(n._dX,{disabled:!0,onClick:()=>void 0,children:"Add to page"})]})]})]})}function J(e){let{droppingFiles:t=!1,onFilesSelected:l}=e;return(0,i.jsx)(n.xuv,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:t?"purple2":"grey2",border:!0,borderStyle:"dashed",children:(0,i.jsxs)(n.R$c,{children:[(0,i.jsx)(n.avq,{lineColor:"purple11",backgroundColor:"purple5",name:"cloudUpload",size:"large"}),(0,i.jsx)(n._T6,{children:"Upload your design images."}),(0,i.jsx)(n.nfr,{children:"Once uploaded, you can generate slices automatically using AI."}),(0,i.jsx)(n.QjJ,{children:(0,i.jsx)(n.KH,{startIcon:"attachFile",onFilesSelected:l,color:"grey",children:"Add images"})})]})})}var q=l(53085);function Q(){let e=(0,q.L)("slicemachine-ai-slice-generation");return{eligible:(null==e?void 0:e.value)==="on"}}var Y=l(28574);let W=e=>(0,i.jsxs)("svg",{width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}),ee=e=>{let{openCreateSliceModal:t,openGenerateSliceWithAiModal:l,openUpdateSliceZoneModal:a,openSlicesTemplatesModal:r,projectHasAvailableSlices:o,isSlicesTemplatesSupported:s}=e,c=Q();return(0,i.jsx)(n.xuv,{flexGrow:1,justifyContent:"center","data-testid":"slice-zone-blank-slate",children:(0,i.jsx)(Y.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(Y.T9,{children:[(0,i.jsx)(n.xuv,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(W,{})}),(0,i.jsx)(Y._T,{children:"Add slices"}),(0,i.jsx)(Y.nf,{children:"Slices are website sections that you can reuse on different pages with different content. Each slice has its own component in your code."}),(0,i.jsx)(Y.Qj,{children:(0,i.jsxs)(n.S0S,{children:[c.eligible&&(0,i.jsx)(n.F8s,{startIcon:"autoFixHigh",onClick:l,description:"Let AI instantly create a Slice for you.",children:"Generate with AI"}),(0,i.jsx)(n.F8s,{startIcon:"add",onClick:t,description:"Build a custom Slice your way.",children:"Start from scratch"}),s?(0,i.jsx)(n.F8s,{startIcon:"contentCopy",onClick:r,description:"Select from premade examples.",children:"Use template"}):void 0,o?(0,i.jsx)(n.F8s,{startIcon:"folder",onClick:a,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};var et=l(65856);function el(e){let{customType:t,tabId:l,slices:i}=e,n={...t};return i.forEach(e=>{n={...n,tabs:n.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),n}var ei=l(18566),en=l(70647);async function ea(){try{let{templates:e,errors:t}=await en.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var er=l(17889),eo=l(91133),es=l(68916),ec=l(47861),ed=l(76805),eu=l(11104);let em=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,i.jsx)(eu.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,i.jsx)(ed.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:(0,i.jsxs)(N.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,i.jsx)(N.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(N.x8,{type:"button",onClick:l})]}),Footer:()=>(0,i.jsxs)(N.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)(ec.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ec.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,i.jsx)(N.nv,{children:"You're about to delete Slice Zone."})})})};var eh=l(61502),ex=l(80218),ep=l(3181),ev=l(99923),ey=l(17766),ej=l.n(ey);let ef=e=>{var t;let{isOpen:l,close:a,onSubmit:r,isLoading:o,slice:d,libraries:u}=e,{remoteSlices:m}=(0,c.v9)(e=>({remoteSlices:(0,es.sT)(e)})),h={from:null===(t=u[0])||void 0===t?void 0:t.name,sliceName:(0,H.MP)(d.key)},[x,v]=(0,s.useState)(h),[y,j]=(0,s.useState)();function f(e){v(e),j((0,ev.h)(e,u,m))}return(0,p.pQ)(l,()=>{l||(v(h),j(void 0))}),(0,i.jsxs)(n.VqE,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,i.jsx)(n.fKu,{title:"Upgrade slice"}),(0,i.jsx)(n.cZJ,{children:(0,i.jsx)(n.l09,{onSubmit:function(){y&&Object.keys(y).length>0||r({libraryID:x.from,sliceID:x.sliceName})},children:(0,i.jsxs)(n.xuv,{flexDirection:"column",children:[(0,i.jsxs)(n.xrM,{className:ej().scrollArea,children:[(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(n.xuv,{flexDirection:"column",gap:4,children:[(0,i.jsx)(n.ytj,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,H.MP)(d.key),")"),error:null==y?void 0:y.sliceName,value:x.sliceName,onValueChange:e=>f({...x,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(n.xuv,{flexDirection:"column",gap:4,children:[(0,i.jsx)("label",{className:ej().label,children:(0,i.jsx)(n.xvT,{variant:"bold",children:"Slice library *"})}),(0,i.jsx)(n.PhF,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:x.from,onValueChange:e=>{e&&f({...x,from:e})},children:u.map(e=>(0,i.jsx)(n.QlF,{value:e.name,children:e.name},e.name))}),(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsxs)(n.kXR,{children:[(0,i.jsx)(n.POh,{size:"medium"}),(0,i.jsx)(n._dX,{type:"submit",size:"medium",loading:o,disabled:y&&Object.keys(y).length>0,children:"Upgrade"})]})]})})})]})};var eg=l(96009),eb=l.n(eg);let eS=e=>{var t,l;let{isOpen:a,close:r,onSubmit:o,isLoading:c,slice:d,sliceName:u,libraries:m,localSharedSlices:h}=e,x={libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:eb()(d.key),variationName:u},[v,y]=(0,s.useState)(!0),[j,f]=(0,s.useState)(x),[g,b]=(0,s.useState)({});function S(e){f(e),b(eC(e,m))}return(0,p.pQ)(a,()=>{a||(f(x),b({}))}),(0,i.jsxs)(n.VqE,{open:a,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(n.fKu,{title:"Convert to slice variation"}),(0,i.jsx)(n.cZJ,{children:(0,i.jsx)(n.l09,{onSubmit:function(){Object.keys(g).length>0||o(j)},children:(0,i.jsxs)(n.xuv,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(n.xrM,{className:ej().scrollArea,children:[(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(n.xuv,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ej().label,children:[(0,i.jsx)(n.xvT,{variant:"bold",children:"Target slice *"}),"string"==typeof g.libraryID?(0,i.jsx)(n.xvT,{variant:"small",color:"tomato10",children:g.libraryID}):null,"string"==typeof g.sliceID?(0,i.jsx)(n.xvT,{variant:"small",color:"tomato10",children:g.sliceID}):null]}),(0,i.jsx)(n.PhF,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(j.libraryID,"::").concat(j.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");S({...j,libraryID:t,sliceID:l})}},children:h.map(e=>(0,i.jsxs)(n.QlF,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsx)(n.xuv,{display:"flex",flexDirection:"column",gap:4,children:(0,i.jsx)(n.ytj,{label:"Variation name *",placeholder:u,error:g.variationName,value:j.variationName,onValueChange:e=>{let t={...j,variationName:e.slice(0,30)};v&&(t.variationID=eb()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,i.jsx)(n.xuv,{display:"flex",flexDirection:"column",gap:4,children:(0,i.jsx)(n.ytj,{label:"ID *",placeholder:eb()(d.key),error:g.variationID,value:j.variationID,onValueChange:e=>{y(!1),S({...j,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,i.jsxs)(n.kXR,{children:[(0,i.jsx)(n.POh,{size:"medium"}),(0,i.jsx)(n._dX,{type:"submit",size:"medium",loading:c,disabled:Object.keys(g).length>0,children:"Convert"})]})]})})})]})},eC=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let i=t.find(t=>t.path===e.libraryID);l.libraryID||i||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let n=null==i?void 0:i.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||n||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==n?void 0:n.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},eI=e=>{var t,l;let{isOpen:a,close:r,onSubmit:o,isLoading:c,identicalSlices:d}=e,u=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[m,h]=(0,s.useState)(u),[x,v]=(0,s.useState)();return(0,p.pQ)(a,()=>{a||(h(u),v(void 0))}),(0,i.jsxs)(n.VqE,{open:a,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(n.fKu,{title:"Merge with an existing slice"}),(0,i.jsx)(n.cZJ,{children:(0,i.jsx)(n.l09,{onSubmit:function(){if(x)return;let[e,t,l]=m.split("::");o({libraryID:e,sliceID:t,variationID:l})},children:(0,i.jsxs)(n.xuv,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(n.xrM,{className:ej().scrollArea,children:[(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,i.jsxs)(n.xuv,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ej().label,children:[(0,i.jsx)(n.xvT,{variant:"bold",children:"Target slice*"}),"string"==typeof x?(0,i.jsx)(n.xvT,{variant:"small",color:"tomato10",children:x}):null]}),(0,i.jsx)(n.PhF,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:m,onValueChange:function(e){h(e),e||v("Cannot be empty.")},children:d.map(e=>(0,i.jsx)(n.QlF,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,i.jsx)(n.xvT,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsxs)(n.kXR,{children:[(0,i.jsx)(n.POh,{size:"medium"}),(0,i.jsx)(n._dX,{type:"submit",size:"medium",loading:c,disabled:!!x,children:"Merge"})]})]})})})]})},eT=e=>{var t;let{slice:l,path:a}=e,{refreshState:r}=(0,f.Z)(),[o,d]=(0,s.useState)(!1),[u,m]=(0,s.useState)(),{setCustomType:h}=C(),{libraries:x}=(0,c.v9)(e=>({libraries:(0,es.Sd)(e)})),p="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,y=x.filter(e=>e.isLocal),j=y.map(e=>e.components).flat(),g=ew(l,p,j),b=async e=>{var t,i,n;if(!u)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:u});let{errors:o}=await en.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(i=e.variationName)&&void 0!==i?i:"Default",variationID:null!==(n=e.variationID)&&void 0!==n?n:"default"}});if(o.length)throw console.error("Could not convert slice `".concat(p,"`"),o),z.Am.error("Could not convert slice `".concat(p,"`")),o;let{model:s,errors:c}=await en.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),z.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(r(await (0,v.y0)()),d(!1),m(void 0),u){case"as_new_slice":z.Am.success("".concat(p," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":z.Am.success("".concat(p," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:z.Am.success("".concat(p," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h(s)},S={path:a,slice:l,sliceName:p,libraries:y,localSharedSlices:j,identicalSlices:g,close:()=>m(void 0),onSubmit:b,isLoading:o};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.h_2,{children:[(0,i.jsx)(n.$FS,{children:(0,i.jsx)(n.zxk,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(n.AWV,{align:"start",children:[(0,i.jsx)(n.Xiv,{startIcon:(0,i.jsx)(n.JO$,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>m("as_new_slice"),children:"Upgrade slice"}),(0,i.jsx)(n.Xiv,{startIcon:(0,i.jsx)(n.JO$,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>m("as_new_variation"),disabled:!j.length,children:"Convert to slice variation"}),(0,i.jsx)(n.Xiv,{startIcon:(0,i.jsx)(n.JO$,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>m("merge_with_identical"),disabled:!g.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(ef,{...S,isOpen:"as_new_slice"===u}),(0,i.jsx)(eS,{...S,isOpen:"as_new_variation"===u}),(0,i.jsx)(eI,{...S,isOpen:"merge_with_identical"===u})]})},ew=(e,t,l)=>(0,s.useMemo)(()=>{let i=[],n=(0,ep.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,ep.ux)(t,e.model.name);n.primary===l.primary&&n.items===l.items&&i.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return i},[e,t,l]),ek=e=>{let{slice:t,path:l}=e,[a]=(0,eh.E)("legacySliceUpgrader"),r=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(ex.Zb,{children:[(0,i.jsx)(ex.ZB,{component:"div",children:(0,i.jsx)(n.xuv,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(n.xvT,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(ex.T$,{children:[(0,i.jsx)(n.ua7,{content:r,side:"bottom",children:(0,i.jsx)(n.Cts,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,i.jsx)(eT,{slice:t,path:l}):null]}),(0,i.jsx)(ex.eW,{subtitle:"1 variation",title:(0,ep.Dj)(t.value)})]})};var e_=l(53850),eD=l(42849);let eA=e=>{let{slices:t,format:l,path:n,onRemoveSharedSlice:a}=e,r=t.some(e=>"SharedSlice"!==e.type),o=g.$[l],[c]=(0,eh.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{r&&(c.enabled?z.Am.info("This ".concat(o.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):z.Am.warning("This ".concat(o.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[r]),(0,i.jsx)(eD.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,i.jsx)(ek,{slice:t,path:n})}{let t=e.payload;return(0,i.jsx)(e_.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function eN(e){try{let{templateIDs:t,localLibrariesNames:l,onSuccess:i}=e,{data:n,errors:a}=await en.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(a.length>0||void 0===n)throw a;n.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],sliceTemplate:t[i]})}),await i(n.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),z.Am.error(e)}}var eE=l(80410);let eM=[{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:{id:"video_highlights",name:"VideoHighlights",type:"SharedSlice",variations:[{description:"",docURL:"",id:"default",name:"Default",version:"sktwi1xtmkfgx8626"}]},screenshots:{default:{url:"/videoHighlights.png"}}}];var eF=e=>{let{availableSlices:t,values:l,placeholderSlices:n}=e;return(0,i.jsx)(A.F2,{name:"sliceKeys",render:e=>(0,i.jsx)(eD.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{var a;let r=null!==(a=null==n?void 0:n.some(e=>e.model.id===t.model.id))&&void 0!==a&&a,o=l.sliceKeys.includes(t.model.id);return(0,i.jsx)(e_.b,{action:{type:"checkbox"},isComingSoon:r,mode:"selection",onSelectedChange:i=>{i?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:o,slice:t,variant:"outlined"})}})})};let eZ=e=>{let{formId:t,close:l,onSuccess:n,availableSlicesTemplates:a,localLibraries:r}=e,{createSliceSuccess:o}=(0,f.Z)();return(0,i.jsx)(D.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;eN({templateIDs:t,localLibrariesNames:r.map(e=>e.name),onSuccess:async e=>{o((await (0,v.y0)()).libraries),n(await Promise.all(e.map(async e=>(await en.managerClient.slices.readSlice({libraryID:r[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(N.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(eF,{values:t,placeholderSlices:eM,availableSlices:[...a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eE.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})})),...eM]})}})};var eO=e=>{let{formId:t,close:l,onSubmit:n,availableSlices:a}=e;return(0,i.jsx)(D.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;n(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(N.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(eF,{values:t,availableSlices:a})}})};let ez=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:i,notFound:n}=e.value.reduce((e,t)=>{let{key:i,value:n}=t;if("SharedSlice"===n.type){let t=l.find(e=>e.model.id===i);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:i}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:i,value:n}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:i,notFound:n}};var eV=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:r,onRemoveSharedSlice:o,sliceZone:d,tabId:u}=e,m=Q(),h=(0,ei.QT)(ea,[]),[x,p]=(0,s.useState)(!1),[y,j]=(0,s.useState)(!1),[f,g]=(0,s.useState)(!1),[b,S]=(0,s.useState)(!1),{remoteSlices:I,libraries:T}=(0,c.v9)(e=>({remoteSlices:(0,es.sT)(e),libraries:(0,es.Sd)(e),slices:(0,es.xC)(e)})),{setCustomType:w}=C(),{completeStep:k}=(0,et.k)(),D=T.filter(e=>e.isLocal),{availableSlices:A,slicesInSliceZone:N,notFound:E}=(0,s.useMemo)(()=>d?ez(d,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,T]),[M,F]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==E?void 0:E.length)&&E.forEach(e=>{let{key:t}=e;o(t)})},[E]);let Z=N.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),O=A.filter(e=>!Z.some(t=>t.model.id===e.model.id)),L=()=>{j(!0)},P=()=>{g(!0)},K=()=>{S(!0)},H=()=>{p(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},R=()=>{j(!1)},X=()=>{g(!1)},U=()=>{p(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(V.Bu,{actions:d?(0,i.jsxs)(n.h_2,{children:[(0,i.jsx)(n.$FS,{children:(0,i.jsx)(n.zxk,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(n.AWV,{align:"end",children:[m.eligible&&(0,i.jsx)(n.Xiv,{startIcon:(0,i.jsx)(n.JO$,{name:"autoFixHigh",size:"large"}),onSelect:K,description:"Let AI instantly create a Slice for you.",children:"Generate with AI"}),(0,i.jsx)(n.Xiv,{startIcon:(0,i.jsx)(n.JO$,{name:"add",size:"large"}),onSelect:P,description:"Build a custom Slice your way.",children:"Start from scratch"}),h.length>0?(0,i.jsx)(n.Xiv,{onSelect:H,startIcon:(0,i.jsx)(n.JO$,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",endAdornment:(0,i.jsx)(n.xvT,{color:"inherit",component:"kbd",children:(0,i.jsx)(n.Cts,{color:"purple",title:"New"})}),children:"Use template"}):void 0,O.length>0?(0,i.jsx)(n.Xiv,{onSelect:L,startIcon:(0,i.jsx)(n.JO$,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==u?(0,i.jsx)(n.rsf,{checked:!!d,onCheckedChange:e=>{e?a():F(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?N.length>0?(0,i.jsx)($.xR,{children:(0,i.jsx)(eA,{slices:N,format:l.format,path:{customTypeID:l.id,tabID:u,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:o})}):(0,i.jsx)(ee,{openUpdateSliceZoneModal:L,openCreateSliceModal:P,openGenerateSliceWithAiModal:K,openSlicesTemplatesModal:H,projectHasAvailableSlices:O.length>0,isSlicesTemplatesSupported:h.length>0}):void 0,y&&(0,i.jsx)(eO,{formId:"tab-slicezone-form-".concat(u),availableSlices:O,onSubmit:e=>{let t=el({customType:l,tabId:u,slices:e});w(_.Dc.fromSM(t),()=>{z.Am.success("Slice(s) added to slice zone")}),k("createSlice"),R()},close:R}),x&&(0,i.jsx)(eZ,{formId:"tab-slicezone-form-".concat(u),availableSlicesTemplates:h,localLibraries:D,onSuccess:e=>{let t=el({customType:l,tabId:u,slices:e});w(_.Dc.fromSM(t),()=>{z.Am.success((0,i.jsx)(eo.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(D[0].name,"/")}))}),k("createSlice"),U()},close:U}),M&&(0,i.jsx)(em,{closeDeleteSliceZoneModal:()=>{F(!1)},deleteSliceZone:()=>{r(),F(!1)}}),(null==D?void 0:D.length)!==0&&f&&(0,i.jsx)(er.c,{onSuccess:e=>{let t=el({customType:l,tabId:u,slices:[e]});w(_.Dc.fromSM(t),()=>{z.Am.success((0,i.jsx)(eo.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(D[0].name,"/")}))}),X()},localLibraries:D,remoteSlices:I,onClose:X}),(0,i.jsx)(G,{open:b,onClose:()=>{S(!1)}})]})};let eL=[P.C.UID,P.C.Image,P.C.Text,P.C.StructuredText,P.C.Link,P.C.Select,P.C.Boolean,P.C.Number,P.C.Color,P.C.Date,P.C.Table,P.C.Embed,P.C.Timestamp,P.C.GeoPoint,P.C.ContentRelationship,P.C.LinkToMedia,P.C.Group,P.C.NestedGroup];var eP=e=>{var t,l,a,r;let{tabId:o}=e,{customType:c,setCustomType:d}=C(),m=_.Dc.toSM(c),h=null===(t=m.tabs.find(e=>e.key===o))||void 0===t?void 0:t.sliceZone,x=null!==(a=null===(l=m.tabs.find(e=>e.key===o))||void 0===l?void 0:l.value)&&void 0!==a?a:[],p="page"===m.format&&m.repeatable?x.filter(e=>"uid"!==e.key):x,v=m.tabs.reduce((e,t)=>[...e,...t.value],[]),y=e=>{var t;let{apiId:l,value:i}=e,n=null===(t=i.config)||void 0===t?void 0:t.label;if((0,K.Ss)(P.C,i.type)||null==n)return;if("Range"===i.type||"IntegrationFields"===i.type||"Separator"===i.type)throw Error("Unsupported Field Type: ".concat(i.type));let a=P.C[i.type];try{a.schema.validateSync(i,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(i.type,'".'))}let r=_.L$.fromSM(i);d((0,u.xS)({customType:c,newField:r,newFieldId:l,sectionId:o}),()=>{z.Am.success("".concat("Group"===i.type?"Group":"Field"," added"))}),(0,R.V)({id:l,field:r})},j=e=>{let{apiId:t,newKey:l,value:i,inGroupFieldAction:n}=e;if((0,K.Ss)(P.C,i.type))return;let a=_.L$.fromSM(i);d((0,u.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:a,sectionId:o}),()=>{"add"===n&&z.Am.success("Field added")}),n||(0,X.Z)({previousId:t,id:l,field:a})};return(0,i.jsx)(L.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(n.xuv,{padding:32,children:(0,i.jsx)(n._3P,{})}),children:(0,i.jsxs)(V.aV,{border:!1,style:{flexGrow:1},children:[(0,i.jsx)(B.Z,{zoneType:"customType",zoneTypeFormat:null!==(r=c.format)&&void 0!==r?r:"custom",tabId:o,title:"Static zone",dataTip:"",fields:p,poolOfFieldsToCheck:v,showHints:!0,EditModal:U.Z,widgetsArray:eL,onDeleteItem:e=>{d((0,u.AK)({customType:c,fieldId:e,sectionId:o}))},onSave:e=>""===e.apiId?y({...e,apiId:e.newKey}):j(e),onDragEnd:e=>{if((0,K.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let i=(0,u.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:o});(0,O.flushSync)(()=>d(i))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,H.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,H.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,i.jsx)(eV,{customType:m,tabId:o,sliceZone:h,onRemoveSharedSlice:e=>{d((0,u.EN)({customType:c,sectionId:o,sliceId:e}))},onCreateSliceZone:()=>{d((0,u.Tr)(c,o))},onDeleteSliceZone:()=>{d((0,u.E3)(c,o))}})]})})})};let eK=()=>{var e,t,l;let{customType:a,setCustomType:r}=C(),o=_.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=o.tabs[0])||void 0===e?void 0:e.key),[m,h]=(0,s.useState)(),x=(null===(l=o.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.Rz2,{sx:x?{flexGrow:1}:void 0,children:["page"===a.format?(0,i.jsx)(n.pyJ,{title:a.repeatable?(0,i.jsx)(T,{}):void 0}):void 0,(0,i.jsxs)(n.KCD,{onValueChange:d,value:c,children:[(0,i.jsx)(n.mYC,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:o.tabs.map(e=>(0,i.jsx)(n.wfd,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.Xiv,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(n.JO$,{name:"edit"}),children:"Rename"}),(0,i.jsx)(n.Xiv,{color:"tomato",disabled:function(e){if(o.tabs.length<=1)return!0;let t=o.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(n.JO$,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),o.tabs.map(e=>(0,i.jsx)(n.e$b,{value:e.key,children:(0,i.jsx)(eP,{tabId:e.key})},e.key))]})]}),(null==m?void 0:m.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.vB)(a,t)),d(t)},tabIds:o.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(Z,{close:()=>{h(void 0)},initialTabKey:m.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.HO)(a,m.tabKey,t)),c===m.tabKey&&d(t)},tabIds:o.tabs.filter(e=>e.key!==m.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(F,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(r((0,u.F$)(a,m.tabKey)),c===m.tabKey){var e;let t=null===(e=o.tabs.find(e=>e.key!==m.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eH=l(1744),eR=l(40572),eX=l(64910),eU=l(9975),eB=l(41329),e$=l.n(eB);let eG=e=>{let{tabs:t,...l}=e;return(0,i.jsxs)(eU.fC,{...l,className:e$().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,i.jsx)(eU.aV,{className:e$().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,i.jsx)(eU.xz,{className:e$().trigger,value:l,children:(0,i.jsx)(n.xvT,{className:e$().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,i.jsx)(eU.VY,{className:e$().content,value:l,children:(0,i.jsx)(n.xrM,{className:e$().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eJ=l(11290),eq=l(88241),eQ=l(58133),eY=l(37628),eW=l.n(eY);let e0=e=>{var t,l;let{inline:a,...r}=e,o=(0,eQ.p)();if(!0===a)return(0,i.jsx)("code",{...r,className:eW().inlineCode});let s=(()=>{var e,t,l,i,n;if((null===(t=r.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(i=r.node)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(n=r.className)||void 0===n?void 0:n.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=r.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,i.jsx)(n.dnZ,{...r,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:o})},language:c,code:String(r.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},e1=e=>{let{markdown:t}=e;return(0,i.jsx)(eJ.D,{children:t,linkTarget:"_blank",remarkPlugins:[eq.Z],components:{code:e=>(0,i.jsx)(e0,{...e}),h1:e=>(0,i.jsx)(n.xvT,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,i.jsx)(n.xvT,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,i.jsx)(n.xvT,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,i.jsx)(n.xvT,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,i.jsx)(n.xvT,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,i.jsx)(n.xvT,{className:eW().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,i.jsx)(n.xvT,{className:eW().section,children:e.children,component:"pre",variant:"normal"})}})};async function e4(e){let t=JSON.parse(e),{errors:l,documentation:i}=await en.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return i}var e8=l(83321),e5=l.n(e8);let e3=e=>{var t;let{model:l}=e,a=(0,eQ.p)(),r=(t={kind:"PageSnippet",data:{model:l}},(0,ei.QT)(e4,[JSON.stringify(t)])),{completeStep:o}=(0,et.k)();return 0===r.length?null:(0,i.jsxs)(n.VqE,{size:"small",trigger:(0,i.jsx)(n.zxk,{color:"grey",onClick:()=>{o("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(n.fKu,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:e5().content,children:r.length>1?(0,i.jsx)(eG,{style:{flex:1},tabs:r.map((e,t)=>{let{label:l,content:n}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,i.jsx)(e1,{markdown:n})}})}):(0,i.jsx)(n.xrM,{style:{flex:1,padding:16},children:(0,i.jsx)(e1,{markdown:r[0].content})})})]})},e6=e=>{let{model:t}=e;return(0,i.jsx)("div",{children:(0,i.jsx)(L.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(n.zxk,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(e3,{model:t})})})})},e2=()=>{let e=(0,o.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eR.Jk)(t,(0,h.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eH.TG)(t)||e.replace("/")},[t,e]),t&&(0,eH.TG)(t))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,i.jsx)(e7,{customType:t.local})]}):(0,i.jsx)(x.LN,{})},e7=e=>{let{customType:t}=e;return null===t?(0,i.jsx)(x.LN,{}):(0,i.jsx)(x.LN,{children:(0,i.jsx)(S,{initialCustomType:_.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:r,setCustomType:o}=e,s=(0,u.y6)(r),c=h.cd[t.format],p=g.$[t.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(x.wd,{children:[(0,i.jsx)(x.Xq,{url:c.tablePagePathname}),(0,i.jsxs)(x.Cx,{children:[(0,i.jsx)(d.g,{children:p.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(l=r.label)&&void 0!==l?l:r.id})]}),(0,i.jsxs)(x.K2,{children:[(0,i.jsx)(m.X,{status:a}),"page"===r.format?(0,i.jsx)(e6,{model:r}):void 0,(0,i.jsx)(eX._,{isChangesLocal:!0,format:s,customType:r,setLocalCustomType:o})]})]}),(0,i.jsx)(x.RN,{children:(0,i.jsx)(n.xuv,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eK,{})})})]})}})})}},61502:function(e,t,l){"use strict";l.d(t,{E:function(){return n}});var i=l(29806);function n(e){var t,l;let[n,a]=(0,i.f)(),r=async t=>{let l={...n,labs:{...n.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await a(l)};return[{enabled:null!==(l=null==n?void 0:null===(t=n.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},r]}},29806:function(e,t,l){"use strict";l.d(t,{f:function(){return a}});var i=l(18566),n=l(70647);function a(){return[(0,i.QT)(r,[]),async e=>{await n.managerClient.project.writeSliceMachineConfig({config:e}),(0,i.VA)(r,[],e)}]}async function r(){return n.managerClient.project.getSliceMachineConfig()}},17889:function(e,t,l){"use strict";l.d(t,{c:function(){return f}});var i=l(52322),n=l(2784),a=l(36131),r=l(75289),o=l(93188),s=l(65856),c=l(88932),d=l(3181),u=l(99510),m=l(70647);async function h(e){let{sliceName:t,libraryName:l,onSuccess:i}=e;try{let e=(0,d.fo)(t),{errors:n}=await m.managerClient.slices.createSlice({libraryID:l,model:e});if(n.length>0)throw n;o.Xe.track({event:"slice:created",id:(0,u.MP)(t),name:t,library:l}),await i(e)}catch(l){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,l),c.Am.error(e)}}var x=l(80546),p=l(1490),v=l(41067),y=l(28801),j=l(99923);let f=e=>{let{onClose:t,onSuccess:l,localLibraries:c,remoteSlices:d}=e,{createSliceSuccess:u}=(0,v.Z)(),[m,f]=(0,n.useState)(!1),{syncChanges:g}=(0,x.g)(),{completeStep:b}=(0,s.k)(),S=async e=>{let t=e.sliceName,i=e.from;f(!0),await h({sliceName:t,libraryName:i,onSuccess:async e=>{u((await (0,o.y0)()).libraries),l(e,i),g(),b("createSlice")}})};return(0,i.jsx)(p.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:m,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{S(e)},initialValues:{sliceName:"",from:c[0].name},validate:e=>(0,j.h)(e,c,d),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:l,setFieldValue:n,errors:o}=e;return(0,i.jsxs)(r.xu,{children:[(0,i.jsx)(y.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?o.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(r.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(a.ZP,{name:"from",options:c.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void n("from",e.value):null,defaultValue:{value:l.from,label:l.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},99923:function(e,t,l){"use strict";l.d(t,{h:function(){return s}});var i=l(96009),n=l.n(i),a=l(74600),r=l.n(a),o=l(17186);function s(e,t,l){let{sliceName:i}=e;return i?o.lS.includes(i.toLowerCase())?{sliceName:'Name "'.concat(i,'" is reserved for Slice Machine use.')}:o.xo.exec(i)?r()(n()(i)).replace(/\s/gm,"")!==i.trim()?{sliceName:"Value has to be PascalCased."}:i.match(/^\d/)?{sliceName:"Value cannot start with a number."}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...l.map(e=>e.name)].includes(i)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed."}:{sliceName:"Cannot be empty"}}},42849:function(e,t,l){"use strict";var i=l(52322),n=l(75289);t.Z=function(e){let{elems:t,renderElem:l,defineElementKey:a,gridTemplateMinPx:r="320px",gridGap:o="16px",sx:s}=e;return(0,i.jsx)(n.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(r,", 1fr))"),gridGap:o,pt:2,...s},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:l(e,t)},"".concat(a(e),"-").concat(t+1)):null)})}},41329:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},83321:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},37628:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},17766:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[574],{80775:function(e,t,n){"use strict";n.d(t,{aV:function(){return s},Bu:function(){return d}});var i=n(52322),l=n(7729),r=n(6277),o=n(13938),a=n.n(o);let s=e=>{let{border:t=!0,...n}=e;return(0,i.jsx)("div",{...n,className:(0,r.Z)(a().root,t&&a()["root-border"])})},d=e=>{let{actions:t,children:n,toggle:r,...o}=e;return(0,i.jsxs)("div",{...o,className:a().header,children:[(0,i.jsx)(l.xvT,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:n}),r,t?(0,i.jsx)("div",{className:a().headerActions,children:t}):null]})}},87782:function(e,t,n){"use strict";n.d(t,{J9:function(){return i},U:function(){return r},XU:function(){return a},fF:function(){return l}});let i=[{name:"Image",description:"A responsive image.",icon:"image",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295520/DEV_TOOLS/SM_FIELDS/Type_Image_zyatxy.png",type:"Image"},{name:"Text",description:"A text string without formatting.",icon:"title",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295529/DEV_TOOLS/SM_FIELDS/Type_Key_Text_xrqf45.png",type:"Text"},{name:"Rich Text",description:"Text with formatting options.",icon:"textFields",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295530/DEV_TOOLS/SM_FIELDS/Type_Rich_Text_fxdyar.png",type:"StructuredText"},{name:"Boolean",description:"A true or false toggle.",icon:"toggleOff",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295526/DEV_TOOLS/SM_FIELDS/Type_Boolean_cbwg8k.png",type:"Boolean"},{name:"Number",description:"An integer or float.",icon:"pin",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_Number_o3olop.png",type:"Number"},{name:"Select",description:"A dropdown of options.",icon:"arrowDropDownCircle",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Select_bedjei.png",type:"Select"},{name:"Link",description:"A link to a website, asset, or document.",icon:"link",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295528/DEV_TOOLS/SM_FIELDS/Type_Link_bgslgy.png",type:"Link"},{name:"Link To Media",description:"A link to a media asset.",icon:"attachFile",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_LinkToMedia_m2p0ce.png",type:"Link",variant:"LinkToMedia"},{name:"Color",description:"A color in hex format.",icon:"colorLens",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295521/DEV_TOOLS/SM_FIELDS/Type_Color_nyoeit.png",type:"Color"},{name:"Date",description:"A date without time.",icon:"dateRange",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295525/DEV_TOOLS/SM_FIELDS/Type_Date_dsuaeq.png",type:"Date"},{name:"Table",description:"A structured table.",icon:"table",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1737381854/FIELDS_SM/Table_f47jnq.png",type:"Table"},{name:"Timestamp",description:"A date and time.",icon:"schedule",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295524/DEV_TOOLS/SM_FIELDS/Type_Timestamp_fkr5iw.png",type:"Timestamp"},{name:"Embed",description:"A video, song, or oEmbed link.",icon:"code",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295523/DEV_TOOLS/SM_FIELDS/Type_Embed_wwssvd.png",type:"Embed"},{name:"Geopoint",description:"A geographical coordinate.",icon:"place",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_GeoPoint_lpq0sm.png",type:"GeoPoint"},{name:"Content Relationship",description:"A reference to a Prismic document.",icon:"settingsEthernet",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Content_RelationShip_s4z4nh.png",type:"Link",variant:"ContentRelationship"}],l={name:"UID",description:"Unique Identifier",icon:"tag",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_UID_hrwzug.png",type:"UID"},r={name:"Repeatable Group",description:"A set of fields that editors can repeat.",icon:"createNewFolder",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721314577/DEV_TOOLS/SM_FIELDS/Type_Group_uwwco0.png",type:"Group"},o={...r,variant:"NestedGroup"},a=[...i,l,r,o]},6697:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});var i=n(52322),l=n(7729);let r=e=>{let t;let{status:n}=e;switch(n){case"pending":t={icon:(0,i.jsx)(l._3P,{color:"grey11"}),text:"Saving..."};break;case"failed":t={icon:(0,i.jsx)(l.JO$,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":t={icon:(0,i.jsx)(l.JO$,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(l.xuv,{gap:8,alignItems:"center",children:[t.icon,(0,i.jsx)(l.xvT,{color:"grey11",children:t.text})]})}},81271:function(e,t,n){"use strict";n.d(t,{S:function(){return o}});var i=n(52322),l=n(7729),r=n(87782);function o(e){let{open:t,onOpenChange:n,disabled:o=!1,onSelectField:s,fields:d,triggerDataTestId:c="add-field",trigger:u}=e,p=d.filter(e=>r.J9.some(t=>t.name===e.name)||e.name===r.fF.name),m=d.find(e=>e.name===r.U.name);return(0,i.jsxs)(l.h_2,{open:t,onOpenChange:n,children:[(0,i.jsx)(l.$FS,{disabled:o,children:null!=u?u:(0,i.jsx)(l.zxk,{startIcon:"add",color:"grey","data-testid":c,children:"Add a field"})}),(0,i.jsxs)(l.AWV,{align:"end",maxHeight:400,collisionPadding:8,children:[(0,i.jsx)(l.Juw,{children:"Single fields"}),p.map(e=>(0,i.jsx)(a,{field:e,onSelectField:s},e.name)),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Juw,{children:"Set of fields"}),(0,i.jsx)(a,{field:m,onSelectField:s})]})]})]})}function a(e){let{field:t,onSelectField:n}=e,{type:r,variant:o,name:a,icon:s,description:d,thumbnail:c}=t;return(0,i.jsx)(l.Xiv,{startIcon:(0,i.jsx)(l.JO$,{name:s,size:"large"}),description:d,onSelect:()=>n(null!=o?o:r),renderTooltip:e=>(0,i.jsx)(l.ua7,{visible:!0,variant:"custom",content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Eep,{src:c,borderRadius:4,sx:{height:170,width:278},animateOnLoad:!1}),(0,i.jsx)(l.xvT,{color:"white",children:"How it will look for content editors."})]}),align:"start",side:"left",sideOffset:4,animation:"none",children:e}),children:a},"".concat(r).concat(o?"-".concat(o):""))}},47760:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var i=n(52322),l=n(61183);n(2784);var r=n(59326),o=n(75289);l.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 s=e=>{var t;let{children:n,lang:s,sx:d,codeStyle:c,codeClass:u,Header:p}=e,{theme:m}=(0,r.B7)(),x=s?l.Z.highlight(n,{language:"vue"===s?"html":s}).value:l.Z.highlightAuto(n,a).value;return(0,i.jsxs)(o.kC,{as:"pre",sx:d,children:[p?(0,i.jsx)(p,{}):null,(0,i.jsx)("code",{className:"hljs".concat(u?" ".concat(u):""),style:{overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(t=m.colors)||void 0===t?void 0:t.textClear),...c},dangerouslySetInnerHTML:{__html:x}})]})}},28325:function(e,t,n){"use strict";n.d(t,{J:function(){return o},k:function(){return r}});var i=n(52322);n(2784);var l=n(75289);let r=e=>{let{children:t,sx:n,...r}=e;return(0,i.jsx)(l.xu,{sx:{display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between",...n},...r,children:t})},o=e=>{let{children:t,cols:n=2}=e;return(0,i.jsx)(l.xu,{sx:{flex:"0 ".concat(100/n-1,"%"),mb:1},children:t})}},81699:function(e,t,n){"use strict";n.d(t,{kp:function(){return d},sP:function(){return c},w8:function(){return u},Hq:function(){return m}});var i,l,r=n(52322),o=n(63397),a=n(2784),s=n(75289),d=e=>{let{field:t,meta:n,fieldName:i,label:l,focusOnNewEntry:d=!0,inputPlaceholder:c,buttonLabel:u}=e,[p,m]=(0,a.useState)(n.value.length),x=(0,a.useRef)(Array(n.value.length));return(0,a.useEffect)(()=>{x.current=x.current.slice(0,n.value.length)},[n.value.length]),(0,a.useEffect)(()=>{let e=x.current.length;d&&e>p&&x.current[e-1].focus(),m(e)},[x.current.length,d,p]),(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(s.__,{variant:"label.primary",htmlFor:i,children:[l,n.touched&&n.error?(0,r.jsx)(s.xv,{as:"span",variant:"text.labelError",children:n.error}):null]}),(0,r.jsx)(o.F2,{name:i,id:i,...t,render:e=>(0,r.jsxs)("div",{children:[t.value&&t.value.length>0?t.value.map((t,n)=>(0,r.jsxs)(s.kC,{my:2,children:[(0,r.jsx)(s.II,{placeholder:c,name:"".concat(i,".").concat(n),value:t,ref:e=>x.current[n]=e,onChange:t=>{let{target:{value:i}}=t;return e.replace(n,i)}}),(0,r.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:()=>e.remove(n),children:"-"})]},"".concat(i,"-").concat(+n+1))):null,(0,r.jsx)(s.zx,{type:"button",onClick:()=>e.insert(t.value.length,""),children:u})]})})]})},c=e=>{let{initialValues:t,meta:n,label:i,fieldName:l,onChange:a,...d}=e;return(0,r.jsxs)(s.__,{variant:"label.border",...d,children:[(0,r.jsx)(o.gN,{as:s.XZ,type:"checkbox",name:l,onChange:()=>a(!n.value),checked:n.value}),i]})},u=e=>{let{field:t,label:n,defaultValue:i,onChange:l,controlledValue:o,setControlledValue:s,buildControlledValue:d}=e,[u,p]=(0,a.useState)(i||t.defaultValue||!1);return(0,a.useEffect)(()=>{d?s(d(o,u)):s(d)},[u,o,d]),(0,r.jsx)(c,{meta:{value:u},fieldName:t.name,onChange:e=>p(e)&&l&&l(e),label:"function"==typeof n?n(o,u):n})};(i=l||(l={}))[i.ERROR=0]="ERROR",i[i.DISABLED=1]="DISABLED",i[i.WARNING=2]="WARNING";let p=e=>{let t={"&::placeholder":{color:"#C9D0D8"}};switch(e){case 1:return{...t,border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"};case 0:return{...t,border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}};case 2:return{...t,border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}};default:return t}},m=e=>{let{sx:t={},field:n,meta:i,formField:l,fieldName:a,fields:d,initialValues:c,isDisabled:u,autoFocus:m}=e,x=i.error?0:u||l.disabled?1:void 0;return(0,r.jsxs)(s.xu,{sx:t,children:[(0,r.jsxs)(s.__,{variant:"label.primary",htmlFor:a,children:[l.label||a,i.touched&&i.error?(0,r.jsx)(s.xv,{as:"span",variant:"text.labelError",children:i.error}):null]}),(0,r.jsx)(o.gN,{id:a,name:a,type:"text",placeholder:l.placeholder||l.label||a,...l.fieldLevelValidation&&c?{validate:e=>l.fieldLevelValidation&&l.fieldLevelValidation({value:e,fields:d,initialId:c.id})}:null,...n,as:s.II,sx:p(x),disabled:u||l.disabled,autoFocus:null!=m?m:l.autoFocus})]})}},89753:function(e,t,n){"use strict";var i=n(52322),l=n(2784),r=n(75289);let o=(0,l.forwardRef)((e,t)=>{let{children:n,Component:l=r.kC,sx:o={},...a}=e;return(0,i.jsx)(l,{as:"li",sx:{p:3,mx:3,alignItems:"center",variant:"styles.listItem",...o},ref:t,...a,children:n})});t.Z=o},4687:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var i=n(52322),l=n(7729),r=n(5446),o=n(2784),a=n(40023),s=n(951),d=n(8799),c=n(18978),u=n(59326),p=n(75289),m=n(89753),x=n(96666),h=n(33710),f=n(28316),g=n(65077);let v=e=>{let{children:t}=e;return(0,f.createPortal)((0,i.jsx)(g.xR,{children:t}),document.body)},b=e=>{let{text:t,as:n,sx:l={},...r}=e,a=(0,o.useRef)(null),[s,d]=(0,o.useState)(null),c=()=>{d(a.current&&a.current.offsetWidth<a.current.scrollWidth)};return(0,o.useEffect)(()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.xv,{"data-for":t,"data-tip":!0,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l},as:n,ref:a,...r,children:t}),s&&(0,i.jsx)(v,{children:(0,i.jsx)(h.Z,{id:t,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:t})})]})};var y=e=>{var t,n;let{text:l,sliceFieldName:r,theme:o,WidgetIcon:a}=e;return(0,i.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,i.jsx)(a,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary,flexShrink:0}}),(0,i.jsx)(b,{text:l,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,i.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear",overflow:"hidden",textOverflow:"ellipsis"},"data-testid":"field-id",children:r})]})},j=function(e){let{item:t,index:n,deleteItem:h,enterEditMode:f,modelFieldName:g,renderFieldAccessor:v,HintElement:b,CustomEditElement:j,CustomEditElements:k,widget:S,draggableId:_,testId:T,isRepeatableCustomType:I,children:F}=e,{theme:E}=(0,u.B7)(),{key:C,value:{config:w,type:L}}=t,O=!!(("Link"===L||"Group"===L)&&(null==w?void 0:w.repeat));return(0,i.jsx)(o.Fragment,{children:(0,i.jsx)(a._l,{draggableId:_,index:n,children:e=>{var a,u,_,M,D;return(0,i.jsx)(o.Fragment,{children:(0,i.jsxs)(m.Z,{"data-testid":T,ref:e.innerRef,...e.draggableProps,Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,i.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,i.jsx)(x.Z,{label:"Reorder slice field (drag and drop)",Icon:c.Fm7,color:null===(a=E.colors)||void 0===a?void 0:a.icons,mr:1,mt:3,...e.dragHandleProps}),(0,i.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,i.jsx)(y,{theme:E,text:(null==w?void 0:w.label)||C,sliceFieldName:v&&v(C),WidgetIcon:S.Meta.icon}),(0,i.jsxs)(p.kC,{sx:{flex:"0 0 auto"},children:[O&&(0,i.jsx)(l.Cts,{title:"Repeatable",color:"purple",size:"medium",sx:{alignSelf:"center",marginInline:16}}),k||null,j||(0,i.jsx)(x.Z,{size:22,Icon:s.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(u=E.colors)||void 0===u?void 0:u.icons,flexShrink:0},onClick:()=>f([C,t.value],g,n)}),!(!0===I&&"UID"==L)&&(0,i.jsxs)(r.v2,{children:[(0,i.jsx)(r.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,i.jsx)(d.FQA,{size:20,color:null===(_=E.colors)||void 0===_?void 0:_.icons,style:{pointerEvents:"none"}})}),(0,i.jsx)(r.qy,{style:{background:null===(M=E.colors)||void 0===M?void 0:M.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(D=E.colors)||void 0===D?void 0:D.borders,outline:"0"},children:(0,i.jsx)(r.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:()=>h(C),children:"Delete field"})})]})]})]}),b||null]})]}),F]})})}})})}},96666:function(e,t,n){"use strict";var i=n(52322),l=n(75289);let r=(e,t)=>t?{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.error)}}:e?{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.primary)}}:{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.borders)}};t.Z=e=>{let{sx:t=null,onClick:n=()=>null,label:o,Icon:a,error:s=null,size:d=16,fitButton:c=!1,active:u=!1,useActive:p=!1,activeSx:m=r,...x}=e;return(0,i.jsx)(l.hU,{onClick:n,"aria-label":o,type:"button",sx:{...c?{width:d,height:d}:null,...p&&m(u,s),...t},...x,children:(0,i.jsx)(a,{size:d})})}},4205:function(e,t,n){"use strict";var i=n(52322),l=n(63397),r=n(2784),o=n(75289),a=n(81699),s=n(1646);t.Z=e=>{let{fieldName:t,formField:n,fields:d,initialValues:c,autoFocus:u}=e,[p,m,x]=(0,l.U$)(t),h=n.component;return(0,i.jsx)(o.xu,{sx:{mt:2,alignItems:"center",...n.type===s.h.CHECKBOX?{display:"flex",height:"130%"}:null},children:h?(0,i.jsx)(h,{meta:m,field:p,helpers:x,fieldName:t,formField:n,initialValues:c}):(0,i.jsxs)(r.Fragment,{children:[n.type===s.h.INPUT?(0,i.jsx)(a.Hq,{meta:m,field:p,fields:d,formField:n,fieldName:t,initialValues:c,autoFocus:u}):null,n.type===s.h.CHECKBOX&&(0,i.jsx)(a.sP,{meta:m,label:n.label,fieldName:t,initialValues:c,onChange:e=>x.setValue(e)})]})})}},64602:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var i=n(52322),l=n(37149),r=n.n(l),o=n(59326),a=n(75289),s=n(65413),d=n(76805),c=n(2784),u=n(92928);let p=e=>{let{children:t,...n}=e;return(0,i.jsx)(a.xu,{as:"ul",sx:{p:0,m:0,px:e=>"calc(".concat(e.space[3],"px + 8px)"),borderBottom:"1px solid #DFE1E5",position:"relative"},...n,children:t})};p.tabsRole="TabList";let m=e=>{let{children:t,...n}=e,{theme:l}=(0,o.B7)();return(0,i.jsx)(u.OK,{...n,style:{margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0",...n.selected?{borderBottom:"3px solid ".concat(l.colors.primary),color:l.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}},children:t})};m.tabsRole="Tab";var x=(0,c.memo)(e=>{let{children:t,Footer:n,Header:l,tabs:r,bodySx:o,footerSx:s,defaultIndex:x=0}=e,[h,f]=(0,c.useState)(x);return(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:0,...s},bodySx:{p:0,...o},sx:{border:"none"},Header:l,Footer:n,children:(0,i.jsxs)(u.mQ,{defaultIndex:x,onSelect:e=>f(e),children:[(0,i.jsx)(p,{children:(r||[]).map(e=>(0,i.jsx)(m,{children:e},e))}),c.Children.map(t,(e,t)=>(0,i.jsx)(a.xu,{sx:{p:e=>"calc(".concat(e.space[3],"px + 8px)"),display:t===h?"block":"none"},children:(0,i.jsx)(u.x4,{children:e})}))]})})}),h=n(28325),f=e=>{var t,n;let{text:l,sliceFieldName:r,theme:o,WidgetIcon:s}=e;return(0,i.jsxs)(a.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(s,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary}}),(0,i.jsx)(a.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:l}),(0,i.jsx)(a.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},g=n(11104),v=n(22863),b=n(5632),y=n(65186),j=n(17186);let k=()=>{let e=(0,b.useRouter)();return(0,i.jsxs)(a.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,i.jsx)(y.wr$,{size:48,color:"#C9D0D8"}),(0,i.jsx)(a.xu,{sx:{height:"12px"}}),(0,i.jsx)(a.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,i.jsx)(a.xu,{sx:{height:"8px"}}),(0,i.jsx)(a.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,i.jsx)(a.xu,{sx:{height:"24px"}}),(0,i.jsx)(a.zx,{onClick:t=>{t.preventDefault(),window.open("".concat(e.asPath,"/simulator"),j.pq)},children:"Go to the Slice Simulator"})]})};var S=n(18493),_=n(85357),T=n(38369),I=n(4205),F=n(63397),E=n(99510);function C(){let[{value:e}]=(0,F.U$)("config.label"),[{value:t},n,i]=(0,F.U$)("id"),l=(0,c.useRef)(null!=n.initialValue&&n.initialValue.length>0);(0,c.useEffect)(()=>{l.current||null==e||i.setValue((0,E.lV)(e),!1)},[e]),(0,c.useEffect)(()=>{let n=null==t||0===t.length;if(l.current){if(!n)return;l.current=!1}else n||null!=e&&t===(0,E.lV)(e)||(l.current=!0)},[t])}var w=(0,c.memo)(e=>{let{formId:t,initialValues:n,validationSchema:l,onSave:r,FormFields:o,children:s}=e;return(0,i.jsx)(a.xu,{children:(0,i.jsx)(F.J9,{initialValues:n,validationSchema:l,onSubmit:(e,t)=>{let{id:n,...i}=e;r({newKey:n,value:Object.entries(i).reduce((e,t)=>{let[n,i]=t;if(typeof i!==Boolean&&!i){var l;let t=null===(l=o[n])||void 0===l?void 0:l.defaultValue;if(void 0!==t)return{...e,[n]:t}}return{...e,[n]:i}},{})})},children:e=>(0,i.jsxs)(F.l0,{id:t,children:[(0,i.jsx)(C,{}),s({...e,initialValues:n})]})})})});function L(e){let{children:t}=e,n=(0,d.W)();return(0,i.jsx)(a.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n},children:t})}r().setAppElement("#__next");var O=e=>{let{close:t,data:n,fields:l,onSave:r,zoneType:d}=e,{theme:c}=(0,o.B7)();if(!n.isOpen)return null;let{field:[u,p]}=n,m=(0,T.t)(S.C,p.config,p.type);if(!m)return(0,i.jsxs)("div",{children:[p.type," not found"]});let{Meta:{icon:b},FormFields:y,Form:j,schema:F}=m,E={...(0,v.f7)((0,_.B9)(y,"id")),...m.prepareInitialValues?m.prepareInitialValues(p.config):p.config},{res:C,err:O}=(()=>{try{return{res:F.validateSync({type:p.type,config:E},{stripUnknown:!0})}}catch(e){return{err:e}}})();O&&(console.error("[EditModal] Failed to validate field of type ".concat(p.type,".\n Please update model.json accordingly.")),console.error(O));let M={id:u,config:C?C.config:E},[D,A]=y.id.validate.matches,N=s.object().shape({id:s.string().matches(D,A).min(3).max(35).required(),config:F.fields.config}),q="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,i.jsx)(g.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,i.jsx)(w,{apiId:u,formId:q,initialValues:M,validationSchema:N,FormFields:y,onSave:e=>{let{newKey:n,value:i}=e;r({apiId:u,newKey:n,value:{...p,...i}}),t()},children:e=>{let{values:{id:n,config:{label:r}},isValid:o,isSubmitting:s,initialValues:p}=e,m=j?(0,i.jsx)(j,{...e,fields:l},"field-model-tab-content"):(0,i.jsx)(h.k,{children:Object.entries(y).map(e=>{let[t,n]=e;return(0,i.jsx)(h.J,{children:(0,i.jsx)(I.Z,{fieldName:(0,v.lm)(t),formField:n,fields:l,initialValues:p,autoFocus:""===u&&void 0})},t)})},"field-model-tab-content"),g=["Field Model"],S=[m];if("slice"===d){let e=(0,i.jsx)(a.xu,{children:(0,i.jsx)(k,{})},"mock-data-tab-content");g.push("Mock Data"),S.push(e)}return(0,i.jsx)(x,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:(0,i.jsxs)(L,{children:[(0,i.jsx)(f,{theme:c,text:r||n,WidgetIcon:b}),(0,i.jsx)(a.x8,{onClick:t,type:"button"})]}),Footer:(0,i.jsxs)(a.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(a.xu,{sx:{ml:"auto"}}),(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:t,variant:"secondary",children:"Cancel"}),(0,i.jsx)(a.zx,{form:q,type:"submit",disabled:!o&&s,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:S})}})})}},56309:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var i=n(52322),l=n(2784),r=n(49857),o=n(70647),a=n(77245),s=n(8799),d=n(65186),c=n(59326),u=n(75289),p=n(47760);let m={position:"relative",top:"3px"};var x=e=>{var t,n,r;let{code:o,lang:x}=e,{theme:h}=(0,c.B7)(),[f,g]=(0,l.useState)(!1);return o?(0,i.jsxs)(u.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,i.jsxs)(u.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,i.jsx)(s.vcz,{size:26,color:null==h?void 0:null===(t=h.colors)||void 0===t?void 0:t.icons,style:{border:"1px solid",borderColor:null==h?void 0:null===(n=h.colors)||void 0===n?void 0:n.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,i.jsx)(p.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:x,children:o})]}),(0,i.jsx)(u.xu,{children:(0,i.jsxs)(u.zx,{"aria-label":f?"Code snippet copied":"Copy code snippet",onClick:()=>{o&&navigator.clipboard.writeText(o).then(()=>{g(!0),setTimeout(()=>{g(!1)},1200)})},variant:"textButton",children:[f?(0,i.jsx)(d.HhX,{size:16,color:null==h?void 0:null===(r=h.colors)||void 0===r?void 0:r.success,style:m}):(0,i.jsx)(a.LhG,{size:16,style:m}),(0,i.jsx)(u.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},h=e=>{let{show:t,renderHintBase:n,item:l,hintItemName:a}=e,s=n({item:l}),d=[s];if("Link"===l.value.type){var c,u,p,m,h;null!==(m=null===(c=l.value.config)||void 0===c?void 0:c.allowText)&&void 0!==m&&m&&d.push("allowText"),null!==(h=null===(u=l.value.config)||void 0===u?void 0:u.repeat)&&void 0!==h&&h&&d.push("repeat"),(null===(p=l.value.config)||void 0===p?void 0:p.variants)&&d.push("variants")}let{data:f,error:g}=(0,r.ZP)(d.join("$"),async()=>await o.managerClient.snippets.readSnippets({fieldPath:s.split("."),model:l.value,itemName:a}));if(g&&console.error(g),!f||g)return null;let v=f.snippets||[];return v[0]?(0,i.jsx)("div",{style:{display:t?"initial":"none"},children:(0,i.jsx)(x,{code:v[0].code,lang:v[0].language})}):null}},47655:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var i=n(52322),l=n(7729),r=n(13980),o=n(2784),a=n(65077),s=n(93188),d=n(80775),c=n(87782),u=n(81271);function p(e){let{open:t,onOpenChange:n,onConfirm:r}=e;return(0,i.jsxs)(l.VqE,{open:t,onOpenChange:n,size:"small",children:[(0,i.jsx)(l.fKu,{title:"Static zone"}),(0,i.jsx)(l.cZJ,{children:(0,i.jsx)(l.xrM,{children:(0,i.jsxs)(l.xuv,{as:"article",flexDirection:"column",padding:16,gap:4,children:[(0,i.jsx)(l.xvT,{sx:{marginBottom:4},color:"purple9",variant:"smallBold",children:"About"}),(0,i.jsx)(l.xvT,{variant:"h3",children:"What is the static zone?"}),(0,i.jsx)(l.xvT,{color:"grey11",children:"The static zone in Prismic page types contain fields that are always present on the page. Use it for essential information like a page's title, page design settings, or metadata. Unlike slices, which can be added or removed, static zone fields remain fixed."}),(0,i.jsx)(l.nkn,{src:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1723540305/DEV_TOOLS/STATES/Explication_vide%CC%81o_zone_statique_phibeq.mp4",sizing:"contain",autoPlay:!0,loop:!0})]})})}),(0,i.jsx)(l.kXR,{children:(0,i.jsx)(l._dX,{size:"medium",sx:{flexGrow:1},onClick:()=>{r(),n(!1)},children:"Got it"})})]})}let m=(0,o.forwardRef)((e,t)=>{var n;return(0,i.jsx)(l.zxk,{...e,ref:t,startIcon:"add",color:"grey","aria-label":"Add a field","data-testid":null!==(n=e["data-testid"])&&void 0!==n?n:"add-field"})});function x(e){let{zoneTypeFormat:t,...n}=e;return"page"===t?(0,i.jsx)(f,{...n}):(0,i.jsx)(g,{...n})}let h=(0,i.jsx)("div",{style:{position:"absolute",bottom:0,right:0}});function f(e){let{disabled:t,fields:n,triggerDataTestId:r,onSelectField:a}=e,[s,d]=(0,o.useState)(!1),[c,x]=(0,o.useState)(!1),[f,g]=function(e,t,n){let{schema:i}={},l="".concat("slice-machine","_").concat(e),[r,a]=(0,o.useState)(()=>{try{let e=localStorage.getItem(l);if(null==e)return t;if(!i)return JSON.parse(e);return i.parse(JSON.parse(e))}catch(e){return console.warn("Error reading localStorage key “".concat(l,"”:"),e),t}});return(0,o.useEffect)(()=>{try{localStorage.setItem(l,JSON.stringify(r))}catch(e){console.warn("Error setting localStorage key “".concat(l,"”:"),e)}},[l,r]),[r,a]}("staticFieldsInfoDialogDismissed",!1);return(0,i.jsxs)(l.xuv,{position:"relative",children:[(0,i.jsx)(m,{onClick:()=>{f?d(!0):x(!0)},"data-testid":r}),(0,i.jsx)(p,{open:c,onOpenChange:e=>{x(e),e||d(!0)},onConfirm:()=>g(!0)}),(0,i.jsx)(u.S,{open:s,onOpenChange:d,disabled:t,onSelectField:a,fields:n,trigger:h})]})}function g(e){let{disabled:t,fields:n,triggerDataTestId:l,onSelectField:r}=e;return(0,i.jsx)(u.S,{disabled:t,onSelectField:r,fields:n,trigger:(0,i.jsx)(m,{"data-testid":l})})}var v=n(18493),b=n(45067),y=n(40023),j=n(75289),k=n(89753),S=n(4687),_=n(38369),T=n(56309),I=e=>{let{fields:t,title:n,tabId:l,enterEditMode:r,enterSelectMode:o,onDragEnd:a,renderFieldAccessor:s,onDeleteItem:d,onSave:c,showHints:u,renderHintBase:p,isRepeatable:m,testId:x,isRepeatableCustomType:h}=e;return(0,i.jsx)(y.Z5,{onDragEnd:a,children:(0,i.jsx)(y.bK,{droppableId:n,children:(e,n)=>(0,i.jsxs)(j.xu,{as:"ul",ref:e.innerRef,...e.droppableProps,"data-testid":x,sx:{paddingInline:"16px !important"},children:[t.map((e,t)=>{let{value:{config:a,type:x}}=e,f=(0,_.t)(v.C,a,x);if(!f)return(0,i.jsx)(k.Z,{children:(0,i.jsxs)(j.xv,{children:['Field type "',x,'" not supported']})});let g={item:e,index:t,tabId:l,widget:f,showHints:u,key:e.key,enterSelectMode:o,renderFieldAccessor:s,enterEditMode:r,parentSnapshot:n,deleteItem:d,saveItem:c,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:h,testId:"list-item-".concat(e.key)},b=(0,i.jsx)(T.Z,{item:e,show:u,isRepeatable:m,renderHintBase:p,hintItemName:f.hintItemName,Widgets:v.C,typeName:f.CUSTOM_NAME||f.TYPE_NAME});if(f.CustomListItem){let{CustomListItem:e}=f;return(0,i.jsx)(e,{...g,HintElement:b})}return(0,i.jsx)(S.Z,{...g,HintElement:b})}),e.placeholder]})})})},F=n(83288),E=n.n(F);let C=e=>{let{zoneType:t,heading:n="Your ".concat(t," has no fields yet"),action:r}=e;return(0,i.jsxs)("div",{className:E().root,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(l.xvT,{variant:"bold",children:n}),(0,i.jsx)(l.xvT,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),r]})},w=e=>{let t,{zoneType:n,zoneTypeFormat:r,tabId:p,title:m,fields:h,poolOfFieldsToCheck:f,widgetsArray:g,isRepeatable:y,onDeleteItem:j,onDragEnd:k,EditModal:S,onSave:_,dataTip:T,renderHintBase:F,renderFieldAccessor:E,testId:w,isRepeatableCustomType:L,emptyStateHeading:O}=e,M=(()=>{let e=!!Object.entries(f).find(e=>{let[,{value:t}]=e;return"UID"===t.type}),t=g.filter(e=>{let{TYPE_NAME:t}=e;return"UID"!==t});return e?t:[...t,g.find(e=>{let{TYPE_NAME:t}=e;return"UID"===t})]})(),[D,A]=(0,o.useState)(!1),[N,q]=(0,o.useState)({isOpen:!1}),R={onSelectField:e=>{q({isOpen:!0,field:["",v.C[e].create("")]})},fields:M.filter(Boolean).map(e=>{let{TYPE_NAME:t,CUSTOM_NAME:n}=e;return c.XU.find(e=>e.type===t&&(void 0===n||e.variant===n))}),triggerDataTestId:y?"add-field-in-items":void 0};return"slice"===n&&h.length>0?t=(0,i.jsx)(u.S,{...R}):"customType"===n&&(t=(0,i.jsx)(x,{...R,zoneTypeFormat:r})),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.Bu,{actions:(0,i.jsxs)(i.Fragment,{children:[h.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.xvT,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,i.jsx)(l.rsf,{checked:D,onCheckedChange:A,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"})]}),t]}),children:m}),0===h.length&&"slice"===n?(0,i.jsx)(C,{zoneType:"customType"===n?"page"===r?"page type":"custom type":n,heading:O,action:(0,i.jsx)(u.S,{...R})}):h.length>0?(0,i.jsx)(a.xR,{children:(0,i.jsx)(I,{tabId:p,isRepeatable:y,fields:h,showHints:D,dataTip:T,title:m,renderFieldAccessor:E,renderHintBase:F,enterEditMode:e=>{q({isOpen:!0,field:e});let[t,n]=e;s.Xe.track({event:"field:settings-opened",id:t,name:n.config.label,type:n.type,isInAGroup:!1,contentType:(0,b.T)(window.location.pathname)})},onDragEnd:k,onDeleteItem:j,onSave:_,testId:w,isRepeatableCustomType:L})}):void 0,(0,i.jsx)(S,{data:N,close:()=>{q({isOpen:!1})},onSave:_,fields:f,zoneType:n})]})};w.propTypes={isRepeatable:r.bool,title:r.string.isRequired,dataTip:r.string.isRequired,onSave:r.func.isRequired,onDragEnd:r.func.isRequired,onDeleteItem:r.func.isRequired,poolOfFieldsToCheck:(0,r.arrayOf)((0,r.shape)({key:r.string,value:r.object})),renderHintBase:r.func.isRequired,renderFieldAccessor:r.func.isRequired,widgetsArray:r.array.isRequired,fields:(0,r.arrayOf)((0,r.shape)({key:r.string.isRequired,value:(0,r.shape)({config:r.object,fields:r.array,type:r.string.isRequired})}))};var L=w},38369:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var i=n(59050);let l=(e,t,n)=>{if("Link"===n)switch(null==t?void 0:t.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}if(n===i.GroupFieldType){var l;return null!==(l=e.Group)&&void 0!==l?l:e.NestedGroup}return e[n]}},25273:function(e,t,n){"use strict";n.d(t,{Jp:function(){return o},OR:function(){return r}});var i=n(17186),l=n(37429);let r={label:(0,l.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)",!0),id:(0,l.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},e=>{let{value:t,fields:n,initialId:i}=e;return t?n.find(e=>{let{key:n}=e;return n===t})&&t!==i?'Field "'.concat(t,'" already exists.'):void 0:"Field is required"},void 0,"A unique identifier for the field (e.g. buttonLink)")},o={...r,placeholder:(0,l.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},37429:function(e,t,n){"use strict";n.d(t,{II:function(){return d},Jg:function(){return r}});var i=n(22863),l=n(1646);let r=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:l.h.CHECKBOX,validate:{required:(0,i.MJ)(t,s)},required:t,label:e,defaultValue:n,yupType:"boolean"}},o=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:o,max:a,required:s},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],{min:u,max:p,required:m,matches:x}=t||{};return{type:l.h.INPUT,label:e,validate:{required:(0,i.MJ)(m,s),min:(0,i.MJ)(u,o),max:(0,i.MJ)(p,a),matches:x},defaultValue:r,fieldLevelValidation:n,yupType:"string",placeholder:d,autoFocus:c}}},22863:function(e,t,n){"use strict";n.d(t,{MJ:function(){return a},f7:function(){return s},gc:function(){return d},lm:function(){return o}});var i=n(65413),l=n(1646);let r=e=>null===e.defaultValue?void 0:void 0!==e.defaultValue?e.defaultValue:e.type===l.h.CHECKBOX||(e.type===l.h.INPUT?"":e.type===l.h.SELECT?[]:void 0),o=e=>"id"===e?"id":"config.".concat(e),a=(e,t)=>Array.isArray(e)?e:"boolean"==typeof e&&e?t:null,s=e=>Object.entries(e).reduce((e,t)=>{let[n,i]=t,l=r(i);return void 0!==l?{...e,[n]:l}:e},{}),d=e=>i.object().shape(Object.entries(e).filter(e=>e).reduce((e,t)=>{let[n,l]=t,{validate:r,yupType:o}=l;if(!r)return e;if("function"==typeof r)return{...e,[n]:r(n,l)};let a=i[o]();return Object.entries(r).filter(e=>e&&e[1]).forEach(e=>{let[t,i]=e;if(i&&a[t]){a=a[t](...Array.isArray(i)?i:[i]);return}console.warn('Invalid Yup validator for field "'.concat(n,'"'))}),{...e,[n]:a}},{})).required().default(void 0).noUnknown(!0)},1646:function(e,t,n){"use strict";var i,l;n.d(t,{h:function(){return i}}),(l=i||(i={})).CHECKBOX="checkbox",l.INPUT="input",l.SELECT="select"},18493:function(e,t,n){"use strict";n.d(t,{C:function(){return th}});var i=n(52322),l=n(53085),r=n(65186),o=n(65413),a=n(75289),s=n(28325),d=n(4205),c=n(22863),u=n(25273),p=n(37429);let m={...u.OR,repeat:(0,p.Jg)("Repeatable",!1,!0)};var x=e=>{let{initialValues:t,fields:n,values:l,setFieldValue:r}=e,{config:{repeat:o}}=l;return(0,i.jsxs)(s.k,{children:[Object.entries(m).filter(e=>{let[t]=e;return"repeat"!==t}).map(e=>{let[l,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(l),formField:r,fields:n,initialValues:t})},l)}),(0,i.jsx)(s.J,{children:(0,i.jsx)(a.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,i.jsxs)(a.__,{variant:"label.border",sx:{mb:0},children:[(0,i.jsx)(a.XZ,{checked:o,onChange:()=>r("config.repeat",!o)}),"Repeatable"]})})})]})};let h={icon:r.iy3},f=e=>o.object().shape({type:o.string().matches(e,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),repeat:o.boolean().optional()})});function g(e){let{schemaTypeRegex:t,customListItem:n,customName:i,hintItemName:l}=e;return{Meta:h,Form:x,FormFields:m,schema:f(t),create:e=>({type:"Group",config:{label:e,repeat:!0,fields:[]}}),CustomListItem:n,TYPE_NAME:"Group",CUSTOM_NAME:i,hintItemName:l}}var v=n(59050),b=n(2784),y=n(40023),j=n(28316),k=n(93188),S=n(87782),_=n(81271),T=n(4687),I=n(64602),F=n(56309),E=n(38369),C=n(2439),w=n(85357),L=n(99510),O=n(45067),M=n(50268),D=n(44266);let A=e=>{let{tabId:t,widget:n,Widgets:l,widgetsArray:r,hintBase:o,parentSnapshot:s,showHints:d,isRepeatable:c,item:u,draggableId:p,saveItem:m,HintElement:x,...h}=e,[f,g]=(0,b.useState)({isOpen:!1}),A=e=>{var t;let{apiId:n,value:i}=e;null===(t=i.config)||void 0===t||t.label;let l=function(e){var t,n,i;let l=structuredClone(e.group);return null!==(n=l.config)&&void 0!==n||(l.config={}),null!==(i=(t=l.config).fields)&&void 0!==i||(t.fields={}),l.config.fields[e.fieldId]=e.field,l}({group:C.Fl.fromSM(u.value),fieldId:n,field:i});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(l),inGroupFieldAction:"add"}),(0,M.V)({id:n,field:i,isInAGroup:!0})},N=e=>{let{apiId:t,newKey:n,value:i}=e,l=i.type===v.GroupFieldType?C.Fl.fromSM(i):i,r=function(e){var t,n;let i=structuredClone(e.group);if(!(null===(t=i.config)||void 0===t?void 0:t.fields)||!(null===(n=e.group.config)||void 0===n?void 0:n.fields))return i;for(let t in i.config.fields={},e.group.config.fields)t===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[t]=e.group.config.fields[t];return i}({group:C.Fl.fromSM(u.value),previousFieldId:t,newFieldId:n,field:l});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(r),inGroupFieldAction:"update"}),(0,D.Z)({previousId:t,id:n,field:l,isInAGroup:!0})},q=e=>{let t=function(e){var t,n;let i=structuredClone(e.group);return null===(n=i.config)||void 0===n||null===(t=n.fields)||void 0===t||delete t[e.fieldId],i}({group:C.Fl.fromSM(u.value),fieldId:e});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(t)})},R=e=>{g({isOpen:!0,field:e});let[t,n]=e;k.Xe.track({event:"field:settings-opened",id:t,name:n.config.label,type:n.type,isInAGroup:!0,contentType:(0,O.T)(window.location.pathname)})};return(0,i.jsxs)(b.Fragment,{children:[(0,i.jsx)(T.Z,{item:u,widget:n,draggableId:p,...h,HintElement:x,CustomEditElements:[(0,i.jsx)(_.S,{onSelectField:e=>{g({isOpen:!0,field:["",l[e].create("")]})},fields:r.filter(Boolean).map(e=>{let{TYPE_NAME:t,CUSTOM_NAME:n}=e,i=S.XU.find(e=>e.type===t&&(void 0===n||e.variant===n));if(!i)throw Error("Field not found for widget: ".concat(t," - ").concat(n));return i})},"add-field-dropdown")],children:(0,i.jsx)(a.xu,{sx:{ml:4},children:(0,i.jsx)(y.Z5,{onDragEnd:e=>{if((0,w.uS)(e))return;let{source:t,destination:n}=e;if(!n)return;let{index:i}=t,{index:l}=n,r=function(e){var t;let n=structuredClone(e.group);if(!(null===(t=n.config)||void 0===t?void 0:t.fields))return n;let i=Object.entries(n.config.fields),[l]=i.splice(e.sourceIndex,1);return i.splice(e.destinationIndex,0,l),n.config.fields=Object.fromEntries(i),n}({group:C.Fl.fromSM(u.value),sourceIndex:i,destinationIndex:l});(0,j.flushSync)(()=>{m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(r)})})},children:(0,i.jsx)(y.bK,{droppableId:"".concat(t,"-").concat(u.key,"-zone"),children:e=>(0,i.jsxs)("ul",{ref:e.innerRef,...e.droppableProps,children:[u.value.config.fields.map((e,t)=>{let{value:{config:n,type:r}}=e,a=(0,E.t)(l,n,r);if(!a)return null;let s={item:e,index:t,widget:a,key:e.key,enterEditMode:R,deleteItem:q,saveItem:N,showHints:d,renderFieldAccessor:t=>"item".concat((0,L.Ti)(e.key)),draggableId:"group-".concat(u.key,"-").concat(e.key,"-").concat(t),testId:"list-item-group-".concat(u.key,"-").concat(e.key)},p=(0,i.jsx)(F.Z,{item:e,show:d,isRepeatable:c,renderHintBase:e=>{let{item:t}=e;return"".concat(o).concat((0,L.Ti)(t.key))},hintItemName:a.hintItemName,Widgets:l,typeName:a.CUSTOM_NAME||a.TYPE_NAME});if(a.CustomListItem){let{CustomListItem:e}=a;return(0,i.jsx)(e,{...s,HintElement:p})}return(0,i.jsx)(T.Z,{...s,HintElement:p})}),e.placeholder]})})})})}),(0,i.jsx)(I.Z,{data:f,close:()=>{g({isOpen:!1})},onSave:e=>""===e.apiId?A({...e,apiId:e.newKey}):N(e),fields:u.value.config.fields})]})},N={icon:r.hs8},q={label:u.Jp.label,id:u.Jp.id,placeholder_false:(0,p.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,p.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,p.Jg)("Default to true")},R=o.object().shape({type:o.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(q,"id"))}),V={icon:r.U8L},{TYPE_NAME:z,FormFields:B,schema:J}=(0,w.zg)("Color");var P=n(56580),Z=n(1744),G=n(40572),U=n(7729),H=n(63397);function $(e){let{checked:t,height:n=130,setFieldValue:l}=e,[r,o]=(0,b.useState)(null);return(0,i.jsx)(s.J,{children:(0,i.jsx)(a.kC,{sx:{mt:2,alignItems:"center",height:"".concat(n,"%")},children:(0,i.jsx)(a.__,{variant:"label.border",children:(0,i.jsxs)(U.xuv,{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",ref:o,children:[(0,i.jsxs)(a.kC,{children:[(0,i.jsx)(a.XZ,{checked:t,onChange:e=>{l("config.allowText",e.target.checked)}}),"Allow display text"]}),(0,i.jsx)(U.ua7,{container:r,align:"end",content:"Allow editors to customize the link display text",children:(0,i.jsx)(U.JO$,{name:"alert",size:"medium",color:"grey11"})})]})})})})}function W(e){let{checked:t,setFieldValue:n}=e;return(0,i.jsxs)(U.xuv,{flexDirection:"column",children:[(0,i.jsx)(a.__,{htmlFor:"repeat",variant:"label.primary",children:"Repeatable"}),(0,i.jsxs)(a.__,{variant:"label.border",sx:{display:"flex"},children:[(0,i.jsx)(a.XZ,{name:"repeat",checked:t,onChange:e=>{n("config.repeat",e.target.checked)}}),"Make this link repeatable (allows editors to create lists of links)"]}),(0,i.jsxs)(U.xuv,{alignItems:"center",gap:4,children:[(0,i.jsx)(U.JO$,{name:"alert",size:"medium",color:"grey11"}),(0,i.jsxs)(U.xvT,{variant:"normal",color:"grey11",children:["Repeatable link fields are returned as an array of links by the API."," ",(0,i.jsx)("a",{href:"https://prismic.io/docs/field",style:{textDecoration:"none"},target:"_blank",rel:"noopener noreferrer",children:(0,i.jsx)(U.xvT,{variant:"normal",color:"indigo11",children:"See documentation."})})]})]})]})}function K(e){var t,n;let{variants:l,onVariantsChange:r,error:o}=e,a=!!l,s=a?"Enabled":"Disabled",d="Options (".concat(null!==(t=null==l?void 0:l.length)&&void 0!==t?t:0,")"),c=(null!==(n=null==l?void 0:l.length)&&void 0!==n?n:0)>2,u=(0,b.useRef)();return(0,i.jsxs)(U.xuv,{overflow:"hidden",flexDirection:"column",border:!0,borderRadius:6,children:[(0,i.jsxs)(U.xuv,{border:{bottom:!0},padding:12,flexDirection:"column",gap:8,children:[(0,i.jsx)(U.xvT,{variant:"h4",color:"grey12",children:"Variants"}),(0,i.jsx)(U.xvT,{color:"grey12",children:'Add variants like "Primary" and "Secondary" to allow editors to choose the link\'s style by selecting one of them.'}),(0,i.jsxs)(U.xuv,{gap:8,children:[(0,i.jsx)(U.rsf,{checked:a,onCheckedChange:e=>{r(e?["Primary","Secondary"]:void 0)}}),(0,i.jsx)(U.xvT,{color:"grey11",children:s})]})]}),a&&(0,i.jsxs)(U.xuv,{border:{bottom:!0},padding:12,flexDirection:"column",gap:8,children:[(0,i.jsxs)(U.xvT,{variant:"h5",color:"grey11",children:[d,!!o&&(0,i.jsx)(U.xvT,{variant:"inherit",color:"tomato9",children:" ".concat(o)})]}),null==l?void 0:l.map((e,t)=>(0,i.jsxs)(U.xuv,{gap:4,alignItems:"center",children:[(0,i.jsx)(U.xuv,{flexGrow:1,backgroundColor:"white",padding:{inline:12,block:8},flexDirection:"column",border:!0,borderRadius:4,children:(0,i.jsx)(U.oil,{ref:e=>{u.current===t&&(u.current=void 0,null==e||e.focus())},placeholder:"Variant option (e.g. Primary)",value:e,onValueChange:e=>r(null==l?void 0:l.map((n,i)=>i===t?e:n))})}),c&&(0,i.jsx)(U.hU,{type:"button",icon:"delete",onClick:()=>r(null==l?void 0:l.filter((e,n)=>n!==t))})]},t)),(0,i.jsx)(U.xuv,{children:(0,i.jsx)(U.zxk,{invisible:!0,startIcon:"add",onClick:()=>{u.current=null==l?void 0:l.length,r([...null!=l?l:[],""])},children:"Add option"})})]}),(0,i.jsx)(U.xuv,{backgroundColor:"white",flexDirection:"column",padding:12,children:(0,i.jsxs)(U.xvT,{variant:"normal",color:"grey11",children:['Need additional properties similar to "Variants"?'," ",(0,i.jsx)("a",{href:"https://community.prismic.io/t/link-field-use-cases-share-your-requests-and-feedback/18146",target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:"Please provide your feedback here."})]})})]})}let X={...u.Jp};function Y(e){var t;let{variants:n,setFieldValue:l}=e,r="config.variants",[o,a]=(0,H.U$)(r),s=null===(t=a.error)||void 0===t?void 0:t.find(e=>e);return(0,i.jsx)(K,{variants:n,onVariantsChange:e=>l(r,e),error:s})}let Q={icon:r.$l_},ee=o.object().shape({label:o.string().optional(),useAsTitle:o.boolean().optional(),placeholder:o.string().optional(),select:o.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:o.array(o.string()).strict().optional(),masks:o.array(o.string()).optional(),tags:o.array(o.string()).optional(),allowTargetBlank:o.boolean().strict().optional(),allowText:o.boolean().strict().optional(),repeat:o.boolean().strict().optional(),variants:o.array(o.string().trim().required("Values can't be empty")).optional()}).required().default(void 0).noUnknown(!0),et=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ee.optional()});var en=n(36131);let ei={label:u.Jp.label,id:u.Jp.id,customtypes:{validate:()=>o.array().of(o.string())}},el={icon:r.I2R},er=ee.shape({label:o.string().max(35,"String is too long. Max: 35"),select:o.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:o.array(o.string()).strict().optional()}),eo=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:er}),{FormFields:ea,schema:es}=(0,w.zg)("Date"),ed={icon:r.f$3},{FormFields:ec,schema:eu}=(0,w.zg)("Embed"),ep={icon:r.xoN},em={label:u.Jp.label,id:u.Jp.id},ex=o.object().shape({type:o.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:o.object().shape({label:o.string()}).required().default(void 0).noUnknown(!0)}),eh={icon:r.lPv};var ef=n(8799),eg=n(81699),ev=n(96666);let eb=e=>{let{onClick:t,error:n,onDelete:l,active:o,text:s,sx:d}=e;return(0,i.jsx)(ev.Z,{useActive:!0,fitButton:!0,error:n,onClick:t,active:o,sx:{position:"relative",width:"64px",height:"64px",...d},Icon:()=>(0,i.jsxs)(b.Fragment,{children:[(0,i.jsxs)(a.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,i.jsx)(ef.jnY,{size:22}),(0,i.jsx)(a.xv,{mt:1,children:s})]}),l?(0,i.jsx)(a.Ct,{onClick:l,variant:"circle-right",children:(0,i.jsx)(r.B4e,{})}):null]})})},ey=e=>{let{onClick:t}=e;return(0,i.jsx)(ev.Z,{fitButton:!0,onClick:t,sx:{width:"64px",height:"64px",border:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}},Icon:()=>(0,i.jsx)(a.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(ef.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})})},ej=e=>{let{prefix:t,required:n=!1,display:l}=e,[r,o]=(0,H.U$)(t),a=n?"*":"";return l?(0,i.jsxs)(b.Fragment,{children:[(0,i.jsx)(ek,{name:"".concat(t,".name"),label:"Name".concat(a),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===t,meta:o}),(0,i.jsx)(eS,{name:"".concat(t,".width"),label:"Width (px)".concat(a),placeholder:" ",sx:{mb:3}}),(0,i.jsx)(eS,{name:"".concat(t,".height"),label:"Height (px)".concat(a),placeholder:" "})]}):null},ek=e=>{let{name:t,label:n,placeholder:l,meta:r,isConstraint:o,...a}=e,[s]=(0,H.U$)(t);return(0,i.jsx)(eg.Hq,{...a,fieldName:t,meta:r,formField:{label:n,placeholder:l},field:o?{value:"main",readOnly:!0}:{value:s.value},variant:o?"disabled":"primary"})},eS=e=>{let{name:t,label:n,placeholder:l,...r}=e,[o,a]=(0,H.U$)(t);return(0,i.jsx)(eg.Hq,{...r,fieldName:t,formField:{label:n,placeholder:l},meta:a,field:{min:0,type:"number",value:o.value||"",onKeyDown:e=>{("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}})},e_=()=>o.number().nullable().transform((e,t)=>""===t?null:e),eT={label:u.Jp.label,id:u.Jp.id,constraint:{validate:()=>o.object().defined().shape({width:e_(),height:e_()})},thumbnails:{validate:()=>o.array().defined().of(o.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;let t="number"==typeof e.width&&e.width,n="number"==typeof e.height&&e.height;return e.name&&(t||n)}}))}},eI={name:"",width:"",height:""},eF=function(){let{width:e,height:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!n||e||t?e||t?"".concat(e||"auto","x").concat(t||"auto"):"...":"auto"},eE=o.object().shape({type:o.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(eT,"id"))}),eC={icon:r.Fwj},ew={...u.Jp},eL={icon:r._b$},eO=ee.shape({select:o.string().required().matches(/^media$/,{excludeEmptyString:!0})}),eM=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:eO.optional()}),{FormFields:eD,schema:eA}=(0,w.zg)("Number"),eN={icon:r.KZU};var eq=n(1646);let eR=e=>"use first value as default ".concat(e?'("'.concat(e,'")'):""),eV=(e,t)=>t?e:void 0,ez={...u.Jp,default_value:{type:eq.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return o.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(t=>t===e)}})},component:e=>{var t;let{values:n}=(0,H.u6)(),l=null===(t=n.config)||void 0===t?void 0:t.options[0];return(0,i.jsx)(eg.w8,{...e,defaultValue:e.field.value,controlledValue:l,setControlledValue:e.helpers.setValue,buildControlledValue:eV,label:eR})}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:e=>!e.some(e=>!e||!e.length)}},component:e=>(0,i.jsx)(eg.kp,{label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option",...e})}},eB={icon:r.nwY},eJ=o.object().shape({type:o.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(ez,"id"))});var eP=n(47927),eZ=n(29259),eG=n.n(eZ),eU=n(85505),eH=n.n(eU),e$=n(34543);let eW=e=>t=>{let{size:n}=t;return(0,i.jsx)("span",{style:{fontSize:n},children:e})},eK=[{value:"paragraph",label:"P",icon:eW("p")},{value:"preformatted",label:"PRE",icon:eW("pre")},{value:"heading1",label:"H1",icon:eW("h1")},{value:"heading2",label:"H2",icon:eW("h2")},{value:"heading3",label:"H3",icon:eW("h3")},{value:"heading4",label:"H4",icon:eW("h4")},{value:"heading5",label:"H5",icon:eW("h5")},{value:"heading6",label:"H6",icon:eW("h6")},{value:"strong",label:"Strong",icon:eW((0,i.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eW((0,i.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eW((0,i.jsx)(e$.eR7,{}))},{value:"image",label:"image",icon:eW((0,i.jsx)(e$.LFN,{}))},{value:"embed",label:"embed",icon:eW((0,i.jsx)(e$.xqv,{}))},{value:"list-item",label:"list",icon:eW((0,i.jsx)(e$.SnF,{}))},{value:"o-list-item",label:"o",icon:eW((0,i.jsx)(ef.KyO,{}))},{value:"rtl",label:"rtl",icon:eW("rtl")}],eX=eK.map(e=>e.value),eY=e=>!eX.find(t=>!e.includes(t)),eQ=e=>{let t=e.split(",");return eK.reduce((e,n)=>{let{value:i}=n;return t.includes(i)?[...e,i]:e},[])};function e0(e,t){return(0,eP.has)("parent",e)&&eG()(e.parent)&&(0,eP.has)(t,e.parent)&&eH()(e.parent[t])?e.parent[t]:null}function e1(e){return()=>o.string().test({name:e,message:"Options cannot be empty",test:function(t,n){let i="single"===e?"multi":"single",l=e0(n,e),r=e0(n,i);return!!r&&"string"==typeof r||!("string"!=typeof l||(!l||!l.length)&&(!r||!r.length)||l.split(",").find(e=>!eX.includes(e)))}})}let e2={...u.Jp,allowTargetBlank:(0,p.Jg)("Allow target blank for links"),single:{validate:e1("single")},multi:{validate:e1("multi")}},e5=["config.single","config.multi"],e3={icon:r.BAW},e7=o.object().shape({type:o.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)({...e2,labels:{yupType:"array",validate:{}}},"id"))});var e6=n(18978);let e8={label:u.Jp.label,id:u.Jp.id},e9=o.object().shape({type:o.string().matches(/^Table$/,{excludeEmptyString:!0}).required(),config:o.object().shape({label:o.string()}).required().default(void 0).noUnknown(!0)}),e4={icon:e6.WHV},te=u.Jp,tt=o.object().shape({type:o.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(te,"id"))}),tn={icon:r.SQS},ti=u.Jp,tl=o.object().shape({type:o.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(ti,"id"))}),tr={icon:r.k71},to={label:u.Jp.label,id:{...u.Jp.id,validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0},placeholder:u.Jp.placeholder},ta=o.object().shape({type:o.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(to,"id"))}),ts={Boolean:{TYPE_NAME:"Boolean",create:e=>({type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}),Meta:N,schema:R,FormFields:q},Color:{create:e=>({type:"Color",config:{label:e,placeholder:""}}),FormFields:B,TYPE_NAME:z,schema:J,Meta:V},ContentRelationship:{create:e=>({type:"Link",config:{label:e,select:"document",repeat:!1}}),Meta:el,schema:eo,TYPE_NAME:"Link",FormFields:ei,CUSTOM_NAME:"ContentRelationship",Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,o=(0,P.v9)(G.Ch).filter(Z.TG),u=o.map(e=>({value:e.local.id,label:e.local.label})),p=n.config.customtypes?n.config.customtypes.map(e=>{let t=o.find(t=>t.local.id===e);return{value:null==t?void 0:t.local.id,label:null==t?void 0:t.local.label}}):null;return(0,i.jsxs)(s.k,{children:[Object.entries(ei).filter(e=>"customtypes"!==e[0]).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.xu,{sx:{mt:2,alignItems:"center"},children:[(0,i.jsx)(a.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,i.jsx)(en.ZP,{isMulti:!0,name:"origin",options:u,onChange:e=>{e&&r("config.customtypes",e.map(e=>{let{value:t}=e;return t}))},value:p,theme:e=>({...e,colors:{...e.colors,text:"text",primary:"background"}})})]})})]})},prepareInitialValues:e=>{let t=(0,P.v9)(G.Ch).filter(Z.TG);return(null==e?void 0:e.customtypes)?{...e,customtypes:e.customtypes.filter(e=>t.find(t=>t.local.id===e))}:e}},Date:{create:e=>({type:"Date",config:{label:e,placeholder:""}}),FormFields:ea,TYPE_NAME:"Date",schema:es,Meta:ed},Embed:{create:e=>({type:"Embed",config:{label:e,placeholder:""}}),FormFields:ec,TYPE_NAME:"Embed",schema:eu,Meta:ep},GeoPoint:{create:e=>({type:"GeoPoint",config:{label:e}}),FormFields:em,TYPE_NAME:"GeoPoint",schema:ex,Meta:eh},Image:{Meta:eC,Form:e=>{let{initialValues:t,values:n,errors:l,fields:r,touched:o}=e,[u,p]=(0,b.useState)(0),{config:{thumbnails:m,constraint:x}}=n;return(0,b.useEffect)(()=>{p(m.length)},[m.length]),(0,i.jsxs)(s.k,{children:[Object.entries(eT).map(e=>{let[n,l]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:l,fields:r,initialValues:t})},n)}),(0,i.jsxs)(s.J,{children:[(0,i.jsx)(a.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,i.jsx)(a.Zb,{p:3,children:(0,i.jsx)(H.F2,{name:"config.thumbnails",render:t=>{let{push:n,remove:r}=t;return(0,i.jsxs)(b.Fragment,{children:[(0,i.jsxs)(a.kC,{mb:3,children:[(0,i.jsx)(eb,{active:0===u,text:eF(x,!0),sx:{mr:2},onClick:()=>p(0)}),m.map((e,t)=>(0,i.jsx)(eb,{sx:{mr:3},active:u===+t+1,text:eF(e),error:!!l.thumbnails&&!!o.thumbnails&&!!o.thumbnails[t]&&!!l.thumbnails&&!!l.thumbnails[t],onDelete:()=>r(t),onClick:()=>p(+t+1)},"thumbnail-button-".concat(+t+1))),(0,i.jsx)(ey,{onClick:()=>{n(eI)}})]}),(0,i.jsx)(ej,{...e,display:0===u,prefix:"config.constraint"}),m.map((t,n)=>(0,b.createElement)(ej,{...e,required:!0,key:"thumbnail-".concat(+n+1),display:u===+n+1,prefix:"config.thumbnails[".concat(n,"]")}))]})}})})]})]})},schema:eE,create:e=>({type:"Image",config:{label:e,constraint:{},thumbnails:[]}}),FormFields:eT,TYPE_NAME:"Image"},Link:{Meta:Q,FormFields:X,schema:et,Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,{config:{allowText:o,repeat:u,variants:m}}=n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.k,{children:[Object.entries(X).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.kC,{sx:{gap:2,marginTop:3},style:{paddingTop:"1px"},children:[(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)("allowTargetBlank"),formField:(0,p.Jg)("Allow target blank",!1,!0),fields:l,initialValues:t})}),(0,i.jsx)($,{checked:o,setFieldValue:r})]})},"allowTargetBlank")]}),(0,i.jsx)(U.xuv,{height:8}),(0,i.jsxs)(U.xuv,{flexDirection:"column",gap:16,children:[(0,i.jsx)(W,{checked:u,setFieldValue:r}),(0,i.jsx)(Y,{variants:m,setFieldValue:r})]})]})},create:e=>({type:"Link",config:{label:e,placeholder:"",select:null,allowTargetBlank:!0,allowText:!0,repeat:!1}}),TYPE_NAME:"Link"},LinkToMedia:{Meta:eL,FormFields:ew,schema:eM,Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,{config:{allowText:o,variants:a}}=n;return(0,i.jsxs)(U.xuv,{flexDirection:"column",gap:16,children:[(0,i.jsxs)(s.k,{children:[Object.entries(ew).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)($,{checked:o,setFieldValue:r})]}),(0,i.jsx)(Y,{variants:a,setFieldValue:r})]})},create:e=>({type:"Link",config:{label:e,placeholder:"",select:"media",allowText:!0}}),TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},Number:{create:e=>({type:"Number",config:{label:e,placeholder:""}}),FormFields:eD,TYPE_NAME:"Number",schema:eA,Meta:eN},Select:{FormFields:ez,create:e=>({type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}),schema:eJ,Meta:eB,TYPE_NAME:"Select"},StructuredText:{create:e=>({type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:eX.join(",")}}),FormFields:e2,Meta:e3,schema:e7,TYPE_NAME:"StructuredText",Form:e=>{var t;let{initialValues:n,values:l,errors:r,fields:o,setFieldValue:u}=e,{config:{single:p,multi:m}}=l,x=p?eQ(p):m?eQ(m):eX,[h,f]=(0,b.useState)(!p),[g,v]=(0,b.useState)(x);return(0,b.useEffect)(()=>{let e=h?1:0;u(e5[e],g.join(",")),setTimeout(()=>{u(e5[1-e],void 0)},100)},[h,g]),(0,i.jsxs)(s.k,{children:[Object.entries(e2).map(e=>{let[t,l]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(t),formField:l,fields:o,initialValues:n})},t)}),(0,i.jsxs)(s.J,{children:[(0,i.jsxs)(a.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,i.jsx)(a.zx,{type:"button",variant:"buttons.textButton",onClick:()=>{if(eY(g))return v([]);v(eX)},children:eY(g)?"Unselect All":"Select all"})]}),eK.map(e=>(0,i.jsx)(ev.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:g.includes(e.value),onClick:()=>{if(g.find(t=>t===e.value))return v(g.filter(t=>t!==e.value));v([...g,e.value])}},e.value)),(null===(t=r.config)||void 0===t?void 0:t[h?"multi":"single"])?(0,i.jsx)(a.xu,{sx:{position:"absolute"},children:(0,i.jsx)(a.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[h?"multi":"single"]})}):null]}),(0,i.jsx)(s.J,{children:(0,i.jsx)(a.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,i.jsxs)(a.__,{variant:"label.border",children:[(0,i.jsx)(a.XZ,{checked:h,onChange:()=>f(!h)}),"Allow multiple paragraphs"]})})})]})}},Table:{create:e=>({type:"Table",config:{label:e}}),FormFields:e8,TYPE_NAME:"Table",schema:e9,Meta:e4},Text:{create:e=>({type:"Text",config:{label:e,placeholder:""}}),Meta:tn,schema:tt,TYPE_NAME:"Text",FormFields:te},Timestamp:{create:e=>({type:"Timestamp",config:{label:e,placeholder:""}}),schema:tl,FormFields:ti,TYPE_NAME:"Timestamp",Meta:tr},UID:{create:e=>({type:"UID",config:{label:e,placeholder:""}}),Meta:{icon:r.XN7},schema:ta,TYPE_NAME:"UID",FormFields:to}},td=[ts.Image,ts.Text,ts.StructuredText,ts.Link,ts.Select,ts.Boolean,ts.Number,ts.Color,ts.Date,ts.Table,ts.Embed,ts.Timestamp,ts.GeoPoint,ts.ContentRelationship,ts.LinkToMedia],tc="subItem",tu=g({schemaTypeRegex:/^NestedGroup$/,customListItem:e=>(0,i.jsx)(A,{Widgets:ts,widgetsArray:td,hintBase:tc,...e}),customName:"NestedGroup",hintItemName:tc}),tp={...ts,NestedGroup:tu},tm=[tp.Image,tp.Text,tp.StructuredText,tp.Link,tp.Select,tp.Boolean,tp.Number,tp.Color,tp.Date,tp.Table,tp.Embed,tp.Timestamp,tp.GeoPoint,tp.ContentRelationship,tp.LinkToMedia,tp.NestedGroup],tx="item",th={Group:g({schemaTypeRegex:/^Group$/,customListItem:e=>{let t=function(){let e=(0,l.L)("slicemachine-nested-groups");return{eligible:(null==e?void 0:e.value)==="on"}}(),n=tm.filter(e=>!!t.eligible||"NestedGroup"!==e.CUSTOM_NAME);return(0,i.jsx)(A,{Widgets:tp,widgetsArray:n,hintBase:tx,...e})},hintItemName:tx}),NestedGroup:tu,...ts}},85357:function(e,t,n){"use strict";n.d(t,{B9:function(){return o},Ss:function(){return s},uS:function(){return a},zg:function(){return d}});var i=n(65413),l=n(22863),r=n(25273);let o=(e,t)=>{let{[t]:n,...i}=e;return i},a=e=>!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId,s=(e,t)=>!e[t]&&(console.log('Could not find widget with type name "'.concat(t,'".')),!0),d=e=>({TYPE_NAME:e,FormFields:r.Jp,schema:i.object().shape({type:i.string().test({name:"type",test:function(t){return t===e}}),config:(0,l.gc)(o(r.Jp,"id"))}),create:()=>({type:e,config:(0,l.f7)(o(r.Jp,"id"))})})},45067:function(e,t,n){"use strict";function i(e){if(e.startsWith("/slices/"))return"slice";if(e.startsWith("/custom-types/"))return"custom type";if(e.startsWith("/page-types/"))return"page type";throw Error("Did not detect a content type from: ".concat(e))}n.d(t,{T:function(){return i}})},50268:function(e,t,n){"use strict";n.d(t,{V:function(){return r}});var i=n(93188),l=n(45067);function r(e){var t,n,r,o,a;let{id:s,field:d,isInAGroup:c=!1}=e;i.Xe.track({event:"field:added",id:s,name:null!==(a=null===(t=d.config)||void 0===t?void 0:t.label)&&void 0!==a?a:"",type:d.type,isInAGroup:c,contentType:(0,l.T)(window.location.pathname),..."Link"===d.type&&{allowText:null===(n=d.config)||void 0===n?void 0:n.allowText,repeat:null===(r=d.config)||void 0===r?void 0:r.repeat,variants:null===(o=d.config)||void 0===o?void 0:o.variants}})}},44266:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var i=n(93188),l=n(45067);function r(e){var t,n,r,o,a;let{id:s,previousId:d=s,field:c,isInAGroup:u=!1}=e;i.Xe.track({event:"field:updated",previousId:d,id:s,idUpdated:d!==s,name:null!==(a=null===(t=c.config)||void 0===t?void 0:t.label)&&void 0!==a?a:"",type:c.type,isInAGroup:u,contentType:(0,l.T)(window.location.pathname),..."Link"===c.type&&{allowText:null===(n=c.config)||void 0===n?void 0:n.allowText,repeat:null===(r=c.config)||void 0===r?void 0:r.repeat,variants:null===(o=c.config)||void 0===o?void 0:o.variants}})}},13938:function(e){e.exports={flex:"List_flex__b6acG",row:"List_row__zKnOI List_flex__b6acG",root:"List_root__m_SiQ List_flex__b6acG","root-border":"List_root-border__UW3vp",child:"List_child__MJ49i List_row__zKnOI List_flex__b6acG",header:"List_header__T0WM5 List_child__MJ49i List_row__zKnOI List_flex__b6acG",headerActions:"List_headerActions__mNgLY List_row__zKnOI List_flex__b6acG",item:"List_item__LMBx4 List_child__MJ49i List_row__zKnOI List_flex__b6acG"}},83288:function(e){e.exports={root:"ZoneEmptyState_root__DAfG2"}}}]);