slice-machine-ui 2.19.2-alpha.lg-import-slices.1 → 2.19.2-alpha.xru-unskip-e2e-test-redirection.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 (46) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/UxC5PuGC_LR5N5R6FFDo6/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/422-c9192a1dbdd2ae0e.js +1 -0
  4. package/out/_next/static/chunks/{429-e5d7e39160de9f5e.js → 429-aab52070cad2884b.js} +1 -1
  5. package/out/_next/static/chunks/489-ce3053e1d81ade83.js +1 -0
  6. package/out/_next/static/chunks/907-180eb33eefccc237.js +1 -0
  7. package/out/_next/static/chunks/pages/{_app-a8345a65a46d8112.js → _app-0e4d39dfdf8ae39a.js} +1 -1
  8. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-97120b65616617fb.js → [customTypeId]-af9376721beb489e.js} +1 -1
  9. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-b358358b5c2c1c43.js → [pageTypeId]-a24665e91b882169.js} +1 -1
  10. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-8c70298caf51bed0.js → simulator-faeb6d2f77d97096.js} +1 -1
  11. package/out/_next/static/chunks/pages/slices-81c1c3f1bcad60f4.js +1 -0
  12. package/out/changelog.html +1 -1
  13. package/out/changes.html +1 -1
  14. package/out/custom-types/[customTypeId].html +1 -1
  15. package/out/custom-types.html +1 -1
  16. package/out/index.html +1 -1
  17. package/out/labs.html +1 -1
  18. package/out/page-types/[pageTypeId].html +1 -1
  19. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  20. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  21. package/out/slices.html +1 -1
  22. package/package.json +3 -3
  23. package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/CreateSliceFromImageModal.tsx +36 -3
  24. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +0 -11
  25. package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +0 -14
  26. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +0 -51
  27. package/src/pages/slices.tsx +0 -30
  28. package/out/_next/static/Q_2lm2CqEzK8hMGWeR30R/_buildManifest.js +0 -1
  29. package/out/_next/static/chunks/130-e1a16d2f94fb2b64.js +0 -1
  30. package/out/_next/static/chunks/489-d6580011169630a1.js +0 -1
  31. package/out/_next/static/chunks/585-c89bb2471e85b9f8.js +0 -1
  32. package/out/_next/static/chunks/928-ebbe58b08e1e70b1.js +0 -1
  33. package/out/_next/static/chunks/954-bedaaabf664584a0.js +0 -1
  34. package/out/_next/static/chunks/pages/slices-d5a2b0fcb7490565.js +0 -1
  35. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/ImportSlicesFromLibraryModal.tsx +0 -291
  36. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/SliceCard.tsx +0 -48
  37. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/hooks/useImportSlicesFromGithub.ts +0 -93
  38. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/index.tsx +0 -1
  39. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/types.ts +0 -28
  40. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/addSlices.ts +0 -193
  41. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/github.ts +0 -630
  42. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/mapWithConcurrency.ts +0 -28
  43. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/sliceWithoutConflicts.ts +0 -51
  44. package/src/features/customTypes/customTypesBuilder/shared/getSubmitButtonLabel.ts +0 -12
  45. package/src/features/customTypes/customTypesBuilder/shared/useExistingSlices.ts +0 -26
  46. /package/out/_next/static/{Q_2lm2CqEzK8hMGWeR30R → UxC5PuGC_LR5N5R6FFDo6}/_ssgManifest.js +0 -0
@@ -15,7 +15,6 @@ import { BaseStyles, Flex, Link, Text } from "theme-ui";
15
15
 
16
16
  import { BreadcrumbItem } from "@/components/Breadcrumb";
17
17
  import { CreateSliceFromImageModal } from "@/features/customTypes/customTypesBuilder/CreateSliceFromImageModal";
18
- import { ImportSlicesFromLibraryModal } from "@/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal";
19
18
  import { getSliceCreationOptions } from "@/features/customTypes/customTypesBuilder/sliceCreationOptions";
20
19
  import { SharedSliceCard } from "@/features/slices/sliceCards/SharedSliceCard";
21
20
  import { SLICES_CONFIG } from "@/features/slices/slicesConfig";
@@ -65,10 +64,6 @@ const SlicesIndex: React.FunctionComponent = () => {
65
64
  const [isRenameSliceModalOpen, setIsRenameSliceModalOpen] = useState(false);
66
65
  const [isCreateSliceFromImageModalOpen, setIsCreateSliceFromImageModalOpen] =
67
66
  useState(false);
68
- const [
69
- isImportSlicesFromLibraryModalOpen,
70
- setIsImportSlicesFromLibraryModalOpen,
71
- ] = useState(false);
72
67
 
73
68
  const localLibraries: LibraryUI[] = libraries.filter(
74
69
  (library) => library.isLocal,
@@ -150,17 +145,6 @@ const SlicesIndex: React.FunctionComponent = () => {
150
145
  >
151
146
  {sliceCreationOptions.fromScratch.title}
152
147
  </DropdownMenuItem>
153
- <DropdownMenuItem
154
- renderStartIcon={() =>
155
- sliceCreationOptions.importFromExternal.BackgroundIcon
156
- }
157
- onSelect={() => setIsImportSlicesFromLibraryModalOpen(true)}
158
- description={
159
- sliceCreationOptions.importFromExternal.description
160
- }
161
- >
162
- {sliceCreationOptions.importFromExternal.title}
163
- </DropdownMenuItem>
164
148
  </DropdownMenuContent>
165
149
  </DropdownMenu>
166
150
  ) : undefined}
@@ -353,20 +337,6 @@ const SlicesIndex: React.FunctionComponent = () => {
353
337
  }}
354
338
  onClose={closeCreateSliceFromImageModal}
355
339
  />
356
- <ImportSlicesFromLibraryModal
357
- open={isImportSlicesFromLibraryModalOpen}
358
- location="slices"
359
- onSuccess={({ library }: { library: string }) => {
360
- toast.success(
361
- <ToastMessageWithPath
362
- message="Slice(s) added to slice zone and created at: "
363
- path={library}
364
- />,
365
- );
366
- setIsImportSlicesFromLibraryModalOpen(false);
367
- }}
368
- onClose={() => setIsImportSlicesFromLibraryModalOpen(false)}
369
- />
370
340
  </AppLayoutContent>
