module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},35202,a=>{"use strict";var b=a.i(2157),c=a.i(50227);let d=async a=>{let d;try{d=await b.default.promises.open(a,"r")}catch(a){return console.warn(a),!1}if((await d.stat()).isDirectory())return await d.close(),!1;let{ext:e}=c.default.parse(a);if(![".js",".tsx",".jsx"].includes(e))return await d.close(),!1;let f=await d.readFile("utf8");await d.close();let g=/\bexport\s+default\b/gm.test(f),h=/\bmodule\.exports\s*=/gm.test(f),i=/\bexport\s+\{[^}]*\bdefault\b[^}]*\}/gm.test(f);return g||h||i},e=async(a,f=!1,g=!1,h=a)=>{if(!b.default.existsSync(a))return;let i=await b.default.promises.readdir(a,{withFileTypes:!0}),j=await Promise.all(i.map(b=>d(c.default.join(a,b.name)))),k=i.filter((a,b)=>j[b]).map(a=>f?a.name:a.name.replace(c.default.extname(a.name),"")),l=await Promise.all(i.filter(a=>a.isDirectory()&&!a.name.startsWith("_")&&"static"!==a.name).map(b=>e(c.default.join(a,b.name),f,!0,h))),m={absolutePath:a,relativePath:c.default.relative(h,a),directoryName:a.split(c.default.sep).pop(),emailFilenames:k,subDirectories:l};return g?(a=>{let b=a;for(;0===b.emailFilenames.length&&1===b.subDirectories.length;){let a=b.subDirectories[0];b={...a,directoryName:c.default.join(b.directoryName,a.directoryName)}}return b})(m):m};a.s(["getEmailsDirectoryMetadata",0,e])},38379,a=>{"use strict";let b=process.env.USER_PROJECT_LOCATION,c=process.env.PREVIEW_SERVER_LOCATION,d=process.env.EMAILS_DIR_ABSOLUTE_PATH,e=process.env.RESEND_API_KEY,f="true"===process.env.NEXT_PUBLIC_IS_BUILDING,g="true"===process.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT;a.s(["emailsDirectoryAbsolutePath",0,d,"isBuilding",0,f,"isPreviewDevelopment",0,g,"previewServerLocation",0,c,"resendApiKey",0,e,"userProjectLocation",0,b])},7962,a=>{"use strict";var b=a.i(55317);let c=(0,b.registerClientReference)(function(){throw Error("Attempted to call EmailsProvider() from the server but EmailsProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/packages/preview-server/src/contexts/emails.tsx <module evaluation>","EmailsProvider"),d=(0,b.registerClientReference)(function(){throw Error("Attempted to call useEmails() from the server but useEmails is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/packages/preview-server/src/contexts/emails.tsx <module evaluation>","useEmails");a.s(["EmailsProvider",0,c,"useEmails",0,d])},75367,a=>{"use strict";var b=a.i(55317);let c=(0,b.registerClientReference)(function(){throw Error("Attempted to call EmailsProvider() from the server but EmailsProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/packages/preview-server/src/contexts/emails.tsx","EmailsProvider"),d=(0,b.registerClientReference)(function(){throw Error("Attempted to call useEmails() from the server but useEmails is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/packages/preview-server/src/contexts/emails.tsx","useEmails");a.s(["EmailsProvider",0,c,"useEmails",0,d])},60601,a=>{"use strict";a.i(7962);var b=a.i(75367);a.n(b)},75405,a=>{a.v({className:"inter_8a594245-module__h1XLeG__className",variable:"inter_8a594245-module__h1XLeG__variable"})},98112,a=>{a.v({className:"sfmono_4612e31-module__uAfGsa__className",variable:"sfmono_4612e31-module__uAfGsa__variable"})},17477,a=>{"use strict";var b=a.i(86108),c=a.i(60601),d=a.i(35202),e=a.i(38379),f=a.i(75405);let g={className:f.default.className,style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"}};null!=f.default.variable&&(g.variable=f.default.variable);var h=a.i(98112);let i={className:h.default.className,style:{fontFamily:"'sfMono', 'sfMono Fallback'"}};async function j({children:a}){let f=await (0,d.getEmailsDirectoryMetadata)(e.emailsDirectoryAbsolutePath);if(void 0===f)throw Error(`Could not find the emails directory specified under ${e.emailsDirectoryAbsolutePath}!`);return(0,b.jsx)("html",{className:`${g.variable} ${i.variable} font-sans`,lang:"en",children:(0,b.jsx)("body",{className:"relative h-screen bg-black text-slate-11 leading-loose selection:bg-cyan-5 selection:text-cyan-12",children:(0,b.jsx)("div",{className:"bg-gradient-to-t from-slate-3 flex flex-col",children:(0,b.jsx)(c.EmailsProvider,{initialEmailsDirectoryMetadata:f,children:a})})})})}null!=h.default.variable&&(i.variable=h.default.variable),a.s(["default",()=>j,"dynamic",0,"force-dynamic","metadata",0,{title:"React Email"}],17477)}];

//# sourceMappingURL=%5Broot-of-the-server%5D__d142d10f._.js.map