mppx 0.6.31 → 0.8.0

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 (616) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +20 -11
  3. package/dist/Challenge.d.ts.map +1 -1
  4. package/dist/Challenge.js +27 -13
  5. package/dist/Challenge.js.map +1 -1
  6. package/dist/Constants.d.ts +46 -0
  7. package/dist/Constants.d.ts.map +1 -0
  8. package/dist/Constants.js +46 -0
  9. package/dist/Constants.js.map +1 -0
  10. package/dist/Credential.d.ts.map +1 -1
  11. package/dist/Credential.js +5 -4
  12. package/dist/Credential.js.map +1 -1
  13. package/dist/Mcp.d.ts +3 -0
  14. package/dist/Mcp.d.ts.map +1 -1
  15. package/dist/Mcp.js +2 -0
  16. package/dist/Mcp.js.map +1 -1
  17. package/dist/Method.d.ts +32 -4
  18. package/dist/Method.d.ts.map +1 -1
  19. package/dist/Method.js +5 -2
  20. package/dist/Method.js.map +1 -1
  21. package/dist/PaymentRequest.d.ts +10 -10
  22. package/dist/PaymentRequest.js +8 -8
  23. package/dist/Receipt.d.ts.map +1 -1
  24. package/dist/Receipt.js +3 -2
  25. package/dist/Receipt.js.map +1 -1
  26. package/dist/cli/cli.d.ts.map +1 -1
  27. package/dist/cli/cli.js +19 -11
  28. package/dist/cli/cli.js.map +1 -1
  29. package/dist/cli/plugins/tempo.d.ts.map +1 -1
  30. package/dist/cli/plugins/tempo.js +17 -6
  31. package/dist/cli/plugins/tempo.js.map +1 -1
  32. package/dist/cli/utils.d.ts +5 -0
  33. package/dist/cli/utils.d.ts.map +1 -1
  34. package/dist/cli/utils.js +10 -0
  35. package/dist/cli/utils.js.map +1 -1
  36. package/dist/client/Methods.d.ts +5 -2
  37. package/dist/client/Methods.d.ts.map +1 -1
  38. package/dist/client/Methods.js +5 -2
  39. package/dist/client/Methods.js.map +1 -1
  40. package/dist/client/Mppx.js +2 -2
  41. package/dist/client/Mppx.js.map +1 -1
  42. package/dist/client/Transport.d.ts +11 -16
  43. package/dist/client/Transport.d.ts.map +1 -1
  44. package/dist/client/Transport.js +55 -76
  45. package/dist/client/Transport.js.map +1 -1
  46. package/dist/client/index.d.ts +5 -1
  47. package/dist/client/index.d.ts.map +1 -1
  48. package/dist/client/index.js +3 -1
  49. package/dist/client/index.js.map +1 -1
  50. package/dist/client/internal/Fetch.d.ts.map +1 -1
  51. package/dist/client/internal/Fetch.js +60 -13
  52. package/dist/client/internal/Fetch.js.map +1 -1
  53. package/dist/client/internal/protocols/Mcp.d.ts +7 -0
  54. package/dist/client/internal/protocols/Mcp.d.ts.map +1 -0
  55. package/dist/client/internal/protocols/Mcp.js +159 -0
  56. package/dist/client/internal/protocols/Mcp.js.map +1 -0
  57. package/dist/client/internal/protocols/Mpp.d.ts +4 -0
  58. package/dist/client/internal/protocols/Mpp.d.ts.map +1 -0
  59. package/dist/client/internal/protocols/Mpp.js +18 -0
  60. package/dist/client/internal/protocols/Mpp.js.map +1 -0
  61. package/dist/client/internal/protocols/Protocol.d.ts +10 -0
  62. package/dist/client/internal/protocols/Protocol.d.ts.map +1 -0
  63. package/dist/client/internal/protocols/Protocol.js +2 -0
  64. package/dist/client/internal/protocols/Protocol.js.map +1 -0
  65. package/dist/client/internal/protocols/Shared.d.ts +5 -0
  66. package/dist/client/internal/protocols/Shared.d.ts.map +1 -0
  67. package/dist/client/internal/protocols/Shared.js +20 -0
  68. package/dist/client/internal/protocols/Shared.js.map +1 -0
  69. package/dist/client/internal/protocols/X402.d.ts +8 -0
  70. package/dist/client/internal/protocols/X402.d.ts.map +1 -0
  71. package/dist/client/internal/protocols/X402.js +39 -0
  72. package/dist/client/internal/protocols/X402.js.map +1 -0
  73. package/dist/evm/client/index.d.ts +1 -0
  74. package/dist/evm/client/index.d.ts.map +1 -1
  75. package/dist/evm/client/index.js +1 -0
  76. package/dist/evm/client/index.js.map +1 -1
  77. package/dist/evm/index.d.ts +2 -0
  78. package/dist/evm/index.d.ts.map +1 -1
  79. package/dist/evm/index.js +2 -0
  80. package/dist/evm/index.js.map +1 -1
  81. package/dist/evm/server/Methods.d.ts +1 -1
  82. package/dist/evm/server/Methods.d.ts.map +1 -1
  83. package/dist/evm/server/index.d.ts +1 -0
  84. package/dist/evm/server/index.d.ts.map +1 -1
  85. package/dist/evm/server/index.js +1 -0
  86. package/dist/evm/server/index.js.map +1 -1
  87. package/dist/index.d.ts +1 -0
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +1 -0
  90. package/dist/index.js.map +1 -1
  91. package/dist/internal/AcceptPayment.d.ts +3 -0
  92. package/dist/internal/AcceptPayment.d.ts.map +1 -1
  93. package/dist/internal/AcceptPayment.js +15 -11
  94. package/dist/internal/AcceptPayment.js.map +1 -1
  95. package/dist/mcp/client/McpClient.d.ts +101 -0
  96. package/dist/mcp/client/McpClient.d.ts.map +1 -0
  97. package/dist/mcp/client/McpClient.js +162 -0
  98. package/dist/mcp/client/McpClient.js.map +1 -0
  99. package/dist/mcp/client/index.d.ts.map +1 -0
  100. package/dist/mcp/client/index.js.map +1 -0
  101. package/dist/mcp/server/Transport.d.ts.map +1 -0
  102. package/dist/mcp/server/Transport.js.map +1 -0
  103. package/dist/mcp/server/index.d.ts.map +1 -0
  104. package/dist/mcp/server/index.js.map +1 -0
  105. package/dist/server/Mppx.d.ts +12 -4
  106. package/dist/server/Mppx.d.ts.map +1 -1
  107. package/dist/server/Mppx.js +85 -27
  108. package/dist/server/Mppx.js.map +1 -1
  109. package/dist/server/Response.d.ts.map +1 -1
  110. package/dist/server/Response.js +2 -1
  111. package/dist/server/Response.js.map +1 -1
  112. package/dist/server/Transport.d.ts +1 -1
  113. package/dist/server/Transport.d.ts.map +1 -1
  114. package/dist/server/Transport.js +5 -4
  115. package/dist/server/Transport.js.map +1 -1
  116. package/dist/server/index.d.ts +1 -0
  117. package/dist/server/index.d.ts.map +1 -1
  118. package/dist/server/index.js +1 -0
  119. package/dist/server/index.js.map +1 -1
  120. package/dist/stripe/client/Charge.d.ts +1 -1
  121. package/dist/stripe/client/Charge.d.ts.map +1 -1
  122. package/dist/stripe/client/Charge.js +3 -1
  123. package/dist/stripe/client/Charge.js.map +1 -1
  124. package/dist/stripe/server/Charge.d.ts +1 -1
  125. package/dist/stripe/server/Charge.d.ts.map +1 -1
  126. package/dist/stripe/server/Charge.js +9 -2
  127. package/dist/stripe/server/Charge.js.map +1 -1
  128. package/dist/stripe/server/Methods.d.ts +1 -1
  129. package/dist/stripe/server/Methods.d.ts.map +1 -1
  130. package/dist/stripe/server/internal/html.gen.d.ts +1 -1
  131. package/dist/stripe/server/internal/html.gen.d.ts.map +1 -1
  132. package/dist/stripe/server/internal/html.gen.js +1 -1
  133. package/dist/stripe/server/internal/html.gen.js.map +1 -1
  134. package/dist/tempo/Methods.d.ts +18 -0
  135. package/dist/tempo/Methods.d.ts.map +1 -1
  136. package/dist/tempo/Methods.js +16 -1
  137. package/dist/tempo/Methods.js.map +1 -1
  138. package/dist/tempo/Proof.d.ts +85 -1
  139. package/dist/tempo/Proof.d.ts.map +1 -1
  140. package/dist/tempo/Proof.js +35 -0
  141. package/dist/tempo/Proof.js.map +1 -1
  142. package/dist/tempo/client/Charge.d.ts +19 -1
  143. package/dist/tempo/client/Charge.d.ts.map +1 -1
  144. package/dist/tempo/client/Charge.js +47 -27
  145. package/dist/tempo/client/Charge.js.map +1 -1
  146. package/dist/tempo/client/Methods.d.ts +41 -10
  147. package/dist/tempo/client/Methods.d.ts.map +1 -1
  148. package/dist/tempo/client/Methods.js +16 -7
  149. package/dist/tempo/client/Methods.js.map +1 -1
  150. package/dist/tempo/client/ResolveAccount.d.ts +40 -0
  151. package/dist/tempo/client/ResolveAccount.d.ts.map +1 -0
  152. package/dist/tempo/client/ResolveAccount.js +2 -0
  153. package/dist/tempo/client/ResolveAccount.js.map +1 -0
  154. package/dist/tempo/client/index.d.ts +7 -4
  155. package/dist/tempo/client/index.d.ts.map +1 -1
  156. package/dist/tempo/client/index.js +5 -3
  157. package/dist/tempo/client/index.js.map +1 -1
  158. package/dist/tempo/index.d.ts +1 -0
  159. package/dist/tempo/index.d.ts.map +1 -1
  160. package/dist/tempo/index.js +1 -0
  161. package/dist/tempo/index.js.map +1 -1
  162. package/dist/tempo/internal/fee-payer.d.ts +29 -1
  163. package/dist/tempo/internal/fee-payer.d.ts.map +1 -1
  164. package/dist/tempo/internal/fee-payer.js +138 -4
  165. package/dist/tempo/internal/fee-payer.js.map +1 -1
  166. package/dist/tempo/internal/proof.d.ts +71 -5
  167. package/dist/tempo/internal/proof.d.ts.map +1 -1
  168. package/dist/tempo/internal/proof.js +42 -6
  169. package/dist/tempo/internal/proof.js.map +1 -1
  170. package/dist/tempo/{client → legacy/client}/ChannelOps.d.ts +19 -6
  171. package/dist/tempo/legacy/client/ChannelOps.d.ts.map +1 -0
  172. package/dist/tempo/{client → legacy/client}/ChannelOps.js +9 -3
  173. package/dist/tempo/legacy/client/ChannelOps.js.map +1 -0
  174. package/dist/tempo/{client → legacy/client}/Session.d.ts +23 -4
  175. package/dist/tempo/legacy/client/Session.d.ts.map +1 -0
  176. package/dist/tempo/{client → legacy/client}/Session.js +14 -7
  177. package/dist/tempo/legacy/client/Session.js.map +1 -0
  178. package/dist/tempo/{client → legacy/client}/SessionManager.d.ts +20 -5
  179. package/dist/tempo/legacy/client/SessionManager.d.ts.map +1 -0
  180. package/dist/tempo/{client → legacy/client}/SessionManager.js +30 -19
  181. package/dist/tempo/legacy/client/SessionManager.js.map +1 -0
  182. package/dist/tempo/legacy/client/index.d.ts +7 -0
  183. package/dist/tempo/legacy/client/index.d.ts.map +1 -0
  184. package/dist/tempo/legacy/client/index.js +5 -0
  185. package/dist/tempo/legacy/client/index.js.map +1 -0
  186. package/dist/tempo/legacy/index.d.ts +7 -0
  187. package/dist/tempo/legacy/index.d.ts.map +1 -0
  188. package/dist/tempo/legacy/index.js +7 -0
  189. package/dist/tempo/legacy/index.js.map +1 -0
  190. package/dist/tempo/{server → legacy/server}/Session.d.ts +28 -11
  191. package/dist/tempo/legacy/server/Session.d.ts.map +1 -0
  192. package/dist/tempo/{server → legacy/server}/Session.js +12 -10
  193. package/dist/tempo/legacy/server/Session.js.map +1 -0
  194. package/dist/tempo/legacy/server/index.d.ts +5 -0
  195. package/dist/tempo/legacy/server/index.d.ts.map +1 -0
  196. package/dist/tempo/legacy/server/index.js +5 -0
  197. package/dist/tempo/legacy/server/index.js.map +1 -0
  198. package/dist/tempo/{session → legacy/session}/Chain.d.ts +30 -23
  199. package/dist/tempo/legacy/session/Chain.d.ts.map +1 -0
  200. package/dist/tempo/{session → legacy/session}/Chain.js +12 -11
  201. package/dist/tempo/legacy/session/Chain.js.map +1 -0
  202. package/dist/tempo/{session → legacy/session}/Channel.d.ts +1 -0
  203. package/dist/tempo/legacy/session/Channel.d.ts.map +1 -0
  204. package/dist/tempo/legacy/session/Channel.js.map +1 -0
  205. package/dist/tempo/legacy/session/ChannelStore.d.ts +22 -0
  206. package/dist/tempo/legacy/session/ChannelStore.d.ts.map +1 -0
  207. package/dist/tempo/legacy/session/ChannelStore.js +6 -0
  208. package/dist/tempo/legacy/session/ChannelStore.js.map +1 -0
  209. package/dist/tempo/legacy/session/Types.d.ts +73 -0
  210. package/dist/tempo/legacy/session/Types.d.ts.map +1 -0
  211. package/dist/tempo/legacy/session/Types.js.map +1 -0
  212. package/dist/tempo/{session → legacy/session}/Voucher.d.ts +4 -4
  213. package/dist/tempo/legacy/session/Voucher.d.ts.map +1 -0
  214. package/dist/tempo/{session → legacy/session}/Voucher.js +1 -1
  215. package/dist/tempo/legacy/session/Voucher.js.map +1 -0
  216. package/dist/tempo/{session → legacy/session}/escrow.abi.d.ts +1 -0
  217. package/dist/tempo/{session → legacy/session}/escrow.abi.d.ts.map +1 -1
  218. package/dist/tempo/{session → legacy/session}/escrow.abi.js +1 -0
  219. package/dist/tempo/legacy/session/escrow.abi.js.map +1 -0
  220. package/dist/tempo/legacy/session/index.d.ts +9 -0
  221. package/dist/tempo/legacy/session/index.d.ts.map +1 -0
  222. package/dist/tempo/legacy/session/index.js +9 -0
  223. package/dist/tempo/legacy/session/index.js.map +1 -0
  224. package/dist/tempo/server/Charge.d.ts +1 -1
  225. package/dist/tempo/server/Charge.d.ts.map +1 -1
  226. package/dist/tempo/server/Charge.js +51 -30
  227. package/dist/tempo/server/Charge.js.map +1 -1
  228. package/dist/tempo/server/Methods.d.ts +67 -8
  229. package/dist/tempo/server/Methods.d.ts.map +1 -1
  230. package/dist/tempo/server/Methods.js +40 -10
  231. package/dist/tempo/server/Methods.js.map +1 -1
  232. package/dist/tempo/server/Subscription.d.ts +11 -1
  233. package/dist/tempo/server/Subscription.d.ts.map +1 -1
  234. package/dist/tempo/server/Subscription.js +135 -23
  235. package/dist/tempo/server/Subscription.js.map +1 -1
  236. package/dist/tempo/server/index.d.ts +6 -5
  237. package/dist/tempo/server/index.d.ts.map +1 -1
  238. package/dist/tempo/server/index.js +5 -5
  239. package/dist/tempo/server/index.js.map +1 -1
  240. package/dist/tempo/server/internal/html.gen.d.ts +1 -1
  241. package/dist/tempo/server/internal/html.gen.d.ts.map +1 -1
  242. package/dist/tempo/server/internal/html.gen.js +1 -1
  243. package/dist/tempo/server/internal/html.gen.js.map +1 -1
  244. package/dist/tempo/server/internal/request-body.d.ts +7 -2
  245. package/dist/tempo/server/internal/request-body.d.ts.map +1 -1
  246. package/dist/tempo/server/internal/request-body.js +20 -3
  247. package/dist/tempo/server/internal/request-body.js.map +1 -1
  248. package/dist/tempo/server/internal/transport.d.ts +8 -4
  249. package/dist/tempo/server/internal/transport.d.ts.map +1 -1
  250. package/dist/tempo/server/internal/transport.js +8 -7
  251. package/dist/tempo/server/internal/transport.js.map +1 -1
  252. package/dist/tempo/session/Snapshot.d.ts +32 -0
  253. package/dist/tempo/session/Snapshot.d.ts.map +1 -0
  254. package/dist/tempo/session/Snapshot.js +37 -0
  255. package/dist/tempo/session/Snapshot.js.map +1 -0
  256. package/dist/tempo/session/client/ChannelOps.d.ts +81 -0
  257. package/dist/tempo/session/client/ChannelOps.d.ts.map +1 -0
  258. package/dist/tempo/session/client/ChannelOps.js +201 -0
  259. package/dist/tempo/session/client/ChannelOps.js.map +1 -0
  260. package/dist/tempo/session/client/ChannelStore.d.ts +51 -0
  261. package/dist/tempo/session/client/ChannelStore.d.ts.map +1 -0
  262. package/dist/tempo/session/client/ChannelStore.js +63 -0
  263. package/dist/tempo/session/client/ChannelStore.js.map +1 -0
  264. package/dist/tempo/session/client/CredentialState.d.ts +245 -0
  265. package/dist/tempo/session/client/CredentialState.d.ts.map +1 -0
  266. package/dist/tempo/session/client/CredentialState.js +419 -0
  267. package/dist/tempo/session/client/CredentialState.js.map +1 -0
  268. package/dist/tempo/session/client/ReceiptCoordinator.d.ts +26 -0
  269. package/dist/tempo/session/client/ReceiptCoordinator.d.ts.map +1 -0
  270. package/dist/tempo/session/client/ReceiptCoordinator.js +61 -0
  271. package/dist/tempo/session/client/ReceiptCoordinator.js.map +1 -0
  272. package/dist/tempo/session/client/Runtime.d.ts +464 -0
  273. package/dist/tempo/session/client/Runtime.d.ts.map +1 -0
  274. package/dist/tempo/session/client/Runtime.js +499 -0
  275. package/dist/tempo/session/client/Runtime.js.map +1 -0
  276. package/dist/tempo/session/client/Session.d.ts +138 -0
  277. package/dist/tempo/session/client/Session.d.ts.map +1 -0
  278. package/dist/tempo/session/client/Session.js +69 -0
  279. package/dist/tempo/session/client/Session.js.map +1 -0
  280. package/dist/tempo/session/client/SessionManager.d.ts +84 -0
  281. package/dist/tempo/session/client/SessionManager.d.ts.map +1 -0
  282. package/dist/tempo/session/client/SessionManager.js +577 -0
  283. package/dist/tempo/session/client/SessionManager.js.map +1 -0
  284. package/dist/tempo/session/client/Transports.d.ts +449 -0
  285. package/dist/tempo/session/client/Transports.d.ts.map +1 -0
  286. package/dist/tempo/session/client/Transports.js +721 -0
  287. package/dist/tempo/session/client/Transports.js.map +1 -0
  288. package/dist/tempo/session/client/index.d.ts +11 -0
  289. package/dist/tempo/session/client/index.d.ts.map +1 -0
  290. package/dist/tempo/session/client/index.js +6 -0
  291. package/dist/tempo/session/client/index.js.map +1 -0
  292. package/dist/tempo/session/index.d.ts +7 -8
  293. package/dist/tempo/session/index.d.ts.map +1 -1
  294. package/dist/tempo/session/index.js +7 -8
  295. package/dist/tempo/session/index.js.map +1 -1
  296. package/dist/tempo/session/precompile/Chain.d.ts +319 -0
  297. package/dist/tempo/session/precompile/Chain.d.ts.map +1 -0
  298. package/dist/tempo/session/precompile/Chain.js +492 -0
  299. package/dist/tempo/session/precompile/Chain.js.map +1 -0
  300. package/dist/tempo/session/precompile/Channel.d.ts +46 -0
  301. package/dist/tempo/session/precompile/Channel.d.ts.map +1 -0
  302. package/dist/tempo/session/precompile/Channel.js +56 -0
  303. package/dist/tempo/session/precompile/Channel.js.map +1 -0
  304. package/dist/tempo/session/precompile/Protocol.d.ts +308 -0
  305. package/dist/tempo/session/precompile/Protocol.d.ts.map +1 -0
  306. package/dist/tempo/session/precompile/Protocol.js +264 -0
  307. package/dist/tempo/session/precompile/Protocol.js.map +1 -0
  308. package/dist/tempo/session/precompile/Voucher.d.ts +40 -0
  309. package/dist/tempo/session/precompile/Voucher.d.ts.map +1 -0
  310. package/dist/tempo/session/precompile/Voucher.js +125 -0
  311. package/dist/tempo/session/precompile/Voucher.js.map +1 -0
  312. package/dist/tempo/session/precompile/escrow.abi.d.ts +522 -0
  313. package/dist/tempo/session/precompile/escrow.abi.d.ts.map +1 -0
  314. package/dist/tempo/session/precompile/escrow.abi.js +224 -0
  315. package/dist/tempo/session/precompile/escrow.abi.js.map +1 -0
  316. package/dist/tempo/session/precompile/index.d.ts +24 -0
  317. package/dist/tempo/session/precompile/index.d.ts.map +1 -0
  318. package/dist/tempo/session/precompile/index.js +22 -0
  319. package/dist/tempo/session/precompile/index.js.map +1 -0
  320. package/dist/tempo/session/server/ChannelOps.d.ts +56 -0
  321. package/dist/tempo/session/server/ChannelOps.d.ts.map +1 -0
  322. package/dist/tempo/session/server/ChannelOps.js +91 -0
  323. package/dist/tempo/session/server/ChannelOps.js.map +1 -0
  324. package/dist/tempo/session/server/ChannelStore.d.ts +347 -0
  325. package/dist/tempo/session/server/ChannelStore.d.ts.map +1 -0
  326. package/dist/tempo/session/server/ChannelStore.js +404 -0
  327. package/dist/tempo/session/server/ChannelStore.js.map +1 -0
  328. package/dist/tempo/session/server/CredentialVerification.d.ts +85 -0
  329. package/dist/tempo/session/server/CredentialVerification.d.ts.map +1 -0
  330. package/dist/tempo/session/server/CredentialVerification.js +494 -0
  331. package/dist/tempo/session/server/CredentialVerification.js.map +1 -0
  332. package/dist/tempo/session/server/MeteredStream.d.ts +40 -0
  333. package/dist/tempo/session/server/MeteredStream.d.ts.map +1 -0
  334. package/dist/tempo/session/server/MeteredStream.js +42 -0
  335. package/dist/tempo/session/server/MeteredStream.js.map +1 -0
  336. package/dist/tempo/session/server/RequestState.d.ts +208 -0
  337. package/dist/tempo/session/server/RequestState.d.ts.map +1 -0
  338. package/dist/tempo/session/server/RequestState.js +252 -0
  339. package/dist/tempo/session/server/RequestState.js.map +1 -0
  340. package/dist/tempo/session/server/Session.d.ts +169 -0
  341. package/dist/tempo/session/server/Session.d.ts.map +1 -0
  342. package/dist/tempo/session/server/Session.js +351 -0
  343. package/dist/tempo/session/server/Session.js.map +1 -0
  344. package/dist/tempo/session/server/Settlement.d.ts +185 -0
  345. package/dist/tempo/session/server/Settlement.d.ts.map +1 -0
  346. package/dist/tempo/session/server/Settlement.js +252 -0
  347. package/dist/tempo/session/server/Settlement.js.map +1 -0
  348. package/dist/tempo/session/{Sse.d.ts → server/Sse.d.ts} +9 -56
  349. package/dist/tempo/session/server/Sse.d.ts.map +1 -0
  350. package/dist/tempo/session/server/Sse.js +184 -0
  351. package/dist/tempo/session/server/Sse.js.map +1 -0
  352. package/dist/tempo/session/server/Transports.d.ts +89 -0
  353. package/dist/tempo/session/server/Transports.d.ts.map +1 -0
  354. package/dist/tempo/session/server/Transports.js +149 -0
  355. package/dist/tempo/session/server/Transports.js.map +1 -0
  356. package/dist/tempo/session/server/Ws.d.ts +48 -0
  357. package/dist/tempo/session/server/Ws.d.ts.map +1 -0
  358. package/dist/tempo/session/server/Ws.js +244 -0
  359. package/dist/tempo/session/server/Ws.js.map +1 -0
  360. package/dist/tempo/session/server/index.d.ts +4 -0
  361. package/dist/tempo/session/server/index.d.ts.map +1 -0
  362. package/dist/tempo/session/server/index.js +2 -0
  363. package/dist/tempo/session/server/index.js.map +1 -0
  364. package/dist/tempo/subscription/KeyAuthorization.d.ts +712 -1
  365. package/dist/tempo/subscription/KeyAuthorization.d.ts.map +1 -1
  366. package/dist/tempo/subscription/Store.d.ts +2 -0
  367. package/dist/tempo/subscription/Store.d.ts.map +1 -1
  368. package/dist/tempo/subscription/Store.js +16 -1
  369. package/dist/tempo/subscription/Store.js.map +1 -1
  370. package/dist/x402/index.d.ts +1 -0
  371. package/dist/x402/index.d.ts.map +1 -1
  372. package/dist/x402/index.js +1 -0
  373. package/dist/x402/index.js.map +1 -1
  374. package/package.json +25 -9
  375. package/src/Challenge.test.ts +40 -0
  376. package/src/Challenge.ts +28 -13
  377. package/src/Constants.ts +58 -0
  378. package/src/Credential.ts +5 -4
  379. package/src/Mcp.ts +4 -0
  380. package/src/Method.ts +46 -5
  381. package/src/PaymentRequest.ts +10 -10
  382. package/src/Receipt.ts +3 -2
  383. package/src/cli/cli.test.ts +38 -43
  384. package/src/cli/cli.ts +23 -10
  385. package/src/cli/mcp.test.ts +21 -7
  386. package/src/cli/plugins/tempo.ts +21 -8
  387. package/src/cli/utils.test.ts +25 -1
  388. package/src/cli/utils.ts +10 -0
  389. package/src/client/Methods.ts +5 -2
  390. package/src/client/Mppx.test-d.ts +31 -1
  391. package/src/client/Mppx.test.ts +76 -1
  392. package/src/client/Mppx.ts +2 -2
  393. package/src/client/Transport.test.ts +225 -178
  394. package/src/client/Transport.ts +77 -84
  395. package/src/client/index.ts +25 -1
  396. package/src/client/internal/Fetch.test.ts +236 -6
  397. package/src/client/internal/Fetch.ts +69 -11
  398. package/src/client/internal/protocols/Mcp.test.ts +220 -0
  399. package/src/client/internal/protocols/Mcp.ts +162 -0
  400. package/src/client/internal/protocols/Mpp.ts +21 -0
  401. package/src/client/internal/protocols/Protocol.ts +10 -0
  402. package/src/client/internal/protocols/Shared.ts +25 -0
  403. package/src/client/internal/protocols/X402.ts +42 -0
  404. package/src/discovery/OpenApi.test.ts +1 -1
  405. package/src/env.d.ts +1 -1
  406. package/src/evm/PublicInterface.test-d.ts +1 -1
  407. package/src/evm/client/index.ts +1 -0
  408. package/src/evm/index.ts +2 -0
  409. package/src/evm/server/Charge.test.ts +1 -1
  410. package/src/evm/server/index.ts +1 -0
  411. package/src/index.ts +1 -0
  412. package/src/internal/AcceptPayment.test.ts +61 -0
  413. package/src/internal/AcceptPayment.ts +21 -14
  414. package/src/{mcp-sdk → mcp}/client/McpClient.integration.test.ts +18 -11
  415. package/src/{mcp-sdk → mcp}/client/McpClient.test-d.ts +45 -11
  416. package/src/{mcp-sdk → mcp}/client/McpClient.test.ts +211 -5
  417. package/src/mcp/client/McpClient.ts +307 -0
  418. package/src/mcp/client/McpClient.unit.test.ts +135 -0
  419. package/src/middlewares/elysia.test.ts +9 -5
  420. package/src/middlewares/express.test.ts +9 -5
  421. package/src/middlewares/hono.test.ts +5 -5
  422. package/src/middlewares/internal/mppx.test.ts +1 -1
  423. package/src/middlewares/nextjs.test.ts +9 -5
  424. package/src/proxy/Proxy.test.ts +9 -9
  425. package/src/proxy/services/anthropic.test.ts +1 -1
  426. package/src/proxy/services/openai.test.ts +1 -1
  427. package/src/proxy/services/stripe.test.ts +1 -1
  428. package/src/server/Mppx.authorize.test.ts +1 -1
  429. package/src/server/Mppx.test-d.ts +55 -1
  430. package/src/server/Mppx.test.ts +220 -9
  431. package/src/server/Mppx.ts +501 -407
  432. package/src/server/Response.ts +2 -1
  433. package/src/server/Transport.test.ts +6 -6
  434. package/src/server/Transport.ts +5 -4
  435. package/src/server/index.ts +1 -0
  436. package/src/stripe/Charge.integration.test.ts +1 -1
  437. package/src/stripe/client/Charge.test.ts +21 -6
  438. package/src/stripe/client/Charge.ts +6 -2
  439. package/src/stripe/server/Charge.test.ts +115 -2
  440. package/src/stripe/server/Charge.ts +13 -2
  441. package/src/stripe/server/internal/html/package.json +1 -1
  442. package/src/stripe/server/internal/html.gen.ts +1 -1
  443. package/src/tempo/AccessKeyAuthorization.test.ts +4 -94
  444. package/src/tempo/Methods.test.ts +45 -17
  445. package/src/tempo/Methods.ts +22 -0
  446. package/src/tempo/Proof.conformance.test.ts +146 -0
  447. package/src/tempo/Proof.test-d.ts +15 -0
  448. package/src/tempo/Proof.ts +52 -1
  449. package/src/tempo/PublicExports.test-d.ts +105 -0
  450. package/src/tempo/Subscription.integration.test.ts +1 -1
  451. package/src/tempo/client/Charge.test.ts +258 -0
  452. package/src/tempo/client/Charge.ts +84 -38
  453. package/src/tempo/client/Methods.ts +22 -8
  454. package/src/tempo/client/ResolveAccount.ts +46 -0
  455. package/src/tempo/client/index.ts +15 -4
  456. package/src/tempo/index.ts +1 -0
  457. package/src/tempo/internal/fee-payer.test.ts +296 -17
  458. package/src/tempo/internal/fee-payer.ts +186 -4
  459. package/src/tempo/internal/fee-token.test.ts +14 -9
  460. package/src/tempo/internal/proof.test.ts +12 -4
  461. package/src/tempo/internal/proof.ts +55 -6
  462. package/src/tempo/legacy/AccessKeyAuthorization.test.ts +162 -0
  463. package/src/tempo/legacy/README.md +9 -0
  464. package/src/tempo/{client → legacy/client}/ChannelOps.test.ts +6 -7
  465. package/src/tempo/{client → legacy/client}/ChannelOps.ts +22 -9
  466. package/src/tempo/{client → legacy/client}/Session.test.ts +51 -9
  467. package/src/tempo/{client → legacy/client}/Session.ts +25 -11
  468. package/src/tempo/{client → legacy/client}/SessionManager.test.ts +81 -9
  469. package/src/tempo/{client → legacy/client}/SessionManager.ts +52 -23
  470. package/src/tempo/legacy/client/index.ts +6 -0
  471. package/src/tempo/legacy/index.ts +6 -0
  472. package/src/tempo/{server → legacy/server}/Session.test.ts +136 -71
  473. package/src/tempo/{server → legacy/server}/Session.ts +32 -23
  474. package/src/tempo/legacy/server/index.ts +4 -0
  475. package/src/tempo/{session → legacy/session}/Chain.test.ts +3 -4
  476. package/src/tempo/{session → legacy/session}/Chain.ts +94 -63
  477. package/src/tempo/{session → legacy/session}/Channel.ts +1 -0
  478. package/src/tempo/legacy/session/ChannelStore.test.ts +58 -0
  479. package/src/tempo/legacy/session/ChannelStore.ts +39 -0
  480. package/src/tempo/legacy/session/Types.ts +91 -0
  481. package/src/tempo/{session → legacy/session}/Voucher.ts +12 -8
  482. package/src/tempo/{session → legacy/session}/escrow.abi.ts +1 -0
  483. package/src/tempo/legacy/session/index.ts +8 -0
  484. package/src/tempo/server/AtomicStore.test-d.ts +16 -11
  485. package/src/tempo/server/Charge.test.ts +480 -31
  486. package/src/tempo/server/Charge.ts +54 -30
  487. package/src/tempo/server/Methods.ts +58 -10
  488. package/src/tempo/server/Sse.test.ts +2 -2
  489. package/src/tempo/server/Subscription.test.ts +465 -3
  490. package/src/tempo/server/Subscription.ts +174 -19
  491. package/src/tempo/server/index.ts +6 -5
  492. package/src/tempo/server/internal/html/package.json +2 -2
  493. package/src/tempo/server/internal/html.gen.ts +1 -1
  494. package/src/tempo/server/internal/request-body.test.ts +37 -4
  495. package/src/tempo/server/internal/request-body.ts +25 -6
  496. package/src/tempo/server/internal/transport.test.ts +4 -4
  497. package/src/tempo/server/internal/transport.ts +19 -10
  498. package/src/tempo/session/Snapshot.test.ts +41 -0
  499. package/src/tempo/session/Snapshot.ts +74 -0
  500. package/src/tempo/session/client/ChannelOps.test.ts +163 -0
  501. package/src/tempo/session/client/ChannelOps.ts +330 -0
  502. package/src/tempo/session/client/ChannelStore.ts +111 -0
  503. package/src/tempo/session/client/CredentialState.test.ts +789 -0
  504. package/src/tempo/session/client/CredentialState.ts +799 -0
  505. package/src/tempo/session/client/ReceiptCoordinator.ts +95 -0
  506. package/src/tempo/session/client/Runtime.test.ts +1092 -0
  507. package/src/tempo/session/client/Runtime.ts +986 -0
  508. package/src/tempo/session/client/Session.test.ts +774 -0
  509. package/src/tempo/session/client/Session.ts +123 -0
  510. package/src/tempo/session/client/SessionManager.test.ts +1397 -0
  511. package/src/tempo/session/client/SessionManager.ts +751 -0
  512. package/src/tempo/session/client/Transports.test.ts +837 -0
  513. package/src/tempo/session/client/Transports.ts +1292 -0
  514. package/src/tempo/session/client/index.ts +40 -0
  515. package/src/tempo/session/index.ts +7 -8
  516. package/src/tempo/session/precompile/Chain.integration.test.ts +321 -0
  517. package/src/tempo/session/precompile/Chain.test.ts +1258 -0
  518. package/src/tempo/session/precompile/Chain.ts +979 -0
  519. package/src/tempo/session/precompile/Channel.test.ts +138 -0
  520. package/src/tempo/session/precompile/Channel.ts +103 -0
  521. package/src/tempo/session/precompile/Protocol.test.ts +358 -0
  522. package/src/tempo/session/precompile/Protocol.ts +520 -0
  523. package/src/tempo/session/precompile/Voucher.test.ts +354 -0
  524. package/src/tempo/session/precompile/Voucher.ts +162 -0
  525. package/src/tempo/session/precompile/escrow.abi.ts +226 -0
  526. package/src/tempo/session/precompile/index.ts +33 -0
  527. package/src/tempo/session/server/ChannelOps.test.ts +129 -0
  528. package/src/tempo/session/server/ChannelOps.ts +157 -0
  529. package/src/tempo/session/{ChannelStore.test.ts → server/ChannelStore.test.ts} +536 -29
  530. package/src/tempo/session/server/ChannelStore.ts +835 -0
  531. package/src/tempo/session/server/CredentialVerification.test.ts +146 -0
  532. package/src/tempo/session/server/CredentialVerification.ts +710 -0
  533. package/src/tempo/session/server/MeteredStream.ts +88 -0
  534. package/src/tempo/session/server/RequestState.test.ts +531 -0
  535. package/src/tempo/session/server/RequestState.ts +499 -0
  536. package/src/tempo/session/server/Session.integration.test.ts +444 -0
  537. package/src/tempo/session/server/Session.test.ts +3253 -0
  538. package/src/tempo/session/server/Session.ts +543 -0
  539. package/src/tempo/session/server/Settlement.test.ts +329 -0
  540. package/src/tempo/session/server/Settlement.ts +471 -0
  541. package/src/tempo/session/{Sse.test.ts → server/Sse.test.ts} +37 -3
  542. package/src/tempo/session/server/Sse.ts +254 -0
  543. package/src/tempo/session/server/Transports.test.ts +346 -0
  544. package/src/tempo/session/server/Transports.ts +255 -0
  545. package/src/tempo/session/{Ws.test.ts → server/Ws.test.ts} +4 -4
  546. package/src/tempo/session/server/Ws.ts +380 -0
  547. package/src/tempo/session/server/index.ts +8 -0
  548. package/src/tempo/subscription/Store.ts +27 -9
  549. package/src/x402/Exact.e2e.test.ts +1 -1
  550. package/src/x402/PublicInterface.test-d.ts +1 -1
  551. package/src/x402/index.ts +1 -0
  552. package/dist/mcp-sdk/client/McpClient.d.ts +0 -78
  553. package/dist/mcp-sdk/client/McpClient.d.ts.map +0 -1
  554. package/dist/mcp-sdk/client/McpClient.js +0 -105
  555. package/dist/mcp-sdk/client/McpClient.js.map +0 -1
  556. package/dist/mcp-sdk/client/index.d.ts.map +0 -1
  557. package/dist/mcp-sdk/client/index.js.map +0 -1
  558. package/dist/mcp-sdk/server/Transport.d.ts.map +0 -1
  559. package/dist/mcp-sdk/server/Transport.js.map +0 -1
  560. package/dist/mcp-sdk/server/index.d.ts.map +0 -1
  561. package/dist/mcp-sdk/server/index.js.map +0 -1
  562. package/dist/tempo/client/ChannelOps.d.ts.map +0 -1
  563. package/dist/tempo/client/ChannelOps.js.map +0 -1
  564. package/dist/tempo/client/Session.d.ts.map +0 -1
  565. package/dist/tempo/client/Session.js.map +0 -1
  566. package/dist/tempo/client/SessionManager.d.ts.map +0 -1
  567. package/dist/tempo/client/SessionManager.js.map +0 -1
  568. package/dist/tempo/server/Session.d.ts.map +0 -1
  569. package/dist/tempo/server/Session.js.map +0 -1
  570. package/dist/tempo/session/Chain.d.ts.map +0 -1
  571. package/dist/tempo/session/Chain.js.map +0 -1
  572. package/dist/tempo/session/Channel.d.ts.map +0 -1
  573. package/dist/tempo/session/Channel.js.map +0 -1
  574. package/dist/tempo/session/ChannelStore.d.ts +0 -117
  575. package/dist/tempo/session/ChannelStore.d.ts.map +0 -1
  576. package/dist/tempo/session/ChannelStore.js +0 -172
  577. package/dist/tempo/session/ChannelStore.js.map +0 -1
  578. package/dist/tempo/session/Receipt.d.ts +0 -22
  579. package/dist/tempo/session/Receipt.d.ts.map +0 -1
  580. package/dist/tempo/session/Receipt.js +0 -34
  581. package/dist/tempo/session/Receipt.js.map +0 -1
  582. package/dist/tempo/session/Sse.d.ts.map +0 -1
  583. package/dist/tempo/session/Sse.js +0 -363
  584. package/dist/tempo/session/Sse.js.map +0 -1
  585. package/dist/tempo/session/Types.d.ts +0 -78
  586. package/dist/tempo/session/Types.d.ts.map +0 -1
  587. package/dist/tempo/session/Types.js.map +0 -1
  588. package/dist/tempo/session/Voucher.d.ts.map +0 -1
  589. package/dist/tempo/session/Voucher.js.map +0 -1
  590. package/dist/tempo/session/Ws.d.ts +0 -87
  591. package/dist/tempo/session/Ws.d.ts.map +0 -1
  592. package/dist/tempo/session/Ws.js +0 -443
  593. package/dist/tempo/session/Ws.js.map +0 -1
  594. package/dist/tempo/session/escrow.abi.js.map +0 -1
  595. package/src/mcp-sdk/client/McpClient.ts +0 -196
  596. package/src/tempo/session/ChannelStore.ts +0 -308
  597. package/src/tempo/session/Receipt.test.ts +0 -89
  598. package/src/tempo/session/Receipt.ts +0 -46
  599. package/src/tempo/session/Sse.ts +0 -462
  600. package/src/tempo/session/Types.ts +0 -86
  601. package/src/tempo/session/Ws.ts +0 -576
  602. /package/dist/{mcp-sdk → mcp}/client/index.d.ts +0 -0
  603. /package/dist/{mcp-sdk → mcp}/client/index.js +0 -0
  604. /package/dist/{mcp-sdk → mcp}/server/Transport.d.ts +0 -0
  605. /package/dist/{mcp-sdk → mcp}/server/Transport.js +0 -0
  606. /package/dist/{mcp-sdk → mcp}/server/index.d.ts +0 -0
  607. /package/dist/{mcp-sdk → mcp}/server/index.js +0 -0
  608. /package/dist/tempo/{session → legacy/session}/Channel.js +0 -0
  609. /package/dist/tempo/{session → legacy/session}/Types.js +0 -0
  610. /package/src/{mcp-sdk → mcp}/client/index.ts +0 -0
  611. /package/src/{mcp-sdk → mcp}/server/Transport.test.ts +0 -0
  612. /package/src/{mcp-sdk → mcp}/server/Transport.ts +0 -0
  613. /package/src/{mcp-sdk → mcp}/server/index.ts +0 -0
  614. /package/src/tempo/{session → legacy/session}/Channel.test.ts +0 -0
  615. /package/src/tempo/{session → legacy/session}/Voucher.test.ts +0 -0
  616. /package/src/tempo/session/{Sse.fuzz.test.ts → server/Sse.fuzz.test.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA"}
@@ -89,7 +89,7 @@ export declare namespace charge {
89
89
  client?: StripeJs | undefined;
90
90
  /** Called when a Stripe challenge is received. Create an SPT to retry. */
91
91
  createToken: (parameters: OnChallengeParameters) => Promise<string>;
92
- /** Optional client-side external reference ID for the credential payload. */
92
+ /** Optional fallback external reference ID. A request-bound externalId is echoed and takes precedence. */
93
93
  externalId?: string | undefined;
94
94
  /** Default payment method ID. Overridden by `context.paymentMethod`. */
95
95
  paymentMethod?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Charge.d.ts","sourceRoot":"","sources":["../../../src/stripe/client/Charge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmDnD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,UAAU,GAAG;QAChB,qGAAqG;QACrG,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;QAC7B,0EAA0E;QAC1E,WAAW,EAAE,CAAC,UAAU,EAAE,qBAAqB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;QACnE,6EAA6E;QAC7E,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC/B,wEAAwE;QACxE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KACnC,CAAA;IAED,KAAK,qBAAqB,GAAG;QAC3B,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AAC,EAAE,QAAQ,GAAG,SAAS,CAAA;QAC7B,0EAA0E;QAC1E,WAAW,EAAE,CAAC,UAAU,EAAE,qBAAqB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;QACnE,0GAA0G;QAC1G,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC/B,wEAAwE;QACxE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KACnC,CAAA;IAED,KAAK,qBAAqB,GAAG;QAC3B,kDAAkD;QAClD,MAAM,EAAE,MAAM,CAAA;QACd,SAAS,EAAE,SAAS,CAAC,SAAS,CAC5B,CAAC,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAC9C,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAC5B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAC3B,CAAA;QACD,4DAA4D;QAC5D,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;QAC7B,sCAAsC;QACtC,QAAQ,EAAE,MAAM,CAAA;QAChB,oDAAoD;QACpD,SAAS,EAAE,MAAM,CAAA;QACjB,mDAAmD;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;QAC7C,0CAA0C;QAC1C,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;QAC7B,4DAA4D;QAC5D,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KACnC,CAAA;CACF"}
@@ -49,6 +49,7 @@ export function charge(parameters) {
49
49
  }
50
50
  const amount = challenge.request.amount;
51
51
  const currency = challenge.request.currency;
52
+ const requestExternalId = typeof challenge.request.externalId === 'string' ? challenge.request.externalId : undefined;
52
53
  const networkId = challenge.request.methodDetails?.networkId;
53
54
  if (!networkId)
54
55
  throw new Error('networkId is required in challenge.methodDetails');
@@ -69,11 +70,12 @@ export function charge(parameters) {
69
70
  networkId,
70
71
  paymentMethod,
71
72
  });
73
+ const payloadExternalId = requestExternalId ?? externalId;
72
74
  return Credential.serialize({
73
75
  challenge,
74
76
  payload: {
75
77
  spt,
76
- ...(externalId ? { externalId } : {}),
78
+ ...(payloadExternalId !== undefined ? { externalId: payloadExternalId } : {}),
77
79
  },
78
80
  });
79
81
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Charge.js","sourceRoot":"","sources":["../../../src/stripe/client/Charge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,MAAM,CAAC,UAA6B;IAClD,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAA;IAE3F,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;QACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;YAChB,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACtC,CAAC;QAEF,KAAK,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE;YAC3C,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,oBAAoB,CAAA;YACpE,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;YAC/E,CAAC;YAED,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,MAAgB,CAAA;YACjD,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAkB,CAAA;YACrD,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,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C,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;gBAC1D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;YAExC,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC;gBAC5B,MAAM;gBACN,SAAS;gBACT,MAAM;gBACN,QAAQ;gBACR,SAAS;gBACT,QAAQ;gBACR,SAAS;gBACT,aAAa;aACd,CAAC,CAAA;YAEF,MAAM,iBAAiB,GAAG,iBAAiB,IAAI,UAAU,CAAA;YAEzD,OAAO,UAAU,CAAC,SAAS,CAAC;gBAC1B,SAAS;gBACT,OAAO,EAAE;oBACP,GAAG;oBACH,GAAG,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC9E;aACF,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -74,7 +74,7 @@ export declare function charge<const parameters extends charge.Parameters>(param
74
74
  recipient?: string | undefined;
75
75
  }>>;
76
76
  };