371
341
  </AppLayout>
372
342
  </>
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,n,u,d,f,h,k,j,l,p,g,o,r,m,_,y,I,N){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,e,o,r,"static/chunks/pages/index-0d8cb369de720a35.js"],"/_error":["static/chunks/pages/_error-fedd2c6ebd3d27b9.js"],"/changelog":[c,t,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-8514e0696e90a1b2.js"],"/changes":[c,i,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-fa4f2563cb5fd014.js",a,u,"static/css/d98ebc475f8423a3.css","static/chunks/pages/changes-8af4acbb8f974cb2.js"],"/custom-types":[s,e,o,r,"static/chunks/pages/custom-types-5acd56959b60346f.js"],"/custom-types/[customTypeId]":[c,d,f,h,k,s,t,b,n,j,l,m,a,e,p,g,_,y,"static/chunks/pages/custom-types/[customTypeId]-97120b65616617fb.js"],"/labs":["static/chunks/pages/labs-56fd818a63553497.js"],"/page-types/[pageTypeId]":[c,d,f,h,k,s,t,b,n,j,l,m,a,e,p,g,_,y,"static/chunks/pages/page-types/[pageTypeId]-b358358b5c2c1c43.js"],"/slices":[c,i,I,s,b,n,l,N,a,g,u,"static/css/efa5152b7c0f35c0.css","static/chunks/pages/slices-d5a2b0fcb7490565.js"],"/slices/[lib]/[sliceName]/[variation]":[c,i,d,f,h,k,I,s,t,b,j,N,"static/chunks/484-3e011e79c41f0342.js",a,p,u,"static/css/e8e03c0d4003d1eb.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-e973a443d8b8a75d.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[i,"static/chunks/72585f70-28b4d7d5384b3703.js",n,"static/chunks/429-e5d7e39160de9f5e.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-8c70298caf51bed0.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/397-e6c340070a3bcb41.js","static/chunks/59b4e022-ef680789f7cc9b11.js","static/chunks/34-28725deef8b874b1.js","static/chunks/647-aa094286bc248d52.js","static/chunks/183-4ea255b867ff171b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/344-fdb3008f4bb3b0c1.js","static/chunks/130-e1a16d2f94fb2b64.js","static/chunks/658-8231c0b729e0124a.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/256-07f768a2b19b0a0e.js","static/chunks/954-bedaaabf664584a0.js","static/chunks/630-2bf927bca082a191.js","static/chunks/928-ebbe58b08e1e70b1.js","static/chunks/248-84a5987f0499b074.js","static/css/4e475d945cf8a890.css","static/chunks/585-c89bb2471e85b9f8.js","static/chunks/489-d6580011169630a1.js","static/css/56f2a6684a524374.css","static/chunks/52d4c156-89c6ec6efca0a0bb.js","static/chunks/500-d3989390f5e8da53.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[130],{60130:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return a.default}});var r=s(n(27343)),u=s(n(46076)),l=s(n(85854)),o=s(n(95899)),f=s(n(15384)),a=s(n(25791)),d=s(n(77888)),i=s(n(49926)),c=s(n(9964));function s(e){return e&&e.__esModule?e:{default:e}}},2763:function(e,t){function n(e){return(e+64>>>9<<4)+14+1}function r(e,t){let n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function u(e,t,n,u,l,o){var f;return r((f=r(r(t,e),r(u,o)))<<l|f>>>32-l,n)}function l(e,t,n,r,l,o,f){return u(t&n|~t&r,e,t,l,o,f)}function o(e,t,n,r,l,o,f){return u(t&r|n&~r,e,t,l,o,f)}function f(e,t,n,r,l,o,f){return u(t^n^r,e,t,l,o,f)}function a(e,t,n,r,l,o,f){return u(n^(t|~r),e,t,l,o,f)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e){if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){let t=[],n=32*e.length,r="0123456789abcdef";for(let u=0;u<n;u+=8){let n=e[u>>5]>>>u%32&255,l=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(l)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let u=1732584193,d=-271733879,i=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){let n=u,s=d,p=i,y=c;u=l(u,d,i,c,e[t],7,-680876936),c=l(c,u,d,i,e[t+1],12,-389564586),i=l(i,c,u,d,e[t+2],17,606105819),d=l(d,i,c,u,e[t+3],22,-1044525330),u=l(u,d,i,c,e[t+4],7,-176418897),c=l(c,u,d,i,e[t+5],12,1200080426),i=l(i,c,u,d,e[t+6],17,-1473231341),d=l(d,i,c,u,e[t+7],22,-45705983),u=l(u,d,i,c,e[t+8],7,1770035416),c=l(c,u,d,i,e[t+9],12,-1958414417),i=l(i,c,u,d,e[t+10],17,-42063),d=l(d,i,c,u,e[t+11],22,-1990404162),u=l(u,d,i,c,e[t+12],7,1804603682),c=l(c,u,d,i,e[t+13],12,-40341101),i=l(i,c,u,d,e[t+14],17,-1502002290),d=l(d,i,c,u,e[t+15],22,1236535329),u=o(u,d,i,c,e[t+1],5,-165796510),c=o(c,u,d,i,e[t+6],9,-1069501632),i=o(i,c,u,d,e[t+11],14,643717713),d=o(d,i,c,u,e[t],20,-373897302),u=o(u,d,i,c,e[t+5],5,-701558691),c=o(c,u,d,i,e[t+10],9,38016083),i=o(i,c,u,d,e[t+15],14,-660478335),d=o(d,i,c,u,e[t+4],20,-405537848),u=o(u,d,i,c,e[t+9],5,568446438),c=o(c,u,d,i,e[t+14],9,-1019803690),i=o(i,c,u,d,e[t+3],14,-187363961),d=o(d,i,c,u,e[t+8],20,1163531501),u=o(u,d,i,c,e[t+13],5,-1444681467),c=o(c,u,d,i,e[t+2],9,-51403784),i=o(i,c,u,d,e[t+7],14,1735328473),d=o(d,i,c,u,e[t+12],20,-1926607734),u=f(u,d,i,c,e[t+5],4,-378558),c=f(c,u,d,i,e[t+8],11,-2022574463),i=f(i,c,u,d,e[t+11],16,1839030562),d=f(d,i,c,u,e[t+14],23,-35309556),u=f(u,d,i,c,e[t+1],4,-1530992060),c=f(c,u,d,i,e[t+4],11,1272893353),i=f(i,c,u,d,e[t+7],16,-155497632),d=f(d,i,c,u,e[t+10],23,-1094730640),u=f(u,d,i,c,e[t+13],4,681279174),c=f(c,u,d,i,e[t],11,-358537222),i=f(i,c,u,d,e[t+3],16,-722521979),d=f(d,i,c,u,e[t+6],23,76029189),u=f(u,d,i,c,e[t+9],4,-640364487),c=f(c,u,d,i,e[t+12],11,-421815835),i=f(i,c,u,d,e[t+15],16,530742520),d=f(d,i,c,u,e[t+2],23,-995338651),u=a(u,d,i,c,e[t],6,-198630844),c=a(c,u,d,i,e[t+7],10,1126891415),i=a(i,c,u,d,e[t+14],15,-1416354905),d=a(d,i,c,u,e[t+5],21,-57434055),u=a(u,d,i,c,e[t+12],6,1700485571),c=a(c,u,d,i,e[t+3],10,-1894986606),i=a(i,c,u,d,e[t+10],15,-1051523),d=a(d,i,c,u,e[t+1],21,-2054922799),u=a(u,d,i,c,e[t+8],6,1873313359),c=a(c,u,d,i,e[t+15],10,-30611744),i=a(i,c,u,d,e[t+6],15,-1560198380),d=a(d,i,c,u,e[t+13],21,1309151649),u=a(u,d,i,c,e[t+4],6,-145523070),c=a(c,u,d,i,e[t+11],10,-1120210379),i=a(i,c,u,d,e[t+2],15,718787259),d=a(d,i,c,u,e[t+9],21,-343485551),u=r(u,n),d=r(d,s),i=r(i,p),c=r(c,y)}return[u,d,i,c]}(function(e){if(0===e.length)return[];let t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},74267:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;let n="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);t.default={randomUUID:n}},15384:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},9964:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(77888))&&r.__esModule?r:{default:r};t.default=function(e){let t;if(!(0,u.default)(e))throw TypeError("Invalid UUID");let n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},76678:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},41874:function(e,t){let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};let r=new Uint8Array(16)},13254:function(e,t){function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let u=Math.ceil((e.length/4+2)/16),l=Array(u);for(let t=0;t<u;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];l[t]=n}l[u-1][14]=(e.length-1)*8/4294967296,l[u-1][14]=Math.floor(l[u-1][14]),l[u-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<u;++e){let u=new Uint32Array(80);for(let t=0;t<16;++t)u[t]=l[e][t];for(let e=16;e<80;++e)u[e]=n(u[e-3]^u[e-8]^u[e-14]^u[e-16],1);let o=r[0],f=r[1],a=r[2],d=r[3],i=r[4];for(let e=0;e<80;++e){let r=Math.floor(e/20),l=n(o,5)+function(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}(r,f,a,d)+i+t[r]+u[e]>>>0;i=d,d=a,a=n(f,30)>>>0,f=o,o=l}r[0]=r[0]+o>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+d>>>0,r[4]=r[4]+i>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}},49926:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=o;var r,u=(r=n(77888))&&r.__esModule?r:{default:r};let l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));function o(e,t=0){return(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase()}t.default=function(e,t=0){let n=o(e,t);if(!(0,u.default)(n))throw TypeError("Stringified UUID is invalid");return n}},27343:function(e,t,n){let r,u;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,o=(l=n(41874))&&l.__esModule?l:{default:l},f=n(49926);let a=0,d=0;t.default=function(e,t,n){let l=t&&n||0,i=t||Array(16),c=(e=e||{}).node||r,s=void 0!==e.clockseq?e.clockseq:u;if(null==c||null==s){let t=e.random||(e.rng||o.default)();null==c&&(c=r=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=u=(t[6]<<8|t[7])&16383)}let p=void 0!==e.msecs?e.msecs:Date.now(),y=void 0!==e.nsecs?e.nsecs:d+1,v=p-a+(y-d)/1e4;if(v<0&&void 0===e.clockseq&&(s=s+1&16383),(v<0||p>a)&&void 0===e.nsecs&&(y=0),y>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,d=y,u=s;let _=((268435455&(p+=122192928e5))*1e4+y)%4294967296;i[l++]=_>>>24&255,i[l++]=_>>>16&255,i[l++]=_>>>8&255,i[l++]=255&_;let b=p/4294967296*1e4&268435455;i[l++]=b>>>8&255,i[l++]=255&b,i[l++]=b>>>24&15|16,i[l++]=b>>>16&255,i[l++]=s>>>8|128,i[l++]=255&s;for(let e=0;e<6;++e)i[l+e]=c[e];return t||(0,f.unsafeStringify)(i)}},46076:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(18679)),u=l(n(2763));function l(e){return e&&e.__esModule?e:{default:e}}let o=(0,r.default)("v3",48,u.default);t.default=o},18679:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,o,f){var a;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,l.default)(r)),(null===(a=r)||void 0===a?void 0:a.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+e.length);if(d.set(r),d.set(e,r.length),(d=n(d))[6]=15&d[6]|t,d[8]=63&d[8]|128,o){f=f||0;for(let e=0;e<16;++e)o[f+e]=d[e];return o}return(0,u.unsafeStringify)(d)}try{r.name=e}catch(e){}return r.DNS=o,r.URL=f,r};var r,u=n(49926),l=(r=n(9964))&&r.__esModule?r:{default:r};let o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=o;let f="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=f},85854:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(74267)),u=o(n(41874)),l=n(49926);function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();let o=(e=e||{}).random||(e.rng||u.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return(0,l.unsafeStringify)(o)}},95899:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(18679)),u=l(n(13254));function l(e){return e&&e.__esModule?e:{default:e}}let o=(0,r.default)("v5",80,u.default);t.default=o},77888:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(76678))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&u.default.test(e)}},25791:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(77888))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,u.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[489],{19489:function(e,t,l){"use strict";l.d(t,{H:function(){return e6}});var n=l(52322),i=l(11699),a=l(97729),o=l.n(a),r=l(5632),s=l(2784),c=l(56580),d=l(43388),m=l(77630),u=l(23094),h=l(59294),p=l(58446),x=l(74217),v=l(94160),b=l(68968),y=l(23710),g=l(54597),f=l(98564);let j=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:l}=e,[i,a]=(0,s.useState)(l),o=(0,m.y6)(i),r=f.$[o],{actionQueueStatus:c,setNextAction:d}=(0,y.c)({errorMessage:r.autoSaveFailed}),{refreshState:u}=(0,g.Z)(),h=(0,x.R9)(u),{syncChanges:p}=(0,b.g)(),S=(0,s.useCallback)(e=>{let{customType:t,onSaveCallback:l,updateMeta:n}=e;a(t),d(async()=>{let{errors:e}=await (0,v.KA)({customType:t,updateMeta:n});if(e.length>0)throw e;h(await (0,v.y0)()),p(),null==l||l()})},[d,h,p]),I=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:i,setCustomType:S}),[c,i,S]);return(0,n.jsx)(j.Provider,{value:I,children:"function"==typeof t?t(I):t})}function I(){let e=(0,s.useContext)(j);if(!e)throw Error("CustomTypeProvider not found");return e}var C=l(30195);function T(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:o}=I(),[r,c]=null!==(e=(0,m.j5)(a))&&void 0!==e?e:[],d=c?(0,m.N3)(c):"",[u,h]=(0,s.useState)(null!=d?d:""),[p,v]=(0,s.useState)();(0,x.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let b=(0,s.useCallback)(()=>(0,n.jsx)(i.aX,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,n.jsxs)(i.ae,{open:t,onOpenChange:l,size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:b,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,n.jsx)(i.al,{title:"Edit the UID label"}),(0,n.jsx)(i.aj,{children:(0,n.jsxs)(i.aJ,{onSubmit:function(){p||(o({customType:c?(0,m.eK)(u,a):(0,m.H8)(u,a)}),l(!1))},children:[(0,n.jsx)(i.D,{flexDirection:"column",padding:16,gap:4,children:(0,n.jsx)(i.aM,{type:"text",label:"Label *",placeholder:"UID",value:u,onValueChange:function(e){h(e),v(function(e){let t=D.safeParse(e,{errorMap:k});if(t.error)return t.error.errors[0].message}(e))},error:p,description:"A label for the UID"})}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",disabled:!!p,children:"Save"})]})]})})]})}let D=C.z.string().max(35).min(1),k=e=>{switch(e.code){case C.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case C.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var w=l(94840),_=l(59532),E=l(63397),L=l(75289);let A=e=>{let{name:t,label:l,placeholder:i,error:a,...o}=e;return(0,n.jsxs)(L.xu,{mb:3,children:[(0,n.jsx)(L.__,{htmlFor:t,mb:2,children:l}),(0,n.jsx)(E.gN,{name:t,type:"text",placeholder:i,as:L.II,autoComplete:"off",...o}),a?(0,n.jsx)(L.xv,{sx:{color:"error",mt:1},children:a}):null]})};var M=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a}=e;return(0,n.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,onSubmit:e=>{l(e),i()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,n.jsx)(A,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},N=e=>{let{isOpen:t,onSubmit:l,close:i}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,n.jsxs)(L.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(L.X6,{as:"h4",children:"Remove this tab?"}),(0,n.jsx)(L.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,n.jsx)(L.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),i()},children:"Yes, remove tab"})]})})},z=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a,initialTabKey:o}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{id:o},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:o,isValid:r}=e;return(0,n.jsxs)(L.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(A,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&o("id",e.target.value.trim())},onChange:e=>{o("id",e.target.value)}}),(0,n.jsx)(L.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!r,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),i()},children:"Save"})]})}})},Z=l(28316),O=l(88932),F=l(35289),P=l(87446),K=l(45440),B=l(16086),R=l(358),U=l(5495),V=l(39302),X=l(3285),G=l(40141),Y=l(65077),q=l(91589),H=l(53403),Q=l(27213);let W=e=>{let{openCreateSliceModal:t,openCreateSliceFromImageModal:l,openUpdateSliceZoneModal:a,openImportSlicesFromLibraryModal:o,openSlicesTemplatesModal:r,projectHasAvailableSlices:s,isSlicesTemplatesSupported:c}=e,d=(0,Q.F)({menuType:"ActionList"});return(0,n.jsxs)(i.s,{"data-testid":"slice-zone-blank-slate",sx:{width:648},children:[(0,n.jsx)(i.x,{lineColor:"purple9",backgroundColor:"purple5",name:"add",size:"large"}),(0,n.jsx)(i.z,{size:"big",children:"Add slices"}),(0,n.jsx)(i.w,{children:"Slices are reusable website sections. You can use them on different pages and write unique content for each. Each slice has its own component in your code."}),(0,n.jsx)(i.v,{children:(0,n.jsxs)(i.A,{children:[(0,n.jsx)(i.b,{renderStartIcon:()=>d.fromImage.BackgroundIcon,onClick:l,description:d.fromImage.description,children:d.fromImage.title}),(0,n.jsx)(i.b,{renderStartIcon:()=>d.fromScratch.BackgroundIcon,onClick:t,description:d.fromScratch.description,children:d.fromScratch.title}),c&&(0,n.jsx)(i.b,{renderStartIcon:()=>d.fromTemplate.BackgroundIcon,onClick:r,description:d.fromTemplate.description,children:d.fromTemplate.title}),s&&(0,n.jsx)(i.b,{renderStartIcon:()=>d.fromExisting.BackgroundIcon,onClick:a,description:d.fromExisting.description,children:d.fromExisting.title}),(0,n.jsx)(i.b,{renderStartIcon:()=>d.importFromExternal.BackgroundIcon,onClick:o,description:d.importFromExternal.description,children:d.importFromExternal.title})]})})]})};var $=l(98250);function J(e){let{customType:t,tabId:l,slices:n}=e,i={...t};return n.forEach(e=>{i={...i,tabs:i.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),i}var ee=l(18566),et=l(80148);async function el(){try{let{templates:e,errors:t}=await et.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var en=l(6256),ei=l(39204),ea=l(7723),eo=l(33986),er=l(30527),es=l(55862);let ec=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,n.jsx)(es.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,n.jsx)(er.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:(0,n.jsxs)(L.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,n.jsx)(L.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,n.jsx)(L.x8,{type:"button",onClick:l})]}),Footer:()=>(0,n.jsxs)(L.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,n.jsx)(eo.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,n.jsx)(eo.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,n.jsx)(L.nv,{children:"You're about to delete Slice Zone."})})})};var ed=l(84879),em=l(62434),eu=l(63908),eh=l(63019),ep=l(65375),ex=l.n(ep);let ev=e=>{var t;let{isOpen:l,close:a,onSubmit:o,isLoading:r,slice:d,libraries:m}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,ea.sT)(e)})),h={from:null===(t=m[0])||void 0===t?void 0:t.name,sliceName:(0,R.MP)(d.key)},[p,v]=(0,s.useState)(h),[b,y]=(0,s.useState)();function g(e){v(e),y((0,eh.h)(e,m,u))}return(0,x.pQ)(l,()=>{l||(v(h),y(void 0))}),(0,n.jsxs)(i.ae,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Upgrade slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){b&&Object.keys(b).length>0||o({libraryID:p.from,sliceID:p.sliceName})},children:(0,n.jsxs)(i.D,{flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ex().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)(i.aM,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,R.MP)(d.key),")"),error:null==b?void 0:b.sliceName,value:p.sliceName,onValueChange:e=>g({...p,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)("label",{className:ex().label,children:(0,n.jsx)(i.bL,{variant:"bold",children:"Slice library *"})}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:p.from,onValueChange:e=>{e&&g({...p,from:e})},children:m.map(e=>(0,n.jsx)(i.bt,{value:e.name,children:e.name},e.name))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:r,disabled:b&&Object.keys(b).length>0,children:"Upgrade"})]})]})})})]})};var eb=l(96009),ey=l.n(eb);let eg=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,slice:d,sliceName:m,libraries:u,localSharedSlices:h}=e,p={libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:ey()(d.key),variationName:m},[v,b]=(0,s.useState)(!0),[y,g]=(0,s.useState)(p),[f,j]=(0,s.useState)({});function S(e){g(e),j(ef(e,u))}return(0,x.pQ)(a,()=>{a||(g(p),j({}))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Convert to slice variation"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){Object.keys(f).length>0||r(y)},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ex().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ex().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice *"}),"string"==typeof f.libraryID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:f.libraryID}):null,"string"==typeof f.sliceID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:f.sliceID}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(y.libraryID,"::").concat(y.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");S({...y,libraryID:t,sliceID:l})}},children:h.map(e=>(0,n.jsxs)(i.bt,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"Variation name *",placeholder:m,error:f.variationName,value:y.variationName,onValueChange:e=>{let t={...y,variationName:e.slice(0,30)};v&&(t.variationID=ey()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"ID *",placeholder:ey()(d.key),error:f.variationID,value:y.variationID,onValueChange:e=>{b(!1),S({...y,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:Object.keys(f).length>0,children:"Convert"})]})]})})})]})},ef=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let n=t.find(t=>t.path===e.libraryID);l.libraryID||n||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let i=null==n?void 0:n.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||i||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==i?void 0:i.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},ej=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,identicalSlices:d}=e,m=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[u,h]=(0,s.useState)(m),[p,v]=(0,s.useState)();return(0,x.pQ)(a,()=>{a||(h(m),v(void 0))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Merge with an existing slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){if(p)return;let[e,t,l]=u.split("::");r({libraryID:e,sliceID:t,variationID:l})},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ex().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ex().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice*"}),"string"==typeof p?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:p}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:u,onValueChange:function(e){h(e),e||v("Cannot be empty.")},children:d.map(e=>(0,n.jsx)(i.bt,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:!!p,children:"Merge"})]})]})})})]})},eS=e=>{var t;let{slice:l,path:a}=e,{refreshState:o}=(0,g.Z)(),[r,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(),{setCustomType:h}=I(),{libraries:p}=(0,c.v9)(e=>({libraries:(0,ea.Sd)(e)})),x="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,b=p.filter(e=>e.isLocal),y=b.map(e=>e.components).flat(),f=eI(l,x,y),j=async e=>{var t,n,i;if(!m)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:m});let{errors:r}=await et.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(n=e.variationName)&&void 0!==n?n:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}});if(r.length)throw console.error("Could not convert slice `".concat(x,"`"),r),O.Am.error("Could not convert slice `".concat(x,"`")),r;let{model:s,errors:c}=await et.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),O.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(o(await (0,v.y0)()),d(!1),u(void 0),m){case"as_new_slice":O.Am.success("".concat(x," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":O.Am.success("".concat(x," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:O.Am.success("".concat(x," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h({customType:s})},S={path:a,slice:l,sliceName:x,libraries:b,localSharedSlices:y,identicalSlices:f,close:()=>u(void 0),onSubmit:j,isLoading:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,n.jsxs)(i.as,{align:"start",children:[(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>u("as_new_slice"),children:"Upgrade slice"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>u("as_new_variation"),disabled:!y.length,children:"Convert to slice variation"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>u("merge_with_identical"),disabled:!f.length,children:"Merge with another slice"})]})]}),(0,n.jsx)(ev,{...S,isOpen:"as_new_slice"===m}),(0,n.jsx)(eg,{...S,isOpen:"as_new_variation"===m}),(0,n.jsx)(ej,{...S,isOpen:"merge_with_identical"===m})]})},eI=(e,t,l)=>(0,s.useMemo)(()=>{let n=[],i=(0,eu.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,eu.ux)(t,e.model.name);i.primary===l.primary&&i.items===l.items&&n.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return n},[e,t,l]),eC=e=>{let{slice:t,path:l}=e,[a]=(0,ed.E)("legacySliceUpgrader"),o=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,n.jsxs)(em.Zb,{children:[(0,n.jsx)(em.ZB,{component:"div",children:(0,n.jsx)(i.D,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(i.bL,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,n.jsxs)(em.T$,{children:[(0,n.jsx)(i.c3,{content:o,side:"bottom",children:(0,n.jsx)(i.m,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,n.jsx)(eS,{slice:t,path:l}):null]}),(0,n.jsx)(em.eW,{subtitle:"1 variation",title:(0,eu.Dj)(t.value)})]})};var eT=l(51507),eD=l(21151);let ek=e=>{let{slices:t,format:l,path:i,onRemoveSharedSlice:a}=e,o=t.some(e=>"SharedSlice"!==e.type),r=f.$[l],[c]=(0,ed.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{o&&(c.enabled?O.Am.info("This ".concat(r.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):O.Am.warning("This ".concat(r.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[o]),(0,n.jsx)(eD.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,n.jsx)(eC,{slice:t,path:i})}{let t=e.payload;return(0,n.jsx)(eT.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,location:n,onSuccess:i}=e,{data:a,errors:o}=await et.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(o.length>0||void 0===a)throw o;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],location:n,mode:"template",sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),O.Am.error(e)}}var e_=l(26109),eE=e=>{let{availableSlices:t,values:l}=e;return(0,n.jsx)(E.F2,{name:"sliceKeys",render:e=>(0,n.jsx)(eD.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{let i=l.sliceKeys.includes(t.model.id);return(0,n.jsx)(eT.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:n=>{n?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:i,slice:t,variant:"outlined"})}})})};let eL=e=>{let{formId:t,close:l,onSuccess:i,availableSlicesTemplates:a,localLibraries:o,location:r}=e,{createSliceSuccess:s}=(0,g.Z)();return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:o.map(e=>e.name),location:r,onSuccess:async e=>{s((await (0,v.y0)()).libraries),i(await Promise.all(e.map(async e=>(await et.managerClient.slices.readSlice({libraryID:o[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(L.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(eE,{values:t,availableSlices:a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:e_.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})}))})}})};var eA=e=>{let{formId:t,close:l,onSubmit:i,availableSlices:a}=e;return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;i(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(L.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(eE,{values:t,availableSlices:a})}})};let eM=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:n,notFound:i}=e.value.reduce((e,t)=>{let{key:n,value:i}=t;if("SharedSlice"===i.type){let t=l.find(e=>e.model.id===n);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:n}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:n,value:i}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:n,notFound:i}};var eN=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:o,onRemoveSharedSlice:r,sliceZone:d,tabId:m}=e,u=(0,ee.QT)(el,[]),[h,p]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),[y,f]=(0,s.useState)(!1),[j,S]=(0,s.useState)(!1),[C,T]=(0,s.useState)(!1),{remoteSlices:D,libraries:k}=(0,c.v9)(e=>({remoteSlices:(0,ea.sT)(e),libraries:(0,ea.Sd)(e),slices:(0,ea.xC)(e)})),{setCustomType:_}=I(),{completeStep:E}=(0,$.k)(),{openLoginModal:L}=(0,g.Z)(),A=(0,Q.F)({menuType:"Dropdown"}),M=k.filter(e=>e.isLocal),{availableSlices:N,slicesInSliceZone:z,notFound:Z}=(0,s.useMemo)(()=>d?eM(d,k):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,k]),[P,K]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==Z?void 0:Z.length)&&Z.forEach(e=>{let{key:t}=e;r(t)})},[Z]);let B=z.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),R=N.filter(e=>!B.some(t=>t.model.id===e.model.id)),U=()=>{b(!0)},V=()=>{f(!0)},X=async()=>{await et.managerClient.user.checkIsLoggedIn()?S(!0):L()},G=()=>{p(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},eo=()=>{T(!0)},er=()=>{b(!1)},es=()=>{f(!1)},ed=()=>{S(!1)},em=()=>{p(!1)},eu=()=>{T(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F.Bu,{actions:d?(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,n.jsxs)(i.as,{align:"end",children:[(0,n.jsx)(i.at,{renderStartIcon:()=>A.fromImage.BackgroundIcon,onSelect:()=>void X(),description:A.fromImage.description,children:A.fromImage.title}),(0,n.jsx)(i.at,{renderStartIcon:()=>A.fromScratch.BackgroundIcon,onSelect:V,description:A.fromScratch.description,children:A.fromScratch.title}),u.length>0?(0,n.jsx)(i.at,{onSelect:G,renderStartIcon:()=>A.fromTemplate.BackgroundIcon,description:A.fromTemplate.description,children:A.fromTemplate.title}):void 0,R.length>0?(0,n.jsx)(i.at,{onSelect:U,renderStartIcon:()=>A.fromExisting.BackgroundIcon,description:A.fromExisting.description,children:A.fromExisting.title}):void 0,(0,n.jsx)(i.at,{onSelect:eo,renderStartIcon:()=>A.importFromExternal.BackgroundIcon,description:A.importFromExternal.description,children:A.importFromExternal.title})]})]}):void 0,toggle:"page"!==l.format||"Main"!==m?(0,n.jsx)(i.bC,{checked:!!d,onCheckedChange:e=>{e?a():K(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?z.length>0?(0,n.jsx)(Y.xR,{children:(0,n.jsx)(ek,{slices:z,format:l.format,path:{customTypeID:l.id,tabID:m,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:r})}):(0,n.jsx)(i.D,{flexDirection:"column",flexGrow:1,justifyContent:"center",alignItems:"center",padding:{block:32},children:(0,n.jsx)(W,{openUpdateSliceZoneModal:U,openCreateSliceModal:V,openCreateSliceFromImageModal:()=>void X(),openImportSlicesFromLibraryModal:()=>void eo(),openSlicesTemplatesModal:G,projectHasAvailableSlices:R.length>0,isSlicesTemplatesSupported:u.length>0})}):void 0,x&&(0,n.jsx)(eA,{formId:"tab-slicezone-form-".concat(m),availableSlices:R,onSubmit:e=>{let t=J({customType:l,tabId:m,slices:e});_({customType:w.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success("Slice(s) added to slice zone")}}),E("createSlice"),er()},close:er}),h&&(0,n.jsx)(eL,{formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:u,localLibraries:M,location:"".concat(l.format,"_type"),onSuccess:e=>{let t=J({customType:l,tabId:m,slices:e});_({customType:w.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(ei.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(M[0].name,"/")}))}}),E("createSlice"),em()},close:em}),P&&(0,n.jsx)(ec,{closeDeleteSliceZoneModal:()=>{K(!1)},deleteSliceZone:()=>{o(),K(!1)}}),(null==M?void 0:M.length)!==0&&y&&(0,n.jsx)(en.c,{onSuccess:e=>{let t=J({customType:l,tabId:m,slices:[e]});_({customType:w.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(ei.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(M[0].name,"/")}))}}),es()},localLibraries:M,location:"".concat(l.format,"_type"),remoteSlices:D,onClose:es}),(0,n.jsx)(q.S,{open:j,location:"".concat(l.format,"_type"),onSuccess:e=>{let{slices:t,library:i}=e,a=J({customType:l,tabId:m,slices:t.map(e=>e.model)});_({customType:w.Dc.fromSM(a),onSaveCallback:()=>{O.Am.success((0,n.jsx)(ei.GX,{message:"Slice(s) added to slice zone and created at: ",path:i}))}}),ed()},onClose:ed}),(0,n.jsx)(H.w,{open:C,location:"".concat(l.format,"_type"),onSuccess:e=>{let{slices:t,library:i}=e,a=J({customType:l,tabId:m,slices:t.map(e=>e.model)});_({customType:w.Dc.fromSM(a),onSaveCallback:()=>{O.Am.success((0,n.jsx)(ei.GX,{message:"Slice(s) added to slice zone and created at: ",path:i}))}}),eu()},onClose:eu})]})};let ez=[K.C.UID,K.C.Image,K.C.Text,K.C.StructuredText,K.C.Link,K.C.Select,K.C.Boolean,K.C.Number,K.C.Color,K.C.Date,K.C.Table,K.C.Embed,K.C.Timestamp,K.C.GeoPoint,K.C.ContentRelationship,K.C.LinkToMedia,K.C.Group,K.C.NestedGroup];var eZ=e=>{var t,l,a,o;let{tabId:r}=e,{customType:c,setCustomType:d}=I(),u=w.Dc.toSM(c),h=null===(t=u.tabs.find(e=>e.key===r))||void 0===t?void 0:t.sliceZone,p=null!==(a=null===(l=u.tabs.find(e=>e.key===r))||void 0===l?void 0:l.value)&&void 0!==a?a:[],x="page"===u.format&&u.repeatable?p.filter(e=>"uid"!==e.key):p,v=u.tabs.reduce((e,t)=>[...e,...t.value],[]),b=e=>{var t;let{apiId:l,value:n}=e,i=null===(t=n.config)||void 0===t?void 0:t.label;if((0,B.Ss)(K.C,n.type)||null==i)return;if("Range"===n.type||"IntegrationFields"===n.type||"Separator"===n.type)throw Error("Unsupported Field Type: ".concat(n.type));let a=K.C[n.type];try{a.schema.validateSync(n,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(n.type,'".'))}let o=w.L$.fromSM(n);d({customType:(0,m.xS)({customType:c,newField:o,newFieldId:l,sectionId:r}),onSaveCallback:()=>{O.Am.success("".concat("Group"===n.type?"Group":"Field"," added"))}}),(0,U.V)({id:l,field:o})},y=e=>{let{apiId:t,newKey:l,value:n,inGroupFieldAction:i,updateMeta:a}=e;if((0,B.Ss)(K.C,n.type))return;let o=w.L$.fromSM(n);d({customType:(0,m.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:o,sectionId:r}),onSaveCallback:()=>{"add"===i&&O.Am.success("Field added")},updateMeta:a}),i||(0,V.Z)({previousId:t,id:l,field:o})};return(0,n.jsx)(P.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.D,{padding:32,children:(0,n.jsx)(i.bg,{})}),children:(0,n.jsxs)(F.aV,{border:!1,style:{flexGrow:1},children:[(0,n.jsx)(G.Z,{zoneType:"customType",zoneTypeFormat:null!==(o=c.format)&&void 0!==o?o:"custom",tabId:r,title:"Static zone",dataTip:"",fields:x,poolOfFieldsToCheck:v,showHints:!0,EditModal:X.Z,widgetsArray:ez,onDeleteItem:e=>{d({customType:(0,m.AK)({customType:c,fieldId:e,sectionId:r})})},onSave:e=>""===e.apiId?b({...e,apiId:e.newKey}):y(e),onDragEnd:e=>{if((0,B.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let n=(0,m.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:r});(0,Z.flushSync)(()=>d({customType:n}))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,R.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,R.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,n.jsx)(eN,{customType:u,tabId:r,sliceZone:h,onRemoveSharedSlice:e=>{d({customType:(0,m.EN)({customType:c,sectionId:r,sliceId:e})})},onCreateSliceZone:()=>{d({customType:(0,m.Tr)(c,r)})},onDeleteSliceZone:()=>{d({customType:(0,m.E3)(c,r)})}})]})})})};let eO=()=>{var e,t,l;let{customType:a,setCustomType:o}=I(),r=w.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=r.tabs[0])||void 0===e?void 0:e.key),[u,h]=(0,s.useState)(),p=(null===(l=r.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.c9,{sx:p?{flexGrow:1}:void 0,children:["page"===a.format?(0,n.jsx)(i.ca,{title:a.repeatable?(0,n.jsx)(T,{}):void 0}):void 0,(0,n.jsxs)(i.cb,{onValueChange:d,value:c,children:[(0,n.jsx)(i.cd,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:r.tabs.map(e=>(0,n.jsx)(i.ce,{menu:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.at,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"edit"}),children:"Rename"}),(0,n.jsx)(i.at,{color:"tomato",disabled:function(e){if(r.tabs.length<=1)return!0;let t=r.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),r.tabs.map(e=>(0,n.jsx)(i.cc,{value:e.key,children:(0,n.jsx)(eZ,{tabId:e.key})},e.key))]})]}),(null==u?void 0:u.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.vB)(a,t)}),d(t)},tabIds:r.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(z,{close:()=>{h(void 0)},initialTabKey:u.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.HO)(a,u.tabKey,t)}),c===u.tabKey&&d(t)},tabIds:r.tabs.filter(e=>e.key!==u.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,n.jsx)(N,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(o({customType:(0,m.F$)(a,u.tabKey)}),c===u.tabKey){var e;let t=null===(e=r.tabs.find(e=>e.key!==u.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eF=l(16442),eP=l(78254),eK=l(60867),eB=l(11166),eR=l(34919),eU=l.n(eR);let eV=e=>{let{tabs:t,...l}=e;return(0,n.jsxs)(eB.fC,{...l,className:eU().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,n.jsx)(eB.aV,{className:eU().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,n.jsx)(eB.xz,{className:eU().trigger,value:l,children:(0,n.jsx)(i.bL,{className:eU().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,n.jsx)(eB.VY,{className:eU().content,value:l,children:(0,n.jsx)(i.bn,{className:eU().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eX=l(25661),eG=l(88241),eY=l(32554),eq=l(44621),eH=l.n(eq);let eQ=e=>{var t,l;let{inline:a,...o}=e,r=(0,eY.p)();if(!0===a)return(0,n.jsx)("code",{...o,className:eH().inlineCode});let s=(()=>{var e,t,l,n,i;if((null===(t=o.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(n=o.node)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(i=o.className)||void 0===i?void 0:i.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=o.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,n.jsx)(i.W,{...o,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:r})},language:c,code:String(o.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},eW=e=>{let{markdown:t}=e;return(0,n.jsx)(eX.D,{children:t,linkTarget:"_blank",remarkPlugins:[eG.Z],components:{code:e=>(0,n.jsx)(eQ,{...e}),h1:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,n.jsx)(i.bL,{className:eH().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,n.jsx)(i.bL,{className:eH().section,children:e.children,component:"pre",variant:"normal"})}})};async function e$(e){let t=JSON.parse(e),{errors:l,documentation:n}=await et.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return n}var eJ=l(65480),e0=l.n(eJ);let e1=e=>{var t;let{model:l}=e,a=(0,eY.p)(),o=(t={kind:"PageSnippet",data:{model:l}},(0,ee.QT)(e$,[JSON.stringify(t)])),{completeStep:r}=(0,$.k)();return 0===o.length?null:(0,n.jsxs)(i.ae,{size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",onClick:()=>{r("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,n.jsx)(i.al,{icon:"code",title:"Page snippet"}),(0,n.jsx)("section",{className:e0().content,children:o.length>1?(0,n.jsx)(eV,{style:{flex:1},tabs:o.map((e,t)=>{let{label:l,content:i}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,n.jsx)(eW,{markdown:i})}})}):(0,n.jsx)(i.bn,{style:{flex:1,padding:16},children:(0,n.jsx)(eW,{markdown:o[0].content})})})]})},e4=e=>{let{model:t}=e;return(0,n.jsx)("div",{children:(0,n.jsx)(P.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.E,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,n.jsx)(e1,{model:t})})})})},e6=()=>{let e=(0,r.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eP.Jk)(t,(0,h.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eF.TG)(t)||e.replace("/")},[t,e]),t&&(0,eF.TG)(t))?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,n.jsx)(e8,{customType:t.local})]}):(0,n.jsx)(p.LN,{})},e8=e=>{let{customType:t}=e;return null===t?(0,n.jsx)(p.LN,{}):(0,n.jsx)(p.LN,{children:(0,n.jsx)(S,{initialCustomType:w.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:o,setCustomType:r}=e,s=(0,m.y6)(o),c=h.cd[t.format],x=f.$[t.format];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(p.wd,{children:[(0,n.jsx)(p.Xq,{url:c.tablePagePathname}),(0,n.jsxs)(p.Cx,{children:[(0,n.jsx)(d.g,{children:x.name({start:!0,plural:!0})}),(0,n.jsx)(d.g,{active:!0,children:null!==(l=o.label)&&void 0!==l?l:o.id})]}),(0,n.jsxs)(p.K2,{children:[(0,n.jsx)(u.X,{status:a}),"page"===o.format?(0,n.jsx)(e4,{model:o}):void 0,(0,n.jsx)(eK._,{isChangesLocal:!0,format:s,customType:o,setLocalCustomType:r})]})]}),(0,n.jsx)(p.RN,{children:(0,n.jsx)(i.D,{flexDirection:"column",minWidth:0,children:(0,n.jsx)(eO,{})})})]})}})})}},84879:function(e,t,l){"use strict";l.d(t,{E:function(){return o}});var n=l(18566),i=l(80148);async function a(){return i.managerClient.project.getSliceMachineConfig()}function o(e){var t,l;let[o,r]=[(0,n.QT)(a,[]),async e=>{await i.managerClient.project.writeSliceMachineConfig({config:e}),(0,n.VA)(a,[],e)}],s=async t=>{let l={...o,labs:{...o.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await r(l)};return[{enabled:null!==(l=null==o?void 0:null===(t=o.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},s]}},34919:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},65480:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},44621:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},65375:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);