@worldcoin/idkit 2.2.0 → 2.2.2

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.
@@ -0,0 +1,2371 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ IDKitWidget: () => IDKitWidget_default,
34
+ VerificationLevel: () => import_idkit_core7.VerificationLevel,
35
+ VerificationState: () => import_idkit_core7.VerificationState,
36
+ solidityEncode: () => import_hashing.solidityEncode,
37
+ useIDKit: () => useIDKit_default,
38
+ useSession: () => useSession,
39
+ verifyCloudProof: () => import_backend.verifyCloudProof
40
+ });
41
+ module.exports = __toCommonJS(src_exports);
42
+
43
+ // src/hooks/useIDKit.ts
44
+ var import_react = require("react");
45
+
46
+ // src/lang/index.ts
47
+ var translations = {};
48
+ var getLang = () => {
49
+ if (!navigator?.languages) return;
50
+ const supportedLang = navigator.languages.find((l) => translations[l] != void 0) ?? "";
51
+ return translations[supportedLang];
52
+ };
53
+ var replaceParams = (str, params) => {
54
+ let replaced = str;
55
+ for (const [key, value] of Object.entries(params ?? {})) replaced = str.replace(`:${key}`, value);
56
+ return replaced;
57
+ };
58
+ function __(str, params) {
59
+ if (typeof navigator === "undefined") return str;
60
+ return replaceParams(getLang()?.[str] ?? str, params);
61
+ }
62
+
63
+ // src/store/idkit.ts
64
+ var import_shallow = require("zustand/shallow");
65
+ var import_traditional = require("zustand/traditional");
66
+ var import_idkit_core = require("@worldcoin/idkit-core");
67
+ var SELF_HOSTED_APP_ID = "self_hosted";
68
+ var useIDKitStore = (0, import_traditional.createWithEqualityFn)()(
69
+ (set, get) => ({
70
+ app_id: "",
71
+ signal: "",
72
+ action: "",
73
+ action_description: "",
74
+ bridge_url: "",
75
+ verification_level: import_idkit_core.DEFAULT_VERIFICATION_LEVEL,
76
+ partner: false,
77
+ open: false,
78
+ result: null,
79
+ errorTitle: "",
80
+ errorDetail: "",
81
+ autoClose: true,
82
+ errorState: null,
83
+ processing: false,
84
+ errorCallbacks: {},
85
+ verifyCallbacks: {},
86
+ successCallbacks: {},
87
+ stage: "WORLD_ID" /* WORLD_ID */,
88
+ setStage: (stage) => set({ stage }),
89
+ setErrorState: (errorState) => set({ errorState }),
90
+ setProcessing: (processing) => set({ processing }),
91
+ retryFlow: () => {
92
+ set({ stage: "WORLD_ID" /* WORLD_ID */, errorState: null });
93
+ },
94
+ addErrorCallback: (cb, source) => {
95
+ set((state) => {
96
+ state.errorCallbacks[source] = cb;
97
+ return state;
98
+ });
99
+ },
100
+ addSuccessCallback: (cb, source) => {
101
+ set((state) => {
102
+ state.successCallbacks[source] = cb;
103
+ return state;
104
+ });
105
+ },
106
+ addVerificationCallback: (cb, source) => {
107
+ set((state) => {
108
+ state.verifyCallbacks[source] = cb;
109
+ return state;
110
+ });
111
+ },
112
+ setOptions: ({
113
+ handleVerify,
114
+ onSuccess,
115
+ signal,
116
+ action,
117
+ app_id,
118
+ partner,
119
+ onError,
120
+ verification_level,
121
+ action_description,
122
+ bridge_url,
123
+ autoClose,
124
+ advanced
125
+ }, source) => {
126
+ set({
127
+ signal,
128
+ action,
129
+ bridge_url,
130
+ action_description,
131
+ autoClose: autoClose ?? true,
132
+ app_id: advanced?.self_hosted ? SELF_HOSTED_APP_ID : app_id,
133
+ verification_level: verification_level ?? import_idkit_core.DEFAULT_VERIFICATION_LEVEL,
134
+ partner
135
+ });
136
+ get().addSuccessCallback(onSuccess, source);
137
+ if (onError) get().addErrorCallback(onError, source);
138
+ if (handleVerify) get().addVerificationCallback(handleVerify, source);
139
+ },
140
+ handleVerify: (result) => {
141
+ set({ stage: "HOST_APP_VERIFICATION" /* HOST_APP_VERIFICATION */, processing: false });
142
+ Promise.all(Object.values(get().verifyCallbacks).map(async (cb) => cb?.(result))).then(
143
+ () => {
144
+ set({ stage: "SUCCESS" /* SUCCESS */, result });
145
+ if (get().autoClose) setTimeout(() => get().onOpenChange(false), 2500);
146
+ },
147
+ (response) => {
148
+ let errorMessage = void 0;
149
+ if (response && typeof response === "object" && response.message) {
150
+ errorMessage = response.message;
151
+ }
152
+ set({
153
+ stage: "ERROR" /* ERROR */,
154
+ errorState: {
155
+ code: import_idkit_core.AppErrorCodes.FailedByHostApp,
156
+ message: errorMessage ? __(errorMessage) : void 0
157
+ }
158
+ });
159
+ }
160
+ );
161
+ },
162
+ onOpenChange: (open) => {
163
+ if (open) {
164
+ return set({ open });
165
+ }
166
+ const errorState = get().errorState;
167
+ if (get().stage === "ERROR" /* ERROR */ && errorState) {
168
+ const callbacks = get().errorCallbacks;
169
+ requestAnimationFrame(() => Object.values(callbacks).forEach((cb) => void cb?.(errorState)));
170
+ }
171
+ const result = get().result;
172
+ if (get().stage == "SUCCESS" /* SUCCESS */ && result) {
173
+ const callbacks = get().successCallbacks;
174
+ requestAnimationFrame(() => Object.values(callbacks).forEach((cb) => void cb?.(result)));
175
+ }
176
+ set({
177
+ open,
178
+ result: null,
179
+ errorState: null,
180
+ processing: false,
181
+ stage: "WORLD_ID" /* WORLD_ID */
182
+ });
183
+ }
184
+ }),
185
+ import_shallow.shallow
186
+ );
187
+ var idkit_default = useIDKitStore;
188
+
189
+ // src/hooks/useIDKit.ts
190
+ var getStore = ({ open, onOpenChange, addSuccessCallback, addVerificationCallback }) => ({
191
+ open,
192
+ onOpenChange,
193
+ addSuccessCallback,
194
+ addVerificationCallback
195
+ });
196
+ var useIDKit = ({ handleVerify, onSuccess } = {}) => {
197
+ const { open, onOpenChange, addSuccessCallback, addVerificationCallback } = idkit_default(getStore);
198
+ (0, import_react.useEffect)(() => {
199
+ if (onSuccess) addSuccessCallback(onSuccess, "hook" /* HOOK */);
200
+ if (handleVerify) addVerificationCallback(handleVerify, "hook" /* HOOK */);
201
+ }, [handleVerify, onSuccess]);
202
+ return { open, setOpen: onOpenChange };
203
+ };
204
+ var useIDKit_default = useIDKit;
205
+
206
+ // src/components/IDKitWidget/index.tsx
207
+ var import_react9 = require("react");
208
+
209
+ // src/hooks/useMedia.ts
210
+ var import_react2 = require("react");
211
+ var useMedia = () => {
212
+ const getInitialState = () => {
213
+ if (typeof window !== "undefined") {
214
+ return window.matchMedia("(max-width: 768px)").matches ? "mobile" : "desktop";
215
+ }
216
+ return "desktop";
217
+ };
218
+ const [media, setMedia] = (0, import_react2.useState)(getInitialState());
219
+ (0, import_react2.useEffect)(() => {
220
+ const mql = window.matchMedia("(max-width: 768px)");
221
+ const handleChange = (mql2) => setMedia(mql2.matches ? "mobile" : "desktop");
222
+ handleChange(mql);
223
+ mql.addEventListener("change", handleChange);
224
+ return () => {
225
+ mql.removeEventListener("change", handleChange);
226
+ };
227
+ }, []);
228
+ return media;
229
+ };
230
+ var useMedia_default = useMedia;
231
+
232
+ // src/components/IDKitWidget/BaseWidget.tsx
233
+ var import_react_dom2 = require("react-dom");
234
+
235
+ // src/styles/styles.css
236
+ var styles_default = `/* TODO: Use an alternative to avoid the extra request to Google (e.g. hosting ourselves, or local file) */
237
+ @import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&family=Sora:wght@600&display=swap');
238
+ /* ! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com */
239
+ /*
240
+ 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
241
+ 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
242
+ */
243
+ *,
244
+ ::before,
245
+ ::after {
246
+ box-sizing: border-box; /* 1 */
247
+ border-width: 0; /* 2 */
248
+ border-style: solid; /* 2 */
249
+ border-color: #e5e7eb; /* 2 */
250
+ }
251
+ ::before,
252
+ ::after {
253
+ --tw-content: '';
254
+ }
255
+ /*
256
+ 1. Use a consistent sensible line-height in all browsers.
257
+ 2. Prevent adjustments of font size after orientation changes in iOS.
258
+ 3. Use a more readable tab size.
259
+ 4. Use the user's configured \`sans\` font-family by default.
260
+ 5. Use the user's configured \`sans\` font-feature-settings by default.
261
+ 6. Use the user's configured \`sans\` font-variation-settings by default.
262
+ 7. Disable tap highlights on iOS
263
+ */
264
+ html,
265
+ :host {
266
+ line-height: 1.5; /* 1 */
267
+ -webkit-text-size-adjust: 100%; /* 2 */
268
+ -moz-tab-size: 4; /* 3 */
269
+ -o-tab-size: 4;
270
+ tab-size: 4; /* 3 */
271
+ font-family: Rubik, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
272
+ font-feature-settings: normal; /* 5 */
273
+ font-variation-settings: normal; /* 6 */
274
+ -webkit-tap-highlight-color: transparent; /* 7 */
275
+ }
276
+ /*
277
+ 1. Remove the margin in all browsers.
278
+ 2. Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element.
279
+ */
280
+ body {
281
+ margin: 0; /* 1 */
282
+ line-height: inherit; /* 2 */
283
+ }
284
+ /*
285
+ 1. Add the correct height in Firefox.
286
+ 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
287
+ 3. Ensure horizontal rules are visible by default.
288
+ */
289
+ hr {
290
+ height: 0; /* 1 */
291
+ color: inherit; /* 2 */
292
+ border-top-width: 1px; /* 3 */
293
+ }
294
+ /*
295
+ Add the correct text decoration in Chrome, Edge, and Safari.
296
+ */
297
+ abbr:where([title]) {
298
+ -webkit-text-decoration: underline dotted;
299
+ text-decoration: underline dotted;
300
+ }
301
+ /*
302
+ Remove the default font size and weight for headings.
303
+ */
304
+ h1,
305
+ h2,
306
+ h3,
307
+ h4,
308
+ h5,
309
+ h6 {
310
+ font-size: inherit;
311
+ font-weight: inherit;
312
+ }
313
+ /*
314
+ Reset links to optimize for opt-in styling instead of opt-out.
315
+ */
316
+ a {
317
+ color: inherit;
318
+ text-decoration: inherit;
319
+ }
320
+ /*
321
+ Add the correct font weight in Edge and Safari.
322
+ */
323
+ b,
324
+ strong {
325
+ font-weight: bolder;
326
+ }
327
+ /*
328
+ 1. Use the user's configured \`mono\` font-family by default.
329
+ 2. Use the user's configured \`mono\` font-feature-settings by default.
330
+ 3. Use the user's configured \`mono\` font-variation-settings by default.
331
+ 4. Correct the odd \`em\` font sizing in all browsers.
332
+ */
333
+ code,
334
+ kbd,
335
+ samp,
336
+ pre {
337
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
338
+ font-feature-settings: normal; /* 2 */
339
+ font-variation-settings: normal; /* 3 */
340
+ font-size: 1em; /* 4 */
341
+ }
342
+ /*
343
+ Add the correct font size in all browsers.
344
+ */
345
+ small {
346
+ font-size: 80%;
347
+ }
348
+ /*
349
+ Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.
350
+ */
351
+ sub,
352
+ sup {
353
+ font-size: 75%;
354
+ line-height: 0;
355
+ position: relative;
356
+ vertical-align: baseline;
357
+ }
358
+ sub {
359
+ bottom: -0.25em;
360
+ }
361
+ sup {
362
+ top: -0.5em;
363
+ }
364
+ /*
365
+ 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
366
+ 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
367
+ 3. Remove gaps between table borders by default.
368
+ */
369
+ table {
370
+ text-indent: 0; /* 1 */
371
+ border-color: inherit; /* 2 */
372
+ border-collapse: collapse; /* 3 */
373
+ }
374
+ /*
375
+ 1. Change the font styles in all browsers.
376
+ 2. Remove the margin in Firefox and Safari.
377
+ 3. Remove default padding in all browsers.
378
+ */
379
+ button,
380
+ input,
381
+ optgroup,
382
+ select,
383
+ textarea {
384
+ font-family: inherit; /* 1 */
385
+ font-feature-settings: inherit; /* 1 */
386
+ font-variation-settings: inherit; /* 1 */
387
+ font-size: 100%; /* 1 */
388
+ font-weight: inherit; /* 1 */
389
+ line-height: inherit; /* 1 */
390
+ letter-spacing: inherit; /* 1 */
391
+ color: inherit; /* 1 */
392
+ margin: 0; /* 2 */
393
+ padding: 0; /* 3 */
394
+ }
395
+ /*
396
+ Remove the inheritance of text transform in Edge and Firefox.
397
+ */
398
+ button,
399
+ select {
400
+ text-transform: none;
401
+ }
402
+ /*
403
+ 1. Correct the inability to style clickable types in iOS and Safari.
404
+ 2. Remove default button styles.
405
+ */
406
+ button,
407
+ input:where([type='button']),
408
+ input:where([type='reset']),
409
+ input:where([type='submit']) {
410
+ -webkit-appearance: button; /* 1 */
411
+ background-color: transparent; /* 2 */
412
+ background-image: none; /* 2 */
413
+ }
414
+ /*
415
+ Use the modern Firefox focus style for all focusable elements.
416
+ */
417
+ :-moz-focusring {
418
+ outline: auto;
419
+ }
420
+ /*
421
+ Remove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
422
+ */
423
+ :-moz-ui-invalid {
424
+ box-shadow: none;
425
+ }
426
+ /*
427
+ Add the correct vertical alignment in Chrome and Firefox.
428
+ */
429
+ progress {
430
+ vertical-align: baseline;
431
+ }
432
+ /*
433
+ Correct the cursor style of increment and decrement buttons in Safari.
434
+ */
435
+ ::-webkit-inner-spin-button,
436
+ ::-webkit-outer-spin-button {
437
+ height: auto;
438
+ }
439
+ /*
440
+ 1. Correct the odd appearance in Chrome and Safari.
441
+ 2. Correct the outline style in Safari.
442
+ */
443
+ [type='search'] {
444
+ -webkit-appearance: textfield; /* 1 */
445
+ outline-offset: -2px; /* 2 */
446
+ }
447
+ /*
448
+ Remove the inner padding in Chrome and Safari on macOS.
449
+ */
450
+ ::-webkit-search-decoration {
451
+ -webkit-appearance: none;
452
+ }
453
+ /*
454
+ 1. Correct the inability to style clickable types in iOS and Safari.
455
+ 2. Change font properties to \`inherit\` in Safari.
456
+ */
457
+ ::-webkit-file-upload-button {
458
+ -webkit-appearance: button; /* 1 */
459
+ font: inherit; /* 2 */
460
+ }
461
+ /*
462
+ Add the correct display in Chrome and Safari.
463
+ */
464
+ summary {
465
+ display: list-item;
466
+ }
467
+ /*
468
+ Removes the default spacing and border for appropriate elements.
469
+ */
470
+ blockquote,
471
+ dl,
472
+ dd,
473
+ h1,
474
+ h2,
475
+ h3,
476
+ h4,
477
+ h5,
478
+ h6,
479
+ hr,
480
+ figure,
481
+ p,
482
+ pre {
483
+ margin: 0;
484
+ }
485
+ fieldset {
486
+ margin: 0;
487
+ padding: 0;
488
+ }
489
+ legend {
490
+ padding: 0;
491
+ }
492
+ ol,
493
+ ul,
494
+ menu {
495
+ list-style: none;
496
+ margin: 0;
497
+ padding: 0;
498
+ }
499
+ /*
500
+ Reset default styling for dialogs.
501
+ */
502
+ dialog {
503
+ padding: 0;
504
+ }
505
+ /*
506
+ Prevent resizing textareas horizontally by default.
507
+ */
508
+ textarea {
509
+ resize: vertical;
510
+ }
511
+ /*
512
+ 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
513
+ 2. Set the default placeholder color to the user's configured gray 400 color.
514
+ */
515
+ input::-moz-placeholder, textarea::-moz-placeholder {
516
+ opacity: 1; /* 1 */
517
+ color: #9ca3af; /* 2 */
518
+ }
519
+ input::placeholder,
520
+ textarea::placeholder {
521
+ opacity: 1; /* 1 */
522
+ color: #9ca3af; /* 2 */
523
+ }
524
+ /*
525
+ Set the default cursor for buttons.
526
+ */
527
+ button,
528
+ [role="button"] {
529
+ cursor: pointer;
530
+ }
531
+ /*
532
+ Make sure disabled buttons don't get the pointer cursor.
533
+ */
534
+ :disabled {
535
+ cursor: default;
536
+ }
537
+ /*
538
+ 1. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
539
+ 2. Add \`vertical-align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
540
+ This can trigger a poorly considered lint error in some tools but is included by design.
541
+ */
542
+ img,
543
+ svg,
544
+ video,
545
+ canvas,
546
+ audio,
547
+ iframe,
548
+ embed,
549
+ object {
550
+ display: block; /* 1 */
551
+ vertical-align: middle; /* 2 */
552
+ }
553
+ /*
554
+ Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
555
+ */
556
+ img,
557
+ video {
558
+ max-width: 100%;
559
+ height: auto;
560
+ }
561
+ /* Make elements with the HTML hidden attribute stay hidden by default */
562
+ [hidden] {
563
+ display: none;
564
+ }
565
+ [type='text'],input:where(:not([type])),[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select{
566
+ -webkit-appearance: none;
567
+ -moz-appearance: none;
568
+ appearance: none;
569
+ background-color: #fff;
570
+ border-color: #6b7280;
571
+ border-width: 1px;
572
+ border-radius: 0px;
573
+ padding-top: 0.5rem;
574
+ padding-right: 0.75rem;
575
+ padding-bottom: 0.5rem;
576
+ padding-left: 0.75rem;
577
+ font-size: 1rem;
578
+ line-height: 1.5rem;
579
+ --tw-shadow: 0 0 #0000;
580
+ }
581
+ [type='text']:focus, input:where(:not([type])):focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus{
582
+ outline: 2px solid transparent;
583
+ outline-offset: 2px;
584
+ --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
585
+ --tw-ring-offset-width: 0px;
586
+ --tw-ring-offset-color: #fff;
587
+ --tw-ring-color: #2563eb;
588
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
589
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
590
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
591
+ border-color: #2563eb;
592
+ }
593
+ input::-moz-placeholder, textarea::-moz-placeholder{
594
+ color: #6b7280;
595
+ opacity: 1;
596
+ }
597
+ input::placeholder,textarea::placeholder{
598
+ color: #6b7280;
599
+ opacity: 1;
600
+ }
601
+ ::-webkit-datetime-edit-fields-wrapper{
602
+ padding: 0;
603
+ }
604
+ ::-webkit-date-and-time-value{
605
+ min-height: 1.5em;
606
+ text-align: inherit;
607
+ }
608
+ ::-webkit-datetime-edit{
609
+ display: inline-flex;
610
+ }
611
+ ::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{
612
+ padding-top: 0;
613
+ padding-bottom: 0;
614
+ }
615
+ select{
616
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
617
+ background-position: right 0.5rem center;
618
+ background-repeat: no-repeat;
619
+ background-size: 1.5em 1.5em;
620
+ padding-right: 2.5rem;
621
+ -webkit-print-color-adjust: exact;
622
+ print-color-adjust: exact;
623
+ }
624
+ [multiple],[size]:where(select:not([size="1"])){
625
+ background-image: initial;
626
+ background-position: initial;
627
+ background-repeat: unset;
628
+ background-size: initial;
629
+ padding-right: 0.75rem;
630
+ -webkit-print-color-adjust: unset;
631
+ print-color-adjust: unset;
632
+ }
633
+ [type='checkbox'],[type='radio']{
634
+ -webkit-appearance: none;
635
+ -moz-appearance: none;
636
+ appearance: none;
637
+ padding: 0;
638
+ -webkit-print-color-adjust: exact;
639
+ print-color-adjust: exact;
640
+ display: inline-block;
641
+ vertical-align: middle;
642
+ background-origin: border-box;
643
+ -webkit-user-select: none;
644
+ -moz-user-select: none;
645
+ user-select: none;
646
+ flex-shrink: 0;
647
+ height: 1rem;
648
+ width: 1rem;
649
+ color: #2563eb;
650
+ background-color: #fff;
651
+ border-color: #6b7280;
652
+ border-width: 1px;
653
+ --tw-shadow: 0 0 #0000;
654
+ }
655
+ [type='checkbox']{
656
+ border-radius: 0px;
657
+ }
658
+ [type='radio']{
659
+ border-radius: 100%;
660
+ }
661
+ [type='checkbox']:focus,[type='radio']:focus{
662
+ outline: 2px solid transparent;
663
+ outline-offset: 2px;
664
+ --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
665
+ --tw-ring-offset-width: 2px;
666
+ --tw-ring-offset-color: #fff;
667
+ --tw-ring-color: #2563eb;
668
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
669
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
670
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
671
+ }
672
+ [type='checkbox']:checked,[type='radio']:checked{
673
+ border-color: transparent;
674
+ background-color: currentColor;
675
+ background-size: 100% 100%;
676
+ background-position: center;
677
+ background-repeat: no-repeat;
678
+ }
679
+ [type='checkbox']:checked{
680
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
681
+ }
682
+ @media (forced-colors: active) {
683
+ [type='checkbox']:checked{
684
+ -webkit-appearance: auto;
685
+ -moz-appearance: auto;
686
+ appearance: auto;
687
+ }
688
+ }
689
+ [type='radio']:checked{
690
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
691
+ }
692
+ @media (forced-colors: active) {
693
+ [type='radio']:checked{
694
+ -webkit-appearance: auto;
695
+ -moz-appearance: auto;
696
+ appearance: auto;
697
+ }
698
+ }
699
+ [type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus{
700
+ border-color: transparent;
701
+ background-color: currentColor;
702
+ }
703
+ [type='checkbox']:indeterminate{
704
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
705
+ border-color: transparent;
706
+ background-color: currentColor;
707
+ background-size: 100% 100%;
708
+ background-position: center;
709
+ background-repeat: no-repeat;
710
+ }
711
+ @media (forced-colors: active) {
712
+ [type='checkbox']:indeterminate{
713
+ -webkit-appearance: auto;
714
+ -moz-appearance: auto;
715
+ appearance: auto;
716
+ }
717
+ }
718
+ [type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus{
719
+ border-color: transparent;
720
+ background-color: currentColor;
721
+ }
722
+ [type='file']{
723
+ background: unset;
724
+ border-color: inherit;
725
+ border-width: 0;
726
+ border-radius: 0;
727
+ padding: 0;
728
+ font-size: unset;
729
+ line-height: inherit;
730
+ }
731
+ [type='file']:focus{
732
+ outline: 1px solid ButtonText;
733
+ outline: 1px auto -webkit-focus-ring-color;
734
+ }
735
+ *, ::before, ::after{
736
+ --tw-border-spacing-x: 0;
737
+ --tw-border-spacing-y: 0;
738
+ --tw-translate-x: 0;
739
+ --tw-translate-y: 0;
740
+ --tw-rotate: 0;
741
+ --tw-skew-x: 0;
742
+ --tw-skew-y: 0;
743
+ --tw-scale-x: 1;
744
+ --tw-scale-y: 1;
745
+ --tw-pan-x: ;
746
+ --tw-pan-y: ;
747
+ --tw-pinch-zoom: ;
748
+ --tw-scroll-snap-strictness: proximity;
749
+ --tw-gradient-from-position: ;
750
+ --tw-gradient-via-position: ;
751
+ --tw-gradient-to-position: ;
752
+ --tw-ordinal: ;
753
+ --tw-slashed-zero: ;
754
+ --tw-numeric-figure: ;
755
+ --tw-numeric-spacing: ;
756
+ --tw-numeric-fraction: ;
757
+ --tw-ring-inset: ;
758
+ --tw-ring-offset-width: 0px;
759
+ --tw-ring-offset-color: #fff;
760
+ --tw-ring-color: rgb(59 130 246 / 0.5);
761
+ --tw-ring-offset-shadow: 0 0 #0000;
762
+ --tw-ring-shadow: 0 0 #0000;
763
+ --tw-shadow: 0 0 #0000;
764
+ --tw-shadow-colored: 0 0 #0000;
765
+ --tw-blur: ;
766
+ --tw-brightness: ;
767
+ --tw-contrast: ;
768
+ --tw-grayscale: ;
769
+ --tw-hue-rotate: ;
770
+ --tw-invert: ;
771
+ --tw-saturate: ;
772
+ --tw-sepia: ;
773
+ --tw-drop-shadow: ;
774
+ --tw-backdrop-blur: ;
775
+ --tw-backdrop-brightness: ;
776
+ --tw-backdrop-contrast: ;
777
+ --tw-backdrop-grayscale: ;
778
+ --tw-backdrop-hue-rotate: ;
779
+ --tw-backdrop-invert: ;
780
+ --tw-backdrop-opacity: ;
781
+ --tw-backdrop-saturate: ;
782
+ --tw-backdrop-sepia: ;
783
+ --tw-contain-size: ;
784
+ --tw-contain-layout: ;
785
+ --tw-contain-paint: ;
786
+ --tw-contain-style: ;
787
+ }
788
+ ::backdrop{
789
+ --tw-border-spacing-x: 0;
790
+ --tw-border-spacing-y: 0;
791
+ --tw-translate-x: 0;
792
+ --tw-translate-y: 0;
793
+ --tw-rotate: 0;
794
+ --tw-skew-x: 0;
795
+ --tw-skew-y: 0;
796
+ --tw-scale-x: 1;
797
+ --tw-scale-y: 1;
798
+ --tw-pan-x: ;
799
+ --tw-pan-y: ;
800
+ --tw-pinch-zoom: ;
801
+ --tw-scroll-snap-strictness: proximity;
802
+ --tw-gradient-from-position: ;
803
+ --tw-gradient-via-position: ;
804
+ --tw-gradient-to-position: ;
805
+ --tw-ordinal: ;
806
+ --tw-slashed-zero: ;
807
+ --tw-numeric-figure: ;
808
+ --tw-numeric-spacing: ;
809
+ --tw-numeric-fraction: ;
810
+ --tw-ring-inset: ;
811
+ --tw-ring-offset-width: 0px;
812
+ --tw-ring-offset-color: #fff;
813
+ --tw-ring-color: rgb(59 130 246 / 0.5);
814
+ --tw-ring-offset-shadow: 0 0 #0000;
815
+ --tw-ring-shadow: 0 0 #0000;
816
+ --tw-shadow: 0 0 #0000;
817
+ --tw-shadow-colored: 0 0 #0000;
818
+ --tw-blur: ;
819
+ --tw-brightness: ;
820
+ --tw-contrast: ;
821
+ --tw-grayscale: ;
822
+ --tw-hue-rotate: ;
823
+ --tw-invert: ;
824
+ --tw-saturate: ;
825
+ --tw-sepia: ;
826
+ --tw-drop-shadow: ;
827
+ --tw-backdrop-blur: ;
828
+ --tw-backdrop-brightness: ;
829
+ --tw-backdrop-contrast: ;
830
+ --tw-backdrop-grayscale: ;
831
+ --tw-backdrop-hue-rotate: ;
832
+ --tw-backdrop-invert: ;
833
+ --tw-backdrop-opacity: ;
834
+ --tw-backdrop-saturate: ;
835
+ --tw-backdrop-sepia: ;
836
+ --tw-contain-size: ;
837
+ --tw-contain-layout: ;
838
+ --tw-contain-paint: ;
839
+ --tw-contain-style: ;
840
+ }
841
+ .container{
842
+ width: 100%;
843
+ }
844
+ @media (min-width: 414px){
845
+ .container{
846
+ max-width: 414px;
847
+ }
848
+ }
849
+ @media (min-width: 640px){
850
+ .container{
851
+ max-width: 640px;
852
+ }
853
+ }
854
+ @media (min-width: 768px){
855
+ .container{
856
+ max-width: 768px;
857
+ }
858
+ }
859
+ @media (min-width: 1024px){
860
+ .container{
861
+ max-width: 1024px;
862
+ }
863
+ }
864
+ @media (min-width: 1280px){
865
+ .container{
866
+ max-width: 1280px;
867
+ }
868
+ }
869
+ @media (min-width: 1536px){
870
+ .container{
871
+ max-width: 1536px;
872
+ }
873
+ }
874
+ .visible{
875
+ visibility: visible;
876
+ }
877
+ .fixed{
878
+ position: fixed;
879
+ }
880
+ .absolute{
881
+ position: absolute;
882
+ }
883
+ .relative{
884
+ position: relative;
885
+ }
886
+ .inset-0{
887
+ inset: 0;
888
+ }
889
+ .z-50{
890
+ z-index: 50;
891
+ }
892
+ .z-\\[9999\\]{
893
+ z-index: 9999;
894
+ }
895
+ .mx-6{
896
+ margin-left: 24px;
897
+ margin-right: 24px;
898
+ }
899
+ .mx-auto{
900
+ margin-left: auto;
901
+ margin-right: auto;
902
+ }
903
+ .-mt-5{
904
+ margin-top: -20px;
905
+ }
906
+ .-mt-6{
907
+ margin-top: -24px;
908
+ }
909
+ .mb-10{
910
+ margin-bottom: 40px;
911
+ }
912
+ .mb-12{
913
+ margin-bottom: 48px;
914
+ }
915
+ .mb-3{
916
+ margin-bottom: 12px;
917
+ }
918
+ .mb-4{
919
+ margin-bottom: 16px;
920
+ }
921
+ .mb-6{
922
+ margin-bottom: 24px;
923
+ }
924
+ .mr-1{
925
+ margin-right: 4px;
926
+ }
927
+ .mr-1\\.5{
928
+ margin-right: 6px;
929
+ }
930
+ .mt-2{
931
+ margin-top: 8px;
932
+ }
933
+ .mt-3{
934
+ margin-top: 12px;
935
+ }
936
+ .mt-4{
937
+ margin-top: 16px;
938
+ }
939
+ .inline{
940
+ display: inline;
941
+ }
942
+ .flex{
943
+ display: flex;
944
+ }
945
+ .inline-flex{
946
+ display: inline-flex;
947
+ }
948
+ .hidden{
949
+ display: none;
950
+ }
951
+ .size-11{
952
+ width: 44px;
953
+ height: 44px;
954
+ }
955
+ .size-24{
956
+ width: 96px;
957
+ height: 96px;
958
+ }
959
+ .size-5{
960
+ width: 20px;
961
+ height: 20px;
962
+ }
963
+ .size-6{
964
+ width: 24px;
965
+ height: 24px;
966
+ }
967
+ .size-\\[244px\\]{
968
+ width: 244px;
969
+ height: 244px;
970
+ }
971
+ .h-10{
972
+ height: 40px;
973
+ }
974
+ .min-h-full{
975
+ min-height: 100%;
976
+ }
977
+ .min-h-screen{
978
+ min-height: 100vh;
979
+ }
980
+ .w-24{
981
+ width: 96px;
982
+ }
983
+ .w-full{
984
+ width: 100%;
985
+ }
986
+ .max-w-\\[224px\\]{
987
+ max-width: 224px;
988
+ }
989
+ .flex-1{
990
+ flex: 1 1 0%;
991
+ }
992
+ @keyframes pulse{
993
+ 50%{
994
+ opacity: .5;
995
+ }
996
+ }
997
+ .animate-pulse{
998
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
999
+ }
1000
+ @keyframes spin{
1001
+ to{
1002
+ transform: rotate(360deg);
1003
+ }
1004
+ }
1005
+ .animate-spin{
1006
+ animation: spin 1s linear infinite;
1007
+ }
1008
+ .cursor-pointer{
1009
+ cursor: pointer;
1010
+ }
1011
+ .flex-col{
1012
+ flex-direction: column;
1013
+ }
1014
+ .items-end{
1015
+ align-items: flex-end;
1016
+ }
1017
+ .items-center{
1018
+ align-items: center;
1019
+ }
1020
+ .justify-center{
1021
+ justify-content: center;
1022
+ }
1023
+ .justify-between{
1024
+ justify-content: space-between;
1025
+ }
1026
+ .space-x-2 > :not([hidden]) ~ :not([hidden]){
1027
+ --tw-space-x-reverse: 0;
1028
+ margin-right: calc(8px * var(--tw-space-x-reverse));
1029
+ margin-left: calc(8px * calc(1 - var(--tw-space-x-reverse)));
1030
+ }
1031
+ .space-x-4 > :not([hidden]) ~ :not([hidden]){
1032
+ --tw-space-x-reverse: 0;
1033
+ margin-right: calc(16px * var(--tw-space-x-reverse));
1034
+ margin-left: calc(16px * calc(1 - var(--tw-space-x-reverse)));
1035
+ }
1036
+ .space-y-10 > :not([hidden]) ~ :not([hidden]){
1037
+ --tw-space-y-reverse: 0;
1038
+ margin-top: calc(40px * calc(1 - var(--tw-space-y-reverse)));
1039
+ margin-bottom: calc(40px * var(--tw-space-y-reverse));
1040
+ }
1041
+ .space-y-4 > :not([hidden]) ~ :not([hidden]){
1042
+ --tw-space-y-reverse: 0;
1043
+ margin-top: calc(16px * calc(1 - var(--tw-space-y-reverse)));
1044
+ margin-bottom: calc(16px * var(--tw-space-y-reverse));
1045
+ }
1046
+ .space-y-5 > :not([hidden]) ~ :not([hidden]){
1047
+ --tw-space-y-reverse: 0;
1048
+ margin-top: calc(20px * calc(1 - var(--tw-space-y-reverse)));
1049
+ margin-bottom: calc(20px * var(--tw-space-y-reverse));
1050
+ }
1051
+ .space-y-6 > :not([hidden]) ~ :not([hidden]){
1052
+ --tw-space-y-reverse: 0;
1053
+ margin-top: calc(24px * calc(1 - var(--tw-space-y-reverse)));
1054
+ margin-bottom: calc(24px * var(--tw-space-y-reverse));
1055
+ }
1056
+ .space-y-8 > :not([hidden]) ~ :not([hidden]){
1057
+ --tw-space-y-reverse: 0;
1058
+ margin-top: calc(32px * calc(1 - var(--tw-space-y-reverse)));
1059
+ margin-bottom: calc(32px * var(--tw-space-y-reverse));
1060
+ }
1061
+ .overflow-y-hidden{
1062
+ overflow-y: hidden;
1063
+ }
1064
+ .rounded-2xl{
1065
+ border-radius: 1rem;
1066
+ }
1067
+ .rounded-full{
1068
+ border-radius: 9999px;
1069
+ }
1070
+ .rounded-lg{
1071
+ border-radius: 0.5rem;
1072
+ }
1073
+ .border{
1074
+ border-width: 1px;
1075
+ }
1076
+ .border-t{
1077
+ border-top-width: 1px;
1078
+ }
1079
+ .border-ebecef{
1080
+ --tw-border-opacity: 1;
1081
+ border-color: rgb(235 236 239 / var(--tw-border-opacity));
1082
+ }
1083
+ .border-f1f5f8{
1084
+ --tw-border-opacity: 1;
1085
+ border-color: rgb(241 245 248 / var(--tw-border-opacity));
1086
+ }
1087
+ .border-f5f5f7{
1088
+ --tw-border-opacity: 1;
1089
+ border-color: rgb(245 245 247 / var(--tw-border-opacity));
1090
+ }
1091
+ .border-transparent{
1092
+ border-color: transparent;
1093
+ }
1094
+ .bg-0d151d{
1095
+ --tw-bg-opacity: 1;
1096
+ background-color: rgb(13 21 29 / var(--tw-bg-opacity));
1097
+ }
1098
+ .bg-black\\/50{
1099
+ background-color: rgb(0 0 0 / 0.5);
1100
+ }
1101
+ .bg-transparent{
1102
+ background-color: transparent;
1103
+ }
1104
+ .bg-white{
1105
+ --tw-bg-opacity: 1;
1106
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
1107
+ }
1108
+ .p-2{
1109
+ padding: 8px;
1110
+ }
1111
+ .p-4{
1112
+ padding: 16px;
1113
+ }
1114
+ .p-7{
1115
+ padding: 28px;
1116
+ }
1117
+ .px-2{
1118
+ padding-left: 8px;
1119
+ padding-right: 8px;
1120
+ }
1121
+ .px-8{
1122
+ padding-left: 32px;
1123
+ padding-right: 32px;
1124
+ }
1125
+ .py-1{
1126
+ padding-top: 4px;
1127
+ padding-bottom: 4px;
1128
+ }
1129
+ .py-3{
1130
+ padding-top: 12px;
1131
+ padding-bottom: 12px;
1132
+ }
1133
+ .pt-6{
1134
+ padding-top: 24px;
1135
+ }
1136
+ .text-center{
1137
+ text-align: center;
1138
+ }
1139
+ .font-sans{
1140
+ font-family: Rubik, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
1141
+ }
1142
+ .font-sora{
1143
+ font-family: Sora, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
1144
+ }
1145
+ .text-2xl{
1146
+ font-size: 24px;
1147
+ line-height: 32px;
1148
+ }
1149
+ .text-lg{
1150
+ font-size: 18px;
1151
+ line-height: 28px;
1152
+ }
1153
+ .text-sm{
1154
+ font-size: 14px;
1155
+ line-height: 20px;
1156
+ }
1157
+ .text-xs{
1158
+ font-size: 12px;
1159
+ line-height: 16px;
1160
+ }
1161
+ .font-bold{
1162
+ font-weight: 700;
1163
+ }
1164
+ .font-medium{
1165
+ font-weight: 500;
1166
+ }
1167
+ .font-semibold{
1168
+ font-weight: 600;
1169
+ }
1170
+ .text-0d151d{
1171
+ --tw-text-opacity: 1;
1172
+ color: rgb(13 21 29 / var(--tw-text-opacity));
1173
+ }
1174
+ .text-29343f{
1175
+ --tw-text-opacity: 1;
1176
+ color: rgb(41 52 63 / var(--tw-text-opacity));
1177
+ }
1178
+ .text-3c424b{
1179
+ --tw-text-opacity: 1;
1180
+ color: rgb(60 66 75 / var(--tw-text-opacity));
1181
+ }
1182
+ .text-657080{
1183
+ --tw-text-opacity: 1;
1184
+ color: rgb(101 112 128 / var(--tw-text-opacity));
1185
+ }
1186
+ .text-70868f{
1187
+ --tw-text-opacity: 1;
1188
+ color: rgb(112 134 143 / var(--tw-text-opacity));
1189
+ }
1190
+ .text-9ba3ae{
1191
+ --tw-text-opacity: 1;
1192
+ color: rgb(155 163 174 / var(--tw-text-opacity));
1193
+ }
1194
+ .text-9eafc0{
1195
+ --tw-text-opacity: 1;
1196
+ color: rgb(158 175 192 / var(--tw-text-opacity));
1197
+ }
1198
+ .text-black{
1199
+ --tw-text-opacity: 1;
1200
+ color: rgb(0 0 0 / var(--tw-text-opacity));
1201
+ }
1202
+ .text-gray-900{
1203
+ --tw-text-opacity: 1;
1204
+ color: rgb(17 24 39 / var(--tw-text-opacity));
1205
+ }
1206
+ .text-red-500{
1207
+ --tw-text-opacity: 1;
1208
+ color: rgb(239 68 68 / var(--tw-text-opacity));
1209
+ }
1210
+ .text-white{
1211
+ --tw-text-opacity: 1;
1212
+ color: rgb(255 255 255 / var(--tw-text-opacity));
1213
+ }
1214
+ .opacity-40{
1215
+ opacity: 0.4;
1216
+ }
1217
+ .shadow{
1218
+ --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
1219
+ --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
1220
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1221
+ }
1222
+ .shadow-sm{
1223
+ --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
1224
+ --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
1225
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1226
+ }
1227
+ .blur-lg{
1228
+ --tw-blur: blur(16px);
1229
+ 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);
1230
+ }
1231
+ .filter{
1232
+ 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);
1233
+ }
1234
+ .backdrop-blur-lg{
1235
+ --tw-backdrop-blur: blur(16px);
1236
+ -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
1237
+ backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
1238
+ }
1239
+ .transition{
1240
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
1241
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
1242
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
1243
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1244
+ transition-duration: 150ms;
1245
+ }
1246
+ .duration-300{
1247
+ transition-duration: 300ms;
1248
+ }
1249
+ .duration-500{
1250
+ transition-duration: 500ms;
1251
+ }
1252
+ .ease-in-out{
1253
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1254
+ }
1255
+ input[type='number']::-webkit-inner-spin-button,
1256
+ input[type='number']::-webkit-outer-spin-button{
1257
+ -webkit-appearance: none;
1258
+ appearance: none;
1259
+ }
1260
+
1261
+ .hover\\:underline:hover{
1262
+ text-decoration-line: underline;
1263
+ }
1264
+
1265
+ .hover\\:shadow:hover{
1266
+ --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
1267
+ --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
1268
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1269
+ }
1270
+
1271
+ .focus\\:outline-none:focus{
1272
+ outline: 2px solid transparent;
1273
+ outline-offset: 2px;
1274
+ }
1275
+
1276
+ .focus\\:ring-2:focus{
1277
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1278
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1279
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1280
+ }
1281
+
1282
+ .focus\\:ring-indigo-500:focus{
1283
+ --tw-ring-opacity: 1;
1284
+ --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity));
1285
+ }
1286
+
1287
+ .focus\\:ring-offset-2:focus{
1288
+ --tw-ring-offset-width: 2px;
1289
+ }
1290
+
1291
+ .focus-visible\\:ring:focus-visible{
1292
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1293
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1294
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1295
+ }
1296
+
1297
+ .focus-visible\\:ring-purple-500\\/75:focus-visible{
1298
+ --tw-ring-color: rgb(168 85 247 / 0.75);
1299
+ }
1300
+
1301
+ .disabled\\:cursor-not-allowed:disabled{
1302
+ cursor: not-allowed;
1303
+ }
1304
+
1305
+ .disabled\\:opacity-40:disabled{
1306
+ opacity: 0.4;
1307
+ }
1308
+
1309
+ @media (prefers-reduced-motion: reduce){
1310
+ @keyframes spin{
1311
+ to{
1312
+ transform: rotate(360deg);
1313
+ }
1314
+ }
1315
+ .motion-reduce\\:animate-\\[spin_1\\.5s_linear_infinite\\]{
1316
+ animation: spin 1.5s linear infinite;
1317
+ }
1318
+ }
1319
+
1320
+ .dark\\:border-f1f5f8\\/10:is(.dark *){
1321
+ border-color: rgb(241 245 248 / 0.1);
1322
+ }
1323
+
1324
+ .dark\\:bg-0d151d:is(.dark *){
1325
+ --tw-bg-opacity: 1;
1326
+ background-color: rgb(13 21 29 / var(--tw-bg-opacity));
1327
+ }
1328
+
1329
+ .dark\\:bg-white:is(.dark *){
1330
+ --tw-bg-opacity: 1;
1331
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
1332
+ }
1333
+
1334
+ .dark\\:text-0d151d:is(.dark *){
1335
+ --tw-text-opacity: 1;
1336
+ color: rgb(13 21 29 / var(--tw-text-opacity));
1337
+ }
1338
+
1339
+ .dark\\:text-9eafc0:is(.dark *){
1340
+ --tw-text-opacity: 1;
1341
+ color: rgb(158 175 192 / var(--tw-text-opacity));
1342
+ }
1343
+
1344
+ .dark\\:text-white:is(.dark *){
1345
+ --tw-text-opacity: 1;
1346
+ color: rgb(255 255 255 / var(--tw-text-opacity));
1347
+ }
1348
+
1349
+ @media (min-width: 768px){
1350
+ .md\\:mt-2{
1351
+ margin-top: 8px;
1352
+ }
1353
+ .md\\:hidden{
1354
+ display: none;
1355
+ }
1356
+ .md\\:min-h-\\[35rem\\]{
1357
+ min-height: 35rem;
1358
+ }
1359
+ .md\\:max-w-md{
1360
+ max-width: 448px;
1361
+ }
1362
+ .md\\:items-center{
1363
+ align-items: center;
1364
+ }
1365
+ .md\\:overflow-y-auto{
1366
+ overflow-y: auto;
1367
+ }
1368
+ .md\\:rounded-2xl{
1369
+ border-radius: 1rem;
1370
+ }
1371
+ .md\\:rounded-b-2xl{
1372
+ border-bottom-right-radius: 1rem;
1373
+ border-bottom-left-radius: 1rem;
1374
+ }
1375
+ .md\\:p-4{
1376
+ padding: 16px;
1377
+ }
1378
+ }
1379
+ `;
1380
+
1381
+ // src/components/Styles.tsx
1382
+ var import_jsx_runtime = require("react/jsx-runtime");
1383
+ var Styles = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: styles_default });
1384
+ var Styles_default = Styles;
1385
+
1386
+ // src/components/IDKitWidget/ShadowHost.tsx
1387
+ var import_react_dom = __toESM(require("react-dom"), 1);
1388
+ var import_react3 = require("react");
1389
+ var import_jsx_runtime2 = require("react/jsx-runtime");
1390
+ var ShadowHost = ({ id, children, mode = "open", delegatesFocus = false }) => {
1391
+ const [shadowRoot, setShadowRoot] = (0, import_react3.useState)(null);
1392
+ const hostRef = (0, import_react3.useCallback)(
1393
+ (node) => {
1394
+ if (node) {
1395
+ const root = node.shadowRoot ?? node.attachShadow({ mode, delegatesFocus });
1396
+ setShadowRoot(root);
1397
+ }
1398
+ },
1399
+ [mode, delegatesFocus]
1400
+ );
1401
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: hostRef, id, children: shadowRoot && import_react_dom.default.createPortal(children, shadowRoot) });
1402
+ };
1403
+
1404
+ // src/components/IDKitWidget/BaseWidget.tsx
1405
+ var import_shallow3 = require("zustand/shallow");
1406
+
1407
+ // src/components/Icons/XMarkIcon.tsx
1408
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1409
+ var XMarkIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1410
+ "path",
1411
+ {
1412
+ strokeWidth: "1.5",
1413
+ stroke: "currentColor",
1414
+ strokeLinecap: "round",
1415
+ strokeLinejoin: "round",
1416
+ d: "m16.243 7.758-8.485 8.485m8.485 0L7.758 7.758"
1417
+ }
1418
+ ) });
1419
+ var XMarkIcon_default = XMarkIcon;
1420
+
1421
+ // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
1422
+ function r(e) {
1423
+ var t, f, n = "";
1424
+ if ("string" == typeof e || "number" == typeof e) n += e;
1425
+ else if ("object" == typeof e) if (Array.isArray(e)) {
1426
+ var o = e.length;
1427
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
1428
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
1429
+ return n;
1430
+ }
1431
+ function clsx() {
1432
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
1433
+ return n;
1434
+ }
1435
+ var clsx_default = clsx;
1436
+
1437
+ // src/components/Icons/ErrorIcon.tsx
1438
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1439
+ var ErrorIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", children: [
1440
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "50", cy: "50", r: "49.375", fill: "url(#a)", fillOpacity: ".65", stroke: "url(#b)", strokeWidth: "1.25" }),
1441
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("g", { filter: "url(#c)", children: [
1442
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
1443
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#FFC9AD", strokeWidth: "1.136" })
1444
+ ] }),
1445
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1446
+ "path",
1447
+ {
1448
+ stroke: "#FF4732",
1449
+ strokeLinecap: "round",
1450
+ strokeLinejoin: "round",
1451
+ strokeWidth: "3.75",
1452
+ d: "m57.5 42.5-15 14.999m15 .001-15-14.999"
1453
+ }
1454
+ ),
1455
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("defs", { children: [
1456
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("linearGradient", { id: "a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
1457
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("stop", { stopColor: "#FFA483" }),
1458
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("stop", { offset: "1", stopColor: "#FFA483", stopOpacity: "0" })
1459
+ ] }),
1460
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("linearGradient", { id: "b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
1461
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("stop", { stopColor: "#FFA483" }),
1462
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("stop", { offset: ".713", stopColor: "#FFA483", stopOpacity: "0" })
1463
+ ] }),
1464
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1465
+ "filter",
1466
+ {
1467
+ id: "c",
1468
+ width: "77.5",
1469
+ height: "77.5",
1470
+ x: "11.25",
1471
+ y: "13.125",
1472
+ colorInterpolationFilters: "sRGB",
1473
+ filterUnits: "userSpaceOnUse",
1474
+ children: [
1475
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1476
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
1477
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feOffset", { dy: "1.875" }),
1478
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feGaussianBlur", { stdDeviation: "1.875" }),
1479
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 0.788235 0 0 0 0 0.678431 0 0 0 0.45 0" }),
1480
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_740" }),
1481
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_740", result: "shape" })
1482
+ ]
1483
+ }
1484
+ )
1485
+ ] })
1486
+ ] });
1487
+ var ErrorIcon_default = ErrorIcon;
1488
+
1489
+ // src/components/IDKitWidget/States/ErrorState.tsx
1490
+ var import_idkit_core2 = require("@worldcoin/idkit-core");
1491
+
1492
+ // src/components/Icons/ReloadIcon.tsx
1493
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1494
+ var ReloadIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1495
+ "path",
1496
+ {
1497
+ d: "M12.3809 1.6665L13.3626 4.24214C12.3754 3.66434 11.2263 3.33317 9.99992 3.33317C6.31802 3.33317 3.33325 6.31794 3.33325 9.99984C3.33325 11.2141 3.6579 12.3526 4.22513 13.3332M7.61897 18.3332L6.63719 15.7575C7.62438 16.3353 8.77348 16.6665 9.99992 16.6665C13.6818 16.6665 16.6666 13.6817 16.6666 9.99984C16.6666 8.78555 16.3419 7.64708 15.7747 6.6665",
1498
+ stroke: "#3C424B",
1499
+ strokeWidth: "1.5",
1500
+ strokeLinecap: "round",
1501
+ strokeLinejoin: "round"
1502
+ }
1503
+ ) });
1504
+ var ReloadIcon_default = ReloadIcon;
1505
+
1506
+ // src/components/Icons/WarningIcon.tsx
1507
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1508
+ var WarningIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", ...props, children: [
1509
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1510
+ "circle",
1511
+ {
1512
+ cx: "50",
1513
+ cy: "50",
1514
+ r: "49.375",
1515
+ fill: "url(#warning-a)",
1516
+ fillOpacity: ".65",
1517
+ stroke: "url(#warning-b)",
1518
+ strokeWidth: "1.25"
1519
+ }
1520
+ ),
1521
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("g", { filter: "url(#warning-c)", children: [
1522
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
1523
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#FFE999", strokeWidth: "1.136" })
1524
+ ] }),
1525
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1526
+ "path",
1527
+ {
1528
+ fill: "#FFB200",
1529
+ fillRule: "evenodd",
1530
+ d: "M47.46 40.207c1.107-1.943 3.973-1.943 5.08 0l9.59 16.834c1.076 1.888-.324 4.209-2.54 4.209H40.41c-2.216 0-3.616-2.32-2.54-4.21l9.59-16.833Zm3.79 16.043a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm-.313-10a.937.937 0 1 0-1.875 0v6.25a.938.938 0 0 0 1.875 0v-6.25Z",
1531
+ clipRule: "evenodd"
1532
+ }
1533
+ ),
1534
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("defs", { children: [
1535
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("linearGradient", { id: "warning-a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
1536
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { stopColor: "#FFDA66" }),
1537
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { offset: "1", stopColor: "#FFDA66", stopOpacity: "0" })
1538
+ ] }),
1539
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("linearGradient", { id: "warning-b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
1540
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { stopColor: "#FFDA66" }),
1541
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { offset: ".713", stopColor: "#FFDA66", stopOpacity: "0" })
1542
+ ] }),
1543
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1544
+ "filter",
1545
+ {
1546
+ id: "warning-c",
1547
+ width: "77.5",
1548
+ height: "77.5",
1549
+ x: "11.25",
1550
+ y: "13.125",
1551
+ colorInterpolationFilters: "sRGB",
1552
+ filterUnits: "userSpaceOnUse",
1553
+ children: [
1554
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1555
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
1556
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feOffset", { dy: "1.875" }),
1557
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feGaussianBlur", { stdDeviation: "1.875" }),
1558
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 0.913725 0 0 0 0 0.6 0 0 0 0.45 0" }),
1559
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_758" }),
1560
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_758", result: "shape" })
1561
+ ]
1562
+ }
1563
+ )
1564
+ ] })
1565
+ ] });
1566
+ var WarningIcon_default = WarningIcon;
1567
+
1568
+ // src/components/IDKitWidget/States/ErrorState.tsx
1569
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1570
+ var getParams = ({ retryFlow, errorState }) => ({ retryFlow, errorState });
1571
+ var ERROR_TITLES = {
1572
+ [import_idkit_core2.AppErrorCodes.GenericError]: __("Something went wrong"),
1573
+ [import_idkit_core2.AppErrorCodes.FailedByHostApp]: __("Verification Declined"),
1574
+ [import_idkit_core2.AppErrorCodes.VerificationRejected]: __("Request cancelled")
1575
+ };
1576
+ var ERROR_MESSAGES = {
1577
+ [import_idkit_core2.AppErrorCodes.ConnectionFailed]: __("Connection to your wallet failed. Please try again."),
1578
+ [import_idkit_core2.AppErrorCodes.VerificationRejected]: __("You\u2019ve cancelled the request in World App."),
1579
+ [import_idkit_core2.AppErrorCodes.MaxVerificationsReached]: __(
1580
+ "You have already verified the maximum number of times for this action."
1581
+ ),
1582
+ [import_idkit_core2.AppErrorCodes.CredentialUnavailable]: __("It seems you do not have the verification level required by this app."),
1583
+ [import_idkit_core2.AppErrorCodes.MalformedRequest]: __(
1584
+ "There was a problem with this request. Please try again or contact the app owner."
1585
+ ),
1586
+ [import_idkit_core2.AppErrorCodes.InvalidNetwork]: __(
1587
+ "Invalid network. If you are the app owner, visit docs.world.org/test for details."
1588
+ ),
1589
+ [import_idkit_core2.AppErrorCodes.InclusionProofFailed]: __("There was an issue fetching your credential. Please try again."),
1590
+ [import_idkit_core2.AppErrorCodes.InclusionProofPending]: __(
1591
+ "Your identity is still being registered. Please wait a few minutes and try again."
1592
+ ),
1593
+ [import_idkit_core2.AppErrorCodes.GenericError]: __("Something unexpected went wrong. Please try again."),
1594
+ [import_idkit_core2.AppErrorCodes.UnexpectedResponse]: __("Unexpected response from your wallet. Please try again."),
1595
+ [import_idkit_core2.AppErrorCodes.FailedByHostApp]: __("Verification failed by the app. Please contact the app owner for details.")
1596
+ };
1597
+ var ErrorState = (props) => {
1598
+ const { retryFlow, errorState } = idkit_default(getParams);
1599
+ const { show_modal } = props;
1600
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-8", children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: clsx_default("flex items-center justify-center", show_modal ? "-mt-5" : ""), children: errorState?.code == import_idkit_core2.AppErrorCodes.VerificationRejected ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(WarningIcon_default, { className: "w-24" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorIcon_default, { className: "w-24" }) }),
1602
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1603
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-center text-2xl font-semibold text-gray-900 dark:text-white", children: (errorState?.code && ERROR_TITLES[errorState.code]) ?? ERROR_TITLES[import_idkit_core2.AppErrorCodes.GenericError] }),
1604
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "mx-auto mt-2 max-w-[224px] text-center text-657080", children: errorState?.message ?? ERROR_MESSAGES[errorState?.code ?? import_idkit_core2.AppErrorCodes.GenericError] })
1605
+ ] }),
1606
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1607
+ "button",
1608
+ {
1609
+ type: "button",
1610
+ onClick: retryFlow,
1611
+ className: "inline-flex items-center rounded-lg border border-ebecef bg-transparent px-8 py-3 font-medium text-3c424b shadow-sm transition duration-300 hover:shadow focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-40",
1612
+ children: [
1613
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ReloadIcon_default, { className: "mr-1.5 size-5" }),
1614
+ __("Try Again")
1615
+ ]
1616
+ }
1617
+ ) })
1618
+ ] });
1619
+ };
1620
+ var ErrorState_default = ErrorState;
1621
+
1622
+ // src/components/IDKitWidget/BaseWidget.tsx
1623
+ var Toast = __toESM(require("@radix-ui/react-toast"), 1);
1624
+
1625
+ // src/components/Icons/CheckIcon.tsx
1626
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1627
+ var CheckIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", ...props, children: [
1628
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1629
+ "circle",
1630
+ {
1631
+ cx: "50",
1632
+ cy: "50",
1633
+ r: "49.375",
1634
+ fill: "url(#success-a)",
1635
+ fillOpacity: ".65",
1636
+ stroke: "url(#success-b)",
1637
+ strokeWidth: "1.25"
1638
+ }
1639
+ ),
1640
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("g", { filter: "url(#success-c)", children: [
1641
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
1642
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#CCEBCC", strokeWidth: "1.136" })
1643
+ ] }),
1644
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1645
+ "path",
1646
+ {
1647
+ stroke: "#090",
1648
+ strokeLinecap: "round",
1649
+ strokeLinejoin: "round",
1650
+ strokeWidth: "3.75",
1651
+ d: "m41.25 52.5 4.375 4.375 13.125-13.75"
1652
+ }
1653
+ ),
1654
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("defs", { children: [
1655
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("linearGradient", { id: "success-a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
1656
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("stop", { stopColor: "#99D699" }),
1657
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("stop", { offset: "1", stopColor: "#99D699", stopOpacity: "0" })
1658
+ ] }),
1659
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("linearGradient", { id: "success-b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
1660
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("stop", { stopColor: "#99D699" }),
1661
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("stop", { offset: ".713", stopColor: "#99D699", stopOpacity: "0" })
1662
+ ] }),
1663
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1664
+ "filter",
1665
+ {
1666
+ id: "success-c",
1667
+ width: "77.5",
1668
+ height: "77.5",
1669
+ x: "11.25",
1670
+ y: "13.125",
1671
+ colorInterpolationFilters: "sRGB",
1672
+ filterUnits: "userSpaceOnUse",
1673
+ children: [
1674
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1675
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
1676
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feOffset", { dy: "1.875" }),
1677
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feGaussianBlur", { stdDeviation: "1.875" }),
1678
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feColorMatrix", { values: "0 0 0 0 0.8 0 0 0 0 0.921569 0 0 0 0 0.8 0 0 0 0.45 0" }),
1679
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_712" }),
1680
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_712", result: "shape" })
1681
+ ]
1682
+ }
1683
+ )
1684
+ ] })
1685
+ ] });
1686
+ var CheckIcon_default = CheckIcon;
1687
+
1688
+ // src/components/IDKitWidget/States/SuccessState.tsx
1689
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1690
+ var SuccessState = (props) => {
1691
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-6", children: [
1692
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: clsx_default("flex items-center justify-center", props.show_modal ? "-mt-5" : ""), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckIcon_default, { className: "w-24 text-white" }) }),
1693
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1694
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-center text-2xl font-semibold text-gray-900 dark:text-white", children: __("Successfully verified") }),
1695
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mx-auto mt-2 max-w-[224px] text-center text-lg text-657080", children: __("Your World ID verification was successful") })
1696
+ ] })
1697
+ ] });
1698
+ };
1699
+ var SuccessState_default = SuccessState;
1700
+
1701
+ // src/components/IDKitWidget/States/WorldID/QRState.tsx
1702
+ var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"), 1);
1703
+
1704
+ // src/components/QRCode.tsx
1705
+ var import_react4 = require("react");
1706
+ var import_qrcode = __toESM(require("qrcode/lib/core/qrcode.js"), 1);
1707
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1708
+ var generateMatrix = (data) => {
1709
+ const arr = import_qrcode.default.create(data, { errorCorrectionLevel: "M" }).modules.data;
1710
+ const sqrt = Math.sqrt(arr.length);
1711
+ return arr.reduce(
1712
+ (rows, key, index) => {
1713
+ if (index % sqrt === 0) rows.push([key]);
1714
+ else rows[rows.length - 1].push(key);
1715
+ return rows;
1716
+ },
1717
+ []
1718
+ );
1719
+ };
1720
+ var Qrcode = ({ data, size = 300 }) => {
1721
+ const dots = (0, import_react4.useMemo)(() => {
1722
+ const dots2 = [];
1723
+ const matrix = generateMatrix(data);
1724
+ const cellSize = size / matrix.length;
1725
+ const qrList = [
1726
+ { x: 0, y: 0 },
1727
+ { x: 1, y: 0 },
1728
+ { x: 0, y: 1 }
1729
+ ];
1730
+ qrList.forEach(({ x, y }) => {
1731
+ const x1 = (matrix.length - 7) * cellSize * x;
1732
+ const y1 = (matrix.length - 7) * cellSize * y;
1733
+ for (let i = 0; i < 3; i++) {
1734
+ dots2.push(
1735
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1736
+ "rect",
1737
+ {
1738
+ fill: "currentColor",
1739
+ x: x1 + cellSize * i,
1740
+ y: y1 + cellSize * i,
1741
+ width: cellSize * (7 - i * 2),
1742
+ height: cellSize * (7 - i * 2),
1743
+ rx: (i - 2) * -5,
1744
+ ry: (i - 2) * -5,
1745
+ className: i % 3 === 0 ? "text-black" : i % 3 === 1 ? "text-white" : "text-black"
1746
+ },
1747
+ `${i}-${x}-${y}`
1748
+ )
1749
+ );
1750
+ }
1751
+ });
1752
+ matrix.forEach((row, i) => {
1753
+ row.forEach((_, j) => {
1754
+ if (!matrix[i][j]) return;
1755
+ if (i < 7 && j < 7 || i > matrix.length - 8 && j < 7 || i < 7 && j > matrix.length - 8) return;
1756
+ dots2.push(
1757
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1758
+ "circle",
1759
+ {
1760
+ fill: "currentColor",
1761
+ r: cellSize / 3,
1762
+ cx: i * cellSize + cellSize / 2,
1763
+ cy: j * cellSize + cellSize / 2,
1764
+ className: "text-black dark:text-white"
1765
+ },
1766
+ `circle-${i}-${j}`
1767
+ )
1768
+ );
1769
+ });
1770
+ });
1771
+ return dots2;
1772
+ }, [size, data]);
1773
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { height: size, width: size, "data-test-id": "qr-code", children: dots });
1774
+ };
1775
+ var QRCode_default = (0, import_react4.memo)(Qrcode);
1776
+
1777
+ // src/components/IDKitWidget/States/WorldID/QRState.tsx
1778
+ var import_react5 = require("react");
1779
+ var import_framer_motion = require("framer-motion");
1780
+
1781
+ // src/components/Icons/WorldcoinIcon.tsx
1782
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1783
+ var WorldcoinIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 33 32", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1784
+ "path",
1785
+ {
1786
+ fill: "currentColor",
1787
+ d: "M30.7195 9.77312C29.9097 7.87434 28.7647 6.17103 27.2845 4.6911C25.8044 3.21117 24.1288 2.06632 22.2298 1.25654C20.247 0.418848 18.1525 0 16.0021 0C13.8238 0 11.7293 0.418848 9.7744 1.25654C7.87537 2.06632 6.17184 3.21117 4.69171 4.6911C3.21159 6.17103 2.06659 7.87434 1.25671 9.77312C0.418903 11.7277 0 13.822 0 16C0 18.1501 0.418903 20.2443 1.25671 22.2269C2.06659 24.1257 3.21159 25.829 4.69171 27.3089C6.17184 28.7888 7.87537 29.9337 9.7744 30.7155C11.7572 31.5532 13.8517 31.9721 16.0021 31.9721C18.1525 31.9721 20.247 31.5532 22.2298 30.7155C24.1288 29.9058 25.8323 28.7609 27.3125 27.281C28.7926 25.801 29.9376 24.0977 30.7475 22.1989C31.5853 20.2164 32.0042 18.1222 32.0042 15.9721C32.0042 13.822 31.5574 11.7277 30.7195 9.77312ZM10.696 14.4921C11.3383 11.9232 13.6842 10.0524 16.4489 10.0524H27.5638C28.2899 11.4206 28.7367 12.9284 28.9043 14.4921H10.696ZM28.9043 17.5079C28.7367 19.0716 28.262 20.5794 27.5638 21.9476H16.4489C13.6842 21.9476 11.3662 20.0489 10.696 17.5079H28.9043ZM6.81415 6.81326C9.27172 4.35602 12.5392 3.01571 16.0021 3.01571C19.465 3.01571 22.7325 4.35602 25.19 6.81326C25.2738 6.89703 25.3297 6.95288 25.4134 7.03665H16.4489C14.0472 7.03665 11.8131 7.95811 10.1095 9.66143C8.76903 11.0017 7.9033 12.6771 7.62403 14.4921H3.09988C3.435 11.5881 4.71964 8.9075 6.81415 6.81326ZM16.0021 28.9843C12.5392 28.9843 9.27172 27.644 6.81415 25.1867C4.71964 23.0925 3.435 20.3839 3.09988 17.5079H7.62403C7.93123 19.3229 8.79696 20.9983 10.1095 22.3386C11.8131 24.0419 14.0472 24.9633 16.4489 24.9633H25.4134C25.3297 25.0471 25.2738 25.103 25.19 25.1867C22.7325 27.644 19.465 28.9843 16.0021 28.9843Z"
1788
+ }
1789
+ ) });
1790
+ var WorldcoinIcon_default = WorldcoinIcon;
1791
+
1792
+ // src/components/Icons/QRPlaceholderIcon.tsx
1793
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1794
+ var QRPlaceholderIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 200 200", children: [
1795
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1796
+ "path",
1797
+ {
1798
+ fill: "#EBECEF",
1799
+ fillRule: "evenodd",
1800
+ d: "M12.1 0C5.417 0 0 5.417 0 12.1v18.505c0 6.682 5.417 12.1 12.1 12.1h18.505c6.682 0 12.1-5.418 12.1-12.1V12.1c0-6.683-5.418-12.1-12.1-12.1H12.1Zm18.505 11.388H12.1a.712.712 0 0 0-.712.712v18.505c0 .393.319.712.712.712h18.505a.712.712 0 0 0 .712-.712V12.1a.712.712 0 0 0-.712-.712Z",
1801
+ clipRule: "evenodd"
1802
+ }
1803
+ ),
1804
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1805
+ "path",
1806
+ {
1807
+ fill: "#EBECEF",
1808
+ d: "M197.026 200c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-17.616c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.545.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808h-11.897v-11.744h-11.896v-23.487h11.896v8.808c0 .778.314 1.525.872 2.076.557.55 1.314.86 2.102.86h5.949c.788 0 1.545-.31 2.103-.86a2.922 2.922 0 0 0 .871-2.076v-8.808h8.922c.789 0 1.545-.309 2.103-.86a2.916 2.916 0 0 0 .871-2.076v-5.872c0-.779-.313-1.525-.871-2.076a2.992 2.992 0 0 0-2.103-.86h-29.741c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v8.808h-23.792v-11.744h8.922c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-5.872c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.546.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808H119.7c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.525.871 2.076.558.551 1.314.86 2.103.86h20.819v8.808c0 .778.313 1.525.871 2.076.557.55 1.314.86 2.103.86h8.922v8.808c0 .778.313 1.525.871 2.076.558.55 1.314.859 2.103.859h8.922v11.744h-20.818c-.789 0-1.546.31-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.526.871 2.076a2.99 2.99 0 0 0 2.103.86h17.844c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-8.808h11.896v8.808c0 .779.314 1.526.872 2.076a2.99 2.99 0 0 0 2.102.86h17.845Z"
1809
+ }
1810
+ ),
1811
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1812
+ "path",
1813
+ {
1814
+ fill: "#EBECEF",
1815
+ fillRule: "evenodd",
1816
+ d: "M157.295 12.1c0-6.683 5.418-12.1 12.1-12.1H187.9c6.683 0 12.1 5.417 12.1 12.1v18.505c0 6.682-5.417 12.1-12.1 12.1h-18.505c-6.682 0-12.1-5.418-12.1-12.1V12.1Zm12.1-.712H187.9c.393 0 .712.319.712.712v18.505a.712.712 0 0 1-.712.712h-18.505a.712.712 0 0 1-.712-.712V12.1c0-.393.319-.712.712-.712ZM12.1 157.295c-6.683 0-12.1 5.418-12.1 12.1V187.9c0 6.683 5.417 12.1 12.1 12.1h18.505c6.682 0 12.1-5.417 12.1-12.1v-18.505c0-6.682-5.418-12.1-12.1-12.1H12.1Zm19.217 12.1a.712.712 0 0 0-.712-.712H12.1a.712.712 0 0 0-.712.712V187.9c0 .393.319.712.712.712h18.505a.712.712 0 0 0 .712-.712v-18.505Z",
1817
+ clipRule: "evenodd"
1818
+ }
1819
+ ),
1820
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1821
+ "path",
1822
+ {
1823
+ fill: "#EBECEF",
1824
+ d: "M6.05 89.68A6.05 6.05 0 0 0 0 95.73v9.252a6.05 6.05 0 0 0 6.05 6.05h9.253a6.05 6.05 0 0 0 6.05-6.05V95.73c0-.678-.112-1.33-.318-1.94.445.105.908.16 1.385.16h27.758a6.05 6.05 0 0 0 6.05-6.05v-9.252a6.05 6.05 0 0 0-6.05-6.05H22.42a6.05 6.05 0 0 0-6.05 6.05V87.9c0 .678.112 1.33.317 1.939a6.065 6.065 0 0 0-1.385-.16H6.05Zm102.135-40.926a6.05 6.05 0 0 1 6.05-6.05h9.253a6.05 6.05 0 0 1 6.049 6.05v9.253a6.05 6.05 0 0 1-6.049 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.253ZM67.616 184.698a6.05 6.05 0 0 1 6.05-6.05h9.252c.678 0 1.33.111 1.939.317a6.064 6.064 0 0 1-.16-1.385v-9.253a6.05 6.05 0 0 1 6.05-6.049H100a6.05 6.05 0 0 1 6.05 6.049v9.253a6.05 6.05 0 0 1-6.05 6.05h-9.253c-.678 0-1.33-.112-1.938-.317.104.444.159.908.159 1.385v9.252a6.05 6.05 0 0 1-6.05 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.252Zm78.291-120.285a6.05 6.05 0 0 1 6.05-6.05h41.993a6.05 6.05 0 0 1 6.05 6.05v9.252a6.05 6.05 0 0 1-6.05 6.05h-41.993a6.05 6.05 0 0 1-6.05-6.05v-9.252ZM95.018 0a6.05 6.05 0 0 0-6.05 6.05v17.082a6.05 6.05 0 0 0 6.05 6.05h9.252a6.05 6.05 0 0 0 6.05-6.05V6.05A6.05 6.05 0 0 0 104.27 0h-9.252Z"
1825
+ }
1826
+ ),
1827
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1828
+ "path",
1829
+ {
1830
+ fill: "url(#a)",
1831
+ fillRule: "evenodd",
1832
+ d: "M12.1 0C5.417 0 0 5.417 0 12.1v18.505c0 6.682 5.417 12.1 12.1 12.1h18.505c6.682 0 12.1-5.418 12.1-12.1V12.1c0-6.683-5.418-12.1-12.1-12.1H12.1Zm18.505 11.388H12.1a.712.712 0 0 0-.712.712v18.505c0 .393.319.712.712.712h18.505a.712.712 0 0 0 .712-.712V12.1a.712.712 0 0 0-.712-.712Z",
1833
+ clipRule: "evenodd"
1834
+ }
1835
+ ),
1836
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1837
+ "path",
1838
+ {
1839
+ fill: "url(#a)",
1840
+ d: "M197.026 200c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-17.616c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.545.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808h-11.897v-11.744h-11.896v-23.487h11.896v8.808c0 .778.314 1.525.872 2.076.557.55 1.314.86 2.102.86h5.949c.788 0 1.545-.31 2.103-.86a2.922 2.922 0 0 0 .871-2.076v-8.808h8.922c.789 0 1.545-.309 2.103-.86a2.916 2.916 0 0 0 .871-2.076v-5.872c0-.779-.313-1.525-.871-2.076a2.992 2.992 0 0 0-2.103-.86h-29.741c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v8.808h-23.792v-11.744h8.922c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-5.872c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.546.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808H119.7c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.525.871 2.076.558.551 1.314.86 2.103.86h20.819v8.808c0 .778.313 1.525.871 2.076.557.55 1.314.86 2.103.86h8.922v8.808c0 .778.313 1.525.871 2.076.558.55 1.314.859 2.103.859h8.922v11.744h-20.818c-.789 0-1.546.31-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.526.871 2.076a2.99 2.99 0 0 0 2.103.86h17.844c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-8.808h11.896v8.808c0 .779.314 1.526.872 2.076a2.99 2.99 0 0 0 2.102.86h17.845Z"
1841
+ }
1842
+ ),
1843
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1844
+ "path",
1845
+ {
1846
+ fill: "url(#a)",
1847
+ fillRule: "evenodd",
1848
+ d: "M157.295 12.1c0-6.683 5.418-12.1 12.1-12.1H187.9c6.683 0 12.1 5.417 12.1 12.1v18.505c0 6.682-5.417 12.1-12.1 12.1h-18.505c-6.682 0-12.1-5.418-12.1-12.1V12.1Zm12.1-.712H187.9c.393 0 .712.319.712.712v18.505a.712.712 0 0 1-.712.712h-18.505a.712.712 0 0 1-.712-.712V12.1c0-.393.319-.712.712-.712Z",
1849
+ clipRule: "evenodd"
1850
+ }
1851
+ ),
1852
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1853
+ "path",
1854
+ {
1855
+ fill: "url(#a)",
1856
+ fillRule: "evenodd",
1857
+ d: "M12.1 157.295c-6.683 0-12.1 5.418-12.1 12.1V187.9c0 6.683 5.417 12.1 12.1 12.1h18.505c6.682 0 12.1-5.417 12.1-12.1v-18.505c0-6.682-5.418-12.1-12.1-12.1H12.1Zm19.217 12.1a.712.712 0 0 0-.712-.712H12.1a.712.712 0 0 0-.712.712V187.9c0 .393.319.712.712.712h18.505a.712.712 0 0 0 .712-.712v-18.505Z",
1858
+ clipRule: "evenodd"
1859
+ }
1860
+ ),
1861
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1862
+ "path",
1863
+ {
1864
+ fill: "url(#a)",
1865
+ d: "M6.05 89.68A6.05 6.05 0 0 0 0 95.73v9.252a6.05 6.05 0 0 0 6.05 6.05h9.253a6.05 6.05 0 0 0 6.05-6.05V95.73c0-.678-.112-1.33-.318-1.94.445.105.908.16 1.385.16h27.758a6.05 6.05 0 0 0 6.05-6.05v-9.252a6.05 6.05 0 0 0-6.05-6.05H22.42a6.05 6.05 0 0 0-6.05 6.05V87.9c0 .678.112 1.33.317 1.939a6.065 6.065 0 0 0-1.385-.16H6.05Z"
1866
+ }
1867
+ ),
1868
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1869
+ "path",
1870
+ {
1871
+ fill: "url(#a)",
1872
+ d: "M108.185 48.754a6.05 6.05 0 0 1 6.05-6.05h9.253a6.05 6.05 0 0 1 6.049 6.05v9.253a6.05 6.05 0 0 1-6.049 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.253Z"
1873
+ }
1874
+ ),
1875
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1876
+ "path",
1877
+ {
1878
+ fill: "url(#a)",
1879
+ d: "M67.616 184.698a6.05 6.05 0 0 1 6.05-6.05h9.252c.678 0 1.33.111 1.939.317a6.064 6.064 0 0 1-.16-1.385v-9.253a6.05 6.05 0 0 1 6.05-6.049H100a6.05 6.05 0 0 1 6.05 6.049v9.253a6.05 6.05 0 0 1-6.05 6.05h-9.253c-.678 0-1.33-.112-1.938-.317.104.444.159.908.159 1.385v9.252a6.05 6.05 0 0 1-6.05 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.252Z"
1880
+ }
1881
+ ),
1882
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1883
+ "path",
1884
+ {
1885
+ fill: "url(#a)",
1886
+ d: "M145.907 64.413a6.05 6.05 0 0 1 6.05-6.05h41.993a6.05 6.05 0 0 1 6.05 6.05v9.252a6.05 6.05 0 0 1-6.05 6.05h-41.993a6.05 6.05 0 0 1-6.05-6.05v-9.252Z"
1887
+ }
1888
+ ),
1889
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1890
+ "path",
1891
+ {
1892
+ fill: "url(#a)",
1893
+ d: "M95.018 0a6.05 6.05 0 0 0-6.05 6.05v17.082a6.05 6.05 0 0 0 6.05 6.05h9.252a6.05 6.05 0 0 0 6.05-6.05V6.05A6.05 6.05 0 0 0 104.27 0h-9.252Z"
1894
+ }
1895
+ ),
1896
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("linearGradient", { id: "a", x1: "0", x2: "200", y1: "0", y2: "200", gradientUnits: "userSpaceOnUse", children: [
1897
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("stop", { offset: ".37", stopColor: "#fff", stopOpacity: "0" }),
1898
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("stop", { offset: ".5", stopColor: "#fff", stopOpacity: ".85" }),
1899
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("stop", { offset: ".63", stopColor: "#fff", stopOpacity: "0" })
1900
+ ] }) })
1901
+ ] });
1902
+ var QRPlaceholderIcon_default = QRPlaceholderIcon;
1903
+
1904
+ // src/components/IDKitWidget/States/WorldID/QRState.tsx
1905
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1906
+ var QRState = ({ qrData, showQR, setShowQR }) => {
1907
+ const media = useMedia_default();
1908
+ const [copiedLink, setCopiedLink] = (0, import_react5.useState)(false);
1909
+ const copyLink = (0, import_react5.useCallback)(() => {
1910
+ (0, import_copy_to_clipboard.default)(qrData ?? "");
1911
+ setCopiedLink(true);
1912
+ setTimeout(() => setCopiedLink(false), 2e3);
1913
+ }, [qrData]);
1914
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1915
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: clsx_default("md:hidden", { "mb-10 space-y-4": !showQR }), children: [
1916
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1917
+ import_framer_motion.motion.a,
1918
+ {
1919
+ href: qrData ?? "",
1920
+ whileTap: { scale: 0.95 },
1921
+ whileHover: { scale: 1.05 },
1922
+ transition: { layout: { duration: 0.15 } },
1923
+ layoutId: media == "desktop" ? void 0 : "worldid-button",
1924
+ className: clsx_default(
1925
+ "flex w-full items-center space-x-2 rounded-2xl border border-transparent p-4 font-medium shadow-sm",
1926
+ "bg-0d151d text-white dark:bg-white dark:text-0d151d",
1927
+ { hidden: showQR }
1928
+ ),
1929
+ children: [
1930
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorldcoinIcon_default, { className: "size-5" }),
1931
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1932
+ import_framer_motion.motion.span,
1933
+ {
1934
+ className: "flex-1 text-center",
1935
+ transition: { layout: { duration: 0.15 } },
1936
+ layoutId: media == "desktop" ? void 0 : "worldid-text",
1937
+ children: __("Open World App")
1938
+ }
1939
+ )
1940
+ ]
1941
+ }
1942
+ ),
1943
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: clsx_default("mb-3", { "space-y-4": !showQR, hidden: media === "mobile" }), children: [
1944
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: clsx_default("flex items-center space-x-4 ", { hidden: showQR }), children: [
1945
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("hr", { className: "flex-1" }),
1946
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-xs font-medium text-9ba3ae", children: "or" }),
1947
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("hr", { className: "flex-1" })
1948
+ ] }),
1949
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1950
+ import_framer_motion.motion.button,
1951
+ {
1952
+ className: "w-full rounded-2xl border border-ebecef p-4 text-lg font-medium text-3c424b",
1953
+ onClick: () => setShowQR((state) => !state),
1954
+ children: showQR ? __("Hide QR Code") : __("Display QR Code")
1955
+ }
1956
+ )
1957
+ ] })
1958
+ ] }),
1959
+ (media == "desktop" || showQR) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1960
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_framer_motion.AnimatePresence, { children: copiedLink && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1961
+ import_framer_motion.motion.div,
1962
+ {
1963
+ className: "text-sm text-9eafc0",
1964
+ initial: "hidden",
1965
+ animate: "visible",
1966
+ exit: "exit",
1967
+ variants: {
1968
+ hidden: { opacity: 0, height: 0, marginTop: 0, y: 0 },
1969
+ visible: {
1970
+ opacity: 1,
1971
+ height: "auto",
1972
+ marginTop: 8,
1973
+ y: -20,
1974
+ transition: {
1975
+ duration: 0.25,
1976
+ opacity: { delay: 0.05, duration: 0.2 },
1977
+ ease: "easeInOut"
1978
+ }
1979
+ },
1980
+ exit: {
1981
+ opacity: 0,
1982
+ height: 0,
1983
+ marginTop: 0,
1984
+ y: 0,
1985
+ transition: {
1986
+ duration: 0.4,
1987
+ delay: 0.1,
1988
+ opacity: { duration: 0.25, delay: 0 },
1989
+ ease: "easeInOut"
1990
+ }
1991
+ }
1992
+ },
1993
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "rounded-lg border border-f1f5f8 px-2 py-1 text-sm", children: __("QR Code copied") })
1994
+ },
1995
+ "copied"
1996
+ ) }),
1997
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "relative inline-flex items-center justify-center rounded-2xl border border-f1f5f8 p-2 dark:border-f1f5f8/10", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "text-29343f dark:text-white", children: qrData ? (
1998
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
1999
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { onClick: copyLink, className: "cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(QRCode_default, { data: qrData, size: 244 }) })
2000
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex size-[244px] items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(QRPlaceholderIcon_default, { className: "size-[244px] animate-pulse" }) }) }) })
2001
+ ] })
2002
+ ] });
2003
+ };
2004
+ var QRState_default = QRState;
2005
+
2006
+ // src/components/IDKitWidget/States/WorldIDState.tsx
2007
+ var import_shallow2 = require("zustand/shallow");
2008
+ var import_react7 = require("react");
2009
+
2010
+ // src/services/wld-bridge.ts
2011
+ var import_react6 = require("react");
2012
+ var import_idkit_core3 = require("@worldcoin/idkit-core");
2013
+ var useWorldBridge = (app_id, action, signal, bridge_url, verification_level, action_description, partner) => {
2014
+ const ref_verification_level = (0, import_react6.useRef)(verification_level);
2015
+ const { reset, result, connectorURI, createClient, pollForUpdates, verificationState, errorCode } = (0, import_idkit_core3.useWorldBridgeStore)();
2016
+ (0, import_react6.useEffect)(() => {
2017
+ if (!connectorURI) {
2018
+ void createClient({
2019
+ app_id,
2020
+ action,
2021
+ signal,
2022
+ bridge_url,
2023
+ action_description,
2024
+ verification_level: ref_verification_level.current,
2025
+ partner
2026
+ });
2027
+ }
2028
+ }, [
2029
+ app_id,
2030
+ action,
2031
+ signal,
2032
+ action_description,
2033
+ createClient,
2034
+ ref_verification_level,
2035
+ bridge_url,
2036
+ connectorURI,
2037
+ partner
2038
+ ]);
2039
+ (0, import_react6.useEffect)(() => {
2040
+ if (!connectorURI || result || errorCode) return;
2041
+ const interval = setInterval(() => void pollForUpdates(), 3e3);
2042
+ return () => clearInterval(interval);
2043
+ }, [connectorURI, pollForUpdates, errorCode, result]);
2044
+ return { connectorURI, reset, result, verificationState, errorCode };
2045
+ };
2046
+
2047
+ // src/components/Icons/LoadingIcon.tsx
2048
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2049
+ var LoadingIcon = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2050
+ "svg",
2051
+ {
2052
+ xmlns: "http://www.w3.org/2000/svg",
2053
+ fill: "none",
2054
+ viewBox: "0 0 24 24",
2055
+ className: `animate-spin motion-reduce:animate-[spin_1.5s_linear_infinite] ${className}`,
2056
+ ...props,
2057
+ children: [
2058
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "12", cy: "12", r: "10.75", stroke: "#191C20", strokeOpacity: ".16", strokeWidth: "2.5" }),
2059
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2060
+ "path",
2061
+ {
2062
+ fill: "#191C20",
2063
+ d: "M17.28 2.633c.338-.6.127-1.368-.505-1.642A12 12 0 0 0 7.459.892c-.638.261-.864 1.024-.539 1.632.326.607 1.08.827 1.725.584a9.504 9.504 0 0 1 6.897.073c.64.257 1.399.053 1.737-.548Z"
2064
+ }
2065
+ )
2066
+ ]
2067
+ }
2068
+ );
2069
+ var LoadingIcon_default = LoadingIcon;
2070
+
2071
+ // src/components/IDKitWidget/States/WorldIDState.tsx
2072
+ var import_idkit_core4 = require("@worldcoin/idkit-core");
2073
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2074
+ var getOptions = (store) => ({
2075
+ signal: store.signal,
2076
+ app_id: store.app_id,
2077
+ action: store.action,
2078
+ setStage: store.setStage,
2079
+ bridge_url: store.bridge_url,
2080
+ handleVerify: store.handleVerify,
2081
+ setErrorState: store.setErrorState,
2082
+ verification_level: store.verification_level,
2083
+ action_description: store.action_description,
2084
+ partner: store.partner
2085
+ });
2086
+ var WorldIDState = (props) => {
2087
+ const media = useMedia_default();
2088
+ const [showQR, setShowQR] = (0, import_react7.useState)(false);
2089
+ const {
2090
+ app_id,
2091
+ action,
2092
+ signal,
2093
+ setStage,
2094
+ handleVerify,
2095
+ bridge_url,
2096
+ action_description,
2097
+ verification_level,
2098
+ setErrorState,
2099
+ partner
2100
+ } = idkit_default(getOptions, import_shallow2.shallow);
2101
+ const { connectorURI, reset, errorCode, result, verificationState } = useWorldBridge(
2102
+ app_id,
2103
+ action,
2104
+ signal,
2105
+ bridge_url,
2106
+ verification_level,
2107
+ action_description,
2108
+ partner
2109
+ );
2110
+ (0, import_react7.useEffect)(() => reset, [reset]);
2111
+ (0, import_react7.useEffect)(() => {
2112
+ if (verificationState === import_idkit_core4.VerificationState.Failed) {
2113
+ setStage("ERROR" /* ERROR */);
2114
+ setErrorState({ code: errorCode ?? import_idkit_core4.AppErrorCodes.GenericError });
2115
+ }
2116
+ if (result) {
2117
+ if (verification_level === import_idkit_core4.VerificationLevel.Orb && result.verification_level === import_idkit_core4.VerificationLevel.Device) {
2118
+ console.error("Credential type received from wallet does not match configured credential_types.");
2119
+ setStage("ERROR" /* ERROR */);
2120
+ setErrorState({ code: import_idkit_core4.AppErrorCodes.CredentialUnavailable });
2121
+ return;
2122
+ }
2123
+ return handleVerify(result);
2124
+ }
2125
+ }, [result, handleVerify, verificationState, setStage, errorCode, setErrorState, verification_level]);
2126
+ const { show_modal } = props;
2127
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2128
+ "div",
2129
+ {
2130
+ className: clsx_default(
2131
+ "flex flex-col items-center text-center",
2132
+ show_modal ? showQR ? "-mt-6 space-y-5 " : "-mt-6 space-y-10 " : ""
2133
+ ),
2134
+ children: [
2135
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: clsx_default(!show_modal ? "hidden" : ""), children: [
2136
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mb-4 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorldcoinIcon_default, { className: "h-10 text-0d151d dark:text-white" }) }),
2137
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "font-sora text-2xl font-semibold text-gray-900 dark:text-white", children: __("Verify with World ID") }),
2138
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: clsx_default("mt-3 text-657080 dark:text-9eafc0 md:mt-2", { hidden: media === "mobile" }), children: [
2139
+ "Use your camera to scan the QR code. ",
2140
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("br", {}),
2141
+ " ",
2142
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-red-500", children: "Keep this window open after scanning." })
2143
+ ] })
2144
+ ] }),
2145
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative w-full", children: [
2146
+ verificationState === import_idkit_core4.VerificationState.WaitingForApp && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center space-y-6", children: [
2147
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LoadingIcon_default, { className: "size-6" }),
2148
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
2149
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "font-bold text-657080", children: "Verifying" }),
2150
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-657080", children: "Please continue in app" }),
2151
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: clsx_default(show_modal ? "" : "hidden", "mt-2 text-sm font-bold text-red-500"), children: "Don't close this window" })
2152
+ ] })
2153
+ ] }),
2154
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2155
+ "div",
2156
+ {
2157
+ className: clsx_default(
2158
+ "transition duration-500 ease-in-out",
2159
+ verificationState === import_idkit_core4.VerificationState.WaitingForApp && "opacity-40 blur-lg"
2160
+ ),
2161
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(QRState_default, { showQR, setShowQR, qrData: connectorURI }) })
2162
+ }
2163
+ )
2164
+ ] })
2165
+ ]
2166
+ }
2167
+ );
2168
+ };
2169
+ var WorldIDState_default = WorldIDState;
2170
+
2171
+ // src/components/IDKitWidget/BaseWidget.tsx
2172
+ var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
2173
+ var import_react8 = require("react");
2174
+ var import_framer_motion2 = require("framer-motion");
2175
+
2176
+ // src/components/IDKitWidget/States/HostAppVerificationState.tsx
2177
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2178
+ var HostAppVerificationState = () => {
2179
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-6", children: [
2180
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingIcon_default, { className: "size-24" }) }),
2181
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mt-4 text-70868f", children: __("Transmitting verification to host app. Please wait...") })
2182
+ ] });
2183
+ };
2184
+ var HostAppVerificationState_default = HostAppVerificationState;
2185
+
2186
+ // src/components/IDKitWidget/BaseWidget.tsx
2187
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2188
+ var getParams2 = ({ open, processing, onOpenChange, stage, setStage, setOptions }) => ({
2189
+ stage,
2190
+ setStage,
2191
+ processing,
2192
+ setOptions,
2193
+ isOpen: open,
2194
+ onOpenChange
2195
+ });
2196
+ var IDKitWidget = ({
2197
+ children,
2198
+ show_modal = true,
2199
+ container_id,
2200
+ disable_default_modal_behavior = false,
2201
+ ...config
2202
+ }) => {
2203
+ const media = useMedia_default();
2204
+ const { isOpen, onOpenChange, stage, setOptions } = idkit_default(getParams2, import_shallow3.shallow);
2205
+ (0, import_react8.useEffect)(() => {
2206
+ if (config.action === "") {
2207
+ throw new Error(__("Action cannot be an empty string."));
2208
+ }
2209
+ setOptions(config, "props" /* PROPS */);
2210
+ }, [config, setOptions]);
2211
+ const StageContent = (0, import_react8.useMemo)(() => {
2212
+ switch (stage) {
2213
+ case "WORLD_ID" /* WORLD_ID */:
2214
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(WorldIDState_default, { show_modal });
2215
+ case "SUCCESS" /* SUCCESS */:
2216
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SuccessState_default, {});
2217
+ case "ERROR" /* ERROR */:
2218
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ErrorState_default, {});
2219
+ case "HOST_APP_VERIFICATION" /* HOST_APP_VERIFICATION */:
2220
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(HostAppVerificationState_default, {});
2221
+ default:
2222
+ throw new Error(__("Invalid IDKitStage :stage.", { stage }));
2223
+ }
2224
+ }, [stage, show_modal]);
2225
+ const widgetContent = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ShadowHost, { mode: "open", id: "idkit-widget", children: [
2226
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Styles_default, {}),
2227
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Toast.Provider, { children: [
2228
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Toast.Viewport, { className: "flex justify-center" }),
2229
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2230
+ "div",
2231
+ {
2232
+ id: "widget-content-inline",
2233
+ className: "relative flex flex-col bg-white p-4 focus:outline-none dark:bg-0d151d",
2234
+ children: StageContent
2235
+ }
2236
+ )
2237
+ ] })
2238
+ ] });
2239
+ if (!show_modal && container_id) {
2240
+ const containerElement = document.getElementById(container_id);
2241
+ if (containerElement) {
2242
+ return (0, import_react_dom2.createPortal)(widgetContent, containerElement);
2243
+ }
2244
+ console.warn(`Container element with id "${container_id}" not found. Rendering widget inline.`);
2245
+ }
2246
+ const avoidDefaultDomBehavior = (e) => {
2247
+ if (disable_default_modal_behavior) {
2248
+ e.preventDefault();
2249
+ }
2250
+ };
2251
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Dialog.Root, { open: isOpen, onOpenChange, children: [
2252
+ children?.({ open: () => onOpenChange(true) }),
2253
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Portal, { forceMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_framer_motion2.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ShadowHost, { mode: "open", id: "idkit-widget", children: [
2254
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Styles_default, {}),
2255
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { id: "modal", className: "fixed z-[9999] font-sans", children: [
2256
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Overlay, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2257
+ import_framer_motion2.motion.div,
2258
+ {
2259
+ initial: { opacity: 0 },
2260
+ animate: { opacity: 1 },
2261
+ exit: { opacity: 0 },
2262
+ className: "fixed inset-0 bg-black/50 backdrop-blur-lg"
2263
+ }
2264
+ ) }),
2265
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "fixed inset-0 z-[9999] overflow-y-hidden md:overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex min-h-full items-end justify-center text-center md:items-center md:p-4", children: [
2266
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Title, {}),
2267
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2268
+ Dialog.Content,
2269
+ {
2270
+ asChild: true,
2271
+ onPointerDownOutside: avoidDefaultDomBehavior,
2272
+ onInteractOutside: avoidDefaultDomBehavior,
2273
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2274
+ import_framer_motion2.motion.div,
2275
+ {
2276
+ layout: media == "mobile" ? "position" : true,
2277
+ exit: media == "mobile" ? "initMob" : "init",
2278
+ initial: media == "mobile" ? "initMob" : "init",
2279
+ animate: media == "mobile" ? "animateMob" : "animate",
2280
+ variants: {
2281
+ init: { opacity: 0, scale: 0.9 },
2282
+ initMob: { translateY: "100%" },
2283
+ animate: { opacity: 1, scale: 1 },
2284
+ animateMob: { translateY: 0 }
2285
+ },
2286
+ transition: { layout: { duration: 0.15 } },
2287
+ className: "relative z-50 flex min-h-screen w-full flex-col bg-white pt-6 shadow focus:outline-none focus-visible:ring focus-visible:ring-purple-500/75 dark:bg-0d151d md:min-h-[35rem] md:max-w-md md:rounded-2xl",
2288
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Toast.Provider, { children: [
2289
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Toast.Viewport, { className: "flex justify-center" }),
2290
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mx-6 mb-12 flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog.Close, { className: "flex size-11 items-center justify-center rounded-full text-black dark:text-white", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(XMarkIcon_default, { className: "size-5" }) }) }),
2291
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "relative mx-6 mb-6 flex flex-1 flex-col items-center justify-center", children: StageContent }),
2292
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center border-t border-f5f5f7 p-7 md:rounded-b-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2293
+ "a",
2294
+ {
2295
+ href: "https://developer.worldcoin.org/privacy-statement",
2296
+ target: "_blank",
2297
+ rel: "noreferrer",
2298
+ className: "text-sm text-657080 hover:underline",
2299
+ children: __("Terms & Privacy")
2300
+ }
2301
+ ) })
2302
+ ] })
2303
+ }
2304
+ )
2305
+ }
2306
+ )
2307
+ ] }) })
2308
+ ] })
2309
+ ] }) }) }) })
2310
+ ] });
2311
+ };
2312
+ var BaseWidget_default = IDKitWidget;
2313
+
2314
+ // src/components/IDKitWidget/index.tsx
2315
+ var IDKitWidget_default = (0, import_react9.memo)(BaseWidget_default);
2316
+
2317
+ // src/index.ts
2318
+ var import_hashing = require("@worldcoin/idkit-core/hashing");
2319
+ var import_backend = require("@worldcoin/idkit-core/backend");
2320
+ var import_idkit_core7 = require("@worldcoin/idkit-core");
2321
+
2322
+ // src/hooks/useSession.ts
2323
+ var import_react10 = require("react");
2324
+ var import_shallow4 = require("zustand/react/shallow");
2325
+ var import_idkit_core5 = require("@worldcoin/idkit-core");
2326
+ var import_idkit_core6 = require("@worldcoin/idkit-core");
2327
+ var TERMINAL_STATES = [import_idkit_core5.VerificationState.Confirmed, import_idkit_core5.VerificationState.Failed];
2328
+ function useSession(config) {
2329
+ const { reset, result, connectorURI, createClient, pollForUpdates, verificationState, errorCode } = (0, import_idkit_core6.useWorldBridgeStore)(
2330
+ (0, import_shallow4.useShallow)((state) => ({
2331
+ reset: state.reset,
2332
+ result: state.result,
2333
+ connectorURI: state.connectorURI,
2334
+ createClient: state.createClient,
2335
+ pollForUpdates: state.pollForUpdates,
2336
+ verificationState: state.verificationState,
2337
+ errorCode: state.errorCode
2338
+ }))
2339
+ );
2340
+ (0, import_react10.useEffect)(() => {
2341
+ if (verificationState === import_idkit_core5.VerificationState.PreparingClient && !connectorURI) {
2342
+ void createClient(config);
2343
+ }
2344
+ }, [verificationState, connectorURI, createClient, config]);
2345
+ (0, import_react10.useEffect)(() => {
2346
+ if (TERMINAL_STATES.includes(verificationState)) return;
2347
+ const interval = setInterval(() => {
2348
+ void pollForUpdates();
2349
+ }, 3e3);
2350
+ return () => {
2351
+ clearInterval(interval);
2352
+ };
2353
+ }, [verificationState, pollForUpdates]);
2354
+ return {
2355
+ status: verificationState,
2356
+ sessionURI: connectorURI,
2357
+ result,
2358
+ errorCode,
2359
+ reset
2360
+ };
2361
+ }
2362
+ // Annotate the CommonJS export names for ESM import in node:
2363
+ 0 && (module.exports = {
2364
+ IDKitWidget,
2365
+ VerificationLevel,
2366
+ VerificationState,
2367
+ solidityEncode,
2368
+ useIDKit,
2369
+ useSession,
2370
+ verifyCloudProof
2371
+ });