@latticexyz/entrykit 2.2.12-entrykit-8af96e16f9faceae4ab53d09a2c9cdaf89f7403b → 2.2.12-entrykit-d8d9d97f36d81ff2e175f0f61d51c996f7fb70ef
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/internal.js +124 -242
- package/dist/tsup/internal.js.map +1 -1
- package/package.json +8 -8
package/dist/tsup/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Root as
|
|
1
|
+
import{Root as qt,DialogPortal as Yt,DialogContent as Xt}from"@radix-ui/react-dialog";import{forwardRef as Bt,useEffect as Ft,useRef as Te,useState as Re}from"react";import Wt from"react-dom";var ke=`*, ::before, ::after {
|
|
2
2
|
--tw-border-spacing-x: 0;
|
|
3
3
|
--tw-border-spacing-y: 0;
|
|
4
4
|
--tw-translate-x: 0;
|
|
@@ -532,6 +532,11 @@ video {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
+
.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {
|
|
536
|
+
border-top-width: 0;
|
|
537
|
+
border-bottom-width: 0;
|
|
538
|
+
}
|
|
539
|
+
|
|
535
540
|
.sr-only {
|
|
536
541
|
position: absolute;
|
|
537
542
|
width: 1px;
|
|
@@ -602,16 +607,16 @@ video {
|
|
|
602
607
|
margin-bottom: -0.25rem;
|
|
603
608
|
}
|
|
604
609
|
|
|
605
|
-
.-my-2\\.5 {
|
|
606
|
-
margin-top: -0.625rem;
|
|
607
|
-
margin-bottom: -0.625rem;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
610
|
.-my-\\[0\\.125em\\] {
|
|
611
611
|
margin-top: -0.125em;
|
|
612
612
|
margin-bottom: -0.125em;
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
+
.mx-auto {
|
|
616
|
+
margin-left: auto;
|
|
617
|
+
margin-right: auto;
|
|
618
|
+
}
|
|
619
|
+
|
|
615
620
|
.-ml-3 {
|
|
616
621
|
margin-left: -0.75rem;
|
|
617
622
|
}
|
|
@@ -652,10 +657,6 @@ video {
|
|
|
652
657
|
height: 4rem;
|
|
653
658
|
}
|
|
654
659
|
|
|
655
|
-
.h-2\\.5 {
|
|
656
|
-
height: 0.625rem;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
660
|
.h-4 {
|
|
660
661
|
height: 1rem;
|
|
661
662
|
}
|
|
@@ -680,22 +681,26 @@ video {
|
|
|
680
681
|
max-height: 8rem;
|
|
681
682
|
}
|
|
682
683
|
|
|
683
|
-
.min-h-\\[
|
|
684
|
-
min-height:
|
|
684
|
+
.min-h-\\[28rem\\] {
|
|
685
|
+
min-height: 28rem;
|
|
685
686
|
}
|
|
686
687
|
|
|
687
688
|
.w-16 {
|
|
688
689
|
width: 4rem;
|
|
689
690
|
}
|
|
690
691
|
|
|
691
|
-
.w-
|
|
692
|
-
width:
|
|
692
|
+
.w-28 {
|
|
693
|
+
width: 7rem;
|
|
693
694
|
}
|
|
694
695
|
|
|
695
696
|
.w-4 {
|
|
696
697
|
width: 1rem;
|
|
697
698
|
}
|
|
698
699
|
|
|
700
|
+
.w-48 {
|
|
701
|
+
width: 12rem;
|
|
702
|
+
}
|
|
703
|
+
|
|
699
704
|
.w-6 {
|
|
700
705
|
width: 1.5rem;
|
|
701
706
|
}
|
|
@@ -716,6 +721,10 @@ video {
|
|
|
716
721
|
width: 100%;
|
|
717
722
|
}
|
|
718
723
|
|
|
724
|
+
.max-w-\\[26rem\\] {
|
|
725
|
+
max-width: 26rem;
|
|
726
|
+
}
|
|
727
|
+
|
|
719
728
|
.flex-shrink-0 {
|
|
720
729
|
flex-shrink: 0;
|
|
721
730
|
}
|
|
@@ -764,14 +773,14 @@ video {
|
|
|
764
773
|
flex-direction: column;
|
|
765
774
|
}
|
|
766
775
|
|
|
767
|
-
.place-items-end {
|
|
768
|
-
place-items: end;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
776
|
.place-items-center {
|
|
772
777
|
place-items: center;
|
|
773
778
|
}
|
|
774
779
|
|
|
780
|
+
.items-end {
|
|
781
|
+
align-items: flex-end;
|
|
782
|
+
}
|
|
783
|
+
|
|
775
784
|
.items-center {
|
|
776
785
|
align-items: center;
|
|
777
786
|
}
|
|
@@ -784,12 +793,12 @@ video {
|
|
|
784
793
|
justify-content: center;
|
|
785
794
|
}
|
|
786
795
|
|
|
787
|
-
.
|
|
788
|
-
|
|
796
|
+
.justify-between {
|
|
797
|
+
justify-content: space-between;
|
|
789
798
|
}
|
|
790
799
|
|
|
791
|
-
.gap-1
|
|
792
|
-
gap: 0.
|
|
800
|
+
.gap-1 {
|
|
801
|
+
gap: 0.25rem;
|
|
793
802
|
}
|
|
794
803
|
|
|
795
804
|
.gap-2 {
|
|
@@ -800,6 +809,10 @@ video {
|
|
|
800
809
|
gap: 0.625rem;
|
|
801
810
|
}
|
|
802
811
|
|
|
812
|
+
.gap-4 {
|
|
813
|
+
gap: 1rem;
|
|
814
|
+
}
|
|
815
|
+
|
|
803
816
|
.gap-5 {
|
|
804
817
|
gap: 1.25rem;
|
|
805
818
|
}
|
|
@@ -808,18 +821,24 @@ video {
|
|
|
808
821
|
gap: 1.5rem;
|
|
809
822
|
}
|
|
810
823
|
|
|
811
|
-
.
|
|
812
|
-
--tw-
|
|
813
|
-
|
|
814
|
-
|
|
824
|
+
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
|
825
|
+
--tw-divide-y-reverse: 0;
|
|
826
|
+
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
|
827
|
+
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
|
815
828
|
}
|
|
816
829
|
|
|
817
|
-
.
|
|
818
|
-
|
|
830
|
+
.divide-neutral-700 > :not([hidden]) ~ :not([hidden]) {
|
|
831
|
+
--tw-divide-opacity: 1;
|
|
832
|
+
border-color: rgb(64 64 64 / var(--tw-divide-opacity));
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {
|
|
836
|
+
--tw-divide-opacity: 1;
|
|
837
|
+
border-color: rgb(38 38 38 / var(--tw-divide-opacity));
|
|
819
838
|
}
|
|
820
839
|
|
|
821
|
-
.self-
|
|
822
|
-
align-self:
|
|
840
|
+
.self-auto {
|
|
841
|
+
align-self: auto;
|
|
823
842
|
}
|
|
824
843
|
|
|
825
844
|
.self-end {
|
|
@@ -830,14 +849,6 @@ video {
|
|
|
830
849
|
align-self: center;
|
|
831
850
|
}
|
|
832
851
|
|
|
833
|
-
.self-stretch {
|
|
834
|
-
align-self: stretch;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
.overflow-y-auto {
|
|
838
|
-
overflow-y: auto;
|
|
839
|
-
}
|
|
840
|
-
|
|
841
852
|
.overflow-y-scroll {
|
|
842
853
|
overflow-y: scroll;
|
|
843
854
|
}
|
|
@@ -858,12 +869,12 @@ video {
|
|
|
858
869
|
border-width: 1px;
|
|
859
870
|
}
|
|
860
871
|
|
|
861
|
-
.border-
|
|
862
|
-
border-
|
|
872
|
+
.border-4 {
|
|
873
|
+
border-width: 4px;
|
|
863
874
|
}
|
|
864
875
|
|
|
865
|
-
.border-
|
|
866
|
-
border-
|
|
876
|
+
.border-l-4 {
|
|
877
|
+
border-left-width: 4px;
|
|
867
878
|
}
|
|
868
879
|
|
|
869
880
|
.border-neutral-300 {
|
|
@@ -871,11 +882,6 @@ video {
|
|
|
871
882
|
border-color: rgb(212 212 212 / var(--tw-border-opacity));
|
|
872
883
|
}
|
|
873
884
|
|
|
874
|
-
.border-neutral-400 {
|
|
875
|
-
--tw-border-opacity: 1;
|
|
876
|
-
border-color: rgb(163 163 163 / var(--tw-border-opacity));
|
|
877
|
-
}
|
|
878
|
-
|
|
879
885
|
.border-red-500 {
|
|
880
886
|
--tw-border-opacity: 1;
|
|
881
887
|
border-color: rgb(239 68 68 / var(--tw-border-opacity));
|
|
@@ -885,27 +891,27 @@ video {
|
|
|
885
891
|
border-color: transparent;
|
|
886
892
|
}
|
|
887
893
|
|
|
888
|
-
.bg-amber-700 {
|
|
889
|
-
--tw-bg-opacity: 1;
|
|
890
|
-
background-color: rgb(180 83 9 / var(--tw-bg-opacity));
|
|
891
|
-
}
|
|
892
|
-
|
|
893
894
|
.bg-black\\/10 {
|
|
894
895
|
background-color: rgb(0 0 0 / 0.1);
|
|
895
896
|
}
|
|
896
897
|
|
|
897
|
-
.bg-
|
|
898
|
+
.bg-neutral-100 {
|
|
899
|
+
--tw-bg-opacity: 1;
|
|
900
|
+
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.bg-neutral-700 {
|
|
898
904
|
--tw-bg-opacity: 1;
|
|
899
|
-
background-color: rgb(
|
|
905
|
+
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
900
906
|
}
|
|
901
907
|
|
|
902
|
-
.bg-neutral-
|
|
908
|
+
.bg-neutral-800 {
|
|
903
909
|
--tw-bg-opacity: 1;
|
|
904
|
-
background-color: rgb(
|
|
910
|
+
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
|
905
911
|
}
|
|
906
912
|
|
|
907
|
-
.bg-neutral-
|
|
908
|
-
background-color: rgb(
|
|
913
|
+
.bg-neutral-800\\/85 {
|
|
914
|
+
background-color: rgb(38 38 38 / 0.85);
|
|
909
915
|
}
|
|
910
916
|
|
|
911
917
|
.bg-neutral-900 {
|
|
@@ -923,6 +929,11 @@ video {
|
|
|
923
929
|
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
|
|
924
930
|
}
|
|
925
931
|
|
|
932
|
+
.bg-red-800 {
|
|
933
|
+
--tw-bg-opacity: 1;
|
|
934
|
+
background-color: rgb(153 27 27 / var(--tw-bg-opacity));
|
|
935
|
+
}
|
|
936
|
+
|
|
926
937
|
.bg-white {
|
|
927
938
|
--tw-bg-opacity: 1;
|
|
928
939
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
@@ -972,8 +983,8 @@ video {
|
|
|
972
983
|
padding: 1.5rem;
|
|
973
984
|
}
|
|
974
985
|
|
|
975
|
-
.p-\\[
|
|
976
|
-
padding:
|
|
986
|
+
.p-\\[\\.75em\\] {
|
|
987
|
+
padding: .75em;
|
|
977
988
|
}
|
|
978
989
|
|
|
979
990
|
.px-3 {
|
|
@@ -986,9 +997,14 @@ video {
|
|
|
986
997
|
padding-right: 1.25rem;
|
|
987
998
|
}
|
|
988
999
|
|
|
989
|
-
.
|
|
990
|
-
padding-
|
|
991
|
-
padding-
|
|
1000
|
+
.px-8 {
|
|
1001
|
+
padding-left: 2rem;
|
|
1002
|
+
padding-right: 2rem;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
.py-8 {
|
|
1006
|
+
padding-top: 2rem;
|
|
1007
|
+
padding-bottom: 2rem;
|
|
992
1008
|
}
|
|
993
1009
|
|
|
994
1010
|
.pb-5 {
|
|
@@ -999,6 +1015,10 @@ video {
|
|
|
999
1015
|
text-align: left;
|
|
1000
1016
|
}
|
|
1001
1017
|
|
|
1018
|
+
.text-center {
|
|
1019
|
+
text-align: center;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1002
1022
|
.font-mono {
|
|
1003
1023
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
1004
1024
|
}
|
|
@@ -1073,11 +1093,6 @@ video {
|
|
|
1073
1093
|
color: rgb(249 115 22 / var(--tw-text-opacity));
|
|
1074
1094
|
}
|
|
1075
1095
|
|
|
1076
|
-
.text-red-700 {
|
|
1077
|
-
--tw-text-opacity: 1;
|
|
1078
|
-
color: rgb(185 28 28 / var(--tw-text-opacity));
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
1096
|
.text-red-900 {
|
|
1082
1097
|
--tw-text-opacity: 1;
|
|
1083
1098
|
color: rgb(127 29 29 / var(--tw-text-opacity));
|
|
@@ -1113,20 +1128,20 @@ video {
|
|
|
1113
1128
|
outline-offset: 2px;
|
|
1114
1129
|
}
|
|
1115
1130
|
|
|
1116
|
-
.ring-
|
|
1131
|
+
.ring-1 {
|
|
1117
1132
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1118
|
-
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(
|
|
1133
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1119
1134
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1120
1135
|
}
|
|
1121
1136
|
|
|
1122
|
-
.ring-
|
|
1137
|
+
.ring-2 {
|
|
1123
1138
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1124
|
-
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(
|
|
1139
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1125
1140
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1126
1141
|
}
|
|
1127
1142
|
|
|
1128
|
-
.ring-
|
|
1129
|
-
--tw-ring-color: rgb(
|
|
1143
|
+
.ring-neutral-700\\/50 {
|
|
1144
|
+
--tw-ring-color: rgb(64 64 64 / 0.5);
|
|
1130
1145
|
}
|
|
1131
1146
|
|
|
1132
1147
|
.ring-transparent {
|
|
@@ -1145,6 +1160,12 @@ video {
|
|
|
1145
1160
|
transition-duration: 150ms;
|
|
1146
1161
|
}
|
|
1147
1162
|
|
|
1163
|
+
.transition-all {
|
|
1164
|
+
transition-property: all;
|
|
1165
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1166
|
+
transition-duration: 150ms;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1148
1169
|
.duration-100 {
|
|
1149
1170
|
transition-duration: 100ms;
|
|
1150
1171
|
}
|
|
@@ -1183,8 +1204,8 @@ video {
|
|
|
1183
1204
|
--tw-enter-opacity: 0;
|
|
1184
1205
|
}
|
|
1185
1206
|
|
|
1186
|
-
.slide-in-from-bottom-
|
|
1187
|
-
--tw-enter-translate-y:
|
|
1207
|
+
.slide-in-from-bottom-8 {
|
|
1208
|
+
--tw-enter-translate-y: 2rem;
|
|
1188
1209
|
}
|
|
1189
1210
|
|
|
1190
1211
|
.slide-in-from-left-2 {
|
|
@@ -1195,8 +1216,8 @@ video {
|
|
|
1195
1216
|
animation-duration: 200ms;
|
|
1196
1217
|
}
|
|
1197
1218
|
|
|
1198
|
-
.animate-duration-
|
|
1199
|
-
animation-duration:
|
|
1219
|
+
.animate-duration-300 {
|
|
1220
|
+
animation-duration: 300ms;
|
|
1200
1221
|
}
|
|
1201
1222
|
|
|
1202
1223
|
@property --tw-border-gradient-angle {
|
|
@@ -1243,53 +1264,34 @@ video {
|
|
|
1243
1264
|
--tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity));
|
|
1244
1265
|
}
|
|
1245
1266
|
|
|
1246
|
-
.hover\\:border-neutral-500:hover {
|
|
1247
|
-
--tw-border-opacity: 1;
|
|
1248
|
-
border-color: rgb(115 115 115 / var(--tw-border-opacity));
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
1267
|
.hover\\:bg-neutral-200:hover {
|
|
1252
1268
|
--tw-bg-opacity: 1;
|
|
1253
1269
|
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
|
1254
1270
|
}
|
|
1255
1271
|
|
|
1256
|
-
.hover\\:bg-neutral-700:hover {
|
|
1257
|
-
--tw-bg-opacity: 1;
|
|
1258
|
-
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
1272
|
.hover\\:bg-orange-400:hover {
|
|
1262
1273
|
--tw-bg-opacity: 1;
|
|
1263
1274
|
background-color: rgb(251 146 60 / var(--tw-bg-opacity));
|
|
1264
1275
|
}
|
|
1265
1276
|
|
|
1266
|
-
.hover\\:text-neutral-
|
|
1277
|
+
.hover\\:text-neutral-500:hover {
|
|
1267
1278
|
--tw-text-opacity: 1;
|
|
1268
|
-
color: rgb(
|
|
1279
|
+
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1269
1280
|
}
|
|
1270
1281
|
|
|
1271
|
-
.
|
|
1272
|
-
|
|
1282
|
+
.hover\\:text-white:hover {
|
|
1283
|
+
--tw-text-opacity: 1;
|
|
1284
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1273
1285
|
}
|
|
1274
1286
|
|
|
1275
|
-
.
|
|
1276
|
-
--tw-
|
|
1277
|
-
--tw-
|
|
1287
|
+
.hover\\:brightness-125:hover {
|
|
1288
|
+
--tw-brightness: brightness(1.25);
|
|
1289
|
+
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);
|
|
1278
1290
|
}
|
|
1279
1291
|
|
|
1280
|
-
.
|
|
1292
|
+
.focus\\:border-orange-500:focus {
|
|
1281
1293
|
--tw-border-opacity: 1;
|
|
1282
|
-
border-color: rgb(
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
.active\\:bg-neutral-300:active {
|
|
1286
|
-
--tw-bg-opacity: 1;
|
|
1287
|
-
background-color: rgb(212 212 212 / var(--tw-bg-opacity));
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
.active\\:bg-neutral-600:active {
|
|
1291
|
-
--tw-bg-opacity: 1;
|
|
1292
|
-
background-color: rgb(82 82 82 / var(--tw-bg-opacity));
|
|
1294
|
+
border-color: rgb(249 115 22 / var(--tw-border-opacity));
|
|
1293
1295
|
}
|
|
1294
1296
|
|
|
1295
1297
|
.active\\:bg-orange-600:active {
|
|
@@ -1297,11 +1299,16 @@ video {
|
|
|
1297
1299
|
background-color: rgb(234 88 12 / var(--tw-bg-opacity));
|
|
1298
1300
|
}
|
|
1299
1301
|
|
|
1300
|
-
.
|
|
1301
|
-
--tw-brightness: brightness(1.
|
|
1302
|
+
.active\\:brightness-150:active {
|
|
1303
|
+
--tw-brightness: brightness(1.5);
|
|
1302
1304
|
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);
|
|
1303
1305
|
}
|
|
1304
1306
|
|
|
1307
|
+
.group:hover .group-hover\\:rotate-90 {
|
|
1308
|
+
--tw-rotate: 90deg;
|
|
1309
|
+
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));
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1305
1312
|
.group:hover .group-hover\\:text-black {
|
|
1306
1313
|
--tw-text-opacity: 1;
|
|
1307
1314
|
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
@@ -1320,21 +1327,6 @@ video {
|
|
|
1320
1327
|
pointer-events: none;
|
|
1321
1328
|
}
|
|
1322
1329
|
|
|
1323
|
-
.aria-disabled\\:border-neutral-300[aria-disabled="true"] {
|
|
1324
|
-
--tw-border-opacity: 1;
|
|
1325
|
-
border-color: rgb(212 212 212 / var(--tw-border-opacity));
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
.aria-disabled\\:bg-neutral-200[aria-disabled="true"] {
|
|
1329
|
-
--tw-bg-opacity: 1;
|
|
1330
|
-
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
.aria-disabled\\:text-neutral-400[aria-disabled="true"] {
|
|
1334
|
-
--tw-text-opacity: 1;
|
|
1335
|
-
color: rgb(163 163 163 / var(--tw-text-opacity));
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
1330
|
.group[aria-busy="true"] .group-aria-busy\\:translate-x-0 {
|
|
1339
1331
|
--tw-translate-x: 0px;
|
|
1340
1332
|
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));
|
|
@@ -1373,17 +1365,17 @@ video {
|
|
|
1373
1365
|
font-weight: 500;
|
|
1374
1366
|
}
|
|
1375
1367
|
|
|
1376
|
-
.links\\:text-
|
|
1368
|
+
.links\\:text-white a[href]:not(.links-unset) {
|
|
1377
1369
|
--tw-text-opacity: 1;
|
|
1378
|
-
color: rgb(
|
|
1370
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1379
1371
|
}
|
|
1380
1372
|
|
|
1381
1373
|
.links\\:underline a[href]:not(.links-unset) {
|
|
1382
1374
|
text-decoration-line: underline;
|
|
1383
1375
|
}
|
|
1384
1376
|
|
|
1385
|
-
.links\\:decoration-neutral-
|
|
1386
|
-
text-decoration-color: #
|
|
1377
|
+
.links\\:decoration-neutral-500 a[href]:not(.links-unset) {
|
|
1378
|
+
text-decoration-color: #737373;
|
|
1387
1379
|
}
|
|
1388
1380
|
|
|
1389
1381
|
.links\\:underline-offset-4 a[href]:not(.links-unset) {
|
|
@@ -1396,31 +1388,9 @@ video {
|
|
|
1396
1388
|
|
|
1397
1389
|
@media (min-width: 640px) {
|
|
1398
1390
|
|
|
1399
|
-
.sm\\:
|
|
1400
|
-
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
.sm\\:place-items-center {
|
|
1404
|
-
place-items: center;
|
|
1391
|
+
.sm\\:items-center {
|
|
1392
|
+
align-items: center;
|
|
1405
1393
|
}
|
|
1406
|
-
|
|
1407
|
-
.sm\\:self-start {
|
|
1408
|
-
align-self: flex-start;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
.sm\\:border {
|
|
1412
|
-
border-width: 1px;
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
.dark\\:divide-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) > :not([hidden]) ~ :not([hidden]) {
|
|
1417
|
-
--tw-divide-opacity: 1;
|
|
1418
|
-
border-color: rgb(64 64 64 / var(--tw-divide-opacity));
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
.dark\\:border-neutral-400:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1422
|
-
--tw-border-opacity: 1;
|
|
1423
|
-
border-color: rgb(163 163 163 / var(--tw-border-opacity));
|
|
1424
1394
|
}
|
|
1425
1395
|
|
|
1426
1396
|
.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
@@ -1428,16 +1398,6 @@ video {
|
|
|
1428
1398
|
border-color: rgb(64 64 64 / var(--tw-border-opacity));
|
|
1429
1399
|
}
|
|
1430
1400
|
|
|
1431
|
-
.dark\\:bg-neutral-100:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1432
|
-
--tw-bg-opacity: 1;
|
|
1433
|
-
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
.dark\\:bg-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1437
|
-
--tw-bg-opacity: 1;
|
|
1438
|
-
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
1401
|
.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1442
1402
|
--tw-bg-opacity: 1;
|
|
1443
1403
|
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
|
@@ -1448,10 +1408,6 @@ video {
|
|
|
1448
1408
|
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
|
|
1449
1409
|
}
|
|
1450
1410
|
|
|
1451
|
-
.dark\\:bg-neutral-900\\/75:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1452
|
-
background-color: rgb(23 23 23 / 0.75);
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
1411
|
.dark\\:bg-red-900:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1456
1412
|
--tw-bg-opacity: 1;
|
|
1457
1413
|
background-color: rgb(127 29 29 / var(--tw-bg-opacity));
|
|
@@ -1461,26 +1417,11 @@ video {
|
|
|
1461
1417
|
background-color: rgb(255 255 255 / 0.1);
|
|
1462
1418
|
}
|
|
1463
1419
|
|
|
1464
|
-
.dark\\:text-black:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1465
|
-
--tw-text-opacity: 1;
|
|
1466
|
-
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
.dark\\:text-neutral-300:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1470
|
-
--tw-text-opacity: 1;
|
|
1471
|
-
color: rgb(212 212 212 / var(--tw-text-opacity));
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
1420
|
.dark\\:text-neutral-400:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1475
1421
|
--tw-text-opacity: 1;
|
|
1476
1422
|
color: rgb(163 163 163 / var(--tw-text-opacity));
|
|
1477
1423
|
}
|
|
1478
1424
|
|
|
1479
|
-
.dark\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1480
|
-
--tw-text-opacity: 1;
|
|
1481
|
-
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
1425
|
.dark\\:text-red-50:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1485
1426
|
--tw-text-opacity: 1;
|
|
1486
1427
|
color: rgb(254 242 242 / var(--tw-text-opacity));
|
|
@@ -1496,75 +1437,16 @@ video {
|
|
|
1496
1437
|
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1497
1438
|
}
|
|
1498
1439
|
|
|
1499
|
-
.dark\\:hover\\:border-neutral-300:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1500
|
-
--tw-border-opacity: 1;
|
|
1501
|
-
border-color: rgb(212 212 212 / var(--tw-border-opacity));
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
.dark\\:hover\\:bg-neutral-200:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1505
|
-
--tw-bg-opacity: 1;
|
|
1506
|
-
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
1440
|
.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1510
1441
|
--tw-bg-opacity: 1;
|
|
1511
1442
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
1512
1443
|
}
|
|
1513
1444
|
|
|
1514
|
-
.dark\\:hover\\:text-neutral-400:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1515
|
-
--tw-text-opacity: 1;
|
|
1516
|
-
color: rgb(163 163 163 / var(--tw-text-opacity));
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
.dark\\:active\\:border-neutral-200:active:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1520
|
-
--tw-border-opacity: 1;
|
|
1521
|
-
border-color: rgb(229 229 229 / var(--tw-border-opacity));
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
.dark\\:active\\:bg-neutral-300:active:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1525
|
-
--tw-bg-opacity: 1;
|
|
1526
|
-
background-color: rgb(212 212 212 / var(--tw-bg-opacity));
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
.dark\\:active\\:bg-neutral-600:active:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1530
|
-
--tw-bg-opacity: 1;
|
|
1531
|
-
background-color: rgb(82 82 82 / var(--tw-bg-opacity));
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
1445
|
.group:hover .dark\\:group-hover\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1535
1446
|
--tw-text-opacity: 1;
|
|
1536
1447
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1537
1448
|
}
|
|
1449
|
+
`;import{useResizeObserver as Ut}from"usehooks-ts";import{mergeRefs as Gt}from"react-merge-refs";import{createContext as Tt,useContext as Ot}from"react";import{jsx as zt}from"react/jsx-runtime";var Ae=Tt(null);function Se({frame:e,children:t}){if(Ot(Ae))throw new Error("`FrameProvider` can only be used once.");return zt(Ae.Provider,{value:{frame:e},children:t})}import{useMediaQuery as Lt}from"usehooks-ts";import"@rainbow-me/rainbowkit/styles.css";import{createContext as Dt,useContext as Ne}from"react";import{RainbowKitProvider as Kt,lightTheme as Pe,midnightTheme as Me}from"@rainbow-me/rainbowkit";import{jsx as Ie}from"react/jsx-runtime";var se=Dt(null);function He({config:e,children:t}){if(Ne(se))throw new Error("`EntryKitProvider` can only be used once.");return Ie(Kt,{initialChain:e.chainId,appInfo:{appName:e.appInfo?.name},theme:e.theme==="light"?Pe({borderRadius:"none"}):e.theme==="dark"?Me({borderRadius:"none"}):{lightMode:Pe({borderRadius:"none"}),darkMode:Me({borderRadius:"none"})},children:Ie(se.Provider,{value:e,children:t})})}function p(){let e=Ne(se);if(!e)throw new Error("`useEntryKitConfig` can only be used within a `EntryKitProvider`.");return e}function Ee(){let{theme:e}=p(),t=Lt("(prefers-color-scheme: dark)");return e??(t?"dark":"light")}import{jsx as H,jsxs as _t}from"react/jsx-runtime";function Vt({onSize:e,...t}){let n=Te(null);return Ut({ref:n,onResize:e}),H("div",{ref:n,...t,style:{...t.style,display:"inline-block"}})}var L=Bt(function({mode:t,children:n},r){let a=Te(null),[i,s]=Re(!1),o=i?a.current:null,[l,d]=Re({width:void 0,height:void 0}),c=o?.contentDocument,u=Ee();Ft(()=>{c&&c.body.setAttribute("data-theme",u)},[c,u]);let f=t==="modal"?{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",zIndex:"2147483646"}:l.width&&l.height?{all:"unset",display:"inline-block",width:`${l.width}px`,height:`${l.height}px`}:{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",opacity:0,pointerEvents:"none"};return H("iframe",{ref:Gt([r,a]),style:f,onLoad:()=>s(!0),srcDoc:"<!doctype html><title>\u2026</title>",children:c?Wt.createPortal(_t(Se,{frame:o,children:[H("div",{children:t==="modal"?n:H(Vt,{onSize:d,children:n})}),H("style",{dangerouslySetInnerHTML:{__html:ke}})]}),c.body):null})});import{twMerge as Oe}from"tailwind-merge";import{jsx as A,jsxs as $t}from"react/jsx-runtime";function ze({open:e,onOpenChange:t,children:n}){return A(qt,{open:e,onOpenChange:t,children:A(Yt,{children:$t(L,{mode:"modal",children:[A("div",{className:Oe("fixed inset-0","bg-neutral-800/85","animate-in animate-duration-300 fade-in")}),A("div",{className:Oe("fixed inset-0","grid items-end sm:items-center transition-all","animate-in animate-duration-300 fade-in slide-in-from-bottom-8"),children:A("div",{children:A(Xt,{className:"outline-none w-full max-w-[26rem] mx-auto","aria-describedby":void 0,children:n})})})]})})})}import{useCallback as ce,useMemo as Qt}from"react";import{useStore as jt}from"zustand";import{createStore as Jt}from"zustand/vanilla";var B=Jt(()=>({open:!1}));function y(){let e=jt(B,a=>a.open),t=ce(()=>{B.setState({open:!0})},[]),n=ce(()=>{B.setState({open:!1})},[]),r=ce(a=>{B.setState({open:a})},[]);return Qt(()=>({accountModalOpen:e,openAccountModal:t,closeAccountModal:n,toggleAccountModal:r}),[e,t,n,r])}import{twMerge as Ct}from"tailwind-merge";import{useConnectorClient as Br}from"wagmi";import{useAccount as Jn}from"wagmi";import{twMerge as F}from"tailwind-merge";import{twMerge as Zt}from"tailwind-merge";import{jsx as De,jsxs as en}from"react/jsx-runtime";function x({className:e,...t}){return en("svg",{className:Zt("-my-[0.125em] h-[1.25em] w-[1.25em] animate-spin",e),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t,children:[De("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),De("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}import{jsx as E,jsxs as nn}from"react/jsx-runtime";var tn=({variant:e="primary",pending:t=!1}={})=>F("group self-center leading-none outline-none border-4 border-transparent","transition hover:brightness-125 active:brightness-150","focus:border-orange-500","aria-disabled:pointer-events-none aria-busy:pointer-events-none","p-[.75em] font-medium",{primary:F("bg-neutral-700 text-white"),secondary:F("bg-neutral-800 text-white")}[e]),g=({pending:e,variant:t,type:n,className:r,children:a,disabled:i,...s})=>E("button",{type:n||"button",className:F(tn({variant:t,pending:e}),r),"aria-busy":e,"aria-disabled":i,disabled:i||e,...s,children:nn("span",{className:"grid grid-cols-[1fr_auto_1fr] gap-2",children:[E("span",{className:"flex items-center justify-end text-[.75em]",children:E("span",{className:"transition opacity-0 translate-x-2 group-aria-busy:opacity-100 group-aria-busy:translate-x-0 duration-100 group-aria-busy:duration-300",children:E(x,{})})}),E("span",{children:a})]})});import{useConnectModal as Zn}from"@rainbow-me/rainbowkit";import{useMutation as Qe}from"@tanstack/react-query";import{useConnectors as Yn}from"wagmi";import{createClient as Bn,custom as Fn,getAddress as Wn,numberToHex as qe,SwitchChainError as Un}from"viem";import{ChainNotConfiguredError as Gn,createConnector as Vn}from"wagmi";import{createStore as rn}from"zustand/vanilla";import{persist as an}from"zustand/middleware";var m=rn(an(()=>({publicKeys:{},addresses:{},activeCredential:null}),{name:"mud:passkey:cache"}));function on(e){e.key===m.persist.getOptions().name&&m.persist.rehydrate()}window.addEventListener("storage",on);import{smartAccountActions as _n}from"permissionless/clients";import{toWebAuthnAccount as vn}from"viem/account-abstraction";import{BaseError as sn}from"abitype";import{pad as cn,encodeFunctionData as de,hashMessage as dn,hashTypedData as Le,encodeAbiParameters as Be,stringToHex as ln,size as pn,encodePacked as un,parseSignature as mn}from"viem";import{entryPoint07Abi as fn,entryPoint07Address as yn,getUserOperationHash as gn,toSmartAccount as hn}from"viem/account-abstraction";import{readContract as Ke}from"viem/actions";import{parseSignature as wn}from"webauthn-p256";async function G(e){let{client:t,owners:n,nonce:r=0n}=e,a=e.address,i={abi:fn,address:yn,version:"0.7"},s={abi:xn,address:"0x356336adA1619BeC1Ae4E6D94Dd9c0490DA414a8"};if(!n.length)throw new Error("`owners` must have at least one account.");function o(c){return c.type==="webAuthn"?c.publicKey:cn(c.address)}let l=e.signer??n[0],d=n.indexOf(l);if(d===-1)throw new Error("`signer` must be one of `owners`.");return hn({client:t,entryPoint:i,extend:{__isCoinbaseSmartAccount:!0,abi:U,factory:s,signer:l},async encodeCalls(c){return c.length===1?de({abi:U,functionName:"execute",args:[c[0].to,c[0].value??0n,c[0].data??"0x"]}):de({abi:U,functionName:"executeBatch",args:[c.map(u=>({data:u.data??"0x",target:u.to,value:u.value??0n}))]})},async getAddress(){return a??=await Ke(t,{...s,functionName:"getAddress",args:[n.map(o),r]}),a},async getFactoryArgs(){let c=de({abi:s.abi,functionName:"createAccount",args:[n.map(o),r]});return{factory:s.address,factoryData:c}},async getStubSignature(){return l.type==="webAuthn"?"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000001949fc7c88032b9fcb5f6efc7a7b8c63668eae9871b765e23123bb473ff57aa831a7c0d9276168ebcc29f2875a0239cffdf2a9cd1c2007c5c77c071db9264df1d000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2273496a396e6164474850596759334b7156384f7a4a666c726275504b474f716d59576f4d57516869467773222c226f726967696e223a2268747470733a2f2f7369676e2e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d00000000000000000000000000000000000000000000":R({signature:"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",ownerIndex:d})},async sign(c){let u=await this.getAddress(),f=le({address:u,chainId:t.chain.id,hash:c.hash}),w=await W({hash:f,owner:l});return R({signature:w,ownerIndex:d})},async signMessage(c){let{message:u}=c,f=await this.getAddress(),w=le({address:f,chainId:t.chain.id,hash:dn(u)}),N=await W({hash:w,owner:l});return R({signature:N,ownerIndex:d})},async signTypedData(c){let{domain:u,types:f,primaryType:w,message:N}=c,ie=await this.getAddress(),Ht=le({address:ie,chainId:t.chain.id,hash:Le({domain:u,message:N,primaryType:w,types:f})}),Et=await W({hash:Ht,owner:l});return R({signature:Et,ownerIndex:d})},async signUserOperation(c){let{chainId:u=t.chain.id,...f}=c,w=await this.getAddress(),N=gn({chainId:u,entryPointAddress:i.address,entryPointVersion:i.version,userOperation:{...f,sender:w}}),ie=await W({hash:N,owner:l});return R({signature:ie,ownerIndex:d})},userOperation:{async estimateGas(c){if(l.type==="webAuthn")return{verificationGasLimit:BigInt(Math.max(Number(c.verificationGasLimit??0n),8e5))}}},async isOwner(c){return await Ke(t,{abi:U,address:await this.getAddress(),functionName:"isOwnerBytes",args:[o(c)]})}})}async function W({hash:e,owner:t}){if(t.type==="webAuthn"){let{signature:n,webauthn:r}=await t.sign({hash:e});return bn({signature:n,webauthn:r})}if(t.sign)return t.sign({hash:e});throw new sn("`owner` does not support raw sign.")}function le({address:e,chainId:t,hash:n}){return Le({domain:{chainId:t,name:"Coinbase Smart Wallet",verifyingContract:e,version:"1"},types:{CoinbaseSmartWalletMessage:[{name:"hash",type:"bytes32"}]},primaryType:"CoinbaseSmartWalletMessage",message:{hash:n}})}function bn({webauthn:e,signature:t}){let{r:n,s:r}=wn(t);return Be([{components:[{name:"authenticatorData",type:"bytes"},{name:"clientDataJSON",type:"bytes"},{name:"challengeIndex",type:"uint256"},{name:"typeIndex",type:"uint256"},{name:"r",type:"uint256"},{name:"s",type:"uint256"}],type:"tuple"}],[{authenticatorData:e.authenticatorData,clientDataJSON:ln(e.clientDataJSON),challengeIndex:BigInt(e.challengeIndex),typeIndex:BigInt(e.typeIndex),r:n,s:r}])}function R(e){let{ownerIndex:t}=e,n=(()=>{if(pn(e.signature)!==65)return e.signature;let r=mn(e.signature);return un(["bytes32","bytes32","uint8"],[r.r,r.s,r.yParity===0?27:28])})();return Be([{components:[{name:"ownerIndex",type:"uint8"},{name:"signatureData",type:"bytes"}],type:"tuple"}],[{ownerIndex:t,signatureData:n}])}var U=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"owner",type:"bytes"}],name:"AlreadyOwner",type:"error"},{inputs:[],name:"Initialized",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidEthereumAddressOwner",type:"error"},{inputs:[{name:"key",type:"uint256"}],name:"InvalidNonceKey",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidOwnerBytesLength",type:"error"},{inputs:[],name:"LastOwner",type:"error"},{inputs:[{name:"index",type:"uint256"}],name:"NoOwnerAtIndex",type:"error"},{inputs:[{name:"ownersRemaining",type:"uint256"}],name:"NotLastOwner",type:"error"},{inputs:[{name:"selector",type:"bytes4"}],name:"SelectorNotAllowed",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{inputs:[],name:"UnauthorizedCallContext",type:"error"},{inputs:[],name:"UpgradeFailed",type:"error"},{inputs:[{name:"index",type:"uint256"},{name:"expectedOwner",type:"bytes"},{name:"actualOwner",type:"bytes"}],name:"WrongOwnerAtIndex",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"AddOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"RemoveOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"REPLAYABLE_NONCE_KEY",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"addOwnerAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"addOwnerPublicKey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"functionSelector",type:"bytes4"}],name:"canSkipChainIdValidation",outputs:[{name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"domainSeparator",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"entryPoint",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"calls",type:"bytes[]"}],name:"executeWithoutChainIdValidation",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHashWithoutChainId",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"$",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"owners",type:"bytes[]"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"isOwnerAddress",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"bytes"}],name:"isOwnerBytes",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"isOwnerPublicKey",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"result",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextOwnerIndex",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"}],name:"ownerAtIndex",outputs:[{name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownerCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeLastOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeOwnerAtIndex",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"removedOwnersCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"}],name:"replaySafeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"newImplementation",type:"address"},{name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{name:"validationData",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],xn=[{inputs:[{name:"implementation_",type:"address"}],stateMutability:"payable",type:"constructor"},{inputs:[],name:"OwnerRequired",type:"error"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"createAccount",outputs:[{name:"account",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"getAddress",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"}];async function T(e,t){let{publicKeys:n}=m.getState(),r=n[t];if(!r)throw new Error("No public key found for passkey credential.");let i=[vn({credential:{id:t,publicKey:r}})];return await G({client:e,owners:i})}import{bytesToHex as Hn,hashMessage as En}from"viem";import{sign as Rn}from"webauthn-p256";import{bytesToHex as Cn,hexToBytes as Fe}from"webauthn-p256";import{concatBytes as kn,utf8ToBytes as An}from"@noble/curves/abstract/utils";async function V(e){let{authenticatorData:t,challengeIndex:n,clientDataJSON:r,typeIndex:a,userVerificationRequired:i}=e,s=a||r.indexOf('"type"'),o=n||r.indexOf('"challenge"'),l=Fe(t);if(l.length<37)throw new Error("Invalid authenticatorData");let d=l[32];if((d&1)!==1)throw new Error("Invalid authenticatorData");if(i&&(d&4)!==4)throw new Error("Invalid authenticatorData");if((d&8)!==8&&(d&16)===16)throw new Error("Invalid authenticatorData");let c='"type":"webauthn.get"';if(c!==r.slice(Number(s),c.length+1))throw new Error("Invalid clientDataJSON");if(!r.slice(Number(o)).match(/^"challenge":"(.*?)"/))throw new Error("Invalid clientDataJSON");let f=new Uint8Array(await crypto.subtle.digest("SHA-256",An(r))),w=new Uint8Array(await crypto.subtle.digest("SHA-256",kn(Fe(t),f)));return Cn(w)}import{sign as Pn}from"webauthn-p256";import{parseSignature as Sn,serializePublicKey as We}from"webauthn-p256";import{secp256r1 as Ue}from"@noble/curves/p256";function pe(e){let{r:t,s:n}=Sn(e.signatureHex),r=new Ue.Signature(t,n).addRecoveryBit(1).recoverPublicKey(e.messageHash.slice(2)),a=new Ue.Signature(t,n).addRecoveryBit(0).recoverPublicKey(e.messageHash.slice(2));return[We(r),We(a)]}import{hashMessage as Mn}from"viem";function In([e,t]){return Nn([...pe(e),...pe(t)])}async function Ge(e){let t=Mn(e.signatureHex),{signature:n,webauthn:r,raw:a}=await Pn({credentialId:e.credentialId,hash:t}),i=await V(r),s=In([e,{signatureHex:n,messageHash:i}]);if(s)return{publicKey:s,credential:a}}function Nn(e){let t=new Set;for(let n of e){if(t.has(n))return n;t.add(n)}}async function ue(){let e=Hn(crypto.getRandomValues(new Uint8Array(256))),t=En(e),{signature:n,webauthn:r,raw:a}=await Rn({hash:t}),i=await(async()=>{let s=m.getState().publicKeys[a.id];if(s)return s;let o=await V(r),l=await Ge({credentialId:a.id,messageHash:o,signatureHex:n});if(!l)throw new Error("recovery failed");if(l.credential.id!==a.id)throw new Error("wrong credential");return m.setState(d=>({publicKeys:{...d.publicKeys,[a.id]:l.publicKey}})),l.publicKey})();return console.log("recovered passkey",a.id,i),m.setState(()=>({activeCredential:a.id})),{id:a.id,publicKey:i,raw:a}}import{createCredential as Tn}from"webauthn-p256";async function Ve(){let e=await Tn({name:"MUD Account"});return console.log("created passkey",e),m.setState(t=>({activeCredential:e.id,publicKeys:{...t.publicKeys,[e.id]:e.publicKey}})),e}import{resourceToHex as On}from"@latticexyz/common";import{parseAbi as zn}from"viem";import Dn from"@latticexyz/world/mud.config";var _={pollingInterval:250},O=On({type:"system",namespace:"",name:"unlimited"}),_e=Dn.namespaces.world.tables,me=zn(["function registerDelegation(address delegatee, bytes32 delegationControlId, bytes initCallData)"]);import{createBundlerClient as Kn}from"viem/account-abstraction";var Ln=new Set([31337,17420,17069,690]);function q({paymasterAddress:e,...t}){let n=t.chain??t.client?.chain;return Kn({..._,paymaster:{getPaymasterData:async()=>({paymaster:e,paymasterData:"0x"})},userOperation:{estimateFeesPerGas:n&&Ln.has(n.id)?async()=>({maxFeePerGas:100000n,maxPriorityFeePerGas:0n}):void 0},...t})}import{observer as qn}from"@latticexyz/explorer/observer";S.type="passkey";function S({chainId:e,bundlerTransport:t,paymasterAddress:n,explorerUrl:r}){return Vn(a=>{if(!a.transports)throw new Error("Wagmi must be configured with transports to use the passkey connector.");let i=a.chains.find(d=>d.id===e);if(!i)throw new Error(`Could not find configured chain for chain ID ${e}.`);let s=a.transports[i.id];if(!s)throw new Error(`Could not find configured transport for chain ID ${e}.`);let o=Bn({..._,chain:i,transport:s}),l=m.getState().activeCredential!=null;return{id:"passkey",type:S.type,name:"Passkey",async createPasskey(){let{id:d}=await Ve(),c=await T(o,d);this.onAccountsChanged([c.address]),this.onConnect?.({chainId:qe(e)})},async reusePasskey(){let{id:d}=await ue(),c=await T(o,d);this.onAccountsChanged([c.address]),this.onConnect?.({chainId:qe(e)})},async connect(d){if(console.log("connect"),d?.chainId!=null&&d.chainId!==e)throw new Error(`Can't connect to chain ${d.chainId}. Passkey connector is bound to chain ${e}.`);!m.getState().activeCredential&&!d?.isReconnecting&&await ue();let c=await this.getAccounts();return l=c.length>0,{accounts:c,chainId:e}},async disconnect(){console.log("disconnect"),l=!1,m.setState({activeCredential:null})},async getAccounts(){console.log("getAccounts");let d=m.getState().activeCredential;if(!d)return[];try{console.log("getting account for credential",d);let c=await T(o,d);return console.log("got account",c),[c.address]}catch{console.log("could not get address for credential ID",d)}return[]},async getChainId(){return e},async isAuthorized(){return console.log("isAuthorized"),l?(await this.getAccounts()).length>0:!1},async switchChain(d){if(d.chainId!==e)throw new Error(`Can't connect to chain ${d.chainId}. Passkey connector is bound to chain ${e}.`);let c=a.chains.find(u=>u.id===d.chainId);if(!c)throw new Un(new Gn);return c},onAccountsChanged(d){console.log("onAccountsChanged"),d.length>0?a.emitter.emit("change",{accounts:d.map(c=>Wn(c))}):this.onDisconnect()},onChainChanged(d){console.log("onChainChanged"),a.emitter.emit("change",{chainId:Number(d)})},async onConnect(d){console.log("onConnect");let c=await this.getAccounts();a.emitter.emit("connect",{accounts:c,chainId:e})},async onDisconnect(d){console.log("onDisconnect"),a.emitter.emit("disconnect"),l=!1},async getClient(d){console.log("passkeyConnector.getClient",d);let c=m.getState().activeCredential;if(!c)throw new Error("Not connected.");let u=await T(o,c);return q({paymasterAddress:n,transport:t,client:o,account:u}).extend(_n()).extend(f=>r?qn({explorerUrl:r})(f):{})},async getProvider(d){return Fn({request:o.transport.request})({retryCount:0})}}})}function Ye(){let t=Yn().find(n=>n.type===S.type);if(!t)throw new Error("Could not find passkey connector. Did you configure Wagmi with the EntryKit passkey connector or passkey wallet?");return t}import{twMerge as Xn}from"tailwind-merge";import{jsx as fe,jsxs as $n}from"react/jsx-runtime";function v({className:e,...t}){return $n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8 8",fill:"currentColor",shapeRendering:"crispEdges",className:Xn("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...t,children:[fe("path",{d:"M0 0h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm2-1h1v1H7zm0 1h1v1H7zM6 7h1v1H6zm1-2h1v1H7zm0-1h1v1H7zm0-1h1v1H7z"}),fe("path",{d:"M2 2h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm1-3h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm0 1h1v1H5zm0 1h1v1H5zm0 1h1v1H5zM4 5h1v1H4zM3 5h1v1H3z",opacity:".5"}),fe("path",{d:"M7 2h1v1H7zm0-1h1v1H7zM1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm1 0h1v1H6zm1 0h1v1H7z"})]})}function Xe(){let{appInfo:e}=p(),t=e?.name??document.title,n=location.host,r=e?.icon??document.querySelector("link[rel~='icon']")?.getAttribute("href")??"/favico.ico",a=e?.image;return{appName:t,appOrigin:n,appIcon:r,appImage:a}}import{useQuery as Qn}from"@tanstack/react-query";function Y(e){return Qn({enabled:!!e,retry:!1,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,queryKey:[e],queryFn:()=>new Promise((t,n)=>{if(!e)throw new Error("usePreloadImage: Must provide `url` to preload image.");let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error(`usePreloadImage: Could not load image.
|
|
1538
1450
|
|
|
1539
|
-
.dark\\:aria-disabled\\:border-neutral-600[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1540
|
-
--tw-border-opacity: 1;
|
|
1541
|
-
border-color: rgb(82 82 82 / var(--tw-border-opacity));
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
.dark\\:aria-disabled\\:bg-neutral-400[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1545
|
-
--tw-bg-opacity: 1;
|
|
1546
|
-
background-color: rgb(163 163 163 / var(--tw-bg-opacity));
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
.dark\\:aria-disabled\\:text-neutral-500[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1550
|
-
--tw-text-opacity: 1;
|
|
1551
|
-
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
.dark\\:aria-disabled\\:text-neutral-600[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1555
|
-
--tw-text-opacity: 1;
|
|
1556
|
-
color: rgb(82 82 82 / var(--tw-text-opacity));
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
.dark\\:links\\:text-white a[href]:not(.links-unset):where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1560
|
-
--tw-text-opacity: 1;
|
|
1561
|
-
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
.dark\\:links\\:decoration-neutral-500 a[href]:not(.links-unset):where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1565
|
-
text-decoration-color: #737373;
|
|
1566
|
-
}
|
|
1567
|
-
`;import{useResizeObserver as Vt}from"usehooks-ts";import{mergeRefs as _t}from"react-merge-refs";import{createContext as zt,useContext as Dt}from"react";import{jsx as Kt}from"react/jsx-runtime";var ke=zt(null);function Ce({frame:e,children:t}){if(Dt(ke))throw new Error("`FrameProvider` can only be used once.");return Kt(ke.Provider,{value:{frame:e},children:t})}import{useMediaQuery as Wt}from"usehooks-ts";import"@rainbow-me/rainbowkit/styles.css";import{createContext as Lt,useContext as Me}from"react";import{RainbowKitProvider as Bt,lightTheme as Ae,midnightTheme as Se}from"@rainbow-me/rainbowkit";import{jsx as Pe}from"react/jsx-runtime";var ue=Lt(null);function Ne({config:e,children:t}){if(Me(ue))throw new Error("`EntryKitProvider` can only be used once.");return Pe(Bt,{initialChain:e.chainId,appInfo:{appName:e.appInfo?.name},theme:e.theme==="light"?Ae({borderRadius:"none"}):e.theme==="dark"?Se({borderRadius:"none"}):{lightMode:Ae({borderRadius:"none"}),darkMode:Se({borderRadius:"none"})},children:Pe(ue.Provider,{value:e,children:t})})}function p(){let e=Me(ue);if(!e)throw new Error("`useEntryKitConfig` can only be used within a `EntryKitProvider`.");return e}function Ie(){let{theme:e}=p(),t=Wt("(prefers-color-scheme: dark)");return e??(t?"dark":"light")}import{jsx as O,jsxs as Yt}from"react/jsx-runtime";function qt({onSize:e,...t}){let r=Ee(null);return Vt({ref:r,onResize:e}),O("div",{ref:r,...t,style:{...t.style,display:"inline-block"}})}var U=Ft(function({mode:t,children:r},a){let n=Ee(null),[i,o]=He(!1),d=i?n.current:null,[l,c]=He({width:void 0,height:void 0}),s=d?.contentDocument,u=Ie();Ut(()=>{s&&s.body.setAttribute("data-theme",u)},[s,u]);let f=t==="modal"?{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",zIndex:"2147483646"}:l.width&&l.height?{all:"unset",display:"inline-block",width:`${l.width}px`,height:`${l.height}px`}:{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",opacity:0,pointerEvents:"none"};return O("iframe",{ref:_t([a,n]),style:f,onLoad:()=>o(!0),srcDoc:"<!doctype html><title>\u2026</title>",children:s?Gt.createPortal(Yt(Ce,{frame:d,children:[O("div",{children:t==="modal"?r:O(qt,{onSize:c,children:r})}),O("style",{dangerouslySetInnerHTML:{__html:ve}})]}),s.body):null})});import{twMerge as Re}from"tailwind-merge";import{jsx as z,jsxs as jt}from"react/jsx-runtime";function Te({open:e,onOpenChange:t,children:r}){return z(Xt,{open:e,onOpenChange:t,children:z($t,{children:jt(U,{mode:"modal",children:[z("div",{className:Re("fixed inset-0","bg-neutral-700/50 dark:bg-neutral-900/75","animate-in animate-duration-500 fade-in")}),z("div",{className:Re("fixed inset-0","grid place-items-end sm:place-items-center overflow-y-auto","animate-in animate-duration-200 fade-in slide-in-from-bottom-4"),children:z(Qt,{className:"outline-none w-full sm:max-w-screen-sm","aria-describedby":void 0,children:r})})]})})})}import{useCallback as me,useMemo as Jt}from"react";import{useStore as Zt}from"zustand";import{createStore as er}from"zustand/vanilla";var G=er(()=>({open:!1}));function y(){let e=Zt(G,n=>n.open),t=me(()=>{G.setState({open:!0})},[]),r=me(()=>{G.setState({open:!1})},[]),a=me(n=>{G.setState({open:n})},[]);return Jt(()=>({accountModalOpen:e,openAccountModal:t,closeAccountModal:r,toggleAccountModal:a}),[e,t,r,a])}import{twMerge as Ct}from"tailwind-merge";import{useConnectorClient as Qa}from"wagmi";import{useAccount as Jr}from"wagmi";import{twMerge as V}from"tailwind-merge";import{twMerge as tr}from"tailwind-merge";import{jsx as Oe,jsxs as rr}from"react/jsx-runtime";function b({className:e,...t}){return rr("svg",{className:tr("-my-[0.125em] h-[1.25em] w-[1.25em] animate-spin",e),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t,children:[Oe("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Oe("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}import{jsx as D,jsxs as nr}from"react/jsx-runtime";var ar=({variant:e="primary",pending:t=!1}={})=>V("group self-center leading-none outline-none border border-transparent ring-2 ring-transparent focus:ring-orange-500 focus:border-transparent transition","aria-disabled:pointer-events-none aria-busy:pointer-events-none","p-[1em] font-semibold",{primary:V("bg-neutral-900 text-white hover:bg-neutral-700 active:bg-neutral-600 aria-disabled:bg-neutral-200 aria-disabled:text-neutral-400","dark:bg-neutral-100 dark:text-black dark:hover:bg-neutral-200 dark:active:bg-neutral-300 dark:aria-disabled:bg-neutral-400 dark:aria-disabled:text-neutral-600",t&&"dark:bg-neutral-700 dark:text-neutral-400"),secondary:V("text-black border-neutral-400 hover:bg-neutral-200 hover:border-neutral-500 active:bg-neutral-300 active:border-neutral-600 aria-disabled:text-neutral-400 aria-disabled:border-neutral-300","dark:text-white dark:border-neutral-400 dark:hover:bg-neutral-700 dark:hover:border-neutral-300 dark:active:bg-neutral-600 dark:active:border-neutral-200 dark:aria-disabled:text-neutral-500 dark:aria-disabled:border-neutral-600")}[e]),k=({pending:e,variant:t,type:r,className:a,children:n,disabled:i,...o})=>D("button",{type:r||"button",className:V(ar({variant:t,pending:e}),a),"aria-busy":e,"aria-disabled":i,disabled:i||e,...o,children:nr("span",{className:"grid grid-cols-[1fr_auto_1fr] gap-2",children:[D("span",{className:"flex items-center justify-end text-[.75em]",children:D("span",{className:"transition opacity-0 translate-x-2 group-aria-busy:opacity-100 group-aria-busy:translate-x-0 duration-100 group-aria-busy:duration-300",children:D(b,{})})}),D("span",{children:n})]})});import{useConnectModal as Zr}from"@rainbow-me/rainbowkit";import{useMutation as ea}from"@tanstack/react-query";import{useConnectors as Xr}from"wagmi";import{createClient as Wr,custom as Fr,getAddress as Ur,numberToHex as _e,SwitchChainError as Gr}from"viem";import{ChainNotConfiguredError as Vr,createConnector as _r}from"wagmi";import{createStore as or}from"zustand/vanilla";import{persist as ir}from"zustand/middleware";var m=or(ir(()=>({publicKeys:{},addresses:{},activeCredential:null}),{name:"mud:passkey:cache"}));function sr(e){e.key===m.persist.getOptions().name&&m.persist.rehydrate()}window.addEventListener("storage",sr);import{smartAccountActions as qr}from"permissionless/clients";import{toWebAuthnAccount as kr}from"viem/account-abstraction";import{BaseError as cr}from"abitype";import{pad as dr,encodeFunctionData as fe,hashMessage as lr,hashTypedData as De,encodeAbiParameters as Ke,stringToHex as pr,size as ur,encodePacked as mr,parseSignature as fr}from"viem";import{entryPoint07Abi as gr,entryPoint07Address as yr,getUserOperationHash as hr,toSmartAccount as br}from"viem/account-abstraction";import{readContract as ze}from"viem/actions";import{parseSignature as wr}from"webauthn-p256";async function Y(e){let{client:t,owners:r,nonce:a=0n}=e,n=e.address,i={abi:gr,address:yr,version:"0.7"},o={abi:vr,address:"0x356336adA1619BeC1Ae4E6D94Dd9c0490DA414a8"};if(!r.length)throw new Error("`owners` must have at least one account.");function d(s){return s.type==="webAuthn"?s.publicKey:dr(s.address)}let l=e.signer??r[0],c=r.indexOf(l);if(c===-1)throw new Error("`signer` must be one of `owners`.");return br({client:t,entryPoint:i,extend:{__isCoinbaseSmartAccount:!0,abi:q,factory:o,signer:l},async encodeCalls(s){return s.length===1?fe({abi:q,functionName:"execute",args:[s[0].to,s[0].value??0n,s[0].data??"0x"]}):fe({abi:q,functionName:"executeBatch",args:[s.map(u=>({data:u.data??"0x",target:u.to,value:u.value??0n}))]})},async getAddress(){return n??=await ze(t,{...o,functionName:"getAddress",args:[r.map(d),a]}),n},async getFactoryArgs(){let s=fe({abi:o.abi,functionName:"createAccount",args:[r.map(d),a]});return{factory:o.address,factoryData:s}},async getStubSignature(){return l.type==="webAuthn"?"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000001949fc7c88032b9fcb5f6efc7a7b8c63668eae9871b765e23123bb473ff57aa831a7c0d9276168ebcc29f2875a0239cffdf2a9cd1c2007c5c77c071db9264df1d000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2273496a396e6164474850596759334b7156384f7a4a666c726275504b474f716d59576f4d57516869467773222c226f726967696e223a2268747470733a2f2f7369676e2e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d00000000000000000000000000000000000000000000":K({signature:"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",ownerIndex:c})},async sign(s){let u=await this.getAddress(),f=ge({address:u,chainId:t.chain.id,hash:s.hash}),v=await _({hash:f,owner:l});return K({signature:v,ownerIndex:c})},async signMessage(s){let{message:u}=s,f=await this.getAddress(),v=ge({address:f,chainId:t.chain.id,hash:lr(u)}),T=await _({hash:v,owner:l});return K({signature:T,ownerIndex:c})},async signTypedData(s){let{domain:u,types:f,primaryType:v,message:T}=s,pe=await this.getAddress(),Rt=ge({address:pe,chainId:t.chain.id,hash:De({domain:u,message:T,primaryType:v,types:f})}),Tt=await _({hash:Rt,owner:l});return K({signature:Tt,ownerIndex:c})},async signUserOperation(s){let{chainId:u=t.chain.id,...f}=s,v=await this.getAddress(),T=hr({chainId:u,entryPointAddress:i.address,entryPointVersion:i.version,userOperation:{...f,sender:v}}),pe=await _({hash:T,owner:l});return K({signature:pe,ownerIndex:c})},userOperation:{async estimateGas(s){if(l.type==="webAuthn")return{verificationGasLimit:BigInt(Math.max(Number(s.verificationGasLimit??0n),8e5))}}},async isOwner(s){return await ze(t,{abi:q,address:await this.getAddress(),functionName:"isOwnerBytes",args:[d(s)]})}})}async function _({hash:e,owner:t}){if(t.type==="webAuthn"){let{signature:r,webauthn:a}=await t.sign({hash:e});return xr({signature:r,webauthn:a})}if(t.sign)return t.sign({hash:e});throw new cr("`owner` does not support raw sign.")}function ge({address:e,chainId:t,hash:r}){return De({domain:{chainId:t,name:"Coinbase Smart Wallet",verifyingContract:e,version:"1"},types:{CoinbaseSmartWalletMessage:[{name:"hash",type:"bytes32"}]},primaryType:"CoinbaseSmartWalletMessage",message:{hash:r}})}function xr({webauthn:e,signature:t}){let{r,s:a}=wr(t);return Ke([{components:[{name:"authenticatorData",type:"bytes"},{name:"clientDataJSON",type:"bytes"},{name:"challengeIndex",type:"uint256"},{name:"typeIndex",type:"uint256"},{name:"r",type:"uint256"},{name:"s",type:"uint256"}],type:"tuple"}],[{authenticatorData:e.authenticatorData,clientDataJSON:pr(e.clientDataJSON),challengeIndex:BigInt(e.challengeIndex),typeIndex:BigInt(e.typeIndex),r,s:a}])}function K(e){let{ownerIndex:t}=e,r=(()=>{if(ur(e.signature)!==65)return e.signature;let a=fr(e.signature);return mr(["bytes32","bytes32","uint8"],[a.r,a.s,a.yParity===0?27:28])})();return Ke([{components:[{name:"ownerIndex",type:"uint8"},{name:"signatureData",type:"bytes"}],type:"tuple"}],[{ownerIndex:t,signatureData:r}])}var q=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"owner",type:"bytes"}],name:"AlreadyOwner",type:"error"},{inputs:[],name:"Initialized",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidEthereumAddressOwner",type:"error"},{inputs:[{name:"key",type:"uint256"}],name:"InvalidNonceKey",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidOwnerBytesLength",type:"error"},{inputs:[],name:"LastOwner",type:"error"},{inputs:[{name:"index",type:"uint256"}],name:"NoOwnerAtIndex",type:"error"},{inputs:[{name:"ownersRemaining",type:"uint256"}],name:"NotLastOwner",type:"error"},{inputs:[{name:"selector",type:"bytes4"}],name:"SelectorNotAllowed",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{inputs:[],name:"UnauthorizedCallContext",type:"error"},{inputs:[],name:"UpgradeFailed",type:"error"},{inputs:[{name:"index",type:"uint256"},{name:"expectedOwner",type:"bytes"},{name:"actualOwner",type:"bytes"}],name:"WrongOwnerAtIndex",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"AddOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"RemoveOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"REPLAYABLE_NONCE_KEY",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"addOwnerAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"addOwnerPublicKey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"functionSelector",type:"bytes4"}],name:"canSkipChainIdValidation",outputs:[{name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"domainSeparator",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"entryPoint",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"calls",type:"bytes[]"}],name:"executeWithoutChainIdValidation",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHashWithoutChainId",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"$",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"owners",type:"bytes[]"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"isOwnerAddress",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"bytes"}],name:"isOwnerBytes",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"isOwnerPublicKey",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"result",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextOwnerIndex",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"}],name:"ownerAtIndex",outputs:[{name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownerCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeLastOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeOwnerAtIndex",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"removedOwnersCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"}],name:"replaySafeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"newImplementation",type:"address"},{name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{name:"validationData",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],vr=[{inputs:[{name:"implementation_",type:"address"}],stateMutability:"payable",type:"constructor"},{inputs:[],name:"OwnerRequired",type:"error"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"createAccount",outputs:[{name:"account",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"getAddress",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"}];async function L(e,t){let{publicKeys:r}=m.getState(),a=r[t];if(!a)throw new Error("No public key found for passkey credential.");let i=[kr({credential:{id:t,publicKey:a}})];return await Y({client:e,owners:i})}import{bytesToHex as Er,hashMessage as Rr}from"viem";import{sign as Tr}from"webauthn-p256";import{bytesToHex as Cr,hexToBytes as Le}from"webauthn-p256";import{concatBytes as Ar,utf8ToBytes as Sr}from"@noble/curves/abstract/utils";async function X(e){let{authenticatorData:t,challengeIndex:r,clientDataJSON:a,typeIndex:n,userVerificationRequired:i}=e,o=n||a.indexOf('"type"'),d=r||a.indexOf('"challenge"'),l=Le(t);if(l.length<37)throw new Error("Invalid authenticatorData");let c=l[32];if((c&1)!==1)throw new Error("Invalid authenticatorData");if(i&&(c&4)!==4)throw new Error("Invalid authenticatorData");if((c&8)!==8&&(c&16)===16)throw new Error("Invalid authenticatorData");let s='"type":"webauthn.get"';if(s!==a.slice(Number(o),s.length+1))throw new Error("Invalid clientDataJSON");if(!a.slice(Number(d)).match(/^"challenge":"(.*?)"/))throw new Error("Invalid clientDataJSON");let f=new Uint8Array(await crypto.subtle.digest("SHA-256",Sr(a))),v=new Uint8Array(await crypto.subtle.digest("SHA-256",Ar(Le(t),f)));return Cr(v)}import{sign as Mr}from"webauthn-p256";import{parseSignature as Pr,serializePublicKey as Be}from"webauthn-p256";import{secp256r1 as We}from"@noble/curves/p256";function ye(e){let{r:t,s:r}=Pr(e.signatureHex),a=new We.Signature(t,r).addRecoveryBit(1).recoverPublicKey(e.messageHash.slice(2)),n=new We.Signature(t,r).addRecoveryBit(0).recoverPublicKey(e.messageHash.slice(2));return[Be(a),Be(n)]}import{hashMessage as Nr}from"viem";function Ir([e,t]){return Hr([...ye(e),...ye(t)])}async function Fe(e){let t=Nr(e.signatureHex),{signature:r,webauthn:a,raw:n}=await Mr({credentialId:e.credentialId,hash:t}),i=await X(a),o=Ir([e,{signatureHex:r,messageHash:i}]);if(o)return{publicKey:o,credential:n}}function Hr(e){let t=new Set;for(let r of e){if(t.has(r))return r;t.add(r)}}async function he(){let e=Er(crypto.getRandomValues(new Uint8Array(256))),t=Rr(e),{signature:r,webauthn:a,raw:n}=await Tr({hash:t}),i=await(async()=>{let o=m.getState().publicKeys[n.id];if(o)return o;let d=await X(a),l=await Fe({credentialId:n.id,messageHash:d,signatureHex:r});if(!l)throw new Error("recovery failed");if(l.credential.id!==n.id)throw new Error("wrong credential");return m.setState(c=>({publicKeys:{...c.publicKeys,[n.id]:l.publicKey}})),l.publicKey})();return console.log("recovered passkey",n.id,i),m.setState(()=>({activeCredential:n.id})),{id:n.id,publicKey:i,raw:n}}import{createCredential as Or}from"webauthn-p256";async function Ue(){let e=await Or({name:"MUD Account"});return console.log("created passkey",e),m.setState(t=>({activeCredential:e.id,publicKeys:{...t.publicKeys,[e.id]:e.publicKey}})),e}import{resourceToHex as zr}from"@latticexyz/common";import{parseAbi as Dr}from"viem";import Kr from"@latticexyz/world/mud.config";var $={pollingInterval:250},Q=zr({type:"system",namespace:"",name:"unlimited"}),Ge=Kr.namespaces.world.tables,Ve=Dr(["function registerDelegation(address delegatee, bytes32 delegationControlId, bytes initCallData)"]);import{createBundlerClient as Lr}from"viem/account-abstraction";var Br=new Set([31337,17420,17069,690]);function j({paymasterAddress:e,...t}){let r=t.chain??t.client?.chain;return Lr({...$,paymaster:{getPaymasterData:async()=>({paymaster:e,paymasterData:"0x"})},userOperation:{estimateFeesPerGas:r&&Br.has(r.id)?async()=>({maxFeePerGas:100000n,maxPriorityFeePerGas:0n}):void 0},...t})}import{observer as Yr}from"@latticexyz/explorer/observer";N.type="passkey";function N({chainId:e,bundlerTransport:t,paymasterAddress:r,explorerUrl:a}){return _r(n=>{if(!n.transports)throw new Error("Wagmi must be configured with transports to use the passkey connector.");let i=n.chains.find(c=>c.id===e);if(!i)throw new Error(`Could not find configured chain for chain ID ${e}.`);let o=n.transports[i.id];if(!o)throw new Error(`Could not find configured transport for chain ID ${e}.`);let d=Wr({...$,chain:i,transport:o}),l=m.getState().activeCredential!=null;return{id:"passkey",type:N.type,name:"Passkey",async createPasskey(){let{id:c}=await Ue(),s=await L(d,c);this.onAccountsChanged([s.address]),this.onConnect?.({chainId:_e(e)})},async reusePasskey(){let{id:c}=await he(),s=await L(d,c);this.onAccountsChanged([s.address]),this.onConnect?.({chainId:_e(e)})},async connect(c){if(console.log("connect"),c?.chainId!=null&&c.chainId!==e)throw new Error(`Can't connect to chain ${c.chainId}. Passkey connector is bound to chain ${e}.`);!m.getState().activeCredential&&!c?.isReconnecting&&await he();let s=await this.getAccounts();return l=s.length>0,{accounts:s,chainId:e}},async disconnect(){console.log("disconnect"),l=!1,m.setState({activeCredential:null})},async getAccounts(){console.log("getAccounts");let c=m.getState().activeCredential;if(!c)return[];try{console.log("getting account for credential",c);let s=await L(d,c);return console.log("got account",s),[s.address]}catch{console.log("could not get address for credential ID",c)}return[]},async getChainId(){return e},async isAuthorized(){return console.log("isAuthorized"),l?(await this.getAccounts()).length>0:!1},async switchChain(c){if(c.chainId!==e)throw new Error(`Can't connect to chain ${c.chainId}. Passkey connector is bound to chain ${e}.`);let s=n.chains.find(u=>u.id===c.chainId);if(!s)throw new Gr(new Vr);return s},onAccountsChanged(c){console.log("onAccountsChanged"),c.length>0?n.emitter.emit("change",{accounts:c.map(s=>Ur(s))}):this.onDisconnect()},onChainChanged(c){console.log("onChainChanged"),n.emitter.emit("change",{chainId:Number(c)})},async onConnect(c){console.log("onConnect");let s=await this.getAccounts();n.emitter.emit("connect",{accounts:s,chainId:e})},async onDisconnect(c){console.log("onDisconnect"),n.emitter.emit("disconnect"),l=!1},async getClient(c){console.log("passkeyConnector.getClient",c);let s=m.getState().activeCredential;if(!s)throw new Error("Not connected.");let u=await L(d,s);return j({paymasterAddress:r,transport:t,client:d,account:u}).extend(qr()).extend(f=>a?Yr({explorerUrl:a})(f):{})},async getProvider(c){return Fr({request:d.transport.request})({retryCount:0})}}})}function qe(){let t=Xr().find(r=>r.type===N.type);if(!t)throw new Error("Could not find passkey connector. Did you configure Wagmi with the EntryKit passkey connector or passkey wallet?");return t}import{twMerge as $r}from"tailwind-merge";import{jsx as be,jsxs as Qr}from"react/jsx-runtime";function A({className:e,...t}){return Qr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8 8",fill:"currentColor",shapeRendering:"crispEdges",className:$r("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...t,children:[be("path",{d:"M0 0h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm2-1h1v1H7zm0 1h1v1H7zM6 7h1v1H6zm1-2h1v1H7zm0-1h1v1H7zm0-1h1v1H7z"}),be("path",{d:"M2 2h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm1-3h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm0 1h1v1H5zm0 1h1v1H5zm0 1h1v1H5zM4 5h1v1H4zM3 5h1v1H3z",opacity:".5"}),be("path",{d:"M7 2h1v1H7zm0-1h1v1H7zM1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm1 0h1v1H6zm1 0h1v1H7z"})]})}function Ye(){let{appInfo:e}=p(),t=e?.name??document.title,r=location.host,a=e?.icon??document.querySelector("link[rel~='icon']")?.getAttribute("href")??"/favico.ico",n=e?.image;return{appName:t,appOrigin:r,appIcon:a,appImage:n}}import{useQuery as jr}from"@tanstack/react-query";function J(e){return jr({enabled:!!e,retry:!1,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,queryKey:[e],queryFn:()=>new Promise((t,r)=>{if(!e)throw new Error("usePreloadImage: Must provide `url` to preload image.");let a=new Image;a.onload=()=>t(a),a.onerror=()=>r(new Error(`usePreloadImage: Could not load image.
|
|
1568
|
-
|
|
1569
|
-
URL: ${e}`)),a.src=e})})}import{jsx as B,jsxs as Xe}from"react/jsx-runtime";function $e(){let{appName:e,appOrigin:t,appIcon:r}=Ye(),{data:a,isLoading:n}=J(r);return Xe("div",{className:"flex-grow flex flex-col items-center justify-center gap-2",children:[B("div",{className:"w-16 h-16 m-2",children:n?null:a?B("img",{src:r,className:"w-full h-full object-cover"}):B(A,{className:"w-full h-full text-orange-500 dark:bg-neutral-800"})}),Xe("div",{className:"flex flex-col gap-1 items-center justify-center",children:[B("div",{className:"text-2xl",children:e}),B("div",{className:"text-sm font-mono text-neutral-400",children:t})]})]})}import{Fragment as ta,jsx as w,jsxs as Z}from"react/jsx-runtime";function Qe(){let e=Jr(),{accountModalOpen:t}=y(),{openConnectModal:r,connectModalOpen:a}=Zr(),n=qe(),i=ea({mutationKey:["createPasskey",n.id,t,a,e.status],mutationFn:async()=>await n.createPasskey()});return w(ta,{children:w("div",{className:"flex-grow grid place-items-center p-6",children:Z("div",{className:"flex flex-col gap-6",children:[w("div",{className:"p-4",children:w($e,{})}),Z("div",{className:"flex flex-col gap-2",children:[Z("div",{className:"flex flex-col",children:[w(k,{className:"self-auto flex justify-center",pending:i.status==="pending",onClick:()=>i.mutate(),children:"Create account"}),i.status==="error"?w("div",{className:"bg-red-100 text-red-700 text-sm p-2 animate-in animate-duration-200 fade-in",children:i.error.message}):null]}),w(k,{className:"self-auto flex justify-center text-sm py-1",variant:"secondary",pending:e.status==="connecting",onClick:r,children:"Connect with passkey or wallet"})]}),Z("a",{href:"https://mud.dev",target:"_blank",rel:"noreferrer noopener",className:"self-center p-2 flex items-center justify-center gap-1.5 text-sm",children:[w("span",{className:"block w-4 h-4",children:w(A,{className:"w-full h-full text-orange-500 dark:bg-neutral-800"})}),w("span",{children:"Powered by MUD"})]})]})})})}import{useState as ra}from"react";import{twMerge as aa}from"tailwind-merge";import{Fragment as na,jsx as ee,jsxs as je}from"react/jsx-runtime";function Je({steps:e}){if(!e.length)throw new Error("No steps.");let[t,r]=ra(null),a=e.find(o=>o.content!=null&&!o.isComplete),n=e.filter(o=>o.isComplete),i=(t!=null?e.find(o=>o.id===t):null)??a??(n.length<e.length?n.at(-1):null)??e.at(0);return je(na,{children:[ee("div",{className:"flex items-center justify-center p-2",children:e.filter(o=>o.id!=="finalize").map(o=>je("button",{type:"button",title:o.label,disabled:!o.content,className:"outline-none p-2.5 -my-2.5 hover:enabled:brightness-125 transition",onClick:()=>r(o.id),children:[ee("span",{className:aa("block w-2.5 h-2.5 rounded-full",o.id===a?.id?"bg-orange-500":o.isComplete?"bg-amber-700":"bg-gray-300",o.id===i.id?"ring-4 ring-orange-500/20":null)}),ee("span",{className:"sr-only",children:o.label})]},o.id))}),ee("div",{className:"outline-none flex-grow flex flex-col",children:i.content})]})}import{useDisconnect as ma}from"wagmi";import{twMerge as oa}from"tailwind-merge";import{jsx as ia}from"react/jsx-runtime";function g({className:e,children:t}){return ia("div",{className:oa("flex-grow flex flex-col gap-5 px-5 pb-5","animate-in fade-in slide-in-from-left-2",e),children:t})}import{useQuery as sa}from"@tanstack/react-query";function te(e){let t=e?.toLowerCase();return sa({enabled:!!t,queryKey:["ens",t],initialData:{address:void 0,name:void 0,displayName:void 0,avatar:void 0},queryFn:async()=>{let r=await fetch(`https://api.ensideas.com/ens/resolve/${t}`).then(a=>a.json());return{address:r.address??void 0,name:r.name??void 0,displayName:r.displayName??void 0,avatar:r.avatar??void 0}}})}import{jsx as we,jsxs as ca}from"react/jsx-runtime";function W({hex:e}){return e.length<=10?we("span",{title:e,children:e}):ca("span",{title:e,children:[we("span",{className:"after:select-none after:content-['\u2026']",children:e.slice(0,6)}),we("span",{className:"tracking-[-1ch] text-transparent",children:e.slice(6,-4)}),e.slice(-4)]})}import{twMerge as da}from"tailwind-merge";import{BaseError as la,UserRejectedRequestError as pa}from"viem";import{jsx as Ze,jsxs as ua}from"react/jsx-runtime";function S({title:e,error:t}){if(!t||t instanceof la&&t.walk(n=>n instanceof pa)!=null)return null;let r=e??"Error",a=typeof t=="string"?t:t instanceof Error?String(t):"Something unexpected happened.";return ua("div",{className:da("text-sm border-l-4 border-red-500","bg-red-100 text-red-900","dark:bg-red-900 dark:text-red-50"),children:[Ze("div",{className:"p-3 font-semibold",children:r}),Ze("div",{className:"px-3 whitespace-break-spaces break-all max-h-32 overflow-y-scroll",children:a})]})}import{Fragment as fa,jsx as P,jsxs as I}from"react/jsx-runtime";function et({userAddress:e}){let{data:t}=te(e),{disconnect:r,isPending:a,error:n}=ma(),{closeAccountModal:i}=y();return I(fa,{children:[I(g,{children:[P("div",{className:"text-lg font-medium",children:"Your wallet"}),I("div",{className:"space-y-4",children:[I("p",{children:["Hello,"," ",t.name?P("span",{className:"font-medium",children:t.name}):P("span",{className:"text-sm font-mono font-medium",children:P(W,{hex:e})}),"!"]}),I("p",{children:["Once signed in, your wallet address (",P("span",{className:"text-sm font-mono font-medium",children:P(W,{hex:e})}),") will be associated with all onchain actions for this app."]})]})]}),I(g,{className:"justify-end",children:[n?P(S,{error:n}):null,P(k,{variant:"secondary",className:"self-stretch sm:self-start",pending:a,onClick:()=>{i(),r()},children:"Disconnect"})]})]})}import{useClient as Ca}from"wagmi";import{useQuery as Aa}from"@tanstack/react-query";import{createStore as ga}from"zustand/vanilla";import{persist as ya}from"zustand/middleware";var F=ga(ya(()=>({appSigners:{}}),{name:"mud:entrykit",partialize:({appSigners:e})=>({appSigners:e})}));function ha(e){e.key===F.persist.getOptions().name&&F.persist.rehydrate()}window.addEventListener("storage",ha);import{generatePrivateKey as ba,privateKeyToAccount as wa}from"viem/accounts";function tt(e){let t=F.getState().appSigners[e]??(()=>{let r=ba();return F.setState(a=>({appSigners:{...a.appSigners,[e]:r}})),r})();return wa(t)}import{smartAccountActions as xa}from"permissionless";import{callFrom as va}from"@latticexyz/world/internal";import{observer as ka}from"@latticexyz/explorer/observer";async function rt({worldAddress:e,userAddress:t,client:r,bundlerTransport:a,paymasterAddress:n,explorerUrl:i}){let o=tt(t),d=await Y({client:r,owners:[o]});return j({paymasterAddress:n,transport:a,client:r,account:d}).extend(xa()).extend(va({worldAddress:e,delegatorAddress:t,publicClient:r})).extend(c=>i?ka({explorerUrl:i})(c):{})}function H(e){let{chainId:t,bundlerTransport:r,paymasterAddress:a,worldAddress:n,explorerUrl:i}=p(),o=Ca({chainId:t}),d=["appAccountClient",o?.uid,e];return Aa(o&&e?{queryKey:d,queryFn:async()=>await rt({worldAddress:n,userAddress:e,client:o,bundlerTransport:r,paymasterAddress:a,explorerUrl:i}),staleTime:1/0}:{queryKey:d,enabled:!1})}import{useMutation as Na,useQueryClient as Ia}from"@tanstack/react-query";import{getAction as nt}from"viem/utils";import{sendUserOperation as Ha,waitForUserOperationReceipt as Ea}from"viem/account-abstraction";import{defineStore as Sa}from"@latticexyz/store";import{parseAbi as Pa}from"viem";var at=Pa(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),Ma=Sa({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),re=Ma.namespaces.root.tables;function ot(){let{worldAddress:e,paymasterAddress:t}=p(),r=Ia();return Na({mutationKey:["setupAppAccount"],mutationFn:async({userClient:a,appAccountAddress:n,registerSpender:i,registerDelegation:o})=>{if(a.account.type!=="smart")throw new Error("User account is not a smart account.");let d=[];if(i&&(console.log("registering spender"),d.push({to:t,abi:at,functionName:"registerSpender",args:[n]})),o&&(console.log("registering delegation"),d.push({to:e,abi:Ve,functionName:"registerDelegation",args:[n,Q,"0x"]})),!d.length)return;console.log("setting up account with",d);let l=await nt(a,Ha,"sendUserOperation")({calls:d});console.log("got user op hash",l);let c=await nt(a,Ea,"waitForUserOperationReceipt")({hash:l});console.log("got user op receipt",c),await r.invalidateQueries({queryKey:["readContract"]})}})}import{jsx as h,jsxs as it}from"react/jsx-runtime";function st({userClient:e,registerSpender:t,registerDelegation:r}){let{closeAccountModal:a}=y(),n=H(e.account.address),i=ot();return n.status==="pending"?h(g,{className:"items-center justify-center",children:h(b,{})}):n.status==="error"?h(g,{children:h(S,{error:n.error})}):!t&&!r?it(g,{children:[h("div",{className:"text-lg font-medium",children:"Your app account"}),h("p",{children:"Blah blah blah app account"}),h("p",{children:"All sorted"})]}):it(g,{children:[h("div",{className:"text-lg font-medium",children:"Set up account"}),h("p",{children:"Blah blah blah app account"}),n.data?h(k,{className:"self-start",pending:i.status==="pending",onClick:async()=>{await i.mutateAsync({userClient:e,appAccountAddress:n.data.account.address,registerSpender:t,registerDelegation:r}),a()},children:"Set up"}):h("p",{children:"not ready"})]})}import{useReadContract as Ra}from"wagmi";import Ta from"@latticexyz/store/out/IStoreRead.sol/IStoreRead.abi.json";import{decodeValueArgs as Oa,getKeyTuple as za,getSchemaTypes as Da,getValueSchema as Ka}from"@latticexyz/protocol-parser/internal";function E({table:e,key:t,...r}){return Ra(e&&t&&r.query?.enabled!==!1?{...r,abi:Ta,functionName:"getRecord",args:[e.tableId,za(e,t)],query:{...r.query,select:a=>({...t,...Oa(Da(Ka(e)),{staticData:a[0],encodedLengths:a[1],dynamicData:a[2]})})}}:{})}function ae(e){let{chainId:t,paymasterAddress:r}=p();return E({chainId:t,address:r,...e?{table:re.Allowance,key:{user:e}}:null})}import{useMutation as La,useQueryClient as Ba}from"@tanstack/react-query";function ct(){let e=Ba(),{passIssuerTransport:t}=p();return La({mutationKey:["claimGasPass"],mutationFn:async r=>{let a=t({retryCount:0});await a.request({method:"quarry_issuePass",params:["0x01",r]}),await a.request({method:"quarry_claimAllowance",params:["0x01",r]}),await e.invalidateQueries({queryKey:["readContract"]})}})}import{twMerge as Wa}from"tailwind-merge";import{jsx as ne,jsxs as Fa}from"react/jsx-runtime";function dt({className:e,...t}){return Fa("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 263 428",fill:"currentColor",className:Wa("w-[0.6em] h-[1em]",e),...t,children:[ne("path",{d:"M132 321V428L263 243L132 321Z"}),ne("path",{d:"M0 243L132 321V428",fillOpacity:"0.5"}),ne("path",{d:"M132 0V296L263 218"}),ne("path",{d:"M0 218L132 296V0L0 218Z",fillOpacity:"0.5"})]})}import{formatEther as Ua}from"viem";function lt(e){let t=Ua(e),r=Math.floor(parseFloat(t)).toString().length;return parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:Math.max(0,6-r)})}import{jsx as Ga,jsxs as Va}from"react/jsx-runtime";function pt({wei:e}){return Va("span",{className:"inline-flex items-center gap-1",children:[lt(e)," ",Ga(dt,{})]})}import{useEffect as qa}from"react";import{parseEther as _a}from"viem";var oe=_a("0.01");import{Fragment as Ya,jsx as x,jsxs as ie}from"react/jsx-runtime";function ut({userAddress:e}){let t=ae(e),r=ct();return qa(()=>{r.status==="idle"&&t.data&&t.data.allowance<oe&&r.mutate(e)},[t.data,r,e]),t.status==="pending"?x(g,{className:"items-center justify-center",children:x(b,{})}):t.status==="error"?x(g,{children:x(S,{error:t.error})}):x(Ya,{children:ie(g,{children:[x("div",{className:"text-lg font-medium",children:"Top up"}),ie("div",{className:"space-y-4",children:[t.data.allowance>0n?ie("p",{children:["You currently have ",x(pt,{wei:t.data.allowance})," allowance to spend on gas."]}):x("p",{children:"You haven't claimed a gas pass yet."}),ie("div",{className:"flex flex-col",children:[x(k,{className:"self-start",pending:r.status==="pending",onClick:()=>r.mutate(e),children:"Claim gas pass"}),r.status==="error"?x("div",{className:"bg-red-100 text-red-700 text-sm p-2 animate-in animate-duration-200 fade-in",children:r.error.message}):null]})]})]})})}function mt(e){let{chainId:t,paymasterAddress:r}=p();return E({chainId:t,address:r,...e?{table:re.Spender,key:{spender:e}}:null})}function ft(e,t){let{chainId:r,worldAddress:a}=p();return E({chainId:r,address:a,...e&&t?{table:Ge.UserDelegationControl,key:{delegator:e,delegatee:t}}:null})}import{useMemo as Xa}from"react";import{jsx as xe}from"react/jsx-runtime";function se(e){let t=e?.account.address,r=ae(t),a=H(t),n=mt(a.data?.account.address),i=t&&n.data?n.data.user.toLowerCase()===t.toLowerCase():!1,o=ft(e?.account.address,a.data?.account.address),d=o.data?o.data?.delegationControlId===Q:!1;return Xa(()=>t?[{id:"connectWallet",label:"Sign in",isComplete:!0,content:xe(et,{userAddress:t})},{id:"claimGasPass",label:"Top up",isComplete:(r.data?.allowance??0n)>=oe,content:xe(ut,{userAddress:t})},{id:"setupAppAccount",label:"Set up account",isComplete:i&&d,content:xe(st,{userClient:e,registerSpender:!i,registerDelegation:!d})}]:[{id:"connectWallet",label:"Sign in",isComplete:!1,content:null}],[r.data?.allowance,d,i,t,e])}import{jsx as $a}from"react/jsx-runtime";function gt({userClient:e}){let t=se(e);return $a(Je,{steps:t})}import{jsx as yt}from"react/jsx-runtime";function ht(){let{chainId:e}=p(),t=Qa({chainId:e});return t.status!=="success"?yt(Qe,{}):yt(gt,{userClient:t.data})}import{useState as ja}from"react";import{ErrorBoundary as Ja}from"react-error-boundary";import{wait as Za}from"@latticexyz/common/utils";import{twMerge as en}from"tailwind-merge";import{useIsMounted as tn}from"usehooks-ts";import{jsx as ce,jsxs as bt}from"react/jsx-runtime";function wt({children:e}){let t=tn(),[r,a]=ja(1);return ce(Ja,{fallbackRender:({error:n,resetErrorBoundary:i})=>bt("div",{className:en("flex-grow flex flex-col justify-center p-5 gap-2"),children:[ce(S,{error:n instanceof Error?n.stack??n.message:n}),r>0?bt("button",{type:"button",onClick:async o=>{o.currentTarget.ariaBusy="true",await Za(1e3),i(),t()&&(a(d=>d-1),o.currentTarget.ariaBusy=null)},className:"group aria-busy:pointer-events-none self-end flex items-center gap-1",children:[ce(b,{className:"transition opacity-0 group-aria-busy:opacity-100 text-xs text-neutral-500 dark:text-neutral-400"}),ce("span",{className:"text-sm text-neutral-500 dark:text-neutral-400 group-hover:text-black dark:group-hover:text-white",children:"Retry?"})]}):null]}),children:e})}import{DialogClose as nn,DialogTitle as on}from"@radix-ui/react-dialog";import{twMerge as rn}from"tailwind-merge";import{jsx as an}from"react/jsx-runtime";function xt({className:e,children:t,...r}){return an("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:rn("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...r,children:t})}import{jsx as vt}from"react/jsx-runtime";function kt(e){return vt(xt,{strokeWidth:"2",stroke:"currentColor",...e,children:vt("path",{d:"M6 18L18 6M6 6L18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as R,jsxs as At}from"react/jsx-runtime";function St(){let{accountModalOpen:e,toggleAccountModal:t}=y();return At(Te,{open:e,onOpenChange:t,children:[R(on,{className:"sr-only",children:"Connect with EntryKit"}),e?At("div",{className:Ct("relative flex flex-col min-h-[20rem] border-t sm:border","bg-neutral-100 text-neutral-700 border-neutral-300","dark:bg-neutral-800 dark:text-neutral-300 dark:border-neutral-700 dark:divide-neutral-700","links:font-medium links:underline links:underline-offset-4","links:text-black dark:links:text-white","links:decoration-neutral-300 dark:links:decoration-neutral-500 hover:links:decoration-orange-500"),children:[R(wt,{children:R(ht,{})}),R("div",{className:"absolute top-0 right-0",children:R(nn,{className:Ct("pointer-events-auto leading-none p-1 transition","text-neutral-400 hover:text-neutral-600","dark:text-neutral-500 dark:hover:text-neutral-400"),title:"Close",children:R(kt,{className:"m-0"})})})]}):null]})}import{jsx as cn,jsxs as dn}from"react/jsx-runtime";function sn({config:e,children:t}){return dn(Ne,{config:e,children:[t,cn(St,{})]})}import{useAccount as pn}from"wagmi";import{twMerge as M}from"tailwind-merge";import{twMerge as Pt}from"tailwind-merge";import{Fragment as ln,jsx as de,jsxs as Mt}from"react/jsx-runtime";function Nt({address:e}){let{data:t}=te(e),{isSuccess:r}=J(t.avatar);return Mt(ln,{children:[Mt("span",{className:"flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center",children:[de("img",{src:r?t.avatar:void 0,className:Pt("col-start-1 row-start-1","inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",r?"opacity-100":"opacity-0")}),de(A,{className:Pt("col-start-1 row-start-1 text-orange-500","transition duration-300",r?"opacity-0":"opacity-100")})]}),de("span",{className:"flex-grow",children:t.name??(e?de(W,{hex:e}):null)})]})}import{jsx as C,jsxs as Ht}from"react/jsx-runtime";var It=M("w-60 inline-flex outline-none transition","border border-transparent","text-base leading-none"),un=M("bg-neutral-100 border-neutral-300 text-black","dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"),mn=M("cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700");function fn(){let{openAccountModal:e,accountModalOpen:t}=y(),{status:r,address:a}=pn();return C(U,{mode:"child",children:r==="connected"||r==="reconnecting"&&a?C("button",{type:"button",className:M(It,un,mn,"p-3"),onClick:e,children:C("span",{className:"flex-grow inline-flex gap-2.5 items-center text-left font-medium",children:C(Nt,{address:a})})},"connected"):Ht("button",{type:"button",className:M(It,"group","items-center justify-center gap-2.5 p-3","bg-orange-500 text-white font-medium","hover:bg-orange-400","active:bg-orange-600","aria-busy:saturate-50"),"aria-busy":t,onClick:e,children:[Ht("span",{className:"pointer-events-none inline-grid place-items-center -ml-3",children:[C("span",{className:M("col-start-1 row-start-1 leading-none","scale-100 opacity-100 transition duration-300","group-aria-busy:scale-125 group-aria-busy:opacity-0"),children:C(A,{})}),C("span",{"aria-hidden":!0,className:M("col-start-1 row-start-1","scale-50 opacity-0 transition duration-300 delay-50","group-aria-busy:scale-100 group-aria-busy:opacity-100"),children:C(b,{})})]}),C("span",{className:"font-medium",children:"Sign in"})]},"sign in")})}import{useConnectorClient as gn}from"wagmi";import{useMemo as yn}from"react";function hn(){let{chainId:e}=p(),{data:t,error:r}=gn({chainId:e});r&&console.error("Error retrieving user client",r);let a=H(t?.account.address),n=se(t);return yn(()=>{if(n.every(i=>i.isComplete))return a.data},[a.data,n])}import{connectorsForWallets as wn,getDefaultWallets as xn}from"@rainbow-me/rainbowkit";import{createConfig as vn}from"wagmi";var bn=`data:image/svg+xml;base64,${btoa('<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" width="512" height="512" viewBox="-64 -32 608 512"><path d="M6.206 425.469A6.202 6.202 0 010 419.263c0-1.771.235-3.517.663-5.245 9.95-78.847 57.22-96.006 100.964-107.256 21.008-5.412 62.901-26.489 57.822-53.668-10.596-9.819-21.113-23.39-22.946-43.63l-1.274.026c-2.932-.044-5.778-.716-8.422-2.217-5.848-3.325-9.051-9.697-10.596-16.958-3.238-22.186-4.058-33.515 7.768-38.464l.096-.035c-1.467-27.37 3.159-67.64-24.944-76.141C154.622 7.1 218.597-30.203 266.627 30.805c53.519 2.801 77.389 78.611 44.154 121.046h-1.405c11.826 4.949 10.045 17.674 7.767 38.464-1.544 7.261-4.747 13.633-10.595 16.958-2.645 1.501-5.481 2.173-8.422 2.217l-1.275-.026c-1.833 20.24-12.376 33.811-22.972 43.63-4.459 23.871 27.275 43.011 49.33 50.997a139.442 139.442 0 004.268 5.525c-7.2 9.941-8.771 22.797-4.564 34.038-17.002 8.763-24.255 29.334-16.479 46.86-11.966 7.55-18.258 21.305-16.609 34.955H6.206zm419.058-105.362a86.778 86.778 0 0019.446-1.641c29.36-5.822 53.152-27.467 62.657-55.823 3.596-10.544 5.071-21.663 4.521-33.341-1.179-23.46-12.193-46.633-29.631-62.369-17.107-15.361-38.342-23.574-61.383-23.042-22.841.507-45.359 11.216-60.187 28.593-14.977 17.551-22.003 39.144-20.921 62.133.585 11.661 3.482 23.016 8.737 34.074 7.741 16.303 19.934 29.735 35.391 39.048l-22.457 20.711 13.232 27.86-29.413 13.973 13.991 29.456-26.769 12.717 16.81 35.374 35.601-16.915 40.375-110.808zm15.239-129.364c13.685 4.869 20.824 19.908 15.954 33.593-4.87 13.685-19.908 20.833-33.593 15.963-13.685-4.87-20.834-19.917-15.963-33.602 4.87-13.685 19.917-20.825 33.602-15.954z"/></svg>')}`,le=e=>()=>({id:"passkey",name:"Passkey",iconUrl:bn,iconBackground:"#fec",createConnector:t=>r=>({...N(e)(r),...t})});function kn(e){let{wallets:t}=xn(),r=[{groupName:"Recommended",wallets:[le({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t],a=wn(r,{appName:e.appInfo.name,projectId:e.walletConnectProjectId});return vn({connectors:a,chains:e.chains,transports:e.transports})}function Ul(e){return e!=null&&"__isCoinbaseSmartAccount"in e&&e.__isCoinbaseSmartAccount===!0}var Vl=new Set([17420,31337]);function _l(e){return t=>{let{request:r,...a}=e(t),n=null,i=new Map;return{...a,async request(o){if(o.method==="eth_chainId")return n??(n=await r(o));if(o.method==="eth_getTransactionReceipt"){let d=o.params[0],l=i.get(d)??await r(o);return i.has(d)||i.set(d,l),l}if(o.method==="eth_sendUserOperation")return(await r({...o,method:"pimlico_sendUserOperationNow"})).userOpHash;if(o.method==="eth_getUserOperationReceipt"){let d=o.params[0],l=i.get(d)??await r(o);return i.has(d)||i.set(d,l),l}return r(o)}}}}import{connectorsForWallets as An}from"@rainbow-me/rainbowkit";import{getDefaultWallets as Cn}from"@rainbow-me/rainbowkit";function Et(e){let{wallets:t}=Cn();return[{groupName:"Recommended",wallets:[le({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t]}function ep({wallets:e,...t}){return An(e??Et(t),{appName:t.appInfo?.name??document.title,projectId:t.walletConnectProjectId})}export{fn as AccountButton,sn as EntryKitProvider,q as abi,kn as createWagmiConfig,ep as getConnectors,Et as getWallets,Ul as isCoinbaseSmartAccount,N as passkeyConnector,le as passkeyWallet,_ as sign,Y as toCoinbaseSmartAccount,ge as toReplaySafeHash,xr as toWebAuthnSignature,y as useAccountModal,hn as useAppAccountClient,p as useEntryKitConfig,_l as wiresaw,Vl as wiresawChainIds,K as wrapSignature};
|
|
1451
|
+
URL: ${e}`)),r.src=e})})}import{jsx as X,jsxs as jn}from"react/jsx-runtime";function $e(){let{appName:e,appIcon:t}=Xe(),{data:n,isLoading:r}=Y(t);return jn("div",{className:"flex-grow flex flex-col items-center justify-center gap-2",children:[X("div",{className:"w-16 h-16 m-2",children:r?null:n?X("img",{src:t,className:"w-full h-full object-cover"}):X(v,{className:"w-full h-full text-orange-500 dark:bg-neutral-800"})}),X("div",{className:"text-2xl text-white text-center",children:e})]})}import{Fragment as er,jsx as C,jsxs as ye}from"react/jsx-runtime";function je(){let e=Jn(),{accountModalOpen:t}=y(),{openConnectModal:n,connectModalOpen:r}=Zn(),a=Ye(),i=Qe({mutationKey:["createPasskey",a.id,t,r,e.status],mutationFn:async()=>await a.createPasskey()}),s=Qe({mutationKey:["reusePasskey",a.id,t,r,e.status],mutationFn:async()=>await a.reusePasskey()});return C(er,{children:C("div",{className:"flex-grow grid place-items-center p-6",children:ye("div",{className:"flex flex-col gap-6",children:[C("div",{className:"p-4",children:C($e,{})}),ye("div",{className:"self-center flex flex-col gap-2 w-60",children:[ye("div",{className:"flex flex-col",children:[C(g,{className:"self-auto flex justify-center",pending:i.status==="pending",onClick:()=>i.mutate(),children:"Create account"}),i.status==="error"?C("div",{className:"bg-red-800 text-white text-sm p-2 animate-in animate-duration-200 fade-in",children:i.error.message}):null]}),C(g,{className:"self-auto flex justify-center",variant:"secondary",pending:s.status==="pending",onClick:()=>s.mutate(),children:"Sign in"}),C("button",{className:"text-sm transition text-neutral-500 hover:text-white",disabled:e.status==="connecting",onClick:n,children:"Already have a wallet?"})]})]})})})}import{useState as Kr}from"react";import{useMemo as Dr}from"react";import{parseEther as tr}from"viem";var $=tr("0.01");import{useReadContract as nr}from"wagmi";import rr from"@latticexyz/store/out/IStoreRead.sol/IStoreRead.abi.json";import{decodeValueArgs as ar,getKeyTuple as or,getSchemaTypes as ir,getValueSchema as sr}from"@latticexyz/protocol-parser/internal";function P({table:e,key:t,...n}){return nr(e&&t&&n.query?.enabled!==!1?{...n,abi:rr,functionName:"getRecord",args:[e.tableId,or(e,t)],query:{...n.query,select:r=>({...t,...ar(ir(sr(e)),{staticData:r[0],encodedLengths:r[1],dynamicData:r[2]})})}}:{})}import{defineStore as cr}from"@latticexyz/store";import{parseAbi as dr}from"viem";var ge=dr(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),lr=cr({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),Q=lr.namespaces.root.tables;function j(e){let{chainId:t,paymasterAddress:n}=p();return P({chainId:t,address:n,...e?{table:Q.Allowance,key:{user:e}}:null})}import{useClient as br}from"wagmi";import{useQuery as xr}from"@tanstack/react-query";import{createStore as pr}from"zustand/vanilla";import{persist as ur}from"zustand/middleware";var z=pr(ur(()=>({appSigners:{}}),{name:"mud:entrykit",partialize:({appSigners:e})=>({appSigners:e})}));function mr(e){e.key===z.persist.getOptions().name&&z.persist.rehydrate()}window.addEventListener("storage",mr);import{generatePrivateKey as fr,privateKeyToAccount as yr}from"viem/accounts";function Je(e){let t=z.getState().appSigners[e]??(()=>{let n=fr();return z.setState(r=>({appSigners:{...r.appSigners,[e]:n}})),n})();return yr(t)}import{smartAccountActions as gr}from"permissionless";import{callFrom as hr}from"@latticexyz/world/internal";import{observer as wr}from"@latticexyz/explorer/observer";async function Ze({worldAddress:e,userAddress:t,client:n,bundlerTransport:r,paymasterAddress:a,explorerUrl:i}){let s=Je(t),o=await G({client:n,owners:[s]});return q({paymasterAddress:a,transport:r,client:n,account:o}).extend(gr()).extend(hr({worldAddress:e,delegatorAddress:t,publicClient:n})).extend(d=>i?wr({explorerUrl:i})(d):{})}function M(e){let{chainId:t,bundlerTransport:n,paymasterAddress:r,worldAddress:a,explorerUrl:i}=p(),s=br({chainId:t}),o=["appAccountClient",s?.uid,e];return xr(s&&e?{queryKey:o,queryFn:async()=>await Ze({worldAddress:a,userAddress:e,client:s,bundlerTransport:n,paymasterAddress:r,explorerUrl:i}),staleTime:1/0}:{queryKey:o,enabled:!1})}function et(e){let{chainId:t,paymasterAddress:n}=p();return P({chainId:t,address:n,...e?{table:Q.Spender,key:{spender:e}}:null})}function tt(e,t){let{chainId:n,worldAddress:r}=p();return P({chainId:n,address:r,...e&&t?{table:_e.UserDelegationControl,key:{delegator:e,delegatee:t}}:null})}import{useDisconnect as kr}from"wagmi";import{useQuery as vr}from"@tanstack/react-query";function J(e){let t=e?.toLowerCase();return vr({enabled:!!t,queryKey:["ens",t],initialData:{address:void 0,name:void 0,displayName:void 0,avatar:void 0},queryFn:async()=>{let n=await fetch(`https://api.ensideas.com/ens/resolve/${t}`).then(r=>r.json());return{address:n.address??void 0,name:n.name??void 0,displayName:n.displayName??void 0,avatar:n.avatar??void 0}}})}import{jsx as he,jsxs as Cr}from"react/jsx-runtime";function Z({hex:e}){return e.length<=10?he("span",{title:e,children:e}):Cr("span",{title:e,children:[he("span",{className:"after:select-none after:content-['\u2026']",children:e.slice(0,6)}),he("span",{className:"tracking-[-1ch] text-transparent",children:e.slice(6,-4)}),e.slice(-4)]})}import{jsx as D,jsxs as we}from"react/jsx-runtime";function nt({isActive:e,isExpanded:t,userAddress:n}){let{data:r}=J(n),{disconnect:a,isPending:i}=kr(),{closeAccountModal:s}=y();return we("div",{className:"flex flex-col gap-4",children:[we("div",{className:"flex justify-between gap-4",children:[we("div",{children:[D("div",{children:"Account"}),D("div",{className:"font-mono text-white",children:r.name??D(Z,{hex:n})})]}),D(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",pending:i,onClick:()=>{s(),a()},children:"Sign out"})]}),t?D("p",{className:"text-sm",children:"Each of your onchain actions in this app is associated with your account."}):null]})}import{useMutation as Ar,useQueryClient as Sr}from"@tanstack/react-query";function rt(){let e=Sr(),{passIssuerTransport:t}=p();return Ar({onError:n=>console.error(n),mutationKey:["claimGasPass"],mutationFn:async n=>{let r=t({retryCount:0});await r.request({method:"quarry_issuePass",params:["0x01",n]}),await r.request({method:"quarry_claimAllowance",params:["0x01",n]}),await e.invalidateQueries({queryKey:["readContract"]})}})}import{twMerge as Pr}from"tailwind-merge";import{jsx as ee,jsxs as Mr}from"react/jsx-runtime";function at({className:e,...t}){return Mr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 263 428",fill:"currentColor",className:Pr("w-[0.6em] h-[1em]",e),...t,children:[ee("path",{d:"M132 321V428L263 243L132 321Z"}),ee("path",{d:"M0 243L132 321V428",fillOpacity:"0.5"}),ee("path",{d:"M132 0V296L263 218"}),ee("path",{d:"M0 218L132 296V0L0 218Z",fillOpacity:"0.5"})]})}import{formatEther as Ir}from"viem";function ot(e){let t=Ir(e),n=Math.floor(parseFloat(t)).toString().length;return parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:Math.max(0,6-n)})}import{jsx as Nr,jsxs as Hr}from"react/jsx-runtime";function it({wei:e}){return Hr("span",{className:"inline-flex items-center gap-1",children:[ot(e)," ",Nr(at,{})]})}import{useEffect as Er}from"react";import{jsx as I,jsxs as be}from"react/jsx-runtime";function st({isActive:e,isExpanded:t,userAddress:n}){let r=j(n),a=rt();return Er(()=>{e&&a.status==="idle"&&r.data&&r.data.allowance<$&&a.mutate(n)},[r.data,a,e,n]),be("div",{className:"flex flex-col gap-4",children:[be("div",{className:"flex justify-between gap-4",children:[be("div",{children:[I("div",{children:"Allowance"}),I("div",{className:"font-mono text-white",children:r.data?I(it,{wei:r.data.allowance}):I(x,{})})]}),I(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",pending:a.status==="pending",onClick:()=>a.mutate(n),children:"Top up"})]}),t?I("p",{className:"text-sm",children:"Your allowance is used to pay for onchain computation."}):null]})}import{useMutation as Rr,useQueryClient as Tr}from"@tanstack/react-query";import{getAction as te}from"viem/utils";import{sendUserOperation as Or,waitForUserOperationReceipt as zr}from"viem/account-abstraction";import{writeContract as ct}from"viem/actions";function dt(){let{worldAddress:e,paymasterAddress:t}=p(),n=Tr();return Rr({onError:r=>console.error(r),mutationKey:["setupAppAccount"],mutationFn:async({userClient:r,appAccountAddress:a,registerSpender:i,registerDelegation:s})=>{r.account.type!=="smart"&&(await te(r,ct,"writeContract")({chain:r.chain,account:r.account,address:t,abi:ge,functionName:"registerSpender",args:[a]}),await te(r,ct,"writeContract")({chain:r.chain,account:r.account,address:e,abi:me,functionName:"registerDelegation",args:[a,O,"0x"]}));let o=[];if(i&&(console.log("registering spender"),o.push({to:t,abi:ge,functionName:"registerSpender",args:[a]})),s&&(console.log("registering delegation"),o.push({to:e,abi:me,functionName:"registerDelegation",args:[a,O,"0x"]})),!o.length)return;console.log("setting up account with",o);let l=await te(r,Or,"sendUserOperation")({calls:o});console.log("got user op hash",l);let d=await te(r,zr,"waitForUserOperationReceipt")({hash:l});console.log("got user op receipt",d),await n.invalidateQueries({queryKey:["readContract"]})}})}import{jsx as K,jsxs as xe}from"react/jsx-runtime";function lt({isActive:e,isExpanded:t,userClient:n,registerSpender:r,registerDelegation:a}){let{closeAccountModal:i}=y(),s=M(n.account.address),o=dt(),l=!a&&!a;return xe("div",{className:"flex flex-col gap-4",children:[xe("div",{className:"flex justify-between gap-4",children:[xe("div",{children:[K("div",{children:"Session"}),K("div",{className:"font-mono text-white",children:l?"Approved":"Set up"})]}),l?K(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",disabled:!0,children:"Revoke"}):K(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",pending:!s.data||o.status==="pending",onClick:s.data?async()=>{await o.mutateAsync({userClient:n,appAccountAddress:s.data.account.address,registerSpender:r,registerDelegation:a}),i()}:void 0,children:"Approve"})]}),t?K("p",{className:"text-sm",children:"You can perform actions in this app without interruptions for approvals."}):null]})}import{jsx as ve}from"react/jsx-runtime";function ne(e){let t=e?.account.address,n=j(t),r=M(t),a=et(r.data?.account.address),i=t&&a.data?a.data.user.toLowerCase()===t.toLowerCase():!1,s=tt(e?.account.address,r.data?.account.address),o=s.data?s.data?.delegationControlId===O:!1;return Dr(()=>t?[{id:"wallet",label:"Sign in",isComplete:!0,content:l=>ve(nt,{...l,userAddress:t})},{id:"allowance",label:"Top up",isComplete:(n.data?.allowance??0n)>=$,content:l=>ve(st,{...l,userAddress:t})},{id:"session",label:"Set up account",isComplete:i&&o,content:l=>ve(lt,{...l,userClient:e,registerSpender:!i,registerDelegation:!o})}]:[{id:"wallet",label:"Sign in",isComplete:!1,content:()=>null}],[n.data?.allowance,o,i,t,e])}import{twMerge as Lr}from"tailwind-merge";import{jsx as pt}from"react/jsx-runtime";function ut({userClient:e}){let t=ne(e),[n,r]=Kr(null),a=t.find(o=>o.content!=null&&!o.isComplete),i=t.filter(o=>o.isComplete),s=(n!=null?t.find(o=>o.id===n):null)??a??(i.length<t.length?i.at(-1):null);return pt("div",{className:"px-8 flex-grow flex flex-col divide-y divide-neutral-800",children:t.map(o=>{let l=o===s,d=l||i.length===t.length;return pt("div",{className:Lr("py-8 flex flex-col justify-center",l?"flex-grow":null),children:o.content({isActive:l,isExpanded:d})},o.id)})})}import{jsx as mt}from"react/jsx-runtime";function ft(){let{chainId:e}=p(),t=Br({chainId:e});return t.status!=="success"?mt(je,{}):mt(ut,{userClient:t.data})}import{useState as Vr}from"react";import{ErrorBoundary as _r}from"react-error-boundary";import{twMerge as Fr}from"tailwind-merge";import{BaseError as Wr,UserRejectedRequestError as Ur}from"viem";import{jsx as yt,jsxs as Gr}from"react/jsx-runtime";function gt({title:e,error:t}){if(!t||t instanceof Wr&&t.walk(a=>a instanceof Ur)!=null)return null;let n=e??"Error",r=typeof t=="string"?t:t instanceof Error?String(t):"Something unexpected happened.";return Gr("div",{className:Fr("text-sm border-l-4 border-red-500","bg-red-100 text-red-900","dark:bg-red-900 dark:text-red-50"),children:[yt("div",{className:"p-3 font-semibold",children:n}),yt("div",{className:"px-3 whitespace-break-spaces break-all max-h-32 overflow-y-scroll",children:r})]})}import{wait as qr}from"@latticexyz/common/utils";import{twMerge as Yr}from"tailwind-merge";import{useIsMounted as Xr}from"usehooks-ts";import{jsx as re,jsxs as ht}from"react/jsx-runtime";function wt({children:e}){let t=Xr(),[n,r]=Vr(1);return re(_r,{fallbackRender:({error:a,resetErrorBoundary:i})=>ht("div",{className:Yr("flex-grow flex flex-col justify-center p-5 gap-2"),children:[re(gt,{error:a instanceof Error?a.stack??a.message:a}),n>0?ht("button",{type:"button",onClick:async s=>{s.currentTarget.ariaBusy="true",await qr(1e3),i(),t()&&(r(o=>o-1),s.currentTarget.ariaBusy=null)},className:"group aria-busy:pointer-events-none self-end flex items-center gap-1",children:[re(x,{className:"transition opacity-0 group-aria-busy:opacity-100 text-xs text-neutral-500 dark:text-neutral-400"}),re("span",{className:"text-sm text-neutral-500 dark:text-neutral-400 group-hover:text-black dark:group-hover:text-white",children:"Retry?"})]}):null]}),children:e})}import{DialogClose as jr,DialogTitle as Jr}from"@radix-ui/react-dialog";import{twMerge as $r}from"tailwind-merge";import{jsx as Qr}from"react/jsx-runtime";function bt({className:e,children:t,...n}){return Qr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:$r("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...n,children:t})}import{jsx as xt}from"react/jsx-runtime";function vt(e){return xt(bt,{strokeWidth:"2",stroke:"currentColor",...e,children:xt("path",{d:"M6 18L18 6M6 6L18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as h,jsxs as Ce}from"react/jsx-runtime";function kt(){let{accountModalOpen:e,toggleAccountModal:t}=y();return Ce(ze,{open:e,onOpenChange:t,children:[h(Jr,{className:"sr-only",children:"Connect with EntryKit"}),e?Ce("div",{className:Ct("relative flex flex-col min-h-[28rem] ring-1","bg-neutral-900 text-neutral-400 ring-neutral-700/50 divide-neutral-700","links:font-medium links:underline links:underline-offset-4","links:text-white","links:decoration-neutral-500 hover:links:decoration-orange-500"),children:[h("div",{className:"flex-grow flex flex-col",children:h(wt,{children:h(ft,{})})}),Ce("a",{href:"https://mud.dev",target:"_blank",rel:"noreferrer noopener",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",children:[h("span",{className:"block w-4 h-4",children:h(v,{className:"w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300"})}),h("span",{children:"Powered by MUD"})]}),h("div",{className:"absolute top-0 right-0",children:h(jr,{className:Ct("pointer-events-auto leading-none p-2 transition","text-neutral-700 hover:text-neutral-500"),title:"Close",children:h(vt,{className:"m-0"})})})]}):null]})}import{jsx as ea,jsxs as ta}from"react/jsx-runtime";function Zr({config:e,children:t}){return ta(He,{config:e,children:[t,ea(kt,{})]})}import{useAccount as ra}from"wagmi";import{twMerge as k}from"tailwind-merge";import{twMerge as At}from"tailwind-merge";import{Fragment as na,jsx as ae,jsxs as St}from"react/jsx-runtime";function Pt({address:e}){let{data:t}=J(e),{isSuccess:n}=Y(t.avatar);return St(na,{children:[St("span",{className:"flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center",children:[ae("img",{src:n?t.avatar:void 0,className:At("col-start-1 row-start-1","inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",n?"opacity-100":"opacity-0")}),ae(v,{className:At("col-start-1 row-start-1 text-orange-500","transition duration-300",n?"opacity-0":"opacity-100")})]}),ae("span",{className:"flex-grow",children:t.name??(e?ae(Z,{hex:e}):null)})]})}import{jsx as b,jsxs as It}from"react/jsx-runtime";var Mt=k("w-48 inline-flex outline-none transition","border border-transparent","text-base leading-none"),aa=k("bg-neutral-100 border-neutral-300 text-black","dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"),oa=k("cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700");function ia(){let{openAccountModal:e,accountModalOpen:t}=y(),{status:n,address:r}=ra();return b(L,{mode:"child",children:n==="connected"||n==="reconnecting"&&r?b("button",{type:"button",className:k(Mt,aa,oa,"p-3"),onClick:e,children:b("span",{className:"flex-grow inline-flex gap-2.5 items-center text-left font-medium",children:b(Pt,{address:r})})},"connected"):It("button",{type:"button",className:k(Mt,"group","items-center justify-center gap-2.5 p-3","bg-orange-500 text-white font-medium","hover:bg-orange-400","active:bg-orange-600","aria-busy:saturate-50"),"aria-busy":t,onClick:e,children:[It("span",{className:"pointer-events-none inline-grid place-items-center -ml-3",children:[b("span",{className:k("col-start-1 row-start-1 leading-none","scale-100 opacity-100 transition duration-300","group-aria-busy:scale-125 group-aria-busy:opacity-0"),children:b(v,{})}),b("span",{"aria-hidden":!0,className:k("col-start-1 row-start-1","scale-50 opacity-0 transition duration-300 delay-50","group-aria-busy:scale-100 group-aria-busy:opacity-100"),children:b(x,{})})]}),b("span",{className:"font-medium",children:"Sign in"})]},"sign in")})}import{useConnectorClient as sa}from"wagmi";import{useMemo as ca}from"react";function da(){let{chainId:e}=p(),{data:t,error:n}=sa({chainId:e});n&&console.error("Error retrieving user client",n);let r=M(t?.account.address),a=ne(t);return ca(()=>{if(a.every(i=>i.isComplete))return r.data},[r.data,a])}import{connectorsForWallets as pa,getDefaultWallets as ua}from"@rainbow-me/rainbowkit";import{createConfig as ma}from"wagmi";var la=`data:image/svg+xml;base64,${btoa('<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" width="512" height="512" viewBox="-64 -32 608 512"><path d="M6.206 425.469A6.202 6.202 0 010 419.263c0-1.771.235-3.517.663-5.245 9.95-78.847 57.22-96.006 100.964-107.256 21.008-5.412 62.901-26.489 57.822-53.668-10.596-9.819-21.113-23.39-22.946-43.63l-1.274.026c-2.932-.044-5.778-.716-8.422-2.217-5.848-3.325-9.051-9.697-10.596-16.958-3.238-22.186-4.058-33.515 7.768-38.464l.096-.035c-1.467-27.37 3.159-67.64-24.944-76.141C154.622 7.1 218.597-30.203 266.627 30.805c53.519 2.801 77.389 78.611 44.154 121.046h-1.405c11.826 4.949 10.045 17.674 7.767 38.464-1.544 7.261-4.747 13.633-10.595 16.958-2.645 1.501-5.481 2.173-8.422 2.217l-1.275-.026c-1.833 20.24-12.376 33.811-22.972 43.63-4.459 23.871 27.275 43.011 49.33 50.997a139.442 139.442 0 004.268 5.525c-7.2 9.941-8.771 22.797-4.564 34.038-17.002 8.763-24.255 29.334-16.479 46.86-11.966 7.55-18.258 21.305-16.609 34.955H6.206zm419.058-105.362a86.778 86.778 0 0019.446-1.641c29.36-5.822 53.152-27.467 62.657-55.823 3.596-10.544 5.071-21.663 4.521-33.341-1.179-23.46-12.193-46.633-29.631-62.369-17.107-15.361-38.342-23.574-61.383-23.042-22.841.507-45.359 11.216-60.187 28.593-14.977 17.551-22.003 39.144-20.921 62.133.585 11.661 3.482 23.016 8.737 34.074 7.741 16.303 19.934 29.735 35.391 39.048l-22.457 20.711 13.232 27.86-29.413 13.973 13.991 29.456-26.769 12.717 16.81 35.374 35.601-16.915 40.375-110.808zm15.239-129.364c13.685 4.869 20.824 19.908 15.954 33.593-4.87 13.685-19.908 20.833-33.593 15.963-13.685-4.87-20.834-19.917-15.963-33.602 4.87-13.685 19.917-20.825 33.602-15.954z"/></svg>')}`,oe=e=>()=>({id:"passkey",name:"Passkey",iconUrl:la,iconBackground:"#fec",createConnector:t=>n=>({...S(e)(n),...t})});function fa(e){let{wallets:t}=ua(),n=[{groupName:"Recommended",wallets:[oe({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t],r=pa(n,{appName:e.appInfo.name,projectId:e.walletConnectProjectId});return ma({connectors:r,chains:e.chains,transports:e.transports})}function Cl(e){return e!=null&&"__isCoinbaseSmartAccount"in e&&e.__isCoinbaseSmartAccount===!0}var Al=new Set([17420,31337]);function Sl(e){return t=>{let{request:n,...r}=e(t),a=null,i=new Map;return{...r,async request(s){if(s.method==="eth_chainId")return a??(a=await n(s));if(s.method==="eth_getTransactionReceipt"){let o=s.params[0],l=i.get(o)??await n(s);return i.has(o)||i.set(o,l),l}if(s.method==="eth_sendUserOperation")return(await n({...s,method:"pimlico_sendUserOperationNow"})).userOpHash;if(s.method==="eth_getUserOperationReceipt"){let o=s.params[0],l=i.get(o)??await n(s);return i.has(o)||i.set(o,l),l}return n(s)}}}}import{connectorsForWallets as ga}from"@rainbow-me/rainbowkit";import{getDefaultWallets as ya}from"@rainbow-me/rainbowkit";function Nt(e){let{wallets:t}=ya();return[{groupName:"Recommended",wallets:[oe({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t]}function Ol({wallets:e,...t}){return ga(e??Nt(t),{appName:t.appInfo?.name??document.title,projectId:t.walletConnectProjectId})}export{ia as AccountButton,Zr as EntryKitProvider,U as abi,fa as createWagmiConfig,Ol as getConnectors,Nt as getWallets,Cl as isCoinbaseSmartAccount,S as passkeyConnector,oe as passkeyWallet,W as sign,G as toCoinbaseSmartAccount,le as toReplaySafeHash,bn as toWebAuthnSignature,y as useAccountModal,da as useAppAccountClient,p as useEntryKitConfig,Sl as wiresaw,Al as wiresawChainIds,R as wrapSignature};
|
|
1570
1452
|
//# sourceMappingURL=internal.js.map
|