@latticexyz/entrykit 2.2.22-d83a0fd5283b7bea7e9a5372ea3c45ab9aea350f → 2.2.22-d8eef923b761a5efe83ddf9f5b0a1460b5ca4db9
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 +1544 -348
- 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";
|
|
@@ -368,10 +373,10 @@ function useAccountModal() {
|
|
|
368
373
|
}
|
|
369
374
|
|
|
370
375
|
// src/AccountModal.tsx
|
|
371
|
-
import { twMerge as
|
|
376
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
372
377
|
|
|
373
378
|
// src/AccountModalContent.tsx
|
|
374
|
-
import { useAccount as
|
|
379
|
+
import { useAccount as useAccount8, useConnectorClient } from "wagmi";
|
|
375
380
|
|
|
376
381
|
// src/ConnectWallet.tsx
|
|
377
382
|
import { useAccount } from "wagmi";
|
|
@@ -545,16 +550,39 @@ function ConnectWallet() {
|
|
|
545
550
|
}
|
|
546
551
|
|
|
547
552
|
// src/onboarding/ConnectedSteps.tsx
|
|
548
|
-
import { useEffect as
|
|
549
|
-
import { twMerge as
|
|
553
|
+
import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
554
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
550
555
|
|
|
551
|
-
// src/onboarding/
|
|
552
|
-
import {
|
|
553
|
-
|
|
556
|
+
// src/onboarding/usePrerequisites.ts
|
|
557
|
+
import { useClient as useClient6, useConfig } from "wagmi";
|
|
558
|
+
import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
|
|
559
|
+
import { queryOptions as queryOptions6, skipToken as skipToken6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
|
|
560
|
+
|
|
561
|
+
// src/getPaymaster.ts
|
|
562
|
+
function getPaymaster(chain) {
|
|
563
|
+
const contracts = chain.contracts ?? {};
|
|
564
|
+
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
565
|
+
if ("address" in contracts.quarryPaymaster) {
|
|
566
|
+
return {
|
|
567
|
+
type: "quarry",
|
|
568
|
+
address: contracts.quarryPaymaster.address,
|
|
569
|
+
isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
574
|
+
if ("address" in contracts.paymaster) {
|
|
575
|
+
return {
|
|
576
|
+
type: "simple",
|
|
577
|
+
address: contracts.paymaster.address
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
554
582
|
|
|
555
583
|
// src/onboarding/quarry/useAllowance.ts
|
|
556
584
|
import { useClient } from "wagmi";
|
|
557
|
-
import { queryOptions, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
585
|
+
import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
558
586
|
|
|
559
587
|
// src/quarry/getAllowance.ts
|
|
560
588
|
import { numberToHex as numberToHex2 } from "viem";
|
|
@@ -565,7 +593,10 @@ import { parseAbi } from "viem";
|
|
|
565
593
|
var paymasterAbi = parseAbi([
|
|
566
594
|
"error SpenderSystem_AlreadyRegistered(address spender, address user)",
|
|
567
595
|
"error SpenderSystem_HasOwnBalance(address spender)",
|
|
568
|
-
"
|
|
596
|
+
"error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
|
|
597
|
+
"error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
|
|
598
|
+
"function registerSpender(address spender)",
|
|
599
|
+
"function depositTo(address to) payable"
|
|
569
600
|
]);
|
|
570
601
|
var paymasterConfig = defineStore({
|
|
571
602
|
namespaces: {
|
|
@@ -579,6 +610,13 @@ var paymasterConfig = defineStore({
|
|
|
579
610
|
},
|
|
580
611
|
key: ["user"]
|
|
581
612
|
},
|
|
613
|
+
Balance: {
|
|
614
|
+
schema: {
|
|
615
|
+
user: "address",
|
|
616
|
+
balance: "uint256"
|
|
617
|
+
},
|
|
618
|
+
key: ["user"]
|
|
619
|
+
},
|
|
582
620
|
Grantor: {
|
|
583
621
|
schema: {
|
|
584
622
|
grantor: "address",
|
|
@@ -628,29 +666,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
|
|
|
628
666
|
import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
|
|
629
667
|
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
630
668
|
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
669
|
async function getAllowance({ client, userAddress }) {
|
|
655
670
|
const paymaster = getPaymaster(client.chain);
|
|
656
671
|
if (paymaster?.type !== "quarry") return null;
|
|
@@ -684,13 +699,10 @@ function getAllowanceQueryOptions({
|
|
|
684
699
|
client,
|
|
685
700
|
userAddress
|
|
686
701
|
}) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
client && userAddress ? {
|
|
690
|
-
|
|
691
|
-
queryFn: () => getAllowance({ client, userAddress })
|
|
692
|
-
} : { queryKey, enabled: false }
|
|
693
|
-
);
|
|
702
|
+
return queryOptions({
|
|
703
|
+
queryKey: ["getAllowance", client?.uid, userAddress],
|
|
704
|
+
queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken
|
|
705
|
+
});
|
|
694
706
|
}
|
|
695
707
|
function useAllowance(userAddress) {
|
|
696
708
|
const { chainId } = useEntryKitConfig();
|
|
@@ -700,7 +712,7 @@ function useAllowance(userAddress) {
|
|
|
700
712
|
|
|
701
713
|
// src/onboarding/quarry/useSpender.ts
|
|
702
714
|
import { useClient as useClient2 } from "wagmi";
|
|
703
|
-
import { queryOptions as queryOptions2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
715
|
+
import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
704
716
|
|
|
705
717
|
// src/onboarding/quarry/getSpender.ts
|
|
706
718
|
import { getRecord as getRecord2 } from "@latticexyz/store/internal";
|
|
@@ -722,18 +734,15 @@ function getSpenderQueryOptions({
|
|
|
722
734
|
userAddress,
|
|
723
735
|
sessionAddress
|
|
724
736
|
}) {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
client && userAddress && sessionAddress ? {
|
|
728
|
-
|
|
729
|
-
queryFn: () => getSpender({ client, userAddress, sessionAddress })
|
|
730
|
-
} : { queryKey, enabled: false }
|
|
731
|
-
);
|
|
737
|
+
return queryOptions2({
|
|
738
|
+
queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
|
|
739
|
+
queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken2
|
|
740
|
+
});
|
|
732
741
|
}
|
|
733
742
|
|
|
734
743
|
// src/onboarding/useDelegation.ts
|
|
735
744
|
import { useClient as useClient3 } from "wagmi";
|
|
736
|
-
import { queryOptions as queryOptions3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
745
|
+
import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
737
746
|
|
|
738
747
|
// src/onboarding/getDelegation.ts
|
|
739
748
|
import { getRecord as getRecord3 } from "@latticexyz/store/internal";
|
|
@@ -776,22 +785,15 @@ function getDelegationQueryOptions({
|
|
|
776
785
|
userAddress,
|
|
777
786
|
sessionAddress
|
|
778
787
|
}) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
client && userAddress && sessionAddress ? {
|
|
782
|
-
|
|
783
|
-
queryFn: () => getDelegation({ client, worldAddress, userAddress, sessionAddress })
|
|
784
|
-
} : { queryKey, enabled: false }
|
|
785
|
-
);
|
|
788
|
+
return queryOptions3({
|
|
789
|
+
queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
|
|
790
|
+
queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken3
|
|
791
|
+
});
|
|
786
792
|
}
|
|
787
793
|
|
|
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
794
|
// src/useSessionAccount.ts
|
|
793
795
|
import { useClient as useClient4 } from "wagmi";
|
|
794
|
-
import { queryOptions as queryOptions4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
796
|
+
import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
795
797
|
|
|
796
798
|
// src/getSessionAccount.ts
|
|
797
799
|
import { toSimpleSmartAccount } from "permissionless/accounts";
|
|
@@ -855,20 +857,50 @@ function getSessionAccountQueryOptions({
|
|
|
855
857
|
client,
|
|
856
858
|
userAddress
|
|
857
859
|
}) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
client && userAddress ? {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
860
|
+
return queryOptions4({
|
|
861
|
+
queryKey: ["getSessionAccount", client?.uid, userAddress],
|
|
862
|
+
queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken4,
|
|
863
|
+
staleTime: Infinity,
|
|
864
|
+
// TODO: replace with function to retry only connection errors
|
|
865
|
+
retry: false
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// src/onboarding/quarry/useBalance.ts
|
|
870
|
+
import { useClient as useClient5 } from "wagmi";
|
|
871
|
+
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
872
|
+
|
|
873
|
+
// src/quarry/getBalance.ts
|
|
874
|
+
import { getRecord as getRecord4 } from "@latticexyz/store/internal";
|
|
875
|
+
async function getBalance({ client, userAddress }) {
|
|
876
|
+
const paymaster = getPaymaster(client.chain);
|
|
877
|
+
if (paymaster?.type !== "quarry") return null;
|
|
878
|
+
const record = await getRecord4(client, {
|
|
879
|
+
address: paymaster.address,
|
|
880
|
+
table: paymasterTables.Balance,
|
|
881
|
+
key: { user: userAddress },
|
|
882
|
+
blockTag: "pending"
|
|
883
|
+
});
|
|
884
|
+
return record.balance;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// src/onboarding/quarry/useBalance.ts
|
|
888
|
+
function getBalanceQueryOptions({
|
|
889
|
+
client,
|
|
890
|
+
userAddress
|
|
891
|
+
}) {
|
|
892
|
+
return queryOptions5({
|
|
893
|
+
queryKey: ["getBalance", client?.uid, userAddress],
|
|
894
|
+
queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
function useBalance(userAddress) {
|
|
898
|
+
const { chainId } = useEntryKitConfig();
|
|
899
|
+
const client = useClient5({ chainId });
|
|
900
|
+
return useQuery6(getBalanceQueryOptions({ client, userAddress }));
|
|
868
901
|
}
|
|
869
902
|
|
|
870
903
|
// src/onboarding/usePrerequisites.ts
|
|
871
|
-
import { getBalanceQueryOptions } from "wagmi/query";
|
|
872
904
|
function getPrequisitesQueryOptions({
|
|
873
905
|
queryClient,
|
|
874
906
|
config,
|
|
@@ -876,46 +908,46 @@ function getPrequisitesQueryOptions({
|
|
|
876
908
|
userAddress,
|
|
877
909
|
worldAddress
|
|
878
910
|
}) {
|
|
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
|
-
);
|
|
911
|
+
return queryOptions6({
|
|
912
|
+
queryKey: ["getPrerequisites", client?.uid, userAddress],
|
|
913
|
+
queryFn: client && userAddress ? async () => {
|
|
914
|
+
const paymaster = getPaymaster(client.chain);
|
|
915
|
+
const {
|
|
916
|
+
account: { address: sessionAddress }
|
|
917
|
+
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
918
|
+
const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
|
|
919
|
+
!paymaster ? queryClient.fetchQuery(
|
|
920
|
+
getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
|
|
921
|
+
) : null,
|
|
922
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
|
|
923
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
|
|
924
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
|
|
925
|
+
queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
|
|
926
|
+
]);
|
|
927
|
+
const hasAllowance = allowance == null || allowance > 0n;
|
|
928
|
+
const isSpender = spender == null ? true : spender;
|
|
929
|
+
const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
|
|
930
|
+
const hasQuarryGasBalance = quarryBalance == null || quarryBalance > 0n;
|
|
931
|
+
return {
|
|
932
|
+
sessionAddress,
|
|
933
|
+
hasAllowance,
|
|
934
|
+
isSpender,
|
|
935
|
+
hasGasBalance,
|
|
936
|
+
hasQuarryGasBalance,
|
|
937
|
+
hasDelegation,
|
|
938
|
+
// we intentionally don't enforce an allowance/gas balance here
|
|
939
|
+
complete: isSpender && hasDelegation
|
|
940
|
+
};
|
|
941
|
+
} : skipToken6,
|
|
942
|
+
retry: false
|
|
943
|
+
});
|
|
912
944
|
}
|
|
913
945
|
function usePrerequisites(userAddress) {
|
|
914
946
|
const queryClient = useQueryClient();
|
|
915
947
|
const config = useConfig();
|
|
916
948
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
917
|
-
const client =
|
|
918
|
-
const prereqs =
|
|
949
|
+
const client = useClient6({ chainId });
|
|
950
|
+
const prereqs = useQuery7(
|
|
919
951
|
getPrequisitesQueryOptions({
|
|
920
952
|
queryClient,
|
|
921
953
|
config,
|
|
@@ -932,10 +964,10 @@ function usePrerequisites(userAddress) {
|
|
|
932
964
|
import { useDisconnect } from "wagmi";
|
|
933
965
|
|
|
934
966
|
// src/useENS.ts
|
|
935
|
-
import { useQuery as
|
|
967
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
936
968
|
function useENS(address) {
|
|
937
969
|
const normalizedAddress = address?.toLowerCase();
|
|
938
|
-
return
|
|
970
|
+
return useQuery8({
|
|
939
971
|
enabled: !!normalizedAddress,
|
|
940
972
|
queryKey: ["ens", normalizedAddress],
|
|
941
973
|
queryFn: async () => {
|
|
@@ -1054,8 +1086,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
|
|
|
1054
1086
|
] });
|
|
1055
1087
|
}
|
|
1056
1088
|
|
|
1057
|
-
// src/onboarding/quarry/
|
|
1089
|
+
// src/onboarding/quarry/Allowance.tsx
|
|
1058
1090
|
import { parseEther as parseEther3 } from "viem";
|
|
1091
|
+
|
|
1092
|
+
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1093
|
+
import { parseEther as parseEther2 } from "viem";
|
|
1059
1094
|
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1060
1095
|
|
|
1061
1096
|
// src/quarry/transports/quarryPassIssuer.ts
|
|
@@ -1085,11 +1120,11 @@ async function claimGasPass({ chain, userAddress }) {
|
|
|
1085
1120
|
}
|
|
1086
1121
|
|
|
1087
1122
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1088
|
-
import { useClient as
|
|
1123
|
+
import { useClient as useClient7 } from "wagmi";
|
|
1089
1124
|
function useClaimGasPass() {
|
|
1090
1125
|
const queryClient = useQueryClient2();
|
|
1091
1126
|
const { chain } = useEntryKitConfig();
|
|
1092
|
-
const client =
|
|
1127
|
+
const client = useClient7({ chainId: chain.id });
|
|
1093
1128
|
const mutationKey = ["claimGasPass", chain.id];
|
|
1094
1129
|
return useMutation({
|
|
1095
1130
|
retry: 0,
|
|
@@ -1097,7 +1132,7 @@ function useClaimGasPass() {
|
|
|
1097
1132
|
mutationFn: async (userAddress) => {
|
|
1098
1133
|
if (chain.id === 31337) {
|
|
1099
1134
|
if (!client) throw new Error("No client?");
|
|
1100
|
-
await setAllowanceSlot({ client, userAddress, allowance:
|
|
1135
|
+
await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
|
|
1101
1136
|
} else {
|
|
1102
1137
|
await claimGasPass({ chain, userAddress });
|
|
1103
1138
|
}
|
|
@@ -1172,7 +1207,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1172
1207
|
const claimGasPass2 = useShowMutationError(useClaimGasPass());
|
|
1173
1208
|
useEffect6(() => {
|
|
1174
1209
|
const timer = setTimeout(() => {
|
|
1175
|
-
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data <
|
|
1210
|
+
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
|
|
1176
1211
|
claimGasPass2.mutate(userAddress);
|
|
1177
1212
|
}
|
|
1178
1213
|
});
|
|
@@ -1200,6 +1235,9 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1200
1235
|
] });
|
|
1201
1236
|
}
|
|
1202
1237
|
|
|
1238
|
+
// src/onboarding/Session.tsx
|
|
1239
|
+
import { useEffect as useEffect7 } from "react";
|
|
1240
|
+
|
|
1203
1241
|
// src/onboarding/useSetupSession.ts
|
|
1204
1242
|
import { encodeFunctionData } from "viem";
|
|
1205
1243
|
import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -1213,7 +1251,7 @@ function defineCall(call) {
|
|
|
1213
1251
|
}
|
|
1214
1252
|
|
|
1215
1253
|
// src/onboarding/useSetupSession.ts
|
|
1216
|
-
import { useClient as
|
|
1254
|
+
import { useClient as useClient8 } from "wagmi";
|
|
1217
1255
|
import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
|
|
1218
1256
|
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
|
|
1219
1257
|
|
|
@@ -1225,7 +1263,7 @@ import { getAction as getAction3 } from "viem/utils";
|
|
|
1225
1263
|
import { toHex } from "viem";
|
|
1226
1264
|
import { signTypedData } from "viem/actions";
|
|
1227
1265
|
import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
|
|
1228
|
-
import { getRecord as
|
|
1266
|
+
import { getRecord as getRecord5 } from "@latticexyz/store/internal";
|
|
1229
1267
|
import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
|
|
1230
1268
|
import { hexToResource } from "@latticexyz/common";
|
|
1231
1269
|
import { getAction as getAction2 } from "viem/utils";
|
|
@@ -1237,7 +1275,7 @@ async function signCall({
|
|
|
1237
1275
|
nonce: initialNonce,
|
|
1238
1276
|
client
|
|
1239
1277
|
}) {
|
|
1240
|
-
const nonce = initialNonce ?? (client ? (await
|
|
1278
|
+
const nonce = initialNonce ?? (client ? (await getRecord5(client, {
|
|
1241
1279
|
address: worldAddress,
|
|
1242
1280
|
table: moduleConfig.tables.CallWithSignatureNonces,
|
|
1243
1281
|
key: { signer: userClient.account.address },
|
|
@@ -1290,7 +1328,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
|
|
|
1290
1328
|
function useSetupSession({ userClient }) {
|
|
1291
1329
|
const queryClient = useQueryClient3();
|
|
1292
1330
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1293
|
-
const client =
|
|
1331
|
+
const client = useClient8({ chainId });
|
|
1294
1332
|
const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
|
|
1295
1333
|
return useMutation2({
|
|
1296
1334
|
retry: 0,
|
|
@@ -1396,20 +1434,18 @@ function useSetupSession({ userClient }) {
|
|
|
1396
1434
|
});
|
|
1397
1435
|
}
|
|
1398
1436
|
|
|
1399
|
-
// src/onboarding/Session.tsx
|
|
1400
|
-
import { useEffect as useEffect7 } from "react";
|
|
1401
|
-
|
|
1402
1437
|
// src/useSessionClient.ts
|
|
1403
|
-
import { useClient as
|
|
1438
|
+
import { useClient as useClient9 } from "wagmi";
|
|
1404
1439
|
import {
|
|
1405
|
-
queryOptions as
|
|
1406
|
-
|
|
1440
|
+
queryOptions as queryOptions7,
|
|
1441
|
+
skipToken as skipToken7,
|
|
1442
|
+
useQuery as useQuery9,
|
|
1407
1443
|
useQueryClient as useQueryClient4
|
|
1408
1444
|
} from "@tanstack/react-query";
|
|
1409
1445
|
|
|
1410
1446
|
// src/getSessionClient.ts
|
|
1411
1447
|
import { smartAccountActions } from "permissionless";
|
|
1412
|
-
import { callFrom } from "@latticexyz/world/internal";
|
|
1448
|
+
import { callFrom, sendUserOperationFrom } from "@latticexyz/world/internal";
|
|
1413
1449
|
|
|
1414
1450
|
// src/createBundlerClient.ts
|
|
1415
1451
|
import {
|
|
@@ -1468,6 +1504,12 @@ async function getSessionClient({
|
|
|
1468
1504
|
delegatorAddress: userAddress,
|
|
1469
1505
|
publicClient: client
|
|
1470
1506
|
})
|
|
1507
|
+
).extend(
|
|
1508
|
+
sendUserOperationFrom({
|
|
1509
|
+
worldAddress,
|
|
1510
|
+
delegatorAddress: userAddress,
|
|
1511
|
+
publicClient: client
|
|
1512
|
+
})
|
|
1471
1513
|
).extend(() => ({ userAddress, worldAddress, internal_signer: sessionSigner }));
|
|
1472
1514
|
return sessionClient;
|
|
1473
1515
|
}
|
|
@@ -1482,32 +1524,29 @@ function getSessionClientQueryOptions({
|
|
|
1482
1524
|
userAddress,
|
|
1483
1525
|
worldAddress
|
|
1484
1526
|
}) {
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
userAddress ? {
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
retry: false
|
|
1503
|
-
} : { queryKey, enabled: false }
|
|
1504
|
-
);
|
|
1527
|
+
return queryOptions7({
|
|
1528
|
+
queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
|
|
1529
|
+
queryFn: userAddress ? async () => {
|
|
1530
|
+
const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
|
|
1531
|
+
getSessionAccountQueryOptions({ client, userAddress })
|
|
1532
|
+
);
|
|
1533
|
+
return await getSessionClient({
|
|
1534
|
+
sessionAccount,
|
|
1535
|
+
sessionSigner,
|
|
1536
|
+
userAddress,
|
|
1537
|
+
worldAddress
|
|
1538
|
+
});
|
|
1539
|
+
} : skipToken7,
|
|
1540
|
+
staleTime: Infinity,
|
|
1541
|
+
// TODO: replace with function to retry only connection errors
|
|
1542
|
+
retry: false
|
|
1543
|
+
});
|
|
1505
1544
|
}
|
|
1506
1545
|
function useSessionClient(userAddress) {
|
|
1507
1546
|
const queryClient = useQueryClient4();
|
|
1508
1547
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1509
|
-
const client =
|
|
1510
|
-
return
|
|
1548
|
+
const client = useClient9({ chainId });
|
|
1549
|
+
return useQuery9(
|
|
1511
1550
|
getSessionClientQueryOptions({
|
|
1512
1551
|
queryClient,
|
|
1513
1552
|
client,
|
|
@@ -1523,9 +1562,11 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1523
1562
|
const sessionClient = useShowQueryError(useSessionClient(userClient.account.address));
|
|
1524
1563
|
const setup = useShowMutationError(useSetupSession({ userClient }));
|
|
1525
1564
|
const hasSession = !registerDelegation && !registerDelegation;
|
|
1565
|
+
const { data: prerequisites } = usePrerequisites(userClient.account.address);
|
|
1566
|
+
const { hasAllowance, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
1526
1567
|
useEffect7(() => {
|
|
1527
1568
|
const timer = setTimeout(() => {
|
|
1528
|
-
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
|
|
1569
|
+
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession && (hasAllowance || hasGasBalance || hasQuarryGasBalance)) {
|
|
1529
1570
|
setup.mutate({
|
|
1530
1571
|
sessionClient: sessionClient.data,
|
|
1531
1572
|
registerSpender,
|
|
@@ -1534,7 +1575,17 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1534
1575
|
}
|
|
1535
1576
|
});
|
|
1536
1577
|
return () => clearTimeout(timer);
|
|
1537
|
-
}, [
|
|
1578
|
+
}, [
|
|
1579
|
+
hasSession,
|
|
1580
|
+
isActive,
|
|
1581
|
+
registerDelegation,
|
|
1582
|
+
registerSpender,
|
|
1583
|
+
sessionClient,
|
|
1584
|
+
setup,
|
|
1585
|
+
hasAllowance,
|
|
1586
|
+
hasGasBalance,
|
|
1587
|
+
hasQuarryGasBalance
|
|
1588
|
+
]);
|
|
1538
1589
|
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-4", children: [
|
|
1539
1590
|
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between gap-4", children: [
|
|
1540
1591
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
@@ -1562,7 +1613,10 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1562
1613
|
}
|
|
1563
1614
|
|
|
1564
1615
|
// src/onboarding/GasBalance.tsx
|
|
1565
|
-
import {
|
|
1616
|
+
import { useEffect as useEffect9, useState as useState3 } from "react";
|
|
1617
|
+
import { parseEther as parseEther4 } from "viem";
|
|
1618
|
+
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
1619
|
+
import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
|
|
1566
1620
|
|
|
1567
1621
|
// src/data/relayChains.json
|
|
1568
1622
|
var relayChains_default = {
|
|
@@ -1847,11 +1901,11 @@ var relayChains_default = {
|
|
|
1847
1901
|
// src/onboarding/useSetBalance.ts
|
|
1848
1902
|
import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1849
1903
|
import { setBalance as setBalance2 } from "viem/actions";
|
|
1850
|
-
import { useClient as
|
|
1904
|
+
import { useClient as useClient10 } from "wagmi";
|
|
1851
1905
|
function useSetBalance() {
|
|
1852
1906
|
const queryClient = useQueryClient5();
|
|
1853
1907
|
const { chainId } = useEntryKitConfig();
|
|
1854
|
-
const client =
|
|
1908
|
+
const client = useClient10({ chainId });
|
|
1855
1909
|
return useMutation3({
|
|
1856
1910
|
retry: 0,
|
|
1857
1911
|
mutationKey: ["setBalance", chainId],
|
|
@@ -1867,21 +1921,93 @@ function useSetBalance() {
|
|
|
1867
1921
|
});
|
|
1868
1922
|
}
|
|
1869
1923
|
|
|
1924
|
+
// src/errors/usePrevious.ts
|
|
1925
|
+
import { useEffect as useEffect8, useRef as useRef2 } from "react";
|
|
1926
|
+
function usePrevious(value, initialValue) {
|
|
1927
|
+
const ref = useRef2();
|
|
1928
|
+
useEffect8(() => {
|
|
1929
|
+
ref.current = { value };
|
|
1930
|
+
}, [value]);
|
|
1931
|
+
return ref.current ? ref.current.value : initialValue;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
// src/icons/IconSVG.tsx
|
|
1935
|
+
import { twMerge as twMerge7 } from "tailwind-merge";
|
|
1936
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1937
|
+
function IconSVG({ className, children, ...props }) {
|
|
1938
|
+
return /* @__PURE__ */ jsx16(
|
|
1939
|
+
"svg",
|
|
1940
|
+
{
|
|
1941
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1942
|
+
viewBox: "0 0 24 24",
|
|
1943
|
+
fill: "currentColor",
|
|
1944
|
+
className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
1945
|
+
...props,
|
|
1946
|
+
children
|
|
1947
|
+
}
|
|
1948
|
+
);
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
// src/icons/CopyIcon.tsx
|
|
1952
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1953
|
+
function CopyIcon(props) {
|
|
1954
|
+
return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
|
|
1955
|
+
"path",
|
|
1956
|
+
{
|
|
1957
|
+
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",
|
|
1958
|
+
fill: "none",
|
|
1959
|
+
stroke: "currentColor",
|
|
1960
|
+
strokeWidth: "2",
|
|
1961
|
+
strokeLinecap: "round",
|
|
1962
|
+
strokeLinejoin: "round"
|
|
1963
|
+
}
|
|
1964
|
+
) });
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
// src/icons/CheckIcon.tsx
|
|
1968
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1969
|
+
function CheckIcon(props) {
|
|
1970
|
+
return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
|
|
1971
|
+
"path",
|
|
1972
|
+
{
|
|
1973
|
+
d: "M5 13L9 17L19 7",
|
|
1974
|
+
fill: "none",
|
|
1975
|
+
stroke: "currentColor",
|
|
1976
|
+
strokeWidth: "2",
|
|
1977
|
+
strokeLinecap: "round",
|
|
1978
|
+
strokeLinejoin: "round"
|
|
1979
|
+
}
|
|
1980
|
+
) });
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1870
1983
|
// src/onboarding/GasBalance.tsx
|
|
1871
|
-
import { Fragment, jsx as
|
|
1984
|
+
import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1872
1985
|
function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
1986
|
+
const queryClient = useQueryClient6();
|
|
1873
1987
|
const { chain } = useEntryKitConfig();
|
|
1874
|
-
const
|
|
1988
|
+
const [copied, setCopied] = useState3(false);
|
|
1989
|
+
const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
|
|
1990
|
+
const prevBalance = usePrevious(balance.data);
|
|
1875
1991
|
useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
|
|
1876
1992
|
const setBalance3 = useShowMutationError(useSetBalance());
|
|
1877
1993
|
const relayChain = relayChains_default[chain.id];
|
|
1994
|
+
const handleCopy = () => {
|
|
1995
|
+
navigator.clipboard.writeText(sessionAddress);
|
|
1996
|
+
setCopied(true);
|
|
1997
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1998
|
+
};
|
|
1999
|
+
useEffect9(() => {
|
|
2000
|
+
if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
|
|
2001
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
2002
|
+
}
|
|
2003
|
+
}, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
|
|
1878
2004
|
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
|
|
1879
2005
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
|
|
1880
2006
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
|
|
2008
|
+
/* @__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" }) })
|
|
1883
2009
|
] }),
|
|
1884
|
-
chain.id === 31337 ? /* @__PURE__ */
|
|
2010
|
+
chain.id === 31337 ? /* @__PURE__ */ jsx19(
|
|
1885
2011
|
Button,
|
|
1886
2012
|
{
|
|
1887
2013
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1890,19 +2016,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1890
2016
|
pending: balance.status === "pending" || setBalance3.status === "pending",
|
|
1891
2017
|
onClick: () => setBalance3.mutate({
|
|
1892
2018
|
address: sessionAddress,
|
|
1893
|
-
value:
|
|
2019
|
+
value: parseEther4("0.01") + (balance.data?.value ?? 0n)
|
|
1894
2020
|
}),
|
|
1895
2021
|
children: "Top up"
|
|
1896
2022
|
}
|
|
1897
2023
|
) : relayChain != null ? (
|
|
1898
2024
|
// TODO: convert this to a <ButtonLink>
|
|
1899
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ jsx19(
|
|
1900
2026
|
"a",
|
|
1901
2027
|
{
|
|
1902
|
-
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
|
|
2028
|
+
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
|
|
1903
2029
|
target: "_blank",
|
|
1904
2030
|
rel: "noopener noreferrer",
|
|
1905
|
-
children: /* @__PURE__ */
|
|
2031
|
+
children: /* @__PURE__ */ jsx19(
|
|
1906
2032
|
Button,
|
|
1907
2033
|
{
|
|
1908
2034
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1917,11 +2043,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1917
2043
|
) : null
|
|
1918
2044
|
] }),
|
|
1919
2045
|
isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
1920
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
|
|
1921
2047
|
/* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
|
|
1922
2048
|
"Send funds to",
|
|
1923
2049
|
" ",
|
|
1924
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ jsxs14(
|
|
2051
|
+
"span",
|
|
2052
|
+
{
|
|
2053
|
+
className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
|
|
2054
|
+
onClick: handleCopy,
|
|
2055
|
+
title: "Click to copy",
|
|
2056
|
+
children: [
|
|
2057
|
+
/* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
|
|
2058
|
+
" ",
|
|
2059
|
+
copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
|
|
2060
|
+
]
|
|
2061
|
+
}
|
|
2062
|
+
),
|
|
1925
2063
|
" ",
|
|
1926
2064
|
"on ",
|
|
1927
2065
|
chain.name,
|
|
@@ -1931,133 +2069,741 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1931
2069
|
] });
|
|
1932
2070
|
}
|
|
1933
2071
|
|
|
1934
|
-
// src/onboarding/
|
|
1935
|
-
import {
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
{
|
|
1965
|
-
id: "wallet",
|
|
1966
|
-
isComplete: false,
|
|
1967
|
-
content: () => null
|
|
1968
|
-
}
|
|
1969
|
-
];
|
|
1970
|
-
}
|
|
1971
|
-
const steps2 = [
|
|
1972
|
-
{
|
|
1973
|
-
id: "wallet",
|
|
1974
|
-
isComplete: true,
|
|
1975
|
-
content: (props) => /* @__PURE__ */ jsx17(Wallet, { ...props, userAddress })
|
|
1976
|
-
}
|
|
1977
|
-
];
|
|
1978
|
-
if (!paymaster) {
|
|
1979
|
-
if (sessionAddress != null) {
|
|
1980
|
-
steps2.push({
|
|
1981
|
-
id: "gasBalance",
|
|
1982
|
-
isComplete: !!hasGasBalance,
|
|
1983
|
-
content: (props) => /* @__PURE__ */ jsx17(GasBalance, { ...props, sessionAddress })
|
|
1984
|
-
});
|
|
1985
|
-
}
|
|
1986
|
-
} else if (paymaster.type === "quarry") {
|
|
1987
|
-
steps2.push({
|
|
1988
|
-
id: "allowance",
|
|
1989
|
-
isComplete: !!hasAllowance,
|
|
1990
|
-
content: (props) => /* @__PURE__ */ jsx17(Allowance, { ...props, userAddress })
|
|
1991
|
-
});
|
|
2072
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
2073
|
+
import { useState as useState5 } from "react";
|
|
2074
|
+
import { useChains as useChains4, useChainId } from "wagmi";
|
|
2075
|
+
|
|
2076
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2077
|
+
import { useAccount as useAccount5, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
|
|
2078
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2079
|
+
import { useMutation as useMutation4, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
2080
|
+
|
|
2081
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2082
|
+
import { useEffect as useEffect11, useRef as useRef3 } from "react";
|
|
2083
|
+
import { useAccount as useAccount4, useBalance as useBalance5, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
|
|
2084
|
+
import { useIsMounted } from "usehooks-ts";
|
|
2085
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2086
|
+
|
|
2087
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2088
|
+
import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
|
|
2089
|
+
import { useAccount as useAccount2, useSwitchChain } from "wagmi";
|
|
2090
|
+
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2091
|
+
import * as Select from "@radix-ui/react-select";
|
|
2092
|
+
|
|
2093
|
+
// src/icons/ChevronUpIcon.tsx
|
|
2094
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2095
|
+
function ChevronUpIcon(props) {
|
|
2096
|
+
return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
|
|
2097
|
+
"path",
|
|
2098
|
+
{
|
|
2099
|
+
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",
|
|
2100
|
+
fillRule: "evenodd",
|
|
2101
|
+
clipRule: "evenodd"
|
|
1992
2102
|
}
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
2002
|
-
const completedSteps = steps.filter((step) => step.isComplete);
|
|
2003
|
-
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
2004
|
-
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
2005
|
-
return /* @__PURE__ */ jsx17(
|
|
2006
|
-
"div",
|
|
2103
|
+
) });
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
// src/icons/ChevronDownIcon.tsx
|
|
2107
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2108
|
+
function ChevronDownIcon(props) {
|
|
2109
|
+
return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
|
|
2110
|
+
"path",
|
|
2007
2111
|
{
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
2012
|
-
),
|
|
2013
|
-
children: steps.map((step, i) => {
|
|
2014
|
-
const isActive = step === activeStep;
|
|
2015
|
-
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
2016
|
-
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
2017
|
-
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);
|
|
2018
|
-
})
|
|
2112
|
+
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",
|
|
2113
|
+
fillRule: "evenodd",
|
|
2114
|
+
clipRule: "evenodd"
|
|
2019
2115
|
}
|
|
2020
|
-
);
|
|
2116
|
+
) });
|
|
2021
2117
|
}
|
|
2022
2118
|
|
|
2023
|
-
// src/
|
|
2024
|
-
import {
|
|
2025
|
-
import {
|
|
2026
|
-
function
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2119
|
+
// src/ui/Slot.tsx
|
|
2120
|
+
import { isValidElement, cloneElement, Children } from "react";
|
|
2121
|
+
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2122
|
+
function Slot({
|
|
2123
|
+
children,
|
|
2124
|
+
...props
|
|
2125
|
+
}) {
|
|
2126
|
+
if (isValidElement(children)) {
|
|
2127
|
+
return cloneElement(children, {
|
|
2128
|
+
...props,
|
|
2129
|
+
...children.props,
|
|
2130
|
+
style: {
|
|
2131
|
+
...props.style,
|
|
2132
|
+
...children.props.style
|
|
2133
|
+
},
|
|
2134
|
+
className: twMerge8(props.className, children.props.className)
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
if (Children.count(children) > 1) {
|
|
2138
|
+
Children.only(null);
|
|
2033
2139
|
}
|
|
2034
|
-
return
|
|
2140
|
+
return null;
|
|
2035
2141
|
}
|
|
2036
2142
|
|
|
2037
|
-
// src/
|
|
2038
|
-
import {
|
|
2143
|
+
// src/ui/Input.tsx
|
|
2144
|
+
import { twMerge as twMerge9 } from "tailwind-merge";
|
|
2145
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2146
|
+
function Input({ asChild, className, ...props }) {
|
|
2147
|
+
const Child = asChild ? Slot : "input";
|
|
2148
|
+
return /* @__PURE__ */ jsx22(
|
|
2149
|
+
Child,
|
|
2150
|
+
{
|
|
2151
|
+
className: twMerge9(
|
|
2152
|
+
"p-2.5 gap-1 border text-lg font-medium transition",
|
|
2153
|
+
"outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
|
|
2154
|
+
"bg-white border-neutral-300 text-black placeholder:text-neutral-400",
|
|
2155
|
+
"dark:bg-neutral-900 dark:border-neutral-700 dark:text-white dark:placeholder:text-neutral-500",
|
|
2156
|
+
className
|
|
2157
|
+
),
|
|
2158
|
+
...props
|
|
2159
|
+
}
|
|
2160
|
+
);
|
|
2161
|
+
}
|
|
2039
2162
|
|
|
2040
|
-
// src/
|
|
2041
|
-
import {
|
|
2042
|
-
import { jsx as
|
|
2043
|
-
function
|
|
2044
|
-
|
|
2045
|
-
|
|
2163
|
+
// src/onboarding/deposit/ChainBalance.tsx
|
|
2164
|
+
import { useBalance as useBalance3 } from "wagmi";
|
|
2165
|
+
import { Fragment as Fragment2, jsx as jsx23 } from "react/jsx-runtime";
|
|
2166
|
+
function ChainBalance({ chainId, address }) {
|
|
2167
|
+
const balance = useBalance3({ chainId, address });
|
|
2168
|
+
return /* @__PURE__ */ jsx23(Fragment2, { children: balance.data ? /* @__PURE__ */ jsx23(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx23(PendingIcon, {}) });
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2172
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2173
|
+
|
|
2174
|
+
// src/onboarding/deposit/PreloadedImage.tsx
|
|
2175
|
+
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
2176
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2177
|
+
function PreloadedImage({ url, fallback: fallback2, className }) {
|
|
2178
|
+
const { isSuccess, isLoading } = usePreloadImage(url);
|
|
2179
|
+
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 });
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2183
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2184
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2185
|
+
var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
|
|
2186
|
+
return /* @__PURE__ */ jsx25(
|
|
2187
|
+
"span",
|
|
2046
2188
|
{
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2189
|
+
ref: forwardedRef,
|
|
2190
|
+
className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
|
|
2191
|
+
children: url ? /* @__PURE__ */ jsx25(PreloadedImage, { url }) : (
|
|
2192
|
+
// TODO: better placeholder
|
|
2193
|
+
/* @__PURE__ */ jsx25(
|
|
2194
|
+
"span",
|
|
2195
|
+
{
|
|
2196
|
+
className: twMerge11(
|
|
2197
|
+
"inline-flex items-center justify-center w-full h-full rounded-full",
|
|
2198
|
+
"border-2 border-dashed border-black/20 dark:border-white/50 opacity-50"
|
|
2199
|
+
),
|
|
2200
|
+
children: name?.slice(0, 1)
|
|
2201
|
+
}
|
|
2202
|
+
)
|
|
2203
|
+
)
|
|
2204
|
+
}
|
|
2205
|
+
);
|
|
2206
|
+
});
|
|
2207
|
+
|
|
2208
|
+
// src/onboarding/deposit/useRelay.ts
|
|
2209
|
+
import {
|
|
2210
|
+
MAINNET_RELAY_API,
|
|
2211
|
+
TESTNET_RELAY_API,
|
|
2212
|
+
fetchChainConfigs,
|
|
2213
|
+
createClient as createClient2,
|
|
2214
|
+
LogLevel
|
|
2215
|
+
} from "@reservoir0x/relay-sdk";
|
|
2216
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
2217
|
+
function useRelay() {
|
|
2218
|
+
const { chain } = useEntryKitConfig();
|
|
2219
|
+
const appOrigin = location.host;
|
|
2220
|
+
const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
|
|
2221
|
+
return useQuery10({
|
|
2222
|
+
queryKey: ["relayChains", baseApiUrl, appOrigin],
|
|
2223
|
+
queryFn: async () => {
|
|
2224
|
+
debug("fetching relay chains from", baseApiUrl);
|
|
2225
|
+
const chains = await fetchChainConfigs(baseApiUrl);
|
|
2226
|
+
debug("got relay chains", chains);
|
|
2227
|
+
const client = createClient2({
|
|
2228
|
+
baseApiUrl,
|
|
2229
|
+
source: appOrigin,
|
|
2230
|
+
chains,
|
|
2231
|
+
logLevel: LogLevel.Verbose
|
|
2232
|
+
});
|
|
2233
|
+
return { client, chains };
|
|
2234
|
+
},
|
|
2235
|
+
refetchOnMount: false,
|
|
2236
|
+
refetchOnReconnect: false,
|
|
2237
|
+
refetchOnWindowFocus: false,
|
|
2238
|
+
staleTime: Infinity
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2243
|
+
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2244
|
+
function ChainSelect({ value, onChange }) {
|
|
2245
|
+
const theme = useTheme();
|
|
2246
|
+
const { frame } = useFrame();
|
|
2247
|
+
const userAccount = useAccount2();
|
|
2248
|
+
const { chains, switchChain } = useSwitchChain();
|
|
2249
|
+
const relay = useRelay();
|
|
2250
|
+
const relayChains = relay.data?.chains;
|
|
2251
|
+
const sourceChains = useMemo2(() => {
|
|
2252
|
+
return chains.map((sourceChain) => {
|
|
2253
|
+
const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
|
|
2254
|
+
return {
|
|
2255
|
+
...sourceChain,
|
|
2256
|
+
relayChain
|
|
2257
|
+
};
|
|
2258
|
+
}).filter((c) => c.relayChain);
|
|
2259
|
+
}, [chains, relayChains]);
|
|
2260
|
+
const selectedChain = sourceChains.find((c) => c.id === value);
|
|
2261
|
+
useEffect10(() => {
|
|
2262
|
+
if (sourceChains.length > 0 && !selectedChain) {
|
|
2263
|
+
const defaultChain = sourceChains[0];
|
|
2264
|
+
onChange(defaultChain.id);
|
|
2265
|
+
switchChain({ chainId: defaultChain.id });
|
|
2266
|
+
}
|
|
2267
|
+
}, [value, selectedChain, sourceChains, onChange, switchChain]);
|
|
2268
|
+
return /* @__PURE__ */ jsxs15(
|
|
2269
|
+
Select.Root,
|
|
2270
|
+
{
|
|
2271
|
+
value: value.toString(),
|
|
2272
|
+
onValueChange: (value2) => {
|
|
2273
|
+
if (value2) {
|
|
2274
|
+
const chain = sourceChains.find((chain2) => chain2.id.toString() === value2);
|
|
2275
|
+
if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
|
|
2276
|
+
onChange(chain.id);
|
|
2277
|
+
}
|
|
2278
|
+
},
|
|
2279
|
+
children: [
|
|
2280
|
+
/* @__PURE__ */ jsx26(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
|
|
2281
|
+
/* @__PURE__ */ jsx26(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
2282
|
+
ChainIcon,
|
|
2283
|
+
{
|
|
2284
|
+
id: selectedChain?.id,
|
|
2285
|
+
name: selectedChain?.name,
|
|
2286
|
+
url: selectedChain?.relayChain?.icon?.[theme],
|
|
2287
|
+
className: "w-8"
|
|
2288
|
+
}
|
|
2289
|
+
) }),
|
|
2290
|
+
/* @__PURE__ */ jsx26(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
2291
|
+
/* @__PURE__ */ jsx26(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
|
|
2292
|
+
/* @__PURE__ */ jsx26(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
|
|
2293
|
+
] }) })
|
|
2294
|
+
] }) }),
|
|
2295
|
+
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(
|
|
2296
|
+
Select.Group,
|
|
2297
|
+
{
|
|
2298
|
+
className: twMerge12(
|
|
2299
|
+
"flex flex-col border divide-y",
|
|
2300
|
+
"bg-neutral-100 text-neutral-700 border-neutral-300 divide-neutral-300",
|
|
2301
|
+
"dark:bg-neutral-800 dark:text-neutral-300 dark:border-neutral-700 dark:divide-neutral-700"
|
|
2302
|
+
),
|
|
2303
|
+
children: sourceChains.map((chain) => (
|
|
2304
|
+
// TODO: figure out why up/down arrow jump to top/bottom rather than cycling through items
|
|
2305
|
+
/* @__PURE__ */ jsxs15(
|
|
2306
|
+
Select.Item,
|
|
2307
|
+
{
|
|
2308
|
+
value: chain.id.toString(),
|
|
2309
|
+
className: twMerge12(
|
|
2310
|
+
"group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
|
|
2311
|
+
// TODO: different style for checked/active state
|
|
2312
|
+
"text-black focus:bg-white data-[state=checked]:bg-neutral-200",
|
|
2313
|
+
"dark:text-white dark:focus:bg-neutral-700 dark:data-[state=checked]:bg-neutral-900"
|
|
2314
|
+
),
|
|
2315
|
+
children: [
|
|
2316
|
+
/* @__PURE__ */ jsx26(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
|
|
2317
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
|
|
2318
|
+
/* @__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 }) })
|
|
2319
|
+
]
|
|
2320
|
+
},
|
|
2321
|
+
chain.id
|
|
2322
|
+
)
|
|
2323
|
+
))
|
|
2324
|
+
}
|
|
2325
|
+
) }) }) }) : null
|
|
2326
|
+
]
|
|
2327
|
+
}
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
// src/onboarding/deposit/AmountInput.tsx
|
|
2332
|
+
import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
|
|
2333
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2334
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
2335
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2336
|
+
var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
|
|
2337
|
+
return /* @__PURE__ */ jsx27(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
|
|
2338
|
+
/* @__PURE__ */ jsx27(
|
|
2339
|
+
"input",
|
|
2340
|
+
{
|
|
2341
|
+
ref: forwardedRef,
|
|
2342
|
+
className: twMerge13(
|
|
2343
|
+
"peer flex-grow outline-none bg-transparent",
|
|
2344
|
+
"placeholder:text-neutral-400",
|
|
2345
|
+
"dark:placeholder:text-neutral-500"
|
|
2346
|
+
),
|
|
2347
|
+
placeholder: "0.005",
|
|
2348
|
+
required: true,
|
|
2349
|
+
autoFocus: true,
|
|
2350
|
+
defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
|
|
2351
|
+
onChange: (event) => {
|
|
2352
|
+
const input = event.currentTarget;
|
|
2353
|
+
if (input.value.trim() === "") {
|
|
2354
|
+
input.setCustomValidity("");
|
|
2355
|
+
onChange(void 0);
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
const value = input.value.trim().replace(/\.$/, ".0");
|
|
2359
|
+
if (!/^\d*(\.\d+)?$/.test(value)) {
|
|
2360
|
+
return input.setCustomValidity("Invalid amount.");
|
|
2361
|
+
}
|
|
2362
|
+
input.setCustomValidity("");
|
|
2363
|
+
onChange(parseEther5(value));
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
),
|
|
2367
|
+
/* @__PURE__ */ jsx27(
|
|
2368
|
+
"span",
|
|
2369
|
+
{
|
|
2370
|
+
className: twMerge13(
|
|
2371
|
+
"flex-shrink-0 text-2xl",
|
|
2372
|
+
"peer-placeholder-shown:text-neutral-400",
|
|
2373
|
+
"dark:peer-placeholder-shown:text-neutral-500"
|
|
2374
|
+
),
|
|
2375
|
+
children: /* @__PURE__ */ jsx27(EthIcon, {})
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2378
|
+
] }) });
|
|
2379
|
+
});
|
|
2380
|
+
|
|
2381
|
+
// src/onboarding/deposit/SubmitButton.tsx
|
|
2382
|
+
import { useAccount as useAccount3, useBalance as useBalance4, useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
2383
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2384
|
+
import { parseEther as parseEther6 } from "viem";
|
|
2385
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2386
|
+
var MAX_DEPOSIT_AMOUNT = "0.1";
|
|
2387
|
+
function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
2388
|
+
const { chainId: userChainId, address: userAddress } = useAccount3();
|
|
2389
|
+
const { data: userBalance } = useBalance4({ address: userAddress });
|
|
2390
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
2391
|
+
const switchChain = useSwitchChain2();
|
|
2392
|
+
if (shouldSwitchChain) {
|
|
2393
|
+
return /* @__PURE__ */ jsx28(
|
|
2394
|
+
Button,
|
|
2395
|
+
{
|
|
2396
|
+
type: "button",
|
|
2397
|
+
variant: "primary",
|
|
2398
|
+
className: twMerge14("w-full", className),
|
|
2399
|
+
pending: switchChain.isPending,
|
|
2400
|
+
onClick: () => switchChain.switchChain({ chainId }),
|
|
2401
|
+
children: "Switch chain"
|
|
2402
|
+
}
|
|
2403
|
+
);
|
|
2404
|
+
} else if (amount) {
|
|
2405
|
+
if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
|
|
2406
|
+
return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
|
|
2407
|
+
"Max amount is ",
|
|
2408
|
+
MAX_DEPOSIT_AMOUNT,
|
|
2409
|
+
" ETH"
|
|
2410
|
+
] });
|
|
2411
|
+
} else if (amount > (userBalance?.value ?? 0n)) {
|
|
2412
|
+
return /* @__PURE__ */ jsx28(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
return /* @__PURE__ */ jsx28(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
// src/icons/WarningIcon.tsx
|
|
2419
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2420
|
+
function WarningIcon(props) {
|
|
2421
|
+
return /* @__PURE__ */ jsx29(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx29(
|
|
2422
|
+
"path",
|
|
2423
|
+
{
|
|
2424
|
+
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",
|
|
2425
|
+
stroke: "currentColor",
|
|
2426
|
+
strokeWidth: "2",
|
|
2427
|
+
strokeLinecap: "round",
|
|
2428
|
+
strokeLinejoin: "round"
|
|
2429
|
+
}
|
|
2430
|
+
) });
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
// src/formatGas.ts
|
|
2434
|
+
import { formatGwei } from "viem";
|
|
2435
|
+
function formatGas(wei) {
|
|
2436
|
+
const formatted = formatGwei(wei);
|
|
2437
|
+
const magnitude = Math.floor(parseFloat(formatted)).toString().length;
|
|
2438
|
+
return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2442
|
+
import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2443
|
+
function DepositForm({
|
|
2444
|
+
sourceChain,
|
|
2445
|
+
setSourceChainId,
|
|
2446
|
+
amount,
|
|
2447
|
+
setAmount,
|
|
2448
|
+
estimatedFee,
|
|
2449
|
+
estimatedTime,
|
|
2450
|
+
onSubmit,
|
|
2451
|
+
submitButton
|
|
2452
|
+
}) {
|
|
2453
|
+
const amountInputRef = useRef3(null);
|
|
2454
|
+
const isMounted = useIsMounted();
|
|
2455
|
+
const { address: userAddress, chainId: userChainId } = useAccount4();
|
|
2456
|
+
const balance = useShowQueryError(useBalance5({ chainId: sourceChain.id, address: userAddress }));
|
|
2457
|
+
const quarryBalance = useShowQueryError(useBalance(userAddress));
|
|
2458
|
+
useWatchBlockNumber2({
|
|
2459
|
+
onBlockNumber: () => {
|
|
2460
|
+
balance.refetch();
|
|
2461
|
+
quarryBalance.refetch();
|
|
2462
|
+
}
|
|
2463
|
+
});
|
|
2464
|
+
const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
|
|
2465
|
+
const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
|
|
2466
|
+
useEffect11(() => {
|
|
2467
|
+
amountInputRef.current?.focus();
|
|
2468
|
+
}, [userChainId]);
|
|
2469
|
+
return /* @__PURE__ */ jsxs18(
|
|
2470
|
+
"form",
|
|
2471
|
+
{
|
|
2472
|
+
className: "flex flex-col gap-5",
|
|
2473
|
+
onSubmit: async (event) => {
|
|
2474
|
+
event.preventDefault();
|
|
2475
|
+
try {
|
|
2476
|
+
await onSubmit();
|
|
2477
|
+
if (isMounted()) {
|
|
2478
|
+
setAmount(void 0);
|
|
2479
|
+
if (amountInputRef.current) {
|
|
2480
|
+
amountInputRef.current.value = "";
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
} catch (error2) {
|
|
2484
|
+
console.error("Error during deposit", error2);
|
|
2485
|
+
} finally {
|
|
2486
|
+
amountInputRef.current?.focus();
|
|
2487
|
+
}
|
|
2488
|
+
},
|
|
2489
|
+
children: [
|
|
2490
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
2491
|
+
/* @__PURE__ */ jsx30(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
|
|
2492
|
+
/* @__PURE__ */ jsx30(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
|
|
2493
|
+
] }),
|
|
2494
|
+
/* @__PURE__ */ jsxs18(
|
|
2495
|
+
"dl",
|
|
2496
|
+
{
|
|
2497
|
+
className: twMerge15(
|
|
2498
|
+
"grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
|
|
2499
|
+
"divide-neutral-200 text-neutral-500",
|
|
2500
|
+
"dark:divide-neutral-700 dark:text-neutral-400"
|
|
2501
|
+
),
|
|
2502
|
+
children: [
|
|
2503
|
+
/* @__PURE__ */ jsx30("dt", { children: "Available to deposit" }),
|
|
2504
|
+
/* @__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 }),
|
|
2505
|
+
/* @__PURE__ */ jsx30("dt", { children: "Gas balance after deposit" }),
|
|
2506
|
+
/* @__PURE__ */ jsx30("dd", { children: /* @__PURE__ */ jsx30(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
|
|
2507
|
+
/* @__PURE__ */ jsx30("dt", { children: "Estimated fee" }),
|
|
2508
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2509
|
+
formatGas(estimatedFee.fee),
|
|
2510
|
+
" gwei"
|
|
2511
|
+
] }) : 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 }),
|
|
2512
|
+
/* @__PURE__ */ jsx30("dt", { children: "Time to deposit" }),
|
|
2513
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedTime })
|
|
2514
|
+
]
|
|
2515
|
+
}
|
|
2516
|
+
),
|
|
2517
|
+
hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx30(SubmitButton, { disabled: true, children: "Not enough funds" })
|
|
2518
|
+
]
|
|
2519
|
+
}
|
|
2520
|
+
);
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
// src/onboarding/deposit/useDeposits.ts
|
|
2524
|
+
import { createStore as createStore4 } from "zustand/vanilla";
|
|
2525
|
+
import { useStore as useStore2 } from "zustand";
|
|
2526
|
+
import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
2527
|
+
var store4 = createStore4(() => ({
|
|
2528
|
+
count: 0,
|
|
2529
|
+
deposits: []
|
|
2530
|
+
}));
|
|
2531
|
+
function useDeposits() {
|
|
2532
|
+
const deposits = useStore2(store4, (state) => state.deposits);
|
|
2533
|
+
const addDeposit = useCallback2((transaction) => {
|
|
2534
|
+
store4.setState((state) => {
|
|
2535
|
+
if (transaction.type === "relay") {
|
|
2536
|
+
const existingDeposit = state.deposits.find(
|
|
2537
|
+
(deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
|
|
2538
|
+
);
|
|
2539
|
+
if (existingDeposit) {
|
|
2540
|
+
return state;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
return {
|
|
2544
|
+
count: state.count + 1,
|
|
2545
|
+
deposits: [
|
|
2546
|
+
...state.deposits,
|
|
2547
|
+
{
|
|
2548
|
+
...transaction,
|
|
2549
|
+
uid: `deposit-${state.count}`
|
|
2550
|
+
}
|
|
2551
|
+
]
|
|
2552
|
+
};
|
|
2553
|
+
});
|
|
2554
|
+
}, []);
|
|
2555
|
+
const removeDeposit = useCallback2((uid) => {
|
|
2556
|
+
store4.setState((state) => ({
|
|
2557
|
+
deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
|
|
2558
|
+
}));
|
|
2559
|
+
}, []);
|
|
2560
|
+
return useMemo3(
|
|
2561
|
+
() => ({
|
|
2562
|
+
deposits,
|
|
2563
|
+
addDeposit,
|
|
2564
|
+
removeDeposit
|
|
2565
|
+
}),
|
|
2566
|
+
[addDeposit, deposits, removeDeposit]
|
|
2567
|
+
);
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2571
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2572
|
+
function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2573
|
+
const { chain } = useEntryKitConfig();
|
|
2574
|
+
const paymaster = getPaymaster(chain);
|
|
2575
|
+
const publicClient = usePublicClient();
|
|
2576
|
+
const { address: userAddress } = useAccount5();
|
|
2577
|
+
const { writeContractAsync } = useWriteContract();
|
|
2578
|
+
const { addDeposit } = useDeposits();
|
|
2579
|
+
if (!userAddress) {
|
|
2580
|
+
throw new Error("User address not found");
|
|
2581
|
+
}
|
|
2582
|
+
const { data: gasPrice } = useQuery11({
|
|
2583
|
+
queryKey: ["gasPrice", sourceChain.id],
|
|
2584
|
+
queryFn: async () => {
|
|
2585
|
+
if (!publicClient) throw new Error("Public client not available");
|
|
2586
|
+
return publicClient.getGasPrice();
|
|
2587
|
+
},
|
|
2588
|
+
refetchInterval: 15e3,
|
|
2589
|
+
enabled: !!publicClient
|
|
2590
|
+
});
|
|
2591
|
+
const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
|
|
2592
|
+
to: paymaster?.address,
|
|
2593
|
+
data: encodeFunctionData2({
|
|
2594
|
+
abi: paymasterAbi,
|
|
2595
|
+
functionName: "depositTo",
|
|
2596
|
+
args: [userAddress]
|
|
2597
|
+
}),
|
|
2598
|
+
value: amount
|
|
2599
|
+
});
|
|
2600
|
+
const deposit = useMutation4({
|
|
2601
|
+
mutationKey: ["depositViaTransfer", amount?.toString()],
|
|
2602
|
+
mutationFn: async () => {
|
|
2603
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
2604
|
+
if (!publicClient) throw new Error("Public client not found");
|
|
2605
|
+
if (!amount) throw new Error("Amount cannot be 0");
|
|
2606
|
+
try {
|
|
2607
|
+
const hash = await writeContractAsync({
|
|
2608
|
+
address: paymaster.address,
|
|
2609
|
+
abi: paymasterAbi,
|
|
2610
|
+
functionName: "depositTo",
|
|
2611
|
+
args: [userAddress],
|
|
2612
|
+
value: amount
|
|
2613
|
+
});
|
|
2614
|
+
const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
|
|
2615
|
+
if (receipt2.status === "reverted") {
|
|
2616
|
+
throw new Error("Transfer transaction reverted.");
|
|
2617
|
+
}
|
|
2618
|
+
return receipt2;
|
|
2619
|
+
});
|
|
2620
|
+
const pendingDeposit = {
|
|
2621
|
+
type: "transfer",
|
|
2622
|
+
amount,
|
|
2623
|
+
chainL1Id: sourceChain.id,
|
|
2624
|
+
chainL2Id: chain.id,
|
|
2625
|
+
hash,
|
|
2626
|
+
receipt,
|
|
2627
|
+
start: /* @__PURE__ */ new Date(),
|
|
2628
|
+
estimatedTime: 1e3 * 12,
|
|
2629
|
+
isComplete: receipt.then(() => void 0)
|
|
2630
|
+
};
|
|
2631
|
+
addDeposit(pendingDeposit);
|
|
2632
|
+
} catch (error2) {
|
|
2633
|
+
console.error("Error while depositing via bridge", error2);
|
|
2634
|
+
throw error2;
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
});
|
|
2638
|
+
const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
|
|
2639
|
+
return /* @__PURE__ */ jsx31(
|
|
2640
|
+
DepositForm,
|
|
2641
|
+
{
|
|
2642
|
+
sourceChain,
|
|
2643
|
+
setSourceChainId,
|
|
2644
|
+
amount,
|
|
2645
|
+
setAmount,
|
|
2646
|
+
estimatedFee: {
|
|
2647
|
+
fee: estimatedFee,
|
|
2648
|
+
isLoading: !prepareData && !prepareError || !gasPrice,
|
|
2649
|
+
error: prepareError instanceof Error ? prepareError : void 0
|
|
2650
|
+
},
|
|
2651
|
+
estimatedTime: "A few seconds",
|
|
2652
|
+
onSubmit: async () => {
|
|
2653
|
+
await deposit.mutateAsync();
|
|
2654
|
+
},
|
|
2655
|
+
submitButton: /* @__PURE__ */ jsx31(
|
|
2656
|
+
SubmitButton,
|
|
2657
|
+
{
|
|
2658
|
+
variant: "primary",
|
|
2659
|
+
amount,
|
|
2660
|
+
chainId: sourceChain.id,
|
|
2661
|
+
disabled: !!prepareError || !amount || !userAddress,
|
|
2662
|
+
pending: deposit.isPending,
|
|
2663
|
+
children: "Deposit"
|
|
2664
|
+
}
|
|
2665
|
+
)
|
|
2053
2666
|
}
|
|
2054
2667
|
);
|
|
2055
2668
|
}
|
|
2056
2669
|
|
|
2670
|
+
// src/onboarding/deposit/DepositViaRelayForm.tsx
|
|
2671
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
2672
|
+
import { useAccount as useAccount6, useWalletClient } from "wagmi";
|
|
2673
|
+
import { useMutation as useMutation5, useQuery as useQuery12 } from "@tanstack/react-query";
|
|
2674
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2675
|
+
var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2676
|
+
function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2677
|
+
const { chain, chainId: destinationChainId } = useEntryKitConfig();
|
|
2678
|
+
const paymaster = getPaymaster(chain);
|
|
2679
|
+
const { data: wallet } = useWalletClient();
|
|
2680
|
+
const { address: userAddress } = useAccount6();
|
|
2681
|
+
const { addDeposit } = useDeposits();
|
|
2682
|
+
const { data: relay } = useRelay();
|
|
2683
|
+
const relayClient = relay?.client;
|
|
2684
|
+
const quote = useQuery12({
|
|
2685
|
+
queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
|
|
2686
|
+
queryFn: async () => {
|
|
2687
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2688
|
+
if (!userAddress) throw new Error("No user address found.");
|
|
2689
|
+
const result = await relayClient.actions.getQuote({
|
|
2690
|
+
chainId: sourceChain.id,
|
|
2691
|
+
toChainId: destinationChainId,
|
|
2692
|
+
currency: ETH_ADDRESS,
|
|
2693
|
+
toCurrency: ETH_ADDRESS,
|
|
2694
|
+
amount: amount?.toString(),
|
|
2695
|
+
tradeType: "EXACT_OUTPUT",
|
|
2696
|
+
recipient: paymaster?.address,
|
|
2697
|
+
wallet,
|
|
2698
|
+
txs: [
|
|
2699
|
+
{
|
|
2700
|
+
to: paymaster?.address,
|
|
2701
|
+
data: encodeFunctionData3({
|
|
2702
|
+
abi: paymasterAbi,
|
|
2703
|
+
functionName: "depositTo",
|
|
2704
|
+
args: [userAddress]
|
|
2705
|
+
}),
|
|
2706
|
+
value: amount?.toString()
|
|
2707
|
+
}
|
|
2708
|
+
]
|
|
2709
|
+
});
|
|
2710
|
+
if (!result) {
|
|
2711
|
+
throw new Error("Failed to get relay quote");
|
|
2712
|
+
}
|
|
2713
|
+
return result;
|
|
2714
|
+
},
|
|
2715
|
+
retry: 1,
|
|
2716
|
+
refetchInterval: 15e3,
|
|
2717
|
+
enabled: !!amount && !!userAddress && !!relayClient
|
|
2718
|
+
});
|
|
2719
|
+
const deposit = useMutation5({
|
|
2720
|
+
mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
|
|
2721
|
+
mutationFn: async ({ quote: quote2, amount: amount2 }) => {
|
|
2722
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2723
|
+
if (!wallet) throw new Error("No wallet found.");
|
|
2724
|
+
try {
|
|
2725
|
+
return new Promise((resolve) => {
|
|
2726
|
+
const pendingDeposit = relayClient.actions.execute({
|
|
2727
|
+
quote: quote2,
|
|
2728
|
+
wallet,
|
|
2729
|
+
onProgress(progress) {
|
|
2730
|
+
const currentStep = progress.currentStep;
|
|
2731
|
+
const requestId = currentStep?.requestId;
|
|
2732
|
+
const currentState = currentStep?.items[0]?.progressState;
|
|
2733
|
+
if (requestId && currentState === "validating") {
|
|
2734
|
+
addDeposit({
|
|
2735
|
+
type: "relay",
|
|
2736
|
+
requestId,
|
|
2737
|
+
amount: amount2,
|
|
2738
|
+
chainL1Id: sourceChain.id,
|
|
2739
|
+
chainL2Id: destinationChainId,
|
|
2740
|
+
start: /* @__PURE__ */ new Date(),
|
|
2741
|
+
estimatedTime: 1e3 * 30,
|
|
2742
|
+
depositPromise: pendingDeposit,
|
|
2743
|
+
isComplete: pendingDeposit.then(() => void 0)
|
|
2744
|
+
});
|
|
2745
|
+
resolve(void 0);
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
});
|
|
2749
|
+
});
|
|
2750
|
+
} catch (error2) {
|
|
2751
|
+
console.error("Error while depositing via Relay", error2);
|
|
2752
|
+
throw error2;
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
});
|
|
2756
|
+
const fees = quote.data?.fees;
|
|
2757
|
+
const gasFee = BigInt(fees?.gas?.amount ?? 0);
|
|
2758
|
+
const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
|
|
2759
|
+
const fee = gasFee + relayerFee;
|
|
2760
|
+
return /* @__PURE__ */ jsx32(
|
|
2761
|
+
DepositForm,
|
|
2762
|
+
{
|
|
2763
|
+
sourceChain,
|
|
2764
|
+
setSourceChainId,
|
|
2765
|
+
amount,
|
|
2766
|
+
setAmount,
|
|
2767
|
+
estimatedFee: {
|
|
2768
|
+
fee: fee != null ? BigInt(fee) : void 0,
|
|
2769
|
+
isLoading: quote.isLoading,
|
|
2770
|
+
error: quote.error instanceof Error ? quote.error : void 0
|
|
2771
|
+
},
|
|
2772
|
+
estimatedTime: "A few seconds",
|
|
2773
|
+
onSubmit: async () => {
|
|
2774
|
+
if (!quote.data || !amount) return;
|
|
2775
|
+
await deposit.mutateAsync({ quote: quote.data, amount });
|
|
2776
|
+
},
|
|
2777
|
+
submitButton: /* @__PURE__ */ jsx32(
|
|
2778
|
+
SubmitButton,
|
|
2779
|
+
{
|
|
2780
|
+
variant: "primary",
|
|
2781
|
+
amount,
|
|
2782
|
+
chainId: sourceChain.id,
|
|
2783
|
+
disabled: quote.isError || !amount,
|
|
2784
|
+
pending: deposit.isPending,
|
|
2785
|
+
children: "Deposit"
|
|
2786
|
+
}
|
|
2787
|
+
)
|
|
2788
|
+
}
|
|
2789
|
+
);
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2793
|
+
import { useEffect as useEffect13 } from "react";
|
|
2794
|
+
import { useQuery as useQuery15, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
2795
|
+
|
|
2796
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2797
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
2798
|
+
|
|
2799
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2800
|
+
import { useEffect as useEffect12, useState as useState4 } from "react";
|
|
2801
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2802
|
+
|
|
2057
2803
|
// src/icons/CloseIcon.tsx
|
|
2058
|
-
import { jsx as
|
|
2804
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2059
2805
|
function CloseIcon(props) {
|
|
2060
|
-
return /* @__PURE__ */
|
|
2806
|
+
return /* @__PURE__ */ jsx33(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx33(
|
|
2061
2807
|
"path",
|
|
2062
2808
|
{
|
|
2063
2809
|
d: "M6 18L18 6M6 6L18 18",
|
|
@@ -2070,52 +2816,502 @@ function CloseIcon(props) {
|
|
|
2070
2816
|
) });
|
|
2071
2817
|
}
|
|
2072
2818
|
|
|
2819
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2820
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2821
|
+
function DepositStatus({ status, progress, children, onDismiss }) {
|
|
2822
|
+
const [appear, setAppear] = useState4(false);
|
|
2823
|
+
useEffect12(() => {
|
|
2824
|
+
setAppear(true);
|
|
2825
|
+
}, []);
|
|
2826
|
+
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: [
|
|
2827
|
+
/* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
|
|
2828
|
+
/* @__PURE__ */ jsx34("div", { className: "flex-grow", children }),
|
|
2829
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
|
|
2830
|
+
/* @__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" }) }),
|
|
2831
|
+
/* @__PURE__ */ jsx34(
|
|
2832
|
+
"button",
|
|
2833
|
+
{
|
|
2834
|
+
type: "button",
|
|
2835
|
+
className: twMerge16(
|
|
2836
|
+
"col-start-1 row-start-1 flex items-center justify-center transition",
|
|
2837
|
+
"opacity-0 pointer-events-none",
|
|
2838
|
+
"group-hover:opacity-100 group-hover:pointer-events-auto",
|
|
2839
|
+
"text-neutral-400 hover:text-black",
|
|
2840
|
+
"dark:text-neutral-500 dark:hover:text-white"
|
|
2841
|
+
),
|
|
2842
|
+
title: "Dismiss",
|
|
2843
|
+
onClick: onDismiss,
|
|
2844
|
+
children: /* @__PURE__ */ jsx34(CloseIcon, {})
|
|
2845
|
+
}
|
|
2846
|
+
)
|
|
2847
|
+
] })
|
|
2848
|
+
] }),
|
|
2849
|
+
/* @__PURE__ */ jsx34("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx34(
|
|
2850
|
+
"div",
|
|
2851
|
+
{
|
|
2852
|
+
className: twMerge16(
|
|
2853
|
+
"w-full h-full transition ease-linear",
|
|
2854
|
+
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",
|
|
2855
|
+
status === "pending" ? "opacity-100" : "opacity-0"
|
|
2856
|
+
),
|
|
2857
|
+
style: status === "pending" ? {
|
|
2858
|
+
transform: appear ? `translateX(0)` : "translate(-100%)",
|
|
2859
|
+
transitionDuration: `${progress.duration}ms`,
|
|
2860
|
+
transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
|
|
2861
|
+
} : void 0
|
|
2862
|
+
}
|
|
2863
|
+
) })
|
|
2864
|
+
] });
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2868
|
+
import { useChains as useChains2 } from "wagmi";
|
|
2869
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2870
|
+
function TransferDepositStatus({
|
|
2871
|
+
amount,
|
|
2872
|
+
chainL1Id,
|
|
2873
|
+
hash,
|
|
2874
|
+
receipt: receiptPromise,
|
|
2875
|
+
start,
|
|
2876
|
+
estimatedTime,
|
|
2877
|
+
onDismiss
|
|
2878
|
+
}) {
|
|
2879
|
+
const chains = useChains2();
|
|
2880
|
+
const chain = chains.find((chain2) => chain2.id === chainL1Id);
|
|
2881
|
+
const receipt = useQuery13({
|
|
2882
|
+
queryKey: ["transferDepositStatus", hash],
|
|
2883
|
+
queryFn: () => receiptPromise
|
|
2884
|
+
});
|
|
2885
|
+
return /* @__PURE__ */ jsx35(
|
|
2886
|
+
DepositStatus,
|
|
2887
|
+
{
|
|
2888
|
+
status: receipt.status,
|
|
2889
|
+
progress: {
|
|
2890
|
+
duration: estimatedTime,
|
|
2891
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2892
|
+
},
|
|
2893
|
+
onDismiss,
|
|
2894
|
+
children: (() => {
|
|
2895
|
+
const blockExplorer = chain.blockExplorers?.default.url;
|
|
2896
|
+
if (receipt.status === "pending") {
|
|
2897
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2898
|
+
"Confirming deposit on",
|
|
2899
|
+
" ",
|
|
2900
|
+
/* @__PURE__ */ jsx35(
|
|
2901
|
+
"a",
|
|
2902
|
+
{
|
|
2903
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2904
|
+
target: "_blank",
|
|
2905
|
+
rel: "noreferrer noopener",
|
|
2906
|
+
children: chain.name
|
|
2907
|
+
}
|
|
2908
|
+
),
|
|
2909
|
+
"\u2026"
|
|
2910
|
+
] });
|
|
2911
|
+
}
|
|
2912
|
+
if (receipt.status === "error") {
|
|
2913
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2914
|
+
"Could not find deposit on",
|
|
2915
|
+
" ",
|
|
2916
|
+
/* @__PURE__ */ jsx35(
|
|
2917
|
+
"a",
|
|
2918
|
+
{
|
|
2919
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2920
|
+
target: "_blank",
|
|
2921
|
+
rel: "noreferrer noopener",
|
|
2922
|
+
children: chain.name
|
|
2923
|
+
}
|
|
2924
|
+
),
|
|
2925
|
+
"."
|
|
2926
|
+
] });
|
|
2927
|
+
}
|
|
2928
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2929
|
+
"Successfully",
|
|
2930
|
+
" ",
|
|
2931
|
+
/* @__PURE__ */ jsx35(
|
|
2932
|
+
"a",
|
|
2933
|
+
{
|
|
2934
|
+
href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
|
|
2935
|
+
target: "_blank",
|
|
2936
|
+
rel: "noreferrer noopener",
|
|
2937
|
+
children: "deposited"
|
|
2938
|
+
}
|
|
2939
|
+
),
|
|
2940
|
+
" ",
|
|
2941
|
+
/* @__PURE__ */ jsx35(Balance, { wei: amount })
|
|
2942
|
+
] });
|
|
2943
|
+
})()
|
|
2944
|
+
}
|
|
2945
|
+
);
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
// src/onboarding/deposit/RelayDepositStatus.tsx
|
|
2949
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
2950
|
+
import { useChains as useChains3 } from "wagmi";
|
|
2951
|
+
import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2952
|
+
function RelayDepositStatus({
|
|
2953
|
+
amount,
|
|
2954
|
+
chainL1Id,
|
|
2955
|
+
chainL2Id,
|
|
2956
|
+
start,
|
|
2957
|
+
estimatedTime,
|
|
2958
|
+
depositPromise,
|
|
2959
|
+
onDismiss
|
|
2960
|
+
}) {
|
|
2961
|
+
const chains = useChains3();
|
|
2962
|
+
const chainL1 = chains.find((chain) => chain.id === chainL1Id);
|
|
2963
|
+
const chainL2 = chains.find((chain) => chain.id === chainL2Id);
|
|
2964
|
+
const deposit = useQuery14({
|
|
2965
|
+
queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
|
|
2966
|
+
queryFn: () => depositPromise
|
|
2967
|
+
});
|
|
2968
|
+
return /* @__PURE__ */ jsx36(
|
|
2969
|
+
DepositStatus,
|
|
2970
|
+
{
|
|
2971
|
+
status: deposit.status,
|
|
2972
|
+
progress: {
|
|
2973
|
+
duration: estimatedTime,
|
|
2974
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2975
|
+
},
|
|
2976
|
+
onDismiss,
|
|
2977
|
+
children: (() => {
|
|
2978
|
+
if (deposit.status === "pending") {
|
|
2979
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2980
|
+
"Relay bridge deposit pending on ",
|
|
2981
|
+
chainL1.name,
|
|
2982
|
+
"\u2026"
|
|
2983
|
+
] });
|
|
2984
|
+
}
|
|
2985
|
+
if (deposit.status === "error") {
|
|
2986
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2987
|
+
"Relay bridge deposit to ",
|
|
2988
|
+
chainL2.name,
|
|
2989
|
+
" failed."
|
|
2990
|
+
] });
|
|
2991
|
+
}
|
|
2992
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2993
|
+
"Successfully bridged ",
|
|
2994
|
+
/* @__PURE__ */ jsx36(Balance, { wei: amount }),
|
|
2995
|
+
" to ",
|
|
2996
|
+
chainL2.name,
|
|
2997
|
+
"!"
|
|
2998
|
+
] });
|
|
2999
|
+
})()
|
|
3000
|
+
}
|
|
3001
|
+
);
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
3005
|
+
import { useAccount as useAccount7, useClient as useClient11 } from "wagmi";
|
|
3006
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3007
|
+
function Deposits() {
|
|
3008
|
+
const queryClient = useQueryClient7();
|
|
3009
|
+
const { chainId } = useEntryKitConfig();
|
|
3010
|
+
const client = useClient11({ chainId });
|
|
3011
|
+
const { address: userAddress } = useAccount7();
|
|
3012
|
+
const { deposits, removeDeposit } = useDeposits();
|
|
3013
|
+
const { data: isComplete } = useQuery15({
|
|
3014
|
+
queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
|
|
3015
|
+
queryFn: async () => {
|
|
3016
|
+
if (!deposits.length) return false;
|
|
3017
|
+
await Promise.all(deposits.map((deposit) => deposit.isComplete));
|
|
3018
|
+
return true;
|
|
3019
|
+
}
|
|
3020
|
+
});
|
|
3021
|
+
useEffect13(() => {
|
|
3022
|
+
if (isComplete) {
|
|
3023
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] });
|
|
3024
|
+
queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
|
|
3025
|
+
}
|
|
3026
|
+
}, [client?.uid, isComplete, queryClient, userAddress]);
|
|
3027
|
+
if (!deposits.length) return null;
|
|
3028
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
|
|
3029
|
+
if (deposit.type === "transfer") {
|
|
3030
|
+
return /* @__PURE__ */ jsx37(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3031
|
+
} else if (deposit.type === "relay") {
|
|
3032
|
+
return /* @__PURE__ */ jsx37(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3033
|
+
}
|
|
3034
|
+
}) });
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
3038
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3039
|
+
function DepositFormContainer() {
|
|
3040
|
+
const { chainId: destinationChainId } = useEntryKitConfig();
|
|
3041
|
+
const chainId = useChainId();
|
|
3042
|
+
const chains = useChains4();
|
|
3043
|
+
const [amount, setAmount] = useState5(void 0);
|
|
3044
|
+
const [sourceChainId, setSourceChainId] = useState5(chainId);
|
|
3045
|
+
const sourceChain = chains.find(({ id }) => id === sourceChainId);
|
|
3046
|
+
return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
|
|
3047
|
+
destinationChainId === sourceChainId ? /* @__PURE__ */ jsx38(
|
|
3048
|
+
DepositViaTransferForm,
|
|
3049
|
+
{
|
|
3050
|
+
amount,
|
|
3051
|
+
setAmount,
|
|
3052
|
+
sourceChain,
|
|
3053
|
+
setSourceChainId
|
|
3054
|
+
}
|
|
3055
|
+
) : /* @__PURE__ */ jsx38(
|
|
3056
|
+
DepositViaRelayForm,
|
|
3057
|
+
{
|
|
3058
|
+
amount,
|
|
3059
|
+
setAmount,
|
|
3060
|
+
sourceChain,
|
|
3061
|
+
setSourceChainId
|
|
3062
|
+
}
|
|
3063
|
+
),
|
|
3064
|
+
/* @__PURE__ */ jsx38(Deposits, {})
|
|
3065
|
+
] });
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
// src/icons/ArrowLeftIcon.tsx
|
|
3069
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3070
|
+
function ArrowLeftIcon(props) {
|
|
3071
|
+
return /* @__PURE__ */ jsx39(IconSVG, { ...props, children: /* @__PURE__ */ jsx39(
|
|
3072
|
+
"path",
|
|
3073
|
+
{
|
|
3074
|
+
d: "M19 12H5M12 19l-7-7 7-7",
|
|
3075
|
+
fill: "none",
|
|
3076
|
+
stroke: "currentColor",
|
|
3077
|
+
strokeWidth: "2",
|
|
3078
|
+
strokeLinecap: "round",
|
|
3079
|
+
strokeLinejoin: "round"
|
|
3080
|
+
}
|
|
3081
|
+
) });
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
3085
|
+
import { useEffect as useEffect14 } from "react";
|
|
3086
|
+
import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
3087
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3088
|
+
function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
|
|
3089
|
+
const queryClient = useQueryClient8();
|
|
3090
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3091
|
+
const prevBalance = usePrevious(balance.data || 0n);
|
|
3092
|
+
useEffect14(() => {
|
|
3093
|
+
if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
|
|
3094
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
3095
|
+
setFocused(false);
|
|
3096
|
+
}
|
|
3097
|
+
}, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
|
|
3098
|
+
if (isFocused) {
|
|
3099
|
+
return /* @__PURE__ */ jsxs23(Fragment7, { children: [
|
|
3100
|
+
isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
|
|
3101
|
+
"div",
|
|
3102
|
+
{
|
|
3103
|
+
className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
|
|
3104
|
+
onClick: () => setFocused(false),
|
|
3105
|
+
children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
|
|
3106
|
+
}
|
|
3107
|
+
) }),
|
|
3108
|
+
/* @__PURE__ */ jsx40(DepositFormContainer, {})
|
|
3109
|
+
] });
|
|
3110
|
+
}
|
|
3111
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4", children: [
|
|
3112
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex justify-between gap-4", children: [
|
|
3113
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
3114
|
+
/* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
|
|
3115
|
+
/* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
|
|
3116
|
+
] }),
|
|
3117
|
+
/* @__PURE__ */ jsx40(
|
|
3118
|
+
Button,
|
|
3119
|
+
{
|
|
3120
|
+
variant: isActive ? "primary" : "tertiary",
|
|
3121
|
+
className: "flex-shrink-0 text-sm p-1 w-28",
|
|
3122
|
+
autoFocus: isActive || isExpanded,
|
|
3123
|
+
pending: balance.status === "pending",
|
|
3124
|
+
onClick: () => setFocused(true),
|
|
3125
|
+
children: "Top up"
|
|
3126
|
+
}
|
|
3127
|
+
)
|
|
3128
|
+
] }),
|
|
3129
|
+
isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
|
|
3130
|
+
] });
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
// src/onboarding/ConnectedSteps.tsx
|
|
3134
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3135
|
+
function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
3136
|
+
const { chain } = useEntryKitConfig();
|
|
3137
|
+
const paymaster = getPaymaster(chain);
|
|
3138
|
+
const [focusedId, setFocusedId] = useState6(null);
|
|
3139
|
+
const userAddress = userClient.account.address;
|
|
3140
|
+
const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
|
|
3141
|
+
useEffect15(() => {
|
|
3142
|
+
if (prerequisitesError) {
|
|
3143
|
+
console.error("Could not get prerequisites", prerequisitesError);
|
|
3144
|
+
}
|
|
3145
|
+
}, [prerequisitesError]);
|
|
3146
|
+
const { closeAccountModal } = useAccountModal();
|
|
3147
|
+
const isNewConnection = userAddress !== initialUserAddress;
|
|
3148
|
+
const initialPrerequisites = useRef4(prerequisites);
|
|
3149
|
+
useEffect15(() => {
|
|
3150
|
+
if (prerequisites == null) return;
|
|
3151
|
+
if (initialPrerequisites.current == null) {
|
|
3152
|
+
initialPrerequisites.current = prerequisites;
|
|
3153
|
+
}
|
|
3154
|
+
if (prerequisites.complete) {
|
|
3155
|
+
if (isNewConnection || !initialPrerequisites.current.complete) {
|
|
3156
|
+
closeAccountModal();
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
}, [closeAccountModal, isNewConnection, prerequisites]);
|
|
3160
|
+
const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
3161
|
+
const steps = useMemo4(() => {
|
|
3162
|
+
if (!userAddress) {
|
|
3163
|
+
return [
|
|
3164
|
+
{
|
|
3165
|
+
id: "wallet",
|
|
3166
|
+
isComplete: false,
|
|
3167
|
+
content: () => null
|
|
3168
|
+
}
|
|
3169
|
+
];
|
|
3170
|
+
}
|
|
3171
|
+
const steps2 = [
|
|
3172
|
+
{
|
|
3173
|
+
id: "wallet",
|
|
3174
|
+
isComplete: true,
|
|
3175
|
+
content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
|
|
3176
|
+
}
|
|
3177
|
+
];
|
|
3178
|
+
if (!paymaster) {
|
|
3179
|
+
if (sessionAddress != null) {
|
|
3180
|
+
steps2.push({
|
|
3181
|
+
id: "gasBalance",
|
|
3182
|
+
isComplete: !!hasGasBalance,
|
|
3183
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
} else if (paymaster.type === "quarry") {
|
|
3187
|
+
if (paymaster.isGasPass) {
|
|
3188
|
+
steps2.push({
|
|
3189
|
+
id: "allowance",
|
|
3190
|
+
isComplete: !!hasAllowance,
|
|
3191
|
+
content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
|
|
3192
|
+
});
|
|
3193
|
+
} else {
|
|
3194
|
+
steps2.push({
|
|
3195
|
+
id: "gasBalanceQuarry",
|
|
3196
|
+
isComplete: !!hasQuarryGasBalance,
|
|
3197
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
|
|
3198
|
+
});
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
steps2.push({
|
|
3202
|
+
id: "session",
|
|
3203
|
+
isComplete: !!isSpender && !!hasDelegation,
|
|
3204
|
+
content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
|
|
3205
|
+
});
|
|
3206
|
+
return steps2;
|
|
3207
|
+
}, [
|
|
3208
|
+
hasAllowance,
|
|
3209
|
+
hasDelegation,
|
|
3210
|
+
hasGasBalance,
|
|
3211
|
+
hasQuarryGasBalance,
|
|
3212
|
+
isSpender,
|
|
3213
|
+
paymaster,
|
|
3214
|
+
sessionAddress,
|
|
3215
|
+
userAddress,
|
|
3216
|
+
userClient
|
|
3217
|
+
]);
|
|
3218
|
+
const [selectedStepId] = useState6(null);
|
|
3219
|
+
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
3220
|
+
const completedSteps = steps.filter((step) => step.isComplete);
|
|
3221
|
+
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
3222
|
+
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
3223
|
+
return /* @__PURE__ */ jsx41(
|
|
3224
|
+
"div",
|
|
3225
|
+
{
|
|
3226
|
+
className: twMerge17(
|
|
3227
|
+
"px-8 flex flex-col",
|
|
3228
|
+
focusedId && "divide-y divide-neutral-800",
|
|
3229
|
+
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
3230
|
+
),
|
|
3231
|
+
children: steps.map((step, i) => {
|
|
3232
|
+
const isActive = step === activeStep;
|
|
3233
|
+
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
3234
|
+
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
3235
|
+
const isFocused = focusedId === step.id;
|
|
3236
|
+
const content = step.content({
|
|
3237
|
+
isActive,
|
|
3238
|
+
isExpanded,
|
|
3239
|
+
isFocused,
|
|
3240
|
+
setFocused: (focused) => setFocusedId(focused ? step.id : null)
|
|
3241
|
+
});
|
|
3242
|
+
if (focusedId) {
|
|
3243
|
+
if (step.id === focusedId) {
|
|
3244
|
+
return content;
|
|
3245
|
+
}
|
|
3246
|
+
return null;
|
|
3247
|
+
}
|
|
3248
|
+
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);
|
|
3249
|
+
})
|
|
3250
|
+
}
|
|
3251
|
+
);
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
// src/AccountModalContent.tsx
|
|
3255
|
+
import { useRef as useRef5 } from "react";
|
|
3256
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3257
|
+
function AccountModalContent() {
|
|
3258
|
+
const { chainId } = useEntryKitConfig();
|
|
3259
|
+
const userClient = useConnectorClient({ chainId });
|
|
3260
|
+
const { address: userAddress } = useAccount8();
|
|
3261
|
+
const initialUserAddress = useRef5(userAddress);
|
|
3262
|
+
if (userClient.status !== "success") {
|
|
3263
|
+
return /* @__PURE__ */ jsx42(ConnectWallet, {});
|
|
3264
|
+
}
|
|
3265
|
+
return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
|
|
3266
|
+
}
|
|
3267
|
+
|
|
2073
3268
|
// src/AccountModal.tsx
|
|
3269
|
+
import { DialogClose } from "@radix-ui/react-dialog";
|
|
2074
3270
|
import { ErrorBoundary } from "react-error-boundary";
|
|
2075
3271
|
|
|
2076
3272
|
// src/errors/ErrorOverlay.tsx
|
|
2077
3273
|
import { wait } from "@latticexyz/common/utils";
|
|
2078
|
-
import { useEffect as
|
|
2079
|
-
import { twMerge as
|
|
2080
|
-
import { Fragment as
|
|
3274
|
+
import { useEffect as useEffect16 } from "react";
|
|
3275
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
3276
|
+
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2081
3277
|
function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
2082
|
-
|
|
3278
|
+
useEffect16(() => {
|
|
2083
3279
|
if (error2) {
|
|
2084
3280
|
console.error(error2);
|
|
2085
3281
|
}
|
|
2086
3282
|
}, [error2]);
|
|
2087
|
-
return /* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
3283
|
+
return /* @__PURE__ */ jsxs24("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
|
|
3284
|
+
/* @__PURE__ */ jsx43(
|
|
2089
3285
|
"div",
|
|
2090
3286
|
{
|
|
2091
|
-
className:
|
|
3287
|
+
className: twMerge18(
|
|
2092
3288
|
"absolute inset-0 bg-blue-700/60",
|
|
2093
3289
|
"transition duration-300",
|
|
2094
3290
|
error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
2095
3291
|
)
|
|
2096
3292
|
}
|
|
2097
3293
|
),
|
|
2098
|
-
/* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ jsx43(
|
|
2099
3295
|
"div",
|
|
2100
3296
|
{
|
|
2101
|
-
className:
|
|
3297
|
+
className: twMerge18(
|
|
2102
3298
|
"absolute inset-0 pb-8",
|
|
2103
3299
|
"transition duration-300",
|
|
2104
3300
|
error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
|
|
2105
3301
|
),
|
|
2106
|
-
children: error2 ? /* @__PURE__ */
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
3302
|
+
children: error2 ? /* @__PURE__ */ jsx43(Fragment8, { children: /* @__PURE__ */ jsxs24("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
|
|
3303
|
+
/* @__PURE__ */ jsxs24("div", { className: "space-y-6 px-8 pt-8", children: [
|
|
3304
|
+
/* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
|
|
3305
|
+
/* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
|
|
3306
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
|
|
2111
3307
|
] }),
|
|
2112
|
-
/* @__PURE__ */
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
retry ? /* @__PURE__ */
|
|
3308
|
+
/* @__PURE__ */ jsxs24("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
|
|
3309
|
+
/* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
|
|
3310
|
+
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs24(
|
|
2115
3311
|
"button",
|
|
2116
3312
|
{
|
|
2117
3313
|
type: "button",
|
|
2118
|
-
className:
|
|
3314
|
+
className: twMerge18(
|
|
2119
3315
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2120
3316
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2121
3317
|
"text-white text-sm font-medium",
|
|
@@ -2130,15 +3326,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2130
3326
|
}
|
|
2131
3327
|
},
|
|
2132
3328
|
children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
3329
|
+
/* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
|
|
3330
|
+
/* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
|
|
2135
3331
|
]
|
|
2136
3332
|
}
|
|
2137
|
-
) }) : dismiss ? /* @__PURE__ */
|
|
3333
|
+
) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
|
|
2138
3334
|
"button",
|
|
2139
3335
|
{
|
|
2140
3336
|
type: "button",
|
|
2141
|
-
className:
|
|
3337
|
+
className: twMerge18(
|
|
2142
3338
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2143
3339
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2144
3340
|
"text-white text-sm font-medium",
|
|
@@ -2156,27 +3352,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2156
3352
|
}
|
|
2157
3353
|
|
|
2158
3354
|
// src/errors/ErrorFallback.tsx
|
|
2159
|
-
import { jsx as
|
|
3355
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2160
3356
|
function ErrorFallback({ error: error2, resetErrorBoundary }) {
|
|
2161
|
-
return /* @__PURE__ */
|
|
3357
|
+
return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
|
|
2162
3358
|
}
|
|
2163
3359
|
|
|
2164
3360
|
// src/errors/ErrorsOverlay.tsx
|
|
2165
|
-
import { useStore as
|
|
2166
|
-
import { jsx as
|
|
3361
|
+
import { useStore as useStore3 } from "zustand";
|
|
3362
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2167
3363
|
function ErrorsOverlay() {
|
|
2168
|
-
const error2 =
|
|
2169
|
-
return /* @__PURE__ */
|
|
3364
|
+
const error2 = useStore3(store3, (state) => state.errors.at(0));
|
|
3365
|
+
return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
|
|
2170
3366
|
}
|
|
2171
3367
|
|
|
2172
3368
|
// src/AccountModal.tsx
|
|
2173
|
-
import { jsx as
|
|
3369
|
+
import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2174
3370
|
function AccountModal() {
|
|
2175
3371
|
const { accountModalOpen, toggleAccountModal } = useAccountModal();
|
|
2176
|
-
return /* @__PURE__ */
|
|
3372
|
+
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs25(
|
|
2177
3373
|
"div",
|
|
2178
3374
|
{
|
|
2179
|
-
className:
|
|
3375
|
+
className: twMerge19(
|
|
2180
3376
|
"relative py-2 ring-1",
|
|
2181
3377
|
"bg-neutral-900 text-neutral-400 ring-neutral-700/50",
|
|
2182
3378
|
"links:font-medium links:underline links:underline-offset-4",
|
|
@@ -2184,11 +3380,11 @@ function AccountModal() {
|
|
|
2184
3380
|
"links:decoration-neutral-500 hover:links:decoration-orange-500"
|
|
2185
3381
|
),
|
|
2186
3382
|
children: [
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
3383
|
+
/* @__PURE__ */ jsxs25(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
|
|
3384
|
+
/* @__PURE__ */ jsx46(AccountModalContent, {}),
|
|
3385
|
+
/* @__PURE__ */ jsx46(ErrorsOverlay, {})
|
|
2190
3386
|
] }),
|
|
2191
|
-
/* @__PURE__ */
|
|
3387
|
+
/* @__PURE__ */ jsxs25(
|
|
2192
3388
|
"a",
|
|
2193
3389
|
{
|
|
2194
3390
|
href: "https://mud.dev",
|
|
@@ -2196,20 +3392,20 @@ function AccountModal() {
|
|
|
2196
3392
|
rel: "noreferrer noopener",
|
|
2197
3393
|
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",
|
|
2198
3394
|
children: [
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
3395
|
+
/* @__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" }) }),
|
|
3396
|
+
/* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
|
|
2201
3397
|
]
|
|
2202
3398
|
}
|
|
2203
3399
|
),
|
|
2204
|
-
/* @__PURE__ */
|
|
3400
|
+
/* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
|
|
2205
3401
|
DialogClose,
|
|
2206
3402
|
{
|
|
2207
|
-
className:
|
|
3403
|
+
className: twMerge19(
|
|
2208
3404
|
"pointer-events-auto leading-none p-2 transition",
|
|
2209
3405
|
"text-white/20 hover:text-white/40"
|
|
2210
3406
|
),
|
|
2211
3407
|
title: "Close",
|
|
2212
|
-
children: /* @__PURE__ */
|
|
3408
|
+
children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
|
|
2213
3409
|
}
|
|
2214
3410
|
) })
|
|
2215
3411
|
]
|
|
@@ -2218,31 +3414,31 @@ function AccountModal() {
|
|
|
2218
3414
|
}
|
|
2219
3415
|
|
|
2220
3416
|
// src/EntryKitProvider.tsx
|
|
2221
|
-
import { jsx as
|
|
3417
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2222
3418
|
function EntryKitProvider({ config, children }) {
|
|
2223
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ jsxs26(EntryKitConfigProvider, { config, children: [
|
|
2224
3420
|
children,
|
|
2225
|
-
/* @__PURE__ */
|
|
3421
|
+
/* @__PURE__ */ jsx47(AccountModal, {})
|
|
2226
3422
|
] });
|
|
2227
3423
|
}
|
|
2228
3424
|
|
|
2229
3425
|
// src/AccountButton.tsx
|
|
2230
|
-
import { useAccount as
|
|
2231
|
-
import { twMerge as
|
|
3426
|
+
import { useAccount as useAccount9 } from "wagmi";
|
|
3427
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
2232
3428
|
|
|
2233
3429
|
// src/AccountName.tsx
|
|
2234
|
-
import { twMerge as
|
|
2235
|
-
import { Fragment as
|
|
3430
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
3431
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2236
3432
|
function AccountName({ address }) {
|
|
2237
3433
|
const { data: ens } = useENS(address);
|
|
2238
3434
|
const avatar = usePreloadImage(ens?.avatar);
|
|
2239
|
-
return /* @__PURE__ */
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ jsxs27(Fragment9, { children: [
|
|
3436
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
|
|
3437
|
+
/* @__PURE__ */ jsx48(
|
|
2242
3438
|
"img",
|
|
2243
3439
|
{
|
|
2244
3440
|
src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
|
|
2245
|
-
className:
|
|
3441
|
+
className: twMerge20(
|
|
2246
3442
|
"col-start-1 row-start-1",
|
|
2247
3443
|
"inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
|
|
2248
3444
|
"transtion duration-300",
|
|
@@ -2250,10 +3446,10 @@ function AccountName({ address }) {
|
|
|
2250
3446
|
)
|
|
2251
3447
|
}
|
|
2252
3448
|
),
|
|
2253
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ jsx48(
|
|
2254
3450
|
Logo,
|
|
2255
3451
|
{
|
|
2256
|
-
className:
|
|
3452
|
+
className: twMerge20(
|
|
2257
3453
|
"col-start-1 row-start-1 text-orange-500",
|
|
2258
3454
|
"transition duration-300",
|
|
2259
3455
|
ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
|
|
@@ -2261,29 +3457,29 @@ function AccountName({ address }) {
|
|
|
2261
3457
|
}
|
|
2262
3458
|
)
|
|
2263
3459
|
] }),
|
|
2264
|
-
/* @__PURE__ */
|
|
3460
|
+
/* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
|
|
2265
3461
|
] });
|
|
2266
3462
|
}
|
|
2267
3463
|
|
|
2268
3464
|
// src/AccountButton.tsx
|
|
2269
|
-
import { useRef as
|
|
2270
|
-
import { jsx as
|
|
2271
|
-
var containerClassNames =
|
|
3465
|
+
import { useRef as useRef6 } from "react";
|
|
3466
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3467
|
+
var containerClassNames = twMerge21(
|
|
2272
3468
|
"w-48 p-3 inline-flex outline-none transition",
|
|
2273
3469
|
"border border-transparent",
|
|
2274
3470
|
"text-base leading-none"
|
|
2275
3471
|
);
|
|
2276
|
-
var secondaryClassNames =
|
|
3472
|
+
var secondaryClassNames = twMerge21(
|
|
2277
3473
|
"bg-neutral-100 border-neutral-300 text-black",
|
|
2278
3474
|
"dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
|
|
2279
3475
|
);
|
|
2280
|
-
var secondaryInteractiveClassNames =
|
|
3476
|
+
var secondaryInteractiveClassNames = twMerge21(
|
|
2281
3477
|
"cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
|
|
2282
3478
|
);
|
|
2283
3479
|
function AccountButton() {
|
|
2284
3480
|
const { openAccountModal, accountModalOpen } = useAccountModal();
|
|
2285
|
-
const { status, address: userAddress } =
|
|
2286
|
-
const initialUserAddress =
|
|
3481
|
+
const { status, address: userAddress } = useAccount9();
|
|
3482
|
+
const initialUserAddress = useRef6(userAddress);
|
|
2287
3483
|
const prereqs = usePrerequisites(userAddress);
|
|
2288
3484
|
const isConnected = status === "connected" || status === "reconnecting" && userAddress;
|
|
2289
3485
|
const isNewConnection = userAddress !== initialUserAddress.current;
|
|
@@ -2295,20 +3491,20 @@ function AccountButton() {
|
|
|
2295
3491
|
}
|
|
2296
3492
|
return "Sign in";
|
|
2297
3493
|
})();
|
|
2298
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
|
|
2299
3495
|
"button",
|
|
2300
3496
|
{
|
|
2301
3497
|
type: "button",
|
|
2302
|
-
className:
|
|
3498
|
+
className: twMerge21(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
|
|
2303
3499
|
onClick: openAccountModal,
|
|
2304
|
-
children: /* @__PURE__ */
|
|
3500
|
+
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 })
|
|
2305
3501
|
},
|
|
2306
3502
|
"connected"
|
|
2307
|
-
) : /* @__PURE__ */
|
|
3503
|
+
) : /* @__PURE__ */ jsxs28(
|
|
2308
3504
|
"button",
|
|
2309
3505
|
{
|
|
2310
3506
|
type: "button",
|
|
2311
|
-
className:
|
|
3507
|
+
className: twMerge21(
|
|
2312
3508
|
containerClassNames,
|
|
2313
3509
|
"group",
|
|
2314
3510
|
"items-center justify-center gap-2.5",
|
|
@@ -2319,32 +3515,32 @@ function AccountButton() {
|
|
|
2319
3515
|
"aria-busy": accountModalOpen,
|
|
2320
3516
|
onClick: openAccountModal,
|
|
2321
3517
|
children: [
|
|
2322
|
-
/* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ jsxs28("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
|
|
3519
|
+
/* @__PURE__ */ jsx49(
|
|
2324
3520
|
"span",
|
|
2325
3521
|
{
|
|
2326
|
-
className:
|
|
3522
|
+
className: twMerge21(
|
|
2327
3523
|
"col-start-1 row-start-1 leading-none",
|
|
2328
3524
|
"scale-100 opacity-100 transition duration-300",
|
|
2329
3525
|
"group-aria-busy:scale-125 group-aria-busy:opacity-0"
|
|
2330
3526
|
),
|
|
2331
|
-
children: /* @__PURE__ */
|
|
3527
|
+
children: /* @__PURE__ */ jsx49(Logo, {})
|
|
2332
3528
|
}
|
|
2333
3529
|
),
|
|
2334
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx49(
|
|
2335
3531
|
"span",
|
|
2336
3532
|
{
|
|
2337
3533
|
"aria-hidden": true,
|
|
2338
|
-
className:
|
|
3534
|
+
className: twMerge21(
|
|
2339
3535
|
"col-start-1 row-start-1",
|
|
2340
3536
|
"scale-50 opacity-0 transition duration-300 delay-50",
|
|
2341
3537
|
"group-aria-busy:scale-100 group-aria-busy:opacity-100"
|
|
2342
3538
|
),
|
|
2343
|
-
children: /* @__PURE__ */
|
|
3539
|
+
children: /* @__PURE__ */ jsx49(PendingIcon, {})
|
|
2344
3540
|
}
|
|
2345
3541
|
)
|
|
2346
3542
|
] }),
|
|
2347
|
-
/* @__PURE__ */
|
|
3543
|
+
/* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
|
|
2348
3544
|
]
|
|
2349
3545
|
},
|
|
2350
3546
|
"sign in"
|