slice-machine-ui 1.19.2-dev-in-app-guide.2 → 1.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/components/Navigation/index.tsx +0 -1
  2. package/out/404.html +1 -1
  3. package/out/_next/static/8rc3TRisi8gOyPYwHa35C/_buildManifest.js +1 -0
  4. package/out/_next/static/chunks/{474-2393e400314474be.js → 125-e3857af2068bbedf.js} +2 -2
  5. package/out/_next/static/chunks/18539003-1bb05c8aa7db2bc2.js +97 -0
  6. package/out/_next/static/chunks/482-bfe6dbc93fb63a0d.js +1 -0
  7. package/out/_next/static/chunks/{550-e72c08c598051224.js → 550-1dafbcec5d50b384.js} +1 -1
  8. package/out/_next/static/chunks/{125-f0e2eb84ee39757a.js → 585-f3dca093db4b3792.js} +3 -1
  9. package/out/_next/static/chunks/{80-821a0b5d4ad61185.js → 80-c513d12da6156fb7.js} +1 -1
  10. package/out/_next/static/chunks/840-c317c8ff8de0f202.js +1 -0
  11. package/out/_next/static/chunks/904-438ff06c6c7e18f3.js +1 -0
  12. package/out/_next/static/chunks/958-4f94d552d296c608.js +1 -0
  13. package/out/_next/static/chunks/pages/_app-19c4fbcd62918db2.js +428 -0
  14. package/out/_next/static/chunks/pages/{changelog-fa36b9995c26e1d7.js → changelog-75b0bf58d1f3045d.js} +1 -1
  15. package/out/_next/static/chunks/pages/{changes-e388be4457a43c3a.js → changes-9dcb1cdaa8b10560.js} +1 -1
  16. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-3a37eb3373bb8823.js → [customTypeId]-aa37e07c96c8f9b5.js} +1 -1
  17. package/out/_next/static/chunks/pages/index-5266b7f0ca55025a.js +1 -0
  18. package/out/_next/static/chunks/pages/labs-2349c21fbac1bd23.js +1 -0
  19. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-733f3890c0466a05.js → [pageTypeId]-d445f5cabeb460c0.js} +1 -1
  20. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-dda1f32608129e23.js → simulator-5e441f8b049cf91b.js} +1 -1
  21. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-2282320bb9091898.js → [variation]-c9b5ff7076d2b19b.js} +1 -1
  22. package/out/_next/static/chunks/pages/{slices-22db04643850c1d8.js → slices-247c480530e98426.js} +1 -1
  23. package/out/_next/static/css/{3e88bd24e38f18d0.css → 1fbd45881dcf43c4.css} +1 -1
  24. package/out/_next/static/css/{867d8d7ab4a75762.css → 22d69420bda374a7.css} +1 -1
  25. package/out/_next/static/css/{16b41648cd1de03b.css → 26b51745402a92af.css} +1 -1
  26. package/out/_next/static/css/66b3836ab88b0c5c.css +1 -0
  27. package/out/_next/static/css/{6e4843007ff41825.css → e4f4acc81f000d9c.css} +1 -1
  28. package/out/_next/static/css/{51597cd1f01c4889.css → f585032018f6024b.css} +1 -1
  29. package/out/changelog.html +1 -1
  30. package/out/changes.html +1 -1
  31. package/out/custom-types/[customTypeId].html +1 -1
  32. package/out/custom-types.html +1 -1
  33. package/out/index.html +1 -1
  34. package/out/labs.html +1 -1
  35. package/out/page-types/[pageTypeId].html +1 -1
  36. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  37. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  38. package/out/slices.html +1 -1
  39. package/package.json +7 -7
  40. package/pages/_app.tsx +37 -38
  41. package/src/components/ContentTabs/ContentTabs.css.ts +1 -1
  42. package/src/components/SideNav/SideNav.css.ts +11 -11
  43. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  44. package/out/_next/static/JtXmprA4ZlF_tsZXgw4Gi/_buildManifest.js +0 -1
  45. package/out/_next/static/chunks/18539003-371d86ea83e7293b.js +0 -97
  46. package/out/_next/static/chunks/482-39cef3a713901788.js +0 -1
  47. package/out/_next/static/chunks/840-884e41a48b92e5d3.js +0 -1
  48. package/out/_next/static/chunks/904-55ff54caf14254dc.js +0 -1
  49. package/out/_next/static/chunks/958-be627006594efb21.js +0 -1
  50. package/out/_next/static/chunks/pages/_app-6a64c583ef6e4158.js +0 -439
  51. package/out/_next/static/chunks/pages/index-d8e3a2c0d712904f.js +0 -1
  52. package/out/_next/static/chunks/pages/labs-ebce03a4e7a95a4e.js +0 -1
  53. package/out/_next/static/css/bca8066fd65eed7f.css +0 -1
  54. package/src/components/Counter/Counter.css.ts +0 -25
  55. package/src/components/Counter/Counter.stories.tsx +0 -24
  56. package/src/components/Counter/Counter.tsx +0 -18
  57. package/src/components/Counter/index.ts +0 -1
  58. package/src/features/inAppGuide/InAppGuideDialog.tsx +0 -109
  59. package/src/features/inAppGuide/inAppGuideContent.tsx +0 -68
  60. package/src/hooks/usePersistedState.ts +0 -23
  61. package/src/icons/FlowerBackgroundIcon.tsx +0 -16
  62. package/src/icons/HelpIcon.tsx +0 -19
  63. /package/out/_next/static/{JtXmprA4ZlF_tsZXgw4Gi → 8rc3TRisi8gOyPYwHa35C}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[482],{8482:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var s=t(62230),i=t(85244),d=t(17064),r=t(81541),a=t(52322),c=t(71651),l=t(13980),o=t(2784),u=t(65077),p=t(28173),f=t(75012),x=t(9620),h=t(2967),y=t(75289),_=t(71168),b=t(21078),j=t(13394),g=t(99968),v=t(92809),m=function(e){var n=e.fields,t=e.title,d=e.tabId,r=e.enterEditMode,c=e.enterSelectMode,l=e.onDragEnd,o=e.renderFieldAccessor,u=e.onDeleteItem,p=e.showHints,f=e.newField,x=e.renderHintBase,m=e.isRepeatable,R=e.dataCy,S=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:l,children:(0,a.jsx)(h.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(y.xu,(0,i.Z)((0,s.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-cy":R,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var l=e.value,f=l.config,h=l.type,R=(0,g.t)(j,f,h);if(!R)return(0,a.jsx)(_.Z,{children:(0,a.jsxs)(y.xv,{children:['Field type "',h,'" not supported']})});var Z={item:e,index:n,tabId:d,widget:R,showHints:p,key:e.key,enterSelectMode:c,renderFieldAccessor:o,enterEditMode:r,parentSnapshot:t,deleteItem:u,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:S};if(R.CustomListItem){var C=R.CustomListItem;return(0,a.jsx)(C,(0,s.Z)({},Z))}var w=(0,a.jsx)(v.Z,{item:e,show:p,isRepeatable:m,renderHintBase:x,Widgets:j,typeName:R.CUSTOM_NAME||R.TYPE_NAME});return(0,a.jsx)(b.Z,(0,i.Z)((0,s.Z)({},Z),{HintElement:w}))}),e.placeholder,f]}))}})})},R=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(y.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(y.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(y.xu,{sx:{my:2},children:(0,a.jsxs)(y.xv,{sx:{color:"textClear"},children:["Add a field to your ",t," Zone"]})}),(0,a.jsx)(y.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(c.zx,{variant:"secondary",onClick:function(){return n()},"data-cy":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},S=function(e){var n=e.zoneType,t=e.tabId,l=e.title,h=e.fields,y=e.poolOfFieldsToCheck,_=e.widgetsArray,b=e.isRepeatable,j=e.onDeleteItem,g=e.onSaveNewField,v=e.onDragEnd,S=e.EditModal,Z=e.onSave,C=e.dataTip,w=e.renderHintBase,k=e.renderFieldAccessor,E=e.dataCy,I=e.isRepeatableCustomType,A=Object.entries(y).find(function(e){return"UID"===(0,d.Z)(e,2)[1].value.type})?_.filter(function(e){return"UID"!==e.TYPE_NAME}):_,T=(0,o.useState)(!1),F=T[0],N=T[1],q=(0,o.useState)({isOpen:!1}),M=q[0],O=q[1],D=(0,o.useState)({isOpen:!1}),H=D[0],B=D[1],z=(0,o.useState)(null),P=z[0],U=z[1],W=function(e){O({isOpen:!0,field:e})},L=function(){B({isOpen:!0})},Y=function(){O({isOpen:!1})},K=function(){return B({isOpen:!1})},V=function(e){U({widgetTypeName:e,fields:h}),B({isOpen:!1})},X=function(){return U(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:h.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(c.rs,{checked:F,onCheckedChange:N,size:"small",style:{flexShrink:0}}),(0,a.jsx)(c.zx,{"data-cy":"add-".concat(b?"Repeatable":"Static","-field"),onClick:L,startIcon:"add",variant:"secondary",children:"Add a new field"})]}):void 0,children:l}),0!==h.length||P?h.length>0||P?(0,a.jsx)(u.xR,{children:(0,a.jsx)(m,{tabId:t,isRepeatable:b,fields:h,showHints:F,dataTip:C,title:l,renderFieldAccessor:k,renderHintBase:w,enterEditMode:W,enterSelectMode:L,onDragEnd:v,onDeleteItem:j,dataCy:E,isRepeatableCustomType:I,newField:P&&(0,a.jsx)(x.Z,(0,i.Z)((0,s.Z)({},P),{fields:y||h,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];g.apply(void 0,(0,r.Z)(n)),U(null)},onCancelNewField:X}))})}):void 0:(0,a.jsx)(u.xR,{children:(0,a.jsx)(R,{onEnterSelectMode:function(){return L()},zoneName:b?"Repeatable":"Static"})}),(0,a.jsx)(S,{data:M,close:Y,onSave:Z,fields:y,zoneType:n}),(0,a.jsx)(f.Z,{data:H,close:K,onSelect:V,widgetsArray:A})]})};S.propTypes={isRepeatable:l.bool,title:l.string.isRequired,dataTip:l.string.isRequired,onSave:l.func.isRequired,onSaveNewField:l.func.isRequired,onDragEnd:l.func.isRequired,onDeleteItem:l.func.isRequired,poolOfFieldsToCheck:(0,l.arrayOf)((0,l.shape)({key:l.string,value:l.object})),renderHintBase:l.func.isRequired,renderFieldAccessor:l.func.isRequired,widgetsArray:l.array.isRequired,fields:(0,l.arrayOf)((0,l.shape)({key:l.string.isRequired,value:(0,l.shape)({config:l.object,fields:l.array,type:l.string.isRequired})}))};var Z=S},28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return c},Bu:function(){return l}});var s=t(62230),i=t(85244),d=t(98240),r=t(52322),a=t(71651);t(58740),t(97798);var c=function(e){return(0,r.jsx)("div",(0,i.Z)((0,s.Z)({},e),{className:"_2a96i71 _1ecs97d9bi _1ecs97d9bk _1ecs97d268 _1ecs97d2dl _1ecs97d9d7 _1ecs97d9ej _1ecs97d9ex _1ecs97d9bt _1ecs97d9c9"}))},l=function(e){var n=e.actions,t=e.children,c=e.toggle,l=(0,d.Z)(e,["actions","children","toggle"]);return(0,r.jsxs)("div",(0,i.Z)((0,s.Z)({},l),{className:"_2a96i73 _2a96i72 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9bq _1ecs97d48s _1ecs97d4g5 _1ecs97d9f1 _1ecs97d9bj _1ecs97d9jc _1ecs97d9u4 _1ecs97d18 _1ecs97d8l _1ecs97d9ep _1ecs97d9ld _1ecs97d9ts",children:[(0,r.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),c,Boolean(n)?(0,r.jsx)("div",{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9bq _1ecs97d9bv _1ecs97d9ld _1ecs97d9c1 _1ecs97d9hc",children:n}):null]}))}},97798:function(){},58740:function(){}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[550],{56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),s=t(98240),a=t(52322),c=t(2784),i=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,m=e.form,p=e.isLoading,f=void 0!==p&&p,h=e.disabled,x=e.onClick,y=e.sx,v=e.iconSize,b=void 0===v?16:v,g=e.iconFill,j=e.variant,_=void 0===j?"primary":j,Z=(0,s.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(i.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===y?{}:y),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),f?{cursor:"wait !important"}:{}),type:d,form:m,disabled:void 0!==h&&h||f,onClick:f?void 0:x,variant:_},Z),{children:f?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$j,{size:b,color:u(_),"data-cy":l(Z["data-cy"],"spinner")}),c&&t]}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(c,{size:b,fill:g,"data-cy":l(Z["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 s=t(63397),a=t(75289),c=function(e){var n=e.name,t=e.label,c=e.placeholder,i=e.error,l=e.dataCy,u=e.onChange;return(0,o.jsxs)(a.xu,{mb:3,children:[(0,o.jsx)(a.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(s.gN,(0,r.Z)({name:n,type:"text",placeholder:c,as:a.II,autoComplete:"off"},u?{onChange:u}:null,l?{"data-cy":l}:null)),i?(0,o.jsx)(a.xv,{"data-cy":l?"".concat(l,"-error"):"input-error",sx:{color:"error",mt:1},children:i}):null]})}},68780:function(e,n,t){"use strict";var r=t(62230),o=t(85244),s=t(52322),a=t(37149),c=t.n(a),i=t(25812),l=t(63397),u=t(75289),d=t(56577),m=t(54132);n.Z=function(e){var n=e.children,t=e.close,a=e.isOpen,p=e.formId,f=e.validate,h=e.onSubmit,x=e.widthInPx,y=e.initialValues,v=e.content.title,b=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,_=e.isLoading,Z=void 0!==_&&_,C=e.buttonLabel,S=void 0===C?"Save":C,k=e.dataCy,T=e.actionMessage;return c().setAppElement("#__next"),(0,s.jsx)(i.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:v,style:{content:{width:null!=x?x:"900px"}},children:(0,s.jsx)(l.J9,{validateOnChange:!0,initialValues:y,validate:function(e){return f?f(e):void 0},onSubmit:function(e){h(e)},children:function(e){var a=e.isValid,c=e.isSubmitting,i=e.values,f=e.errors,h=e.touched,x=e.setFieldValue,y=e.setValues;return(0,s.jsx)(l.l0,(0,o.Z)((0,r.Z)({id:p},null!=k?{"data-cy":k}:null),{children:(0,s.jsx)(m.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"}},b),{Header:function(e){var n=e.radius;return(0,s.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,s.jsx)(u.X6,{sx:{fontSize:"20px"},children:v}),(0,s.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,s.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,s.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof T?T(e):T}),(0,s.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,s.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:c||Z,children:"Cancel"}),(0,s.jsx)(d.z,{label:S,form:p,type:"submit",disabled:!a||c||Z,isLoading:c||Z,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:a,isSubmitting:c,values:i,errors:f,touched:h,setFieldValue:x,setValues:y})}))}))}})})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return u},Qj:function(){return h},T9:function(){return m},nf:function(){return f},u2:function(){return d},_T:function(){return p}});var r=t(67557),o=t(62230),s=t(85244),a=t(98240),c=t(52322),i=t(6277),l=t(22715);t(41236);var u=function(e){var n=e.backgroundImage,t=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,c.jsx)("article",(0,s.Z)((0,o.Z)({},l),{className:(0,i.Z)("_18bjhbz0 _1ecs97de7i _1ecs97de7j _1ecs97de7k _1ecs97de7t _1ecs97deqn _1ecs97deqp _1ecs97deqr _1ecs97d39c _1ecs97d3gp _1ecs97de99 _1ecs97deal _1ecs97deaz _1ecs97de87",(0,r.Z)({},"_18bjhbz1 _1ecs97de8f _1ecs97ded9",u)),style:(0,o.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,s.Z)((0,o.Z)({},e),{className:"_1ecs97de7i _1ecs97de7j _1ecs97de7k _1ecs97de7t _1ecs97d6f0 _1ecs97d6md _1ecs97dear _1ecs97deb3 _1ecs97de87"}))},m=function(e){return(0,c.jsx)("div",(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97de7i _1ecs97de7j _1ecs97de7k _1ecs97de7t _1ecs97denu"}))},p=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},f=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},h=function(e){return(0,c.jsx)(l.hE,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97dehj _1ecs97de7q _1ecs97delp",size:"medium",variant:"secondary"}))}},62607:function(e,n,t){"use strict";t.d(n,{_:function(){return F}});var r=t(22710),o=t(99267),s=t(52322),a=t(2784),c=t(22715),i=t(5632),l=t(90374),u=t(88932),d=t(67557),m=t(62230),p=t(85244),f=t(17064);function h(e){return Object.entries(e.json)}var x=t(40147),y=t(78656);function v(){return(v=(0,r.Z)(function(e,n){var t,r;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=y.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=function(e){var n,t=(0,p.Z)((0,m.Z)({},e),{format:"page"}),r=h(e)[0];if(r){var o=(0,f.Z)(r,1)[0];t=function(e,n){if(function(e,n){var t,r,o,s=e.json[n];if(void 0!==s){var a=Object.values(s).find(function(e){return"Slices"===e.type});return null!==(o=null==a?void 0:a.config)&&void 0!==o?o:void 0}}(e,n))return e;var t=function(e,n){var t,r=h(e),o=r.findIndex(function(e){return(0,f.Z)(e,1)[0]===n}),s=r.flatMap(function(e){var n=(0,f.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return"Slices"===t[e].type})}),a=o;do t="slices".concat(0!==a?a.toString():""),a++;while(s.includes(t));return t}(e,n);return(0,p.Z)((0,m.Z)({},e),{json:(0,p.Z)((0,m.Z)({},e.json),(0,d.Z)({},n,(0,p.Z)((0,m.Z)({},e.json[n]),(0,d.Z)({},t,{type:"Slices",fieldset:"Slice Zone"}))))})}(t,o)}return t}(e),[4,x.j.customTypes.updateCustomType({model:r})];case 2:return o.sent(),n(r),u.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return o.sent(),u.Am.error("Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type")),[3,4];case 4:return[2]}})})).apply(this,arguments)}var b=t(67445),g=t(75289),j=t(68780),_=t(70041),Z=t(56580),C=t(49471);function S(){return(S=(0,r.Z)(function(e){var n,t,r,s,a,c,i;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,s=y.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),a=(0,p.Z)((0,m.Z)({},n),{label:t}),[4,x.j.customTypes.renameCustomType({model:a})];case 2:return o.sent(),r(a),u.Am.success("".concat(s.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return c=o.sent(),i="Internal Error: ".concat(s.name({start:!0,plural:!1})," could not be renamed"),console.error(i,c),u.Am.error(i),[3,4];case 4:return[2]}})})).apply(this,arguments)}var k=function(e){var n,t,c,i=e.isChangesLocal,u=e.customType,d=e.format,m=e.onClose,p=null!==(n=null==u?void 0:u.label)&&void 0!==n?n:"",f=null!==(t=null==u?void 0:u.id)&&void 0!==t?t:"",h=(0,l.Z)(),x=h.renameAvailableCustomTypeSuccess,v=h.renameSelectedCustomType,b=(0,a.useState)(!1),k=b[0],T=b[1],I=(c=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(T(!0),!i)return[3,1];return v(e.customTypeName),[3,3];case 1:return[4,function(e){return S.apply(this,arguments)}({model:u,newLabel:e.customTypeName,onSuccess:x})];case 2:n.sent(),n.label=3;case 3:return T(!1),m(),[2]}})}),function(e){return c.apply(this,arguments)}),w=(0,Z.v9)(function(e){return{customTypeLabels:(0,C.YS)(e)}}).customTypeLabels,z=y.$[d];return(0,s.jsx)(j.Z,{isOpen:!0,dataCy:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:m,onSubmit:function(e){I(e)},initialValues:{customTypeName:p},isLoading:k,content:{title:"Rename a ".concat(z.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&&w.includes(n)&&p!==n&&(t.customTypeName="".concat(z.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,s.jsx)(g.xu,{children:(0,s.jsx)(_.W,{name:"customTypeName",label:"".concat(z.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(z.name({start:!1,plural:!1})),error:n.customTypeName,dataCy:"custom-type-name-input"})})}})},T=t(25812),I=t(59326),w=t(54132),z=t(65186),N=t(56577);function L(){return(L=(0,r.Z)(function(e){var n,t,r,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=y.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,x.j.customTypes.deleteCustomType({id:n.id})];case 2:return o.sent(),t(),u.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(a,s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var R=function(e){var n,t=e.customType,c=e.format,i=e.onClose,u=e.onDeleteCustomTypeSuccess,d=y.$[c],m=(0,a.useState)(!1),p=m[0],f=m[1],h=(0,l.Z)().deleteCustomTypeSuccess,x=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return f(!0),[4,function(e){return L.apply(this,arguments)}({customType:t,onSuccess:function(){return h(t.id)}})];case 1:return e.sent(),u(),[2]}})}),function(){return n.apply(this,arguments)}),v=(0,I.B7)().theme;return(0,s.jsx)(T.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return i()},children:(0,s.jsx)(w.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,s.jsxs)(g.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,s.jsxs)(g.kC,{sx:{alignItems:"center"},children:[(0,s.jsx)(z.$vK,{size:20,color:null===(e=v.colors)||void 0===e?void 0:e.greyIcon}),(0,s.jsxs)(g.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,s.jsx)(g.x8,{type:"button",onClick:function(){return i()}})]})},Footer:function(){return(0,s.jsxs)(g.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,s.jsx)(N.z,{label:"Cancel",variant:"secondary",onClick:function(){return i()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,s.jsx)(N.z,{label:"Delete",variant:"danger",isLoading:p,onClick:function(){x()},sx:{minHeight:39,minWidth:78}})]})},children:(0,s.jsxs)("div",{children:["This action will immediately make the following change:",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Delete the"," ",(0,s.jsxs)(g.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,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},F=function(e){var n,t=e.format,u=e.customType,d=e.isChangesLocal,m=(0,i.useRouter)(),p=(0,l.Z)().saveCustomTypeSuccess,f=(0,a.useState)(!1),h=f[0],x=f[1],y=(0,a.useState)(!1),g=y[0],j=y[1],_=(0,a.useState)(!1),Z=_[0],C=_[1],S=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return C(!0),[4,function(e,n){return v.apply(this,arguments)}(u,p)];case 1:return t.sent(),e=b.cd.custom.getBuilderPagePathname(u.id),m.asPath===e&&(n=b.cd.page.getBuilderPagePathname(u.id),m.replace(n)),C(!1),[2]}})}),function(){return n.apply(this,arguments)}),T=function(){var e,n=b.cd[null!==(e=u.format)&&void 0!==e?e:"custom"].tablePagePathname;m.asPath!==n?m.replace(n):x(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(c.h_,{modal:!0,children:[(0,s.jsx)(c.$F,{disabled:Z,children:(0,s.jsx)(c.zx,{loading:Z,startIcon:"moreVert",variant:"secondary","data-testid":"editDropdown"})}),(0,s.jsxs)(c.AW,{align:"end",children:[(0,s.jsx)(c.Xi,{startIcon:(0,s.jsx)(c.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===t&&!d&&(0,s.jsx)(c.Xi,{startIcon:(0,s.jsx)(c.I5,{name:"driveFileMove"}),onSelect:function(){S()},children:"Convert to page type"}),(0,s.jsx)(c.Xi,{color:"tomato",startIcon:(0,s.jsx)(c.I5,{name:"delete"}),onSelect:function(){x(!0)},children:"Remove"})]})]}),h?(0,s.jsx)(R,{format:t,customType:u,onClose:function(){return x(!1)},onDeleteCustomTypeSuccess:T}):null,g?(0,s.jsx)(k,{format:t,customType:u,isChangesLocal:d,onClose:function(){return j(!1)}}):null]})}},41236:function(){}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[550],{56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),s=t(98240),a=t(52322),c=t(2784),i=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,m=e.form,p=e.isLoading,f=void 0!==p&&p,h=e.disabled,x=e.onClick,y=e.sx,b=e.iconSize,v=void 0===b?16:b,g=e.iconFill,j=e.variant,_=void 0===j?"primary":j,Z=(0,s.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(i.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===y?{}:y),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),f?{cursor:"wait !important"}:{}),type:d,form:m,disabled:void 0!==h&&h||f,onClick:f?void 0:x,variant:_},Z),{children:f?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$j,{size:v,color:u(_),"data-cy":l(Z["data-cy"],"spinner")}),c&&t]}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(c,{size:v,fill:g,"data-cy":l(Z["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 s=t(63397),a=t(75289),c=function(e){var n=e.name,t=e.label,c=e.placeholder,i=e.error,l=e.dataCy,u=e.onChange;return(0,o.jsxs)(a.xu,{mb:3,children:[(0,o.jsx)(a.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(s.gN,(0,r.Z)({name:n,type:"text",placeholder:c,as:a.II,autoComplete:"off"},u?{onChange:u}:null,l?{"data-cy":l}:null)),i?(0,o.jsx)(a.xv,{"data-cy":l?"".concat(l,"-error"):"input-error",sx:{color:"error",mt:1},children:i}):null]})}},68780:function(e,n,t){"use strict";var r=t(62230),o=t(85244),s=t(52322),a=t(37149),c=t.n(a),i=t(25812),l=t(63397),u=t(75289),d=t(56577),m=t(54132);n.Z=function(e){var n=e.children,t=e.close,a=e.isOpen,p=e.formId,f=e.validate,h=e.onSubmit,x=e.widthInPx,y=e.initialValues,b=e.content.title,v=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,_=e.isLoading,Z=void 0!==_&&_,C=e.buttonLabel,S=void 0===C?"Save":C,k=e.dataCy,T=e.actionMessage;return c().setAppElement("#__next"),(0,s.jsx)(i.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:b,style:{content:{width:null!=x?x:"900px"}},children:(0,s.jsx)(l.J9,{validateOnChange:!0,initialValues:y,validate:function(e){return f?f(e):void 0},onSubmit:function(e){h(e)},children:function(e){var a=e.isValid,c=e.isSubmitting,i=e.values,f=e.errors,h=e.touched,x=e.setFieldValue,y=e.setValues;return(0,s.jsx)(l.l0,(0,o.Z)((0,r.Z)({id:p},null!=k?{"data-cy":k}:null),{children:(0,s.jsx)(m.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"}},v),{Header:function(e){var n=e.radius;return(0,s.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,s.jsx)(u.X6,{sx:{fontSize:"20px"},children:b}),(0,s.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,s.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,s.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof T?T(e):T}),(0,s.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,s.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:c||Z,children:"Cancel"}),(0,s.jsx)(d.z,{label:S,form:p,type:"submit",disabled:!a||c||Z,isLoading:c||Z,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:a,isSubmitting:c,values:i,errors:f,touched:h,setFieldValue:x,setValues:y})}))}))}})})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return u},Qj:function(){return h},T9:function(){return m},nf:function(){return f},u2:function(){return d},_T:function(){return p}});var r=t(67557),o=t(62230),s=t(85244),a=t(98240),c=t(52322),i=t(6277),l=t(71651);t(41236);var u=function(e){var n=e.backgroundImage,t=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,c.jsx)("article",(0,s.Z)((0,o.Z)({},l),{className:(0,i.Z)("_18bjhbz0 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9uk _1ecs97d9um _1ecs97d9uo _1ecs97d268 _1ecs97d2dl _1ecs97d9d7 _1ecs97d9ej _1ecs97d9ex _1ecs97d9c7",(0,r.Z)({},"_18bjhbz1 _1ecs97d9cf _1ecs97d9h6",u)),style:(0,o.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,s.Z)((0,o.Z)({},e),{className:"_1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d48s _1ecs97d4g5 _1ecs97d9ep _1ecs97d9f1 _1ecs97d9c7"}))},m=function(e){return(0,c.jsx)("div",(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9rr"}))},p=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},f=function(e){return(0,c.jsx)(l.xv,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},h=function(e){return(0,c.jsx)(l.hE,(0,s.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97d9lg _1ecs97d9bq _1ecs97d9pm",size:"medium",variant:"secondary"}))}},62607:function(e,n,t){"use strict";t.d(n,{_:function(){return F}});var r=t(22710),o=t(99267),s=t(52322),a=t(2784),c=t(71651),i=t(5632),l=t(90374),u=t(88932),d=t(67557),m=t(62230),p=t(85244),f=t(17064);function h(e){return Object.entries(e.json)}var x=t(40147),y=t(78656);function b(){return(b=(0,r.Z)(function(e,n){var t,r;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=y.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=function(e){var n,t=(0,p.Z)((0,m.Z)({},e),{format:"page"}),r=h(e)[0];if(r){var o=(0,f.Z)(r,1)[0];t=function(e,n){if(function(e,n){var t,r,o,s=e.json[n];if(void 0!==s){var a=Object.values(s).find(function(e){return"Slices"===e.type});return null!==(o=null==a?void 0:a.config)&&void 0!==o?o:void 0}}(e,n))return e;var t=function(e,n){var t,r=h(e),o=r.findIndex(function(e){return(0,f.Z)(e,1)[0]===n}),s=r.flatMap(function(e){var n=(0,f.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return"Slices"===t[e].type})}),a=o;do t="slices".concat(0!==a?a.toString():""),a++;while(s.includes(t));return t}(e,n);return(0,p.Z)((0,m.Z)({},e),{json:(0,p.Z)((0,m.Z)({},e.json),(0,d.Z)({},n,(0,p.Z)((0,m.Z)({},e.json[n]),(0,d.Z)({},t,{type:"Slices",fieldset:"Slice Zone"}))))})}(t,o)}return t}(e),[4,x.j.customTypes.updateCustomType({model:r})];case 2:return o.sent(),n(r),u.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return o.sent(),u.Am.error("Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type")),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v=t(67445),g=t(75289),j=t(68780),_=t(70041),Z=t(56580),C=t(49471);function S(){return(S=(0,r.Z)(function(e){var n,t,r,s,a,c,i;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,s=y.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),a=(0,p.Z)((0,m.Z)({},n),{label:t}),[4,x.j.customTypes.renameCustomType({model:a})];case 2:return o.sent(),r(a),u.Am.success("".concat(s.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return c=o.sent(),i="Internal Error: ".concat(s.name({start:!0,plural:!1})," could not be renamed"),console.error(i,c),u.Am.error(i),[3,4];case 4:return[2]}})})).apply(this,arguments)}var k=function(e){var n,t,c,i=e.isChangesLocal,u=e.customType,d=e.format,m=e.onClose,p=null!==(n=null==u?void 0:u.label)&&void 0!==n?n:"",f=null!==(t=null==u?void 0:u.id)&&void 0!==t?t:"",h=(0,l.Z)(),x=h.renameAvailableCustomTypeSuccess,b=h.renameSelectedCustomType,v=(0,a.useState)(!1),k=v[0],T=v[1],I=(c=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(T(!0),!i)return[3,1];return b(e.customTypeName),[3,3];case 1:return[4,function(e){return S.apply(this,arguments)}({model:u,newLabel:e.customTypeName,onSuccess:x})];case 2:n.sent(),n.label=3;case 3:return T(!1),m(),[2]}})}),function(e){return c.apply(this,arguments)}),w=(0,Z.v9)(function(e){return{customTypeLabels:(0,C.YS)(e)}}).customTypeLabels,z=y.$[d];return(0,s.jsx)(j.Z,{isOpen:!0,dataCy:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:m,onSubmit:function(e){I(e)},initialValues:{customTypeName:p},isLoading:k,content:{title:"Rename a ".concat(z.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&&w.includes(n)&&p!==n&&(t.customTypeName="".concat(z.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,s.jsx)(g.xu,{children:(0,s.jsx)(_.W,{name:"customTypeName",label:"".concat(z.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(z.name({start:!1,plural:!1})),error:n.customTypeName,dataCy:"custom-type-name-input"})})}})},T=t(25812),I=t(59326),w=t(54132),z=t(65186),N=t(56577);function L(){return(L=(0,r.Z)(function(e){var n,t,r,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=y.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,x.j.customTypes.deleteCustomType({id:n.id})];case 2:return o.sent(),t(),u.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(a,s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var R=function(e){var n,t=e.customType,c=e.format,i=e.onClose,u=e.onDeleteCustomTypeSuccess,d=y.$[c],m=(0,a.useState)(!1),p=m[0],f=m[1],h=(0,l.Z)().deleteCustomTypeSuccess,x=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return f(!0),[4,function(e){return L.apply(this,arguments)}({customType:t,onSuccess:function(){return h(t.id)}})];case 1:return e.sent(),u(),[2]}})}),function(){return n.apply(this,arguments)}),b=(0,I.B7)().theme;return(0,s.jsx)(T.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return i()},children:(0,s.jsx)(w.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,s.jsxs)(g.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,s.jsxs)(g.kC,{sx:{alignItems:"center"},children:[(0,s.jsx)(z.$vK,{size:20,color:null===(e=b.colors)||void 0===e?void 0:e.greyIcon}),(0,s.jsxs)(g.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,s.jsx)(g.x8,{type:"button",onClick:function(){return i()}})]})},Footer:function(){return(0,s.jsxs)(g.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,s.jsx)(N.z,{label:"Cancel",variant:"secondary",onClick:function(){return i()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,s.jsx)(N.z,{label:"Delete",variant:"danger",isLoading:p,onClick:function(){x()},sx:{minHeight:39,minWidth:78}})]})},children:(0,s.jsxs)("div",{children:["This action will immediately make the following change:",(0,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Delete the"," ",(0,s.jsxs)(g.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,s.jsx)("ul",{children:(0,s.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},F=function(e){var n,t=e.format,u=e.customType,d=e.isChangesLocal,m=(0,i.useRouter)(),p=(0,l.Z)().saveCustomTypeSuccess,f=(0,a.useState)(!1),h=f[0],x=f[1],y=(0,a.useState)(!1),g=y[0],j=y[1],_=(0,a.useState)(!1),Z=_[0],C=_[1],S=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return C(!0),[4,function(e,n){return b.apply(this,arguments)}(u,p)];case 1:return t.sent(),e=v.cd.custom.getBuilderPagePathname(u.id),m.asPath===e&&(n=v.cd.page.getBuilderPagePathname(u.id),m.replace(n)),C(!1),[2]}})}),function(){return n.apply(this,arguments)}),T=function(){var e,n=v.cd[null!==(e=u.format)&&void 0!==e?e:"custom"].tablePagePathname;m.asPath!==n?m.replace(n):x(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(c.h_,{modal:!0,children:[(0,s.jsx)(c.$F,{disabled:Z,children:(0,s.jsx)(c.zx,{loading:Z,startIcon:"moreVert",variant:"secondary","data-testid":"editDropdown"})}),(0,s.jsxs)(c.AW,{align:"end",children:[(0,s.jsx)(c.Xi,{startIcon:(0,s.jsx)(c.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===t&&!d&&(0,s.jsx)(c.Xi,{startIcon:(0,s.jsx)(c.I5,{name:"driveFileMove"}),onSelect:function(){S()},children:"Convert to page type"}),(0,s.jsx)(c.Xi,{color:"tomato",startIcon:(0,s.jsx)(c.I5,{name:"delete"}),onSelect:function(){x(!0)},children:"Remove"})]})]}),h?(0,s.jsx)(R,{format:t,customType:u,onClose:function(){return x(!1)},onDeleteCustomTypeSuccess:T}):null,g?(0,s.jsx)(k,{format:t,customType:u,isChangesLocal:d,onClose:function(){return j(!1)}}):null]})}},41236:function(){}}]);