@vandenberghinc/volt 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/.vrepo +28 -0
  2. package/.vscode/tasks.json +87 -0
  3. package/README.md +67 -0
  4. package/backend/dist/cjs/blacklist.d.ts +10 -0
  5. package/backend/dist/cjs/blacklist.js +53 -0
  6. package/backend/dist/cjs/cli.d.ts +2 -0
  7. package/backend/dist/cjs/cli.js +263 -0
  8. package/backend/dist/cjs/database.d.ts +364 -0
  9. package/backend/dist/cjs/database.js +1962 -0
  10. package/backend/dist/cjs/endpoint.d.ts +57 -0
  11. package/backend/dist/cjs/endpoint.js +425 -0
  12. package/backend/dist/cjs/file_watcher.d.ts +44 -0
  13. package/backend/dist/cjs/file_watcher.js +348 -0
  14. package/backend/dist/cjs/frontend.d.ts +13 -0
  15. package/backend/dist/cjs/frontend.js +30 -0
  16. package/backend/dist/cjs/image_endpoint.d.ts +24 -0
  17. package/backend/dist/cjs/image_endpoint.js +210 -0
  18. package/backend/dist/cjs/logger.d.ts +5 -0
  19. package/backend/dist/cjs/logger.js +16 -0
  20. package/backend/dist/cjs/meta.d.ts +50 -0
  21. package/backend/dist/cjs/meta.js +153 -0
  22. package/backend/dist/cjs/mutex.d.ts +24 -0
  23. package/backend/dist/cjs/mutex.js +52 -0
  24. package/backend/dist/cjs/package.json +1 -0
  25. package/backend/dist/cjs/payments/paddle.d.ts +161 -0
  26. package/backend/dist/cjs/payments/paddle.js +2301 -0
  27. package/backend/dist/cjs/plugins/browser.d.ts +36 -0
  28. package/backend/dist/cjs/plugins/browser.js +183 -0
  29. package/backend/dist/cjs/plugins/communication.d.ts +70 -0
  30. package/backend/dist/cjs/plugins/communication.js +177 -0
  31. package/backend/dist/cjs/plugins/css.d.ts +10 -0
  32. package/backend/dist/cjs/plugins/css.js +71 -0
  33. package/backend/dist/cjs/plugins/mail.d.ts +277 -0
  34. package/backend/dist/cjs/plugins/mail.js +1419 -0
  35. package/backend/dist/cjs/plugins/pdf.d.ts +757 -0
  36. package/backend/dist/cjs/plugins/pdf.js +1694 -0
  37. package/backend/dist/cjs/plugins/thread_monitor.d.ts +18 -0
  38. package/backend/dist/cjs/plugins/thread_monitor.js +127 -0
  39. package/backend/dist/cjs/plugins/ts/compiler.d.ts +132 -0
  40. package/backend/dist/cjs/plugins/ts/compiler.js +944 -0
  41. package/backend/dist/cjs/plugins/ts/preprocessing.d.ts +14 -0
  42. package/backend/dist/cjs/plugins/ts/preprocessing.js +762 -0
  43. package/backend/dist/cjs/rate_limit.d.ts +65 -0
  44. package/backend/dist/cjs/rate_limit.js +463 -0
  45. package/backend/dist/cjs/request.deprc.d.ts +48 -0
  46. package/backend/dist/cjs/request.deprc.js +572 -0
  47. package/backend/dist/cjs/response.deprc.d.ts +55 -0
  48. package/backend/dist/cjs/response.deprc.js +275 -0
  49. package/backend/dist/cjs/server.d.ts +311 -0
  50. package/backend/dist/cjs/server.js +3475 -0
  51. package/backend/dist/cjs/splash_screen.d.ts +35 -0
  52. package/backend/dist/cjs/splash_screen.js +152 -0
  53. package/backend/dist/cjs/status.d.ts +60 -0
  54. package/backend/dist/cjs/status.js +199 -0
  55. package/backend/dist/cjs/stream.d.ts +75 -0
  56. package/backend/dist/cjs/stream.js +954 -0
  57. package/backend/dist/cjs/users.d.ts +111 -0
  58. package/backend/dist/cjs/users.js +1945 -0
  59. package/backend/dist/cjs/utils.d.ts +27 -0
  60. package/backend/dist/cjs/utils.js +329 -0
  61. package/backend/dist/cjs/view.d.ts +52 -0
  62. package/backend/dist/cjs/view.js +568 -0
  63. package/backend/dist/cjs/vinc.d.ts +2 -0
  64. package/backend/dist/cjs/vinc.dev.d.ts +2 -0
  65. package/backend/dist/cjs/vinc.dev.js +42 -0
  66. package/backend/dist/cjs/vinc.js +42 -0
  67. package/backend/dist/cjs/volt.d.ts +15 -0
  68. package/backend/dist/cjs/volt.js +64 -0
  69. package/backend/dist/css/adyen.css +92 -0
  70. package/backend/dist/css/volt.css +65 -0
  71. package/backend/dist/esm/blacklist.d.ts +10 -0
  72. package/backend/dist/esm/blacklist.js +49 -0
  73. package/backend/dist/esm/cli.d.ts +2 -0
  74. package/backend/dist/esm/cli.js +228 -0
  75. package/backend/dist/esm/database.d.ts +364 -0
  76. package/backend/dist/esm/database.js +1957 -0
  77. package/backend/dist/esm/endpoint.d.ts +57 -0
  78. package/backend/dist/esm/endpoint.js +421 -0
  79. package/backend/dist/esm/file_watcher.d.ts +44 -0
  80. package/backend/dist/esm/file_watcher.js +313 -0
  81. package/backend/dist/esm/frontend.d.ts +13 -0
  82. package/backend/dist/esm/frontend.js +27 -0
  83. package/backend/dist/esm/image_endpoint.d.ts +24 -0
  84. package/backend/dist/esm/image_endpoint.js +206 -0
  85. package/backend/dist/esm/logger.d.ts +5 -0
  86. package/backend/dist/esm/logger.js +13 -0
  87. package/backend/dist/esm/meta.d.ts +50 -0
  88. package/backend/dist/esm/meta.js +149 -0
  89. package/backend/dist/esm/mutex.d.ts +24 -0
  90. package/backend/dist/esm/mutex.js +48 -0
  91. package/backend/dist/esm/payments/paddle.d.ts +161 -0
  92. package/backend/dist/esm/payments/paddle.js +2261 -0
  93. package/backend/dist/esm/plugins/browser.d.ts +36 -0
  94. package/backend/dist/esm/plugins/browser.js +176 -0
  95. package/backend/dist/esm/plugins/communication.d.ts +70 -0
  96. package/backend/dist/esm/plugins/communication.js +169 -0
  97. package/backend/dist/esm/plugins/css.d.ts +10 -0
  98. package/backend/dist/esm/plugins/css.js +64 -0
  99. package/backend/dist/esm/plugins/mail.d.ts +277 -0
  100. package/backend/dist/esm/plugins/mail.js +1403 -0
  101. package/backend/dist/esm/plugins/pdf.d.ts +757 -0
  102. package/backend/dist/esm/plugins/pdf.js +1694 -0
  103. package/backend/dist/esm/plugins/thread_monitor.d.ts +18 -0
  104. package/backend/dist/esm/plugins/thread_monitor.js +120 -0
  105. package/backend/dist/esm/plugins/ts/compiler.d.ts +132 -0
  106. package/backend/dist/esm/plugins/ts/compiler.js +907 -0
  107. package/backend/dist/esm/plugins/ts/preprocessing.d.ts +14 -0
  108. package/backend/dist/esm/plugins/ts/preprocessing.js +724 -0
  109. package/backend/dist/esm/rate_limit.d.ts +65 -0
  110. package/backend/dist/esm/rate_limit.js +425 -0
  111. package/backend/dist/esm/request.deprc.d.ts +48 -0
  112. package/backend/dist/esm/request.deprc.js +572 -0
  113. package/backend/dist/esm/response.deprc.d.ts +55 -0
  114. package/backend/dist/esm/response.deprc.js +275 -0
  115. package/backend/dist/esm/server.d.ts +311 -0
  116. package/backend/dist/esm/server.js +3435 -0
  117. package/backend/dist/esm/splash_screen.d.ts +35 -0
  118. package/backend/dist/esm/splash_screen.js +148 -0
  119. package/backend/dist/esm/status.d.ts +60 -0
  120. package/backend/dist/esm/status.js +196 -0
  121. package/backend/dist/esm/stream.d.ts +75 -0
  122. package/backend/dist/esm/stream.js +947 -0
  123. package/backend/dist/esm/users.d.ts +111 -0
  124. package/backend/dist/esm/users.js +1908 -0
  125. package/backend/dist/esm/utils.d.ts +27 -0
  126. package/backend/dist/esm/utils.js +324 -0
  127. package/backend/dist/esm/view.d.ts +52 -0
  128. package/backend/dist/esm/view.js +561 -0
  129. package/backend/dist/esm/vinc.d.ts +2 -0
  130. package/backend/dist/esm/vinc.dev.d.ts +2 -0
  131. package/backend/dist/esm/vinc.dev.js +6 -0
  132. package/backend/dist/esm/vinc.js +6 -0
  133. package/backend/dist/esm/volt.d.ts +15 -0
  134. package/backend/dist/esm/volt.js +23 -0
  135. package/backend/dist/esm-dev/blacklist.d.ts +10 -0
  136. package/backend/dist/esm-dev/blacklist.js +49 -0
  137. package/backend/dist/esm-dev/cli.d.ts +2 -0
  138. package/backend/dist/esm-dev/cli.js +228 -0
  139. package/backend/dist/esm-dev/database.d.ts +364 -0
  140. package/backend/dist/esm-dev/database.js +1957 -0
  141. package/backend/dist/esm-dev/endpoint.d.ts +57 -0
  142. package/backend/dist/esm-dev/endpoint.js +421 -0
  143. package/backend/dist/esm-dev/file_watcher.d.ts +44 -0
  144. package/backend/dist/esm-dev/file_watcher.js +313 -0
  145. package/backend/dist/esm-dev/frontend.d.ts +13 -0
  146. package/backend/dist/esm-dev/frontend.js +27 -0
  147. package/backend/dist/esm-dev/image_endpoint.d.ts +24 -0
  148. package/backend/dist/esm-dev/image_endpoint.js +206 -0
  149. package/backend/dist/esm-dev/logger.d.ts +5 -0
  150. package/backend/dist/esm-dev/logger.js +13 -0
  151. package/backend/dist/esm-dev/meta.d.ts +50 -0
  152. package/backend/dist/esm-dev/meta.js +149 -0
  153. package/backend/dist/esm-dev/mutex.d.ts +24 -0
  154. package/backend/dist/esm-dev/mutex.js +48 -0
  155. package/backend/dist/esm-dev/payments/paddle.d.ts +161 -0
  156. package/backend/dist/esm-dev/payments/paddle.js +2261 -0
  157. package/backend/dist/esm-dev/plugins/browser.d.ts +36 -0
  158. package/backend/dist/esm-dev/plugins/browser.js +176 -0
  159. package/backend/dist/esm-dev/plugins/communication.d.ts +70 -0
  160. package/backend/dist/esm-dev/plugins/communication.js +169 -0
  161. package/backend/dist/esm-dev/plugins/css.d.ts +10 -0
  162. package/backend/dist/esm-dev/plugins/css.js +64 -0
  163. package/backend/dist/esm-dev/plugins/mail.d.ts +277 -0
  164. package/backend/dist/esm-dev/plugins/mail.js +1403 -0
  165. package/backend/dist/esm-dev/plugins/pdf.d.ts +757 -0
  166. package/backend/dist/esm-dev/plugins/pdf.js +1694 -0
  167. package/backend/dist/esm-dev/plugins/thread_monitor.d.ts +18 -0
  168. package/backend/dist/esm-dev/plugins/thread_monitor.js +120 -0
  169. package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +132 -0
  170. package/backend/dist/esm-dev/plugins/ts/compiler.js +907 -0
  171. package/backend/dist/esm-dev/plugins/ts/preprocessing.d.ts +14 -0
  172. package/backend/dist/esm-dev/plugins/ts/preprocessing.js +724 -0
  173. package/backend/dist/esm-dev/rate_limit.d.ts +65 -0
  174. package/backend/dist/esm-dev/rate_limit.js +425 -0
  175. package/backend/dist/esm-dev/request.deprc.d.ts +48 -0
  176. package/backend/dist/esm-dev/request.deprc.js +572 -0
  177. package/backend/dist/esm-dev/response.deprc.d.ts +55 -0
  178. package/backend/dist/esm-dev/response.deprc.js +275 -0
  179. package/backend/dist/esm-dev/server.d.ts +311 -0
  180. package/backend/dist/esm-dev/server.js +3435 -0
  181. package/backend/dist/esm-dev/splash_screen.d.ts +35 -0
  182. package/backend/dist/esm-dev/splash_screen.js +148 -0
  183. package/backend/dist/esm-dev/status.d.ts +60 -0
  184. package/backend/dist/esm-dev/status.js +196 -0
  185. package/backend/dist/esm-dev/stream.d.ts +75 -0
  186. package/backend/dist/esm-dev/stream.js +947 -0
  187. package/backend/dist/esm-dev/users.d.ts +111 -0
  188. package/backend/dist/esm-dev/users.js +1908 -0
  189. package/backend/dist/esm-dev/utils.d.ts +27 -0
  190. package/backend/dist/esm-dev/utils.js +324 -0
  191. package/backend/dist/esm-dev/view.d.ts +52 -0
  192. package/backend/dist/esm-dev/view.js +561 -0
  193. package/backend/dist/esm-dev/vinc.d.ts +2 -0
  194. package/backend/dist/esm-dev/vinc.dev.d.ts +2 -0
  195. package/backend/dist/esm-dev/vinc.dev.js +6 -0
  196. package/backend/dist/esm-dev/vinc.js +6 -0
  197. package/backend/dist/esm-dev/volt.d.ts +15 -0
  198. package/backend/dist/esm-dev/volt.js +23 -0
  199. package/backend/src/blacklist.ts +69 -0
  200. package/backend/src/cli.js +245 -0
  201. package/backend/src/database.ts +2241 -0
  202. package/backend/src/endpoint.ts +494 -0
  203. package/backend/src/file_watcher.ts +359 -0
  204. package/backend/src/frontend.ts +35 -0
  205. package/backend/src/globals.d.ts +8 -0
  206. package/backend/src/image_endpoint.ts +258 -0
  207. package/backend/src/logger.ts +18 -0
  208. package/backend/src/meta.ts +202 -0
  209. package/backend/src/mutex.ts +51 -0
  210. package/backend/src/payments/paddle.ts +2659 -0
  211. package/backend/src/plugins/browser.ts +188 -0
  212. package/backend/src/plugins/communication.ts +204 -0
  213. package/backend/src/plugins/css.ts +84 -0
  214. package/backend/src/plugins/fonts/Menlo-Bold.ttf +0 -0
  215. package/backend/src/plugins/fonts/Menlo-Regular.ttf +0 -0
  216. package/backend/src/plugins/mail.ts +1720 -0
  217. package/backend/src/plugins/pdf.js +1932 -0
  218. package/backend/src/plugins/thread_monitor.ts +164 -0
  219. package/backend/src/plugins/ts/compiler.ts +1242 -0
  220. package/backend/src/plugins/ts/preprocessing.ts +812 -0
  221. package/backend/src/rate_limit.ts +503 -0
  222. package/backend/src/request.deprc.js +626 -0
  223. package/backend/src/response.deprc.js +354 -0
  224. package/backend/src/server.ts +4149 -0
  225. package/backend/src/splash_screen.ts +192 -0
  226. package/backend/src/status.ts +199 -0
  227. package/backend/src/stream.ts +1070 -0
  228. package/backend/src/users.ts +2077 -0
  229. package/backend/src/utils.ts +359 -0
  230. package/backend/src/view.ts +655 -0
  231. package/backend/src/vinc.dev.js +6 -0
  232. package/backend/src/vinc.ts +6 -0
  233. package/backend/src/volt.js +25 -0
  234. package/backend/tsconfig.cjs.json +29 -0
  235. package/backend/tsconfig.esm.dev.json +34 -0
  236. package/backend/tsconfig.esm.json +30 -0
  237. package/backend/tsconfig.json +2 -0
  238. package/frontend/compile.js +436 -0
  239. package/frontend/dist/elements/base.d.ts +9891 -0
  240. package/frontend/dist/elements/base.js +8818 -0
  241. package/frontend/dist/elements/module.d.ts +16 -0
  242. package/frontend/dist/elements/module.js +178 -0
  243. package/frontend/dist/modules/array.d.ts +37 -0
  244. package/frontend/dist/modules/array.js +284 -0
  245. package/frontend/dist/modules/auth.d.ts +45 -0
  246. package/frontend/dist/modules/auth.js +138 -0
  247. package/frontend/dist/modules/colors.d.ts +26 -0
  248. package/frontend/dist/modules/colors.js +340 -0
  249. package/frontend/dist/modules/compression.d.ts +6 -0
  250. package/frontend/dist/modules/compression.js +999 -0
  251. package/frontend/dist/modules/cookies.d.ts +17 -0
  252. package/frontend/dist/modules/cookies.js +166 -0
  253. package/frontend/dist/modules/date.d.ts +142 -0
  254. package/frontend/dist/modules/date.js +493 -0
  255. package/frontend/dist/modules/events.d.ts +7 -0
  256. package/frontend/dist/modules/events.js +90 -0
  257. package/frontend/dist/modules/google.d.ts +10 -0
  258. package/frontend/dist/modules/google.js +53 -0
  259. package/frontend/dist/modules/meta.d.ts +9 -0
  260. package/frontend/dist/modules/meta.js +45 -0
  261. package/frontend/dist/modules/mutex.d.ts +8 -0
  262. package/frontend/dist/modules/mutex.js +52 -0
  263. package/frontend/dist/modules/number.d.ts +12 -0
  264. package/frontend/dist/modules/number.js +8 -0
  265. package/frontend/dist/modules/object.d.ts +50 -0
  266. package/frontend/dist/modules/object.js +147 -0
  267. package/frontend/dist/modules/paddle.d.ts +1403 -0
  268. package/frontend/dist/modules/paddle.js +2641 -0
  269. package/frontend/dist/modules/scheme.d.ts +207 -0
  270. package/frontend/dist/modules/scheme.js +649 -0
  271. package/frontend/dist/modules/settings.d.ts +3 -0
  272. package/frontend/dist/modules/settings.js +4 -0
  273. package/frontend/dist/modules/statics.d.ts +4 -0
  274. package/frontend/dist/modules/statics.js +45 -0
  275. package/frontend/dist/modules/string.d.ts +163 -0
  276. package/frontend/dist/modules/string.js +291 -0
  277. package/frontend/dist/modules/support.d.ts +18 -0
  278. package/frontend/dist/modules/support.js +102 -0
  279. package/frontend/dist/modules/themes.d.ts +8 -0
  280. package/frontend/dist/modules/themes.js +17 -0
  281. package/frontend/dist/modules/user.d.ts +58 -0
  282. package/frontend/dist/modules/user.js +279 -0
  283. package/frontend/dist/modules/utils.d.ts +58 -0
  284. package/frontend/dist/modules/utils.js +1159 -0
  285. package/frontend/dist/types/gradient.d.ts +12 -0
  286. package/frontend/dist/types/gradient.js +79 -0
  287. package/frontend/dist/ui/border_button.d.ts +177 -0
  288. package/frontend/dist/ui/border_button.js +235 -0
  289. package/frontend/dist/ui/button.d.ts +42 -0
  290. package/frontend/dist/ui/button.js +114 -0
  291. package/frontend/dist/ui/canvas.d.ts +56 -0
  292. package/frontend/dist/ui/canvas.js +411 -0
  293. package/frontend/dist/ui/checkbox.d.ts +72 -0
  294. package/frontend/dist/ui/checkbox.js +277 -0
  295. package/frontend/dist/ui/code.d.ts +232 -0
  296. package/frontend/dist/ui/code.js +977 -0
  297. package/frontend/dist/ui/color.d.ts +1 -0
  298. package/frontend/dist/ui/color.js +110 -0
  299. package/frontend/dist/ui/context_menu.d.ts +30 -0
  300. package/frontend/dist/ui/context_menu.js +211 -0
  301. package/frontend/dist/ui/css.d.ts +10 -0
  302. package/frontend/dist/ui/css.js +44 -0
  303. package/frontend/dist/ui/divider.d.ts +18 -0
  304. package/frontend/dist/ui/divider.js +82 -0
  305. package/frontend/dist/ui/dropdown.d.ts +115 -0
  306. package/frontend/dist/ui/dropdown.js +446 -0
  307. package/frontend/dist/ui/for_each.d.ts +38 -0
  308. package/frontend/dist/ui/for_each.js +97 -0
  309. package/frontend/dist/ui/form.d.ts +25 -0
  310. package/frontend/dist/ui/form.js +227 -0
  311. package/frontend/dist/ui/frame_modes.d.ts +28 -0
  312. package/frontend/dist/ui/frame_modes.js +116 -0
  313. package/frontend/dist/ui/google_map.d.ts +31 -0
  314. package/frontend/dist/ui/google_map.js +111 -0
  315. package/frontend/dist/ui/gradient.d.ts +24 -0
  316. package/frontend/dist/ui/gradient.js +115 -0
  317. package/frontend/dist/ui/image.d.ts +138 -0
  318. package/frontend/dist/ui/image.js +570 -0
  319. package/frontend/dist/ui/input.d.ts +316 -0
  320. package/frontend/dist/ui/input.js +1187 -0
  321. package/frontend/dist/ui/link.d.ts +39 -0
  322. package/frontend/dist/ui/link.js +146 -0
  323. package/frontend/dist/ui/list.d.ts +33 -0
  324. package/frontend/dist/ui/list.js +161 -0
  325. package/frontend/dist/ui/loader_button.d.ts +108 -0
  326. package/frontend/dist/ui/loader_button.js +207 -0
  327. package/frontend/dist/ui/loaders.d.ts +60 -0
  328. package/frontend/dist/ui/loaders.js +150 -0
  329. package/frontend/dist/ui/popup.d.ts +84 -0
  330. package/frontend/dist/ui/popup.js +331 -0
  331. package/frontend/dist/ui/pseudo.d.ts +16 -0
  332. package/frontend/dist/ui/pseudo.js +81 -0
  333. package/frontend/dist/ui/scroller.d.ts +131 -0
  334. package/frontend/dist/ui/scroller.js +1251 -0
  335. package/frontend/dist/ui/slider.d.ts +35 -0
  336. package/frontend/dist/ui/slider.js +203 -0
  337. package/frontend/dist/ui/spacer.d.ts +20 -0
  338. package/frontend/dist/ui/spacer.js +83 -0
  339. package/frontend/dist/ui/span.d.ts +11 -0
  340. package/frontend/dist/ui/span.js +75 -0
  341. package/frontend/dist/ui/stack.d.ts +123 -0
  342. package/frontend/dist/ui/stack.js +344 -0
  343. package/frontend/dist/ui/steps.d.ts +72 -0
  344. package/frontend/dist/ui/steps.js +306 -0
  345. package/frontend/dist/ui/style.d.ts +12 -0
  346. package/frontend/dist/ui/style.js +78 -0
  347. package/frontend/dist/ui/switch.d.ts +44 -0
  348. package/frontend/dist/ui/switch.js +280 -0
  349. package/frontend/dist/ui/table.d.ts +118 -0
  350. package/frontend/dist/ui/table.js +411 -0
  351. package/frontend/dist/ui/tabs.d.ts +85 -0
  352. package/frontend/dist/ui/tabs.js +392 -0
  353. package/frontend/dist/ui/text.d.ts +19 -0
  354. package/frontend/dist/ui/text.js +88 -0
  355. package/frontend/dist/ui/theme.d.ts +25 -0
  356. package/frontend/dist/ui/theme.js +237 -0
  357. package/frontend/dist/ui/title.d.ts +36 -0
  358. package/frontend/dist/ui/title.js +127 -0
  359. package/frontend/dist/ui/ui.d.ts +38 -0
  360. package/frontend/dist/ui/ui.js +41 -0
  361. package/frontend/dist/ui/view.d.ts +25 -0
  362. package/frontend/dist/ui/view.js +93 -0
  363. package/frontend/dist/volt.d.ts +22 -0
  364. package/frontend/dist/volt.js +27 -0
  365. package/frontend/exports.json +1340 -0
  366. package/frontend/src/css/adyen.css +92 -0
  367. package/frontend/src/css/volt.css +65 -0
  368. package/frontend/src/elements/base.ts +16790 -0
  369. package/frontend/src/elements/module.ts +184 -0
  370. package/frontend/src/elements/types.d.ts +155 -0
  371. package/frontend/src/modules/array.ts +366 -0
  372. package/frontend/src/modules/auth.ts +188 -0
  373. package/frontend/src/modules/colors.ts +449 -0
  374. package/frontend/src/modules/compression.ts +67 -0
  375. package/frontend/src/modules/cookies.ts +182 -0
  376. package/frontend/src/modules/date.js +535 -0
  377. package/frontend/src/modules/date.ts +583 -0
  378. package/frontend/src/modules/events.ts +96 -0
  379. package/frontend/src/modules/google.ts +60 -0
  380. package/frontend/src/modules/meta.ts +59 -0
  381. package/frontend/src/modules/mutex.ts +59 -0
  382. package/frontend/src/modules/number.ts +20 -0
  383. package/frontend/src/modules/object.ts +212 -0
  384. package/frontend/src/modules/paddle.ts +2990 -0
  385. package/frontend/src/modules/scheme.ts +740 -0
  386. package/frontend/src/modules/settings.ts +5 -0
  387. package/frontend/src/modules/statics.ts +47 -0
  388. package/frontend/src/modules/string.ts +500 -0
  389. package/frontend/src/modules/support.ts +118 -0
  390. package/frontend/src/modules/themes.ts +24 -0
  391. package/frontend/src/modules/user.ts +321 -0
  392. package/frontend/src/modules/utils.ts +1260 -0
  393. package/frontend/src/static/admin/admin.png +0 -0
  394. package/frontend/src/static/admin/password.webp +0 -0
  395. package/frontend/src/static/icons/copy.webp +0 -0
  396. package/frontend/src/static/payments/arrow.long.webp +0 -0
  397. package/frontend/src/static/payments/arrow.long2.webp +0 -0
  398. package/frontend/src/static/payments/cancelled.webp +0 -0
  399. package/frontend/src/static/payments/check.sign.webp +0 -0
  400. package/frontend/src/static/payments/check.webp +0 -0
  401. package/frontend/src/static/payments/close.webp +0 -0
  402. package/frontend/src/static/payments/error.webp +0 -0
  403. package/frontend/src/static/payments/exclamation.webp +0 -0
  404. package/frontend/src/static/payments/minus.webp +0 -0
  405. package/frontend/src/static/payments/party.webp +0 -0
  406. package/frontend/src/static/payments/plus.webp +0 -0
  407. package/frontend/src/static/payments/shopping_cart.webp +0 -0
  408. package/frontend/src/static/payments/trash.webp +0 -0
  409. package/frontend/src/types/global.d.ts +4 -0
  410. package/frontend/src/types/gradient.ts +87 -0
  411. package/frontend/src/ui/any_element.d.ts +5 -0
  412. package/frontend/src/ui/border_button.ts +320 -0
  413. package/frontend/src/ui/button.ts +62 -0
  414. package/frontend/src/ui/canvas.ts +431 -0
  415. package/frontend/src/ui/checkbox.ts +284 -0
  416. package/frontend/src/ui/code.ts +1049 -0
  417. package/frontend/src/ui/color.ts +117 -0
  418. package/frontend/src/ui/context_menu.ts +194 -0
  419. package/frontend/src/ui/css.ts +57 -0
  420. package/frontend/src/ui/divider.ts +28 -0
  421. package/frontend/src/ui/dropdown.ts +503 -0
  422. package/frontend/src/ui/for_each.ts +71 -0
  423. package/frontend/src/ui/form.ts +208 -0
  424. package/frontend/src/ui/frame_modes.ts +140 -0
  425. package/frontend/src/ui/google_map.ts +70 -0
  426. package/frontend/src/ui/gradient.ts +73 -0
  427. package/frontend/src/ui/image.ts +587 -0
  428. package/frontend/src/ui/input.ts +1284 -0
  429. package/frontend/src/ui/link.ts +77 -0
  430. package/frontend/src/ui/list.ts +88 -0
  431. package/frontend/src/ui/loader_button.ts +192 -0
  432. package/frontend/src/ui/loaders.ts +126 -0
  433. package/frontend/src/ui/popup.ts +370 -0
  434. package/frontend/src/ui/pseudo.ts +33 -0
  435. package/frontend/src/ui/scroller.ts +1324 -0
  436. package/frontend/src/ui/slider.ts +215 -0
  437. package/frontend/src/ui/spacer.ts +29 -0
  438. package/frontend/src/ui/span.ts +23 -0
  439. package/frontend/src/ui/stack.ts +238 -0
  440. package/frontend/src/ui/steps.ts +334 -0
  441. package/frontend/src/ui/style.ts +26 -0
  442. package/frontend/src/ui/switch.ts +286 -0
  443. package/frontend/src/ui/table.ts +323 -0
  444. package/frontend/src/ui/tabs.ts +441 -0
  445. package/frontend/src/ui/text.ts +38 -0
  446. package/frontend/src/ui/theme.ts +279 -0
  447. package/frontend/src/ui/title.ts +64 -0
  448. package/frontend/src/ui/ui.ts +47 -0
  449. package/frontend/src/ui/view.ts +44 -0
  450. package/frontend/src/volt.ts +31 -0
  451. package/package.json +58 -0
