@latticexyz/entrykit 2.2.22-88ddd0c3a68c52469abbc59c2f9db3bbee2eafb6 → 2.2.22-91cbbf67c5363dfcb7435504d6c803c19113e9ad
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/dist/tsup/exports/internal.js +1559 -358
- package/dist/tsup/exports/internal.js.map +1 -1
- package/package.json +10 -8
|
@@ -22,7 +22,7 @@ import { forwardRef, useEffect, useRef, useState } from "react";
|
|
|
22
22
|
import ReactDOM from "react-dom";
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/tailwindcss@3.4.13/node_modules/tailwindcss/tailwind.css?inline
|
|
25
|
-
var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.block {\n display: block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.min-h-\\[22rem\\] {\n min-height: 22rem;\n}\n\n.min-h-\\[26rem\\] {\n min-height: 26rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n';
|
|
25
|
+
var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mr-1 {\n margin-right: -0.25rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.mt-1 {\n margin-top: 0.25rem;\n}\n\n.mt-4 {\n margin-top: 1rem;\n}\n\n.block {\n display: block;\n}\n\n.inline-block {\n display: inline-block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.aspect-square {\n aspect-ratio: 1 / 1;\n}\n\n.h-10 {\n height: 2.5rem;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-3\\.5 {\n height: 0.875rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-\\[2px\\] {\n height: 2px;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.w-10 {\n width: 2.5rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-3\\.5 {\n width: 0.875rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-8 {\n width: 2rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-\\[352px\\] {\n width: 352px;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.cursor-text {\n cursor: text;\n}\n\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-5 {\n gap: 1.25rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-200 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(229 229 229 / var(--tw-divide-opacity));\n}\n\n.divide-neutral-300 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-divide-opacity));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-2 {\n border-width: 2px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-dashed {\n border-style: dashed;\n}\n\n.border-black\\/20 {\n border-color: rgb(0 0 0 / 0.2);\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-green-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(34 197 94 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity));\n}\n\n.bg-transparent {\n background-color: transparent;\n}\n\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-2\\.5 {\n padding: 0.625rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-10 {\n padding-top: 2.5rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-loose {\n line-height: 2;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-amber-500 {\n --tw-text-opacity: 1;\n color: rgb(245 158 11 / var(--tw-text-opacity));\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.text-neutral-700 {\n --tw-text-opacity: 1;\n color: rgb(64 64 64 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-50 {\n opacity: 0.5;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.ring-transparent {\n --tw-ring-color: transparent;\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n.ease-linear {\n transition-timing-function: linear;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.animate-out {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.fade-out {\n --tw-exit-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-2 {\n --tw-enter-translate-y: 0.5rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.slide-in-from-top-2 {\n --tw-enter-translate-y: -0.5rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n.ease-linear {\n animation-timing-function: linear;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.placeholder\\:text-neutral-400::placeholder {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.focus-within\\:border-transparent:focus-within {\n border-color: transparent;\n}\n\n.focus-within\\:ring-orange-500:focus-within {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity));\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:text-white\\/80:hover {\n color: rgb(255 255 255 / 0.8);\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.focus\\:bg-white:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:pointer-events-none {\n pointer-events: none;\n}\n\n.group:hover .group-hover\\:pointer-events-auto {\n pointer-events: auto;\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group:hover .group-hover\\:opacity-0 {\n opacity: 0;\n}\n\n.group:hover .group-hover\\:opacity-100 {\n opacity: 1;\n}\n\n.peer:placeholder-shown ~ .peer-placeholder-shown\\:text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:inline {\n display: inline;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:hidden {\n display: none;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.data-\\[state\\=checked\\]\\:bg-neutral-200[data-state="checked"] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:divide-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-divide-opacity));\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:border-white\\/50:where([data-theme="dark"], [data-theme="dark"] *) {\n border-color: rgb(255 255 255 / 0.5);\n}\n\n.dark\\:bg-blue-600:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-green-600:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(22 163 74 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-neutral-900:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-red-600:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(220 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-neutral-300:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(212 212 212 / var(--tw-text-opacity));\n}\n\n.dark\\:text-neutral-400:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.dark\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:placeholder\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *)::placeholder {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.dark\\:hover\\:text-white:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:focus\\:bg-neutral-700:focus:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.peer:placeholder-shown ~ .dark\\:peer-placeholder-shown\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.dark\\:data-\\[state\\=checked\\]\\:bg-neutral-900[data-state="checked"]:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.\\[\\&_\\>_\\:is\\(dt\\2c dd\\)\\]\\:px-1 > :is(dt,dd) {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n.\\[\\&_\\>_dd\\]\\:text-right > dd {\n text-align: right;\n}\n';
|
|
26
26
|
|
|
27
27
|
// src/ui/Shadow.tsx
|
|
28
28
|
import { useResizeObserver } from "usehooks-ts";
|
|
@@ -37,6 +37,11 @@ function FrameProvider({ frame, children }) {
|
|
|
37
37
|
if (value) throw new Error("`FrameProvider` can only be used once.");
|
|
38
38
|
return /* @__PURE__ */ jsx(Context.Provider, { value: { frame }, children });
|
|
39
39
|
}
|
|
40
|
+
function useFrame() {
|
|
41
|
+
const value = useContext(Context);
|
|
42
|
+
if (!value) throw new Error("`useFrame` can only be used within a `FrameProvider`.");
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
// src/useTheme.ts
|
|
42
47
|
import { useMediaQuery } from "usehooks-ts";
|
|
@@ -184,20 +189,31 @@ function userOpExecutor({ executor }) {
|
|
|
184
189
|
}
|
|
185
190
|
|
|
186
191
|
// src/getBundlerTransport.ts
|
|
192
|
+
import { wiresaw } from "@latticexyz/common/internal";
|
|
187
193
|
function getBundlerTransport(chain) {
|
|
188
194
|
const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (
|
|
198
|
-
|
|
195
|
+
const wiresawWebSocketUrl = chain.rpcUrls.wiresaw?.webSocket?.[0];
|
|
196
|
+
if (wiresawWebSocketUrl) {
|
|
197
|
+
return wiresaw({ wiresaw: webSocket(wiresawWebSocketUrl), fallbackBundler: http(bundlerHttpUrl) });
|
|
198
|
+
}
|
|
199
|
+
const wiresawHttpUrl = chain.rpcUrls.wiresaw?.http[0];
|
|
200
|
+
if (wiresawHttpUrl) {
|
|
201
|
+
return wiresaw({ wiresaw: http(wiresawHttpUrl), fallbackBundler: http(bundlerHttpUrl) });
|
|
202
|
+
}
|
|
203
|
+
if (bundlerHttpUrl) {
|
|
204
|
+
return http(bundlerHttpUrl);
|
|
199
205
|
}
|
|
200
|
-
|
|
206
|
+
if (chain.id === 31337) {
|
|
207
|
+
return userOpExecutor({
|
|
208
|
+
executor: createClient({
|
|
209
|
+
chain,
|
|
210
|
+
transport: fallback([webSocket(), http()]),
|
|
211
|
+
account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
|
|
212
|
+
pollingInterval: 10
|
|
213
|
+
}).extend(transactionQueue())
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
|
|
201
217
|
}
|
|
202
218
|
|
|
203
219
|
// src/EntryKitConfigProvider.tsx
|
|
@@ -368,10 +384,10 @@ function useAccountModal() {
|
|
|
368
384
|
}
|
|
369
385
|
|
|
370
386
|
// src/AccountModal.tsx
|
|
371
|
-
import { twMerge as
|
|
387
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
372
388
|
|
|
373
389
|
// src/AccountModalContent.tsx
|
|
374
|
-
import { useAccount as
|
|
390
|
+
import { useAccount as useAccount8, useConnectorClient } from "wagmi";
|
|
375
391
|
|
|
376
392
|
// src/ConnectWallet.tsx
|
|
377
393
|
import { useAccount } from "wagmi";
|
|
@@ -545,16 +561,39 @@ function ConnectWallet() {
|
|
|
545
561
|
}
|
|
546
562
|
|
|
547
563
|
// src/onboarding/ConnectedSteps.tsx
|
|
548
|
-
import { useEffect as
|
|
549
|
-
import { twMerge as
|
|
564
|
+
import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
565
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
550
566
|
|
|
551
|
-
// src/onboarding/
|
|
552
|
-
import {
|
|
553
|
-
|
|
567
|
+
// src/onboarding/usePrerequisites.ts
|
|
568
|
+
import { useClient as useClient6, useConfig } from "wagmi";
|
|
569
|
+
import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
|
|
570
|
+
import { queryOptions as queryOptions6, skipToken as skipToken6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
|
|
571
|
+
|
|
572
|
+
// src/getPaymaster.ts
|
|
573
|
+
function getPaymaster(chain) {
|
|
574
|
+
const contracts = chain.contracts ?? {};
|
|
575
|
+
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
576
|
+
if ("address" in contracts.quarryPaymaster) {
|
|
577
|
+
return {
|
|
578
|
+
type: "quarry",
|
|
579
|
+
address: contracts.quarryPaymaster.address,
|
|
580
|
+
isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
585
|
+
if ("address" in contracts.paymaster) {
|
|
586
|
+
return {
|
|
587
|
+
type: "simple",
|
|
588
|
+
address: contracts.paymaster.address
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
554
593
|
|
|
555
594
|
// src/onboarding/quarry/useAllowance.ts
|
|
556
595
|
import { useClient } from "wagmi";
|
|
557
|
-
import { queryOptions, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
596
|
+
import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
558
597
|
|
|
559
598
|
// src/quarry/getAllowance.ts
|
|
560
599
|
import { numberToHex as numberToHex2 } from "viem";
|
|
@@ -565,7 +604,10 @@ import { parseAbi } from "viem";
|
|
|
565
604
|
var paymasterAbi = parseAbi([
|
|
566
605
|
"error SpenderSystem_AlreadyRegistered(address spender, address user)",
|
|
567
606
|
"error SpenderSystem_HasOwnBalance(address spender)",
|
|
568
|
-
"
|
|
607
|
+
"error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
|
|
608
|
+
"error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
|
|
609
|
+
"function registerSpender(address spender)",
|
|
610
|
+
"function depositTo(address to) payable"
|
|
569
611
|
]);
|
|
570
612
|
var paymasterConfig = defineStore({
|
|
571
613
|
namespaces: {
|
|
@@ -579,6 +621,13 @@ var paymasterConfig = defineStore({
|
|
|
579
621
|
},
|
|
580
622
|
key: ["user"]
|
|
581
623
|
},
|
|
624
|
+
Balance: {
|
|
625
|
+
schema: {
|
|
626
|
+
user: "address",
|
|
627
|
+
balance: "uint256"
|
|
628
|
+
},
|
|
629
|
+
key: ["user"]
|
|
630
|
+
},
|
|
582
631
|
Grantor: {
|
|
583
632
|
schema: {
|
|
584
633
|
grantor: "address",
|
|
@@ -628,29 +677,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
|
|
|
628
677
|
import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
|
|
629
678
|
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
630
679
|
import { setStorageAt } from "viem/actions";
|
|
631
|
-
|
|
632
|
-
// src/getPaymaster.ts
|
|
633
|
-
function getPaymaster(chain) {
|
|
634
|
-
const contracts = chain.contracts ?? {};
|
|
635
|
-
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
636
|
-
if ("address" in contracts.quarryPaymaster) {
|
|
637
|
-
return {
|
|
638
|
-
type: "quarry",
|
|
639
|
-
address: contracts.quarryPaymaster.address
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
644
|
-
if ("address" in contracts.paymaster) {
|
|
645
|
-
return {
|
|
646
|
-
type: "simple",
|
|
647
|
-
address: contracts.paymaster.address
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
// src/quarry/getAllowance.ts
|
|
654
680
|
async function getAllowance({ client, userAddress }) {
|
|
655
681
|
const paymaster = getPaymaster(client.chain);
|
|
656
682
|
if (paymaster?.type !== "quarry") return null;
|
|
@@ -684,13 +710,10 @@ function getAllowanceQueryOptions({
|
|
|
684
710
|
client,
|
|
685
711
|
userAddress
|
|
686
712
|
}) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
client && userAddress ? {
|
|
690
|
-
|
|
691
|
-
queryFn: () => getAllowance({ client, userAddress })
|
|
692
|
-
} : { queryKey, enabled: false }
|
|
693
|
-
);
|
|
713
|
+
return queryOptions({
|
|
714
|
+
queryKey: ["getAllowance", client?.uid, userAddress],
|
|
715
|
+
queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken
|
|
716
|
+
});
|
|
694
717
|
}
|
|
695
718
|
function useAllowance(userAddress) {
|
|
696
719
|
const { chainId } = useEntryKitConfig();
|
|
@@ -700,7 +723,7 @@ function useAllowance(userAddress) {
|
|
|
700
723
|
|
|
701
724
|
// src/onboarding/quarry/useSpender.ts
|
|
702
725
|
import { useClient as useClient2 } from "wagmi";
|
|
703
|
-
import { queryOptions as queryOptions2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
726
|
+
import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
704
727
|
|
|
705
728
|
// src/onboarding/quarry/getSpender.ts
|
|
706
729
|
import { getRecord as getRecord2 } from "@latticexyz/store/internal";
|
|
@@ -722,18 +745,15 @@ function getSpenderQueryOptions({
|
|
|
722
745
|
userAddress,
|
|
723
746
|
sessionAddress
|
|
724
747
|
}) {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
client && userAddress && sessionAddress ? {
|
|
728
|
-
|
|
729
|
-
queryFn: () => getSpender({ client, userAddress, sessionAddress })
|
|
730
|
-
} : { queryKey, enabled: false }
|
|
731
|
-
);
|
|
748
|
+
return queryOptions2({
|
|
749
|
+
queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
|
|
750
|
+
queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken2
|
|
751
|
+
});
|
|
732
752
|
}
|
|
733
753
|
|
|
734
754
|
// src/onboarding/useDelegation.ts
|
|
735
755
|
import { useClient as useClient3 } from "wagmi";
|
|
736
|
-
import { queryOptions as queryOptions3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
756
|
+
import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
737
757
|
|
|
738
758
|
// src/onboarding/getDelegation.ts
|
|
739
759
|
import { getRecord as getRecord3 } from "@latticexyz/store/internal";
|
|
@@ -776,22 +796,15 @@ function getDelegationQueryOptions({
|
|
|
776
796
|
userAddress,
|
|
777
797
|
sessionAddress
|
|
778
798
|
}) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
client && userAddress && sessionAddress ? {
|
|
782
|
-
|
|
783
|
-
queryFn: () => getDelegation({ client, worldAddress, userAddress, sessionAddress })
|
|
784
|
-
} : { queryKey, enabled: false }
|
|
785
|
-
);
|
|
799
|
+
return queryOptions3({
|
|
800
|
+
queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
|
|
801
|
+
queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken3
|
|
802
|
+
});
|
|
786
803
|
}
|
|
787
804
|
|
|
788
|
-
// src/onboarding/usePrerequisites.ts
|
|
789
|
-
import { queryOptions as queryOptions5, useQuery as useQuery6, useQueryClient } from "@tanstack/react-query";
|
|
790
|
-
import { useClient as useClient5, useConfig } from "wagmi";
|
|
791
|
-
|
|
792
805
|
// src/useSessionAccount.ts
|
|
793
806
|
import { useClient as useClient4 } from "wagmi";
|
|
794
|
-
import { queryOptions as queryOptions4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
807
|
+
import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
795
808
|
|
|
796
809
|
// src/getSessionAccount.ts
|
|
797
810
|
import { toSimpleSmartAccount } from "permissionless/accounts";
|
|
@@ -855,20 +868,50 @@ function getSessionAccountQueryOptions({
|
|
|
855
868
|
client,
|
|
856
869
|
userAddress
|
|
857
870
|
}) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
client && userAddress ? {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
871
|
+
return queryOptions4({
|
|
872
|
+
queryKey: ["getSessionAccount", client?.uid, userAddress],
|
|
873
|
+
queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken4,
|
|
874
|
+
staleTime: Infinity,
|
|
875
|
+
// TODO: replace with function to retry only connection errors
|
|
876
|
+
retry: false
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// src/onboarding/quarry/useBalance.ts
|
|
881
|
+
import { useClient as useClient5 } from "wagmi";
|
|
882
|
+
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
883
|
+
|
|
884
|
+
// src/quarry/getBalance.ts
|
|
885
|
+
import { getRecord as getRecord4 } from "@latticexyz/store/internal";
|
|
886
|
+
async function getBalance({ client, userAddress }) {
|
|
887
|
+
const paymaster = getPaymaster(client.chain);
|
|
888
|
+
if (paymaster?.type !== "quarry") return null;
|
|
889
|
+
const record = await getRecord4(client, {
|
|
890
|
+
address: paymaster.address,
|
|
891
|
+
table: paymasterTables.Balance,
|
|
892
|
+
key: { user: userAddress },
|
|
893
|
+
blockTag: "pending"
|
|
894
|
+
});
|
|
895
|
+
return record.balance;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/onboarding/quarry/useBalance.ts
|
|
899
|
+
function getBalanceQueryOptions({
|
|
900
|
+
client,
|
|
901
|
+
userAddress
|
|
902
|
+
}) {
|
|
903
|
+
return queryOptions5({
|
|
904
|
+
queryKey: ["getBalance", client?.uid, userAddress],
|
|
905
|
+
queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
function useBalance(userAddress) {
|
|
909
|
+
const { chainId } = useEntryKitConfig();
|
|
910
|
+
const client = useClient5({ chainId });
|
|
911
|
+
return useQuery6(getBalanceQueryOptions({ client, userAddress }));
|
|
868
912
|
}
|
|
869
913
|
|
|
870
914
|
// src/onboarding/usePrerequisites.ts
|
|
871
|
-
import { getBalanceQueryOptions } from "wagmi/query";
|
|
872
915
|
function getPrequisitesQueryOptions({
|
|
873
916
|
queryClient,
|
|
874
917
|
config,
|
|
@@ -876,46 +919,46 @@ function getPrequisitesQueryOptions({
|
|
|
876
919
|
userAddress,
|
|
877
920
|
worldAddress
|
|
878
921
|
}) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
client && userAddress ? {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
);
|
|
922
|
+
return queryOptions6({
|
|
923
|
+
queryKey: ["getPrerequisites", client?.uid, userAddress],
|
|
924
|
+
queryFn: client && userAddress ? async () => {
|
|
925
|
+
const paymaster = getPaymaster(client.chain);
|
|
926
|
+
const {
|
|
927
|
+
account: { address: sessionAddress }
|
|
928
|
+
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
929
|
+
const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
|
|
930
|
+
!paymaster ? queryClient.fetchQuery(
|
|
931
|
+
getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
|
|
932
|
+
) : null,
|
|
933
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
|
|
934
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
|
|
935
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
|
|
936
|
+
queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
|
|
937
|
+
]);
|
|
938
|
+
const hasAllowance = allowance == null || allowance > 0n;
|
|
939
|
+
const isSpender = spender == null ? true : spender;
|
|
940
|
+
const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
|
|
941
|
+
const hasQuarryGasBalance = quarryBalance == null || quarryBalance > 0n;
|
|
942
|
+
return {
|
|
943
|
+
sessionAddress,
|
|
944
|
+
hasAllowance,
|
|
945
|
+
isSpender,
|
|
946
|
+
hasGasBalance,
|
|
947
|
+
hasQuarryGasBalance,
|
|
948
|
+
hasDelegation,
|
|
949
|
+
// we intentionally don't enforce an allowance/gas balance here
|
|
950
|
+
complete: isSpender && hasDelegation
|
|
951
|
+
};
|
|
952
|
+
} : skipToken6,
|
|
953
|
+
retry: false
|
|
954
|
+
});
|
|
912
955
|
}
|
|
913
956
|
function usePrerequisites(userAddress) {
|
|
914
957
|
const queryClient = useQueryClient();
|
|
915
958
|
const config = useConfig();
|
|
916
959
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
917
|
-
const client =
|
|
918
|
-
const prereqs =
|
|
960
|
+
const client = useClient6({ chainId });
|
|
961
|
+
const prereqs = useQuery7(
|
|
919
962
|
getPrequisitesQueryOptions({
|
|
920
963
|
queryClient,
|
|
921
964
|
config,
|
|
@@ -932,10 +975,10 @@ function usePrerequisites(userAddress) {
|
|
|
932
975
|
import { useDisconnect } from "wagmi";
|
|
933
976
|
|
|
934
977
|
// src/useENS.ts
|
|
935
|
-
import { useQuery as
|
|
978
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
936
979
|
function useENS(address) {
|
|
937
980
|
const normalizedAddress = address?.toLowerCase();
|
|
938
|
-
return
|
|
981
|
+
return useQuery8({
|
|
939
982
|
enabled: !!normalizedAddress,
|
|
940
983
|
queryKey: ["ens", normalizedAddress],
|
|
941
984
|
queryFn: async () => {
|
|
@@ -1054,8 +1097,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
|
|
|
1054
1097
|
] });
|
|
1055
1098
|
}
|
|
1056
1099
|
|
|
1057
|
-
// src/onboarding/quarry/
|
|
1100
|
+
// src/onboarding/quarry/Allowance.tsx
|
|
1058
1101
|
import { parseEther as parseEther3 } from "viem";
|
|
1102
|
+
|
|
1103
|
+
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1104
|
+
import { parseEther as parseEther2 } from "viem";
|
|
1059
1105
|
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1060
1106
|
|
|
1061
1107
|
// src/quarry/transports/quarryPassIssuer.ts
|
|
@@ -1085,11 +1131,11 @@ async function claimGasPass({ chain, userAddress }) {
|
|
|
1085
1131
|
}
|
|
1086
1132
|
|
|
1087
1133
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1088
|
-
import { useClient as
|
|
1134
|
+
import { useClient as useClient7 } from "wagmi";
|
|
1089
1135
|
function useClaimGasPass() {
|
|
1090
1136
|
const queryClient = useQueryClient2();
|
|
1091
1137
|
const { chain } = useEntryKitConfig();
|
|
1092
|
-
const client =
|
|
1138
|
+
const client = useClient7({ chainId: chain.id });
|
|
1093
1139
|
const mutationKey = ["claimGasPass", chain.id];
|
|
1094
1140
|
return useMutation({
|
|
1095
1141
|
retry: 0,
|
|
@@ -1097,7 +1143,7 @@ function useClaimGasPass() {
|
|
|
1097
1143
|
mutationFn: async (userAddress) => {
|
|
1098
1144
|
if (chain.id === 31337) {
|
|
1099
1145
|
if (!client) throw new Error("No client?");
|
|
1100
|
-
await setAllowanceSlot({ client, userAddress, allowance:
|
|
1146
|
+
await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
|
|
1101
1147
|
} else {
|
|
1102
1148
|
await claimGasPass({ chain, userAddress });
|
|
1103
1149
|
}
|
|
@@ -1172,7 +1218,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1172
1218
|
const claimGasPass2 = useShowMutationError(useClaimGasPass());
|
|
1173
1219
|
useEffect6(() => {
|
|
1174
1220
|
const timer = setTimeout(() => {
|
|
1175
|
-
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data <
|
|
1221
|
+
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
|
|
1176
1222
|
claimGasPass2.mutate(userAddress);
|
|
1177
1223
|
}
|
|
1178
1224
|
});
|
|
@@ -1200,6 +1246,9 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1200
1246
|
] });
|
|
1201
1247
|
}
|
|
1202
1248
|
|
|
1249
|
+
// src/onboarding/Session.tsx
|
|
1250
|
+
import { useEffect as useEffect7 } from "react";
|
|
1251
|
+
|
|
1203
1252
|
// src/onboarding/useSetupSession.ts
|
|
1204
1253
|
import { encodeFunctionData } from "viem";
|
|
1205
1254
|
import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -1213,7 +1262,7 @@ function defineCall(call) {
|
|
|
1213
1262
|
}
|
|
1214
1263
|
|
|
1215
1264
|
// src/onboarding/useSetupSession.ts
|
|
1216
|
-
import { useClient as
|
|
1265
|
+
import { useClient as useClient8 } from "wagmi";
|
|
1217
1266
|
import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
|
|
1218
1267
|
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
|
|
1219
1268
|
|
|
@@ -1225,7 +1274,7 @@ import { getAction as getAction3 } from "viem/utils";
|
|
|
1225
1274
|
import { toHex } from "viem";
|
|
1226
1275
|
import { signTypedData } from "viem/actions";
|
|
1227
1276
|
import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
|
|
1228
|
-
import { getRecord as
|
|
1277
|
+
import { getRecord as getRecord5 } from "@latticexyz/store/internal";
|
|
1229
1278
|
import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
|
|
1230
1279
|
import { hexToResource } from "@latticexyz/common";
|
|
1231
1280
|
import { getAction as getAction2 } from "viem/utils";
|
|
@@ -1237,7 +1286,7 @@ async function signCall({
|
|
|
1237
1286
|
nonce: initialNonce,
|
|
1238
1287
|
client
|
|
1239
1288
|
}) {
|
|
1240
|
-
const nonce = initialNonce ?? (client ? (await
|
|
1289
|
+
const nonce = initialNonce ?? (client ? (await getRecord5(client, {
|
|
1241
1290
|
address: worldAddress,
|
|
1242
1291
|
table: moduleConfig.tables.CallWithSignatureNonces,
|
|
1243
1292
|
key: { signer: userClient.account.address },
|
|
@@ -1290,7 +1339,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
|
|
|
1290
1339
|
function useSetupSession({ userClient }) {
|
|
1291
1340
|
const queryClient = useQueryClient3();
|
|
1292
1341
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1293
|
-
const client =
|
|
1342
|
+
const client = useClient8({ chainId });
|
|
1294
1343
|
const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
|
|
1295
1344
|
return useMutation2({
|
|
1296
1345
|
retry: 0,
|
|
@@ -1396,14 +1445,12 @@ function useSetupSession({ userClient }) {
|
|
|
1396
1445
|
});
|
|
1397
1446
|
}
|
|
1398
1447
|
|
|
1399
|
-
// src/onboarding/Session.tsx
|
|
1400
|
-
import { useEffect as useEffect7 } from "react";
|
|
1401
|
-
|
|
1402
1448
|
// src/useSessionClient.ts
|
|
1403
|
-
import { useClient as
|
|
1449
|
+
import { useClient as useClient9 } from "wagmi";
|
|
1404
1450
|
import {
|
|
1405
|
-
queryOptions as
|
|
1406
|
-
|
|
1451
|
+
queryOptions as queryOptions7,
|
|
1452
|
+
skipToken as skipToken7,
|
|
1453
|
+
useQuery as useQuery9,
|
|
1407
1454
|
useQueryClient as useQueryClient4
|
|
1408
1455
|
} from "@tanstack/react-query";
|
|
1409
1456
|
|
|
@@ -1488,32 +1535,29 @@ function getSessionClientQueryOptions({
|
|
|
1488
1535
|
userAddress,
|
|
1489
1536
|
worldAddress
|
|
1490
1537
|
}) {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
userAddress ? {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
retry: false
|
|
1509
|
-
} : { queryKey, enabled: false }
|
|
1510
|
-
);
|
|
1538
|
+
return queryOptions7({
|
|
1539
|
+
queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
|
|
1540
|
+
queryFn: userAddress ? async () => {
|
|
1541
|
+
const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
|
|
1542
|
+
getSessionAccountQueryOptions({ client, userAddress })
|
|
1543
|
+
);
|
|
1544
|
+
return await getSessionClient({
|
|
1545
|
+
sessionAccount,
|
|
1546
|
+
sessionSigner,
|
|
1547
|
+
userAddress,
|
|
1548
|
+
worldAddress
|
|
1549
|
+
});
|
|
1550
|
+
} : skipToken7,
|
|
1551
|
+
staleTime: Infinity,
|
|
1552
|
+
// TODO: replace with function to retry only connection errors
|
|
1553
|
+
retry: false
|
|
1554
|
+
});
|
|
1511
1555
|
}
|
|
1512
1556
|
function useSessionClient(userAddress) {
|
|
1513
1557
|
const queryClient = useQueryClient4();
|
|
1514
1558
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1515
|
-
const client =
|
|
1516
|
-
return
|
|
1559
|
+
const client = useClient9({ chainId });
|
|
1560
|
+
return useQuery9(
|
|
1517
1561
|
getSessionClientQueryOptions({
|
|
1518
1562
|
queryClient,
|
|
1519
1563
|
client,
|
|
@@ -1529,9 +1573,11 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1529
1573
|
const sessionClient = useShowQueryError(useSessionClient(userClient.account.address));
|
|
1530
1574
|
const setup = useShowMutationError(useSetupSession({ userClient }));
|
|
1531
1575
|
const hasSession = !registerDelegation && !registerDelegation;
|
|
1576
|
+
const { data: prerequisites } = usePrerequisites(userClient.account.address);
|
|
1577
|
+
const { hasAllowance, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
1532
1578
|
useEffect7(() => {
|
|
1533
1579
|
const timer = setTimeout(() => {
|
|
1534
|
-
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
|
|
1580
|
+
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession && (hasAllowance || hasGasBalance || hasQuarryGasBalance)) {
|
|
1535
1581
|
setup.mutate({
|
|
1536
1582
|
sessionClient: sessionClient.data,
|
|
1537
1583
|
registerSpender,
|
|
@@ -1540,7 +1586,17 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1540
1586
|
}
|
|
1541
1587
|
});
|
|
1542
1588
|
return () => clearTimeout(timer);
|
|
1543
|
-
}, [
|
|
1589
|
+
}, [
|
|
1590
|
+
hasSession,
|
|
1591
|
+
isActive,
|
|
1592
|
+
registerDelegation,
|
|
1593
|
+
registerSpender,
|
|
1594
|
+
sessionClient,
|
|
1595
|
+
setup,
|
|
1596
|
+
hasAllowance,
|
|
1597
|
+
hasGasBalance,
|
|
1598
|
+
hasQuarryGasBalance
|
|
1599
|
+
]);
|
|
1544
1600
|
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-4", children: [
|
|
1545
1601
|
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between gap-4", children: [
|
|
1546
1602
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
@@ -1568,7 +1624,10 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1568
1624
|
}
|
|
1569
1625
|
|
|
1570
1626
|
// src/onboarding/GasBalance.tsx
|
|
1571
|
-
import {
|
|
1627
|
+
import { useEffect as useEffect9, useState as useState3 } from "react";
|
|
1628
|
+
import { parseEther as parseEther4 } from "viem";
|
|
1629
|
+
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
1630
|
+
import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
|
|
1572
1631
|
|
|
1573
1632
|
// src/data/relayChains.json
|
|
1574
1633
|
var relayChains_default = {
|
|
@@ -1853,11 +1912,11 @@ var relayChains_default = {
|
|
|
1853
1912
|
// src/onboarding/useSetBalance.ts
|
|
1854
1913
|
import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1855
1914
|
import { setBalance as setBalance2 } from "viem/actions";
|
|
1856
|
-
import { useClient as
|
|
1915
|
+
import { useClient as useClient10 } from "wagmi";
|
|
1857
1916
|
function useSetBalance() {
|
|
1858
1917
|
const queryClient = useQueryClient5();
|
|
1859
1918
|
const { chainId } = useEntryKitConfig();
|
|
1860
|
-
const client =
|
|
1919
|
+
const client = useClient10({ chainId });
|
|
1861
1920
|
return useMutation3({
|
|
1862
1921
|
retry: 0,
|
|
1863
1922
|
mutationKey: ["setBalance", chainId],
|
|
@@ -1873,21 +1932,93 @@ function useSetBalance() {
|
|
|
1873
1932
|
});
|
|
1874
1933
|
}
|
|
1875
1934
|
|
|
1935
|
+
// src/errors/usePrevious.ts
|
|
1936
|
+
import { useEffect as useEffect8, useRef as useRef2 } from "react";
|
|
1937
|
+
function usePrevious(value, initialValue) {
|
|
1938
|
+
const ref = useRef2();
|
|
1939
|
+
useEffect8(() => {
|
|
1940
|
+
ref.current = { value };
|
|
1941
|
+
}, [value]);
|
|
1942
|
+
return ref.current ? ref.current.value : initialValue;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
// src/icons/IconSVG.tsx
|
|
1946
|
+
import { twMerge as twMerge7 } from "tailwind-merge";
|
|
1947
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1948
|
+
function IconSVG({ className, children, ...props }) {
|
|
1949
|
+
return /* @__PURE__ */ jsx16(
|
|
1950
|
+
"svg",
|
|
1951
|
+
{
|
|
1952
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1953
|
+
viewBox: "0 0 24 24",
|
|
1954
|
+
fill: "currentColor",
|
|
1955
|
+
className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
1956
|
+
...props,
|
|
1957
|
+
children
|
|
1958
|
+
}
|
|
1959
|
+
);
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
// src/icons/CopyIcon.tsx
|
|
1963
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1964
|
+
function CopyIcon(props) {
|
|
1965
|
+
return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
|
|
1966
|
+
"path",
|
|
1967
|
+
{
|
|
1968
|
+
d: "M8 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H16C17.1046 21 18 20.1046 18 19V18M8 5C8 6.10457 8.89543 7 10 7H12C13.1046 7 14 6.10457 14 5M8 5C8 3.89543 8.89543 3 10 3H12C13.1046 3 14 3.89543 14 5M14 5H16C17.1046 5 18 5.89543 18 7V10M20 14H10M10 14L13 11M10 14L13 17",
|
|
1969
|
+
fill: "none",
|
|
1970
|
+
stroke: "currentColor",
|
|
1971
|
+
strokeWidth: "2",
|
|
1972
|
+
strokeLinecap: "round",
|
|
1973
|
+
strokeLinejoin: "round"
|
|
1974
|
+
}
|
|
1975
|
+
) });
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
// src/icons/CheckIcon.tsx
|
|
1979
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1980
|
+
function CheckIcon(props) {
|
|
1981
|
+
return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
|
|
1982
|
+
"path",
|
|
1983
|
+
{
|
|
1984
|
+
d: "M5 13L9 17L19 7",
|
|
1985
|
+
fill: "none",
|
|
1986
|
+
stroke: "currentColor",
|
|
1987
|
+
strokeWidth: "2",
|
|
1988
|
+
strokeLinecap: "round",
|
|
1989
|
+
strokeLinejoin: "round"
|
|
1990
|
+
}
|
|
1991
|
+
) });
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1876
1994
|
// src/onboarding/GasBalance.tsx
|
|
1877
|
-
import { Fragment, jsx as
|
|
1995
|
+
import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1878
1996
|
function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
1997
|
+
const queryClient = useQueryClient6();
|
|
1879
1998
|
const { chain } = useEntryKitConfig();
|
|
1880
|
-
const
|
|
1999
|
+
const [copied, setCopied] = useState3(false);
|
|
2000
|
+
const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
|
|
2001
|
+
const prevBalance = usePrevious(balance.data);
|
|
1881
2002
|
useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
|
|
1882
2003
|
const setBalance3 = useShowMutationError(useSetBalance());
|
|
1883
2004
|
const relayChain = relayChains_default[chain.id];
|
|
2005
|
+
const handleCopy = () => {
|
|
2006
|
+
navigator.clipboard.writeText(sessionAddress);
|
|
2007
|
+
setCopied(true);
|
|
2008
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
2009
|
+
};
|
|
2010
|
+
useEffect9(() => {
|
|
2011
|
+
if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
|
|
2012
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
2013
|
+
}
|
|
2014
|
+
}, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
|
|
1884
2015
|
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
|
|
1885
2016
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
|
|
1886
2017
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
|
|
2019
|
+
/* @__PURE__ */ jsx19("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx19(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx19(PendingIcon, { className: "text-sm" }) })
|
|
1889
2020
|
] }),
|
|
1890
|
-
chain.id === 31337 ? /* @__PURE__ */
|
|
2021
|
+
chain.id === 31337 ? /* @__PURE__ */ jsx19(
|
|
1891
2022
|
Button,
|
|
1892
2023
|
{
|
|
1893
2024
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1896,19 +2027,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1896
2027
|
pending: balance.status === "pending" || setBalance3.status === "pending",
|
|
1897
2028
|
onClick: () => setBalance3.mutate({
|
|
1898
2029
|
address: sessionAddress,
|
|
1899
|
-
value:
|
|
2030
|
+
value: parseEther4("0.01") + (balance.data?.value ?? 0n)
|
|
1900
2031
|
}),
|
|
1901
2032
|
children: "Top up"
|
|
1902
2033
|
}
|
|
1903
2034
|
) : relayChain != null ? (
|
|
1904
2035
|
// TODO: convert this to a <ButtonLink>
|
|
1905
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ jsx19(
|
|
1906
2037
|
"a",
|
|
1907
2038
|
{
|
|
1908
|
-
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
|
|
2039
|
+
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
|
|
1909
2040
|
target: "_blank",
|
|
1910
2041
|
rel: "noopener noreferrer",
|
|
1911
|
-
children: /* @__PURE__ */
|
|
2042
|
+
children: /* @__PURE__ */ jsx19(
|
|
1912
2043
|
Button,
|
|
1913
2044
|
{
|
|
1914
2045
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1923,11 +2054,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1923
2054
|
) : null
|
|
1924
2055
|
] }),
|
|
1925
2056
|
isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
2057
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
|
|
1927
2058
|
/* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
|
|
1928
2059
|
"Send funds to",
|
|
1929
2060
|
" ",
|
|
1930
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ jsxs14(
|
|
2062
|
+
"span",
|
|
2063
|
+
{
|
|
2064
|
+
className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
|
|
2065
|
+
onClick: handleCopy,
|
|
2066
|
+
title: "Click to copy",
|
|
2067
|
+
children: [
|
|
2068
|
+
/* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
|
|
2069
|
+
" ",
|
|
2070
|
+
copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
|
|
2071
|
+
]
|
|
2072
|
+
}
|
|
2073
|
+
),
|
|
1931
2074
|
" ",
|
|
1932
2075
|
"on ",
|
|
1933
2076
|
chain.name,
|
|
@@ -1937,133 +2080,741 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1937
2080
|
] });
|
|
1938
2081
|
}
|
|
1939
2082
|
|
|
1940
|
-
// src/onboarding/
|
|
1941
|
-
import {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
{
|
|
1971
|
-
id: "wallet",
|
|
1972
|
-
isComplete: false,
|
|
1973
|
-
content: () => null
|
|
1974
|
-
}
|
|
1975
|
-
];
|
|
1976
|
-
}
|
|
1977
|
-
const steps2 = [
|
|
1978
|
-
{
|
|
1979
|
-
id: "wallet",
|
|
1980
|
-
isComplete: true,
|
|
1981
|
-
content: (props) => /* @__PURE__ */ jsx17(Wallet, { ...props, userAddress })
|
|
1982
|
-
}
|
|
1983
|
-
];
|
|
1984
|
-
if (!paymaster) {
|
|
1985
|
-
if (sessionAddress != null) {
|
|
1986
|
-
steps2.push({
|
|
1987
|
-
id: "gasBalance",
|
|
1988
|
-
isComplete: !!hasGasBalance,
|
|
1989
|
-
content: (props) => /* @__PURE__ */ jsx17(GasBalance, { ...props, sessionAddress })
|
|
1990
|
-
});
|
|
1991
|
-
}
|
|
1992
|
-
} else if (paymaster.type === "quarry") {
|
|
1993
|
-
steps2.push({
|
|
1994
|
-
id: "allowance",
|
|
1995
|
-
isComplete: !!hasAllowance,
|
|
1996
|
-
content: (props) => /* @__PURE__ */ jsx17(Allowance, { ...props, userAddress })
|
|
1997
|
-
});
|
|
2083
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
2084
|
+
import { useState as useState5 } from "react";
|
|
2085
|
+
import { useChains as useChains4, useChainId } from "wagmi";
|
|
2086
|
+
|
|
2087
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2088
|
+
import { useAccount as useAccount5, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
|
|
2089
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2090
|
+
import { useMutation as useMutation4, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
2091
|
+
|
|
2092
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2093
|
+
import { useEffect as useEffect11, useRef as useRef3 } from "react";
|
|
2094
|
+
import { useAccount as useAccount4, useBalance as useBalance5, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
|
|
2095
|
+
import { useIsMounted } from "usehooks-ts";
|
|
2096
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2097
|
+
|
|
2098
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2099
|
+
import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
|
|
2100
|
+
import { useAccount as useAccount2, useSwitchChain } from "wagmi";
|
|
2101
|
+
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2102
|
+
import * as Select from "@radix-ui/react-select";
|
|
2103
|
+
|
|
2104
|
+
// src/icons/ChevronUpIcon.tsx
|
|
2105
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2106
|
+
function ChevronUpIcon(props) {
|
|
2107
|
+
return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
|
|
2108
|
+
"path",
|
|
2109
|
+
{
|
|
2110
|
+
d: "M14.7071 12.7071C14.3166 13.0976 13.6834 13.0976 13.2929 12.7071L10 9.41421L6.70711 12.7071C6.31658 13.0976 5.68342 13.0976 5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929L9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C15.0976 11.6834 15.0976 12.3166 14.7071 12.7071Z",
|
|
2111
|
+
fillRule: "evenodd",
|
|
2112
|
+
clipRule: "evenodd"
|
|
1998
2113
|
}
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
2008
|
-
const completedSteps = steps.filter((step) => step.isComplete);
|
|
2009
|
-
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
2010
|
-
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
2011
|
-
return /* @__PURE__ */ jsx17(
|
|
2012
|
-
"div",
|
|
2114
|
+
) });
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
// src/icons/ChevronDownIcon.tsx
|
|
2118
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2119
|
+
function ChevronDownIcon(props) {
|
|
2120
|
+
return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
|
|
2121
|
+
"path",
|
|
2013
2122
|
{
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
2018
|
-
),
|
|
2019
|
-
children: steps.map((step, i) => {
|
|
2020
|
-
const isActive = step === activeStep;
|
|
2021
|
-
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
2022
|
-
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
2023
|
-
return /* @__PURE__ */ jsx17("div", { className: twMerge7("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx17("div", { className: twMerge7("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: step.content({ isActive, isExpanded }) }) }, step.id);
|
|
2024
|
-
})
|
|
2123
|
+
d: "M5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289L10 10.5858L13.2929 7.29289C13.6834 6.90237 14.3166 6.90237 14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L10.7071 12.7071C10.3166 13.0976 9.68342 13.0976 9.29289 12.7071L5.29289 8.70711C4.90237 8.31658 4.90237 7.68342 5.29289 7.29289Z",
|
|
2124
|
+
fillRule: "evenodd",
|
|
2125
|
+
clipRule: "evenodd"
|
|
2025
2126
|
}
|
|
2026
|
-
);
|
|
2127
|
+
) });
|
|
2027
2128
|
}
|
|
2028
2129
|
|
|
2029
|
-
// src/
|
|
2030
|
-
import {
|
|
2031
|
-
import {
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2130
|
+
// src/ui/Slot.tsx
|
|
2131
|
+
import { isValidElement, cloneElement, Children } from "react";
|
|
2132
|
+
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2133
|
+
function Slot({
|
|
2134
|
+
children,
|
|
2135
|
+
...props
|
|
2136
|
+
}) {
|
|
2137
|
+
if (isValidElement(children)) {
|
|
2138
|
+
return cloneElement(children, {
|
|
2139
|
+
...props,
|
|
2140
|
+
...children.props,
|
|
2141
|
+
style: {
|
|
2142
|
+
...props.style,
|
|
2143
|
+
...children.props.style
|
|
2144
|
+
},
|
|
2145
|
+
className: twMerge8(props.className, children.props.className)
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
if (Children.count(children) > 1) {
|
|
2149
|
+
Children.only(null);
|
|
2039
2150
|
}
|
|
2040
|
-
return
|
|
2151
|
+
return null;
|
|
2041
2152
|
}
|
|
2042
2153
|
|
|
2043
|
-
// src/
|
|
2044
|
-
import {
|
|
2154
|
+
// src/ui/Input.tsx
|
|
2155
|
+
import { twMerge as twMerge9 } from "tailwind-merge";
|
|
2156
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2157
|
+
function Input({ asChild, className, ...props }) {
|
|
2158
|
+
const Child = asChild ? Slot : "input";
|
|
2159
|
+
return /* @__PURE__ */ jsx22(
|
|
2160
|
+
Child,
|
|
2161
|
+
{
|
|
2162
|
+
className: twMerge9(
|
|
2163
|
+
"p-2.5 gap-1 border text-lg font-medium transition",
|
|
2164
|
+
"outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
|
|
2165
|
+
"bg-white border-neutral-300 text-black placeholder:text-neutral-400",
|
|
2166
|
+
"dark:bg-neutral-900 dark:border-neutral-700 dark:text-white dark:placeholder:text-neutral-500",
|
|
2167
|
+
className
|
|
2168
|
+
),
|
|
2169
|
+
...props
|
|
2170
|
+
}
|
|
2171
|
+
);
|
|
2172
|
+
}
|
|
2045
2173
|
|
|
2046
|
-
// src/
|
|
2047
|
-
import {
|
|
2048
|
-
import { jsx as
|
|
2049
|
-
function
|
|
2050
|
-
|
|
2051
|
-
|
|
2174
|
+
// src/onboarding/deposit/ChainBalance.tsx
|
|
2175
|
+
import { useBalance as useBalance3 } from "wagmi";
|
|
2176
|
+
import { Fragment as Fragment2, jsx as jsx23 } from "react/jsx-runtime";
|
|
2177
|
+
function ChainBalance({ chainId, address }) {
|
|
2178
|
+
const balance = useBalance3({ chainId, address });
|
|
2179
|
+
return /* @__PURE__ */ jsx23(Fragment2, { children: balance.data ? /* @__PURE__ */ jsx23(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx23(PendingIcon, {}) });
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2183
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2184
|
+
|
|
2185
|
+
// src/onboarding/deposit/PreloadedImage.tsx
|
|
2186
|
+
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
2187
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2188
|
+
function PreloadedImage({ url, fallback: fallback2, className }) {
|
|
2189
|
+
const { isSuccess, isLoading } = usePreloadImage(url);
|
|
2190
|
+
return /* @__PURE__ */ jsx24("span", { className: twMerge10("inline-flex w-full h-full items-center justify-center overflow-clip", className), children: !isLoading ? isSuccess ? /* @__PURE__ */ jsx24("img", { src: url, className: "w-full h-full object-cover" }) : fallback2 : null });
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2194
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2195
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2196
|
+
var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
|
|
2197
|
+
return /* @__PURE__ */ jsx25(
|
|
2198
|
+
"span",
|
|
2052
2199
|
{
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2200
|
+
ref: forwardedRef,
|
|
2201
|
+
className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
|
|
2202
|
+
children: url ? /* @__PURE__ */ jsx25(PreloadedImage, { url }) : (
|
|
2203
|
+
// TODO: better placeholder
|
|
2204
|
+
/* @__PURE__ */ jsx25(
|
|
2205
|
+
"span",
|
|
2206
|
+
{
|
|
2207
|
+
className: twMerge11(
|
|
2208
|
+
"inline-flex items-center justify-center w-full h-full rounded-full",
|
|
2209
|
+
"border-2 border-dashed border-black/20 dark:border-white/50 opacity-50"
|
|
2210
|
+
),
|
|
2211
|
+
children: name?.slice(0, 1)
|
|
2212
|
+
}
|
|
2213
|
+
)
|
|
2214
|
+
)
|
|
2215
|
+
}
|
|
2216
|
+
);
|
|
2217
|
+
});
|
|
2218
|
+
|
|
2219
|
+
// src/onboarding/deposit/useRelay.ts
|
|
2220
|
+
import {
|
|
2221
|
+
MAINNET_RELAY_API,
|
|
2222
|
+
TESTNET_RELAY_API,
|
|
2223
|
+
fetchChainConfigs,
|
|
2224
|
+
createClient as createClient2,
|
|
2225
|
+
LogLevel
|
|
2226
|
+
} from "@reservoir0x/relay-sdk";
|
|
2227
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
2228
|
+
function useRelay() {
|
|
2229
|
+
const { chain } = useEntryKitConfig();
|
|
2230
|
+
const appOrigin = location.host;
|
|
2231
|
+
const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
|
|
2232
|
+
return useQuery10({
|
|
2233
|
+
queryKey: ["relayChains", baseApiUrl, appOrigin],
|
|
2234
|
+
queryFn: async () => {
|
|
2235
|
+
debug("fetching relay chains from", baseApiUrl);
|
|
2236
|
+
const chains = await fetchChainConfigs(baseApiUrl);
|
|
2237
|
+
debug("got relay chains", chains);
|
|
2238
|
+
const client = createClient2({
|
|
2239
|
+
baseApiUrl,
|
|
2240
|
+
source: appOrigin,
|
|
2241
|
+
chains,
|
|
2242
|
+
logLevel: LogLevel.Verbose
|
|
2243
|
+
});
|
|
2244
|
+
return { client, chains };
|
|
2245
|
+
},
|
|
2246
|
+
refetchOnMount: false,
|
|
2247
|
+
refetchOnReconnect: false,
|
|
2248
|
+
refetchOnWindowFocus: false,
|
|
2249
|
+
staleTime: Infinity
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2254
|
+
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2255
|
+
function ChainSelect({ value, onChange }) {
|
|
2256
|
+
const theme = useTheme();
|
|
2257
|
+
const { frame } = useFrame();
|
|
2258
|
+
const userAccount = useAccount2();
|
|
2259
|
+
const { chains, switchChain } = useSwitchChain();
|
|
2260
|
+
const relay = useRelay();
|
|
2261
|
+
const relayChains = relay.data?.chains;
|
|
2262
|
+
const sourceChains = useMemo2(() => {
|
|
2263
|
+
return chains.map((sourceChain) => {
|
|
2264
|
+
const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
|
|
2265
|
+
return {
|
|
2266
|
+
...sourceChain,
|
|
2267
|
+
relayChain
|
|
2268
|
+
};
|
|
2269
|
+
}).filter((c) => c.relayChain);
|
|
2270
|
+
}, [chains, relayChains]);
|
|
2271
|
+
const selectedChain = sourceChains.find((c) => c.id === value);
|
|
2272
|
+
useEffect10(() => {
|
|
2273
|
+
if (sourceChains.length > 0 && !selectedChain) {
|
|
2274
|
+
const defaultChain = sourceChains[0];
|
|
2275
|
+
onChange(defaultChain.id);
|
|
2276
|
+
switchChain({ chainId: defaultChain.id });
|
|
2277
|
+
}
|
|
2278
|
+
}, [value, selectedChain, sourceChains, onChange, switchChain]);
|
|
2279
|
+
return /* @__PURE__ */ jsxs15(
|
|
2280
|
+
Select.Root,
|
|
2281
|
+
{
|
|
2282
|
+
value: value.toString(),
|
|
2283
|
+
onValueChange: (value2) => {
|
|
2284
|
+
if (value2) {
|
|
2285
|
+
const chain = sourceChains.find((chain2) => chain2.id.toString() === value2);
|
|
2286
|
+
if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
|
|
2287
|
+
onChange(chain.id);
|
|
2288
|
+
}
|
|
2289
|
+
},
|
|
2290
|
+
children: [
|
|
2291
|
+
/* @__PURE__ */ jsx26(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
|
|
2292
|
+
/* @__PURE__ */ jsx26(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
2293
|
+
ChainIcon,
|
|
2294
|
+
{
|
|
2295
|
+
id: selectedChain?.id,
|
|
2296
|
+
name: selectedChain?.name,
|
|
2297
|
+
url: selectedChain?.relayChain?.icon?.[theme],
|
|
2298
|
+
className: "w-8"
|
|
2299
|
+
}
|
|
2300
|
+
) }),
|
|
2301
|
+
/* @__PURE__ */ jsx26(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
2302
|
+
/* @__PURE__ */ jsx26(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
|
|
2303
|
+
/* @__PURE__ */ jsx26(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
|
|
2304
|
+
] }) })
|
|
2305
|
+
] }) }),
|
|
2306
|
+
frame.contentDocument ? /* @__PURE__ */ jsx26(Select.Portal, { container: frame.contentDocument.body, children: /* @__PURE__ */ jsx26(Select.Content, { position: "popper", className: "w-[352px] mt-1 animate-in fade-in slide-in-from-top-2", children: /* @__PURE__ */ jsx26(Select.Viewport, { children: /* @__PURE__ */ jsx26(
|
|
2307
|
+
Select.Group,
|
|
2308
|
+
{
|
|
2309
|
+
className: twMerge12(
|
|
2310
|
+
"flex flex-col border divide-y",
|
|
2311
|
+
"bg-neutral-100 text-neutral-700 border-neutral-300 divide-neutral-300",
|
|
2312
|
+
"dark:bg-neutral-800 dark:text-neutral-300 dark:border-neutral-700 dark:divide-neutral-700"
|
|
2313
|
+
),
|
|
2314
|
+
children: sourceChains.map((chain) => (
|
|
2315
|
+
// TODO: figure out why up/down arrow jump to top/bottom rather than cycling through items
|
|
2316
|
+
/* @__PURE__ */ jsxs15(
|
|
2317
|
+
Select.Item,
|
|
2318
|
+
{
|
|
2319
|
+
value: chain.id.toString(),
|
|
2320
|
+
className: twMerge12(
|
|
2321
|
+
"group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
|
|
2322
|
+
// TODO: different style for checked/active state
|
|
2323
|
+
"text-black focus:bg-white data-[state=checked]:bg-neutral-200",
|
|
2324
|
+
"dark:text-white dark:focus:bg-neutral-700 dark:data-[state=checked]:bg-neutral-900"
|
|
2325
|
+
),
|
|
2326
|
+
children: [
|
|
2327
|
+
/* @__PURE__ */ jsx26(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
|
|
2328
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
|
|
2329
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-500 dark:text-neutral-400", children: /* @__PURE__ */ jsx26(ChainBalance, { chainId: chain.id, address: userAccount.address }) })
|
|
2330
|
+
]
|
|
2331
|
+
},
|
|
2332
|
+
chain.id
|
|
2333
|
+
)
|
|
2334
|
+
))
|
|
2335
|
+
}
|
|
2336
|
+
) }) }) }) : null
|
|
2337
|
+
]
|
|
2338
|
+
}
|
|
2339
|
+
);
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
// src/onboarding/deposit/AmountInput.tsx
|
|
2343
|
+
import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
|
|
2344
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2345
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
2346
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2347
|
+
var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
|
|
2348
|
+
return /* @__PURE__ */ jsx27(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
|
|
2349
|
+
/* @__PURE__ */ jsx27(
|
|
2350
|
+
"input",
|
|
2351
|
+
{
|
|
2352
|
+
ref: forwardedRef,
|
|
2353
|
+
className: twMerge13(
|
|
2354
|
+
"peer flex-grow outline-none bg-transparent",
|
|
2355
|
+
"placeholder:text-neutral-400",
|
|
2356
|
+
"dark:placeholder:text-neutral-500"
|
|
2357
|
+
),
|
|
2358
|
+
placeholder: "0.005",
|
|
2359
|
+
required: true,
|
|
2360
|
+
autoFocus: true,
|
|
2361
|
+
defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
|
|
2362
|
+
onChange: (event) => {
|
|
2363
|
+
const input = event.currentTarget;
|
|
2364
|
+
if (input.value.trim() === "") {
|
|
2365
|
+
input.setCustomValidity("");
|
|
2366
|
+
onChange(void 0);
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
const value = input.value.trim().replace(/\.$/, ".0");
|
|
2370
|
+
if (!/^\d*(\.\d+)?$/.test(value)) {
|
|
2371
|
+
return input.setCustomValidity("Invalid amount.");
|
|
2372
|
+
}
|
|
2373
|
+
input.setCustomValidity("");
|
|
2374
|
+
onChange(parseEther5(value));
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
),
|
|
2378
|
+
/* @__PURE__ */ jsx27(
|
|
2379
|
+
"span",
|
|
2380
|
+
{
|
|
2381
|
+
className: twMerge13(
|
|
2382
|
+
"flex-shrink-0 text-2xl",
|
|
2383
|
+
"peer-placeholder-shown:text-neutral-400",
|
|
2384
|
+
"dark:peer-placeholder-shown:text-neutral-500"
|
|
2385
|
+
),
|
|
2386
|
+
children: /* @__PURE__ */ jsx27(EthIcon, {})
|
|
2387
|
+
}
|
|
2388
|
+
)
|
|
2389
|
+
] }) });
|
|
2390
|
+
});
|
|
2391
|
+
|
|
2392
|
+
// src/onboarding/deposit/SubmitButton.tsx
|
|
2393
|
+
import { useAccount as useAccount3, useBalance as useBalance4, useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
2394
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2395
|
+
import { parseEther as parseEther6 } from "viem";
|
|
2396
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2397
|
+
var MAX_DEPOSIT_AMOUNT = "0.1";
|
|
2398
|
+
function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
2399
|
+
const { chainId: userChainId, address: userAddress } = useAccount3();
|
|
2400
|
+
const { data: userBalance } = useBalance4({ address: userAddress });
|
|
2401
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
2402
|
+
const switchChain = useSwitchChain2();
|
|
2403
|
+
if (shouldSwitchChain) {
|
|
2404
|
+
return /* @__PURE__ */ jsx28(
|
|
2405
|
+
Button,
|
|
2406
|
+
{
|
|
2407
|
+
type: "button",
|
|
2408
|
+
variant: "primary",
|
|
2409
|
+
className: twMerge14("w-full", className),
|
|
2410
|
+
pending: switchChain.isPending,
|
|
2411
|
+
onClick: () => switchChain.switchChain({ chainId }),
|
|
2412
|
+
children: "Switch chain"
|
|
2413
|
+
}
|
|
2414
|
+
);
|
|
2415
|
+
} else if (amount) {
|
|
2416
|
+
if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
|
|
2417
|
+
return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
|
|
2418
|
+
"Max amount is ",
|
|
2419
|
+
MAX_DEPOSIT_AMOUNT,
|
|
2420
|
+
" ETH"
|
|
2421
|
+
] });
|
|
2422
|
+
} else if (amount > (userBalance?.value ?? 0n)) {
|
|
2423
|
+
return /* @__PURE__ */ jsx28(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
return /* @__PURE__ */ jsx28(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
// src/icons/WarningIcon.tsx
|
|
2430
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2431
|
+
function WarningIcon(props) {
|
|
2432
|
+
return /* @__PURE__ */ jsx29(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx29(
|
|
2433
|
+
"path",
|
|
2434
|
+
{
|
|
2435
|
+
d: "M12 9V11M12 15H12.01M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33978 16C2.56998 17.3333 3.53223 19 5.07183 19Z",
|
|
2436
|
+
stroke: "currentColor",
|
|
2437
|
+
strokeWidth: "2",
|
|
2438
|
+
strokeLinecap: "round",
|
|
2439
|
+
strokeLinejoin: "round"
|
|
2440
|
+
}
|
|
2441
|
+
) });
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
// src/formatGas.ts
|
|
2445
|
+
import { formatGwei } from "viem";
|
|
2446
|
+
function formatGas(wei) {
|
|
2447
|
+
const formatted = formatGwei(wei);
|
|
2448
|
+
const magnitude = Math.floor(parseFloat(formatted)).toString().length;
|
|
2449
|
+
return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2453
|
+
import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2454
|
+
function DepositForm({
|
|
2455
|
+
sourceChain,
|
|
2456
|
+
setSourceChainId,
|
|
2457
|
+
amount,
|
|
2458
|
+
setAmount,
|
|
2459
|
+
estimatedFee,
|
|
2460
|
+
estimatedTime,
|
|
2461
|
+
onSubmit,
|
|
2462
|
+
submitButton
|
|
2463
|
+
}) {
|
|
2464
|
+
const amountInputRef = useRef3(null);
|
|
2465
|
+
const isMounted = useIsMounted();
|
|
2466
|
+
const { address: userAddress, chainId: userChainId } = useAccount4();
|
|
2467
|
+
const balance = useShowQueryError(useBalance5({ chainId: sourceChain.id, address: userAddress }));
|
|
2468
|
+
const quarryBalance = useShowQueryError(useBalance(userAddress));
|
|
2469
|
+
useWatchBlockNumber2({
|
|
2470
|
+
onBlockNumber: () => {
|
|
2471
|
+
balance.refetch();
|
|
2472
|
+
quarryBalance.refetch();
|
|
2473
|
+
}
|
|
2474
|
+
});
|
|
2475
|
+
const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
|
|
2476
|
+
const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
|
|
2477
|
+
useEffect11(() => {
|
|
2478
|
+
amountInputRef.current?.focus();
|
|
2479
|
+
}, [userChainId]);
|
|
2480
|
+
return /* @__PURE__ */ jsxs18(
|
|
2481
|
+
"form",
|
|
2482
|
+
{
|
|
2483
|
+
className: "flex flex-col gap-5",
|
|
2484
|
+
onSubmit: async (event) => {
|
|
2485
|
+
event.preventDefault();
|
|
2486
|
+
try {
|
|
2487
|
+
await onSubmit();
|
|
2488
|
+
if (isMounted()) {
|
|
2489
|
+
setAmount(void 0);
|
|
2490
|
+
if (amountInputRef.current) {
|
|
2491
|
+
amountInputRef.current.value = "";
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
} catch (error2) {
|
|
2495
|
+
console.error("Error during deposit", error2);
|
|
2496
|
+
} finally {
|
|
2497
|
+
amountInputRef.current?.focus();
|
|
2498
|
+
}
|
|
2499
|
+
},
|
|
2500
|
+
children: [
|
|
2501
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
2502
|
+
/* @__PURE__ */ jsx30(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
|
|
2503
|
+
/* @__PURE__ */ jsx30(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
|
|
2504
|
+
] }),
|
|
2505
|
+
/* @__PURE__ */ jsxs18(
|
|
2506
|
+
"dl",
|
|
2507
|
+
{
|
|
2508
|
+
className: twMerge15(
|
|
2509
|
+
"grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
|
|
2510
|
+
"divide-neutral-200 text-neutral-500",
|
|
2511
|
+
"dark:divide-neutral-700 dark:text-neutral-400"
|
|
2512
|
+
),
|
|
2513
|
+
children: [
|
|
2514
|
+
/* @__PURE__ */ jsx30("dt", { children: "Available to deposit" }),
|
|
2515
|
+
/* @__PURE__ */ jsx30("dd", { children: balance.isSuccess ? /* @__PURE__ */ jsx30(Balance, { wei: balance.data.value }) : balance.isError ? /* @__PURE__ */ jsx30("span", { title: String(balance.error), children: /* @__PURE__ */ jsx30(WarningIcon, { className: "inline-block text-amber-500" }) }) : balance.isLoading ? /* @__PURE__ */ jsx30(PendingIcon, { className: "inline-block text-xs" }) : null }),
|
|
2516
|
+
/* @__PURE__ */ jsx30("dt", { children: "Gas balance after deposit" }),
|
|
2517
|
+
/* @__PURE__ */ jsx30("dd", { children: /* @__PURE__ */ jsx30(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
|
|
2518
|
+
/* @__PURE__ */ jsx30("dt", { children: "Estimated fee" }),
|
|
2519
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2520
|
+
formatGas(estimatedFee.fee),
|
|
2521
|
+
" gwei"
|
|
2522
|
+
] }) : estimatedFee.error ? /* @__PURE__ */ jsx30("span", { title: String(estimatedFee.error), children: /* @__PURE__ */ jsx30(WarningIcon, { className: "inline-block text-amber-500" }) }) : estimatedFee.isLoading ? /* @__PURE__ */ jsx30(PendingIcon, { className: "inline-block text-xs" }) : null }),
|
|
2523
|
+
/* @__PURE__ */ jsx30("dt", { children: "Time to deposit" }),
|
|
2524
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedTime })
|
|
2525
|
+
]
|
|
2526
|
+
}
|
|
2527
|
+
),
|
|
2528
|
+
hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx30(SubmitButton, { disabled: true, children: "Not enough funds" })
|
|
2529
|
+
]
|
|
2530
|
+
}
|
|
2531
|
+
);
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
// src/onboarding/deposit/useDeposits.ts
|
|
2535
|
+
import { createStore as createStore4 } from "zustand/vanilla";
|
|
2536
|
+
import { useStore as useStore2 } from "zustand";
|
|
2537
|
+
import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
2538
|
+
var store4 = createStore4(() => ({
|
|
2539
|
+
count: 0,
|
|
2540
|
+
deposits: []
|
|
2541
|
+
}));
|
|
2542
|
+
function useDeposits() {
|
|
2543
|
+
const deposits = useStore2(store4, (state) => state.deposits);
|
|
2544
|
+
const addDeposit = useCallback2((transaction) => {
|
|
2545
|
+
store4.setState((state) => {
|
|
2546
|
+
if (transaction.type === "relay") {
|
|
2547
|
+
const existingDeposit = state.deposits.find(
|
|
2548
|
+
(deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
|
|
2549
|
+
);
|
|
2550
|
+
if (existingDeposit) {
|
|
2551
|
+
return state;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
return {
|
|
2555
|
+
count: state.count + 1,
|
|
2556
|
+
deposits: [
|
|
2557
|
+
...state.deposits,
|
|
2558
|
+
{
|
|
2559
|
+
...transaction,
|
|
2560
|
+
uid: `deposit-${state.count}`
|
|
2561
|
+
}
|
|
2562
|
+
]
|
|
2563
|
+
};
|
|
2564
|
+
});
|
|
2565
|
+
}, []);
|
|
2566
|
+
const removeDeposit = useCallback2((uid) => {
|
|
2567
|
+
store4.setState((state) => ({
|
|
2568
|
+
deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
|
|
2569
|
+
}));
|
|
2570
|
+
}, []);
|
|
2571
|
+
return useMemo3(
|
|
2572
|
+
() => ({
|
|
2573
|
+
deposits,
|
|
2574
|
+
addDeposit,
|
|
2575
|
+
removeDeposit
|
|
2576
|
+
}),
|
|
2577
|
+
[addDeposit, deposits, removeDeposit]
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2582
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2583
|
+
function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2584
|
+
const { chain } = useEntryKitConfig();
|
|
2585
|
+
const paymaster = getPaymaster(chain);
|
|
2586
|
+
const publicClient = usePublicClient();
|
|
2587
|
+
const { address: userAddress } = useAccount5();
|
|
2588
|
+
const { writeContractAsync } = useWriteContract();
|
|
2589
|
+
const { addDeposit } = useDeposits();
|
|
2590
|
+
if (!userAddress) {
|
|
2591
|
+
throw new Error("User address not found");
|
|
2592
|
+
}
|
|
2593
|
+
const { data: gasPrice } = useQuery11({
|
|
2594
|
+
queryKey: ["gasPrice", sourceChain.id],
|
|
2595
|
+
queryFn: async () => {
|
|
2596
|
+
if (!publicClient) throw new Error("Public client not available");
|
|
2597
|
+
return publicClient.getGasPrice();
|
|
2598
|
+
},
|
|
2599
|
+
refetchInterval: 15e3,
|
|
2600
|
+
enabled: !!publicClient
|
|
2601
|
+
});
|
|
2602
|
+
const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
|
|
2603
|
+
to: paymaster?.address,
|
|
2604
|
+
data: encodeFunctionData2({
|
|
2605
|
+
abi: paymasterAbi,
|
|
2606
|
+
functionName: "depositTo",
|
|
2607
|
+
args: [userAddress]
|
|
2608
|
+
}),
|
|
2609
|
+
value: amount
|
|
2610
|
+
});
|
|
2611
|
+
const deposit = useMutation4({
|
|
2612
|
+
mutationKey: ["depositViaTransfer", amount?.toString()],
|
|
2613
|
+
mutationFn: async () => {
|
|
2614
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
2615
|
+
if (!publicClient) throw new Error("Public client not found");
|
|
2616
|
+
if (!amount) throw new Error("Amount cannot be 0");
|
|
2617
|
+
try {
|
|
2618
|
+
const hash = await writeContractAsync({
|
|
2619
|
+
address: paymaster.address,
|
|
2620
|
+
abi: paymasterAbi,
|
|
2621
|
+
functionName: "depositTo",
|
|
2622
|
+
args: [userAddress],
|
|
2623
|
+
value: amount
|
|
2624
|
+
});
|
|
2625
|
+
const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
|
|
2626
|
+
if (receipt2.status === "reverted") {
|
|
2627
|
+
throw new Error("Transfer transaction reverted.");
|
|
2628
|
+
}
|
|
2629
|
+
return receipt2;
|
|
2630
|
+
});
|
|
2631
|
+
const pendingDeposit = {
|
|
2632
|
+
type: "transfer",
|
|
2633
|
+
amount,
|
|
2634
|
+
chainL1Id: sourceChain.id,
|
|
2635
|
+
chainL2Id: chain.id,
|
|
2636
|
+
hash,
|
|
2637
|
+
receipt,
|
|
2638
|
+
start: /* @__PURE__ */ new Date(),
|
|
2639
|
+
estimatedTime: 1e3 * 12,
|
|
2640
|
+
isComplete: receipt.then(() => void 0)
|
|
2641
|
+
};
|
|
2642
|
+
addDeposit(pendingDeposit);
|
|
2643
|
+
} catch (error2) {
|
|
2644
|
+
console.error("Error while depositing via bridge", error2);
|
|
2645
|
+
throw error2;
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
});
|
|
2649
|
+
const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
|
|
2650
|
+
return /* @__PURE__ */ jsx31(
|
|
2651
|
+
DepositForm,
|
|
2652
|
+
{
|
|
2653
|
+
sourceChain,
|
|
2654
|
+
setSourceChainId,
|
|
2655
|
+
amount,
|
|
2656
|
+
setAmount,
|
|
2657
|
+
estimatedFee: {
|
|
2658
|
+
fee: estimatedFee,
|
|
2659
|
+
isLoading: !prepareData && !prepareError || !gasPrice,
|
|
2660
|
+
error: prepareError instanceof Error ? prepareError : void 0
|
|
2661
|
+
},
|
|
2662
|
+
estimatedTime: "A few seconds",
|
|
2663
|
+
onSubmit: async () => {
|
|
2664
|
+
await deposit.mutateAsync();
|
|
2665
|
+
},
|
|
2666
|
+
submitButton: /* @__PURE__ */ jsx31(
|
|
2667
|
+
SubmitButton,
|
|
2668
|
+
{
|
|
2669
|
+
variant: "primary",
|
|
2670
|
+
amount,
|
|
2671
|
+
chainId: sourceChain.id,
|
|
2672
|
+
disabled: !!prepareError || !amount || !userAddress,
|
|
2673
|
+
pending: deposit.isPending,
|
|
2674
|
+
children: "Deposit"
|
|
2675
|
+
}
|
|
2676
|
+
)
|
|
2059
2677
|
}
|
|
2060
2678
|
);
|
|
2061
2679
|
}
|
|
2062
2680
|
|
|
2681
|
+
// src/onboarding/deposit/DepositViaRelayForm.tsx
|
|
2682
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
2683
|
+
import { useAccount as useAccount6, useWalletClient } from "wagmi";
|
|
2684
|
+
import { useMutation as useMutation5, useQuery as useQuery12 } from "@tanstack/react-query";
|
|
2685
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2686
|
+
var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2687
|
+
function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2688
|
+
const { chain, chainId: destinationChainId } = useEntryKitConfig();
|
|
2689
|
+
const paymaster = getPaymaster(chain);
|
|
2690
|
+
const { data: wallet } = useWalletClient();
|
|
2691
|
+
const { address: userAddress } = useAccount6();
|
|
2692
|
+
const { addDeposit } = useDeposits();
|
|
2693
|
+
const { data: relay } = useRelay();
|
|
2694
|
+
const relayClient = relay?.client;
|
|
2695
|
+
const quote = useQuery12({
|
|
2696
|
+
queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
|
|
2697
|
+
queryFn: async () => {
|
|
2698
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2699
|
+
if (!userAddress) throw new Error("No user address found.");
|
|
2700
|
+
const result = await relayClient.actions.getQuote({
|
|
2701
|
+
chainId: sourceChain.id,
|
|
2702
|
+
toChainId: destinationChainId,
|
|
2703
|
+
currency: ETH_ADDRESS,
|
|
2704
|
+
toCurrency: ETH_ADDRESS,
|
|
2705
|
+
amount: amount?.toString(),
|
|
2706
|
+
tradeType: "EXACT_OUTPUT",
|
|
2707
|
+
recipient: paymaster?.address,
|
|
2708
|
+
wallet,
|
|
2709
|
+
txs: [
|
|
2710
|
+
{
|
|
2711
|
+
to: paymaster?.address,
|
|
2712
|
+
data: encodeFunctionData3({
|
|
2713
|
+
abi: paymasterAbi,
|
|
2714
|
+
functionName: "depositTo",
|
|
2715
|
+
args: [userAddress]
|
|
2716
|
+
}),
|
|
2717
|
+
value: amount?.toString()
|
|
2718
|
+
}
|
|
2719
|
+
]
|
|
2720
|
+
});
|
|
2721
|
+
if (!result) {
|
|
2722
|
+
throw new Error("Failed to get relay quote");
|
|
2723
|
+
}
|
|
2724
|
+
return result;
|
|
2725
|
+
},
|
|
2726
|
+
retry: 1,
|
|
2727
|
+
refetchInterval: 15e3,
|
|
2728
|
+
enabled: !!amount && !!userAddress && !!relayClient
|
|
2729
|
+
});
|
|
2730
|
+
const deposit = useMutation5({
|
|
2731
|
+
mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
|
|
2732
|
+
mutationFn: async ({ quote: quote2, amount: amount2 }) => {
|
|
2733
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2734
|
+
if (!wallet) throw new Error("No wallet found.");
|
|
2735
|
+
try {
|
|
2736
|
+
return new Promise((resolve) => {
|
|
2737
|
+
const pendingDeposit = relayClient.actions.execute({
|
|
2738
|
+
quote: quote2,
|
|
2739
|
+
wallet,
|
|
2740
|
+
onProgress(progress) {
|
|
2741
|
+
const currentStep = progress.currentStep;
|
|
2742
|
+
const requestId = currentStep?.requestId;
|
|
2743
|
+
const currentState = currentStep?.items[0]?.progressState;
|
|
2744
|
+
if (requestId && currentState === "validating") {
|
|
2745
|
+
addDeposit({
|
|
2746
|
+
type: "relay",
|
|
2747
|
+
requestId,
|
|
2748
|
+
amount: amount2,
|
|
2749
|
+
chainL1Id: sourceChain.id,
|
|
2750
|
+
chainL2Id: destinationChainId,
|
|
2751
|
+
start: /* @__PURE__ */ new Date(),
|
|
2752
|
+
estimatedTime: 1e3 * 30,
|
|
2753
|
+
depositPromise: pendingDeposit,
|
|
2754
|
+
isComplete: pendingDeposit.then(() => void 0)
|
|
2755
|
+
});
|
|
2756
|
+
resolve(void 0);
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
});
|
|
2760
|
+
});
|
|
2761
|
+
} catch (error2) {
|
|
2762
|
+
console.error("Error while depositing via Relay", error2);
|
|
2763
|
+
throw error2;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
});
|
|
2767
|
+
const fees = quote.data?.fees;
|
|
2768
|
+
const gasFee = BigInt(fees?.gas?.amount ?? 0);
|
|
2769
|
+
const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
|
|
2770
|
+
const fee = gasFee + relayerFee;
|
|
2771
|
+
return /* @__PURE__ */ jsx32(
|
|
2772
|
+
DepositForm,
|
|
2773
|
+
{
|
|
2774
|
+
sourceChain,
|
|
2775
|
+
setSourceChainId,
|
|
2776
|
+
amount,
|
|
2777
|
+
setAmount,
|
|
2778
|
+
estimatedFee: {
|
|
2779
|
+
fee: fee != null ? BigInt(fee) : void 0,
|
|
2780
|
+
isLoading: quote.isLoading,
|
|
2781
|
+
error: quote.error instanceof Error ? quote.error : void 0
|
|
2782
|
+
},
|
|
2783
|
+
estimatedTime: "A few seconds",
|
|
2784
|
+
onSubmit: async () => {
|
|
2785
|
+
if (!quote.data || !amount) return;
|
|
2786
|
+
await deposit.mutateAsync({ quote: quote.data, amount });
|
|
2787
|
+
},
|
|
2788
|
+
submitButton: /* @__PURE__ */ jsx32(
|
|
2789
|
+
SubmitButton,
|
|
2790
|
+
{
|
|
2791
|
+
variant: "primary",
|
|
2792
|
+
amount,
|
|
2793
|
+
chainId: sourceChain.id,
|
|
2794
|
+
disabled: quote.isError || !amount,
|
|
2795
|
+
pending: deposit.isPending,
|
|
2796
|
+
children: "Deposit"
|
|
2797
|
+
}
|
|
2798
|
+
)
|
|
2799
|
+
}
|
|
2800
|
+
);
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2804
|
+
import { useEffect as useEffect13 } from "react";
|
|
2805
|
+
import { useQuery as useQuery15, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
2806
|
+
|
|
2807
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2808
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
2809
|
+
|
|
2810
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2811
|
+
import { useEffect as useEffect12, useState as useState4 } from "react";
|
|
2812
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2813
|
+
|
|
2063
2814
|
// src/icons/CloseIcon.tsx
|
|
2064
|
-
import { jsx as
|
|
2815
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2065
2816
|
function CloseIcon(props) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2817
|
+
return /* @__PURE__ */ jsx33(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx33(
|
|
2067
2818
|
"path",
|
|
2068
2819
|
{
|
|
2069
2820
|
d: "M6 18L18 6M6 6L18 18",
|
|
@@ -2076,52 +2827,502 @@ function CloseIcon(props) {
|
|
|
2076
2827
|
) });
|
|
2077
2828
|
}
|
|
2078
2829
|
|
|
2830
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2831
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2832
|
+
function DepositStatus({ status, progress, children, onDismiss }) {
|
|
2833
|
+
const [appear, setAppear] = useState4(false);
|
|
2834
|
+
useEffect12(() => {
|
|
2835
|
+
setAppear(true);
|
|
2836
|
+
}, []);
|
|
2837
|
+
return /* @__PURE__ */ jsxs19("div", { className: "group bg-white dark:bg-neutral-900 flex flex-col animate-in fade-in slide-in-from-bottom-2 animate-out fade-out", children: [
|
|
2838
|
+
/* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
|
|
2839
|
+
/* @__PURE__ */ jsx34("div", { className: "flex-grow", children }),
|
|
2840
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
|
|
2841
|
+
/* @__PURE__ */ jsx34("span", { className: "col-start-1 row-start-1 transition opacity-100 group-hover:opacity-0 group-hover:pointer-events-none", children: status === "success" ? /* @__PURE__ */ jsx34(CheckIcon, { className: "text-green-600" }) : status === "error" ? /* @__PURE__ */ jsx34(WarningIcon, { className: "text-amber-500" }) : /* @__PURE__ */ jsx34(PendingIcon, { className: "text-neutral-400 dark:text-neutral-500 transition" }) }),
|
|
2842
|
+
/* @__PURE__ */ jsx34(
|
|
2843
|
+
"button",
|
|
2844
|
+
{
|
|
2845
|
+
type: "button",
|
|
2846
|
+
className: twMerge16(
|
|
2847
|
+
"col-start-1 row-start-1 flex items-center justify-center transition",
|
|
2848
|
+
"opacity-0 pointer-events-none",
|
|
2849
|
+
"group-hover:opacity-100 group-hover:pointer-events-auto",
|
|
2850
|
+
"text-neutral-400 hover:text-black",
|
|
2851
|
+
"dark:text-neutral-500 dark:hover:text-white"
|
|
2852
|
+
),
|
|
2853
|
+
title: "Dismiss",
|
|
2854
|
+
onClick: onDismiss,
|
|
2855
|
+
children: /* @__PURE__ */ jsx34(CloseIcon, {})
|
|
2856
|
+
}
|
|
2857
|
+
)
|
|
2858
|
+
] })
|
|
2859
|
+
] }),
|
|
2860
|
+
/* @__PURE__ */ jsx34("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx34(
|
|
2861
|
+
"div",
|
|
2862
|
+
{
|
|
2863
|
+
className: twMerge16(
|
|
2864
|
+
"w-full h-full transition ease-linear",
|
|
2865
|
+
status === "success" ? "bg-green-500 dark:bg-green-600" : status === "error" ? "bg-red-500 dark:bg-red-600" : "bg-blue-500 dark:bg-blue-600",
|
|
2866
|
+
status === "pending" ? "opacity-100" : "opacity-0"
|
|
2867
|
+
),
|
|
2868
|
+
style: status === "pending" ? {
|
|
2869
|
+
transform: appear ? `translateX(0)` : "translate(-100%)",
|
|
2870
|
+
transitionDuration: `${progress.duration}ms`,
|
|
2871
|
+
transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
|
|
2872
|
+
} : void 0
|
|
2873
|
+
}
|
|
2874
|
+
) })
|
|
2875
|
+
] });
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2879
|
+
import { useChains as useChains2 } from "wagmi";
|
|
2880
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2881
|
+
function TransferDepositStatus({
|
|
2882
|
+
amount,
|
|
2883
|
+
chainL1Id,
|
|
2884
|
+
hash,
|
|
2885
|
+
receipt: receiptPromise,
|
|
2886
|
+
start,
|
|
2887
|
+
estimatedTime,
|
|
2888
|
+
onDismiss
|
|
2889
|
+
}) {
|
|
2890
|
+
const chains = useChains2();
|
|
2891
|
+
const chain = chains.find((chain2) => chain2.id === chainL1Id);
|
|
2892
|
+
const receipt = useQuery13({
|
|
2893
|
+
queryKey: ["transferDepositStatus", hash],
|
|
2894
|
+
queryFn: () => receiptPromise
|
|
2895
|
+
});
|
|
2896
|
+
return /* @__PURE__ */ jsx35(
|
|
2897
|
+
DepositStatus,
|
|
2898
|
+
{
|
|
2899
|
+
status: receipt.status,
|
|
2900
|
+
progress: {
|
|
2901
|
+
duration: estimatedTime,
|
|
2902
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2903
|
+
},
|
|
2904
|
+
onDismiss,
|
|
2905
|
+
children: (() => {
|
|
2906
|
+
const blockExplorer = chain.blockExplorers?.default.url;
|
|
2907
|
+
if (receipt.status === "pending") {
|
|
2908
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2909
|
+
"Confirming deposit on",
|
|
2910
|
+
" ",
|
|
2911
|
+
/* @__PURE__ */ jsx35(
|
|
2912
|
+
"a",
|
|
2913
|
+
{
|
|
2914
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2915
|
+
target: "_blank",
|
|
2916
|
+
rel: "noreferrer noopener",
|
|
2917
|
+
children: chain.name
|
|
2918
|
+
}
|
|
2919
|
+
),
|
|
2920
|
+
"\u2026"
|
|
2921
|
+
] });
|
|
2922
|
+
}
|
|
2923
|
+
if (receipt.status === "error") {
|
|
2924
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2925
|
+
"Could not find deposit on",
|
|
2926
|
+
" ",
|
|
2927
|
+
/* @__PURE__ */ jsx35(
|
|
2928
|
+
"a",
|
|
2929
|
+
{
|
|
2930
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2931
|
+
target: "_blank",
|
|
2932
|
+
rel: "noreferrer noopener",
|
|
2933
|
+
children: chain.name
|
|
2934
|
+
}
|
|
2935
|
+
),
|
|
2936
|
+
"."
|
|
2937
|
+
] });
|
|
2938
|
+
}
|
|
2939
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2940
|
+
"Successfully",
|
|
2941
|
+
" ",
|
|
2942
|
+
/* @__PURE__ */ jsx35(
|
|
2943
|
+
"a",
|
|
2944
|
+
{
|
|
2945
|
+
href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
|
|
2946
|
+
target: "_blank",
|
|
2947
|
+
rel: "noreferrer noopener",
|
|
2948
|
+
children: "deposited"
|
|
2949
|
+
}
|
|
2950
|
+
),
|
|
2951
|
+
" ",
|
|
2952
|
+
/* @__PURE__ */ jsx35(Balance, { wei: amount })
|
|
2953
|
+
] });
|
|
2954
|
+
})()
|
|
2955
|
+
}
|
|
2956
|
+
);
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
// src/onboarding/deposit/RelayDepositStatus.tsx
|
|
2960
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
2961
|
+
import { useChains as useChains3 } from "wagmi";
|
|
2962
|
+
import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2963
|
+
function RelayDepositStatus({
|
|
2964
|
+
amount,
|
|
2965
|
+
chainL1Id,
|
|
2966
|
+
chainL2Id,
|
|
2967
|
+
start,
|
|
2968
|
+
estimatedTime,
|
|
2969
|
+
depositPromise,
|
|
2970
|
+
onDismiss
|
|
2971
|
+
}) {
|
|
2972
|
+
const chains = useChains3();
|
|
2973
|
+
const chainL1 = chains.find((chain) => chain.id === chainL1Id);
|
|
2974
|
+
const chainL2 = chains.find((chain) => chain.id === chainL2Id);
|
|
2975
|
+
const deposit = useQuery14({
|
|
2976
|
+
queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
|
|
2977
|
+
queryFn: () => depositPromise
|
|
2978
|
+
});
|
|
2979
|
+
return /* @__PURE__ */ jsx36(
|
|
2980
|
+
DepositStatus,
|
|
2981
|
+
{
|
|
2982
|
+
status: deposit.status,
|
|
2983
|
+
progress: {
|
|
2984
|
+
duration: estimatedTime,
|
|
2985
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2986
|
+
},
|
|
2987
|
+
onDismiss,
|
|
2988
|
+
children: (() => {
|
|
2989
|
+
if (deposit.status === "pending") {
|
|
2990
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2991
|
+
"Relay bridge deposit pending on ",
|
|
2992
|
+
chainL1.name,
|
|
2993
|
+
"\u2026"
|
|
2994
|
+
] });
|
|
2995
|
+
}
|
|
2996
|
+
if (deposit.status === "error") {
|
|
2997
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2998
|
+
"Relay bridge deposit to ",
|
|
2999
|
+
chainL2.name,
|
|
3000
|
+
" failed."
|
|
3001
|
+
] });
|
|
3002
|
+
}
|
|
3003
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
3004
|
+
"Successfully bridged ",
|
|
3005
|
+
/* @__PURE__ */ jsx36(Balance, { wei: amount }),
|
|
3006
|
+
" to ",
|
|
3007
|
+
chainL2.name,
|
|
3008
|
+
"!"
|
|
3009
|
+
] });
|
|
3010
|
+
})()
|
|
3011
|
+
}
|
|
3012
|
+
);
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
3016
|
+
import { useAccount as useAccount7, useClient as useClient11 } from "wagmi";
|
|
3017
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3018
|
+
function Deposits() {
|
|
3019
|
+
const queryClient = useQueryClient7();
|
|
3020
|
+
const { chainId } = useEntryKitConfig();
|
|
3021
|
+
const client = useClient11({ chainId });
|
|
3022
|
+
const { address: userAddress } = useAccount7();
|
|
3023
|
+
const { deposits, removeDeposit } = useDeposits();
|
|
3024
|
+
const { data: isComplete } = useQuery15({
|
|
3025
|
+
queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
|
|
3026
|
+
queryFn: async () => {
|
|
3027
|
+
if (!deposits.length) return false;
|
|
3028
|
+
await Promise.all(deposits.map((deposit) => deposit.isComplete));
|
|
3029
|
+
return true;
|
|
3030
|
+
}
|
|
3031
|
+
});
|
|
3032
|
+
useEffect13(() => {
|
|
3033
|
+
if (isComplete) {
|
|
3034
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] });
|
|
3035
|
+
queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
|
|
3036
|
+
}
|
|
3037
|
+
}, [client?.uid, isComplete, queryClient, userAddress]);
|
|
3038
|
+
if (!deposits.length) return null;
|
|
3039
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
|
|
3040
|
+
if (deposit.type === "transfer") {
|
|
3041
|
+
return /* @__PURE__ */ jsx37(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3042
|
+
} else if (deposit.type === "relay") {
|
|
3043
|
+
return /* @__PURE__ */ jsx37(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3044
|
+
}
|
|
3045
|
+
}) });
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
3049
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3050
|
+
function DepositFormContainer() {
|
|
3051
|
+
const { chainId: destinationChainId } = useEntryKitConfig();
|
|
3052
|
+
const chainId = useChainId();
|
|
3053
|
+
const chains = useChains4();
|
|
3054
|
+
const [amount, setAmount] = useState5(void 0);
|
|
3055
|
+
const [sourceChainId, setSourceChainId] = useState5(chainId);
|
|
3056
|
+
const sourceChain = chains.find(({ id }) => id === sourceChainId);
|
|
3057
|
+
return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
|
|
3058
|
+
destinationChainId === sourceChainId ? /* @__PURE__ */ jsx38(
|
|
3059
|
+
DepositViaTransferForm,
|
|
3060
|
+
{
|
|
3061
|
+
amount,
|
|
3062
|
+
setAmount,
|
|
3063
|
+
sourceChain,
|
|
3064
|
+
setSourceChainId
|
|
3065
|
+
}
|
|
3066
|
+
) : /* @__PURE__ */ jsx38(
|
|
3067
|
+
DepositViaRelayForm,
|
|
3068
|
+
{
|
|
3069
|
+
amount,
|
|
3070
|
+
setAmount,
|
|
3071
|
+
sourceChain,
|
|
3072
|
+
setSourceChainId
|
|
3073
|
+
}
|
|
3074
|
+
),
|
|
3075
|
+
/* @__PURE__ */ jsx38(Deposits, {})
|
|
3076
|
+
] });
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
// src/icons/ArrowLeftIcon.tsx
|
|
3080
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3081
|
+
function ArrowLeftIcon(props) {
|
|
3082
|
+
return /* @__PURE__ */ jsx39(IconSVG, { ...props, children: /* @__PURE__ */ jsx39(
|
|
3083
|
+
"path",
|
|
3084
|
+
{
|
|
3085
|
+
d: "M19 12H5M12 19l-7-7 7-7",
|
|
3086
|
+
fill: "none",
|
|
3087
|
+
stroke: "currentColor",
|
|
3088
|
+
strokeWidth: "2",
|
|
3089
|
+
strokeLinecap: "round",
|
|
3090
|
+
strokeLinejoin: "round"
|
|
3091
|
+
}
|
|
3092
|
+
) });
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
3096
|
+
import { useEffect as useEffect14 } from "react";
|
|
3097
|
+
import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
3098
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3099
|
+
function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
|
|
3100
|
+
const queryClient = useQueryClient8();
|
|
3101
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3102
|
+
const prevBalance = usePrevious(balance.data || 0n);
|
|
3103
|
+
useEffect14(() => {
|
|
3104
|
+
if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
|
|
3105
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
3106
|
+
setFocused(false);
|
|
3107
|
+
}
|
|
3108
|
+
}, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
|
|
3109
|
+
if (isFocused) {
|
|
3110
|
+
return /* @__PURE__ */ jsxs23(Fragment7, { children: [
|
|
3111
|
+
isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
|
|
3112
|
+
"div",
|
|
3113
|
+
{
|
|
3114
|
+
className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
|
|
3115
|
+
onClick: () => setFocused(false),
|
|
3116
|
+
children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
|
|
3117
|
+
}
|
|
3118
|
+
) }),
|
|
3119
|
+
/* @__PURE__ */ jsx40(DepositFormContainer, {})
|
|
3120
|
+
] });
|
|
3121
|
+
}
|
|
3122
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4", children: [
|
|
3123
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex justify-between gap-4", children: [
|
|
3124
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
3125
|
+
/* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
|
|
3126
|
+
/* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
|
|
3127
|
+
] }),
|
|
3128
|
+
/* @__PURE__ */ jsx40(
|
|
3129
|
+
Button,
|
|
3130
|
+
{
|
|
3131
|
+
variant: isActive ? "primary" : "tertiary",
|
|
3132
|
+
className: "flex-shrink-0 text-sm p-1 w-28",
|
|
3133
|
+
autoFocus: isActive || isExpanded,
|
|
3134
|
+
pending: balance.status === "pending",
|
|
3135
|
+
onClick: () => setFocused(true),
|
|
3136
|
+
children: "Top up"
|
|
3137
|
+
}
|
|
3138
|
+
)
|
|
3139
|
+
] }),
|
|
3140
|
+
isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
|
|
3141
|
+
] });
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
// src/onboarding/ConnectedSteps.tsx
|
|
3145
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3146
|
+
function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
3147
|
+
const { chain } = useEntryKitConfig();
|
|
3148
|
+
const paymaster = getPaymaster(chain);
|
|
3149
|
+
const [focusedId, setFocusedId] = useState6(null);
|
|
3150
|
+
const userAddress = userClient.account.address;
|
|
3151
|
+
const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
|
|
3152
|
+
useEffect15(() => {
|
|
3153
|
+
if (prerequisitesError) {
|
|
3154
|
+
console.error("Could not get prerequisites", prerequisitesError);
|
|
3155
|
+
}
|
|
3156
|
+
}, [prerequisitesError]);
|
|
3157
|
+
const { closeAccountModal } = useAccountModal();
|
|
3158
|
+
const isNewConnection = userAddress !== initialUserAddress;
|
|
3159
|
+
const initialPrerequisites = useRef4(prerequisites);
|
|
3160
|
+
useEffect15(() => {
|
|
3161
|
+
if (prerequisites == null) return;
|
|
3162
|
+
if (initialPrerequisites.current == null) {
|
|
3163
|
+
initialPrerequisites.current = prerequisites;
|
|
3164
|
+
}
|
|
3165
|
+
if (prerequisites.complete) {
|
|
3166
|
+
if (isNewConnection || !initialPrerequisites.current.complete) {
|
|
3167
|
+
closeAccountModal();
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
}, [closeAccountModal, isNewConnection, prerequisites]);
|
|
3171
|
+
const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
3172
|
+
const steps = useMemo4(() => {
|
|
3173
|
+
if (!userAddress) {
|
|
3174
|
+
return [
|
|
3175
|
+
{
|
|
3176
|
+
id: "wallet",
|
|
3177
|
+
isComplete: false,
|
|
3178
|
+
content: () => null
|
|
3179
|
+
}
|
|
3180
|
+
];
|
|
3181
|
+
}
|
|
3182
|
+
const steps2 = [
|
|
3183
|
+
{
|
|
3184
|
+
id: "wallet",
|
|
3185
|
+
isComplete: true,
|
|
3186
|
+
content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
|
|
3187
|
+
}
|
|
3188
|
+
];
|
|
3189
|
+
if (!paymaster) {
|
|
3190
|
+
if (sessionAddress != null) {
|
|
3191
|
+
steps2.push({
|
|
3192
|
+
id: "gasBalance",
|
|
3193
|
+
isComplete: !!hasGasBalance,
|
|
3194
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
|
|
3195
|
+
});
|
|
3196
|
+
}
|
|
3197
|
+
} else if (paymaster.type === "quarry") {
|
|
3198
|
+
if (paymaster.isGasPass) {
|
|
3199
|
+
steps2.push({
|
|
3200
|
+
id: "allowance",
|
|
3201
|
+
isComplete: !!hasAllowance,
|
|
3202
|
+
content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
|
|
3203
|
+
});
|
|
3204
|
+
} else {
|
|
3205
|
+
steps2.push({
|
|
3206
|
+
id: "gasBalanceQuarry",
|
|
3207
|
+
isComplete: !!hasQuarryGasBalance,
|
|
3208
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
|
|
3209
|
+
});
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
steps2.push({
|
|
3213
|
+
id: "session",
|
|
3214
|
+
isComplete: !!isSpender && !!hasDelegation,
|
|
3215
|
+
content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
|
|
3216
|
+
});
|
|
3217
|
+
return steps2;
|
|
3218
|
+
}, [
|
|
3219
|
+
hasAllowance,
|
|
3220
|
+
hasDelegation,
|
|
3221
|
+
hasGasBalance,
|
|
3222
|
+
hasQuarryGasBalance,
|
|
3223
|
+
isSpender,
|
|
3224
|
+
paymaster,
|
|
3225
|
+
sessionAddress,
|
|
3226
|
+
userAddress,
|
|
3227
|
+
userClient
|
|
3228
|
+
]);
|
|
3229
|
+
const [selectedStepId] = useState6(null);
|
|
3230
|
+
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
3231
|
+
const completedSteps = steps.filter((step) => step.isComplete);
|
|
3232
|
+
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
3233
|
+
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
3234
|
+
return /* @__PURE__ */ jsx41(
|
|
3235
|
+
"div",
|
|
3236
|
+
{
|
|
3237
|
+
className: twMerge17(
|
|
3238
|
+
"px-8 flex flex-col",
|
|
3239
|
+
focusedId && "divide-y divide-neutral-800",
|
|
3240
|
+
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
3241
|
+
),
|
|
3242
|
+
children: steps.map((step, i) => {
|
|
3243
|
+
const isActive = step === activeStep;
|
|
3244
|
+
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
3245
|
+
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
3246
|
+
const isFocused = focusedId === step.id;
|
|
3247
|
+
const content = step.content({
|
|
3248
|
+
isActive,
|
|
3249
|
+
isExpanded,
|
|
3250
|
+
isFocused,
|
|
3251
|
+
setFocused: (focused) => setFocusedId(focused ? step.id : null)
|
|
3252
|
+
});
|
|
3253
|
+
if (focusedId) {
|
|
3254
|
+
if (step.id === focusedId) {
|
|
3255
|
+
return content;
|
|
3256
|
+
}
|
|
3257
|
+
return null;
|
|
3258
|
+
}
|
|
3259
|
+
return /* @__PURE__ */ jsx41("div", { className: twMerge17("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx41("div", { className: twMerge17("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: content }) }, step.id);
|
|
3260
|
+
})
|
|
3261
|
+
}
|
|
3262
|
+
);
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
// src/AccountModalContent.tsx
|
|
3266
|
+
import { useRef as useRef5 } from "react";
|
|
3267
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3268
|
+
function AccountModalContent() {
|
|
3269
|
+
const { chainId } = useEntryKitConfig();
|
|
3270
|
+
const userClient = useConnectorClient({ chainId });
|
|
3271
|
+
const { address: userAddress } = useAccount8();
|
|
3272
|
+
const initialUserAddress = useRef5(userAddress);
|
|
3273
|
+
if (userClient.status !== "success") {
|
|
3274
|
+
return /* @__PURE__ */ jsx42(ConnectWallet, {});
|
|
3275
|
+
}
|
|
3276
|
+
return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
|
|
3277
|
+
}
|
|
3278
|
+
|
|
2079
3279
|
// src/AccountModal.tsx
|
|
3280
|
+
import { DialogClose } from "@radix-ui/react-dialog";
|
|
2080
3281
|
import { ErrorBoundary } from "react-error-boundary";
|
|
2081
3282
|
|
|
2082
3283
|
// src/errors/ErrorOverlay.tsx
|
|
2083
3284
|
import { wait } from "@latticexyz/common/utils";
|
|
2084
|
-
import { useEffect as
|
|
2085
|
-
import { twMerge as
|
|
2086
|
-
import { Fragment as
|
|
3285
|
+
import { useEffect as useEffect16 } from "react";
|
|
3286
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
3287
|
+
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2087
3288
|
function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
2088
|
-
|
|
3289
|
+
useEffect16(() => {
|
|
2089
3290
|
if (error2) {
|
|
2090
3291
|
console.error(error2);
|
|
2091
3292
|
}
|
|
2092
3293
|
}, [error2]);
|
|
2093
|
-
return /* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
3294
|
+
return /* @__PURE__ */ jsxs24("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
|
|
3295
|
+
/* @__PURE__ */ jsx43(
|
|
2095
3296
|
"div",
|
|
2096
3297
|
{
|
|
2097
|
-
className:
|
|
3298
|
+
className: twMerge18(
|
|
2098
3299
|
"absolute inset-0 bg-blue-700/60",
|
|
2099
3300
|
"transition duration-300",
|
|
2100
3301
|
error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
2101
3302
|
)
|
|
2102
3303
|
}
|
|
2103
3304
|
),
|
|
2104
|
-
/* @__PURE__ */
|
|
3305
|
+
/* @__PURE__ */ jsx43(
|
|
2105
3306
|
"div",
|
|
2106
3307
|
{
|
|
2107
|
-
className:
|
|
3308
|
+
className: twMerge18(
|
|
2108
3309
|
"absolute inset-0 pb-8",
|
|
2109
3310
|
"transition duration-300",
|
|
2110
3311
|
error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
|
|
2111
3312
|
),
|
|
2112
|
-
children: error2 ? /* @__PURE__ */
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
3313
|
+
children: error2 ? /* @__PURE__ */ jsx43(Fragment8, { children: /* @__PURE__ */ jsxs24("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
|
|
3314
|
+
/* @__PURE__ */ jsxs24("div", { className: "space-y-6 px-8 pt-8", children: [
|
|
3315
|
+
/* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
|
|
3316
|
+
/* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
|
|
3317
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
|
|
2117
3318
|
] }),
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
retry ? /* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ jsxs24("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
|
|
3320
|
+
/* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
|
|
3321
|
+
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs24(
|
|
2121
3322
|
"button",
|
|
2122
3323
|
{
|
|
2123
3324
|
type: "button",
|
|
2124
|
-
className:
|
|
3325
|
+
className: twMerge18(
|
|
2125
3326
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2126
3327
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2127
3328
|
"text-white text-sm font-medium",
|
|
@@ -2136,15 +3337,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2136
3337
|
}
|
|
2137
3338
|
},
|
|
2138
3339
|
children: [
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
3340
|
+
/* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
|
|
3341
|
+
/* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
|
|
2141
3342
|
]
|
|
2142
3343
|
}
|
|
2143
|
-
) }) : dismiss ? /* @__PURE__ */
|
|
3344
|
+
) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
|
|
2144
3345
|
"button",
|
|
2145
3346
|
{
|
|
2146
3347
|
type: "button",
|
|
2147
|
-
className:
|
|
3348
|
+
className: twMerge18(
|
|
2148
3349
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2149
3350
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2150
3351
|
"text-white text-sm font-medium",
|
|
@@ -2162,27 +3363,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2162
3363
|
}
|
|
2163
3364
|
|
|
2164
3365
|
// src/errors/ErrorFallback.tsx
|
|
2165
|
-
import { jsx as
|
|
3366
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2166
3367
|
function ErrorFallback({ error: error2, resetErrorBoundary }) {
|
|
2167
|
-
return /* @__PURE__ */
|
|
3368
|
+
return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
|
|
2168
3369
|
}
|
|
2169
3370
|
|
|
2170
3371
|
// src/errors/ErrorsOverlay.tsx
|
|
2171
|
-
import { useStore as
|
|
2172
|
-
import { jsx as
|
|
3372
|
+
import { useStore as useStore3 } from "zustand";
|
|
3373
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2173
3374
|
function ErrorsOverlay() {
|
|
2174
|
-
const error2 =
|
|
2175
|
-
return /* @__PURE__ */
|
|
3375
|
+
const error2 = useStore3(store3, (state) => state.errors.at(0));
|
|
3376
|
+
return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
|
|
2176
3377
|
}
|
|
2177
3378
|
|
|
2178
3379
|
// src/AccountModal.tsx
|
|
2179
|
-
import { jsx as
|
|
3380
|
+
import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2180
3381
|
function AccountModal() {
|
|
2181
3382
|
const { accountModalOpen, toggleAccountModal } = useAccountModal();
|
|
2182
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs25(
|
|
2183
3384
|
"div",
|
|
2184
3385
|
{
|
|
2185
|
-
className:
|
|
3386
|
+
className: twMerge19(
|
|
2186
3387
|
"relative py-2 ring-1",
|
|
2187
3388
|
"bg-neutral-900 text-neutral-400 ring-neutral-700/50",
|
|
2188
3389
|
"links:font-medium links:underline links:underline-offset-4",
|
|
@@ -2190,11 +3391,11 @@ function AccountModal() {
|
|
|
2190
3391
|
"links:decoration-neutral-500 hover:links:decoration-orange-500"
|
|
2191
3392
|
),
|
|
2192
3393
|
children: [
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsxs25(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
|
|
3395
|
+
/* @__PURE__ */ jsx46(AccountModalContent, {}),
|
|
3396
|
+
/* @__PURE__ */ jsx46(ErrorsOverlay, {})
|
|
2196
3397
|
] }),
|
|
2197
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsxs25(
|
|
2198
3399
|
"a",
|
|
2199
3400
|
{
|
|
2200
3401
|
href: "https://mud.dev",
|
|
@@ -2202,20 +3403,20 @@ function AccountModal() {
|
|
|
2202
3403
|
rel: "noreferrer noopener",
|
|
2203
3404
|
className: "group self-center p-3 flex items-center justify-center gap-2 links-unset text-sm font-mono transition text-neutral-400 hover:text-white",
|
|
2204
3405
|
children: [
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx46("span", { className: "block w-4 h-4", children: /* @__PURE__ */ jsx46(Logo, { className: "w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300" }) }),
|
|
3407
|
+
/* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
|
|
2207
3408
|
]
|
|
2208
3409
|
}
|
|
2209
3410
|
),
|
|
2210
|
-
/* @__PURE__ */
|
|
3411
|
+
/* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
|
|
2211
3412
|
DialogClose,
|
|
2212
3413
|
{
|
|
2213
|
-
className:
|
|
3414
|
+
className: twMerge19(
|
|
2214
3415
|
"pointer-events-auto leading-none p-2 transition",
|
|
2215
3416
|
"text-white/20 hover:text-white/40"
|
|
2216
3417
|
),
|
|
2217
3418
|
title: "Close",
|
|
2218
|
-
children: /* @__PURE__ */
|
|
3419
|
+
children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
|
|
2219
3420
|
}
|
|
2220
3421
|
) })
|
|
2221
3422
|
]
|
|
@@ -2224,31 +3425,31 @@ function AccountModal() {
|
|
|
2224
3425
|
}
|
|
2225
3426
|
|
|
2226
3427
|
// src/EntryKitProvider.tsx
|
|
2227
|
-
import { jsx as
|
|
3428
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2228
3429
|
function EntryKitProvider({ config, children }) {
|
|
2229
|
-
return /* @__PURE__ */
|
|
3430
|
+
return /* @__PURE__ */ jsxs26(EntryKitConfigProvider, { config, children: [
|
|
2230
3431
|
children,
|
|
2231
|
-
/* @__PURE__ */
|
|
3432
|
+
/* @__PURE__ */ jsx47(AccountModal, {})
|
|
2232
3433
|
] });
|
|
2233
3434
|
}
|
|
2234
3435
|
|
|
2235
3436
|
// src/AccountButton.tsx
|
|
2236
|
-
import { useAccount as
|
|
2237
|
-
import { twMerge as
|
|
3437
|
+
import { useAccount as useAccount9 } from "wagmi";
|
|
3438
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
2238
3439
|
|
|
2239
3440
|
// src/AccountName.tsx
|
|
2240
|
-
import { twMerge as
|
|
2241
|
-
import { Fragment as
|
|
3441
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
3442
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2242
3443
|
function AccountName({ address }) {
|
|
2243
3444
|
const { data: ens } = useENS(address);
|
|
2244
3445
|
const avatar = usePreloadImage(ens?.avatar);
|
|
2245
|
-
return /* @__PURE__ */
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
/* @__PURE__ */
|
|
3446
|
+
return /* @__PURE__ */ jsxs27(Fragment9, { children: [
|
|
3447
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
|
|
3448
|
+
/* @__PURE__ */ jsx48(
|
|
2248
3449
|
"img",
|
|
2249
3450
|
{
|
|
2250
3451
|
src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
|
|
2251
|
-
className:
|
|
3452
|
+
className: twMerge20(
|
|
2252
3453
|
"col-start-1 row-start-1",
|
|
2253
3454
|
"inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
|
|
2254
3455
|
"transtion duration-300",
|
|
@@ -2256,10 +3457,10 @@ function AccountName({ address }) {
|
|
|
2256
3457
|
)
|
|
2257
3458
|
}
|
|
2258
3459
|
),
|
|
2259
|
-
/* @__PURE__ */
|
|
3460
|
+
/* @__PURE__ */ jsx48(
|
|
2260
3461
|
Logo,
|
|
2261
3462
|
{
|
|
2262
|
-
className:
|
|
3463
|
+
className: twMerge20(
|
|
2263
3464
|
"col-start-1 row-start-1 text-orange-500",
|
|
2264
3465
|
"transition duration-300",
|
|
2265
3466
|
ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
|
|
@@ -2267,29 +3468,29 @@ function AccountName({ address }) {
|
|
|
2267
3468
|
}
|
|
2268
3469
|
)
|
|
2269
3470
|
] }),
|
|
2270
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
|
|
2271
3472
|
] });
|
|
2272
3473
|
}
|
|
2273
3474
|
|
|
2274
3475
|
// src/AccountButton.tsx
|
|
2275
|
-
import { useRef as
|
|
2276
|
-
import { jsx as
|
|
2277
|
-
var containerClassNames =
|
|
3476
|
+
import { useRef as useRef6 } from "react";
|
|
3477
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3478
|
+
var containerClassNames = twMerge21(
|
|
2278
3479
|
"w-48 p-3 inline-flex outline-none transition",
|
|
2279
3480
|
"border border-transparent",
|
|
2280
3481
|
"text-base leading-none"
|
|
2281
3482
|
);
|
|
2282
|
-
var secondaryClassNames =
|
|
3483
|
+
var secondaryClassNames = twMerge21(
|
|
2283
3484
|
"bg-neutral-100 border-neutral-300 text-black",
|
|
2284
3485
|
"dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
|
|
2285
3486
|
);
|
|
2286
|
-
var secondaryInteractiveClassNames =
|
|
3487
|
+
var secondaryInteractiveClassNames = twMerge21(
|
|
2287
3488
|
"cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
|
|
2288
3489
|
);
|
|
2289
3490
|
function AccountButton() {
|
|
2290
3491
|
const { openAccountModal, accountModalOpen } = useAccountModal();
|
|
2291
|
-
const { status, address: userAddress } =
|
|
2292
|
-
const initialUserAddress =
|
|
3492
|
+
const { status, address: userAddress } = useAccount9();
|
|
3493
|
+
const initialUserAddress = useRef6(userAddress);
|
|
2293
3494
|
const prereqs = usePrerequisites(userAddress);
|
|
2294
3495
|
const isConnected = status === "connected" || status === "reconnecting" && userAddress;
|
|
2295
3496
|
const isNewConnection = userAddress !== initialUserAddress.current;
|
|
@@ -2301,20 +3502,20 @@ function AccountButton() {
|
|
|
2301
3502
|
}
|
|
2302
3503
|
return "Sign in";
|
|
2303
3504
|
})();
|
|
2304
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
|
|
2305
3506
|
"button",
|
|
2306
3507
|
{
|
|
2307
3508
|
type: "button",
|
|
2308
|
-
className:
|
|
3509
|
+
className: twMerge21(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
|
|
2309
3510
|
onClick: openAccountModal,
|
|
2310
|
-
children: /* @__PURE__ */
|
|
3511
|
+
children: /* @__PURE__ */ jsx49("span", { className: "flex-grow inline-flex gap-2.5 items-center text-left font-medium", children: userAddress ? /* @__PURE__ */ jsx49(AccountName, { address: userAddress }) : null })
|
|
2311
3512
|
},
|
|
2312
3513
|
"connected"
|
|
2313
|
-
) : /* @__PURE__ */
|
|
3514
|
+
) : /* @__PURE__ */ jsxs28(
|
|
2314
3515
|
"button",
|
|
2315
3516
|
{
|
|
2316
3517
|
type: "button",
|
|
2317
|
-
className:
|
|
3518
|
+
className: twMerge21(
|
|
2318
3519
|
containerClassNames,
|
|
2319
3520
|
"group",
|
|
2320
3521
|
"items-center justify-center gap-2.5",
|
|
@@ -2325,32 +3526,32 @@ function AccountButton() {
|
|
|
2325
3526
|
"aria-busy": accountModalOpen,
|
|
2326
3527
|
onClick: openAccountModal,
|
|
2327
3528
|
children: [
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsxs28("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
|
|
3530
|
+
/* @__PURE__ */ jsx49(
|
|
2330
3531
|
"span",
|
|
2331
3532
|
{
|
|
2332
|
-
className:
|
|
3533
|
+
className: twMerge21(
|
|
2333
3534
|
"col-start-1 row-start-1 leading-none",
|
|
2334
3535
|
"scale-100 opacity-100 transition duration-300",
|
|
2335
3536
|
"group-aria-busy:scale-125 group-aria-busy:opacity-0"
|
|
2336
3537
|
),
|
|
2337
|
-
children: /* @__PURE__ */
|
|
3538
|
+
children: /* @__PURE__ */ jsx49(Logo, {})
|
|
2338
3539
|
}
|
|
2339
3540
|
),
|
|
2340
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ jsx49(
|
|
2341
3542
|
"span",
|
|
2342
3543
|
{
|
|
2343
3544
|
"aria-hidden": true,
|
|
2344
|
-
className:
|
|
3545
|
+
className: twMerge21(
|
|
2345
3546
|
"col-start-1 row-start-1",
|
|
2346
3547
|
"scale-50 opacity-0 transition duration-300 delay-50",
|
|
2347
3548
|
"group-aria-busy:scale-100 group-aria-busy:opacity-100"
|
|
2348
3549
|
),
|
|
2349
|
-
children: /* @__PURE__ */
|
|
3550
|
+
children: /* @__PURE__ */ jsx49(PendingIcon, {})
|
|
2350
3551
|
}
|
|
2351
3552
|
)
|
|
2352
3553
|
] }),
|
|
2353
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
|
|
2354
3555
|
]
|
|
2355
3556
|
},
|
|
2356
3557
|
"sign in"
|