react-email 4.0.16 → 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.
Files changed (470) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dev/index.js +40 -0
  3. package/dev/package.json +13 -0
  4. package/dist/index.js +1 -1
  5. package/package.json +13 -46
  6. package/readme.md +16 -0
  7. package/src/commands/build.ts +306 -0
  8. package/src/commands/dev.ts +27 -0
  9. package/src/commands/export.ts +204 -0
  10. package/src/commands/start.ts +38 -0
  11. package/src/index.ts +55 -0
  12. package/src/utils/__snapshots__/tree.spec.ts.snap +27 -0
  13. package/src/utils/esbuild/renderring-utilities-exporter.ts +1 -1
  14. package/src/utils/get-emails-directory-metadata.spec.ts +1 -1
  15. package/src/utils/get-preview-server-location.ts +51 -0
  16. package/src/utils/index.ts +2 -6
  17. package/src/utils/packageJson.ts +4 -0
  18. package/src/utils/preview/get-env-variables-for-preview-app.ts +14 -0
  19. package/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts +284 -0
  20. package/src/utils/preview/hot-reloading/create-dependency-graph.ts +321 -0
  21. package/src/utils/preview/hot-reloading/get-imported-modules.spec.ts +151 -0
  22. package/src/utils/preview/hot-reloading/get-imported-modules.ts +49 -0
  23. package/src/utils/preview/hot-reloading/resolve-path-aliases.spec.ts +11 -0
  24. package/src/utils/preview/hot-reloading/resolve-path-aliases.ts +32 -0
  25. package/src/utils/preview/hot-reloading/setup-hot-reloading.ts +121 -0
  26. package/src/utils/preview/hot-reloading/test/tsconfig.json +8 -0
  27. package/src/utils/preview/index.ts +2 -0
  28. package/src/utils/preview/serve-static-file.ts +51 -0
  29. package/src/utils/preview/start-dev-server.ts +234 -0
  30. package/src/utils/tree.spec.ts +5 -0
  31. package/src/utils/tree.ts +76 -0
  32. package/src/utils/types/hot-reload-change.ts +1 -1
  33. package/src/utils/types/hot-reload-event.ts +1 -1
  34. package/tsconfig.json +4 -10
  35. package/dist/cli/index.d.mts +0 -1
  36. package/dist/cli/index.d.ts +0 -1
  37. package/dist/cli/index.js +0 -2785
  38. package/dist/cli/index.mjs +0 -1361
  39. package/dist/index.d.mts +0 -20
  40. package/dist/index.d.ts +0 -20
  41. package/dist/index.mjs +0 -21
  42. package/dist/package/index.d.mts +0 -33
  43. package/dist/package/index.d.ts +0 -33
  44. package/dist/package/index.js +0 -62
  45. package/dist/package/index.mjs +0 -7
  46. package/dist/preview/.next/BUILD_ID +0 -1
  47. package/dist/preview/.next/app-build-manifest.json +0 -44
  48. package/dist/preview/.next/app-path-routes-manifest.json +0 -6
  49. package/dist/preview/.next/build-manifest.json +0 -33
  50. package/dist/preview/.next/diagnostics/build-diagnostics.json +0 -6
  51. package/dist/preview/.next/diagnostics/framework.json +0 -1
  52. package/dist/preview/.next/export-marker.json +0 -6
  53. package/dist/preview/.next/images-manifest.json +0 -57
  54. package/dist/preview/.next/next-minimal-server.js.nft.json +0 -1
  55. package/dist/preview/.next/next-server.js.nft.json +0 -1
  56. package/dist/preview/.next/package.json +0 -1
  57. package/dist/preview/.next/prerender-manifest.json +0 -41
  58. package/dist/preview/.next/react-loadable-manifest.json +0 -1
  59. package/dist/preview/.next/required-server-files.json +0 -311
  60. package/dist/preview/.next/routes-manifest.json +0 -64
  61. package/dist/preview/.next/server/app/_not-found/page.js +0 -1
  62. package/dist/preview/.next/server/app/_not-found/page.js.nft.json +0 -1
  63. package/dist/preview/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
  64. package/dist/preview/.next/server/app/favicon.ico/route.js +0 -1
  65. package/dist/preview/.next/server/app/favicon.ico/route.js.nft.json +0 -1
  66. package/dist/preview/.next/server/app/favicon.ico.body +0 -0
  67. package/dist/preview/.next/server/app/favicon.ico.meta +0 -1
  68. package/dist/preview/.next/server/app/page.js +0 -1
  69. package/dist/preview/.next/server/app/page.js.nft.json +0 -1
  70. package/dist/preview/.next/server/app/page_client-reference-manifest.js +0 -1
  71. package/dist/preview/.next/server/app/preview/[...slug]/page.js +0 -321
  72. package/dist/preview/.next/server/app/preview/[...slug]/page.js.nft.json +0 -1
  73. package/dist/preview/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +0 -1
  74. package/dist/preview/.next/server/app-paths-manifest.json +0 -6
  75. package/dist/preview/.next/server/chunks/134.js +0 -6
  76. package/dist/preview/.next/server/chunks/235.js +0 -15
  77. package/dist/preview/.next/server/chunks/275.js +0 -1
  78. package/dist/preview/.next/server/chunks/343.js +0 -20
  79. package/dist/preview/.next/server/chunks/428.js +0 -14
  80. package/dist/preview/.next/server/chunks/963.js +0 -1
  81. package/dist/preview/.next/server/functions-config-manifest.json +0 -4
  82. package/dist/preview/.next/server/interception-route-rewrite-manifest.js +0 -1
  83. package/dist/preview/.next/server/middleware-build-manifest.js +0 -1
  84. package/dist/preview/.next/server/middleware-manifest.json +0 -6
  85. package/dist/preview/.next/server/middleware-react-loadable-manifest.js +0 -1
  86. package/dist/preview/.next/server/next-font-manifest.js +0 -1
  87. package/dist/preview/.next/server/next-font-manifest.json +0 -1
  88. package/dist/preview/.next/server/pages/500.html +0 -1
  89. package/dist/preview/.next/server/pages/_app.js +0 -1
  90. package/dist/preview/.next/server/pages/_app.js.nft.json +0 -1
  91. package/dist/preview/.next/server/pages/_document.js +0 -1
  92. package/dist/preview/.next/server/pages/_document.js.nft.json +0 -1
  93. package/dist/preview/.next/server/pages/_error.js +0 -1
  94. package/dist/preview/.next/server/pages/_error.js.nft.json +0 -1
  95. package/dist/preview/.next/server/pages-manifest.json +0 -5
  96. package/dist/preview/.next/server/server-reference-manifest.js +0 -1
  97. package/dist/preview/.next/server/server-reference-manifest.json +0 -1
  98. package/dist/preview/.next/server/webpack-runtime.js +0 -1
  99. package/dist/preview/.next/static/chunks/107-3043079e7cb8bcae.js +0 -1
  100. package/dist/preview/.next/static/chunks/293-297b1eb2241f9a70.js +0 -1
  101. package/dist/preview/.next/static/chunks/3bd82e28-cda2c00a924937c5.js +0 -1
  102. package/dist/preview/.next/static/chunks/45-1021fac82f766268.js +0 -1
  103. package/dist/preview/.next/static/chunks/484-e38a627386aae911.js +0 -1
  104. package/dist/preview/.next/static/chunks/589-817d8691661d370e.js +0 -1
  105. package/dist/preview/.next/static/chunks/902-c34acb56733e0ce1.js +0 -1
  106. package/dist/preview/.next/static/chunks/app/_not-found/page-4cbc7dce3ad33336.js +0 -1
  107. package/dist/preview/.next/static/chunks/app/layout-269b5cbd8f4cd2e3.js +0 -1
  108. package/dist/preview/.next/static/chunks/app/page-2dbfb5b2dc4b1191.js +0 -1
  109. package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-79e0c9b528a62f8b.js +0 -1
  110. package/dist/preview/.next/static/chunks/f33a14d2-ec7c5f0b91818561.js +0 -6
  111. package/dist/preview/.next/static/chunks/framework-b887e9fc751a9906.js +0 -1
  112. package/dist/preview/.next/static/chunks/main-9a03e7ba8acb1900.js +0 -1
  113. package/dist/preview/.next/static/chunks/main-app-976577a424e11c75.js +0 -1
  114. package/dist/preview/.next/static/chunks/pages/_app-542a93a5a214e1c0.js +0 -1
  115. package/dist/preview/.next/static/chunks/pages/_error-d5fe1b1612642f76.js +0 -1
  116. package/dist/preview/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  117. package/dist/preview/.next/static/chunks/webpack-31c45daa2bd82a7b.js +0 -1
  118. package/dist/preview/.next/static/css/ac3decd5d6736fbe.css +0 -3
  119. package/dist/preview/.next/static/media/05613964ce6c782e-s.p.otf +0 -0
  120. package/dist/preview/.next/static/media/11c6126b9369e85e-s.p.otf +0 -0
  121. package/dist/preview/.next/static/media/26a46d62cd723877-s.woff2 +0 -0
  122. package/dist/preview/.next/static/media/26cb97734d8cb717-s.p.otf +0 -0
  123. package/dist/preview/.next/static/media/55c55f0601d81cf3-s.woff2 +0 -0
  124. package/dist/preview/.next/static/media/581909926a08bbc8-s.woff2 +0 -0
  125. package/dist/preview/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  126. package/dist/preview/.next/static/media/97e0cb1ae144a2a9-s.woff2 +0 -0
  127. package/dist/preview/.next/static/media/bb6462617151f6b7-s.p.otf +0 -0
  128. package/dist/preview/.next/static/media/cf6daef822ab0142-s.p.otf +0 -0
  129. package/dist/preview/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  130. package/dist/preview/.next/static/media/e4051546b3043204-s.p.otf +0 -0
  131. package/dist/preview/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  132. package/dist/preview/.next/static/media/logo.2ce2a759.png +0 -0
  133. package/dist/preview/.next/static/yxjkw7Y7HRLmRWkl3S43z/_buildManifest.js +0 -1
  134. package/dist/preview/.next/static/yxjkw7Y7HRLmRWkl3S43z/_ssgManifest.js +0 -1
  135. package/dist/preview/.next/trace +0 -27
  136. package/dist/preview/.next/types/app/layout.ts +0 -84
  137. package/dist/preview/.next/types/app/page.ts +0 -84
  138. package/dist/preview/.next/types/app/preview/[...slug]/page.ts +0 -84
  139. package/dist/preview/.next/types/cache-life.d.ts +0 -141
  140. package/dist/preview/.next/types/package.json +0 -1
  141. package/module-punycode.d.ts +0 -3
  142. package/next-env.d.ts +0 -5
  143. package/next.config.js +0 -22
  144. package/postcss.config.js +0 -8
  145. package/scripts/build-preview-server.mjs +0 -33
  146. package/scripts/fill-caniemail-data.mjs +0 -36
  147. package/src/actions/email-validation/caniemail-data.ts +0 -85993
  148. package/src/actions/email-validation/check-compatibility.ts +0 -333
  149. package/src/actions/email-validation/check-images.spec.tsx +0 -100
  150. package/src/actions/email-validation/check-images.ts +0 -160
  151. package/src/actions/email-validation/check-links.spec.tsx +0 -113
  152. package/src/actions/email-validation/check-links.ts +0 -113
  153. package/src/actions/email-validation/get-code-location-from-ast-element.ts +0 -18
  154. package/src/actions/email-validation/quick-fetch.ts +0 -14
  155. package/src/actions/get-email-path-from-slug.ts +0 -32
  156. package/src/actions/get-emails-directory-metadata-action.ts +0 -19
  157. package/src/actions/render-email-by-path.tsx +0 -121
  158. package/src/animated-icons-data/help.json +0 -1082
  159. package/src/animated-icons-data/link.json +0 -1309
  160. package/src/animated-icons-data/load.json +0 -443
  161. package/src/animated-icons-data/mail.json +0 -1320
  162. package/src/app/env.ts +0 -15
  163. package/src/app/favicon.ico +0 -0
  164. package/src/app/fonts/SFMono/SFMonoBold.otf +0 -0
  165. package/src/app/fonts/SFMono/SFMonoBoldItalic.otf +0 -0
  166. package/src/app/fonts/SFMono/SFMonoHeavy.otf +0 -0
  167. package/src/app/fonts/SFMono/SFMonoHeavyItalic.otf +0 -0
  168. package/src/app/fonts/SFMono/SFMonoLight.otf +0 -0
  169. package/src/app/fonts/SFMono/SFMonoLightItalic.otf +0 -0
  170. package/src/app/fonts/SFMono/SFMonoMedium.otf +0 -0
  171. package/src/app/fonts/SFMono/SFMonoMediumItalic.otf +0 -0
  172. package/src/app/fonts/SFMono/SFMonoRegular.otf +0 -0
  173. package/src/app/fonts/SFMono/SFMonoRegularItalic.otf +0 -0
  174. package/src/app/fonts/SFMono/SFMonoSemibold.otf +0 -0
  175. package/src/app/fonts/SFMono/SFMonoSemiboldItalic.otf +0 -0
  176. package/src/app/fonts.ts +0 -39
  177. package/src/app/globals.css +0 -15
  178. package/src/app/layout.tsx +0 -43
  179. package/src/app/logo.png +0 -0
  180. package/src/app/page.tsx +0 -46
  181. package/src/app/preview/[...slug]/page.tsx +0 -157
  182. package/src/app/preview/[...slug]/preview.tsx +0 -216
  183. package/src/app/preview/[...slug]/rendering-error.tsx +0 -40
  184. package/src/commands/testing/out/magic-links/aws-verify-email.html +0 -165
  185. package/src/commands/testing/out/magic-links/linear-login-code.html +0 -90
  186. package/src/commands/testing/out/magic-links/notion-magic-link.html +0 -76
  187. package/src/commands/testing/out/magic-links/plaid-verify-identity.html +0 -78
  188. package/src/commands/testing/out/magic-links/raycast-magic-link.html +0 -91
  189. package/src/commands/testing/out/magic-links/slack-confirm.html +0 -240
  190. package/src/commands/testing/out/newsletters/codepen-challengers.html +0 -548
  191. package/src/commands/testing/out/newsletters/google-play-policy-update.html +0 -339
  192. package/src/commands/testing/out/newsletters/stack-overflow-tips.html +0 -231
  193. package/src/commands/testing/out/notifications/github-access-token.html +0 -104
  194. package/src/commands/testing/out/notifications/papermark-year-in-review.html +0 -317
  195. package/src/commands/testing/out/notifications/vercel-invite-user.html +0 -171
  196. package/src/commands/testing/out/notifications/yelp-recent-login.html +0 -195
  197. package/src/commands/testing/out/receipts/apple-receipt.html +0 -677
  198. package/src/commands/testing/out/receipts/nike-receipt.html +0 -724
  199. package/src/commands/testing/out/reset-password/dropbox-reset-password.html +0 -98
  200. package/src/commands/testing/out/reset-password/twitch-reset-password.html +0 -220
  201. package/src/commands/testing/out/reviews/airbnb-review.html +0 -206
  202. package/src/commands/testing/out/reviews/amazon-review.html +0 -356
  203. package/src/commands/testing/out/static/airbnb-logo.png +0 -0
  204. package/src/commands/testing/out/static/airbnb-review-user.jpg +0 -0
  205. package/src/commands/testing/out/static/amazon-book.jpg +0 -0
  206. package/src/commands/testing/out/static/amazon-facebook.jpg +0 -0
  207. package/src/commands/testing/out/static/amazon-instagram.jpg +0 -0
  208. package/src/commands/testing/out/static/amazon-logo.png +0 -0
  209. package/src/commands/testing/out/static/amazon-prime-logo.png +0 -0
  210. package/src/commands/testing/out/static/amazon-rating.gif +0 -0
  211. package/src/commands/testing/out/static/amazon-twitter.jpg +0 -0
  212. package/src/commands/testing/out/static/apple-card-icon.png +0 -0
  213. package/src/commands/testing/out/static/apple-hbo-max-icon.jpeg +0 -0
  214. package/src/commands/testing/out/static/apple-logo.png +0 -0
  215. package/src/commands/testing/out/static/apple-wallet.png +0 -0
  216. package/src/commands/testing/out/static/aws-logo.png +0 -0
  217. package/src/commands/testing/out/static/codepen-challengers.png +0 -0
  218. package/src/commands/testing/out/static/codepen-cube.png +0 -0
  219. package/src/commands/testing/out/static/codepen-pro.png +0 -0
  220. package/src/commands/testing/out/static/dropbox-logo.png +0 -0
  221. package/src/commands/testing/out/static/github.png +0 -0
  222. package/src/commands/testing/out/static/google-play-academy.png +0 -0
  223. package/src/commands/testing/out/static/google-play-chat.png +0 -0
  224. package/src/commands/testing/out/static/google-play-footer.png +0 -0
  225. package/src/commands/testing/out/static/google-play-header.png +0 -0
  226. package/src/commands/testing/out/static/google-play-icon.png +0 -0
  227. package/src/commands/testing/out/static/google-play-logo.png +0 -0
  228. package/src/commands/testing/out/static/google-play-pl.png +0 -0
  229. package/src/commands/testing/out/static/google-play.png +0 -0
  230. package/src/commands/testing/out/static/koala-logo.png +0 -0
  231. package/src/commands/testing/out/static/linear-logo.png +0 -0
  232. package/src/commands/testing/out/static/netlify-logo.png +0 -0
  233. package/src/commands/testing/out/static/nike-logo.png +0 -0
  234. package/src/commands/testing/out/static/nike-phone.png +0 -0
  235. package/src/commands/testing/out/static/nike-product.png +0 -0
  236. package/src/commands/testing/out/static/nike-recomendation-1.png +0 -0
  237. package/src/commands/testing/out/static/nike-recomendation-2.png +0 -0
  238. package/src/commands/testing/out/static/nike-recomendation-3.png +0 -0
  239. package/src/commands/testing/out/static/nike-recomendation-4.png +0 -0
  240. package/src/commands/testing/out/static/notion-logo.png +0 -0
  241. package/src/commands/testing/out/static/plaid-logo.png +0 -0
  242. package/src/commands/testing/out/static/raycast-bg.png +0 -0
  243. package/src/commands/testing/out/static/raycast-logo.png +0 -0
  244. package/src/commands/testing/out/static/slack-facebook.png +0 -0
  245. package/src/commands/testing/out/static/slack-linkedin.png +0 -0
  246. package/src/commands/testing/out/static/slack-logo.png +0 -0
  247. package/src/commands/testing/out/static/slack-twitter.png +0 -0
  248. package/src/commands/testing/out/static/stack-overflow-header.png +0 -0
  249. package/src/commands/testing/out/static/stack-overflow-logo-sm.png +0 -0
  250. package/src/commands/testing/out/static/stack-overflow-logo.png +0 -0
  251. package/src/commands/testing/out/static/stripe-logo.png +0 -0
  252. package/src/commands/testing/out/static/twitch-icon-facebook.png +0 -0
  253. package/src/commands/testing/out/static/twitch-icon-twitter.png +0 -0
  254. package/src/commands/testing/out/static/twitch-logo.png +0 -0
  255. package/src/commands/testing/out/static/vercel-arrow.png +0 -0
  256. package/src/commands/testing/out/static/vercel-logo.png +0 -0
  257. package/src/commands/testing/out/static/vercel-team.png +0 -0
  258. package/src/commands/testing/out/static/vercel-user.png +0 -0
  259. package/src/commands/testing/out/static/yelp-footer.png +0 -0
  260. package/src/commands/testing/out/static/yelp-header.png +0 -0
  261. package/src/commands/testing/out/static/yelp-logo.png +0 -0
  262. package/src/commands/testing/out/welcome/koala-welcome.html +0 -90
  263. package/src/commands/testing/out/welcome/netlify-welcome.html +0 -199
  264. package/src/commands/testing/out/welcome/stripe-welcome.html +0 -153
  265. package/src/components/button.tsx +0 -101
  266. package/src/components/code-container.tsx +0 -164
  267. package/src/components/code-snippet.tsx +0 -9
  268. package/src/components/code.tsx +0 -184
  269. package/src/components/heading.tsx +0 -113
  270. package/src/components/icons/icon-arrow-down.tsx +0 -16
  271. package/src/components/icons/icon-base.tsx +0 -26
  272. package/src/components/icons/icon-bug.tsx +0 -19
  273. package/src/components/icons/icon-button.tsx +0 -23
  274. package/src/components/icons/icon-check.tsx +0 -19
  275. package/src/components/icons/icon-clipboard.tsx +0 -40
  276. package/src/components/icons/icon-download.tsx +0 -19
  277. package/src/components/icons/icon-email.tsx +0 -18
  278. package/src/components/icons/icon-file.tsx +0 -19
  279. package/src/components/icons/icon-folder-open.tsx +0 -19
  280. package/src/components/icons/icon-folder.tsx +0 -18
  281. package/src/components/icons/icon-hide-sidebar.tsx +0 -23
  282. package/src/components/icons/icon-image.tsx +0 -19
  283. package/src/components/icons/icon-info.tsx +0 -18
  284. package/src/components/icons/icon-link.tsx +0 -14
  285. package/src/components/icons/icon-monitor.tsx +0 -19
  286. package/src/components/icons/icon-phone.tsx +0 -26
  287. package/src/components/icons/icon-reload.tsx +0 -18
  288. package/src/components/icons/icon-source.tsx +0 -19
  289. package/src/components/icons/icon-stamp.tsx +0 -14
  290. package/src/components/icons/icon-warning.tsx +0 -31
  291. package/src/components/index.ts +0 -7
  292. package/src/components/logo.tsx +0 -63
  293. package/src/components/resizable-wrapper.tsx +0 -173
  294. package/src/components/send.tsx +0 -134
  295. package/src/components/shell.tsx +0 -95
  296. package/src/components/sidebar/file-tree-directory-children.tsx +0 -134
  297. package/src/components/sidebar/file-tree-directory.tsx +0 -92
  298. package/src/components/sidebar/file-tree.tsx +0 -31
  299. package/src/components/sidebar/index.ts +0 -1
  300. package/src/components/sidebar/sidebar.tsx +0 -43
  301. package/src/components/text.tsx +0 -99
  302. package/src/components/toolbar/checking-results.tsx +0 -150
  303. package/src/components/toolbar/code-preview-line-link.tsx +0 -40
  304. package/src/components/toolbar/compatibility.tsx +0 -113
  305. package/src/components/toolbar/linter.tsx +0 -278
  306. package/src/components/toolbar/results.tsx +0 -51
  307. package/src/components/toolbar/spam-assassin.tsx +0 -155
  308. package/src/components/toolbar/toolbar-button.tsx +0 -52
  309. package/src/components/toolbar/use-cached-state.ts +0 -33
  310. package/src/components/toolbar.tsx +0 -349
  311. package/src/components/tooltip-content.tsx +0 -31
  312. package/src/components/tooltip.tsx +0 -19
  313. package/src/components/topbar/active-view-toggle-group.tsx +0 -86
  314. package/src/components/topbar/view-size-controls.tsx +0 -247
  315. package/src/components/topbar.tsx +0 -59
  316. package/src/contexts/emails.tsx +0 -59
  317. package/src/contexts/fragment-identifier.tsx +0 -48
  318. package/src/contexts/preview.tsx +0 -79
  319. package/src/hooks/use-clamped-state.ts +0 -24
  320. package/src/hooks/use-email-rendering-result.ts +0 -58
  321. package/src/hooks/use-fragment-identifier.ts +0 -14
  322. package/src/hooks/use-hot-reload.ts +0 -31
  323. package/src/hooks/use-icon-animation.ts +0 -41
  324. package/src/hooks/use-rendering-metadata.ts +0 -36
  325. package/src/package/body/dist/index.d.mts +0 -6
  326. package/src/package/body/dist/index.d.ts +0 -6
  327. package/src/package/body/dist/index.js +0 -79
  328. package/src/package/body/dist/index.mjs +0 -45
  329. package/src/package/button/dist/index.d.mts +0 -6
  330. package/src/package/button/dist/index.d.ts +0 -6
  331. package/src/package/button/dist/index.js +0 -252
  332. package/src/package/button/dist/index.mjs +0 -218
  333. package/src/package/code-block/dist/index.d.mts +0 -4906
  334. package/src/package/code-block/dist/index.d.ts +0 -4906
  335. package/src/package/code-block/dist/index.js +0 -18205
  336. package/src/package/code-block/dist/index.mjs +0 -18133
  337. package/src/package/code-inline/dist/index.d.mts +0 -11
  338. package/src/package/code-inline/dist/index.d.ts +0 -11
  339. package/src/package/code-inline/dist/index.js +0 -106
  340. package/src/package/code-inline/dist/index.mjs +0 -72
  341. package/src/package/column/dist/index.d.mts +0 -6
  342. package/src/package/column/dist/index.d.ts +0 -6
  343. package/src/package/column/dist/index.js +0 -79
  344. package/src/package/column/dist/index.mjs +0 -45
  345. package/src/package/components/dist/index.d.mts +0 -20
  346. package/src/package/components/dist/index.d.ts +0 -20
  347. package/src/package/components/dist/index.js +0 -62
  348. package/src/package/components/dist/index.mjs +0 -21
  349. package/src/package/container/dist/index.d.mts +0 -6
  350. package/src/package/container/dist/index.d.ts +0 -6
  351. package/src/package/container/dist/index.js +0 -93
  352. package/src/package/container/dist/index.mjs +0 -59
  353. package/src/package/font/dist/index.d.mts +0 -25
  354. package/src/package/font/dist/index.d.ts +0 -25
  355. package/src/package/font/dist/index.js +0 -55
  356. package/src/package/font/dist/index.mjs +0 -28
  357. package/src/package/head/dist/index.d.mts +0 -6
  358. package/src/package/head/dist/index.d.ts +0 -6
  359. package/src/package/head/dist/index.js +0 -83
  360. package/src/package/head/dist/index.mjs +0 -49
  361. package/src/package/heading/dist/index.d.mts +0 -43
  362. package/src/package/heading/dist/index.d.ts +0 -43
  363. package/src/package/heading/dist/index.js +0 -113
  364. package/src/package/heading/dist/index.mjs +0 -79
  365. package/src/package/hr/dist/index.d.mts +0 -6
  366. package/src/package/hr/dist/index.d.ts +0 -6
  367. package/src/package/hr/dist/index.js +0 -89
  368. package/src/package/hr/dist/index.mjs +0 -55
  369. package/src/package/html/dist/index.d.mts +0 -6
  370. package/src/package/html/dist/index.d.ts +0 -6
  371. package/src/package/html/dist/index.js +0 -79
  372. package/src/package/html/dist/index.mjs +0 -45
  373. package/src/package/img/dist/index.d.mts +0 -6
  374. package/src/package/img/dist/index.d.ts +0 -6
  375. package/src/package/img/dist/index.js +0 -94
  376. package/src/package/img/dist/index.mjs +0 -60
  377. package/src/package/link/dist/index.d.mts +0 -6
  378. package/src/package/link/dist/index.d.ts +0 -6
  379. package/src/package/link/dist/index.js +0 -90
  380. package/src/package/link/dist/index.mjs +0 -56
  381. package/src/package/markdown/dist/index.d.mts +0 -15
  382. package/src/package/markdown/dist/index.d.ts +0 -15
  383. package/src/package/markdown/dist/index.js +0 -92
  384. package/src/package/markdown/dist/index.mjs +0 -58
  385. package/src/package/preview/dist/index.d.mts +0 -12
  386. package/src/package/preview/dist/index.d.ts +0 -12
  387. package/src/package/preview/dist/index.js +0 -108
  388. package/src/package/preview/dist/index.mjs +0 -73
  389. package/src/package/render/dist/browser/index.d.mts +0 -24
  390. package/src/package/render/dist/browser/index.d.ts +0 -24
  391. package/src/package/render/dist/browser/index.js +0 -250
  392. package/src/package/render/dist/browser/index.mjs +0 -214
  393. package/src/package/render/dist/index.d.mts +0 -23
  394. package/src/package/render/dist/index.d.ts +0 -23
  395. package/src/package/render/dist/index.js +0 -768
  396. package/src/package/render/dist/index.mjs +0 -733
  397. package/src/package/render/dist/node/index.d.mts +0 -27
  398. package/src/package/render/dist/node/index.d.ts +0 -27
  399. package/src/package/render/dist/node/index.js +0 -212
  400. package/src/package/render/dist/node/index.mjs +0 -176
  401. package/src/package/row/dist/index.d.mts +0 -10
  402. package/src/package/row/dist/index.d.ts +0 -10
  403. package/src/package/row/dist/index.js +0 -93
  404. package/src/package/row/dist/index.mjs +0 -59
  405. package/src/package/section/dist/index.d.mts +0 -6
  406. package/src/package/section/dist/index.d.ts +0 -6
  407. package/src/package/section/dist/index.js +0 -93
  408. package/src/package/section/dist/index.mjs +0 -59
  409. package/src/package/tailwind/dist/index.d.ts +0 -19
  410. package/src/package/tailwind/dist/index.js +0 -48
  411. package/src/package/tailwind/dist/index.mjs +0 -17167
  412. package/src/package/tailwind/dist/tailwindcss/config.d.ts +0 -376
  413. package/src/package/tailwind/dist/tailwindcss/generated/.gitkeep +0 -0
  414. package/src/package/tailwind/dist/tailwindcss/generated/colors.d.ts +0 -298
  415. package/src/package/tailwind/dist/tailwindcss/generated/corePluginList.d.ts +0 -1
  416. package/src/package/tailwind/dist/tailwindcss/generated/default-theme.d.ts +0 -397
  417. package/src/package/tailwind/dist/tailwindcss/index.d.ts +0 -11
  418. package/src/package/text/dist/index.d.mts +0 -6
  419. package/src/package/text/dist/index.d.ts +0 -6
  420. package/src/package/text/dist/index.js +0 -89
  421. package/src/package/text/dist/index.mjs +0 -55
  422. package/src/utils/__snapshots__/get-email-component.spec.ts.snap +0 -3
  423. package/src/utils/caniemail/all-css-properties.ts +0 -358
  424. package/src/utils/caniemail/ast/__snapshots__/get-object-variables.spec.ts.snap +0 -74
  425. package/src/utils/caniemail/ast/__snapshots__/get-used-style-properties.spec.ts.snap +0 -24
  426. package/src/utils/caniemail/ast/get-object-variables.spec.ts +0 -19
  427. package/src/utils/caniemail/ast/get-object-variables.ts +0 -61
  428. package/src/utils/caniemail/ast/get-used-style-properties.spec.ts +0 -23
  429. package/src/utils/caniemail/ast/get-used-style-properties.ts +0 -91
  430. package/src/utils/caniemail/get-compatibility-stats-for-entry.ts +0 -118
  431. package/src/utils/caniemail/get-css-functions.ts +0 -25
  432. package/src/utils/caniemail/get-css-property-names.ts +0 -32
  433. package/src/utils/caniemail/get-css-property-with-value.ts +0 -14
  434. package/src/utils/caniemail/get-css-unit.ts +0 -3
  435. package/src/utils/caniemail/get-element-attributes.ts +0 -7
  436. package/src/utils/caniemail/get-element-names.ts +0 -20
  437. package/src/utils/caniemail/tailwind/generate-tailwind-rules.ts +0 -30
  438. package/src/utils/caniemail/tailwind/get-tailwind-config.ts +0 -187
  439. package/src/utils/caniemail/tailwind/get-tailwind-metadata.spec.ts +0 -25
  440. package/src/utils/caniemail/tailwind/get-tailwind-metadata.ts +0 -45
  441. package/src/utils/caniemail/tailwind/setup-tailwind-context.ts +0 -15
  442. package/src/utils/cn.ts +0 -6
  443. package/src/utils/constants.ts +0 -6
  444. package/src/utils/contains-email-template.spec.ts +0 -124
  445. package/src/utils/contains-email-template.ts +0 -33
  446. package/src/utils/copy-text-to-clipboard.ts +0 -7
  447. package/src/utils/get-email-component.spec.ts +0 -41
  448. package/src/utils/get-email-component.ts +0 -134
  449. package/src/utils/get-line-and-column-from-offset.spec.ts +0 -11
  450. package/src/utils/get-line-and-column-from-offset.ts +0 -11
  451. package/src/utils/improve-error-with-sourcemap.ts +0 -86
  452. package/src/utils/js-email-detection.spec.ts +0 -24
  453. package/src/utils/language-map.ts +0 -7
  454. package/src/utils/linting.ts +0 -60
  455. package/src/utils/load-stream.ts +0 -15
  456. package/src/utils/result.ts +0 -49
  457. package/src/utils/run-bundled-code.ts +0 -64
  458. package/src/utils/sanitize.ts +0 -6
  459. package/src/utils/static-node-modules-for-vm.ts +0 -93
  460. package/src/utils/testing/js-email-export-default.js +0 -17
  461. package/src/utils/testing/js-email-test.js +0 -18
  462. package/src/utils/testing/mdx-email-test.js +0 -128
  463. package/src/utils/testing/request-response-email.tsx +0 -9
  464. package/src/utils/types/as.ts +0 -26
  465. package/src/utils/types/email-template.ts +0 -8
  466. package/src/utils/types/error-object.ts +0 -11
  467. package/src/utils/unreachable.ts +0 -8
  468. package/tailwind-internals.d.ts +0 -133
  469. package/tailwind.config.ts +0 -99
  470. /package/src/{components/toolbar/results-table.tsx → utils/preview/hot-reloading/test/some-file.ts} +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[719],{803:(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)("7fe55552c27883c6380fe708a8db93597814d50557",i.callServer,void 0,i.findSourceMapURL,"getEmailPathFromSlug"),c=(0,i.createServerReference)("7fe2413412131fb0a7faf76393844252374a97ec77",i.callServer,void 0,i.findSourceMapURL,"renderEmailByPath");var d=a(8356);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(8379),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(803);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$,{})]})]})}},4312:(e,t,a)=>{Promise.resolve().then(a.bind(a,3726)),Promise.resolve().then(a.bind(a,1494)),Promise.resolve().then(a.bind(a,8379)),Promise.resolve().then(a.bind(a,803))},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"},8379:(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(803),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)("7f94c6551f6e3e6429fa57b5342d92ac6c7a421cc6",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)("7f143410954b15efd0bd840c616fc1ed8c6c46438a",j.callServer,void 0,j.findSourceMapURL,"checkImages"),T=(0,j.createServerReference)("7f90691abba2ff7af1cec080755484e131df1fe5ed",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})}}},e=>{var t=t=>e(e.s=t);e.O(0,[979,589,293,45,484,733,107,358],()=>t(4312)),_N_E=e.O()}]);