@facto-to/connect 0.0.1-beta.1 → 0.0.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -81
- package/dist/browser/index.cjs +29 -20
- package/dist/browser/index.d.cts +1 -31
- package/dist/browser/index.d.ts +1 -31
- package/dist/browser/index.js +28 -19
- package/dist/card-transport-Zh-6EMPi.d.cts +63 -0
- package/dist/card-transport-Zh-6EMPi.d.ts +63 -0
- package/dist/chunk-2WJ3CACP.js +1 -0
- package/dist/chunk-MSUNZ66U.js +2 -0
- package/dist/cli/index.cjs +6 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +5 -0
- package/dist/index.d-BikZSd0p.d.cts +1030 -0
- package/dist/index.d-BikZSd0p.d.ts +1030 -0
- package/dist/react/index.cjs +0 -1
- package/dist/react/index.js +0 -1
- package/dist/server/card-connect-admin-client.cjs +2 -0
- package/dist/server/card-connect-admin-client.d.cts +318 -0
- package/dist/server/card-connect-admin-client.d.ts +318 -0
- package/dist/server/card-connect-admin-client.js +1 -0
- package/dist/server/index.cjs +1 -2
- package/dist/server/index.d.cts +1186 -291
- package/dist/server/index.d.ts +1186 -291
- package/dist/server/index.js +1 -2
- package/dist/testing/index.cjs +1 -2
- package/dist/testing/index.d.cts +2 -12
- package/dist/testing/index.d.ts +2 -12
- package/dist/testing/index.js +1 -2
- package/package.json +64 -17
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.js.map +0 -1
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.js.map +0 -1
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/testing/index.cjs.map +0 -1
- package/dist/testing/index.js.map +0 -1
package/dist/browser/index.js
CHANGED
|
@@ -34,11 +34,11 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
34
34
|
</g>
|
|
35
35
|
</g>
|
|
36
36
|
</g>
|
|
37
|
-
</svg>`,
|
|
37
|
+
</svg>`,N=`<svg width="146" height="146" viewBox="0 0 146 146" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
38
38
|
<circle cx="73" cy="73" r="73" fill="#0052FF"/>
|
|
39
39
|
<path d="M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.3432 101.617 21.4463 73.323 21.4463C46.4045 21.4463 24.3554 42.2789 22.1528 68.6124H91.4891V76.5626H22.1528C24.3554 102.896 46.4045 123.729 73.323 123.729Z" fill="white"/>
|
|
40
40
|
</svg>
|
|
41
|
-
`,
|
|
41
|
+
`,ae=`<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
42
42
|
<circle cx="128" cy="128" r="128" fill="#F3BA2F"/>
|
|
43
43
|
<path d="M88.19 111.61L128 71.8L167.83 111.63L191 88.46L128 25.46L65.02 88.44L88.19 111.61Z" fill="white"/>
|
|
44
44
|
<path d="M25.46 128L48.63 104.83L71.8 128L48.63 151.17L25.46 128Z" fill="white"/>
|
|
@@ -46,7 +46,7 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
46
46
|
<path d="M184.2 128L207.37 104.83L230.54 128L207.37 151.17L184.2 128Z" fill="white"/>
|
|
47
47
|
<path d="M151.48 127.99H151.49L128 104.5L110.64 121.86L108.64 123.86L104.52 127.98L104.5 128L104.52 128.02L128 151.5L151.49 128.01L151.5 128L151.48 127.99Z" fill="white"/>
|
|
48
48
|
</svg>
|
|
49
|
-
`,
|
|
49
|
+
`,se=`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
50
50
|
<circle cx="32" cy="32" r="32" fill="#627EEA"/>
|
|
51
51
|
<path d="M32.001 8L31.681 9.087V40.832L32.001 41.151L46.734 32.444L32.001 8Z" fill="#FFFFFF" fill-opacity="0.92"/>
|
|
52
52
|
<path d="M32.001 8L17.266 32.444L32.001 41.151V25.753V8Z" fill="#FFFFFF" fill-opacity="0.72"/>
|
|
@@ -55,7 +55,7 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
55
55
|
<path d="M32.001 41.151L46.734 32.444L32.001 25.753V41.151Z" fill="#FFFFFF"/>
|
|
56
56
|
<path d="M17.266 32.444L32.001 41.151V25.753L17.266 32.444Z" fill="#FFFFFF" fill-opacity="0.86"/>
|
|
57
57
|
</svg>
|
|
58
|
-
`,
|
|
58
|
+
`,oe=`<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
59
59
|
<path
|
|
60
60
|
d="M153.018 199.027C160.881 199.027 167.23 192.682 167.23 184.855C167.23 177.028 160.881 170.683 153.018 170.683C145.217 170.683 138.867 177.028 138.867 184.855C138.867 192.682 145.217 199.027 153.018 199.027Z"
|
|
61
61
|
fill="#19191A"
|
|
@@ -73,13 +73,13 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
73
73
|
fill="#19191A"
|
|
74
74
|
/>
|
|
75
75
|
</svg>
|
|
76
|
-
`,
|
|
76
|
+
`,re=`<svg width="182" height="184" viewBox="0 0 182 184" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
77
77
|
<path d="M90.5358 0C64.3911 0 0 65.2598 0 91.7593C0 118.259 64.3911 183.52 90.5358 183.52C116.681 183.52 181.073 118.258 181.073 91.7593C181.073 65.2609 116.682 0 90.5358 0ZM76.4273 144.23C65.4024 141.185 35.7608 88.634 38.7655 77.4599C41.7703 66.2854 93.62 36.2439 104.645 39.2892C115.67 42.3341 145.312 94.8846 142.307 106.059C139.302 117.234 87.4522 147.276 76.4273 144.23Z" fill="#6E54FF"/>
|
|
78
78
|
</svg>
|
|
79
|
-
`,
|
|
79
|
+
`,ie=`<svg width="100" height="101" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
80
80
|
<path d="M100 50.7706C100 51.2827 99.9928 51.7947 99.9783 52.3067H75.659V51.1876H52.2523C52.2523 50.9535 52.2596 50.7194 52.2596 50.4927C52.2596 50.2659 52.2596 50.0245 52.2523 49.7978H75.659V48.686H99.9566C99.9855 49.3809 100 50.0758 100 50.7706ZM51.8395 45.7309L74.7465 42.8855L74.8841 43.9973L99.073 40.991C98.8413 39.7914 98.566 38.6065 98.2546 37.4434L74.4424 40.4059L74.58 41.5177L51.5643 44.3777C51.6657 44.8312 51.7598 45.2847 51.8395 45.7455V45.7309ZM50.6446 41.2543L72.5377 35.7318L72.8056 36.8144L96.0385 30.9554C95.5605 29.8216 95.0463 28.7025 94.4959 27.6126L71.9438 33.3034L72.2118 34.3859L50.1376 39.9597C50.3187 40.3912 50.4852 40.8228 50.6446 41.2617V41.2543ZM48.7036 37.0631L69.17 29.2584L69.5611 30.3044L91.2152 22.0462C90.5127 21.0075 89.774 19.9981 88.9919 19.018L68.2937 26.9104L68.6848 27.9564L47.9722 35.8562C48.2257 36.2512 48.4719 36.6535 48.7036 37.0631ZM46.0168 33.1863L64.0933 23.67L64.6002 24.6648L84.5887 14.1391C83.6689 13.2394 82.7129 12.3836 81.728 11.5571L62.9418 21.4464L63.4487 22.4412L45.0681 32.1184C45.3867 32.4695 45.7054 32.8206 46.0096 33.1863H46.0168ZM41.657 29.0024L58.0243 18.4913L58.6182 19.4349L76.6802 7.83394C75.5432 7.10248 74.3844 6.42222 73.1895 5.78585L56.699 16.3774L57.2929 17.321L40.4548 28.1319C40.8676 28.4099 41.2659 28.7025 41.6642 29.0024H41.657ZM37.7897 26.5593L51.5064 15.1997L52.2089 16.0629L67.6564 3.26231C66.3456 2.7576 64.9986 2.3041 63.637 1.90911L49.9348 13.2614L50.6373 14.1245L36.4209 25.901C36.8844 26.1058 37.3407 26.3252 37.7897 26.5593ZM32.6695 24.5478L43.5038 13.6564L44.2787 14.4463L58.0461 0.629056C56.5542 0.380359 55.0406 0.197494 53.5052 0.0804606L41.7656 11.8789L42.5406 12.6689L31.0979 24.1674C31.6266 24.2772 32.148 24.4015 32.6695 24.5478ZM26.6802 23.6335L35.3201 13.0566L36.1747 13.7661L47.4218 0C45.7126 0.0804606 44.0252 0.248696 42.3667 0.497393L33.4082 11.462L34.2627 12.1715L24.9059 23.6262C25.1666 23.6188 25.4345 23.6115 25.6952 23.6115C26.0284 23.6115 26.3543 23.6115 26.6802 23.6262V23.6335ZM21.502 23.948L28.1576 13.5466L29.0846 14.1538L37.1307 1.57264C35.2911 2.0554 33.4951 2.64057 31.7425 3.32083L26.0791 12.1788L27.0061 12.7859L19.6335 24.3137C20.2491 24.1674 20.872 24.0431 21.502 23.9407V23.948ZM15.7517 25.5645L20.5388 16.5017L21.5093 17.0284L27.8462 5.03976C25.8111 6.04186 23.8557 7.17562 21.9873 8.43373L18.3444 15.3241L19.3221 15.8507L13.6877 26.5154C14.354 26.1716 15.042 25.8571 15.7445 25.5718L15.7517 25.5645ZM11.6237 27.6931L13.6587 21.856L14.7016 22.2291L18.6559 10.8914C16.6498 12.5007 14.7668 14.2562 13.0214 16.1506L11.3195 21.0295L12.3624 21.4025L9.69728 29.039C10.3201 28.5635 10.9574 28.1173 11.6165 27.7004L11.6237 27.6931ZM6.54693 31.8697L7.44496 27.6272L8.52404 27.8613L10.3346 19.3179C8.4299 21.7609 6.74247 24.3869 5.30127 27.1591L6.10516 27.3347L4.45394 34.3567C5.09849 33.4862 5.80098 32.6524 6.54693 31.8697ZM2.81721 36.829V31.2114C1.47016 34.8029 0.514195 39.2721 0 43.6535C0.630069 41.2251 1.58604 38.9356 2.81721 36.829ZM0.0362109 57.4781C0.56489 61.2159 1.49189 64.822 2.781 68.2525V64.1052C1.59328 62.0571 0.659038 59.8334 0.0362109 57.4781ZM4.62775 66.8774L6.06895 73.6653L5.26506 73.8409C6.70626 76.6204 8.39369 79.2391 10.2984 81.6821L8.48783 73.1387L7.40875 73.3727L6.49623 69.0791C5.8372 68.3769 5.20713 67.6454 4.62775 66.8701V66.8774ZM9.64658 71.9245L12.3262 79.6048L11.2833 79.9778L12.9852 84.8567C14.7306 86.7512 16.6136 88.5067 18.6196 90.1159L14.6654 78.7782L13.6225 79.1513L11.5802 73.285C10.9212 72.8607 10.2767 72.4145 9.65382 71.9391L9.64658 71.9245ZM13.6443 74.4626L19.2932 85.1566L18.3155 85.6832L21.9583 92.5736C23.8268 93.8317 25.7822 94.9655 27.8172 95.9676L21.4803 83.9789L20.5026 84.5056L15.701 75.4208C14.9986 75.1356 14.3105 74.8137 13.637 74.4699L13.6443 74.4626ZM19.5901 76.6716L26.9699 88.2141L26.0429 88.8212L31.7063 97.6792C33.4589 98.3594 35.2549 98.9446 37.0944 99.4274L29.0484 86.8463L28.1214 87.4534L21.4586 77.0374C20.8285 76.935 20.1984 76.8106 19.5828 76.6643L19.5901 76.6716ZM24.8624 77.3738L34.2193 88.8285L33.3647 89.538L42.3233 100.503C43.9818 100.751 45.6692 100.92 47.3783 101L36.1312 87.2266L35.2766 87.9361L26.6367 77.3592C26.3253 77.3738 26.0067 77.3738 25.688 77.3738C25.4128 77.3738 25.1304 77.3738 24.8552 77.3592L24.8624 77.3738ZM31.0689 76.8326L42.5043 88.3238L41.7294 89.1138L53.469 100.912C55.0043 100.795 56.518 100.612 58.0098 100.364L44.2497 86.539L43.4676 87.3363L32.6405 76.4522C32.1263 76.5912 31.5976 76.7228 31.0689 76.8326ZM36.3992 75.1136L50.6011 86.8828L49.8986 87.7459L63.6008 99.0982C64.9623 98.7032 66.3094 98.2497 67.6202 97.745L52.1654 84.9444L51.4629 85.8076L37.7607 74.4553C37.3117 74.6894 36.8554 74.9088 36.3919 75.1136H36.3992ZM40.4258 72.8754L57.2422 83.679L56.6483 84.6226L73.1388 95.2141C74.3337 94.5778 75.4997 93.8902 76.6295 93.1661L58.5675 81.5651L57.9736 82.5087L41.628 72.0122C41.2297 72.3121 40.8314 72.6047 40.4186 72.8827L40.4258 72.8754ZM45.0608 68.8962L63.4198 78.5588L62.9128 79.5536L81.699 89.4429C82.684 88.6164 83.6399 87.7606 84.5597 86.8609L64.5713 76.3352L64.0643 77.33L46.0096 67.8283C45.7054 68.194 45.394 68.5524 45.0681 68.8962H45.0608ZM47.9649 65.1511L68.6486 73.0436L68.2575 74.0896L88.9557 81.982C89.7306 81.0019 90.4693 79.9925 91.179 78.9538L69.5249 70.6956L69.1338 71.7416L48.6964 63.9442C48.4647 64.3539 48.2184 64.7562 47.9649 65.1511ZM50.1304 61.055L72.1683 66.6141L71.9003 67.6966L94.4525 73.3874C95.0101 72.2975 95.5243 71.1784 96.0023 70.0446L72.7694 64.1856L72.5014 65.2682L50.6373 59.753C50.478 60.1918 50.3042 60.6234 50.1304 61.055ZM51.5643 56.637L74.5437 59.4896L74.4061 60.6015L98.2184 63.5639C98.5298 62.3935 98.805 61.2086 99.0368 60.0163L74.8479 57.01L74.7103 58.1218L51.8395 55.2764C51.7598 55.7373 51.6657 56.1908 51.5643 56.6443V56.637Z" fill="black"/>
|
|
81
81
|
</svg>
|
|
82
|
-
`,
|
|
82
|
+
`,de=`<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
83
83
|
<path d="M186.384 171.561L243.497 138.588C246.518 136.842 248.397 133.591 248.397 130.099V64.1433C248.397 60.6566 246.518 57.4003 243.497 55.6543L186.384 22.6815C183.363 20.9356 179.605 20.9407 176.584 22.6815L119.47 55.6543C116.45 57.4003 114.571 60.6515 114.571 64.1433V182.001L74.5219 205.117L34.4733 182.001V135.752L74.5219 112.635L100.941 127.882V96.8601L79.4218 84.439C77.937 83.5839 76.2422 83.1334 74.5219 83.1334C72.8016 83.1334 71.1069 83.5839 69.6221 84.439L12.5034 117.417C9.48256 119.163 7.60352 122.414 7.60352 125.906V191.857C7.60352 195.343 9.48256 198.6 12.5034 200.346L69.617 233.323C72.6378 235.064 76.3907 235.064 79.4166 233.323L136.53 200.351C139.551 198.605 141.43 195.348 141.43 191.862V74.0044L142.152 73.5897L181.479 50.8876L221.527 74.0095V120.253L181.479 143.375L155.1 128.148V159.171L176.579 171.576C179.6 173.317 183.358 173.317 186.379 171.576L186.384 171.561Z" fill="url(#paint0_linear_polygon)"/>
|
|
84
84
|
<defs>
|
|
85
85
|
<linearGradient id="paint0_linear_polygon" x1="28.0733" y1="200.863" x2="235.024" y2="49.9609" gradientUnits="userSpaceOnUse">
|
|
@@ -89,7 +89,7 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
89
89
|
</linearGradient>
|
|
90
90
|
</defs>
|
|
91
91
|
</svg>
|
|
92
|
-
`,
|
|
92
|
+
`,ce=`<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 115.87 149.53">
|
|
93
93
|
<defs>
|
|
94
94
|
<style>
|
|
95
95
|
.cls-1 {
|
|
@@ -103,41 +103,51 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
103
103
|
d="m.86,149.53h3.3c.6,0,1.2-.3,1.4-.8C30.46,85.33,57.56,53.93,74.56,35.13c.7-.8.4-1.4-.6-1.4h-30.4c-1.1,0-2.03.44-2.8,1.4l-21.8,27c-3.2,4-4,7.7-4,13v27.6C7.86,122.63,3.36,136.13.06,148.33c-.2.78.1,1.2.8,1.2ZM110.56,4.03c-4.7-5-25.9-5.2-35.7-1.4-2.04.79-4,2.13-4.9,2.9-9,7.7-15,13.8-20.7,19.8-.7.7-.4,1.4.6,1.4h33.7c3.1,0,4.9,1.8,4.9,4.9v38c0,1,.8,1.3,1.4.4l20.3-26.5c3.3-4.3,4.3-5.6,5.2-11.6,1.2-8.8.5-22.3-4.8-27.9Zm-43.5,100.8l13.9-22.9c.3-.6.4-1.3.4-1.8v-38.2c0-1-.7-1.4-1.4-.6-20.9,23.3-37.2,47.8-52.3,77.3-.38.74.1,1.4,1,1.1l31.2-9.6c3.52-1.08,5.5-2.5,7.2-5.3Z"
|
|
104
104
|
/>
|
|
105
105
|
</svg>
|
|
106
|
-
`,
|
|
106
|
+
`,le=`<svg width="534" height="535" viewBox="0 0 534 535" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
107
107
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M266.012 534.324C345.239 534.324 416.418 499.892 465.377 445.186C442.603 425.407 408.28 424.206 384.034 443.755L379.402 447.49C335.007 483.284 270.32 477.998 232.336 435.472C211.619 412.279 176.14 409.911 152.52 430.145L99.1133 475.895C144.855 512.46 202.878 534.324 266.012 534.324ZM352.701 404.955C394.986 370.862 454.42 372.084 495.089 405.013C519.397 364.767 533.383 317.597 533.383 267.162C533.383 211.12 516.115 159.11 486.604 116.151C467.58 112.103 446.96 116.831 431.307 130.691L426.852 134.636C384.158 172.44 319.295 170.142 279.388 129.414C257.622 107.201 222.07 106.471 199.41 127.773L137.261 186.196L103.072 149.884L165.222 91.4612C207.669 51.5576 274.266 52.924 315.039 94.535C336.343 116.277 370.969 117.504 393.76 97.3227L398.215 93.3779C412.05 81.1279 428.057 72.8695 444.815 68.5261C397.446 25.9257 334.759 0 266.012 0C130.284 0 18.1773 101.056 0.938963 231.975C42.1649 212.207 93.0169 219.814 126.631 254.209C147.852 275.922 182.02 278.214 205.955 259.53L240.704 232.404C284.374 198.313 346.109 199.963 387.893 236.339L455.545 295.234L422.769 332.824L355.117 273.929C331.358 253.245 296.254 252.306 271.421 271.692L236.673 298.817C192.698 333.146 129.921 328.935 90.9332 289.041C68.262 265.843 31.183 265.033 7.51958 287.22L0 294.27C5.62745 350.071 28.4393 400.803 63.0671 441.104L120.044 392.295C164.29 354.392 230.753 358.827 269.561 402.275C289.838 424.976 324.37 427.798 348.069 408.69L352.701 404.955Z" fill="#9E1F19"/>
|
|
108
108
|
</svg>
|
|
109
|
-
`,
|
|
109
|
+
`,pe=`<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
110
110
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M118.566 0.0743864C117.783 0.164683 115.403 0.432728 113.278 0.670672C111.152 0.908616 107.765 1.37434 105.751 1.70624C103.738 2.03774 99.5812 2.94436 96.5146 3.72043C93.4481 4.49649 88.5052 5.97663 85.5306 7.00935C82.556 8.04247 77.6506 10.0156 74.6301 11.3944C71.6095 12.7733 66.6667 15.3391 63.6462 17.0958C60.6256 18.8528 56.9642 21.114 55.5098 22.1206C54.0556 23.1269 50.9434 25.4332 48.5941 27.2452C46.2447 29.0573 41.2905 33.5607 37.5853 37.2532C33.8796 40.9455 29.4674 45.7056 27.7803 47.8308C26.0932 49.9561 23.4888 53.5008 21.9929 55.7083C20.4971 57.9156 18.1485 61.6679 16.7739 64.0464C15.3989 66.4251 13.2778 70.4763 12.0602 73.0489C10.8426 75.6215 9.06603 79.7398 8.11246 82.2006C7.15889 84.6614 5.63579 89.2636 4.72778 92.4282C3.81977 95.5922 2.62171 100.534 2.06478 103.41C1.50785 106.286 0.810983 110.561 0.516044 112.909C0.182864 115.566 -0.0124056 121.411 0.000612383 128.366C0.0164781 136.7 0.202797 140.847 0.732061 144.635C1.12261 147.432 1.98911 152.191 2.65751 155.211C3.3255 158.231 4.53577 162.898 5.34613 165.583C6.15651 168.267 7.5893 172.386 8.52985 174.734C9.47041 177.083 10.9252 180.47 11.7619 182.259C12.5992 184.049 14.2911 187.343 15.5226 189.581C16.7535 191.818 19.2648 195.936 21.1032 198.733C22.9412 201.528 25.9809 205.739 27.858 208.087C29.7346 210.436 34.024 215.113 37.3896 218.478C40.7551 221.845 45.4311 226.122 47.7804 227.985C50.1297 229.847 54.3402 232.886 57.1371 234.739C59.9339 236.59 64.6152 239.389 67.5393 240.957C70.4639 242.526 73.576 244.119 74.4551 244.499C75.3347 244.879 78.3423 246.102 81.1391 247.217C83.9359 248.332 87.9634 249.762 90.0889 250.396C92.2146 251.029 95.4829 251.936 97.3518 252.412C99.2211 252.886 103.34 253.711 106.505 254.245C109.67 254.779 115.281 255.434 118.973 255.701C122.934 255.987 128.352 256.08 132.194 255.927C135.774 255.784 140.351 255.476 142.364 255.242C144.378 255.008 148.04 254.451 150.501 254.004C152.962 253.556 156.806 252.736 159.044 252.179C161.281 251.622 164.851 250.615 166.977 249.94C169.102 249.265 172.947 247.888 175.52 246.878C178.092 245.87 182.787 243.702 185.95 242.059C189.113 240.418 193.567 237.914 195.848 236.496C198.128 235.077 202.07 232.36 204.606 230.459C207.142 228.557 211.244 225.183 213.722 222.959C216.2 220.736 219.665 217.349 221.42 215.434C223.177 213.519 226.191 209.99 228.119 207.593C230.047 205.195 232.98 201.169 234.637 198.645C236.295 196.121 238.622 192.328 239.809 190.216C240.996 188.105 243.132 183.832 244.555 180.721C245.978 177.61 247.88 172.932 248.782 170.324C249.684 167.716 251.129 162.838 251.992 159.482C252.857 156.127 253.944 150.885 254.407 147.834C254.871 144.784 255.465 139.066 255.727 135.129C256.092 129.639 256.092 126.283 255.723 120.745C255.458 116.771 254.879 111.14 254.437 108.232C253.995 105.324 252.983 100.335 252.189 97.146C251.396 93.9567 250.007 89.1978 249.101 86.5706C248.195 83.9435 246.717 80.055 245.813 77.9298C244.91 75.8046 243.366 72.4587 242.381 70.495C241.396 68.5312 239.371 64.8709 237.881 62.3617C236.391 59.8522 234.075 56.2427 232.734 54.3403C231.391 52.438 228.729 48.9596 226.817 46.6107C224.903 44.2617 221.229 40.224 218.651 37.6375C216.073 35.0514 212.408 31.6539 210.505 30.0879C208.604 28.5216 205.857 26.3361 204.404 25.231C202.949 24.1259 200.204 22.1951 198.301 20.9402C196.399 19.6851 193.361 17.81 191.551 16.7728C189.741 15.7356 185.621 13.6247 182.397 12.081C179.174 10.5378 174.211 8.43417 171.368 7.40674C168.526 6.3789 163.767 4.90771 160.791 4.13693C157.816 3.36615 153.918 2.45221 152.128 2.10566C150.338 1.75912 146.769 1.18724 144.195 0.834997C141.412 0.453879 135.561 0.137024 129.753 0.0524219C124.383 -0.025266 119.35 -0.0155039 118.566 0.0743864ZM142.567 16.5064C145.589 16.929 149.799 17.6624 151.925 18.1362C154.05 18.6105 157.345 19.4358 159.247 19.971C161.149 20.5058 163.895 21.3913 165.35 21.9388L167.994 22.9341L168.104 32.6089C168.163 37.9303 168.053 42.4431 167.858 42.6375C167.658 42.8381 165.583 42.557 163.071 41.9892C160.632 41.4381 157.355 40.7893 155.789 40.5474C154.223 40.3054 151.294 39.9116 149.28 39.6724C147.266 39.4332 142.232 39.2372 138.093 39.2372C133.954 39.2367 128.828 39.4402 126.703 39.6887C124.577 39.9372 120.915 40.5176 118.566 40.9784C116.216 41.4389 112.038 42.5514 109.282 43.4502C106.525 44.3492 101.766 46.3251 98.7049 47.8414C95.6444 49.3573 91.4924 51.7595 89.4788 53.1799C87.465 54.6002 83.8916 57.6842 81.5378 60.0332C79.1839 62.382 76.3207 65.5644 75.1748 67.1051C74.0292 68.6459 72.2644 71.2999 71.2531 73.003C70.2422 74.706 68.7419 77.7293 67.9189 79.7211C67.0963 81.7129 65.9829 85.2821 65.445 87.6526C64.7051 90.913 64.4675 93.151 64.4687 96.8433C64.4699 100.053 64.7332 102.978 65.2372 105.385C65.6586 107.398 66.6334 110.525 67.4026 112.333C68.1723 114.141 69.4192 116.521 70.1734 117.621C70.928 118.721 72.3768 120.516 73.3926 121.61C74.4088 122.704 76.2138 124.32 77.4033 125.201C78.5932 126.084 80.8868 127.433 82.5003 128.198C84.1137 128.964 86.71 129.861 88.2701 130.192C89.8298 130.522 92.8748 130.796 95.0366 130.799C97.1985 130.803 100.311 130.549 101.952 130.235C103.594 129.921 106.127 129.263 107.58 128.773C109.033 128.284 111.585 127.246 113.25 126.466C114.914 125.687 121.231 122.198 127.286 118.714C133.342 115.229 140.493 111.096 143.178 109.529C145.863 107.963 148.932 106.161 149.998 105.524C151.065 104.888 152.017 104.368 152.115 104.368C152.213 104.368 154.086 103.299 156.279 101.993C158.471 100.687 162.827 98.1424 165.96 96.339C169.092 94.5351 180.899 87.7119 192.199 81.1764C203.498 74.6405 214.427 68.3075 216.485 67.1036C218.543 65.8992 220.408 64.914 220.63 64.914C220.852 64.914 222.021 66.5158 223.227 68.4731C224.433 70.4307 226.444 73.954 227.694 76.3028C228.945 78.6518 230.648 82.221 231.479 84.2343C232.31 86.2477 233.619 89.7237 234.39 91.9592C235.16 94.1943 236.322 98.221 236.97 100.907C237.618 103.594 238.425 107.402 238.763 109.37C239.1 111.338 239.586 115.087 239.842 117.704C240.121 120.566 240.218 125.862 240.085 131.006C239.964 135.705 239.564 141.473 239.198 143.822C238.832 146.171 238.067 150.198 237.498 152.77C236.929 155.343 235.913 159.187 235.24 161.312C234.567 163.437 233.136 167.373 232.062 170.057C230.988 172.742 228.976 177.134 227.59 179.819C226.205 182.503 223.556 186.988 221.703 189.784C219.85 192.581 217.084 196.424 215.555 198.325C214.026 200.227 210.846 203.768 208.487 206.196C206.129 208.623 202.735 211.847 200.945 213.36C199.155 214.873 196.195 217.231 194.365 218.6C192.535 219.969 188.89 222.387 186.265 223.972C183.64 225.557 180.102 227.552 178.404 228.403C176.706 229.256 173.577 230.69 171.451 231.591C169.326 232.492 165.665 233.87 163.315 234.653C160.966 235.436 156.755 236.632 153.959 237.31C151.162 237.988 146.769 238.875 144.195 239.279C140.449 239.868 137.165 240.012 127.719 240C117.49 239.986 115.192 239.864 110.431 239.078C107.411 238.581 102.56 237.542 99.6503 236.769C96.7408 235.996 93.0099 234.903 91.359 234.341C89.7082 233.779 88.1062 233.111 87.7994 232.856C87.3555 232.487 87.2412 230.444 87.2412 222.884C87.2412 213.976 87.2877 213.375 87.9784 213.375C88.3836 213.375 90.0772 213.726 91.7414 214.154C93.4057 214.584 96.5065 215.222 98.632 215.576C100.758 215.928 104.327 216.409 106.565 216.645C108.802 216.88 114.02 217.077 118.159 217.08C122.814 217.084 127.547 216.837 130.567 216.433C133.252 216.073 137.371 215.344 139.721 214.813C142.07 214.282 146.006 213.128 148.467 212.248C150.928 211.368 154.04 210.129 155.382 209.494C156.725 208.859 159.345 207.461 161.204 206.387C163.063 205.314 165.992 203.381 167.712 202.093C169.433 200.804 172.255 198.402 173.985 196.755C175.715 195.107 178.474 191.995 180.114 189.839C181.755 187.685 183.827 184.638 184.719 183.073C185.611 181.507 186.995 178.658 187.797 176.744C188.597 174.829 189.678 171.626 190.197 169.626C191.009 166.505 191.141 165.01 191.136 159.074C191.128 152.738 191.036 151.862 190.033 148.586C189.432 146.62 188.28 143.703 187.474 142.104C186.669 140.504 185.314 138.253 184.464 137.103C183.612 135.952 181.787 133.988 180.406 132.737C179.025 131.488 176.647 129.811 175.122 129.009C173.596 128.207 171.093 127.14 169.561 126.637C167.148 125.845 165.925 125.723 160.468 125.732C155.584 125.739 153.611 125.907 151.721 126.475C150.378 126.879 147.999 127.68 146.432 128.254C144.866 128.83 142.578 129.803 141.348 130.418C140.116 131.032 136.73 132.9 133.821 134.57C130.913 136.239 119.105 143.058 107.582 149.724C96.059 156.388 84.7088 162.94 82.3595 164.282C80.0102 165.624 77.5387 167.039 76.8675 167.425C76.1963 167.811 74.5488 168.762 73.2063 169.539C71.8638 170.315 66.5548 173.379 61.4086 176.346C56.2625 179.313 48.367 183.917 43.8632 186.577C39.3593 189.235 35.484 191.411 35.2514 191.411C35.0187 191.411 33.2665 188.802 31.3573 185.614C29.4482 182.425 27.1237 178.169 26.192 176.157C25.26 174.144 23.7788 170.667 22.9009 168.43C22.0226 166.193 20.6899 162.258 19.9393 159.685C19.1888 157.113 18.195 153.252 17.7307 151.104C17.2666 148.958 16.5762 144.841 16.1967 141.954C15.7309 138.411 15.5071 133.86 15.5083 127.959C15.5096 121.992 15.7305 117.599 16.2032 114.13C16.5844 111.333 17.2743 107.215 17.736 104.978C18.1982 102.741 19.203 98.7489 19.9694 96.1067C20.7363 93.4641 22.1874 89.2194 23.1942 86.6736C24.2015 84.1281 26.0855 79.9753 27.3804 77.4454C28.6757 74.9154 30.1545 72.1134 30.667 71.2185C31.1792 70.3238 32.7523 67.8528 34.1628 65.7276C35.5731 63.6023 37.9445 60.3077 39.4322 58.4061C40.9203 56.5046 43.7757 53.1766 45.7777 51.0108C47.7796 48.8449 51.3481 45.4066 53.7073 43.3705C56.0663 41.334 59.3136 38.7007 60.923 37.5187C62.5326 36.3367 65.7717 34.1713 68.121 32.7069C70.4705 31.2422 74.5894 28.9381 77.2744 27.5865C79.9594 26.2348 82.8884 24.8235 83.7834 24.45C84.6783 24.0763 87.2555 23.0736 89.5101 22.2219C91.7651 21.3702 96.1587 20.0255 99.2736 19.2336C102.389 18.4416 105.945 17.6119 107.175 17.3898C108.406 17.1678 110.786 16.774 112.464 16.5145C114.141 16.255 117.437 15.8873 119.786 15.6974C122.136 15.5074 126.987 15.4387 130.567 15.5448C134.146 15.6514 139.547 16.0842 142.567 16.5064ZM73.3132 207.135C73.9259 207.589 74.8355 208.676 75.3355 209.549C75.8351 210.423 76.2471 211.83 76.2509 212.676C76.2545 213.522 76.0063 214.803 75.6996 215.524C75.3928 216.244 74.7038 217.236 74.1683 217.728C73.633 218.221 72.4817 218.922 71.6095 219.287C70.5538 219.727 69.5356 219.859 68.5637 219.679C67.7611 219.53 66.5182 219.048 65.8022 218.609C65.0866 218.168 64.1253 217.201 63.6665 216.459C63.0912 215.528 62.8325 214.418 62.8325 212.879C62.8325 211.233 63.0746 210.288 63.7576 209.275C64.2661 208.521 65.3189 207.472 66.0968 206.943C67.2794 206.139 67.8948 206.008 69.8553 206.145C71.3683 206.251 72.5952 206.603 73.3132 207.135ZM66.982 208.002C66.2436 208.407 65.2839 209.279 64.849 209.938C64.3983 210.622 64.0578 211.838 64.057 212.765C64.0566 213.665 64.4109 214.974 64.8503 215.694C65.2868 216.411 66.2318 217.3 66.9498 217.672C67.8481 218.136 68.8338 218.282 70.1067 218.138C71.5599 217.975 72.2397 217.622 73.2693 216.499C73.9906 215.711 74.7025 214.42 74.851 213.629C75.0422 212.609 74.9014 211.748 74.3669 210.674C73.9523 209.839 73.1395 208.812 72.5606 208.389C71.9821 207.967 70.7922 207.54 69.9163 207.443C68.8606 207.325 67.8725 207.513 66.982 208.002ZM71.9406 210.113C72.4081 210.571 72.6054 211.137 72.4451 211.555C72.201 212.191 72.1054 212.194 71.1823 211.588C70.6331 211.229 69.7158 210.934 69.1438 210.934C68.4209 210.934 67.958 211.255 67.626 211.984C67.2965 212.706 67.2762 213.234 67.5601 213.685C67.7867 214.044 68.2838 214.533 68.6645 214.771C69.1852 215.097 69.6662 215.029 70.6027 214.493C71.2877 214.102 72.0167 213.782 72.2221 213.782C72.4276 213.782 72.596 214.137 72.596 214.573C72.596 215.007 72.1892 215.647 71.6917 215.995C71.1945 216.344 70.1734 216.629 69.4233 216.629C68.4571 216.629 67.711 216.281 66.8693 215.44C66.0248 214.596 65.6826 213.859 65.6891 212.898C65.694 212.154 66.0146 211.141 66.4011 210.647C66.7879 210.155 67.5617 209.567 68.121 209.343C68.6804 209.119 69.5957 209.03 70.1551 209.147C70.7144 209.263 71.518 209.698 71.9406 210.113Z" fill="white"/>
|
|
111
111
|
<path d="M78.4936 203.229H60.8047V222.006H78.4936V203.229Z" fill="white"/>
|
|
112
112
|
</svg>
|
|
113
|
-
`,
|
|
113
|
+
`,U=`<svg width="256" height="256" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
114
114
|
<path
|
|
115
115
|
d="M0 0C22.11 0 44.22 0 67 0C64.71 10.29 64.71 10.29 63 15.44C62.67 16.45 62.34 17.46 62 18.5C61 21 61 21 59 23C56.85 23.32 56.85 23.32 54.21 23.41C52.8 23.47 52.8 23.47 51.36 23.53C50.37 23.56 49.39 23.59 48.38 23.62C47.38 23.66 46.39 23.7 45.37 23.74C42.91 23.84 40.46 23.92 38 24C37.83 24.52 37.66 25.04 37.48 25.58C35.7 31 33.92 36.42 32.13 41.83C31.46 43.86 30.8 45.88 30.13 47.9C29.18 50.81 28.22 53.71 27.26 56.62C26.96 57.53 26.67 58.43 26.36 59.37C26.08 60.21 25.8 61.05 25.51 61.92C25.27 62.66 25.02 63.4 24.77 64.17C24 66 24 66 22 68C19.85 68.23 19.85 68.23 17.21 68.2C16.27 68.19 15.33 68.18 14.36 68.18C13.37 68.16 12.39 68.14 11.38 68.12C10.38 68.12 9.39 68.11 8.37 68.1C5.91 68.07 3.46 68.04 1 68C-0.12 64.65 0.08 64.01 1.17 60.8C1.45 59.96 1.73 59.12 2.02 58.26C2.33 57.35 2.64 56.45 2.96 55.52C3.28 54.59 3.59 53.66 3.91 52.71C4.91 49.74 5.92 46.78 6.94 43.81C7.62 41.8 8.3 39.79 8.97 37.78C10.64 32.85 12.32 27.93 14 23C7.4 23 0.8 23 -6 23C-7.11 19.66 -6.92 19.03 -5.82 15.84C-5.55 15.05 -5.28 14.25 -5 13.44C-4.57 12.2 -4.57 12.2 -4.12 10.94C-3.84 10.11 -3.56 9.28 -3.27 8.43C-1.2 2.4 -1.2 2.4 0 0Z"
|
|
116
116
|
fill="#000000"
|
|
117
117
|
transform="translate(70 66)"
|
|
118
118
|
/>
|
|
119
119
|
</svg>
|
|
120
|
-
`,
|
|
120
|
+
`,ue='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill-opacity=".5" d="M17.82 14.342v4.672h1.275c.172 0 .312-.14.312-.311v-4.05a.31.31 0 0 0-.312-.312zm0-9.356v4.673h1.275c.172 0 .312-.14.312-.312v-4.05a.31.31 0 0 0-.312-.311z"/><path fill-opacity=".3" d="M20.209 4.986v4.673h.477c.172 0 .311-.14.311-.312v-4.05a.31.31 0 0 0-.311-.311zm.002 9.356v4.672h.477c.172 0 .312-.14.312-.311v-4.05a.31.31 0 0 0-.312-.312z"/><path d="M12.026 9.67h-4.03a.31.31 0 0 0-.31.307v4.002c0 .17.138.308.31.308h4.03a.31.31 0 0 0 .31-.308V9.977a.31.31 0 0 0-.31-.308M7.361 4.986h-4.05A.31.31 0 0 0 3 5.297v4.05c0 .172.14.312.312.312h4.05c.171 0 .31-.14.31-.312v-4.05a.31.31 0 0 0-.31-.311m9.343 0h-4.05a.31.31 0 0 0-.311.311v4.05c0 .172.14.312.311.312h4.05c.172 0 .312-.14.312-.312v-4.05a.31.31 0 0 0-.312-.311M7.361 14.33h-4.05a.31.31 0 0 0-.311.313v4.05c0 .171.14.31.312.31h4.05a.31.31 0 0 0 .31-.31v-4.05a.31.31 0 0 0-.31-.312m9.343-.001h-4.05a.31.31 0 0 0-.311.313v4.05c0 .171.14.31.311.31h4.05a.31.31 0 0 0 .312-.31v-4.05a.31.31 0 0 0-.312-.312"/></svg>',z=[{chainId:1,name:"Ethereum",gasSymbol:"ETH",explorerUrl:"https://etherscan.io",logo:se,logoTheme:"normal",testnet:!1},{chainId:56,name:"BNB",gasSymbol:"BNB",explorerUrl:"https://bscscan.com",logo:ae,logoTheme:"normal",testnet:!1},{chainId:137,name:"Polygon",gasSymbol:"POL",explorerUrl:"https://polygonscan.com",logo:de,logoTheme:"normal",testnet:!1},{chainId:143,name:"Monad",gasSymbol:"MON",explorerUrl:"https://monadscan.com",logo:re,logoTheme:"normal",testnet:!1},{chainId:196,name:"X Layer",gasSymbol:"OKB",explorerUrl:"https://www.oklink.com/x-layer/evm",logo:ue,logoTheme:"invertOnDark",testnet:!1},{chainId:988,name:"Stable Mainnet",gasSymbol:"USDT0",explorerUrl:"https://stablescan.xyz",logo:pe,logoTheme:"invertOnLight",testnet:!1},{chainId:1329,name:"Sei",gasSymbol:"SEI",explorerUrl:"https://seiscan.io",logo:le,logoTheme:"normal",testnet:!1},{chainId:4217,name:"Tempo",gasSymbol:"TMPO",explorerUrl:"https://explore.tempo.xyz",logo:U,logoTheme:"normal",testnet:!1},{chainId:4326,name:"MegaETH",gasSymbol:"ETH",explorerUrl:"https://mega.etherscan.io",logo:oe,logoTheme:"normal",testnet:!1},{chainId:8453,name:"Base",gasSymbol:"ETH",explorerUrl:"https://basescan.org",logo:N,logoTheme:"normal",testnet:!1},{chainId:9745,name:"Plasma",gasSymbol:"XPL",explorerUrl:"https://plasmascan.to",logo:ie,logoTheme:"normal",testnet:!1},{chainId:42161,name:"Arbitrum",gasSymbol:"ETH",explorerUrl:"https://arbiscan.io",logo:R,logoTheme:"normal",testnet:!1},{chainId:42431,name:"Tempo Moderato",gasSymbol:"TMPO",explorerUrl:"https://explore.tempo.xyz",logo:U,logoTheme:"normal",testnet:!0},{chainId:46630,name:"Robinhood Testnet",gasSymbol:"ETH",explorerUrl:"https://explorer.testnet.chain.robinhood.com",logo:ce,logoTheme:"normal",testnet:!0},{chainId:84532,name:"Base Sepolia",gasSymbol:"ETH",explorerUrl:"https://sepolia.basescan.org",logo:N,logoTheme:"normal",testnet:!0},{chainId:421614,name:"Arbitrum Sepolia",gasSymbol:"ETH",explorerUrl:"https://sepolia.arbiscan.io",logo:R,logoTheme:"normal",testnet:!0}],T=Object.fromEntries(z.map(e=>[e.chainId,e])),me=`<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
121
121
|
<!-- PLACEHOLDER \u2014 not final artwork. See src/assets/chains/README.md. -->
|
|
122
122
|
<circle cx="50" cy="50" r="47" fill="#E5E7EB" stroke="#9CA3AF" stroke-width="2" stroke-dasharray="6 5"/>
|
|
123
123
|
<text x="50" y="58" font-family="ui-sans-serif, system-ui, sans-serif" font-size="30" font-weight="600" fill="#6B7280" text-anchor="middle">AV3</text>
|
|
124
124
|
</svg>
|
|
125
|
-
`,
|
|
125
|
+
`,ye=`<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
126
126
|
<!-- PLACEHOLDER \u2014 not final artwork. See src/assets/chains/README.md. -->
|
|
127
127
|
<circle cx="50" cy="50" r="47" fill="#E5E7EB" stroke="#9CA3AF" stroke-width="2" stroke-dasharray="6 5"/>
|
|
128
128
|
<text x="50" y="58" font-family="ui-sans-serif, system-ui, sans-serif" font-size="30" font-weight="600" fill="#6B7280" text-anchor="middle">CV2</text>
|
|
129
129
|
</svg>
|
|
130
|
-
`,
|
|
130
|
+
`,fe=`<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
131
131
|
<!-- PLACEHOLDER \u2014 not final artwork. See src/assets/chains/README.md. -->
|
|
132
132
|
<circle cx="50" cy="50" r="47" fill="#E5E7EB" stroke="#9CA3AF" stroke-width="2" stroke-dasharray="6 5"/>
|
|
133
133
|
<text x="50" y="58" font-family="ui-sans-serif, system-ui, sans-serif" font-size="30" font-weight="600" fill="#6B7280" text-anchor="middle">DL</text>
|
|
134
134
|
</svg>
|
|
135
|
-
`,
|
|
135
|
+
`,Ce=`<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
136
136
|
<!-- PLACEHOLDER \u2014 not final artwork. See src/assets/chains/README.md. -->
|
|
137
137
|
<circle cx="50" cy="50" r="47" fill="#E5E7EB" stroke="#9CA3AF" stroke-width="2" stroke-dasharray="6 5"/>
|
|
138
138
|
<text x="50" y="58" font-family="ui-sans-serif, system-ui, sans-serif" font-size="30" font-weight="600" fill="#6B7280" text-anchor="middle">MB</text>
|
|
139
139
|
</svg>
|
|
140
|
-
`,
|
|
140
|
+
`,he=`<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
141
|
+
<!-- PLACEHOLDER \u2014 not final artwork. See src/assets/chains/README.md. -->
|
|
142
|
+
<circle cx="50" cy="50" r="47" fill="#E5E7EB" stroke="#9CA3AF" stroke-width="2" stroke-dasharray="6 5"/>
|
|
143
|
+
<text x="50" y="58" font-family="ui-sans-serif, system-ui, sans-serif" font-size="30" font-weight="600" fill="#6B7280" text-anchor="middle">WL</text>
|
|
144
|
+
</svg>
|
|
145
|
+
`,be=`<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
146
|
+
<!-- PLACEHOLDER \u2014 not final artwork. See src/assets/chains/README.md. -->
|
|
147
|
+
<circle cx="50" cy="50" r="47" fill="#E5E7EB" stroke="#9CA3AF" stroke-width="2" stroke-dasharray="6 5"/>
|
|
148
|
+
<text x="50" y="58" font-family="ui-sans-serif, system-ui, sans-serif" font-size="30" font-weight="600" fill="#6B7280" text-anchor="middle">VN</text>
|
|
149
|
+
</svg>
|
|
150
|
+
`,$=[{id:"permit2",name:"Wallet",subtitle:"Direct wallet balance",logo:he,logoTheme:"normal",supportsBorrow:!1},{id:"aave-v3",name:"AAVE V3",domain:"aave.com",logo:me,logoTheme:"normal",supportsBorrow:!0},{id:"compound-v2",name:"Compound V2",domain:"compound.finance",logo:ye,logoTheme:"normal",supportsBorrow:!0},{id:"morpho",name:"Morpho Blue",domain:"morpho.org",logo:Ce,logoTheme:"normal",supportsBorrow:!0},{id:"dolomite",name:"Dolomite",domain:"dolomite.io",logo:fe,logoTheme:"normal",supportsBorrow:!0},{id:"venus",name:"Venus",subtitle:"venus.io",domain:"venus.io",logo:be,logoTheme:"normal",supportsBorrow:!0}],I=Object.fromEntries($.map(e=>[e.id,e]));function j(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let n of Object.values(e))j(n)}return e}var et=j([{type:"function",name:"deposit",stateMutability:"nonpayable",inputs:[{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"onBehalfOf",type:"address",internalType:"address"}],outputs:[]},{type:"function",name:"requestExit",stateMutability:"nonpayable",inputs:[{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"to",type:"address",internalType:"address"}],outputs:[{name:"exitId",type:"uint256",internalType:"uint256"}]},{type:"function",name:"claimExit",stateMutability:"nonpayable",inputs:[{name:"exitId",type:"uint256",internalType:"uint256"}],outputs:[{name:"claimed",type:"uint256",internalType:"uint256"}]},{type:"function",name:"cancelExpiredExitToBalance",stateMutability:"nonpayable",inputs:[{name:"exitId",type:"uint256",internalType:"uint256"}],outputs:[{name:"returned",type:"uint256",internalType:"uint256"}]},{type:"function",name:"revoke",stateMutability:"nonpayable",inputs:[{name:"routeId",type:"bytes32",internalType:"bytes32"}],outputs:[]},{type:"function",name:"revokeUpTo",stateMutability:"nonpayable",inputs:[{name:"routeId",type:"bytes32",internalType:"bytes32"},{name:"minNonce",type:"uint64",internalType:"uint64"}],outputs:[]},{type:"function",name:"createSubAccount",stateMutability:"nonpayable",inputs:[{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"subAccount",type:"address",internalType:"address"}]},{type:"function",name:"permitSpend",stateMutability:"nonpayable",inputs:[{name:"routeId",type:"bytes32",internalType:"bytes32"},{name:"permission",type:"tuple",internalType:"struct IPaymentHub.SpendPermission",components:[{name:"account",type:"address",internalType:"address"},{name:"source",type:"address",internalType:"address"},{name:"sourceType",type:"uint8",internalType:"uint8"},{name:"cardHash",type:"bytes32",internalType:"bytes32"},{name:"txCap",type:"uint128",internalType:"uint128"},{name:"dailyCap",type:"uint128",internalType:"uint128"},{name:"monthlyCap",type:"uint128",internalType:"uint128"},{name:"expiry",type:"uint48",internalType:"uint48"},{name:"nonce",type:"uint64",internalType:"uint64"}]},{name:"userSig",type:"bytes",internalType:"bytes"}],outputs:[]},{type:"function",name:"withdrawWithPermit",stateMutability:"nonpayable",inputs:[{name:"permit",type:"tuple",internalType:"struct IPaymentHub.WithdrawPermit",components:[{name:"account",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"to",type:"address",internalType:"address"},{name:"nonce",type:"uint64",internalType:"uint64"},{name:"deadline",type:"uint48",internalType:"uint48"}]},{name:"userSig",type:"bytes",internalType:"bytes"},{name:"attesterSig",type:"bytes",internalType:"bytes"}],outputs:[]},{type:"function",name:"balances",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}]},{type:"function",name:"withdrawNonces",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint64",internalType:"uint64"}]},{type:"function",name:"activeExitIdsOf",stateMutability:"view",inputs:[{name:"account",type:"address",internalType:"address"},{name:"token",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256[]",internalType:"uint256[]"}]},{type:"function",name:"exitEntries",stateMutability:"view",inputs:[{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"account",type:"address",internalType:"address"},{name:"requestedAt",type:"uint48",internalType:"uint48"},{name:"claimed",type:"bool",internalType:"bool"},{name:"token",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"remaining",type:"uint256",internalType:"uint256"}]},{type:"function",name:"predictSubAccount",stateMutability:"view",inputs:[{name:"owner_",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}]},{type:"function",name:"permissions",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"account",type:"address",internalType:"address"},{name:"source",type:"address",internalType:"address"},{name:"sourceType",type:"uint8",internalType:"uint8"},{name:"cardHash",type:"bytes32",internalType:"bytes32"},{name:"txCap",type:"uint128",internalType:"uint128"},{name:"dailyCap",type:"uint128",internalType:"uint128"},{name:"monthlyCap",type:"uint128",internalType:"uint128"},{name:"expiry",type:"uint48",internalType:"uint48"},{name:"nonce",type:"uint64",internalType:"uint64"}]},{type:"function",name:"permissionActive",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"bool",internalType:"bool"}]},{type:"function",name:"routeUsage",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"dailyStart",type:"uint48",internalType:"uint48"},{name:"dailyUsedUsd",type:"uint128",internalType:"uint128"},{name:"monthlyStart",type:"uint48",internalType:"uint48"},{name:"monthlyUsedUsd",type:"uint128",internalType:"uint128"}]},{type:"function",name:"EXIT_PROTECTION_WINDOW",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint48",internalType:"uint48"}]},{type:"function",name:"isSupportedStablecoin",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}]},{type:"function",name:"tokenDecimals",stateMutability:"view",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint8",internalType:"uint8"}]},{type:"function",name:"paused",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bool",internalType:"bool"}]},{type:"event",name:"Deposited",anonymous:!1,inputs:[{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}]},{type:"event",name:"ExitRequested",anonymous:!1,inputs:[{name:"exitId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"unlockAt",type:"uint48",indexed:!1,internalType:"uint48"}]},{type:"event",name:"ExitClaimed",anonymous:!1,inputs:[{name:"exitId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}]},{type:"event",name:"ExitCancelledToBalance",anonymous:!1,inputs:[{name:"exitId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}]},{type:"event",name:"PermissionGranted",anonymous:!1,inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"routeId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"sourceType",type:"uint8",indexed:!1,internalType:"uint8"},{name:"source",type:"address",indexed:!1,internalType:"address"},{name:"cardHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"nonce",type:"uint64",indexed:!1,internalType:"uint64"}]},{type:"event",name:"PermissionRevoked",anonymous:!1,inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"routeId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"newNonce",type:"uint64",indexed:!1,internalType:"uint64"}]},{type:"event",name:"SubAccountCreated",anonymous:!1,inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"salt",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"subAccount",type:"address",indexed:!1,internalType:"address"}]},{type:"event",name:"WithdrawnWithPermit",anonymous:!1,inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"nonce",type:"uint64",indexed:!1,internalType:"uint64"}]}]),tt=Object.freeze({deposit:"0xf45346dc",requestExit:"0x43c03865",claimExit:"0x328bd18b",revoke:"0xb75c7dc6",createSubAccount:"0xb93f2bcc",balances:"0xc23f001f",withdrawNonces:"0xf5aa42bb",activeExitIdsOf:"0x15f7e815",exitEntries:"0x0722ce60",predictSubAccount:"0x49c349b4"});var xe=Object.freeze([56,143,1329,8453,9745,31337,42161]),nt=Object.freeze([56,143,8453,9745,42161]),at=Object.freeze(["permit2","aaveV3","morpho","dolomite","venus"]),ge="untrusted_dynamic_hub_address",Ee="spend_permission_signature_rejected",we="sub_account_not_deployed",Le="invalid_withdraw_recipient",Ae="withdraw_rate_limit_exceeded";var st=Object.freeze({UNTRUSTED_DYNAMIC_HUB_ADDRESS:ge,SPEND_PERMISSION_SIGNATURE_REJECTED:Ee,SUB_ACCOUNT_NOT_DEPLOYED:we,INVALID_WITHDRAW_RECIPIENT:Le,WITHDRAW_RATE_LIMIT_EXCEEDED:Ae}),ve=class extends Error{code;chainId;pinnedHubAddress;receivedDynamicHubAddress;adapterKind;pinnedAdapterAddress;receivedDynamicAdapterAddress;field;constructor(e,n,t={}){super(n),this.name="PaymentHubError",this.code=e,this.chainId=t.chainId,this.pinnedHubAddress=t.pinnedHubAddress,this.receivedDynamicHubAddress=t.receivedDynamicHubAddress,this.adapterKind=t.adapterKind,this.pinnedAdapterAddress=t.pinnedAdapterAddress,this.receivedDynamicAdapterAddress=t.receivedDynamicAdapterAddress,this.field=t.field}};function w(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let n of Object.values(e))w(n)}return e}var _=w({56:{chainId:56,name:"bnb-mainnet",paymentHub:"0xf2954e2875dF36914dA0346F648a0b04e8122199",settlementPool:"0x88D9B010e65cF15a4b6751e1CE7bA135cB66E6BD",allowlistRegistry:"0x346Ddf57b4Bb9d9FF01606F519dCD545Eb9C74Fd",paymentHubLens:"0x011787D425A6ADe5700C5761B06b920EbCeB0594",subAccountImplementation:"0x16EF7cDD8cD0d681b579c6a29d53189f2633c261",compositePolicyGuard:"0x00fa9cAaF6f095950F83bE1D947DC38A6c2B41Eb",authHoldEscrow:"0xE981e6CD8b9079024BEcB1034425D7318386F7d0",feeSplitRouter:"0xc1Eee06Becc733eF1CDE9Cd64F9912F825630Fc9",issuerSettlementVaults:{wasabi:"0x47B56B69e985cf5A8E873cC1623A64f1Ed3fAfb2",interlace:"0x7cA7d6C65Cd4Fd52C6769C93B4e1A807580F0c0E",rain:"0x20904435518412DCBebeFA1bd157547ED8EfD9fe"},adapters:{permit2:"0x8ff2ba842ad0b8d1C770631994CbC956b6b49F79",aaveV3:"0x84F61e19075A375620C8bb72B35E9F1687f9504B",morpho:null,dolomite:null,venus:"0x4b54727aEd6B43d70A3259598f12f560aA97B035"}},143:{chainId:143,name:"monad-mainnet",paymentHub:"0x1029a98eF7e53f1402fF00793b3443E4404b1045",settlementPool:"0x94228F9fF53BbD7F272cB5c3F412290f7F4a6618",allowlistRegistry:"0x43B14AF15FfBBf1Ad362D57a6343fAd25bc08442",paymentHubLens:"0x1bec543199D422b8A447c7BA7a030FA845641099",subAccountImplementation:"0xDB1D0f56fD409c66908EffE3a486CF35978AEC98",compositePolicyGuard:"0xE341cA91Dd432e8F2E9abc257879C24E98438692",authHoldEscrow:"0xbb403aAF095e47714782678871A120Bf84f339B4",feeSplitRouter:"0xc56775270A95cefEC105Fbcb3bB6f502DEAE3627",issuerSettlementVaults:{wasabi:"0x9070f0c0FC0fa930468B036Ce2cCf23DD4Bf4f6F",interlace:"0x5cAb46FEe65Bc19cD2dcce4512E17fA913Fa63a1",rain:"0x21Aa61810425b1dC04bfFa4371B8D343c20A5e2D"},adapters:{permit2:"0x6f79C363618056abB6B9dd12f70F5476F95ea3dB",aaveV3:"0xCfF7522db834246AF51947acce4a8d0Bd47e0DDe",morpho:"0xF408c5D5DcAb956097E713F562e1e5692fa92c2A",dolomite:null,venus:null}},1329:{chainId:1329,name:"sei-mainnet",paymentHub:"0x5500000000000000000000000000000000001329",settlementPool:"0x5501000000000000000000000000000000001329",allowlistRegistry:"0x5502000000000000000000000000000000001329",paymentHubLens:null,subAccountImplementation:null,compositePolicyGuard:null,authHoldEscrow:null,feeSplitRouter:null,issuerSettlementVaults:{wasabi:null,interlace:null,rain:null},adapters:{permit2:null,aaveV3:null,morpho:null,dolomite:null,venus:null}},8453:{chainId:8453,name:"base-mainnet",paymentHub:"0x5A0Fd3DC0BDbB5DF009F198f45d3ffFdE8Db485d",settlementPool:"0x0Fd24e5d33C5a58EB7866F58a86E76e04fa8065a",allowlistRegistry:"0xd5529310139a9c6805DCB13752F1592BF7340f92",paymentHubLens:"0x7E716cd20Ff78dF52286deBd0395093E6846C887",subAccountImplementation:"0x2Ba1561D7Ca705E7a1956bDe8C09A2Cc46a871ca",compositePolicyGuard:"0x6B340b4C975a470609bD060a94B0dd31D8EA888c",authHoldEscrow:"0xE651964BeC920EDeef3e12eFa2EBa440d6906c3C",feeSplitRouter:"0x0B24571D1FC57B14efCD3A15c193B0a71815B7D0",issuerSettlementVaults:{wasabi:"0xF660e06d0853F38c0E18D07A8a72dFfaB5848D7b",interlace:"0x3c44AB2Ff04Cade4cC945bF8CC9294cD4BB019f9",rain:"0xEe8644D20cbe85949a6E7C78Bf7dD3c9Ddd52e8D"},adapters:{permit2:"0x0538F3eAF361f42813eD3B03A949Ee2C09A6b05C",aaveV3:"0xDE3f541AC2006dA052A9F0A9cdF4A25F31A37731",morpho:null,dolomite:null,venus:null}},9745:{chainId:9745,name:"plasma-mainnet",paymentHub:"0xbc41DA5313CB860b4984E4A5954C7aD75c4135e3",settlementPool:"0x9a64Ee525eE6f6CDB7c4F88be2B9c376fe59533B",allowlistRegistry:"0xE55a49F8c993CEC5f19F4EAf60e1d09Be94B1f8a",paymentHubLens:"0x047e484bF995c15e11017A8FEfAc24c1618436EE",subAccountImplementation:"0xb2414c3222E1F02F13c981d3b634E354522625ad",compositePolicyGuard:"0xFf476E2bdd9138D398DA1c94023Ef3850E1E86da",authHoldEscrow:"0xB39175D2db4d5FB8F0B902c9Aac17dA8e65ed322",feeSplitRouter:"0xB8CD9623451178424867507c3Aa8A1438AE1ce61",issuerSettlementVaults:{wasabi:"0x7307ea1839D4AB2fE9090b440e3487923EFfa32c",interlace:"0x3fbda7eFcEF9e4b6E8f4fD977A0f98696599A9de",rain:"0xa8f8Aff10A564f5b08E3304293700bad5bAB261E"},adapters:{permit2:"0x881D4d05b65BB81FaCB800c3FF96fE790bE90773",aaveV3:"0x9c09ddA8e9d323dA6EA01e531Fcb76C43Da4Af2C",morpho:null,dolomite:null,venus:null}},31337:{chainId:31337,name:"anvil-local",paymentHub:"0x5500000000000000000000000000000000031337",settlementPool:"0x5501000000000000000000000000000000031337",allowlistRegistry:"0x5502000000000000000000000000000000031337",paymentHubLens:null,subAccountImplementation:null,compositePolicyGuard:null,authHoldEscrow:null,feeSplitRouter:null,issuerSettlementVaults:{wasabi:null,interlace:null,rain:null},adapters:{permit2:null,aaveV3:null,morpho:null,dolomite:null,venus:null}},42161:{chainId:42161,name:"arbitrum-mainnet",paymentHub:"0xb9B03CA7A1b6c4034C09CAB0454a32C4994cbc96",settlementPool:"0xA2D0E0358dAba422BF23AE1Ac9657E8d634592f5",allowlistRegistry:"0x14A06Ae11f58aE681883b100cfCDE809C22bec9B",paymentHubLens:"0xbAaf81279B42c36D2d7b7aC34F8949D777696D2d",subAccountImplementation:"0xc435B7DBa7a4Ff9123b3718046cBE57eCd1A5805",compositePolicyGuard:"0xA9D77219F2943c8944B006877b7B8887CAe8fB08",authHoldEscrow:"0xC13A1376E5926Fde562d1D62696b63479E80057c",feeSplitRouter:"0xd8EC2982a4EAc1086290ef6975A015C31cE58252",issuerSettlementVaults:{wasabi:"0x24e1569E504304996e3EDAb095AD71E369143217",interlace:"0x9a2578CD3e33209B618155f11357151Af4B82D24",rain:"0x710514Cf9672916d7163B6900e7c0B86De3885C3"},adapters:{permit2:"0x7bAE6153A4b10F77BdcCE894935ecaD68F36c8FD",aaveV3:"0x7E31c78e7DDa96dcD8886Ea5DF1E0A078cE1CeCA",morpho:null,dolomite:null,venus:null}}});var Fe="0x0000000000000000000000000000000000000000";var ot=(1n<<48n)-1n,rt=(1n<<64n)-1n,it=(1n<<128n)-1n,dt=(1n<<160n)-1n,ct=(1n<<256n)-1n;function Te(e){if(!(!Number.isInteger(e)||e<=0)&&Object.hasOwn(_,e))return _[e]}var E=Object.freeze({BALANCE:0,PERMIT2:1,AAVE_V3:2,SUB_ACCOUNT:3}),Ie=w([{id:"balances",name:"Facto Balance",sourceType:E.BALANCE,requiresSubAccount:!1,requiresPermit2Approval:!1},{id:"permit2",name:"Permit2",sourceType:E.PERMIT2,requiresSubAccount:!1,requiresPermit2Approval:!0},{id:"aave-v3",name:"AAVE V3",sourceType:E.AAVE_V3,requiresSubAccount:!1,requiresPermit2Approval:!1},{id:"morpho",name:"Morpho Blue",sourceType:E.SUB_ACCOUNT,requiresSubAccount:!0,requiresPermit2Approval:!1},{id:"dolomite",name:"Dolomite",sourceType:E.SUB_ACCOUNT,requiresSubAccount:!0,requiresPermit2Approval:!1},{id:"venus",name:"Venus",sourceType:E.SUB_ACCOUNT,requiresSubAccount:!0,requiresPermit2Approval:!1}]),lt=Object.freeze(Object.fromEntries(Ie.map(e=>[e.id,e])));var V=w({PermitSpend:[{name:"routeId",type:"bytes32"},{name:"permission",type:"SpendPermission"}],SpendPermission:[{name:"account",type:"address"},{name:"source",type:"address"},{name:"sourceType",type:"uint8"},{name:"cardHash",type:"bytes32"},{name:"txCap",type:"uint128"},{name:"dailyCap",type:"uint128"},{name:"monthlyCap",type:"uint128"},{name:"expiry",type:"uint48"},{name:"nonce",type:"uint64"}]}),_e=w({WithdrawPermit:[{name:"account",type:"address"},{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"to",type:"address"},{name:"nonce",type:"uint64"},{name:"deadline",type:"uint48"}]});function S(e,n){if(!Object.hasOwn(n,e))throw new ve("invalid_payment_hub_input",`Unknown EIP-712 primaryType "${e}".`,{field:"primaryType"});let t=new Set,s=d=>{let o=n[d];if(o)for(let m of o){let c=m.type.replace(/\[[^\]]*\]$/g,"");c!==e&&Object.hasOwn(n,c)&&!t.has(c)&&(t.add(c),s(c))}};return s(e),[e,...[...t].sort()].map(d=>{let o=n[d]??[];return`${d}(${o.map(m=>`${m.type} ${m.name}`).join(",")})`}).join("")}var pt=S("SpendPermission",V),ut=S("PermitSpend",V),mt=S("WithdrawPermit",_e);var Se="0x55000000000000000000000000000000000";var yt=Object.freeze([]),ft=w({56:[{chainId:56,address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",decimals:18}],143:[{chainId:143,address:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603",symbol:"USDC",decimals:6}],8453:[{chainId:8453,address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",decimals:6}],9745:[{chainId:9745,address:"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",symbol:"USDT0",decimals:6}],42161:[{chainId:42161,address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",decimals:6}]});function Pe(e){let n=Te(e);if(!n)return!1;let t=n.paymentHub.toLowerCase();return t!==Fe&&!t.startsWith(Se)}var Ct=Object.freeze(xe.filter(e=>Pe(e)).map(e=>_[e]));var Z=!1;function ke(e){let n=Oe(e.container);Ue();let t=e,s=P(void 0).setup,d={kind:"idle",message:""},o=!1,m=W("facto-express-root"),c=document.createElement("button");c.type="button",c.className="facto-express-button",c.addEventListener("click",()=>{r()});let p=document.createElement("span"),x=document.createElement("strong");c.append(p,x);let u=document.createElement("p");u.className="facto-express-inline-status",u.setAttribute("role","status"),u.setAttribute("aria-live","polite"),m.append(c,u),n.replaceChildren(m);let a=W("facto-express-overlay");a.setAttribute("aria-hidden","true"),a.innerHTML=De(),document.body.append(a);let y=A(a,"[data-facto-close]"),f=A(a,"[data-facto-change]"),l=A(a,"[data-facto-pay]"),L=A(a,"[data-facto-result]");y.addEventListener("click",v),f.addEventListener("click",()=>{g()}),l.addEventListener("click",()=>{ee()}),document.addEventListener("keydown",O),B(),F();async function r(){if(!o){C({kind:"checking",message:"Checking saved Facto setup..."});try{let i=P(await t.getPaymentSetup());if(i.setup?.ready){s=i.setup,D();return}await g()}catch(i){C({kind:"error",message:k(i,"Facto checkout could not start.")})}}}async function g(){if(!o){C({kind:"setup",message:"Opening Facto secure checkout..."});try{let i=P(await t.startPaymentSetup());if(!i.setup?.ready){C({kind:"setup",message:i.state?.message??"Finish Facto setup"});return}s=i.setup,D()}catch(i){C({kind:"error",message:k(i,"Facto setup could not be completed.")})}}}async function ee(){if(!(o||!s?.ready)){C({kind:"paying",message:"Submitting Facto payment..."}),l.disabled=!0;try{let i=await t.submitPayment(s);C({kind:"success",message:i?.message??"Payment authorized with Facto."})}catch(i){C({kind:"error",message:k(i,"Facto payment failed.")})}finally{l.disabled=!1}}}function D(){F(),a.dataset.open="true",a.setAttribute("aria-hidden","false"),C({kind:"ready",message:""}),l.focus()}function v(){a.dataset.open="false",a.setAttribute("aria-hidden","true"),c.focus()}function te(i){t={...t,...i},B(),F()}function ne(){o=!0,document.removeEventListener("keydown",O),a.remove(),m.remove()}function O(i){i.key==="Escape"&&a.dataset.open==="true"&&v()}function C(i){d=i,t.onStatusChange?.(d),M()}function B(){let i=t.buttonLabel??"Pay with",H=t.brandLabel??"Facto";p.textContent=i,x.textContent=H,c.setAttribute("aria-label",`${i} ${H}`)}function F(){let i=s;h(a,"[data-facto-brand]",t.brandLabel??"Facto"),h(a,"[data-facto-route]",i?.routeLabel??"Connect Facto to pay"),h(a,"[data-facto-address]",i?Ne(i.walletAddress):""),h(a,"[data-facto-order-label]",t.order.label),h(a,"[data-facto-order-amount]",t.order.amountLabel),h(a,"[data-facto-shipping]",t.order.shippingLabel??"Included"),h(a,"[data-facto-total]",t.order.amountLabel),h(a,"[data-facto-pay-label]",`Pay ${t.order.amountLabel} with ${t.brandLabel??"Facto"}`),h(a,"[data-facto-env]",`Sandbox target: ${t.environmentLabel??"local"}`),M()}function M(){u.textContent=d.message,u.dataset.kind=d.kind,L.textContent=d.kind==="ready"?"":d.message,L.dataset.kind=d.kind}return{open:r,close:v,update:te,destroy:ne}}function De(){return`
|
|
141
151
|
<section class="facto-express-sheet" role="dialog" aria-modal="true" aria-labelledby="facto-express-title">
|
|
142
152
|
<div class="facto-express-close-row">
|
|
143
153
|
<button type="button" class="facto-express-secondary" data-facto-close>Close</button>
|
|
@@ -184,7 +194,7 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
184
194
|
<p class="facto-express-result" role="status" aria-live="polite" data-facto-result></p>
|
|
185
195
|
</div>
|
|
186
196
|
</section>
|
|
187
|
-
`}function
|
|
197
|
+
`}function Oe(e){if(typeof e!="string")return e;let n=document.querySelector(e);if(n instanceof HTMLElement)return n;throw new Error(`Facto checkout container was not found: ${e}`)}function P(e){return e?Be(e)?{setup:null,state:e}:"pipelineReady"in e?e.pipelineReady?e.factoServerWalletAddress?{setup:{walletAddress:e.factoServerWalletAddress,routeLabel:Me(e.pipeline),ready:!0},state:null}:{setup:null,state:null}:{setup:null,state:{buttonLabel:"Pay with Facto",setupStatus:"finish_facto_setup",message:"Finish Facto setup. We'll resume checkout here.",paymentReady:!1,mandateReady:!1,blockingReason:"payment_path_required"}}:e.ready?{setup:e,state:null}:{setup:null,state:null}:{setup:null,state:null}}function Be(e){return"setupStatus"in e&&"paymentReady"in e&&"mandateReady"in e}function Me(e){return e?[He(e.chainId),Re(e.protocolId),e.assetSymbol].filter(Boolean).join(" \xB7 "):"Facto payment route"}function He(e){return T[e]?.name??`Chain ${e}`}function Re(e){return I[e]?.name??e}function Ne(e){return e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e}function W(e){let n=document.createElement("div");return n.className=e,n}function A(e,n){let t=e.querySelector(n);if(!t)throw new Error(`Facto checkout element missing: ${n}`);return t}function h(e,n,t){A(e,n).textContent=t}function k(e,n){return e instanceof Error?e.message:n}function Ue(){if(Z)return;Z=!0;let e=document.createElement("style");e.dataset.factoExpressCheckout="true",e.textContent=`
|
|
188
198
|
.facto-express-root { width: 100%; }
|
|
189
199
|
.facto-express-button {
|
|
190
200
|
width: min(352px, 100%);
|
|
@@ -375,5 +385,4 @@ var R=`<svg xmlns:xodm="http://www.corel.com/coreldraw/odm/2003" xmlns="http://w
|
|
|
375
385
|
.facto-express-body { padding: 16px; }
|
|
376
386
|
.facto-express-button { width: 100%; }
|
|
377
387
|
}
|
|
378
|
-
`,document.head.append(e)}var
|
|
379
|
-
//# sourceMappingURL=index.js.map
|
|
388
|
+
`,document.head.append(e)}var Y="facto.externalLink.connected",K="facto.externalLink.ready",q="facto.externalLink.failed",G="facto.externalLink.closeRequested",b=class extends Error{code;retryable;status;details;constructor(n,t,s){super(t),this.name="FactoConnectError",this.code=n,this.retryable=s.retryable,this.status=s.status,this.details=s.details}},ze=460,$e=720;function X(){let e=ze,n=$e,t=window.screenLeft??window.screenX??0,s=window.screenTop??window.screenY??0,d=window.outerWidth||e,o=window.outerHeight||n,m=Math.max(0,t+(d-e)/2),c=Math.max(0,s+(o-n)/2);return{width:e,height:n,left:Math.round(m),top:Math.round(c)}}function je(){let{width:e,height:n,left:t,top:s}=X();return["popup=yes",`width=${e}`,`height=${n}`,`innerWidth=${e}`,`innerHeight=${n}`,`left=${t}`,`top=${s}`,"resizable=yes","scrollbars=yes","toolbar=no","menubar=no","location=no","status=no"].join(",")}function Ve(e){return`facto-connect-${e.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,36)||"session"}`}function Ze(e){let{width:n,height:t,left:s,top:d}=X();try{typeof e.resizeTo=="function"&&e.resizeTo(n,t),typeof e.moveTo=="function"&&e.moveTo(s,d),typeof e.focus=="function"&&e.focus()}catch{}}function We(e,n){let t=new URL(e);return!t.searchParams.has("external_origin")&&!t.searchParams.has("origin")&&t.searchParams.set("external_origin",n),t.toString()}function Ye(e){if(typeof e!="object"||e===null)return null;let n=e,t=n.type,s=n.state;if(typeof t!="string"||typeof s!="string"||t!==Y&&t!==K&&t!==q&&t!==G)return null;let d={type:t,state:s};return typeof n.code=="string"&&(d.code=n.code),typeof n.reason=="string"&&(d.reason=n.reason),d}function J(e){let n=new URL(e.connectUrl).origin,t=e.origin??window.location.origin,s=null,d=!1,o=!1,m=!1,c=!1,p=null,x=f=>{if(d||f.origin!==n||s&&f.source&&f.source!==s)return;let l=Ye(f.data);if(!(!l||l.state!==e.state))switch(l.type){case Y:typeof l.code=="string"&&e.onConnected?.({code:l.code,state:l.state,kind:"connected"});break;case K:typeof l.code=="string"&&e.onReady?.({code:l.code,state:l.state,kind:"ready"});break;case q:e.onFailed?.({state:l.state,reason:l.reason});break;case G:a();break}};function u(){o&&(window.removeEventListener("message",x),o=!1),p&&(clearInterval(p),p=null)}function a(){d||(d=!0,u(),s&&!s.closed&&s.close(),s=null,m&&e.onClose?.())}function y(){if(d||o)return;let f=We(e.connectUrl,t);if(s=window.open(f,e.windowName??Ve(e.state),e.windowFeatures??je()),!s||s.closed){e.onFailed?.({state:e.state,reason:"popup_blocked"});return}e.windowFeatures||Ze(s),window.addEventListener("message",x),o=!0,m=!0,c=!1,p=setInterval(()=>{if(s){if(!s.closed){c=!0;return}c&&a()}},500)}return{open:y,close:a}}function Ke(e){return{...e.appId===void 0?{}:{appId:e.appId},...e.userLinkRef===void 0?{}:{userLinkRef:e.userLinkRef},...e.grantStatus===void 0?{}:{grantStatus:e.grantStatus},pipelineReady:e.pipelineReady,...e.scopes===void 0?{}:{scopes:e.scopes}}}function qe(e){let n=null,t=()=>{n?.close(),n=null},s=o=>{e.telemetry?.track(o)};return{connect:o=>(s({type:"connect_started",appId:e.appId}),new Promise((m,c)=>{let p=!1,x=!1,u=null,a=null,y=r=>{p||(p=!0,u&&clearTimeout(u),t(),o.onError?.(r),c(r))},f=r=>{p||(p=!0,u&&clearTimeout(u),o.onError?.(r),c(r))},l=r=>{p||(p=!0,u&&clearTimeout(u),t(),m(r))},L=async r=>{if(!(p||x||!a)){x=!0,r.kind==="connected"&&o.onConnected?.(r),r.kind==="ready"&&o.onReady?.(r),s({type:"code_received",appId:e.appId,sessionId:a.sessionId,state:a.state,details:{kind:r.kind}}),s({type:"link_complete_started",appId:e.appId,sessionId:a.sessionId,state:a.state});try{let g=await o.completeLink({sessionId:a.sessionId,state:a.state,nonce:a.nonce,code:r.code});s({type:"link_complete_succeeded",appId:e.appId,sessionId:a.sessionId,state:a.state}),l(Ke(g))}catch(g){s({type:"link_complete_failed",appId:e.appId,sessionId:a.sessionId,state:a.state}),f(new b("LINK_COMPLETE_FAILED","Facto link completion failed",{retryable:!0,details:g}))}}};(async()=>{try{s({type:"link_session_requested",appId:e.appId}),a=Ge(await o.fetchLinkSession()),s({type:"link_session_received",appId:e.appId,sessionId:a.sessionId,state:a.state})}catch(r){y(new b("INVALID_LINK_SESSION","Unable to create Facto link session",{retryable:!0,details:r}));return}if(new Date(a.expiresAt).getTime()<=Date.now()){y(new b("LINK_SESSION_EXPIRED","Facto link session expired",{retryable:!0,details:{expiresAt:a.expiresAt}}));return}u=setTimeout(()=>{o.onExit?.({reason:"timeout",state:a?.state}),s({type:"connect_timeout",appId:e.appId,sessionId:a?.sessionId,state:a?.state}),y(new b("TIMEOUT","Facto Connect timed out",{retryable:!0}))},e.timeoutMs??3e5),n=J({connectUrl:a.connectUrl,state:a.state,windowName:e.popupName,windowFeatures:e.popupFeatures,onReady:r=>{L(r)},onConnected:r=>{L(r)},onFailed:r=>{if(r.reason==="popup_blocked"){s({type:"popup_blocked",appId:e.appId,state:r.state}),y(new b("POPUP_BLOCKED","Facto Connect popup was blocked",{retryable:!0}));return}y(new b("CONNECT_APP_FAILED","Facto Connect failed",{retryable:!0,details:r}))},onClose:()=>{p||(o.onExit?.({reason:"user_exit",state:a?.state}),s({type:"journey_exit",appId:e.appId,sessionId:a?.sessionId,state:a?.state}),y(new b("USER_EXIT","Facto Connect was closed before completion",{retryable:!0})))}}),n.open(),s({type:"popup_opened",appId:e.appId,sessionId:a.sessionId,state:a.state})})()})),close:t}}function Ge(e){let n=e.connectUrl??e.iframeUrl;if(!n||typeof n!="string")throw new Error("Facto link session is missing connectUrl");if(!e.state||typeof e.state!="string")throw new Error("Facto link session is missing state");if(!e.expiresAt||Number.isNaN(new Date(e.expiresAt).getTime()))throw new Error("Facto link session is missing a valid expiresAt");return{...e,connectUrl:n}}function Xe(e){return"connectUrl"in e&&"state"in e}function Q(e){return Xe(e)?J(e):qe(e)}var Et={create:Q},wt=Q;export{G as FACTO_LINK_CLOSE_REQUESTED,Y as FACTO_LINK_CONNECTED,q as FACTO_LINK_FAILED,K as FACTO_LINK_READY,Et as FactoConnect,b as FactoConnectError,Q as createFactoConnect,J as createFactoConnectTransport,ke as createFactoExpressCheckout,wt as default};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
type FactoConnectServerErrorCode = 'FACTO_CONFIG_INVALID' | 'FACTO_ENGINE_REQUEST_FAILED' | 'FACTO_ENGINE_RESPONSE_INVALID' | 'FACTO_REQUEST_ABORTED' | 'FACTO_STATUS_POLL_ABORTED';
|
|
2
|
+
type CardErrorOutcome = 'refused' | 'unknown' | 'config_invalid';
|
|
3
|
+
declare class FactoConnectServerError extends Error {
|
|
4
|
+
readonly code: FactoConnectServerErrorCode;
|
|
5
|
+
readonly retryable: boolean;
|
|
6
|
+
readonly status?: number;
|
|
7
|
+
readonly details?: unknown;
|
|
8
|
+
readonly retryAfterSeconds?: number;
|
|
9
|
+
constructor(code: FactoConnectServerErrorCode, message: string, options: {
|
|
10
|
+
retryable: boolean;
|
|
11
|
+
status?: number;
|
|
12
|
+
details?: unknown;
|
|
13
|
+
retryAfterSeconds?: number;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
declare class CardError extends FactoConnectServerError {
|
|
17
|
+
readonly outcome: CardErrorOutcome;
|
|
18
|
+
readonly engineCode: string | undefined;
|
|
19
|
+
readonly httpStatus: number | undefined;
|
|
20
|
+
readonly requestId: string | undefined;
|
|
21
|
+
constructor(code: FactoConnectServerErrorCode, message: string, options: {
|
|
22
|
+
retryable: boolean;
|
|
23
|
+
status?: number;
|
|
24
|
+
httpStatus?: number;
|
|
25
|
+
details?: unknown;
|
|
26
|
+
retryAfterSeconds?: number;
|
|
27
|
+
outcome?: CardErrorOutcome;
|
|
28
|
+
engineCode?: string;
|
|
29
|
+
requestId?: string;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
interface ServerRetryOptions<TError extends FactoConnectServerError = FactoConnectServerError> {
|
|
33
|
+
maxRetries?: number;
|
|
34
|
+
baseDelayMs?: number;
|
|
35
|
+
maxDelayMs?: number;
|
|
36
|
+
respectRetryAfter?: boolean;
|
|
37
|
+
maxRetryAfterMs?: number;
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
onRetry?: (info: {
|
|
40
|
+
attempt: number;
|
|
41
|
+
error: TError;
|
|
42
|
+
delayMs: number;
|
|
43
|
+
}) => void;
|
|
44
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
type CardServerRetryOptions = ServerRetryOptions<CardError>;
|
|
47
|
+
declare function withServerRetry<T>(fn: () => Promise<T>, options?: ServerRetryOptions): Promise<T>;
|
|
48
|
+
|
|
49
|
+
type CardEnvironment = 'dev' | 'production';
|
|
50
|
+
type OpenVocabulary<T extends string> = T | (string & {});
|
|
51
|
+
interface CardRequestOptions {
|
|
52
|
+
readonly signal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
interface TransportOptions {
|
|
55
|
+
readonly environment: CardEnvironment;
|
|
56
|
+
readonly apiBaseUrl?: string;
|
|
57
|
+
readonly timeoutMs?: number;
|
|
58
|
+
readonly retry?: CardServerRetryOptions;
|
|
59
|
+
readonly maxResponseBytes?: number;
|
|
60
|
+
readonly fetch?: (input: string, init?: RequestInit) => Promise<Response>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { type CardEnvironment as C, FactoConnectServerError as F, type OpenVocabulary as O, type ServerRetryOptions as S, type TransportOptions as T, type CardRequestOptions as a, type FactoConnectServerErrorCode as b, withServerRetry as w };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
type FactoConnectServerErrorCode = 'FACTO_CONFIG_INVALID' | 'FACTO_ENGINE_REQUEST_FAILED' | 'FACTO_ENGINE_RESPONSE_INVALID' | 'FACTO_REQUEST_ABORTED' | 'FACTO_STATUS_POLL_ABORTED';
|
|
2
|
+
type CardErrorOutcome = 'refused' | 'unknown' | 'config_invalid';
|
|
3
|
+
declare class FactoConnectServerError extends Error {
|
|
4
|
+
readonly code: FactoConnectServerErrorCode;
|
|
5
|
+
readonly retryable: boolean;
|
|
6
|
+
readonly status?: number;
|
|
7
|
+
readonly details?: unknown;
|
|
8
|
+
readonly retryAfterSeconds?: number;
|
|
9
|
+
constructor(code: FactoConnectServerErrorCode, message: string, options: {
|
|
10
|
+
retryable: boolean;
|
|
11
|
+
status?: number;
|
|
12
|
+
details?: unknown;
|
|
13
|
+
retryAfterSeconds?: number;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
declare class CardError extends FactoConnectServerError {
|
|
17
|
+
readonly outcome: CardErrorOutcome;
|
|
18
|
+
readonly engineCode: string | undefined;
|
|
19
|
+
readonly httpStatus: number | undefined;
|
|
20
|
+
readonly requestId: string | undefined;
|
|
21
|
+
constructor(code: FactoConnectServerErrorCode, message: string, options: {
|
|
22
|
+
retryable: boolean;
|
|
23
|
+
status?: number;
|
|
24
|
+
httpStatus?: number;
|
|
25
|
+
details?: unknown;
|
|
26
|
+
retryAfterSeconds?: number;
|
|
27
|
+
outcome?: CardErrorOutcome;
|
|
28
|
+
engineCode?: string;
|
|
29
|
+
requestId?: string;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
interface ServerRetryOptions<TError extends FactoConnectServerError = FactoConnectServerError> {
|
|
33
|
+
maxRetries?: number;
|
|
34
|
+
baseDelayMs?: number;
|
|
35
|
+
maxDelayMs?: number;
|
|
36
|
+
respectRetryAfter?: boolean;
|
|
37
|
+
maxRetryAfterMs?: number;
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
onRetry?: (info: {
|
|
40
|
+
attempt: number;
|
|
41
|
+
error: TError;
|
|
42
|
+
delayMs: number;
|
|
43
|
+
}) => void;
|
|
44
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
type CardServerRetryOptions = ServerRetryOptions<CardError>;
|
|
47
|
+
declare function withServerRetry<T>(fn: () => Promise<T>, options?: ServerRetryOptions): Promise<T>;
|
|
48
|
+
|
|
49
|
+
type CardEnvironment = 'dev' | 'production';
|
|
50
|
+
type OpenVocabulary<T extends string> = T | (string & {});
|
|
51
|
+
interface CardRequestOptions {
|
|
52
|
+
readonly signal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
interface TransportOptions {
|
|
55
|
+
readonly environment: CardEnvironment;
|
|
56
|
+
readonly apiBaseUrl?: string;
|
|
57
|
+
readonly timeoutMs?: number;
|
|
58
|
+
readonly retry?: CardServerRetryOptions;
|
|
59
|
+
readonly maxResponseBytes?: number;
|
|
60
|
+
readonly fetch?: (input: string, init?: RequestInit) => Promise<Response>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { type CardEnvironment as C, FactoConnectServerError as F, type OpenVocabulary as O, type ServerRetryOptions as S, type TransportOptions as T, type CardRequestOptions as a, type FactoConnectServerErrorCode as b, withServerRetry as w };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function h(r){let e=r.headers.get("retry-after");if(!(e===null||!/^[0-9]+$/.test(e)))return Number(e)}var b=new Set([400,401,402,403,404,410,412,422,423,428]),T=new Set(["idempotency_payload_mismatch","mapping_revision_not_approved","fact_type_not_allowed","managed_route_refused","ambiguous_lookup_selector","assertion_replayed","intent_sealed"]);function C(r){if(typeof r!="object"||r===null||Array.isArray(r))return{engineCode:void 0,requestId:void 0};let e=r;if(typeof e.error=="string"&&e.error.length>0)return{engineCode:e.error,requestId:typeof e.request_id=="string"&&e.request_id.length>0?e.request_id:void 0};if(typeof e.error=="object"&&e.error!==null&&!Array.isArray(e.error)){let n=e.error;return{engineCode:typeof n.code=="string"&&n.code.length>0?n.code:void 0,requestId:typeof n.request_id=="string"&&n.request_id.length>0?n.request_id:void 0}}return{engineCode:typeof e.code=="string"&&e.code.length>0?e.code:void 0,requestId:typeof e.request_id=="string"&&e.request_id.length>0?e.request_id:void 0}}function g(r,e,n){return r==="FACTO_CONFIG_INVALID"?"config_invalid":r==="FACTO_ENGINE_RESPONSE_INVALID"||r==="FACTO_REQUEST_ABORTED"||r==="FACTO_STATUS_POLL_ABORTED"||e===void 0?"unknown":b.has(e)||e===409&&n!==void 0&&T.has(n)?"refused":"unknown"}var c=class extends Error{code;retryable;status;details;retryAfterSeconds;constructor(e,n,t){super(n),this.name="FactoConnectServerError",this.code=e,this.retryable=t.retryable,this.status=t.status,this.details=t.details,this.retryAfterSeconds=t.retryAfterSeconds}},d=class extends c{outcome;engineCode;httpStatus;requestId;constructor(e,n,t){let o=t.httpStatus??t.status;super(e,n,{retryable:t.retryable,status:o,details:t.details,retryAfterSeconds:t.retryAfterSeconds}),this.name="CardError",this.httpStatus=o;let s=C(t.details);this.engineCode=t.engineCode??s.engineCode,this.requestId=t.requestId??s.requestId,this.outcome=t.outcome??g(e,o,this.engineCode)}},R=6e4,_=2147483647;function O(r,e){return r<=0?Promise.resolve():new Promise((n,t)=>{if(e?.aborted){t(new d("FACTO_STATUS_POLL_ABORTED","aborted",{retryable:!1}));return}let o=setTimeout(()=>{e?.removeEventListener("abort",s),n()},r),s=()=>{clearTimeout(o),t(new d("FACTO_STATUS_POLL_ABORTED","aborted",{retryable:!1}))};e?.addEventListener("abort",s,{once:!0})})}function v(r,e={}){return m(r,e,c)}function I(r,e={}){return m(r,e,d)}async function m(r,e,n){let t=e.maxRetries??2,o=e.baseDelayMs??200,s=e.maxDelayMs??5e3,A=e.respectRetryAfter??!0,i=e.maxRetryAfterMs??R;if(!Number.isFinite(i)||i<0||i>_)throw new d("FACTO_CONFIG_INVALID",`maxRetryAfterMs must be a number from 0 to ${_}`,{retryable:!1});let E=e.sleep??O,u=0;for(;;)try{return await r()}catch(a){if(!(a instanceof n)||!a.retryable||u>=t)throw a;let f=A&&typeof a.retryAfterSeconds=="number"?a.retryAfterSeconds*1e3:void 0;if(f!==void 0&&!(f<=i))throw a;u+=1;let y=Math.min(s,o*2**(u-1)),S=y*.25*Math.random(),l=f??y+S;e.onRetry?.({attempt:u,error:a,delayMs:l}),await E(l,e.signal)}}export{h as a,c as b,d as c,v as d,I as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as L,c as k,e as _e}from"./chunk-2WJ3CACP.js";var ze=1048576,oe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,V=/^pconn_[A-Za-z0-9_-]{16,}$/,se=/^[a-f0-9]{64}$/,G=/^sha256:[a-f0-9]{64}$/,ye=["environment","apiBaseUrl","timeoutMs","retry","maxResponseBytes","fetch"];function S(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function d(e,n=1,r=255){return typeof e=="string"&&[...e].length>=n&&[...e].length<=r}function v(e,n=1,r=255){return d(e,n,r)&&/^[\x21-\x7e]+$/.test(e)}function x(e){return typeof e=="string"&&oe.test(e)&&e!=="00000000-0000-0000-0000-000000000000"}function fe(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=2147483647}function m(e){return typeof e=="string"&&/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d+)?(?:Z|[+-]\d\d:\d\d)$/.test(e)&&Number.isFinite(Date.parse(e))}function f(e,n,r=[]){return S(e)&&n.every(t=>Object.hasOwn(e,t))&&Object.keys(e).every(t=>n.includes(t)||r.includes(t))}function l(e,n,r=[]){return S(e)&&n.every(t=>Object.hasOwn(e,t))}function i(e,n){if(!e)throw new k("FACTO_CONFIG_INVALID",n,{retryable:!1})}function W(e){return e===429||e>=500}function H(e){let n=e?.headers.get("x-request-id")?.trim();return n&&n.length>0?n:void 0}function w(e,n){return new k("FACTO_ENGINE_RESPONSE_INVALID","Card API response does not match the producer contract",{retryable:W(e),status:e,retryAfterSeconds:n?L(n):void 0,requestId:H(n)})}function le(e,n){return new k("FACTO_ENGINE_RESPONSE_INVALID",`Card API response body exceeds maxResponseBytes (${n} bytes)`,{retryable:W(e.status),status:e.status,details:{reason:"response_body_too_large",maxResponseBytes:n},retryAfterSeconds:L(e),requestId:H(e)})}async function Pe(e,n,r){let t=e.headers.get("content-length")?.trim();if(t!==void 0&&/^\d+$/.test(t)&&Number(t)>n)throw await e.body?.cancel().catch(()=>{}),le(e,n);if(!e.body)return"";let _=e.body.getReader(),y=[],C=0;try{for(;;){let{done:s,value:a}=await _.read();if(s)break;if(C+=a.byteLength,C>n||r.aborted)throw await _.cancel().catch(()=>{}),r.aborted?new k("FACTO_REQUEST_ABORTED","Card API request aborted or timed out",{retryable:!1}):le(e,n);y.push(a)}}finally{_.releaseLock()}let g=new Uint8Array(C),o=0;for(let s of y)g.set(s,o),o+=s.byteLength;return new TextDecoder().decode(g)}var ve=512;function Ee(e){return l(e,["error","message","request_id"])&&d(e.error,1,128)&&/^[a-z][a-z0-9_]*$/.test(e.error)&&d(e.message,1,ve)&&d(e.request_id,1,128)}function Te(e){if(!l(e,["error"])||!l(e.error,["category","code","message","request_id","retryable"],["details"]))return!1;let n=e.error;return!(typeof n.category!="string"||typeof n.code!="string"||typeof n.message!="string"||typeof n.request_id!="string"||typeof n.retryable!="boolean")}function De(e){e!==void 0&&(i(S(e),"retry options must be an object"),e.maxRetries!==void 0&&i(typeof e.maxRetries=="number"&&Number.isSafeInteger(e.maxRetries)&&e.maxRetries>=0,"retry.maxRetries must be a non-negative integer"),e.baseDelayMs!==void 0&&i(typeof e.baseDelayMs=="number"&&Number.isFinite(e.baseDelayMs)&&e.baseDelayMs>=0,"retry.baseDelayMs must be non-negative"),e.maxDelayMs!==void 0&&i(typeof e.maxDelayMs=="number"&&Number.isFinite(e.maxDelayMs)&&e.maxDelayMs>=0,"retry.maxDelayMs must be non-negative"),e.maxRetryAfterMs!==void 0&&i(typeof e.maxRetryAfterMs=="number"&&Number.isFinite(e.maxRetryAfterMs)&&e.maxRetryAfterMs>=0&&e.maxRetryAfterMs<=2147483647,"retry.maxRetryAfterMs is out of range"))}function ge(e,n){i(typeof window>"u","Card API credentials require a server runtime"),i(e.environment==="dev"||e.environment==="production","An explicit dev or production environment is required"),De(e.retry);let r={dev:"https://dev-api.facto.to",production:"https://api.facto.to"},t;i(e.environment!=="production"||typeof e.apiBaseUrl=="string","Production requires an explicit apiBaseUrl");try{t=new URL(e.apiBaseUrl??r.dev)}catch{throw new k("FACTO_CONFIG_INVALID","apiBaseUrl must be an absolute HTTP(S) origin",{retryable:!1})}i(!t.username&&!t.password&&!t.search&&!t.hash&&t.pathname==="/"&&(t.protocol==="https:"||t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname)),"apiBaseUrl must be an HTTPS origin or an explicit loopback HTTP origin");let _=`${t.protocol}//${t.hostname.replace(/\.+$/,"")}${t.port?`:${t.port}`:""}`;i(!Object.values(r).includes(_)||_===r[e.environment],"The published endpoint must match the client environment");let y=t.origin,C=e.timeoutMs??3e4;i(Number.isSafeInteger(C)&&C>0,"timeoutMs must be a positive integer");let g=e.maxResponseBytes??ze;i(Number.isSafeInteger(g)&&g>0,"maxResponseBytes must be a positive integer");let o=e.fetch??globalThis.fetch?.bind(globalThis);i(typeof o=="function","A server fetch implementation is required");let s=e.retry;return async function(u,p,c,I,A,K,B={}){let ne=typeof c=="function"?c():new Headers(c),D=B.signal&&s?.signal?AbortSignal.any([B.signal,s.signal]):B.signal??s?.signal,ue=0,pe=async()=>{let te=ue===0?ne:typeof c=="function"?c():new Headers(c);ue+=1;let P=new AbortController,M=()=>P.abort();D?.addEventListener("abort",M,{once:!0}),D?.aborted&&M();let Re=setTimeout(M,C),q,re=new Promise((b,ie)=>{q=()=>ie(new k("FACTO_REQUEST_ABORTED","Card API request aborted or timed out",{retryable:!1})),P.signal.addEventListener("abort",q,{once:!0}),P.signal.aborted&&q()});try{if(P.signal.aborted)return await re;te.set("accept","application/json"),I!==void 0&&te.set("content-type","application/json");let b=await Promise.race([o(`${y}${p}`,{method:u,headers:te,redirect:"error",signal:P.signal,...I!==void 0?{body:I}:{}}),re]),ie=await Promise.race([Pe(b,g,P.signal),re]),O;try{O=JSON.parse(ie)}catch{throw w(b.status,b)}if(A.includes(b.status)&&K(O,b.status))return O;if(!b.ok){if(Ee(O))throw new k("FACTO_ENGINE_REQUEST_FAILED",`Card API ${n} request failed with status ${b.status}`,{retryable:W(b.status),status:b.status,details:O,retryAfterSeconds:L(b),requestId:O.request_id||H(b)});if(Te(O))throw new k("FACTO_ENGINE_REQUEST_FAILED",`Card API ${n} request failed with status ${b.status}`,{retryable:W(b.status),status:b.status,details:O,retryAfterSeconds:L(b),requestId:O.error.request_id||H(b)})}throw w(b.status,b)}catch(b){throw b instanceof k?b:new k("FACTO_ENGINE_REQUEST_FAILED","Card API transport failed; inspect the original operation before any new action",{retryable:!1})}finally{clearTimeout(Re),D?.removeEventListener("abort",M),q&&P.signal.removeEventListener("abort",q)}};return s!==void 0&&(u==="GET"||ne.has("Idempotency-Key"))?_e(pe,{...s,signal:D}):pe()}}import{randomUUID as nn}from"node:crypto";import{createPrivateKey as Be,sign as qe}from"node:crypto";var Le="facto-card-binding+jwt",Ne=/^pc_[A-Za-z0-9_-]{16,}$/,je=/^cbs_[A-Za-z0-9_-]{16,}$/,Fe=/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,Ue=/^[A-Za-z0-9_-]+$/,$e=/^[0-9]{4}$/,me=300,he=600,Ke=["card.metadata.view","card.use_for_facto_payments"],Me=["passkey","mfa","reauthenticated_session"],We=["provider_authenticated_app","device_bound_confirmation"],He={dev:"urn:facto:sandbox:card-program-connect:binding-proof",production:"urn:facto:production:card-program-connect:binding-proof"};function be(e){return Buffer.from(JSON.stringify(e),"utf8").toString("base64url")}function N(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=1e9&&e<=9999999999}function Ae(e){return typeof e=="string"&&Ue.test(e)&&Buffer.from(e,"base64url").byteLength===32}function Ve(e){return/^[0-9]{12,19}$/.test(e)||/[0-9]{13}/.test(e)}function Ge(e,n){return i(S(e),"Binding assertion proof claim is required"),e.mode==="provider_reauthentication"?(i(f(e,["mode","authenticatedAtSeconds","assurance"])&&N(e.authenticatedAtSeconds)&&e.authenticatedAtSeconds<=n&&n-e.authenticatedAtSeconds<=he&&Me.includes(e.assurance),"Reauthentication proof requires valid authenticatedAtSeconds (within 600 seconds before issuedAtSeconds) and assurance"),{mode:"provider_reauthentication",authenticated_at:e.authenticatedAtSeconds,assurance:e.assurance}):(i(e.mode==="provider_second_channel"&&f(e,["mode","approvedAtSeconds","approvalRef","channelType"])&&N(e.approvedAtSeconds)&&e.approvedAtSeconds<=n&&n-e.approvedAtSeconds<=he&&d(e.approvalRef,16,255)&&We.includes(e.channelType),"Second-channel proof requires valid approvedAtSeconds (within 600 seconds before issuedAtSeconds), approvalRef (16-255 chars), and channelType"),{mode:"provider_second_channel",approved_at:e.approvedAtSeconds,approval_ref:e.approvalRef,channel_type:e.channelType})}function Je(e){i(Array.isArray(e)&&e.length>=1&&e.length<=20,"Binding assertion requires 1 to 20 asserted cards");let n=new Set,r=0;return e.map(t=>{i(f(t,["externalCardId"],["isEntryCard","display"])&&d(t.externalCardId,8,512)&&!Ve(t.externalCardId)&&(t.isEntryCard===void 0||typeof t.isEntryCard=="boolean"),"Each asserted card requires an opaque externalCardId (8-512 non-PAN chars) and optional boolean isEntryCard"),i(!n.has(t.externalCardId),"Asserted cards must have unique externalCardId values"),n.add(t.externalCardId),t.isEntryCard===!0&&(r+=1,i(r<=1,"At most one asserted card may set isEntryCard to true"));let _;if(t.display!==void 0){i(f(t.display,[],["network","cardType","last4"]),"Asserted card display accepts only network, cardType, and last4");let y=t.display;i((y.network===void 0||d(y.network,1,32))&&(y.cardType===void 0||d(y.cardType,1,32))&&(y.last4===void 0||typeof y.last4=="string"&&$e.test(y.last4)),"Asserted card display fields are out of contract bounds");let C={};y.network!==void 0&&(C.network=y.network),y.cardType!==void 0&&(C.card_type=y.cardType),y.last4!==void 0&&(C.last4=y.last4),Object.keys(C).length>0&&(_=C)}return{card_ref:t.externalCardId,relationship_type:"owner",...t.isEntryCard===!0?{is_entry_card:!0}:{},..._!==void 0?{display:_}:{}}})}async function Ze(e,n,r){if(typeof e=="function"){let t=await e(n);return i(t instanceof Uint8Array&&t.byteLength===64,"Binding assertion signer must return a 64-byte Ed25519 signature"),t}i(f(e,["kty","crv","x","d"],["kid","alg","use","key_ops","ext"])&&e.kty==="OKP"&&e.crv==="Ed25519"&&(e.alg===void 0||e.alg==="EdDSA"||e.alg==="Ed25519")&&(e.use===void 0||e.use==="sig")&&(e.key_ops===void 0||Array.isArray(e.key_ops)&&e.key_ops.every(t=>typeof t=="string")&&e.key_ops.includes("sign"))&&(e.ext===void 0||typeof e.ext=="boolean")&&(e.kid===void 0||e.kid===r)&&Ae(e.x)&&Ae(e.d),"Binding assertion signer must be a valid Ed25519 private JWK (matching signingKeyId when kid is present) or async signing callback");try{let t=Be({key:{kty:"OKP",crv:"Ed25519",x:e.x,d:e.d},format:"jwk"});return new Uint8Array(qe(null,n,t))}catch{throw new k("FACTO_CONFIG_INVALID","Invalid Ed25519 private JWK for binding assertion signing",{retryable:!1})}}async function Ce(e){i(f(e,["environment","providerConnectionId","programId","bindingSessionId","issuer","subject","jti","factoChallenge","sessionRequestDigest","requestedUserConsents","proof","cards","signingKeyId","signer"],["issuedAtSeconds","notBeforeSeconds","expiresAtSeconds"]),"Binding assertion input contains missing or unknown fields"),i(e.environment==="dev"||e.environment==="production","environment must be dev or production"),i(typeof e.providerConnectionId=="string"&&Ne.test(e.providerConnectionId),"providerConnectionId must be a pc_ provider connection identifier (not a pconn_ program connection identifier)"),i(d(e.programId,1,255),"programId must be 1 to 255 characters"),i(typeof e.bindingSessionId=="string"&&je.test(e.bindingSessionId),"bindingSessionId must be a cbs_ identifier"),i(d(e.issuer,1,512),"issuer is required"),i(d(e.subject,16,512),"subject must be a pairwise opaque identifier of 16 to 512 characters"),i(d(e.jti,16,255),"jti must be 16 to 255 characters"),i(d(e.factoChallenge,1,512),"factoChallenge is required"),i(typeof e.sessionRequestDigest=="string"&&G.test(e.sessionRequestDigest),"sessionRequestDigest must be a sha256:<hex> digest"),i(d(e.signingKeyId,1,255)&&e.signingKeyId.trim()===e.signingKeyId&&!e.signingKeyId.includes("\0"),"signingKeyId must be a non-empty trimmed identifier without NUL bytes");let n=e.requestedUserConsents;i(Array.isArray(n)&&n.length>0&&new Set(n).size===n.length&&n.every(p=>Ke.includes(p)),"requestedUserConsents must be a non-empty unique set of supported consent purposes");let r=e.issuedAtSeconds??Math.floor(Date.now()/1e3),t=e.notBeforeSeconds??r,_=e.expiresAtSeconds??r+me;i(N(r)&&N(t)&&N(_)&&t<=r&&r<=_&&_-r<=me,"Binding assertion timestamps must satisfy nbf <= iat <= exp with lifetime <= 300 seconds");let y=Ge(e.proof,r),C=Je(e.cards),g=be({typ:Le,alg:"EdDSA",kid:e.signingKeyId}),o=be({iss:e.issuer,aud:He[e.environment],sub:e.subject,iat:r,nbf:t,exp:_,jti:e.jti,binding_session_id:e.bindingSessionId,facto_challenge:e.factoChallenge,session_request_digest:e.sessionRequestDigest,connection_id:e.providerConnectionId,environment:e.environment,program_ref:e.programId,proof:y,cards:C,requested_user_consents:[...n]}),s=new TextEncoder().encode(`${g}.${o}`),a=await Ze(e.signer,s,e.signingKeyId),u=`${g}.${o}.${Buffer.from(a).toString("base64url")}`;return i(u.length>=128&&u.length<=16384&&Fe.test(u),"Signed binding assertion exceeds compact JWS bounds"),u}import{createHash as Qe,createHmac as Xe,timingSafeEqual as Ye}from"node:crypto";var en=/^(?:[0-9a-fA-F]{2})+$/;function E(e){return new k("FACTO_CONFIG_INVALID",e,{retryable:!1})}function J(e){if(typeof e=="string")throw E("apiKeySecret cannot be a bare string; pass { encoding: 'hex', value }, { encoding: 'utf8', value }, or Uint8Array");if(e instanceof Uint8Array){if(e.byteLength===0)throw E("apiKeySecret Uint8Array must not be empty");return new Uint8Array(e)}if(typeof e!="object"||e===null||Array.isArray(e))throw E("apiKeySecret must be { encoding: 'hex', value }, { encoding: 'utf8', value }, or Uint8Array");if(Object.keys(e).length!==2||!Object.hasOwn(e,"encoding")||!Object.hasOwn(e,"value"))throw E("apiKeySecret must contain only { encoding: 'hex' | 'utf8', value: string }");let{encoding:r,value:t}=e;if(r==="utf8"){if(typeof t!="string"||t.length===0)throw E("apiKeySecret with encoding 'utf8' must have a non-empty string value");return new TextEncoder().encode(t)}if(r==="hex"){if(typeof t!="string"||!en.test(t))throw E("apiKeySecret with encoding 'hex' must be a non-empty, even-length hexadecimal string");let _=new Uint8Array(t.length/2);for(let y=0;y<t.length;y+=2)_[y/2]=Number.parseInt(t.slice(y,y+2),16);return _}throw E("apiKeySecret encoding must be 'hex' or 'utf8', or pass a Uint8Array")}function ae(e){let n=J(e.secret),r=Qe("sha256").update(e.body).digest("hex"),t=["FACTO-HMAC-V2",e.method,e.target,String(e.timestamp),e.nonce,r].join(`
|
|
2
|
+
`),_=new Headers({"x-api-key":e.apiKeyId,"x-api-timestamp":String(e.timestamp),"x-api-nonce":e.nonce,"x-api-signature":Xe("sha256",n).update(t,"utf8").digest("hex")});return e.idempotencyKey!==void 0&&_.set("Idempotency-Key",e.idempotencyKey),_}function Zn(e){let n=J(e.secret),r=new Headers(e.headers),t=r.get("x-api-timestamp"),_=r.get("x-api-nonce"),y=r.get("x-api-signature");if(r.get("x-api-key")!==e.apiKeyId||!t||!/^\d{10}$/.test(t)||!_||!/^[\x21-\x7e]{1,128}$/.test(_)||!y||!/^[a-f0-9]{64}$/.test(y))return!1;let C=ae({...e,secret:n,timestamp:Number(t),nonce:_}).get("x-api-signature");return Ye(Buffer.from(y,"hex"),Buffer.from(C,"hex"))}var $=/^cbs_[A-Za-z0-9_-]{16,}$/,Y=/^cint_[A-Za-z0-9_-]{16,}$/,ee=/^cb_[A-Za-z0-9_-]{16,}$/,ce=/^sha256:[a-fA-F0-9]{64}$/,xe=["authorization_updated","clearing","reversal","refund","chargeback","settlement"],X=["authorization_requested",...xe],tn=["facto_admission","durable_commit","provider_authorization","chain_finality","provider_settlement"],rn=["active","frozen","closed","replaced"],on=/^[A-Za-z0-9_.:-]{1,64}$/,sn=/^[0-9]+\.[0-9]{2,6}$/,an=/^-?[0-9]+\.[0-9]{2,6}$/;function h(e,n){return typeof e=="string"&&n.test(e)}function R(e){return e===null||typeof e=="string"}function F(e,n=-2147483648){return typeof e=="number"&&Number.isInteger(e)&&e>=n&&e<=2147483647}function U(e,n=128){return d(e,1,n)&&!/[0-9]{13}/.test(e)}function j(e,n){return e==null||n(e)}function Q(e){return Array.isArray(e)&&e.every(n=>h(n,ee))}function ke(e){return l(e,["network","type","last4"])&&R(e.network)&&(e.type===null||["virtual","physical","unknown"].includes(String(e.type)))&&(e.last4===null||typeof e.last4=="string"&&/^[0-9]{4}$/.test(e.last4))}function z(e){return typeof e=="string"&&/^0x0{32}[0-9a-fA-F]{32}$/.test(e)}function dn(e){return typeof e=="string"&&on.test(e)}function cn(e){return!l(e,["snapshot_token","snapshot_at","to_at","items","next_cursor","complete"])||!d(e.snapshot_token,16,4096)||!m(e.snapshot_at)||!m(e.to_at)||typeof e.complete!="boolean"||e.next_cursor!==null&&!d(e.next_cursor,1,4096)||e.complete&&e.next_cursor!==null||!Array.isArray(e.items)||e.items.length>100?!1:e.items.every(n=>l(n,["event_id","origin_connection_id","connection_sequence","event_sha256","target_revision","delivery_state"],["accepted_at"])&&x(n.event_id)&&typeof n.origin_connection_id=="string"&&V.test(n.origin_connection_id)&&(n.connection_sequence===null||typeof n.connection_sequence=="number"&&Number.isSafeInteger(n.connection_sequence)&&n.connection_sequence>=1)&&typeof n.event_sha256=="string"&&se.test(n.event_sha256)&&x(n.target_revision)&&typeof n.delivery_state=="string"&&(n.accepted_at===void 0||m(n.accepted_at)))}function un(e){return l(e,["replay_id","selection_id","target_revision","status"])&&x(e.replay_id)&&x(e.selection_id)&&x(e.target_revision)&&e.status==="accepted"}function pn(e){i(f(e,["target_revision","page_size"],["selection_id","from_at","to_at","snapshot_token","cursor"]),"Reconciliation requires only the generated query fields"),i(x(e.target_revision)&&typeof e.page_size=="number"&&Number.isInteger(e.page_size)&&e.page_size>=1&&e.page_size<=100,"Reconciliation target_revision and page_size are invalid"),i(x(e.selection_id)&&!Object.hasOwn(e,"from_at")&&!Object.hasOwn(e,"to_at")||!Object.hasOwn(e,"selection_id")&&m(e.from_at)&&m(e.to_at)&&Date.parse(e.from_at)<=Date.parse(e.to_at),"Select exactly one fixed selection or explicit time window"),i((e.snapshot_token===void 0||d(e.snapshot_token,16,4096))&&(e.cursor===void 0||d(e.cursor,16,4096)&&d(e.snapshot_token,16,4096)),"A cursor requires its original snapshot token")}function _n(e){i(S(e),"Authorization lookup requires criteria");let n=Object.hasOwn(e,"criteria")?(i(f(e,["criteria"])&&S(e.criteria),"Authorization lookup wrapper requires only criteria"),e.criteria):e;i(S(n),"Authorization lookup requires criteria");let r=n.by==="external_authorization_id"?f(n,["by","external_authorization_id","resource_version","mapping_revision"],["fact_type"])&&d(n.external_authorization_id,1,256)&&d(n.resource_version,1,255)&&d(n.mapping_revision,1,255)&&(n.fact_type===void 0||X.includes(String(n.fact_type))):n.by==="supplier_transaction_id"?f(n,["by","supplier_transaction_id","resource_version","mapping_revision"],["fact_type"])&&typeof n.supplier_transaction_id=="string"&&d(n.supplier_transaction_id.trim(),1,256)&&d(n.resource_version,1,255)&&d(n.mapping_revision,1,255)&&(n.fact_type===void 0||X.includes(String(n.fact_type))):n.by==="idempotency_key"?f(n,["by","idempotency_key","original_credential_key_id"],["operation"])&&d(n.idempotency_key,16,255)&&d(n.original_credential_key_id,1,255)&&(n.operation===void 0||n.operation==="create_authorization"):n.by==="charge_id"&&f(n,["by","charge_id"])&&z(n.charge_id);return i(r,"Select exactly one complete external_authorization_id, supplier_transaction_id, idempotency_key, or public charge_id"),n}function ln(e){i(f(e,["external_card_id","external_authorization_id","amount","currency","resource_version","mapping_revision","cardholder_verification"],["supplier_transaction_id","client_transaction_id","merchant_name","merchant_mcc","merchant_country","occurred_at","decision_mode","decision_timeout_ms","deadline_at"]),"Authorization create requires the complete generated request");let t=e.cardholder_verification;i(U(e.external_card_id,512)&&d(e.external_authorization_id,1,256)&&h(e.amount,sn)&&(e.currency==="USD"||e.currency==="USDC")&&d(e.resource_version,1,255)&&d(e.mapping_revision,1,255)&&(e.merchant_name===void 0||d(e.merchant_name,0,256))&&(e.merchant_mcc===void 0||h(e.merchant_mcc,/^[0-9]{4}$/))&&(e.merchant_country===void 0||d(e.merchant_country,2,3))&&(e.occurred_at===void 0||m(e.occurred_at))&&[e.supplier_transaction_id,e.client_transaction_id].every(_=>_===void 0||typeof _=="string"&&d(_.trim(),1,256))&&(e.decision_mode===void 0||e.decision_mode==="asynchronous"||e.decision_mode==="synchronous")&&(e.decision_timeout_ms===void 0||e.decision_mode==="synchronous"&&typeof e.decision_timeout_ms=="number"&&Number.isInteger(e.decision_timeout_ms)&&e.decision_timeout_ms>=50&&e.decision_timeout_ms<=5e3)&&(e.deadline_at===void 0||e.decision_mode==="synchronous"&&m(e.deadline_at))&&f(t,["method","verified_at","evidence_id"])&&["pin","biometric","cdcvm","signature","no_cvm","provider_attested"].includes(String(t.method))&&m(t.verified_at)&&d(t.evidence_id,1,256),"Authorization fields, currency, mapping/version, or cardholder verification is invalid")}function yn(e,n){i(d(e,1,255)&&e!=="."&&e!==".."&&!e.includes("/"),"externalId must be a valid external authorization identifier"),i(f(n,["fact_type","amount","currency","resource_version","predecessor_version","mapping_revision","recorded_at"],["supplier_transaction_id","parent_supplier_transaction_id","client_transaction_id","merchant_name","merchant_mcc","merchant_country"]),"Authorization fact requires the complete generated request"),i(xe.includes(String(n.fact_type))&&h(n.amount,an)&&(n.currency==="USD"||n.currency==="USDC")&&d(n.resource_version,1,255)&&typeof n.predecessor_version=="string"&&d(n.predecessor_version.trim(),1,255)&&n.predecessor_version!==n.resource_version&&d(n.mapping_revision,1,255)&&m(n.recorded_at)&&(n.merchant_name===void 0||d(n.merchant_name,1,255))&&(n.merchant_mcc===void 0||h(n.merchant_mcc,/^[0-9]{4}$/))&&(n.merchant_country===void 0||d(n.merchant_country,2,3))&&[n.supplier_transaction_id,n.parent_supplier_transaction_id,n.client_transaction_id].every(_=>_===void 0||typeof _=="string"&&d(_.trim(),1,255)),"Authorization fact type, predecessor version, amount, or timestamp is invalid")}function Oe(e){return Array.isArray(e)&&e.length===5&&e.every((n,r)=>l(n,["kind","state","recorded_at","source_system"],["observed_at","safe_code"])&&n.kind===tn[r]&&["unobserved","pending","confirmed","rejected","indeterminate"].includes(String(n.state))&&m(n.recorded_at)&&["facto","provider","chain"].includes(String(n.source_system))&&(n.safe_code===void 0||d(n.safe_code,1,64))&&(n.observed_at===void 0||m(n.observed_at))&&(n.state!=="confirmed"||m(n.observed_at))&&(n.state!=="unobserved"||!Object.hasOwn(n,"observed_at")))}function fn(e){return!l(e,["receipt_event_id","charge_id","mapping_revision","operation_type","resource_version","execution_outcome","terminal_action","finalized_at","facts_at_finality"],["external_authorization_id","authorization_ref"])||!x(e.receipt_event_id)||!z(e.charge_id)||!(d(e.external_authorization_id,1,256)||d(e.authorization_ref,1,256))||!d(e.mapping_revision,1,255)||!X.includes(String(e.operation_type))||!d(e.resource_version,1,255)||!m(e.finalized_at)||!Oe(e.facts_at_finality)||e.facts_at_finality[3].state!=="confirmed"?!1:e.terminal_action==="releaseFor"?e.execution_outcome==="succeeded"&&e.facts_at_finality[0].state==="confirmed"&&e.facts_at_finality[1].state==="confirmed":e.terminal_action==="cancelReservation"&&e.execution_outcome==="failed"}function gn(e){if(e===void 0)return!0;if(!S(e)||!S(e.issuer)||!Array.isArray(e.issuer.entries)||!Array.isArray(e.refund_cases))return!1;let n=e.issuer,r=n.entries;return["state","cleared_amount","reversed_amount","refunded_amount"].every(t=>typeof n[t]=="string")&&r.every(t=>S(t)&&["operation_type","resource_version","amount","currency","recorded_at","link_status"].every(_=>typeof t[_]=="string")&&t.currency==="USDC"&&(t.unlinked_reason===void 0||typeof t.unlinked_reason=="string"))&&e.refund_cases.every(t=>S(t)&&["case_id","source_operation_type","source_resource_version","status","amount","excess_amount","updated_at"].every(_=>typeof t[_]=="string")&&(t.paid_amount===void 0||typeof t.paid_amount=="string")&&(t.not_payable_reason===void 0||typeof t.not_payable_reason=="string"))}function mn(e,n){if(e===void 0)return!0;if(!S(e)||typeof e.fee_total!="string"||!S(e.fee_breakdown))return!1;let r=e.fee_breakdown;if(!["base_fee","fast_pay_fee","pooled_surcharge"].every(_=>typeof r[_]=="string"))return!1;let t=e.user_payment;return t!==void 0&&(!S(t)||!Number.isSafeInteger(t.chain_id)||typeof t.tx_hash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t.tx_hash)||t.asset_symbol!==void 0&&typeof t.asset_symbol!="string")?!1:e.refund_payments===void 0?!0:Array.isArray(e.refund_payments)?e.refund_payments.length===0?!0:n&&e.refund_payments.every(_=>S(_)&&Number.isSafeInteger(_.chain_id)&&typeof _.case_id=="string"&&typeof _.paid_amount=="string"&&typeof _.recorded_by=="string"&&typeof _.tx_hash=="string"&&/^0x[0-9a-fA-F]{64}$/.test(_.tx_hash)):!1}function hn(e){if(!l(e,["external_authorization_id","processing_status","origin_connection_id","resource_version","mapping_revision"],["charge_id","final_receipt","decline_reason_code","supplier_transaction_id","facts","revision","operation_type","decision","lifecycle","payment_details"])||!d(e.external_authorization_id,1,256)||typeof e.origin_connection_id!="string"||!V.test(e.origin_connection_id)||!d(e.resource_version,1,255)||!d(e.mapping_revision,1,255)||e.charge_id!==void 0&&e.charge_id!==null&&!z(e.charge_id)||e.supplier_transaction_id!==void 0&&!d(e.supplier_transaction_id,1,256)||e.facts!==void 0&&!Oe(e.facts)||e.revision!==void 0&&!fe(e.revision)||e.operation_type!==void 0&&!X.includes(String(e.operation_type))||e.decision!==void 0&&!["approved","declined","self_reversed_timeout"].includes(String(e.decision))||e.decline_reason_code!==void 0&&!dn(e.decline_reason_code)||!gn(e.lifecycle)||!mn(e.payment_details,e.lifecycle!==void 0))return!1;if(e.processing_status==="succeeded"||e.processing_status==="failed"){if(Object.hasOwn(e,"final_receipt")&&e.final_receipt!==void 0){if(!z(e.charge_id)||!fn(e.final_receipt)||Object.hasOwn(e,"decline_reason_code"))return!1;let n=e.final_receipt,r=n.external_authorization_id??n.authorization_ref;return n.execution_outcome===e.processing_status&&n.charge_id===e.charge_id&&r===e.external_authorization_id&&n.mapping_revision===e.mapping_revision&&n.resource_version===e.resource_version&&(e.operation_type===void 0||n.operation_type===e.operation_type)}return e.processing_status==="succeeded"?!Object.hasOwn(e,"decline_reason_code")&&(e.charge_id===void 0||z(e.charge_id)):z(e.charge_id)||(e.charge_id===void 0||e.charge_id===null)&&(e.decision==="declined"||e.decision==="self_reversed_timeout"||e.decline_reason_code!==void 0)}return!Object.hasOwn(e,"final_receipt")&&!Object.hasOwn(e,"decline_reason_code")&&(e.processing_status==="processing"||e.processing_status==="indeterminate"&&(e.charge_id===void 0||e.charge_id===null))}function bn(e){return!l(e,["observed_at","resolution"],["authorization"])||!m(e.observed_at)?!1:e.resolution==="not_observed"?!Object.hasOwn(e,"authorization")||e.authorization===void 0:hn(e.authorization)?e.resolution==="resolved"?["succeeded","failed"].includes(e.authorization.processing_status):e.resolution==="pending"?e.authorization.processing_status==="processing":e.resolution==="unknown"&&e.authorization.processing_status==="indeterminate":!1}function An(e){return l(e,["charge_id","status"])&&z(e.charge_id)&&["processing","approved","declined"].includes(String(e.status))&&!Object.hasOwn(e,"final_receipt")}function Cn(e){return l(e,["operation_id","status"])&&x(e.operation_id)&&e.status==="recorded"}function In(e,n){return!l(e,["deadline_at","decision_id"])||!m(e.deadline_at)||!x(e.decision_id)?!1:n===200?e.decision==="approved"&&e.status==="approved"&&z(e.charge_id)&&m(e.decided_at):typeof e.error!="string"||typeof e.message!="string"||typeof e.request_id!="string"?!1:n===408&&e.error==="decision_deadline_exceeded"&&!Object.hasOwn(e,"decision")?!0:m(e.decided_at)&&(n===422&&e.decision==="declined"||n===408&&e.decision==="self_reversed_timeout")}function Sn(e){if(!l(e,["binding_session_id","status","binding_url","expires_at","proof_policy"])||!h(e.binding_session_id,$)||e.status!=="pending"||typeof e.binding_url!="string"||!m(e.expires_at))return!1;let n=e.proof_policy;return l(n,["allowed_modes","challenge_after_facto_auth","challenge_delivery"],["card_selection_supported"])&&Array.isArray(n.allowed_modes)&&n.allowed_modes.length>0&&new Set(n.allowed_modes).size===n.allowed_modes.length&&n.allowed_modes.every(r=>r==="provider_reauthentication"||r==="provider_second_channel")&&n.challenge_after_facto_auth===!0&&(n.challenge_delivery==="browser_handoff"||n.challenge_delivery==="provider_backend")&&(n.card_selection_supported===void 0||n.card_selection_supported===!0)}function Ie(e){if(!S(e)||!h(e.binding_session_id,$)||!m(e.expires_at))return!1;let n=["binding_session_id","status","expires_at"];return["pending","proof_pending","consent_pending"].includes(String(e.status))?l(e,n)&&!["outcome","binding_ids","failure_reason","completed_at"].some(r=>Object.hasOwn(e,r)):e.status==="completed"?Object.hasOwn(e,"completed_at")&&!m(e.completed_at)?!1:e.outcome==="bound"?l(e,[...n,"outcome","binding_ids"],["completed_at"])&&!Object.hasOwn(e,"failure_reason")&&Q(e.binding_ids):e.outcome==="declined"&&l(e,[...n,"outcome","failure_reason"],["completed_at"])&&!Object.hasOwn(e,"binding_ids")&&e.failure_reason==="declined_by_user":e.status==="cancelled"?l(e,n,["completed_at","failure_reason"])&&!["outcome","binding_ids"].some(r=>Object.hasOwn(e,r))&&(!Object.hasOwn(e,"completed_at")||m(e.completed_at))&&(!Object.hasOwn(e,"failure_reason")||["cancelled_by_user","cancelled_by_partner","proof_rejected","admission_closed","no_eligible_cards","integrity_conflict"].includes(String(e.failure_reason))):e.status==="expired"&&l(e,n,["failure_reason"])&&!["completed_at","outcome","binding_ids"].some(r=>Object.hasOwn(e,r))&&(!Object.hasOwn(e,"failure_reason")||e.failure_reason==="expired"||e.failure_reason==="proof_timeout")}function wn(e){return l(e,["binding_session_id","status","proof_received_at"])&&h(e.binding_session_id,$)&&e.status==="consent_pending"&&m(e.proof_received_at)}function xn(e){return l(e,["binding_session_id","facto_challenge","session_request_digest","expires_at"])&&h(e.binding_session_id,$)&&d(e.facto_challenge,1,512)&&h(e.session_request_digest,G)&&m(e.expires_at)}function kn(e){i(f(e,["requested_user_consents","return_uri"]),"Binding session requires the generated consent and return URI fields");let n=e.requested_user_consents;i(Array.isArray(n)&&n.length>0&&new Set(n).size===n.length&&n.every(r=>r==="card.metadata.view"||r==="card.use_for_facto_payments"),"Binding session consents are invalid"),i(typeof e.return_uri=="string"&&Buffer.byteLength(e.return_uri,"utf8")<=2048&&e.return_uri.startsWith("https://")&&!/[#\r\n]/.test(e.return_uri)&&e.return_uri.slice(8).split(/[/?]/,1)[0].length>0&&!e.return_uri.slice(8).split(/[/?]/,1)[0].includes("@"),"An exact registered HTTPS return URI is required")}function Se(e){i(f(e,["proof_format","binding_assertion"])&&e.proof_format==="compact-jws"&&typeof e.binding_assertion=="string"&&e.binding_assertion.length>=128&&e.binding_assertion.length<=16384&&/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(e.binding_assertion),"The original compact JWS provider proof is required")}function On(e){return l(e,["id","revision","cards"])&&h(e.id,Y)&&h(e.revision,ce)&&Array.isArray(e.cards)&&e.cards.every(n=>l(n,["binding_id","status","card"])&&h(n.binding_id,ee)&&typeof n.status=="string"&&ke(n.card))}function Rn(e){return l(e,["id","status","revision","added_binding_ids","removed_binding_ids","kept_binding_ids"])&&h(e.id,Y)&&["applied","no_change"].includes(String(e.status))&&h(e.revision,ce)&&Q(e.added_binding_ids)&&Q(e.removed_binding_ids)&&Q(e.kept_binding_ids)}function zn(e){return l(e,["id","status"])&&h(e.id,Y)&&e.status==="cancelled"}function Pn(e){return l(e,["state"],["amount","constrained_by","currency","reason"])&&["available","not_chargeable","unavailable"].includes(String(e.state))&&(e.amount===void 0||typeof e.amount=="string")&&(e.constrained_by===void 0||typeof e.constrained_by=="string")&&(e.currency===void 0||typeof e.currency=="string")&&(e.reason===void 0||typeof e.reason=="string")}function vn(e){return l(e,["currency","period","available_to_charge"],["expires_at","per_tx_limit","period_limit","period_remaining","period_used"])&&typeof e.currency=="string"&&typeof e.period=="string"&&Pn(e.available_to_charge)&&(e.expires_at===void 0||e.expires_at===null||m(e.expires_at))&&(e.per_tx_limit===void 0||R(e.per_tx_limit))&&(e.period_limit===void 0||R(e.period_limit))&&(e.period_remaining===void 0||R(e.period_remaining))&&(e.period_used===void 0||R(e.period_used))}function En(e){return l(e,["account_ref","asset_decimals","asset_symbol","chain_id","name","protocol","spend_mode","yield_token_symbol"],["balance","balance_raw","balance_updated_at"])&&typeof e.account_ref=="string"&&F(e.asset_decimals,0)&&typeof e.asset_symbol=="string"&&typeof e.chain_id=="number"&&Number.isSafeInteger(e.chain_id)&&e.chain_id>=0&&typeof e.name=="string"&&typeof e.protocol=="string"&&typeof e.spend_mode=="string"&&typeof e.yield_token_symbol=="string"&&(e.balance===void 0||R(e.balance))&&(e.balance_raw===void 0||R(e.balance_raw))&&(e.balance_updated_at===void 0||e.balance_updated_at===null||m(e.balance_updated_at))}function Tn(e){return e===void 0||l(e,["configured","state"],["reason","limits","pipeline"])&&typeof e.configured=="boolean"&&["ready","not_configured","unavailable"].includes(String(e.state))&&(e.reason===void 0||e.reason===null||typeof e.reason=="string")&&(e.limits===void 0||vn(e.limits))&&(e.pipeline===void 0||En(e.pipeline))}function Dn(e){if(!l(e,["binding"],["found"])||e.found!==void 0&&typeof e.found!="boolean")return!1;let n=e.binding;return n===null?e.found!==!0:(e.found===void 0||e.found===!0)&&l(n,["id","status","revision","card"],["funding"])&&h(n.id,ee)&&typeof n.status=="string"&&F(n.revision,1)&&ke(n.card)&&Tn(n.funding)}function Bn(e){return l(e,["items"])&&Array.isArray(e.items)&&e.items.every(n=>l(n,["id","event_kind","binding_id","binding_revision","connection_sequence","delivery_attempts","last_delivery_error","dead_lettered_at","replay_count"])&&h(n.id,oe)&&typeof n.event_kind=="string"&&h(n.binding_id,ee)&&F(n.binding_revision,1)&&(n.connection_sequence===null||typeof n.connection_sequence=="number"&&Number.isSafeInteger(n.connection_sequence)&&n.connection_sequence>=1)&&F(n.delivery_attempts,1)&&R(n.last_delivery_error)&&(n.dead_lettered_at===null||m(n.dead_lettered_at))&&F(n.replay_count,0))}function qn(e){return l(e,["id","status"])&&x(e.id)&&e.status==="accepted"}function Ln(e){return l(e,["delivery_id","disposition","effect"])&&x(e.delivery_id)&&(e.disposition==="duplicate"?e.effect===null:e.disposition==="applied"&&["revoked","status_updated","released","none"].includes(String(e.effect)))}function Nn(e){i(f(e,["intent_token","approval_id","approval_sha256","revision","cards"],["external_account_id"])&&v(e.intent_token,32,8192)&&d(e.approval_id,1,255)&&h(e.approval_sha256,se)&&h(e.revision,ce)&&j(e.external_account_id,n=>typeof n=="string"&&n.length>0&&Buffer.byteLength(n,"utf8")<=512),"Card replacement requires the original complete approved request"),i(Array.isArray(e.cards)&&e.cards.length<=50&&e.cards.every(n=>f(n,["external_card_id"],["network","type","last4"])&&U(n.external_card_id,255)&&j(n.network,r=>U(r,40))&&j(n.type,r=>r==="virtual"||r==="physical"||r==="unknown")&&j(n.last4,r=>typeof r=="string"&&/^[0-9]{4}$/.test(r))),"Target cards must match the generated safe card projection")}function jn(e){i(f(e,["delivery_id","kind","assertion_jws"],["external_card_id","lifecycle_status","external_account_id"])&&x(e.delivery_id)&&typeof e.assertion_jws=="string"&&e.assertion_jws.trim().length>=32,"Inbound event requires a UUID delivery_id and signed assertion_jws");let n=r=>r==null;i(e.kind==="account.released"?d(e.external_account_id,1,512)&&n(e.external_card_id)&&n(e.lifecycle_status):U(e.external_card_id)&&n(e.external_account_id)&&(e.kind==="card.unbound"?n(e.lifecycle_status):e.kind==="card.lifecycle_changed"&&rn.includes(String(e.lifecycle_status))),"Inbound event fields must match the declared event kind")}function T(e){return i(e&&v(e.idempotencyKey,16,255),"An explicit original Idempotency-Key of 16 to 255 characters is required"),e.idempotencyKey}function Z(e){return i(h(e,$),"id must be the original binding session identifier"),`/api/card/connect/sessions/${e}`}function de(e){return i(h(e,Y),"id must be the original connect intent identifier"),`/api/card/connect/intents/${e}`}function we(e){return i(e?.rawBody===void 0||typeof e?.rawBody=="string","rawBody must preserve the original authenticated request bytes"),e?.rawBody}function tt(e){i(f(e,["environment","connectionId","programId","apiKeyId","apiKeySecret"],[...ye,"nowSeconds","createNonce"]),"Card client options cannot contain human session or arbitrary authentication fields"),i(typeof e.connectionId=="string"&&V.test(e.connectionId),"connectionId must be a pconn_ connection identifier"),i(d(e.programId,1,128)&&v(e.apiKeyId),"programId and apiKeyId are required");let n=J(e.apiKeySecret),r=ge(e,"program"),t=Object.freeze({connectionId:e.connectionId,environment:e.environment,programId:e.programId}),_=e.apiKeyId,y=e.nowSeconds??(()=>Math.floor(Date.now()/1e3)),C=e.createNonce??nn;function g(o,s,a,u="POST"){let p=y(),c=C();return i(Number.isSafeInteger(p)&&p>=1e9&&p<=9999999999,"nowSeconds must return a ten-digit Unix timestamp in seconds"),i(v(c,1,128),"createNonce must return a bounded canonical nonce"),ae({secret:n,apiKeyId:_,method:u,target:o,timestamp:p,nonce:c,body:s,idempotencyKey:a})}return Object.freeze({scope:t,sessions:Object.freeze({async create(o,s){kn(o),i(f(s,["idempotencyKey"],["cardSelection","signal"]),"Binding session create options accept only idempotencyKey, optional cardSelection, and optional signal");let a=T(s);i(s.cardSelection===void 0||typeof s.cardSelection=="boolean","cardSelection must be a boolean when provided");let u={...o,program_ref:t.programId},p=JSON.stringify(u),c="/api/card/connect/sessions";return r("POST",c,()=>{let A=g(c,p,a);return s.cardSelection===!0&&A.set("x-facto-card-selection","1"),A},p,[201],Sn,s)},async get(o,s){let a=Z(o),u=await r("GET",a,()=>g(a,"",void 0,"GET"),void 0,[200],Ie,s);if(u.binding_session_id!==o)throw w(200);return u},async submitProof(o,s,a){let u=`${Z(o)}/provider-proof`,p=T(a);i(S(s),"Provider proof input is required");let c;if(Object.hasOwn(s,"proof_format")||Object.hasOwn(s,"binding_assertion"))Se(s),c=s;else{i(!["environment","programId","bindingSessionId","connectionId"].some(D=>Object.hasOwn(s,D)),"Provider proof assertion inherits environment, programId, and bindingSessionId from client scope and session id, and requires explicit providerConnectionId (pc_...)");let K=s,B=K.issuedAtSeconds??y();c={proof_format:"compact-jws",binding_assertion:await Ce({...K,environment:t.environment,programId:t.programId,bindingSessionId:o,issuedAtSeconds:B})},Se(c)}let I=JSON.stringify(c),A=await r("POST",u,()=>g(u,I,p),I,[202],wn,a);if(A.binding_session_id!==o)throw w(202);return A},async getProofChallenge(o,s){let a=`${Z(o)}/proof-challenge`,u=await r("GET",a,()=>g(a,"",void 0,"GET"),void 0,[200],xn,s);if(u.binding_session_id!==o)throw w(200);return u},async cancel(o,s){let a=`${Z(o)}/cancel`,u=T(s),p=we(s)??"{}",c=await r("POST",a,()=>g(a,p,u),p,[200],Ie,s);if(c.binding_session_id!==o)throw w(200);return c}}),intents:Object.freeze({async listCards(o,s){let a=`${de(o)}/cards`;i(f(s,["intentToken"],["signal"])&&v(s.intentToken,32,8192),"intentToken must be a valid HTTP header value of at least 32 characters");let p=await r("GET",a,()=>{let c=g(a,"",void 0,"GET");return c.set("x-facto-intent-token",s.intentToken),c},void 0,[200],On,s);if(p.id!==o)throw w(200);return p},async replaceCards(o,s,a){let u=`${de(o)}/cards`;Nn(s);let p=T(a),c=JSON.stringify(s),I=await r("PUT",u,()=>g(u,c,p,"PUT"),c,[200],Rn,a);if(I.id!==o)throw w(200);return I},async cancel(o,s,a){let u=`${de(o)}/cancel`;i(f(s,["intent_token"])&&v(s.intent_token,32,8192),"Cancel requires the original intent_token body of at least 32 characters");let p=JSON.stringify(s),c=await r("POST",u,()=>g(u,p),p,[200],zn,a);if(c.id!==o)throw w(200);return c}}),bindings:Object.freeze({async lookup(o,s){i(f(o,["external_card_id"])&&U(o.external_card_id),"Binding lookup requires only an opaque external_card_id in its body");let a=JSON.stringify(o),u="/api/card/bindings/lookup";return r("POST",u,()=>g(u,a),a,[200],Dn,s)}}),authorizations:Object.freeze({create:(async(o,s)=>{ln(o);let a=T(s),u={...o,program_id:t.programId},p=JSON.stringify(u),c="/api/card/authorizations";return o.decision_mode==="synchronous"?r("POST",c,()=>g(c,p,a),p,[200,422,408],In,s):r("POST",c,()=>g(c,p,a),p,[200],An,s)}),async recordFact(o,s,a){yn(o,s);let u=T(a),p={...s,program_id:t.programId},c=JSON.stringify(p),I=`/api/card/authorizations/${encodeURIComponent(o)}/facts`;return r("POST",I,()=>g(I,c,u),c,[200],Cn,a)},async lookup(o,s){let a=_n(o),u={program_id:t.programId,criteria:a},p=JSON.stringify(u),c="/api/card/authorizations/lookup",I=await r("POST",c,()=>g(c,p),p,[200],bn,s),A=I.authorization;if(A&&(A.origin_connection_id!==t.connectionId||a.by==="charge_id"&&A.charge_id?.toLowerCase()!==a.charge_id.toLowerCase()||a.by==="external_authorization_id"&&(A.external_authorization_id!==a.external_authorization_id||A.resource_version!==a.resource_version||A.mapping_revision!==a.mapping_revision||a.fact_type!==void 0&&A.operation_type!==void 0&&A.operation_type!==a.fact_type)||a.by==="supplier_transaction_id"&&(A.supplier_transaction_id!==a.supplier_transaction_id.trim()||A.resource_version!==a.resource_version||A.mapping_revision!==a.mapping_revision||a.fact_type!==void 0&&A.operation_type!==void 0&&A.operation_type!==a.fact_type)))throw w(200);return I}}),events:Object.freeze({async record(o,s){jn(o);let a=JSON.stringify(o),u="/api/card/events",p=await r("POST",u,()=>g(u,a),a,[200],Ln,s),c=o.kind==="card.unbound"?"revoked":o.kind==="card.lifecycle_changed"?"status_updated":"released";if(p.delivery_id!==o.delivery_id||p.disposition==="applied"&&p.effect!=="none"&&p.effect!==c)throw w(200);return p}}),deliveries:Object.freeze({async list(o,s){pn(o);let a={...o,program_id:t.programId},u=JSON.stringify(a),p="/api/card/deliveries/reconciliations/list",c=await r("POST",p,()=>g(p,u),u,[200],cn,s);if(c.items.length>o.page_size)throw w(200);return c}}),deliveryReplays:Object.freeze({async create(o,s){i(f(o,["selection_id"])&&x(o.selection_id),"Delivery replay requires a fixed selection_id UUID");let a=T(s),u={...o,program_id:t.programId},p=JSON.stringify(u),c="/api/card/deliveries/replays",I=await r("POST",c,()=>g(c,p,a),p,[202],un,s);if(I.selection_id!==o.selection_id)throw w(202);return I}}),deadLetters:Object.freeze({async list(o,s){i(o===void 0||f(o,[],["limit"])&&j(o.limit,c=>typeof c=="number"&&Number.isInteger(c)&&c>=1&&c<=100),"Dead-letter limit must be null, absent, or an integer from 1 to 100");let a=typeof o?.limit=="number"?o.limit:void 0,u=a!==void 0?`/api/card/deliveries/dead-letters?limit=${a}`:"/api/card/deliveries/dead-letters",p=await r("GET",u,()=>g(u,"",void 0,"GET"),void 0,[200],Bn,s);if(p.items.length>(a??50))throw w(200);return p},async replay(o,s){i(x(o),"The dead-letter path identifier must be a UUID");let a=`/api/card/deliveries/dead-letters/${o}/replay`,u=we(s),p=await r("POST",a,()=>g(a,u??""),u,[202],qn,s);if(p.id!==o)throw w(202);return p}})})}export{V as a,G as b,ye as c,S as d,d as e,v as f,x as g,fe as h,m as i,f as j,l as k,i as l,w as m,Te as n,ge as o,ae as p,Zn as q,tt as r};
|