slice-machine-ui 2.2.1-alpha.lg-advanced-groups.2 → 2.2.1-alpha.lg-advanced-groups.3

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.
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/b3bb731ce567d63f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/b3bb731ce567d63f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-207ecb3e9b995dd9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5863d07747cf0937.js" defer=""></script><script src="/_next/static/chunks/pages/_error-6aa4c7b8478d35e3.js" defer=""></script><script src="/_next/static/Smg17tdz_EkdZUCYLzmuO/_buildManifest.js" defer=""></script><script src="/_next/static/Smg17tdz_EkdZUCYLzmuO/_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":"Smg17tdz_EkdZUCYLzmuO","runtimeConfig":{"sentryEnvironment":"alpha"},"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/b3bb731ce567d63f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/b3bb731ce567d63f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-207ecb3e9b995dd9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-a908d839a6dbf5a5.js" defer=""></script><script src="/_next/static/chunks/pages/_error-6aa4c7b8478d35e3.js" defer=""></script><script src="/_next/static/woTNk3D-U1STjePe17pbd/_buildManifest.js" defer=""></script><script src="/_next/static/woTNk3D-U1STjePe17pbd/_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":"woTNk3D-U1STjePe17pbd","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[574],{85513:function(e,n,t){"use strict";t.d(n,{aV:function(){return d},Bu:function(){return f}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715),s=t(6277),c=t(41350),u=t.n(c),d=function(e){var n=e.border,t=(0,o.Z)(e,["border"]);return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},t),{className:(0,s.Z)(u().root,(void 0===n||n)&&u()["root-border"])}))},f=function(e){var n=e.actions,t=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:u().header,children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:u().headerActions,children:n}):null]}))}},90490:function(e,n,t){"use strict";t.d(n,{CM:function(){return s},Ir:function(){return l},J0:function(){return c},eE:function(){return a}});var i,r,o=t(17064);function l(e){var n,t,o=structuredClone(e.group);return null!==(n=(i=o).config)&&void 0!==n||(i.config={}),null!==(t=(r=o.config).fields)&&void 0!==t||(r.fields={}),o.config.fields[e.fieldId]=e.field,o}function a(e){var n,t,i=structuredClone(e.group);if(!(null===(n=i.config)||void 0===n?void 0:n.fields)||!(null===(t=e.group.config)||void 0===t?void 0:t.fields))return i;for(var r in i.config.fields={},e.group.config.fields)r===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[r]=e.group.config.fields[r];return i}function s(e){var n,t=structuredClone(e.group);if(!(null===(n=t.config)||void 0===n?void 0:n.fields))return t;var i=Object.entries(t.config.fields),r=(0,o.Z)(i.splice(e.sourceIndex,1),1)[0];return i.splice(e.destinationIndex,0,r),t.config.fields=Object.fromEntries(i),t}function c(e){var n,t,i=structuredClone(e.group);return null===(n=i.config)||void 0===n||null===(t=n.fields)||void 0===t||delete t[e.fieldId],i}},90104:function(e,n,t){"use strict";t.d(n,{X:function(){return o}});var i=t(52322),r=t(22715),o=function(e){var n,t=e.status;switch(t){case"pending":n={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":n={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":n={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[n.icon,(0,i.jsx)(r.xv,{color:"grey11",children:n.text})]})}},51279:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322),o=t(61183);t(2784);var l=t(59326),a=t(75289),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};o.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],u=function(e){var n,t=e.children,s=e.lang,u=e.sx,d=e.codeStyle,f=e.codeClass,p=e.Header,m=(0,l.B7)().theme,x=s?o.Z.highlight(t,{language:"vue"===s?"html":s}).value:o.Z.highlightAuto(t,c).value;return(0,r.jsxs)(a.kC,{as:"pre",sx:u,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=m.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:x}})]})}},26950:function(e,n,t){"use strict";t.d(n,{J:function(){return c},k:function(){return s}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322);t(2784);var a=t(75289),s=function(e){var n=e.children,t=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},t)},s),{children:n}))},c=function(e){var n=e.children,t=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===t?2:t)-1,"%"),mb:1},children:n})}},35549:function(e,n,t){"use strict";t.d(n,{$w:function(){return i},Hq:function(){return d},tM:function(){return u}});var i,r=t(62230),o=t(85244),l=t(52322),a=t(63397);t(2784);var s,c=t(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var u=function(e){var n={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}});case i.WARNING:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}});default:return n}},d=function(e){var n=e.sx,t=e.field,s=e.meta,d=e.formField,f=e.fieldName,p=e.fields,m=e.initialValues,x=e.isDisabled,h=s.error?i.ERROR:x||d.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===n?{}:n,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[d.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:d.placeholder||d.label||f},d.fieldLevelValidation&&m?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:m.id})}}:null,t),{as:c.II,sx:u(h),disabled:x||d.disabled}))]})}},20180:function(e,n,t){"use strict";t.d(n,{kp:function(){return c},sP:function(){return d},w8:function(){return f},Hq:function(){return p.Hq}});var i=t(62230),r=t(85244),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=function(e){var n=e.field,t=e.meta,c=e.fieldName,u=e.label,d=e.focusOnNewEntry,f=void 0===d||d,p=e.inputPlaceholder,m=e.buttonLabel,x=(0,a.useState)(t.value.length),h=x[0],v=x[1],g=(0,a.useRef)(Array(t.value.length));return(0,a.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,a.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[u,t.touched&&t.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:t.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},n),{render:function(e){return(0,o.jsxs)("div",{children:[n.value&&n.value.length>0?n.value.map(function(n,t){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(t),value:n,ref:function(e){return g.current[t]=e},onChange:function(n){var i=n.target.value;return e.replace(t,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(t)},children:"-"})]},"".concat(c,"-").concat(+t+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(n.value.length,"")},children:m})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,a=e.fieldName,c=e.onChange,d=(0,u.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},d),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!n.value)},checked:n.value}),t]}))},f=function(e){var n=e.field,t=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,a.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(d,{meta:{value:f},fieldName:n.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof t?t(l,f):t})},p=t(35549)},82004:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(75289),c=(0,a.forwardRef)(function(e,n){var t=e.children,a=e.Component,c=void 0===a?s.kC:a,u=e.sx,d=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===u?{}:u),ref:n},d),{children:t}))});n.Z=c},1225:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(62230),r=t(85244),o=t(52322),l=t(5446),a=t(2784),s=t(40023),c=t(951),u=t(8799),d=t(18978),f=t(59326),p=t(75289),m=t(82004),x=t(26474),h=t(98240),v=t(33710),g=t(79401),b=function(e){var n=e.text,t=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),u=(0,a.useState)(null),d=u[0],f=u[1],m=function(){f(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return m(),window.addEventListener("resize",m),function(){window.removeEventListener("resize",m)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.xv,(0,r.Z)((0,i.Z)({"data-for":n,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:t,ref:c},s),{children:n})),d&&(0,o.jsx)(g.X,{children:(0,o.jsx)(v.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},y=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(n=l.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=l.colors)||void 0===t?void 0:t.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var n=e.item,t=e.index,h=e.deleteItem,v=e.enterEditMode,g=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,k=e.CustomEditElements,I=e.widget,S=e.draggableId,C=e.testId,E=e.isRepeatableCustomType,F=e.children,w=(0,f.B7)().theme,T=n.key,_=n.value,M=_.config,A=_.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:S,index:t,children:function(e){var s,f,S,_,N;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(m.Z,(0,r.Z)((0,i.Z)({"data-testid":C,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(x.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:d.Fm7,color:null===(s=w.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:w,text:(null==M?void 0:M.label)||T,sliceFieldName:b&&b(T),WidgetIcon:I.Meta.icon}),(0,o.jsxs)(p.kC,{children:[k||null,Z||(0,o.jsx)(x.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=w.colors)||void 0===f?void 0:f.icons},onClick:function(){return v([T,n.value],g,t)}}),!(!0===E&&"UID"==A)&&(0,o.jsxs)(l.v2,{children:[(0,o.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(u.FQA,{size:20,color:null===(S=w.colors)||void 0===S?void 0:S.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(_=w.colors)||void 0===_?void 0:_.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(N=w.colors)||void 0===N?void 0:N.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),F]}))})}})})}},26474:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(75289),s=function(e,n){return n?{border:function(e){var n=e.colors;return"1px solid ".concat(n.error)}}:e?{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)}}:{border:function(e){var n=e.colors;return"1px solid ".concat(n.borders)}}},c=function(e){var n=e.sx,t=e.onClick,c=e.label,u=e.Icon,d=e.error,f=e.size,p=void 0===f?16:f,m=e.fitButton,x=e.active,h=e.useActive,v=e.activeSx,g=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===t?function(){return null}:t,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==m&&m?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==x&&x,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},79474:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=t(20180),u=t(33413),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,l.U$)(n),3),m=p[0],x=p[1],h=p[2],v=t.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===u.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:x,field:m,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[t.type===u.h.INPUT?(0,o.jsx)(c.Hq,{meta:x,field:m,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===u.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:x,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},1411:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(59326),u=t(75289),d=t(65413),f=t(2784),p=t(92928),m=t(2978),x=t(98240),h=function(e){var n=e.children,t=(0,x.Z)(e,["children"]);return(0,l.jsx)(u.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},t),{children:n}))};h.tabsRole="TabList";var v=function(e){var n=e.children,t=(0,x.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(p.OK,(0,r.Z)((0,i.Z)({},t),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},t.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:n}))};v.tabsRole="Tab";var g=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,d=void 0===c?0:c,x=(0,f.useState)(d),g=x[0],b=x[1];return(0,l.jsx)(m.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:t,children:(0,l.jsxs)(p.mQ,{defaultIndex:d,onSelect:function(e){return b(e)},children:[(0,l.jsx)(h,{children:(o||[]).map(function(e){return(0,l.jsx)(v,{children:e},e)})}),f.Children.map(n,function(e,n){return(0,l.jsx)(u.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===g?"block":"none"},children:(0,l.jsx)(p.x4,{children:e})})})]})})},b=(0,f.memo)(g),y=t(26950),j=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(n=o.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=o.colors)||void 0===t?void 0:t.primary}}),(0,l.jsx)(u.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},Z=t(28199),k=t(86163),I=t(5632),S=t(65186),C=t(25978),E=function(){var e=(0,I.useRouter)();return(0,l.jsxs)(u.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(S.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(u.xu,{sx:{height:"12px"}}),(0,l.jsx)(u.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(u.xu,{sx:{height:"8px"}}),(0,l.jsx)(u.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(u.xu,{sx:{height:"24px"}}),(0,l.jsx)(u.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),C.pq)},children:"Go to the Slice Simulator"})]})},F=t(81944),w=t(50535),T=t(69114),_=t(79474),M=t(67557),A=t(77033),N=t(63397),R=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,d=e.children;return(0,l.jsx)(u.xu,{children:(0,l.jsx)(N.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,x.Z)(e,["id"])).reduce(function(e,n){var t=(0,o.Z)(n,2),l=t[0],a=t[1];if((void 0===a?"undefined":(0,A.Z)(a))!==Boolean&&!a){var s,u=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==u)return(0,r.Z)((0,i.Z)({},e),(0,M.Z)({},l,u))}return(0,r.Z)((0,i.Z)({},e),(0,M.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(N.l0,{id:n,children:d((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},L=(0,f.memo)(R);s().setAppElement("#__next");var B=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,f=e.zoneType,p=(0,c.B7)().theme;if(!t.isOpen)return null;var m=(0,o.Z)(t.field,2),x=m[0],h=m[1],v=(0,T.t)(F,h.config,h.type);if(!v)return(0,l.jsxs)("div",{children:[h.type," not found"]});var g=v.Meta.icon,I=v.FormFields,S=v.Form,C=v.schema,M=(0,i.Z)({},(0,k.f7)((0,w.B9)(I,"id")),v.prepareInitialValues?v.prepareInitialValues(h.config):h.config),A=function(){try{return{res:C.validateSync({type:h.type,config:M},{stripUnknown:!0})}}catch(e){return{err:e}}}(),N=A.res,R=A.err;R&&(console.error("[EditModal] Failed to validate field of type ".concat(h.type,".\n Please update model.json accordingly.")),console.error(R));var B={id:x,config:N?N.config:M},D=(0,o.Z)(I.id.validate.matches,2),O=D[0],V=D[1],q=d.object().shape({id:d.string().matches(O,V).min(3).max(35).required(),config:C.fields.config}),z="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(L,{apiId:x,formId:z,initialValues:B,validationSchema:q,FormFields:I,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:x,newKey:t,value:(0,i.Z)({},h,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,d=e.isValid,m=e.isSubmitting,x=e.initialValues,h=S?(0,l.jsx)(S,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(I).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(y.J,{children:(0,l.jsx)(_.Z,{fieldName:(0,k.lm)(t),formField:i,fields:a,initialValues:x})},t)})},"field-model-tab-content"),v=["Field Model"],Z=[h];if("slice"===f){var C=(0,l.jsx)(u.xu,{children:(0,l.jsx)(E,{})},"mock-data-tab-content");v.push("Mock Data"),Z.push(C)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:v,Header:function(e){var t=e.radius;return(0,l.jsxs)(u.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t},children:[(0,l.jsx)(j,{theme:p,text:c||s,WidgetIcon:g}),(0,l.jsx)(u.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(u.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(u.xu,{sx:{ml:"auto"}}),(0,l.jsx)(u.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(u.zx,{form:z,type:"submit",disabled:!d&&m,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},14424:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(75289),c=t(2978),u=t(26950),d=t(28199),f=t(59326),p=function(e){var n=e.title,t=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(s.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},"&:hover":{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":n,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(n,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(s.xu,{ml:1,children:[(0,o.jsx)(s.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(s.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var m=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(d.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(c.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(s.X6,{children:"Add a new field"}),(0,o.jsx)(s.x8,{onClick:t})]})},children:(0,o.jsx)(u.k,{children:a.filter(function(e){return e}).map(function(e){var n=e.Meta,t=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(u.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},63928:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(49857),s=t(7604),c=t(77245),u=t(8799),d=t(65186),f=t(59326),p=t(75289),m=t(51279),x={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,f.B7)().theme,h=(0,l.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(p.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(p.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(u.vcz,{size:26,color:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(m.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(p.xu,{children:(0,o.jsxs)(p.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(d.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:x}):(0,o.jsx)(c.LhG,{size:16,style:x}),(0,o.jsx)(p.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=function(e){var n=e.show,t=e.renderHintBase,l=e.item,c=t({item:l}),u=(0,a.ZP)(c,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:c.split("."),model:l.value})];case 1:return[2,e.sent()]}})})),d=u.data,f=u.error;if(f&&console.error(f),!d||f)return null;var p=d.snippets||[];return p[0]?(0,o.jsx)("div",{style:{display:n?"initial":"none"},children:(0,o.jsx)(h,{code:p[0].code,lang:p[0].language})}):null}},12158:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var i={};t.r(i),t.d(i,{Boolean:function(){return h.Boolean},Color:function(){return h.Color},ContentRelationship:function(){return h.ContentRelationship},Date:function(){return h.Date},Embed:function(){return h.Embed},GeoPoint:function(){return h.GeoPoint},Group:function(){return v.f},Image:function(){return h.Image},Link:function(){return h.Link},LinkToMedia:function(){return h.LinkToMedia},NestedGroup:function(){return g.k},Number:function(){return h.Number},Select:function(){return h.Select},StructuredText:function(){return h.StructuredText},Text:function(){return h.Text},Timestamp:function(){return h.Timestamp},UID:function(){return h.UID}});var r=t(62230),o=t(85244),l=t(98240),a=t(52322),s=t(22715),c=t(63397),u=t(2784),d=t(75289),f=t(59326),p=t(35549),m=t(86163),x=t(58428),h=t(64831),v=t(4940),g=t(70479),b=t(55197),y=t(18978),j=t(33710),Z=t(79401),k=function(e){var n=e.error;return n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Z.X,{children:(0,a.jsx)(j.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,a.jsx)(y.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},I=function(e){var n=e.innerRef,t=(0,l.Z)(e,["innerRef"]);return(0,a.jsx)(d.II,(0,o.Z)((0,r.Z)({},t),{ref:n}))},S=function(e){var n=e.widgetTypeName,t=e.fields,l=e.onSave,h=e.onCancelNewField,v=(0,u.useRef)(null),g=(0,f.B7)().theme,y=(0,u.useState)(!0),j=y[0],Z=y[1];(0,u.useEffect)(function(){v.current&&v.current.focus()},[v]);var S=i[n];if(!S)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,a.jsx)("div",{children:"Unexpected error. Contact us for more info."});var C=S.FormFields,E=S.Meta.icon,F={id:C.id,label:C.label},w=(0,o.Z)((0,r.Z)({},(0,m.f7)(F),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,m.gc)(F),_=function(e,n,t){t(j&&!F.id.disabled?(0,o.Z)((0,r.Z)({},n),{label:e.target.value,id:(0,b.lV)(e.target.value)}):(0,o.Z)((0,r.Z)({},n),{label:e.target.value}))},M=function(e,n){n("id",e.target.value),Z(!1)};return(0,a.jsx)(c.J9,{onSubmit:l,validationSchema:T,initialValues:w,children:function(e){var n,i,l=e.errors,u=e.values,f=e.setValues,m=e.setFieldValue,b=e.submitForm;return(0,a.jsx)(c.l0,{"data-testid":"new-field-form",children:(0,a.jsxs)(d.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var n,t;return"1px solid ".concat((null===(n=e.colors)||void 0===n?void 0:null===(t=n.borders)||void 0===t?void 0:t.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,a.jsx)(E,{style:{color:null===(n=g.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(i=g.colors)||void 0===i?void 0:i.primary},size:28}),(0,a.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,a.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,a.jsx)(c.gN,{onChange:function(e){return _(e,u,f)},onKeyDown:function(e){"Enter"===e.key&&b()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:I,innerRef:v,sx:(0,o.Z)((0,r.Z)({},(0,p.tM)(F.label.disabled?p.$w.DISABLED:l.label?p.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,a.jsx)(k,{error:l.label})]}),(0,a.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,a.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,a.jsx)(c.gN,{onChange:function(e){return M(e,m)},onKeyDown:function(e){"Enter"===e.key&&b()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:F.id.disabled,validate:function(e){return(0,x.u)({value:e,fields:t,initialId:null})},as:I,sx:(0,o.Z)((0,r.Z)({},(0,p.tM)(F.id.disabled?p.$w.DISABLED:l.id?p.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,a.jsx)(k,{error:l.id})]}),(0,a.jsxs)(d.kC,{sx:{gap:2},children:[(0,a.jsx)(s.zx,{onClick:h,color:"grey",children:"Cancel"}),(0,a.jsx)(s.zx,{onClick:function(){b()},children:"Add"})]})]})})}})}},75843:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(62230),r=t(85244),o=t(17064),l=t(81541),a=t(52322),s=t(22715),c=t(13980),u=t(2784),d=t(65077),f=t(12189),p=t(85513),m=t(21112),x=t(14424),h=t(40023),v=t(75289),g=t(82004),b=t(1225),y=t(81944),j=t(69114),Z=t(63928),k=function(e){var n=e.fields,t=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,u=e.renderFieldAccessor,d=e.onDeleteItem,f=e.onSave,p=e.showHints,m=e.newField,x=e.renderHintBase,k=e.isRepeatable,I=e.testId,S=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:c,children:(0,a.jsx)(h.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(v.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":I,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,m=c.config,h=c.type,I=(0,j.t)(y,m,h);if(!I)return(0,a.jsx)(g.Z,{children:(0,a.jsxs)(v.xv,{children:['Field type "',h,'" not supported']})});var C={item:e,index:n,tabId:o,widget:I,showHints:p,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,saveItem:f,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:S,testId:"list-item-".concat(e.key)},E=(0,a.jsx)(Z.Z,{item:e,show:p,isRepeatable:k,renderHintBase:x,Widgets:y,typeName:I.CUSTOM_NAME||I.TYPE_NAME});if(I.CustomListItem){var F=I.CustomListItem;return(0,a.jsx)(F,(0,r.Z)((0,i.Z)({},C),{HintElement:E}))}return(0,a.jsx)(b.Z,(0,r.Z)((0,i.Z)({},C),{HintElement:E}))}),e.placeholder,m]}))}})})},I=t(12158),S=t(73539),C=t.n(S),E=function(e){var n=e.zoneType,t=e.heading,i=void 0===t?"Your ".concat(n," has no fields yet"):t,r=e.onActionClick,o=e.actionTestId;return(0,a.jsxs)("div",{className:C().root,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s.xv,{variant:"bold",children:i}),(0,a.jsx)(s.xv,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return r()},"data-testid":o,startIcon:"add",children:"Add a field"})]})},F=function(e){var n,t,c=e.zoneType,h=e.zoneTypeFormat,v=e.tabId,g=e.title,b=e.fields,y=e.poolOfFieldsToCheck,j=e.widgetsArray,Z=e.isRepeatable,S=e.onDeleteItem,C=e.onSaveNewField,F=e.onDragEnd,w=e.EditModal,T=e.onSave,_=e.dataTip,M=e.renderHintBase,A=e.renderFieldAccessor,N=e.testId,R=e.isRepeatableCustomType,L=e.emptyStateHeading,B=e.emptyStateActionTestId,D=Object.entries(y).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?j.filter(function(e){return"UID"!==e.TYPE_NAME}):j,O=(0,u.useState)(!1),V=O[0],q=O[1],z=(0,u.useState)({isOpen:!1}),P=z[0],H=z[1],J=(0,u.useState)({isOpen:!1}),G=J[0],U=J[1],W=(0,u.useState)(null),Y=W[0],$=W[1],K=function(e){H({isOpen:!0,field:e});var n=(0,o.Z)(e,2),t=n[0],i=n[1];f.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!1,contentType:(0,m.T)(window.location.pathname)})},X=function(){U({isOpen:!0})},Q=function(){H({isOpen:!1})},ee=function(){return U({isOpen:!1})},en=function(e){$({widgetTypeName:e,fields:b}),U({isOpen:!1})},et=function(){return $(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:b.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:V,onCheckedChange:q,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(Z?"Repeatable":"Static","-field"),onClick:X,startIcon:"add",color:"grey",disabled:null!==Y,children:"Add a field"})]}):void 0,children:g}),0!==b.length||Y?b.length>0||Y?(0,a.jsx)(d.xR,{children:(0,a.jsx)(k,{tabId:v,isRepeatable:Z,fields:b,showHints:V,dataTip:_,title:g,renderFieldAccessor:A,renderHintBase:M,enterEditMode:K,enterSelectMode:X,onDragEnd:F,onDeleteItem:S,onSave:T,testId:N,isRepeatableCustomType:R,newField:Y&&(0,a.jsx)(I.Z,(0,r.Z)((0,i.Z)({},Y),{fields:y||b,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];C.apply(void 0,(0,l.Z)(n)),$(null)},onCancelNewField:et}))})}):void 0:(0,a.jsx)(E,{zoneType:(n=c,t=h,"customType"===n?"page"===t?"page type":"custom type":n),heading:L,onActionClick:function(){return X()},actionTestId:B}),(0,a.jsx)(w,{data:P,close:Q,onSave:T,fields:y,zoneType:c}),(0,a.jsx)(x.Z,{data:G,close:ee,onSelect:en,widgetsArray:D})]})};F.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var w=F},69114:function(e,n,t){"use strict";t.d(n,{t:function(){return r}});var i=t(59050),r=function(e,n,t){if("Link"===t)switch(null==n?void 0:n.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}if(t===i.GroupFieldType){var r;return null!==(r=e.NestedGroup)&&void 0!==r?r:e.Group}return e[t]}},58428:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(25978),r=t(77362),o=function(e){var n=e.value,t=e.fields,i=e.initialId;return n?t.find(function(e){return e.key===n})&&n!==i?'Field "'.concat(n,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},77362:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(86163),r=t(33413),o=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(n,s)},required:n,label:e,defaultValue:t,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,u=n||{},d=u.min,f=u.max,p=u.required,m=u.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(d,l),max:(0,i.MJ)(f,a),matches:m},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},86163:function(e,n,t){"use strict";t.d(n,{MJ:function(){return d},f7:function(){return f},gc:function(){return p},lm:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),l=t(17064),a=t(81541),s=t(65413),c=t(33413),u=function(e){return"id"===e?"id":"config.".concat(e)},d=function(e,n){return Array.isArray(e)?e:"boolean"==typeof e&&e?n:null},f=function(e){return Object.entries(e).reduce(function(e,n){var t,a=(0,l.Z)(n,2),s=a[0],u=null===(t=a[1]).defaultValue?void 0:void 0!==t.defaultValue?t.defaultValue:t.type===c.h.CHECKBOX||(t.type===c.h.INPUT?"":t.type===c.h.SELECT?[]:void 0);return void 0!==u?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,u)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,n){var t=(0,l.Z)(n,2),c=t[0],u=t[1],d=u.validate,f=u.yupType;if(!d)return e;if("function"==typeof d)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,d(c,u)));var p=s[f]();return Object.entries(d).filter(function(e){return e&&e[1]}).forEach(function(e){var n,t=(0,l.Z)(e,2),i=t[0],r=t[1];if(r&&p[i]){p=(n=p)[i].apply(n,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},33413:function(e,n,t){"use strict";var i,r;t.d(n,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},4940:function(e,n,t){"use strict";t.d(n,{f:function(){return D}});var i,r=t(65186),o=t(65413),l=t(62230),a=t(85244),s=t(17064),c=t(52322),u=t(75289),d=t(26950),f=t(79474),p=t(86163),m=t(58428),x=t(77362),h=(0,a.Z)((0,l.Z)({},m.J),{repeat:(0,x.Jg)("Repeatable",!1,!0)}),v=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,c.jsxs)(d.k,{children:[Object.entries(h).filter(function(e){return"repeat"!==(0,s.Z)(e,1)[0]}).map(function(e){var i=(0,s.Z)(e,2),r=i[0],o=i[1];return(0,c.jsx)(d.J,{children:(0,c.jsx)(f.Z,{fieldName:(0,p.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,c.jsx)(d.J,{children:(0,c.jsx)(u.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,c.jsxs)(u.__,{variant:"label.border",sx:{mb:0},children:[(0,c.jsx)(u.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},g=t(98240),b=t(81541),y=t(2784),j=t(40023),Z=t(28316),k=t(12189),I=t(90490),S=t(1225),C=t(1411),E=t(14424),F=t(63928),w=t(12158),T=t(69114),_=t(38265),M=t(27594),A=t(7850),N=t(50535),R=t(55197),L=t(21112),B=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),r=e.isRepeatable,o=e.item,d=e.draggableId,f=e.saveItem,p=e.HintElement,m=(0,g.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),x=(0,y.useState)(!1),h=x[0],v=x[1],B=(0,y.useState)(null),D=B[0],O=B[1],V=(0,y.useState)({isOpen:!1}),q=V[0],z=V[1],P=function(e){O({widgetTypeName:e}),v(!1)},H=function(){O(null)},J=function(){z({isOpen:!1})},G=function(e){var n=e.id,t=e.label,i=A[e.widgetTypeName].create(t),r=(0,I.Ir)({group:_.Fl.fromSM(o.value),fieldId:n,field:i});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)}),k.Xe.track({event:"field:added",id:n,name:t,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})},U=function(e){var n=e.apiId,t=e.newKey,i=e.value,r=(0,I.eE)({group:_.Fl.fromSM(o.value),previousFieldId:n,newFieldId:t,field:_.Fl.fromSM(i)});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)})},W=function(e){if(!(0,N.uS)(e)){var n=e.source,t=e.destination;if(t){var i=n.index,r=t.index,l=(0,I.CM)({group:_.Fl.fromSM(o.value),sourceIndex:i,destinationIndex:r});(0,Z.flushSync)(function(){f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(l)})})}}},Y=function(e){var n=(0,I.J0)({group:_.Fl.fromSM(o.value),fieldId:e});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(n)})},$=function(e){z({isOpen:!0,field:e});var n=(0,s.Z)(e,2),t=n[0],i=n[1];k.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})};return(0,c.jsxs)(y.Fragment,{children:[(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({item:o,widget:t,draggableId:d},m),{HintElement:p,CustomEditElements:[(0,c.jsx)(u.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return v(!0)},children:"Add Field"},"custom-edit-element-".concat(o.key)),],children:(0,c.jsx)(u.xu,{sx:{ml:4},children:(0,c.jsx)(j.Z5,{onDragEnd:W,children:(0,c.jsx)(j.bK,{droppableId:"".concat(n,"-").concat(o.key,"-zone"),children:function(e){return(0,c.jsxs)("ul",(0,a.Z)((0,l.Z)({ref:e.innerRef},e.droppableProps),{children:[o.value.config.fields.map(function(e,n){var t=e.value,s=t.config,u=t.type,d=(0,T.t)(A,s,u);if(!d)return null;var f={item:e,index:n,widget:d,key:e.key,enterEditMode:$,deleteItem:Y,saveItem:U,renderFieldAccessor:function(n){return"item".concat((0,R.Ti)(e.key))},draggableId:"group-".concat(o.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(o.key,"-").concat(e.key)},p=(0,c.jsx)(F.Z,{item:e,show:i,isRepeatable:r,renderHintBase:function(e){var n=e.item;return"item".concat((0,R.Ti)(n.key))},Widgets:A,typeName:d.CUSTOM_NAME||d.TYPE_NAME});if(d.CustomListItem){var m=d.CustomListItem;return(0,c.jsx)(m,(0,a.Z)((0,l.Z)({},f),{HintElement:p}))}return(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({},f),{HintElement:p}))}),e.placeholder,D&&(0,c.jsx)(w.Z,(0,a.Z)((0,l.Z)({},D),{fields:o.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];G.apply(void 0,(0,b.Z)(n)),O(null)},onCancelNewField:H}))]}))}})})})})),(0,c.jsx)(E.Z,{data:{isOpen:h},close:function(){return v(!1)},onSelect:P,widgetsArray:M.Z}),(0,c.jsx)(C.Z,{data:q,close:J,onSave:U,fields:o.value.config.fields})]})},D={Meta:{icon:r.cC1,title:"Group",description:"A repeatable set of fields"},Form:v,FormFields:h,schema:o.object().shape({type:o.string().matches(/^Group$/,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),placeholder:o.string(),repeat:o.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:B,TYPE_NAME:"Group"}},70479:function(e,n,t){"use strict";t.d(n,{k:function(){return D}});var i,r=t(65186),o=t(65413),l=t(62230),a=t(85244),s=t(17064),c=t(52322),u=t(75289),d=t(26950),f=t(79474),p=t(86163),m=t(58428),x=t(77362),h=(0,a.Z)((0,l.Z)({},m.J),{repeat:(0,x.Jg)("Repeatable",!1,!0)}),v=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,c.jsxs)(d.k,{children:[Object.entries(h).filter(function(e){return"repeat"!==(0,s.Z)(e,1)[0]}).map(function(e){var i=(0,s.Z)(e,2),r=i[0],o=i[1];return(0,c.jsx)(d.J,{children:(0,c.jsx)(f.Z,{fieldName:(0,p.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,c.jsx)(d.J,{children:(0,c.jsx)(u.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,c.jsxs)(u.__,{variant:"label.border",sx:{mb:0},children:[(0,c.jsx)(u.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},g=t(98240),b=t(81541),y=t(2784),j=t(40023),Z=t(28316),k=t(12189),I=t(90490),S=t(1225),C=t(1411),E=t(14424),F=t(63928),w=t(12158),T=t(69114),_=t(38265),M=t(64831),A=[M.StructuredText,M.Image,M.Link,M.LinkToMedia,M.ContentRelationship,M.Select,M.Boolean,M.Date,M.Timestamp,M.Embed,M.Number,M.GeoPoint,M.Color,M.Text,],N=t(50535),R=t(55197),L=t(21112),B=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),r=e.isRepeatable,o=e.item,d=e.draggableId,f=e.saveItem,p=e.HintElement,m=(0,g.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),x=(0,y.useState)(!1),h=x[0],v=x[1],B=(0,y.useState)(null),D=B[0],O=B[1],V=(0,y.useState)({isOpen:!1}),q=V[0],z=V[1],P=function(e){O({widgetTypeName:e}),v(!1)},H=function(){O(null)},J=function(){z({isOpen:!1})},G=function(e){var n=e.id,t=e.label,i=M[e.widgetTypeName].create(t),r=(0,I.Ir)({group:_.Fl.fromSM(o.value),fieldId:n,field:i});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)}),k.Xe.track({event:"field:added",id:n,name:t,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})},U=function(e){var n=e.apiId,t=e.newKey,i=e.value,r=(0,I.eE)({group:_.Fl.fromSM(o.value),previousFieldId:n,newFieldId:t,field:i});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)})},W=function(e){if(!(0,N.uS)(e)){var n=e.source,t=e.destination;if(t){var i=n.index,r=t.index,l=(0,I.CM)({group:_.Fl.fromSM(o.value),sourceIndex:i,destinationIndex:r});(0,Z.flushSync)(function(){f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(l)})})}}},Y=function(e){var n=(0,I.J0)({group:_.Fl.fromSM(o.value),fieldId:e});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(n)})},$=function(e){z({isOpen:!0,field:e});var n=(0,s.Z)(e,2),t=n[0],i=n[1];k.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})};return(0,c.jsxs)(y.Fragment,{children:[(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({item:o,widget:t,draggableId:d},m),{HintElement:p,CustomEditElements:[(0,c.jsx)(u.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return v(!0)},children:"Add Field"},"custom-edit-element-".concat(o.key)),],children:(0,c.jsx)(u.xu,{sx:{ml:4},children:(0,c.jsx)(j.Z5,{onDragEnd:W,children:(0,c.jsx)(j.bK,{droppableId:"".concat(n,"-").concat(o.key,"-zone"),children:function(e){return(0,c.jsxs)("ul",(0,a.Z)((0,l.Z)({ref:e.innerRef},e.droppableProps),{children:[o.value.config.fields.map(function(e,n){var t=e.value,s=t.config,u=t.type,d=(0,T.t)(M,s,u);if(!d)return null;var f={item:e,index:n,widget:d,key:e.key,enterEditMode:$,deleteItem:Y,renderFieldAccessor:function(n){return"item".concat((0,R.Ti)(e.key))},draggableId:"group-".concat(o.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(o.key,"-").concat(e.key)},p=(0,c.jsx)(F.Z,{item:e,show:i,isRepeatable:r,renderHintBase:function(e){var n=e.item;return"item".concat((0,R.Ti)(n.key))},Widgets:M,typeName:d.CUSTOM_NAME||d.TYPE_NAME});return(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({},f),{HintElement:p}))}),e.placeholder,D&&(0,c.jsx)(w.Z,(0,a.Z)((0,l.Z)({},D),{fields:o.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];console.log((0,l.Z)({log:"onSave"},n)),G.apply(void 0,(0,b.Z)(n)),O(null)},onCancelNewField:H}))]}))}})})})})),(0,c.jsx)(E.Z,{data:{isOpen:h},close:function(){return v(!1)},onSelect:P,widgetsArray:A}),(0,c.jsx)(C.Z,{data:q,close:J,onSave:U,fields:o.value.config.fields})]})},D={Meta:{icon:r.cC1,title:"Group",description:"A repeatable set of fields"},Form:v,FormFields:h,schema:o.object().shape({type:o.string().matches(/^NestedGroup$/,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),placeholder:o.string(),repeat:o.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:B,TYPE_NAME:"Group",CUSTOM_NAME:"NestedGroup"}},27594:function(e,n,t){"use strict";var i=t(7850);n.Z=[i.NestedGroup,i.StructuredText,i.Image,i.Link,i.LinkToMedia,i.ContentRelationship,i.Select,i.Boolean,i.Date,i.Timestamp,i.Embed,i.Number,i.GeoPoint,i.Color,i.Text,]},64831:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return v},Color:function(){return Z},ContentRelationship:function(){return J},Date:function(){return W},Embed:function(){return K},GeoPoint:function(){return Q},Image:function(){return eh},Link:function(){return B},LinkToMedia:function(){return ej},Number:function(){return eS},Select:function(){return eM},StructuredText:function(){return eY},Text:function(){return eX},Timestamp:function(){return e0},UID:function(){return e4}});var i,r,o,l,a,s=t(8799),c=t(65413),u=t(86163),d=t(58428),f=t(77362),p=t(50535),m={icon:s.XGl,title:"Boolean",description:"An input that is either true or false"},x={label:d.J.label,id:d.J.id,placeholder_false:(0,f.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,f.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,f.Jg)("Default to true")},h=c.object().shape({type:c.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(x,"id"))}),v={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:m,schema:h,FormFields:x},g=t(65186),b={icon:g.jqW,title:"Color",description:"A color picker"},y=(0,p.zg)("Color"),j=y.TYPE_NAME,Z={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:y.FormFields,TYPE_NAME:j,schema:y.schema,Meta:b},k=t(62230),I=t(85244),S=t(56580),C=t(93290),E=t(7781),F=t(34543),w=t(17064),T=t(52322),_=t(26950),M=t(79474),A=(0,I.Z)((0,k.Z)({},d.J),{allowTargetBlank:(0,f.Jg)("Allow target blank",!1,!1)}),N=function(e){var n=e.initialValues,t=e.fields;return(0,T.jsx)(_.k,{children:Object.entries(A).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},R={icon:F.eR7,title:"Link",description:"A link to web, media or Prismic document"},L=c.object().shape({label:c.string().optional(),useAsTitle:c.boolean().optional(),placeholder:c.string().optional(),select:c.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:c.array(c.string()).strict().optional(),masks:c.array(c.string()).optional(),tags:c.array(c.string()).optional(),allowTargetBlank:c.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),B={Meta:R,FormFields:A,schema:c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:L.optional()}),Form:N,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"},D=t(36131),O=t(75289),V={label:d.J.label,id:d.J.id,customtypes:{validate:function(){return c.array().of(c.string())}}},q=function(e){var n=e.initialValues,t=e.values,i=e.fields,r=e.setFieldValue,o=(0,S.v9)(E.Ch).filter(C.TG),l=o.map(function(e){return{value:e.local.id,label:e.local.label}}),a=t.config.customtypes?t.config.customtypes.map(function(e){var n=o.find(function(n){return n.local.id===e});return{value:null==n?void 0:n.local.id,label:null==n?void 0:n.local.label}}):null;return(0,T.jsxs)(_.k,{children:[Object.entries(V).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,w.Z)(e,2),r=t[0],o=t[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(r),formField:o,fields:i,initialValues:n})},r)}),(0,T.jsx)(_.J,{children:(0,T.jsxs)(O.xu,{sx:{mt:2,alignItems:"center"},children:[(0,T.jsx)(O.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,T.jsx)(D.ZP,{isMulti:!0,name:"origin",options:l,onChange:function(e){e&&r("config.customtypes",e.map(function(e){return e.value}))},value:a,theme:function(e){return(0,I.Z)((0,k.Z)({},e),{colors:(0,I.Z)((0,k.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},z={icon:g.I2R,title:"Content Relationship",description:"Define content relations & internal links"},P=L.shape({label:c.string().max(35,"String is too long. Max: 35"),select:c.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:c.array(c.string()).strict().optional()}),H=c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:P}),J={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:z,schema:H,TYPE_NAME:"Link",FormFields:V,CUSTOM_NAME:"ContentRelationship",Form:q,prepareInitialValues:function(e){var n=(0,S.v9)(E.Ch).filter(C.TG);return(null==e?void 0:e.customtypes)?(0,I.Z)((0,k.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}},G=(0,p.zg)("Date"),U=G.FormFields,W={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:U,TYPE_NAME:"Date",schema:G.schema,Meta:{icon:g.f$3,title:"Date",description:"A calendar date picker"}},Y=(0,p.zg)("Embed"),$=Y.FormFields,K={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:$,TYPE_NAME:"Embed",schema:Y.schema,Meta:{icon:F.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}},X={label:d.J.label,id:d.J.id},Q={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:X,TYPE_NAME:"GeoPoint",schema:c.object().shape({type:c.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:c.object().shape({label:c.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:g.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}},ee=t(2784),en=t(63397),et=t(98240),ei=t(20180),er=t(26474),eo=function(e){var n=e.onClick,t=e.error,i=e.onDelete,r=e.active,o=e.text,l=e.sx;return(0,T.jsx)(er.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:r,sx:(0,k.Z)({position:"relative",width:"64px",height:"64px"},l),Icon:function(){return(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsxs)(O.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,T.jsx)(s.jnY,{size:22}),(0,T.jsx)(O.xv,{mt:1,children:o})]}),i?(0,T.jsx)(O.Ct,{onClick:i,variant:"circle-right",children:(0,T.jsx)(g.B4e,{})}):null]})}})},el=function(e){var n=e.onClick;return(0,T.jsx)(er.Z,{fitButton:!0,onClick:n,sx:{width:"64px",height:"64px",border:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}},Icon:function(){return(0,T.jsx)(O.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,T.jsx)(s.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},ea=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,w.Z)((0,en.U$)(n),2),o=(r[0],r[1]),l=void 0!==t&&t?"*":"";return i?(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsx)(es,{name:"".concat(n,".name"),label:"Name".concat(l),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,T.jsx)(ec,{name:"".concat(n,".width"),label:"Width (px)".concat(l),placeholder:" ",sx:{mb:3}}),(0,T.jsx)(ec,{name:"".concat(n,".height"),label:"Height (px)".concat(l),placeholder:" "})]}):null},es=function(e){var n=e.name,t=e.label,i=e.placeholder,r=e.meta,o=e.isConstraint,l=(0,et.Z)(e,["name","label","placeholder","meta","isConstraint"]),a=(0,w.Z)((0,en.U$)(n),1)[0];return(0,T.jsx)(ei.Hq,(0,I.Z)((0,k.Z)({},l),{fieldName:n,meta:r,formField:{label:t,placeholder:i},field:o?{value:"main",readOnly:!0}:{value:a.value},variant:o?"disabled":"primary"}))},ec=function(e){var n=e.name,t=e.label,i=e.placeholder,r=(0,et.Z)(e,["name","label","placeholder"]),o=(0,w.Z)((0,en.U$)(n),2),l=o[0],a=o[1];return(0,T.jsx)(ei.Hq,(0,I.Z)((0,k.Z)({},r),{fieldName:n,formField:{label:t,placeholder:i},meta:a,field:{min:0,type:"number",value:l.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},eu=function(){return c.number().nullable().transform(function(e,n){return""===n?null:e})},ed={label:d.J.label,id:d.J.id,constraint:{validate:function(){return c.object().defined().shape({width:eu(),height:eu()})}},thumbnails:{validate:function(){return c.array().defined().of(c.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var n="number"==typeof e.width&&e.width,t="number"==typeof e.height&&e.height;return e.name&&(n||t)}}))}}},ef={name:"",width:"",height:""},ep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,t=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||n||t?n||t?"".concat(n||"auto","x").concat(t||"auto"):"...":"auto"},em=function(e){var n=e.initialValues,t=e.values,i=e.errors,r=e.fields,o=e.touched,l=(0,ee.useState)(0),a=l[0],s=l[1],c=t.config,d=c.thumbnails,f=c.constraint;return(0,ee.useEffect)(function(){s(d.length)},[d.length]),(0,T.jsxs)(_.k,{children:[Object.entries(ed).map(function(e){var t=(0,w.Z)(e,2),i=t[0],o=t[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(i),formField:o,fields:r,initialValues:n})},i)}),(0,T.jsxs)(_.J,{children:[(0,T.jsx)(O.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,T.jsx)(O.Zb,{p:3,children:(0,T.jsx)(en.F2,{name:"config.thumbnails",render:function(n){var t=n.push,r=n.remove;return(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsxs)(O.kC,{mb:3,children:[(0,T.jsx)(eo,{active:0===a,text:ep(f,!0),sx:{mr:2},onClick:function(){return s(0)}}),d.map(function(e,n){return(0,T.jsx)(eo,{sx:{mr:3},active:a===+n+1,text:ep(e),error:!!i.thumbnails&&!!o.thumbnails&&!!o.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return r(n)},onClick:function(){return s(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,T.jsx)(el,{onClick:function(){t(ef)}})]}),(0,T.jsx)(ea,(0,I.Z)((0,k.Z)({},e),{display:0===a,prefix:"config.constraint"})),d.map(function(n,t){return(0,ee.createElement)(ea,(0,I.Z)((0,k.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:a===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},ex=c.object().shape({type:c.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(ed,"id"))}),eh={Meta:{icon:s.jnY,title:"Image",description:"A responsive image field with constraints"},Form:em,schema:ex,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:ed,TYPE_NAME:"Image"},ev=(0,k.Z)({},d.J),eg=function(e){var n=e.initialValues,t=e.fields;return(0,T.jsx)(_.k,{children:Object.entries(ev).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},eb={icon:g.x2k,title:"Link to media",description:"A link to files, document and media"},ey=L.shape({select:c.string().required().matches(/^media$/,{excludeEmptyString:!0})}),ej={Meta:eb,FormFields:ev,schema:c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ey.optional()}),Form:eg,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},eZ=t(951),ek=(0,p.zg)("Number"),eI=ek.FormFields,eS={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:eI,TYPE_NAME:"Number",schema:ek.schema,Meta:{icon:eZ.JUs,title:"Number",description:"A number input field"}},eC=t(33413),eE=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},eF=function(e,n){return n?e:void 0},ew=(0,I.Z)((0,k.Z)({},d.J),{default_value:{type:eC.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return c.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(n){return n===e})}})},component:function(e){var n,t=null===(n=(0,en.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,T.jsx)(ei.w8,(0,I.Z)((0,k.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:eF,label:eE}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,T.jsx)(ei.kp,(0,k.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),eT={icon:g.dzP,title:"Select",description:"A dropdown field of options for content creators."},e_=c.object().shape({type:c.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(ew,"id"))}),eM={FormFields:ew,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:e_,Meta:eT,TYPE_NAME:"Select"},eA=t(81541),eN=t(47927),eR=t(76635),eL=function(e){return function(n){var t=n.size;return(0,T.jsx)("span",{style:{fontSize:t},children:e})}},eB=[{value:"paragraph",label:"P",icon:eL("p")},{value:"preformatted",label:"PRE",icon:eL("pre")},{value:"heading1",label:"H1",icon:eL("h1")},{value:"heading2",label:"H2",icon:eL("h2")},{value:"heading3",label:"H3",icon:eL("h3")},{value:"heading4",label:"H4",icon:eL("h4")},{value:"heading5",label:"H5",icon:eL("h5")},{value:"heading6",label:"H6",icon:eL("h6")},{value:"strong",label:"Strong",icon:eL((0,T.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eL((0,T.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eL((0,T.jsx)(F.eR7,{}))},{value:"image",label:"image",icon:eL((0,T.jsx)(F.LFN,{}))},{value:"embed",label:"embed",icon:eL((0,T.jsx)(F.xqv,{}))},{value:"list-item",label:"list",icon:eL((0,T.jsx)(F.SnF,{}))},{value:"o-list-item",label:"o",icon:eL((0,T.jsx)(s.KyO,{}))},{value:"rtl",label:"rtl",icon:eL("rtl")},],eD=eB.map(function(e){return e.value}),eO=function(e){return!eD.find(function(n){return!e.includes(n)})},eV=function(e){var n=e.split(",");return eB.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,eA.Z)(e).concat([i]):e},[])};function eq(e,n){return(0,eN.has)("parent",e)&&(0,eR.isObject)(e.parent)&&(0,eN.has)(n,e.parent)&&(0,eR.isString)(e.parent[n])?e.parent[n]:null}function ez(e){return function(){return c.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=eq(t,e),r=eq(t,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!eD.includes(e)})}})}}var eP,eH=(0,I.Z)((0,k.Z)({},d.J),{allowTargetBlank:(0,f.Jg)("Allow target blank for links"),single:{validate:ez("single")},multi:{validate:ez("multi")}}),eJ=["config.single","config.multi"],eG=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,l=e.setFieldValue,a=i.config,s=a.single,c=a.multi,d=s?eV(s):c&&eV(c)||eD,f=(0,ee.useState)(!s),p=f[0],m=f[1],x=(0,ee.useState)(d),h=x[0],v=x[1];return(0,ee.useEffect)(function(){var e=p?1:0;l(eJ[e],h.join(",")),setTimeout(function(){l(eJ[1-e],void 0)},100)},[p,h]),(0,T.jsxs)(_.k,{children:[Object.entries(eH).map(function(e){var n=(0,w.Z)(e,2),i=n[0],r=n[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,T.jsxs)(_.J,{children:[(0,T.jsxs)(O.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,T.jsx)(O.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(eO(h))return v([]);v(eD)},children:eO(h)?"Unselect All":"Select all"})]}),eB.map(function(e){return(0,T.jsx)(er.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:h.includes(e.value),onClick:function(){if(h.find(function(n){return n===e.value}))return v(h.filter(function(n){return n!==e.value}));v((0,eA.Z)(h).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[p?"multi":"single"])?(0,T.jsx)(O.xu,{sx:{position:"absolute"},children:(0,T.jsx)(O.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[p?"multi":"single"]})}):null]}),(0,T.jsx)(_.J,{children:(0,T.jsx)(O.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,T.jsxs)(O.__,{variant:"label.border",children:[(0,T.jsx)(O.XZ,{checked:p,onChange:function(){return m(!p)}}),"Allow multiple paragraphs"]})})})]})},eU={icon:g.BAW,title:"Rich Text",description:"A rich text field with formatting options"},eW=c.object().shape({type:c.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)((0,k.Z)({},eH,{labels:{yupType:"array",validate:{}}}),"id"))}),eY={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:eD.join(",")}}},FormFields:eH,Meta:eU,schema:eW,TYPE_NAME:"StructuredText",Form:eG},e$=d.J,eK=c.object().shape({type:c.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(e$,"id"))}),eX={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:g.SQS,title:"Key Text",description:"A simple text string field"},schema:eK,TYPE_NAME:"Text",FormFields:e$},eQ=d.J,e0={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:c.object().shape({type:c.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(eQ,"id"))}),FormFields:eQ,TYPE_NAME:"Timestamp",Meta:{icon:g.f$3,title:"Timestamp",description:"A calendar date picker with time"}},e2={label:d.J.label,id:(0,I.Z)((0,k.Z)({},d.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:d.J.placeholder},e1=c.object().shape({type:c.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(e2,"id"))}),e4={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:g.izl,title:"UID",description:"Unique Identifier"},schema:e1,TYPE_NAME:"UID",FormFields:e2}},81944:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.Boolean},Color:function(){return i.Color},ContentRelationship:function(){return i.ContentRelationship},Date:function(){return i.Date},Embed:function(){return i.Embed},GeoPoint:function(){return i.GeoPoint},Group:function(){return r.f},Image:function(){return i.Image},Link:function(){return i.Link},LinkToMedia:function(){return i.LinkToMedia},Number:function(){return i.Number},Select:function(){return i.Select},StructuredText:function(){return i.StructuredText},Text:function(){return i.Text},Timestamp:function(){return i.Timestamp},UID:function(){return i.UID}});var i=t(64831),r=t(4940)},7850:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.Boolean},Color:function(){return i.Color},ContentRelationship:function(){return i.ContentRelationship},Date:function(){return i.Date},Embed:function(){return i.Embed},GeoPoint:function(){return i.GeoPoint},Image:function(){return i.Image},Link:function(){return i.Link},LinkToMedia:function(){return i.LinkToMedia},NestedGroup:function(){return r.k},Number:function(){return i.Number},Select:function(){return i.Select},StructuredText:function(){return i.StructuredText},Text:function(){return i.Text},Timestamp:function(){return i.Timestamp},UID:function(){return i.UID}});var i=t(64831),r=t(70479)},50535:function(e,n,t){"use strict";t.d(n,{B9:function(){return s},Ss:function(){return u},uS:function(){return c},zg:function(){return d}});var i=t(98240),r=t(9849),o=t(65413),l=t(86163),a=t(58428),s=function(e,n){return e[n],(0,i.Z)(e,[n].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},u=function(e,n){return!e[n]&&(console.log('Could not find widget with type name "'.concat(n,'".')),!0)},d=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},21112:function(e,n,t){"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))}t.d(n,{T:function(){return i}})},41350:function(e){e.exports={flex:"List_flex__v0QQS",row:"List_row__sBVx1 List_flex__v0QQS",root:"List_root__f9klF List_flex__v0QQS","root-border":"List_root-border__2nh4p",child:"List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",header:"List_header__J5e8m List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",headerActions:"List_headerActions__FqUvW List_row__sBVx1 List_flex__v0QQS",item:"List_item__t5SQz List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS"}},73539:function(e){e.exports={root:"ZoneEmptyState_root__K6dwt"}}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[574],{85513:function(e,n,t){"use strict";t.d(n,{aV:function(){return d},Bu:function(){return f}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715),s=t(6277),c=t(41350),u=t.n(c),d=function(e){var n=e.border,t=(0,o.Z)(e,["border"]);return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},t),{className:(0,s.Z)(u().root,(void 0===n||n)&&u()["root-border"])}))},f=function(e){var n=e.actions,t=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:u().header,children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:u().headerActions,children:n}):null]}))}},90490:function(e,n,t){"use strict";t.d(n,{CM:function(){return s},Ir:function(){return l},J0:function(){return c},eE:function(){return a}});var i,r,o=t(17064);function l(e){var n,t,o=structuredClone(e.group);return null!==(n=(i=o).config)&&void 0!==n||(i.config={}),null!==(t=(r=o.config).fields)&&void 0!==t||(r.fields={}),o.config.fields[e.fieldId]=e.field,o}function a(e){var n,t,i=structuredClone(e.group);if(!(null===(n=i.config)||void 0===n?void 0:n.fields)||!(null===(t=e.group.config)||void 0===t?void 0:t.fields))return i;for(var r in i.config.fields={},e.group.config.fields)r===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[r]=e.group.config.fields[r];return i}function s(e){var n,t=structuredClone(e.group);if(!(null===(n=t.config)||void 0===n?void 0:n.fields))return t;var i=Object.entries(t.config.fields),r=(0,o.Z)(i.splice(e.sourceIndex,1),1)[0];return i.splice(e.destinationIndex,0,r),t.config.fields=Object.fromEntries(i),t}function c(e){var n,t,i=structuredClone(e.group);return null===(n=i.config)||void 0===n||null===(t=n.fields)||void 0===t||delete t[e.fieldId],i}},90104:function(e,n,t){"use strict";t.d(n,{X:function(){return o}});var i=t(52322),r=t(22715),o=function(e){var n,t=e.status;switch(t){case"pending":n={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":n={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":n={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[n.icon,(0,i.jsx)(r.xv,{color:"grey11",children:n.text})]})}},51279:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322),o=t(61183);t(2784);var l=t(59326),a=t(75289),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};o.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],u=function(e){var n,t=e.children,s=e.lang,u=e.sx,d=e.codeStyle,f=e.codeClass,p=e.Header,m=(0,l.B7)().theme,x=s?o.Z.highlight(t,{language:"vue"===s?"html":s}).value:o.Z.highlightAuto(t,c).value;return(0,r.jsxs)(a.kC,{as:"pre",sx:u,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=m.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:x}})]})}},26950:function(e,n,t){"use strict";t.d(n,{J:function(){return c},k:function(){return s}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322);t(2784);var a=t(75289),s=function(e){var n=e.children,t=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},t)},s),{children:n}))},c=function(e){var n=e.children,t=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===t?2:t)-1,"%"),mb:1},children:n})}},35549:function(e,n,t){"use strict";t.d(n,{$w:function(){return i},Hq:function(){return d},tM:function(){return u}});var i,r=t(62230),o=t(85244),l=t(52322),a=t(63397);t(2784);var s,c=t(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var u=function(e){var n={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}});case i.WARNING:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}});default:return n}},d=function(e){var n=e.sx,t=e.field,s=e.meta,d=e.formField,f=e.fieldName,p=e.fields,m=e.initialValues,x=e.isDisabled,h=s.error?i.ERROR:x||d.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===n?{}:n,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[d.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:d.placeholder||d.label||f},d.fieldLevelValidation&&m?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:m.id})}}:null,t),{as:c.II,sx:u(h),disabled:x||d.disabled}))]})}},20180:function(e,n,t){"use strict";t.d(n,{kp:function(){return c},sP:function(){return d},w8:function(){return f},Hq:function(){return p.Hq}});var i=t(62230),r=t(85244),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=function(e){var n=e.field,t=e.meta,c=e.fieldName,u=e.label,d=e.focusOnNewEntry,f=void 0===d||d,p=e.inputPlaceholder,m=e.buttonLabel,x=(0,a.useState)(t.value.length),h=x[0],v=x[1],g=(0,a.useRef)(Array(t.value.length));return(0,a.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,a.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[u,t.touched&&t.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:t.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},n),{render:function(e){return(0,o.jsxs)("div",{children:[n.value&&n.value.length>0?n.value.map(function(n,t){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(t),value:n,ref:function(e){return g.current[t]=e},onChange:function(n){var i=n.target.value;return e.replace(t,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(t)},children:"-"})]},"".concat(c,"-").concat(+t+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(n.value.length,"")},children:m})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,a=e.fieldName,c=e.onChange,d=(0,u.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},d),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!n.value)},checked:n.value}),t]}))},f=function(e){var n=e.field,t=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,a.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(d,{meta:{value:f},fieldName:n.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof t?t(l,f):t})},p=t(35549)},82004:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(75289),c=(0,a.forwardRef)(function(e,n){var t=e.children,a=e.Component,c=void 0===a?s.kC:a,u=e.sx,d=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===u?{}:u),ref:n},d),{children:t}))});n.Z=c},1225:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(62230),r=t(85244),o=t(52322),l=t(5446),a=t(2784),s=t(40023),c=t(951),u=t(8799),d=t(18978),f=t(59326),p=t(75289),m=t(82004),x=t(26474),h=t(98240),v=t(33710),g=t(79401),b=function(e){var n=e.text,t=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),u=(0,a.useState)(null),d=u[0],f=u[1],m=function(){f(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return m(),window.addEventListener("resize",m),function(){window.removeEventListener("resize",m)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.xv,(0,r.Z)((0,i.Z)({"data-for":n,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:t,ref:c},s),{children:n})),d&&(0,o.jsx)(g.X,{children:(0,o.jsx)(v.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},y=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(n=l.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=l.colors)||void 0===t?void 0:t.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var n=e.item,t=e.index,h=e.deleteItem,v=e.enterEditMode,g=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,k=e.CustomEditElements,I=e.widget,S=e.draggableId,C=e.testId,E=e.isRepeatableCustomType,F=e.children,w=(0,f.B7)().theme,T=n.key,_=n.value,M=_.config,A=_.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:S,index:t,children:function(e){var s,f,S,_,N;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(m.Z,(0,r.Z)((0,i.Z)({"data-testid":C,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(x.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:d.Fm7,color:null===(s=w.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:w,text:(null==M?void 0:M.label)||T,sliceFieldName:b&&b(T),WidgetIcon:I.Meta.icon}),(0,o.jsxs)(p.kC,{children:[k||null,Z||(0,o.jsx)(x.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=w.colors)||void 0===f?void 0:f.icons},onClick:function(){return v([T,n.value],g,t)}}),!(!0===E&&"UID"==A)&&(0,o.jsxs)(l.v2,{children:[(0,o.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(u.FQA,{size:20,color:null===(S=w.colors)||void 0===S?void 0:S.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(_=w.colors)||void 0===_?void 0:_.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(N=w.colors)||void 0===N?void 0:N.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),F]}))})}})})}},26474:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(75289),s=function(e,n){return n?{border:function(e){var n=e.colors;return"1px solid ".concat(n.error)}}:e?{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)}}:{border:function(e){var n=e.colors;return"1px solid ".concat(n.borders)}}},c=function(e){var n=e.sx,t=e.onClick,c=e.label,u=e.Icon,d=e.error,f=e.size,p=void 0===f?16:f,m=e.fitButton,x=e.active,h=e.useActive,v=e.activeSx,g=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===t?function(){return null}:t,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==m&&m?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==x&&x,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},79474:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=t(20180),u=t(33413),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,l.U$)(n),3),m=p[0],x=p[1],h=p[2],v=t.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===u.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:x,field:m,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[t.type===u.h.INPUT?(0,o.jsx)(c.Hq,{meta:x,field:m,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===u.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:x,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},1411:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(59326),u=t(75289),d=t(65413),f=t(2784),p=t(92928),m=t(2978),x=t(98240),h=function(e){var n=e.children,t=(0,x.Z)(e,["children"]);return(0,l.jsx)(u.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},t),{children:n}))};h.tabsRole="TabList";var v=function(e){var n=e.children,t=(0,x.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(p.OK,(0,r.Z)((0,i.Z)({},t),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},t.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:n}))};v.tabsRole="Tab";var g=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,d=void 0===c?0:c,x=(0,f.useState)(d),g=x[0],b=x[1];return(0,l.jsx)(m.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:t,children:(0,l.jsxs)(p.mQ,{defaultIndex:d,onSelect:function(e){return b(e)},children:[(0,l.jsx)(h,{children:(o||[]).map(function(e){return(0,l.jsx)(v,{children:e},e)})}),f.Children.map(n,function(e,n){return(0,l.jsx)(u.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===g?"block":"none"},children:(0,l.jsx)(p.x4,{children:e})})})]})})},b=(0,f.memo)(g),y=t(26950),j=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(n=o.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=o.colors)||void 0===t?void 0:t.primary}}),(0,l.jsx)(u.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},Z=t(28199),k=t(86163),I=t(5632),S=t(65186),C=t(25978),E=function(){var e=(0,I.useRouter)();return(0,l.jsxs)(u.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(S.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(u.xu,{sx:{height:"12px"}}),(0,l.jsx)(u.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(u.xu,{sx:{height:"8px"}}),(0,l.jsx)(u.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(u.xu,{sx:{height:"24px"}}),(0,l.jsx)(u.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),C.pq)},children:"Go to the Slice Simulator"})]})},F=t(81944),w=t(50535),T=t(69114),_=t(79474),M=t(67557),A=t(77033),N=t(63397),R=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,d=e.children;return(0,l.jsx)(u.xu,{children:(0,l.jsx)(N.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,x.Z)(e,["id"])).reduce(function(e,n){var t=(0,o.Z)(n,2),l=t[0],a=t[1];if((void 0===a?"undefined":(0,A.Z)(a))!==Boolean&&!a){var s,u=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==u)return(0,r.Z)((0,i.Z)({},e),(0,M.Z)({},l,u))}return(0,r.Z)((0,i.Z)({},e),(0,M.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(N.l0,{id:n,children:d((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},L=(0,f.memo)(R);s().setAppElement("#__next");var B=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,f=e.zoneType,p=(0,c.B7)().theme;if(!t.isOpen)return null;var m=(0,o.Z)(t.field,2),x=m[0],h=m[1],v=(0,T.t)(F,h.config,h.type);if(!v)return(0,l.jsxs)("div",{children:[h.type," not found"]});var g=v.Meta.icon,I=v.FormFields,S=v.Form,C=v.schema,M=(0,i.Z)({},(0,k.f7)((0,w.B9)(I,"id")),v.prepareInitialValues?v.prepareInitialValues(h.config):h.config),A=function(){try{return{res:C.validateSync({type:h.type,config:M},{stripUnknown:!0})}}catch(e){return{err:e}}}(),N=A.res,R=A.err;R&&(console.error("[EditModal] Failed to validate field of type ".concat(h.type,".\n Please update model.json accordingly.")),console.error(R));var B={id:x,config:N?N.config:M},D=(0,o.Z)(I.id.validate.matches,2),O=D[0],V=D[1],q=d.object().shape({id:d.string().matches(O,V).min(3).max(35).required(),config:C.fields.config}),z="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(L,{apiId:x,formId:z,initialValues:B,validationSchema:q,FormFields:I,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:x,newKey:t,value:(0,i.Z)({},h,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,d=e.isValid,m=e.isSubmitting,x=e.initialValues,h=S?(0,l.jsx)(S,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(I).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(y.J,{children:(0,l.jsx)(_.Z,{fieldName:(0,k.lm)(t),formField:i,fields:a,initialValues:x})},t)})},"field-model-tab-content"),v=["Field Model"],Z=[h];if("slice"===f){var C=(0,l.jsx)(u.xu,{children:(0,l.jsx)(E,{})},"mock-data-tab-content");v.push("Mock Data"),Z.push(C)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:v,Header:function(e){var t=e.radius;return(0,l.jsxs)(u.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t},children:[(0,l.jsx)(j,{theme:p,text:c||s,WidgetIcon:g}),(0,l.jsx)(u.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(u.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(u.xu,{sx:{ml:"auto"}}),(0,l.jsx)(u.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(u.zx,{form:z,type:"submit",disabled:!d&&m,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},14424:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(75289),c=t(2978),u=t(26950),d=t(28199),f=t(59326),p=function(e){var n=e.title,t=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(s.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},"&:hover":{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":n,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(n,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(s.xu,{ml:1,children:[(0,o.jsx)(s.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(s.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var m=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(d.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(c.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(s.X6,{children:"Add a new field"}),(0,o.jsx)(s.x8,{onClick:t})]})},children:(0,o.jsx)(u.k,{children:a.filter(function(e){return e}).map(function(e){var n=e.Meta,t=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(u.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},63928:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(49857),s=t(7604),c=t(77245),u=t(8799),d=t(65186),f=t(59326),p=t(75289),m=t(51279),x={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,f.B7)().theme,h=(0,l.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(p.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(p.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(u.vcz,{size:26,color:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(m.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(p.xu,{children:(0,o.jsxs)(p.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(d.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:x}):(0,o.jsx)(c.LhG,{size:16,style:x}),(0,o.jsx)(p.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=function(e){var n=e.show,t=e.renderHintBase,l=e.item,c=t({item:l}),u=(0,a.ZP)(c,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:c.split("."),model:l.value})];case 1:return[2,e.sent()]}})})),d=u.data,f=u.error;if(f&&console.error(f),!d||f)return null;var p=d.snippets||[];return p[0]?(0,o.jsx)("div",{style:{display:n?"initial":"none"},children:(0,o.jsx)(h,{code:p[0].code,lang:p[0].language})}):null}},12158:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var i={};t.r(i),t.d(i,{Boolean:function(){return h.Boolean},Color:function(){return h.Color},ContentRelationship:function(){return h.ContentRelationship},Date:function(){return h.Date},Embed:function(){return h.Embed},GeoPoint:function(){return h.GeoPoint},Group:function(){return v.f},Image:function(){return h.Image},Link:function(){return h.Link},LinkToMedia:function(){return h.LinkToMedia},NestedGroup:function(){return g.k},Number:function(){return h.Number},Select:function(){return h.Select},StructuredText:function(){return h.StructuredText},Text:function(){return h.Text},Timestamp:function(){return h.Timestamp},UID:function(){return h.UID}});var r=t(62230),o=t(85244),l=t(98240),a=t(52322),s=t(22715),c=t(63397),u=t(2784),d=t(75289),f=t(59326),p=t(35549),m=t(86163),x=t(58428),h=t(64831),v=t(4940),g=t(70479),b=t(55197),y=t(18978),j=t(33710),Z=t(79401),k=function(e){var n=e.error;return n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Z.X,{children:(0,a.jsx)(j.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,a.jsx)(y.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},I=function(e){var n=e.innerRef,t=(0,l.Z)(e,["innerRef"]);return(0,a.jsx)(d.II,(0,o.Z)((0,r.Z)({},t),{ref:n}))},S=function(e){var n=e.widgetTypeName,t=e.fields,l=e.onSave,h=e.onCancelNewField,v=(0,u.useRef)(null),g=(0,f.B7)().theme,y=(0,u.useState)(!0),j=y[0],Z=y[1];(0,u.useEffect)(function(){v.current&&v.current.focus()},[v]);var S=i[n];if(!S)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,a.jsx)("div",{children:"Unexpected error. Contact us for more info."});var C=S.FormFields,E=S.Meta.icon,F={id:C.id,label:C.label},w=(0,o.Z)((0,r.Z)({},(0,m.f7)(F),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,m.gc)(F),_=function(e,n,t){t(j&&!F.id.disabled?(0,o.Z)((0,r.Z)({},n),{label:e.target.value,id:(0,b.lV)(e.target.value)}):(0,o.Z)((0,r.Z)({},n),{label:e.target.value}))},M=function(e,n){n("id",e.target.value),Z(!1)};return(0,a.jsx)(c.J9,{onSubmit:l,validationSchema:T,initialValues:w,children:function(e){var n,i,l=e.errors,u=e.values,f=e.setValues,m=e.setFieldValue,b=e.submitForm;return(0,a.jsx)(c.l0,{"data-testid":"new-field-form",children:(0,a.jsxs)(d.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var n,t;return"1px solid ".concat((null===(n=e.colors)||void 0===n?void 0:null===(t=n.borders)||void 0===t?void 0:t.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,a.jsx)(E,{style:{color:null===(n=g.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(i=g.colors)||void 0===i?void 0:i.primary},size:28}),(0,a.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,a.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,a.jsx)(c.gN,{onChange:function(e){return _(e,u,f)},onKeyDown:function(e){"Enter"===e.key&&b()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:I,innerRef:v,sx:(0,o.Z)((0,r.Z)({},(0,p.tM)(F.label.disabled?p.$w.DISABLED:l.label?p.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,a.jsx)(k,{error:l.label})]}),(0,a.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,a.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,a.jsx)(c.gN,{onChange:function(e){return M(e,m)},onKeyDown:function(e){"Enter"===e.key&&b()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:F.id.disabled,validate:function(e){return(0,x.u)({value:e,fields:t,initialId:null})},as:I,sx:(0,o.Z)((0,r.Z)({},(0,p.tM)(F.id.disabled?p.$w.DISABLED:l.id?p.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,a.jsx)(k,{error:l.id})]}),(0,a.jsxs)(d.kC,{sx:{gap:2},children:[(0,a.jsx)(s.zx,{onClick:h,color:"grey",children:"Cancel"}),(0,a.jsx)(s.zx,{onClick:function(){b()},children:"Add"})]})]})})}})}},75843:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(62230),r=t(85244),o=t(17064),l=t(81541),a=t(52322),s=t(22715),c=t(13980),u=t(2784),d=t(65077),f=t(12189),p=t(85513),m=t(21112),x=t(14424),h=t(40023),v=t(75289),g=t(82004),b=t(1225),y=t(81944),j=t(69114),Z=t(63928),k=function(e){var n=e.fields,t=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,u=e.renderFieldAccessor,d=e.onDeleteItem,f=e.onSave,p=e.showHints,m=e.newField,x=e.renderHintBase,k=e.isRepeatable,I=e.testId,S=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:c,children:(0,a.jsx)(h.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(v.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":I,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,m=c.config,h=c.type,I=(0,j.t)(y,m,h);if(!I)return(0,a.jsx)(g.Z,{children:(0,a.jsxs)(v.xv,{children:['Field type "',h,'" not supported']})});var C={item:e,index:n,tabId:o,widget:I,showHints:p,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,saveItem:f,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:S,testId:"list-item-".concat(e.key)},E=(0,a.jsx)(Z.Z,{item:e,show:p,isRepeatable:k,renderHintBase:x,Widgets:y,typeName:I.CUSTOM_NAME||I.TYPE_NAME});if(I.CustomListItem){var F=I.CustomListItem;return(0,a.jsx)(F,(0,r.Z)((0,i.Z)({},C),{HintElement:E}))}return(0,a.jsx)(b.Z,(0,r.Z)((0,i.Z)({},C),{HintElement:E}))}),e.placeholder,m]}))}})})},I=t(12158),S=t(73539),C=t.n(S),E=function(e){var n=e.zoneType,t=e.heading,i=void 0===t?"Your ".concat(n," has no fields yet"):t,r=e.onActionClick,o=e.actionTestId;return(0,a.jsxs)("div",{className:C().root,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s.xv,{variant:"bold",children:i}),(0,a.jsx)(s.xv,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return r()},"data-testid":o,startIcon:"add",children:"Add a field"})]})},F=function(e){var n,t,c=e.zoneType,h=e.zoneTypeFormat,v=e.tabId,g=e.title,b=e.fields,y=e.poolOfFieldsToCheck,j=e.widgetsArray,Z=e.isRepeatable,S=e.onDeleteItem,C=e.onSaveNewField,F=e.onDragEnd,w=e.EditModal,T=e.onSave,_=e.dataTip,M=e.renderHintBase,A=e.renderFieldAccessor,N=e.testId,R=e.isRepeatableCustomType,L=e.emptyStateHeading,B=e.emptyStateActionTestId,D=Object.entries(y).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?j.filter(function(e){return"UID"!==e.TYPE_NAME}):j,O=(0,u.useState)(!1),V=O[0],q=O[1],z=(0,u.useState)({isOpen:!1}),P=z[0],H=z[1],J=(0,u.useState)({isOpen:!1}),G=J[0],U=J[1],W=(0,u.useState)(null),Y=W[0],$=W[1],K=function(e){H({isOpen:!0,field:e});var n=(0,o.Z)(e,2),t=n[0],i=n[1];f.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!1,contentType:(0,m.T)(window.location.pathname)})},X=function(){U({isOpen:!0})},Q=function(){H({isOpen:!1})},ee=function(){return U({isOpen:!1})},en=function(e){$({widgetTypeName:e,fields:b}),U({isOpen:!1})},et=function(){return $(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:b.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:V,onCheckedChange:q,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(Z?"Repeatable":"Static","-field"),onClick:X,startIcon:"add",color:"grey",disabled:null!==Y,children:"Add a field"})]}):void 0,children:g}),0!==b.length||Y?b.length>0||Y?(0,a.jsx)(d.xR,{children:(0,a.jsx)(k,{tabId:v,isRepeatable:Z,fields:b,showHints:V,dataTip:_,title:g,renderFieldAccessor:A,renderHintBase:M,enterEditMode:K,enterSelectMode:X,onDragEnd:F,onDeleteItem:S,onSave:T,testId:N,isRepeatableCustomType:R,newField:Y&&(0,a.jsx)(I.Z,(0,r.Z)((0,i.Z)({},Y),{fields:y||b,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];C.apply(void 0,(0,l.Z)(n)),$(null)},onCancelNewField:et}))})}):void 0:(0,a.jsx)(E,{zoneType:(n=c,t=h,"customType"===n?"page"===t?"page type":"custom type":n),heading:L,onActionClick:function(){return X()},actionTestId:B}),(0,a.jsx)(w,{data:P,close:Q,onSave:T,fields:y,zoneType:c}),(0,a.jsx)(x.Z,{data:G,close:ee,onSelect:en,widgetsArray:D})]})};F.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var w=F},69114:function(e,n,t){"use strict";t.d(n,{t:function(){return r}});var i=t(59050),r=function(e,n,t){if("Link"===t)switch(null==n?void 0:n.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}if(t===i.GroupFieldType){var r;return null!==(r=e.NestedGroup)&&void 0!==r?r:e.Group}return e[t]}},58428:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(25978),r=t(77362),o=function(e){var n=e.value,t=e.fields,i=e.initialId;return n?t.find(function(e){return e.key===n})&&n!==i?'Field "'.concat(n,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},77362:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(86163),r=t(33413),o=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(n,s)},required:n,label:e,defaultValue:t,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,u=n||{},d=u.min,f=u.max,p=u.required,m=u.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(d,l),max:(0,i.MJ)(f,a),matches:m},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},86163:function(e,n,t){"use strict";t.d(n,{MJ:function(){return d},f7:function(){return f},gc:function(){return p},lm:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),l=t(17064),a=t(81541),s=t(65413),c=t(33413),u=function(e){return"id"===e?"id":"config.".concat(e)},d=function(e,n){return Array.isArray(e)?e:"boolean"==typeof e&&e?n:null},f=function(e){return Object.entries(e).reduce(function(e,n){var t,a=(0,l.Z)(n,2),s=a[0],u=null===(t=a[1]).defaultValue?void 0:void 0!==t.defaultValue?t.defaultValue:t.type===c.h.CHECKBOX||(t.type===c.h.INPUT?"":t.type===c.h.SELECT?[]:void 0);return void 0!==u?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,u)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,n){var t=(0,l.Z)(n,2),c=t[0],u=t[1],d=u.validate,f=u.yupType;if(!d)return e;if("function"==typeof d)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,d(c,u)));var p=s[f]();return Object.entries(d).filter(function(e){return e&&e[1]}).forEach(function(e){var n,t=(0,l.Z)(e,2),i=t[0],r=t[1];if(r&&p[i]){p=(n=p)[i].apply(n,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},33413:function(e,n,t){"use strict";var i,r;t.d(n,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},4940:function(e,n,t){"use strict";t.d(n,{f:function(){return D}});var i,r=t(65186),o=t(65413),l=t(62230),a=t(85244),s=t(17064),c=t(52322),u=t(75289),d=t(26950),f=t(79474),p=t(86163),m=t(58428),x=t(77362),h=(0,a.Z)((0,l.Z)({},m.J),{repeat:(0,x.Jg)("Repeatable",!1,!0)}),v=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,c.jsxs)(d.k,{children:[Object.entries(h).filter(function(e){return"repeat"!==(0,s.Z)(e,1)[0]}).map(function(e){var i=(0,s.Z)(e,2),r=i[0],o=i[1];return(0,c.jsx)(d.J,{children:(0,c.jsx)(f.Z,{fieldName:(0,p.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,c.jsx)(d.J,{children:(0,c.jsx)(u.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,c.jsxs)(u.__,{variant:"label.border",sx:{mb:0},children:[(0,c.jsx)(u.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},g=t(98240),b=t(81541),y=t(2784),j=t(40023),Z=t(28316),k=t(12189),I=t(90490),S=t(1225),C=t(1411),E=t(14424),F=t(63928),w=t(12158),T=t(69114),_=t(38265),M=t(27594),A=t(7850),N=t(50535),R=t(55197),L=t(21112),B=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),r=e.isRepeatable,o=e.item,d=e.draggableId,f=e.saveItem,p=e.HintElement,m=(0,g.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),x=(0,y.useState)(!1),h=x[0],v=x[1],B=(0,y.useState)(null),D=B[0],O=B[1],V=(0,y.useState)({isOpen:!1}),q=V[0],z=V[1],P=function(e){O({widgetTypeName:e}),v(!1)},H=function(){O(null)},J=function(){z({isOpen:!1})},G=function(e){var n=e.id,t=e.label,i=A[e.widgetTypeName].create(t),r=(0,I.Ir)({group:_.Fl.fromSM(o.value),fieldId:n,field:i});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)}),k.Xe.track({event:"field:added",id:n,name:t,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})},U=function(e){var n=e.apiId,t=e.newKey,i=e.value,r=(0,I.eE)({group:_.Fl.fromSM(o.value),previousFieldId:n,newFieldId:t,field:_.Fl.fromSM(i)});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)})},W=function(e){if(!(0,N.uS)(e)){var n=e.source,t=e.destination;if(t){var i=n.index,r=t.index,l=(0,I.CM)({group:_.Fl.fromSM(o.value),sourceIndex:i,destinationIndex:r});(0,Z.flushSync)(function(){f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(l)})})}}},Y=function(e){var n=(0,I.J0)({group:_.Fl.fromSM(o.value),fieldId:e});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(n)})},$=function(e){z({isOpen:!0,field:e});var n=(0,s.Z)(e,2),t=n[0],i=n[1];k.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})};return(0,c.jsxs)(y.Fragment,{children:[(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({item:o,widget:t,draggableId:d},m),{HintElement:p,CustomEditElements:[(0,c.jsx)(u.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return v(!0)},children:"Add Field"},"custom-edit-element-".concat(o.key)),],children:(0,c.jsx)(u.xu,{sx:{ml:4},children:(0,c.jsx)(j.Z5,{onDragEnd:W,children:(0,c.jsx)(j.bK,{droppableId:"".concat(n,"-").concat(o.key,"-zone"),children:function(e){return(0,c.jsxs)("ul",(0,a.Z)((0,l.Z)({ref:e.innerRef},e.droppableProps),{children:[o.value.config.fields.map(function(e,n){var t=e.value,s=t.config,u=t.type,d=(0,T.t)(A,s,u);if(!d)return null;var f={item:e,index:n,widget:d,key:e.key,enterEditMode:$,deleteItem:Y,saveItem:U,renderFieldAccessor:function(n){return"item".concat((0,R.Ti)(e.key))},draggableId:"group-".concat(o.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(o.key,"-").concat(e.key)},p=(0,c.jsx)(F.Z,{item:e,show:i,isRepeatable:r,renderHintBase:function(e){var n=e.item;return"item".concat((0,R.Ti)(n.key))},Widgets:A,typeName:d.CUSTOM_NAME||d.TYPE_NAME});if(d.CustomListItem){var m=d.CustomListItem;return(0,c.jsx)(m,(0,a.Z)((0,l.Z)({},f),{HintElement:p}))}return(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({},f),{HintElement:p}))}),e.placeholder,D&&(0,c.jsx)(w.Z,(0,a.Z)((0,l.Z)({},D),{fields:o.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];G.apply(void 0,(0,b.Z)(n)),O(null)},onCancelNewField:H}))]}))}})})})})),(0,c.jsx)(E.Z,{data:{isOpen:h},close:function(){return v(!1)},onSelect:P,widgetsArray:M.Z}),(0,c.jsx)(C.Z,{data:q,close:J,onSave:U,fields:o.value.config.fields})]})},D={Meta:{icon:r.cC1,title:"Group",description:"A repeatable set of fields"},Form:v,FormFields:h,schema:o.object().shape({type:o.string().matches(/^Group$/,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),placeholder:o.string(),repeat:o.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:B,TYPE_NAME:"Group"}},70479:function(e,n,t){"use strict";t.d(n,{k:function(){return D}});var i,r=t(65186),o=t(65413),l=t(62230),a=t(85244),s=t(17064),c=t(52322),u=t(75289),d=t(26950),f=t(79474),p=t(86163),m=t(58428),x=t(77362),h=(0,a.Z)((0,l.Z)({},m.J),{repeat:(0,x.Jg)("Repeatable",!1,!0)}),v=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,c.jsxs)(d.k,{children:[Object.entries(h).filter(function(e){return"repeat"!==(0,s.Z)(e,1)[0]}).map(function(e){var i=(0,s.Z)(e,2),r=i[0],o=i[1];return(0,c.jsx)(d.J,{children:(0,c.jsx)(f.Z,{fieldName:(0,p.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,c.jsx)(d.J,{children:(0,c.jsx)(u.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,c.jsxs)(u.__,{variant:"label.border",sx:{mb:0},children:[(0,c.jsx)(u.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},g=t(98240),b=t(81541),y=t(2784),j=t(40023),Z=t(28316),k=t(12189),I=t(90490),S=t(1225),C=t(1411),E=t(14424),F=t(63928),w=t(12158),T=t(69114),_=t(38265),M=t(64831),A=[M.StructuredText,M.Image,M.Link,M.LinkToMedia,M.ContentRelationship,M.Select,M.Boolean,M.Date,M.Timestamp,M.Embed,M.Number,M.GeoPoint,M.Color,M.Text,],N=t(50535),R=t(55197),L=t(21112),B=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),r=e.isRepeatable,o=e.item,d=e.draggableId,f=e.saveItem,p=e.HintElement,m=(0,g.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),x=(0,y.useState)(!1),h=x[0],v=x[1],B=(0,y.useState)(null),D=B[0],O=B[1],V=(0,y.useState)({isOpen:!1}),q=V[0],z=V[1],P=function(e){O({widgetTypeName:e}),v(!1)},H=function(){O(null)},J=function(){z({isOpen:!1})},G=function(e){var n=e.id,t=e.label,i=M[e.widgetTypeName].create(t),r=(0,I.Ir)({group:_.Fl.fromSM(o.value),fieldId:n,field:i});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)}),k.Xe.track({event:"field:added",id:n,name:t,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})},U=function(e){var n=e.apiId,t=e.newKey,i=e.value,r=(0,I.eE)({group:_.Fl.fromSM(o.value),previousFieldId:n,newFieldId:t,field:i});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(r)})},W=function(e){if(!(0,N.uS)(e)){var n=e.source,t=e.destination;if(t){var i=n.index,r=t.index,l=(0,I.CM)({group:_.Fl.fromSM(o.value),sourceIndex:i,destinationIndex:r});(0,Z.flushSync)(function(){f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(l)})})}}},Y=function(e){var n=(0,I.J0)({group:_.Fl.fromSM(o.value),fieldId:e});f({apiId:o.key,newKey:o.key,value:_.Fl.toSM(n)})},$=function(e){z({isOpen:!0,field:e});var n=(0,s.Z)(e,2),t=n[0],i=n[1];k.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,L.T)(window.location.pathname)})};return(0,c.jsxs)(y.Fragment,{children:[(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({item:o,widget:t,draggableId:d},m),{HintElement:p,CustomEditElements:[(0,c.jsx)(u.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return v(!0)},children:"Add Field"},"custom-edit-element-".concat(o.key)),],children:(0,c.jsx)(u.xu,{sx:{ml:4},children:(0,c.jsx)(j.Z5,{onDragEnd:W,children:(0,c.jsx)(j.bK,{droppableId:"".concat(n,"-").concat(o.key,"-zone"),children:function(e){return(0,c.jsxs)("ul",(0,a.Z)((0,l.Z)({ref:e.innerRef},e.droppableProps),{children:[o.value.config.fields.map(function(e,n){var t=e.value,s=t.config,u=t.type,d=(0,T.t)(M,s,u);if(!d)return null;var f={item:e,index:n,widget:d,key:e.key,enterEditMode:$,deleteItem:Y,renderFieldAccessor:function(n){return"item".concat((0,R.Ti)(e.key))},draggableId:"group-".concat(o.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(o.key,"-").concat(e.key)},p=(0,c.jsx)(F.Z,{item:e,show:i,isRepeatable:r,renderHintBase:function(e){var n=e.item;return"item".concat((0,R.Ti)(n.key))},Widgets:M,typeName:d.CUSTOM_NAME||d.TYPE_NAME});return(0,c.jsx)(S.Z,(0,a.Z)((0,l.Z)({},f),{HintElement:p}))}),e.placeholder,D&&(0,c.jsx)(w.Z,(0,a.Z)((0,l.Z)({},D),{fields:o.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];G.apply(void 0,(0,b.Z)(n)),O(null)},onCancelNewField:H}))]}))}})})})})),(0,c.jsx)(E.Z,{data:{isOpen:h},close:function(){return v(!1)},onSelect:P,widgetsArray:A}),(0,c.jsx)(C.Z,{data:q,close:J,onSave:U,fields:o.value.config.fields})]})},D={Meta:{icon:r.cC1,title:"Group",description:"A repeatable set of fields"},Form:v,FormFields:h,schema:o.object().shape({type:o.string().matches(/^NestedGroup$/,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),placeholder:o.string(),repeat:o.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:B,TYPE_NAME:"Group",CUSTOM_NAME:"NestedGroup"}},27594:function(e,n,t){"use strict";var i=t(7850);n.Z=[i.NestedGroup,i.StructuredText,i.Image,i.Link,i.LinkToMedia,i.ContentRelationship,i.Select,i.Boolean,i.Date,i.Timestamp,i.Embed,i.Number,i.GeoPoint,i.Color,i.Text,]},64831:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return v},Color:function(){return Z},ContentRelationship:function(){return J},Date:function(){return W},Embed:function(){return K},GeoPoint:function(){return Q},Image:function(){return eh},Link:function(){return B},LinkToMedia:function(){return ej},Number:function(){return eS},Select:function(){return eM},StructuredText:function(){return eY},Text:function(){return eX},Timestamp:function(){return e0},UID:function(){return e4}});var i,r,o,l,a,s=t(8799),c=t(65413),u=t(86163),d=t(58428),f=t(77362),p=t(50535),m={icon:s.XGl,title:"Boolean",description:"An input that is either true or false"},x={label:d.J.label,id:d.J.id,placeholder_false:(0,f.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,f.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,f.Jg)("Default to true")},h=c.object().shape({type:c.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(x,"id"))}),v={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:m,schema:h,FormFields:x},g=t(65186),b={icon:g.jqW,title:"Color",description:"A color picker"},y=(0,p.zg)("Color"),j=y.TYPE_NAME,Z={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:y.FormFields,TYPE_NAME:j,schema:y.schema,Meta:b},k=t(62230),I=t(85244),S=t(56580),C=t(93290),E=t(7781),F=t(34543),w=t(17064),T=t(52322),_=t(26950),M=t(79474),A=(0,I.Z)((0,k.Z)({},d.J),{allowTargetBlank:(0,f.Jg)("Allow target blank",!1,!1)}),N=function(e){var n=e.initialValues,t=e.fields;return(0,T.jsx)(_.k,{children:Object.entries(A).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},R={icon:F.eR7,title:"Link",description:"A link to web, media or Prismic document"},L=c.object().shape({label:c.string().optional(),useAsTitle:c.boolean().optional(),placeholder:c.string().optional(),select:c.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:c.array(c.string()).strict().optional(),masks:c.array(c.string()).optional(),tags:c.array(c.string()).optional(),allowTargetBlank:c.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),B={Meta:R,FormFields:A,schema:c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:L.optional()}),Form:N,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"},D=t(36131),O=t(75289),V={label:d.J.label,id:d.J.id,customtypes:{validate:function(){return c.array().of(c.string())}}},q=function(e){var n=e.initialValues,t=e.values,i=e.fields,r=e.setFieldValue,o=(0,S.v9)(E.Ch).filter(C.TG),l=o.map(function(e){return{value:e.local.id,label:e.local.label}}),a=t.config.customtypes?t.config.customtypes.map(function(e){var n=o.find(function(n){return n.local.id===e});return{value:null==n?void 0:n.local.id,label:null==n?void 0:n.local.label}}):null;return(0,T.jsxs)(_.k,{children:[Object.entries(V).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,w.Z)(e,2),r=t[0],o=t[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(r),formField:o,fields:i,initialValues:n})},r)}),(0,T.jsx)(_.J,{children:(0,T.jsxs)(O.xu,{sx:{mt:2,alignItems:"center"},children:[(0,T.jsx)(O.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,T.jsx)(D.ZP,{isMulti:!0,name:"origin",options:l,onChange:function(e){e&&r("config.customtypes",e.map(function(e){return e.value}))},value:a,theme:function(e){return(0,I.Z)((0,k.Z)({},e),{colors:(0,I.Z)((0,k.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},z={icon:g.I2R,title:"Content Relationship",description:"Define content relations & internal links"},P=L.shape({label:c.string().max(35,"String is too long. Max: 35"),select:c.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:c.array(c.string()).strict().optional()}),H=c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:P}),J={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:z,schema:H,TYPE_NAME:"Link",FormFields:V,CUSTOM_NAME:"ContentRelationship",Form:q,prepareInitialValues:function(e){var n=(0,S.v9)(E.Ch).filter(C.TG);return(null==e?void 0:e.customtypes)?(0,I.Z)((0,k.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}},G=(0,p.zg)("Date"),U=G.FormFields,W={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:U,TYPE_NAME:"Date",schema:G.schema,Meta:{icon:g.f$3,title:"Date",description:"A calendar date picker"}},Y=(0,p.zg)("Embed"),$=Y.FormFields,K={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:$,TYPE_NAME:"Embed",schema:Y.schema,Meta:{icon:F.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}},X={label:d.J.label,id:d.J.id},Q={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:X,TYPE_NAME:"GeoPoint",schema:c.object().shape({type:c.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:c.object().shape({label:c.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:g.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}},ee=t(2784),en=t(63397),et=t(98240),ei=t(20180),er=t(26474),eo=function(e){var n=e.onClick,t=e.error,i=e.onDelete,r=e.active,o=e.text,l=e.sx;return(0,T.jsx)(er.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:r,sx:(0,k.Z)({position:"relative",width:"64px",height:"64px"},l),Icon:function(){return(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsxs)(O.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,T.jsx)(s.jnY,{size:22}),(0,T.jsx)(O.xv,{mt:1,children:o})]}),i?(0,T.jsx)(O.Ct,{onClick:i,variant:"circle-right",children:(0,T.jsx)(g.B4e,{})}):null]})}})},el=function(e){var n=e.onClick;return(0,T.jsx)(er.Z,{fitButton:!0,onClick:n,sx:{width:"64px",height:"64px",border:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}},Icon:function(){return(0,T.jsx)(O.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,T.jsx)(s.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},ea=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,w.Z)((0,en.U$)(n),2),o=(r[0],r[1]),l=void 0!==t&&t?"*":"";return i?(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsx)(es,{name:"".concat(n,".name"),label:"Name".concat(l),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,T.jsx)(ec,{name:"".concat(n,".width"),label:"Width (px)".concat(l),placeholder:" ",sx:{mb:3}}),(0,T.jsx)(ec,{name:"".concat(n,".height"),label:"Height (px)".concat(l),placeholder:" "})]}):null},es=function(e){var n=e.name,t=e.label,i=e.placeholder,r=e.meta,o=e.isConstraint,l=(0,et.Z)(e,["name","label","placeholder","meta","isConstraint"]),a=(0,w.Z)((0,en.U$)(n),1)[0];return(0,T.jsx)(ei.Hq,(0,I.Z)((0,k.Z)({},l),{fieldName:n,meta:r,formField:{label:t,placeholder:i},field:o?{value:"main",readOnly:!0}:{value:a.value},variant:o?"disabled":"primary"}))},ec=function(e){var n=e.name,t=e.label,i=e.placeholder,r=(0,et.Z)(e,["name","label","placeholder"]),o=(0,w.Z)((0,en.U$)(n),2),l=o[0],a=o[1];return(0,T.jsx)(ei.Hq,(0,I.Z)((0,k.Z)({},r),{fieldName:n,formField:{label:t,placeholder:i},meta:a,field:{min:0,type:"number",value:l.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},eu=function(){return c.number().nullable().transform(function(e,n){return""===n?null:e})},ed={label:d.J.label,id:d.J.id,constraint:{validate:function(){return c.object().defined().shape({width:eu(),height:eu()})}},thumbnails:{validate:function(){return c.array().defined().of(c.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var n="number"==typeof e.width&&e.width,t="number"==typeof e.height&&e.height;return e.name&&(n||t)}}))}}},ef={name:"",width:"",height:""},ep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,t=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||n||t?n||t?"".concat(n||"auto","x").concat(t||"auto"):"...":"auto"},em=function(e){var n=e.initialValues,t=e.values,i=e.errors,r=e.fields,o=e.touched,l=(0,ee.useState)(0),a=l[0],s=l[1],c=t.config,d=c.thumbnails,f=c.constraint;return(0,ee.useEffect)(function(){s(d.length)},[d.length]),(0,T.jsxs)(_.k,{children:[Object.entries(ed).map(function(e){var t=(0,w.Z)(e,2),i=t[0],o=t[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(i),formField:o,fields:r,initialValues:n})},i)}),(0,T.jsxs)(_.J,{children:[(0,T.jsx)(O.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,T.jsx)(O.Zb,{p:3,children:(0,T.jsx)(en.F2,{name:"config.thumbnails",render:function(n){var t=n.push,r=n.remove;return(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsxs)(O.kC,{mb:3,children:[(0,T.jsx)(eo,{active:0===a,text:ep(f,!0),sx:{mr:2},onClick:function(){return s(0)}}),d.map(function(e,n){return(0,T.jsx)(eo,{sx:{mr:3},active:a===+n+1,text:ep(e),error:!!i.thumbnails&&!!o.thumbnails&&!!o.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return r(n)},onClick:function(){return s(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,T.jsx)(el,{onClick:function(){t(ef)}})]}),(0,T.jsx)(ea,(0,I.Z)((0,k.Z)({},e),{display:0===a,prefix:"config.constraint"})),d.map(function(n,t){return(0,ee.createElement)(ea,(0,I.Z)((0,k.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:a===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},ex=c.object().shape({type:c.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(ed,"id"))}),eh={Meta:{icon:s.jnY,title:"Image",description:"A responsive image field with constraints"},Form:em,schema:ex,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:ed,TYPE_NAME:"Image"},ev=(0,k.Z)({},d.J),eg=function(e){var n=e.initialValues,t=e.fields;return(0,T.jsx)(_.k,{children:Object.entries(ev).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},eb={icon:g.x2k,title:"Link to media",description:"A link to files, document and media"},ey=L.shape({select:c.string().required().matches(/^media$/,{excludeEmptyString:!0})}),ej={Meta:eb,FormFields:ev,schema:c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ey.optional()}),Form:eg,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},eZ=t(951),ek=(0,p.zg)("Number"),eI=ek.FormFields,eS={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:eI,TYPE_NAME:"Number",schema:ek.schema,Meta:{icon:eZ.JUs,title:"Number",description:"A number input field"}},eC=t(33413),eE=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},eF=function(e,n){return n?e:void 0},ew=(0,I.Z)((0,k.Z)({},d.J),{default_value:{type:eC.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return c.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(n){return n===e})}})},component:function(e){var n,t=null===(n=(0,en.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,T.jsx)(ei.w8,(0,I.Z)((0,k.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:eF,label:eE}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,T.jsx)(ei.kp,(0,k.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),eT={icon:g.dzP,title:"Select",description:"A dropdown field of options for content creators."},e_=c.object().shape({type:c.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(ew,"id"))}),eM={FormFields:ew,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:e_,Meta:eT,TYPE_NAME:"Select"},eA=t(81541),eN=t(47927),eR=t(76635),eL=function(e){return function(n){var t=n.size;return(0,T.jsx)("span",{style:{fontSize:t},children:e})}},eB=[{value:"paragraph",label:"P",icon:eL("p")},{value:"preformatted",label:"PRE",icon:eL("pre")},{value:"heading1",label:"H1",icon:eL("h1")},{value:"heading2",label:"H2",icon:eL("h2")},{value:"heading3",label:"H3",icon:eL("h3")},{value:"heading4",label:"H4",icon:eL("h4")},{value:"heading5",label:"H5",icon:eL("h5")},{value:"heading6",label:"H6",icon:eL("h6")},{value:"strong",label:"Strong",icon:eL((0,T.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eL((0,T.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eL((0,T.jsx)(F.eR7,{}))},{value:"image",label:"image",icon:eL((0,T.jsx)(F.LFN,{}))},{value:"embed",label:"embed",icon:eL((0,T.jsx)(F.xqv,{}))},{value:"list-item",label:"list",icon:eL((0,T.jsx)(F.SnF,{}))},{value:"o-list-item",label:"o",icon:eL((0,T.jsx)(s.KyO,{}))},{value:"rtl",label:"rtl",icon:eL("rtl")},],eD=eB.map(function(e){return e.value}),eO=function(e){return!eD.find(function(n){return!e.includes(n)})},eV=function(e){var n=e.split(",");return eB.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,eA.Z)(e).concat([i]):e},[])};function eq(e,n){return(0,eN.has)("parent",e)&&(0,eR.isObject)(e.parent)&&(0,eN.has)(n,e.parent)&&(0,eR.isString)(e.parent[n])?e.parent[n]:null}function ez(e){return function(){return c.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=eq(t,e),r=eq(t,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!eD.includes(e)})}})}}var eP,eH=(0,I.Z)((0,k.Z)({},d.J),{allowTargetBlank:(0,f.Jg)("Allow target blank for links"),single:{validate:ez("single")},multi:{validate:ez("multi")}}),eJ=["config.single","config.multi"],eG=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,l=e.setFieldValue,a=i.config,s=a.single,c=a.multi,d=s?eV(s):c&&eV(c)||eD,f=(0,ee.useState)(!s),p=f[0],m=f[1],x=(0,ee.useState)(d),h=x[0],v=x[1];return(0,ee.useEffect)(function(){var e=p?1:0;l(eJ[e],h.join(",")),setTimeout(function(){l(eJ[1-e],void 0)},100)},[p,h]),(0,T.jsxs)(_.k,{children:[Object.entries(eH).map(function(e){var n=(0,w.Z)(e,2),i=n[0],r=n[1];return(0,T.jsx)(_.J,{children:(0,T.jsx)(M.Z,{fieldName:(0,u.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,T.jsxs)(_.J,{children:[(0,T.jsxs)(O.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,T.jsx)(O.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(eO(h))return v([]);v(eD)},children:eO(h)?"Unselect All":"Select all"})]}),eB.map(function(e){return(0,T.jsx)(er.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:h.includes(e.value),onClick:function(){if(h.find(function(n){return n===e.value}))return v(h.filter(function(n){return n!==e.value}));v((0,eA.Z)(h).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[p?"multi":"single"])?(0,T.jsx)(O.xu,{sx:{position:"absolute"},children:(0,T.jsx)(O.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[p?"multi":"single"]})}):null]}),(0,T.jsx)(_.J,{children:(0,T.jsx)(O.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,T.jsxs)(O.__,{variant:"label.border",children:[(0,T.jsx)(O.XZ,{checked:p,onChange:function(){return m(!p)}}),"Allow multiple paragraphs"]})})})]})},eU={icon:g.BAW,title:"Rich Text",description:"A rich text field with formatting options"},eW=c.object().shape({type:c.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)((0,k.Z)({},eH,{labels:{yupType:"array",validate:{}}}),"id"))}),eY={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:eD.join(",")}}},FormFields:eH,Meta:eU,schema:eW,TYPE_NAME:"StructuredText",Form:eG},e$=d.J,eK=c.object().shape({type:c.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(e$,"id"))}),eX={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:g.SQS,title:"Key Text",description:"A simple text string field"},schema:eK,TYPE_NAME:"Text",FormFields:e$},eQ=d.J,e0={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:c.object().shape({type:c.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(eQ,"id"))}),FormFields:eQ,TYPE_NAME:"Timestamp",Meta:{icon:g.f$3,title:"Timestamp",description:"A calendar date picker with time"}},e2={label:d.J.label,id:(0,I.Z)((0,k.Z)({},d.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:d.J.placeholder},e1=c.object().shape({type:c.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,p.B9)(e2,"id"))}),e4={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:g.izl,title:"UID",description:"Unique Identifier"},schema:e1,TYPE_NAME:"UID",FormFields:e2}},81944:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.Boolean},Color:function(){return i.Color},ContentRelationship:function(){return i.ContentRelationship},Date:function(){return i.Date},Embed:function(){return i.Embed},GeoPoint:function(){return i.GeoPoint},Group:function(){return r.f},Image:function(){return i.Image},Link:function(){return i.Link},LinkToMedia:function(){return i.LinkToMedia},Number:function(){return i.Number},Select:function(){return i.Select},StructuredText:function(){return i.StructuredText},Text:function(){return i.Text},Timestamp:function(){return i.Timestamp},UID:function(){return i.UID}});var i=t(64831),r=t(4940)},7850:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.Boolean},Color:function(){return i.Color},ContentRelationship:function(){return i.ContentRelationship},Date:function(){return i.Date},Embed:function(){return i.Embed},GeoPoint:function(){return i.GeoPoint},Image:function(){return i.Image},Link:function(){return i.Link},LinkToMedia:function(){return i.LinkToMedia},NestedGroup:function(){return r.k},Number:function(){return i.Number},Select:function(){return i.Select},StructuredText:function(){return i.StructuredText},Text:function(){return i.Text},Timestamp:function(){return i.Timestamp},UID:function(){return i.UID}});var i=t(64831),r=t(70479)},50535:function(e,n,t){"use strict";t.d(n,{B9:function(){return s},Ss:function(){return u},uS:function(){return c},zg:function(){return d}});var i=t(98240),r=t(9849),o=t(65413),l=t(86163),a=t(58428),s=function(e,n){return e[n],(0,i.Z)(e,[n].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},u=function(e,n){return!e[n]&&(console.log('Could not find widget with type name "'.concat(n,'".')),!0)},d=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},21112:function(e,n,t){"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))}t.d(n,{T:function(){return i}})},41350:function(e){e.exports={flex:"List_flex__v0QQS",row:"List_row__sBVx1 List_flex__v0QQS",root:"List_root__f9klF List_flex__v0QQS","root-border":"List_root-border__2nh4p",child:"List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",header:"List_header__J5e8m List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",headerActions:"List_headerActions__FqUvW List_row__sBVx1 List_flex__v0QQS",item:"List_item__t5SQz List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS"}},73539:function(e){e.exports={root:"ZoneEmptyState_root__K6dwt"}}}]);