77
- }, charge.DeriveDefaults<parameters>, undefined, {}>;
77
+ }, charge.DeriveDefaults<parameters>, undefined, {}, undefined>;
78
78
  export declare namespace charge {
79
79
  type Defaults = LooseOmit<Method.RequestDefaults<typeof Methods.charge>, 'recipient'>;
80
80
  type Parameters = {
@@ -1 +1 @@
1
- {"version":3,"file":"Charge.d.ts","sourceRoot":"","sources":["../../../src/stripe/server/Charge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,SAAS,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,KAAK,UAAU,MAAM,qBAAqB,CAAA;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AA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, PaymentActionRequiredError, VerificationFailedError, } from '../../Errors.js';
2
2
  import * as Expires from '../../Expires.js';
3
3
  import * as Method from '../../Method.js';
4
4
  import { stripePreviewVersion } from '../internal/constants.js';
@@ -82,6 +82,13 @@ export function charge(parameters) {
82
82
  if (!parsed.success)
83
83
  throw new Error('Invalid credential payload: missing or malformed spt');
84
84
  const { spt, externalId: credentialExternalId } = parsed.data;
85
+ const requestExternalId = resolvedRequest.externalId;
86
+ if (requestExternalId !== undefined && credentialExternalId !== requestExternalId) {
87
+ throw new InvalidChallengeError({
88
+ id: challenge.id,
89
+ reason: 'credential externalId does not match this route request',
90
+ });
91
+ }
85
92
  const userMetadata = resolvedRequest.methodDetails?.metadata;
86
93
  const resolvedMetadata = { ...buildAnalytics({ credential }), ...userMetadata };
87
94
  const settlement = validateConnectSettlement({
@@ -119,7 +126,7 @@ export function charge(parameters) {
119
126
  status: 'success',
120
127
  timestamp: new Date().toISOString(),
121
128
  reference: pi.id,
122
- ...(credentialExternalId ? { externalId: credentialExternalId } : {}),
129
+ ...(requestExternalId !== undefined ? { externalId: requestExternalId } : {}),
123
130
  };
124
131
  },
125
132
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Charge.js","sourceRoot":"","sources":["../../../src/stripe/server/Charge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACrF,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAE3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAGzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAO/D,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,MAAM,CAA6C,UAAsB;IACvF,MAAM,EACJ,MAAM,EACN,QAAQ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AA;AAC9F,CAAC;AAED,SAAS,cAAc,CAAC,KAAyB,EAAE,aAAqB,EAAE,IAAY;IACpF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAM;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAC3C,MAAM,IAAI,uBAAuB,CAAC;YAChC,MAAM,EAAE,kBAAkB,IAAI,kCAAkC;SACjE,CAAC,CAAA;IACJ,IAAI,KAAK,GAAG,aAAa;QACvB,MAAM,IAAI,uBAAuB,CAAC;YAChC,MAAM,EAAE,kBAAkB,IAAI,0DAA0D;SACzF,CAAC,CAAA;AACN,CAAC"}
@@ -54,7 +54,7 @@ export declare function stripe<const parameters extends stripe.Parameters>(param
54
54
  recipient?: string | undefined;
55
55
  }>>;
56
56
  };
57
- }, charge_.DeriveDefaults<parameters>, undefined, {}>];
57
+ }, charge_.DeriveDefaults<parameters>, undefined, {}, undefined>];
58
58
  export declare namespace stripe {
59
59
  type Parameters = charge_.Parameters;
60
60
  /** Creates a Stripe `charge` method for SPT-based payments. */
@@ -1 +1 @@
1
- {"version":3,"file":"Methods.d.ts","sourceRoot":"","sources":["../../../src/stripe/server/Methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,CAAC,UAAU,SAAS,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAExF;AAED,yBAAiB,MAAM,CAAC;IACtB,KAAY,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;IAE3C,+DAA+D;IACxD,MAAM,MAAM,gBAAU,CAAA;CAC9B"}
1
+ {"version":3,"file":"Methods.d.ts","sourceRoot":"","sources":["../../../src/stripe/server/Methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,CAAC,UAAU,SAAS,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAExF;AAED,yBAAiB,MAAM,CAAC;IACtB,KAAY,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;IAE3C,+DAA+D;IACxD,MAAM,MAAM,gBAAU,CAAA;CAC9B"}
@@ -1,2 +1,2 @@
1
- export declare const html = "<script>(function(){var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=t((e=>{Object.defineProperty(e,\"__esModule\",{value:!0});function t(e){\"@babel/helpers - typeof\";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}var n=`dahlia`,r=function(e){return e===3?`v3`:e},i=`https://js.stripe.com`,a=`${i}/${n}/stripe.js`,o=/^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/,s=/^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/,c=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,l=function(e){return o.test(e)||s.test(e)},u=function(){for(var e=document.querySelectorAll(`script[src^=\"${i}\"]`),t=0;t<e.length;t++){var n=e[t];if(l(n.src))return n}return null},d=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=`${a}${t}`;var r=document.head||document.body;if(!r)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return r.appendChild(n),n},ee=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:`stripe-js`,version:`9.7.0`,startTime:t})},f=null,p=null,m=null,h=function(e){return function(t){e(Error(`Failed to load Stripe.js`,{cause:t}))}},g=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},te=function(e){return f===null?(f=new Promise(function(t,n){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(c),window.Stripe){t(window.Stripe);return}try{var r=u();if(r&&e)console.warn(c);else if(!r)r=d(e);else if(r&&m!==null&&p!==null){var i;r.removeEventListener(`load`,m),r.removeEventListener(`error`,p),(i=r.parentNode)==null||i.removeChild(r),r=d(e)}m=g(t,n),p=h(n),r.addEventListener(`load`,m),r.addEventListener(`error`,p)}catch(e){n(e);return}}),f.catch(function(e){return f=null,Promise.reject(e)})):f},ne=function(e,i,a){if(e===null)return null;var o=i[0];if(typeof o!=`string`)throw Error(`Expected publishable key to be of type string, got type ${t(o)} instead.`);var s=o.match(/^pk_test/),c=r(e.version),l=n;s&&c!==l&&console.warn(`Stripe.js@${c} was loaded on the page, but @stripe/stripe-js@9.7.0 expected Stripe.js@${l}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);var u=e.apply(void 0,i);return ee(u,a),u},_=function(e){var n=`invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ${JSON.stringify(e)}\n`;if(e===null||t(e)!==`object`)throw Error(n);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals==`boolean`)return e;throw Error(n)},v,y=!1,b=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];y=!0;var r=Date.now();return te(v).then(function(e){return ne(e,t,r)})};b.setLoadParameters=function(e){if(y&&v){var t=_(e);if(Object.keys(t).reduce(function(t,n){return t&&e[n]===v?.[n]},!0))return}if(y)throw Error(`You cannot change load parameters after calling loadStripe`);v=_(e)},e.loadStripe=b})),r=t(((e,t)=>{t.exports=n()})),i,a=e((()=>{i=`0.1.1`}));function o(){return i}var s=e((()=>{a()}));function c(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause?c(e.cause,t):t?null:e}var l,u=e((()=>{s(),l=class e extends Error{static setStaticOptions(t){e.prototype.docsOrigin=t.docsOrigin,e.prototype.showVersion=t.showVersion,e.prototype.version=t.version}constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&`details`in n.cause&&typeof n.cause.details==`string`?n.cause.details:n.cause?.message?n.cause.message:n.details})(),i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=n.docsOrigin??e.prototype.docsOrigin,o=`${a}${i??``}`,s=!!(n.version??e.prototype.showVersion),c=n.version??e.prototype.version,l=[t||`An error occurred.`,...n.metaMessages?[``,...n.metaMessages]:[],...r||i||s?[``,r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(e=>typeof e==`string`).join(`\n`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docs\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsOrigin\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"showVersion\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"cause\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsOrigin=a,this.docsPath=i,this.shortMessage=t,this.showVersion=s,this.version=c}walk(e){return c(this,e)}},Object.defineProperty(l,\"defaultStaticOptions\",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:`https://oxlib.sh`,showVersion:!1,version:`ox@${o()}`}}),l.setStaticOptions(l.defaultStaticOptions)}));function d(e,t){if(_(e)>t)throw new y({givenSize:_(e),maxSize:t})}function ee(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new b({size:e.length,targetSize:r,type:`Bytes`});let i=new Uint8Array(r);for(let t=0;t<r;t++){let a=n===`right`;i[a?t:r-t-1]=e[a?t:e.length-t-1]}return i}var f=e((()=>{re()}));function p(e){if(e===null||typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`Cannot canonicalize non-finite number`);return Object.is(e,-0)?`0`:JSON.stringify(e)}if(typeof e==`bigint`)throw TypeError(`Cannot canonicalize bigint`);if(Array.isArray(e))return`[${e.map(e=>p(e)).join(`,`)}]`;if(typeof e==`object`)return`{${Object.keys(e).sort().reduce((t,n)=>{let r=e[n];return r!==void 0&&t.push(`${JSON.stringify(n)}:${p(r)}`),t},[]).join(`,`)}}`}function m(e,t){return JSON.parse(e,(e,n)=>{let r=n;return typeof r==`string`&&r.endsWith(h)?BigInt(r.slice(0,-9)):typeof t==`function`?t(e,r):r})}var h,g=e((()=>{h=`#__bigint`}));function te(e,t={}){let{size:n}=t,r=v.encode(e);return typeof n==`number`?(d(r,n),ne(r,n)):r}function ne(e,t){return ee(e,{dir:`right`,size:t})}function _(e){return e.length}var v,y,b,re=e((()=>{u(),f(),g(),v=new TextEncoder,y=class extends l{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \\`${t}\\` bytes. Given size: \\`${e}\\` bytes.`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeOverflowError`})}},b=class extends l{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\\`${e}\\`) exceeds padding size (\\`${t}\\`).`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeExceedsPaddingSizeError`})}}}));re();let ie=new TextDecoder,x=Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[t,e.charCodeAt(0)]));({...Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[e.charCodeAt(0),t]))});function ae(e,t={}){let{pad:n=!0,url:r=!1}=t,i=new Uint8Array(Math.ceil(e.length/3)*4);for(let t=0,n=0;n<e.length;t+=4,n+=3){let r=(e[n]<<16)+(e[n+1]<<8)+(e[n+2]|0);i[t]=x[r>>18],i[t+1]=x[r>>12&63],i[t+2]=x[r>>6&63],i[t+3]=x[r&63]}let a=e.length%3,o=Math.floor(e.length/3)*4+(a&&a+1),s=ie.decode(new Uint8Array(i.buffer,0,o));return n&&a===1&&(s+=`==`),n&&a===2&&(s+=`=`),r&&(s=s.replaceAll(`+`,`-`).replaceAll(`/`,`_`)),s}function oe(e,t={}){return ae(te(e),t)}g();function S(e){return oe(p(e),{pad:!1,url:!0})}var se;function C(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,\"_zod\",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}var w=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(se=globalThis).__zod_globalConfig??(se.__zod_globalConfig={});let le=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(le,e),le}function ue(e,t){return typeof t==`bigint`?t.toString():t}function de(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}throw Error(`cached value already set`)}}}function fe(e){return e==null}function pe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}let E=Symbol(`evaluating`);function D(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E)return r===void 0&&(r=E,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}let me=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function O(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function he(e){if(O(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(O(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ge(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function k(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function _e(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function A(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ve(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function j(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function M(e){return typeof e==`string`?e:e?.message}function N(e,t,n){let r=e.message?e.message:M(e.inst?._zod.def?.error?.(e))??M(t?.error?.(e))??M(n.customError?.(e))??M(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ye(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}let be=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ue,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},xe=C(`$ZodError`,be),P=C(`$ZodError`,be,{Parent:Error}),Se=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new w;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>N(e,a,T())));throw me(t,i?.callee),t}return o.value})(P),Ce=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>N(e,a,T())));throw me(t,i?.callee),t}return o.value})(P),we=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new w;return a.issues.length?{success:!1,error:new(e??xe)(a.issues.map(e=>N(e,i,T())))}:{success:!0,data:a.value}})(P),F=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>N(e,i,T())))}:{success:!0,data:a.value}})(P),Te=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},I=/^-?\\d+(?:\\.\\d+)?$/,L=C(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ee=C(`$ZodCheckMinLength`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!fe(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ye(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),De=C(`$ZodCheckStringFormat`,(e,t)=>{var n,r;L.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Oe=C(`$ZodCheckRegex`,(e,t)=>{De.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ke={major:4,minor:4,patch:3},R=C(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ke;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=A(e),i;for(let a of t){if(a._zod.def.when){if(ve(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new w;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=A(e,t))});else{if(e.issues.length===t)continue;r||=A(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(A(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new w;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new w;return o.then(e=>t(e,r,a))}return t(o,r,a)}}D(e,`~standard`,()=>({validate:t=>{try{let n=we(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return F(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ae=C(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Te(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),je=C(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??I,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}});function z(e,t,n){e.issues.length&&t.issues.push(...j(n,e.issues)),t.value[n]=e.value}let Me=C(`$ZodArray`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>z(t,n,e))):z(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...j(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Ne(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=_e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Pe(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t,u,d))):B(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}let Fe=C(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let n={...e};return Object.defineProperty(t,\"shape\",{value:n}),n}})}let n=de(()=>Ne(t));D(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=O,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>B(n,t,e,s,r,i))):B(a,t,e,s,r,i)}return i?Pe(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Ie=C(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!he(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>N(e,r,T())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...j(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...j(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&I.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>N(e,r,T())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...j(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...j(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Le=C(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ce(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new w;return n.value=i,n.fallback=!0,n}});function V(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let Re=C(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${pe(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>V(e,r)):V(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ze=C(`$ZodPipe`,(e,t)=>{R.init(e,t),D(e._zod,`values`,()=>t.in._zod.values),D(e._zod,`optin`,()=>t.in._zod.optin),D(e._zod,`optout`,()=>t.out._zod.optout),D(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.in,n)):H(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.out,n)):H(r,t.out,n)}});function H(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function Be(e,t){return new e({type:`string`,...k(t)})}function Ve(e,t){return new e({type:`number`,checks:[],...k(t)})}function He(e,t){return new Ee({check:`min_length`,...k(t),minimum:e})}function Ue(e,t){return new Oe({check:`string_format`,format:`regex`,...k(t),pattern:e})}let U=C(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);R.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>Se(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>we(e,t,n),e.parseAsync=async(t,n)=>Ce(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>F(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>ge(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),We=C(`ZodMiniString`,(e,t)=>{Ae.init(e,t),U.init(e,t)});function W(e){return Be(We,e)}let Ge=C(`ZodMiniNumber`,(e,t)=>{je.init(e,t),U.init(e,t)});function Ke(e){return Ve(Ge,e)}let qe=C(`ZodMiniArray`,(e,t)=>{Me.init(e,t),U.init(e,t)});function Je(e,t){return new qe({type:`array`,element:e,...k(t)})}let Ye=C(`ZodMiniObject`,(e,t)=>{Fe.init(e,t),U.init(e,t),D(e,`shape`,()=>t.shape)});function G(e,t){return new Ye({type:`object`,shape:e??{},...k(t)})}let Xe=C(`ZodMiniRecord`,(e,t)=>{Ie.init(e,t),U.init(e,t)});function Ze(e,t,n){return!t||!t._zod?new Xe({type:`record`,keyType:W(),valueType:e,...k(t)}):new Xe({type:`record`,keyType:e,valueType:t,...k(n)})}let Qe=C(`ZodMiniTransform`,(e,t)=>{Le.init(e,t),U.init(e,t)});function $e(e){return new Qe({type:`transform`,transform:e})}let et=C(`ZodMiniOptional`,(e,t)=>{Re.init(e,t),U.init(e,t)});function K(e){return new et({type:`optional`,innerType:e})}let tt=C(`ZodMiniPipe`,(e,t)=>{ze.init(e,t),U.init(e,t)});function nt(e,t){return new tt({type:`pipe`,in:e,out:t})}function rt(){return W().check(Ue(/^\\d+(\\.\\d+)?$/,`Invalid amount`))}function it(e){let{meta:t,opaque:n,request:r,...i}=e.challenge,a=n??(t===void 0?void 0:S(t)),o={challenge:{...i,...a!==void 0&&{opaque:a},request:S(r)},payload:e.payload,...e.source&&{source:e.source}};return`Payment ${oe(JSON.stringify(o),{pad:!1,url:!0})}`}var q,at=e((()=>{q=`2.51.3`}));function ot(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause!==void 0?ot(e.cause,t):t?null:e}var J,st;e((()=>{at(),J={getDocsUrl:({docsBaseUrl:e,docsPath:t=``,docsSlug:n})=>t?`${e??`https://viem.sh`}${t}${n?`#${n}`:``}`:void 0,version:`viem@${q}`},st=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=J.getDocsUrl?.({...n,docsPath:i}),o=[t||`An error occurred.`,``,...n.metaMessages?[...n.metaMessages,``]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...J.version?[`Version: ${J.version}`]:[]].join(`\n`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"metaMessages\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=q}walk(e){return ot(this,e)}}}))();var ct=class extends st{constructor({value:e}){super(`Number \\`${e}\\` is not a valid decimal number.`,{name:`InvalidDecimalNumberError`})}};function lt(e,t){if(!/^(-?)([0-9]*)\\.?([0-9]*)$/.test(e))throw new ct({value:e});let[n,r=`0`]=e.split(`.`),i=n.startsWith(`-`);if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,``),t===0)Math.round(Number(`.${r}`))===1&&(n=`${BigInt(n)+1n}`),r=``;else if(r.length>t){let[e,i,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],o=Math.round(Number(`${i}.${a}`));r=o>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,`0`):`${e}${o}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,`0`);return BigInt(`${i?`-`:``}${n}${r}`)}function ut(e){return e}function dt(e,t){let{context:n,createCredential:r}=t;return{...e,context:n,createCredential:r}}let ft=ut({name:`stripe`,intent:`charge`,schema:{credential:{payload:G({externalId:K(W()),spt:W()})},request:nt(G({amount:rt(),currency:W(),decimals:Ke(),description:K(W()),externalId:K(W()),metadata:K(Ze(W(),W())),networkId:W(),paymentMethodTypes:Je(W()).check(He(1)),recipient:K(W())}),$e(({amount:e,decimals:t,metadata:n,networkId:r,paymentMethodTypes:i,...a})=>({...a,amount:lt(e,t).toString(),methodDetails:{networkId:r,paymentMethodTypes:i,...n!==void 0&&{metadata:n}}})))}});function pt(e){let{client:t,createToken:n,externalId:r,paymentMethod:i}=e;return dt(ft,{context:G({paymentMethod:K(W())}),async createCredential({challenge:e,context:a}){let o=a?.paymentMethod??i;if(!o)throw Error(`paymentMethod is required (pass via context or parameters)`);let s=e.request.amount,c=e.request.currency,l=e.request.methodDetails?.networkId;if(!l)throw Error(`networkId is required in challenge.methodDetails`);let u=e.request.methodDetails?.metadata;if(u?.externalId)throw Error(`methodDetails.metadata.externalId is reserved; use credential externalId instead`);return it({challenge:e,payload:{spt:await n({amount:s,challenge:e,client:t,currency:c,expiresAt:e.expires?Math.floor(new Date(e.expires).getTime()/1e3):Math.floor(Date.now()/1e3)+3600,metadata:u,networkId:l,paymentMethod:o}),...r?{externalId:r}:{}}})}})}function mt(e){return[pt(e)]}(function(e){e.charge=pt})(mt||={});var ht=r();let Y={data:`__MPPX_DATA__`,error:`root_error`,root:`root`},gt={serviceWorker:`__mppx_worker`,tab:`__mppx_tab`},X={challengeId:`data-mppx-challenge-id`,remaining:`data-remaining`};var Z=class{name;constructor(e){this.name=`--mppx-${e}`}toString(){return`var(${this.name})`}};let _t={accent:new Z(`accent`),background:new Z(`background`),border:new Z(`border`),foreground:new Z(`foreground`),muted:new Z(`muted`),negative:new Z(`negative`),positive:new Z(`positive`),surface:new Z(`surface`),fontFamily:new Z(`font-family`),fontSizeBase:new Z(`font-size-base`),radius:new Z(`radius`),spacingUnit:new Z(`spacing-unit`)};String.raw`<style>\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n border-color: ${_t.border};\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n -webkit-tap-highlight-color: transparent;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\n monospace;\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type='button'], [type='reset'], [type='submit']),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n }\n</style>`;function vt(e,t){if(t==null)return e;if(!Q(e)||!Q(t))return t??e;let n={...e};for(let[e,r]of Object.entries(t)){if(r==null||r===``)continue;let t=n[e];n[e]=Q(t)&&Q(r)?vt(t,r):r}return n}function Q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function yt(e){let t=new URL(location.href);t.searchParams.set(gt.serviceWorker,``);let n=await navigator.serviceWorker.register(t.pathname+t.search),r=await new Promise(e=>{let t=n.installing??n.waiting??n.active;if(t?.state===`activated`)return e(t);let r=t??n;r.addEventListener(`statechange`,function t(){let i=n.active;i?.state===`activated`&&(r.removeEventListener(`statechange`,t),e(i))})});await new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>t(),r.postMessage({credential:e},[n.port2])}),location.reload()}g();function bt(e){let t=document.getElementById(Y.data),n=m(t.textContent),r=t.getAttribute(X.remaining);!r||Number(r)<=1?t.remove():t.setAttribute(X.remaining,String(Number(r)-1));let i=document.currentScript,a=i?.getAttribute(X.challengeId),o=a?(i.removeAttribute(X.challengeId),n[a]):Object.values(n).find(t=>t.challenge.method===e);return{...o,error(e){if(!e){document.getElementById(Y.error)?.remove();return}let t=document.getElementById(Y.error);if(t){t.textContent=e;return}let n=document.createElement(`p`);n.id=Y.error,n.className=`mppx-error`,n.role=`alert`,n.textContent=e,document.getElementById(o.rootId)?.after(n)},root:document.getElementById(o.rootId),submit:yt,vars:_t}}let $=bt(`stripe`),xt=String.raw,St=document.createElement(`style`);St.textContent=xt`\n form {\n display: flex;\n flex-direction: column;\n gap: calc(${$.vars.spacingUnit} * 8);\n }\n button {\n background: ${$.vars.accent};\n border-radius: ${$.vars.radius};\n color: ${$.vars.background};\n cursor: pointer;\n font-weight: 500;\n padding: calc(${$.vars.spacingUnit} * 4) calc(${$.vars.spacingUnit} * 8);\n width: 100%;\n }\n button:hover:not(:disabled) {\n opacity: 0.85;\n }\n button:disabled {\n cursor: default;\n opacity: 0.5;\n }\n`,$.root.append(St),(async()=>{let e=await(0,ht.loadStripe)($.config.publishableKey);if(!e)throw Error(`Failed to loadStripe`);let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=(()=>{if($.config.elements?.options?.appearance?.theme)return $.config.elements?.options?.appearance?.theme;switch($.theme.colorScheme){case`light dark`:return t.matches?`night`:`stripe`;case`light`:return`stripe`;case`dark`:return`night`}})(),n=+!!t.matches;return vt({disableAnimations:!0,theme:e,variables:{borderRadius:$.theme.radius,colorBackground:$.theme.surface[n],colorDanger:$.theme.negative[n],colorPrimary:$.theme.accent[n],colorText:$.theme.foreground[n],colorTextSecondary:$.theme.muted[n],fontSizeBase:$.theme.fontSizeBase,fontFamily:$.theme.fontFamily,spacingUnit:$.theme.spacingUnit}},$.config.elements?.options?.appearance??{})},r=e.elements({appearance:n(),...$.config.elements?.options,amount:Number($.challenge.request.amount),currency:$.challenge.request.currency,mode:`payment`,paymentMethodCreation:`manual`,paymentMethodTypes:$.challenge.request.methodDetails.paymentMethodTypes});t.addEventListener(`change`,()=>{r.update({appearance:n()})});let i=document.createElement(`form`);r.create(`payment`,$.config.elements?.paymentOptions).mount(i),$.root.appendChild(i);let a=document.createElement(`button`);a.textContent=$.text.pay,a.type=`submit`,i.appendChild(a),i.onsubmit=async t=>{t.preventDefault(),$.error(),a.disabled=!0;try{await r.submit();let{paymentMethod:t,error:n}=await e.createPaymentMethod({...$.config.elements?.createPaymentMethodOptions,elements:r});if(n||!t)throw n??Error(`Failed to create payment method`);let i=await mt({client:e,createToken:Ct})[0].createCredential({challenge:$.challenge,context:{paymentMethod:t.id}});await $.submit(i)}catch(e){$.error(e instanceof Error?e.message:`Payment failed`)}finally{a.disabled=!1}}})();async function Ct(e){let t=new URL($.config.createTokenUrl,location.origin);if(t.origin!==location.origin)throw Error(`createTokenUrl must be same-origin`);let n=await fetch(t,{method:`POST`,headers:{\"Content-Type\":`application/json`},body:JSON.stringify(e)});if(!n.ok){let e=await n.text().catch(()=>`<response body unavailable>`);throw Error(`Failed to create SPT (${n.status}): ${e}`)}return(await n.json()).spt}})();</script>";
1
+ export declare const html = "<script>(function(){var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),t=e((e=>{Object.defineProperty(e,\"__esModule\",{value:!0});function t(e){\"@babel/helpers - typeof\";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}var n=`dahlia`,r=function(e){return e===3?`v3`:e},i=`https://js.stripe.com`,a=`${i}/${n}/stripe.js`,o=/^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/,s=/^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/,c=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,l=function(e){return o.test(e)||s.test(e)},u=function(){for(var e=document.querySelectorAll(`script[src^=\"${i}\"]`),t=0;t<e.length;t++){var n=e[t];if(l(n.src))return n}return null},d=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=`${a}${t}`;var r=document.head||document.body;if(!r)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return r.appendChild(n),n},f=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:`stripe-js`,version:`9.8.0`,startTime:t})},p=null,m=null,h=null,ee=function(e){return function(t){e(Error(`Failed to load Stripe.js`,{cause:t}))}},g=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},_=function(e){return p===null?(p=new Promise(function(t,n){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(c),window.Stripe){t(window.Stripe);return}try{var r=u();if(r&&e)console.warn(c);else if(!r)r=d(e);else if(r&&h!==null&&m!==null){var i;r.removeEventListener(`load`,h),r.removeEventListener(`error`,m),(i=r.parentNode)==null||i.removeChild(r),r=d(e)}h=g(t,n),m=ee(n),r.addEventListener(`load`,h),r.addEventListener(`error`,m)}catch(e){n(e);return}}),p.catch(function(e){return p=null,Promise.reject(e)})):p},v=function(e,i,a){if(e===null)return null;var o=i[0];if(typeof o!=`string`)throw Error(`Expected publishable key to be of type string, got type ${t(o)} instead.`);var s=o.match(/^pk_test/),c=r(e.version),l=n;s&&c!==l&&console.warn(`Stripe.js@${c} was loaded on the page, but @stripe/stripe-js@9.8.0 expected Stripe.js@${l}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);var u=e.apply(void 0,i);return f(u,a),u},y=function(e){var n=`invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ${JSON.stringify(e)}\n`;if(e===null||t(e)!==`object`)throw Error(n);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals==`boolean`)return e;throw Error(n)},b,x=!1,S=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];x=!0;var r=Date.now();return _(b).then(function(e){return v(e,t,r)})};S.setLoadParameters=function(e){if(x&&b){var t=y(e);if(Object.keys(t).reduce(function(t,n){return t&&e[n]===b?.[n]},!0))return}if(x)throw Error(`You cannot change load parameters after calling loadStripe`);b=y(e)},e.loadStripe=S})),n=e(((e,n)=>{n.exports=t()}));function r(){return`0.1.1`}var i=class e extends Error{static setStaticOptions(t){e.prototype.docsOrigin=t.docsOrigin,e.prototype.showVersion=t.showVersion,e.prototype.version=t.version}constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&`details`in n.cause&&typeof n.cause.details==`string`?n.cause.details:n.cause?.message?n.cause.message:n.details})(),i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=n.docsOrigin??e.prototype.docsOrigin,o=`${a}${i??``}`,s=!!(n.version??e.prototype.showVersion),c=n.version??e.prototype.version,l=[t||`An error occurred.`,...n.metaMessages?[``,...n.metaMessages]:[],...r||i||s?[``,r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(e=>typeof e==`string`).join(`\n`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docs\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsOrigin\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"showVersion\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"cause\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsOrigin=a,this.docsPath=i,this.shortMessage=t,this.showVersion=s,this.version=c}walk(e){return a(this,e)}};Object.defineProperty(i,\"defaultStaticOptions\",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:`https://oxlib.sh`,showVersion:!1,version:`ox@${r()}`}}),i.setStaticOptions(i.defaultStaticOptions);function a(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause?a(e.cause,t):t?null:e}function o(e,t){if(p(e)>t)throw new m({givenSize:p(e),maxSize:t})}function s(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new h({size:e.length,targetSize:r,type:`Bytes`});let i=new Uint8Array(r);for(let t=0;t<r;t++){let a=n===`right`;i[a?t:r-t-1]=e[a?t:e.length-t-1]}return i}function c(e){if(e===null||typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`Cannot canonicalize non-finite number`);return Object.is(e,-0)?`0`:JSON.stringify(e)}if(typeof e==`bigint`)throw TypeError(`Cannot canonicalize bigint`);if(Array.isArray(e))return`[${e.map(e=>c(e)).join(`,`)}]`;if(typeof e==`object`)return`{${Object.keys(e).sort().reduce((t,n)=>{let r=e[n];return r!==void 0&&t.push(`${JSON.stringify(n)}:${c(r)}`),t},[]).join(`,`)}}`}function l(e,t){return JSON.parse(e,(e,n)=>{let r=n;return typeof r==`string`&&r.endsWith(`#__bigint`)?BigInt(r.slice(0,-9)):typeof t==`function`?t(e,r):r})}let u=new TextEncoder;function d(e,t={}){let{size:n}=t,r=u.encode(e);return typeof n==`number`?(o(r,n),f(r,n)):r}function f(e,t){return s(e,{dir:`right`,size:t})}function p(e){return e.length}var m=class extends i{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \\`${t}\\` bytes. Given size: \\`${e}\\` bytes.`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeOverflowError`})}},h=class extends i{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\\`${e}\\`) exceeds padding size (\\`${t}\\`).`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeExceedsPaddingSizeError`})}};let ee=new TextDecoder,g=Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[t,e.charCodeAt(0)]));({...Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[e.charCodeAt(0),t]))});function _(e,t={}){let{pad:n=!0,url:r=!1}=t,i=new Uint8Array(Math.ceil(e.length/3)*4);for(let t=0,n=0;n<e.length;t+=4,n+=3){let r=(e[n]<<16)+(e[n+1]<<8)+(e[n+2]|0);i[t]=g[r>>18],i[t+1]=g[r>>12&63],i[t+2]=g[r>>6&63],i[t+3]=g[r&63]}let a=e.length%3,o=Math.floor(e.length/3)*4+(a&&a+1),s=ee.decode(new Uint8Array(i.buffer,0,o));return n&&a===1&&(s+=`==`),n&&a===2&&(s+=`=`),r&&(s=s.replaceAll(`+`,`-`).replaceAll(`/`,`_`)),s}function v(e,t={}){return _(d(e),t)}let y={payment:`Payment`};function b(e){return v(c(e),{pad:!1,url:!0})}var x;function S(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,\"_zod\",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}var C=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},te=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(x=globalThis).__zod_globalConfig??(x.__zod_globalConfig={});let w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function ne(e,t){return typeof t==`bigint`?t.toString():t}function re(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}throw Error(`cached value already set`)}}}function ie(e){return e==null}function ae(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}let E=Symbol(`evaluating`);function D(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E)return r===void 0&&(r=E,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}let O=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function oe(e){if(k(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(k(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function se(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function A(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function j(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function le(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function M(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function N(e){return typeof e==`string`?e:e?.message}function P(e,t,n){let r=e.message?e.message:N(e.inst?._zod.def?.error?.(e))??N(t?.error?.(e))??N(n.customError?.(e))??N(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ue(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}let de=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ne,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},fe=S(`$ZodError`,de),F=S(`$ZodError`,de,{Parent:Error}),pe=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new C;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>P(e,a,T())));throw O(t,i?.callee),t}return o.value})(F),me=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>P(e,a,T())));throw O(t,i?.callee),t}return o.value})(F),he=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new C;return a.issues.length?{success:!1,error:new(e??fe)(a.issues.map(e=>P(e,i,T())))}:{success:!0,data:a.value}})(F),ge=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>P(e,i,T())))}:{success:!0,data:a.value}})(F),_e=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},ve=/^-?\\d+(?:\\.\\d+)?$/,I=S(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ye=S(`$ZodCheckMinLength`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ue(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),be=S(`$ZodCheckStringFormat`,(e,t)=>{var n,r;I.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),xe=S(`$ZodCheckRegex`,(e,t)=>{be.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Se={major:4,minor:4,patch:3},L=S(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Se;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=j(e),i;for(let a of t){if(a._zod.def.when){if(le(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new C;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=j(e,t))});else{if(e.issues.length===t)continue;r||=j(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(j(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new C;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new C;return o.then(e=>t(e,r,a))}return t(o,r,a)}}D(e,`~standard`,()=>({validate:t=>{try{let n=he(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ge(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ce=S(`$ZodString`,(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_e(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),we=S(`$ZodNumber`,(e,t)=>{L.init(e,t),e._zod.pattern=e._zod.bag.pattern??ve,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}});function R(e,t,n){e.issues.length&&t.issues.push(...M(n,e.issues)),t.value[n]=e.value}let Te=S(`$ZodArray`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>R(t,n,e))):R(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function z(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...M(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Ee(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=ce(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function De(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>z(e,n,i,t,u,d))):z(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}let Oe=S(`$ZodObject`,(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let n={...e};return Object.defineProperty(t,\"shape\",{value:n}),n}})}let n=re(()=>Ee(t));D(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=k,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>z(n,t,e,s,r,i))):z(a,t,e,s,r,i)}return i?De(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ke=S(`$ZodRecord`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!oe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>P(e,r,T())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...M(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...M(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ve.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>P(e,r,T())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...M(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...M(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ae=S(`$ZodTransform`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new te(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new C;return n.value=i,n.fallback=!0,n}});function B(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let je=S(`$ZodOptional`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ae(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>B(e,r)):B(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Me=S(`$ZodPipe`,(e,t)=>{L.init(e,t),D(e._zod,`values`,()=>t.in._zod.values),D(e._zod,`optin`,()=>t.in._zod.optin),D(e._zod,`optout`,()=>t.out._zod.optout),D(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.in,n)):V(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.out,n)):V(r,t.out,n)}});function V(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function Ne(e,t){return new e({type:`string`,...A(t)})}function Pe(e,t){return new e({type:`number`,checks:[],...A(t)})}function Fe(e,t){return new ye({check:`min_length`,...A(t),minimum:e})}function Ie(e,t){return new xe({check:`string_format`,format:`regex`,...A(t),pattern:e})}let H=S(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);L.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>pe(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>he(e,t,n),e.parseAsync=async(t,n)=>me(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ge(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>se(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),Le=S(`ZodMiniString`,(e,t)=>{Ce.init(e,t),H.init(e,t)});function U(e){return Ne(Le,e)}let Re=S(`ZodMiniNumber`,(e,t)=>{we.init(e,t),H.init(e,t)});function ze(e){return Pe(Re,e)}let Be=S(`ZodMiniArray`,(e,t)=>{Te.init(e,t),H.init(e,t)});function Ve(e,t){return new Be({type:`array`,element:e,...A(t)})}let He=S(`ZodMiniObject`,(e,t)=>{Oe.init(e,t),H.init(e,t),D(e,`shape`,()=>t.shape)});function W(e,t){return new He({type:`object`,shape:e??{},...A(t)})}let G=S(`ZodMiniRecord`,(e,t)=>{ke.init(e,t),H.init(e,t)});function Ue(e,t,n){return!t||!t._zod?new G({type:`record`,keyType:U(),valueType:e,...A(t)}):new G({type:`record`,keyType:e,valueType:t,...A(n)})}let We=S(`ZodMiniTransform`,(e,t)=>{Ae.init(e,t),H.init(e,t)});function Ge(e){return new We({type:`transform`,transform:e})}let Ke=S(`ZodMiniOptional`,(e,t)=>{je.init(e,t),H.init(e,t)});function K(e){return new Ke({type:`optional`,innerType:e})}let qe=S(`ZodMiniPipe`,(e,t)=>{Me.init(e,t),H.init(e,t)});function Je(e,t){return new qe({type:`pipe`,in:e,out:t})}function Ye(){return U().check(Ie(/^\\d+(\\.\\d+)?$/,`Invalid amount`))}function Xe(e){let{meta:t,opaque:n,request:r,...i}=e.challenge,a=n??(t===void 0?void 0:b(t)),o={challenge:{...i,...a!==void 0&&{opaque:a},request:b(r)},payload:e.payload,...e.source&&{source:e.source}},s=v(JSON.stringify(o),{pad:!1,url:!0});return`${y.payment} ${s}`}function Ze(e){return e}function Qe(e,t){let{canHandleChallenge:n,context:r,createCredential:i}=t;return{...e,canHandleChallenge:n,context:r,createCredential:i}}let q=`2.52.2`,J={getDocsUrl:({docsBaseUrl:e,docsPath:t=``,docsSlug:n})=>t?`${e??`https://viem.sh`}${t}${n?`#${n}`:``}`:void 0,version:`viem@${q}`};var $e=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=J.getDocsUrl?.({...n,docsPath:i}),o=[t||`An error occurred.`,``,...n.metaMessages?[...n.metaMessages,``]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...J.version?[`Version: ${J.version}`]:[]].join(`\n`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"metaMessages\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=q}walk(e){return et(this,e)}};function et(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause!==void 0?et(e.cause,t):t?null:e}var tt=class extends $e{constructor({value:e}){super(`Number \\`${e}\\` is not a valid decimal number.`,{name:`InvalidDecimalNumberError`})}};function nt(e,t){if(!/^(-?)([0-9]*)\\.?([0-9]*)$/.test(e))throw new tt({value:e});let[n,r=`0`]=e.split(`.`),i=n.startsWith(`-`);if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,``),t===0)Math.round(Number(`.${r}`))===1&&(n=`${BigInt(n)+1n}`),r=``;else if(r.length>t){let[e,i,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],o=Math.round(Number(`${i}.${a}`));r=o>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,`0`):`${e}${o}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,`0`);return BigInt(`${i?`-`:``}${n}${r}`)}let rt=Ze({name:`stripe`,intent:`charge`,schema:{credential:{payload:W({externalId:K(U()),spt:U()})},request:Je(W({amount:Ye(),currency:U(),decimals:ze(),description:K(U()),externalId:K(U()),metadata:K(Ue(U(),U())),networkId:U(),paymentMethodTypes:Ve(U()).check(Fe(1)),recipient:K(U())}),Ge(({amount:e,decimals:t,metadata:n,networkId:r,paymentMethodTypes:i,...a})=>({...a,amount:nt(e,t).toString(),methodDetails:{networkId:r,paymentMethodTypes:i,...n!==void 0&&{metadata:n}}})))}});function it(e){let{client:t,createToken:n,externalId:r,paymentMethod:i}=e;return Qe(rt,{context:W({paymentMethod:K(U())}),async createCredential({challenge:e,context:a}){let o=a?.paymentMethod??i;if(!o)throw Error(`paymentMethod is required (pass via context or parameters)`);let s=e.request.amount,c=e.request.currency,l=typeof e.request.externalId==`string`?e.request.externalId:void 0,u=e.request.methodDetails?.networkId;if(!u)throw Error(`networkId is required in challenge.methodDetails`);let d=e.request.methodDetails?.metadata;if(d?.externalId)throw Error(`methodDetails.metadata.externalId is reserved; use credential externalId instead`);let f=await n({amount:s,challenge:e,client:t,currency:c,expiresAt:e.expires?Math.floor(new Date(e.expires).getTime()/1e3):Math.floor(Date.now()/1e3)+3600,metadata:d,networkId:u,paymentMethod:o}),p=l??r;return Xe({challenge:e,payload:{spt:f,...p===void 0?{}:{externalId:p}}})}})}function at(e){return[it(e)]}(function(e){e.charge=it})(at||={});var ot=n();let Y={data:`__MPPX_DATA__`,error:`root_error`,root:`root`},st={serviceWorker:`__mppx_worker`,tab:`__mppx_tab`},X={challengeId:`data-mppx-challenge-id`,remaining:`data-remaining`};var Z=class{name;constructor(e){this.name=`--mppx-${e}`}toString(){return`var(${this.name})`}};let ct={accent:new Z(`accent`),background:new Z(`background`),border:new Z(`border`),foreground:new Z(`foreground`),muted:new Z(`muted`),negative:new Z(`negative`),positive:new Z(`positive`),surface:new Z(`surface`),fontFamily:new Z(`font-family`),fontSizeBase:new Z(`font-size-base`),radius:new Z(`radius`),spacingUnit:new Z(`spacing-unit`)};String.raw`<style>\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n border-color: ${ct.border};\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n -webkit-tap-highlight-color: transparent;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\n monospace;\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type='button'], [type='reset'], [type='submit']),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n }\n</style>`;function lt(e,t){if(t==null)return e;if(!Q(e)||!Q(t))return t??e;let n={...e};for(let[e,r]of Object.entries(t)){if(r==null||r===``)continue;let t=n[e];n[e]=Q(t)&&Q(r)?lt(t,r):r}return n}function Q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function ut(e){let t=new URL(location.href);t.searchParams.set(st.serviceWorker,``);let n=await navigator.serviceWorker.register(t.pathname+t.search),r=await new Promise(e=>{let t=n.installing??n.waiting??n.active;if(t?.state===`activated`)return e(t);let r=t??n;r.addEventListener(`statechange`,function t(){let i=n.active;i?.state===`activated`&&(r.removeEventListener(`statechange`,t),e(i))})});await new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>t(),r.postMessage({credential:e},[n.port2])}),location.reload()}function dt(e){let t=document.getElementById(Y.data),n=l(t.textContent),r=t.getAttribute(X.remaining);!r||Number(r)<=1?t.remove():t.setAttribute(X.remaining,String(Number(r)-1));let i=document.currentScript,a=i?.getAttribute(X.challengeId),o=a?(i.removeAttribute(X.challengeId),n[a]):Object.values(n).find(t=>t.challenge.method===e);return{...o,error(e){if(!e){document.getElementById(Y.error)?.remove();return}let t=document.getElementById(Y.error);if(t){t.textContent=e;return}let n=document.createElement(`p`);n.id=Y.error,n.className=`mppx-error`,n.role=`alert`,n.textContent=e,document.getElementById(o.rootId)?.after(n)},root:document.getElementById(o.rootId),submit:ut,vars:ct}}let $=dt(`stripe`),ft=String.raw,pt=document.createElement(`style`);pt.textContent=ft`\n form {\n display: flex;\n flex-direction: column;\n gap: calc(${$.vars.spacingUnit} * 8);\n }\n button {\n background: ${$.vars.accent};\n border-radius: ${$.vars.radius};\n color: ${$.vars.background};\n cursor: pointer;\n font-weight: 500;\n padding: calc(${$.vars.spacingUnit} * 4) calc(${$.vars.spacingUnit} * 8);\n width: 100%;\n }\n button:hover:not(:disabled) {\n opacity: 0.85;\n }\n button:disabled {\n cursor: default;\n opacity: 0.5;\n }\n`,$.root.append(pt),(async()=>{let e=await(0,ot.loadStripe)($.config.publishableKey);if(!e)throw Error(`Failed to loadStripe`);let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=(()=>{if($.config.elements?.options?.appearance?.theme)return $.config.elements?.options?.appearance?.theme;switch($.theme.colorScheme){case`light dark`:return t.matches?`night`:`stripe`;case`light`:return`stripe`;case`dark`:return`night`}})(),n=+!!t.matches;return lt({disableAnimations:!0,theme:e,variables:{borderRadius:$.theme.radius,colorBackground:$.theme.surface[n],colorDanger:$.theme.negative[n],colorPrimary:$.theme.accent[n],colorText:$.theme.foreground[n],colorTextSecondary:$.theme.muted[n],fontSizeBase:$.theme.fontSizeBase,fontFamily:$.theme.fontFamily,spacingUnit:$.theme.spacingUnit}},$.config.elements?.options?.appearance??{})},r=e.elements({appearance:n(),...$.config.elements?.options,amount:Number($.challenge.request.amount),currency:$.challenge.request.currency,mode:`payment`,paymentMethodCreation:`manual`,paymentMethodTypes:$.challenge.request.methodDetails.paymentMethodTypes});t.addEventListener(`change`,()=>{r.update({appearance:n()})});let i=document.createElement(`form`);r.create(`payment`,$.config.elements?.paymentOptions).mount(i),$.root.appendChild(i);let a=document.createElement(`button`);a.textContent=$.text.pay,a.type=`submit`,i.appendChild(a),i.onsubmit=async t=>{t.preventDefault(),$.error(),a.disabled=!0;try{await r.submit();let{paymentMethod:t,error:n}=await e.createPaymentMethod({...$.config.elements?.createPaymentMethodOptions,elements:r});if(n||!t)throw n??Error(`Failed to create payment method`);let i=await at({client:e,createToken:mt})[0].createCredential({challenge:$.challenge,context:{paymentMethod:t.id}});await $.submit(i)}catch(e){$.error(e instanceof Error?e.message:`Payment failed`)}finally{a.disabled=!1}}})();async function mt(e){let t=new URL($.config.createTokenUrl,location.origin);if(t.origin!==location.origin)throw Error(`createTokenUrl must be same-origin`);let n=await fetch(t,{method:`POST`,headers:{\"Content-Type\":`application/json`},body:JSON.stringify(e)});if(!n.ok){let e=await n.text().catch(()=>`<response body unavailable>`);throw Error(`Failed to create SPT (${n.status}): ${e}`)}return(await n.json()).spt}})();</script>";
2
2
  //# sourceMappingURL=html.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html.gen.d.ts","sourceRoot":"","sources":["../../../../src/stripe/server/internal/html.gen.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,y4kCAAy4kC,CAAA"}
