slice-machine-ui 1.23.2-alpha.bmo-add-github-settings-page.5 → 1.23.2-alpha.bmo-add-github-settings-page.6
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/components/DeleteSliceModal/index.tsx +34 -24
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +61 -38
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +2 -2
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +33 -21
- package/components/Navigation/ChangesListItem.tsx +14 -32
- package/lib/models/common/widgets/StructuredText/index.ts +1 -1
- package/out/404.html +1 -1
- package/out/_next/static/chunks/25-01f422cea8066349.js +1 -0
- package/out/_next/static/chunks/{318-bd030cc1725e23b5.js → 318-99b5914b60bf1d17.js} +1 -1
- package/out/_next/static/chunks/727-f8fefdd3e50cab2a.js +1 -0
- package/out/_next/static/chunks/799-b467582de0a7254f.js +1 -0
- package/out/_next/static/chunks/904-4653b7a849f4db94.js +1 -0
- package/out/_next/static/chunks/pages/{_app-0556263ae30802aa.js → _app-95e9373e879af96c.js} +26 -26
- package/out/_next/static/chunks/pages/{changes-8de69920dfb5a48f.js → changes-ac7d64fc8ec82b39.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-3f862ad6111a1fc0.js → [customTypeId]-97ab3b90b85d645d.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-94b8f8dbf7727412.js → custom-types-3c8e721ec6802127.js} +1 -1
- package/out/_next/static/chunks/pages/index-cf93d16e9c63b6db.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-d1ffca11c42f2603.js → [pageTypeId]-84a22c5e480d3fa9.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-b12346e58ac9abea.js → simulator-c498e9c80cae8cce.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8038454f751ad0b9.js +1 -0
- package/out/_next/static/chunks/pages/slices-4522d604117d8c66.js +1 -0
- package/out/_next/static/{eWuPXMHFhmgmq_6O409zA → giA50Mi0bmd47Gv-gysZU}/_buildManifest.js +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -3
- package/pages/slices.tsx +20 -8
- package/src/apiClient.ts +1 -22
- package/src/domain/__tests__/customType.test.ts +179 -0
- package/src/domain/customType.ts +110 -2
- package/src/domain/slice.ts +38 -0
- package/src/features/customTypes/PageTypeOnboarding.tsx +21 -26
- package/src/features/customTypes/actions/convertCustomToPageType.ts +14 -10
- package/src/features/customTypes/actions/createCustomType.ts +69 -0
- package/src/features/customTypes/actions/deleteCustomType.ts +13 -3
- package/src/features/customTypes/actions/renameCustomType.ts +10 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +3 -1
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +8 -8
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +18 -17
- package/src/features/slices/actions/createSlice.ts +5 -29
- package/src/features/slices/actions/deleteSlice.ts +33 -0
- package/src/features/slices/actions/renameSlice.ts +37 -0
- package/src/modules/availableCustomTypes/index.ts +29 -135
- package/src/modules/loading/types.ts +0 -5
- package/src/modules/modal/types.ts +0 -3
- package/src/modules/slices/index.ts +27 -193
- package/src/modules/slices/selector.ts +0 -14
- package/src/modules/useSliceMachineActions.ts +70 -89
- package/src/modules/userContext/index.ts +3 -3
- package/src/redux/saga.ts +0 -4
- package/test/src/modules/availableCustomTypes/index.test.ts +2 -243
- package/test/src/modules/slices.test.ts +1 -267
- package/out/_next/static/chunks/25-37d6fa7f064be04b.js +0 -1
- package/out/_next/static/chunks/727-2235967a881f9035.js +0 -1
- package/out/_next/static/chunks/731-a9b66ccdc3fae2c2.js +0 -1
- package/out/_next/static/chunks/904-6d6937d53ea2761e.js +0 -1
- package/out/_next/static/chunks/pages/index-64cfb8b0948ba8ef.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-62b55bae7f1b3793.js +0 -1
- package/out/_next/static/chunks/pages/slices-81e382c3374273df.js +0 -1
- package/src/features/customTypes/__tests__/createCustomType.test.ts +0 -159
- package/src/features/customTypes/customTypesTable/createCustomType.ts +0 -107
- package/test/components/CreateCustomTypeModal.test.tsx +0 -73
- /package/out/_next/static/{eWuPXMHFhmgmq_6O409zA → giA50Mi0bmd47Gv-gysZU}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[318],{39576:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322);t(2784);var o=t(59326),l=t(75289),a=t(61183),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};a.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,x=(0,o.B7)().theme,m=s?a.Z.highlight(t,{language:"vue"===s?"html":s}).value:a.Z.highlightAuto(t,c).value;return(0,r.jsxs)(l.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=x.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:m}})]})}},3026: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})}},59872: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,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||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&&x?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,t),{as:c.II,sx:u(h),disabled:m||d.disabled}))]})}},34066: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(2784),a=t(63397),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,x=e.buttonLabel,m=(0,l.useState)(t.value.length),h=m[0],v=m[1],g=(0,l.useRef)(Array(t.value.length));return(0,l.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,l.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)(l.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)(a.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:x})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,l=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)(a.gN,{as:s.XZ,type:"checkbox",name:l,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,a=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,l.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,l.useEffect)(function(){c?s(c(a,f)):s(c)},[f,a,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(a,f):t})},p=t(59872)},71168: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},28728: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(2784),a=t(40023),s=t(5446),c=t(59326),u=t(75289),d=t(71168),f=t(39031),p=t(98240),x=t(33710),m=t(39295),h=function(e){var n=e.text,t=e.as,a=e.sx,s=(0,p.Z)(e,["text","as","sx"]),c=(0,l.useRef)(null),d=(0,l.useState)(null),f=d[0],h=d[1],v=function(){h(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,l.useEffect)(function(){return v(),window.addEventListener("resize",v),function(){window.removeEventListener("resize",v)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.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===a?{}:a),as:t,ref:c},s),{children:n})),f&&(0,o.jsx)(m.X,{children:(0,o.jsx)(x.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},v=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(u.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)(h,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-cy":"field-name"}),(0,o.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-cy":"field-id",children:r})]})},g=t(951),b=t(8799),y=t(18978),j=function(e){var n=e.item,t=e.index,p=e.deleteItem,x=e.enterEditMode,m=e.modelFieldName,h=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,S=e.CustomEditElements,C=e.widget,k=e.draggableId,I=e.dataCy,F=e.isRepeatableCustomType,E=e.children,w=(0,c.B7)().theme,T=n.key,A=n.value,_=A.config,M=A.type;return(0,o.jsx)(l.Fragment,{children:(0,o.jsx)(a._l,{draggableId:k,index:t,children:function(e){var a,c,k,A,N;return(0,o.jsx)(l.Fragment,{children:(0,o.jsxs)(d.Z,(0,r.Z)((0,i.Z)({"data-cy":I,ref:e.innerRef},e.draggableProps),{Component:u.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(u.kC,{sx:{width:"100%"},children:[(0,o.jsx)(f.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:y.Fm7,color:null===(a=w.colors)||void 0===a?void 0:a.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(u.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)(u.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(v,{theme:w,text:(null==_?void 0:_.label)||T,sliceFieldName:h&&h(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(u.kC,{children:[S||null,Z||(0,o.jsx)(f.Z,{size:22,Icon:g.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(c=w.colors)||void 0===c?void 0:c.icons},onClick:function(){return x([T,n.value],m,t)}}),!(!0===F&&"UID"==M)&&(0,o.jsxs)(s.v2,{children:[(0,o.jsx)(s.j2,{className:"sliceMenuButton","data-cy":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(b.FQA,{size:20,color:null===(k=w.colors)||void 0===k?void 0:k.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(s.qy,{style:{background:null===(A=w.colors)||void 0===A?void 0:A.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(N=w.colors)||void 0===N?void 0:N.borders,outline:"0"},children:(0,o.jsx)(s.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return p(T)},children:"Delete field"})})]})]})]}),j||null]})]}),E]}))})}})})}},39031: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,x=e.fitButton,m=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!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==m&&m,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},89853:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(2784),a=t(63397),s=t(34066),c=t(78610),u=t(75289),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,a.U$)(n),3),x=p[0],m=p[1],h=p[2],v=t.component;return(0,o.jsx)(u.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===c.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:m,field:x,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(l.Fragment,{children:[t.type===c.h.INPUT?(0,o.jsx)(s.Hq,{meta:m,field:x,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===c.h.CHECKBOX&&(0,o.jsx)(s.sP,{meta:m,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},4092:function(e,n,t){"use strict";t.d(n,{Z:function(){return D}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(25812),u=t(59326),d=t(75289),f=t(65413),p=t(83239),x=t(60113),m=t(2784),h=t(92928),v=t(98240),g=function(e){var n=e.children,t=(0,v.Z)(e,["children"]);return(0,l.jsx)(d.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}))};g.tabsRole="TabList";var b=function(e){var n=e.children,t=(0,v.Z)(e,["children"]),o=(0,u.B7)().theme;return(0,l.jsx)(h.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}))};b.tabsRole="Tab";var y=t(54132),j=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,u=void 0===c?0:c,f=(0,m.useState)(u),p=f[0],x=f[1];return(0,l.jsx)(y.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)(h.mQ,{defaultIndex:u,onSelect:function(e){return x(e)},children:[(0,l.jsx)(g,{children:(o||[]).map(function(e){return(0,l.jsx)(b,{children:e},e)})}),m.Children.map(n,function(e,n){return(0,l.jsx)(d.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===p?"block":"none"},children:(0,l.jsx)(h.x4,{children:e})})})]})})},Z=(0,m.memo)(j),S=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(d.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)(d.xv,{as:"p","data-cy":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(d.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},C=t(3026),k=t(67557),I=t(77033),F=t(63397),E=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,u=e.children;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(F.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,v.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,I.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,k.Z)({},l,u))}return(0,r.Z)((0,i.Z)({},e),(0,k.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(F.l0,{id:n,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},w=(0,m.memo)(E),T=t(89853),A=t(99968),_=t(83462),M=t(5632),N=t(75329),R=t(65186),z=function(){var e=(0,M.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(R.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(d.xu,{sx:{height:"12px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(d.xu,{sx:{height:"8px"}}),(0,l.jsx)(d.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)(d.xu,{sx:{height:"24px"}}),(0,l.jsx)(d.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),N.pq)},children:"Go to the Slice Simulator"})]})};s().setAppElement("#__next");var D=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,m=e.zoneType,h=(0,u.B7)().theme;if(!t.isOpen)return null;var v=(0,o.Z)(t.field,2),g=v[0],b=v[1],y=(0,A.t)(p,b.config,b.type);if(!y)return(0,l.jsxs)("div",{children:[b.type," not found"]});var j=y.Meta.icon,k=y.FormFields,I=y.Form,F=y.schema,E=(0,i.Z)({},(0,x.f7)((0,_.B9)(k,"id")),y.prepareInitialValues?y.prepareInitialValues(b.config):b.config),M=function(){try{return{res:F.validateSync({type:b.type,config:E},{stripUnknown:!0})}}catch(e){return{err:e}}}(),N=M.res,R=M.err;R&&(console.error("[EditModal] Failed to validate field of type ".concat(b.type,".\n Please update model.json accordingly.")),console.error(R));var D={id:g,config:N?N.config:E},B=(0,o.Z)(k.id.validate.matches,2),q=B[0],O=B[1],P=f.object().shape({id:f.string().matches(q,O).min(3).max(35).required(),config:F.fields.config}),V="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(c.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(w,{apiId:g,formId:V,initialValues:D,validationSchema:P,FormFields:k,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:g,newKey:t,value:(0,i.Z)({},b,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,u=e.isValid,f=e.isSubmitting,p=e.initialValues,v=I?(0,l.jsx)(I,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(C.k,{children:Object.entries(k).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(C.J,{children:(0,l.jsx)(T.Z,{fieldName:(0,x.lm)(t),formField:i,fields:a,initialValues:p})},t)})},"field-model-tab-content"),g=["Field Model"],b=[v];if("slice"===m){var y=(0,l.jsx)(d.xu,{children:(0,l.jsx)(z,{})},"mock-data-tab-content");g.push("Mock Data"),b.push(y)}return(0,l.jsx)(Z,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:function(e){var t=e.radius;return(0,l.jsxs)(d.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)(S,{theme:h,text:c||s,WidgetIcon:j}),(0,l.jsx)(d.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(d.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(d.xu,{sx:{ml:"auto"}}),(0,l.jsx)(d.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(d.zx,{form:V,type:"submit",disabled:!u&&f,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:b})}})})}},75012:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(25812),c=t(75289),u=t(54132),d=t(3026),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)(c.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-cy":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)(c.xu,{ml:1,children:[(0,o.jsx)(c.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(c.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var x=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(s.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(u.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)(c.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)(c.X6,{children:"Add a new field"}),(0,o.jsx)(c.x8,{onClick:t})]})},children:(0,o.jsx)(d.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)(d.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},70697: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(81038),c=t(59326),u=t(75289),d=t(8799),f=t(77245),p=t(65186),x=t(39576),m={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,c.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)(u.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(u.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.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)(x.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(u.xu,{children:(0,o.jsxs)(u.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(p.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(f.LhG,{size:16,style:m}),(0,o.jsx)(u.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}},9620:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(63397),c=t(75289),u=t(59326),d=t(22715),f=t(90569),p=t(60113),x=t(83239),m=t(38876),h=t(33710),v=t(18978),g=t(39295),b=function(e){var n=e.error;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.X,{children:(0,l.jsx)(h.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(v.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},y=t(59872),j=function(e){var n=e.innerRef,t=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(c.II,(0,r.Z)((0,i.Z)({},t),{ref:n}))},Z=function(e){var n=e.widgetTypeName,t=e.fields,o=e.onSave,h=e.onCancelNewField,v=(0,a.useRef)(null),g=(0,u.B7)().theme,Z=(0,a.useState)(!0),S=Z[0],C=Z[1];(0,a.useEffect)(function(){v.current&&v.current.focus()},[v]);var k=x[n];if(!k)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var I=k.FormFields,F=k.Meta.icon,E={id:I.id,label:I.label},w=(0,r.Z)((0,i.Z)({},(0,p.f7)(E),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,p.gc)(E),A=function(e,n,t){t(S&&!E.id.disabled?(0,r.Z)((0,i.Z)({},n),{label:e.target.value,id:(0,m.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},n),{label:e.target.value}))},_=function(e,n){n("id",e.target.value),C(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:w,children:function(e){var n,o,a=e.errors,u=e.values,p=e.setValues,x=e.setFieldValue,m=e.submitForm;return(0,l.jsx)(s.l0,{"data-cy":"new-field-form",children:(0,l.jsxs)(c.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,l.jsx)(F,{style:{color:null===(n=g.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=g.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(c.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(c.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return A(e,u,p)},onKeyDown:function(e){"Enter"===e.key&&m()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:v,sx:(0,r.Z)((0,i.Z)({},(0,y.tM)(E.label.disabled?y.$w.DISABLED:a.label?y.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-cy":"new-field-name-input"}),(0,l.jsx)(b,{error:a.label})]}),(0,l.jsxs)(c.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(c.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return _(e,x)},onKeyDown:function(e){"Enter"===e.key&&m()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:E.id.disabled,validate:function(e){return(0,f.u)({value:e,fields:t,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,y.tM)(E.id.disabled?y.$w.DISABLED:a.id?y.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-cy":"new-field-id-input"}),(0,l.jsx)(b,{error:a.id})]}),(0,l.jsxs)(c.kC,{sx:{gap:2},children:[(0,l.jsx)(d.zx,{onClick:h,color:"grey",children:"Cancel"}),(0,l.jsx)(d.zx,{onClick:function(){m()},children:"Add"})]})]})})}})}},8482:function(e,n,t){"use strict";t.d(n,{Z:function(){return k}});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(28173),p=t(75012),x=t(9620),m=t(40023),h=t(75289),v=t(71168),g=t(28728),b=t(83239),y=t(99968),j=t(70697),Z=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.showHints,p=e.newField,x=e.renderHintBase,Z=e.isRepeatable,S=e.dataCy,C=e.isRepeatableCustomType;return(0,a.jsx)(m.Z5,{onDragEnd:c,children:(0,a.jsx)(m.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(h.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-cy":S,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,p=c.config,m=c.type,S=(0,y.t)(b,p,m);if(!S)return(0,a.jsx)(v.Z,{children:(0,a.jsxs)(h.xv,{children:['Field type "',m,'" not supported']})});var k={item:e,index:n,tabId:o,widget:S,showHints:f,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:C,dataCy:"list-item-".concat(e.key)};if(S.CustomListItem){var I=S.CustomListItem;return(0,a.jsx)(I,(0,i.Z)({},k))}var F=(0,a.jsx)(j.Z,{item:e,show:f,isRepeatable:Z,renderHintBase:x,Widgets:b,typeName:S.CUSTOM_NAME||S.TYPE_NAME});return(0,a.jsx)(g.Z,(0,r.Z)((0,i.Z)({},k),{HintElement:F}))}),e.placeholder,p]}))}})})},S=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(h.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(h.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(h.xu,{sx:{my:2},children:(0,a.jsxs)(h.xv,{sx:{color:"textClear"},children:["Add a field to your ",t," Zone"]})}),(0,a.jsx)(h.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return n()},"data-cy":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},C=function(e){var n=e.zoneType,t=e.tabId,c=e.title,m=e.fields,h=e.poolOfFieldsToCheck,v=e.widgetsArray,g=e.isRepeatable,b=e.onDeleteItem,y=e.onSaveNewField,j=e.onDragEnd,C=e.EditModal,k=e.onSave,I=e.dataTip,F=e.renderHintBase,E=e.renderFieldAccessor,w=e.dataCy,T=e.isRepeatableCustomType,A=Object.entries(h).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?v.filter(function(e){return"UID"!==e.TYPE_NAME}):v,_=(0,u.useState)(!1),M=_[0],N=_[1],R=(0,u.useState)({isOpen:!1}),z=R[0],D=R[1],B=(0,u.useState)({isOpen:!1}),q=B[0],O=B[1],P=(0,u.useState)(null),V=P[0],L=P[1],H=function(e){D({isOpen:!0,field:e})},J=function(){O({isOpen:!0})},U=function(){D({isOpen:!1})},W=function(){return O({isOpen:!1})},$=function(e){L({widgetTypeName:e,fields:m}),O({isOpen:!1})},G=function(){return L(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Bu,{actions:m.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:M,onCheckedChange:N,size:"small",style:{flexShrink:0},"data-cy":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-cy":"add-".concat(g?"Repeatable":"Static","-field"),onClick:J,startIcon:"add",color:"grey",disabled:null!==V,children:"Add a new field"})]}):void 0,children:c}),0!==m.length||V?m.length>0||V?(0,a.jsx)(d.xR,{children:(0,a.jsx)(Z,{tabId:t,isRepeatable:g,fields:m,showHints:M,dataTip:I,title:c,renderFieldAccessor:E,renderHintBase:F,enterEditMode:H,enterSelectMode:J,onDragEnd:j,onDeleteItem:b,dataCy:w,isRepeatableCustomType:T,newField:V&&(0,a.jsx)(x.Z,(0,r.Z)((0,i.Z)({},V),{fields:h||m,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];y.apply(void 0,(0,l.Z)(n)),L(null)},onCancelNewField:G}))})}):void 0:(0,a.jsx)(d.xR,{children:(0,a.jsx)(S,{onEnterSelectMode:function(){return J()},zoneName:g?"Repeatable":"Static"})}),(0,a.jsx)(C,{data:z,close:U,onSave:k,fields:h,zoneType:n}),(0,a.jsx)(p.Z,{data:q,close:W,onSelect:$,widgetsArray:A})]})};C.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 k=C},99968:function(e,n,t){"use strict";t.d(n,{t:function(){return i}});var i=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}return e[t]}},90569:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(34671),r=t(75329),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,i.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,i.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[r.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,i.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},34671:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(78610),r=t(60113),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:i.h.CHECKBOX,validate:{required:(0,r.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,x=u.matches;return{type:i.h.INPUT,label:e,validate:{required:(0,r.MJ)(p,s),min:(0,r.MJ)(d,l),max:(0,r.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},60113: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(78610),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)}},78610: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"},82910:function(e,n,t){"use strict";t.d(n,{H:function(){return f}});var i=t(65413),r=t(8799),o=t(83462),l=t(60113),a=t(90569),s=t(34671),c={icon:r.XGl,title:"Boolean",description:"An input that is either true or false"},u={label:a.J.label,id:a.J.id,placeholder_false:(0,s.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,s.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,s.Jg)("Default to true")},d=i.object().shape({type:i.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,o.B9)(u,"id"))}),f={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:c,schema:d,FormFields:u}},12174:function(e,n,t){"use strict";t.d(n,{S:function(){return c}});var i,r=t(65186),o=t(83462),l={icon:r.jqW,title:"Color",description:"A color picker"},a=(0,o.zg)("Color"),s=a.TYPE_NAME,c={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:a.FormFields,TYPE_NAME:s,schema:a.schema,Meta:l}},86495:function(e,n,t){"use strict";t.d(n,{l:function(){return C}});var i=t(62230),r=t(85244),o=t(65413),l=t(17064),a=t(52322),s=t(75289),c=t(90569),u=t(89853),d=t(36131),f=t(3026),p=t(60113),x=t(56580),m=t(49471),h=t(7819),v={label:c.J.label,id:c.J.id,customtypes:{validate:function(){return o.array().of(o.string())}}},g=function(e){var n=e.initialValues,t=e.values,o=e.fields,c=e.setFieldValue,g=(0,x.v9)(m.Ch).filter(h.TG),b=g.map(function(e){return{value:e.local.id,label:e.local.label}}),y=t.config.customtypes?t.config.customtypes.map(function(e){var n=g.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,a.jsxs)(f.k,{children:[Object.entries(v).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1];return(0,a.jsx)(f.J,{children:(0,a.jsx)(u.Z,{fieldName:(0,p.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,a.jsx)(f.J,{children:(0,a.jsxs)(s.xu,{sx:{mt:2,alignItems:"center"},children:[(0,a.jsx)(s.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,a.jsx)(d.ZP,{isMulti:!0,name:"origin",options:b,onChange:function(e){e&&c("config.customtypes",e.map(function(e){return e.value}))},value:y,theme:function(e){return(0,r.Z)((0,i.Z)({},e),{colors:(0,r.Z)((0,i.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},b=t(65186),y=t(348),j={icon:b.I2R,title:"Content Relationship",description:"Define content relations & internal links"},Z=y.I.shape({label:o.string().max(35,"String is too long. Max: 35"),select:o.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:o.array(o.string()).strict().optional()}),S=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:Z}),C={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:j,schema:S,TYPE_NAME:"Link",FormFields:v,CUSTOM_NAME:"ContentRelationship",Form:g,prepareInitialValues:function(e){var n=(0,x.v9)(m.Ch).filter(h.TG);return(null==e?void 0:e.customtypes)?(0,r.Z)((0,i.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}}},71516:function(e,n,t){"use strict";t.d(n,{v:function(){return a}});var i,r=t(65186),o=(0,t(83462).zg)("Date"),l=o.FormFields,a={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Date",schema:o.schema,Meta:{icon:r.f$3,title:"Date",description:"A calendar date picker"}}},79583:function(e,n,t){"use strict";t.d(n,{S:function(){return a}});var i,r=t(34543),o=(0,t(83462).zg)("Embed"),l=o.FormFields,a={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Embed",schema:o.schema,Meta:{icon:r.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}}},37191:function(e,n,t){"use strict";t.d(n,{X:function(){return s}});var i,r=t(65413),o=t(65186),l=t(90569),a={label:l.J.label,id:l.J.id},s={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:a,TYPE_NAME:"GeoPoint",schema:r.object().shape({type:r.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:r.object().shape({label:r.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:o.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}}},64118:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var i=t(65413),r=t(62230),o=t(85244),l=t(17064),a=t(52322),s=t(2784),c=t(90569),u=t(60113),d=t(89853),f=t(63397),p=t(75289),x=t(3026),m=t(98240),h=t(8799),v=t(65186),g=t(39031),b=t(34066),y=function(e){var n=e.onClick,t=e.error,i=e.onDelete,o=e.active,l=e.text,c=e.sx;return(0,a.jsx)(g.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:o,sx:(0,r.Z)({position:"relative",width:"64px",height:"64px"},c),Icon:function(){return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,a.jsx)(h.jnY,{size:22}),(0,a.jsx)(p.xv,{mt:1,children:l})]}),i?(0,a.jsx)(p.Ct,{onClick:i,variant:"circle-right",children:(0,a.jsx)(v.B4e,{})}):null]})}})},j=function(e){var n=e.onClick;return(0,a.jsx)(g.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,a.jsx)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,a.jsx)(h.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},Z=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,l.Z)((0,f.U$)(n),2),o=(r[0],r[1]),c=void 0!==t&&t?"*":"";return i?(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)(S,{name:"".concat(n,".name"),label:"Name".concat(c),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,a.jsx)(C,{name:"".concat(n,".width"),label:"Width (px)".concat(c),placeholder:" ",sx:{mb:3}}),(0,a.jsx)(C,{name:"".concat(n,".height"),label:"Height (px)".concat(c),placeholder:" "})]}):null},S=function(e){var n=e.name,t=e.label,i=e.placeholder,s=e.meta,c=e.isConstraint,u=(0,m.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,l.Z)((0,f.U$)(n),1)[0];return(0,a.jsx)(b.Hq,(0,o.Z)((0,r.Z)({},u),{fieldName:n,meta:s,formField:{label:t,placeholder:i},field:c?{value:"main",readOnly:!0}:{value:d.value},variant:c?"disabled":"primary"}))},C=function(e){var n=e.name,t=e.label,i=e.placeholder,s=(0,m.Z)(e,["name","label","placeholder"]),c=(0,l.Z)((0,f.U$)(n),2),u=c[0],d=c[1];return(0,a.jsx)(b.Hq,(0,o.Z)((0,r.Z)({},s),{fieldName:n,formField:{label:t,placeholder:i},meta:d,field:{min:0,type:"number",value:u.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},k=function(){return i.number().nullable().transform(function(e,n){return""===n?null:e})},I={label:c.J.label,id:c.J.id,constraint:{validate:function(){return i.object().defined().shape({width:k(),height:k()})}},thumbnails:{validate:function(){return i.array().defined().of(i.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)}}))}}},F={name:"",width:"",height:""},E=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"},w=function(e){var n=e.initialValues,t=e.values,i=e.errors,c=e.fields,m=e.touched,h=(0,s.useState)(0),v=h[0],g=h[1],b=t.config,S=b.thumbnails,C=b.constraint;return(0,s.useEffect)(function(){g(S.length)},[S.length]),(0,a.jsxs)(x.k,{children:[Object.entries(I).map(function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1];return(0,a.jsx)(x.J,{children:(0,a.jsx)(d.Z,{fieldName:(0,u.lm)(i),formField:r,fields:c,initialValues:n})},i)}),(0,a.jsxs)(x.J,{children:[(0,a.jsx)(p.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,a.jsx)(p.Zb,{p:3,children:(0,a.jsx)(f.F2,{name:"config.thumbnails",render:function(n){var t=n.push,l=n.remove;return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)(p.kC,{mb:3,children:[(0,a.jsx)(y,{active:0===v,text:E(C,!0),sx:{mr:2},onClick:function(){return g(0)}}),S.map(function(e,n){return(0,a.jsx)(y,{sx:{mr:3},active:v===+n+1,text:E(e),error:!!i.thumbnails&&!!m.thumbnails&&!!m.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return l(n)},onClick:function(){return g(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,a.jsx)(j,{onClick:function(){t(F)}})]}),(0,a.jsx)(Z,(0,o.Z)((0,r.Z)({},e),{display:0===v,prefix:"config.constraint"})),S.map(function(n,t){return(0,s.createElement)(Z,(0,o.Z)((0,r.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:v===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},T=t(83462),A=i.object().shape({type:i.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,T.B9)(I,"id"))}),_={Meta:{icon:h.jnY,title:"Image",description:"A responsive image field with constraints"},Form:w,schema:A,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:I,TYPE_NAME:"Image"}},348:function(e,n,t){"use strict";t.d(n,{h:function(){return v},I:function(){return h}});var i=t(65413),r=t(62230),o=t(85244),l=t(17064),a=t(52322),s=t(90569),c=t(89853),u=t(34671),d=t(3026),f=t(60113),p=(0,o.Z)((0,r.Z)({},s.J),{allowTargetBlank:(0,u.Jg)("Allow target blank",!1,!1)}),x=function(e){var n=e.initialValues,t=e.fields;return(0,a.jsx)(d.k,{children:Object.entries(p).map(function(e){var i=(0,l.Z)(e,2),r=i[0],o=i[1];return(0,a.jsx)(d.J,{children:(0,a.jsx)(c.Z,{fieldName:(0,f.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:t(34543).eR7,title:"Link",description:"A link to web, media or Prismic document"},h=i.object().shape({label:i.string().optional(),useAsTitle:i.boolean().optional(),placeholder:i.string().optional(),select:i.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:i.array(i.string()).strict().optional(),masks:i.array(i.string()).optional(),tags:i.array(i.string()).optional(),allowTargetBlank:i.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),v={Meta:m,FormFields:p,schema:i.object().shape({type:i.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"}},33949:function(e,n,t){"use strict";t.d(n,{H:function(){return v}});var i=t(65413),r=t(65186),o=t(348),l=t(62230),a=t(17064),s=t(52322),c=t(90569),u=t(89853),d=t(3026),f=t(60113),p=(0,l.Z)({},c.J),x=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(d.k,{children:Object.entries(p).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(d.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,f.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:r.x2k,title:"Link to media",description:"A link to files, document and media"},h=o.I.shape({select:i.string().required().matches(/^media$/,{excludeEmptyString:!0})}),v={Meta:m,FormFields:p,schema:i.object().shape({type:i.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"}},51490:function(e,n,t){"use strict";t.d(n,{L:function(){return a}});var i,r=t(951),o=(0,t(83462).zg)("Number"),l=o.FormFields,a={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Number",schema:o.schema,Meta:{icon:r.JUs,title:"Number",description:"A number input field"}}},74269:function(e,n,t){"use strict";t.d(n,{u:function(){return b}});var i=t(65413),r=t(65186),o=t(60113),l=t(83462),a=t(62230),s=t(85244),c=t(52322),u=t(63397),d=t(34066),f=t(78610),p=t(90569),x=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},m=function(e,n){return n?e:void 0},h=(0,s.Z)((0,a.Z)({},p.J),{default_value:{type:f.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return i.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,u.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,c.jsx)(d.w8,(0,s.Z)((0,a.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:m,label:x}))}},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,c.jsx)(d.kp,(0,a.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),v={icon:r.dzP,title:"Select",description:"A dropdown field of options for content creators."},g=i.object().shape({type:i.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(h,"id"))}),b={FormFields:h,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:g,Meta:v,TYPE_NAME:"Select"}},810:function(e,n,t){"use strict";t.d(n,{P:function(){return R}});var i=t(62230),r=t(65413),o=t(85244),l=t(17064),a=t(81541),s=t(52322),c=t(2784),u=t(60113),d=t(34671),f=t(90569),p=t(34543),x=t(8799),m=function(e){return function(n){var t=n.size;return(0,s.jsx)("span",{style:{fontSize:t},children:e})}},h=[{value:"paragraph",label:"P",icon:m("p")},{value:"preformatted",label:"PRE",icon:m("pre")},{value:"heading1",label:"H1",icon:m("h1")},{value:"heading2",label:"H2",icon:m("h2")},{value:"heading3",label:"H3",icon:m("h3")},{value:"heading4",label:"H4",icon:m("h4")},{value:"heading5",label:"H5",icon:m("h5")},{value:"heading6",label:"H6",icon:m("h6")},{value:"strong",label:"Strong",icon:m((0,s.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:m((0,s.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:m((0,s.jsx)(p.eR7,{}))},{value:"image",label:"image",icon:m((0,s.jsx)(p.LFN,{}))},{value:"embed",label:"embed",icon:m((0,s.jsx)(p.xqv,{}))},{value:"list-item",label:"list",icon:m((0,s.jsx)(p.SnF,{}))},{value:"o-list-item",label:"o",icon:m((0,s.jsx)(x.KyO,{}))},{value:"rtl",label:"rtl",icon:m("rtl")},],v=h.map(function(e){return e.value}),g=t(89853),b=t(75289),y=t(3026),j=t(39031),Z=t(47927),S=t(76635),C=function(e){return!v.find(function(n){return!e.includes(n)})},k=function(e){var n=e.split(",");return h.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,a.Z)(e).concat([i]):e},[])};function I(e,n){return(0,Z.has)("parent",e)&&(0,S.isObject)(e.parent)&&(0,Z.has)(n,e.parent)&&(0,S.isString)(e.parent[n])?e.parent[n]:null}function F(e){return function(){return r.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=I(t,e),r=I(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!v.includes(e)})}})}}var E=(0,o.Z)((0,i.Z)({},f.J),{allowTargetBlank:(0,d.Jg)("Allow target blank for links"),single:{validate:F("single")},multi:{validate:F("multi")}}),w=["config.single","config.multi"],T=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,d=e.setFieldValue,f=i.config,p=f.single,x=f.multi,m=p?k(p):x&&k(x)||v,Z=(0,c.useState)(!p),S=Z[0],I=Z[1],F=(0,c.useState)(m),T=F[0],A=F[1];return(0,c.useEffect)(function(){var e=S?1:0;d(w[e],T.join(",")),setTimeout(function(){d(w[1-e],void 0)},100)},[S,T]),(0,s.jsxs)(y.k,{children:[Object.entries(E).map(function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];return(0,s.jsx)(y.J,{children:(0,s.jsx)(g.Z,{fieldName:(0,u.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,s.jsxs)(y.J,{children:[(0,s.jsxs)(b.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,s.jsx)(b.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(C(T))return A([]);A(v)},children:C(T)?"Unselect All":"Select all"})]}),h.map(function(e){return(0,s.jsx)(j.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:T.includes(e.value),onClick:function(){if(T.find(function(n){return n===e.value}))return A(T.filter(function(n){return n!==e.value}));A((0,a.Z)(T).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[S?"multi":"single"])?(0,s.jsx)(b.xu,{sx:{position:"absolute"},children:(0,s.jsx)(b.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[S?"multi":"single"]})}):null]}),(0,s.jsx)(y.J,{children:(0,s.jsx)(b.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,s.jsxs)(b.__,{variant:"label.border",children:[(0,s.jsx)(b.XZ,{checked:S,onChange:function(){return I(!S)}}),"Allow multiple paragraphs"]})})})]})},A=t(65186),_=t(83462),M={icon:A.BAW,title:"Rich Text",description:"A rich text field with formatting options"},N=r.object().shape({type:r.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,_.B9)((0,i.Z)({},E,{labels:{yupType:"array",validate:{}}}),"id"))}),R={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,single:v.join(",")}}},FormFields:E,Meta:M,schema:N,TYPE_NAME:"StructuredText",Form:T}},89928:function(e,n,t){"use strict";t.d(n,{y:function(){return u}});var i=t(65413),r=t(65186),o=t(83462),l=t(90569),a=t(60113),s=l.J,c=i.object().shape({type:i.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,a.gc)((0,o.B9)(s,"id"))}),u={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:r.SQS,title:"Key Text",description:"A simple text string field"},schema:c,TYPE_NAME:"Text",FormFields:s}},64797:function(e,n,t){"use strict";t.d(n,{d:function(){return u}});var i,r=t(65413),o=t(65186),l=t(83462),a=t(90569),s=t(60113),c=a.J,u={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:r.object().shape({type:r.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,s.gc)((0,l.B9)(c,"id"))}),FormFields:c,TYPE_NAME:"Timestamp",Meta:{icon:o.f$3,title:"Timestamp",description:"A calendar date picker with time"}}},2353:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.H},Color:function(){return r.S},ContentRelationship:function(){return o.l},Date:function(){return l.v},Embed:function(){return a.S},GeoPoint:function(){return s.X},Image:function(){return c.b},Link:function(){return u.h},LinkToMedia:function(){return d.H},Number:function(){return f.L},Select:function(){return p.u},StructuredText:function(){return x.P},Text:function(){return m.y},Timestamp:function(){return h.d},UID:function(){return I}});var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797),v=t(62230),g=t(85244),b=t(65413),y=t(65186),j=t(83462),Z=t(90569),S=t(60113),C={label:Z.J.label,id:(0,g.Z)((0,v.Z)({},Z.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:Z.J.placeholder},k=b.object().shape({type:b.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,S.gc)((0,j.B9)(C,"id"))}),I={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:y.izl,title:"UID",description:"Unique Identifier"},schema:k,TYPE_NAME:"UID",FormFields:C}},44384:function(e,n,t){"use strict";var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797);n.Z=[x.P,c.b,u.h,d.H,o.l,p.u,i.H,l.v,h.d,a.S,f.L,s.X,r.S,m.y,]},83239:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return r.Boolean},Color:function(){return r.Color},ContentRelationship:function(){return r.ContentRelationship},Date:function(){return r.Date},Embed:function(){return r.Embed},GeoPoint:function(){return r.GeoPoint},Group:function(){return D},Image:function(){return r.Image},Link:function(){return r.Link},LinkToMedia:function(){return r.LinkToMedia},Number:function(){return r.Number},Select:function(){return r.Select},SharedSlice:function(){return B},SliceZone:function(){return q},StructuredText:function(){return r.StructuredText},Text:function(){return r.Text},Timestamp:function(){return r.Timestamp},UID:function(){return r.UID}});var i,r=t(2353),o=t(65413),l=t(65186),a=t(62230),s=t(85244),c=t(98240),u=t(81541),d=t(52322),f=t(2784),p=t(28316),x=t(40023),m=t(75289),h=t(83462),v=t(38876),g=t(75012),b=t(9620),y=t(4092),j=t(99968),Z=t(44384),S=t(70697),C=t(28728),k=t(81787),I=t(14137),F=t(91061),E=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),o=e.isRepeatable,l=e.item,E=e.draggableId,w=(e.renderFieldAccessor,(0,c.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","renderFieldAccessor"])),T=(0,f.useState)(!1),A=T[0],_=T[1],M=(0,f.useState)(null),N=M[0],R=M[1],z=(0,f.useState)({isOpen:!1}),D=z[0],B=z[1],q=(0,k.G)(),O=q.customType,P=q.setCustomType,V=function(e){R({widgetTypeName:e}),_(!1)},L=function(){R(null)},H=function(){B({isOpen:!1})},J=function(e){var t=e.id,i=e.label,o=r[e.widgetTypeName].create(i),a=I.L$.fromSM(o),s=(0,F.kQ)({customType:O,sectionId:n,groupFieldId:l.key,newField:a,newFieldId:t});P(s)},U=function(e){var t=e.apiId,i=e.newKey,o=e.value;if(!(0,h.Ss)(r,o.type)){var a=I.L$.fromSM(o),s=(0,F.l9)({customType:O,sectionId:n,groupFieldId:l.key,previousFieldId:t,newFieldId:i,newField:a});P(s)}},W=function(e){if(!(0,h.uS)(e)){var t=e.source,i=e.destination;if(i){var r=t.index,o=i.index,a=(0,F.GA)({customType:O,sectionId:n,groupFieldId:l.key,sourceIndex:r,destinationIndex:o});(0,p.flushSync)(function(){return P(a)})}}},$=function(e){var t=(0,F.j6)({customType:O,sectionId:n,groupFieldId:l.key,fieldId:e});P(t)},G=function(e){B({isOpen:!0,field:e})};return(0,d.jsxs)(f.Fragment,{children:[(0,d.jsx)(C.Z,(0,s.Z)((0,a.Z)({item:l,widget:t,draggableId:E,renderFieldAccessor:function(e){return"data.".concat(l.key,".[...]")}},w),{CustomEditElements:[(0,d.jsx)(m.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return _(!0)},children:"Add Field"},"custom-edit-element-".concat(l.key)),],children:(0,d.jsx)(m.xu,{sx:{ml:4},children:(0,d.jsx)(x.Z5,{onDragEnd:W,children:(0,d.jsx)(x.bK,{droppableId:"".concat(n,"-").concat(l.key,"-zone"),children:function(e){return(0,d.jsxs)("ul",(0,s.Z)((0,a.Z)({ref:e.innerRef},e.droppableProps),{children:[l.value.config.fields.map(function(e,n){var t=e.value,c=t.config,u=t.type,f=(0,j.t)(r,c,u);if(!f)return null;var p={item:e,index:n,widget:f,key:e.key,enterEditMode:G,deleteItem:$,renderFieldAccessor:function(e){return"data.".concat(l.key,".").concat(e)},draggableId:"group-".concat(l.key,"-").concat(e.key,"-").concat(n),dataCy:"list-item-group-".concat(l.key,"-").concat(e.key)},x=(0,d.jsx)(S.Z,{item:e,show:i,isRepeatable:o,renderHintBase:function(e){var n=e.item;return"data.".concat(l.key).concat((0,v.Ti)(n.key))},Widgets:r,typeName:f.CUSTOM_NAME||f.TYPE_NAME});return(0,d.jsx)(C.Z,(0,s.Z)((0,a.Z)({},p),{HintElement:x}))}),e.placeholder,N&&(0,d.jsx)(b.Z,(0,s.Z)((0,a.Z)({},N),{fields:l.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];J.apply(void 0,(0,u.Z)(n)),R(null)},onCancelNewField:L}))]}))}})})})})),(0,d.jsx)(g.Z,{data:{isOpen:A},close:function(){return _(!1)},onSelect:V,widgetsArray:Z.Z}),(0,d.jsx)(y.Z,{data:D,close:H,onSave:U,fields:l.value.config.fields})]})},w=t(17064),T=t(3026),A=t(90569),_=t(89853),M=t(34671),N=t(60113),R=(0,s.Z)((0,a.Z)({},A.J),{repeat:(0,M.Jg)("Repeatable",!1,!0)}),z=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,d.jsxs)(T.k,{children:[Object.entries(R).filter(function(e){return"repeat"!==(0,w.Z)(e,1)[0]}).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,d.jsx)(T.J,{children:(0,d.jsx)(_.Z,{fieldName:(0,N.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,d.jsx)(T.J,{children:(0,d.jsx)(m.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,d.jsxs)(m.__,{variant:"label.border",sx:{mb:0},children:[(0,d.jsx)(m.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},D={Meta:{icon:l.cC1,title:"Group",description:"A Group of Prismic fields"},Form:z,FormFields:R,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:E,TYPE_NAME:"Group"},B=null,q=null},83462: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(90569),a=t(60113),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:l.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,a.gc)(s(l.J,"id"))}),create:function(){return{type:e,config:(0,a.f7)(s(l.J,"id"))}}}}},28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return s},Bu:function(){return c}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715);t(82432),t(84779);var s=function(e){return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_2a96i71 _1ecs97dez0 _1ecs97dez2 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezb _1ecs97dezr"}))},c=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:"_2a96i73 _2a96i72 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97d6r8 _1ecs97d6yl _1ecs97df2l _1ecs97dez1 _1ecs97df71 _1ecs97dfie _1ecs97d18 _1ecs97d8l _1ecs97df29 _1ecs97df92 _1ecs97dfi1",children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dezd _1ecs97df92 _1ecs97dezj _1ecs97df51",children:n}):null]}))}},47976: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"saving":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"saved":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})]})}},41072:function(e,n,t){"use strict";t.d(n,{Q:function(){return f}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),s=t(2784),c=t(76635),u=t(88932),d=t(22715),f=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.autoSaveStatusDelay,f=void 0===t?300:t,p=n.errorMessage,x=void 0===p?"An error happened while saving":p,m=n.retryDelay,h=void 0===m?1e3:m,v=n.retryMessage,g=void 0===v?"Retry":v,b=(0,s.useState)({pendingSave:void 0,nextSave:void 0}),y=b[0],j=b[1],Z=(0,s.useState)("saved"),S=Z[0],C=Z[1],k=(0,s.useState)(S),I=k[0],F=k[1],E=(0,s.useCallback)(function(e){j(function(n){return(0,o.Z)((0,r.Z)({},n),{nextSave:e})})},[]),w=(0,s.useCallback)((e=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(t){switch(t.label){case 0:if(!e)return[3,4];C("saving"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e()];case 2:return t.sent(),C("saved"),[3,4];case 3:var i,r,o,l,s,f,p;return n=t.sent(),C("failed"),console.error(x,n),r=(i={errorMessage:x,retryDelay:h,retryMessage:g,setAutoSaveStatusActual:C,setAutoSaveStack:j}).errorMessage,o=i.retryDelay,l=i.retryMessage,s=i.setAutoSaveStatusActual,f=i.setAutoSaveStack,p=(0,c.uniqueId)(),u.Am.error(function(){return(0,a.jsxs)(d.xu,{gap:8,alignItems:"center",children:[(0,a.jsx)(d.xv,{color:"grey1",variant:"small",children:r}),(0,a.jsx)(d.zx,{size:"small",color:"grey",onClick:function(){u.Am.dismiss(p),s("saving"),setTimeout(function(){var e;s("saved"),f(function(n){return{nextSave:null!==(e=n.nextSave)&&void 0!==e?e:n.pendingSave,pendingSave:void 0}})},o)},children:l})]})},{autoClose:!1,closeOnClick:!1,draggable:!1,toastId:p}),[3,4];case 4:return[2]}})}),function(n){return e.apply(this,arguments)}),[x,h,g]);return(0,s.useEffect)(function(){"saved"===S&&y.nextSave&&(w(y.nextSave),j({pendingSave:y.nextSave,nextSave:void 0}))},[S,y,w]),(0,s.useEffect)(function(){if("saving"===S)F("saving");else{var e=setTimeout(function(){F(S)},f);return function(){clearTimeout(e)}}},[S,f]),(0,s.useMemo)(function(){return{autoSaveStatus:I,setNextSave:E}},[I,E])}},81787:function(e,n,t){"use strict";t.d(n,{G:function(){return m},k:function(){return x}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(74217),s=t(90374),c=t(41072),u=t(91061),d=t(82770),f=t(78656),p=(0,l.createContext)(void 0);function x(e){var n=e.children,t=e.initialCustomType,x=(0,l.useState)(t),m=x[0],h=x[1],v=(0,u.y6)(m),g=f.$[v],b=(0,c.Q)({errorMessage:g.autoSaveFailed}),y=b.autoSaveStatus,j=b.setNextSave,Z=(0,s.Z)().saveCustomTypeSuccess,S=(0,a.R9)(Z),C=(0,l.useCallback)(function(e){h(e),j((0,i.Z)(function(){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,d.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return S(e),[2]}})}))},[j,S]),k=(0,l.useMemo)(function(){return{autoSaveStatus:y,customType:m,setCustomType:C}},[y,m,C]);return(0,o.jsx)(p.Provider,{value:k,children:"function"==typeof n?n(k):n})}function m(){var e=(0,l.useContext)(p);if(!e)throw Error("CustomTypeProvider not found");return e}},84779:function(){},82432:function(){}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[318],{39576:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(62230),r=t(52322);t(2784);var o=t(59326),l=t(75289),a=t(61183),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};a.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,x=(0,o.B7)().theme,m=s?a.Z.highlight(t,{language:"vue"===s?"html":s}).value:a.Z.highlightAuto(t,c).value;return(0,r.jsxs)(l.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=x.colors)||void 0===n?void 0:n.textClear)},d),dangerouslySetInnerHTML:{__html:m}})]})}},3026: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})}},59872: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,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||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&&x?{validate:function(e){return d.fieldLevelValidation&&d.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,t),{as:c.II,sx:u(h),disabled:m||d.disabled}))]})}},34066: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(2784),a=t(63397),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,x=e.buttonLabel,m=(0,l.useState)(t.value.length),h=m[0],v=m[1],g=(0,l.useRef)(Array(t.value.length));return(0,l.useEffect)(function(){g.current=g.current.slice(0,t.value.length)},[t.value.length]),(0,l.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)(l.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)(a.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:x})]})}}))]})},u=t(98240),d=function(e){e.initialValues;var n=e.meta,t=e.label,l=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)(a.gN,{as:s.XZ,type:"checkbox",name:l,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,a=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,u=(0,l.useState)(i||n.defaultValue||!1),f=u[0],p=u[1];return(0,l.useEffect)(function(){c?s(c(a,f)):s(c)},[f,a,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(a,f):t})},p=t(59872)},71168: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},28728: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(2784),a=t(40023),s=t(5446),c=t(59326),u=t(75289),d=t(71168),f=t(39031),p=t(98240),x=t(33710),m=t(39295),h=function(e){var n=e.text,t=e.as,a=e.sx,s=(0,p.Z)(e,["text","as","sx"]),c=(0,l.useRef)(null),d=(0,l.useState)(null),f=d[0],h=d[1],v=function(){h(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,l.useEffect)(function(){return v(),window.addEventListener("resize",v),function(){window.removeEventListener("resize",v)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.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===a?{}:a),as:t,ref:c},s),{children:n})),f&&(0,o.jsx)(m.X,{children:(0,o.jsx)(x.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},v=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(u.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)(h,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-cy":"field-name"}),(0,o.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-cy":"field-id",children:r})]})},g=t(951),b=t(8799),y=t(18978),j=function(e){var n=e.item,t=e.index,p=e.deleteItem,x=e.enterEditMode,m=e.modelFieldName,h=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,S=e.CustomEditElements,C=e.widget,k=e.draggableId,I=e.dataCy,F=e.isRepeatableCustomType,E=e.children,w=(0,c.B7)().theme,T=n.key,A=n.value,_=A.config,M=A.type;return(0,o.jsx)(l.Fragment,{children:(0,o.jsx)(a._l,{draggableId:k,index:t,children:function(e){var a,c,k,A,N;return(0,o.jsx)(l.Fragment,{children:(0,o.jsxs)(d.Z,(0,r.Z)((0,i.Z)({"data-cy":I,ref:e.innerRef},e.draggableProps),{Component:u.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(u.kC,{sx:{width:"100%"},children:[(0,o.jsx)(f.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:y.Fm7,color:null===(a=w.colors)||void 0===a?void 0:a.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(u.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)(u.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(v,{theme:w,text:(null==_?void 0:_.label)||T,sliceFieldName:h&&h(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(u.kC,{children:[S||null,Z||(0,o.jsx)(f.Z,{size:22,Icon:g.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(c=w.colors)||void 0===c?void 0:c.icons},onClick:function(){return x([T,n.value],m,t)}}),!(!0===F&&"UID"==M)&&(0,o.jsxs)(s.v2,{children:[(0,o.jsx)(s.j2,{className:"sliceMenuButton","data-cy":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(b.FQA,{size:20,color:null===(k=w.colors)||void 0===k?void 0:k.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(s.qy,{style:{background:null===(A=w.colors)||void 0===A?void 0:A.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(N=w.colors)||void 0===N?void 0:N.borders,outline:"0"},children:(0,o.jsx)(s.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return p(T)},children:"Delete field"})})]})]})]}),j||null]})]}),E]}))})}})})}},39031: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,x=e.fitButton,m=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!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==m&&m,void 0===d?null:d),void 0===n?null:n)},g),{children:(0,l.jsx)(u,{size:p})}))};n.Z=c},89853:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(2784),a=t(63397),s=t(34066),c=t(78610),u=t(75289),d=function(e){var n=e.fieldName,t=e.formField,d=e.fields,f=e.initialValues,p=(0,r.Z)((0,a.U$)(n),3),x=p[0],m=p[1],h=p[2],v=t.component;return(0,o.jsx)(u.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===c.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:v?(0,o.jsx)(v,{meta:m,field:x,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(l.Fragment,{children:[t.type===c.h.INPUT?(0,o.jsx)(s.Hq,{meta:m,field:x,fields:d,formField:t,fieldName:n,initialValues:f}):null,t.type===c.h.CHECKBOX&&(0,o.jsx)(s.sP,{meta:m,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=d},4092:function(e,n,t){"use strict";t.d(n,{Z:function(){return D}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(25812),u=t(59326),d=t(75289),f=t(65413),p=t(83239),x=t(60113),m=t(2784),h=t(92928),v=t(98240),g=function(e){var n=e.children,t=(0,v.Z)(e,["children"]);return(0,l.jsx)(d.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}))};g.tabsRole="TabList";var b=function(e){var n=e.children,t=(0,v.Z)(e,["children"]),o=(0,u.B7)().theme;return(0,l.jsx)(h.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}))};b.tabsRole="Tab";var y=t(54132),j=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,u=void 0===c?0:c,f=(0,m.useState)(u),p=f[0],x=f[1];return(0,l.jsx)(y.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)(h.mQ,{defaultIndex:u,onSelect:function(e){return x(e)},children:[(0,l.jsx)(g,{children:(o||[]).map(function(e){return(0,l.jsx)(b,{children:e},e)})}),m.Children.map(n,function(e,n){return(0,l.jsx)(d.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===p?"block":"none"},children:(0,l.jsx)(h.x4,{children:e})})})]})})},Z=(0,m.memo)(j),S=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(d.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)(d.xv,{as:"p","data-cy":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(d.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},C=t(3026),k=t(67557),I=t(77033),F=t(63397),E=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,u=e.children;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(F.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,v.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,I.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,k.Z)({},l,u))}return(0,r.Z)((0,i.Z)({},e),(0,k.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(F.l0,{id:n,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},w=(0,m.memo)(E),T=t(89853),A=t(99968),_=t(83462),M=t(5632),N=t(75329),R=t(65186),z=function(){var e=(0,M.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(R.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(d.xu,{sx:{height:"12px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(d.xu,{sx:{height:"8px"}}),(0,l.jsx)(d.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)(d.xu,{sx:{height:"24px"}}),(0,l.jsx)(d.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),N.pq)},children:"Go to the Slice Simulator"})]})};s().setAppElement("#__next");var D=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,m=e.zoneType,h=(0,u.B7)().theme;if(!t.isOpen)return null;var v=(0,o.Z)(t.field,2),g=v[0],b=v[1],y=(0,A.t)(p,b.config,b.type);if(!y)return(0,l.jsxs)("div",{children:[b.type," not found"]});var j=y.Meta.icon,k=y.FormFields,I=y.Form,F=y.schema,E=(0,i.Z)({},(0,x.f7)((0,_.B9)(k,"id")),y.prepareInitialValues?y.prepareInitialValues(b.config):b.config),M=function(){try{return{res:F.validateSync({type:b.type,config:E},{stripUnknown:!0})}}catch(e){return{err:e}}}(),N=M.res,R=M.err;R&&(console.error("[EditModal] Failed to validate field of type ".concat(b.type,".\n Please update model.json accordingly.")),console.error(R));var D={id:g,config:N?N.config:E},B=(0,o.Z)(k.id.validate.matches,2),q=B[0],O=B[1],P=f.object().shape({id:f.string().matches(q,O).min(3).max(35).required(),config:F.fields.config}),V="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(c.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(w,{apiId:g,formId:V,initialValues:D,validationSchema:P,FormFields:k,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:g,newKey:t,value:(0,i.Z)({},b,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,u=e.isValid,f=e.isSubmitting,p=e.initialValues,v=I?(0,l.jsx)(I,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(C.k,{children:Object.entries(k).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(C.J,{children:(0,l.jsx)(T.Z,{fieldName:(0,x.lm)(t),formField:i,fields:a,initialValues:p})},t)})},"field-model-tab-content"),g=["Field Model"],b=[v];if("slice"===m){var y=(0,l.jsx)(d.xu,{children:(0,l.jsx)(z,{})},"mock-data-tab-content");g.push("Mock Data"),b.push(y)}return(0,l.jsx)(Z,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:function(e){var t=e.radius;return(0,l.jsxs)(d.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)(S,{theme:h,text:c||s,WidgetIcon:j}),(0,l.jsx)(d.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(d.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(d.xu,{sx:{ml:"auto"}}),(0,l.jsx)(d.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(d.zx,{form:V,type:"submit",disabled:!u&&f,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:b})}})})}},75012:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(25812),c=t(75289),u=t(54132),d=t(3026),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)(c.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-cy":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)(c.xu,{ml:1,children:[(0,o.jsx)(c.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(c.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var x=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(s.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(u.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)(c.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)(c.X6,{children:"Add a new field"}),(0,o.jsx)(c.x8,{onClick:t})]})},children:(0,o.jsx)(d.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)(d.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},70697: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(81038),c=t(59326),u=t(75289),d=t(8799),f=t(77245),p=t(65186),x=t(39576),m={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,c.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)(u.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(u.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.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)(x.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(u.xu,{children:(0,o.jsxs)(u.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(p.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(f.LhG,{size:16,style:m}),(0,o.jsx)(u.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}},9620:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(63397),c=t(75289),u=t(59326),d=t(22715),f=t(90569),p=t(60113),x=t(83239),m=t(38876),h=t(33710),v=t(18978),g=t(39295),b=function(e){var n=e.error;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.X,{children:(0,l.jsx)(h.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(v.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},y=t(59872),j=function(e){var n=e.innerRef,t=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(c.II,(0,r.Z)((0,i.Z)({},t),{ref:n}))},Z=function(e){var n=e.widgetTypeName,t=e.fields,o=e.onSave,h=e.onCancelNewField,v=(0,a.useRef)(null),g=(0,u.B7)().theme,Z=(0,a.useState)(!0),S=Z[0],C=Z[1];(0,a.useEffect)(function(){v.current&&v.current.focus()},[v]);var k=x[n];if(!k)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var I=k.FormFields,F=k.Meta.icon,E={id:I.id,label:I.label},w=(0,r.Z)((0,i.Z)({},(0,p.f7)(E),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,p.gc)(E),A=function(e,n,t){t(S&&!E.id.disabled?(0,r.Z)((0,i.Z)({},n),{label:e.target.value,id:(0,m.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},n),{label:e.target.value}))},_=function(e,n){n("id",e.target.value),C(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:w,children:function(e){var n,o,a=e.errors,u=e.values,p=e.setValues,x=e.setFieldValue,m=e.submitForm;return(0,l.jsx)(s.l0,{"data-cy":"new-field-form",children:(0,l.jsxs)(c.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,l.jsx)(F,{style:{color:null===(n=g.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=g.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(c.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(c.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return A(e,u,p)},onKeyDown:function(e){"Enter"===e.key&&m()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:v,sx:(0,r.Z)((0,i.Z)({},(0,y.tM)(E.label.disabled?y.$w.DISABLED:a.label?y.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-cy":"new-field-name-input"}),(0,l.jsx)(b,{error:a.label})]}),(0,l.jsxs)(c.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(c.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return _(e,x)},onKeyDown:function(e){"Enter"===e.key&&m()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:E.id.disabled,validate:function(e){return(0,f.u)({value:e,fields:t,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,y.tM)(E.id.disabled?y.$w.DISABLED:a.id?y.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-cy":"new-field-id-input"}),(0,l.jsx)(b,{error:a.id})]}),(0,l.jsxs)(c.kC,{sx:{gap:2},children:[(0,l.jsx)(d.zx,{onClick:h,color:"grey",children:"Cancel"}),(0,l.jsx)(d.zx,{onClick:function(){m()},children:"Add"})]})]})})}})}},8482:function(e,n,t){"use strict";t.d(n,{Z:function(){return k}});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(28173),p=t(75012),x=t(9620),m=t(40023),h=t(75289),v=t(71168),g=t(28728),b=t(83239),y=t(99968),j=t(70697),Z=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.showHints,p=e.newField,x=e.renderHintBase,Z=e.isRepeatable,S=e.dataCy,C=e.isRepeatableCustomType;return(0,a.jsx)(m.Z5,{onDragEnd:c,children:(0,a.jsx)(m.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(h.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-cy":S,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,p=c.config,m=c.type,S=(0,y.t)(b,p,m);if(!S)return(0,a.jsx)(v.Z,{children:(0,a.jsxs)(h.xv,{children:['Field type "',m,'" not supported']})});var k={item:e,index:n,tabId:o,widget:S,showHints:f,key:e.key,enterSelectMode:s,renderFieldAccessor:u,enterEditMode:l,parentSnapshot:t,deleteItem:d,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:C,dataCy:"list-item-".concat(e.key)};if(S.CustomListItem){var I=S.CustomListItem;return(0,a.jsx)(I,(0,i.Z)({},k))}var F=(0,a.jsx)(j.Z,{item:e,show:f,isRepeatable:Z,renderHintBase:x,Widgets:b,typeName:S.CUSTOM_NAME||S.TYPE_NAME});return(0,a.jsx)(g.Z,(0,r.Z)((0,i.Z)({},k),{HintElement:F}))}),e.placeholder,p]}))}})})},S=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(h.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(h.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(h.xu,{sx:{my:2},children:(0,a.jsxs)(h.xv,{sx:{color:"textClear"},children:["Add a field to your ",t," Zone"]})}),(0,a.jsx)(h.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return n()},"data-cy":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},C=function(e){var n=e.zoneType,t=e.tabId,c=e.title,m=e.fields,h=e.poolOfFieldsToCheck,v=e.widgetsArray,g=e.isRepeatable,b=e.onDeleteItem,y=e.onSaveNewField,j=e.onDragEnd,C=e.EditModal,k=e.onSave,I=e.dataTip,F=e.renderHintBase,E=e.renderFieldAccessor,w=e.dataCy,T=e.isRepeatableCustomType,A=Object.entries(h).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?v.filter(function(e){return"UID"!==e.TYPE_NAME}):v,_=(0,u.useState)(!1),M=_[0],N=_[1],R=(0,u.useState)({isOpen:!1}),z=R[0],D=R[1],B=(0,u.useState)({isOpen:!1}),q=B[0],O=B[1],P=(0,u.useState)(null),V=P[0],L=P[1],H=function(e){D({isOpen:!0,field:e})},J=function(){O({isOpen:!0})},U=function(){D({isOpen:!1})},W=function(){return O({isOpen:!1})},$=function(e){L({widgetTypeName:e,fields:m}),O({isOpen:!1})},G=function(){return L(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Bu,{actions:m.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:M,onCheckedChange:N,size:"small",style:{flexShrink:0},"data-cy":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-cy":"add-".concat(g?"Repeatable":"Static","-field"),onClick:J,startIcon:"add",color:"grey",disabled:null!==V,children:"Add a new field"})]}):void 0,children:c}),0!==m.length||V?m.length>0||V?(0,a.jsx)(d.xR,{children:(0,a.jsx)(Z,{tabId:t,isRepeatable:g,fields:m,showHints:M,dataTip:I,title:c,renderFieldAccessor:E,renderHintBase:F,enterEditMode:H,enterSelectMode:J,onDragEnd:j,onDeleteItem:b,dataCy:w,isRepeatableCustomType:T,newField:V&&(0,a.jsx)(x.Z,(0,r.Z)((0,i.Z)({},V),{fields:h||m,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];y.apply(void 0,(0,l.Z)(n)),L(null)},onCancelNewField:G}))})}):void 0:(0,a.jsx)(d.xR,{children:(0,a.jsx)(S,{onEnterSelectMode:function(){return J()},zoneName:g?"Repeatable":"Static"})}),(0,a.jsx)(C,{data:z,close:U,onSave:k,fields:h,zoneType:n}),(0,a.jsx)(p.Z,{data:q,close:W,onSelect:$,widgetsArray:A})]})};C.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 k=C},99968:function(e,n,t){"use strict";t.d(n,{t:function(){return i}});var i=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}return e[t]}},90569:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(34671),r=t(75329),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,i.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,i.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[r.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,i.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},34671:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(78610),r=t(60113),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:i.h.CHECKBOX,validate:{required:(0,r.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,x=u.matches;return{type:i.h.INPUT,label:e,validate:{required:(0,r.MJ)(p,s),min:(0,r.MJ)(d,l),max:(0,r.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},60113: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(78610),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)}},78610: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"},82910:function(e,n,t){"use strict";t.d(n,{H:function(){return f}});var i=t(65413),r=t(8799),o=t(83462),l=t(60113),a=t(90569),s=t(34671),c={icon:r.XGl,title:"Boolean",description:"An input that is either true or false"},u={label:a.J.label,id:a.J.id,placeholder_false:(0,s.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,s.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,s.Jg)("Default to true")},d=i.object().shape({type:i.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,l.gc)((0,o.B9)(u,"id"))}),f={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:c,schema:d,FormFields:u}},12174:function(e,n,t){"use strict";t.d(n,{S:function(){return c}});var i,r=t(65186),o=t(83462),l={icon:r.jqW,title:"Color",description:"A color picker"},a=(0,o.zg)("Color"),s=a.TYPE_NAME,c={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:a.FormFields,TYPE_NAME:s,schema:a.schema,Meta:l}},86495:function(e,n,t){"use strict";t.d(n,{l:function(){return C}});var i=t(62230),r=t(85244),o=t(65413),l=t(17064),a=t(52322),s=t(75289),c=t(90569),u=t(89853),d=t(36131),f=t(3026),p=t(60113),x=t(56580),m=t(31667),h=t(7819),v={label:c.J.label,id:c.J.id,customtypes:{validate:function(){return o.array().of(o.string())}}},g=function(e){var n=e.initialValues,t=e.values,o=e.fields,c=e.setFieldValue,g=(0,x.v9)(m.Ch).filter(h.TG),b=g.map(function(e){return{value:e.local.id,label:e.local.label}}),y=t.config.customtypes?t.config.customtypes.map(function(e){var n=g.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,a.jsxs)(f.k,{children:[Object.entries(v).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1];return(0,a.jsx)(f.J,{children:(0,a.jsx)(u.Z,{fieldName:(0,p.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,a.jsx)(f.J,{children:(0,a.jsxs)(s.xu,{sx:{mt:2,alignItems:"center"},children:[(0,a.jsx)(s.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,a.jsx)(d.ZP,{isMulti:!0,name:"origin",options:b,onChange:function(e){e&&c("config.customtypes",e.map(function(e){return e.value}))},value:y,theme:function(e){return(0,r.Z)((0,i.Z)({},e),{colors:(0,r.Z)((0,i.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},b=t(65186),y=t(348),j={icon:b.I2R,title:"Content Relationship",description:"Define content relations & internal links"},Z=y.I.shape({label:o.string().max(35,"String is too long. Max: 35"),select:o.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:o.array(o.string()).strict().optional()}),S=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:Z}),C={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:j,schema:S,TYPE_NAME:"Link",FormFields:v,CUSTOM_NAME:"ContentRelationship",Form:g,prepareInitialValues:function(e){var n=(0,x.v9)(m.Ch).filter(h.TG);return(null==e?void 0:e.customtypes)?(0,r.Z)((0,i.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}}},71516:function(e,n,t){"use strict";t.d(n,{v:function(){return a}});var i,r=t(65186),o=(0,t(83462).zg)("Date"),l=o.FormFields,a={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Date",schema:o.schema,Meta:{icon:r.f$3,title:"Date",description:"A calendar date picker"}}},79583:function(e,n,t){"use strict";t.d(n,{S:function(){return a}});var i,r=t(34543),o=(0,t(83462).zg)("Embed"),l=o.FormFields,a={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Embed",schema:o.schema,Meta:{icon:r.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}}},37191:function(e,n,t){"use strict";t.d(n,{X:function(){return s}});var i,r=t(65413),o=t(65186),l=t(90569),a={label:l.J.label,id:l.J.id},s={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:a,TYPE_NAME:"GeoPoint",schema:r.object().shape({type:r.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:r.object().shape({label:r.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:o.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}}},64118:function(e,n,t){"use strict";t.d(n,{b:function(){return _}});var i=t(65413),r=t(62230),o=t(85244),l=t(17064),a=t(52322),s=t(2784),c=t(90569),u=t(60113),d=t(89853),f=t(63397),p=t(75289),x=t(3026),m=t(98240),h=t(8799),v=t(65186),g=t(39031),b=t(34066),y=function(e){var n=e.onClick,t=e.error,i=e.onDelete,o=e.active,l=e.text,c=e.sx;return(0,a.jsx)(g.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:o,sx:(0,r.Z)({position:"relative",width:"64px",height:"64px"},c),Icon:function(){return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,a.jsx)(h.jnY,{size:22}),(0,a.jsx)(p.xv,{mt:1,children:l})]}),i?(0,a.jsx)(p.Ct,{onClick:i,variant:"circle-right",children:(0,a.jsx)(v.B4e,{})}):null]})}})},j=function(e){var n=e.onClick;return(0,a.jsx)(g.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,a.jsx)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,a.jsx)(h.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},Z=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,l.Z)((0,f.U$)(n),2),o=(r[0],r[1]),c=void 0!==t&&t?"*":"";return i?(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)(S,{name:"".concat(n,".name"),label:"Name".concat(c),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,a.jsx)(C,{name:"".concat(n,".width"),label:"Width (px)".concat(c),placeholder:" ",sx:{mb:3}}),(0,a.jsx)(C,{name:"".concat(n,".height"),label:"Height (px)".concat(c),placeholder:" "})]}):null},S=function(e){var n=e.name,t=e.label,i=e.placeholder,s=e.meta,c=e.isConstraint,u=(0,m.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,l.Z)((0,f.U$)(n),1)[0];return(0,a.jsx)(b.Hq,(0,o.Z)((0,r.Z)({},u),{fieldName:n,meta:s,formField:{label:t,placeholder:i},field:c?{value:"main",readOnly:!0}:{value:d.value},variant:c?"disabled":"primary"}))},C=function(e){var n=e.name,t=e.label,i=e.placeholder,s=(0,m.Z)(e,["name","label","placeholder"]),c=(0,l.Z)((0,f.U$)(n),2),u=c[0],d=c[1];return(0,a.jsx)(b.Hq,(0,o.Z)((0,r.Z)({},s),{fieldName:n,formField:{label:t,placeholder:i},meta:d,field:{min:0,type:"number",value:u.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},k=function(){return i.number().nullable().transform(function(e,n){return""===n?null:e})},I={label:c.J.label,id:c.J.id,constraint:{validate:function(){return i.object().defined().shape({width:k(),height:k()})}},thumbnails:{validate:function(){return i.array().defined().of(i.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)}}))}}},F={name:"",width:"",height:""},E=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"},w=function(e){var n=e.initialValues,t=e.values,i=e.errors,c=e.fields,m=e.touched,h=(0,s.useState)(0),v=h[0],g=h[1],b=t.config,S=b.thumbnails,C=b.constraint;return(0,s.useEffect)(function(){g(S.length)},[S.length]),(0,a.jsxs)(x.k,{children:[Object.entries(I).map(function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1];return(0,a.jsx)(x.J,{children:(0,a.jsx)(d.Z,{fieldName:(0,u.lm)(i),formField:r,fields:c,initialValues:n})},i)}),(0,a.jsxs)(x.J,{children:[(0,a.jsx)(p.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,a.jsx)(p.Zb,{p:3,children:(0,a.jsx)(f.F2,{name:"config.thumbnails",render:function(n){var t=n.push,l=n.remove;return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)(p.kC,{mb:3,children:[(0,a.jsx)(y,{active:0===v,text:E(C,!0),sx:{mr:2},onClick:function(){return g(0)}}),S.map(function(e,n){return(0,a.jsx)(y,{sx:{mr:3},active:v===+n+1,text:E(e),error:!!i.thumbnails&&!!m.thumbnails&&!!m.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return l(n)},onClick:function(){return g(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,a.jsx)(j,{onClick:function(){t(F)}})]}),(0,a.jsx)(Z,(0,o.Z)((0,r.Z)({},e),{display:0===v,prefix:"config.constraint"})),S.map(function(n,t){return(0,s.createElement)(Z,(0,o.Z)((0,r.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:v===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},T=t(83462),A=i.object().shape({type:i.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,T.B9)(I,"id"))}),_={Meta:{icon:h.jnY,title:"Image",description:"A responsive image field with constraints"},Form:w,schema:A,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:I,TYPE_NAME:"Image"}},348:function(e,n,t){"use strict";t.d(n,{h:function(){return v},I:function(){return h}});var i=t(65413),r=t(62230),o=t(85244),l=t(17064),a=t(52322),s=t(90569),c=t(89853),u=t(34671),d=t(3026),f=t(60113),p=(0,o.Z)((0,r.Z)({},s.J),{allowTargetBlank:(0,u.Jg)("Allow target blank",!1,!1)}),x=function(e){var n=e.initialValues,t=e.fields;return(0,a.jsx)(d.k,{children:Object.entries(p).map(function(e){var i=(0,l.Z)(e,2),r=i[0],o=i[1];return(0,a.jsx)(d.J,{children:(0,a.jsx)(c.Z,{fieldName:(0,f.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:t(34543).eR7,title:"Link",description:"A link to web, media or Prismic document"},h=i.object().shape({label:i.string().optional(),useAsTitle:i.boolean().optional(),placeholder:i.string().optional(),select:i.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:i.array(i.string()).strict().optional(),masks:i.array(i.string()).optional(),tags:i.array(i.string()).optional(),allowTargetBlank:i.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),v={Meta:m,FormFields:p,schema:i.object().shape({type:i.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"}},33949:function(e,n,t){"use strict";t.d(n,{H:function(){return v}});var i=t(65413),r=t(65186),o=t(348),l=t(62230),a=t(17064),s=t(52322),c=t(90569),u=t(89853),d=t(3026),f=t(60113),p=(0,l.Z)({},c.J),x=function(e){var n=e.initialValues,t=e.fields;return(0,s.jsx)(d.k,{children:Object.entries(p).map(function(e){var i=(0,a.Z)(e,2),r=i[0],o=i[1];return(0,s.jsx)(d.J,{children:(0,s.jsx)(u.Z,{fieldName:(0,f.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},m={icon:r.x2k,title:"Link to media",description:"A link to files, document and media"},h=o.I.shape({select:i.string().required().matches(/^media$/,{excludeEmptyString:!0})}),v={Meta:m,FormFields:p,schema:i.object().shape({type:i.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:h.optional()}),Form:x,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"}},51490:function(e,n,t){"use strict";t.d(n,{L:function(){return a}});var i,r=t(951),o=(0,t(83462).zg)("Number"),l=o.FormFields,a={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:l,TYPE_NAME:"Number",schema:o.schema,Meta:{icon:r.JUs,title:"Number",description:"A number input field"}}},74269:function(e,n,t){"use strict";t.d(n,{u:function(){return b}});var i=t(65413),r=t(65186),o=t(60113),l=t(83462),a=t(62230),s=t(85244),c=t(52322),u=t(63397),d=t(34066),f=t(78610),p=t(90569),x=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},m=function(e,n){return n?e:void 0},h=(0,s.Z)((0,a.Z)({},p.J),{default_value:{type:f.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return i.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,u.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,c.jsx)(d.w8,(0,s.Z)((0,a.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:m,label:x}))}},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,c.jsx)(d.kp,(0,a.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),v={icon:r.dzP,title:"Select",description:"A dropdown field of options for content creators."},g=i.object().shape({type:i.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,o.gc)((0,l.B9)(h,"id"))}),b={FormFields:h,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:g,Meta:v,TYPE_NAME:"Select"}},810:function(e,n,t){"use strict";t.d(n,{P:function(){return R}});var i=t(62230),r=t(65413),o=t(85244),l=t(17064),a=t(81541),s=t(52322),c=t(2784),u=t(60113),d=t(34671),f=t(90569),p=t(34543),x=t(8799),m=function(e){return function(n){var t=n.size;return(0,s.jsx)("span",{style:{fontSize:t},children:e})}},h=[{value:"paragraph",label:"P",icon:m("p")},{value:"preformatted",label:"PRE",icon:m("pre")},{value:"heading1",label:"H1",icon:m("h1")},{value:"heading2",label:"H2",icon:m("h2")},{value:"heading3",label:"H3",icon:m("h3")},{value:"heading4",label:"H4",icon:m("h4")},{value:"heading5",label:"H5",icon:m("h5")},{value:"heading6",label:"H6",icon:m("h6")},{value:"strong",label:"Strong",icon:m((0,s.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:m((0,s.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:m((0,s.jsx)(p.eR7,{}))},{value:"image",label:"image",icon:m((0,s.jsx)(p.LFN,{}))},{value:"embed",label:"embed",icon:m((0,s.jsx)(p.xqv,{}))},{value:"list-item",label:"list",icon:m((0,s.jsx)(p.SnF,{}))},{value:"o-list-item",label:"o",icon:m((0,s.jsx)(x.KyO,{}))},{value:"rtl",label:"rtl",icon:m("rtl")},],v=h.map(function(e){return e.value}),g=t(89853),b=t(75289),y=t(3026),j=t(39031),Z=t(47927),S=t(76635),C=function(e){return!v.find(function(n){return!e.includes(n)})},k=function(e){var n=e.split(",");return h.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,a.Z)(e).concat([i]):e},[])};function I(e,n){return(0,Z.has)("parent",e)&&(0,S.isObject)(e.parent)&&(0,Z.has)(n,e.parent)&&(0,S.isString)(e.parent[n])?e.parent[n]:null}function F(e){return function(){return r.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=I(t,e),r=I(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!v.includes(e)})}})}}var E=(0,o.Z)((0,i.Z)({},f.J),{allowTargetBlank:(0,d.Jg)("Allow target blank for links"),single:{validate:F("single")},multi:{validate:F("multi")}}),w=["config.single","config.multi"],T=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,d=e.setFieldValue,f=i.config,p=f.single,x=f.multi,m=p?k(p):x&&k(x)||v,Z=(0,c.useState)(!p),S=Z[0],I=Z[1],F=(0,c.useState)(m),T=F[0],A=F[1];return(0,c.useEffect)(function(){var e=S?1:0;d(w[e],T.join(",")),setTimeout(function(){d(w[1-e],void 0)},100)},[S,T]),(0,s.jsxs)(y.k,{children:[Object.entries(E).map(function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];return(0,s.jsx)(y.J,{children:(0,s.jsx)(g.Z,{fieldName:(0,u.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,s.jsxs)(y.J,{children:[(0,s.jsxs)(b.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,s.jsx)(b.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(C(T))return A([]);A(v)},children:C(T)?"Unselect All":"Select all"})]}),h.map(function(e){return(0,s.jsx)(j.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:T.includes(e.value),onClick:function(){if(T.find(function(n){return n===e.value}))return A(T.filter(function(n){return n!==e.value}));A((0,a.Z)(T).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[S?"multi":"single"])?(0,s.jsx)(b.xu,{sx:{position:"absolute"},children:(0,s.jsx)(b.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[S?"multi":"single"]})}):null]}),(0,s.jsx)(y.J,{children:(0,s.jsx)(b.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,s.jsxs)(b.__,{variant:"label.border",children:[(0,s.jsx)(b.XZ,{checked:S,onChange:function(){return I(!S)}}),"Allow multiple paragraphs"]})})})]})},A=t(65186),_=t(83462),M={icon:A.BAW,title:"Rich Text",description:"A rich text field with formatting options"},N=r.object().shape({type:r.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,u.gc)((0,_.B9)((0,i.Z)({},E,{labels:{yupType:"array",validate:{}}}),"id"))}),R={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:v.join(",")}}},FormFields:E,Meta:M,schema:N,TYPE_NAME:"StructuredText",Form:T}},89928:function(e,n,t){"use strict";t.d(n,{y:function(){return u}});var i=t(65413),r=t(65186),o=t(83462),l=t(90569),a=t(60113),s=l.J,c=i.object().shape({type:i.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,a.gc)((0,o.B9)(s,"id"))}),u={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:r.SQS,title:"Key Text",description:"A simple text string field"},schema:c,TYPE_NAME:"Text",FormFields:s}},64797:function(e,n,t){"use strict";t.d(n,{d:function(){return u}});var i,r=t(65413),o=t(65186),l=t(83462),a=t(90569),s=t(60113),c=a.J,u={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:r.object().shape({type:r.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,s.gc)((0,l.B9)(c,"id"))}),FormFields:c,TYPE_NAME:"Timestamp",Meta:{icon:o.f$3,title:"Timestamp",description:"A calendar date picker with time"}}},2353:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return i.H},Color:function(){return r.S},ContentRelationship:function(){return o.l},Date:function(){return l.v},Embed:function(){return a.S},GeoPoint:function(){return s.X},Image:function(){return c.b},Link:function(){return u.h},LinkToMedia:function(){return d.H},Number:function(){return f.L},Select:function(){return p.u},StructuredText:function(){return x.P},Text:function(){return m.y},Timestamp:function(){return h.d},UID:function(){return I}});var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797),v=t(62230),g=t(85244),b=t(65413),y=t(65186),j=t(83462),Z=t(90569),S=t(60113),C={label:Z.J.label,id:(0,g.Z)((0,v.Z)({},Z.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:Z.J.placeholder},k=b.object().shape({type:b.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,S.gc)((0,j.B9)(C,"id"))}),I={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:y.izl,title:"UID",description:"Unique Identifier"},schema:k,TYPE_NAME:"UID",FormFields:C}},44384:function(e,n,t){"use strict";var i=t(82910),r=t(12174),o=t(86495),l=t(71516),a=t(79583),s=t(37191),c=t(64118),u=t(348),d=t(33949),f=t(51490),p=t(74269),x=t(810),m=t(89928),h=t(64797);n.Z=[x.P,c.b,u.h,d.H,o.l,p.u,i.H,l.v,h.d,a.S,f.L,s.X,r.S,m.y,]},83239:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return r.Boolean},Color:function(){return r.Color},ContentRelationship:function(){return r.ContentRelationship},Date:function(){return r.Date},Embed:function(){return r.Embed},GeoPoint:function(){return r.GeoPoint},Group:function(){return D},Image:function(){return r.Image},Link:function(){return r.Link},LinkToMedia:function(){return r.LinkToMedia},Number:function(){return r.Number},Select:function(){return r.Select},SharedSlice:function(){return B},SliceZone:function(){return q},StructuredText:function(){return r.StructuredText},Text:function(){return r.Text},Timestamp:function(){return r.Timestamp},UID:function(){return r.UID}});var i,r=t(2353),o=t(65413),l=t(65186),a=t(62230),s=t(85244),c=t(98240),u=t(81541),d=t(52322),f=t(2784),p=t(28316),x=t(40023),m=t(75289),h=t(83462),v=t(38876),g=t(75012),b=t(9620),y=t(4092),j=t(99968),Z=t(44384),S=t(70697),C=t(28728),k=t(81787),I=t(14137),F=t(91061),E=function(e){var n=e.tabId,t=e.widget,i=(e.parentSnapshot,e.showHints),o=e.isRepeatable,l=e.item,E=e.draggableId,w=(e.renderFieldAccessor,(0,c.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","renderFieldAccessor"])),T=(0,f.useState)(!1),A=T[0],_=T[1],M=(0,f.useState)(null),N=M[0],R=M[1],z=(0,f.useState)({isOpen:!1}),D=z[0],B=z[1],q=(0,k.G)(),O=q.customType,P=q.setCustomType,V=function(e){R({widgetTypeName:e}),_(!1)},L=function(){R(null)},H=function(){B({isOpen:!1})},J=function(e){var t=e.id,i=e.label,o=r[e.widgetTypeName].create(i),a=I.L$.fromSM(o),s=(0,F.kQ)({customType:O,sectionId:n,groupFieldId:l.key,newField:a,newFieldId:t});P(s)},U=function(e){var t=e.apiId,i=e.newKey,o=e.value;if(!(0,h.Ss)(r,o.type)){var a=I.L$.fromSM(o),s=(0,F.l9)({customType:O,sectionId:n,groupFieldId:l.key,previousFieldId:t,newFieldId:i,newField:a});P(s)}},W=function(e){if(!(0,h.uS)(e)){var t=e.source,i=e.destination;if(i){var r=t.index,o=i.index,a=(0,F.GA)({customType:O,sectionId:n,groupFieldId:l.key,sourceIndex:r,destinationIndex:o});(0,p.flushSync)(function(){return P(a)})}}},$=function(e){var t=(0,F.j6)({customType:O,sectionId:n,groupFieldId:l.key,fieldId:e});P(t)},G=function(e){B({isOpen:!0,field:e})};return(0,d.jsxs)(f.Fragment,{children:[(0,d.jsx)(C.Z,(0,s.Z)((0,a.Z)({item:l,widget:t,draggableId:E,renderFieldAccessor:function(e){return"data.".concat(l.key,".[...]")}},w),{CustomEditElements:[(0,d.jsx)(m.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return _(!0)},children:"Add Field"},"custom-edit-element-".concat(l.key)),],children:(0,d.jsx)(m.xu,{sx:{ml:4},children:(0,d.jsx)(x.Z5,{onDragEnd:W,children:(0,d.jsx)(x.bK,{droppableId:"".concat(n,"-").concat(l.key,"-zone"),children:function(e){return(0,d.jsxs)("ul",(0,s.Z)((0,a.Z)({ref:e.innerRef},e.droppableProps),{children:[l.value.config.fields.map(function(e,n){var t=e.value,c=t.config,u=t.type,f=(0,j.t)(r,c,u);if(!f)return null;var p={item:e,index:n,widget:f,key:e.key,enterEditMode:G,deleteItem:$,renderFieldAccessor:function(e){return"data.".concat(l.key,".").concat(e)},draggableId:"group-".concat(l.key,"-").concat(e.key,"-").concat(n),dataCy:"list-item-group-".concat(l.key,"-").concat(e.key)},x=(0,d.jsx)(S.Z,{item:e,show:i,isRepeatable:o,renderHintBase:function(e){var n=e.item;return"data.".concat(l.key).concat((0,v.Ti)(n.key))},Widgets:r,typeName:f.CUSTOM_NAME||f.TYPE_NAME});return(0,d.jsx)(C.Z,(0,s.Z)((0,a.Z)({},p),{HintElement:x}))}),e.placeholder,N&&(0,d.jsx)(b.Z,(0,s.Z)((0,a.Z)({},N),{fields:l.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];J.apply(void 0,(0,u.Z)(n)),R(null)},onCancelNewField:L}))]}))}})})})})),(0,d.jsx)(g.Z,{data:{isOpen:A},close:function(){return _(!1)},onSelect:V,widgetsArray:Z.Z}),(0,d.jsx)(y.Z,{data:D,close:H,onSave:U,fields:l.value.config.fields})]})},w=t(17064),T=t(3026),A=t(90569),_=t(89853),M=t(34671),N=t(60113),R=(0,s.Z)((0,a.Z)({},A.J),{repeat:(0,M.Jg)("Repeatable",!1,!0)}),z=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,d.jsxs)(T.k,{children:[Object.entries(R).filter(function(e){return"repeat"!==(0,w.Z)(e,1)[0]}).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,d.jsx)(T.J,{children:(0,d.jsx)(_.Z,{fieldName:(0,N.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,d.jsx)(T.J,{children:(0,d.jsx)(m.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,d.jsxs)(m.__,{variant:"label.border",sx:{mb:0},children:[(0,d.jsx)(m.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},D={Meta:{icon:l.cC1,title:"Group",description:"A Group of Prismic fields"},Form:z,FormFields:R,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:E,TYPE_NAME:"Group"},B=null,q=null},83462: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(90569),a=t(60113),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:l.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,a.gc)(s(l.J,"id"))}),create:function(){return{type:e,config:(0,a.f7)(s(l.J,"id"))}}}}},28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return s},Bu:function(){return c}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715);t(82432),t(84779);var s=function(e){return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_2a96i71 _1ecs97dez0 _1ecs97dez2 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezb _1ecs97dezr"}))},c=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:"_2a96i73 _2a96i72 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97d6r8 _1ecs97d6yl _1ecs97df2l _1ecs97dez1 _1ecs97df71 _1ecs97dfie _1ecs97d18 _1ecs97d8l _1ecs97df29 _1ecs97df92 _1ecs97dfi1",children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dezd _1ecs97df92 _1ecs97dezj _1ecs97df51",children:n}):null]}))}},47976: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"saving":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"saved":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})]})}},41072:function(e,n,t){"use strict";t.d(n,{Q:function(){return f}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),s=t(2784),c=t(76635),u=t(88932),d=t(22715),f=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.autoSaveStatusDelay,f=void 0===t?300:t,p=n.errorMessage,x=void 0===p?"An error happened while saving":p,m=n.retryDelay,h=void 0===m?1e3:m,v=n.retryMessage,g=void 0===v?"Retry":v,b=(0,s.useState)({pendingSave:void 0,nextSave:void 0}),y=b[0],j=b[1],Z=(0,s.useState)("saved"),S=Z[0],C=Z[1],k=(0,s.useState)(S),I=k[0],F=k[1],E=(0,s.useCallback)(function(e){j(function(n){return(0,o.Z)((0,r.Z)({},n),{nextSave:e})})},[]),w=(0,s.useCallback)((e=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(t){switch(t.label){case 0:if(!e)return[3,4];C("saving"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e()];case 2:return t.sent(),C("saved"),[3,4];case 3:var i,r,o,l,s,f,p;return n=t.sent(),C("failed"),console.error(x,n),r=(i={errorMessage:x,retryDelay:h,retryMessage:g,setAutoSaveStatusActual:C,setAutoSaveStack:j}).errorMessage,o=i.retryDelay,l=i.retryMessage,s=i.setAutoSaveStatusActual,f=i.setAutoSaveStack,p=(0,c.uniqueId)(),u.Am.error(function(){return(0,a.jsxs)(d.xu,{gap:8,alignItems:"center",children:[(0,a.jsx)(d.xv,{color:"grey1",variant:"small",children:r}),(0,a.jsx)(d.zx,{size:"small",color:"grey",onClick:function(){u.Am.dismiss(p),s("saving"),setTimeout(function(){var e;s("saved"),f(function(n){return{nextSave:null!==(e=n.nextSave)&&void 0!==e?e:n.pendingSave,pendingSave:void 0}})},o)},children:l})]})},{autoClose:!1,closeOnClick:!1,draggable:!1,toastId:p}),[3,4];case 4:return[2]}})}),function(n){return e.apply(this,arguments)}),[x,h,g]);return(0,s.useEffect)(function(){"saved"===S&&y.nextSave&&(w(y.nextSave),j({pendingSave:y.nextSave,nextSave:void 0}))},[S,y,w]),(0,s.useEffect)(function(){if("saving"===S)F("saving");else{var e=setTimeout(function(){F(S)},f);return function(){clearTimeout(e)}}},[S,f]),(0,s.useMemo)(function(){return{autoSaveStatus:I,setNextSave:E}},[I,E])}},81787:function(e,n,t){"use strict";t.d(n,{G:function(){return m},k:function(){return x}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(74217),s=t(90374),c=t(41072),u=t(91061),d=t(82770),f=t(78656),p=(0,l.createContext)(void 0);function x(e){var n=e.children,t=e.initialCustomType,x=(0,l.useState)(t),m=x[0],h=x[1],v=(0,u.y6)(m),g=f.$[v],b=(0,c.Q)({errorMessage:g.autoSaveFailed}),y=b.autoSaveStatus,j=b.setNextSave,Z=(0,s.Z)().saveCustomTypeSuccess,S=(0,a.R9)(Z),C=(0,l.useCallback)(function(e){h(e),j((0,i.Z)(function(){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,d.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return S(e),[2]}})}))},[j,S]),k=(0,l.useMemo)(function(){return{autoSaveStatus:y,customType:m,setCustomType:C}},[y,m,C]);return(0,o.jsx)(p.Provider,{value:k,children:"function"==typeof n?n(k):n})}function m(){var e=(0,l.useContext)(p);if(!e)throw Error("CustomTypeProvider not found");return e}},84779:function(){},82432:function(){}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[727],{54132:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(62230),a=r(85244),s=r(98240),c=r(52322);r(2784);var i=r(75289),l=function(e){var n=e.bg,r=e.background,a=e.sx,s=e.withRadius,l=e.radius,o=e.children;return(0,c.jsx)(i.xu,{sx:(0,t.Z)({p:4,bg:n||r},s?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,a),children:o})},o=function(e){var n=e.Header,r=void 0===n?null:n,o=e.SubHeader,u=void 0===o?null:o,d=e.Body,f=void 0===d?null:d,h=e.Footer,x=void 0===h?null:h,p=e.borderFooter,m=e.radius,C=void 0===m?"6px":m,g=e.bodySx,j=e.footerSx,v=e.sx,b=e.bg,_=e.background,y=e.children,S=(0,s.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,c.jsxs)(i.Zb,(0,a.Z)((0,t.Z)({sx:(0,t.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:C},void 0===v?null:v)},S),{children:[r?(0,c.jsx)(r,{radius:C}):null,u?(0,c.jsx)(u,{radius:C}):null,(0,c.jsxs)(l,{bg:b,background:_,sx:void 0===g?{}:g,withRadius:!x,children:[f?(0,c.jsx)(f,{}):null,y||null]}),x?(0,c.jsx)(l,{bg:b,background:_,sx:(0,t.Z)({},void 0!==p&&p?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===j?{}:j),radius:C,withRadius:!0,children:"object"==typeof x?x:(0,c.jsx)(x,{})}):null]}))}},58882:function(e,n,r){"use strict";r.d(n,{M:function(){return z}});var t=r(22710),a=r(62230),s=r(85244),c=r(99267),i=r(52322),l=r(2784),o=r(75289),u=r(56580),d=r(5632),f=r(68780),h=r(90374),x=r(31667),p=r(38876),m=r(75329),C=r(78656),g=r(88932),j=r(13858),v=r(82770),b=r(91061);function _(){return(_=(0,t.Z)(function(e){var n,r,t,a,s,i,l,o,u,d;return(0,c.__generator)(this,function(c){switch(c.label){case 0:n=e.id,r=e.label,t=e.repeatable,a=e.format,s=e.onSuccess,i=C.$[a],l=(0,b.Ue)({id:n,label:r,repeatable:t,format:a}),c.label=1;case 1:return c.trys.push([1,4,,5]),[4,(0,v.KA)(l)];case 2:if((o=c.sent().errors).length>0)throw o;return v.Xe.track({event:"custom-type:created",id:l.id,name:r,format:a,type:t?"repeatable":"single",origin:"table"}),[4,s(l)];case 3:return c.sent(),g.Am.success((0,j.GX)({message:"".concat(i.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(l.id,"/index.json")})),[3,5];case 4:return u=c.sent(),d="Internal Error: ".concat(i.name({start:!0,plural:!1})," not saved"),console.error(d,u),g.Am.error(d),[3,5];case 5:return[2]}})})).apply(this,arguments)}var y=r(67445),S=r(70041),w=r(17064),L=r(63397),Z=r(98240),T=function(e){var n=e.selected,r=(0,Z.Z)(e,["selected"]);return(0,i.jsx)(o.kC,(0,a.Z)({sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:n?function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}:"none","&:hover":{boxShadow:function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}}}},r))},k=function(e){var n=e.format,r=(0,w.Z)((0,L.U$)("repeatable"),3),t=r[0],a=r[2],s=C.$[n];return(0,i.jsxs)(o.xu,{mb:2,children:[(0,i.jsxs)(T,{selected:t.value,onClick:function(){return a.setValue(!0)},children:[(0,i.jsx)(o.Y8,{checked:t.value,onChange:function(){},"data-cy":"repeatable-type-radio-btn"}),(0,i.jsxs)(o.xu,{sx:{marginLeft:2},children:["Reusable type",(0,i.jsx)(o.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:s.hintRepeatable})]})]}),(0,i.jsxs)(T,{selected:!t.value,onClick:function(){return a.setValue(!1)},children:[(0,i.jsx)(o.Y8,{checked:!t.value,onChange:function(){},"data-cy":"single-type-radio-btn"}),(0,i.jsxs)(o.xu,{sx:{marginLeft:2},children:["Single type",(0,i.jsx)(o.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:s.hintSingle})]})]})]})},z=function(e){var n,r=e.format,g=e.isCreating,j=e.isOpen,v=e.origin,w=void 0===v?"table":v,L=e.onCreateChange,Z=e.onOpenChange,T=(0,h.Z)().createCustomTypeSuccess,z=(0,u.v9)(function(e){return{customTypeIds:(0,x.W6)(e),customTypeLabels:(0,x.YS)(e)}}),H=z.customTypeIds,R=z.customTypeLabels,N=C.$[r],I=(0,l.useState)(!0),V=I[0],M=I[1],E=(0,d.useRouter)(),F=(n=(0,t.Z)(function(e){var n,a,s;return(0,c.__generator)(this,function(i){switch(i.label){case 0:var l;return n=e.id,a=e.label,s=e.repeatable,L(!0),[4,function(e){return _.apply(this,arguments)}({format:r,id:n,label:a,origin:w,repeatable:s,onSuccess:(l=(0,t.Z)(function(e){var r,t;return(0,c.__generator)(this,function(a){switch(a.label){case 0:return T(e),r=(0,b.y6)(e),t=y.cd[r],M(!0),[4,E.push({pathname:t.getBuilderPagePathname(n),query:"page"===e.format?{newPageType:!0}:void 0})];case 1:return a.sent(),[2]}})}),function(e){return l.apply(this,arguments)})})];case 1:return i.sent(),L(!1),Z(!1),[2]}})}),function(e){return n.apply(this,arguments)}),P=function(e,n,r){r(V?(0,s.Z)((0,a.Z)({},n),{label:e.target.value,id:(0,p.lV)(e.target.value)}):(0,s.Z)((0,a.Z)({},n),{label:e.target.value}))},A=function(e,n){n("id",e.target.value),M(!1)};return(0,i.jsx)(f.Z,{dataCy:"create-ct-modal",isOpen:j,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:function(){Z(!1),M(!0)},onSubmit:function(e){F(e)},isLoading:g,initialValues:{repeatable:!0,id:"",label:""},validate:function(e){var n=e.id,r=e.label,t={};return r&&r.length||(t.label="Cannot be empty."),!t.label&&R.includes(r)&&(t.label="".concat(N.name({start:!0,plural:!1})," name is already taken.")),n&&n.length||(t.id="ID cannot be empty."),t.id||!n||m.xo.exec(n)||(t.id="Invalid id: No special characters allowed."),!t.id&&n&&H.map(function(e){return e.toLowerCase()}).includes(n)&&(t.id='ID "'.concat(n,'" exists already.')),Object.keys(t).length>0?t:void 0},content:{title:"Create a new ".concat(N.name({start:!1,plural:!1}))},children:function(e){var n=e.errors,t=e.setValues,a=e.setFieldValue,s=e.values,c=e.touched;return(0,i.jsxs)(o.xu,{children:[(0,i.jsx)(k,{format:r}),(0,i.jsx)(S.W,{name:"label",label:"".concat(N.name({start:!0,plural:!1})," Name"),dataCy:"ct-name-input",placeholder:"A display name for the ".concat(N.name({start:!1,plural:!1})),error:c.label?n.label:void 0,onChange:function(e){return P(e,s,t)}}),(0,i.jsx)(S.W,{name:"id",dataCy:"ct-id-input",label:"".concat(N.name({start:!0,plural:!1})," ID"),placeholder:N.inputPlaceholder,error:c.id?n.id:void 0,onChange:function(e){return A(e,a)}})]})}})}},75329:function(e,n,r){"use strict";r.d(n,{Sn:function(){return i},lS:function(){return t},nG:function(){return a},pq:function(){return l},rd:function(){return c},xo:function(){return s}});var t=["components"],a=["png","jpg","jpeg"],s=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,c="placeholders/What_are_Slices_mrvome",i="SM_HELP_VIDEOS/mock_data",l="slice-machine-simulator"},38876:function(e,n,r){"use strict";r.d(n,{MP:function(){return s},T3:function(){return i},Ti:function(){return a},lV:function(){return l}});var t=/-(\w)/g;function a(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function s(e){return e?(e=e.replace(/_/g,"-").replace(t,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var c=/\B([A-Z])/g;function i(e){var n;return e.replace(c,"-$1").toLowerCase().replace(/-/g,"_")}var l=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},840:function(e,n,r){"use strict";r.d(n,{F:function(){return F}});var t=r(52322),a=r(2784),s=r(22715),c=r(97729),i=r.n(c),l=r(31005),o=r(58882),u=r(78656),d=r(5632),f=r(67557),h=r(50002),x=r(6277);r(64117);var p=function(e){var n=e.children;return(0,t.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez5 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezr",children:(0,t.jsx)("table",{className:"gdfsm51 _1ecs97dez0 _1ecs97dez5 _1ecs97df3p _1ecs97df4v",children:n})})},m=(0,a.createContext)("body");function C(){return(0,a.useContext)(m)}var g=function(e){var n=e.children;return(0,t.jsx)(m.Provider,{value:"head",children:(0,t.jsx)("thead",{className:"gdfsm52 _1ecs97dez0 _1ecs97dez5 _1ecs97d18 _1ecs97d8l",children:n})})},j=function(e){var n=e.children;return(0,t.jsx)(m.Provider,{value:"body",children:(0,t.jsx)("tbody",{className:"gdfsm53 _1ecs97dez0 _1ecs97dez5",children:n})})},v=function(e){var n,r=e.children,a=e.onClick,s=C();return(0,t.jsx)("tr",{className:(0,x.W)("_1ecs97dez0 _1ecs97dez5 _1ecs97df71",(n={},(0,f.Z)(n,"_1ecs97df41",!!a),(0,f.Z)(n,"_1ecs97dm _1ecs97d7z _1ecs97d3c _1ecs97dap _1ecs97d2w _1ecs97da9 _1ecs97df74 _1ecs97dfj8 _1ecs97df0d _1ecs97dfjb","body"===s),n)),onClick:function(e){var n,r=e.target;if(a&&e.currentTarget.contains(r)){var t=(0,h.JY)(r);(null===(n=null==t?void 0:t.contains(e.currentTarget))||void 0===n||n)&&a(e)}},children:r})},b=function(e){var n=e.children,r=C();return(0,t.jsx)("head"===r?"th":"td",{className:"gdfsm55 _1ecs97dez0 _1ecs97dez5 _1ecs97d3fg _1ecs97d3mt _1ecs97df2h _1ecs97dez1 _1ecs97da62 _1ecs97dadf _1ecs97df45 _1ecs97dfhi",children:(0,t.jsx)("div",{className:"gdfsm56 _1ecs97dez0 _1ecs97dez2",children:n})})},_=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0912 12C13.2794 12 11 14.2794 11 17.0912C11 19.903 13.2794 22.1824 16.0912 22.1824C17.9763 22.1824 19.6215 21.1577 20.501 19.6372C20.6563 19.3688 20.7878 19.0849 20.8926 18.7883C20.9846 18.5279 20.8482 18.2422 20.5878 18.1502C20.3275 18.0582 20.0418 18.1947 19.9498 18.455C19.8657 18.693 19.7601 18.9209 19.6354 19.1365C18.9273 20.3606 17.6049 21.1824 16.0912 21.1824C13.8317 21.1824 12 19.3507 12 17.0912C12 14.8317 13.8317 13 16.0912 13C17.4478 13 18.6507 13.66 19.3955 14.6782H17.6216C17.3455 14.6782 17.1216 14.9021 17.1216 15.1782C17.1216 15.4544 17.3455 15.6782 17.6216 15.6782H20.2998C20.576 15.6782 20.7998 15.4544 20.7998 15.1782V12.5C20.7998 12.2239 20.576 12 20.2998 12C20.0237 12 19.7998 12.2239 19.7998 12.5V13.6032C18.8717 12.6167 17.5536 12 16.0912 12Z",fill:"white"})]})},y=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0869 14.6818L14.6627 12.3787C14.7183 12.1561 14.9183 12 15.1477 12C15.473 12 15.7117 12.3057 15.6328 12.6213L15.1177 14.6818H17.7232L18.299 12.3787C18.3547 12.1561 18.5547 12 18.7841 12C19.1094 12 19.3481 12.3057 19.2692 12.6213L18.754 14.6818H21C21.2761 14.6818 21.5 14.9057 21.5 15.1818C21.5 15.458 21.2761 15.6818 21 15.6818H18.504L17.8449 18.3182H20C20.2761 18.3182 20.5 18.542 20.5 18.8182C20.5 19.0943 20.2761 19.3182 20 19.3182H17.5949L17.0192 21.6213C16.9635 21.8439 16.7635 22 16.5341 22C16.2088 22 15.9701 21.6943 16.049 21.3787L16.5642 19.3182H13.9586L13.3828 21.6213C13.3272 21.8439 13.1272 22 12.8977 22C12.5724 22 12.3338 21.6943 12.4127 21.3787L12.9278 19.3182H11C10.7239 19.3182 10.5 19.0943 10.5 18.8182C10.5 18.542 10.7239 18.3182 11 18.3182H13.1778L13.8369 15.6818H12C11.7239 15.6818 11.5 15.458 11.5 15.1818C11.5 14.9057 11.7239 14.6818 12 14.6818H14.0869ZM16.8142 18.3182L17.4732 15.6818H14.8677L14.2086 18.3182H16.8142Z",fill:"white"})]})},S=r(2754),w=r(67445),L=r(19345),Z=r(22710),T=r(99267),k=r(56580),z=r(17329),H=r(81038),R=r(31667),N=r(7819),I=r(14137);function V(e){return M.apply(this,arguments)}function M(){return(M=(0,Z.Z)(function(e){var n,r,t;return(0,T.__generator)(this,function(a){switch(a.label){case 0:return[4,H.j.customTypes.readAllCustomTypes({format:e})];case 1:if(r=(n=a.sent()).errors,t=n.models,r.length>0)throw r;return[2,t.map(function(e){return e.model})]}})})).apply(this,arguments)}var E=function(e){var n,r,c,i,l,o,f=e.format,h=e.isCreatingCustomType,x=e.openCreateCustomTypeModal,m=(0,d.useRouter)(),C=(r=(0,a.useCallback)(function(e){return(0,z.VA)(V,[f],e)},[f]),{customTypes:(0,z.QT)(V,[f]),updateCustomTypes:r}),Z=C.customTypes,T=C.updateCustomTypes,H=Z.sort(function(e,n){return e.id.localeCompare(n.id)}),M=w.cd[f],E=u.$[f];return(o=(0,k.v9)(function(e){return{storeCustomTypes:(0,R.Ch)(e).filter(N.TG)}}).storeCustomTypes,(0,a.useEffect)(function(){var e=o.filter(function(e){return e.local.format===f});(e.length!==Z.length||e.some(function(e){var n=Z.find(function(n){return n.id===e.local.id});return!n||JSON.stringify(I.Dc.fromSM(e.local))!==JSON.stringify(n)}))&&T(e.map(function(e){var n=e.local;return I.Dc.fromSM(n)}))},[f,T,Z,o]),0===H.length)?(0,t.jsxs)(S.R$,{style:{alignSelf:"center",marginTop:s.TV.size[72]},children:[(0,t.jsx)(S.u2,{children:(0,t.jsx)(s.Ee,{src:M.blankSlateImage,sizing:"cover"})}),(0,t.jsxs)(S.T9,{children:[(0,t.jsx)(S._T,{children:E.name({start:!0,plural:!0})}),(0,t.jsx)(S.nf,{children:E.blankSlateDescription}),(0,t.jsx)(S.Qj,{children:(0,t.jsx)(s.zx,{onClick:x,loading:h,children:"Create"})})]})]}):(0,t.jsxs)(p,{children:[(0,t.jsx)(g,{children:(0,t.jsxs)(v,{children:[(0,t.jsx)(b,{children:(0,t.jsx)(s.I5,{name:"notes",size:"medium"})}),(0,t.jsx)(b,{children:"Label"}),(0,t.jsx)(b,{children:"API ID"}),(0,t.jsx)(b,{children:"Limit"}),(0,t.jsx)(b,{})]})}),(0,t.jsx)(j,{children:H.map(function(e){var n=e.repeatable,r=e.label,a=e.id;return(0,t.jsxs)(v,{onClick:function(){m.push(w.cd[f].getBuilderPagePathname(a))},children:[(0,t.jsx)(b,{children:n?(0,t.jsx)(_,{}):(0,t.jsx)(y,{})}),(0,t.jsx)(b,{children:r}),(0,t.jsx)(b,{children:a}),(0,t.jsx)(b,{children:n?"Reusable":"Single"}),(0,t.jsx)(b,{children:(0,t.jsx)(L._,{isChangesLocal:!1,format:f,customType:e})})]},a)})})]})},F=function(e){var n=e.format,r=u.$[n],c=(0,a.useState)(!1),d=c[0],f=c[1],h=(0,a.useState)(!1),x=h[0],p=h[1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsxs)("title",{children:[r.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,t.jsx)(s.SV,{renderError:function(){return(0,t.jsx)(l.LN,{children:(0,t.jsx)(l.RN,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(r.name({start:!1,plural:!0}),".")})})})})},children:(0,t.jsx)(a.Suspense,{fallback:(0,t.jsxs)(l.LN,{children:[(0,t.jsxs)(l.wd,{children:[(0,t.jsx)(l.Cx,{folder:r.name({start:!0,plural:!0})}),(0,t.jsx)(l.K2,{children:(0,t.jsx)(s.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,t.jsx)(l.RN,{children:(0,t.jsx)(s._3,{})})]}),children:(0,t.jsxs)(l.LN,{children:[(0,t.jsxs)(l.wd,{children:[(0,t.jsx)(l.Cx,{folder:r.name({start:!0,plural:!0})}),(0,t.jsx)(l.K2,{children:(0,t.jsx)(s.zx,{"data-cy":"create-ct",loading:d,onClick:function(){p(!0)},startIcon:"add",children:"Create"})})]}),(0,t.jsx)(l.RN,{children:(0,t.jsxs)(s.xu,{flexDirection:"column",children:[(0,t.jsx)(E,{format:n,isCreatingCustomType:d,openCreateCustomTypeModal:function(){p(!0)}}),(0,t.jsx)(o.M,{format:n,isCreating:d,isOpen:x,onCreateChange:f,onOpenChange:p})]})})]})})})]})}},64117:function(){}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[799],{56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),i=t(98240),s=t(52322),c=t(2784),a=t(75289),u=function(e,n){return e?"".concat(e,"-").concat(n):""},l=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,f=e.form,p=e.isLoading,m=void 0!==p&&p,v=e.disabled,y=e.onClick,h=e.sx,x=e.iconSize,g=void 0===x?16:x,Z=e.iconFill,b=e.variant,j=void 0===b?"primary":b,I=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(a.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===h?{}:h),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==v&&v||m,onClick:m?void 0:y,variant:j},I),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$j,{size:g,color:l(j),"data-cy":u(I["data-cy"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:g,fill:Z,"data-cy":u(I["data-cy"],"icon")}),t]})}))})},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return c}});var r=t(62230),o=t(52322);t(2784);var i=t(63397),s=t(75289),c=function(e){var n=e.name,t=e.label,c=e.placeholder,a=e.error,u=e.dataCy,l=e.onChange;return(0,o.jsxs)(s.xu,{mb:3,children:[(0,o.jsx)(s.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(i.gN,(0,r.Z)({name:n,type:"text",placeholder:c,as:s.II,autoComplete:"off"},l?{onChange:l}:null,u?{"data-cy":u}:null)),a?(0,o.jsx)(s.xv,{"data-cy":u?"".concat(u,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},68780:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(37149),c=t.n(s),a=t(25812),u=t(63397),l=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,s=e.isOpen,p=e.formId,m=e.validate,v=e.onSubmit,y=e.widthInPx,h=e.initialValues,x=e.content.title,g=e.cardProps,Z=e.omitFooter,b=void 0!==Z&&Z,j=e.isLoading,I=void 0!==j&&j,T=e.buttonLabel,_=void 0===T?"Save":T,S=e.dataCy,C=e.actionMessage;return c().setAppElement("#__next"),(0,i.jsx)(a.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=y?y:"900px"}},children:(0,i.jsx)(u.J9,{initialValues:h,validate:function(e){return m?m(e):void 0},onSubmit:function(e){v(e)},children:function(e){var s=e.isValid,c=e.isSubmitting,a=e.values,m=e.errors,v=e.touched,y=e.setFieldValue,h=e.setValues;return(0,i.jsx)(u.l0,(0,o.Z)((0,r.Z)({id:p},null!=S?{"data-cy":S}:null),{children:(0,i.jsx)(f.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},g),{Header:function(e){var n=e.radius;return(0,i.jsxs)(l.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,i.jsx)(l.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(l.x8,{type:"button",onClick:t})]})},Footer:b?null:(0,i.jsxs)(l.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(l.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(l.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(l.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:c||I,children:"Cancel"}),(0,i.jsx)(d.z,{label:_,form:p,type:"submit",disabled:!s||c||I,isLoading:c||I,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:s,isSubmitting:c,values:a,errors:m,touched:v,setFieldValue:y,setValues:h})}))}))}})})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return l},Qj:function(){return v},T9:function(){return f},nf:function(){return m},u2:function(){return d},_T:function(){return p}});var r=t(67557),o=t(62230),i=t(85244),s=t(98240),c=t(52322),a=t(6277),u=t(22715);t(69143);var l=function(e){var n=e.backgroundImage,t=e.style,u=(0,s.Z)(e,["backgroundImage","style"]),l=void 0!==n;return(0,c.jsx)("article",(0,i.Z)((0,o.Z)({},u),{className:(0,a.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,r.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",l)),style:(0,o.Z)({backgroundImage:l?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},f=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},p=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},v=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return m},EN:function(){return v},F$:function(){return x},GA:function(){return C},HO:function(){return g},L4:function(){return j},Tr:function(){return p},Ue:function(){return O},gR:function(){return I},j6:function(){return _},kQ:function(){return T},l9:function(){return S},mf:function(){return y},vB:function(){return h},xS:function(){return Z},y6:function(){return u}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),c=t(88866),a=t(98863);function u(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function l(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type===c.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,a=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(u=null==(m=p[1])?void 0:m.config)&&void 0!==u?u:void 0)return e;var t,a,u,d,p,m,v=function(e,n){var t,r=l(e),o=r.findIndex(function(e){return(0,s.Z)(e,1)[0]===n}),i=r.flatMap(function(e){var n=(0,s.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===c.SlicesFieldType})}),a=o;do t="slices".concat(0!==a?a.toString():""),a++;while(i.includes(t));return t}(e,n);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,(0,i.Z)((0,o.Z)({},e.json[n]),(0,r.Z)({},v,{type:c.SlicesFieldType,fieldset:"Slice Zone"}))))})}function m(e,n){var t=d(e,n);if(void 0===t)return e;var s=Object.keys(t).find(function(e){return t[e].type===c.SlicesFieldType});if(void 0===s)return e;var u=(0,a.ud)(t,s);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,u))})}function v(e){var n,t,s=e.customType,u=e.sectionId,l=e.sliceId,f=d(s,u);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===c.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==c.SlicesFieldType)return s;var v=(0,a.ud)(null!==(t=null===(n=m.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},l);return(0,i.Z)((0,o.Z)({},s),{json:(0,i.Z)((0,o.Z)({},s.json),(0,r.Z)({},u,(0,i.Z)((0,o.Z)({},f),(0,r.Z)({},p,(0,i.Z)((0,o.Z)({},m),{config:(0,i.Z)((0,o.Z)({},m.config),{choices:v})})))))})}function y(e){var n,t=(0,i.Z)((0,o.Z)({},e),{format:"page"}),r=l(e)[0];if(r){var c=(0,s.Z)(r,1)[0];t=p(t,c)}return t}function h(e,n){return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,{}))})}function x(e,n){var t=(0,a.ud)(e.json,n);return(0,i.Z)((0,o.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var r=Object.keys(e.json).reduce(function(r,o){return o===n?r[t]=e.json[o]:r[o]=e.json[o],r},{});return(0,i.Z)((0,o.Z)({},e),{json:r})}function Z(e){var n=e.customType,t=e.sectionId,s=e.newField,c=e.newFieldId;return F({customType:n,sectionId:t,updatedSection:(0,i.Z)((0,o.Z)({},n.json[t]),(0,r.Z)({},c,s))})}function b(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,a.ud)(n.json[t],r);return F({customType:n,sectionId:t,updatedSection:o})}function j(e){var n=e.customType,t=e.sectionId,r=e.previousFieldId,o=e.newFieldId,i=e.newField,s=w({fields:n.json[t],previousFieldId:r,newFieldId:o,newField:i});return F({customType:n,sectionId:t,updatedSection:s})}function I(e){var n=e.customType,t=e.sectionId,r=e.sourceIndex,o=e.destinationIndex,i=n.json[t],a=f(n,t),u=Object.fromEntries(Object.entries(i).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),l=z({fields:u,sourceIndex:r,destinationIndex:o});if(void 0!==a){var d=(0,s.Z)(a,2),p=d[0],m=d[1];l[p]=m}return F({customType:n,sectionId:t,updatedSection:l})}function T(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,a=e.newField,u=e.newFieldId,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l)return t;var f=L(l,(0,i.Z)((0,o.Z)({},d),(0,r.Z)({},u,a)));return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,f))})}function _(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.fieldId,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=(0,a.ud)(d,u),p=L(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,p))})}function S(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,a=e.previousFieldId,u=e.newFieldId,l=e.newField,d=k({customType:t,sectionId:s,groupFieldId:c}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var p=w({fields:f,previousFieldId:a,newFieldId:u,newField:l}),m=L(d,p);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,m))})}function C(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,a=e.sourceIndex,u=e.destinationIndex,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=z({fields:d,sourceIndex:a,destinationIndex:u}),p=L(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,p))})}function F(e){var n=e.customType,t=e.sectionId,s=e.updatedSection;return(0,i.Z)((0,o.Z)({},n),{json:(0,i.Z)((0,o.Z)({},n.json),(0,r.Z)({},t,s))})}function w(e){var n=e.fields,t=e.previousFieldId,r=e.newFieldId,o=e.newField;return Object.entries(n).reduce(function(e,n){var i=(0,s.Z)(n,2),c=i[0],a=i[1];return c===t?e[r]=o:c!==r&&(e[c]=a),e},{})}function z(e){var n=e.fields,t=e.sourceIndex,r=e.destinationIndex,o=Object.entries(n),i=(0,s.Z)(o.splice(t,1),1)[0];return o.splice(r,0,i),Object.fromEntries(o)}function k(e){var n=e.customType,t=e.sectionId,r=e.groupFieldId,o=n.json[t][r];if(o.type===c.GroupFieldType)return o}function L(e,n){return(0,i.Z)((0,o.Z)({},e),{config:(0,i.Z)((0,o.Z)({},e.config),{fields:n})})}function O(e){var n,t,r=e.id,i=e.label,s=e.repeatable,c=e.format,a=(n=s,t=c,!1===n&&"page"===t?(0,o.Z)({},R,P):!1===n?N:"page"===t?(0,o.Z)({},M,P):A);return{format:c,id:r,json:a,label:i,repeatable:s,status:!0}}var N={Main:{}},R={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},A={Main:{uid:{config:{label:"UID"},type:"UID"}}},M={Main:(0,o.Z)({},A.Main,R.Main)},P={"SEO & Metadata":{meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"},meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"}}}},19345:function(e,n,t){"use strict";t.d(n,{_:function(){return O}});var r=t(22710),o=t(99267),i=t(52322),s=t(2784),c=t(22715),a=t(5632),u=t(90374),l=t(88932),d=t(91061),f=t(82770),p=t(78656);function m(){return(m=(0,r.Z)(function(e,n){var t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=p.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,d.mf)(e),[4,(0,f.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),l.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type"),console.error(c,s),l.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v=t(67445),y=t(62230),h=t(85244),x=t(75289),g=t(68780),Z=t(70041),b=t(56580),j=t(31667),I=t(81038);function T(){return(T=(0,r.Z)(function(e){var n,t,r,i,s,c,a,u;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=p.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,h.Z)((0,y.Z)({},n),{label:t}),[4,I.j.customTypes.renameCustomType({model:s})];case 2:if((c=o.sent().errors).length>0)throw c;return r(s),l.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return a=o.sent(),u="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(u,a),l.Am.error(u),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=function(e){var n,t,c,a=e.isChangesLocal,l=e.customType,d=e.format,f=e.onClose,m=e.setLocalCustomType,v=null!==(n=null==l?void 0:l.label)&&void 0!==n?n:"",I=null!==(t=null==l?void 0:l.id)&&void 0!==t?t:"",_=(0,u.Z)().renameCustomTypeSuccess,S=(0,s.useState)(!1),C=S[0],F=S[1],w=(c=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(F(!0),!(a&&m))return[3,1];return m((0,h.Z)((0,y.Z)({},l),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return T.apply(this,arguments)}({model:l,newLabel:e.customTypeName,onSuccess:_})];case 2:n.sent(),n.label=3;case 3:return F(!1),f(),[2]}})}),function(e){return c.apply(this,arguments)}),z=(0,b.v9)(function(e){return{customTypeLabels:(0,j.YS)(e)}}).customTypeLabels,k=p.$[d];return(0,i.jsx)(g.Z,{isOpen:!0,dataCy:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(I),buttonLabel:"Rename",close:f,onSubmit:function(e){w(e)},initialValues:{customTypeName:v},isLoading:C,content:{title:"Rename a ".concat(k.name({start:!1,plural:!1}))},validate:function(e){var n=e.customTypeName,t={};return n&&n.length||(t.customTypeName="Cannot be empty."),void 0!=t.customTypeName&&z.includes(n)&&v!==n&&(t.customTypeName="".concat(k.name({start:!0,plural:!1})," name is already taken.")),Object.keys(t).length>0?t:void 0},children:function(e){var n=e.errors;return(0,i.jsx)(x.xu,{children:(0,i.jsx)(Z.W,{name:"customTypeName",label:"".concat(k.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(k.name({start:!1,plural:!1})),error:n.customTypeName,dataCy:"custom-type-name-input"})})}})},S=t(25812),C=t(59326),F=t(54132),w=t(65186),z=t(56577);function k(){return(k=(0,r.Z)(function(e){var n,t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=p.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,I.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),l.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(c,s),l.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var L=function(e){var n,t=e.customType,c=e.format,a=e.onClose,l=e.onDeleteCustomTypeSuccess,d=p.$[c],f=(0,s.useState)(!1),m=f[0],v=f[1],y=(0,u.Z)().deleteCustomTypeSuccess,h=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return v(!0),[4,function(e){return k.apply(this,arguments)}({customType:t,onSuccess:function(){return y(t.id)}})];case 1:return e.sent(),l(),[2]}})}),function(){return n.apply(this,arguments)}),g=(0,C.B7)().theme;return(0,i.jsx)(S.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return a()},children:(0,i.jsx)(F.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,i.jsxs)(x.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsxs)(x.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(w.$vK,{size:20,color:null===(e=g.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(x.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,i.jsx)(x.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,i.jsxs)(x.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(z.z,{label:"Cancel",variant:"secondary",onClick:function(){return a()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(z.z,{label:"Delete",variant:"danger",isLoading:m,onClick:function(){h()},sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsxs)("div",{children:["This action will immediately make the following change:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(x.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==t?void 0:t.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},O=function(e){var n,t=e.format,l=e.customType,d=e.isChangesLocal,f=e.setLocalCustomType,p=(0,a.useRouter)(),y=(0,u.Z)().saveCustomTypeSuccess,h=(0,s.useState)(!1),x=h[0],g=h[1],Z=(0,s.useState)(!1),b=Z[0],j=Z[1],I=(0,s.useState)(!1),T=I[0],S=I[1],C=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return S(!0),[4,function(e,n){return m.apply(this,arguments)}(l,y)];case 1:return t.sent(),e=v.cd.custom.getBuilderPagePathname(l.id),p.asPath===e&&(n=v.cd.page.getBuilderPagePathname(l.id),p.replace(n)),S(!1),[2]}})}),function(){return n.apply(this,arguments)}),F=function(){var e,n=v.cd[null!==(e=l.format)&&void 0!==e?e:"custom"].tablePagePathname;p.asPath!==n?p.replace(n):g(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(c.h_,{modal:!0,children:[(0,i.jsx)(c.$F,{disabled:T,children:(0,i.jsx)(c.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:T,variant:"solid"})}),(0,i.jsxs)(c.AW,{align:"end",children:[(0,i.jsx)(c.Xi,{startIcon:(0,i.jsx)(c.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===t&&!d&&(0,i.jsx)(c.Xi,{startIcon:(0,i.jsx)(c.I5,{name:"driveFileMove"}),onSelect:function(){C()},children:"Convert to page type"}),(0,i.jsx)(c.Xi,{color:"tomato",startIcon:(0,i.jsx)(c.I5,{name:"delete"}),onSelect:function(){g(!0)},children:"Remove"})]})]}),x?(0,i.jsx)(L,{format:t,customType:l,onClose:function(){return g(!1)},onDeleteCustomTypeSuccess:F}):null,b?(0,i.jsx)(_,{format:t,customType:l,isChangesLocal:d,onClose:function(){return j(!1)},setLocalCustomType:f}):null]})}},69143:function(){}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[904],{45466:function(e,n,t){"use strict";t.d(n,{c:function(){return g}});var i=t(22710),r=t(62230),a=t(85244),l=t(99267),s=t(52322),c=t(75289),o=t(2784),d=t(36131),u=t(68780),f=t(88932),m=t(38876),h=t(81038),v=t(82770),p=t(5479);function x(){return(x=(0,i.Z)(function(e){var n,t,i,r,a,s,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:n=e.sliceName,t=e.libraryName,i=e.onSuccess,l.label=1;case 1:return l.trys.push([1,4,,5]),r=(0,p.fo)(n),[4,h.j.slices.createSlice({libraryID:t,model:r})];case 2:if((a=l.sent().errors).length>0)throw a;return v.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 3:return l.sent(),[3,5];case 4:return s=l.sent(),c="An unexpected error happened while creating slice ".concat(n,"."),console.error(c,s),f.Am.error(c),[3,5];case 5:return[2]}})})).apply(this,arguments)}var y=t(90374),j=t(66443),b=t(70041),g=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,h=e.remoteSlices,p=(0,y.Z)().createSliceSuccess,g=(0,o.useState)(!1),C=g[0],S=g[1],_=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var a;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return x.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(a=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,v.y0)()];case 1:return p(n.sent().libraries),f(e,t),[2]}})}),function(e){return a.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,s.jsx)(u.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:C,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){_(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,j.h)(e,m,h)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(b.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,s.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,s.jsx)(d.ZP,{name:"from",options:m.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,a.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,a.Z)((0,r.Z)({},e),{colors:(0,a.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return o}});var i=t(81541),r=t(75329),a=t(96009),l=t.n(a),s=t(74600),c=t.n(s);function o(e,n,t){var a=e.sliceName;if(!a)return{sliceName:"Cannot be empty"};if(!r.xo.exec(a))return{sliceName:"No special characters allowed"};if(c()(l()(a)).replace(/\s/gm,"")!==a.trim())return{sliceName:"Value has to be PascalCased"};if(a.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(a))return{sliceName:"".concat(a," is reserved for Slice Machine use")};var s=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),o=t.map(function(e){return e.name});if((0,i.Z)(s).concat((0,i.Z)(o)).includes(a))return{sliceName:"Slice name is already taken."}}},59469:function(e,n,t){"use strict";var i=t(62230),r=t(52322),a=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,s=e.gridTemplateMinPx,c=e.gridGap,o=e.sx;return(0,r.jsx)(a.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===s?"320px":s,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},o),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},12904:function(e,n,t){"use strict";t.d(n,{H:function(){return nr}});var i=t(52322),r=t(22715),a=t(97729),l=t.n(a),s=t(5632),c=t(2784),o=t(56580),d=t(31005),u=t(62230),f=t(85244),m=t(98240),h=t(50002),v=t(73844);t(82432);var p="_1k08lzu5 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d32 _1ecs97daf _1ecs97df0v",x=function(e){return(0,i.jsx)("div",(0,f.Z)((0,u.Z)({},e),{className:"_1k08lzu2 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d1u _1ecs97d97 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezr"}))},y=function(e){return(0,i.jsx)("div",(0,f.Z)((0,u.Z)({},e),{className:"_1k08lzu3 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfhl",children:(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97df92",children:[(0,i.jsx)("span",{className:p}),(0,i.jsx)("span",{className:p}),(0,i.jsx)("span",{className:p})]})}))},j=function(e){return(0,i.jsx)(v.fC,(0,f.Z)((0,u.Z)({},e),{activationMode:"manual",className:"_1k08lzu6 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97dezd"}))},b=function(e){var n=e.children,t=e.onAddNewTab,a=(0,m.Z)(e,["children","onAddNewTab"]);return(0,i.jsxs)(v.aV,(0,f.Z)((0,u.Z)({},a),{className:"_1k08lzu7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dezq",children:[n,(0,i.jsx)("div",{className:"_1k08lzuc _1k08lzu8 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfgy _1ecs97d1u _1ecs97d97 _1ecs97dfhi _1ecs97dezw _1ecs97dfc1",children:(0,i.jsx)(r.hU,{icon:"add",onClick:t,hiddenLabel:"Add new tab"})})]}))},g=function(e){var n=e.children,t=e.menu,a=e.value,l=(0,m.Z)(e,["children","menu","value"]);return(0,i.jsx)(v.xz,(0,f.Z)((0,u.Z)({},l),{"aria-label":a,asChild:!0,onMouseDown:function(e){var n=e.target,t=(0,h.JY)(n);t!==e.currentTarget&&t!==e.currentTarget.parentElement&&e.preventDefault(),n===e.currentTarget&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},value:a,children:(0,i.jsxs)("div",{className:"_1k08lzu9 _1k08lzu8 _1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97dez8 _1ecs97dfgy _1ecs97dez1 _1ecs97da62 _1ecs97dadf _1ecs97df41 _1ecs97df92 _1ecs97dfhl _1ecs97dezv",children:[(0,i.jsx)(r.xv,{className:"_1ecs97dezv _1ecs97dezd",color:"inherit",component:"span",noWrap:!0,variant:"emphasized",children:n}),Boolean(t)?(0,i.jsx)("div",{className:"_1k08lzub _1ecs97dezv _1ecs97df0i",children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.hU,{icon:"moreVert",hiddenLabel:"tab-".concat(a,"-menu-button")})}),(0,i.jsx)(r.AW,{align:"start",children:t})]})}):void 0]})}))},C=function(e){return(0,i.jsx)(v.VY,(0,f.Z)((0,u.Z)({},e),{className:"_1k08lzud _1ecs97dez0 _1ecs97d18 _1ecs97d8l _1ecs97dez3 _1ecs97dezd"}))},S=t(81787),_=t(14137),I=t(91061),w=t(68780),Z=t(63397),T=t(75289),k=function(e){var n=e.name,t=e.label,r=e.placeholder,a=e.error,l=(0,m.Z)(e,["name","label","placeholder","error"]);return(0,i.jsxs)(T.xu,{mb:3,children:[(0,i.jsx)(T.__,{htmlFor:n,mb:2,children:t}),(0,i.jsx)(Z.gN,(0,u.Z)({name:n,type:"text",placeholder:r,as:T.II,autoComplete:"off"},l)),a?(0,i.jsx)(T.xv,{sx:{color:"error",mt:1},children:a}):null]})},z=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds;return(0,i.jsx)(w.Z,{isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,onSubmit:function(e){t(e),r()},initialValues:{id:""},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:function(e){var n=e.errors;return(0,i.jsx)(k,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id})}})},D=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close;return(0,i.jsx)(w.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{},content:{title:"Remove Tab"},children:function(){return(0,i.jsxs)(T.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(T.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(T.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(T.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:function(){t({}),r()},children:"Yes, remove tab"})]})}})},N=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds,l=e.initialTabKey;return(0,i.jsx)(w.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{id:l},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:function(e){var n=e.errors,a=e.values,l=e.setFieldValue,s=e.isValid;return(0,i.jsxs)(T.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(k,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id,onBlur:function(e){a.id!==e.target.value&&l("id",e.target.value.trim())},onChange:function(e){l("id",e.target.value)}}),(0,i.jsx)(T.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!s,onClick:function(){a.id&&a.id.length&&t({id:a.id.trim()}),r()},children:"Save"})]})}})},L=t(81541),V=t(28316),M=t(83239),E=[M.UID,M.Group,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,],F=t(83462),A=t(28173),H=t(82770),P=t(38876),R=t(4092),O=t(8482),K=t(65077),U=t(88932),B=t(45466),X=t(2754),G=function(e){return(0,i.jsxs)("svg",(0,f.Z)((0,u.Z)({width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}))},q=function(e){var n=e.openCreateSliceModal,t=e.openUpdateSliceZoneModal,a=e.openSlicesTemplatesModal,l=e.projectHasAvailableSlices,s=e.isSlicesTemplatesSupported;return(0,i.jsx)(r.xu,{flexGrow:1,justifyContent:"center","data-cy":"slice-zone-blank-slate",children:(0,i.jsx)(X.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(X.T9,{children:[(0,i.jsx)(r.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(G,{})}),(0,i.jsx)(X._T,{children:"Add slices"}),(0,i.jsx)(X.nf,{children:"Slices are website sections that you can reuse on different pages with different content. Each slice has its own component in your code."}),(0,i.jsx)(X.Qj,{children:(0,i.jsxs)(r.S0,{children:[(0,i.jsx)(r.F8,{startIcon:"add",onClick:n,description:"Start from scratch.",children:"Create new"}),s?(0,i.jsx)(r.F8,{startIcon:"contentCopy",onClick:a,description:"Select from premade examples.",endAdornment:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,l?(0,i.jsx)(r.F8,{startIcon:"folder",onClick:t,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})},J=t(75992),Y=t(22710),W=t(17064),$=t(99267),Q=t(17329),ee=t(81038);function en(){return et.apply(this,arguments)}function et(){return(et=(0,Y.Z)(function(){var e,n,t;return(0,$.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,ee.j.sliceTemplateLibrary.readLibrary({})];case 1:if(n=(e=i.sent()).templates,(t=e.errors).length>0)throw t;return[2,n.map(function(e){return{model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(function(e){var n=(0,W.Z)(e,2),t=n[0],i=n[1];return[t,URL.createObjectURL(i),]}))}})];case 2:return i.sent(),[2,[]];case 3:return[2]}})})).apply(this,arguments)}function ei(e){var n=e.customType,t=e.tabId,i=e.slices,r=(0,u.Z)({},n);return i.forEach(function(e){r=(0,f.Z)((0,u.Z)({},r),{tabs:r.tabs.map(function(n){return n.key===t&&n.sliceZone?(0,f.Z)((0,u.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:[{key:e.id,value:e},].concat((0,L.Z)(n.sliceZone.value))}}):n})})}),H.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:n.id}),r}var er=t(13858),ea=t(56577),el=t(54132),es=t(25812),ec=function(e){var n=e.deleteSliceZone,t=e.closeDeleteSliceZoneModal;return(0,i.jsx)(es.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:t,children:(0,i.jsx)(el.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){return(0,i.jsxs)(T.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsx)(T.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(T.x8,{type:"button",onClick:t})]})},Footer:function(){return(0,i.jsxs)(T.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(ea.z,{label:"Cancel",variant:"secondary",onClick:t,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ea.z,{label:"Delete",variant:"danger",onClick:n,sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsx)(T.nv,{children:"You're about to delete Slice Zone."})})})},eo=t(59469),ed=t(71749),eu=function(e){var n=e.availableSlices,t=e.values,r=e.placeholderSlices;return(0,i.jsx)(Z.F2,{name:"sliceKeys",render:function(e){return(0,i.jsx)(eo.Z,{gridTemplateMinPx:"200px",elems:n,defineElementKey:function(e){return"".concat(e.from,"-").concat(e.model.name)},renderElem:function(n){var a,l=null!==(a=null==r?void 0:r.some(function(e){return e.model.id===n.model.id}))&&void 0!==a&&a,s=t.sliceKeys.includes(n.model.id);return(0,i.jsx)(ed.b,{action:{type:"checkbox"},isComingSoon:l,mode:"selection",onSelectedChange:function(i){i?e.push(n.model.id):e.remove(t.sliceKeys.indexOf(n.model.id))},selected:s,slice:n,variant:"outlined"})}})}})},ef=function(e){var n=e.formId,t=e.close,r=e.onSubmit,a=e.availableSlices;return(0,i.jsx)(w.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){r(e.sliceKeys.map(function(e){var n;return null===(n=a.find(function(n){return n.model.id===e}))||void 0===n?void 0:n.model}).filter(function(e){return void 0!==e}))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},dataCy:"update-slices-modal",validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(T.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eu,{values:n,availableSlices:a})}})},em=t(67557),eh=t(53559);function ev(){return(ev=(0,Y.Z)(function(e){var n,t,i,r,a,l,s,c;return(0,$.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),n=e.templateIDs,t=e.localLibrariesNames,i=e.onSuccess,[4,ee.j.sliceTemplateLibrary.createSlices({templateIDs:n})];case 1:if(a=(r=o.sent()).data,(l=r.errors).length>0||void 0===a)throw l;return a.sliceIDs.forEach(function(e,i){H.Xe.track({event:"slice:created",id:e,name:e,library:t[0],sliceTemplate:n[i]})}),[4,i(a.sliceIDs)];case 2:return o.sent(),[3,4];case 3:return s=o.sent(),c="Internal Error: Slice(s) not created",console.error(c,s),U.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var ep=t(90374),ex=[{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:{id:"video_highlights",name:"VideoHighlights",type:"SharedSlice",variations:[{description:"",docURL:"",id:"default",name:"Default",version:"sktwi1xtmkfgx8626"},]},screenshots:{default:{url:"/videoHighlights.png"}}},],ey=function(e){var n=e.formId,t=e.close,r=e.onSuccess,a=e.availableSlicesTemplates,l=e.localLibraries,s=(0,ep.Z)().createSliceSuccess;return(0,i.jsx)(w.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){var n;!function(e){return ev.apply(this,arguments)}({templateIDs:e.sliceKeys,localLibrariesNames:l.map(function(e){return e.name}),onSuccess:(n=(0,Y.Z)(function(e){var n,t;return(0,$.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,H.y0)()];case 1:var t;return s(n.sent().libraries),[4,Promise.all(e.map((t=(0,Y.Z)(function(e){var n;return(0,$.__generator)(this,function(n){switch(n.label){case 0:return[4,ee.j.slices.readSlice({libraryID:l[0].name,sliceID:e})];case 1:return[2,n.sent().model]}})}),function(e){return t.apply(this,arguments)})).filter(function(e){return void 0!==e}))];case 2:return r(n.sent()),[2]}})}),function(e){return n.apply(this,arguments)})})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(T.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eu,{values:n,placeholderSlices:ex,availableSlices:(0,L.Z)(a.map(function(e){return{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eh.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce(function(e,n){return(0,f.Z)((0,u.Z)({},e),(0,em.Z)({},n[0],{url:n[1]}))},{})}})).concat((0,L.Z)(ex))})}})},ej=t(40432),eb=t(78656),eg=t(24804),eC=t(5479),eS=t(63269),e_=t(66443),eI="_1ecs97dez4 _1ecs97dez8 _1ecs97df90",ew="_1ecs97df77 _1ecs97dez2 _1ecs97df92 _1ecs97dfhl _1ecs97dfg9",eZ=function(e){var n,t=e.isOpen,a=e.close,l=e.onSubmit,s=e.isLoading,c=e.slice,d=e.libraries,u=(0,o.v9)(function(e){return{remoteSlices:(0,J.sT)(e)}}).remoteSlices;return(0,i.jsxs)(r.Vq,{open:t,onOpenChange:function(e){return!e&&a()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Upgrade slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(Z.J9,{validateOnMount:!0,initialValues:{from:null===(n=d[0])||void 0===n?void 0:n.name,sliceName:(0,P.MP)(c.key)},validate:function(e){return(0,e_.h)(e,d,u)},onSubmit:function(e){l({libraryID:e.from,sliceID:e.sliceName})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-slice-dialog",children:(0,i.jsxs)(r.xu,{flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ew,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Display name*"}),"string"==typeof e.errors.sliceName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceName}):null]}),(0,i.jsx)(r.yt,{placeholder:"Pascalised Slice API ID (e.g. ".concat((0,P.MP)(c.key),")"),error:"string"==typeof e.errors.sliceName,value:e.values.sliceName,onValueChange:function(n){e.setFieldValue("sliceName",n.slice(0,30))},"data-cy":"slice-name-input"}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Slice library*"}),"string"==typeof e.errors.from?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.from}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:e.values.from,onValueChange:function(n){return n?void e.setFieldValue("from",n):null},children:d.map(function(e){return(0,i.jsx)(r.Ql,{value:e.name,children:e.name},e.name)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Upgrade",onClick:function(){e.submitForm()},loading:s,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eT=t(76635),ek=function(e){var n,t,a=e.isOpen,l=e.close,s=e.onSubmit,o=e.isLoading,d=e.slice,m=e.sliceName,h=e.libraries,v=e.localSharedSlices,p=(0,c.useState)(!0),x=p[0],y=p[1];return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Convert to slice variation"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(Z.J9,{initialValues:{libraryID:null===(n=v[0])||void 0===n?void 0:n.from,sliceID:null===(t=v[0])||void 0===t?void 0:t.model.id,variationID:(0,eT.camelCase)(d.key),variationName:m},validate:function(e){return ez(e,h)},onSubmit:function(e){s(e)},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-variation-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ew,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.libraryID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.libraryID}):null,"string"==typeof e.errors.sliceID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceID}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(e.values.libraryID,"::").concat(e.values.sliceID),onValueChange:function(n){if(n){var t=(0,W.Z)(n.split("::"),2),i=t[0],r=t[1];e.setFieldValue("libraryID",i),e.setFieldValue("sliceID",r)}},children:v.map(function(e){return(0,i.jsxs)(r.Ql,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id))})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(r.yt,{placeholder:m,error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){var t=(0,f.Z)((0,u.Z)({},e.values),{variationName:n.slice(0,30)});x&&(t.variationID=(0,eT.camelCase)(t.variationName)),e.setValues(t,!0)},"data-cy":"variation-name-input"})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"ID*"}),"string"==typeof e.errors.variationID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationID}):null]}),(0,i.jsx)(r.yt,{placeholder:(0,eT.camelCase)(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:function(n){y(!1),e.setFieldValue("variationID",(0,eT.camelCase)(n.slice(0,30)))},"data-cy":"variation-id-input"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Convert",onClick:function(){e.submitForm()},loading:o,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},ez=function(e,n){var t,i={};e.libraryID||(i.libraryID="Cannot be empty.");var r=n.find(function(n){return n.path===e.libraryID});i.libraryID||r||(i.libraryID="Does not exist."),e.sliceID||(i.sliceID="Cannot be empty.");var a=null==r?void 0:r.components.find(function(n){return n.model.id===e.sliceID});return(i.sliceID||a||(i.sliceID="Does not exist."),e.variationName||(i.variationName="Cannot be empty."),e.variationID)?(null!==(t=null==a?void 0:a.model.variations.map(function(e){return e.id}))&&void 0!==t?t:[]).includes(e.variationID)&&(i.variationID="Slice variation ID is already taken."):i.variationID="Cannot be empty.",i},eD=function(e){var n,t,a=e.isOpen,l=e.close,s=e.onSubmit,c=e.isLoading,o=e.identicalSlices;return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(Z.J9,{initialValues:{path:null!==(t=null===(n=o[0])||void 0===n?void 0:n.path)&&void 0!==t?t:""},validate:function(e){if(!e.path)return{path:"Cannot be empty."}},onSubmit:function(e){var n,t=(0,W.Z)(e.path.split("::"),3),i=t[0];s({libraryID:i,sliceID:t[1],variationID:t[2]})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-merge-with-identical-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ew,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:eI,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.path?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.path}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:e.values.path,onValueChange:function(n){n&&e.setFieldValue("path",n)},children:o.map(function(e){return(0,i.jsx)(r.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Merge",onClick:function(){e.submitForm()},loading:c,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eN=function(e){var n,t,a=e.slice,l=e.path,s=(0,ep.Z)(),d=s.refreshState,m=s.openToaster,h=(0,c.useState)(!1),v=h[0],p=h[1],x=(0,c.useState)(),y=x[0],j=x[1],b=(0,S.G)().setCustomType,g=(0,o.v9)(function(e){return{libraries:(0,J.Sd)(e)}}).libraries,C="Slice"===a.value.type&&null!==(n=a.value.fieldset)&&void 0!==n?n:a.key,_=g.filter(function(e){return e.isLocal}),I=_.map(function(e){return e.components}).flat(),w=eL(a,C,I),Z=(t=(0,Y.Z)(function(e){var n,t,i,r,s,c,o,h;return(0,$.__generator)(this,function(h){switch(h.label){case 0:if(!y)return[2];return p(!0),H.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(n=e.variationID)&&void 0!==n?n:"default",library:e.libraryID,conversionType:y}),[4,ee.j.slices.convertLegacySliceToSharedSlice({model:a.value,src:(0,f.Z)((0,u.Z)({},l),{sliceID:a.key}),dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(t=e.variationName)&&void 0!==t?t:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}})];case 1:if((r=h.sent().errors).length)throw console.error("Could not convert slice `".concat(C,"`"),r),m("Could not convert slice `".concat(C,"`"),ej.Jf.ERROR),r;return[4,ee.j.customTypes.readCustomType({id:l.customTypeID})];case 2:if(c=(s=h.sent()).model,(o=s.errors).length||!c)return console.error("Could not refresh custom type view `".concat(l.customTypeID,"`"),o),m("Could not refresh custom type view `".concat(l.customTypeID,"`"),ej.Jf.ERROR),[2];return[4,(0,H.y0)()];case 3:switch(d(h.sent()),p(!1),j(void 0),y){case"as_new_slice":m("".concat(C," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID),ej.Jf.SUCCESS);break;case"as_new_variation":m("".concat(C," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID),ej.Jf.SUCCESS);break;default:m("".concat(C," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID),ej.Jf.SUCCESS)}return b(c),[2]}})}),function(e){return t.apply(this,arguments)}),T={path:l,slice:a,sliceName:C,libraries:_,localSharedSlices:I,identicalSlices:w,close:function(){return j(void 0)},onSubmit:Z,isLoading:v};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{"data-cy":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(r.AW,{align:"start",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:function(){return j("as_new_slice")},children:"Upgrade slice"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:function(){return j("as_new_variation")},disabled:!I.length,children:"Convert to slice variation"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:function(){return j("merge_with_identical")},disabled:!w.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eZ,(0,f.Z)((0,u.Z)({},T),{isOpen:"as_new_slice"===y})),(0,i.jsx)(ek,(0,f.Z)((0,u.Z)({},T),{isOpen:"as_new_variation"===y})),(0,i.jsx)(eD,(0,f.Z)((0,u.Z)({},T),{isOpen:"merge_with_identical"===y}))]})},eL=function(e,n,t){return(0,c.useMemo)(function(){var i=[],r=(0,eC.ux)(e.value,n),a=!0,l=!1,s=void 0;try{for(var c,o=t[Symbol.iterator]();!(a=(c=o.next()).done);a=!0){var d=c.value,u=!0,f=!1,m=void 0;try{for(var h,v=d.model.variations[Symbol.iterator]();!(u=(h=v.next()).done);u=!0){var p=h.value,x=(0,eC.ux)(p,d.model.name);r.primary===x.primary&&r.items===x.items&&i.push({libraryID:d.from,sliceID:d.model.id,variationID:p.id,path:"".concat(d.from,"::").concat(d.model.id,"::").concat(p.id)})}}catch(y){f=!0,m=y}finally{try{u||null==v.return||v.return()}finally{if(f)throw m}}}}catch(j){l=!0,s=j}finally{try{a||null==o.return||o.return()}finally{if(l)throw s}}return i},[e,n,t])},eV=function(e){var n=e.slice,t=e.path,a=(0,W.Z)((0,eS.E)("legacySliceUpgrader"),1)[0],l=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(eg.Zb,{children:[(0,i.jsx)(eg.ZB,{component:"div",children:(0,i.jsx)(r.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(r.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eg.T$,{children:[(0,i.jsx)(r.u,{content:l,side:"bottom",children:(0,i.jsx)(r.Ct,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,i.jsx)(eN,{slice:n,path:t}):null]}),(0,i.jsx)(eg.eW,{subtitle:"1 variation",title:(0,eC.Dj)(n.value)})]})},eM=function(e){var n=e.slices,t=e.format,r=e.path,a=e.onRemoveSharedSlice,l=n.some(function(e){return"SharedSlice"!==e.type}),s=eb.$[t],o=(0,W.Z)((0,eS.E)("legacySliceUpgrader"),1)[0],d=(0,ep.Z)().openToaster;return(0,c.useEffect)(function(){l&&(o.enabled?d("This ".concat(s.name({start:!1,plural:!1})," contains legacy slices that can be upgraded."),ej.Jf.INFO):d("This ".concat(s.name({start:!1,plural:!1})," contains slices that are incompatible."),ej.Jf.WARNING))},[l]),(0,i.jsx)(eo.Z,{elems:n,defineElementKey:function(e){return"SharedSlice"!==e.type?e.payload.key:e.payload.model.name},renderElem:function(e){if("SharedSlice"!==e.type){var n=e.payload;return(0,i.jsx)(eV,{slice:n,path:r})}var t=e.payload;return(0,i.jsx)(ed.b,{action:{type:"remove",onRemove:function(){a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})},sx:{padding:"16px"}})},eE=function(e,n){var t,i=(n||[]).reduce(function(e,n){return(0,L.Z)(e).concat((0,L.Z)(n.components))},[]),r=e.value.reduce(function(e,n){var t=n.key,r=n.value;if("SharedSlice"===r.type){var a=i.find(function(e){return e.model.id===t});return a?(0,f.Z)((0,u.Z)({},e),{slicesInSliceZone:(0,L.Z)(e.slicesInSliceZone).concat([{type:"SharedSlice",payload:a},])}):(0,f.Z)((0,u.Z)({},e),{notFound:(0,L.Z)(e.notFound).concat([{key:t}])})}return(0,f.Z)((0,u.Z)({},e),{slicesInSliceZone:(0,L.Z)(e.slicesInSliceZone).concat([{type:"Slice",payload:{key:t,value:r}},])})},{slicesInSliceZone:[],notFound:[]});return{availableSlices:i,slicesInSliceZone:r.slicesInSliceZone,notFound:r.notFound}},eF=function(e){var n,t=e.customType,a=e.onCreateSliceZone,l=e.onDeleteSliceZone,d=e.onRemoveSharedSlice,u=e.sliceZone,f=e.tabId,m=(0,s.useRouter)(),h=m.query,v=m.replace,p=m.pathname,x=(0,Q.QT)(en,[]),y=(0,c.useState)(!1),j=y[0],b=y[1],g=(0,c.useState)(!1),C=g[0],I=g[1],w=(0,c.useState)(!1),Z=w[0],T=w[1],k=(0,o.v9)(function(e){return{remoteSlices:(0,J.sT)(e),libraries:(0,J.Sd)(e),slices:(0,J.xC)(e)}}),z=k.remoteSlices,D=k.libraries,N=(0,S.G)().setCustomType,L=D.filter(function(e){return e.isLocal}),V=(0,c.useMemo)(function(){return u?eE(u,D):{availableSlices:[],slicesInSliceZone:[],notFound:[]}},[u,D]),M=V.availableSlices,E=V.slicesInSliceZone,F=V.notFound,P=(0,c.useState)(!1),R=P[0],O=P[1];(0,c.useEffect)(function(){(null==F?void 0:F.length)&&F.forEach(function(e){d(e.key)})},[F]);var X=E.filter(function(e){return"SharedSlice"===e.type}).map(function(e){return e.payload}),G=M.filter(function(e){return!X.some(function(n){return n.model.id===e.model.id})}),Y=function(){I(!0)},W=function(){T(!0)},$=function(){b(!0),H.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:t.id,customTypeFormat:t.format})},ee=function(){"true"===h.newPageType&&v({pathname:p,query:{pageTypeId:h.pageTypeId}},void 0,{shallow:!0})},et=function(){I(!1)},ea=function(){T(!1)},el=function(){b(!1)};return(0,i.jsxs)(i.Fragment,{children:[void 0===h.newPageType?(0,i.jsx)(A.Bu,{actions:u?(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{color:"grey",startIcon:"add",children:"Add slices"})}),(0,i.jsxs)(r.AW,{align:"end",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"add",size:"large"}),onSelect:W,description:"Start from scratch.",children:"Create new"}),x.length>0?(0,i.jsx)(r.Xi,{onSelect:$,startIcon:(0,i.jsx)(r.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",shortcut:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,G.length>0?(0,i.jsx)(r.Xi,{onSelect:Y,startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==t.format||"Main"!==f?(0,i.jsx)(r.rs,{checked:!!u,onCheckedChange:function(e){e?a():O(!0)},size:"small","data-cy":"slice-zone-switch"}):void 0,children:"Slice Zone"}):void 0,u?E.length>0?(0,i.jsx)(K.xR,{children:(0,i.jsx)(eM,{slices:E,format:t.format,path:{customTypeID:t.id,tabID:f,sliceZoneID:null!==(n=null==u?void 0:u.key)&&void 0!==n?n:""},onRemoveSharedSlice:d})}):(0,i.jsx)(q,{openUpdateSliceZoneModal:Y,openCreateSliceModal:W,openSlicesTemplatesModal:$,projectHasAvailableSlices:G.length>0,isSlicesTemplatesSupported:x.length>0}):void 0,C&&(0,i.jsx)(ef,{formId:"tab-slicezone-form-".concat(f),availableSlices:G,onSubmit:function(e){var n=ei({customType:t,tabId:f,slices:e});N(_.Dc.fromSM(n)),et(),ee(),U.Am.success("Slice(s) added to slice zone")},close:et}),j&&(0,i.jsx)(ey,{formId:"tab-slicezone-form-".concat(f),availableSlicesTemplates:x,localLibraries:L,onSuccess:function(e){var n=ei({customType:t,tabId:f,slices:e});N(_.Dc.fromSM(n)),el(),ee(),U.Am.success((0,i.jsx)(er.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},close:el}),R&&(0,i.jsx)(ec,{closeDeleteSliceZoneModal:function(){O(!1)},deleteSliceZone:function(){l(),O(!1)}}),(null==L?void 0:L.length)!==0&&Z&&(0,i.jsx)(B.c,{onSuccess:function(e){var n=ei({customType:t,tabId:f,slices:[e]});N(_.Dc.fromSM(n)),ea(),ee(),U.Am.success((0,i.jsx)(er.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},localLibraries:L,remoteSlices:z,onClose:ea})]})},eA=function(e){var n,t,a,l=e.tabId,o=(0,S.G)(),d=o.customType,u=o.setCustomType,f=_.Dc.toSM(d),m=null===(n=f.tabs.find(function(e){return e.key===l}))||void 0===n?void 0:n.sliceZone,h=null!==(a=null===(t=f.tabs.find(function(e){return e.key===l}))||void 0===t?void 0:t.value)&&void 0!==a?a:[],v=(0,s.useRouter)().query,p=f.tabs.reduce(function(e,n){return(0,L.Z)(e).concat((0,L.Z)(n.value))},[]),x=function(e){var n=(0,I.AK)({customType:d,fieldId:e,sectionId:l});u(n)},y=function(e){var n=e.id,t=e.label,i=e.widgetTypeName;if(!(0,F.Ss)(M,i)){var r=M[i],a=r.create(t);if("Range"===a.type||"IntegrationFields"===a.type||"Separator"===a.type)throw Error("Unsupported Field Type: ".concat(a.type));var s=M[a.type];try{s.schema.validateSync(a,{stripUnknown:!1})}catch(c){throw Error('Add field: Model is invalid for field "'.concat(a.type,'".'))}var o=_.L$.fromSM(a),f=(0,I.xS)({customType:d,newField:o,newFieldId:n,sectionId:l});u(f),H.Xe.track({event:"custom-type:field-added",id:n,name:d.id,type:r.TYPE_NAME,zone:"static"})}},j=function(e){if(!(0,F.uS)(e)){var n=e.source,t=e.destination;if(t){var i=(0,I.gR)({customType:d,sourceIndex:n.index,destinationIndex:t.index,sectionId:l});(0,V.flushSync)(function(){return u(i)})}}},b=function(e){var n=e.apiId,t=e.newKey,i=e.value;if(!(0,F.Ss)(M,i.type)){var r=_.L$.fromSM(i),a=(0,I.L4)({customType:d,previousFieldId:n,newFieldId:t,newField:r,sectionId:l});u(a)}},g=function(){var e=(0,I.Tr)(d,l);u(e)},C=function(){var e=(0,I.E3)(d,l);u(e)},w=function(e){var n=(0,I.EN)({customType:d,sectionId:l,sliceId:e});u(n)};return(0,i.jsx)(r.SV,{children:(0,i.jsx)(c.Suspense,{fallback:(0,i.jsx)(r.xu,{padding:32,children:(0,i.jsx)(r._3,{})}),children:(0,i.jsxs)(A.aV,{style:{flexGrow:1},children:[void 0===v.newPageType?(0,i.jsx)(O.Z,{zoneType:"customType",tabId:l,title:"Static Zone",dataTip:"",fields:h,poolOfFieldsToCheck:p,showHints:!0,EditModal:R.Z,widgetsArray:E,onDeleteItem:x,onSave:b,onSaveNewField:y,onDragEnd:j,renderHintBase:function(e){var n=e.item;return"data".concat((0,P.Ti)(n.key))},renderFieldAccessor:function(e){return"data".concat((0,P.Ti)(e))},dataCy:"static-zone-content",isRepeatableCustomType:d.repeatable}):void 0,(0,i.jsx)(eF,{customType:f,tabId:l,sliceZone:m,onRemoveSharedSlice:w,onCreateSliceZone:g,onDeleteSliceZone:C})]})})})},eH=function(){var e,n,t,a=(0,S.G)(),l=a.customType,o=a.setCustomType,d=_.Dc.toSM(l),u=(0,c.useState)(null===(e=d.tabs[0])||void 0===e?void 0:e.key),f=u[0],m=u[1],h=(0,c.useState)(),v=h[0],p=h[1],w=(0,s.useRouter)().query,Z=(null===(n=d.tabs.find(function(e){return e.key===f}))||void 0===n?void 0:null===(t=n.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(x,{style:Z?{flexGrow:1}:void 0,children:["page"===l.format?(0,i.jsx)(y,{}):void 0,"true"===w.newPageType?(0,i.jsx)(eA,{tabId:d.tabs[0].key}):(0,i.jsxs)(j,{onValueChange:m,value:f,children:[(0,i.jsx)(b,{onAddNewTab:function(){p({type:"CREATE_CUSTOM_TYPE_TAB"})},children:d.tabs.map(function(e){return(0,i.jsx)(g,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Xi,{onSelect:function(){p({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(r.Xi,{color:"tomato",disabled:d.tabs.length<=1,onSelect:function(){p({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key)})}),d.tabs.map(function(e){return(0,i.jsx)(C,{value:e.key,children:(0,i.jsx)(eA,{tabId:e.key})},e.key)})]})]}),(null==v?void 0:v.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(z,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;o((0,I.vB)(l,n)),m(n)},tabIds:d.tabs.map(function(e){return e.key.toLowerCase()})}):void 0,(null==v?void 0:v.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(N,{close:function(){p(void 0)},initialTabKey:v.tabKey,isOpen:!0,onSubmit:function(e){var n=e.id;o((0,I.HO)(l,v.tabKey,n)),f===v.tabKey&&m(n)},tabIds:d.tabs.filter(function(e){return e.key!==v.tabKey}).map(function(e){return e.key.toLowerCase()})}):void 0,(null==v?void 0:v.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(D,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(){if(o((0,I.F$)(l,v.tabKey)),f===v.tabKey){var e,n=null===(e=d.tabs.find(function(e){return e.key!==v.tabKey}))||void 0===e?void 0:e.key;void 0!==n&&m(n)}}}):void 0]})},eP=t(7819),eR=t(67445),eO=t(31667),eK=t(47976),eU=t(19345);t(5608);var eB=function(e){var n=e.tabs,t=(0,m.Z)(e,["tabs"]);return(0,i.jsxs)(v.fC,(0,f.Z)((0,u.Z)({},t),{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97dm _1ecs97d7z _1ecs97df7d",defaultValue:n[0].label,orientation:"vertical",children:[(0,i.jsx)(v.aV,{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezc _1ecs97d6qm _1ecs97d6xz _1ecs97df29 _1ecs97df2l _1ecs97dfhl","aria-label":"content tabs",children:n.map(function(e,n){var t=e.label;return(0,i.jsx)(v.xz,{className:"_76k20u4 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97da62 _1ecs97dadf _1ecs97df41 _1ecs97dfg6",value:t,children:(0,i.jsx)(r.xv,{className:"_76k20u5",component:"span",color:"inherit",children:t})},"".concat(t,"-trig").concat(n+1))})}),n.map(function(e,n){var t=e.label,a=e.content;return(0,i.jsx)(v.VY,{className:"_76k20u6 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97df7d _1ecs97df2s",value:t,children:(0,i.jsx)(r.xr,{className:"_1ecs97dfft",children:a})},"".concat(t,"-content").concat(n+1))})]}))},eX=t(88241),eG=t(70863),eq=t(8857),eJ=t(49109),eY=t(72757),eW=t(25145),e$=function(){return(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1707 19.1237C17.9629 19.3056 17.9419 19.6214 18.1237 19.8293C18.3056 20.0371 18.6214 20.0581 18.8293 19.8763L22.8293 16.3763C22.9378 16.2814 23 16.1442 23 16C23 15.8558 22.9378 15.7187 22.8293 15.6237L18.8293 12.1237C18.6214 11.9419 18.3056 11.9629 18.1237 12.1708C17.9419 12.3786 17.9629 12.6945 18.1707 12.8763L21.7407 16L18.1707 19.1237ZM13.8293 12.8763C14.0371 12.6945 14.0581 12.3786 13.8763 12.1708C13.6944 11.9629 13.3786 11.9419 13.1707 12.1237L9.17075 15.6237C9.06224 15.7187 9 15.8558 9 16C9 16.1442 9.06224 16.2814 9.17075 16.3763L13.1707 19.8763C13.3786 20.0581 13.6944 20.0371 13.8763 19.8293C14.0581 19.6214 14.0371 19.3056 13.8293 19.1237L10.2593 16L13.8293 12.8763Z",fill:"#6F6E77"})})},eQ=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{d:"M21.2388 10H10.7623C10.3415 10 10 10.3415 10 10.7623V21.2377C10 21.6585 10.3415 22 10.7623 22H21.2377C21.6585 22 22 21.6585 22 21.2388V10.7623C22 10.3415 21.6585 10 21.2388 10ZM16.5714 19.1953C16.5714 20.3371 15.9018 20.8571 14.9241 20.8571C14.0402 20.8571 13.4029 20.2645 13.1429 19.7143L14.0413 19.1708C14.2143 19.4777 14.4777 19.7143 14.8571 19.7143C15.2199 19.7143 15.4286 19.5725 15.4286 19.0212V15.4286H16.5714V19.1953ZM19.0502 20.8571C18.0379 20.8571 17.4632 20.3471 17.1429 19.7143L18 19.1429C18.2333 19.5246 18.4877 19.8895 19.0257 19.8895C19.4777 19.8895 19.7143 19.6641 19.7143 19.3516C19.7143 18.9788 19.4688 18.846 18.9721 18.6283L18.6998 18.5112C17.9129 18.1763 17.3895 17.7567 17.3895 16.8683C17.3895 16.0513 18.0134 15.4286 18.9866 15.4286C19.6797 15.4286 20.1775 15.6696 20.5368 16.3013L19.6886 16.8471C19.5011 16.5112 19.3002 16.3795 18.9866 16.3795C18.6674 16.3795 18.4654 16.5826 18.4654 16.8471C18.4654 17.1741 18.6674 17.3058 19.135 17.5089L19.4074 17.6261C20.3348 18.0223 20.8571 18.4275 20.8571 19.3382C20.8571 20.3192 20.0859 20.8571 19.0502 20.8571Z",fill:"#6F6E77"})})},e0=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.1719 10H20.8281C21.4753 10 22 10.5247 22 11.1719V20.8281C22 21.4753 21.4753 22 20.8281 22H11.1719C10.5247 22 10 21.4753 10 20.8281V11.1719C10 10.5247 10.5247 10 11.1719 10ZM17.4283 20.7223V19.549C17.641 19.7275 17.8721 19.8613 18.1215 19.9505C18.371 20.0397 18.6228 20.0843 18.8771 20.0843C19.0263 20.0843 19.1565 20.0709 19.2678 20.044C19.3791 20.0171 19.472 19.9798 19.5466 19.9322C19.6211 19.8845 19.6768 19.8283 19.7135 19.7635C19.7501 19.6987 19.7685 19.6285 19.7685 19.5527C19.7685 19.45 19.7391 19.3583 19.6805 19.2777C19.6217 19.197 19.5417 19.1225 19.4402 19.054C19.3387 18.9856 19.2183 18.9196 19.0789 18.856C18.9395 18.7925 18.7891 18.7277 18.6277 18.6617C18.2169 18.4906 17.9106 18.2816 17.7089 18.0347C17.5071 17.7878 17.4062 17.4896 17.4062 17.1401C17.4062 16.8663 17.4613 16.631 17.5713 16.4343C17.6814 16.2375 17.8311 16.0756 18.0206 15.9484C18.2102 15.8213 18.4296 15.7278 18.6791 15.668C18.9285 15.6081 19.1926 15.5781 19.4714 15.5781C19.7452 15.5781 19.988 15.5946 20.1995 15.6276C20.411 15.6606 20.606 15.7113 20.7845 15.7798V16.8761C20.6965 16.815 20.6005 16.7612 20.4966 16.7148C20.3927 16.6683 20.2857 16.6298 20.1756 16.5992C20.0656 16.5687 19.9562 16.5461 19.8473 16.5314C19.7385 16.5168 19.6352 16.5094 19.5374 16.5094C19.4029 16.5094 19.2806 16.5223 19.1706 16.5479C19.0605 16.5736 18.9676 16.6097 18.8918 16.6561C18.816 16.7025 18.7573 16.7581 18.7157 16.8229C18.6742 16.8877 18.6534 16.9604 18.6534 17.0411C18.6534 17.1291 18.6766 17.2079 18.7231 17.2776C18.7695 17.3472 18.8356 17.4132 18.9212 17.4756C19.0068 17.5379 19.1107 17.599 19.2329 17.6589C19.3552 17.7188 19.4934 17.7805 19.6474 17.8441C19.8577 17.932 20.0466 18.0255 20.2142 18.1245C20.3817 18.2235 20.5253 18.3354 20.6451 18.46C20.765 18.5847 20.8567 18.7271 20.9203 18.8872C20.9838 19.0473 21.0156 19.2337 21.0156 19.4463C21.0156 19.7397 20.96 19.9859 20.8487 20.1851C20.7375 20.3844 20.5865 20.5457 20.3957 20.6691C20.205 20.7926 19.9831 20.8812 19.73 20.935C19.4769 20.9887 19.2097 21.0156 18.9285 21.0156C18.6399 21.0156 18.3655 20.9912 18.105 20.9423C17.8446 20.8934 17.619 20.8201 17.4283 20.7223ZM16.9609 16.6582H15.4558V20.9453H14.2634V16.6582H12.7656V15.6953H16.9609V16.6582Z",fill:"#6F6E77"})})},e1=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.031 11L15.7584 17.8336L16.0831 18.4288L16.4077 17.8336L20.1352 11H22L16.0831 21.4347L10 11H12.031ZM19.2924 11.0006L16.0831 16.8843L12.8737 11.0005L14.2612 11.0001L14.727 11L15.2777 11.9497L16.1319 13.4226L16.9886 11.9512L17.542 11.0006H17.9881H19.2924Z",fill:"#6F6E77"})})},e7=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,children:(0,i.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,i.jsx)("path",{d:"M0 0h32v32H0z"}),(0,i.jsx)("path",{fill:"#6F6E77",fillRule:"nonzero",d:"M15.45 10.534c1.592-1.013 3.794-.542 4.908 1.054.533.747.742 1.679.585 2.584a3.2 3.2 0 0 1-.48 1.197c.35.664.466 1.427.333 2.167a3.205 3.205 0 0 1-1.449 2.148l-2.795 1.782c-1.593 1.013-3.792.542-4.908-1.054a3.413 3.413 0 0 1-.585-2.584c.075-.425.24-.834.48-1.197a3.374 3.374 0 0 1-.334-2.167 3.205 3.205 0 0 1 1.449-2.148Zm3.756 1.785a2.224 2.224 0 0 0-2.383-.883 2.053 2.053 0 0 0-.57.249l-2.794 1.782c-.46.29-.778.759-.873 1.292a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.203-.054.393-.138.569-.249l1.064-.68a.567.567 0 0 1 .171-.076.67.67 0 0 1 .718.266.613.613 0 0 1 .106.468.582.582 0 0 1-.263.39L14.89 19.1a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.612.612 0 0 1-.114-.414l.011-.103-.103-.033a3.608 3.608 0 0 1-1.094-.547l-.144-.106-.051.16c-.03.084-.052.17-.068.26a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.2-.054.393-.138.569-.249l2.795-1.782c.46-.29.777-.759.872-1.292a2.06 2.06 0 0 0-.352-1.555 2.224 2.224 0 0 0-2.384-.883 2.053 2.053 0 0 0-.568.249l-1.065.68a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.613.613 0 0 1-.106-.468.582.582 0 0 1 .263-.39l2.795-1.783a.567.567 0 0 1 .17-.076.67.67 0 0 1 .719.266c.086.119.127.268.113.414l-.01.103.102.033c.393.119.764.303 1.095.547l.143.106.052-.16c.03-.084.051-.17.068-.26a2.06 2.06 0 0 0-.353-1.555Z"})]})})};t(69001),eq.Z.registerLanguage("tsx",eJ.Z),eq.Z.registerLanguage("markup",eY.Z),eq.Z.alias("markup","vue"),eq.Z.alias("markup","svelte");var e2=function(e){var n,t=(null!==(n=e.fileName.match(/\.([^\.]*)$/))&&void 0!==n?n:[])[1];return function(){switch(t){case"ts":case"tsx":return(0,i.jsx)(e0,{});case"js":case"jsx":return(0,i.jsx)(eQ,{});case"vue":return(0,i.jsx)(e1,{});case"svelte":return(0,i.jsx)(e7,{});default:return(0,i.jsx)(e$,{})}}()},e9=function(e){var n=e.code,t=e.onCopy,a=(0,c.useState)(!1),l=a[0],s=a[1];(0,c.useEffect)(function(){if(l){var e=setTimeout(function(){s(!1)},1200);return function(){clearTimeout(e)}}},[l]);var o=function(){navigator.clipboard.writeText(n).then(function(){s(!0),void 0!==t&&t()})};return(0,i.jsx)(r.hU,{size:"small",onClick:o,icon:l?"check":"contentCopy",hiddenLabel:l?"Code successfully copied":"Copy code"})},e4=function(e){var n=e.fileInfo,t=e.className,a=e.copy,l=e.code,s=e.onCopy,c=/language-(\w+)/.exec(null!=t?t:"");return(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez5 _1ecs97df2h _1ecs97df0r _1ecs97df23 _1ecs97d3fg _1ecs97d3mt",children:[(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dezi _1ecs97df1k _1ecs97df1u _1ecs97df29 _1ecs97df2l _1ecs97d18 _1ecs97d8l _1ecs97d6r8 _1ecs97d6yl _1ecs97dfg4 _1ecs97dfic",children:[void 0!==n?(0,i.jsxs)("div",{className:"_1ecs97dez0 _1ecs97dez2 _1ecs97dezi _1ecs97dez8",children:[(0,i.jsx)(e2,{fileName:n.fileName}),(0,i.jsx)(r.xv,{className:"_8uty130",color:"grey11",children:n.fileName})]}):(0,i.jsx)("span",{}),!0===a?(0,i.jsx)(e9,{onCopy:s,code:String(l)}):null]}),null!==c&&c[1]?(0,i.jsx)(eq.Z,{showLineNumbers:!0,customStyle:{margin:0,border:"none",fontSize:"12px",lineHeight:"18px",borderRadius:"none",backgroundColor:"#FFF",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"},children:String(l).replace(/\n$/,""),style:eW.MS,language:c[1],PreTag:"div"}):l]})},e8="_1ecs97dfh5",e6=t(36065),e3=function(e){var n=(0,e6.p)();if(!0===e.inline)return(0,i.jsx)("code",(0,f.Z)((0,u.Z)({},e),{className:"_1ecs97df46 _1ecs97d18 _1ecs97d8l _1ecs97df0r _1ecs97dfg3 _1ecs97dfhg"}));var t=function(){var n,t;if((null===(n=e.node)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.meta)!==void 0){var i,r,a,l=null===(i=e.node)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.meta;return{fileName:l.substring(1,l.length-1),language:null===(a=e.className)||void 0===a?void 0:a.split("-")[1]}}return null}(),r=function(){void 0!==n&&H.Xe.track({event:"page-type:copy-snippet",framework:n})};return(0,i.jsx)(e4,(0,u.Z)((0,f.Z)((0,u.Z)({copy:!0},e),{onCopy:r,code:e.children}),null!==t?{fileInfo:t}:{}))},e5=function(e){var n=e.markdown;return(0,i.jsx)(eG.D,{children:n,linkTarget:"_blank",remarkPlugins:[eX.Z],components:{code:function(e){return(0,i.jsx)(e3,(0,u.Z)({},e))},h1:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h1",variant:"h1"})},h2:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h2",variant:"h2"})},h3:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h3",variant:"h3"})},h4:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},h5:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},p:function(e){return(0,i.jsx)(r.xv,{className:e8,children:e.children,component:"p",variant:"normal"})},pre:function(e){return(0,i.jsx)(r.xv,{className:e8,children:e.children,component:"pre",variant:"normal"})}}})};function ne(e){return nn.apply(this,arguments)}function nn(){return(nn=(0,Y.Z)(function(e){var n,t,i,r;return(0,$.__generator)(this,function(a){switch(a.label){case 0:return n=JSON.parse(e),[4,ee.j.documentation.read({kind:n.kind,data:n.data})];case 1:if(i=(t=a.sent()).errors,r=t.documentation,i.length>0)throw i;return[2,r]}})})).apply(this,arguments)}t(75317);var nt=function(e){var n,t=e.model,a=(0,e6.p)(),l=(0,Q.QT)(ne,[JSON.stringify({kind:"PageSnippet",data:{model:t}})]);if(0===l.length)return null;var s=function(){void 0!==a&&H.Xe.track({event:"page-type:open-snippet",framework:a})};return(0,i.jsxs)(r.Vq,{size:"small",trigger:(0,i.jsx)(r.zx,{color:"grey",onClick:s,startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(r.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:"_3uvawd0 _1ecs97dez2 _1ecs97dezb _1ecs97df7d _1ecs97df94",children:l.length>1?(0,i.jsx)(eB,{style:{flex:1},tabs:l.map(function(e,n){var t=e.label,r=e.content;return{label:null!=t?t:"Tab ".concat(n+1),content:(0,i.jsx)(e5,{markdown:r})}})}):(0,i.jsx)(r.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(e5,{markdown:l[0].content})})})]})},ni=function(e){var n=e.model;return(0,i.jsx)("div",{children:(0,i.jsx)(r.SV,{children:(0,i.jsx)(c.Suspense,{fallback:(0,i.jsx)(r.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(nt,{model:n})})})})},nr=function(){var e=(0,s.useRouter)(),n=(0,o.v9)(function(n){return{selectedCustomType:(0,eO.Jk)(n,(0,eR.Ag)(e.query))}}).selectedCustomType;return((0,c.useEffect)(function(){n&&(0,eP.TG)(n)||e.replace("/")},[n,e]),n&&(0,eP.TG)(n))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsxs)("title",{children:[n.local.label," - Slice Machine"]})}),(0,i.jsx)(na,{customType:n.local})]}):(0,i.jsx)(d.LN,{})},na=function(e){var n=e.customType;return null===n?(0,i.jsx)(d.LN,{}):(0,i.jsx)(d.LN,{children:(0,i.jsx)(S.k,{initialCustomType:_.Dc.fromSM(n),children:function(e){var t,a=e.autoSaveStatus,l=e.customType,s=e.setCustomType,c=(0,I.y6)(l),o=eR.cd[n.format],u=eb.$[n.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.wd,{children:[(0,i.jsx)(d.Xq,{url:o.tablePagePathname}),(0,i.jsx)(d.Cx,{folder:u.name({start:!0,plural:!0}),page:null!==(t=l.label)&&void 0!==t?t:l.id}),(0,i.jsxs)(d.K2,{children:[(0,i.jsx)(eK.X,{status:a}),"page"===l.format?(0,i.jsx)(ni,{model:l}):void 0,(0,i.jsx)(eU._,{isChangesLocal:!0,format:c,customType:l,setLocalCustomType:s})]})]}),(0,i.jsx)(d.RN,{children:(0,i.jsx)(r.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eH,{})})})]})}})})}},63269:function(e,n,t){"use strict";t.d(n,{E:function(){return o}});var i=t(22710),r=t(62230),a=t(85244),l=t(17064),s=t(99267),c=t(19334);function o(e){var n,t,o,d=(0,l.Z)((0,c.f)(),2),u=d[0],f=d[1],m=(o=(0,i.Z)(function(n){var t;return(0,s.__generator)(this,function(i){switch(i.label){case 0:return t=(0,a.Z)((0,r.Z)({},u),{labs:(0,r.Z)({},u.labs)}),n?t.labs[e]=n:e in t.labs&&delete t.labs[e],0===Object.keys(t.labs).length&&delete t.labs,[4,f(t)];case 1:return i.sent(),[2]}})}),function(e){return o.apply(this,arguments)});return[{enabled:null!==(t=null==u?void 0:null===(n=u.labs)||void 0===n?void 0:n[e])&&void 0!==t&&t},m]}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return s}});var i=t(22710),r=t(99267),a=t(17329),l=t(81038);function s(){var e,n=(0,a.QT)(c,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,a.VA)(c,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function c(){return o.apply(this,arguments)}function o(){return(o=(0,i.Z)(function(){return(0,r.__generator)(this,function(e){return[2,l.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},69001:function(){},5608:function(){},75317:function(){}}]);
|