slice-machine-ui 2.20.1 → 2.20.2-alpha.lg-import-slices.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/-rx3Dikh863L90KD25ytx/_buildManifest.js +1 -0
- package/out/_next/static/chunks/130-e1a16d2f94fb2b64.js +1 -0
- package/out/_next/static/chunks/422-10a9f299957417bb.js +1 -0
- package/out/_next/static/chunks/{429-aab52070cad2884b.js → 429-e5d7e39160de9f5e.js} +1 -1
- package/out/_next/static/chunks/489-c9535ef34da63d1a.js +1 -0
- package/out/_next/static/chunks/585-c89bb2471e85b9f8.js +1 -0
- package/out/_next/static/chunks/954-bedaaabf664584a0.js +1 -0
- package/out/_next/static/chunks/pages/{_app-e595114a0455ad49.js → _app-2566e110112a7719.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-6d613b67e6967ae5.js → [customTypeId]-273e9a82c085b596.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-40207b66190e3fcd.js → [pageTypeId]-3fa7667de1a790d9.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-faeb6d2f77d97096.js → simulator-8c70298caf51bed0.js} +1 -1
- package/out/_next/static/chunks/pages/slices-76679cf064761d2b.js +1 -0
- 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/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 +5 -4
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/ImportSlicesFromLibraryModal.tsx +336 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/SliceCard.tsx +48 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/hooks/useImportSlicesFromGithub.ts +91 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/index.tsx +1 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/types.ts +28 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/addSlices.ts +186 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/github.ts +657 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/mapWithConcurrency.ts +28 -0
- package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/sliceWithoutConflicts.ts +51 -0
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +11 -0
- package/src/features/customTypes/customTypesBuilder/shared/getSubmitButtonLabel.ts +12 -0
- package/src/features/customTypes/customTypesBuilder/shared/useExistingSlices.ts +26 -0
- package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +14 -0
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +51 -0
- package/src/pages/slices.tsx +30 -0
- package/out/_next/static/chunks/422-c9192a1dbdd2ae0e.js +0 -1
- package/out/_next/static/chunks/489-32281540712d98bb.js +0 -1
- package/out/_next/static/chunks/633-152bf078e5366a0c.js +0 -1
- package/out/_next/static/chunks/pages/slices-ec56b94b35794675.js +0 -1
- package/out/_next/static/gVA_PuOFwxA0imKtQowfq/_buildManifest.js +0 -1
- /package/out/_next/static/{gVA_PuOFwxA0imKtQowfq → -rx3Dikh863L90KD25ytx}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[954],{74600:function(e,t,n){var i=n(34311),o=n(23779),a=i(function(e,t,n){return e+(n?" ":"")+o(t)});e.exports=a},50421:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentPath=void 0,t.ContentPath={serialize:e=>e.map(e=>e.key).join("::"),current:e=>e[e.length-1],append:(e,t)=>e+"::"+t,make:e=>e.reduce((e,{key:t,type:n})=>t?e.concat({key:t,type:n}):e,[])}},7217:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.migrateDocument=t.collectWidgets=t.traverseDocument=t.fillDocumentWithDefaultValues=t.DocumentLegacy=t.Document=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(50421),p=n(98088),d=n(88866),u=n(82956),s=n(75122);t.Document=l.record(p.WidgetKey,u.WidgetContent);let y=l.record(p.WidgetKey,l.unknown),_=e=>new l.Type("Document",e=>!!e&&"object"==typeof e,t=>(0,r.pipe)(y.decode(t),o.either.map(t=>Object.entries(t).reduce((t,[n,i])=>{let o=(0,s.defaultCtx)(n,e),r=(0,u.WidgetLegacy)(o).decode(i);return!r||(0,a.isLeft)(r)?t:{...t,[n]:r.right}},{}))),t=>Object.entries(t).reduce((t,[n,i])=>{let o=(0,s.defaultCtx)(n,e),a=(0,u.WidgetLegacy)(o).encode(i);return a?{content:{...t.content,[n]:a.content},types:{...t.types,...a.types}}:t},{content:{},types:{}}));function C(e){let{types:t,widgets:n}=Object.entries(e).reduce((e,[t,n])=>{if(t.endsWith("_TYPE")){let i=s.FieldOrSliceType.decode(n);if((0,a.isRight)(i))return{...e,types:e.types.set(t.substring(0,t.length-5),i.right)}}return t.endsWith("_POSITION")||t.endsWith("_TYPE")?e:{...e,widgets:{...e.widgets,[t]:n}}},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[];return{widgets:n,types:t,uid:e.uid,slugs:i}}function T(e){return{customTypeId:null==e?void 0:e.id,fields:Object.fromEntries((0,d.flattenSections)(e))}}function m({document:e,customType:t}){let n=t&&d.StaticCustomType.is(t)?T(t):t;return({transformWidget:t=({content:e})=>e,transformSlice:i=({content:e})=>e})=>{let o=n&&Object.entries(n.fields).reduce((e,[t,n])=>({...e,[t]:n}),{});return Object.entries(e).reduce((e,[a,r])=>{let l=o&&o[a],p=c.ContentPath.make([{key:null==n?void 0:n.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),d=(()=>{switch(r.__TYPE__){case"SliceContentType":return(0,u.traverseSlices)({path:p,key:a,model:(null==l?void 0:l.type)==="Slices"||(null==l?void 0:l.type)==="Choice"?l:void 0,content:r})({transformWidget:t,transformSlice:i});case"GroupContentType":return(0,u.traverseGroupContent)({path:p,key:a,apiId:a,model:(null==l?void 0:l.type)==="Group"?l:void 0,content:r})(t);case"RepeatableContent":return(0,u.traverseRepeatableContent)({path:p,key:a,apiId:a,model:(null==l?void 0:l.type)==="Link"?l:void 0,content:r})(t);case"TableContent":return(0,u.traverseTableContent)({path:p,key:a,apiId:a,model:(null==l?void 0:l.type)==="Table"?l:void 0,content:r})(t);default:return t({path:p,key:a,apiId:a,model:(null==l?void 0:l.type)!=="Group"&&(null==l?void 0:l.type)!=="Slices"&&(null==l?void 0:l.type)!=="Choice"?l:void 0,content:r})}})();return{...e,...d?{[a]:d}:{}}},{})}}function g(e,t){let n=d.StaticCustomType.is(t)?T(t):t;return Object.values((0,d.collectSharedSlices)(n)).some(e=>!!e.legacyPaths)?m({document:e,customType:t})({transformSlice:u.migrateSliceItem}):e}t.DocumentLegacy={_codec:_,extractMetadata:C,parse:function(e,t){let n=(0,r.pipe)(l.record(p.WidgetKey,l.unknown).decode(e),o.either.chain(e=>{let{types:t,widgets:n}=C(e);return _(t).decode(n)}));return(0,a.isLeft)(n)?void 0:g(n.right,t)},encode:function(e){let t=_().encode(e);return{...t.content,...t.types}}},t.fillDocumentWithDefaultValues=function(e,t){let{fields:n}=e&&d.StaticCustomType.is(e)?T(e):e;return Object.entries(n).reduce((e,[n,i])=>{let o=t[n],a=(()=>{switch(i.type){case"Group":return(0,u.isGroupContent)(o)?(0,u.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,u.isSlicesContent)(o)?(0,u.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&d.NestableWidget.is(i)?(0,u.NestableContentDefaultValue)(i):o}})();return a?{...e,[n]:a}:e},t)},t.traverseDocument=m,t.collectWidgets=function(e,t){let n={};return m({document:e})({transformWidget:({content:e,path:i})=>{let o=c.ContentPath.serialize(i);return t(e,i)&&(n[o]=e),e}}),n},t.migrateDocument=g},75122:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultCtx=t.getFieldCtx=t.LegacyContentCtx=t.FieldOrSliceType=void 0;let i=(0,n(22970).__importStar)(n(32521)),o=n(59050);t.FieldOrSliceType=i.union([i.union([o.FieldType,o.SlicesTypes]),i.literal("Repeatable.Link")]);class a{constructor(e,t,n){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=e,this.fieldPath=t||[],this.allTypes=n||new Map;let i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}t.LegacyContentCtx=a,t.getFieldCtx=function(e,t,n){return new a(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)},t.defaultCtx=function(e,t=new Map){return new a(e,[],t)}},54175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(3441);t.EmptyContentType="EmptyContent",t.isEmptyContent=e=>(0,l.hasContentType)(e)&&e.__TYPE__===t.EmptyContentType;let c=r.union([r.null,r.type({value:r.null})]);t.EmptyLegacy=e=>new r.Type("EmptyLegacy",t.isEmptyContent,n=>(0,a.pipe)(c.decode(n),o.either.map(()=>({type:e,__TYPE__:t.EmptyContentType}))),()=>null),t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})},35792:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traverseGroupItemsContent=t.traverseGroupContent=t.groupContentWithDefaultValues=t.GroupLegacy=t.GroupItemLegacy=t.GroupContentDefaultValue=t.isGroupContent=t.GroupContent=t.GroupItemContent=t.GroupContentType=t.GroupItemContentType=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(88866),p=n(75122),d=n(3441),u=n(69732),s=n(29231);t.GroupItemContentType="GroupItemContent",t.GroupContentType="GroupContentType",t.GroupItemContent=l.recursion("GroupItemContent",()=>l.strict({__TYPE__:l.literal(t.GroupItemContentType),value:l.array(l.tuple([l.string,l.union([u.NestableContent,t.GroupContent])]))})),t.GroupContent=l.recursion("GroupContent",()=>l.strict({__TYPE__:l.literal(t.GroupContentType),value:l.array(t.GroupItemContent)})),t.isGroupContent=e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.GroupContentType,t.GroupContentDefaultValue={__TYPE__:t.GroupContentType,value:[]};let y=l.record(l.string,l.unknown);function _({path:e,key:t,apiId:n,model:i,content:o}){return a=>{var r;let l=C({path:e,model:null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.fields,content:o.value})(a);return a({path:e,key:t,apiId:n,model:i,content:{__TYPE__:o.__TYPE__,value:l}})}}function C({path:e,model:n,content:i}){return o=>i.map((i,a)=>{let r=e.concat([{key:a.toString(),type:"GroupItem"}]),l=i.value.reduce((e,[i,a])=>{let l;let c=null==n?void 0:n[i];return(l=(0,t.isGroupContent)(a)?_({path:r.concat([{key:i,type:"Widget"}]),key:i,apiId:i,model:(null==c?void 0:c.type)==="Group"?c:void 0,content:a})(o):(0,u.isRepeatableContent)(a)?(0,u.traverseRepeatableContent)({path:r.concat([{key:i,type:"Widget"}]),key:i,apiId:i,model:(null==c?void 0:c.type)==="Link"?c:void 0,content:a})(o):(0,u.isTableContent)(a)?(0,u.traverseTableContent)({path:r.concat([{key:i,type:"Widget"}]),key:i,apiId:i,model:(null==c?void 0:c.type)==="Table"?c:void 0,content:a})(o):o({path:r.concat([{key:i,type:"Widget"}]),key:i,apiId:i,model:c,content:a}))&&((0,u.isNestableContent)(l)||(0,t.isGroupContent)(l))?e.concat([[i,l]]):e},[]);return{__TYPE__:i.__TYPE__,value:l}})}t.GroupItemLegacy=e=>new l.Type("GroupItemLegacy",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.GroupItemContentType,n=>(0,r.pipe)(y.decode(n),o.either.map(n=>({value:Object.entries(n).reduce((n,[i,o])=>{let r=(0,p.getFieldCtx)(i,e),l=r.fieldType===c.GroupFieldType?(0,t.GroupLegacy)(r).decode(o):(0,u.NestableLegacy)(r).decode(o);return!l||(0,a.isLeft)(l)?n:[...n,[i,l.right]]},[]),__TYPE__:t.GroupItemContentType}))),n=>n.value.reduce((n,[i,o])=>{let a=(0,p.getFieldCtx)(i,e),r=(0,t.isGroupContent)(o)?(0,t.GroupLegacy)(a).encode(o):(0,u.NestableLegacy)(a).encode(o);return r?{content:{...n.content,[i]:r.content},types:{...n.types,...r.types}}:n},{content:{},types:{}})),t.GroupLegacy=e=>{let n=l.array(l.union([l.null,(0,t.GroupItemLegacy)(e)])),i=l.array((0,t.GroupItemLegacy)(e));return new l.Type("GroupLegacy",t.isGroupContent,e=>(0,r.pipe)(n.decode(e),o.either.map(e=>({value:e.map(e=>null===e?{__TYPE__:t.GroupItemContentType,value:[]}:e),__TYPE__:t.GroupContentType}))),t=>{let n=i.encode(t.value);return{content:n.map(e=>e.content),types:n.reduce((e,t)=>({...e,...t.types}),{[e.keyOfType]:c.GroupFieldType})}})},t.groupContentWithDefaultValues=function(e,t){var n;let i=null===(n=e.config)||void 0===n?void 0:n.fields;return i?{...t,value:(0,s.repeatableContentWithDefaultNestableContentValues)(i,t.value)}:t},t.traverseGroupContent=_,t.traverseGroupItemsContent=C},86901:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(3441);t.UIDContentType="UIDContent",t.isUIDContent=e=>(0,l.hasContentType)(e)&&e.__TYPE__===t.UIDContentType,t.UIDLegacy=e=>new r.Type("UIDLegacy",t.isUIDContent,e=>(0,a.pipe)(r.string.decode(e),o.either.map(e=>t.UIDContent.encode({value:e,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[e.keyOfType]:"UID"}})),t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})},18268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetLegacy=t.isWidgetContent=t.WidgetContent=void 0;let i=(0,n(22970).__importStar)(n(32521)),o=n(35792),a=n(69732),r=n(6869),l=n(86901);t.WidgetContent=i.union([o.GroupContent,a.NestableContent,l.UIDContent,r.SlicesContent]),t.isWidgetContent=e=>(0,o.isGroupContent)(e)||(0,a.isNestableContent)(e)||(0,l.isUIDContent)(e)||(0,r.isSlicesContent)(e),t.WidgetLegacy=e=>({decode(t){if(!e.fieldType)return;let n=(()=>{switch(e.fieldType){case"UID":return(0,l.UIDLegacy)(e);case"Group":return(0,o.GroupLegacy)(e);case"Choice":case"Slices":return(0,r.SlicesLegacy)(e);default:return(0,a.NestableLegacy)(e)}})();if(n)return n.decode(t)},encode(t){switch(t.__TYPE__){case l.UIDContentType:return(0,l.UIDLegacy)(e).encode(t);case o.GroupContentType:return(0,o.GroupLegacy)(e).encode(t);case r.SlicesContentType:return(0,r.SlicesLegacy)(e).encode(t);default:return(0,a.NestableLegacy)(e).encode(t)}}})},82956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=n(22970);(0,i.__exportStar)(n(54175),t),(0,i.__exportStar)(n(35792),t),(0,i.__exportStar)(n(69732),t),(0,i.__exportStar)(n(6869),t),(0,i.__exportStar)(n(86901),t),(0,i.__exportStar)(n(18268),t)},58021:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(3441);t.BooleanContentType="BooleanContent",t.isBooleanContent=e=>(0,l.hasContentType)(e)&&e.__TYPE__===t.BooleanContentType,t.BooleanLegacy=e=>new r.Type("BooleanLegacy",t.isBooleanContent,e=>(0,a.pipe)(r.boolean.decode(e),o.either.map(e=>t.BooleanContent.encode({value:e,__TYPE__:t.BooleanContentType}))),t=>({content:t.value,types:{[e.keyOfType]:"Boolean"}})),t.BooleanContent=r.strict({__TYPE__:r.literal(t.BooleanContentType),value:r.boolean}),t.BooleanContentDefaultValue=e=>{var n;return(null===(n=e.config)||void 0===n?void 0:n.default_value)!==void 0?{__TYPE__:t.BooleanContentType,value:e.config.default_value||!1}:void 0}},92611:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(10082),c=n(3441);t.EmbedContentType="EmbedContent",t.isEmbedContent=e=>(0,c.hasContentType)(e)&&e.__TYPE__===t.EmbedContentType,t.EmbedContentLegacy=r.exact(r.intersection([r.type({embed_url:r.string,type:r.string}),r.partial({version:r.union([r.string,r.number,r.null]),title:l.StringOrNull,author_name:l.StringOrNull,author_url:l.StringOrNull,provider_name:l.StringOrNull,provider_url:l.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:l.StringOrNull,thumbnail_width:l.NumberOrNull,thumbnail_height:l.NumberOrNull,html:l.StringOrNull})])),t.EmbedLegacy=e=>new r.Type("EmbedLegacy",t.isEmbedContent,e=>(0,a.pipe)(t.EmbedContentLegacy.decode(e),o.either.map(n=>({...n,all:e,__TYPE__:t.EmbedContentType}))),t=>({content:t.all,types:{[e.keyOfType]:"Embed"}})),t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])},28043:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isColorContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Color"===e.type,t.ColorLegacy=e=>new r.Type("ColorLegacy",t.isColorContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.ColorContent.encode({value:e,type:l.ColorFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.ColorFieldType}})),t.ColorContent=r.strict({type:r.literal(l.ColorFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)})},87029:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isDateContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Date"===e.type,t.DateLegacy=e=>new r.Type("DateLegacy",t.isDateContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.DateContent.encode({value:e,type:l.DateFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.DateFieldType}})),t.DateContent=r.strict({type:r.literal(l.DateFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)})},10473:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isNumberContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Number"===e.type,t.NumberLegacy=e=>new r.Type("NumberLegacy",t.isNumberContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.NumberContent.encode({value:e,type:l.NumberFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.NumberFieldType}})),t.NumberContent=r.strict({type:r.literal(l.NumberFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)})},21576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isRangeContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Range"===e.type,t.RangeLegacy=e=>new r.Type("RangeLegacy",t.isRangeContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.RangeContent.encode({value:e,type:l.RangeFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.RangeFieldType}})),t.RangeContent=r.strict({type:r.literal(l.RangeFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)})},62145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isSelectContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Select"===e.type,t.SelectLegacy=e=>new r.Type("SelectLegacy",t.isSelectContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.SelectContent.encode({value:e,type:l.SelectFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.SelectFieldType}})),t.SelectContent=r.strict({type:r.literal(l.SelectFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)}),t.SelectContentDefaultValue=e=>{var t;return(null===(t=e.config)||void 0===t?void 0:t.default_value)?{__TYPE__:d.FieldContentType,type:l.SelectFieldType,value:e.config.default_value||""}:void 0}},51008:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isTextContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Text"===e.type,t.TextLegacy=e=>new r.Type("TextLegacy",t.isTextContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.TextContent.encode({value:e,type:l.TextFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.TextFieldType}})),t.TextContent=r.strict({type:r.literal(l.TextFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)})},47286:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(59050),c=(0,i.__importDefault)(n(93662)),p=n(3441),d=n(1876);t.isTimestampContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===d.FieldContentType&&(0,p.hasFieldContentType)(e)&&"Timestamp"===e.type,t.TimestampLegacy=e=>new r.Type("TimestampLegacy",t.isTimestampContent,e=>(0,a.pipe)(c.default.decode(e),o.either.map(e=>t.TimestampContent.encode({value:e,type:l.TimestampFieldType,__TYPE__:d.FieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:l.TimestampFieldType}})),t.TimestampContent=r.strict({type:r.literal(l.TimestampFieldType),value:c.default,__TYPE__:r.literal(d.FieldContentType)})},1876:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContentType=void 0,t.FieldContentType="FieldContent"},51711:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let i=n(22970),o=(0,i.__importStar)(n(32521)),a=n(28043),r=n(87029),l=n(10473),c=n(21576),p=n(62145),d=n(51008),u=n(47286);t.FieldType=o.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=o.union([r.DateContent,a.ColorContent,l.NumberContent,c.RangeContent,p.SelectContent,d.TextContent,u.TimestampContent]),(0,i.__exportStar)(n(28043),t),(0,i.__exportStar)(n(1876),t),(0,i.__exportStar)(n(87029),t),(0,i.__exportStar)(n(10473),t),(0,i.__exportStar)(n(21576),t),(0,i.__exportStar)(n(62145),t),(0,i.__exportStar)(n(51008),t),(0,i.__exportStar)(n(47286),t)},95110:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let i=n(22970),o=n(76160),a=n(3735),r=(0,i.__importStar)(n(32521)),l=n(3441);t.GeoPointContentType="GeoPointContent",t.isGeoPointContent=e=>(0,l.hasContentType)(e)&&e.__TYPE__===t.GeoPointContentType;let c=r.strict({position:r.strict({lat:r.number,lng:r.number})});t.GeoPointLegacy=e=>new r.Type("GeoPointLegacy",t.isGeoPointContent,e=>(0,a.pipe)(c.decode(e),o.either.map(e=>t.GeoPointContent.encode({...e,__TYPE__:t.GeoPointContentType}))),t=>({content:{position:t.position},types:{[e.keyOfType]:"GeoPoint"}})),t.GeoPointContent=r.intersection([c,r.strict({__TYPE__:r.literal(t.GeoPointContentType)})])},19729:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(46898),c=n(10082),p=n(3441);t.ImageContentType="ImageContent",t.isImageContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===t.ImageContentType;let d=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:d,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:c.NonEmptyStringOrNull,alt:c.NonEmptyStringOrNull,provider:c.StringOrNull})]));let u=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]);t.ImageLegacy=e=>new r.Type("ImageLegacy",t.isImageContent,e=>(0,a.pipe)(u.decode(e),o.either.map(e=>t.ImageContent.encode({...e,__TYPE__:t.ImageContentType}))),t=>({content:(0,l.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[e.keyOfType]:"Image"}})),t.ImageContent=r.intersection([u,r.strict({__TYPE__:r.literal(t.ImageContentType)})])},14506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(3441);t.IntegrationFieldContentType="IntegrationFieldsContent",t.isIntegrationFieldContent=e=>(0,l.hasContentType)(e)&&e.__TYPE__===t.IntegrationFieldContentType,t.IntegrationFieldLegacy=e=>new r.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,e=>(0,a.pipe)(r.string.decode(e),o.either.map(e=>t.IntegrationFieldContent.encode({value:e,__TYPE__:t.IntegrationFieldContentType}))),t=>({content:t.value,types:{[e.keyOfType]:"IntegrationFields"}})),t.IntegrationFieldContent=r.strict({__TYPE__:r.literal(t.IntegrationFieldContentType),value:r.string})},70451:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FilledLinkContent=t.FilledLink=t.FilledLinkContentLegacy=t.FilledLinkLegacy=t.isFilledLinkContent=t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.AnyLinkContent=t.AnyLinkType=t.ExternalLinkContent=t.FilledExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.FilledDocumentLinkContent=t.DocumentLinkType=t.MediaLinkContent=t.MediaLinkType=t.FileLinkContent=t.FilledFileLinkContent=t.FileLinkType=t.ImageLinkContent=t.FilledImageLinkContent=t.ImageLinkType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(7862),c=n(10082),p=n(61365),d=n(3441);t.ImageLinkType="ImageLink";let u=e=>"string"==typeof e,s=new r.Type("ImageLinkKind",e=>u(e),(e,t)=>u(e)?r.success("image"):r.failure(e,t),()=>"image"),y=r.intersection([r.strict({kind:s,id:r.string,url:r.string,height:r.string,width:r.string,size:r.string,name:r.string}),r.exact(r.partial({date:c.StringOrNull}))]),_=new r.Type("FilledImageLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.ImageLinkType,e=>(0,a.pipe)(y.decode(e),o.either.map(e=>t.FilledImageLinkContent.encode({...e,__TYPE__:t.ImageLinkType}))),e=>y.encode(e));t.FilledImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),y]);let C=r.intersection([r.union([y,r.strict({kind:r.literal("image")})]),r.exact(r.partial({text:r.string,variant:r.string}))]),T=new r.Type("ImageLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.ImageLinkType,e=>(0,a.pipe)(C.decode(e),o.either.map(e=>t.ImageLinkContent.encode({...e,__TYPE__:t.ImageLinkType}))),e=>C.encode(e));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),C]),t.FileLinkType="FileLink";let m=e=>"string"==typeof e,g=new r.Type("FileLinkKind",e=>m(e),(e,t)=>m(e)?r.success("file"):r.failure(e,t),()=>"file"),S=r.exact(r.intersection([r.type({kind:g,id:r.string,url:r.string,name:r.string,size:(0,l.withFallback)(r.string,"0")}),r.partial({date:c.StringOrNull})])),v=new r.Type("FilledFileLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.FileLinkType,e=>(0,a.pipe)(S.decode(e),o.either.map(e=>t.FilledFileLinkContent.encode({...e,__TYPE__:t.FileLinkType}))),e=>S.encode(e));t.FilledFileLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.FileLinkType)}),S]);let L=r.intersection([r.union([S,r.strict({kind:r.literal("file")})]),r.exact(r.partial({text:r.string,variant:r.string}))]),f=new r.Type("FileLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.FileLinkType,e=>(0,a.pipe)(L.decode(e),o.either.map(e=>t.FileLinkContent.encode({...e,__TYPE__:t.FileLinkType}))),e=>L.encode(e));t.FileLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.FileLinkType)}),L]),t.MediaLinkType="MediaLink";let h=r.intersection([r.strict({kind:r.literal("media")}),r.exact(r.partial({text:r.string,variant:r.string}))]),b=new r.Type("MediaLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.MediaLinkType,e=>(0,a.pipe)(h.decode(e),o.either.map(e=>t.MediaLinkContent.encode({...e,__TYPE__:t.MediaLinkType}))),e=>h.encode(e));t.MediaLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.MediaLinkType)}),h]),t.DocumentLinkType="DocumentLink";let k=r.strict({id:c.NonEmptyString}),P=new r.Type("FilledDocumentLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.DocumentLinkType,e=>(0,a.pipe)(k.decode(e),o.either.map(e=>t.FilledDocumentLinkContent.encode({...e,__TYPE__:t.DocumentLinkType}))),e=>k.encode(e));t.FilledDocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),k]);let E=r.intersection([r.union([k,r.strict({kind:r.literal("document")})]),r.exact(r.partial({text:r.string,variant:r.string}))]),x=new r.Type("DocumentLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.DocumentLinkType,e=>(0,a.pipe)(E.decode(e),o.either.map(e=>t.DocumentLinkContent.encode({...e,__TYPE__:t.DocumentLinkType}))),e=>E.encode(e));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),E]),t.ExternalLinkType="ExternalLink";let I=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:c.StringOrNull,preview:(0,p.nullable)(r.partial({title:r.string}))})])),F=new r.Type("FilledExternalLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.ExternalLinkType,e=>(0,a.pipe)(I.decode(e),o.either.map(e=>t.FilledExternalLinkContent.encode({...e,__TYPE__:t.ExternalLinkType}))),e=>I.encode(e));t.FilledExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),I]);let w=r.intersection([r.union([I,r.strict({kind:r.literal("web")})]),r.exact(r.partial({text:r.string,variant:r.string}))]),Y=new r.Type("ExternalLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.ExternalLinkType,e=>(0,a.pipe)(w.decode(e),o.either.map(e=>t.ExternalLinkContent.encode({...e,__TYPE__:t.ExternalLinkType}))),e=>w.encode(e));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),w]),t.AnyLinkType="AnyLink";let D=r.exact(r.intersection([r.type({kind:(0,l.withFallback)(r.literal("any"),"any")}),r.partial({text:r.string,variant:r.string})])),N=new r.Type("AnyLink",e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.AnyLinkType,e=>(0,a.pipe)(D.decode(e),o.either.map(e=>t.AnyLinkContent.encode({...e,__TYPE__:t.AnyLinkType}))),e=>D.encode(e));t.AnyLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.AnyLinkType)}),D]),t.LinkContentType="LinkContent",t.isLinkContent=e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.LinkContentType,t.LinkLegacy=(0,d.withKey)(r.union([T,f,x,Y,b,N])),t.LinkContentLegacy=e=>new r.Type("LinkLegacy",t.isLinkContent,e=>(0,a.pipe)(t.LinkLegacy.decode(e),o.either.map(({key:e,...n})=>t.LinkContent.encode({__TYPE__:"LinkContent",key:e,value:n}))),({key:n,value:i})=>({content:t.LinkLegacy.encode({...i,key:n}),types:{[e.keyOfType]:"Link"}})),t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent,t.MediaLinkContent,t.AnyLinkContent]),t.LinkContent=(0,d.withKey)(r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})),t.isFilledLinkContent=e=>(0,d.hasContentType)(e)&&e.__TYPE__===t.LinkContentType,t.FilledLinkLegacy=r.union([_,v,P,F]),t.FilledLinkContentLegacy=e=>{let n=(0,d.withKey)(t.FilledLinkLegacy);return new r.Type("FilledLinkLegacy",t.isFilledLinkContent,e=>(0,a.pipe)(n.decode(e),o.either.map(({key:e,...n})=>t.FilledLinkContent.encode({__TYPE__:"LinkContent",key:e,value:n}))),({key:t,value:i})=>({content:n.encode({...i,key:t}),types:{[e.keyOfType]:"Link"}}))},t.FilledLink=r.union([t.FilledImageLinkContent,t.FilledFileLinkContent,t.FilledDocumentLinkContent,t.FilledExternalLinkContent]),t.FilledLinkContent=(0,d.withKey)(r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.FilledLink}))},60882:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NestableLegacy=t.isNestableContent=t.NestableContentDefaultValue=t.NestableContent=void 0;let i=n(22970),o=n(45974),a=(0,i.__importStar)(n(32521)),r=n(54175),l=n(58021),c=n(92611),p=n(51711),d=n(1876),u=n(95110),s=n(19729),y=n(14506),_=n(70451),C=n(97798),T=n(13656),m=n(9746),g=n(43940);t.NestableContent=a.union([r.EmptyContent,l.BooleanContent,c.EmbedContent,p.TextContent,p.TimestampContent,p.SelectContent,p.RangeContent,p.NumberContent,p.DateContent,p.ColorContent,u.GeoPointContent,s.ImageContent,y.IntegrationFieldContent,_.LinkContent,T.RichTextContent,m.SeparatorContent,g.TableContent,C.RepeatableContent]),t.NestableContentDefaultValue=e=>{switch(e.type){case"Boolean":return(0,l.BooleanContentDefaultValue)(e);case"Select":return(0,p.SelectContentDefaultValue)(e);default:return}},t.isNestableContent=e=>(0,p.isTextContent)(e)||(0,p.isColorContent)(e)||(0,p.isDateContent)(e)||(0,p.isTimestampContent)(e)||(0,p.isNumberContent)(e)||(0,p.isRangeContent)(e)||(0,p.isSelectContent)(e)||(0,u.isGeoPointContent)(e)||(0,T.isRichTextContent)(e)||(0,l.isBooleanContent)(e)||(0,c.isEmbedContent)(e)||(0,s.isImageContent)(e)||(0,y.isIntegrationFieldContent)(e)||(0,_.isLinkContent)(e)||(0,m.isSeparatorContent)(e)||(0,g.isTableContent)(e)||(0,r.isEmptyContent)(e)||(0,C.isRepeatableContent)(e),t.NestableLegacy=e=>({decode(t){if(!e.fieldType)return;let n=(0,r.EmptyLegacy)(e.fieldType).decode(t);if((0,o.isRight)(n))return n;let i=(()=>{switch(e.fieldType){case"Text":return(0,p.TextLegacy)(e);case"Color":return(0,p.ColorLegacy)(e);case"Date":return(0,p.DateLegacy)(e);case"Timestamp":return(0,p.TimestampLegacy)(e);case"Number":return(0,p.NumberLegacy)(e);case"Range":return(0,p.RangeLegacy)(e);case"Select":return(0,p.SelectLegacy)(e);case"GeoPoint":return(0,u.GeoPointLegacy)(e);case"StructuredText":return(0,T.RichTextLegacy)(e);case"Boolean":return(0,l.BooleanLegacy)(e);case"Embed":return(0,c.EmbedLegacy)(e);case"Image":return(0,s.ImageLegacy)(e);case"IntegrationFields":return(0,y.IntegrationFieldLegacy)(e);case"Link":return(0,_.LinkContentLegacy)(e);case"Separator":return(0,m.SeparatorLegacy)(e);case"Table":return(0,g.TableLegacy)(e);case"Repeatable.Link":return(0,C.RepeatableLegacy)(e,"Link");default:return}})();if(i)return i.decode(t)},encode(t){switch(t.__TYPE__){case d.FieldContentType:if("Text"===t.type)return(0,p.TextLegacy)(e).encode(t);if("Color"===t.type)return(0,p.ColorLegacy)(e).encode(t);if("Range"===t.type)return(0,p.RangeLegacy)(e).encode(t);if("Date"===t.type)return(0,p.DateLegacy)(e).encode(t);if("Number"===t.type)return(0,p.NumberLegacy)(e).encode(t);if("Timestamp"===t.type)return(0,p.TimestampLegacy)(e).encode(t);if("Select"===t.type)return(0,p.SelectLegacy)(e).encode(t);return;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(e).encode(t);case T.RichTextContentType:return(0,T.RichTextLegacy)(e).encode(t);case c.EmbedContentType:return(0,c.EmbedLegacy)(e).encode(t);case l.BooleanContentType:return(0,l.BooleanLegacy)(e).encode(t);case s.ImageContentType:return(0,s.ImageLegacy)(e).encode(t);case y.IntegrationFieldContentType:return(0,y.IntegrationFieldLegacy)(e).encode(t);case _.LinkContentType:return(0,_.LinkContentLegacy)(e).encode(t);case m.SeparatorContentType:return(0,m.SeparatorLegacy)(e).encode(t);case g.TableContentType:return(0,g.TableLegacy)(e).encode(t);case"RepeatableContent":return(0,C.RepeatableLegacy)(e,t.type).encode(t);default:return}}})},97798:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traverseRepeatableContent=t.RepeatableLegacy=t.isRepeatableContent=t.RepeatableContent=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(3441),p=n(70451),d="RepeatableContent";t.RepeatableContent=l.strict({__TYPE__:l.literal(d),type:l.literal("Link"),value:l.array(p.LinkContent)}),t.isRepeatableContent=e=>(0,c.hasContentType)(e)&&e.__TYPE__===d,t.RepeatableLegacy=(e,n)=>new l.Type("RepeatableLegacy",t.isRepeatableContent,t=>(0,r.pipe)(l.array(l.unknown).decode(t),o.either.map(t=>({value:t.reduce((t,i)=>{let o;return"Link"===n&&(o=(0,p.LinkContentLegacy)(e).decode(i)),!o||(0,a.isLeft)(o)?t:[...t,o.right]},[]),type:n,__TYPE__:"RepeatableContent"}))),t=>({content:l.array(p.LinkContent).encode(t.value).reduce((t,n)=>{let i;return n.__TYPE__===p.LinkContentType&&(i=(0,p.LinkContentLegacy)(e).encode(n)),i?[...t,i]:t},[]).map(e=>e.content),types:{[e.keyOfType]:`Repeatable.${n}`}})),t.traverseRepeatableContent=function({path:e,key:t,apiId:n,model:i,content:o}){return a=>{let r=o.value.reduce((o,r,l)=>{let c=a({path:e.concat([{key:l.toString(),type:"Widget"}]),key:t,apiId:n,model:(null==i?void 0:i.type)==="Link"&&i.config?{...i,config:{...i.config,repeat:!1}}:i,content:r});return c&&(0,p.isLinkContent)(c)?o.concat(c):o},[]);return a({path:e,key:t,apiId:n,model:i,content:{__TYPE__:o.__TYPE__,type:o.type,value:r}})}}},76994:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedSpans=t.SpanLegacy=t.Span=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(7862),p=n(8199),d=n(10082),u=n(61365),s=n(92611),y=n(19729),_=n(70451),C=e=>l.strict({data:e,start:l.number,end:l.number,type:l.literal(p.RichTextNodeType.hyperlink)}),T=l.strict({data:(0,c.withFallback)(l.string,""),start:l.number,end:l.number,type:l.literal("label")}),m=l.strict({start:l.number,end:l.number,type:l.keyof({[p.RichTextNodeType.strong]:null,[p.RichTextNodeType.em]:null,"list-item":null})});t.Span=l.union([C(_.FilledLink),T,m]),t.SpanLegacy=l.union([C(_.FilledLinkLegacy),T,m]),t.ValidatedSpans=e=>new l.Type("ValidatedSpans",t=>Array.isArray(t)&&t.every(e.is),(t,n)=>{if(!Array.isArray(t))return l.failure(t,n);{let n=t.reduce((t,n)=>{let i=e.decode(n);return(0,a.isLeft)(i)?t:[...t,i.right]},[]).sort((e,t)=>e.start-t.start);return l.success(n)}},t=>t.reduce((t,n)=>[...t,e.encode(n)],[]));let g=e=>l.exact(l.intersection([l.type({type:l.literal(p.RichTextNodeType.image),data:l.intersection([y.ImageContentView,l.partial({linkTo:(0,u.nullable)(e)})])}),l.partial({label:d.StringOrNull,direction:d.StringOrNull})]));t.ImageBlock=g(_.FilledLink);let S=g(_.FilledLinkLegacy);t.checkImageBlock=function(e){return e.type===p.RichTextNodeType.image};let v=l.exact(l.intersection([l.type({type:l.literal(p.RichTextNodeType.embed),data:l.unknown}),l.partial({label:d.StringOrNull,direction:d.StringOrNull})])),L=new l.Type("EmbedBlockLegacy",e=>"embed"===e.type,e=>(0,r.pipe)(v.decode(e),o.either.chain(e=>o.either.map(t=>[e,t])(s.EmbedContentLegacy.decode(e.data))),o.either.map(([e,n])=>t.EmbedBlock.encode({...e,data:{...n,__TYPE__:s.EmbedContentType,all:e.data}}))),e=>({...v.encode(e),data:s.EmbedContentLegacy.encode(e.data)}));t.EmbedBlock=l.exact(l.intersection([l.type({type:l.literal(p.RichTextNodeType.embed),data:s.EmbedContent}),l.partial({label:d.StringOrNull,direction:d.StringOrNull})])),t.checkEmbedBlock=function(e){return e.type===p.RichTextNodeType.embed};let f=e=>l.exact(l.intersection([l.type({type:(0,u.refineType)(p.RichTextNodeTypeCodec,`string which isn't ${p.RichTextNodeType.image} ${p.RichTextNodeType.embed}`,e=>e!==p.RichTextNodeType.image&&e!==p.RichTextNodeType.embed),content:l.intersection([l.type({text:l.string}),l.partial({spans:(0,t.ValidatedSpans)(e)})])}),l.partial({label:l.string,direction:l.string})]));t.TextBlock=f(t.Span),t.TextBlockLegacy=f(t.SpanLegacy);let h=l.union([L,S,t.TextBlockLegacy]);t.BlockLegacy=new l.Type("BlockLegacy",e=>L.is(e)||S.is(e)||t.TextBlockLegacy.is(e),e=>h.decode(e),e=>t.ImageBlock.is(e)?S.encode(e):t.EmbedBlock.is(e)?L.encode(e):t.TextBlockLegacy.encode(e)),t.Block=l.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])},13656:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.RichTextLegacyContent=t.isRichTextContent=t.RichTextContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(3441),c=n(76994);t.RichTextContentType="StructuredTextContent",t.isRichTextContent=e=>(0,l.hasContentType)(e)&&e.__TYPE__===t.RichTextContentType,t.RichTextLegacyContent=r.array(c.BlockLegacy),t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(c.Block)}),(0,i.__exportStar)(n(76994),t),t.RichTextLegacy=e=>new r.Type("RichTextLegacy",t.isRichTextContent,e=>(0,a.pipe)(t.RichTextLegacyContent.decode(e),o.either.map(e=>({value:e,__TYPE__:t.RichTextContentType}))),n=>({content:t.RichTextLegacyContent.encode(n.value),types:{[e.keyOfType]:"StructuredText"}}))},9746:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let i=(0,n(22970).__importStar)(n(32521)),o=n(3441);t.SeparatorContentType="SeparatorContent",t.isSeparatorContent=e=>(0,o.hasContentType)(e)&&e.__TYPE__===t.SeparatorContentType,t.SeparatorLegacy=e=>new i.Type("SeparatorLegacy",t.isSeparatorContent,()=>i.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[e.keyOfType]:"Separator"}})),t.SeparatorContent=i.strict({__TYPE__:i.literal(t.SeparatorContentType)})},43940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traverseTableContent=t.TableLegacy=t.TableContent=t.isTableContent=t.TableContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(88866),c=n(3441),p=n(13656);t.TableContentType="TableContent",t.isTableContent=e=>(0,c.hasContentType)(e)&&e.__TYPE__===t.TableContentType;let d=(0,c.withKey)(r.intersection([r.strict({type:r.union([r.literal("tableHeader"),r.literal("tableCell")]),content:p.RichTextContent}),r.exact(r.partial({columnWidth:r.number}))])),u=(0,c.withKey)(r.strict({type:r.literal("tableRow"),content:r.array(d)}));t.TableContent=r.strict({__TYPE__:r.literal(t.TableContentType),content:r.array(u)});let s=(0,c.withKey)(r.intersection([r.strict({type:r.union([r.literal("tableHeader"),r.literal("tableCell")]),content:p.RichTextLegacyContent}),r.exact(r.partial({columnWidth:r.number}))])),y=(0,c.withKey)(r.strict({type:r.literal("tableRow"),content:r.array(s)})),_=r.strict({content:r.array(y)});t.TableLegacy=e=>new r.Type("TableLegacy",t.isTableContent,e=>(0,a.pipe)(_.decode(e),o.either.map(e=>({__TYPE__:"TableContent",content:e.content.map(e=>({...e,content:e.content.map(e=>({...e,content:{__TYPE__:"StructuredTextContent",value:e.content}}))}))}))),t=>({content:_.encode({content:t.content.map(e=>({...e,content:e.content.map(e=>({...e,content:e.content.value}))}))}),types:{[e.keyOfType]:"Table"}})),t.traverseTableContent=function({path:e,key:t,apiId:n,model:i,content:o}){return a=>{let r=o.content.map((i,o)=>({...i,content:i.content.map((i,r)=>{let c=a({path:e.concat([{key:[o.toString(),r.toString()].join(","),type:"Widget"}]),key:t,apiId:n,model:l.TableCell,content:{__TYPE__:i.content.__TYPE__,value:i.content.value}})||{__TYPE__:"StructuredTextContent",value:[]};return{...i,content:c}})}));return a({path:e,key:t,apiId:n,model:i,content:{__TYPE__:o.__TYPE__,content:r}})}}},69732:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=n(22970);(0,i.__exportStar)(n(58021),t),(0,i.__exportStar)(n(92611),t),(0,i.__exportStar)(n(51711),t),(0,i.__exportStar)(n(95110),t),(0,i.__exportStar)(n(19729),t),(0,i.__exportStar)(n(14506),t),(0,i.__exportStar)(n(70451),t),(0,i.__exportStar)(n(60882),t),(0,i.__exportStar)(n(97798),t),(0,i.__exportStar)(n(13656),t),(0,i.__exportStar)(n(9746),t),(0,i.__exportStar)(n(43940),t)},77517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.migrateCompositeSlice=t.traverseCompositeSliceContent=t.compositeSliceContentWithDefaultValues=t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(75122),p=n(3441),d=n(35792),u=n(69732),s=n(29231),y=n(96279);t.CompositeSliceContentType="CompositeSliceContent",t.isCompositeSliceContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===t.CompositeSliceContentType;let _=l.exact(l.partial({repeat:l.array(l.unknown),"non-repeat":l.UnknownRecord}));t.CompositeSliceLegacy=e=>new l.Type("CompositeSliceLegacy",t.isCompositeSliceContent,n=>(0,r.pipe)(_.decode(n),o.either.map(n=>{let i=(()=>{let t=(0,c.getFieldCtx)("repeat",e),i=(0,y.RepeatableWidgetsLegacy)(t).decode(n.repeat);if(!(!i||(0,a.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(n["non-repeat"]||{}).reduce((t,[n,i])=>{let o=(0,c.getFieldCtx)(n,e,["non-repeat"]);if(!o)return t;let r=(0,u.NestableLegacy)(o).decode(i);return!r||(0,a.isLeft)(r)?t:{...t,[n]:r.right}},{}),repeat:i,__TYPE__:t.CompositeSliceContentType}})),t=>{let n=Object.entries(t.nonRepeat).reduce((t,[n,i])=>{let o=(0,c.getFieldCtx)(n,e,["non-repeat"]),a=(0,u.NestableLegacy)(o).encode(i);return a?{content:{...t.content,[n]:a.content},types:{...t.types,...a.types}}:t},{content:{},types:{}}),i=(()=>{let n=(0,c.getFieldCtx)("repeat",e);return(0,y.RepeatableWidgetsLegacy)(n).encode(t.repeat)})()||[];return{content:{"non-repeat":n.content,repeat:i.map(e=>e.content)},types:{[e.keyOfType]:"Slice",...n.types,...i.reduce((e,t)=>({...e,...t.types}),{})}}}),t.CompositeSliceContent=l.strict({__TYPE__:l.literal(t.CompositeSliceContentType),nonRepeat:l.record(l.string,u.NestableContent),repeat:y.RepeatableWidgets}),t.compositeSliceContentWithDefaultValues=function(e,t){var n,i;let o=(0,s.withDefaultNestableContentValues)(null!==(n=e["non-repeat"])&&void 0!==n?n:{},t.nonRepeat),a=(0,s.repeatableContentWithDefaultNestableContentValues)(null!==(i=e.repeat)&&void 0!==i?i:{},t.repeat);return{...t,nonRepeat:o,repeat:a}},t.traverseCompositeSliceContent=function({path:e,sliceKey:t,sliceName:n,model:i,content:o}){return(a,r)=>{let l=Object.entries(o.widget.nonRepeat).reduce((o,[r,l])=>{var c,p,d;let s=(null==i?void 0:i.type)==="SharedSlice"?null===(p=null===(c=null==i?void 0:i.fields)||void 0===c?void 0:c.primary)||void 0===p?void 0:p[r]:null===(d=null==i?void 0:i["non-repeat"])||void 0===d?void 0:d[r],y=a({path:e.concat([{key:"non-repeat",type:"primary"},{key:r,type:"Widget"}]),key:r,apiId:n,model:s,content:l});return y?(0,u.isNestableContent)(y)?{...o,[r]:y}:(console.warn(`Warn: Non nestable content with key [${r}] detected in a composite slice [${n}] with key [${t}]`),o):o},{}),c=(0,d.traverseGroupItemsContent)({path:e.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:o.widget.repeat})(a);return r({key:t,apiId:n,path:e,model:i,content:{...o,widget:{__TYPE__:"CompositeSliceContent",repeat:c,nonRepeat:l}}})}},t.migrateCompositeSlice=function(e,t){let[,n]=t.key.split("$");return{key:`${e.sliceName}$${n}`,name:e.sliceName,maybeLabel:t.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:e.variationId,primary:Object.entries(t.widget.nonRepeat).reduce((n,[i,o])=>{var a;return(null===(a=e.fields.primary)||void 0===a?void 0:a[i])?{...n,[i]:o}:(console.warn(`The widget ${i} in the non-repeat zone of the composite slice [${e.sliceName}] with key [${t.key}] doesn't exist in the model.`),n)},{}),items:t.widget.repeat.map(n=>({__TYPE__:"GroupItemContent",value:n.value.reduce((n,[i,o])=>{var a;return(null===(a=e.fields.items)||void 0===a?void 0:a[i])?n.concat([[i,o]]):(console.warn(`The widget ${i} in the repeat zone of the composite slice [${e.sliceName}] with key [${t.key}] doesn't exist in the model.`),n)},[])}),[])}}}},96279:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RepeatableWidgets=t.RepeatableWidgetsLegacy=void 0;let i=(0,n(22970).__importStar)(n(32521)),o=n(35792),a=n(69732);t.RepeatableWidgetsLegacy=e=>i.array((0,o.GroupItemLegacy)(e));let r=i.tuple([i.string,i.union([a.NestableContent,o.GroupContent])]),l=i.strict({__TYPE__:i.literal(o.GroupItemContentType),value:i.array(r)});t.RepeatableWidgets=i.array(l)},90848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSharedSliceContent=t.sharedSliceContentWithDefaultValues=t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(7862),p=n(88866),d=n(75122),u=n(3441),s=n(35792),y=n(69732),_=n(29231),C=n(96279),T=n(95305);t.SharedSliceContentType="SharedSliceContent",t.isSharedSliceContent=e=>(0,u.hasContentType)(e)&&e.__TYPE__===t.SharedSliceContentType;let m=l.exact(l.type({variation:l.string,items:(0,c.withFallback)(l.array(l.unknown),[]),primary:(0,c.withFallback)(l.UnknownRecord,{})}));t.SharedSliceLegacy=e=>new l.Type("SharedSliceLegacy",t.isSharedSliceContent,n=>(0,r.pipe)(m.decode(n),o.either.map(n=>{let i=(()=>{let t=(0,d.getFieldCtx)("items",e,["variations",n.variation]),i=(0,C.RepeatableWidgetsLegacy)(t).decode(n.items);if(!(!i||(0,a.isLeft)(i)))return i.right})()||[],o=Object.entries(n.primary).reduce((t,[i,o])=>{let r=(0,d.getFieldCtx)(i,e,["variations",n.variation,"primary"]),l=(0,T.SlicePrimaryLegacy)(r).decode(o);return!l||(0,a.isLeft)(l)?t:{...t,[i]:l.right}},{});return{variation:n.variation,primary:o,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let n=Object.entries(t.primary).reduce((n,[i,o])=>{let a=(0,d.getFieldCtx)(i,e,["variations",t.variation,"primary"]),r=(0,T.SlicePrimaryLegacy)(a).encode(o);return r?{content:{...n.content,[i]:r.content},types:{...n.types,...r.types}}:n},{content:{},types:{}}),i=(()=>{let n=(0,d.getFieldCtx)("items",e,["variations",t.variation]);return(0,C.RepeatableWidgetsLegacy)(n).encode(t.items)})()||[];return{content:{primary:n.content,items:i.map(e=>e.content),variation:t.variation},types:{[e.keyOfType]:"SharedSlice",...n.types,...i.reduce((e,t)=>({...e,...t.types}),{})}}}),t.SharedSliceContent=l.strict({__TYPE__:l.literal(t.SharedSliceContentType),variation:l.string,primary:l.record(l.string,T.SlicePrimaryContent),items:C.RepeatableWidgets}),t.sharedSliceContentWithDefaultValues=function(e,t){var n,i;let o=e.variations.find(e=>e.id===t.variation),a=null!==(n=null==o?void 0:o.primary)&&void 0!==n?n:{},r=null!==(i=null==o?void 0:o.items)&&void 0!==i?i:{},l=(0,_.withDefaultSlicePrimaryContentValues)(a,t.primary),c=(0,_.repeatableContentWithDefaultNestableContentValues)(r,t.items);return{...t,primary:l,items:c}},t.traverseSharedSliceContent=function({path:e,sliceKey:t,sliceName:n,model:i,content:o}){return(a,r)=>{let l=Object.entries(o.widget.primary).reduce((o,[r,l])=>{var c,d;let u=null===(d=null===(c=null==i?void 0:i.fields)||void 0===c?void 0:c.primary)||void 0===d?void 0:d[r],_=(0,s.isGroupContent)(l)?(0,s.traverseGroupContent)({path:e.concat([{key:"primary",type:"primary"},{key:r,type:"Widget"}]),key:r,apiId:r,content:l,model:(null==u?void 0:u.type)===p.GroupFieldType?u:void 0})(a):(0,y.isRepeatableContent)(l)?(0,y.traverseRepeatableContent)({path:e.concat([{key:"primary",type:"primary"},{key:r,type:"Widget"}]),key:r,apiId:r,content:l,model:(null==u?void 0:u.type)==="Link"?u:void 0})(a):(0,y.isTableContent)(l)?(0,y.traverseTableContent)({path:e.concat([{key:"primary",type:"primary"},{key:r,type:"Widget"}]),key:r,apiId:r,content:l,model:(null==u?void 0:u.type)==="Table"?u:void 0})(a):(0,y.isNestableContent)(l)?a({path:e.concat([{key:"primary",type:"primary"},{key:r,type:"Widget"}]),key:r,apiId:r,model:u,content:l}):void 0;return _?((0,T.isSlicePrimaryContent)(_)||console.warn(`Warn: Non nestable or group content with key [${r}] detected in a shared slice [${n}] with key [${t}]`),{...o,[r]:_}):o},{}),c=(0,s.traverseGroupItemsContent)({path:e.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:o.widget.items})(a);return r({key:t,apiId:n,path:e,model:i,content:{...o,widget:{__TYPE__:"SharedSliceContent",variation:o.widget.variation,primary:l,items:c}}})}}},56710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.migrateSimpleSlice=t.traverseSimpleSliceContent=t.SimpleSliceLegacy=t.isSimpleSliceContent=t.SimpleSliceContent=void 0;let i=(0,n(22970).__importStar)(n(32521)),o=n(35792),a=n(69732);t.SimpleSliceContent=i.union([a.NestableContent,o.GroupContent]),t.isSimpleSliceContent=e=>(0,a.isNestableContent)(e)||(0,o.isGroupContent)(e),t.SimpleSliceLegacy=e=>({decode:"Group"===e.fieldType?(0,o.GroupLegacy)(e).decode.bind(null):(0,a.NestableLegacy)(e).decode.bind(null),encode:t=>"GroupContentType"===t.__TYPE__?(0,o.GroupLegacy)(e).encode(t):(0,a.NestableLegacy)(e).encode(t)}),t.traverseSimpleSliceContent=function({path:e,sliceKey:t,sliceName:n,model:i,content:a}){return(r,l)=>{var c;if((0,o.isGroupContent)(a.widget)){let t=(0,o.traverseGroupContent)({path:e,key:a.key,apiId:a.name,model:(null==i?void 0:i.type)==="Group"?i:(null==i?void 0:i.type)==="SharedSlice"?{type:"Group",config:{fields:i.fields.items||{}}}:void 0,content:a.widget})(r);return t&&l({key:a.key,apiId:a.name,path:e,model:i,content:{...a,widget:t}})}let p=r({key:a.key,apiId:a.name,path:e,model:(null==i?void 0:i.type)==="SharedSlice"?null===(c=i.fields.primary)||void 0===c?void 0:c[a.name]:(null==i?void 0:i.type)!=="Group"?i:void 0,content:a.widget});return p&&l({key:t,apiId:n,path:e,model:i,content:{...a,widget:p}})}},t.migrateSimpleSlice=function(e,t){var n;let[,i]=t.key.split("$"),o=`${e.sliceName}$${i}`;return"GroupContentType"===t.widget.__TYPE__?{key:o,name:e.sliceName,maybeLabel:t.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:e.variationId,primary:{},items:t.widget.value.map(t=>({__TYPE__:"GroupItemContent",value:t.value.reduce((t,[n,i])=>{var o;return(null===(o=e.fields.items)||void 0===o?void 0:o[n])?t.concat([[n,i]]):t},[])}),[])}}:{key:o,name:e.sliceName,maybeLabel:t.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:e.variationId,primary:(null===(n=e.fields.primary)||void 0===n?void 0:n[t.name])?{[t.name]:t.widget}:{},items:[]}}}},95305:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSlicePrimaryContent=t.SlicePrimaryLegacy=t.SlicePrimaryContent=void 0;let i=(0,n(22970).__importStar)(n(32521)),o=n(88866),a=n(35792),r=n(69732);t.SlicePrimaryContent=i.union([r.NestableContent,a.GroupContent]),t.SlicePrimaryLegacy=e=>{let t=(0,a.GroupLegacy)(e),n=(0,r.NestableLegacy)(e);return{decode:i=>e.fieldType===o.GroupFieldType?t.decode(i):n.decode(i),encode:e=>(0,a.isGroupContent)(e)?t.encode(e):n.encode(e)}},t.isSlicePrimaryContent=e=>(0,r.isNestableContent)(e)||(0,a.isGroupContent)(e)},71771:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let i=n(22970),o=(0,i.__importStar)(n(32521)),a=n(77517),r=n(90848),l=n(56710);t.SliceLegacy=e=>({decode:t=>(()=>{switch(e.fieldType){case"Slice":return(0,a.CompositeSliceLegacy)(e);case"SharedSlice":return(0,r.SharedSliceLegacy)(e);default:return(0,l.SimpleSliceLegacy)(e)}})().decode(t),encode:t=>{switch(t.__TYPE__){case"SharedSliceContent":return(0,r.SharedSliceLegacy)(e).encode(t);case"CompositeSliceContent":return(0,a.CompositeSliceLegacy)(e).encode(t);default:return(0,l.SimpleSliceLegacy)(e).encode(t)}}}),t.SliceContent=o.union([a.CompositeSliceContent,r.SharedSliceContent,l.SimpleSliceContent]),(0,i.__exportStar)(n(77517),t),(0,i.__exportStar)(n(90848),t),(0,i.__exportStar)(n(56710),t),(0,i.__exportStar)(n(95305),t)},66219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.migrateSliceItem=t.SlicesItemLegacy=t.sliceItemContentWithDefaultValues=t.isSimpleSliceItemContent=t.isCompositeSliceItemContent=t.isSharedSliceItemContent=t.SliceItemContent=void 0;let i=n(22970),o=n(76160),a=n(45974),r=n(30902),l=(0,i.__importStar)(n(32521)),c=n(61365),p=n(75122),d=n(35792),u=n(69732),s=n(29231),y=n(71771),_=n(77517),C=n(90848),T=n(56710);function m(e){return(0,_.isCompositeSliceContent)(e.widget)}function g(e){return(0,d.isGroupContent)(e.widget)||(0,u.isNestableContent)(e.widget)}t.SliceItemContent=l.type({key:l.string,name:l.string,maybeLabel:l.union([l.string,l.undefined]),widget:y.SliceContent}),t.isSharedSliceItemContent=function(e){return(0,C.isSharedSliceContent)(e.widget)},t.isCompositeSliceItemContent=m,t.isSimpleSliceItemContent=g,t.sliceItemContentWithDefaultValues=function(e,t){var n;if("SharedSlice"===e.type&&(0,C.isSharedSliceContent)(t))return(0,y.sharedSliceContentWithDefaultValues)(e,t);if("Slice"===e.type&&(0,_.isCompositeSliceContent)(t))return(0,y.compositeSliceContentWithDefaultValues)(e,t);if("Group"===e.type&&(0,d.isGroupContent)(t)&&(null===(n=e.config)||void 0===n?void 0:n.fields)){let n=(0,s.repeatableContentWithDefaultNestableContentValues)(e.config.fields,t.value);return{...t,value:n}}return t};let S=l.exact(l.intersection([l.type({key:l.string,value:l.unknown}),l.partial({label:(0,c.nullable)(l.string)})]));t.SlicesItemLegacy=e=>new l.Type("SlicesItemLegacy",e=>((0,C.isSharedSliceContent)(e.widget),(0,_.isCompositeSliceContent)(e.widget),(0,T.isSimpleSliceContent)(e.widget)),(t,n)=>(0,r.pipe)(S.decode(t),o.either.chain(i=>{var o;let r=i.key.indexOf("$"),c=i.key.substring(0,r>0?r:void 0),d=(0,p.getFieldCtx)(c,e),u=(0,y.SliceLegacy)(d).decode(i.value);return!u||(0,a.isLeft)(u)?l.failure(t,n):l.success({key:i.key,name:c,maybeLabel:null!==(o=i.label)&&void 0!==o?o:void 0,widget:u.right})})),t=>{let n=(0,p.getFieldCtx)(t.name,e),i=(0,y.SliceLegacy)(n).encode(t.widget);return{content:{key:t.key,label:t.maybeLabel,value:(null==i?void 0:i.content)||{}},types:(null==i?void 0:i.types)||{}}}),t.migrateSliceItem=({model:e,content:t})=>m(t)&&(null==e?void 0:e.type)==="SharedSlice"?(0,_.migrateCompositeSlice)(e,t):g(t)&&(null==e?void 0:e.type)==="SharedSlice"?(0,T.migrateSimpleSlice)(e,t):t},84186:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSlices=t.slicesContentWithDefaultValues=t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let i=n(22970),o=n(76160),a=n(30902),r=(0,i.__importStar)(n(32521)),l=n(50421),c=n(88866),p=n(3441),d=n(77517),u=n(90848),s=n(56710),y=n(66219);t.SlicesContentType="SliceContentType",t.isSlicesContent=e=>(0,p.hasContentType)(e)&&e.__TYPE__===t.SlicesContentType,t.SlicesLegacy=e=>{let n=r.array((0,y.SlicesItemLegacy)(e));return new r.Type("SlicesLegacy",t.isSlicesContent,e=>(0,a.pipe)(n.decode(e),o.either.map(e=>({__TYPE__:t.SlicesContentType,value:e}))),t=>{let i=n.encode(t.value);return{content:i.map(e=>e.content),types:i.reduce((e,t)=>({...e,...t.types}),{[e.keyOfType]:"Slices"})}})},t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(y.SliceItemContent)}),t.slicesContentWithDefaultValues=function(e,t){var n;let i=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.choices;if(void 0===i)return t;let o=t.value.map(e=>{let t=i[e.name];if(t){let n=(0,y.sliceItemContentWithDefaultValues)(t,e.widget);return{...e,widget:n}}return e});return{...t,value:o}},t.traverseSlices=function({path:e,key:t,model:n,content:i}){return({transformWidget:o=({content:e})=>e,transformSlice:a=({content:e})=>e})=>{let r=i.value.reduce((t,i)=>{let r=n&&function(e,t,n){var i,o;let a=null===(o=null===(i=null==t?void 0:t.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[n.name];return(()=>{if((0,y.isSharedSliceItemContent)(n)&&a&&(0,c.isStaticSharedSlice)(a)){let e=a.variations.find(e=>e.id===n.widget.variation);return e?{type:"SharedSlice",sliceName:a.id,variationId:e.id,fields:{primary:e.primary||{},items:e.items||{}}}:void 0}})()||(()=>{var i;let o=l.ContentPath.append(l.ContentPath.serialize(e),n.name),a=Object.values((null===(i=null==t?void 0:t.config)||void 0===i?void 0:i.choices)||{}).find(e=>{var t;return!!(0,c.isStaticSharedSlice)(e)&&!!(null===(t=e.legacyPaths)||void 0===t?void 0:t[o])});if(!a)return;let r=null==a?void 0:a.variations.find(e=>{var t;return e.id===(null===(t=a.legacyPaths)||void 0===t?void 0:t[o])});if(r)return{type:"SharedSlice",sliceName:a.id,variationId:r.id,fields:{primary:r.primary||{},items:r.items||{}}}})()||(()=>{if(a){if((0,c.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,c.isLegacySlice)(a))return a}})()}(e,n,i),p=(0,y.isSharedSliceItemContent)(i)?(0,u.traverseSharedSliceContent)({path:e.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==r?void 0:r.type)==="SharedSlice"?r:void 0,content:i})(o,a):(0,y.isCompositeSliceItemContent)(i)?(0,d.traverseCompositeSliceContent)({path:e.concat({key:i.key,type:"Slice"}),sliceKey:i.key,sliceName:i.name,model:(null==r?void 0:r.type)==="Slice"||(null==r?void 0:r.type)==="SharedSlice"?r:void 0,content:i})(o,a):(0,y.isSimpleSliceItemContent)(i)?(0,s.traverseSimpleSliceContent)({path:e.concat({key:i.key,type:"LegacySlice"}),sliceKey:i.key,sliceName:i.name,model:r&&(null==r?void 0:r.type)!=="Slice"?r:void 0,content:i})(o,a):void 0;return p?t.concat(p):t},[]);return o({path:e,key:t,apiId:t,model:n,content:{__TYPE__:i.__TYPE__,value:r}})}}},6869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=n(22970);(0,i.__exportStar)(n(71771),t),(0,i.__exportStar)(n(66219),t),(0,i.__exportStar)(n(84186),t)},29231:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatableContentWithDefaultNestableContentValues=t.withDefaultNestableContentValues=t.withDefaultSlicePrimaryContentValues=void 0;let i=n(88866),o=n(35792),a=n(69732);t.withDefaultSlicePrimaryContentValues=function(e,t){for(let[n,r]of Object.entries(e)){let e=t[n];if(void 0===e){if(r.type===i.GroupFieldType)t[n]=(0,o.groupContentWithDefaultValues)(r,o.GroupContentDefaultValue);else{let e=(0,a.NestableContentDefaultValue)(r);e&&(t[n]=e)}continue}r.type===i.GroupFieldType&&(0,o.isGroupContent)(e)&&(t[n]=(0,o.groupContentWithDefaultValues)(r,e))}return t},t.withDefaultNestableContentValues=function(e,t){return Object.entries(e).reduce((e,[n,i])=>{if(void 0===t[n]){let t=(0,a.NestableContentDefaultValue)(i);return void 0!==t?{...e,[n]:t}:e}return e},t)},t.repeatableContentWithDefaultNestableContentValues=function(e,t){let n=Object.entries(e);return t.map(e=>n.reduce((t,[n,i])=>{var r;let l=e.value.find(([e])=>e===n);if("Group"===i.type){let e=(0,o.groupContentWithDefaultValues)(i,null!==(r=null==l?void 0:l[1])&&void 0!==r?r:{__TYPE__:o.GroupContentType,value:[]});return{...t,value:[...t.value.filter(([e])=>e!==n),...e?[[n,e]]:[]]}}if(!l){let e=(0,a.NestableContentDefaultValue)(i);return{...t,value:[...t.value,...e?[[n,e]]:[]]}}return t},e))}},74686:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=n(22970);(0,i.__exportStar)(n(7217),t),(0,i.__exportStar)(n(82956),t),(0,i.__exportStar)(n(75122),t)},3441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withKey=t.hasContentType=t.hasFieldContentType=void 0;let i=n(22970),o=n(45974),a=(0,i.__importStar)(n(32521)),r=n(60130),l=n(82956);function c(e){return"object"==typeof e&&null!==e&&"__TYPE__"in e}t.hasFieldContentType=function(e){return c(e)&&e.__TYPE__===l.FieldContentType&&(null==e?void 0:e.type)!==void 0&&"string"==typeof e.type&&(0,o.isRight)(l.FieldType.decode(e.type))},t.hasContentType=c;let p=e=>"string"==typeof e&&(0,r.validate)(e),d=new a.Type("UUID",p,(e,t)=>void 0===e?a.success((0,r.v4)()):p(e)?a.success(e):a.failure(e,t),a.identity);t.withKey=function(e){return a.intersection([a.strict({key:d}),e])}},93662:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=n(22970),o=n(83296),a=n(3735),r=(0,i.__importStar)(n(32521));t.default=new r.Type("TrimmedString",r.string.is,(e,t)=>(0,a.pipe)(r.string.validate(e,t),(0,o.chain)(e=>r.success(function(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}(e)))),e=>e)}}]);
|