@veryai/widget 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.mts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +79 -116
- package/build/index.js.map +1 -1
- package/build/index.mjs +79 -116
- package/build/index.mjs.map +1 -1
- package/package.json +4 -4
package/build/index.d.mts
CHANGED
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -59,7 +59,7 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// src/styles/styles.css
|
|
62
|
-
styleInject(".default
|
|
62
|
+
styleInject(".default,\n.dark {\n --very-brand-color: #1f3765;\n --very-bg-color: #000;\n --very-primary: #fafbff;\n --very-secondary: rgba(255, 255, 255, 0.6);\n --very-tertiary: rgba(255, 255, 255, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #fafbff;\n --very-button-text: #1f3765;\n --very-border: #b0c6d4;\n}\n.light {\n --very-brand-color: #1f3765;\n --very-bg-color: #fafbff;\n --very-primary: #1c2125;\n --very-secondary: rgba(0, 0, 0, 0.6);\n --very-tertiary: rgba(0, 0, 0, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #1f3765;\n --very-button-text: #fafbff;\n --very-border: #1f3765;\n}\n.very-dialog-overlay {\n backdrop-filter: blur(4px);\n background-color: rgba(0, 0, 0, 0.5);\n inset: 0;\n position: fixed;\n z-index: 40;\n}\n.very-processing {\n backdrop-filter: blur(4px);\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 16px;\n font-weight: 500;\n color: var(--very-primary);\n}\n.very-processing-text {\n margin-top: 16px;\n text-align: center;\n}\n.very-widget {\n align-items: center;\n background-color: var(--very-bg-color);\n border-radius: 20px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n color: var(--very-primary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 16px;\n left: 50%;\n max-width: 440px;\n position: fixed;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 90vw;\n z-index: 50;\n .very-content {\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n padding: 40px 32px 24px;\n }\n .very-center {\n position: relative;\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n gap: 0;\n }\n .very-brand-header {\n height: 28px;\n width: auto;\n margin-bottom: 16px;\n }\n .tip {\n color: var(--very-secondary);\n font-size: 16px;\n letter-spacing: -0.2px;\n line-height: 144%;\n margin-bottom: 20px;\n text-align: center;\n }\n .very-hint {\n color: var(--very-tertiary);\n font-size: 13px;\n letter-spacing: -0.1px;\n line-height: 144%;\n margin-top: 16px;\n text-align: center;\n }\n}\n.very-qr-container {\n position: relative;\n border-radius: 17px;\n overflow: hidden;\n}\n.very-close {\n cursor: pointer;\n padding: 12px;\n position: absolute;\n right: 16px;\n top: 16px;\n opacity: 0.6;\n transition: opacity 0.15s ease;\n}\n.very-close:hover {\n opacity: 1;\n}\n.very-footer {\n align-items: center;\n color: var(--very-secondary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n gap: 6px;\n padding: 0 32px 28px;\n width: 100%;\n}\n.very-footer-links {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.very-footer-sep {\n color: var(--very-tertiary);\n font-size: 13px;\n}\n.very-terms {\n cursor: pointer;\n font-size: 13px;\n color: var(--very-tertiary);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.very-try-again {\n align-items: center;\n background-color: var(--very-button-bg);\n border: none;\n border-radius: 12px;\n color: var(--very-button-text);\n cursor: pointer;\n display: flex;\n font-size: 16px;\n font-weight: 600;\n gap: 12px;\n height: 56px;\n justify-content: center;\n margin-top: 24px;\n padding: 16px 28px;\n width: 100%;\n transition: opacity 0.15s ease;\n}\n.very-try-again:hover {\n opacity: 0.9;\n}\n.error {\n color: var(--very-primary);\n font-size: 28px;\n font-style: normal;\n font-weight: 600;\n letter-spacing: -0.5px;\n line-height: 120%;\n text-align: center;\n}\n.very-error-description {\n font-size: 16px;\n color: var(--very-secondary);\n text-align: center;\n}\n.very-loading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 60px;\n height: 60px;\n}\n.very-loading-animation {\n animation: very-spin 1s linear infinite;\n width: 60px;\n height: 60px;\n}\n.very-loading-logo {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes very-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n");
|
|
63
63
|
|
|
64
64
|
// src/tools/constants.ts
|
|
65
65
|
var API_URL = "https://bridge.very.org/api/v1/";
|
|
@@ -192,153 +192,112 @@ var closeSVG = `
|
|
|
192
192
|
</defs>
|
|
193
193
|
</svg>
|
|
194
194
|
`;
|
|
195
|
-
var
|
|
196
|
-
<path
|
|
197
|
-
<path d="
|
|
198
|
-
<path d="
|
|
199
|
-
<path d="
|
|
200
|
-
<path d="
|
|
201
|
-
|
|
202
|
-
|
|
195
|
+
var errorSVG = `<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
196
|
+
<g clip-path="url(#clip0_2453_16310)">
|
|
197
|
+
<path d="M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
198
|
+
<path d="M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
199
|
+
<path d="M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
200
|
+
<path d="M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
201
|
+
<path d="M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898" stroke="var(--very-primary, #fafbff)" stroke-width="2" />
|
|
202
|
+
<path d="M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898" stroke="var(--very-primary, #fafbff)" stroke-width="2" /> </g> <defs> <clipPath id="clip0_2453_16310"> <rect width="48" height="48" fill="white" /> </clipPath> </defs>
|
|
203
|
+
</svg>`;
|
|
204
|
+
var expiredSVG = ` <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
205
|
+
<path d="M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
206
|
+
<path d="M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
207
|
+
<path d="M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
208
|
+
<path d="M20.5652 27.6289H11.4058" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
209
|
+
<path d="M20.5654 27.6289L25.7176 37.1701" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
210
|
+
</svg>`;
|
|
203
211
|
|
|
204
212
|
// src/vanilla/components.ts
|
|
213
|
+
var QR_OPTIONS = {
|
|
214
|
+
width: 240,
|
|
215
|
+
height: 240,
|
|
216
|
+
backgroundOptions: { color: "#fafbff" },
|
|
217
|
+
dotsOptions: { color: "#000000", type: "dots" },
|
|
218
|
+
cornersDotOptions: { type: "rounded", color: "#000000" },
|
|
219
|
+
cornersSquareOptions: { type: "extra-rounded", color: "#000000" },
|
|
220
|
+
qrOptions: { errorCorrectionLevel: "Q" },
|
|
221
|
+
type: "svg"
|
|
222
|
+
};
|
|
223
|
+
function createExternalLink(href, label) {
|
|
224
|
+
const a = document.createElement("a");
|
|
225
|
+
a.className = "very-terms";
|
|
226
|
+
a.href = href;
|
|
227
|
+
a.target = "_blank";
|
|
228
|
+
a.rel = "noopener noreferrer";
|
|
229
|
+
a.textContent = label;
|
|
230
|
+
return a;
|
|
231
|
+
}
|
|
205
232
|
var createFooterElement = () => {
|
|
206
233
|
const footer = document.createElement("div");
|
|
207
234
|
footer.className = "very-footer";
|
|
208
|
-
const logoRow = document.createElement("div");
|
|
209
|
-
logoRow.className = "very-footer-logo";
|
|
210
|
-
const poweredByText = document.createElement("span");
|
|
211
|
-
poweredByText.textContent = "Powered by";
|
|
212
|
-
logoRow.appendChild(poweredByText);
|
|
213
|
-
const brandLogo = document.createElement("img");
|
|
214
|
-
brandLogo.className = "very-footer-brand";
|
|
215
|
-
brandLogo.alt = "VeryAI";
|
|
216
|
-
brandLogo.src = "https://assets.very.org/branding/logo-light.svg";
|
|
217
|
-
logoRow.appendChild(brandLogo);
|
|
218
235
|
const linksRow = document.createElement("div");
|
|
219
236
|
linksRow.className = "very-footer-links";
|
|
220
|
-
|
|
221
|
-
tosLink.className = "very-terms";
|
|
222
|
-
tosLink.href = TermsUrl;
|
|
223
|
-
tosLink.target = "_blank";
|
|
224
|
-
tosLink.rel = "noopener noreferrer";
|
|
225
|
-
tosLink.textContent = "Terms of Service";
|
|
237
|
+
linksRow.appendChild(createExternalLink(TermsUrl, "Terms of Service"));
|
|
226
238
|
const separator = document.createElement("span");
|
|
227
239
|
separator.className = "very-footer-sep";
|
|
228
240
|
separator.textContent = "\xB7";
|
|
229
|
-
const ppLink = document.createElement("a");
|
|
230
|
-
ppLink.className = "very-terms";
|
|
231
|
-
ppLink.href = PrivacyUrl;
|
|
232
|
-
ppLink.target = "_blank";
|
|
233
|
-
ppLink.rel = "noopener noreferrer";
|
|
234
|
-
ppLink.textContent = "Privacy Policy";
|
|
235
|
-
linksRow.appendChild(tosLink);
|
|
236
241
|
linksRow.appendChild(separator);
|
|
237
|
-
linksRow.appendChild(
|
|
238
|
-
footer.appendChild(logoRow);
|
|
242
|
+
linksRow.appendChild(createExternalLink(PrivacyUrl, "Privacy Policy"));
|
|
239
243
|
footer.appendChild(linksRow);
|
|
240
244
|
return footer;
|
|
241
245
|
};
|
|
242
|
-
var
|
|
243
|
-
width: 240,
|
|
244
|
-
height: 240,
|
|
245
|
-
backgroundOptions: {
|
|
246
|
-
color: "#fafbff"
|
|
247
|
-
},
|
|
248
|
-
dotsOptions: {
|
|
249
|
-
color: "#000000",
|
|
250
|
-
type: "dots"
|
|
251
|
-
},
|
|
252
|
-
cornersDotOptions: {
|
|
253
|
-
type: "rounded",
|
|
254
|
-
color: "#000000"
|
|
255
|
-
},
|
|
256
|
-
cornersSquareOptions: {
|
|
257
|
-
type: "extra-rounded",
|
|
258
|
-
color: "#000000"
|
|
259
|
-
},
|
|
260
|
-
qrOptions: {
|
|
261
|
-
errorCorrectionLevel: "Q"
|
|
262
|
-
},
|
|
263
|
-
type: "svg"
|
|
264
|
-
});
|
|
265
|
-
var createQRCodeElement = (url, isProcessing) => {
|
|
246
|
+
var createQRCodeElement = (url, isProcessing, theme = "default") => {
|
|
266
247
|
const container = document.createElement("div");
|
|
267
248
|
container.className = "very-center";
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
title.textContent = "Verify with VeryAI";
|
|
249
|
+
const brand = document.createElement("img");
|
|
250
|
+
brand.className = "very-brand-header";
|
|
251
|
+
brand.alt = "VeryAI";
|
|
252
|
+
brand.src = theme === "light" ? "https://assets.very.org/branding/logo-dark.svg" : "https://assets.very.org/branding/logo-light.svg";
|
|
273
253
|
const tip = document.createElement("div");
|
|
274
254
|
tip.className = "tip";
|
|
275
|
-
tip.textContent = "
|
|
255
|
+
tip.textContent = "Scan to verify your identity";
|
|
276
256
|
const qrContainer = document.createElement("div");
|
|
277
|
-
qrContainer.className = "very-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
qrContainer.style.overflow = "hidden";
|
|
281
|
-
qrCode.update({
|
|
282
|
-
data: url
|
|
283
|
-
});
|
|
257
|
+
qrContainer.className = "very-qr-container";
|
|
258
|
+
const qrCode = new import_qr_code_styling.default(QR_OPTIONS);
|
|
259
|
+
qrCode.update({ data: url });
|
|
284
260
|
qrCode.append(qrContainer);
|
|
285
261
|
if (isProcessing) {
|
|
286
262
|
const processing = document.createElement("div");
|
|
287
263
|
processing.className = "very-processing";
|
|
288
264
|
const loading = createLoadingElement();
|
|
289
265
|
const text = document.createElement("div");
|
|
290
|
-
text.
|
|
291
|
-
|
|
292
|
-
<div style="margin-top: 16px; text-align: center;">
|
|
293
|
-
Please wait while we <br /> process your verification.
|
|
294
|
-
</div>
|
|
295
|
-
`;
|
|
266
|
+
text.className = "very-processing-text";
|
|
267
|
+
text.textContent = "Processing verification\u2026";
|
|
296
268
|
processing.appendChild(loading);
|
|
297
269
|
processing.appendChild(text);
|
|
298
270
|
qrContainer.appendChild(processing);
|
|
299
271
|
}
|
|
300
|
-
|
|
301
|
-
|
|
272
|
+
const hint = document.createElement("div");
|
|
273
|
+
hint.className = "very-hint";
|
|
274
|
+
hint.textContent = "Open the VeryAI app and scan this code";
|
|
275
|
+
container.appendChild(brand);
|
|
302
276
|
container.appendChild(tip);
|
|
303
277
|
container.appendChild(qrContainer);
|
|
278
|
+
container.appendChild(hint);
|
|
304
279
|
return container;
|
|
305
280
|
};
|
|
306
281
|
var createErrorElement = (errorText, onRefresh) => {
|
|
307
282
|
const error = document.createElement("div");
|
|
308
283
|
error.className = "very-center";
|
|
309
284
|
const isExpired = errorText.includes("has expired");
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
<path d="M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898" stroke="var(--very-primary)" stroke-width="2"/>
|
|
327
|
-
</g>
|
|
328
|
-
<defs>
|
|
329
|
-
<clipPath id="clip0_2453_16310">
|
|
330
|
-
<rect width="48" height="48" fill="white"/>
|
|
331
|
-
</clipPath>
|
|
332
|
-
</defs>
|
|
333
|
-
</svg>
|
|
334
|
-
`}
|
|
335
|
-
<div class="error">${isExpired ? "Session Expired" : "Verification Failed"}</div>
|
|
336
|
-
<div style="font-size: 16px; color: var(--very-secondary);">${errorText || "Unable to verify your identity. Please try again."}</div>
|
|
337
|
-
<div class="very-try-again" onclick="this.dispatchEvent(new CustomEvent('refresh'))">
|
|
338
|
-
Try Again
|
|
339
|
-
</div>
|
|
340
|
-
`;
|
|
341
|
-
error.addEventListener("refresh", onRefresh);
|
|
285
|
+
const icon = document.createElement("div");
|
|
286
|
+
icon.innerHTML = isExpired ? expiredSVG : errorSVG;
|
|
287
|
+
error.appendChild(icon);
|
|
288
|
+
const heading = document.createElement("div");
|
|
289
|
+
heading.className = "error";
|
|
290
|
+
heading.textContent = isExpired ? "Session Expired" : "Verification Failed";
|
|
291
|
+
error.appendChild(heading);
|
|
292
|
+
const description = document.createElement("div");
|
|
293
|
+
description.className = "very-error-description";
|
|
294
|
+
description.textContent = errorText || "Unable to verify your identity. Please try again.";
|
|
295
|
+
error.appendChild(description);
|
|
296
|
+
const tryAgain = document.createElement("div");
|
|
297
|
+
tryAgain.className = "very-try-again";
|
|
298
|
+
tryAgain.textContent = "Try Again";
|
|
299
|
+
tryAgain.addEventListener("click", onRefresh);
|
|
300
|
+
error.appendChild(tryAgain);
|
|
342
301
|
return error;
|
|
343
302
|
};
|
|
344
303
|
var createLoadingElement = () => {
|
|
@@ -369,6 +328,7 @@ var VeryWidgetVanilla = class {
|
|
|
369
328
|
session;
|
|
370
329
|
timer;
|
|
371
330
|
isOpen = false;
|
|
331
|
+
mobileRedirectDone = false;
|
|
372
332
|
overlay;
|
|
373
333
|
widget;
|
|
374
334
|
content;
|
|
@@ -442,15 +402,15 @@ var VeryWidgetVanilla = class {
|
|
|
442
402
|
break;
|
|
443
403
|
case "qr-code":
|
|
444
404
|
this.content.appendChild(
|
|
445
|
-
createQRCodeElement(state.url, state.isProcessing || false)
|
|
405
|
+
createQRCodeElement(state.url, state.isProcessing || false, this.config.theme)
|
|
446
406
|
);
|
|
447
407
|
break;
|
|
448
408
|
case "processing":
|
|
449
|
-
this.content.appendChild(createQRCodeElement(state.url, true));
|
|
409
|
+
this.content.appendChild(createQRCodeElement(state.url, true, this.config.theme));
|
|
450
410
|
break;
|
|
451
411
|
case "error":
|
|
452
412
|
this.content.appendChild(
|
|
453
|
-
createErrorElement(state.errorText, this.refresh)
|
|
413
|
+
createErrorElement(state.errorText, () => this.refresh())
|
|
454
414
|
);
|
|
455
415
|
break;
|
|
456
416
|
}
|
|
@@ -565,10 +525,12 @@ var VeryWidgetVanilla = class {
|
|
|
565
525
|
}, 3e3);
|
|
566
526
|
}
|
|
567
527
|
handleMobileRedirect(url) {
|
|
568
|
-
|
|
528
|
+
if (this.mobileRedirectDone) return;
|
|
529
|
+
const isMobile = /Mobile|Android|iPhone|iPad|iPod|Tablet/i.test(
|
|
569
530
|
navigator.userAgent
|
|
570
531
|
);
|
|
571
532
|
if (isMobile) {
|
|
533
|
+
this.mobileRedirectDone = true;
|
|
572
534
|
setTimeout(() => {
|
|
573
535
|
const link = document.createElement("a");
|
|
574
536
|
link.href = url;
|
|
@@ -588,6 +550,7 @@ var VeryWidgetVanilla = class {
|
|
|
588
550
|
}
|
|
589
551
|
refresh() {
|
|
590
552
|
this.cleanup();
|
|
553
|
+
this.mobileRedirectDone = false;
|
|
591
554
|
this.getSession();
|
|
592
555
|
}
|
|
593
556
|
destroy() {
|
|
@@ -638,7 +601,7 @@ var VeryWidget = ({
|
|
|
638
601
|
if (children) {
|
|
639
602
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: children({ open: handleOpen }) });
|
|
640
603
|
}
|
|
641
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: handleOpen, children: "
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: handleOpen, children: "Verify with VeryAI" }) });
|
|
642
605
|
};
|
|
643
606
|
|
|
644
607
|
// src/adapters/vue/index.ts
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["// Native JavaScript version (recommended)\nexport { createVeryWidget } from \"./vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig, IVeryWidgetState } from \"./vanilla/VeryWidget\";\n\n// Multi-framework adapters\nexport * from \"./adapters/react\";\nexport * from \"./adapters/vanilla\";\nexport * from \"./adapters/vue\";\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.dark {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.light {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #fafbff;\\n --very-primary: #1c2125;\\n --very-secondary: rgba(0, 0, 0, 0.6);\\n --very-tertiary: rgba(0, 0, 0, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #1f3765;\\n --very-button-text: #fafbff;\\n --very-border: #1f3765;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 20px;\\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 440px;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n padding: 40px 32px 24px;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 8px;\\n }\\n .title {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n margin-top: 20px;\\n text-align: center;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-size: 16px;\\n font-style: normal;\\n letter-spacing: -0.192px;\\n line-height: 144%;\\n margin-bottom: 24px;\\n margin-top: 8px;\\n text-align: center;\\n }\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 12px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n opacity: 0.6;\\n transition: opacity 0.15s ease;\\n}\\n.very-close:hover {\\n opacity: 1;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-secondary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 400;\\n gap: 6px;\\n padding: 0 32px 28px;\\n width: 100%;\\n}\\n.very-footer-logo {\\n align-items: center;\\n display: flex;\\n gap: 6px;\\n}\\n.very-footer-brand {\\n height: 14px;\\n width: auto;\\n}\\n.light .very-footer-brand {\\n content: url(https://assets.very.org/branding/logo-dark.svg);\\n}\\n.very-footer-links {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n}\\n.very-footer-sep {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n}\\n.very-terms {\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--very-tertiary);\\n text-decoration: underline;\\n text-underline-offset: 2px;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: var(--very-button-bg);\\n border: none;\\n border-radius: 12px;\\n color: var(--very-button-text);\\n cursor: pointer;\\n display: flex;\\n font-size: 16px;\\n font-weight: 600;\\n gap: 12px;\\n height: 56px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 16px 28px;\\n width: 100%;\\n transition: opacity 0.15s ease;\\n}\\n.very-try-again:hover {\\n opacity: 0.9;\\n}\\n.error {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsUrl = \"https://very.org/legal/terms\";\nexport const PrivacyUrl = \"https://very.org/legal/privacy\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsUrl, PrivacyUrl } from \"../tools/constants\";\nimport { logoSVG } from \"./svgs\";\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n\n const logoRow = document.createElement(\"div\");\n logoRow.className = \"very-footer-logo\";\n\n const poweredByText = document.createElement(\"span\");\n poweredByText.textContent = \"Powered by\";\n logoRow.appendChild(poweredByText);\n\n const brandLogo = document.createElement(\"img\");\n brandLogo.className = \"very-footer-brand\";\n brandLogo.alt = \"VeryAI\";\n brandLogo.src = \"https://assets.very.org/branding/logo-light.svg\";\n logoRow.appendChild(brandLogo);\n\n const linksRow = document.createElement(\"div\");\n linksRow.className = \"very-footer-links\";\n\n const tosLink = document.createElement(\"a\");\n tosLink.className = \"very-terms\";\n tosLink.href = TermsUrl;\n tosLink.target = \"_blank\";\n tosLink.rel = \"noopener noreferrer\";\n tosLink.textContent = \"Terms of Service\";\n\n const separator = document.createElement(\"span\");\n separator.className = \"very-footer-sep\";\n separator.textContent = \"·\";\n\n const ppLink = document.createElement(\"a\");\n ppLink.className = \"very-terms\";\n ppLink.href = PrivacyUrl;\n ppLink.target = \"_blank\";\n ppLink.rel = \"noopener noreferrer\";\n ppLink.textContent = \"Privacy Policy\";\n\n linksRow.appendChild(tosLink);\n linksRow.appendChild(separator);\n linksRow.appendChild(ppLink);\n\n footer.appendChild(logoRow);\n footer.appendChild(linksRow);\n\n return footer;\n};\n\nconst qrCode = new QRCodeStyling({\n width: 240,\n height: 240,\n backgroundOptions: {\n color: \"#fafbff\",\n },\n dotsOptions: {\n color: \"#000000\",\n type: \"dots\",\n },\n cornersDotOptions: {\n type: \"rounded\",\n color: \"#000000\",\n },\n cornersSquareOptions: {\n type: \"extra-rounded\",\n color: \"#000000\",\n },\n qrOptions: {\n errorCorrectionLevel: \"Q\",\n },\n type: \"svg\",\n});\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Create Logo\n const logo = document.createElement(\"div\");\n logo.innerHTML = logoSVG;\n\n // Create title\n const title = document.createElement(\"div\");\n title.className = \"title\";\n title.textContent = \"Verify with VeryAI\";\n\n // Create tip\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Please use your VeryAI App to scan the QR code\";\n\n // Create QR code container\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-center\";\n qrContainer.style.position = \"relative\";\n qrContainer.style.borderRadius = \"17px\";\n qrContainer.style.overflow = \"hidden\";\n\n // Need to integrate QR code generation library here\n qrCode.update({\n data: url,\n });\n\n qrCode.append(qrContainer);\n\n // If processing, add processing overlay\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n\n text.innerHTML = `\n \n <div style=\"margin-top: 16px; text-align: center;\">\n Please wait while we <br /> process your verification.\n </div>\n `;\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n container.appendChild(logo);\n container.appendChild(title);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n error.innerHTML = `\n ${\n isExpired\n ? `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n`\n : `\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16310)\">\n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16310\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`\n }\n <div class=\"error\">${\n isExpired ? \"Session Expired\" : \"Verification Failed\"\n }</div>\n <div style=\"font-size: 16px; color: var(--very-secondary);\">${\n errorText || \"Unable to verify your identity. Please try again.\"\n }</div>\n <div class=\"very-try-again\" onclick=\"this.dispatchEvent(new CustomEvent('refresh'))\">\n Try Again\n </div>\n `;\n\n error.addEventListener(\"refresh\", onRefresh);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"var(--very-active, #3692cd)\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\nexport const logoSVG = `<svg width=\"56\" height=\"48\" viewBox=\"0 0 56 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z\" fill=\"var(--very-primary, #fafbff)\"/>\n</svg>\n`;\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, this.refresh)\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Open VeryAI Widget</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF,OAAO;AACL,SAAK,YAAY,KAAK;AAAA,EACxB;AAEA,MAAI,MAAM,YAAY;AACpB,UAAM,WAAW,UAAU;AAAA,EAC7B,OAAO;AACL,UAAM,YAAY,SAAS,eAAe,GAAG,CAAC;AAAA,EAChD;AACF;;;ACvB8B,YAAY,8sJAA8sJ;;;ACA3vJ,IAAM,UAAU;AAChB,IAAM,mBAAmB;AACzB,IAAM,SA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IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["QRCodeStyling"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["// Native JavaScript version (recommended)\nexport { createVeryWidget } from \"./vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig, IVeryWidgetState } from \"./vanilla/VeryWidget\";\n\n// Multi-framework adapters\nexport * from \"./adapters/react\";\nexport * from \"./adapters/vanilla\";\nexport * from \"./adapters/vue\";\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default,\\n.dark {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.light {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #fafbff;\\n --very-primary: #1c2125;\\n --very-secondary: rgba(0, 0, 0, 0.6);\\n --very-tertiary: rgba(0, 0, 0, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #1f3765;\\n --very-button-text: #fafbff;\\n --very-border: #1f3765;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-processing-text {\\n margin-top: 16px;\\n text-align: center;\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 20px;\\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 440px;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n padding: 40px 32px 24px;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 0;\\n }\\n .very-brand-header {\\n height: 28px;\\n width: auto;\\n margin-bottom: 16px;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-size: 16px;\\n letter-spacing: -0.2px;\\n line-height: 144%;\\n margin-bottom: 20px;\\n text-align: center;\\n }\\n .very-hint {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n letter-spacing: -0.1px;\\n line-height: 144%;\\n margin-top: 16px;\\n text-align: center;\\n }\\n}\\n.very-qr-container {\\n position: relative;\\n border-radius: 17px;\\n overflow: hidden;\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 12px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n opacity: 0.6;\\n transition: opacity 0.15s ease;\\n}\\n.very-close:hover {\\n opacity: 1;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-secondary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 400;\\n gap: 6px;\\n padding: 0 32px 28px;\\n width: 100%;\\n}\\n.very-footer-links {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n}\\n.very-footer-sep {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n}\\n.very-terms {\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--very-tertiary);\\n text-decoration: underline;\\n text-underline-offset: 2px;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: var(--very-button-bg);\\n border: none;\\n border-radius: 12px;\\n color: var(--very-button-text);\\n cursor: pointer;\\n display: flex;\\n font-size: 16px;\\n font-weight: 600;\\n gap: 12px;\\n height: 56px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 16px 28px;\\n width: 100%;\\n transition: opacity 0.15s ease;\\n}\\n.very-try-again:hover {\\n opacity: 0.9;\\n}\\n.error {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n text-align: center;\\n}\\n.very-error-description {\\n font-size: 16px;\\n color: var(--very-secondary);\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsUrl = \"https://very.org/legal/terms\";\nexport const PrivacyUrl = \"https://very.org/legal/privacy\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsUrl, PrivacyUrl } from \"../tools/constants\";\nimport { errorSVG, expiredSVG } from \"./svgs\";\n\nconst QR_OPTIONS = {\n width: 240,\n height: 240,\n backgroundOptions: { color: \"#fafbff\" },\n dotsOptions: { color: \"#000000\", type: \"dots\" as const },\n cornersDotOptions: { type: \"rounded\" as const, color: \"#000000\" },\n cornersSquareOptions: { type: \"extra-rounded\" as const, color: \"#000000\" },\n qrOptions: { errorCorrectionLevel: \"Q\" as const },\n type: \"svg\" as const,\n};\n\nfunction createExternalLink(href: string, label: string): HTMLAnchorElement {\n const a = document.createElement(\"a\");\n a.className = \"very-terms\";\n a.href = href;\n a.target = \"_blank\";\n a.rel = \"noopener noreferrer\";\n a.textContent = label;\n return a;\n}\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n\n const linksRow = document.createElement(\"div\");\n linksRow.className = \"very-footer-links\";\n\n linksRow.appendChild(createExternalLink(TermsUrl, \"Terms of Service\"));\n\n const separator = document.createElement(\"span\");\n separator.className = \"very-footer-sep\";\n separator.textContent = \"\\u00b7\";\n linksRow.appendChild(separator);\n\n linksRow.appendChild(createExternalLink(PrivacyUrl, \"Privacy Policy\"));\n\n footer.appendChild(linksRow);\n\n return footer;\n};\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean,\n theme: \"default\" | \"light\" | \"dark\" = \"default\"\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Brand wordmark — single brand element, no redundant text\n const brand = document.createElement(\"img\");\n brand.className = \"very-brand-header\";\n brand.alt = \"VeryAI\";\n brand.src =\n theme === \"light\"\n ? \"https://assets.very.org/branding/logo-dark.svg\"\n : \"https://assets.very.org/branding/logo-light.svg\";\n\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Scan to verify your identity\";\n\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-qr-container\";\n\n const qrCode = new QRCodeStyling(QR_OPTIONS);\n qrCode.update({ data: url });\n qrCode.append(qrContainer);\n\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n text.className = \"very-processing-text\";\n text.textContent = \"Processing verification…\";\n\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n const hint = document.createElement(\"div\");\n hint.className = \"very-hint\";\n hint.textContent = \"Open the VeryAI app and scan this code\";\n\n container.appendChild(brand);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n container.appendChild(hint);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n const icon = document.createElement(\"div\");\n // SVG constants from svgs.ts, not user input\n icon.innerHTML = isExpired ? expiredSVG : errorSVG; // eslint-disable-line no-unsanitized/property\n error.appendChild(icon);\n\n const heading = document.createElement(\"div\");\n heading.className = \"error\";\n heading.textContent = isExpired ? \"Session Expired\" : \"Verification Failed\";\n error.appendChild(heading);\n\n const description = document.createElement(\"div\");\n description.className = \"very-error-description\";\n description.textContent =\n errorText || \"Unable to verify your identity. Please try again.\";\n error.appendChild(description);\n\n const tryAgain = document.createElement(\"div\");\n tryAgain.className = \"very-try-again\";\n tryAgain.textContent = \"Try Again\";\n tryAgain.addEventListener(\"click\", onRefresh);\n error.appendChild(tryAgain);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n // Hardcoded SVG constant, not user input\n // eslint-disable-next-line no-unsanitized/property\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"var(--very-active, #3692cd)\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n // eslint-disable-next-line no-unsanitized/property\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private mobileRedirectDone = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false, this.config.theme)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true, this.config.theme));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, () => this.refresh())\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n if (this.mobileRedirectDone) return;\n\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n this.mobileRedirectDone = true;\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.mobileRedirectDone = false;\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Verify with VeryAI</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF,OAAO;AACL,SAAK,YAAY,KAAK;AAAA,EACxB;AAEA,MAAI,MAAM,YAAY;AACpB,UAAM,WAAW,UAAU;AAAA,EAC7B,OAAO;AACL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AM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["QRCodeStyling"]}
|
package/build/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// src/styles/styles.css
|
|
24
|
-
styleInject(".default
|
|
24
|
+
styleInject(".default,\n.dark {\n --very-brand-color: #1f3765;\n --very-bg-color: #000;\n --very-primary: #fafbff;\n --very-secondary: rgba(255, 255, 255, 0.6);\n --very-tertiary: rgba(255, 255, 255, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #fafbff;\n --very-button-text: #1f3765;\n --very-border: #b0c6d4;\n}\n.light {\n --very-brand-color: #1f3765;\n --very-bg-color: #fafbff;\n --very-primary: #1c2125;\n --very-secondary: rgba(0, 0, 0, 0.6);\n --very-tertiary: rgba(0, 0, 0, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #1f3765;\n --very-button-text: #fafbff;\n --very-border: #1f3765;\n}\n.very-dialog-overlay {\n backdrop-filter: blur(4px);\n background-color: rgba(0, 0, 0, 0.5);\n inset: 0;\n position: fixed;\n z-index: 40;\n}\n.very-processing {\n backdrop-filter: blur(4px);\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 16px;\n font-weight: 500;\n color: var(--very-primary);\n}\n.very-processing-text {\n margin-top: 16px;\n text-align: center;\n}\n.very-widget {\n align-items: center;\n background-color: var(--very-bg-color);\n border-radius: 20px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n color: var(--very-primary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 16px;\n left: 50%;\n max-width: 440px;\n position: fixed;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 90vw;\n z-index: 50;\n .very-content {\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n padding: 40px 32px 24px;\n }\n .very-center {\n position: relative;\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n gap: 0;\n }\n .very-brand-header {\n height: 28px;\n width: auto;\n margin-bottom: 16px;\n }\n .tip {\n color: var(--very-secondary);\n font-size: 16px;\n letter-spacing: -0.2px;\n line-height: 144%;\n margin-bottom: 20px;\n text-align: center;\n }\n .very-hint {\n color: var(--very-tertiary);\n font-size: 13px;\n letter-spacing: -0.1px;\n line-height: 144%;\n margin-top: 16px;\n text-align: center;\n }\n}\n.very-qr-container {\n position: relative;\n border-radius: 17px;\n overflow: hidden;\n}\n.very-close {\n cursor: pointer;\n padding: 12px;\n position: absolute;\n right: 16px;\n top: 16px;\n opacity: 0.6;\n transition: opacity 0.15s ease;\n}\n.very-close:hover {\n opacity: 1;\n}\n.very-footer {\n align-items: center;\n color: var(--very-secondary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n gap: 6px;\n padding: 0 32px 28px;\n width: 100%;\n}\n.very-footer-links {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.very-footer-sep {\n color: var(--very-tertiary);\n font-size: 13px;\n}\n.very-terms {\n cursor: pointer;\n font-size: 13px;\n color: var(--very-tertiary);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.very-try-again {\n align-items: center;\n background-color: var(--very-button-bg);\n border: none;\n border-radius: 12px;\n color: var(--very-button-text);\n cursor: pointer;\n display: flex;\n font-size: 16px;\n font-weight: 600;\n gap: 12px;\n height: 56px;\n justify-content: center;\n margin-top: 24px;\n padding: 16px 28px;\n width: 100%;\n transition: opacity 0.15s ease;\n}\n.very-try-again:hover {\n opacity: 0.9;\n}\n.error {\n color: var(--very-primary);\n font-size: 28px;\n font-style: normal;\n font-weight: 600;\n letter-spacing: -0.5px;\n line-height: 120%;\n text-align: center;\n}\n.very-error-description {\n font-size: 16px;\n color: var(--very-secondary);\n text-align: center;\n}\n.very-loading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 60px;\n height: 60px;\n}\n.very-loading-animation {\n animation: very-spin 1s linear infinite;\n width: 60px;\n height: 60px;\n}\n.very-loading-logo {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes very-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n");
|
|
25
25
|
|
|
26
26
|
// src/tools/constants.ts
|
|
27
27
|
var API_URL = "https://bridge.very.org/api/v1/";
|
|
@@ -154,153 +154,112 @@ var closeSVG = `
|
|
|
154
154
|
</defs>
|
|
155
155
|
</svg>
|
|
156
156
|
`;
|
|
157
|
-
var
|
|
158
|
-
<path
|
|
159
|
-
<path d="
|
|
160
|
-
<path d="
|
|
161
|
-
<path d="
|
|
162
|
-
<path d="
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
var errorSVG = `<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
158
|
+
<g clip-path="url(#clip0_2453_16310)">
|
|
159
|
+
<path d="M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
160
|
+
<path d="M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
161
|
+
<path d="M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
162
|
+
<path d="M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
163
|
+
<path d="M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898" stroke="var(--very-primary, #fafbff)" stroke-width="2" />
|
|
164
|
+
<path d="M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898" stroke="var(--very-primary, #fafbff)" stroke-width="2" /> </g> <defs> <clipPath id="clip0_2453_16310"> <rect width="48" height="48" fill="white" /> </clipPath> </defs>
|
|
165
|
+
</svg>`;
|
|
166
|
+
var expiredSVG = ` <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
167
|
+
<path d="M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
168
|
+
<path d="M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
169
|
+
<path d="M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
170
|
+
<path d="M20.5652 27.6289H11.4058" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
171
|
+
<path d="M20.5654 27.6289L25.7176 37.1701" stroke="var(--very-primary, #fafbff)" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
|
172
|
+
</svg>`;
|
|
165
173
|
|
|
166
174
|
// src/vanilla/components.ts
|
|
175
|
+
var QR_OPTIONS = {
|
|
176
|
+
width: 240,
|
|
177
|
+
height: 240,
|
|
178
|
+
backgroundOptions: { color: "#fafbff" },
|
|
179
|
+
dotsOptions: { color: "#000000", type: "dots" },
|
|
180
|
+
cornersDotOptions: { type: "rounded", color: "#000000" },
|
|
181
|
+
cornersSquareOptions: { type: "extra-rounded", color: "#000000" },
|
|
182
|
+
qrOptions: { errorCorrectionLevel: "Q" },
|
|
183
|
+
type: "svg"
|
|
184
|
+
};
|
|
185
|
+
function createExternalLink(href, label) {
|
|
186
|
+
const a = document.createElement("a");
|
|
187
|
+
a.className = "very-terms";
|
|
188
|
+
a.href = href;
|
|
189
|
+
a.target = "_blank";
|
|
190
|
+
a.rel = "noopener noreferrer";
|
|
191
|
+
a.textContent = label;
|
|
192
|
+
return a;
|
|
193
|
+
}
|
|
167
194
|
var createFooterElement = () => {
|
|
168
195
|
const footer = document.createElement("div");
|
|
169
196
|
footer.className = "very-footer";
|
|
170
|
-
const logoRow = document.createElement("div");
|
|
171
|
-
logoRow.className = "very-footer-logo";
|
|
172
|
-
const poweredByText = document.createElement("span");
|
|
173
|
-
poweredByText.textContent = "Powered by";
|
|
174
|
-
logoRow.appendChild(poweredByText);
|
|
175
|
-
const brandLogo = document.createElement("img");
|
|
176
|
-
brandLogo.className = "very-footer-brand";
|
|
177
|
-
brandLogo.alt = "VeryAI";
|
|
178
|
-
brandLogo.src = "https://assets.very.org/branding/logo-light.svg";
|
|
179
|
-
logoRow.appendChild(brandLogo);
|
|
180
197
|
const linksRow = document.createElement("div");
|
|
181
198
|
linksRow.className = "very-footer-links";
|
|
182
|
-
|
|
183
|
-
tosLink.className = "very-terms";
|
|
184
|
-
tosLink.href = TermsUrl;
|
|
185
|
-
tosLink.target = "_blank";
|
|
186
|
-
tosLink.rel = "noopener noreferrer";
|
|
187
|
-
tosLink.textContent = "Terms of Service";
|
|
199
|
+
linksRow.appendChild(createExternalLink(TermsUrl, "Terms of Service"));
|
|
188
200
|
const separator = document.createElement("span");
|
|
189
201
|
separator.className = "very-footer-sep";
|
|
190
202
|
separator.textContent = "\xB7";
|
|
191
|
-
const ppLink = document.createElement("a");
|
|
192
|
-
ppLink.className = "very-terms";
|
|
193
|
-
ppLink.href = PrivacyUrl;
|
|
194
|
-
ppLink.target = "_blank";
|
|
195
|
-
ppLink.rel = "noopener noreferrer";
|
|
196
|
-
ppLink.textContent = "Privacy Policy";
|
|
197
|
-
linksRow.appendChild(tosLink);
|
|
198
203
|
linksRow.appendChild(separator);
|
|
199
|
-
linksRow.appendChild(
|
|
200
|
-
footer.appendChild(logoRow);
|
|
204
|
+
linksRow.appendChild(createExternalLink(PrivacyUrl, "Privacy Policy"));
|
|
201
205
|
footer.appendChild(linksRow);
|
|
202
206
|
return footer;
|
|
203
207
|
};
|
|
204
|
-
var
|
|
205
|
-
width: 240,
|
|
206
|
-
height: 240,
|
|
207
|
-
backgroundOptions: {
|
|
208
|
-
color: "#fafbff"
|
|
209
|
-
},
|
|
210
|
-
dotsOptions: {
|
|
211
|
-
color: "#000000",
|
|
212
|
-
type: "dots"
|
|
213
|
-
},
|
|
214
|
-
cornersDotOptions: {
|
|
215
|
-
type: "rounded",
|
|
216
|
-
color: "#000000"
|
|
217
|
-
},
|
|
218
|
-
cornersSquareOptions: {
|
|
219
|
-
type: "extra-rounded",
|
|
220
|
-
color: "#000000"
|
|
221
|
-
},
|
|
222
|
-
qrOptions: {
|
|
223
|
-
errorCorrectionLevel: "Q"
|
|
224
|
-
},
|
|
225
|
-
type: "svg"
|
|
226
|
-
});
|
|
227
|
-
var createQRCodeElement = (url, isProcessing) => {
|
|
208
|
+
var createQRCodeElement = (url, isProcessing, theme = "default") => {
|
|
228
209
|
const container = document.createElement("div");
|
|
229
210
|
container.className = "very-center";
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
title.textContent = "Verify with VeryAI";
|
|
211
|
+
const brand = document.createElement("img");
|
|
212
|
+
brand.className = "very-brand-header";
|
|
213
|
+
brand.alt = "VeryAI";
|
|
214
|
+
brand.src = theme === "light" ? "https://assets.very.org/branding/logo-dark.svg" : "https://assets.very.org/branding/logo-light.svg";
|
|
235
215
|
const tip = document.createElement("div");
|
|
236
216
|
tip.className = "tip";
|
|
237
|
-
tip.textContent = "
|
|
217
|
+
tip.textContent = "Scan to verify your identity";
|
|
238
218
|
const qrContainer = document.createElement("div");
|
|
239
|
-
qrContainer.className = "very-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
qrContainer.style.overflow = "hidden";
|
|
243
|
-
qrCode.update({
|
|
244
|
-
data: url
|
|
245
|
-
});
|
|
219
|
+
qrContainer.className = "very-qr-container";
|
|
220
|
+
const qrCode = new QRCodeStyling(QR_OPTIONS);
|
|
221
|
+
qrCode.update({ data: url });
|
|
246
222
|
qrCode.append(qrContainer);
|
|
247
223
|
if (isProcessing) {
|
|
248
224
|
const processing = document.createElement("div");
|
|
249
225
|
processing.className = "very-processing";
|
|
250
226
|
const loading = createLoadingElement();
|
|
251
227
|
const text = document.createElement("div");
|
|
252
|
-
text.
|
|
253
|
-
|
|
254
|
-
<div style="margin-top: 16px; text-align: center;">
|
|
255
|
-
Please wait while we <br /> process your verification.
|
|
256
|
-
</div>
|
|
257
|
-
`;
|
|
228
|
+
text.className = "very-processing-text";
|
|
229
|
+
text.textContent = "Processing verification\u2026";
|
|
258
230
|
processing.appendChild(loading);
|
|
259
231
|
processing.appendChild(text);
|
|
260
232
|
qrContainer.appendChild(processing);
|
|
261
233
|
}
|
|
262
|
-
|
|
263
|
-
|
|
234
|
+
const hint = document.createElement("div");
|
|
235
|
+
hint.className = "very-hint";
|
|
236
|
+
hint.textContent = "Open the VeryAI app and scan this code";
|
|
237
|
+
container.appendChild(brand);
|
|
264
238
|
container.appendChild(tip);
|
|
265
239
|
container.appendChild(qrContainer);
|
|
240
|
+
container.appendChild(hint);
|
|
266
241
|
return container;
|
|
267
242
|
};
|
|
268
243
|
var createErrorElement = (errorText, onRefresh) => {
|
|
269
244
|
const error = document.createElement("div");
|
|
270
245
|
error.className = "very-center";
|
|
271
246
|
const isExpired = errorText.includes("has expired");
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
<path d="M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898" stroke="var(--very-primary)" stroke-width="2"/>
|
|
289
|
-
</g>
|
|
290
|
-
<defs>
|
|
291
|
-
<clipPath id="clip0_2453_16310">
|
|
292
|
-
<rect width="48" height="48" fill="white"/>
|
|
293
|
-
</clipPath>
|
|
294
|
-
</defs>
|
|
295
|
-
</svg>
|
|
296
|
-
`}
|
|
297
|
-
<div class="error">${isExpired ? "Session Expired" : "Verification Failed"}</div>
|
|
298
|
-
<div style="font-size: 16px; color: var(--very-secondary);">${errorText || "Unable to verify your identity. Please try again."}</div>
|
|
299
|
-
<div class="very-try-again" onclick="this.dispatchEvent(new CustomEvent('refresh'))">
|
|
300
|
-
Try Again
|
|
301
|
-
</div>
|
|
302
|
-
`;
|
|
303
|
-
error.addEventListener("refresh", onRefresh);
|
|
247
|
+
const icon = document.createElement("div");
|
|
248
|
+
icon.innerHTML = isExpired ? expiredSVG : errorSVG;
|
|
249
|
+
error.appendChild(icon);
|
|
250
|
+
const heading = document.createElement("div");
|
|
251
|
+
heading.className = "error";
|
|
252
|
+
heading.textContent = isExpired ? "Session Expired" : "Verification Failed";
|
|
253
|
+
error.appendChild(heading);
|
|
254
|
+
const description = document.createElement("div");
|
|
255
|
+
description.className = "very-error-description";
|
|
256
|
+
description.textContent = errorText || "Unable to verify your identity. Please try again.";
|
|
257
|
+
error.appendChild(description);
|
|
258
|
+
const tryAgain = document.createElement("div");
|
|
259
|
+
tryAgain.className = "very-try-again";
|
|
260
|
+
tryAgain.textContent = "Try Again";
|
|
261
|
+
tryAgain.addEventListener("click", onRefresh);
|
|
262
|
+
error.appendChild(tryAgain);
|
|
304
263
|
return error;
|
|
305
264
|
};
|
|
306
265
|
var createLoadingElement = () => {
|
|
@@ -331,6 +290,7 @@ var VeryWidgetVanilla = class {
|
|
|
331
290
|
session;
|
|
332
291
|
timer;
|
|
333
292
|
isOpen = false;
|
|
293
|
+
mobileRedirectDone = false;
|
|
334
294
|
overlay;
|
|
335
295
|
widget;
|
|
336
296
|
content;
|
|
@@ -404,15 +364,15 @@ var VeryWidgetVanilla = class {
|
|
|
404
364
|
break;
|
|
405
365
|
case "qr-code":
|
|
406
366
|
this.content.appendChild(
|
|
407
|
-
createQRCodeElement(state.url, state.isProcessing || false)
|
|
367
|
+
createQRCodeElement(state.url, state.isProcessing || false, this.config.theme)
|
|
408
368
|
);
|
|
409
369
|
break;
|
|
410
370
|
case "processing":
|
|
411
|
-
this.content.appendChild(createQRCodeElement(state.url, true));
|
|
371
|
+
this.content.appendChild(createQRCodeElement(state.url, true, this.config.theme));
|
|
412
372
|
break;
|
|
413
373
|
case "error":
|
|
414
374
|
this.content.appendChild(
|
|
415
|
-
createErrorElement(state.errorText, this.refresh)
|
|
375
|
+
createErrorElement(state.errorText, () => this.refresh())
|
|
416
376
|
);
|
|
417
377
|
break;
|
|
418
378
|
}
|
|
@@ -527,10 +487,12 @@ var VeryWidgetVanilla = class {
|
|
|
527
487
|
}, 3e3);
|
|
528
488
|
}
|
|
529
489
|
handleMobileRedirect(url) {
|
|
530
|
-
|
|
490
|
+
if (this.mobileRedirectDone) return;
|
|
491
|
+
const isMobile = /Mobile|Android|iPhone|iPad|iPod|Tablet/i.test(
|
|
531
492
|
navigator.userAgent
|
|
532
493
|
);
|
|
533
494
|
if (isMobile) {
|
|
495
|
+
this.mobileRedirectDone = true;
|
|
534
496
|
setTimeout(() => {
|
|
535
497
|
const link = document.createElement("a");
|
|
536
498
|
link.href = url;
|
|
@@ -550,6 +512,7 @@ var VeryWidgetVanilla = class {
|
|
|
550
512
|
}
|
|
551
513
|
refresh() {
|
|
552
514
|
this.cleanup();
|
|
515
|
+
this.mobileRedirectDone = false;
|
|
553
516
|
this.getSession();
|
|
554
517
|
}
|
|
555
518
|
destroy() {
|
|
@@ -600,7 +563,7 @@ var VeryWidget = ({
|
|
|
600
563
|
if (children) {
|
|
601
564
|
return /* @__PURE__ */ jsx("div", { className, children: children({ open: handleOpen }) });
|
|
602
565
|
}
|
|
603
|
-
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("button", { onClick: handleOpen, children: "
|
|
566
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("button", { onClick: handleOpen, children: "Verify with VeryAI" }) });
|
|
604
567
|
};
|
|
605
568
|
|
|
606
569
|
// src/adapters/vue/index.ts
|
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.dark {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.light {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #fafbff;\\n --very-primary: #1c2125;\\n --very-secondary: rgba(0, 0, 0, 0.6);\\n --very-tertiary: rgba(0, 0, 0, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #1f3765;\\n --very-button-text: #fafbff;\\n --very-border: #1f3765;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 20px;\\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 440px;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n padding: 40px 32px 24px;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 8px;\\n }\\n .title {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n margin-top: 20px;\\n text-align: center;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-size: 16px;\\n font-style: normal;\\n letter-spacing: -0.192px;\\n line-height: 144%;\\n margin-bottom: 24px;\\n margin-top: 8px;\\n text-align: center;\\n }\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 12px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n opacity: 0.6;\\n transition: opacity 0.15s ease;\\n}\\n.very-close:hover {\\n opacity: 1;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-secondary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 400;\\n gap: 6px;\\n padding: 0 32px 28px;\\n width: 100%;\\n}\\n.very-footer-logo {\\n align-items: center;\\n display: flex;\\n gap: 6px;\\n}\\n.very-footer-brand {\\n height: 14px;\\n width: auto;\\n}\\n.light .very-footer-brand {\\n content: url(https://assets.very.org/branding/logo-dark.svg);\\n}\\n.very-footer-links {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n}\\n.very-footer-sep {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n}\\n.very-terms {\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--very-tertiary);\\n text-decoration: underline;\\n text-underline-offset: 2px;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: var(--very-button-bg);\\n border: none;\\n border-radius: 12px;\\n color: var(--very-button-text);\\n cursor: pointer;\\n display: flex;\\n font-size: 16px;\\n font-weight: 600;\\n gap: 12px;\\n height: 56px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 16px 28px;\\n width: 100%;\\n transition: opacity 0.15s ease;\\n}\\n.very-try-again:hover {\\n opacity: 0.9;\\n}\\n.error {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsUrl = \"https://very.org/legal/terms\";\nexport const PrivacyUrl = \"https://very.org/legal/privacy\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsUrl, PrivacyUrl } from \"../tools/constants\";\nimport { logoSVG } from \"./svgs\";\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n\n const logoRow = document.createElement(\"div\");\n logoRow.className = \"very-footer-logo\";\n\n const poweredByText = document.createElement(\"span\");\n poweredByText.textContent = \"Powered by\";\n logoRow.appendChild(poweredByText);\n\n const brandLogo = document.createElement(\"img\");\n brandLogo.className = \"very-footer-brand\";\n brandLogo.alt = \"VeryAI\";\n brandLogo.src = \"https://assets.very.org/branding/logo-light.svg\";\n logoRow.appendChild(brandLogo);\n\n const linksRow = document.createElement(\"div\");\n linksRow.className = \"very-footer-links\";\n\n const tosLink = document.createElement(\"a\");\n tosLink.className = \"very-terms\";\n tosLink.href = TermsUrl;\n tosLink.target = \"_blank\";\n tosLink.rel = \"noopener noreferrer\";\n tosLink.textContent = \"Terms of Service\";\n\n const separator = document.createElement(\"span\");\n separator.className = \"very-footer-sep\";\n separator.textContent = \"·\";\n\n const ppLink = document.createElement(\"a\");\n ppLink.className = \"very-terms\";\n ppLink.href = PrivacyUrl;\n ppLink.target = \"_blank\";\n ppLink.rel = \"noopener noreferrer\";\n ppLink.textContent = \"Privacy Policy\";\n\n linksRow.appendChild(tosLink);\n linksRow.appendChild(separator);\n linksRow.appendChild(ppLink);\n\n footer.appendChild(logoRow);\n footer.appendChild(linksRow);\n\n return footer;\n};\n\nconst qrCode = new QRCodeStyling({\n width: 240,\n height: 240,\n backgroundOptions: {\n color: \"#fafbff\",\n },\n dotsOptions: {\n color: \"#000000\",\n type: \"dots\",\n },\n cornersDotOptions: {\n type: \"rounded\",\n color: \"#000000\",\n },\n cornersSquareOptions: {\n type: \"extra-rounded\",\n color: \"#000000\",\n },\n qrOptions: {\n errorCorrectionLevel: \"Q\",\n },\n type: \"svg\",\n});\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Create Logo\n const logo = document.createElement(\"div\");\n logo.innerHTML = logoSVG;\n\n // Create title\n const title = document.createElement(\"div\");\n title.className = \"title\";\n title.textContent = \"Verify with VeryAI\";\n\n // Create tip\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Please use your VeryAI App to scan the QR code\";\n\n // Create QR code container\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-center\";\n qrContainer.style.position = \"relative\";\n qrContainer.style.borderRadius = \"17px\";\n qrContainer.style.overflow = \"hidden\";\n\n // Need to integrate QR code generation library here\n qrCode.update({\n data: url,\n });\n\n qrCode.append(qrContainer);\n\n // If processing, add processing overlay\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n\n text.innerHTML = `\n \n <div style=\"margin-top: 16px; text-align: center;\">\n Please wait while we <br /> process your verification.\n </div>\n `;\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n container.appendChild(logo);\n container.appendChild(title);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n error.innerHTML = `\n ${\n isExpired\n ? `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n`\n : `\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16310)\">\n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16310\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`\n }\n <div class=\"error\">${\n isExpired ? \"Session Expired\" : \"Verification Failed\"\n }</div>\n <div style=\"font-size: 16px; color: var(--very-secondary);\">${\n errorText || \"Unable to verify your identity. Please try again.\"\n }</div>\n <div class=\"very-try-again\" onclick=\"this.dispatchEvent(new CustomEvent('refresh'))\">\n Try Again\n </div>\n `;\n\n error.addEventListener(\"refresh\", onRefresh);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"var(--very-active, #3692cd)\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\nexport const logoSVG = `<svg width=\"56\" height=\"48\" viewBox=\"0 0 56 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z\" fill=\"var(--very-primary, #fafbff)\"/>\n</svg>\n`;\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, this.refresh)\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Open VeryAI Widget</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";AACyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF,OAAO;AACL,SAAK,YAAY,KAAK;AAAA,EACxB;AAEA,MAAI,MAAM,YAAY;AACpB,UAAM,WAAW,UAAU;AAAA,EAC7B,OAAO;AACL,UAAM,YAAY,SAAS,eAAe,GAAG,CAAC;AAAA,EAChD;AACF;;;ACvB8B,YAAY,8sJAA8sJ;;;ACA3vJ,IAAM,UAAU;AAChB,IAAM,mBAAmB;AACzB,IAAM,SAAS;AAEf,IAAM,WAAW;AACjB,IAAM,aAAa;;;ACLnB,IAAM,eAAe,CAAC,SAA8B;AACzD,SAAO,KAAK,OAAO,aAAa,GAAG,IAAI,WAAW,IAAI,CAAC,CAAC;AAC1D;AAEO,IAAM,eAAe,CAAC,WAAgC;AAC3D,QAAM,SAAS,KAAK,MAAM;AAC1B,QAAM,QAAQ,IAAI,WAAW,OAAO,MAAM;AAC1C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,UAAM,CAAC,IAAI,OAAO,WAAW,CAAC;AAAA,EAChC;AACA,SAAO,MAAM;AACf;AAEO,IAAM,iBAAiB,OAC5B,KACA,IACA,YACyB;AACzB,Q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AU,QAAQ,KAAK;AAAA,IACzB;AAAA,EACF;AAEA,MAAI,UAAU;AACZ,WAAO,oBAAC,SAAI,WAAuB,mBAAS,EAAE,MAAM,WAAW,CAAC,GAAE;AAAA,EACpE;AAEA,SACE,oBAAC,SAAI,WACH,8BAAC,YAAO,SAAS,YAAY,gCAAkB,GACjD;AAEJ;;;ACrBO,IAAM,gBAAgB,CAAC,WAAiC;AAC7D,MAAI,iBAA6D;AACjE,MAAI,SAAS;AAEb,QAAM,OAAO,MAAM;AACjB,QAAI,CAAC,gBAAgB;AACnB,uBAAiB,iBAAiB;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,CAAC,UAAU;AACpB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AACA,mBAAe,KAAK;AACpB,aAAS;AAAA,EACX;AAEA,QAAM,QAAQ,MAAM;AAClB,QAAI,gBAAgB;AAClB,qBAAe,MAAM;AACrB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default,\\n.dark {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.light {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #fafbff;\\n --very-primary: #1c2125;\\n --very-secondary: rgba(0, 0, 0, 0.6);\\n --very-tertiary: rgba(0, 0, 0, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #1f3765;\\n --very-button-text: #fafbff;\\n --very-border: #1f3765;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-processing-text {\\n margin-top: 16px;\\n text-align: center;\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 20px;\\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 440px;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n padding: 40px 32px 24px;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 0;\\n }\\n .very-brand-header {\\n height: 28px;\\n width: auto;\\n margin-bottom: 16px;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-size: 16px;\\n letter-spacing: -0.2px;\\n line-height: 144%;\\n margin-bottom: 20px;\\n text-align: center;\\n }\\n .very-hint {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n letter-spacing: -0.1px;\\n line-height: 144%;\\n margin-top: 16px;\\n text-align: center;\\n }\\n}\\n.very-qr-container {\\n position: relative;\\n border-radius: 17px;\\n overflow: hidden;\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 12px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n opacity: 0.6;\\n transition: opacity 0.15s ease;\\n}\\n.very-close:hover {\\n opacity: 1;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-secondary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 400;\\n gap: 6px;\\n padding: 0 32px 28px;\\n width: 100%;\\n}\\n.very-footer-links {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n}\\n.very-footer-sep {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n}\\n.very-terms {\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--very-tertiary);\\n text-decoration: underline;\\n text-underline-offset: 2px;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: var(--very-button-bg);\\n border: none;\\n border-radius: 12px;\\n color: var(--very-button-text);\\n cursor: pointer;\\n display: flex;\\n font-size: 16px;\\n font-weight: 600;\\n gap: 12px;\\n height: 56px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 16px 28px;\\n width: 100%;\\n transition: opacity 0.15s ease;\\n}\\n.very-try-again:hover {\\n opacity: 0.9;\\n}\\n.error {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n text-align: center;\\n}\\n.very-error-description {\\n font-size: 16px;\\n color: var(--very-secondary);\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsUrl = \"https://very.org/legal/terms\";\nexport const PrivacyUrl = \"https://very.org/legal/privacy\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsUrl, PrivacyUrl } from \"../tools/constants\";\nimport { errorSVG, expiredSVG } from \"./svgs\";\n\nconst QR_OPTIONS = {\n width: 240,\n height: 240,\n backgroundOptions: { color: \"#fafbff\" },\n dotsOptions: { color: \"#000000\", type: \"dots\" as const },\n cornersDotOptions: { type: \"rounded\" as const, color: \"#000000\" },\n cornersSquareOptions: { type: \"extra-rounded\" as const, color: \"#000000\" },\n qrOptions: { errorCorrectionLevel: \"Q\" as const },\n type: \"svg\" as const,\n};\n\nfunction createExternalLink(href: string, label: string): HTMLAnchorElement {\n const a = document.createElement(\"a\");\n a.className = \"very-terms\";\n a.href = href;\n a.target = \"_blank\";\n a.rel = \"noopener noreferrer\";\n a.textContent = label;\n return a;\n}\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n\n const linksRow = document.createElement(\"div\");\n linksRow.className = \"very-footer-links\";\n\n linksRow.appendChild(createExternalLink(TermsUrl, \"Terms of Service\"));\n\n const separator = document.createElement(\"span\");\n separator.className = \"very-footer-sep\";\n separator.textContent = \"\\u00b7\";\n linksRow.appendChild(separator);\n\n linksRow.appendChild(createExternalLink(PrivacyUrl, \"Privacy Policy\"));\n\n footer.appendChild(linksRow);\n\n return footer;\n};\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean,\n theme: \"default\" | \"light\" | \"dark\" = \"default\"\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Brand wordmark — single brand element, no redundant text\n const brand = document.createElement(\"img\");\n brand.className = \"very-brand-header\";\n brand.alt = \"VeryAI\";\n brand.src =\n theme === \"light\"\n ? \"https://assets.very.org/branding/logo-dark.svg\"\n : \"https://assets.very.org/branding/logo-light.svg\";\n\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Scan to verify your identity\";\n\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-qr-container\";\n\n const qrCode = new QRCodeStyling(QR_OPTIONS);\n qrCode.update({ data: url });\n qrCode.append(qrContainer);\n\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n text.className = \"very-processing-text\";\n text.textContent = \"Processing verification…\";\n\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n const hint = document.createElement(\"div\");\n hint.className = \"very-hint\";\n hint.textContent = \"Open the VeryAI app and scan this code\";\n\n container.appendChild(brand);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n container.appendChild(hint);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n const icon = document.createElement(\"div\");\n // SVG constants from svgs.ts, not user input\n icon.innerHTML = isExpired ? expiredSVG : errorSVG; // eslint-disable-line no-unsanitized/property\n error.appendChild(icon);\n\n const heading = document.createElement(\"div\");\n heading.className = \"error\";\n heading.textContent = isExpired ? \"Session Expired\" : \"Verification Failed\";\n error.appendChild(heading);\n\n const description = document.createElement(\"div\");\n description.className = \"very-error-description\";\n description.textContent =\n errorText || \"Unable to verify your identity. Please try again.\";\n error.appendChild(description);\n\n const tryAgain = document.createElement(\"div\");\n tryAgain.className = \"very-try-again\";\n tryAgain.textContent = \"Try Again\";\n tryAgain.addEventListener(\"click\", onRefresh);\n error.appendChild(tryAgain);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n // Hardcoded SVG constant, not user input\n // eslint-disable-next-line no-unsanitized/property\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"var(--very-active, #3692cd)\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n // eslint-disable-next-line no-unsanitized/property\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private mobileRedirectDone = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false, this.config.theme)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true, this.config.theme));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, () => this.refresh())\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n if (this.mobileRedirectDone) return;\n\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n this.mobileRedirectDone = true;\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.mobileRedirectDone = false;\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Verify with VeryAI</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close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;;;ACrBO,IAAM,gBAAgB,CAAC,WAAiC;AAC7D,MAAI,iBAA6D;AACjE,MAAI,SAAS;AAEb,QAAM,OAAO,MAAM;AACjB,QAAI,CAAC,gBAAgB;AACnB,uBAAiB,iBAAiB;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,CAAC,UAAU;AACpB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AACA,mBAAe,KAAK;AACpB,aAAS;AAAA,EACX;AAEA,QAAM,QAAQ,MAAM;AAClB,QAAI,gBAAgB;AAClB,qBAAe,MAAM;AACrB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryai/widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "Cross-framework widget for Very palm verification.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"version": "bumpp patch ",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
},
|
|
67
67
|
"repository": {
|
|
68
68
|
"type": "git",
|
|
69
|
-
"url": "git+https://github.com/veroslabs/
|
|
69
|
+
"url": "git+https://github.com/veroslabs/very-widget.git"
|
|
70
70
|
},
|
|
71
71
|
"bugs": {
|
|
72
|
-
"url": "https://github.com/veroslabs/
|
|
72
|
+
"url": "https://github.com/veroslabs/very-widget/issues"
|
|
73
73
|
},
|
|
74
|
-
"homepage": "https://github.com/veroslabs/
|
|
74
|
+
"homepage": "https://github.com/veroslabs/very-widget",
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
}
|