1
+ {"version":3,"file":"html.gen.d.ts","sourceRoot":"","sources":["../../../../src/stripe/server/internal/html.gen.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,y0kCAAy0kC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  // Generated — do not edit.
2
- export const html = "<script>(function(){var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=t((e=>{Object.defineProperty(e,\"__esModule\",{value:!0});function t(e){\"@babel/helpers - typeof\";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}var n=`dahlia`,r=function(e){return e===3?`v3`:e},i=`https://js.stripe.com`,a=`${i}/${n}/stripe.js`,o=/^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/,s=/^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/,c=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,l=function(e){return o.test(e)||s.test(e)},u=function(){for(var e=document.querySelectorAll(`script[src^=\"${i}\"]`),t=0;t<e.length;t++){var n=e[t];if(l(n.src))return n}return null},d=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=`${a}${t}`;var r=document.head||document.body;if(!r)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return r.appendChild(n),n},ee=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:`stripe-js`,version:`9.7.0`,startTime:t})},f=null,p=null,m=null,h=function(e){return function(t){e(Error(`Failed to load Stripe.js`,{cause:t}))}},g=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},te=function(e){return f===null?(f=new Promise(function(t,n){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(c),window.Stripe){t(window.Stripe);return}try{var r=u();if(r&&e)console.warn(c);else if(!r)r=d(e);else if(r&&m!==null&&p!==null){var i;r.removeEventListener(`load`,m),r.removeEventListener(`error`,p),(i=r.parentNode)==null||i.removeChild(r),r=d(e)}m=g(t,n),p=h(n),r.addEventListener(`load`,m),r.addEventListener(`error`,p)}catch(e){n(e);return}}),f.catch(function(e){return f=null,Promise.reject(e)})):f},ne=function(e,i,a){if(e===null)return null;var o=i[0];if(typeof o!=`string`)throw Error(`Expected publishable key to be of type string, got type ${t(o)} instead.`);var s=o.match(/^pk_test/),c=r(e.version),l=n;s&&c!==l&&console.warn(`Stripe.js@${c} was loaded on the page, but @stripe/stripe-js@9.7.0 expected Stripe.js@${l}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);var u=e.apply(void 0,i);return ee(u,a),u},_=function(e){var n=`invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ${JSON.stringify(e)}\n`;if(e===null||t(e)!==`object`)throw Error(n);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals==`boolean`)return e;throw Error(n)},v,y=!1,b=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];y=!0;var r=Date.now();return te(v).then(function(e){return ne(e,t,r)})};b.setLoadParameters=function(e){if(y&&v){var t=_(e);if(Object.keys(t).reduce(function(t,n){return t&&e[n]===v?.[n]},!0))return}if(y)throw Error(`You cannot change load parameters after calling loadStripe`);v=_(e)},e.loadStripe=b})),r=t(((e,t)=>{t.exports=n()})),i,a=e((()=>{i=`0.1.1`}));function o(){return i}var s=e((()=>{a()}));function c(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause?c(e.cause,t):t?null:e}var l,u=e((()=>{s(),l=class e extends Error{static setStaticOptions(t){e.prototype.docsOrigin=t.docsOrigin,e.prototype.showVersion=t.showVersion,e.prototype.version=t.version}constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&`details`in n.cause&&typeof n.cause.details==`string`?n.cause.details:n.cause?.message?n.cause.message:n.details})(),i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=n.docsOrigin??e.prototype.docsOrigin,o=`${a}${i??``}`,s=!!(n.version??e.prototype.showVersion),c=n.version??e.prototype.version,l=[t||`An error occurred.`,...n.metaMessages?[``,...n.metaMessages]:[],...r||i||s?[``,r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(e=>typeof e==`string`).join(`\n`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docs\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsOrigin\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"showVersion\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"cause\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsOrigin=a,this.docsPath=i,this.shortMessage=t,this.showVersion=s,this.version=c}walk(e){return c(this,e)}},Object.defineProperty(l,\"defaultStaticOptions\",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:`https://oxlib.sh`,showVersion:!1,version:`ox@${o()}`}}),l.setStaticOptions(l.defaultStaticOptions)}));function d(e,t){if(_(e)>t)throw new y({givenSize:_(e),maxSize:t})}function ee(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new b({size:e.length,targetSize:r,type:`Bytes`});let i=new Uint8Array(r);for(let t=0;t<r;t++){let a=n===`right`;i[a?t:r-t-1]=e[a?t:e.length-t-1]}return i}var f=e((()=>{re()}));function p(e){if(e===null||typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`Cannot canonicalize non-finite number`);return Object.is(e,-0)?`0`:JSON.stringify(e)}if(typeof e==`bigint`)throw TypeError(`Cannot canonicalize bigint`);if(Array.isArray(e))return`[${e.map(e=>p(e)).join(`,`)}]`;if(typeof e==`object`)return`{${Object.keys(e).sort().reduce((t,n)=>{let r=e[n];return r!==void 0&&t.push(`${JSON.stringify(n)}:${p(r)}`),t},[]).join(`,`)}}`}function m(e,t){return JSON.parse(e,(e,n)=>{let r=n;return typeof r==`string`&&r.endsWith(h)?BigInt(r.slice(0,-9)):typeof t==`function`?t(e,r):r})}var h,g=e((()=>{h=`#__bigint`}));function te(e,t={}){let{size:n}=t,r=v.encode(e);return typeof n==`number`?(d(r,n),ne(r,n)):r}function ne(e,t){return ee(e,{dir:`right`,size:t})}function _(e){return e.length}var v,y,b,re=e((()=>{u(),f(),g(),v=new TextEncoder,y=class extends l{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \\`${t}\\` bytes. Given size: \\`${e}\\` bytes.`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeOverflowError`})}},b=class extends l{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\\`${e}\\`) exceeds padding size (\\`${t}\\`).`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeExceedsPaddingSizeError`})}}}));re();let ie=new TextDecoder,x=Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[t,e.charCodeAt(0)]));({...Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[e.charCodeAt(0),t]))});function ae(e,t={}){let{pad:n=!0,url:r=!1}=t,i=new Uint8Array(Math.ceil(e.length/3)*4);for(let t=0,n=0;n<e.length;t+=4,n+=3){let r=(e[n]<<16)+(e[n+1]<<8)+(e[n+2]|0);i[t]=x[r>>18],i[t+1]=x[r>>12&63],i[t+2]=x[r>>6&63],i[t+3]=x[r&63]}let a=e.length%3,o=Math.floor(e.length/3)*4+(a&&a+1),s=ie.decode(new Uint8Array(i.buffer,0,o));return n&&a===1&&(s+=`==`),n&&a===2&&(s+=`=`),r&&(s=s.replaceAll(`+`,`-`).replaceAll(`/`,`_`)),s}function oe(e,t={}){return ae(te(e),t)}g();function S(e){return oe(p(e),{pad:!1,url:!0})}var se;function C(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,\"_zod\",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}var w=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(se=globalThis).__zod_globalConfig??(se.__zod_globalConfig={});let le=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(le,e),le}function ue(e,t){return typeof t==`bigint`?t.toString():t}function de(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}throw Error(`cached value already set`)}}}function fe(e){return e==null}function pe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}let E=Symbol(`evaluating`);function D(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E)return r===void 0&&(r=E,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}let me=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function O(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function he(e){if(O(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(O(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ge(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function k(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function _e(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function A(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ve(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function j(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function M(e){return typeof e==`string`?e:e?.message}function N(e,t,n){let r=e.message?e.message:M(e.inst?._zod.def?.error?.(e))??M(t?.error?.(e))??M(n.customError?.(e))??M(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ye(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}let be=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ue,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},xe=C(`$ZodError`,be),P=C(`$ZodError`,be,{Parent:Error}),Se=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new w;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>N(e,a,T())));throw me(t,i?.callee),t}return o.value})(P),Ce=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>N(e,a,T())));throw me(t,i?.callee),t}return o.value})(P),we=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new w;return a.issues.length?{success:!1,error:new(e??xe)(a.issues.map(e=>N(e,i,T())))}:{success:!0,data:a.value}})(P),F=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>N(e,i,T())))}:{success:!0,data:a.value}})(P),Te=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},I=/^-?\\d+(?:\\.\\d+)?$/,L=C(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ee=C(`$ZodCheckMinLength`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!fe(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ye(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),De=C(`$ZodCheckStringFormat`,(e,t)=>{var n,r;L.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Oe=C(`$ZodCheckRegex`,(e,t)=>{De.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ke={major:4,minor:4,patch:3},R=C(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ke;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=A(e),i;for(let a of t){if(a._zod.def.when){if(ve(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new w;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=A(e,t))});else{if(e.issues.length===t)continue;r||=A(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(A(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new w;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new w;return o.then(e=>t(e,r,a))}return t(o,r,a)}}D(e,`~standard`,()=>({validate:t=>{try{let n=we(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return F(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ae=C(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Te(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),je=C(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??I,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}});function z(e,t,n){e.issues.length&&t.issues.push(...j(n,e.issues)),t.value[n]=e.value}let Me=C(`$ZodArray`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>z(t,n,e))):z(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...j(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Ne(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=_e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Pe(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t,u,d))):B(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}let Fe=C(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let n={...e};return Object.defineProperty(t,\"shape\",{value:n}),n}})}let n=de(()=>Ne(t));D(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=O,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>B(n,t,e,s,r,i))):B(a,t,e,s,r,i)}return i?Pe(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Ie=C(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!he(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>N(e,r,T())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...j(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...j(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&I.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>N(e,r,T())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...j(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...j(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Le=C(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ce(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new w;return n.value=i,n.fallback=!0,n}});function V(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let Re=C(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${pe(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>V(e,r)):V(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ze=C(`$ZodPipe`,(e,t)=>{R.init(e,t),D(e._zod,`values`,()=>t.in._zod.values),D(e._zod,`optin`,()=>t.in._zod.optin),D(e._zod,`optout`,()=>t.out._zod.optout),D(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.in,n)):H(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.out,n)):H(r,t.out,n)}});function H(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function Be(e,t){return new e({type:`string`,...k(t)})}function Ve(e,t){return new e({type:`number`,checks:[],...k(t)})}function He(e,t){return new Ee({check:`min_length`,...k(t),minimum:e})}function Ue(e,t){return new Oe({check:`string_format`,format:`regex`,...k(t),pattern:e})}let U=C(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);R.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>Se(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>we(e,t,n),e.parseAsync=async(t,n)=>Ce(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>F(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>ge(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),We=C(`ZodMiniString`,(e,t)=>{Ae.init(e,t),U.init(e,t)});function W(e){return Be(We,e)}let Ge=C(`ZodMiniNumber`,(e,t)=>{je.init(e,t),U.init(e,t)});function Ke(e){return Ve(Ge,e)}let qe=C(`ZodMiniArray`,(e,t)=>{Me.init(e,t),U.init(e,t)});function Je(e,t){return new qe({type:`array`,element:e,...k(t)})}let Ye=C(`ZodMiniObject`,(e,t)=>{Fe.init(e,t),U.init(e,t),D(e,`shape`,()=>t.shape)});function G(e,t){return new Ye({type:`object`,shape:e??{},...k(t)})}let Xe=C(`ZodMiniRecord`,(e,t)=>{Ie.init(e,t),U.init(e,t)});function Ze(e,t,n){return!t||!t._zod?new Xe({type:`record`,keyType:W(),valueType:e,...k(t)}):new Xe({type:`record`,keyType:e,valueType:t,...k(n)})}let Qe=C(`ZodMiniTransform`,(e,t)=>{Le.init(e,t),U.init(e,t)});function $e(e){return new Qe({type:`transform`,transform:e})}let et=C(`ZodMiniOptional`,(e,t)=>{Re.init(e,t),U.init(e,t)});function K(e){return new et({type:`optional`,innerType:e})}let tt=C(`ZodMiniPipe`,(e,t)=>{ze.init(e,t),U.init(e,t)});function nt(e,t){return new tt({type:`pipe`,in:e,out:t})}function rt(){return W().check(Ue(/^\\d+(\\.\\d+)?$/,`Invalid amount`))}function it(e){let{meta:t,opaque:n,request:r,...i}=e.challenge,a=n??(t===void 0?void 0:S(t)),o={challenge:{...i,...a!==void 0&&{opaque:a},request:S(r)},payload:e.payload,...e.source&&{source:e.source}};return`Payment ${oe(JSON.stringify(o),{pad:!1,url:!0})}`}var q,at=e((()=>{q=`2.51.3`}));function ot(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause!==void 0?ot(e.cause,t):t?null:e}var J,st;e((()=>{at(),J={getDocsUrl:({docsBaseUrl:e,docsPath:t=``,docsSlug:n})=>t?`${e??`https://viem.sh`}${t}${n?`#${n}`:``}`:void 0,version:`viem@${q}`},st=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=J.getDocsUrl?.({...n,docsPath:i}),o=[t||`An error occurred.`,``,...n.metaMessages?[...n.metaMessages,``]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...J.version?[`Version: ${J.version}`]:[]].join(`\n`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"metaMessages\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=q}walk(e){return ot(this,e)}}}))();var ct=class extends st{constructor({value:e}){super(`Number \\`${e}\\` is not a valid decimal number.`,{name:`InvalidDecimalNumberError`})}};function lt(e,t){if(!/^(-?)([0-9]*)\\.?([0-9]*)$/.test(e))throw new ct({value:e});let[n,r=`0`]=e.split(`.`),i=n.startsWith(`-`);if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,``),t===0)Math.round(Number(`.${r}`))===1&&(n=`${BigInt(n)+1n}`),r=``;else if(r.length>t){let[e,i,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],o=Math.round(Number(`${i}.${a}`));r=o>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,`0`):`${e}${o}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,`0`);return BigInt(`${i?`-`:``}${n}${r}`)}function ut(e){return e}function dt(e,t){let{context:n,createCredential:r}=t;return{...e,context:n,createCredential:r}}let ft=ut({name:`stripe`,intent:`charge`,schema:{credential:{payload:G({externalId:K(W()),spt:W()})},request:nt(G({amount:rt(),currency:W(),decimals:Ke(),description:K(W()),externalId:K(W()),metadata:K(Ze(W(),W())),networkId:W(),paymentMethodTypes:Je(W()).check(He(1)),recipient:K(W())}),$e(({amount:e,decimals:t,metadata:n,networkId:r,paymentMethodTypes:i,...a})=>({...a,amount:lt(e,t).toString(),methodDetails:{networkId:r,paymentMethodTypes:i,...n!==void 0&&{metadata:n}}})))}});function pt(e){let{client:t,createToken:n,externalId:r,paymentMethod:i}=e;return dt(ft,{context:G({paymentMethod:K(W())}),async createCredential({challenge:e,context:a}){let o=a?.paymentMethod??i;if(!o)throw Error(`paymentMethod is required (pass via context or parameters)`);let s=e.request.amount,c=e.request.currency,l=e.request.methodDetails?.networkId;if(!l)throw Error(`networkId is required in challenge.methodDetails`);let u=e.request.methodDetails?.metadata;if(u?.externalId)throw Error(`methodDetails.metadata.externalId is reserved; use credential externalId instead`);return it({challenge:e,payload:{spt:await n({amount:s,challenge:e,client:t,currency:c,expiresAt:e.expires?Math.floor(new Date(e.expires).getTime()/1e3):Math.floor(Date.now()/1e3)+3600,metadata:u,networkId:l,paymentMethod:o}),...r?{externalId:r}:{}}})}})}function mt(e){return[pt(e)]}(function(e){e.charge=pt})(mt||={});var ht=r();let Y={data:`__MPPX_DATA__`,error:`root_error`,root:`root`},gt={serviceWorker:`__mppx_worker`,tab:`__mppx_tab`},X={challengeId:`data-mppx-challenge-id`,remaining:`data-remaining`};var Z=class{name;constructor(e){this.name=`--mppx-${e}`}toString(){return`var(${this.name})`}};let _t={accent:new Z(`accent`),background:new Z(`background`),border:new Z(`border`),foreground:new Z(`foreground`),muted:new Z(`muted`),negative:new Z(`negative`),positive:new Z(`positive`),surface:new Z(`surface`),fontFamily:new Z(`font-family`),fontSizeBase:new Z(`font-size-base`),radius:new Z(`radius`),spacingUnit:new Z(`spacing-unit`)};String.raw`<style>\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n border-color: ${_t.border};\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n -webkit-tap-highlight-color: transparent;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\n monospace;\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type='button'], [type='reset'], [type='submit']),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n }\n</style>`;function vt(e,t){if(t==null)return e;if(!Q(e)||!Q(t))return t??e;let n={...e};for(let[e,r]of Object.entries(t)){if(r==null||r===``)continue;let t=n[e];n[e]=Q(t)&&Q(r)?vt(t,r):r}return n}function Q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function yt(e){let t=new URL(location.href);t.searchParams.set(gt.serviceWorker,``);let n=await navigator.serviceWorker.register(t.pathname+t.search),r=await new Promise(e=>{let t=n.installing??n.waiting??n.active;if(t?.state===`activated`)return e(t);let r=t??n;r.addEventListener(`statechange`,function t(){let i=n.active;i?.state===`activated`&&(r.removeEventListener(`statechange`,t),e(i))})});await new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>t(),r.postMessage({credential:e},[n.port2])}),location.reload()}g();function bt(e){let t=document.getElementById(Y.data),n=m(t.textContent),r=t.getAttribute(X.remaining);!r||Number(r)<=1?t.remove():t.setAttribute(X.remaining,String(Number(r)-1));let i=document.currentScript,a=i?.getAttribute(X.challengeId),o=a?(i.removeAttribute(X.challengeId),n[a]):Object.values(n).find(t=>t.challenge.method===e);return{...o,error(e){if(!e){document.getElementById(Y.error)?.remove();return}let t=document.getElementById(Y.error);if(t){t.textContent=e;return}let n=document.createElement(`p`);n.id=Y.error,n.className=`mppx-error`,n.role=`alert`,n.textContent=e,document.getElementById(o.rootId)?.after(n)},root:document.getElementById(o.rootId),submit:yt,vars:_t}}let $=bt(`stripe`),xt=String.raw,St=document.createElement(`style`);St.textContent=xt`\n form {\n display: flex;\n flex-direction: column;\n gap: calc(${$.vars.spacingUnit} * 8);\n }\n button {\n background: ${$.vars.accent};\n border-radius: ${$.vars.radius};\n color: ${$.vars.background};\n cursor: pointer;\n font-weight: 500;\n padding: calc(${$.vars.spacingUnit} * 4) calc(${$.vars.spacingUnit} * 8);\n width: 100%;\n }\n button:hover:not(:disabled) {\n opacity: 0.85;\n }\n button:disabled {\n cursor: default;\n opacity: 0.5;\n }\n`,$.root.append(St),(async()=>{let e=await(0,ht.loadStripe)($.config.publishableKey);if(!e)throw Error(`Failed to loadStripe`);let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=(()=>{if($.config.elements?.options?.appearance?.theme)return $.config.elements?.options?.appearance?.theme;switch($.theme.colorScheme){case`light dark`:return t.matches?`night`:`stripe`;case`light`:return`stripe`;case`dark`:return`night`}})(),n=+!!t.matches;return vt({disableAnimations:!0,theme:e,variables:{borderRadius:$.theme.radius,colorBackground:$.theme.surface[n],colorDanger:$.theme.negative[n],colorPrimary:$.theme.accent[n],colorText:$.theme.foreground[n],colorTextSecondary:$.theme.muted[n],fontSizeBase:$.theme.fontSizeBase,fontFamily:$.theme.fontFamily,spacingUnit:$.theme.spacingUnit}},$.config.elements?.options?.appearance??{})},r=e.elements({appearance:n(),...$.config.elements?.options,amount:Number($.challenge.request.amount),currency:$.challenge.request.currency,mode:`payment`,paymentMethodCreation:`manual`,paymentMethodTypes:$.challenge.request.methodDetails.paymentMethodTypes});t.addEventListener(`change`,()=>{r.update({appearance:n()})});let i=document.createElement(`form`);r.create(`payment`,$.config.elements?.paymentOptions).mount(i),$.root.appendChild(i);let a=document.createElement(`button`);a.textContent=$.text.pay,a.type=`submit`,i.appendChild(a),i.onsubmit=async t=>{t.preventDefault(),$.error(),a.disabled=!0;try{await r.submit();let{paymentMethod:t,error:n}=await e.createPaymentMethod({...$.config.elements?.createPaymentMethodOptions,elements:r});if(n||!t)throw n??Error(`Failed to create payment method`);let i=await mt({client:e,createToken:Ct})[0].createCredential({challenge:$.challenge,context:{paymentMethod:t.id}});await $.submit(i)}catch(e){$.error(e instanceof Error?e.message:`Payment failed`)}finally{a.disabled=!1}}})();async function Ct(e){let t=new URL($.config.createTokenUrl,location.origin);if(t.origin!==location.origin)throw Error(`createTokenUrl must be same-origin`);let n=await fetch(t,{method:`POST`,headers:{\"Content-Type\":`application/json`},body:JSON.stringify(e)});if(!n.ok){let e=await n.text().catch(()=>`<response body unavailable>`);throw Error(`Failed to create SPT (${n.status}): ${e}`)}return(await n.json()).spt}})();</script>";
2
+ export const html = "<script>(function(){var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),t=e((e=>{Object.defineProperty(e,\"__esModule\",{value:!0});function t(e){\"@babel/helpers - typeof\";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}var n=`dahlia`,r=function(e){return e===3?`v3`:e},i=`https://js.stripe.com`,a=`${i}/${n}/stripe.js`,o=/^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/,s=/^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/,c=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,l=function(e){return o.test(e)||s.test(e)},u=function(){for(var e=document.querySelectorAll(`script[src^=\"${i}\"]`),t=0;t<e.length;t++){var n=e[t];if(l(n.src))return n}return null},d=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=`${a}${t}`;var r=document.head||document.body;if(!r)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return r.appendChild(n),n},f=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:`stripe-js`,version:`9.8.0`,startTime:t})},p=null,m=null,h=null,ee=function(e){return function(t){e(Error(`Failed to load Stripe.js`,{cause:t}))}},g=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},_=function(e){return p===null?(p=new Promise(function(t,n){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(c),window.Stripe){t(window.Stripe);return}try{var r=u();if(r&&e)console.warn(c);else if(!r)r=d(e);else if(r&&h!==null&&m!==null){var i;r.removeEventListener(`load`,h),r.removeEventListener(`error`,m),(i=r.parentNode)==null||i.removeChild(r),r=d(e)}h=g(t,n),m=ee(n),r.addEventListener(`load`,h),r.addEventListener(`error`,m)}catch(e){n(e);return}}),p.catch(function(e){return p=null,Promise.reject(e)})):p},v=function(e,i,a){if(e===null)return null;var o=i[0];if(typeof o!=`string`)throw Error(`Expected publishable key to be of type string, got type ${t(o)} instead.`);var s=o.match(/^pk_test/),c=r(e.version),l=n;s&&c!==l&&console.warn(`Stripe.js@${c} was loaded on the page, but @stripe/stripe-js@9.8.0 expected Stripe.js@${l}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);var u=e.apply(void 0,i);return f(u,a),u},y=function(e){var n=`invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ${JSON.stringify(e)}\n`;if(e===null||t(e)!==`object`)throw Error(n);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals==`boolean`)return e;throw Error(n)},b,x=!1,S=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];x=!0;var r=Date.now();return _(b).then(function(e){return v(e,t,r)})};S.setLoadParameters=function(e){if(x&&b){var t=y(e);if(Object.keys(t).reduce(function(t,n){return t&&e[n]===b?.[n]},!0))return}if(x)throw Error(`You cannot change load parameters after calling loadStripe`);b=y(e)},e.loadStripe=S})),n=e(((e,n)=>{n.exports=t()}));function r(){return`0.1.1`}var i=class e extends Error{static setStaticOptions(t){e.prototype.docsOrigin=t.docsOrigin,e.prototype.showVersion=t.showVersion,e.prototype.version=t.version}constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&`details`in n.cause&&typeof n.cause.details==`string`?n.cause.details:n.cause?.message?n.cause.message:n.details})(),i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=n.docsOrigin??e.prototype.docsOrigin,o=`${a}${i??``}`,s=!!(n.version??e.prototype.showVersion),c=n.version??e.prototype.version,l=[t||`An error occurred.`,...n.metaMessages?[``,...n.metaMessages]:[],...r||i||s?[``,r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(e=>typeof e==`string`).join(`\n`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docs\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsOrigin\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"showVersion\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"cause\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsOrigin=a,this.docsPath=i,this.shortMessage=t,this.showVersion=s,this.version=c}walk(e){return a(this,e)}};Object.defineProperty(i,\"defaultStaticOptions\",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:`https://oxlib.sh`,showVersion:!1,version:`ox@${r()}`}}),i.setStaticOptions(i.defaultStaticOptions);function a(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause?a(e.cause,t):t?null:e}function o(e,t){if(p(e)>t)throw new m({givenSize:p(e),maxSize:t})}function s(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new h({size:e.length,targetSize:r,type:`Bytes`});let i=new Uint8Array(r);for(let t=0;t<r;t++){let a=n===`right`;i[a?t:r-t-1]=e[a?t:e.length-t-1]}return i}function c(e){if(e===null||typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`Cannot canonicalize non-finite number`);return Object.is(e,-0)?`0`:JSON.stringify(e)}if(typeof e==`bigint`)throw TypeError(`Cannot canonicalize bigint`);if(Array.isArray(e))return`[${e.map(e=>c(e)).join(`,`)}]`;if(typeof e==`object`)return`{${Object.keys(e).sort().reduce((t,n)=>{let r=e[n];return r!==void 0&&t.push(`${JSON.stringify(n)}:${c(r)}`),t},[]).join(`,`)}}`}function l(e,t){return JSON.parse(e,(e,n)=>{let r=n;return typeof r==`string`&&r.endsWith(`#__bigint`)?BigInt(r.slice(0,-9)):typeof t==`function`?t(e,r):r})}let u=new TextEncoder;function d(e,t={}){let{size:n}=t,r=u.encode(e);return typeof n==`number`?(o(r,n),f(r,n)):r}function f(e,t){return s(e,{dir:`right`,size:t})}function p(e){return e.length}var m=class extends i{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \\`${t}\\` bytes. Given size: \\`${e}\\` bytes.`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeOverflowError`})}},h=class extends i{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\\`${e}\\`) exceeds padding size (\\`${t}\\`).`),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeExceedsPaddingSizeError`})}};let ee=new TextDecoder,g=Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[t,e.charCodeAt(0)]));({...Object.fromEntries(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`).map((e,t)=>[e.charCodeAt(0),t]))});function _(e,t={}){let{pad:n=!0,url:r=!1}=t,i=new Uint8Array(Math.ceil(e.length/3)*4);for(let t=0,n=0;n<e.length;t+=4,n+=3){let r=(e[n]<<16)+(e[n+1]<<8)+(e[n+2]|0);i[t]=g[r>>18],i[t+1]=g[r>>12&63],i[t+2]=g[r>>6&63],i[t+3]=g[r&63]}let a=e.length%3,o=Math.floor(e.length/3)*4+(a&&a+1),s=ee.decode(new Uint8Array(i.buffer,0,o));return n&&a===1&&(s+=`==`),n&&a===2&&(s+=`=`),r&&(s=s.replaceAll(`+`,`-`).replaceAll(`/`,`_`)),s}function v(e,t={}){return _(d(e),t)}let y={payment:`Payment`};function b(e){return v(c(e),{pad:!1,url:!0})}var x;function S(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,\"_zod\",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}var C=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},te=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(x=globalThis).__zod_globalConfig??(x.__zod_globalConfig={});let w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function ne(e,t){return typeof t==`bigint`?t.toString():t}function re(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}throw Error(`cached value already set`)}}}function ie(e){return e==null}function ae(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}let E=Symbol(`evaluating`);function D(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E)return r===void 0&&(r=E,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}let O=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function oe(e){if(k(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(k(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function se(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function A(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function j(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function le(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function M(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function N(e){return typeof e==`string`?e:e?.message}function P(e,t,n){let r=e.message?e.message:N(e.inst?._zod.def?.error?.(e))??N(t?.error?.(e))??N(n.customError?.(e))??N(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ue(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}let de=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ne,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},fe=S(`$ZodError`,de),F=S(`$ZodError`,de,{Parent:Error}),pe=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new C;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>P(e,a,T())));throw O(t,i?.callee),t}return o.value})(F),me=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>P(e,a,T())));throw O(t,i?.callee),t}return o.value})(F),he=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new C;return a.issues.length?{success:!1,error:new(e??fe)(a.issues.map(e=>P(e,i,T())))}:{success:!0,data:a.value}})(F),ge=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>P(e,i,T())))}:{success:!0,data:a.value}})(F),_e=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},ve=/^-?\\d+(?:\\.\\d+)?$/,I=S(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ye=S(`$ZodCheckMinLength`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ue(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),be=S(`$ZodCheckStringFormat`,(e,t)=>{var n,r;I.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),xe=S(`$ZodCheckRegex`,(e,t)=>{be.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Se={major:4,minor:4,patch:3},L=S(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Se;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=j(e),i;for(let a of t){if(a._zod.def.when){if(le(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new C;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=j(e,t))});else{if(e.issues.length===t)continue;r||=j(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(j(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new C;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new C;return o.then(e=>t(e,r,a))}return t(o,r,a)}}D(e,`~standard`,()=>({validate:t=>{try{let n=he(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ge(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ce=S(`$ZodString`,(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_e(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),we=S(`$ZodNumber`,(e,t)=>{L.init(e,t),e._zod.pattern=e._zod.bag.pattern??ve,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}});function R(e,t,n){e.issues.length&&t.issues.push(...M(n,e.issues)),t.value[n]=e.value}let Te=S(`$ZodArray`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>R(t,n,e))):R(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function z(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...M(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Ee(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=ce(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function De(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>z(e,n,i,t,u,d))):z(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}let Oe=S(`$ZodObject`,(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let n={...e};return Object.defineProperty(t,\"shape\",{value:n}),n}})}let n=re(()=>Ee(t));D(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=k,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>z(n,t,e,s,r,i))):z(a,t,e,s,r,i)}return i?De(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ke=S(`$ZodRecord`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!oe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>P(e,r,T())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...M(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...M(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ve.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>P(e,r,T())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...M(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...M(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ae=S(`$ZodTransform`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new te(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new C;return n.value=i,n.fallback=!0,n}});function B(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let je=S(`$ZodOptional`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ae(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>B(e,r)):B(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Me=S(`$ZodPipe`,(e,t)=>{L.init(e,t),D(e._zod,`values`,()=>t.in._zod.values),D(e._zod,`optin`,()=>t.in._zod.optin),D(e._zod,`optout`,()=>t.out._zod.optout),D(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.in,n)):V(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.out,n)):V(r,t.out,n)}});function V(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function Ne(e,t){return new e({type:`string`,...A(t)})}function Pe(e,t){return new e({type:`number`,checks:[],...A(t)})}function Fe(e,t){return new ye({check:`min_length`,...A(t),minimum:e})}function Ie(e,t){return new xe({check:`string_format`,format:`regex`,...A(t),pattern:e})}let H=S(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);L.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>pe(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>he(e,t,n),e.parseAsync=async(t,n)=>me(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ge(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>se(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),Le=S(`ZodMiniString`,(e,t)=>{Ce.init(e,t),H.init(e,t)});function U(e){return Ne(Le,e)}let Re=S(`ZodMiniNumber`,(e,t)=>{we.init(e,t),H.init(e,t)});function ze(e){return Pe(Re,e)}let Be=S(`ZodMiniArray`,(e,t)=>{Te.init(e,t),H.init(e,t)});function Ve(e,t){return new Be({type:`array`,element:e,...A(t)})}let He=S(`ZodMiniObject`,(e,t)=>{Oe.init(e,t),H.init(e,t),D(e,`shape`,()=>t.shape)});function W(e,t){return new He({type:`object`,shape:e??{},...A(t)})}let G=S(`ZodMiniRecord`,(e,t)=>{ke.init(e,t),H.init(e,t)});function Ue(e,t,n){return!t||!t._zod?new G({type:`record`,keyType:U(),valueType:e,...A(t)}):new G({type:`record`,keyType:e,valueType:t,...A(n)})}let We=S(`ZodMiniTransform`,(e,t)=>{Ae.init(e,t),H.init(e,t)});function Ge(e){return new We({type:`transform`,transform:e})}let Ke=S(`ZodMiniOptional`,(e,t)=>{je.init(e,t),H.init(e,t)});function K(e){return new Ke({type:`optional`,innerType:e})}let qe=S(`ZodMiniPipe`,(e,t)=>{Me.init(e,t),H.init(e,t)});function Je(e,t){return new qe({type:`pipe`,in:e,out:t})}function Ye(){return U().check(Ie(/^\\d+(\\.\\d+)?$/,`Invalid amount`))}function Xe(e){let{meta:t,opaque:n,request:r,...i}=e.challenge,a=n??(t===void 0?void 0:b(t)),o={challenge:{...i,...a!==void 0&&{opaque:a},request:b(r)},payload:e.payload,...e.source&&{source:e.source}},s=v(JSON.stringify(o),{pad:!1,url:!0});return`${y.payment} ${s}`}function Ze(e){return e}function Qe(e,t){let{canHandleChallenge:n,context:r,createCredential:i}=t;return{...e,canHandleChallenge:n,context:r,createCredential:i}}let q=`2.52.2`,J={getDocsUrl:({docsBaseUrl:e,docsPath:t=``,docsSlug:n})=>t?`${e??`https://viem.sh`}${t}${n?`#${n}`:``}`:void 0,version:`viem@${q}`};var $e=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=J.getDocsUrl?.({...n,docsPath:i}),o=[t||`An error occurred.`,``,...n.metaMessages?[...n.metaMessages,``]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...J.version?[`Version: ${J.version}`]:[]].join(`\n`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,\"details\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"docsPath\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"metaMessages\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shortMessage\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=q}walk(e){return et(this,e)}};function et(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause!==void 0?et(e.cause,t):t?null:e}var tt=class extends $e{constructor({value:e}){super(`Number \\`${e}\\` is not a valid decimal number.`,{name:`InvalidDecimalNumberError`})}};function nt(e,t){if(!/^(-?)([0-9]*)\\.?([0-9]*)$/.test(e))throw new tt({value:e});let[n,r=`0`]=e.split(`.`),i=n.startsWith(`-`);if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,``),t===0)Math.round(Number(`.${r}`))===1&&(n=`${BigInt(n)+1n}`),r=``;else if(r.length>t){let[e,i,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],o=Math.round(Number(`${i}.${a}`));r=o>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,`0`):`${e}${o}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,`0`);return BigInt(`${i?`-`:``}${n}${r}`)}let rt=Ze({name:`stripe`,intent:`charge`,schema:{credential:{payload:W({externalId:K(U()),spt:U()})},request:Je(W({amount:Ye(),currency:U(),decimals:ze(),description:K(U()),externalId:K(U()),metadata:K(Ue(U(),U())),networkId:U(),paymentMethodTypes:Ve(U()).check(Fe(1)),recipient:K(U())}),Ge(({amount:e,decimals:t,metadata:n,networkId:r,paymentMethodTypes:i,...a})=>({...a,amount:nt(e,t).toString(),methodDetails:{networkId:r,paymentMethodTypes:i,...n!==void 0&&{metadata:n}}})))}});function it(e){let{client:t,createToken:n,externalId:r,paymentMethod:i}=e;return Qe(rt,{context:W({paymentMethod:K(U())}),async createCredential({challenge:e,context:a}){let o=a?.paymentMethod??i;if(!o)throw Error(`paymentMethod is required (pass via context or parameters)`);let s=e.request.amount,c=e.request.currency,l=typeof e.request.externalId==`string`?e.request.externalId:void 0,u=e.request.methodDetails?.networkId;if(!u)throw Error(`networkId is required in challenge.methodDetails`);let d=e.request.methodDetails?.metadata;if(d?.externalId)throw Error(`methodDetails.metadata.externalId is reserved; use credential externalId instead`);let f=await n({amount:s,challenge:e,client:t,currency:c,expiresAt:e.expires?Math.floor(new Date(e.expires).getTime()/1e3):Math.floor(Date.now()/1e3)+3600,metadata:d,networkId:u,paymentMethod:o}),p=l??r;return Xe({challenge:e,payload:{spt:f,...p===void 0?{}:{externalId:p}}})}})}function at(e){return[it(e)]}(function(e){e.charge=it})(at||={});var ot=n();let Y={data:`__MPPX_DATA__`,error:`root_error`,root:`root`},st={serviceWorker:`__mppx_worker`,tab:`__mppx_tab`},X={challengeId:`data-mppx-challenge-id`,remaining:`data-remaining`};var Z=class{name;constructor(e){this.name=`--mppx-${e}`}toString(){return`var(${this.name})`}};let ct={accent:new Z(`accent`),background:new Z(`background`),border:new Z(`border`),foreground:new Z(`foreground`),muted:new Z(`muted`),negative:new Z(`negative`),positive:new Z(`positive`),surface:new Z(`surface`),fontFamily:new Z(`font-family`),fontSizeBase:new Z(`font-size-base`),radius:new Z(`radius`),spacingUnit:new Z(`spacing-unit`)};String.raw`<style>\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n border-color: ${ct.border};\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n -webkit-tap-highlight-color: transparent;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\n monospace;\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type='button'], [type='reset'], [type='submit']),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n }\n</style>`;function lt(e,t){if(t==null)return e;if(!Q(e)||!Q(t))return t??e;let n={...e};for(let[e,r]of Object.entries(t)){if(r==null||r===``)continue;let t=n[e];n[e]=Q(t)&&Q(r)?lt(t,r):r}return n}function Q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function ut(e){let t=new URL(location.href);t.searchParams.set(st.serviceWorker,``);let n=await navigator.serviceWorker.register(t.pathname+t.search),r=await new Promise(e=>{let t=n.installing??n.waiting??n.active;if(t?.state===`activated`)return e(t);let r=t??n;r.addEventListener(`statechange`,function t(){let i=n.active;i?.state===`activated`&&(r.removeEventListener(`statechange`,t),e(i))})});await new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>t(),r.postMessage({credential:e},[n.port2])}),location.reload()}function dt(e){let t=document.getElementById(Y.data),n=l(t.textContent),r=t.getAttribute(X.remaining);!r||Number(r)<=1?t.remove():t.setAttribute(X.remaining,String(Number(r)-1));let i=document.currentScript,a=i?.getAttribute(X.challengeId),o=a?(i.removeAttribute(X.challengeId),n[a]):Object.values(n).find(t=>t.challenge.method===e);return{...o,error(e){if(!e){document.getElementById(Y.error)?.remove();return}let t=document.getElementById(Y.error);if(t){t.textContent=e;return}let n=document.createElement(`p`);n.id=Y.error,n.className=`mppx-error`,n.role=`alert`,n.textContent=e,document.getElementById(o.rootId)?.after(n)},root:document.getElementById(o.rootId),submit:ut,vars:ct}}let $=dt(`stripe`),ft=String.raw,pt=document.createElement(`style`);pt.textContent=ft`\n form {\n display: flex;\n flex-direction: column;\n gap: calc(${$.vars.spacingUnit} * 8);\n }\n button {\n background: ${$.vars.accent};\n border-radius: ${$.vars.radius};\n color: ${$.vars.background};\n cursor: pointer;\n font-weight: 500;\n padding: calc(${$.vars.spacingUnit} * 4) calc(${$.vars.spacingUnit} * 8);\n width: 100%;\n }\n button:hover:not(:disabled) {\n opacity: 0.85;\n }\n button:disabled {\n cursor: default;\n opacity: 0.5;\n }\n`,$.root.append(pt),(async()=>{let e=await(0,ot.loadStripe)($.config.publishableKey);if(!e)throw Error(`Failed to loadStripe`);let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=(()=>{if($.config.elements?.options?.appearance?.theme)return $.config.elements?.options?.appearance?.theme;switch($.theme.colorScheme){case`light dark`:return t.matches?`night`:`stripe`;case`light`:return`stripe`;case`dark`:return`night`}})(),n=+!!t.matches;return lt({disableAnimations:!0,theme:e,variables:{borderRadius:$.theme.radius,colorBackground:$.theme.surface[n],colorDanger:$.theme.negative[n],colorPrimary:$.theme.accent[n],colorText:$.theme.foreground[n],colorTextSecondary:$.theme.muted[n],fontSizeBase:$.theme.fontSizeBase,fontFamily:$.theme.fontFamily,spacingUnit:$.theme.spacingUnit}},$.config.elements?.options?.appearance??{})},r=e.elements({appearance:n(),...$.config.elements?.options,amount:Number($.challenge.request.amount),currency:$.challenge.request.currency,mode:`payment`,paymentMethodCreation:`manual`,paymentMethodTypes:$.challenge.request.methodDetails.paymentMethodTypes});t.addEventListener(`change`,()=>{r.update({appearance:n()})});let i=document.createElement(`form`);r.create(`payment`,$.config.elements?.paymentOptions).mount(i),$.root.appendChild(i);let a=document.createElement(`button`);a.textContent=$.text.pay,a.type=`submit`,i.appendChild(a),i.onsubmit=async t=>{t.preventDefault(),$.error(),a.disabled=!0;try{await r.submit();let{paymentMethod:t,error:n}=await e.createPaymentMethod({...$.config.elements?.createPaymentMethodOptions,elements:r});if(n||!t)throw n??Error(`Failed to create payment method`);let i=await at({client:e,createToken:mt})[0].createCredential({challenge:$.challenge,context:{paymentMethod:t.id}});await $.submit(i)}catch(e){$.error(e instanceof Error?e.message:`Payment failed`)}finally{a.disabled=!1}}})();async function mt(e){let t=new URL($.config.createTokenUrl,location.origin);if(t.origin!==location.origin)throw Error(`createTokenUrl must be same-origin`);let n=await fetch(t,{method:`POST`,headers:{\"Content-Type\":`application/json`},body:JSON.stringify(e)});if(!n.ok){let e=await n.text().catch(()=>`<response body unavailable>`);throw Error(`Failed to create SPT (${n.status}): ${e}`)}return(await n.json()).spt}})();</script>";
3
3
  //# sourceMappingURL=html.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"html.gen.js","sourceRoot":"","sources":["../../../../src/stripe/server/internal/html.gen.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,IAAI,GAAG,s4kCAAs4kC,CAAA"}
1
+ {"version":3,"file":"html.gen.js","sourceRoot":"","sources":["../../../../src/stripe/server/internal/html.gen.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,IAAI,GAAG,s0kCAAs0kC,CAAA"}