@react-email/preview-server 1.0.0-canary.0 → 4.1.0-canary.10
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +32 -32
- package/.next/build-manifest.json +14 -14
- package/.next/diagnostics/framework.json +1 -1
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +5 -5
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/preview/[...slug]/page.js +152 -152
- package/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/200.js +1 -0
- package/.next/server/chunks/3.js +15 -0
- package/.next/server/chunks/565.js +1 -0
- package/.next/server/chunks/784.js +6 -0
- package/.next/server/chunks/{428.js → 879.js} +7 -7
- package/.next/server/chunks/915.js +20 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{3bd82e28-cda2c00a924937c5.js → 04c799b8-f2be86d6e75dbf29.js} +1 -1
- package/.next/static/chunks/188-e278e5f1e9c4067e.js +1 -0
- package/.next/static/chunks/336-0767fdc0ff1ceaa1.js +1 -0
- package/.next/static/chunks/551-d9ce0a77591e6bf7.js +1 -0
- package/.next/static/chunks/651-ca7523b84c3a84c4.js +1 -0
- package/.next/static/chunks/713-6c7607cb54b8278e.js +1 -0
- package/.next/static/chunks/834-e77d5196a2631efe.js +1 -0
- package/.next/static/chunks/app/_not-found/page-aee2c5619f94a965.js +1 -0
- package/.next/static/chunks/app/layout-51e57d53a74eca29.js +1 -0
- package/.next/static/chunks/app/page-ddc5b5b5b8d2de0e.js +1 -0
- package/.next/static/chunks/app/preview/[...slug]/page-8ac2b346f388df3e.js +1 -0
- package/.next/static/chunks/{f33a14d2-ec7c5f0b91818561.js → f33a14d2-188715a58266ac15.js} +1 -1
- package/.next/static/chunks/{framework-b887e9fc751a9906.js → framework-f71c687711cb40cc.js} +1 -1
- package/.next/static/chunks/main-697e2f65b52ad05c.js +1 -0
- package/.next/static/chunks/main-app-deb9839bdc2bcbd4.js +1 -0
- package/.next/static/chunks/pages/_app-2e335329c12ac3e7.js +1 -0
- package/.next/static/chunks/pages/_error-73094c2ebe868f44.js +1 -0
- package/.next/static/chunks/{webpack-31c45daa2bd82a7b.js → webpack-c09dcf4c47767be8.js} +1 -1
- package/.next/static/css/{35e8811589f0962b.css → ac3decd5d6736fbe.css} +1 -1
- package/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/.next/static/{VkyJa9K30jCrKBesOgrQT → ur8mm-bO6uPtIDOFYtHum}/_buildManifest.js +1 -1
- package/.next/trace +27 -27
- package/.next/types/app/layout.ts +1 -1
- package/.next/types/app/page.ts +1 -1
- package/.next/types/app/preview/[...slug]/page.ts +1 -1
- package/CHANGELOG.md +19 -0
- package/index.mjs +17 -0
- package/package.json +4 -4
- package/src/actions/email-validation/check-compatibility.ts +2 -2
- package/src/actions/email-validation/check-images.ts +3 -3
- package/src/actions/email-validation/check-links.ts +3 -3
- package/src/actions/email-validation/quick-fetch.ts +1 -1
- package/src/app/layout.tsx +2 -2
- package/src/app/preview/[...slug]/page.tsx +3 -4
- package/src/components/send.tsx +1 -1
- package/src/components/shell.tsx +4 -1
- package/src/components/toolbar/code-preview-line-link.tsx +0 -1
- package/src/components/toolbar/results.tsx +1 -0
- package/src/components/toolbar/use-cached-state.ts +2 -2
- package/src/utils/caniemail/ast/get-object-variables.ts +1 -1
- package/src/utils/caniemail/get-element-names.ts +9 -3
- package/src/utils/caniemail/tailwind/generate-tailwind-rules.ts +1 -1
- package/src/utils/caniemail/tailwind/get-tailwind-config.ts +1 -10
- package/src/utils/contains-email-template.spec.ts +12 -0
- package/src/utils/contains-email-template.ts +26 -9
- package/src/utils/result.ts +2 -2
- package/src/utils/testing/js-email-test.js +1 -1
- package/src/utils/testing/request-response-email.tsx +2 -2
- package/.next/server/chunks/134.js +0 -6
- package/.next/server/chunks/235.js +0 -15
- package/.next/server/chunks/278.js +0 -1
- package/.next/server/chunks/343.js +0 -20
- package/.next/server/chunks/963.js +0 -1
- package/.next/server/chunks/999.js +0 -1
- package/.next/static/chunks/107-3043079e7cb8bcae.js +0 -1
- package/.next/static/chunks/293-67391ef0e44ffa4f.js +0 -1
- package/.next/static/chunks/45-1021fac82f766268.js +0 -1
- package/.next/static/chunks/484-1969fe871b27074e.js +0 -1
- package/.next/static/chunks/484-e02de792ff5f9ea5.js +0 -1
- package/.next/static/chunks/589-817d8691661d370e.js +0 -1
- package/.next/static/chunks/902-c34acb56733e0ce1.js +0 -1
- package/.next/static/chunks/app/_not-found/page-4cbc7dce3ad33336.js +0 -1
- package/.next/static/chunks/app/layout-74628781c0b7e7bf.js +0 -1
- package/.next/static/chunks/app/layout-daeba68330ab58bb.js +0 -1
- package/.next/static/chunks/app/page-55cf199b7ca71958.js +0 -1
- package/.next/static/chunks/app/preview/[...slug]/page-07dd9a701d0b3e56.js +0 -1
- package/.next/static/chunks/app/preview/[...slug]/page-61b0ea70a8d72916.js +0 -1
- package/.next/static/chunks/main-9a03e7ba8acb1900.js +0 -1
- package/.next/static/chunks/main-app-5bc2d814f500db60.js +0 -1
- package/.next/static/chunks/pages/_app-542a93a5a214e1c0.js +0 -1
- package/.next/static/chunks/pages/_error-d5fe1b1612642f76.js +0 -1
- package/.next/static/j4oDiQwPKPQgK5jAoiUTk/_buildManifest.js +0 -1
- package/.next/static/j4oDiQwPKPQgK5jAoiUTk/_ssgManifest.js +0 -1
- package/.next/static/media/6d93bde91c0c2823-s.woff2 +0 -0
- package/.next/static/media/a34f9d1faa5f3315-s.p.woff2 +0 -0
- package/_index.js +0 -4
- /package/.next/static/{VkyJa9K30jCrKBesOgrQT → ur8mm-bO6uPtIDOFYtHum}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[902],{262:(e,t)=>{function r(e){var t;let{config:r,src:n,width:i,quality:o}=e,a=o||(null==(t=r.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)<Math.abs(e-75)?t:e))||75;return r.path+"?url="+encodeURIComponent(n)+"&w="+i+"&q="+a+(n.startsWith("/_next/static/media/"),"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}}),r.__next_img_default=!0;let n=r},513:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return o}});let n=r(7908)._(r(216)),i=r(1347),o=n.default.createContext(i.imageConfigDefault)},1288:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let n=r(216),i=n.useLayoutEffect,o=n.useEffect;function a(e){let{headManager:t,reduceComponentsToState:r}=e;function a(){if(t&&t.mountedInstances){let i=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(i,e))}}return i(()=>{var r;return null==t||null==(r=t.mountedInstances)||r.add(e.children),()=>{var r;null==t||null==(r=t.mountedInstances)||r.delete(e.children)}}),i(()=>(t&&(t._pendingUpdate=a),()=>{t&&(t._pendingUpdate=a)})),o(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},1327:(e,t)=>{function r(e){let{ampFirst:t=!1,hybrid:r=!1,hasQuery:n=!1}=void 0===e?{}:e;return t||r&&n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return r}})},1347:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{VALID_LOADERS:function(){return r},imageConfigDefault:function(){return n}});let r=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}},3902:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return _}});let n=r(7908),i=r(5249),o=r(3604),a=i._(r(216)),l=n._(r(3113)),s=n._(r(9975)),u=r(4702),d=r(1347),c=r(513);r(9023);let f=r(5556),p=n._(r(262)),m=r(477),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function h(e,t,r,n,i,o,a){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,i=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}(null==n?void 0:n.current)&&n.current(e)}}))}function b(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}let v=(0,a.forwardRef)((e,t)=>{let{src:r,srcSet:n,sizes:i,height:l,width:s,decoding:u,className:d,style:c,fetchPriority:f,placeholder:p,loading:g,unoptimized:v,fill:y,onLoadRef:_,onLoadingCompleteRef:w,setBlurComplete:j,setShowAltText:x,sizesInput:C,onLoad:O,onError:S,...E}=e,P=(0,a.useCallback)(e=>{e&&(S&&(e.src=e.src),e.complete&&h(e,p,_,w,j,v,C))},[r,p,_,w,j,S,v,C]),M=(0,m.useMergedRef)(t,P);return(0,o.jsx)("img",{...E,...b(f),loading:g,width:s,height:l,decoding:u,"data-nimg":y?"fill":"1",className:d,style:c,sizes:i,srcSet:n,src:r,ref:M,onLoad:e=>{h(e.currentTarget,p,_,w,j,v,C)},onError:e=>{x(!0),"empty"!==p&&j(!0),S&&S(e)}})});function y(e){let{isAppRouter:t,imgAttributes:r}=e,n={as:"image",imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:r.crossOrigin,referrerPolicy:r.referrerPolicy,...b(r.fetchPriority)};return t&&l.default.preload?(l.default.preload(r.src,n),null):(0,o.jsx)(s.default,{children:(0,o.jsx)("link",{rel:"preload",href:r.srcSet?void 0:r.src,...n},"__nimg-"+r.src+r.srcSet+r.sizes)})}let _=(0,a.forwardRef)((e,t)=>{let r=(0,a.useContext)(f.RouterContext),n=(0,a.useContext)(c.ImageConfigContext),i=(0,a.useMemo)(()=>{var e;let t=g||n||d.imageConfigDefault,r=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),i=t.deviceSizes.sort((e,t)=>e-t),o=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:r,deviceSizes:i,qualities:o}},[n]),{onLoad:l,onLoadingComplete:s}=e,m=(0,a.useRef)(l);(0,a.useEffect)(()=>{m.current=l},[l]);let h=(0,a.useRef)(s);(0,a.useEffect)(()=>{h.current=s},[s]);let[b,_]=(0,a.useState)(!1),[w,j]=(0,a.useState)(!1),{props:x,meta:C}=(0,u.getImgProps)(e,{defaultLoader:p.default,imgConf:i,blurComplete:b,showAltText:w});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v,{...x,unoptimized:C.unoptimized,placeholder:C.placeholder,fill:C.fill,onLoadRef:m,onLoadingCompleteRef:h,setBlurComplete:_,setShowAltText:j,sizesInput:e.sizes,ref:t}),C.priority?(0,o.jsx)(y,{isAppRouter:!r,imgAttributes:x}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return n}});let n=r(7908)._(r(216)).default.createContext({})},4702:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return s}}),r(9023);let n=r(6023),i=r(1347),o=["-moz-initial","fill","none","scale-down",void 0];function a(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function s(e,t){var r,s;let u,d,c,{src:f,sizes:p,unoptimized:m=!1,priority:g=!1,loading:h,className:b,quality:v,width:y,height:_,fill:w=!1,style:j,overrideSrc:x,onLoad:C,onLoadingComplete:O,placeholder:S="empty",blurDataURL:E,fetchPriority:P,decoding:M="async",layout:R,objectFit:z,objectPosition:I,lazyBoundary:k,lazyRoot:A,...D}=e,{imgConf:N,showAltText:T,blurComplete:F,defaultLoader:U}=t,L=N||i.imageConfigDefault;if("allSizes"in L)u=L;else{let e=[...L.deviceSizes,...L.imageSizes].sort((e,t)=>e-t),t=L.deviceSizes.sort((e,t)=>e-t),n=null==(r=L.qualities)?void 0:r.sort((e,t)=>e-t);u={...L,allSizes:e,deviceSizes:t,qualities:n}}if(void 0===U)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let B=D.loader||U;delete D.loader,delete D.srcSet;let q="__next_img_default"in B;if(q){if("custom"===u.loader)throw Object.defineProperty(Error('Image with src "'+f+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader'),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=B;B=t=>{let{config:r,...n}=t;return e(n)}}if(R){"fill"===R&&(w=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[R];e&&(j={...j,...e});let t={responsive:"100vw",fill:"100vw"}[R];t&&!p&&(p=t)}let G="",W=l(y),X=l(_);if((s=f)&&"object"==typeof s&&(a(s)||void 0!==s.src)){let e=a(f)?f.default:f;if(!e.src)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!e.height||!e.width)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(d=e.blurWidth,c=e.blurHeight,E=E||e.blurDataURL,G=e.src,!w)if(W||X){if(W&&!X){let t=W/e.width;X=Math.round(e.height*t)}else if(!W&&X){let t=X/e.height;W=Math.round(e.width*t)}}else W=e.width,X=e.height}let H=!g&&("lazy"===h||void 0===h);(!(f="string"==typeof f?f:G)||f.startsWith("data:")||f.startsWith("blob:"))&&(m=!0,H=!1),u.unoptimized&&(m=!0),q&&!u.dangerouslyAllowSVG&&f.split("?",1)[0].endsWith(".svg")&&(m=!0);let V=l(v),$=Object.assign(w?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:z,objectPosition:I}:{},T?{}:{color:"transparent"},j),J=F||"empty"===S?null:"blur"===S?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:W,heightInt:X,blurWidth:d,blurHeight:c,blurDataURL:E||"",objectFit:$.objectFit})+'")':'url("'+S+'")',Y=o.includes($.objectFit)?"fill"===$.objectFit?"100% 100%":"cover":$.objectFit,Z=J?{backgroundSize:Y,backgroundPosition:$.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},K=function(e){let{config:t,src:r,unoptimized:n,width:i,quality:o,sizes:a,loader:l}=e;if(n)return{src:r,srcSet:void 0,sizes:void 0};let{widths:s,kind:u}=function(e,t,r){let{deviceSizes:n,allSizes:i}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(r);)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:i.filter(t=>t>=n[0]*e),kind:"w"}}return{widths:i,kind:"w"}}return"number"!=typeof t?{widths:n,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>i.find(t=>t>=e)||i[i.length-1]))],kind:"x"}}(t,i,a),d=s.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:s.map((e,n)=>l({config:t,src:r,quality:o,width:e})+" "+("w"===u?e:n+1)+u).join(", "),src:l({config:t,src:r,quality:o,width:s[d]})}}({config:u,src:f,unoptimized:m,width:W,quality:V,sizes:p,loader:B});return{props:{...D,loading:H?"lazy":h,fetchPriority:P,width:W,height:X,decoding:M,className:b,style:{...$,...Z},sizes:K.sizes,srcSet:K.srcSet,src:x||K.src},meta:{unoptimized:m,priority:g,placeholder:S,fill:w}}}},5556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return n}});let n=r(7908)._(r(216)).default.createContext(null)},6023:(e,t)=>{function r(e){let{widthInt:t,heightInt:r,blurWidth:n,blurHeight:i,blurDataURL:o,objectFit:a}=e,l=n?40*n:t,s=i?40*i:r,u=l&&s?"viewBox='0 0 "+l+" "+s+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+u+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+o+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},9975:(e,t,r)=>{var n=r(6662);Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return h},defaultHead:function(){return f}});let i=r(7908),o=r(5249),a=r(3604),l=o._(r(216)),s=i._(r(1288)),u=r(4087),d=r(1279),c=r(1327);function f(e){void 0===e&&(e=!1);let t=[(0,a.jsx)("meta",{charSet:"utf-8"},"charset")];return e||t.push((0,a.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")),t}function p(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(9023);let m=["name","httpEquiv","charSet","itemProp"];function g(e,t){let{inAmpMode:r}=t;return e.reduce(p,[]).reverse().concat(f(r).reverse()).filter(function(){let e=new Set,t=new Set,r=new Set,n={};return i=>{let o=!0,a=!1;if(i.key&&"number"!=typeof i.key&&i.key.indexOf("$")>0){a=!0;let t=i.key.slice(i.key.indexOf("$")+1);e.has(t)?o=!1:e.add(t)}switch(i.type){case"title":case"base":t.has(i.type)?o=!1:t.add(i.type);break;case"meta":for(let e=0,t=m.length;e<t;e++){let t=m[e];if(i.props.hasOwnProperty(t))if("charSet"===t)r.has(t)?o=!1:r.add(t);else{let e=i.props[t],r=n[t]||new Set;("name"!==t||!a)&&r.has(e)?o=!1:(r.add(e),n[t]=r)}}}return o}}()).reverse().map((e,t)=>{let i=e.key||t;if(n.env.__NEXT_OPTIMIZE_FONTS&&!r&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,l.default.cloneElement(e,t)}return l.default.cloneElement(e,{key:i})})}let h=function(e){let{children:t}=e,r=(0,l.useContext)(u.AmpStateContext),n=(0,l.useContext)(d.HeadManagerContext);return(0,a.jsx)(s.default,{reduceComponentsToState:g,headManager:n,inAmpMode:(0,c.isInAmpMode)(r),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let l=r(3604),n=r(8012);function o(){return(0,l.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2563:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return r(499)}])},8012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}}),r(7908);let l=r(3604);r(216);let n={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};function o(e){let{status:t,message:r}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:t+": "+r}),(0,l.jsx)("div",{style:n.error,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,l.jsx)("h1",{className:"next-error-h1",style:n.h1,children:t}),(0,l.jsx)("div",{style:n.desc,children:(0,l.jsx)("h2",{style:n.h2,children:r})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{var t=t=>e(e.s=t);e.O(0,[733,107,358],()=>t(2563)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{919:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_d65c78",variable:"__variable_d65c78"}},1769:()=>{},5936:(e,t,a)=>{"use strict";a.d(t,{Hf:()=>l});var r=a(6662);r.env.EMAILS_DIR_RELATIVE_PATH,r.env.USER_PROJECT_LOCATION,r.env.EMAILS_DIR_ABSOLUTE_PATH;let l="true"===r.env.NEXT_PUBLIC_IS_BUILDING;r.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT},5991:e=>{e.exports={style:{fontFamily:"'sfMono', 'sfMono Fallback'"},className:"__className_a0e4c0",variable:"__variable_a0e4c0"}},7473:(e,t,a)=>{"use strict";a.d(t,{a:()=>i});var r=a(216),l=a(9236);let i=e=>{let t=(0,r.useRef)(null);(0,r.useEffect)(()=>{t.current||(t.current=(0,l.io)());let a=t.current;return a.on("reload",t=>{console.debug("Reloading..."),e(t)}),()=>{a.off()}},[e])}},8344:(e,t,a)=>{"use strict";a.d(t,{EmailsProvider:()=>d,J:()=>_});var r=a(3604),l=a(216),i=a(9992);let o=(0,i.createServerReference)("7f4ba0185c6904a1b38dc42b2c4403cbe7f4ba13d9",i.callServer,void 0,i.findSourceMapURL,"getEmailsDirectoryMetadataAction");var n=a(5936),s=a(7473);let c=(0,l.createContext)(void 0),_=()=>{let e=(0,l.useContext)(c);if(void 0===e)throw Error("Cannot call `useEmail()` outside of an EmailsContext provider!");return e},d=e=>{let[t,a]=(0,l.useState)(e.initialEmailsDirectoryMetadata);return n.Hf||(0,s.a)(async()=>{let t=await o(e.initialEmailsDirectoryMetadata.absolutePath);if(t)a(t);else throw Error("Hot reloading: unable to find the emails directory to update the sidebar")}),(0,r.jsx)(c.Provider,{value:{emailsDirectoryMetadata:t},children:e.children})}},8920:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,1769,23)),Promise.resolve().then(a.t.bind(a,919,23)),Promise.resolve().then(a.t.bind(a,5991,23)),Promise.resolve().then(a.bind(a,8344))}},e=>{var t=t=>e(e.s=t);e.O(0,[933,589,733,107,358],()=>t(8920)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{919:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_d65c78",variable:"__variable_d65c78"}},1769:()=>{},5936:(e,t,a)=>{"use strict";a.d(t,{Hf:()=>l});var r=a(6662);r.env.EMAILS_DIR_RELATIVE_PATH,r.env.USER_PROJECT_LOCATION,r.env.EMAILS_DIR_ABSOLUTE_PATH;let l="true"===r.env.NEXT_PUBLIC_IS_BUILDING;r.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT},5991:e=>{e.exports={style:{fontFamily:"'sfMono', 'sfMono Fallback'"},className:"__className_a0e4c0",variable:"__variable_a0e4c0"}},6981:(e,t,a)=>{"use strict";a.d(t,{EmailsProvider:()=>d,J:()=>_});var r=a(3604),l=a(216),i=a(9992);let o=(0,i.createServerReference)("7fca40254433a83780eaf474dbafc22eb134d0f17f",i.callServer,void 0,i.findSourceMapURL,"getEmailsDirectoryMetadataAction");var n=a(5936),s=a(7473);let c=(0,l.createContext)(void 0),_=()=>{let e=(0,l.useContext)(c);if(void 0===e)throw Error("Cannot call `useEmail()` outside of an EmailsContext provider!");return e},d=e=>{let[t,a]=(0,l.useState)(e.initialEmailsDirectoryMetadata);return n.Hf||(0,s.a)(async()=>{let t=await o(e.initialEmailsDirectoryMetadata.absolutePath);if(t)a(t);else throw Error("Hot reloading: unable to find the emails directory to update the sidebar")}),(0,r.jsx)(c.Provider,{value:{emailsDirectoryMetadata:t},children:e.children})}},7473:(e,t,a)=>{"use strict";a.d(t,{a:()=>i});var r=a(216),l=a(9236);let i=e=>{let t=(0,r.useRef)(null);(0,r.useEffect)(()=>{t.current||(t.current=(0,l.io)());let a=t.current;return a.on("reload",t=>{console.debug("Reloading..."),e(t)}),()=>{a.off()}},[e])}},8920:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,1769,23)),Promise.resolve().then(a.t.bind(a,919,23)),Promise.resolve().then(a.t.bind(a,5991,23)),Promise.resolve().then(a.bind(a,6981))}},e=>{var t=t=>e(e.s=t);e.O(0,[933,589,733,107,358],()=>t(8920)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{8814:(A,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>s});let s={src:"/_next/static/media/logo.2ce2a759.png",height:359,width:359,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAP1BMVEUYQFEbSV8SNEQUOUokYn4fVW4XR1scTWQjS14UOUkPLjwaT2ckXnhdgZFlj6JXi6JVk69Kb4A8hqc5c45WosQu6WxiAAAACnRSTlP+2N7/Vv557P7zZszF7AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAD5JREFUeJwVxkcSwDAIALFNcAXc/f+3ZqKTCNlitBzIWsyKPkDrvQFSxlrjj8xzpoCy790iVHV315dUAWr6AErQAhJo4AeDAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},8842:(A,e,i)=>{Promise.resolve().then(i.t.bind(i,9681,23)),Promise.resolve().then(i.t.bind(i,3902,23)),Promise.resolve().then(i.bind(i,8814)),Promise.resolve().then(i.bind(i,3566)),Promise.resolve().then(i.bind(i,507)),Promise.resolve().then(i.bind(i,1494)),Promise.resolve().then(i.bind(i,7608)),Promise.resolve().then(i.bind(i,1875))}},A=>{var e=e=>A(A.s=e);A.O(0,[979,589,293,902,484,733,107,358],()=>e(8842)),_N_E=A.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[719],{2638:(e,t,a)=>{"use strict";a.d(t,{o:()=>g,PreviewProvider:()=>j});var r=a(3604),s=a(66),l=a(216),n=a(5936),i=a(9992);let o=(0,i.createServerReference)("7fdcd4fab97562dd4f2e439d42773821467ef483b9",i.callServer,void 0,i.findSourceMapURL,"getEmailPathFromSlug"),c=(0,i.createServerReference)("7fe751d0e24e582efaeba4ce3d8cc1db9aa6254131",i.callServer,void 0,i.findSourceMapURL,"renderEmailByPath");var d=a(8344);let u=e=>{let t=e.split(".");return t.length>1?t.slice(0,-1).join("."):e},h=(e,t)=>{let a=e.replace(t.relativePath,"").split("/").filter(Boolean);if(1===a.length){let e=u(a[0]);return t.emailFilenames.includes(e)}let r=t.subDirectories.find(e=>e.directoryName===a[0]);return void 0!==r&&h(e,r)};var m=a(7473);let x=(e,t)=>{let[a,r]=(0,l.useState)(t),{emailsDirectoryMetadata:s}=(0,d.J)();return n.Hf||(0,m.a)(async t=>{for await(let a of t){let t=a.filename;if(!h(t,s))continue;let l=await o(t),n=await c(l,!0);l===e&&r(n)}}),a},p={},f=(e,t,a)=>((0,l.useEffect)(()=>{"markup"in t?p[e]=t:void 0!==a&&"markup"in a&&void 0===p[e]&&(p[e]=a)},[t,e,a]),"error"in t?p[e]:t),g=(0,l.createContext)(void 0),j=e=>{let{emailSlug:t,emailPath:a,serverRenderingResult:l,children:i}=e,o=(0,s.useRouter)(),c=x(a,l),d=f(a,c,l);return n.Hf||(0,m.a)(e=>{let a=e.find(e=>e.filename.includes(t));void 0!==a&&"unlink"===a.event&&o.push("/")}),(0,r.jsx)(g.Provider,{value:{emailPath:a,emailSlug:t,renderedEmailMetadata:d,renderingResult:c},children:i})}},3726:(e,t,a)=>{"use strict";a.d(t,{default:()=>Q});var r=a(3604),s=a(66),l=a(216),n=a(3113),i=a(1026),o=a(1833),c=a(3566),d=a(507);a(5110),a(253),a(801);var u=a(7027),h=a(3040);let m=l.forwardRef((e,t)=>{let{as:a="span",size:s="2",color:l="gray",transform:n,weight:i="normal",className:o,children:c,...d}=e;return(0,r.jsx)(u.DX,{className:(0,h.cn)(o,n,x(s),p(l),f(i)),ref:t,...d,children:(0,r.jsx)(a,{children:c})})}),x=e=>{switch(e){case"1":return"text-xs";case void 0:case"2":return"text-sm";case"3":return"text-base";case"4":return"text-lg";case"5":return["text-17px","md:text-xl tracking-[-0.16px]"];case"6":return"text-2xl tracking-[-0.288px]";case"7":return"text-[28px] leading-[34px] tracking-[-0.416px]";case"8":return"text-[35px] leading-[42px] tracking-[-0.64px]";case"9":return"text-6xl leading-[73px] tracking-[-0.896px]";default:return(0,h.HB)(e)}},p=e=>{switch(e){case"white":return"text-slate-12";case void 0:case"gray":return"text-slate-11";default:return(0,h.HB)(e)}},f=e=>{switch(e){case void 0:case"normal":return"font-normal";case"medium":return"font-medium";default:return(0,h.HB)(e)}};m.displayName="Text";var g=a(1875),j=a(4211),b=a(6886);let v={type:"spring",stiffness:2e3,damping:80,mass:1};var w=a(4582);let y=l.forwardRef((e,t)=>{let{children:a,className:s,...l}=e;return(0,r.jsx)("button",{type:"button",...l,className:(0,h.cn)("focus:ring-gray-8 rounded text-slate-11 transition duration-200 ease-in-out hover:text-slate-12 focus:text-slate-12 focus:outline-none focus:ring-2",s),ref:t,children:a})});y.displayName="IconButton";var C=a(5045),k=a(4524);let N=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsxs)(k.z,{ref:t,...a,children:[(0,r.jsx)("path",{d:"M9 6.75H7.75C6.64543 6.75 5.75 7.64543 5.75 8.75V17.25C5.75 18.3546 6.64543 19.25 7.75 19.25H16.25C17.3546 19.25 18.25 18.3546 18.25 17.25V8.75C18.25 7.64543 17.3546 6.75 16.25 6.75H15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M14 8.25H10C9.44772 8.25 9 7.80228 9 7.25V5.75C9 5.19772 9.44772 4.75 10 4.75H14C14.5523 4.75 15 5.19772 15 5.75V7.25C15 7.80228 14.5523 8.25 14 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M9.75 12.25H14.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M9.75 15.25H14.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})});N.displayName="IconClipboard";let S=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(k.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M4.75 14.75v1.5a3 3 0 0 0 3 3h8.5a3 3 0 0 0 3-3v-1.5M12 14.25v-9.5M8.75 10.75l3.25 3.5 3.25-3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})})});S.displayName="IconDownload";var L=a(1966);let R=e=>{let{markups:t,activeLang:a,setActiveLang:s}=e,l=t.find(e=>{let{language:t}=e;return a===t});if(!l)throw Error("No markup found for the active language!",{cause:{activeLang:a,markups:t}});return(0,r.jsxs)("div",{className:"relative max-h-[650px] w-full h-full whitespace-pre rounded-md border border-slate-6 text-sm",style:{lineHeight:"130%",background:"linear-gradient(145.37deg, rgba(255, 255, 255, 0.09) -8.75%, rgba(255, 255, 255, 0.027) 83.95%)",boxShadow:"rgb(0 0 0 / 10%) 0px 5px 30px -5px"},children:[(0,r.jsxs)("div",{className:"h-9 border-b border-slate-6",children:[(0,r.jsx)("div",{className:"flex",children:(0,r.jsx)(j.o,{id:"code",children:t.map(e=>{let{language:t}=e,l=a===t;return(0,r.jsxs)(b.P.button,{className:"relative px-4 py-[8px] font-sans text-sm font-medium transition duration-200 ease-in-out hover:text-slate-12 ".concat(a!==t?"text-slate-11":"text-slate-12"),onClick:()=>{s(t)},children:[l?(0,r.jsx)(b.P.span,{animate:{opacity:1},className:"absolute bottom-0 left-0 right-0 top-0 bg-slate-4",exit:{opacity:0},initial:{opacity:0},layoutId:"code",transition:v}):null,w.A[t]]},t)})})}),(0,r.jsx)(M,{content:l.content}),(0,r.jsx)(T,{content:l.content,filename:"email.".concat(l.language)})]}),(0,r.jsx)("div",{className:"h-[calc(100%-2.25rem)]",children:(0,r.jsx)(d.Code,{language:a,children:l.content})})]})},M=e=>{let{content:t}=e,[a,s]=l.useState(!1),n=l.useRef(void 0);return l.useEffect(()=>{s(!1),clearTimeout(n.current),n.current=void 0},[t]),(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,className:"absolute right-2 top-2 hidden md:block",children:(0,r.jsx)(y,{onClick:async()=>{s(!0),await (0,h.eM)(t),n.current=setTimeout(()=>{s(!1)},3e3)},children:a?(0,r.jsx)(C.i,{}):(0,r.jsx)(N,{})})}),(0,r.jsx)(L.m.Content,{children:"Copy to Clipboard"})]})},T=e=>{let{content:t,filename:a}=e,s=l.useMemo(()=>{let e=new File([t],a);return URL.createObjectURL(e)},[t,a]),n=l.useSyncExternalStore(()=>()=>{},()=>s,()=>void 0);return(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,className:"text-gray-11 absolute right-8 top-2 hidden md:block",children:(0,r.jsx)("a",{className:"text-slate-11 transition duration-200 ease-in-out hover:text-slate-12",download:a,href:n,children:(0,r.jsx)(S,{})})}),(0,r.jsx)(L.m.Content,{children:"Download"})]})},H=e=>{var t,a;let r=t=>{let a=e.getBoundingClientRect();document.dispatchEvent(new MouseEvent("mousemove",{...t,clientX:t.clientX+a.x,clientY:t.clientY+a.y}))},s=e=>{document.dispatchEvent(new MouseEvent("mouseup",e))};return null==(t=e.contentDocument)||t.addEventListener("mousemove",r),null==(a=e.contentDocument)||a.addEventListener("mouseup",s),()=>{var t,a;null==(t=e.contentDocument)||t.removeEventListener("mousemove",r),null==(a=e.contentDocument)||a.removeEventListener("mouseup",s)}},P=e=>{let{width:t,height:a,onResize:s,onResizeEnd:n,children:i,maxHeight:o,maxWidth:c,minHeight:d,minWidth:m,...x}=e,p=(0,l.useRef)(null),f=(0,l.useRef)(null),g=(0,l.useCallback)(()=>{f.current&&document.removeEventListener("mousemove",f.current),document.removeEventListener("mouseup",g),null==n||n()},[]),j=e=>{f.current=t=>{if(0===t.button&&p.current){let a="east"===e||"west"===e,r=a?t.clientX:t.clientY,l=p.current.getBoundingClientRect();s(2*Math.abs(r-(a?l.x+l.width/2:l.y+l.height/2)),e)}else g()},document.addEventListener("mouseup",g),document.addEventListener("mousemove",f.current)};return(0,l.useEffect)(()=>{if(window.document)return()=>{g()}},[]),(0,r.jsxs)("div",{...x,className:(0,h.cn)("relative mx-auto my-auto box-content",x.className),children:[(0,r.jsx)("div",{"aria-label":"resize-west","aria-valuenow":t,"aria-valuemin":m,"aria-valuemax":c,className:"-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-2 cursor-w-resize p-2 [user-drag:none]",onDragStart:e=>e.preventDefault(),draggable:"false",onMouseDown:()=>{j("west")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-8 w-1 rounded-md bg-black/30"})}),(0,r.jsx)("div",{"aria-label":"resize-east","aria-valuenow":t,"aria-valuemin":m,"aria-valuemax":c,onDragStart:e=>e.preventDefault(),className:"-translate-x-full -translate-y-1/2 absolute top-1/2 left-full cursor-e-resize p-2 [user-drag:none]",draggable:"false",onMouseDown:()=>{j("east")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-8 w-1 rounded-md bg-black/30"})}),(0,r.jsx)("div",{"aria-label":"resize-north","aria-valuenow":a,"aria-valuemin":d,"aria-valuemax":o,onDragStart:e=>e.preventDefault(),className:"-translate-x-1/2 -translate-y-1/2 absolute top-0 left-1/2 cursor-n-resize p-2 [user-drag:none]",draggable:"false",onMouseDown:()=>{j("north")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-1 w-8 rounded-md bg-black/30"})}),(0,r.jsx)("div",{"aria-label":"resize-south","aria-valuenow":a,"aria-valuemin":d,"aria-valuemax":o,onDragStart:e=>e.preventDefault(),className:"-translate-x-1/2 -translate-y-1/2 absolute top-full left-1/2 cursor-s-resize p-2 [user-drag:none]",draggable:"false",onMouseDown:()=>{j("south")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-1 w-8 rounded-md bg-black/30"})}),(0,r.jsx)(u.DX,{ref:p,children:i})]})};var I=a(8815);let E=e=>{let{markup:t}=e,[a,s]=l.useState(""),[n,o]=l.useState("Testing React Email"),[d,u]=l.useState(!1),[h,x]=l.useState(!1),p=async e=>{try{e.preventDefault(),u(!0);let r=await fetch("https://react.email/api/send/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:a,subject:n,html:t})});if(429===r.status){let{error:e}=await r.json();i.oR.error(e)}i.oR.success("Email sent! Check your inbox.")}catch(e){i.oR.error("Something went wrong. Please try again.")}finally{u(!1)}};return(0,r.jsxs)(I.bL,{onOpenChange:()=>{h?(document.body.classList.remove("popup-open"),x(!1)):(document.body.classList.add("popup-open"),x(!0))},open:h,children:[(0,r.jsx)(I.l9,{asChild:!0,children:(0,r.jsx)("button",{className:"box-border flex h-5 w-20 items-center justify-center self-center rounded-lg border border-slate-6 bg-slate-2 px-4 py-4 text-center font-sans text-sm text-slate-11 outline-none transition duration-300 ease-in-out hover:border-slate-10 hover:text-slate-12",type:"submit",children:"Send"})}),(0,r.jsx)(I.Mz,{}),(0,r.jsx)(I.ZL,{children:(0,r.jsx)(I.UC,{align:"end",className:"-mt-10 w-80 rounded-lg border border-slate-6 bg-black/70 p-3 font-sans text-slate-11 shadow-md backdrop-blur-lg font-sans",sideOffset:48,children:(0,r.jsxs)("form",{className:"mt-1",onSubmit:e=>void p(e),children:[(0,r.jsx)("label",{className:"mb-2 block text-xs uppercase text-slate-10",htmlFor:"to",children:"Recipient"}),(0,r.jsx)("input",{autoFocus:!0,className:"mb-3 w-full appearance-none rounded-lg border border-slate-6 bg-slate-3 px-2 py-1 text-sm text-slate-12 placeholder-slate-10 outline-none transition duration-300 ease-in-out focus:ring-1 focus:ring-slate-10",defaultValue:a,id:"to",onChange:e=>{s(e.target.value)},placeholder:"you@example.com",required:!0,type:"email"}),(0,r.jsx)("label",{className:"mb-2 mt-1 block text-xs uppercase text-slate-10",htmlFor:"subject",children:"Subject"}),(0,r.jsx)("input",{className:"mb-3 w-full appearance-none rounded-lg border border-slate-6 bg-slate-3 px-2 py-1 text-sm text-slate-12 placeholder-slate-10 outline-none transition duration-300 ease-in-out focus:ring-1 focus:ring-slate-10",defaultValue:n,id:"subject",onChange:e=>{o(e.target.value)},placeholder:"My Email",required:!0,type:"text"}),(0,r.jsx)("input",{className:"appearance-none checked:bg-blue-500",type:"checkbox"}),(0,r.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,r.jsxs)(m,{className:"inline-block",size:"1",children:["Powered by"," ",(0,r.jsx)("a",{className:"text-white/85 transition duration-300 ease-in-out hover:text-slate-12",href:"https://resend.com",rel:"noreferrer",target:"_blank",children:"Resend"})]}),(0,r.jsx)(c.Button,{className:"disabled:border-transparent disabled:bg-slate-11",disabled:0===n.length||0===a.length||d,type:"submit",children:"Send"})]})]})})})]})};var z=a(4605),D=a(1293);let V=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(k.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M9.75 15.25H17.25C18.3546 15.25 19.25 14.3546 19.25 13.25V6.75C19.25 5.64543 18.3546 4.75 17.25 4.75H6.75C5.64543 4.75 4.75 5.64543 4.75 6.75V13.25C4.75 14.3546 5.64543 15.25 6.75 15.25H9.75ZM9.75 15.25C9.75 15.25 10 18.25 8 19.25H16C14 18.25 14.25 15.25 14.25 15.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})});V.displayName="IconMonitor";let _=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(k.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M17.4 15L21 11.5L17.4 8M6.6 8L3 11.5L6.6 15M14.25 4.5L9.75 18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})});_.displayName="IconSource";let O=e=>{let{activeView:t,setActiveView:a}=e;return(0,r.jsxs)(D.bL,{"aria-label":"View mode",className:"inline-block items-center bg-slate-2 border border-slate-6 rounded-md overflow-hidden h-[36px]",onValueChange:e=>{e&&a(e)},type:"single",value:t,children:[(0,r.jsx)(D.q7,{value:"preview",children:(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,children:(0,r.jsxs)("div",{className:(0,h.cn)("px-3 py-2 transition ease-in-out duration-200 relative hover:text-slate-12",{"text-slate-11":"desktop"!==t,"text-slate-12":"desktop"===t}),children:["preview"===t&&(0,r.jsx)(b.P.span,{animate:{opacity:1},className:"absolute left-0 right-0 top-0 bottom-0 bg-slate-4",exit:{opacity:0},initial:{opacity:0},layoutId:"topbar-tabs",transition:v}),(0,r.jsx)(V,{})]})}),(0,r.jsx)(L.m.Content,{children:"Preview"})]})}),(0,r.jsx)(D.q7,{value:"source",children:(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,children:(0,r.jsxs)("div",{className:(0,h.cn)("px-3 py-2 transition ease-in-out duration-200 relative hover:text-slate-12",{"text-slate-11":"source"!==t,"text-slate-12":"source"===t}),children:["source"===t&&(0,r.jsx)(b.P.span,{animate:{opacity:1},className:"absolute left-0 right-0 top-0 bottom-0 bg-slate-4",exit:{opacity:0},initial:{opacity:0},layoutId:"topbar-tabs",transition:v}),(0,r.jsx)(_,{})]})}),(0,r.jsx)(L.m.Content,{children:"Code"})]})})]})};var F=a(2074),U=a(2031);let B=[{name:"Desktop",dimensions:{width:600,height:1024}},{name:"Mobile",dimensions:{width:375,height:812}}],W={active:{width:"3.5rem",padding:"0 0 0 0.5rem"},inactive:{width:"0"}},A=e=>{let{icon:t,isActive:a,label:s,onBlur:n,onChange:i,setIsActive:o,value:c,hasBorder:d}=e,u=l.useRef(null);return l.useEffect(()=>{a&&u.current&&u.current.focus()},[a]),(0,r.jsx)(L.m.Provider,{children:(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,children:(0,r.jsxs)(b.P.button,{onClick:()=>{a?o(!1):o(!0)},className:(0,h.cn)("relative flex items-center justify-center p-2",{"border-slate-6 border-r":d}),children:[t,(0,r.jsx)(b.P.input,{ref:u,initial:!1,animate:a?"active":"inactive",className:"arrow-hide relative flex h-8 items-center justify-center bg-black text-sm outline-none",onChange:e=>i(Number.parseInt(e.currentTarget.value)),onBlur:n,type:"number",value:c,variants:W})]})}),(0,r.jsxs)(L.m.Content,{children:[(0,r.jsxs)("span",{children:[s,": "]}),(0,r.jsxs)("span",{className:"font-mono",children:[c,"px"]})]})]})})},Z=e=>{let{name:t,dimensions:a,onSelect:s}=e;return(0,r.jsxs)(F.q7,{className:"group flex w-full cursor-pointer select-none items-center justify-between rounded-md py-1.5 pr-1 pl-2 text-sm outline-none transition-colors data-[highlighted]:bg-slate-5",onClick:()=>s(a),children:[t,(0,r.jsxs)("span",{className:"flex h-fit items-center rounded-full bg-slate-6 px-2 py-1 font-medium text-slate-11 text-xs",children:[a.width,"x",a.height]})]})},Y=e=>{let{viewWidth:t,viewHeight:a,setViewWidth:s,setViewHeight:n}=e,[i,o]=l.useState(!1),[c,d]=l.useState(null),u=e=>{s(e.width),n(e.height)},m=()=>{d(null)};return(0,r.jsxs)("div",{className:"relative flex h-9 w-fit overflow-hidden rounded-lg border border-slate-6 text-sm transition-colors duration-300 ease-in-out focus-within:border-slate-8 hover:border-slate-8",children:[(0,r.jsx)(A,{icon:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"}),(0,r.jsx)("path",{d:"M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"}),(0,r.jsx)("path",{d:"M4 12H2"}),(0,r.jsx)("path",{d:"M10 12H8"}),(0,r.jsx)("path",{d:"M16 12h-2"}),(0,r.jsx)("path",{d:"M22 12h-2"})]}),value:t,onChange:s,isActive:"width"===c,setIsActive:e=>d(e?"width":null),onBlur:m,label:"Width",hasBorder:!0}),(0,r.jsx)(A,{icon:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3"}),(0,r.jsx)("path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3"}),(0,r.jsx)("path",{d:"M12 20v2"}),(0,r.jsx)("path",{d:"M12 14v2"}),(0,r.jsx)("path",{d:"M12 8v2"}),(0,r.jsx)("path",{d:"M12 2v2"})]}),value:a,onChange:n,isActive:"height"===c,setIsActive:e=>d(e?"height":null),onBlur:m,label:"Height"}),(0,r.jsxs)(F.bL,{open:i,onOpenChange:o,children:[(0,r.jsx)(F.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:"relative flex items-center justify-center overflow-hidden bg-slate-5 p-2 text-slate-11 text-sm leading-none outline-none transition-colors ease-linear focus-within:text-slate-12 hover:text-slate-12 focus:text-slate-12",children:[(0,r.jsx)("span",{className:"sr-only",children:"View presets"}),(0,r.jsx)(U.R,{className:(0,h.cn)("transform transition-transform duration-200 ease-[cubic-bezier(.36,.66,.6,1)]",{"-rotate-180":i})})]})}),(0,r.jsx)(F.ZL,{children:(0,r.jsx)(F.UC,{align:"end",className:"flex min-w-[12rem] flex-col gap-2 rounded-md border border-slate-8 border-solid bg-black px-2 py-2 text-white",sideOffset:5,children:B.map(e=>(0,r.jsx)(Z,{name:e.name,dimensions:e.dimensions,onSelect:u},e.name))})})]})]})};var J=a(2638);let X=(e,t,a)=>Math.min(Math.max(e,t),a),q=(e,t,a)=>{let[r,s]=(0,l.useState)(e);return[X(r,t,a),e=>{"function"==typeof e?s(r=>{let s=X(r,t,a);return X(e(s),t,a)}):s(X(e,t,a))}]},G=e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"absolute inset-0 z-50 bg-black/80"}),(0,r.jsx)("div",{className:"absolute left-[50%] top-[50%] z-50 grid min-h-[50vh] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-t-sm border border-t-4 bg-white p-6 text-black shadow-lg duration-200 sm:rounded-lg md:max-w-[568px] lg:max-w-[968px]",children:(0,r.jsxs)("div",{className:"flex min-w-0 max-w-full flex-col space-y-1.5",children:[(0,r.jsxs)("h2",{className:"flex flex-shrink items-center gap-4 pb-2 text-lg font-semibold leading-none tracking-tight",children:[(0,r.jsxs)("svg",{className:"h-6 w-6 font-extrabold text-red-600",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,r.jsx)("path",{d:"M12 9v4"}),(0,r.jsx)("path",{d:"M12 17h.01"})]}),e.error.name,": ",e.error.message]}),e.error.stack?(0,r.jsx)("div",{className:"flex-grow scroll-px-4 overflow-x-auto rounded-lg bg-red-500 p-2 text-sm text-gray-100",children:(0,r.jsx)("pre",{className:"w-full min-w-0 font-mono leading-7",children:e.error.stack})}):void 0]})})]}),Q=e=>{var t,a;let{emailTitle:c,className:d,...u}=e,{renderingResult:m,renderedEmailMetadata:x}=(0,l.use)(J.o),p=(0,s.useRouter)(),f=(0,s.usePathname)(),j=(0,s.useSearchParams)(),b=null!=(t=j.get("view"))?t:"preview",v=null!=(a=j.get("lang"))?a:"jsx",w=void 0!==x,y="error"in m,[C,k]=(0,l.useState)(Number.POSITIVE_INFINITY),[N,S]=(0,l.useState)(Number.POSITIVE_INFINITY),M=j.get("width"),T=j.get("height"),[I,D]=q(M?Number.parseInt(M):600,100,C),[V,_]=q(T?Number.parseInt(T):1024,100,N),F=(0,o.YQ)(()=>{let e=new URLSearchParams(j);e.set("width",I.toString()),e.set("height",V.toString()),p.push("".concat(f,"?").concat(e.toString()).concat(location.hash))},300),{toggled:U}=(0,z.S)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(g.Topbar,{emailTitle:c,children:[(0,r.jsx)(Y,{setViewHeight:e=>{_(e),(0,n.flushSync)(()=>{F()})},setViewWidth:e=>{D(e),(0,n.flushSync)(()=>{F()})},viewHeight:V,viewWidth:I}),(0,r.jsx)(O,{activeView:b,setActiveView:e=>{let t=new URLSearchParams(j);t.set("view",e),p.push("".concat(f,"?").concat(t.toString()).concat(location.hash))}}),w?(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(E,{markup:x.markup})}):null]}),(0,r.jsxs)("div",{...u,className:(0,h.cn)("h-[calc(100%-3.5rem-2.375rem)] will-change-[height] flex p-4 transition-[height] duration-300","preview"===b&&"bg-gray-200",U&&"h-[calc(100%-3.5rem-13rem)]",d),ref:e=>{let t=new ResizeObserver(e=>{let[t]=e;t&&(k(t.contentRect.width),S(t.contentRect.height))});return e&&t.observe(e),()=>{t.disconnect()}},children:[y?(0,r.jsx)(G,{error:m.error}):null,w?(0,r.jsxs)(r.Fragment,{children:["preview"===b&&(0,r.jsx)(P,{minHeight:100,minWidth:100,maxHeight:N,maxWidth:C,height:V,onResizeEnd:()=>{F()},onResize:(e,t)=>{"east"===t||"west"===t?D(Math.round(e)):_(Math.round(e))},width:I,children:(0,r.jsx)("iframe",{className:"solid max-h-full rounded-lg bg-white",ref:e=>{if(e)return H(e)},srcDoc:x.markup,style:{width:"".concat(I,"px"),height:"".concat(V,"px")},title:c})}),"source"===b&&(0,r.jsx)("div",{className:"h-full w-full",children:(0,r.jsx)("div",{className:"m-auto h-full flex max-w-3xl p-6",children:(0,r.jsx)(L.m.Provider,{children:(0,r.jsx)(R,{activeLang:v,markups:[{language:"jsx",content:x.reactMarkup},{language:"markup",content:x.markup},{language:"markdown",content:x.plainText}],setActiveLang:e=>{let t=new URLSearchParams(j);t.set("view","source"),t.set("lang",e);let a=j.get("lang")===e;p.push("".concat(f,"?").concat(t.toString()).concat(a?location.hash:""))}})})})})]}):null,(0,r.jsx)(i.l$,{})]})]})}},4605:(e,t,a)=>{"use strict";a.d(t,{Toolbar:()=>X,S:()=>U});var r=a(3604),s=a(7335),l=a(4211),n=a(66),i=a(216),o=a(5936),c=a(2638),d=a(3040),u=a(2031),h=a(5045),m=a(4524);let x=i.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(m.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M12 4C7.58173 4 4 7.58172 4 12C4 16.4182 7.58173 20 12 20C16.4183 20 20 16.4182 20 12C20 7.58172 16.4183 4 12 4ZM5.14754 12C5.14754 8.21549 8.21551 5.14754 12 5.14754C15.7845 5.14754 18.8525 8.21549 18.8525 12C18.8525 15.7844 15.7845 18.8525 12 18.8525C8.21551 18.8525 5.14754 15.7844 5.14754 12ZM12.906 8.37648C12.906 8.87682 12.5004 9.28243 12 9.28243C11.4997 9.28243 11.0941 8.87682 11.0941 8.37648C11.0941 7.87613 11.4997 7.47053 12 7.47053C12.5004 7.47053 12.906 7.87613 12.906 8.37648ZM10.1883 10.1884H10.7922H12.0002C12.3337 10.1884 12.6041 10.4588 12.6041 10.7924V15.0201H13.2081H13.8121V16.2281H13.2081H12.0002H10.7922H10.1883V15.0201H10.7922H11.3962V11.3963H10.7922H10.1883V10.1884Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});x.displayName="IconInfo";let p=i.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(m.z,{ref:t,...a,children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.9354 12C17.9354 9.01537 15.5828 6.05264 11.9202 6.05264C8.96229 6.05264 7.50033 8.21724 6.87735 9.36841H8.72625C9.02024 9.36841 9.25858 9.60406 9.25858 9.89473C9.25858 10.1854 9.02024 10.421 8.72625 10.421H5.53232C5.23833 10.421 5 10.1854 5 9.89473V6.73684C5 6.44617 5.23833 6.21052 5.53232 6.21052C5.82631 6.21052 6.06465 6.44617 6.06465 6.73684V8.64548C6.81471 7.33819 8.54959 5 11.9202 5C16.2456 5 19 8.51094 19 12C19 15.4891 16.2456 19 11.9202 19C9.8507 19 8.12769 18.1904 6.9009 16.9562C6.24405 16.2954 5.73107 15.5148 5.38132 14.6744C5.26942 14.4057 5.39911 14.0981 5.67098 13.9875C5.94285 13.8768 6.25395 14.0051 6.36583 14.2738C6.66482 14.9921 7.10262 15.6574 7.66023 16.2183C8.69486 17.2593 10.1475 17.9474 11.9202 17.9474C15.5828 17.9474 17.9354 14.9846 17.9354 12Z",fill:"currentColor"})})});p.displayName="IconReload";var f=a(1026);let g={family:{gmail:"Gmail",outlook:"Outlook",yahoo:"Yahoo! Mail","apple-mail":"Apple Mail",aol:"AOL",thunderbird:"Mozilla Thunderbird",microsoft:"Microsoft","samsung-email":"Samsung Email",sfr:"SFR",orange:"Orange",protonmail:"ProtonMail",hey:"HEY","mail-ru":"Mail.ru",fastmail:"Fastmail",laposte:"LaPoste.net","t-online-de":"T-online.de","free-fr":"Free.fr",gmx:"GMX","web-de":"WEB.DE","ionos-1and1":"1&1",rainloop:"RainLoop","wp-pl":"WP.pl"}};var j=a(9992);let b=(0,j.createServerReference)("7f72c19f91882de288d5d66ebce96b9935c0910ca3",j.callServer,void 0,j.findSourceMapURL,"checkCompatibility");async function*v(e){let t=e.getReader();try{for(;;){let{value:e,done:a}=await t.read();if(a)break;yield e}}finally{t.releaseLock()}}let w=e=>(0,r.jsxs)("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,r.jsx)("path",{d:"M10.8777 8.99999L6.87766 1.99999C6.79044 1.84609 6.66396 1.71808 6.51112 1.62902C6.35828 1.53997 6.18455 1.49304 6.00766 1.49304C5.83077 1.49304 5.65704 1.53997 5.5042 1.62902C5.35136 1.71808 5.22488 1.84609 5.13766 1.99999L1.13766 8.99999C1.0495 9.15267 1.00327 9.32594 1.00366 9.50224C1.00405 9.67855 1.05105 9.85161 1.13988 10.0039C1.22872 10.1562 1.35623 10.2823 1.50951 10.3694C1.66278 10.4565 1.83636 10.5016 2.01266 10.5H10.0127C10.1881 10.4998 10.3604 10.4535 10.5123 10.3656C10.6642 10.2778 10.7903 10.1515 10.8779 9.99955C10.9656 9.84756 11.0117 9.67518 11.0116 9.49973C11.0116 9.32428 10.9654 9.15193 10.8777 8.99999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.0127 4.5V6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.0127 8.5H6.01853",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});w.displayName="IconCircleWarning";var y=a(9681),C=a.n(y);let k=e=>{let{line:t,column:a,type:s}=e,l=new URLSearchParams((0,n.useSearchParams)());l.set("view","source"),"html"===s?l.set("lang","markup"):"react"===s&&l.set("lang","jsx");let i="#L".concat(t);return(0,r.jsxs)(C(),{href:{search:l.toString(),hash:i},scroll:!1,className:"appearance-none underline mx-2",children:["L",t.toString().padStart(2,"0")]})},N=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)("table",{className:(0,d.cn)("group relative w-full border-collapse text-left text-slate-10 text-sm",a),children:(0,r.jsx)("tbody",{children:t})})};N.Row=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)("tr",{className:(0,d.cn)("border-collapse align-bottom border-slate-6 border-b last:border-b-0",a),...s,children:t})},N.Column=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)("td",{className:(0,d.cn)("py-1.5 align-bottom font-regular",a),...s,children:t})};let S=e=>{let{reactMarkup:t,emailPath:a,initialResults:r}=e,[s,l]=(0,i.useState)(r),[n,o]=(0,i.useState)(!1),c=(0,i.useRef)(!1);return[s,{loading:n,load:async()=>{if(c.current)return;c.current=!0,o(!0),l([]);let e=[];try{let r=await b(t,a);for await(let t of v(r))"error"===t.status&&l(a=>a?e=[...a,t]:[t])}catch(e){console.error(e),f.oR.error(JSON.stringify(e))}finally{o(!1),c.current=!1}return e}}]},L=e=>{let{results:t}=e;return(0,r.jsx)(N,{children:null==t?void 0:t.map((e,t)=>{let a=Object.entries(e.statsPerEmailClient).filter(e=>{let[,t]=e;return"error"===t.status}),s=a.map(e=>{let[t]=e;return g.family[t]}).join(", ");return(0,r.jsxs)(N.Row,{children:[(0,r.jsx)(N.Column,{children:(0,r.jsxs)("span",{className:"flex text-red-400 uppercase gap-2 items-center",children:[(0,r.jsx)(w,{}),(0,d.aj)(e.entry.title)]})}),(0,r.jsxs)(N.Column,{children:[a.length>0?"Not supported in ".concat(s):null,(0,r.jsx)("a",{href:e.entry.url,className:"underline ml-2 decoration-slate-9 decoration-1 hover:decoration-slate-11 transition-colors hover:text-slate-12",rel:"noreferrer",target:"_blank",children:"More ↗"})]}),(0,r.jsx)(N.Column,{className:"font-mono text-slate-11 text-right",children:(0,r.jsx)(k,{line:e.location.start.line,column:e.location.start.column,type:"react"})})]},t)})})};var R=a(6879);let M=(0,j.createServerReference)("7f2531660113da2906f7c722a7180398796b58becc",j.callServer,void 0,j.findSourceMapURL,"checkImages"),T=(0,j.createServerReference)("7f5fdd9ef950582fe3f8b858c3e168afe57c19baf3",j.callServer,void 0,j.findSourceMapURL,"checkLinks");async function*H(e){for await(let t of e)for await(let e of v(await t.getStream())){let a=t.mapValue(e);a&&(yield a)}}let P=e=>{let{markup:t,initialRows:r}=e,[s,l]=(0,i.useState)(r),n=function(e,t){return[{getStream:()=>M(e,t),mapValue(e){if(e&&"success"!==e.status)return{result:e,source:"image"}}},{getStream:()=>T(e),mapValue(e){if(e&&"success"!==e.status)return{result:e,source:"link"}}}]}(t,"location"in a.g?"".concat(a.g.location.protocol,"//").concat(a.g.location.host):""),[o,c]=(0,i.useState)(!1),d=(0,i.useRef)(!1);return[s,{loading:o,load:async()=>{if(!d.current){d.current=!0,c(!0),l([]);try{let e=[];for await(let t of H(n))l(a=>{if(!a)return[t];let r=[...a,t];return r.sort((e,t)=>"error"===e.result.status&&"warning"===t.result.status?-1:+("warning"===e.result.status&&"error"===t.result.status)),e=r,r});return e}finally{c(!1),d.current=!1}}}}]},I=e=>{let{rows:t}=e;return void 0===t?null:(0,r.jsx)(N,{children:t.map((e,t)=>{if("link"===e.source){let a=e.result.checks.find(e=>!1===e.passed),s=[];for(let t of e.result.checks)"fetch_attempt"===t.type&&t.metadata.fetchStatusCode&&s.push((0,r.jsxs)(r.Fragment,{children:["HTTP ",t.metadata.fetchStatusCode]}));return s.push((0,r.jsx)(k,{line:e.result.codeLocation.line,column:e.result.codeLocation.column,type:"html"})),(0,r.jsxs)(E,{status:e.result.status,children:[(0,r.jsx)(E.Name,{children:(0,d.aj)(a.type)}),(0,r.jsxs)(E.Description,{children:["security"===a.type?"Insecure URL, use HTTPS instead of HTTP":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=300&&a.metadata.fetchStatusCode<400?"There was a redirect, the content may have been moved":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=400?"The link is broken":null,"fetch_attempt"===a.type&&void 0===a.metadata.fetchStatusCode?"The link could not be reached":null,"syntax"===a.type?"The link is broken due to invalid syntax":null,(0,r.jsx)("span",{className:"ml-2 text-ellipsis overflow-hidden text-nowrap max-w-[30ch]",children:e.result.link})]}),(0,r.jsx)(E.Metadata,{children:s})]},t)}if("image"===e.source){let a=e.result.checks.find(e=>!1===e.passed),s=[];for(let t of e.result.checks)"image_size"===t.type&&t.metadata.byteCount&&s.push((0,R.A)(t.metadata.byteCount)),"fetch_attempt"===t.type&&t.metadata.fetchStatusCode&&s.push((0,r.jsxs)(r.Fragment,{children:["HTTP ",t.metadata.fetchStatusCode]}));return s.push((0,r.jsx)(k,{line:e.result.codeLocation.line,column:e.result.codeLocation.column,type:"html"})),(0,r.jsxs)(E,{status:e.result.status,children:[(0,r.jsx)(E.Name,{children:(0,d.aj)(a.type)}),(0,r.jsxs)(E.Description,{children:["security"===a.type?"Insecure URL, use HTTPS instead of HTTP":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=300&&a.metadata.fetchStatusCode<400?"There was a redirect, the image may have been moved":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=400?"The image is broken":null,"fetch_attempt"===a.type&&void 0===a.metadata.fetchStatusCode?"The image could not be reached":null,"syntax"===a.type?"The image is broken due to an invalid source":null,"accessibility"===a.type?"Missing alt text":null,"image_size"===a.type&&a.metadata.byteCount?"This image is too large, keep it under 1mb":null,(0,r.jsx)("span",{className:"ml-2 text-ellipsis overflow-hidden text-nowrap max-w-[30ch]",children:e.result.source})]}),(0,r.jsx)(E.Metadata,{children:s})]},t)}})})},E=e=>{let{children:t,className:a,status:s,...l}=e;return(0,r.jsx)(N.Row,{"data-status":s,...l,className:(0,d.cn)("group/result",a),children:t})};E.Name=e=>{let{children:t,...a}=e;return(0,r.jsx)(N.Column,{...a,children:(0,r.jsxs)("span",{className:"flex uppercase gap-2 items-center group-data-[status=error]/result:text-red-400 group-data-[status=warning]/result:text-orange-300",children:[(0,r.jsx)(w,{}),"string"==typeof t?(0,d.aj)(t):t]})})},E.Description=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)(N.Column,{...s,children:t})},E.Metadata=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)(N.Column,{align:"right",...s,className:(0,d.cn)("font-mono text-slate-11",a),children:i.Children.map(t,(e,t)=>(0,r.jsxs)(r.Fragment,{children:[t>0?" \xb7 ":null,e]}))})};let z=e=>{let{markup:t,plainText:a,initialResult:r}=e,[s,l]=(0,i.useState)(r),[n,o]=(0,i.useState)(!1),c=(0,i.useRef)(!1);return[s,{loading:n,load:async()=>{if(!c.current){c.current=!0,o(!0);try{let e=await fetch("https://react.email/api/check-spam",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:t,plainText:a})}),r=await e.json();if(!("error"in r))return l(r),r;f.oR.error(r.error)}catch(e){console.error(e),f.oR.error(JSON.stringify(e))}finally{o(!1),c.current=!1}}}}]},D=e=>{let{result:t}=e;return(0,r.jsx)(r.Fragment,{children:t?(0,r.jsxs)(N,{children:[(0,r.jsxs)(N.Row,{className:"sticky border-b top-0",children:[(0,r.jsx)(N.Column,{className:"uppercase",children:(0,r.jsxs)("span",{className:"flex gap-2 items-center",children:[(0,r.jsx)(w,{className:(0,d.cn)(0===t.points?"text-green-400":null,(t.points>0&&t.points,null),t.points>1.5?"text-yellow-100":null,t.points>3?"text-orange-400":null,t.points>=5?"text-red-400":null)}),"Score"]})}),(0,r.jsx)(N.Column,{children:0===t.points?"Congratulations! Your email is clean of abuse indicators.":"Higher scores are better"}),(0,r.jsxs)(N.Column,{className:"text-right tracking-tighter font-bold",children:[(0,r.jsx)("span",{className:(0,d.cn)("text-3xl",0===t.points?"text-green-400":null,(t.points>0&&t.points,null),t.points>1.5?"text-yellow-200":null,t.points>3?"text-orange-400":null,t.points>=5?"text-red-400":null),children:(10-t.points).toFixed(1)})," ",(0,r.jsx)("span",{className:"text-lg",children:"/ 10"})]})]}),(function(e,t){let a=[...e];return a.sort(t),a})(t.checks,(e,t)=>t.points-e.points).map(e=>(0,r.jsxs)(N.Row,{children:[(0,r.jsx)(N.Column,{className:"uppercase",children:(0,r.jsxs)("span",{className:"flex gap-2 items-center",children:[(0,r.jsx)(w,{className:(0,d.cn)(e.points>1?"text-yellow-200":null,e.points>2?"text-orange-400":null,e.points>3?"text-red-400":null)}),(0,d.aj)(e.name)]})}),(0,r.jsx)(N.Column,{children:e.description}),(0,r.jsxs)(N.Column,{className:(0,d.cn)("text-right font-mono tracking-tighter",e.points>1?"text-yellow-200":null,e.points>2?"text-orange-400":null,e.points>3?"text-red-400":null),children:["-",e.points.toFixed(1)]})]},e.name))]}):null})};var V=a(6886),_=a(1966);let O=e=>{let{children:t,className:a,active:s,tooltip:l,delayDuration:n=500,...i}=e;return(0,r.jsx)(_.m.Provider,{children:(0,r.jsxs)(_.m,{delayDuration:n,children:[(0,r.jsx)(_.m.Trigger,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",...i,className:(0,d.cn)("h-full w-fit font-regular flex text-sm text-slate-10 items-center align-middle justify-center px-1 gap-2 relative","hover:text-slate-12 transition-colors",s&&"data-[state=active]:text-cyan-11",a),children:[t,s?(0,r.jsx)(V.P.span,{className:"-bottom-px absolute rounded-sm left-0 w-full bg-cyan-11 h-px",layoutId:"active-toolbar-button",transition:{type:"spring",bounce:.2,duration:.6}}):null]})}),l?(0,r.jsx)(_.m.Content,{children:l}):null]})})},F=e=>{let t;if("localStorage"in a.g){let r=a.g.localStorage.getItem(e);if(null!==r&&"undefined"!==r)try{t=JSON.parse(r)}catch(t){console.warn("Failed to load stored value for",e,"with value",r)}}return[(0,i.useSyncExternalStore)(()=>()=>{},()=>t,()=>void 0),function(t){"localStorage"in a.g&&a.g.localStorage.setItem(e,JSON.stringify(t))}]},U=()=>{var e;let t=null!=(e=(0,n.useSearchParams)().get("toolbar-panel"))?e:void 0;return{activeTab:t,toggled:void 0!==t}},B=e=>{let{serverLintingRows:t,serverSpamCheckingResult:a,serverCompatibilityResults:c,markup:h,reactMarkup:m,plainText:f,emailPath:g,emailSlug:j}=e,b=(0,n.usePathname)(),v=(0,n.useSearchParams)(),w=(0,n.useRouter)(),{activeTab:y,toggled:C}=U(),k=e=>{let t=new URLSearchParams(v);void 0===e?t.delete("toolbar-panel"):t.set("toolbar-panel",e),w.push("".concat(b,"?").concat(t.toString()).concat(location.hash))},[N,R]=F("spam-assassin-".concat(j.replaceAll("/","-"))),[M,{load:T,loading:H}]=z({markup:h,plainText:f,initialResult:null!=a?a:N}),[E,V]=F("linter-".concat(j.replaceAll("/","-"))),[_,{load:B,loading:X}]=P({markup:h,initialRows:null!=t?t:E}),[q,G]=F("compatibility-".concat(j.replaceAll("/","-"))),[Q,{load:$,loading:K}]=S({emailPath:g,reactMarkup:m,initialResults:null!=c?c:q});return o.Hf||(0,i.useEffect)(()=>{(async()=>{V(await B()),R(await T()),G(await $())})()},[]),(0,r.jsx)("div",{"data-toggled":C,className:(0,d.cn)("absolute bottom-0 left-0 right-0","border-t border-slate-6 group/toolbar text-xs text-slate-11 h-52 transition-transform","data-[toggled=false]:translate-y-[10.625rem]"),children:(0,r.jsx)(s.bL,{value:null!=y?y:"",onValueChange:e=>{k(e)},asChild:!0,children:(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsxs)(s.B8,{className:"flex gap-4 px-4 border-b border-solid border-slate-6 h-10 w-full flex-shrink-0",children:[(0,r.jsxs)(l.o,{id:"toolbar",children:[(0,r.jsx)(s.l9,{asChild:!0,value:"linter",children:(0,r.jsx)(O,{active:"linter"===y,children:"Linter"})}),(0,r.jsx)(s.l9,{asChild:!0,value:"compatibility",children:(0,r.jsx)(O,{active:"compatibility"===y,children:"Compatibility"})}),(0,r.jsx)(s.l9,{asChild:!0,value:"spam-assassin",children:(0,r.jsx)(O,{active:"spam-assassin"===y,children:"Spam"})})]}),(0,r.jsxs)("div",{className:"flex gap-0.5 ml-auto",children:[(0,r.jsx)(O,{delayDuration:0,tooltip:"linter"===y&&"The Linter tab checks all the images and links for common issues like missing alt text, broken URLs, insecure HTTP methods, and more."||"spam-assassin"===y&&"The Spam tab will look at the content and use a robust scoring framework to determine if the email is likely to be spam. Powered by SpamAssassin."||"compatibility"===y&&"The Compatibility tab shows how well the HTML/CSS is supported across mail clients like Outlook, Gmail, etc. Powered by Can I Email."||"Info",children:(0,r.jsx)(x,{size:24})}),o.Hf?null:(0,r.jsx)(O,{tooltip:"Reload",disabled:X||H,onClick:async()=>{void 0===y&&k("linter"),"spam-assassin"===y?await T():"linter"===y?await B():"compatibility"===y&&await $()},children:(0,r.jsx)(p,{size:24,className:(0,d.cn)({"animate-spin opacity-60 animate-spin-fast":X||H})})}),(0,r.jsx)(O,{tooltip:"Toggle toolbar",onClick:()=>{void 0===y?k("linter"):k(void 0)},children:(0,r.jsx)(u.R,{size:24,className:"transition-transform group-data-[toggled=false]/toolbar:rotate-180"})})]})]}),(0,r.jsxs)("div",{className:"flex-grow transition-opacity opacity-100 group-data-[toggled=false]/toolbar:opacity-0 overflow-y-auto pr-3 pl-4 pt-3",children:[(0,r.jsx)(s.UC,{value:"linter",children:X?(0,r.jsx)(W,{message:"Analyzing your code for linting issues..."}):(null==_?void 0:_.length)===0?(0,r.jsxs)(A,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(Y,{children:"All good"}),(0,r.jsx)(J,{children:"No linting issues found."})]}):(0,r.jsx)(I,{rows:null!=_?_:[]})}),(0,r.jsx)(s.UC,{value:"compatibility",children:K?(0,r.jsx)(W,{message:"Checking email compatibility..."}):(null==Q?void 0:Q.length)===0?(0,r.jsxs)(A,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(Y,{children:"Great compatibility"}),(0,r.jsx)(J,{children:"Template should render properly everywhere."})]}):(0,r.jsx)(L,{results:null!=Q?Q:[]})}),(0,r.jsx)(s.UC,{value:"spam-assassin",children:H?(0,r.jsx)(W,{message:"Evaluating your email for spam indicators..."}):(null==M?void 0:M.isSpam)===!1?(0,r.jsxs)(A,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(Y,{children:"10/10"}),(0,r.jsx)(J,{children:"Your email is clean of abuse indicators."})]}):(0,r.jsx)(D,{result:M})})]})]})})})},W=e=>{let{message:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center pt-8",children:[(0,r.jsxs)("div",{className:"relative mb-8 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"h-12 w-12 rounded-full bg-gradient-to-br from-cyan-400/80 to-cyan-600/80 opacity-10 blur-xl absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 animate-pulse"}),(0,r.jsx)("div",{className:"h-12 w-12 rounded-full border border-slate-4 absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),(0,r.jsx)("div",{className:"h-10 w-10 rounded-full flex items-center justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,r.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-white/50 border-t-transparent animate-spin-fast"})})]}),(0,r.jsx)("h3",{className:"text-slate-12 font-medium text-base mb-1",children:"Processing"}),(0,r.jsx)("p",{className:"text-slate-11 text-sm text-center max-w-[320px]",children:t})]})},A=e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"flex flex-col items-center justify-center pt-8",children:t})},Z=()=>(0,r.jsxs)("div",{className:"relative mb-8 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-green-300/20 opacity-80 to-emerald-500/30 blur-md absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),(0,r.jsx)("div",{className:"h-12 w-12 rounded-full bg-gradient-to-br from-green-400/80 opacity-10 to-emerald-600/80 absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 shadow-lg"}),(0,r.jsx)("div",{className:"h-10 w-10 rounded-full bg-gradient-to-br from-green-400 to-emerald-600 flex items-center justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 shadow-[inset_0_1px_1px_rgba(255,255,255,0.4)]",children:(0,r.jsx)(h.i,{size:24,className:"text-white drop-shadow-sm"})})]}),Y=e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"text-slate-12 font-medium text-base mb-1",children:t})},J=e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"text-slate-11 text-sm text-center max-w-[320px]",children:t})},X=e=>{let{serverLintingRows:t,serverSpamCheckingResult:a,serverCompatibilityResults:s}=e,{emailPath:l,emailSlug:n,renderedEmailMetadata:o}=(0,i.use)(c.o);if(void 0===o)return null;let{markup:d,plainText:u,reactMarkup:h}=o;return(0,r.jsx)(B,{emailPath:l,emailSlug:n,markup:d,reactMarkup:h,plainText:u,serverLintingRows:t,serverSpamCheckingResult:a,serverCompatibilityResults:s})}},5045:(e,t,a)=>{"use strict";a.d(t,{i:()=>n});var r=a(3604),s=a(216),l=a(4524);let n=s.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(l.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M16.25 8.75L10.406 15.25L7.75 12.75",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})});n.displayName="IconCheck"},8838:(e,t,a)=>{Promise.resolve().then(a.bind(a,3726)),Promise.resolve().then(a.bind(a,1494)),Promise.resolve().then(a.bind(a,4605)),Promise.resolve().then(a.bind(a,2638))}},e=>{var t=t=>e(e.s=t);e.O(0,[979,589,293,45,484,733,107,358],()=>t(8838)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[719],{3726:(e,t,a)=>{"use strict";a.d(t,{default:()=>Q});var r=a(3604),s=a(66),l=a(216),n=a(3113),i=a(1026),o=a(1833),c=a(3566),d=a(507);a(5110),a(253),a(801);var u=a(7027),h=a(3040);let m=l.forwardRef((e,t)=>{let{as:a="span",size:s="2",color:l="gray",transform:n,weight:i="normal",className:o,children:c,...d}=e;return(0,r.jsx)(u.DX,{className:(0,h.cn)(o,n,x(s),p(l),f(i)),ref:t,...d,children:(0,r.jsx)(a,{children:c})})}),x=e=>{switch(e){case"1":return"text-xs";case void 0:case"2":return"text-sm";case"3":return"text-base";case"4":return"text-lg";case"5":return["text-17px","md:text-xl tracking-[-0.16px]"];case"6":return"text-2xl tracking-[-0.288px]";case"7":return"text-[28px] leading-[34px] tracking-[-0.416px]";case"8":return"text-[35px] leading-[42px] tracking-[-0.64px]";case"9":return"text-6xl leading-[73px] tracking-[-0.896px]";default:return(0,h.HB)(e)}},p=e=>{switch(e){case"white":return"text-slate-12";case void 0:case"gray":return"text-slate-11";default:return(0,h.HB)(e)}},f=e=>{switch(e){case void 0:case"normal":return"font-normal";case"medium":return"font-medium";default:return(0,h.HB)(e)}};m.displayName="Text";var g=a(1875),j=a(4211),b=a(6886);let v={type:"spring",stiffness:2e3,damping:80,mass:1};var w=a(4582);let y=l.forwardRef((e,t)=>{let{children:a,className:s,...l}=e;return(0,r.jsx)("button",{type:"button",...l,className:(0,h.cn)("focus:ring-gray-8 rounded text-slate-11 transition duration-200 ease-in-out hover:text-slate-12 focus:text-slate-12 focus:outline-none focus:ring-2",s),ref:t,children:a})});y.displayName="IconButton";var C=a(5045),k=a(4524);let N=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsxs)(k.z,{ref:t,...a,children:[(0,r.jsx)("path",{d:"M9 6.75H7.75C6.64543 6.75 5.75 7.64543 5.75 8.75V17.25C5.75 18.3546 6.64543 19.25 7.75 19.25H16.25C17.3546 19.25 18.25 18.3546 18.25 17.25V8.75C18.25 7.64543 17.3546 6.75 16.25 6.75H15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M14 8.25H10C9.44772 8.25 9 7.80228 9 7.25V5.75C9 5.19772 9.44772 4.75 10 4.75H14C14.5523 4.75 15 5.19772 15 5.75V7.25C15 7.80228 14.5523 8.25 14 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M9.75 12.25H14.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M9.75 15.25H14.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})});N.displayName="IconClipboard";let S=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(k.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M4.75 14.75v1.5a3 3 0 0 0 3 3h8.5a3 3 0 0 0 3-3v-1.5M12 14.25v-9.5M8.75 10.75l3.25 3.5 3.25-3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})})});S.displayName="IconDownload";var L=a(1966);let R=e=>{let{markups:t,activeLang:a,setActiveLang:s}=e,l=t.find(e=>{let{language:t}=e;return a===t});if(!l)throw Error("No markup found for the active language!",{cause:{activeLang:a,markups:t}});return(0,r.jsxs)("div",{className:"relative max-h-[650px] w-full h-full whitespace-pre rounded-md border border-slate-6 text-sm",style:{lineHeight:"130%",background:"linear-gradient(145.37deg, rgba(255, 255, 255, 0.09) -8.75%, rgba(255, 255, 255, 0.027) 83.95%)",boxShadow:"rgb(0 0 0 / 10%) 0px 5px 30px -5px"},children:[(0,r.jsxs)("div",{className:"h-9 border-b border-slate-6",children:[(0,r.jsx)("div",{className:"flex",children:(0,r.jsx)(j.o,{id:"code",children:t.map(e=>{let{language:t}=e,l=a===t;return(0,r.jsxs)(b.P.button,{className:"relative px-4 py-[8px] font-sans text-sm font-medium transition duration-200 ease-in-out hover:text-slate-12 ".concat(a!==t?"text-slate-11":"text-slate-12"),onClick:()=>{s(t)},children:[l?(0,r.jsx)(b.P.span,{animate:{opacity:1},className:"absolute bottom-0 left-0 right-0 top-0 bg-slate-4",exit:{opacity:0},initial:{opacity:0},layoutId:"code",transition:v}):null,w.A[t]]},t)})})}),(0,r.jsx)(M,{content:l.content}),(0,r.jsx)(T,{content:l.content,filename:"email.".concat(l.language)})]}),(0,r.jsx)("div",{className:"h-[calc(100%-2.25rem)]",children:(0,r.jsx)(d.Code,{language:a,children:l.content})})]})},M=e=>{let{content:t}=e,[a,s]=l.useState(!1),n=l.useRef(void 0);return l.useEffect(()=>{s(!1),clearTimeout(n.current),n.current=void 0},[t]),(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,className:"absolute right-2 top-2 hidden md:block",children:(0,r.jsx)(y,{onClick:async()=>{s(!0),await (0,h.eM)(t),n.current=setTimeout(()=>{s(!1)},3e3)},children:a?(0,r.jsx)(C.i,{}):(0,r.jsx)(N,{})})}),(0,r.jsx)(L.m.Content,{children:"Copy to Clipboard"})]})},T=e=>{let{content:t,filename:a}=e,s=l.useMemo(()=>{let e=new File([t],a);return URL.createObjectURL(e)},[t,a]),n=l.useSyncExternalStore(()=>()=>{},()=>s,()=>void 0);return(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,className:"text-gray-11 absolute right-8 top-2 hidden md:block",children:(0,r.jsx)("a",{className:"text-slate-11 transition duration-200 ease-in-out hover:text-slate-12",download:a,href:n,children:(0,r.jsx)(S,{})})}),(0,r.jsx)(L.m.Content,{children:"Download"})]})},H=e=>{var t,a;let r=t=>{let a=e.getBoundingClientRect();document.dispatchEvent(new MouseEvent("mousemove",{...t,clientX:t.clientX+a.x,clientY:t.clientY+a.y}))},s=e=>{document.dispatchEvent(new MouseEvent("mouseup",e))};return null==(t=e.contentDocument)||t.addEventListener("mousemove",r),null==(a=e.contentDocument)||a.addEventListener("mouseup",s),()=>{var t,a;null==(t=e.contentDocument)||t.removeEventListener("mousemove",r),null==(a=e.contentDocument)||a.removeEventListener("mouseup",s)}},P=e=>{let{width:t,height:a,onResize:s,onResizeEnd:n,children:i,maxHeight:o,maxWidth:c,minHeight:d,minWidth:m,...x}=e,p=(0,l.useRef)(null),f=(0,l.useRef)(null),g=(0,l.useCallback)(()=>{f.current&&document.removeEventListener("mousemove",f.current),document.removeEventListener("mouseup",g),null==n||n()},[]),j=e=>{f.current=t=>{if(0===t.button&&p.current){let a="east"===e||"west"===e,r=a?t.clientX:t.clientY,l=p.current.getBoundingClientRect();s(2*Math.abs(r-(a?l.x+l.width/2:l.y+l.height/2)),e)}else g()},document.addEventListener("mouseup",g),document.addEventListener("mousemove",f.current)};return(0,l.useEffect)(()=>{if(window.document)return()=>{g()}},[]),(0,r.jsxs)("div",{...x,className:(0,h.cn)("relative mx-auto my-auto box-content",x.className),children:[(0,r.jsx)("div",{"aria-label":"resize-west","aria-valuenow":t,"aria-valuemin":m,"aria-valuemax":c,className:"-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-2 cursor-w-resize p-2 [user-drag:none]",onDragStart:e=>e.preventDefault(),draggable:"false",onMouseDown:()=>{j("west")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-8 w-1 rounded-md bg-black/30"})}),(0,r.jsx)("div",{"aria-label":"resize-east","aria-valuenow":t,"aria-valuemin":m,"aria-valuemax":c,onDragStart:e=>e.preventDefault(),className:"-translate-x-full -translate-y-1/2 absolute top-1/2 left-full cursor-e-resize p-2 [user-drag:none]",draggable:"false",onMouseDown:()=>{j("east")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-8 w-1 rounded-md bg-black/30"})}),(0,r.jsx)("div",{"aria-label":"resize-north","aria-valuenow":a,"aria-valuemin":d,"aria-valuemax":o,onDragStart:e=>e.preventDefault(),className:"-translate-x-1/2 -translate-y-1/2 absolute top-0 left-1/2 cursor-n-resize p-2 [user-drag:none]",draggable:"false",onMouseDown:()=>{j("north")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-1 w-8 rounded-md bg-black/30"})}),(0,r.jsx)("div",{"aria-label":"resize-south","aria-valuenow":a,"aria-valuemin":d,"aria-valuemax":o,onDragStart:e=>e.preventDefault(),className:"-translate-x-1/2 -translate-y-1/2 absolute top-full left-1/2 cursor-s-resize p-2 [user-drag:none]",draggable:"false",onMouseDown:()=>{j("south")},role:"slider",tabIndex:0,children:(0,r.jsx)("div",{className:"h-1 w-8 rounded-md bg-black/30"})}),(0,r.jsx)(u.DX,{ref:p,children:i})]})};var I=a(8815);let E=e=>{let{markup:t}=e,[a,s]=l.useState(""),[n,o]=l.useState("Testing React Email"),[d,u]=l.useState(!1),[h,x]=l.useState(!1),p=async e=>{try{e.preventDefault(),u(!0);let r=await fetch("https://react.email/api/send/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:a,subject:n,html:t})});if(429===r.status){let{error:e}=await r.json();i.oR.error(e)}i.oR.success("Email sent! Check your inbox.")}catch(e){i.oR.error("Something went wrong. Please try again.")}finally{u(!1)}};return(0,r.jsxs)(I.bL,{onOpenChange:()=>{h?(document.body.classList.remove("popup-open"),x(!1)):(document.body.classList.add("popup-open"),x(!0))},open:h,children:[(0,r.jsx)(I.l9,{asChild:!0,children:(0,r.jsx)("button",{className:"box-border flex h-5 w-20 items-center justify-center self-center rounded-lg border border-slate-6 bg-slate-2 px-4 py-4 text-center font-sans text-sm text-slate-11 outline-none transition duration-300 ease-in-out hover:border-slate-10 hover:text-slate-12",type:"submit",children:"Send"})}),(0,r.jsx)(I.Mz,{}),(0,r.jsx)(I.ZL,{children:(0,r.jsx)(I.UC,{align:"end",className:"-mt-10 w-80 rounded-lg border border-slate-6 bg-black/70 p-3 font-sans text-slate-11 shadow-md backdrop-blur-lg font-sans",sideOffset:48,children:(0,r.jsxs)("form",{className:"mt-1",onSubmit:e=>void p(e),children:[(0,r.jsx)("label",{className:"mb-2 block text-xs uppercase text-slate-10",htmlFor:"to",children:"Recipient"}),(0,r.jsx)("input",{autoFocus:!0,className:"mb-3 w-full appearance-none rounded-lg border border-slate-6 bg-slate-3 px-2 py-1 text-sm text-slate-12 placeholder-slate-10 outline-none transition duration-300 ease-in-out focus:ring-1 focus:ring-slate-10",defaultValue:a,id:"to",onChange:e=>{s(e.target.value)},placeholder:"you@example.com",required:!0,type:"email"}),(0,r.jsx)("label",{className:"mb-2 mt-1 block text-xs uppercase text-slate-10",htmlFor:"subject",children:"Subject"}),(0,r.jsx)("input",{className:"mb-3 w-full appearance-none rounded-lg border border-slate-6 bg-slate-3 px-2 py-1 text-sm text-slate-12 placeholder-slate-10 outline-none transition duration-300 ease-in-out focus:ring-1 focus:ring-slate-10",defaultValue:n,id:"subject",onChange:e=>{o(e.target.value)},placeholder:"My Email",required:!0,type:"text"}),(0,r.jsx)("input",{className:"appearance-none checked:bg-blue-500",type:"checkbox"}),(0,r.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,r.jsxs)(m,{className:"inline-block",size:"1",children:["Powered by"," ",(0,r.jsx)("a",{className:"text-white/85 transition duration-300 ease-in-out hover:text-slate-12",href:"https://resend.com",rel:"noreferrer",target:"_blank",children:"Resend"})]}),(0,r.jsx)(c.Button,{className:"disabled:border-transparent disabled:bg-slate-11",disabled:0===n.length||0===a.length||d,type:"submit",children:"Send"})]})]})})})]})};var z=a(8340),D=a(1293);let V=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(k.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M9.75 15.25H17.25C18.3546 15.25 19.25 14.3546 19.25 13.25V6.75C19.25 5.64543 18.3546 4.75 17.25 4.75H6.75C5.64543 4.75 4.75 5.64543 4.75 6.75V13.25C4.75 14.3546 5.64543 15.25 6.75 15.25H9.75ZM9.75 15.25C9.75 15.25 10 18.25 8 19.25H16C14 18.25 14.25 15.25 14.25 15.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})});V.displayName="IconMonitor";let _=l.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(k.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M17.4 15L21 11.5L17.4 8M6.6 8L3 11.5L6.6 15M14.25 4.5L9.75 18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})});_.displayName="IconSource";let O=e=>{let{activeView:t,setActiveView:a}=e;return(0,r.jsxs)(D.bL,{"aria-label":"View mode",className:"inline-block items-center bg-slate-2 border border-slate-6 rounded-md overflow-hidden h-[36px]",onValueChange:e=>{e&&a(e)},type:"single",value:t,children:[(0,r.jsx)(D.q7,{value:"preview",children:(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,children:(0,r.jsxs)("div",{className:(0,h.cn)("px-3 py-2 transition ease-in-out duration-200 relative hover:text-slate-12",{"text-slate-11":"desktop"!==t,"text-slate-12":"desktop"===t}),children:["preview"===t&&(0,r.jsx)(b.P.span,{animate:{opacity:1},className:"absolute left-0 right-0 top-0 bottom-0 bg-slate-4",exit:{opacity:0},initial:{opacity:0},layoutId:"topbar-tabs",transition:v}),(0,r.jsx)(V,{})]})}),(0,r.jsx)(L.m.Content,{children:"Preview"})]})}),(0,r.jsx)(D.q7,{value:"source",children:(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,children:(0,r.jsxs)("div",{className:(0,h.cn)("px-3 py-2 transition ease-in-out duration-200 relative hover:text-slate-12",{"text-slate-11":"source"!==t,"text-slate-12":"source"===t}),children:["source"===t&&(0,r.jsx)(b.P.span,{animate:{opacity:1},className:"absolute left-0 right-0 top-0 bottom-0 bg-slate-4",exit:{opacity:0},initial:{opacity:0},layoutId:"topbar-tabs",transition:v}),(0,r.jsx)(_,{})]})}),(0,r.jsx)(L.m.Content,{children:"Code"})]})})]})};var F=a(2074),U=a(2031);let B=[{name:"Desktop",dimensions:{width:600,height:1024}},{name:"Mobile",dimensions:{width:375,height:812}}],W={active:{width:"3.5rem",padding:"0 0 0 0.5rem"},inactive:{width:"0"}},A=e=>{let{icon:t,isActive:a,label:s,onBlur:n,onChange:i,setIsActive:o,value:c,hasBorder:d}=e,u=l.useRef(null);return l.useEffect(()=>{a&&u.current&&u.current.focus()},[a]),(0,r.jsx)(L.m.Provider,{children:(0,r.jsxs)(L.m,{children:[(0,r.jsx)(L.m.Trigger,{asChild:!0,children:(0,r.jsxs)(b.P.button,{onClick:()=>{a?o(!1):o(!0)},className:(0,h.cn)("relative flex items-center justify-center p-2",{"border-slate-6 border-r":d}),children:[t,(0,r.jsx)(b.P.input,{ref:u,initial:!1,animate:a?"active":"inactive",className:"arrow-hide relative flex h-8 items-center justify-center bg-black text-sm outline-none",onChange:e=>i(Number.parseInt(e.currentTarget.value)),onBlur:n,type:"number",value:c,variants:W})]})}),(0,r.jsxs)(L.m.Content,{children:[(0,r.jsxs)("span",{children:[s,": "]}),(0,r.jsxs)("span",{className:"font-mono",children:[c,"px"]})]})]})})},Z=e=>{let{name:t,dimensions:a,onSelect:s}=e;return(0,r.jsxs)(F.q7,{className:"group flex w-full cursor-pointer select-none items-center justify-between rounded-md py-1.5 pr-1 pl-2 text-sm outline-none transition-colors data-[highlighted]:bg-slate-5",onClick:()=>s(a),children:[t,(0,r.jsxs)("span",{className:"flex h-fit items-center rounded-full bg-slate-6 px-2 py-1 font-medium text-slate-11 text-xs",children:[a.width,"x",a.height]})]})},Y=e=>{let{viewWidth:t,viewHeight:a,setViewWidth:s,setViewHeight:n}=e,[i,o]=l.useState(!1),[c,d]=l.useState(null),u=e=>{s(e.width),n(e.height)},m=()=>{d(null)};return(0,r.jsxs)("div",{className:"relative flex h-9 w-fit overflow-hidden rounded-lg border border-slate-6 text-sm transition-colors duration-300 ease-in-out focus-within:border-slate-8 hover:border-slate-8",children:[(0,r.jsx)(A,{icon:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"}),(0,r.jsx)("path",{d:"M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"}),(0,r.jsx)("path",{d:"M4 12H2"}),(0,r.jsx)("path",{d:"M10 12H8"}),(0,r.jsx)("path",{d:"M16 12h-2"}),(0,r.jsx)("path",{d:"M22 12h-2"})]}),value:t,onChange:s,isActive:"width"===c,setIsActive:e=>d(e?"width":null),onBlur:m,label:"Width",hasBorder:!0}),(0,r.jsx)(A,{icon:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3"}),(0,r.jsx)("path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3"}),(0,r.jsx)("path",{d:"M12 20v2"}),(0,r.jsx)("path",{d:"M12 14v2"}),(0,r.jsx)("path",{d:"M12 8v2"}),(0,r.jsx)("path",{d:"M12 2v2"})]}),value:a,onChange:n,isActive:"height"===c,setIsActive:e=>d(e?"height":null),onBlur:m,label:"Height"}),(0,r.jsxs)(F.bL,{open:i,onOpenChange:o,children:[(0,r.jsx)(F.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:"relative flex items-center justify-center overflow-hidden bg-slate-5 p-2 text-slate-11 text-sm leading-none outline-none transition-colors ease-linear focus-within:text-slate-12 hover:text-slate-12 focus:text-slate-12",children:[(0,r.jsx)("span",{className:"sr-only",children:"View presets"}),(0,r.jsx)(U.R,{className:(0,h.cn)("transform transition-transform duration-200 ease-[cubic-bezier(.36,.66,.6,1)]",{"-rotate-180":i})})]})}),(0,r.jsx)(F.ZL,{children:(0,r.jsx)(F.UC,{align:"end",className:"flex min-w-[12rem] flex-col gap-2 rounded-md border border-slate-8 border-solid bg-black px-2 py-2 text-white",sideOffset:5,children:B.map(e=>(0,r.jsx)(Z,{name:e.name,dimensions:e.dimensions,onSelect:u},e.name))})})]})]})};var J=a(7012);let X=(e,t,a)=>Math.min(Math.max(e,t),a),q=(e,t,a)=>{let[r,s]=(0,l.useState)(e);return[X(r,t,a),e=>{"function"==typeof e?s(r=>{let s=X(r,t,a);return X(e(s),t,a)}):s(X(e,t,a))}]},G=e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"absolute inset-0 z-50 bg-black/80"}),(0,r.jsx)("div",{className:"absolute left-[50%] top-[50%] z-50 grid min-h-[50vh] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-t-sm border border-t-4 bg-white p-6 text-black shadow-lg duration-200 sm:rounded-lg md:max-w-[568px] lg:max-w-[968px]",children:(0,r.jsxs)("div",{className:"flex min-w-0 max-w-full flex-col space-y-1.5",children:[(0,r.jsxs)("h2",{className:"flex flex-shrink items-center gap-4 pb-2 text-lg font-semibold leading-none tracking-tight",children:[(0,r.jsxs)("svg",{className:"h-6 w-6 font-extrabold text-red-600",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,r.jsx)("path",{d:"M12 9v4"}),(0,r.jsx)("path",{d:"M12 17h.01"})]}),e.error.name,": ",e.error.message]}),e.error.stack?(0,r.jsx)("div",{className:"flex-grow scroll-px-4 overflow-x-auto rounded-lg bg-red-500 p-2 text-sm text-gray-100",children:(0,r.jsx)("pre",{className:"w-full min-w-0 font-mono leading-7",children:e.error.stack})}):void 0]})})]}),Q=e=>{var t,a;let{emailTitle:c,className:d,...u}=e,{renderingResult:m,renderedEmailMetadata:x}=(0,l.use)(J.o),p=(0,s.useRouter)(),f=(0,s.usePathname)(),j=(0,s.useSearchParams)(),b=null!=(t=j.get("view"))?t:"preview",v=null!=(a=j.get("lang"))?a:"jsx",w=void 0!==x,y="error"in m,[C,k]=(0,l.useState)(Number.POSITIVE_INFINITY),[N,S]=(0,l.useState)(Number.POSITIVE_INFINITY),M=j.get("width"),T=j.get("height"),[I,D]=q(M?Number.parseInt(M):600,100,C),[V,_]=q(T?Number.parseInt(T):1024,100,N),F=(0,o.YQ)(()=>{let e=new URLSearchParams(j);e.set("width",I.toString()),e.set("height",V.toString()),p.push("".concat(f,"?").concat(e.toString()).concat(location.hash))},300),{toggled:U}=(0,z.S)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(g.Topbar,{emailTitle:c,children:[(0,r.jsx)(Y,{setViewHeight:e=>{_(e),(0,n.flushSync)(()=>{F()})},setViewWidth:e=>{D(e),(0,n.flushSync)(()=>{F()})},viewHeight:V,viewWidth:I}),(0,r.jsx)(O,{activeView:b,setActiveView:e=>{let t=new URLSearchParams(j);t.set("view",e),p.push("".concat(f,"?").concat(t.toString()).concat(location.hash))}}),w?(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(E,{markup:x.markup})}):null]}),(0,r.jsxs)("div",{...u,className:(0,h.cn)("h-[calc(100%-3.5rem-2.375rem)] will-change-[height] flex p-4 transition-[height] duration-300","preview"===b&&"bg-gray-200",U&&"h-[calc(100%-3.5rem-13rem)]",d),ref:e=>{let t=new ResizeObserver(e=>{let[t]=e;t&&(k(t.contentRect.width),S(t.contentRect.height))});return e&&t.observe(e),()=>{t.disconnect()}},children:[y?(0,r.jsx)(G,{error:m.error}):null,w?(0,r.jsxs)(r.Fragment,{children:["preview"===b&&(0,r.jsx)(P,{minHeight:100,minWidth:100,maxHeight:N,maxWidth:C,height:V,onResizeEnd:()=>{F()},onResize:(e,t)=>{"east"===t||"west"===t?D(Math.round(e)):_(Math.round(e))},width:I,children:(0,r.jsx)("iframe",{className:"solid max-h-full rounded-lg bg-white",ref:e=>{if(e)return H(e)},srcDoc:x.markup,style:{width:"".concat(I,"px"),height:"".concat(V,"px")},title:c})}),"source"===b&&(0,r.jsx)("div",{className:"h-full w-full",children:(0,r.jsx)("div",{className:"m-auto h-full flex max-w-3xl p-6",children:(0,r.jsx)(L.m.Provider,{children:(0,r.jsx)(R,{activeLang:v,markups:[{language:"jsx",content:x.reactMarkup},{language:"markup",content:x.markup},{language:"markdown",content:x.plainText}],setActiveLang:e=>{let t=new URLSearchParams(j);t.set("view","source"),t.set("lang",e);let a=j.get("lang")===e;p.push("".concat(f,"?").concat(t.toString()).concat(a?location.hash:""))}})})})})]}):null,(0,r.jsx)(i.l$,{})]})]})}},5045:(e,t,a)=>{"use strict";a.d(t,{i:()=>n});var r=a(3604),s=a(216),l=a(4524);let n=s.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(l.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M16.25 8.75L10.406 15.25L7.75 12.75",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})});n.displayName="IconCheck"},7012:(e,t,a)=>{"use strict";a.d(t,{o:()=>g,PreviewProvider:()=>j});var r=a(3604),s=a(66),l=a(216),n=a(5936),i=a(9992);let o=(0,i.createServerReference)("7f18c0cc29dc1154fdc7f8f2eb0b365c814cfcebfa",i.callServer,void 0,i.findSourceMapURL,"getEmailPathFromSlug"),c=(0,i.createServerReference)("7f131250a97d018681180f8e1d6a8598df703fdbf2",i.callServer,void 0,i.findSourceMapURL,"renderEmailByPath");var d=a(6981);let u=e=>{let t=e.split(".");return t.length>1?t.slice(0,-1).join("."):e},h=(e,t)=>{let a=e.replace(t.relativePath,"").split("/").filter(Boolean);if(1===a.length){let e=u(a[0]);return t.emailFilenames.includes(e)}let r=t.subDirectories.find(e=>e.directoryName===a[0]);return void 0!==r&&h(e,r)};var m=a(7473);let x=(e,t)=>{let[a,r]=(0,l.useState)(t),{emailsDirectoryMetadata:s}=(0,d.J)();return n.Hf||(0,m.a)(async t=>{for await(let a of t){let t=a.filename;if(!h(t,s))continue;let l=await o(t),n=await c(l,!0);l===e&&r(n)}}),a},p={},f=(e,t,a)=>((0,l.useEffect)(()=>{"markup"in t?p[e]=t:void 0!==a&&"markup"in a&&void 0===p[e]&&(p[e]=a)},[t,e,a]),"error"in t?p[e]:t),g=(0,l.createContext)(void 0),j=e=>{let{emailSlug:t,emailPath:a,serverRenderingResult:l,children:i}=e,o=(0,s.useRouter)(),c=x(a,l),d=f(a,c,l);return n.Hf||(0,m.a)(e=>{let a=e.find(e=>e.filename.includes(t));void 0!==a&&"unlink"===a.event&&o.push("/")}),(0,r.jsx)(g.Provider,{value:{emailPath:a,emailSlug:t,renderedEmailMetadata:d,renderingResult:c},children:i})}},8340:(e,t,a)=>{"use strict";a.d(t,{Toolbar:()=>X,S:()=>U});var r=a(3604),s=a(7335),l=a(4211),n=a(66),i=a(216),o=a(5936),c=a(7012),d=a(3040),u=a(2031),h=a(5045),m=a(4524);let x=i.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(m.z,{ref:t,...a,children:(0,r.jsx)("path",{d:"M12 4C7.58173 4 4 7.58172 4 12C4 16.4182 7.58173 20 12 20C16.4183 20 20 16.4182 20 12C20 7.58172 16.4183 4 12 4ZM5.14754 12C5.14754 8.21549 8.21551 5.14754 12 5.14754C15.7845 5.14754 18.8525 8.21549 18.8525 12C18.8525 15.7844 15.7845 18.8525 12 18.8525C8.21551 18.8525 5.14754 15.7844 5.14754 12ZM12.906 8.37648C12.906 8.87682 12.5004 9.28243 12 9.28243C11.4997 9.28243 11.0941 8.87682 11.0941 8.37648C11.0941 7.87613 11.4997 7.47053 12 7.47053C12.5004 7.47053 12.906 7.87613 12.906 8.37648ZM10.1883 10.1884H10.7922H12.0002C12.3337 10.1884 12.6041 10.4588 12.6041 10.7924V15.0201H13.2081H13.8121V16.2281H13.2081H12.0002H10.7922H10.1883V15.0201H10.7922H11.3962V11.3963H10.7922H10.1883V10.1884Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});x.displayName="IconInfo";let p=i.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)(m.z,{ref:t,...a,children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.9354 12C17.9354 9.01537 15.5828 6.05264 11.9202 6.05264C8.96229 6.05264 7.50033 8.21724 6.87735 9.36841H8.72625C9.02024 9.36841 9.25858 9.60406 9.25858 9.89473C9.25858 10.1854 9.02024 10.421 8.72625 10.421H5.53232C5.23833 10.421 5 10.1854 5 9.89473V6.73684C5 6.44617 5.23833 6.21052 5.53232 6.21052C5.82631 6.21052 6.06465 6.44617 6.06465 6.73684V8.64548C6.81471 7.33819 8.54959 5 11.9202 5C16.2456 5 19 8.51094 19 12C19 15.4891 16.2456 19 11.9202 19C9.8507 19 8.12769 18.1904 6.9009 16.9562C6.24405 16.2954 5.73107 15.5148 5.38132 14.6744C5.26942 14.4057 5.39911 14.0981 5.67098 13.9875C5.94285 13.8768 6.25395 14.0051 6.36583 14.2738C6.66482 14.9921 7.10262 15.6574 7.66023 16.2183C8.69486 17.2593 10.1475 17.9474 11.9202 17.9474C15.5828 17.9474 17.9354 14.9846 17.9354 12Z",fill:"currentColor"})})});p.displayName="IconReload";var f=a(1026);let g={family:{gmail:"Gmail",outlook:"Outlook",yahoo:"Yahoo! Mail","apple-mail":"Apple Mail",aol:"AOL",thunderbird:"Mozilla Thunderbird",microsoft:"Microsoft","samsung-email":"Samsung Email",sfr:"SFR",orange:"Orange",protonmail:"ProtonMail",hey:"HEY","mail-ru":"Mail.ru",fastmail:"Fastmail",laposte:"LaPoste.net","t-online-de":"T-online.de","free-fr":"Free.fr",gmx:"GMX","web-de":"WEB.DE","ionos-1and1":"1&1",rainloop:"RainLoop","wp-pl":"WP.pl"}};var j=a(9992);let b=(0,j.createServerReference)("7f3999075ae707871a7291a5ddc6df883f8b3beacf",j.callServer,void 0,j.findSourceMapURL,"checkCompatibility");async function*v(e){let t=e.getReader();try{for(;;){let{value:e,done:a}=await t.read();if(a)break;yield e}}finally{t.releaseLock()}}let w=e=>(0,r.jsxs)("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,r.jsx)("path",{d:"M10.8777 8.99999L6.87766 1.99999C6.79044 1.84609 6.66396 1.71808 6.51112 1.62902C6.35828 1.53997 6.18455 1.49304 6.00766 1.49304C5.83077 1.49304 5.65704 1.53997 5.5042 1.62902C5.35136 1.71808 5.22488 1.84609 5.13766 1.99999L1.13766 8.99999C1.0495 9.15267 1.00327 9.32594 1.00366 9.50224C1.00405 9.67855 1.05105 9.85161 1.13988 10.0039C1.22872 10.1562 1.35623 10.2823 1.50951 10.3694C1.66278 10.4565 1.83636 10.5016 2.01266 10.5H10.0127C10.1881 10.4998 10.3604 10.4535 10.5123 10.3656C10.6642 10.2778 10.7903 10.1515 10.8779 9.99955C10.9656 9.84756 11.0117 9.67518 11.0116 9.49973C11.0116 9.32428 10.9654 9.15193 10.8777 8.99999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.0127 4.5V6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.0127 8.5H6.01853",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});w.displayName="IconCircleWarning";var y=a(9681),C=a.n(y);let k=e=>{let{line:t,column:a,type:s}=e,l=new URLSearchParams((0,n.useSearchParams)());l.set("view","source"),"html"===s?l.set("lang","markup"):"react"===s&&l.set("lang","jsx");let i="#L".concat(t);return(0,r.jsxs)(C(),{href:{search:l.toString(),hash:i},scroll:!1,className:"appearance-none underline mx-2",children:["L",t.toString().padStart(2,"0")]})},N=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)("table",{className:(0,d.cn)("group relative w-full border-collapse text-left text-slate-10 text-sm",a),children:(0,r.jsx)("tbody",{children:t})})};N.Row=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)("tr",{className:(0,d.cn)("border-collapse align-bottom border-slate-6 border-b last:border-b-0",a),...s,children:t})},N.Column=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)("td",{className:(0,d.cn)("py-1.5 align-bottom font-regular",a),...s,children:t})};let S=e=>{let{reactMarkup:t,emailPath:a,initialResults:r}=e,[s,l]=(0,i.useState)(r),[n,o]=(0,i.useState)(!1),c=(0,i.useRef)(!1);return[s,{loading:n,load:async()=>{if(c.current)return;c.current=!0,o(!0),l([]);let e=[];try{let r=await b(t,a);for await(let t of v(r))"error"===t.status&&l(a=>a?e=[...a,t]:[t])}catch(e){console.error(e),f.oR.error(JSON.stringify(e))}finally{o(!1),c.current=!1}return e}}]},L=e=>{let{results:t}=e;return(0,r.jsx)(N,{children:null==t?void 0:t.map((e,t)=>{let a=Object.entries(e.statsPerEmailClient).filter(e=>{let[,t]=e;return"error"===t.status}),s=a.map(e=>{let[t]=e;return g.family[t]}).join(", ");return(0,r.jsxs)(N.Row,{children:[(0,r.jsx)(N.Column,{children:(0,r.jsxs)("span",{className:"flex text-red-400 uppercase gap-2 items-center",children:[(0,r.jsx)(w,{}),(0,d.aj)(e.entry.title)]})}),(0,r.jsxs)(N.Column,{children:[a.length>0?"Not supported in ".concat(s):null,(0,r.jsx)("a",{href:e.entry.url,className:"underline ml-2 decoration-slate-9 decoration-1 hover:decoration-slate-11 transition-colors hover:text-slate-12",rel:"noreferrer",target:"_blank",children:"More ↗"})]}),(0,r.jsx)(N.Column,{className:"font-mono text-slate-11 text-right",children:(0,r.jsx)(k,{line:e.location.start.line,column:e.location.start.column,type:"react"})})]},t)})})};var R=a(6879);let M=(0,j.createServerReference)("7f8f6bbcbc43aaee13e0518fa01eda16d814320bd2",j.callServer,void 0,j.findSourceMapURL,"checkImages"),T=(0,j.createServerReference)("7f10fb94cf73ec434bb58dccd728ef6d14e2a98bfb",j.callServer,void 0,j.findSourceMapURL,"checkLinks");async function*H(e){for await(let t of e)for await(let e of v(await t.getStream())){let a=t.mapValue(e);a&&(yield a)}}let P=e=>{let{markup:t,initialRows:r}=e,[s,l]=(0,i.useState)(r),n=function(e,t){return[{getStream:()=>M(e,t),mapValue(e){if(e&&"success"!==e.status)return{result:e,source:"image"}}},{getStream:()=>T(e),mapValue(e){if(e&&"success"!==e.status)return{result:e,source:"link"}}}]}(t,"location"in a.g?"".concat(a.g.location.protocol,"//").concat(a.g.location.host):""),[o,c]=(0,i.useState)(!1),d=(0,i.useRef)(!1);return[s,{loading:o,load:async()=>{if(!d.current){d.current=!0,c(!0),l([]);try{let e=[];for await(let t of H(n))l(a=>{if(!a)return[t];let r=[...a,t];return r.sort((e,t)=>"error"===e.result.status&&"warning"===t.result.status?-1:+("warning"===e.result.status&&"error"===t.result.status)),e=r,r});return e}finally{c(!1),d.current=!1}}}}]},I=e=>{let{rows:t}=e;return void 0===t?null:(0,r.jsx)(N,{children:t.map((e,t)=>{if("link"===e.source){let a=e.result.checks.find(e=>!1===e.passed),s=[];for(let t of e.result.checks)"fetch_attempt"===t.type&&t.metadata.fetchStatusCode&&s.push((0,r.jsxs)(r.Fragment,{children:["HTTP ",t.metadata.fetchStatusCode]}));return s.push((0,r.jsx)(k,{line:e.result.codeLocation.line,column:e.result.codeLocation.column,type:"html"})),(0,r.jsxs)(E,{status:e.result.status,children:[(0,r.jsx)(E.Name,{children:(0,d.aj)(a.type)}),(0,r.jsxs)(E.Description,{children:["security"===a.type?"Insecure URL, use HTTPS instead of HTTP":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=300&&a.metadata.fetchStatusCode<400?"There was a redirect, the content may have been moved":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=400?"The link is broken":null,"fetch_attempt"===a.type&&void 0===a.metadata.fetchStatusCode?"The link could not be reached":null,"syntax"===a.type?"The link is broken due to invalid syntax":null,(0,r.jsx)("span",{className:"ml-2 text-ellipsis overflow-hidden text-nowrap max-w-[30ch]",children:e.result.link})]}),(0,r.jsx)(E.Metadata,{children:s})]},t)}if("image"===e.source){let a=e.result.checks.find(e=>!1===e.passed),s=[];for(let t of e.result.checks)"image_size"===t.type&&t.metadata.byteCount&&s.push((0,R.A)(t.metadata.byteCount)),"fetch_attempt"===t.type&&t.metadata.fetchStatusCode&&s.push((0,r.jsxs)(r.Fragment,{children:["HTTP ",t.metadata.fetchStatusCode]}));return s.push((0,r.jsx)(k,{line:e.result.codeLocation.line,column:e.result.codeLocation.column,type:"html"})),(0,r.jsxs)(E,{status:e.result.status,children:[(0,r.jsx)(E.Name,{children:(0,d.aj)(a.type)}),(0,r.jsxs)(E.Description,{children:["security"===a.type?"Insecure URL, use HTTPS instead of HTTP":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=300&&a.metadata.fetchStatusCode<400?"There was a redirect, the image may have been moved":null,"fetch_attempt"===a.type&&a.metadata.fetchStatusCode&&a.metadata.fetchStatusCode>=400?"The image is broken":null,"fetch_attempt"===a.type&&void 0===a.metadata.fetchStatusCode?"The image could not be reached":null,"syntax"===a.type?"The image is broken due to an invalid source":null,"accessibility"===a.type?"Missing alt text":null,"image_size"===a.type&&a.metadata.byteCount?"This image is too large, keep it under 1mb":null,(0,r.jsx)("span",{className:"ml-2 text-ellipsis overflow-hidden text-nowrap max-w-[30ch]",children:e.result.source})]}),(0,r.jsx)(E.Metadata,{children:s})]},t)}})})},E=e=>{let{children:t,className:a,status:s,...l}=e;return(0,r.jsx)(N.Row,{"data-status":s,...l,className:(0,d.cn)("group/result",a),children:t})};E.Name=e=>{let{children:t,...a}=e;return(0,r.jsx)(N.Column,{...a,children:(0,r.jsxs)("span",{className:"flex uppercase gap-2 items-center group-data-[status=error]/result:text-red-400 group-data-[status=warning]/result:text-orange-300",children:[(0,r.jsx)(w,{}),"string"==typeof t?(0,d.aj)(t):t]})})},E.Description=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)(N.Column,{...s,children:t})},E.Metadata=e=>{let{children:t,className:a,...s}=e;return(0,r.jsx)(N.Column,{align:"right",...s,className:(0,d.cn)("font-mono text-slate-11",a),children:i.Children.map(t,(e,t)=>(0,r.jsxs)(r.Fragment,{children:[t>0?" \xb7 ":null,e]}))})};let z=e=>{let{markup:t,plainText:a,initialResult:r}=e,[s,l]=(0,i.useState)(r),[n,o]=(0,i.useState)(!1),c=(0,i.useRef)(!1);return[s,{loading:n,load:async()=>{if(!c.current){c.current=!0,o(!0);try{let e=await fetch("https://react.email/api/check-spam",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:t,plainText:a})}),r=await e.json();if(!("error"in r))return l(r),r;f.oR.error(r.error)}catch(e){console.error(e),f.oR.error(JSON.stringify(e))}finally{o(!1),c.current=!1}}}}]},D=e=>{let{result:t}=e;return(0,r.jsx)(r.Fragment,{children:t?(0,r.jsxs)(N,{children:[(0,r.jsxs)(N.Row,{className:"sticky border-b top-0",children:[(0,r.jsx)(N.Column,{className:"uppercase",children:(0,r.jsxs)("span",{className:"flex gap-2 items-center",children:[(0,r.jsx)(w,{className:(0,d.cn)(0===t.points?"text-green-400":null,(t.points>0&&t.points,null),t.points>1.5?"text-yellow-100":null,t.points>3?"text-orange-400":null,t.points>=5?"text-red-400":null)}),"Score"]})}),(0,r.jsx)(N.Column,{children:0===t.points?"Congratulations! Your email is clean of abuse indicators.":"Higher scores are better"}),(0,r.jsxs)(N.Column,{className:"text-right tracking-tighter font-bold",children:[(0,r.jsx)("span",{className:(0,d.cn)("text-3xl",0===t.points?"text-green-400":null,(t.points>0&&t.points,null),t.points>1.5?"text-yellow-200":null,t.points>3?"text-orange-400":null,t.points>=5?"text-red-400":null),children:(10-t.points).toFixed(1)})," ",(0,r.jsx)("span",{className:"text-lg",children:"/ 10"})]})]}),(function(e,t){let a=[...e];return a.sort(t),a})(t.checks,(e,t)=>t.points-e.points).map(e=>(0,r.jsxs)(N.Row,{children:[(0,r.jsx)(N.Column,{className:"uppercase",children:(0,r.jsxs)("span",{className:"flex gap-2 items-center",children:[(0,r.jsx)(w,{className:(0,d.cn)(e.points>1?"text-yellow-200":null,e.points>2?"text-orange-400":null,e.points>3?"text-red-400":null)}),(0,d.aj)(e.name)]})}),(0,r.jsx)(N.Column,{children:e.description}),(0,r.jsxs)(N.Column,{className:(0,d.cn)("text-right font-mono tracking-tighter",e.points>1?"text-yellow-200":null,e.points>2?"text-orange-400":null,e.points>3?"text-red-400":null),children:["-",e.points.toFixed(1)]})]},e.name))]}):null})};var V=a(6886),_=a(1966);let O=e=>{let{children:t,className:a,active:s,tooltip:l,delayDuration:n=500,...i}=e;return(0,r.jsx)(_.m.Provider,{children:(0,r.jsxs)(_.m,{delayDuration:n,children:[(0,r.jsx)(_.m.Trigger,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",...i,className:(0,d.cn)("h-full w-fit font-regular flex text-sm text-slate-10 items-center align-middle justify-center px-1 gap-2 relative","hover:text-slate-12 transition-colors",s&&"data-[state=active]:text-cyan-11",a),children:[t,s?(0,r.jsx)(V.P.span,{className:"-bottom-px absolute rounded-sm left-0 w-full bg-cyan-11 h-px",layoutId:"active-toolbar-button",transition:{type:"spring",bounce:.2,duration:.6}}):null]})}),l?(0,r.jsx)(_.m.Content,{children:l}):null]})})},F=e=>{let t;if("localStorage"in a.g){let r=a.g.localStorage.getItem(e);if(null!==r&&"undefined"!==r)try{t=JSON.parse(r)}catch(t){console.warn("Failed to load stored value for",e,"with value",r)}}return[(0,i.useSyncExternalStore)(()=>()=>{},()=>t,()=>void 0),function(t){"localStorage"in a.g&&a.g.localStorage.setItem(e,JSON.stringify(t))}]},U=()=>{var e;let t=null!=(e=(0,n.useSearchParams)().get("toolbar-panel"))?e:void 0;return{activeTab:t,toggled:void 0!==t}},B=e=>{let{serverLintingRows:t,serverSpamCheckingResult:a,serverCompatibilityResults:c,markup:h,reactMarkup:m,plainText:f,emailPath:g,emailSlug:j}=e,b=(0,n.usePathname)(),v=(0,n.useSearchParams)(),w=(0,n.useRouter)(),{activeTab:y,toggled:C}=U(),k=e=>{let t=new URLSearchParams(v);void 0===e?t.delete("toolbar-panel"):t.set("toolbar-panel",e),w.push("".concat(b,"?").concat(t.toString()).concat(location.hash))},[N,R]=F("spam-assassin-".concat(j.replaceAll("/","-"))),[M,{load:T,loading:H}]=z({markup:h,plainText:f,initialResult:null!=a?a:N}),[E,V]=F("linter-".concat(j.replaceAll("/","-"))),[_,{load:B,loading:X}]=P({markup:h,initialRows:null!=t?t:E}),[q,G]=F("compatibility-".concat(j.replaceAll("/","-"))),[Q,{load:$,loading:K}]=S({emailPath:g,reactMarkup:m,initialResults:null!=c?c:q});return o.Hf||(0,i.useEffect)(()=>{(async()=>{V(await B()),R(await T()),G(await $())})()},[]),(0,r.jsx)("div",{"data-toggled":C,className:(0,d.cn)("absolute bottom-0 left-0 right-0","border-t border-slate-6 group/toolbar text-xs text-slate-11 h-52 transition-transform","data-[toggled=false]:translate-y-[10.625rem]"),children:(0,r.jsx)(s.bL,{value:null!=y?y:"",onValueChange:e=>{k(e)},asChild:!0,children:(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsxs)(s.B8,{className:"flex gap-4 px-4 border-b border-solid border-slate-6 h-10 w-full flex-shrink-0",children:[(0,r.jsxs)(l.o,{id:"toolbar",children:[(0,r.jsx)(s.l9,{asChild:!0,value:"linter",children:(0,r.jsx)(O,{active:"linter"===y,children:"Linter"})}),(0,r.jsx)(s.l9,{asChild:!0,value:"compatibility",children:(0,r.jsx)(O,{active:"compatibility"===y,children:"Compatibility"})}),(0,r.jsx)(s.l9,{asChild:!0,value:"spam-assassin",children:(0,r.jsx)(O,{active:"spam-assassin"===y,children:"Spam"})})]}),(0,r.jsxs)("div",{className:"flex gap-0.5 ml-auto",children:[(0,r.jsx)(O,{delayDuration:0,tooltip:"linter"===y&&"The Linter tab checks all the images and links for common issues like missing alt text, broken URLs, insecure HTTP methods, and more."||"spam-assassin"===y&&"The Spam tab will look at the content and use a robust scoring framework to determine if the email is likely to be spam. Powered by SpamAssassin."||"compatibility"===y&&"The Compatibility tab shows how well the HTML/CSS is supported across mail clients like Outlook, Gmail, etc. Powered by Can I Email."||"Info",children:(0,r.jsx)(x,{size:24})}),o.Hf?null:(0,r.jsx)(O,{tooltip:"Reload",disabled:X||H,onClick:async()=>{void 0===y&&k("linter"),"spam-assassin"===y?await T():"linter"===y?await B():"compatibility"===y&&await $()},children:(0,r.jsx)(p,{size:24,className:(0,d.cn)({"animate-spin opacity-60 animate-spin-fast":X||H})})}),(0,r.jsx)(O,{tooltip:"Toggle toolbar",onClick:()=>{void 0===y?k("linter"):k(void 0)},children:(0,r.jsx)(u.R,{size:24,className:"transition-transform group-data-[toggled=false]/toolbar:rotate-180"})})]})]}),(0,r.jsxs)("div",{className:"flex-grow transition-opacity opacity-100 group-data-[toggled=false]/toolbar:opacity-0 overflow-y-auto pr-3 pl-4 pt-3",children:[(0,r.jsx)(s.UC,{value:"linter",children:X?(0,r.jsx)(W,{message:"Analyzing your code for linting issues..."}):(null==_?void 0:_.length)===0?(0,r.jsxs)(A,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(Y,{children:"All good"}),(0,r.jsx)(J,{children:"No linting issues found."})]}):(0,r.jsx)(I,{rows:null!=_?_:[]})}),(0,r.jsx)(s.UC,{value:"compatibility",children:K?(0,r.jsx)(W,{message:"Checking email compatibility..."}):(null==Q?void 0:Q.length)===0?(0,r.jsxs)(A,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(Y,{children:"Great compatibility"}),(0,r.jsx)(J,{children:"Template should render properly everywhere."})]}):(0,r.jsx)(L,{results:null!=Q?Q:[]})}),(0,r.jsx)(s.UC,{value:"spam-assassin",children:H?(0,r.jsx)(W,{message:"Evaluating your email for spam indicators..."}):(null==M?void 0:M.isSpam)===!1?(0,r.jsxs)(A,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(Y,{children:"10/10"}),(0,r.jsx)(J,{children:"Your email is clean of abuse indicators."})]}):(0,r.jsx)(D,{result:M})})]})]})})})},W=e=>{let{message:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center pt-8",children:[(0,r.jsxs)("div",{className:"relative mb-8 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"h-12 w-12 rounded-full bg-gradient-to-br from-cyan-400/80 to-cyan-600/80 opacity-10 blur-xl absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 animate-pulse"}),(0,r.jsx)("div",{className:"h-12 w-12 rounded-full border border-slate-4 absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),(0,r.jsx)("div",{className:"h-10 w-10 rounded-full flex items-center justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,r.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-white/50 border-t-transparent animate-spin-fast"})})]}),(0,r.jsx)("h3",{className:"text-slate-12 font-medium text-base mb-1",children:"Processing"}),(0,r.jsx)("p",{className:"text-slate-11 text-sm text-center max-w-[320px]",children:t})]})},A=e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"flex flex-col items-center justify-center pt-8",children:t})},Z=()=>(0,r.jsxs)("div",{className:"relative mb-8 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-green-300/20 opacity-80 to-emerald-500/30 blur-md absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),(0,r.jsx)("div",{className:"h-12 w-12 rounded-full bg-gradient-to-br from-green-400/80 opacity-10 to-emerald-600/80 absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 shadow-lg"}),(0,r.jsx)("div",{className:"h-10 w-10 rounded-full bg-gradient-to-br from-green-400 to-emerald-600 flex items-center justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 shadow-[inset_0_1px_1px_rgba(255,255,255,0.4)]",children:(0,r.jsx)(h.i,{size:24,className:"text-white drop-shadow-sm"})})]}),Y=e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"text-slate-12 font-medium text-base mb-1",children:t})},J=e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"text-slate-11 text-sm text-center max-w-[320px]",children:t})},X=e=>{let{serverLintingRows:t,serverSpamCheckingResult:a,serverCompatibilityResults:s}=e,{emailPath:l,emailSlug:n,renderedEmailMetadata:o}=(0,i.use)(c.o);if(void 0===o)return null;let{markup:d,plainText:u,reactMarkup:h}=o;return(0,r.jsx)(B,{emailPath:l,emailSlug:n,markup:d,reactMarkup:h,plainText:u,serverLintingRows:t,serverSpamCheckingResult:a,serverCompatibilityResults:s})}},8838:(e,t,a)=>{Promise.resolve().then(a.bind(a,3726)),Promise.resolve().then(a.bind(a,1494)),Promise.resolve().then(a.bind(a,8340)),Promise.resolve().then(a.bind(a,7012))}},e=>{var t=t=>e(e.s=t);e.O(0,[979,589,293,45,484,733,107,358],()=>t(8838)),_N_E=e.O()}]);
|