@@ -0,0 +1,1403 @@
1
+ /*
2
+ * Author: Daan van den Bergh
3
+ * Copyright: © 2022 - 2024 Daan van den Bergh.
4
+ */
5
+ // ---------------------------------------------------------
6
+ // The HTML element server side for creating mails.
7
+ // Element.
8
+ // The class.
9
+ export class Element {
10
+ // ---------------------------------------------------------
11
+ // Attributes.
12
+ // static element_tag: string = tag; // must remain static.
13
+ type;
14
+ element_type;
15
+ tag;
16
+ _style;
17
+ _attrs;
18
+ classes;
19
+ _inner_html;
20
+ children;
21
+ _lang;
22
+ _charset;
23
+ _viewport;
24
+ _title;
25
+ _links;
26
+ _disabled;
27
+ // ---------------------------------------------------------
28
+ // Constructor.
29
+ constructor({ type = "VElement", tag = "div", default_style = null, default_attributes = null, default_events = null, }) {
30
+ // Arguments.
31
+ this.type = type;
32
+ this.element_type = type;
33
+ this.tag = tag;
34
+ // Attributes.
35
+ this._style = {};
36
+ this._attrs = {};
37
+ this.classes = [];
38
+ this._inner_html = null;
39
+ this.children = [];
40
+ // Assign default style.
41
+ if (default_style != null) {
42
+ Object.keys(default_style).forEach((key) => {
43
+ this._style[key] = default_style[key];
44
+ });
45
+ }
46
+ // Assign default attributes.
47
+ if (default_attributes != null) {
48
+ Object.keys(default_attributes).forEach((key) => {
49
+ this._attrs[key] = default_attributes[key];
50
+ });
51
+ }
52
+ // Assign default events.
53
+ if (default_events != null) {
54
+ Object.keys(default_events).forEach((key) => {
55
+ this._attrs[key] = default_events[key];
56
+ });
57
+ }
58
+ }
59
+ // ---------------------------------------------------------
60
+ // Utils.
61
+ // Pad a numeric with px.
62
+ pad_numeric(value, padding = "px") {
63
+ if (typeof value === "number") {
64
+ return value + padding;
65
+ }
66
+ return value;
67
+ }
68
+ // ---------------------------------------------------------
69
+ // Build functions.
70
+ // Build the html.
71
+ html() {
72
+ // Vars.
73
+ let html = "", tag;
74
+ // A default element.
75
+ if (this.tag !== "mail") {
76
+ tag = this.tag;
77
+ }
78
+ // The parent mail element.
79
+ else {
80
+ tag = "body";
81
+ // Build header.
82
+ html += "<!DOCTYPE html>";
83
+ html += `<html lang="${this._lang || "en"}" style="height: 100%;">`;
84
+ html += `<head>`;
85
+ html += `<meta charset="${this._charset || "UTF-8"}">`;
86
+ html += `<meta name="viewport" charset="${this._viewport || "width=device-width, initial-scale=1.0"}">`;
87
+ html += `<meta name="color-scheme" content="light">`;
88
+ html += `<meta name="supported-color-schemes" content="light">`;
89
+ html += `<title>${this._title || ""}"</title>`;
90
+ html += "<style type=\"text/css\">* {box-sizing:border-box;}</style>";
91
+ // Links.
92
+ if (this._links !== undefined) {
93
+ this._links.forEach((url) => {
94
+ if (typeof url === "string") {
95
+ html += `<link rel="stylesheet" href="${url}">`;
96
+ }
97
+ else if (typeof url === "object") {
98
+ if (url.rel == null) {
99
+ url.rel = "stylesheet";
100
+ }
101
+ html += "<link";
102
+ Object.keys(url).forEach((key) => {
103
+ html += ` ${key}="${url[key]}"`;
104
+ });
105
+ html += ">";
106
+ }
107
+ else {
108
+ throw Error("Invalid type for a css include, the valid value types are \"string\" and \"object\".");
109
+ }
110
+ });
111
+ }
112
+ // Close header.
113
+ html += `</head>`;
114
+ // Set presentation role.
115
+ if (this.children.length > 0 && this.children[0].tag === "table") {
116
+ this.children[0]._attrs.role = "presentation";
117
+ }
118
+ }
119
+ // Open.
120
+ html += "<";
121
+ html += tag;
122
+ html += " ";
123
+ // Classes.
124
+ if (this.classes.length > 0) {
125
+ html += "class=\"";
126
+ let i = 0;
127
+ this.classes.forEach((key) => {
128
+ html += key;
129
+ if (i < this.classes.length - 1) {
130
+ html += " ";
131
+ }
132
+ ++i;
133
+ });
134
+ html += "\" ";
135
+ }
136
+ // Style.
137
+ if (Object.keys(this._style).length > 0) {
138
+ html += "style=\"";
139
+ Object.keys(this._style).forEach((key) => {
140
+ html += `${key}:${this._style[key].replaceAll('"', '\'')};`;
141
+ });
142
+ html += "\"";
143
+ }
144
+ // Attributes.
145
+ Object.keys(this._attrs).forEach((key) => {
146
+ html += ` ${key}="${this._attrs[key]}"`;
147
+ });
148
+ // End opening.
149
+ html += ">\n";
150
+ // Add inner html.
151
+ if (this._inner_html != null) {
152
+ html += this._inner_html;
153
+ }
154
+ // Add children.
155
+ this.children.forEach((child) => {
156
+ html += child.html();
157
+ });
158
+ // Close.
159
+ html += "</";
160
+ html += this.tag;
161
+ html += "";
162
+ html += ">\n";
163
+ // The parent mail element.
164
+ if (this.tag === "mail") {
165
+ html += "</html>";
166
+ }
167
+ // Response.
168
+ return html;
169
+ }
170
+ // Add links to the main MailElement.
171
+ links(links) {
172
+ if (this._links === undefined) {
173
+ this._links = [];
174
+ }
175
+ this._links = this._links.concat(links);
176
+ return this;
177
+ }
178
+ background_color(value) {
179
+ if (value == null)
180
+ return this._style["background-color"];
181
+ this._style["background-color"] = value;
182
+ return this;
183
+ }
184
+ display(value) {
185
+ if (value == null)
186
+ return this._style["display"];
187
+ this._style["display"] = value;
188
+ return this;
189
+ }
190
+ background_image(value) {
191
+ if (value == null)
192
+ return this._style["background-image"];
193
+ this._style["background-image"] = value;
194
+ return this;
195
+ }
196
+ background_repeat(value) {
197
+ if (value == null)
198
+ return this._style["background-repeat"];
199
+ this._style["background-repeat"] = value;
200
+ return this;
201
+ }
202
+ border_top(value) {
203
+ if (value == null)
204
+ return this._style["border-top"];
205
+ this._style["border-top"] = value;
206
+ return this;
207
+ }
208
+ border_bottom(value) {
209
+ if (value == null)
210
+ return this._style["border-bottom"];
211
+ this._style["border-bottom"] = value;
212
+ return this;
213
+ }
214
+ border_right(value) {
215
+ if (value == null)
216
+ return this._style["border-right"];
217
+ this._style["border-right"] = value;
218
+ return this;
219
+ }
220
+ border_left(value) {
221
+ if (value == null)
222
+ return this._style["border-left"];
223
+ this._style["border-left"] = value;
224
+ return this;
225
+ }
226
+ border_color(value) {
227
+ if (value == null)
228
+ return this._style["border-color"];
229
+ this._style["border-color"] = value;
230
+ return this;
231
+ }
232
+ border_style(value) {
233
+ if (value == null)
234
+ return this._style["border-style"];
235
+ this._style["border-style"] = value;
236
+ return this;
237
+ }
238
+ cursor(value) {
239
+ if (value == null)
240
+ return this._style["cursor"];
241
+ this._style["cursor"] = value;
242
+ return this;
243
+ }
244
+ justify_items(value) {
245
+ if (value == null)
246
+ return this._style["justify-items"];
247
+ this._style["justify-items"] = value;
248
+ return this;
249
+ }
250
+ letter_spacing(value) {
251
+ if (value == null)
252
+ return this._style["letter-spacing"];
253
+ this._style["letter-spacing"] = value;
254
+ return this;
255
+ }
256
+ line_height(value) {
257
+ if (value == null)
258
+ return this._style["line-height"];
259
+ this._style["line-height"] = value;
260
+ return this;
261
+ }
262
+ outline(value) {
263
+ if (value == null)
264
+ return this._style["outline"];
265
+ this._style["outline"] = value;
266
+ return this;
267
+ }
268
+ overflow(value) {
269
+ if (value == null)
270
+ return this._style["overflow"];
271
+ this._style["overflow"] = value;
272
+ return this;
273
+ }
274
+ overflow_x(value) {
275
+ if (value == null)
276
+ return this._style["overflow-x"];
277
+ this._style["overflow-x"] = value;
278
+ return this;
279
+ }
280
+ overflow_y(value) {
281
+ if (value == null)
282
+ return this._style["overflow-y"];
283
+ this._style["overflow-y"] = value;
284
+ return this;
285
+ }
286
+ text_align(value) {
287
+ if (value == null)
288
+ return this._style["text-align"];
289
+ this._style["text-align"] = value;
290
+ return this;
291
+ }
292
+ text_align_last(value) {
293
+ if (value == null)
294
+ return this._style["text-align-last"];
295
+ this._style["text-align-last"] = value;
296
+ return this;
297
+ }
298
+ text_decoration(value) {
299
+ if (value == null)
300
+ return this._style["text-decoration"];
301
+ this._style["text-decoration"] = value;
302
+ return this;
303
+ }
304
+ text_decoration_color(value) {
305
+ if (value == null)
306
+ return this._style["text-decoration-color"];
307
+ this._style["text-decoration-color"] = value;
308
+ return this;
309
+ }
310
+ text_wrap(value) {
311
+ if (value == null)
312
+ return this._style["text-wrap"];
313
+ this._style["text-wrap"] = value;
314
+ return this;
315
+ }
316
+ white_space(value) {
317
+ if (value == null)
318
+ return this._style["white-space"];
319
+ this._style["white-space"] = value;
320
+ return this;
321
+ }
322
+ overflow_wrap(value) {
323
+ if (value == null)
324
+ return this._style["overflow-wrap"];
325
+ this._style["overflow-wrap"] = value;
326
+ return this;
327
+ }
328
+ word_wrap(value) {
329
+ if (value == null)
330
+ return this._style["word-wrap"];
331
+ this._style["word-wrap"] = value;
332
+ return this;
333
+ }
334
+ box_shadow(value) {
335
+ if (value == null)
336
+ return this._style["box-shadow"];
337
+ this._style["box-shadow"] = value;
338
+ return this;
339
+ }
340
+ drop_shadow(value) {
341
+ if (value == null)
342
+ return this._style["drop-shadow"];
343
+ this._style["drop-shadow"] = value;
344
+ return this;
345
+ }
346
+ font_size(value) {
347
+ if (value == null)
348
+ return this._style["font-size"];
349
+ this._style["font-size"] = this.pad_numeric(value);
350
+ return this;
351
+ }
352
+ font(value) {
353
+ if (value == null)
354
+ return this._style["font"];
355
+ this._style["font"] = this.pad_numeric(value);
356
+ return this;
357
+ }
358
+ font_family(value) {
359
+ if (value == null)
360
+ return this._style["font-family"];
361
+ this._style["font-family"] = this.pad_numeric(value);
362
+ return this;
363
+ }
364
+ font_style(value) {
365
+ if (value == null)
366
+ return this._style["font-style"];
367
+ this._style["font-style"] = this.pad_numeric(value);
368
+ return this;
369
+ }
370
+ font_weight(value) {
371
+ if (value == null)
372
+ return this._style["font-weight"];
373
+ this._style["font-weight"] = this.pad_numeric(value);
374
+ return this;
375
+ }
376
+ width(value) {
377
+ if (value == null)
378
+ return this._style["width"];
379
+ this._style["width"] = this.pad_numeric(value);
380
+ return this;
381
+ }
382
+ min_width(value) {
383
+ if (value == null)
384
+ return this._style["min-width"];
385
+ this._style["min-width"] = this.pad_numeric(value);
386
+ return this;
387
+ }
388
+ max_width(value) {
389
+ if (value == null)
390
+ return this._style["max-width"];
391
+ this._style["max-width"] = this.pad_numeric(value);
392
+ return this;
393
+ }
394
+ height(value) {
395
+ if (value == null)
396
+ return this._style["height"];
397
+ this._style["height"] = this.pad_numeric(value);
398
+ return this;
399
+ }
400
+ min_height(value) {
401
+ if (value == null)
402
+ return this._style["min-height"];
403
+ this._style["min-height"] = this.pad_numeric(value);
404
+ return this;
405
+ }
406
+ max_height(value) {
407
+ if (value == null)
408
+ return this._style["max-height"];
409
+ this._style["max-height"] = this.pad_numeric(value);
410
+ return this;
411
+ }
412
+ margin_top(value) {
413
+ if (value == null)
414
+ return this._style["margin-top"];
415
+ this._style["margin-top"] = this.pad_numeric(value);
416
+ return this;
417
+ }
418
+ margin_bottom(value) {
419
+ if (value == null)
420
+ return this._style["margin-bottom"];
421
+ this._style["margin-bottom"] = this.pad_numeric(value);
422
+ return this;
423
+ }
424
+ margin_right(value) {
425
+ if (value == null)
426
+ return this._style["margin-right"];
427
+ this._style["margin-right"] = this.pad_numeric(value);
428
+ return this;
429
+ }
430
+ margin_left(value) {
431
+ if (value == null)
432
+ return this._style["margin-left"];
433
+ this._style["margin-left"] = this.pad_numeric(value);
434
+ return this;
435
+ }
436
+ padding_top(value) {
437
+ if (value == null)
438
+ return this._style["padding-top"];
439
+ this._style["padding-top"] = this.pad_numeric(value);
440
+ return this;
441
+ }
442
+ padding_bottom(value) {
443
+ if (value == null)
444
+ return this._style["padding-bottom"];
445
+ this._style["padding-bottom"] = this.pad_numeric(value);
446
+ return this;
447
+ }
448
+ padding_right(value) {
449
+ if (value == null)
450
+ return this._style["padding-right"];
451
+ this._style["padding-right"] = this.pad_numeric(value);
452
+ return this;
453
+ }
454
+ padding_left(value) {
455
+ if (value == null)
456
+ return this._style["padding-left"];
457
+ this._style["padding-left"] = this.pad_numeric(value);
458
+ return this;
459
+ }
460
+ border_width(value) {
461
+ if (value == null)
462
+ return this._style["border-width"];
463
+ this._style["border-width"] = this.pad_numeric(value);
464
+ return this;
465
+ }
466
+ align_items(value) {
467
+ if (value == null)
468
+ return this._style["align-items"];
469
+ this._style["align-items"] = value;
470
+ this._style["-ms-align-items"] = value;
471
+ this._style["-webkit-align-items"] = value;
472
+ this._style["-moz-align-items"] = value;
473
+ return this;
474
+ }
475
+ align_content(value) {
476
+ if (value == null)
477
+ return this._style["align-content"];
478
+ this._style["align-content"] = value;
479
+ this._style["-ms-align-content"] = value;
480
+ this._style["-webkit-align-content"] = value;
481
+ this._style["-moz-align-content"] = value;
482
+ return this;
483
+ }
484
+ background_size(value) {
485
+ if (value == null)
486
+ return this._style["background-size"];
487
+ this._style["background-size"] = value;
488
+ this._style["-ms-background-size"] = value;
489
+ this._style["-webkit-background-size"] = value;
490
+ this._style["-moz-background-size"] = value;
491
+ return this;
492
+ }
493
+ box_sizing(value) {
494
+ if (value == null)
495
+ return this._style["box-sizing"];
496
+ this._style["box-sizing"] = value;
497
+ this._style["-ms-box-sizing"] = value;
498
+ this._style["-webkit-box-sizing"] = value;
499
+ this._style["-moz-box-sizing"] = value;
500
+ return this;
501
+ }
502
+ flex(value) {
503
+ if (value == null)
504
+ return this._style["flex"];
505
+ this._style["flex"] = value;
506
+ this._style["-ms-flex"] = value;
507
+ this._style["-webkit-flex"] = value;
508
+ this._style["-moz-flex"] = value;
509
+ return this;
510
+ }
511
+ flex_grow(value) {
512
+ if (value == null)
513
+ return this._style["flex-grow"];
514
+ this._style["flex-grow"] = value;
515
+ this._style["-ms-flex-grow"] = value;
516
+ this._style["-webkit-flex-grow"] = value;
517
+ this._style["-moz-flex-grow"] = value;
518
+ return this;
519
+ }
520
+ flex_shrink(value) {
521
+ if (value == null)
522
+ return this._style["flex-shrink"];
523
+ this._style["flex-shrink"] = value;
524
+ this._style["-ms-flex-shrink"] = value;
525
+ this._style["-webkit-flex-shrink"] = value;
526
+ this._style["-moz-flex-shrink"] = value;
527
+ return this;
528
+ }
529
+ justify_content(value) {
530
+ if (value == null)
531
+ return this._style["justify-content"];
532
+ this._style["justify-content"] = value;
533
+ this._style["-ms-justify-content"] = value;
534
+ this._style["-webkit-justify-content"] = value;
535
+ this._style["-moz-justify-content"] = value;
536
+ return this;
537
+ }
538
+ mask(value) {
539
+ if (value == null)
540
+ return this._style["mask"];
541
+ this._style["mask"] = value;
542
+ this._style["-ms-mask"] = value;
543
+ this._style["-webkit-mask"] = value;
544
+ this._style["-moz-mask"] = value;
545
+ return this;
546
+ }
547
+ user_select(value) {
548
+ if (value == null)
549
+ return this._style["user-select"];
550
+ this._style["user-select"] = value;
551
+ this._style["-ms-user-select"] = value;
552
+ this._style["-webkit-user-select"] = value;
553
+ this._style["-moz-user-select"] = value;
554
+ return this;
555
+ }
556
+ // ---------------------------------------------------------
557
+ // Edit the element.
558
+ // Style the element.
559
+ styles(styles) {
560
+ Object.keys(styles).forEach((key) => {
561
+ this._style[key] = styles[key];
562
+ });
563
+ return this;
564
+ }
565
+ // Add attributes to the element.
566
+ attrs(attrs) {
567
+ Object.keys(attrs).forEach((key) => {
568
+ this._attrs[key] = attrs[key];
569
+ });
570
+ return this;
571
+ }
572
+ // Add events to the element.
573
+ events(events) {
574
+ Object.keys(events).forEach((key) => {
575
+ this._attrs[key] = events[key];
576
+ });
577
+ return this;
578
+ }
579
+ // Add class.
580
+ add_class(name) {
581
+ if (this.classes.includes(name) === false) {
582
+ this.classes.push(name);
583
+ }
584
+ return this;
585
+ }
586
+ // Remove class.
587
+ remove_class(name) {
588
+ this.classes = this.classes.filter((cls) => cls !== name);
589
+ return this;
590
+ }
591
+ // Append a child.
592
+ append(...children) {
593
+ children.forEach((child) => {
594
+ // Skip undefined.
595
+ if (child == null) {
596
+ return;
597
+ }
598
+ // Array.
599
+ else if (Array.isArray(child)) {
600
+ this.append(...child);
601
+ }
602
+ // Execute function.
603
+ else if (typeof child === "function") {
604
+ this.append(child(this));
605
+ }
606
+ // Default.
607
+ else {
608
+ this.children.push(child);
609
+ }
610
+ });
611
+ return this;
612
+ }
613
+ inner_html(value) {
614
+ if (value == null) {
615
+ return this._inner_html;
616
+ }
617
+ this._inner_html = value;
618
+ return this;
619
+ }
620
+ // ---------------------------------------------------------
621
+ // Styling.
622
+ // Center the data.
623
+ center() {
624
+ switch (this.tag) {
625
+ case "table":
626
+ case "tr":
627
+ case "td":
628
+ this._attrs["align"] = "center";
629
+ return this;
630
+ default:
631
+ this._style["text-align"] = "center";
632
+ return this;
633
+ }
634
+ }
635
+ padding(...values) {
636
+ if (values.length === 0) {
637
+ return this._style.padding;
638
+ }
639
+ else if (values.length === 1) {
640
+ this._style.padding = this.pad_numeric(values[0]);
641
+ }
642
+ else if (values.length === 2) {
643
+ if (values[0] != null) {
644
+ this._style["padding-top"] = this.pad_numeric(values[0]);
645
+ }
646
+ if (values[1] != null) {
647
+ this._style["padding-right"] = this.pad_numeric(values[1]);
648
+ }
649
+ if (values[0] != null) {
650
+ this._style["padding-bottom"] = this.pad_numeric(values[0]);
651
+ }
652
+ if (values[1] != null) {
653
+ this._style["padding-left"] = this.pad_numeric(values[1]);
654
+ }
655
+ }
656
+ else if (values.length === 4) {
657
+ this._style["padding-top"] = this.pad_numeric(values[0]);
658
+ if (values[1] != null) {
659
+ this._style["padding-right"] = this.pad_numeric(values[1]);
660
+ }
661
+ if (values[2] != null) {
662
+ this._style["padding-bottom"] = this.pad_numeric(values[2]);
663
+ }
664
+ if (values[3] != null) {
665
+ this._style["padding-left"] = this.pad_numeric(values[3]);
666
+ }
667
+ }
668
+ else {
669
+ console.error("Invalid number of arguments for function \"padding()\".");
670
+ }
671
+ return this;
672
+ }
673
+ margin(...values) {
674
+ if (values.length === 0) {
675
+ return this._style.margin;
676
+ }
677
+ else if (values.length === 1) {
678
+ this._style.margin = this.pad_numeric(values[0]);
679
+ }
680
+ else if (values.length === 2) {
681
+ this._style["margin-top"] = this.pad_numeric(values[0]);
682
+ if (values[1] != null) {
683
+ this._style["margin-left"] = this.pad_numeric(values[1]);
684
+ }
685
+ if (values[0] != null) {
686
+ this._style["margin-bottom"] = this.pad_numeric(values[0]);
687
+ }
688
+ if (values[1] != null) {
689
+ this._style["margin-left"] = this.pad_numeric(values[1]);
690
+ }
691
+ }
692
+ else if (values.length === 4) {
693
+ this._style["margin-top"] = this.pad_numeric(values[0]);
694
+ if (values[1] != null) {
695
+ this._style["margin-left"] = this.pad_numeric(values[1]);
696
+ }
697
+ if (values[2] != null) {
698
+ this._style["margin-bottom"] = this.pad_numeric(values[2]);
699
+ }
700
+ if (values[3] != null) {
701
+ this._style["margin-left"] = this.pad_numeric(values[3]);
702
+ }
703
+ }
704
+ else {
705
+ console.error("Invalid number of arguments for function \"margin()\".");
706
+ }
707
+ return this;
708
+ }
709
+ fixed_width(value) {
710
+ if (value == null) {
711
+ return this._style["min-width"];
712
+ }
713
+ value = this.pad_numeric(value);
714
+ this._style["width"] = value; // also required for for example image masks.
715
+ this._style["min-width"] = value;
716
+ this._style["max-width"] = value;
717
+ return this;
718
+ }
719
+ fixed_height(value) {
720
+ if (value == null) {
721
+ return this._style.height;
722
+ }
723
+ value = this.pad_numeric(value);
724
+ this._style["height"] = value; // also required for for example image masks.
725
+ this._style["min-height"] = value;
726
+ this._style["max-height"] = value;
727
+ return this;
728
+ }
729
+ // Frame.
730
+ frame(width, height) {
731
+ if (width != null) {
732
+ this.width(width);
733
+ }
734
+ if (height != null) {
735
+ this.height(height);
736
+ }
737
+ return this;
738
+ }
739
+ min_frame(width, height) {
740
+ if (width != null) {
741
+ this.min_width(width);
742
+ }
743
+ if (height != null) {
744
+ this.min_height(height);
745
+ }
746
+ return this;
747
+ }
748
+ max_frame(width, height) {
749
+ if (width != null) {
750
+ this.max_width(width);
751
+ }
752
+ if (height != null) {
753
+ this.max_height(height);
754
+ }
755
+ return this;
756
+ }
757
+ fixed_frame(width, height) {
758
+ if (width != null) {
759
+ width = this.pad_numeric(width);
760
+ this._style.width = width; // also required for for example image masks.
761
+ this._style["min-width"] = width;
762
+ this._style["max-width"] = width;
763
+ }
764
+ if (height != null) {
765
+ height = this.pad_numeric(height);
766
+ this._style.height = height; // also required for for example image masks.
767
+ this._style["min-height"] = height;
768
+ this._style["max-height"] = height;
769
+ }
770
+ return this;
771
+ }
772
+ color(value) {
773
+ if (value == null) {
774
+ return this._style.color;
775
+ }
776
+ if (value.startsWith("linear-gradient(") || value.startsWith("radial-gradient(")) {
777
+ this._style["background-image"] = value;
778
+ this._style["background-clip"] = "text";
779
+ this._style["-webkit-background-clip"] = "text";
780
+ this._style.color = "transparent";
781
+ }
782
+ else {
783
+ this._style.color = value;
784
+ }
785
+ return this;
786
+ }
787
+ border(...values) {
788
+ if (values.length === 0) {
789
+ return this._style.border;
790
+ }
791
+ else if (values.length === 1) {
792
+ this._style.border = values[0].toString();
793
+ }
794
+ else if (values.length === 2) {
795
+ this._style.border = `${this.pad_numeric(values[0])} solid ${values[1]}`;
796
+ }
797
+ else if (values.length === 3) {
798
+ this._style.border = `${this.pad_numeric(values[0])} ${values[1]} ${values[2]}`;
799
+ }
800
+ else {
801
+ console.error("Invalid number of arguments for function \"border()\".");
802
+ }
803
+ return this;
804
+ }
805
+ border_radius(value) {
806
+ if (value == null) {
807
+ return this._style["border-radius"];
808
+ }
809
+ const paddedValue = this.pad_numeric(value);
810
+ this._style["border-radius"] = paddedValue;
811
+ this._style["-ms-border-radius"] = paddedValue;
812
+ this._style["-webkit-border-radius"] = paddedValue;
813
+ this._style["-moz-border-radius"] = paddedValue;
814
+ return this;
815
+ }
816
+ background(value) {
817
+ if (value == null) {
818
+ return this._style.background;
819
+ }
820
+ if (typeof value === "string" && (value.startsWith("linear-gradient") || value.startsWith("radial-gradient"))) {
821
+ this._style.background = value;
822
+ this._style["background-image"] = value;
823
+ this._style["background-repeat"] = "no-repeat";
824
+ this._style["background-size"] = "cover";
825
+ }
826
+ else {
827
+ this._style.background = value;
828
+ }
829
+ return this;
830
+ }
831
+ ellipsis_overflow(to = true) {
832
+ if (to == null) {
833
+ return this._style["text-overflow"] === "ellipsis";
834
+ }
835
+ else if (to === true) {
836
+ this._style["text-overflow"] = "ellipsis";
837
+ this._style["white-space"] = "nowrap";
838
+ this._style.overflow = "hidden";
839
+ this._style["text-wrap"] = "wrap";
840
+ this._style["overflow-wrap"] = "break-word";
841
+ }
842
+ else if (to === false) {
843
+ this._style["text-overflow"] = "default";
844
+ this._style["white-space"] = "default";
845
+ this._style.overflow = "default";
846
+ this._style["text-wrap"] = "default";
847
+ this._style["overflow-wrap"] = "default";
848
+ }
849
+ return this;
850
+ }
851
+ on_click(callback) {
852
+ if (callback == null) {
853
+ return this._attrs.onclick;
854
+ }
855
+ this._style.cursor = "pointer";
856
+ const e = this;
857
+ this._attrs.onclick = (t) => {
858
+ if (this._disabled !== true) {
859
+ callback(e, t);
860
+ }
861
+ };
862
+ return this;
863
+ }
864
+ lang(value) {
865
+ if (value == null) {
866
+ return this._lang;
867
+ }
868
+ this._lang = value;
869
+ return this;
870
+ }
871
+ charset(value) {
872
+ if (value == null) {
873
+ return this._charset;
874
+ }
875
+ this._charset = value;
876
+ return this;
877
+ }
878
+ viewport(value) {
879
+ if (value == null) {
880
+ return this._viewport;
881
+ }
882
+ this._viewport = value;
883
+ return this;
884
+ }
885
+ title(value) {
886
+ if (value == null) {
887
+ return this._title;
888
+ }
889
+ this._title = value;
890
+ return this;
891
+ }
892
+ }
893
+ // Create a constructor wrapper.
894
+ function wrapper(constructor) {
895
+ return (...args) => new constructor(...args);
896
+ }
897
+ // Create a shared null element mainly for typescript types.
898
+ function create_null(target_class) {
899
+ let instance;
900
+ return () => {
901
+ if (instance === undefined) {
902
+ instance = new target_class();
903
+ }
904
+ return instance;
905
+ };
906
+ }
907
+ // ---------------------------------------------------------
908
+ // Title.
909
+ export class TitleElement extends Element {
910
+ // Constructor.
911
+ constructor(text) {
912
+ // Initialize base class.
913
+ super({
914
+ type: "Title",
915
+ tag: "h1",
916
+ default_style: {
917
+ "margin": "0px 0px 0px 0px",
918
+ "color": "inherit",
919
+ "white-space": "wrap",
920
+ "text-align": "inherit",
921
+ "font-size": "26px",
922
+ "line-height": "1.2em",
923
+ },
924
+ });
925
+ // Set text.
926
+ if (text) {
927
+ this._inner_html = text;
928
+ }
929
+ }
930
+ }
931
+ export const Title = wrapper(TitleElement);
932
+ export const NullTitle = create_null(TitleElement);
933
+ // ---------------------------------------------------------
934
+ // Subtitle.
935
+ export class SubtitleElement extends Element {
936
+ // Constructor.
937
+ constructor(text) {
938
+ // Initialize base class.
939
+ super({
940
+ type: "Subtitle",
941
+ tag: "h2",
942
+ default_style: {
943
+ "margin": "0px",
944
+ "color": "inherit",
945
+ "white-space": "wrap",
946
+ "text-align": "inherit",
947
+ "font-size": "22px",
948
+ "line-height": "1.2em",
949
+ },
950
+ });
951
+ // Set text.
952
+ if (text) {
953
+ this._inner_html = text;
954
+ }
955
+ }
956
+ }
957
+ export const Subtitle = wrapper(SubtitleElement);
958
+ export const NullSubtitle = create_null(SubtitleElement);
959
+ // ---------------------------------------------------------
960
+ // Text.
961
+ export class TextElement extends Element {
962
+ // Constructor.
963
+ constructor(text) {
964
+ // Initialize base class.
965
+ super({
966
+ type: "Text",
967
+ tag: "p",
968
+ default_style: {
969
+ "margin": "0px",
970
+ "padding": "0px",
971
+ "font-size": "18px",
972
+ "line-height": "1.4em",
973
+ "color": "inherit",
974
+ "text-align": "inherit",
975
+ "white-space": "wrap",
976
+ },
977
+ });
978
+ // Set text.
979
+ if (text) {
980
+ this._inner_html = text;
981
+ }
982
+ }
983
+ }
984
+ export const Text = wrapper(TextElement);
985
+ export const NullText = create_null(TextElement);
986
+ // ---------------------------------------------------------
987
+ // Image.
988
+ export class ImageElement extends Element {
989
+ // Constructor.
990
+ constructor(src) {
991
+ // Initialize base class.
992
+ super({
993
+ type: "Image",
994
+ tag: "img",
995
+ default_style: {
996
+ "margin": "0px",
997
+ "padding": "0px",
998
+ "object-fit": "cover",
999
+ },
1000
+ });
1001
+ // Set src.
1002
+ if (src) {
1003
+ this._attrs.src = src;
1004
+ }
1005
+ }
1006
+ }
1007
+ export const Image = wrapper(ImageElement);
1008
+ export const NullImageElement = create_null(ImageElement);
1009
+ // ---------------------------------------------------------
1010
+ // ImageMask.
1011
+ export class ImageMaskElement extends Element {
1012
+ mask_child;
1013
+ _src;
1014
+ // Constructor.
1015
+ constructor(src) {
1016
+ // Initialize base class.
1017
+ super({
1018
+ type: "ImageMask",
1019
+ tag: "div",
1020
+ default_style: {
1021
+ "margin": "0px",
1022
+ "padding": "0px",
1023
+ "object-fit": "cover",
1024
+ "display": "inline-block",
1025
+ },
1026
+ });
1027
+ // Append child.
1028
+ this.mask_child = VStack()
1029
+ .width("100%")
1030
+ .height("100%")
1031
+ .background("black");
1032
+ if (src != null) {
1033
+ this.mask_child.mask(`url('${src}') no-repeat center/contain`);
1034
+ }
1035
+ this.append(this.mask_child);
1036
+ // Set src.
1037
+ if (src) {
1038
+ this.src(src);
1039
+ }
1040
+ }
1041
+ mask_color(value) {
1042
+ if (value == null) {
1043
+ return this.mask_child._style.background;
1044
+ }
1045
+ this.mask_child._style.background = value;
1046
+ return this;
1047
+ }
1048
+ src(value) {
1049
+ if (value == null) {
1050
+ return this._src;
1051
+ }
1052
+ this.mask_child.mask(`url('${value}') no-repeat center/contain`);
1053
+ this._src = value;
1054
+ return this;
1055
+ }
1056
+ mask(value) {
1057
+ if (value == null) {
1058
+ return this.mask_child.mask();
1059
+ }
1060
+ this.mask_child.mask(value);
1061
+ return this;
1062
+ }
1063
+ }
1064
+ export const ImageMask = wrapper(ImageMaskElement);
1065
+ export const NullImageMaskElement = create_null(ImageMaskElement);
1066
+ // ---------------------------------------------------------
1067
+ // VStack.
1068
+ export class VStackElement extends Element {
1069
+ // Constructor.
1070
+ constructor(...children) {
1071
+ // Initialize base class.
1072
+ super({
1073
+ type: "VStack",
1074
+ tag: "div",
1075
+ });
1076
+ // Add children.
1077
+ this.append(...children);
1078
+ }
1079
+ }
1080
+ export const VStack = wrapper(VStackElement);
1081
+ export const NullVStackElement = create_null(VStackElement);
1082
+ // ---------------------------------------------------------
1083
+ // Divider.
1084
+ export class DividerElement extends Element {
1085
+ // Constructor.
1086
+ constructor(text) {
1087
+ // Initialize base class.
1088
+ super({
1089
+ type: "Divider",
1090
+ tag: "div",
1091
+ default_style: {
1092
+ "margin": "0px",
1093
+ "padding": "0px",
1094
+ "width": "100%",
1095
+ "height": "1px",
1096
+ "min-height": "1px",
1097
+ // "background": "black",
1098
+ },
1099
+ });
1100
+ // Set text.
1101
+ if (text) {
1102
+ this._inner_html = text;
1103
+ }
1104
+ }
1105
+ }
1106
+ export const Divider = wrapper(DividerElement);
1107
+ export const NullDividerElement = create_null(DividerElement);
1108
+ // ---------------------------------------------------------
1109
+ // Table data.
1110
+ export class TableDataElement extends Element {
1111
+ // Constructor.
1112
+ constructor(...children) {
1113
+ // Initialize base class.
1114
+ super({
1115
+ type: "TableData",
1116
+ tag: "td",
1117
+ default_style: {
1118
+ "width": "100%",
1119
+ },
1120
+ default_attributes: {}
1121
+ });
1122
+ // Add children.
1123
+ this.append(...children);
1124
+ }
1125
+ // Center the data.
1126
+ center() {
1127
+ this.attrs({ align: "center" });
1128
+ return this;
1129
+ }
1130
+ // Vertically center.
1131
+ center_vertical() {
1132
+ this._style["vertical-align"] = "middle";
1133
+ return this;
1134
+ }
1135
+ leading_vertical() {
1136
+ this._style["vertical-align"] = "top";
1137
+ return this;
1138
+ }
1139
+ trailing_vertical() {
1140
+ this._style["vertical-align"] = "bottom";
1141
+ return this;
1142
+ }
1143
+ }
1144
+ export const TableData = wrapper(TableDataElement);
1145
+ export const NullTableDataElement = create_null(TableDataElement);
1146
+ // ---------------------------------------------------------
1147
+ // Table row.
1148
+ export class TableRowElement extends Element {
1149
+ current_cell;
1150
+ _wrap = false;
1151
+ // Constructor.
1152
+ constructor(...children) {
1153
+ // Initialize base class.
1154
+ super({
1155
+ type: "TableRow",
1156
+ tag: "tr",
1157
+ default_style: {
1158
+ "width": "100%",
1159
+ },
1160
+ default_attributes: {}
1161
+ });
1162
+ // Add children.
1163
+ this.append(...children);
1164
+ }
1165
+ // Append.
1166
+ append(...children) {
1167
+ for (let i = 0; i < children.length; i++) {
1168
+ const child = children[i];
1169
+ // Skip undefined.
1170
+ if (child == null) {
1171
+ continue;
1172
+ }
1173
+ // Array.
1174
+ else if (Array.isArray(child)) {
1175
+ this.append(...child);
1176
+ }
1177
+ // Execute function.
1178
+ else if (typeof child === "function") {
1179
+ this.append(child(this));
1180
+ }
1181
+ // Table data.
1182
+ else if (child instanceof TableDataElement) {
1183
+ this.current_cell = child;
1184
+ this.children.push(child);
1185
+ }
1186
+ // Default.
1187
+ else {
1188
+ if (this.current_cell == null) {
1189
+ this.current_cell = TableData();
1190
+ this.children.push(this.current_cell);
1191
+ if (this._attrs["align"] === "center") {
1192
+ this.current_cell.attrs({ align: "center" });
1193
+ }
1194
+ if (this._style["vertical-align"] === "middle") {
1195
+ this.current_cell._style["align"] = "middle";
1196
+ }
1197
+ }
1198
+ if ((child._style.display == null || child._style.display === "") && this._wrap === true) {
1199
+ if (child.tag === "p" || child.tag === "h1" || child.tag === "h2") {
1200
+ child._style.display = "inline";
1201
+ }
1202
+ else {
1203
+ child._style.display = "inline-block";
1204
+ }
1205
+ }
1206
+ this.current_cell.append(child);
1207
+ }
1208
+ }
1209
+ return this;
1210
+ }
1211
+ wrap(value) {
1212
+ if (value == null) {
1213
+ return this._wrap;
1214
+ }
1215
+ this._wrap = value;
1216
+ const set_display_inline = (child) => {
1217
+ if (child instanceof TableDataElement) {
1218
+ child.children.forEach(set_display_inline);
1219
+ }
1220
+ else {
1221
+ if ((child._style.display == null || child._style.display === "") && this._wrap === true) {
1222
+ if (child.tag === "p" || child.tag === "h1" || child.tag === "h2") {
1223
+ child._style.display = "inline";
1224
+ }
1225
+ else {
1226
+ child._style.display = "inline-block";
1227
+ }
1228
+ }
1229
+ else if ((child._style.display === "inline" || child._style.display === "inline-block") && this._wrap === false) {
1230
+ child._style.display = "default";
1231
+ }
1232
+ }
1233
+ };
1234
+ this.children.forEach(set_display_inline);
1235
+ return this;
1236
+ }
1237
+ // Center.
1238
+ center() {
1239
+ this._attrs["align"] = "center";
1240
+ this.children.forEach((child) => {
1241
+ if (child instanceof TableDataElement) {
1242
+ child.attrs({ align: "center" });
1243
+ }
1244
+ });
1245
+ return this;
1246
+ }
1247
+ // Vertically center.
1248
+ center_vertical() {
1249
+ this._style["vertical-align"] = "middle";
1250
+ this.children.forEach((child) => {
1251
+ child._style["vertical-align"] = "middle";
1252
+ if (child instanceof TableDataElement) {
1253
+ child.children.forEach((nested) => {
1254
+ nested._style["vertical-align"] = "middle";
1255
+ });
1256
+ }
1257
+ });
1258
+ return this;
1259
+ }
1260
+ leading_vertical() {
1261
+ this._style["vertical-align"] = "top";
1262
+ this.children.forEach((child) => {
1263
+ child._style["vertical-align"] = "top";
1264
+ if (child instanceof TableDataElement) {
1265
+ child.children.forEach((nested) => {
1266
+ nested._style["vertical-align"] = "top";
1267
+ });
1268
+ }
1269
+ });
1270
+ return this;
1271
+ }
1272
+ trailing_vertical() {
1273
+ this._style["vertical-align"] = "bottom";
1274
+ this.children.forEach((child) => {
1275
+ child._style["vertical-align"] = "bottom";
1276
+ if (child instanceof TableDataElement) {
1277
+ child.children.forEach((nested) => {
1278
+ nested._style["vertical-align"] = "bottom";
1279
+ });
1280
+ }
1281
+ });
1282
+ return this;
1283
+ }
1284
+ }
1285
+ export const TableRow = wrapper(TableRowElement);
1286
+ export const NullTableRowElement = create_null(TableRowElement);
1287
+ // ---------------------------------------------------------
1288
+ // Table, automatically inserts table rows and optionally table data's when the appended object is not already a table data.
1289
+ export class TableElement extends Element {
1290
+ current_cell;
1291
+ current_row;
1292
+ // Constructor.
1293
+ constructor(...children) {
1294
+ // Initialize base class.
1295
+ super({
1296
+ type: "Stack",
1297
+ tag: "table",
1298
+ default_style: {
1299
+ "width": "100%",
1300
+ },
1301
+ default_attributes: {
1302
+ "cellspacing": "0",
1303
+ "cellpadding": "0",
1304
+ "border": "0",
1305
+ }
1306
+ });
1307
+ // Add children.
1308
+ this.current_row = TableRow();
1309
+ this.children.append(this.current_row);
1310
+ this.append(...children);
1311
+ }
1312
+ // Add a row.
1313
+ row(...children) {
1314
+ this.current_row = TableRow();
1315
+ this.children.push(this.current_row);
1316
+ this.current_cell = undefined;
1317
+ this.append(...children);
1318
+ return this;
1319
+ }
1320
+ // Append.
1321
+ append(...children) {
1322
+ for (let i = 0; i < children.length; i++) {
1323
+ const child = children[i];
1324
+ // Skip undefined.
1325
+ if (child == null) {
1326
+ continue;
1327
+ }
1328
+ // Array.
1329
+ else if (Array.isArray(child)) {
1330
+ this.append(...child);
1331
+ }
1332
+ // Execute function.
1333
+ else if (typeof child === "function") {
1334
+ this.append(child(this));
1335
+ }
1336
+ // Table row.
1337
+ else if (child instanceof TableRowElement) {
1338
+ this.current_row = child;
1339
+ this.children.push(child);
1340
+ }
1341
+ // Default.
1342
+ else {
1343
+ if (this.current_row == null) {
1344
+ this.current_row = TableRow();
1345
+ this.children.push(this.current_row);
1346
+ }
1347
+ this.current_row.append(child);
1348
+ }
1349
+ }
1350
+ return this;
1351
+ }
1352
+ }
1353
+ export const Table = wrapper(TableElement);
1354
+ export const NullTableElement = create_null(TableElement);
1355
+ // ---------------------------------------------------------
1356
+ // CSS.
1357
+ export class CSSElement extends Element {
1358
+ // Constructor.
1359
+ constructor(style) {
1360
+ // Initialize base class.
1361
+ super({
1362
+ type: "CSS",
1363
+ tag: "style",
1364
+ });
1365
+ // Add inner html.
1366
+ if (style) {
1367
+ this._inner_html = style;
1368
+ }
1369
+ }
1370
+ }
1371
+ export const CSS = wrapper(CSSElement);
1372
+ export const NullCSSElement = create_null(CSSElement);
1373
+ // ---------------------------------------------------------
1374
+ // Mail.
1375
+ export class MailElement extends Element {
1376
+ _subject;
1377
+ // Constructor.
1378
+ constructor(...children) {
1379
+ // Initialize base class.
1380
+ super({
1381
+ type: "Mail",
1382
+ tag: "mail",
1383
+ default_style: {
1384
+ "width": "100% !important",
1385
+ "min-height": "100% !important",
1386
+ "box-sizing": "border-box",
1387
+ "padding": "0px", // this is required, sometimes it glitches and makes it scrolling without zero padding.
1388
+ "margin": "0px",
1389
+ },
1390
+ });
1391
+ // Add children.
1392
+ this.append(...children);
1393
+ }
1394
+ subject(subj) {
1395
+ if (subj == null) {
1396
+ return this._subject;
1397
+ }
1398
+ this._subject = subj;
1399
+ return this;
1400
+ }
1401
+ }
1402
+ export const Mail = wrapper(MailElement);
1403
+ export const NullMailElement = create_null(MailElement);