@didit-protocol/sdk-web 0.5.3 → 0.7.0
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/README.md +8 -1
- package/dist/didit-sdk.cjs +221 -42
- package/dist/didit-sdk.cjs.js +221 -42
- package/dist/didit-sdk.cjs.js.map +1 -1
- package/dist/didit-sdk.cjs.map +1 -1
- package/dist/didit-sdk.esm.js +699 -266
- package/dist/didit-sdk.esm.js.map +1 -1
- package/dist/didit-sdk.module.js +222 -43
- package/dist/didit-sdk.module.js.map +1 -1
- package/dist/didit-sdk.umd.js +700 -265
- package/dist/didit-sdk.umd.js.map +1 -1
- package/dist/didit-sdk.umd.min.js +2 -2
- package/dist/didit-sdk.umd.min.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +7 -2
package/dist/didit-sdk.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didit-sdk.cjs","sources":["../../src/constants.ts","../../src/utils.ts","../../src/translations.ts","../../src/modal.ts","../../src/transactions.ts","../../src/DiditSdk.ts"],"sourcesContent":["export const DEFAULT_CONFIG = {\n zIndex: 9999,\n showCloseButton: true,\n showExitConfirmation: true,\n loggingEnabled: false,\n closeModalOnComplete: false\n} as const;\n\nexport const CSS_CLASSES = {\n overlay: \"didit-modal-overlay\",\n container: \"didit-modal-container\",\n content: \"didit-modal-content\",\n iframe: \"didit-verification-iframe\",\n closeButton: \"didit-close-button\",\n closeIcon: \"didit-close-icon\",\n closeIconLegacy: \"didit-close-icon-legacy\",\n flowSized: \"didit-flow-sized\",\n sizeAnimated: \"didit-size-animated\",\n loading: \"didit-loading\",\n confirmOverlay: \"didit-confirm-overlay\",\n confirmBox: \"didit-confirm-box\",\n embedded: \"didit-embedded\"\n} as const;\n\nexport const SDK_VERSION = \"__SDK_PACKAGE_VERSION__\";\n\n/**\n * The permissions the verification iframe gets, in a modal and embedded:\n * camera and microphone for capture, clipboard-write for the flow's copy\n * buttons, and digital-credentials-get so the flow can ask a digital ID wallet\n * (Google Wallet) through the W3C Digital Credentials API from inside the iframe.\n */\nexport const IFRAME_ALLOW =\n \"camera; microphone; fullscreen; autoplay; encrypted-media; geolocation; clipboard-write; digital-credentials-get\";\n\n/** The verification-URL query parameter each camera option is forwarded as. */\nexport const CAMERA_QUERY_PARAMS = {\n defaultDocumentCamera: \"document_camera\",\n defaultLivenessCamera: \"liveness_camera\",\n showDocumentCameraSwitchButton: \"document_camera_switch\",\n showLivenessCameraSwitchButton: \"liveness_camera_switch\"\n} as const;\n\nexport const CAMERA_LENSES = [\"front\", \"back\"] as const;\n\n/**\n * The verification-URL query parameters that tell the hosted flow how the SDK\n * presents it: `sdk_presentation=modal|embedded` and, in a modal,\n * `sdk_close_button=true|false` (whether the SDK draws its close button over\n * the flow's top bar).\n */\nexport const PRESENTATION_QUERY_PARAMS = {\n presentation: \"sdk_presentation\",\n closeButton: \"sdk_close_button\"\n} as const;\n\n/**\n * Posted by the hosted flow when it lays itself out for the modal, with\n * `data: { contentHeight, colorScheme?, dir?, kind? }` (`kind` is `handoff` or `step`, `step` when missing). The modal then grows to the\n * handoff card on a computer and follows the content height in a narrow\n * window. Handled by the modal and never delivered to `onEvent`.\n */\nexport const LAYOUT_MESSAGE_TYPE = \"didit:layout\";\n\n/** Languages the hosted flow lays out right to left. */\nexport const RTL_LANGUAGES = [\"ar\", \"fa\", \"he\"];\n\nexport const languages = [\n \"ar\",\n \"bg\",\n \"bn\",\n \"ca\",\n \"cnr\",\n \"cs\",\n \"da\",\n \"de\",\n \"el\",\n \"en\",\n \"es\",\n \"et\",\n \"fa\",\n \"fi\",\n \"fr\",\n \"he\",\n \"hi\",\n \"hr\",\n \"hu\",\n \"hy\",\n \"id\",\n \"it\",\n \"ja\",\n \"ka\",\n \"ko\",\n \"lt\",\n \"lv\",\n \"mk\",\n \"mn\",\n \"ms\",\n \"nl\",\n \"no\",\n \"pl\",\n \"pt-BR\",\n \"pt\",\n \"ro\",\n \"ru\",\n \"sk\",\n \"sl\",\n \"so\",\n \"sr\",\n \"sv\",\n \"th\",\n \"tr\",\n \"uk\",\n \"uz\",\n \"vi\",\n \"zh-CN\",\n \"zh-TW\",\n \"zh\",\n]\n","import {\n CAMERA_LENSES,\n CAMERA_QUERY_PARAMS,\n DEFAULT_CONFIG,\n PRESENTATION_QUERY_PARAMS,\n RTL_LANGUAGES,\n languages\n} from \"./constants\";\nimport type { CameraLens, DiditSdkConfiguration } from \"./types\";\n\nclass SDKLogger {\n private static _enabled = false;\n\n static get isEnabled(): boolean {\n return this._enabled;\n }\n\n static set isEnabled(value: boolean) {\n this._enabled = value;\n }\n\n static log(...args: unknown[]): void {\n if (this._enabled) {\n console.log(\"[DiditSDK]\", ...args);\n }\n }\n\n static warn(...args: unknown[]): void {\n if (this._enabled) {\n console.warn(\"[DiditSDK]\", ...args);\n }\n }\n\n static error(...args: unknown[]): void {\n if (this._enabled) {\n console.error(\"[DiditSDK]\", ...args);\n }\n }\n}\n\nexport { SDKLogger };\n\nexport function generateModalId(): string {\n return `didit-modal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n}\n\nexport function isAllowedOrigin(origin: string, url: string): boolean {\n try {\n const originURL = new URL(origin);\n const urlURL = new URL(url);\n return originURL.hostname.endsWith(\".didit.me\") || originURL.hostname === urlURL.hostname;\n } catch {\n return false;\n }\n}\n\nexport function createVerificationError(\n type: \"sessionExpired\" | \"networkError\" | \"cameraAccessDenied\" | \"unknown\",\n customMessage?: string\n): { type: typeof type; message: string } {\n const messages = {\n sessionExpired: \"Your verification session has expired.\",\n networkError: \"A network error occurred. Please try again.\",\n cameraAccessDenied: \"Camera access is required for verification.\",\n unknown: customMessage || \"An unknown error occurred.\"\n };\n\n return {\n type,\n message: customMessage || messages[type]\n };\n}\n\nfunction isCameraLens(value: unknown): value is CameraLens {\n return (CAMERA_LENSES as readonly unknown[]).includes(value);\n}\n\nconst CAMERA_LENS_OPTIONS = [\"defaultDocumentCamera\", \"defaultLivenessCamera\"] as const;\nconst CAMERA_SWITCH_OPTIONS = [\"showDocumentCameraSwitchButton\", \"showLivenessCameraSwitchButton\"] as const;\n\n/**\n * The URL the verification iframe loads: the integrator's URL with the\n * configuration options the hosted page reads from its query string.\n *\n * The camera options (the same four the native SDKs expose) become query\n * parameters: `defaultDocumentCamera` -> `document_camera=<lens>`,\n * `defaultLivenessCamera` -> `liveness_camera=<lens>`,\n * `showDocumentCameraSwitchButton` -> `document_camera_switch=true|false`,\n * `showLivenessCameraSwitchButton` -> `liveness_camera_switch=true|false`.\n * How the SDK presents the flow is always added: `sdk_presentation=modal|embedded`\n * and, in a modal, `sdk_close_button=true|false`.\n * Each parameter is set (not appended) so the configuration wins over a value\n * already on the URL; existing query parameters and the hash are kept. A\n * value of the wrong shape is ignored with a warning rather than forwarded,\n * and a URL the browser cannot parse is returned as it came (the modal\n * reports it when it loads).\n */\nexport function buildVerificationUrl(url: string, configuration: DiditSdkConfiguration = {}): string {\n const params = presentationParams(configuration);\n for (const option of CAMERA_LENS_OPTIONS) {\n const value = configuration[option];\n if (value === undefined) continue;\n if (!isCameraLens(value)) {\n SDKLogger.warn(`Ignoring ${option}: expected \"front\" or \"back\", got`, value);\n continue;\n }\n params.push([CAMERA_QUERY_PARAMS[option], value]);\n }\n for (const option of CAMERA_SWITCH_OPTIONS) {\n const value = configuration[option];\n if (value === undefined) continue;\n if (typeof value !== \"boolean\") {\n SDKLogger.warn(`Ignoring ${option}: expected a boolean, got`, value);\n continue;\n }\n params.push([CAMERA_QUERY_PARAMS[option], value ? \"true\" : \"false\"]);\n }\n try {\n const parsed = new URL(url);\n params.forEach(([name, value]) => parsed.searchParams.set(name, value));\n return parsed.toString();\n } catch {\n return url;\n }\n}\n\nfunction presentationParams(configuration: DiditSdkConfiguration): Array<[string, string]> {\n if (configuration.embedded) {\n return [[PRESENTATION_QUERY_PARAMS.presentation, \"embedded\"]];\n }\n const closeButton = configuration.showCloseButton ?? DEFAULT_CONFIG.showCloseButton;\n return [\n [PRESENTATION_QUERY_PARAMS.presentation, \"modal\"],\n [PRESENTATION_QUERY_PARAMS.closeButton, closeButton ? \"true\" : \"false\"]\n ];\n}\n\nexport function isRtlLanguage(language: string): boolean {\n return RTL_LANGUAGES.includes(language.split(\"-\")[0]);\n}\n\nexport function detectLanguageFromUrl(url: string): string {\n try {\n const { pathname } = new URL(url);\n const firstSegment = pathname.split(\"/\").filter(Boolean)[0];\n if (firstSegment && languages.includes(firstSegment)) {\n return firstSegment;\n }\n } catch {\n // we get it from the browser\n }\n\n const browserLang = navigator.language;\n if (languages.includes(browserLang)) return browserLang;\n const baseLang = browserLang.split(\"-\")[0];\n if (languages.includes(baseLang)) return baseLang;\n\n return \"en\";\n}\n","export interface ModalTranslations {\n exitTitle: string;\n exitMessage: string;\n continueButton: string;\n exitButton: string;\n ariaLabelModal: string;\n ariaLabelClose: string;\n}\n\nconst EN: ModalTranslations = {\n exitTitle: \"Exit verification?\",\n exitMessage: \"Exiting will end your verification process. Are you sure?\",\n continueButton: \"Continue\",\n exitButton: \"Exit\",\n ariaLabelModal: \"Didit Verification\",\n ariaLabelClose: \"Close verification\"\n};\n\nconst translationsMap: Record<string, ModalTranslations> = {\n ar: {\n exitTitle: \"الخروج من التحقق؟\",\n exitMessage: \"سيؤدي الخروج إلى إنهاء عملية التحقق الخاصة بك. هل أنت متأكد؟\",\n continueButton: \"متابعة\",\n exitButton: \"خروج\",\n ariaLabelModal: \"التحقق من Didit\",\n ariaLabelClose: \"إغلاق التحقق\"\n },\n bg: {\n exitTitle: \"Излизане от верификацията?\",\n exitMessage: \"Излизането ще прекрати процеса на верификация. Сигурни ли сте?\",\n continueButton: \"Продължи\",\n exitButton: \"Изход\",\n ariaLabelModal: \"Верификация Didit\",\n ariaLabelClose: \"Затваряне на верификацията\"\n },\n bn: {\n exitTitle: \"যাচাইকরণ থেকে বের হবেন?\",\n exitMessage: \"বের হলে আপনার যাচাইকরণ প্রক্রিয়া শেষ হয়ে যাবে। আপনি কি নিশ্চিত?\",\n continueButton: \"চালিয়ে যান\",\n exitButton: \"বের হন\",\n ariaLabelModal: \"Didit যাচাইকরণ\",\n ariaLabelClose: \"যাচাইকরণ বন্ধ করুন\"\n },\n bs: {\n exitTitle: \"Izaći iz verifikacije?\",\n exitMessage: \"Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?\",\n continueButton: \"Nastavi\",\n exitButton: \"Izađi\",\n ariaLabelModal: \"Didit verifikacija\",\n ariaLabelClose: \"Zatvori verifikaciju\"\n },\n ca: {\n exitTitle: \"Sortir de la verificació?\",\n exitMessage: \"Sortir finalitzarà el procés de verificació. N'esteu segur?\",\n continueButton: \"Continua\",\n exitButton: \"Sortir\",\n ariaLabelModal: \"Verificació Didit\",\n ariaLabelClose: \"Tancar verificació\"\n },\n cnr: {\n exitTitle: \"Izaći iz verifikacije?\",\n exitMessage: \"Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?\",\n continueButton: \"Nastavi\",\n exitButton: \"Izađi\",\n ariaLabelModal: \"Didit verifikacija\",\n ariaLabelClose: \"Zatvori verifikaciju\"\n },\n cs: {\n exitTitle: \"Opravdu chcete odejít?\",\n exitMessage: \"Když odejdete, proces ověření se přeruší. Opravdu chcete skončit?\",\n continueButton: \"Zůstat\",\n exitButton: \"Odejít\",\n ariaLabelModal: \"Ověření Didit\",\n ariaLabelClose: \"Zavřít ověření\"\n },\n da: {\n exitTitle: \"Forlad verifikation?\",\n exitMessage: \"Hvis du forlader, afsluttes din verifikationsproces. Er du sikker?\",\n continueButton: \"Fortsæt\",\n exitButton: \"Forlad\",\n ariaLabelModal: \"Didit-verifikation\",\n ariaLabelClose: \"Luk verifikation\"\n },\n de: {\n exitTitle: \"Verifizierung verlassen?\",\n exitMessage: \"Das Verlassen beendet Ihren Verifizierungsprozess. Sind Sie sicher?\",\n continueButton: \"Fortfahren\",\n exitButton: \"Verlassen\",\n ariaLabelModal: \"Didit-Verifizierung\",\n ariaLabelClose: \"Verifizierung schließen\"\n },\n el: {\n exitTitle: \"Έξοδος από την επαλήθευση;\",\n exitMessage: \"Η έξοδος θα τερματίσει τη διαδικασία επαλήθευσης. Είστε σίγουροι;\",\n continueButton: \"Συνέχεια\",\n exitButton: \"Έξοδος\",\n ariaLabelModal: \"Επαλήθευση Didit\",\n ariaLabelClose: \"Κλείσιμο επαλήθευσης\"\n },\n en: EN,\n es: {\n exitTitle: \"¿Salir de la verificación?\",\n exitMessage: \"Salir terminará tu proceso de verificación. ¿Estás seguro?\",\n continueButton: \"Continuar\",\n exitButton: \"Salir\",\n ariaLabelModal: \"Verificación Didit\",\n ariaLabelClose: \"Cerrar verificación\"\n },\n et: {\n exitTitle: \"Lahkuda kinnitamisest?\",\n exitMessage: \"Lahkumine lõpetab teie kinnitamisprotsessi. Kas olete kindel?\",\n continueButton: \"Jätka\",\n exitButton: \"Lahku\",\n ariaLabelModal: \"Didit kinnitus\",\n ariaLabelClose: \"Sulge kinnitus\"\n },\n fa: {\n exitTitle: \"خروج از تأیید هویت؟\",\n exitMessage: \"خروج باعث پایان فرآیند تأیید هویت شما میشود. آیا مطمئن هستید؟\",\n continueButton: \"ادامه\",\n exitButton: \"خروج\",\n ariaLabelModal: \"تأیید هویت Didit\",\n ariaLabelClose: \"بستن تأیید هویت\"\n },\n fi: {\n exitTitle: \"Poistu vahvistuksesta?\",\n exitMessage: \"Poistuminen päättää vahvistusprosessisi. Oletko varma?\",\n continueButton: \"Jatka\",\n exitButton: \"Poistu\",\n ariaLabelModal: \"Didit-vahvistus\",\n ariaLabelClose: \"Sulje vahvistus\"\n },\n fr: {\n exitTitle: \"Quitter la vérification ?\",\n exitMessage: \"Quitter mettra fin à votre processus de vérification. Êtes-vous sûr ?\",\n continueButton: \"Continuer\",\n exitButton: \"Quitter\",\n ariaLabelModal: \"Vérification Didit\",\n ariaLabelClose: \"Fermer la vérification\"\n },\n he: {\n exitTitle: \"לצאת מהאימות?\",\n exitMessage: \"יציאה תסיים את תהליך האימות שלך. האם אתה בטוח?\",\n continueButton: \"המשך\",\n exitButton: \"יציאה\",\n ariaLabelModal: \"אימות Didit\",\n ariaLabelClose: \"סגירת אימות\"\n },\n hi: {\n exitTitle: \"सत्यापन से बाहर निकलें?\",\n exitMessage: \"बाहर निकलने से आपकी सत्यापन प्रक्रिया समाप्त हो जाएगी। क्या आप सुनिश्चित हैं?\",\n continueButton: \"जारी रखें\",\n exitButton: \"बाहर निकलें\",\n ariaLabelModal: \"Didit सत्यापन\",\n ariaLabelClose: \"सत्यापन बंद करें\"\n },\n hr: {\n exitTitle: \"Izaći iz verifikacije?\",\n exitMessage: \"Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?\",\n continueButton: \"Nastavi\",\n exitButton: \"Izađi\",\n ariaLabelModal: \"Didit verifikacija\",\n ariaLabelClose: \"Zatvori verifikaciju\"\n },\n hu: {\n exitTitle: \"Kilépés az ellenőrzésből?\",\n exitMessage: \"A kilépés befejezi az ellenőrzési folyamatot. Biztos benne?\",\n continueButton: \"Folytatás\",\n exitButton: \"Kilépés\",\n ariaLabelModal: \"Didit ellenőrzés\",\n ariaLabelClose: \"Ellenőrzés bezárása\"\n },\n hy: {\n exitTitle: \"Դուրս գա՞լ ստուգումից\",\n exitMessage: \"Դուրս գալը կավարտի ձեր ստուգման գործընթացը։ Համոզված ե՞ք?\",\n continueButton: \"Շարունակել\",\n exitButton: \"Դուրս գալ\",\n ariaLabelModal: \"Didit ստուգում\",\n ariaLabelClose: \"Փակել ստուգումը\"\n },\n id: {\n exitTitle: \"Keluar dari verifikasi?\",\n exitMessage: \"Keluar akan mengakhiri proses verifikasi Anda. Apakah Anda yakin?\",\n continueButton: \"Lanjutkan\",\n exitButton: \"Keluar\",\n ariaLabelModal: \"Verifikasi Didit\",\n ariaLabelClose: \"Tutup verifikasi\"\n },\n it: {\n exitTitle: \"Uscire dalla verifica?\",\n exitMessage: \"L'uscita terminerà il processo di verifica. Sei sicuro?\",\n continueButton: \"Continua\",\n exitButton: \"Esci\",\n ariaLabelModal: \"Verifica Didit\",\n ariaLabelClose: \"Chiudi verifica\"\n },\n ja: {\n exitTitle: \"認証を終了しますか?\",\n exitMessage: \"終了すると認証プロセスが中断されます。よろしいですか?\",\n continueButton: \"続ける\",\n exitButton: \"終了\",\n ariaLabelModal: \"Didit 認証\",\n ariaLabelClose: \"認証を閉じる\"\n },\n ka: {\n exitTitle: \"გამოსვლა შემოწმებიდან?\",\n exitMessage: \"გამოსვლა დაასრულებს თქვენს შემოწმების პროცესს. დარწმუნებული ხართ?\",\n continueButton: \"გაგრძელება\",\n exitButton: \"გამოსვლა\",\n ariaLabelModal: \"Didit შემოწმება\",\n ariaLabelClose: \"შემოწმების დახურვა\"\n },\n kk: {\n exitTitle: \"Растаудан шығасыз ба?\",\n exitMessage: \"Шығу растау процесін аяқтайды. Сенімдісіз бе?\",\n continueButton: \"Жалғастыру\",\n exitButton: \"Шығу\",\n ariaLabelModal: \"Didit растауы\",\n ariaLabelClose: \"Растауды жабу\"\n },\n ko: {\n exitTitle: \"인증을 종료하시겠습니까?\",\n exitMessage: \"종료하면 인증 절차가 중단됩니다. 확실하십니까?\",\n continueButton: \"계속\",\n exitButton: \"종료\",\n ariaLabelModal: \"Didit 인증\",\n ariaLabelClose: \"인증 닫기\"\n },\n ky: {\n exitTitle: \"Текшерүүдөн чыгасызбы?\",\n exitMessage: \"Чыгуу текшерүү процессин токтотот. Ишенесизби?\",\n continueButton: \"Улантуу\",\n exitButton: \"Чыгуу\",\n ariaLabelModal: \"Didit текшерүүсү\",\n ariaLabelClose: \"Текшерүүнү жабуу\"\n },\n lt: {\n exitTitle: \"Išeiti iš patvirtinimo?\",\n exitMessage: \"Išėjimas nutrauks jūsų patvirtinimo procesą. Ar esate tikri?\",\n continueButton: \"Tęsti\",\n exitButton: \"Išeiti\",\n ariaLabelModal: \"Didit patvirtinimas\",\n ariaLabelClose: \"Uždaryti patvirtinimą\"\n },\n lv: {\n exitTitle: \"Iziet no verifikācijas?\",\n exitMessage: \"Iziešana pārtrauks jūsu verifikācijas procesu. Vai esat pārliecināts?\",\n continueButton: \"Turpināt\",\n exitButton: \"Iziet\",\n ariaLabelModal: \"Didit verifikācija\",\n ariaLabelClose: \"Aizvērt verifikāciju\"\n },\n mk: {\n exitTitle: \"Излези од верификацијата?\",\n exitMessage: \"Излегувањето ќе го прекине процесот на верификација. Дали сте сигурни?\",\n continueButton: \"Продолжи\",\n exitButton: \"Излези\",\n ariaLabelModal: \"Верификација Didit\",\n ariaLabelClose: \"Затвори верификација\"\n },\n mn: {\n exitTitle: \"Баталгаажуулалтаас гарах уу?\",\n exitMessage: \"Гарвал таны баталгаажуулалтын процесс дуусна. Та итгэлтэй байна уу?\",\n continueButton: \"Үргэлжлүүлэх\",\n exitButton: \"Гарах\",\n ariaLabelModal: \"Didit баталгаажуулалт\",\n ariaLabelClose: \"Баталгаажуулалтыг хаах\"\n },\n ms: {\n exitTitle: \"Keluar dari pengesahan?\",\n exitMessage: \"Keluar akan menamatkan proses pengesahan anda. Adakah anda pasti?\",\n continueButton: \"Teruskan\",\n exitButton: \"Keluar\",\n ariaLabelModal: \"Pengesahan Didit\",\n ariaLabelClose: \"Tutup pengesahan\"\n },\n nl: {\n exitTitle: \"Verificatie verlaten?\",\n exitMessage: \"Verlaten beëindigt uw verificatieproces. Weet u het zeker?\",\n continueButton: \"Doorgaan\",\n exitButton: \"Verlaten\",\n ariaLabelModal: \"Didit-verificatie\",\n ariaLabelClose: \"Verificatie sluiten\"\n },\n no: {\n exitTitle: \"Forlat verifisering?\",\n exitMessage: \"Å forlate vil avslutte verifiseringsprosessen. Er du sikker?\",\n continueButton: \"Fortsett\",\n exitButton: \"Forlat\",\n ariaLabelModal: \"Didit-verifisering\",\n ariaLabelClose: \"Lukk verifisering\"\n },\n pl: {\n exitTitle: \"Czy wyjść z weryfikacji?\",\n exitMessage: \"Wyjście zakończy proces weryfikacji. Czy na pewno?\",\n continueButton: \"Kontynuuj\",\n exitButton: \"Wyjdź\",\n ariaLabelModal: \"Weryfikacja Didit\",\n ariaLabelClose: \"Zamknij weryfikację\"\n },\n \"pt-BR\": {\n exitTitle: \"Sair da verificação?\",\n exitMessage: \"Sair encerrará seu processo de verificação. Tem certeza?\",\n continueButton: \"Continuar\",\n exitButton: \"Sair\",\n ariaLabelModal: \"Verificação Didit\",\n ariaLabelClose: \"Fechar verificação\"\n },\n pt: {\n exitTitle: \"Sair da verificação?\",\n exitMessage: \"Sair terminará o seu processo de verificação. Tem a certeza?\",\n continueButton: \"Continuar\",\n exitButton: \"Sair\",\n ariaLabelModal: \"Verificação Didit\",\n ariaLabelClose: \"Fechar verificação\"\n },\n ro: {\n exitTitle: \"Ieși din verificare?\",\n exitMessage: \"Ieșirea va încheia procesul de verificare. Ești sigur?\",\n continueButton: \"Continuă\",\n exitButton: \"Ieși\",\n ariaLabelModal: \"Verificare Didit\",\n ariaLabelClose: \"Închide verificarea\"\n },\n ru: {\n exitTitle: \"Выйти из верификации?\",\n exitMessage: \"Выход завершит процесс верификации. Вы уверены?\",\n continueButton: \"Продолжить\",\n exitButton: \"Выйти\",\n ariaLabelModal: \"Верификация Didit\",\n ariaLabelClose: \"Закрыть верификацию\"\n },\n sk: {\n exitTitle: \"Opustiť overenie?\",\n exitMessage: \"Odchodom ukončíte proces overenia. Ste si istí?\",\n continueButton: \"Pokračovať\",\n exitButton: \"Odísť\",\n ariaLabelModal: \"Overenie Didit\",\n ariaLabelClose: \"Zavrieť overenie\"\n },\n sl: {\n exitTitle: \"Zapustiti preverjanje?\",\n exitMessage: \"Izhod bo prekinil postopek preverjanja. Ali ste prepričani?\",\n continueButton: \"Nadaljuj\",\n exitButton: \"Izhod\",\n ariaLabelModal: \"Preverjanje Didit\",\n ariaLabelClose: \"Zapri preverjanje\"\n },\n so: {\n exitTitle: \"Ka baxdo xaqiijinta?\",\n exitMessage: \"Ka bixitaanku wuxuu dhammayn doonaa habka xaqiijintaada. Ma hubtaa?\",\n continueButton: \"Sii wad\",\n exitButton: \"Ka bax\",\n ariaLabelModal: \"Xaqiijinta Didit\",\n ariaLabelClose: \"Xir xaqiijinta\"\n },\n sq: {\n exitTitle: \"Dilni nga verifikimi?\",\n exitMessage: \"Dalja do të përfundojë procesin tuaj të verifikimit. A jeni të sigurt?\",\n continueButton: \"Vazhdo\",\n exitButton: \"Dil\",\n ariaLabelModal: \"Verifikimi Didit\",\n ariaLabelClose: \"Mbyll verifikimin\"\n },\n sr: {\n exitTitle: \"Изаћи из верификације?\",\n exitMessage: \"Изласком ћете прекинути процес верификације. Да ли сте сигурни?\",\n continueButton: \"Настави\",\n exitButton: \"Изађи\",\n ariaLabelModal: \"Верификација Didit\",\n ariaLabelClose: \"Затвори верификацију\"\n },\n sv: {\n exitTitle: \"Lämna verifiering?\",\n exitMessage: \"Att lämna avslutar din verifieringsprocess. Är du säker?\",\n continueButton: \"Fortsätt\",\n exitButton: \"Lämna\",\n ariaLabelModal: \"Didit-verifiering\",\n ariaLabelClose: \"Stäng verifiering\"\n },\n th: {\n exitTitle: \"ออกจากการยืนยันตัวตน?\",\n exitMessage: \"การออกจะสิ้นสุดกระบวนการยืนยันตัวตนของคุณ คุณแน่ใจหรือไม่?\",\n continueButton: \"ดำเนินการต่อ\",\n exitButton: \"ออก\",\n ariaLabelModal: \"การยืนยันตัวตน Didit\",\n ariaLabelClose: \"ปิดการยืนยันตัวตน\"\n },\n tr: {\n exitTitle: \"Doğrulamadan çıkmak istiyor musunuz?\",\n exitMessage: \"Çıkış, doğrulama sürecinizi sonlandıracak. Emin misiniz?\",\n continueButton: \"Devam et\",\n exitButton: \"Çıkış\",\n ariaLabelModal: \"Didit doğrulama\",\n ariaLabelClose: \"Doğrulamayı kapat\"\n },\n uk: {\n exitTitle: \"Вийти з верифікації?\",\n exitMessage: \"Вихід завершить процес верифікації. Ви впевнені?\",\n continueButton: \"Продовжити\",\n exitButton: \"Вийти\",\n ariaLabelModal: \"Верифікація Didit\",\n ariaLabelClose: \"Закрити верифікацію\"\n },\n uz: {\n exitTitle: \"Tekshiruvdan chiqasizmi?\",\n exitMessage: \"Chiqish tekshiruv jarayonini tugatadi. Ishonchingiz komilmi?\",\n continueButton: \"Davom etish\",\n exitButton: \"Chiqish\",\n ariaLabelModal: \"Didit tekshiruvi\",\n ariaLabelClose: \"Tekshiruvni yopish\"\n },\n vi: {\n exitTitle: \"Thoát khỏi xác minh?\",\n exitMessage: \"Thoát sẽ kết thúc quá trình xác minh của bạn. Bạn có chắc không?\",\n continueButton: \"Tiếp tục\",\n exitButton: \"Thoát\",\n ariaLabelModal: \"Xác minh Didit\",\n ariaLabelClose: \"Đóng xác minh\"\n },\n \"zh-CN\": {\n exitTitle: \"退出验证?\",\n exitMessage: \"退出将结束您的验证流程。确定要退出吗?\",\n continueButton: \"继续\",\n exitButton: \"退出\",\n ariaLabelModal: \"Didit 验证\",\n ariaLabelClose: \"关闭验证\"\n },\n \"zh-TW\": {\n exitTitle: \"退出驗證?\",\n exitMessage: \"退出將結束您的驗證流程。確定要退出嗎?\",\n continueButton: \"繼續\",\n exitButton: \"退出\",\n ariaLabelModal: \"Didit 驗證\",\n ariaLabelClose: \"關閉驗證\"\n },\n zh: {\n exitTitle: \"退出验证?\",\n exitMessage: \"退出将结束您的验证流程。确定要退出吗?\",\n continueButton: \"继续\",\n exitButton: \"退出\",\n ariaLabelModal: \"Didit 验证\",\n ariaLabelClose: \"关闭验证\"\n }\n};\n\nexport function getTranslations(language: string): ModalTranslations {\n return translationsMap[language] ?? EN;\n}\n","import type { DiditSdkConfiguration, VerificationEvent } from \"./types\";\nimport { DEFAULT_CONFIG, CSS_CLASSES, IFRAME_ALLOW, LAYOUT_MESSAGE_TYPE } from \"./constants\";\nimport { SDKLogger, generateModalId, isAllowedOrigin, detectLanguageFromUrl, isRtlLanguage } from \"./utils\";\nimport { getTranslations } from \"./translations\";\n\nexport interface ModalState {\n isOpen: boolean;\n isLoading: boolean;\n showConfirmation: boolean;\n}\n\nexport interface ModalCallbacks {\n onClose: () => void;\n onCloseConfirmed: () => void;\n onMessage: (event: VerificationEvent) => void;\n onIframeLoad: () => void;\n}\n\nexport type FlowKind = \"handoff\" | \"step\";\n\n/** Until the flow reports its first layout the modal waits (hidden) at the size the handoff card needs. */\ntype ModalKind = FlowKind | \"pending\";\n\n/** The length of the one animation when the flow moves from the handoff card to a step or back. */\nconst SIZE_ANIMATION_MS = 300;\n\n/** How long the modal waits for the first layout before it shows at step size, so it can never hang. */\nexport const FIRST_LAYOUT_TIMEOUT_MS = 3000;\n\n/** The layout the hosted flow reports in a didit:layout message. */\nexport interface FlowLayout {\n /**\n * What the flow is showing: the computer handoff card, or a step (phone-sized). A flow that does\n * not say gets \"step\", the size every earlier version of the modal used.\n */\n kind: FlowKind;\n /** Height of the flow's content in CSS pixels, its top bar included. */\n contentHeight: number;\n colorScheme: \"light\" | \"dark\";\n dir: \"ltr\" | \"rtl\";\n}\n\nexport class VerificationModal {\n /**\n * Every currently-open modal, oldest first. Used so a single Escape\n * keypress (or other document-level shortcut) only acts on the topmost\n * modal when multiple VerificationModal instances are open at once (e.g.\n * a transaction action modal stacked over the verification modal).\n */\n private static openModals: VerificationModal[] = [];\n\n private modalId: string;\n private config: Required<Pick<DiditSdkConfiguration, \"zIndex\" | \"showCloseButton\" | \"showExitConfirmation\">>;\n private callbacks: ModalCallbacks;\n private state: ModalState = {\n isOpen: false,\n isLoading: true,\n showConfirmation: false\n };\n\n private overlay: HTMLDivElement | null = null;\n private container: HTMLDivElement | null = null;\n private iframe: HTMLIFrameElement | null = null;\n private loadingEl: HTMLDivElement | null = null;\n private confirmOverlay: HTMLDivElement | null = null;\n private confirmationTrigger: HTMLElement | null = null;\n private containerElement: HTMLElement;\n\n private boundHandleMessage: ((event: MessageEvent) => void) | null = null;\n private boundHandleKeydown: ((event: KeyboardEvent) => void) | null = null;\n private boundHandleFocusChange: (() => void) | null = null;\n private confirmationFocusTimeout: number | null = null;\n private firstLayoutTimeout: number | null = null;\n private sizeTimeout: number | null = null;\n\n private embedded: boolean = false;\n private embeddedContainer: HTMLElement | null = null;\n private language: string = \"en\";\n\n /** The page's own background colours, kept while a full-screen modal paints over them. */\n private pageBackground: { root: string; body: string } | null = null;\n /** body.style.overflow value observed right before this modal locked scroll, restored on close(). */\n private previousBodyOverflow: string | null = null;\n\n constructor(configuration: DiditSdkConfiguration | undefined, callbacks: ModalCallbacks) {\n this.modalId = generateModalId();\n this.config = {\n zIndex: configuration?.zIndex ?? DEFAULT_CONFIG.zIndex,\n showCloseButton: configuration?.showCloseButton ?? DEFAULT_CONFIG.showCloseButton,\n showExitConfirmation: configuration?.showExitConfirmation ?? DEFAULT_CONFIG.showExitConfirmation\n };\n this.callbacks = callbacks;\n this.containerElement = configuration?.containerElement ?? document.body;\n this.embedded = configuration?.embedded ?? false;\n if (this.embedded && configuration?.embeddedContainerId) {\n this.embeddedContainer = document.getElementById(configuration.embeddedContainerId);\n }\n }\n\n private injectStyles(): void {\n const styleId = \"didit-sdk-styles\";\n if (document.getElementById(styleId)) {\n return;\n }\n\n const styles = document.createElement(\"style\");\n styles.id = styleId;\n styles.textContent = `\n .${CSS_CLASSES.overlay} {\n display: none;\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n z-index: ${this.config.zIndex};\n justify-content: center;\n align-items: center;\n padding: 1rem;\n opacity: 0;\n transition: opacity 0.2s ease-out;\n }\n\n .${CSS_CLASSES.overlay}.active {\n display: flex;\n opacity: 1;\n }\n\n .${CSS_CLASSES.container} {\n position: relative;\n width: 100%;\n max-width: 440px;\n height: min(860px, calc(100vh - 2rem));\n height: min(860px, calc(100dvh - 2rem));\n border-radius: 16px;\n overflow: hidden;\n background: transparent;\n }\n\n .${CSS_CLASSES.overlay}.active .${CSS_CLASSES.container} {\n transform: scale(1);\n }\n\n .${CSS_CLASSES.iframe} {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n }\n\n .${CSS_CLASSES.closeButton} {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 24px;\n height: 24px;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n z-index: 10;\n outline: none;\n }\n\n .${CSS_CLASSES.closeButton}:hover,\n .${CSS_CLASSES.closeButton}:focus {\n background: transparent;\n opacity: 0.5;\n }\n\n .${CSS_CLASSES.closeButton} svg {\n stroke: #666;\n stroke-width: 2;\n stroke-linecap: round;\n }\n\n .${CSS_CLASSES.loading} {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #fafafa;\n z-index: 5;\n }\n\n @media (prefers-color-scheme: dark) {\n .${CSS_CLASSES.loading} {\n background: #0b0b0d;\n }\n }\n\n .${CSS_CLASSES.loading}.hidden {\n display: none;\n }\n\n .${CSS_CLASSES.loading} svg {\n width: 4rem;\n height: 4rem;\n animation: didit-spin 1s linear infinite;\n }\n\n .${CSS_CLASSES.loading} circle {\n stroke: #e5e5e5;\n stroke-width: 2.5;\n fill: none;\n }\n\n .${CSS_CLASSES.loading} path {\n stroke: #525252;\n stroke-width: 2.5;\n stroke-linecap: round;\n fill: none;\n }\n\n @keyframes didit-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n .${CSS_CLASSES.confirmOverlay} {\n display: none;\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 20;\n justify-content: center;\n align-items: center;\n opacity: 0;\n transition: opacity 0.15s ease-out;\n }\n\n .${CSS_CLASSES.confirmOverlay}.active {\n display: flex;\n opacity: 1;\n }\n\n .${CSS_CLASSES.confirmBox} {\n background: #fff;\n border-radius: 12px;\n padding: 1.5rem;\n text-align: center;\n max-width: 300px;\n margin: 1rem;\n transform: scale(0.95);\n transition: transform 0.15s ease-out;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n outline: none;\n }\n\n .${CSS_CLASSES.confirmOverlay}.active .${CSS_CLASSES.confirmBox} {\n transform: scale(1);\n }\n\n .${CSS_CLASSES.confirmBox} h3 {\n color: #1a1a2e;\n margin: 0 0 0.5rem 0;\n font-size: 1.125rem;\n font-weight: 600;\n }\n\n .${CSS_CLASSES.confirmBox} p {\n color: #666;\n font-size: 0.875rem;\n margin: 0 0 1.25rem 0;\n line-height: 1.5;\n }\n\n .didit-confirm-actions {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 1rem;\n }\n\n .didit-confirm-actions [data-action=\"continue\"] {\n background: #2563eb;\n color: #fff;\n border: none;\n padding: 0.625rem 1.25rem;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s ease;\n }\n\n .didit-confirm-actions [data-action=\"continue\"]:hover {\n background: #1d4ed8;\n }\n\n .didit-confirm-actions [data-action=\"exit\"] {\n background: transparent;\n border: none;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n color: #666;\n font-size: 0.875rem;\n cursor: pointer;\n padding: 0.625rem;\n transition: color 0.15s ease;\n }\n\n .didit-confirm-actions [data-action=\"exit\"]:hover {\n color: #1a1a2e;\n }\n\n .didit-confirm-actions button:focus-visible {\n outline: 2px solid #2567ff;\n outline-offset: 2px;\n }\n\n /*\n * Steps are phone-sized (440 x 860, above). On a computer the handoff card is wider\n * (board Start-Embedded): 960 x 660 on a window of 1000px or more, never wider than the\n * window less its margin and never taller than 90% of it. In a narrower window the\n * page stacks and the height follows its content (--didit-content-height, set from the\n * flow's layout message). Until the flow reports what it shows, the modal is the handoff\n * card at its final size with the spinner inside it (the flow stays hidden and lays itself\n * out for that size): it never opens small and grows. The first change of kind (a step\n * instead of the handoff, or the person continues on this computer) animates once.\n */\n @media (min-width: 541px) {\n .${CSS_CLASSES.container}[data-didit-kind=\"handoff\"],\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] {\n max-width: min(960px, calc(100vw - 2rem));\n height: min(var(--didit-content-height, 660px), calc(100vh * 0.9));\n height: min(var(--didit-content-height, 660px), calc(100dvh * 0.9));\n }\n\n .${CSS_CLASSES.container}.${CSS_CLASSES.sizeAnimated} {\n transition: max-width 0.25s ease, height 0.25s ease;\n }\n\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] .${CSS_CLASSES.iframe} {\n visibility: hidden;\n }\n }\n\n /*\n * While pending the card already looks like the first screen (ground, radius, shadow and\n * close button come from the flow-sized rules below, with the device theme); the loader\n * sits inside it on the card's own ground.\n */\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] .${CSS_CLASSES.loading} {\n background: transparent;\n }\n\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"][data-didit-theme=\"dark\"] .${CSS_CLASSES.loading} circle {\n stroke: rgba(255, 255, 255, 0.16);\n }\n\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"][data-didit-theme=\"dark\"] .${CSS_CLASSES.loading} path {\n stroke: #f5f5f7;\n }\n\n @media (min-width: 1000px) {\n .${CSS_CLASSES.container}[data-didit-kind=\"handoff\"],\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] {\n height: min(660px, calc(100vh * 0.9));\n height: min(660px, calc(100dvh * 0.9));\n }\n }\n\n @media (max-width: 540px) {\n .${CSS_CLASSES.overlay} {\n padding: 0;\n }\n\n .${CSS_CLASSES.container} {\n max-width: 100%;\n height: 100vh;\n height: 100dvh;\n border-radius: 0;\n }\n }\n\n /*\n * The hosted flow's layout message (didit:layout) brings the modal's size\n * (see above), theme and direction. Colours are the design system tokens\n * named beside them.\n */\n .${CSS_CLASSES.container}.${CSS_CLASSES.flowSized} {\n --didit-ground: #ffffff; /* site-ground */\n --didit-heading: #1a1a1a; /* c-heading */\n --didit-accent: #2567ff; /* c-accent */\n --didit-hover: rgba(120, 120, 128, 0.08); /* c-hover */\n --didit-close-fill: rgba(0, 0, 0, 0.06);\n --didit-drop: rgba(17, 24, 39, 0.35);\n --didit-ring: rgba(0, 0, 0, 0.06);\n background: var(--didit-ground);\n box-shadow: 0 30px 80px -24px var(--didit-drop), 0 0 0 1px var(--didit-ring);\n }\n\n .${CSS_CLASSES.container}.${CSS_CLASSES.flowSized}[data-didit-theme=\"dark\"] {\n --didit-ground: #0b0b0d;\n --didit-heading: #f5f5f7;\n --didit-accent: #4d8bff;\n --didit-hover: rgba(255, 255, 255, 0.06);\n --didit-close-fill: rgba(255, 255, 255, 0.06);\n --didit-drop: rgba(0, 0, 0, 0.55); /* c-shadow-pop, dark */\n --didit-ring: rgba(255, 255, 255, 0.08); /* c-shadow-pop, dark */\n }\n\n .${CSS_CLASSES.closeIcon} {\n display: none;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton} {\n top: 8px;\n right: 8px;\n width: 44px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background: var(--didit-close-fill);\n color: var(--didit-heading);\n }\n\n .${CSS_CLASSES.flowSized}[data-didit-dir=\"rtl\"] .${CSS_CLASSES.closeButton} {\n right: auto;\n left: 8px;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:hover,\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:focus {\n background: var(--didit-close-fill);\n opacity: 1;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:hover {\n background-image: linear-gradient(var(--didit-hover), var(--didit-hover));\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:focus-visible {\n outline: 2px solid var(--didit-accent);\n outline-offset: 2px;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeIconLegacy} {\n display: none;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton} .${CSS_CLASSES.closeIcon} {\n display: block;\n stroke: currentColor;\n stroke-width: 1.75;\n stroke-linejoin: round;\n }\n\n /*\n * The exit confirmation is sized in rem, so with a large text size it\n * can be taller than a short flow: it scrolls inside the modal instead\n * of being clipped, and its width and actions follow a larger text size.\n * It never grows wider than the modal: a long word wraps instead.\n */\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.confirmOverlay} {\n padding: 1rem;\n overflow-y: auto;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.confirmBox} {\n min-width: 0;\n max-width: max(300px, 18.75rem);\n margin: auto;\n overflow-wrap: anywhere;\n /* Focusing the dialog scrolls it into view start-aligned; this keeps\n * the overlay's top padding visible so the title is never clipped. */\n scroll-margin-top: 1rem;\n }\n\n .${CSS_CLASSES.flowSized} .didit-confirm-actions {\n flex-wrap: wrap;\n }\n\n @media (max-width: 540px) {\n .${CSS_CLASSES.container}.${CSS_CLASSES.flowSized} {\n max-width: 100%;\n box-shadow: none;\n }\n }\n\n .${CSS_CLASSES.embedded} {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .${CSS_CLASSES.embedded} .${CSS_CLASSES.iframe} {\n width: 100%;\n height: 100%;\n max-height: none;\n }\n\n .${CSS_CLASSES.embedded} .${CSS_CLASSES.loading} {\n border-radius: 0;\n }\n `;\n\n document.head.appendChild(styles);\n }\n\n private createDOM(): void {\n this.injectStyles();\n\n if (this.embedded && this.embeddedContainer) {\n this.createEmbeddedDOM();\n return;\n }\n const t = getTranslations(this.language);\n\n this.overlay = document.createElement(\"div\");\n this.overlay.id = this.modalId;\n this.overlay.className = CSS_CLASSES.overlay;\n this.overlay.setAttribute(\"role\", \"dialog\");\n this.overlay.setAttribute(\"aria-modal\", \"true\");\n this.overlay.setAttribute(\"aria-label\", t.ariaLabelModal);\n\n this.container = document.createElement(\"div\");\n this.container.className = CSS_CLASSES.container;\n\n this.loadingEl = document.createElement(\"div\");\n this.loadingEl.className = CSS_CLASSES.loading;\n this.loadingEl.innerHTML = `\n <svg viewBox=\"0 0 24 24\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" />\n </svg>\n `;\n\n if (this.config.showCloseButton) {\n const closeBtn = document.createElement(\"button\");\n closeBtn.className = CSS_CLASSES.closeButton;\n closeBtn.setAttribute(\"aria-label\", t.ariaLabelClose);\n closeBtn.innerHTML = `\n <svg class=\"${CSS_CLASSES.closeIconLegacy}\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <line x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\" />\n <line x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\" />\n </svg>\n <svg class=\"${CSS_CLASSES.closeIcon}\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M7 7.03882L17 16.9611\" />\n <path d=\"M7.03968 17L16.9619 7\" />\n </svg>\n `;\n closeBtn.addEventListener(\"click\", () => this.handleCloseRequest(closeBtn));\n this.container.appendChild(closeBtn);\n }\n\n this.iframe = document.createElement(\"iframe\");\n this.iframe.className = CSS_CLASSES.iframe;\n this.iframe.setAttribute(\"allow\", IFRAME_ALLOW);\n this.iframe.setAttribute(\"title\", t.ariaLabelModal);\n this.iframe.addEventListener(\"load\", () => this.handleIframeLoad());\n\n this.confirmOverlay = document.createElement(\"div\");\n this.confirmOverlay.className = CSS_CLASSES.confirmOverlay;\n this.confirmOverlay.innerHTML = `\n <div class=\"${CSS_CLASSES.confirmBox}\" role=\"dialog\" aria-modal=\"true\" tabindex=\"-1\"\n aria-labelledby=\"${this.modalId}-exit-title\" aria-describedby=\"${this.modalId}-exit-message\">\n <h3 id=\"${this.modalId}-exit-title\">${t.exitTitle}</h3>\n <p id=\"${this.modalId}-exit-message\">${t.exitMessage}</p>\n <div class=\"didit-confirm-actions\">\n <button type=\"button\" data-action=\"continue\">${t.continueButton}</button>\n <button type=\"button\" data-action=\"exit\">${t.exitButton}</button>\n </div>\n </div>\n `;\n\n this.confirmOverlay.querySelector('[data-action=\"continue\"]')?.addEventListener(\"click\", () => {\n this.hideConfirmation();\n });\n this.confirmOverlay.querySelector('[data-action=\"exit\"]')?.addEventListener(\"click\", () => {\n this.confirmExit();\n });\n\n this.container.appendChild(this.loadingEl);\n this.container.appendChild(this.iframe);\n this.container.appendChild(this.confirmOverlay);\n this.overlay.appendChild(this.container);\n\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.handleCloseRequest();\n }\n });\n\n this.containerElement.appendChild(this.overlay);\n }\n\n private createEmbeddedDOM(): void {\n if (!this.embeddedContainer) return;\n\n this.container = document.createElement(\"div\");\n this.container.id = this.modalId;\n this.container.className = CSS_CLASSES.embedded;\n\n this.loadingEl = document.createElement(\"div\");\n this.loadingEl.className = CSS_CLASSES.loading;\n this.loadingEl.innerHTML = `\n <svg viewBox=\"0 0 24 24\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" />\n </svg>\n `;\n\n this.iframe = document.createElement(\"iframe\");\n this.iframe.className = CSS_CLASSES.iframe;\n this.iframe.setAttribute(\"allow\", IFRAME_ALLOW);\n this.iframe.setAttribute(\"title\", getTranslations(this.language).ariaLabelModal);\n this.iframe.addEventListener(\"load\", () => this.handleIframeLoad());\n\n this.container.appendChild(this.loadingEl);\n this.container.appendChild(this.iframe);\n this.embeddedContainer.appendChild(this.container);\n }\n\n private setupEventListeners(): void {\n // Idempotent: open() calls this every time it presents the modal, but a\n // modal that was already open (or re-opened without an intervening\n // close()) must not accumulate duplicate listeners.\n if (this.boundHandleMessage || this.boundHandleKeydown) {\n return;\n }\n\n this.boundHandleMessage = this.handleMessage.bind(this);\n window.addEventListener(\"message\", this.boundHandleMessage);\n\n this.boundHandleKeydown = this.handleKeydown.bind(this);\n document.addEventListener(\"keydown\", this.boundHandleKeydown);\n\n this.boundHandleFocusChange = () => {\n if (!this.state.showConfirmation || !this.isTopmost()) return;\n // An iframe can take focus without a focusin event in its parent document.\n // Wait until its focus transition finishes before moving focus back.\n if (this.confirmationFocusTimeout !== null) window.clearTimeout(this.confirmationFocusTimeout);\n this.confirmationFocusTimeout = window.setTimeout(() => {\n this.confirmationFocusTimeout = null;\n if (this.state.showConfirmation && this.isTopmost() && !this.confirmOverlay?.contains(document.activeElement)) {\n this.focusConfirmation();\n }\n }, 0);\n };\n document.addEventListener(\"focusin\", this.boundHandleFocusChange);\n document.addEventListener(\"focusout\", this.boundHandleFocusChange);\n window.addEventListener(\"blur\", this.boundHandleFocusChange);\n }\n\n private removeEventListeners(): void {\n if (this.boundHandleMessage) {\n window.removeEventListener(\"message\", this.boundHandleMessage);\n this.boundHandleMessage = null;\n }\n if (this.boundHandleKeydown) {\n document.removeEventListener(\"keydown\", this.boundHandleKeydown);\n this.boundHandleKeydown = null;\n }\n if (this.boundHandleFocusChange) {\n document.removeEventListener(\"focusin\", this.boundHandleFocusChange);\n document.removeEventListener(\"focusout\", this.boundHandleFocusChange);\n window.removeEventListener(\"blur\", this.boundHandleFocusChange);\n this.boundHandleFocusChange = null;\n }\n }\n\n private pushToTop(): void {\n const modals = VerificationModal.openModals;\n const existingIndex = modals.indexOf(this);\n if (existingIndex !== -1) {\n modals.splice(existingIndex, 1);\n }\n modals.push(this);\n }\n\n private removeFromStack(): void {\n const modals = VerificationModal.openModals;\n const existingIndex = modals.indexOf(this);\n if (existingIndex !== -1) {\n modals.splice(existingIndex, 1);\n }\n }\n\n private isTopmost(): boolean {\n const modals = VerificationModal.openModals;\n return modals.length > 0 && modals[modals.length - 1] === this;\n }\n\n private handleMessage(event: MessageEvent): void {\n if (!this.iframe?.src) return;\n if (!isAllowedOrigin(event.origin, this.iframe.src )) {\n return SDKLogger.warn(\"Received postMessage from unallowed origin:\", event.origin);\n }\n\n // Scope every message to this modal's own iframe. Without this check, a\n // second VerificationModal open at the same time (e.g. a transaction\n // action modal stacked over the verification modal) would also react to\n // postMessages meant for the other iframe.\n if (!this.iframe || event.source !== this.iframe.contentWindow) {\n return;\n }\n\n SDKLogger.log(\"Received postMessage:\", event.data);\n\n let messageData: VerificationEvent;\n try {\n if (typeof event.data === \"string\") {\n messageData = JSON.parse(event.data);\n } else {\n messageData = event.data;\n }\n } catch {\n SDKLogger.warn(\"Failed to parse postMessage:\", event.data);\n return;\n }\n\n if (messageData.type === \"didit:close_request\") {\n this.handleCloseRequest();\n return;\n }\n\n if ((messageData.type as string) === LAYOUT_MESSAGE_TYPE) {\n const layout = this.readFlowLayout(messageData.data);\n if (layout) {\n this.applyFlowLayout(layout);\n } else {\n SDKLogger.warn(\"Ignoring a layout message without a positive contentHeight:\", messageData.data);\n }\n return;\n }\n\n this.callbacks.onMessage(messageData);\n }\n\n /**\n * Reads a didit:layout message's data. Without a positive contentHeight the\n * message is ignored; a missing or unknown colorScheme follows the device,\n * and a missing or unknown dir follows the verification URL's language.\n */\n private readFlowLayout(data: unknown): FlowLayout | null {\n const fields = typeof data === \"object\" && data !== null ? (data as Record<string, unknown>) : {};\n const { contentHeight, colorScheme, dir, kind } = fields;\n if (typeof contentHeight !== \"number\" || !Number.isFinite(contentHeight) || contentHeight <= 0) {\n return null;\n }\n const prefersDark = window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ?? false;\n return {\n kind: kind === \"handoff\" ? \"handoff\" : \"step\",\n contentHeight: Math.ceil(contentHeight),\n colorScheme: colorScheme === \"light\" || colorScheme === \"dark\" ? colorScheme : prefersDark ? \"dark\" : \"light\",\n dir: dir === \"ltr\" || dir === \"rtl\" ? dir : isRtlLanguage(this.language) ? \"rtl\" : \"ltr\"\n };\n }\n\n /** Embedded mode keeps filling the integrator's host element, whatever the flow reports. */\n private applyFlowLayout(layout: FlowLayout): void {\n if (this.embedded || !this.container) return;\n SDKLogger.log(\"Flow layout:\", layout);\n this.container.classList.add(CSS_CLASSES.flowSized);\n this.container.dataset.diditTheme = layout.colorScheme;\n this.container.dataset.diditDir = layout.dir;\n // The height the person sees now, before the reported content height can change it.\n const shownHeight = this.container.offsetHeight;\n this.container.style.setProperty(\"--didit-content-height\", `${layout.contentHeight}px`);\n this.matchPageBackground(layout.colorScheme);\n this.setModalKind(layout.kind, layout.kind === \"handoff\" && this.handoffHeight(layout) === shownHeight);\n }\n\n /** Whether the window is a computer-sized one: a phone is full screen and never waits for a layout. */\n private isPhoneWindow(): boolean {\n return window.matchMedia?.(\"(max-width: 540px)\").matches ?? false;\n }\n\n /** The height the handoff card takes for a layout, as the size rules above compute it (rounded like offsetHeight). */\n private handoffHeight(layout: FlowLayout): number {\n const cap = window.innerHeight * 0.9;\n return Math.round(Math.min(window.innerWidth >= 1000 ? 660 : layout.contentHeight, cap));\n }\n\n /**\n * Sets what the modal is sized for. Leaving \"pending\" shows the modal at its final size with no\n * transition; any later change animates once.\n */\n private setModalKind(kind: ModalKind, sizeUnchanged = false): void {\n if (!this.container) return;\n const previous = this.container.dataset.diditKind;\n if (previous === kind) return;\n if (this.firstLayoutTimeout !== null && kind !== \"pending\") {\n window.clearTimeout(this.firstLayoutTimeout);\n this.firstLayoutTimeout = null;\n }\n // Every change of kind animates, the pending card included (it is on screen), and only for the\n // length of the change, so resizing the window never lags behind.\n // Pending already is the handoff card: a handoff first layout of the same size moves nothing,\n // while a different reported height (a narrow window) animates the correction once.\n const staysPut = previous === \"pending\" && kind === \"handoff\" && sizeUnchanged;\n if (previous !== undefined && !staysPut) this.animateSizeOnce();\n this.container.dataset.diditKind = kind;\n // The final size is in place before the loader goes; a flow still loading keeps its loader.\n if (previous === \"pending\" && !this.state.isLoading) this.loadingEl?.classList.add(\"hidden\");\n }\n\n private animateSizeOnce(): void {\n this.container?.classList.add(CSS_CLASSES.sizeAnimated);\n if (this.sizeTimeout !== null) window.clearTimeout(this.sizeTimeout);\n this.sizeTimeout = window.setTimeout(() => {\n this.sizeTimeout = null;\n this.container?.classList.remove(CSS_CLASSES.sizeAnimated);\n }, SIZE_ANIMATION_MS);\n }\n\n /** A flow that reports no layout (an older one) still shows, at step size, after a short wait. */\n private waitForFirstLayout(): void {\n if (!this.container) return;\n // The card looks like the first screen from the first frame, in the device's theme.\n this.container.classList.add(CSS_CLASSES.flowSized);\n this.container.dataset.diditTheme = window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n this.setModalKind(\"pending\");\n this.firstLayoutTimeout = window.setTimeout(() => {\n this.firstLayoutTimeout = null;\n // A flow that never reported is an older one that paints itself: no card look around it.\n this.container?.classList.remove(CSS_CLASSES.flowSized);\n delete this.container?.dataset.diditTheme;\n this.setModalKind(\"step\");\n }, FIRST_LAYOUT_TIMEOUT_MS);\n }\n\n /**\n * On a phone Safari paints the bottom edge of the screen with the page's own background, past\n * any fixed overlay, and shows it when the keyboard moves the page. A full-screen modal lends\n * the page its ground colour while it is open, so no strip of the host page shows around it.\n */\n private matchPageBackground(colorScheme: FlowLayout[\"colorScheme\"]): void {\n if (!window.matchMedia?.(\"(max-width: 540px)\").matches) return;\n const root = document.documentElement;\n this.pageBackground ??= { root: root.style.backgroundColor, body: document.body.style.backgroundColor };\n const ground = colorScheme === \"dark\" ? \"#0b0b0d\" : \"#ffffff\";\n root.style.backgroundColor = ground;\n document.body.style.backgroundColor = ground;\n }\n\n private restorePageBackground(): void {\n if (!this.pageBackground) return;\n document.documentElement.style.backgroundColor = this.pageBackground.root;\n document.body.style.backgroundColor = this.pageBackground.body;\n this.pageBackground = null;\n }\n\n /** Back to the neutral look until the newly loaded flow reports its theme and direction. */\n private resetFlowLayout(): void {\n if (this.embedded || !this.container) return;\n this.restorePageBackground();\n this.container.classList.remove(CSS_CLASSES.flowSized, CSS_CLASSES.sizeAnimated);\n delete this.container.dataset.diditTheme;\n delete this.container.dataset.diditDir;\n delete this.container.dataset.diditKind;\n this.container.style.removeProperty(\"--didit-content-height\");\n if (this.firstLayoutTimeout !== null) {\n window.clearTimeout(this.firstLayoutTimeout);\n this.firstLayoutTimeout = null;\n }\n if (this.sizeTimeout !== null) {\n window.clearTimeout(this.sizeTimeout);\n this.sizeTimeout = null;\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (!this.state.isOpen) return;\n\n // When multiple modals are open at once, only the topmost one should\n // react to a keypress aimed at it (e.g. Escape closing a stacked\n // transaction action modal must not also trigger the exit confirmation\n // of the verification modal underneath it).\n if (!this.isTopmost()) return;\n\n if (event.key === \"Tab\" && this.state.showConfirmation) {\n const buttons = Array.from(this.confirmOverlay?.querySelectorAll<HTMLButtonElement>(\"button\") ?? []);\n if (buttons.length) {\n event.preventDefault();\n const current = buttons.findIndex((button) => button === document.activeElement);\n const next = event.shiftKey\n ? (current <= 0 ? buttons.length - 1 : current - 1)\n : (current + 1) % buttons.length;\n buttons[next].focus();\n }\n return;\n }\n\n if (event.key === \"Escape\") {\n event.preventDefault();\n if (this.state.showConfirmation) {\n this.hideConfirmation();\n } else {\n this.handleCloseRequest();\n }\n }\n }\n\n private handleIframeLoad(): void {\n if (this.iframe?.src && this.iframe.src !== \"about:blank\") {\n this.state.isLoading = false;\n // A modal still waiting for its first layout keeps the loader over the hidden flow.\n if (this.container?.dataset.diditKind !== \"pending\") this.loadingEl?.classList.add(\"hidden\");\n this.callbacks.onIframeLoad();\n }\n }\n\n private handleCloseRequest(trigger?: HTMLElement): void {\n if (this.config.showExitConfirmation) {\n this.showConfirmation(trigger);\n } else {\n this.callbacks.onCloseConfirmed();\n }\n }\n\n private showConfirmation(trigger?: HTMLElement): void {\n if (!this.confirmOverlay || this.state.showConfirmation) return;\n const activeElement = document.activeElement;\n this.confirmationTrigger = trigger ?? (activeElement instanceof HTMLElement && activeElement !== document.body\n ? activeElement\n : this.container?.querySelector<HTMLButtonElement>(`.${CSS_CLASSES.closeButton}`) ?? this.iframe);\n this.state.showConfirmation = true;\n this.confirmOverlay.classList.add(\"active\");\n if (this.iframe) this.iframe.inert = true;\n const close = this.container?.querySelector<HTMLButtonElement>(`.${CSS_CLASSES.closeButton}`);\n if (close) close.inert = true;\n // A confirmation scrolled at a large text size opens again at its title.\n this.confirmOverlay.scrollTop = 0;\n if (this.isTopmost()) this.focusConfirmation();\n this.callbacks.onClose();\n }\n\n private focusConfirmation(): void {\n this.confirmOverlay?.querySelector<HTMLDivElement>(`.${CSS_CLASSES.confirmBox}`)?.focus({ preventScroll: true });\n }\n\n private hideConfirmation(restoreFocus = true): void {\n if (this.confirmationFocusTimeout !== null) {\n window.clearTimeout(this.confirmationFocusTimeout);\n this.confirmationFocusTimeout = null;\n }\n if (!this.state.showConfirmation) return;\n this.state.showConfirmation = false;\n this.confirmOverlay?.classList.remove(\"active\");\n if (this.iframe) this.iframe.inert = false;\n const close = this.container?.querySelector<HTMLButtonElement>(`.${CSS_CLASSES.closeButton}`);\n if (close) close.inert = false;\n const trigger = this.confirmationTrigger;\n this.confirmationTrigger = null;\n if (restoreFocus && this.isTopmost() && trigger?.isConnected) {\n if (trigger === this.iframe) {\n // Firefox needs a browser task to reactivate an inert cross-origin frame.\n this.confirmationFocusTimeout = window.setTimeout(() => {\n this.confirmationFocusTimeout = null;\n if (this.state.isOpen && !this.state.showConfirmation && this.isTopmost() && trigger.isConnected) {\n trigger.focus({ preventScroll: true });\n }\n }, 0);\n } else {\n trigger.focus({ preventScroll: true });\n }\n }\n }\n\n private confirmExit(): void {\n this.hideConfirmation();\n this.callbacks.onCloseConfirmed();\n }\n\n open(verificationUrl: string): void {\n // Whether this modal already held its scroll lock before this call. Re-opening\n // an already-open instance must not re-capture previousBodyOverflow, or it\n // would record this modal's own \"hidden\" lock and close() could never restore\n // the real pre-lock value.\n const wasAlreadyOpen = this.state.isOpen;\n\n this.language = detectLanguageFromUrl(verificationUrl);\n\n if (!this.overlay && !this.container) {\n this.createDOM();\n }\n // Re-attach listeners every open() (idempotent) since close() now tears\n // them down; this lets the same instance be re-opened without a\n // destroy()/re-create cycle.\n this.setupEventListeners();\n\n SDKLogger.log(\"Opening with URL:\", verificationUrl);\n\n this.state.isLoading = true;\n this.hideConfirmation();\n this.loadingEl?.classList.remove(\"hidden\");\n this.resetFlowLayout();\n if (!this.embedded && !this.isPhoneWindow()) this.waitForFirstLayout();\n\n if (this.iframe) {\n this.iframe.src = verificationUrl;\n }\n\n this.state.isOpen = true;\n this.pushToTop();\n\n if (this.embedded) {\n return;\n }\n\n this.overlay?.classList.add(\"active\");\n // Capture whatever overflow value is currently in effect (which may\n // already be \"hidden\" because another modal is open) so close() can\n // restore exactly that value instead of clobbering a scroll lock owned\n // by a concurrently open modal. Skip the capture on a re-open: the value\n // in effect is this modal's own lock, and previousBodyOverflow already\n // holds the correct pre-lock value.\n if (!wasAlreadyOpen) {\n this.previousBodyOverflow = document.body.style.overflow;\n }\n document.body.style.overflow = \"hidden\";\n }\n\n close(): void {\n SDKLogger.log(\"Closing\");\n\n this.hideConfirmation(false);\n this.state.isOpen = false;\n this.state.isLoading = true;\n this.state.showConfirmation = false;\n this.removeFromStack();\n this.removeEventListeners();\n this.resetFlowLayout();\n\n if (this.iframe) {\n this.iframe.src = \"about:blank\";\n }\n\n if (this.embedded) {\n return;\n }\n\n this.overlay?.classList.remove(\"active\");\n document.body.style.overflow = this.previousBodyOverflow ?? \"\";\n this.previousBodyOverflow = null;\n }\n\n destroy(): void {\n SDKLogger.log(\"Destroying\");\n\n this.close();\n this.removeEventListeners();\n\n if (this.embedded && this.container && this.container.parentNode) {\n this.container.parentNode.removeChild(this.container);\n } else if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n\n this.overlay = null;\n this.container = null;\n this.iframe = null;\n this.loadingEl = null;\n this.confirmOverlay = null;\n }\n\n isOpen(): boolean {\n return this.state.isOpen;\n }\n\n isLoading(): boolean {\n return this.state.isLoading;\n }\n}\n","import type {\n DiditTransactionDetails,\n DiditTransactionParticipant,\n DiditTransactionPayload,\n DiditTravelRuleDetails,\n SubmitTransactionResult,\n TransactionActionRequired,\n TransactionErrorType\n} from \"./types\";\n\nimport { buildFingerprintHeaders, getDeviceFingerprintPayload } from \"@didit-protocol/signals\";\n\nexport const DEFAULT_TRANSACTION_BASE_URL = \"https://verification.didit.me\";\n\nconst ACTION_POLL_INTERVAL_MS = 1500;\nconst ACTION_POLL_MAX_ATTEMPTS = 10;\n\nconst TRANSACTION_ERROR_MESSAGES: Record<TransactionErrorType, string> = {\n invalid_token: \"The transaction token is invalid.\",\n expired_token: \"The transaction token has expired.\",\n validation: \"The transaction payload failed validation.\",\n network: \"A network error occurred while contacting the Didit API.\"\n};\n\n/**\n * Typed error thrown by DiditSdk.submitTransaction.\n *\n * - \"invalid_token\": the X-Transaction-Token was rejected (missing, revoked, over max uses)\n * - \"expired_token\": the transaction token TTL has elapsed\n * - \"validation\": the payload failed validation; see fieldErrors for per-field details\n * - \"network\": the request could not complete or the API returned an unexpected error\n */\nexport class DiditTransactionError extends Error {\n public readonly type: TransactionErrorType;\n public readonly status?: number;\n public readonly fieldErrors?: Record<string, unknown>;\n\n constructor(\n type: TransactionErrorType,\n message?: string,\n options?: { status?: number; fieldErrors?: Record<string, unknown> }\n ) {\n super(message || TRANSACTION_ERROR_MESSAGES[type]);\n this.name = \"DiditTransactionError\";\n this.type = type;\n this.status = options?.status;\n this.fieldErrors = options?.fieldErrors;\n }\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction compact(record: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(record)) {\n if (value !== undefined) result[key] = value;\n }\n return result;\n}\n\nfunction mapDetails(details: DiditTransactionDetails): Record<string, unknown> {\n return compact({\n direction: details.direction,\n amount: details.amount,\n currency: details.currency,\n currencyType: details.currencyType,\n amountInDefaultCurrency: details.amountInDefaultCurrency,\n defaultCurrencyCode: details.defaultCurrencyCode,\n paymentDetails: details.paymentDetails,\n paymentTxnId: details.paymentTxnId,\n type: details.actionType,\n cryptoParams: details.cryptoParams\n });\n}\n\nfunction mapParticipant(participant: DiditTransactionParticipant | undefined): Record<string, unknown> | undefined {\n if (!participant) return undefined;\n return compact({\n type: participant.type,\n externalUserId: participant.externalUserId,\n fullName: participant.fullName,\n firstName: participant.firstName,\n lastName: participant.lastName,\n dob: participant.dob,\n address: participant.address,\n institutionInfo: participant.institutionInfo,\n device: participant.device,\n paymentMethod: participant.paymentMethod\n ? compact({\n type: participant.paymentMethod.type,\n accountId: participant.paymentMethod.accountId,\n issuingCountry: participant.paymentMethod.issuingCountry\n })\n : undefined\n });\n}\n\nfunction mapTravelRule(travelRule: DiditTravelRuleDetails | undefined): Record<string, unknown> | undefined {\n if (!travelRule) return undefined;\n return compact({\n status: travelRule.status,\n protocol: travelRule.protocol,\n required: travelRule.required,\n obligationsCount: travelRule.obligationsCount,\n originatorData: travelRule.originatorData,\n beneficiaryData: travelRule.beneficiaryData,\n metadata: travelRule.metadata\n });\n}\n\n/**\n * Maps the SDK-friendly camelCase payload onto the wire aliases accepted by the\n * Didit transactions API (txnId, txnDate, zoneId, type, info, subject,\n * counterparty, props, travelRule, includeCryptoScreening).\n */\nexport function buildTransactionRequestBody(transaction: DiditTransactionPayload): Record<string, unknown> {\n return compact({\n txnId: transaction.txnId,\n txnDate: transaction.txnDate,\n zoneId: transaction.zoneId,\n type: transaction.category,\n info: mapDetails(transaction.details),\n subject: mapParticipant(transaction.subject),\n counterparty: mapParticipant(transaction.counterparty),\n props: transaction.customProperties,\n travelRule: mapTravelRule(transaction.travelRule),\n includeCryptoScreening: transaction.includeCryptoScreening\n });\n}\n\nfunction pickString(record: Record<string, unknown>, ...keys: string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value) return value;\n }\n return undefined;\n}\n\nfunction mapActionRequired(raw: unknown): TransactionActionRequired | undefined {\n if (!isPlainRecord(raw)) return undefined;\n const type = pickString(raw, \"type\");\n const url = pickString(raw, \"url\");\n if (!type || !url) return undefined;\n const action: TransactionActionRequired = { type, url };\n const sessionId = pickString(raw, \"session_id\", \"sessionId\");\n if (sessionId) action.sessionId = sessionId;\n const sessionToken = pickString(raw, \"session_token\", \"sessionToken\");\n if (sessionToken) action.sessionToken = sessionToken;\n const status = pickString(raw, \"status\");\n if (status) action.status = status;\n const widgetSessionId = pickString(raw, \"widget_session_id\", \"widgetSessionId\");\n if (widgetSessionId) action.widgetSessionId = widgetSessionId;\n const expiresAt = pickString(raw, \"expires_at\", \"expiresAt\");\n if (expiresAt) action.expiresAt = expiresAt;\n return action;\n}\n\nfunction mapTravelRuleStatus(raw: Record<string, unknown>): string | undefined {\n const travelRule = raw.travel_rule ?? raw.travelRule;\n if (isPlainRecord(travelRule)) {\n const status = pickString(travelRule, \"status\");\n if (status) return status;\n }\n const props = raw.props;\n if (isPlainRecord(props)) {\n const status = pickString(props, \"travel_rule_status\", \"travelRuleStatus\");\n if (status) return status;\n }\n return pickString(raw, \"travel_rule_status\", \"travelRuleStatus\");\n}\n\nexport function mapTransactionResponse(raw: Record<string, unknown>): SubmitTransactionResult {\n const transactionId = pickString(raw, \"uuid\", \"transaction_id\", \"transactionId\");\n const status = pickString(raw, \"status\");\n if (!transactionId || !status) {\n // A missing id/status is not a valid transaction snapshot: fabricating\n // empty strings here would let a malformed response (envelope,\n // intercepting proxy, contract drift) look like a real result to\n // callers - e.g. the poll's statusMoved early-exit would trigger on an\n // empty status that merely differs from a real initialStatus.\n throw new DiditTransactionError(\n \"network\",\n \"Unexpected response shape from the Didit API: missing transaction id or status.\"\n );\n }\n const result: SubmitTransactionResult = { transactionId, status };\n const travelRuleStatus = mapTravelRuleStatus(raw);\n if (travelRuleStatus) result.travelRuleStatus = travelRuleStatus;\n const actionRequired = mapActionRequired(raw.action_required ?? raw.actionRequired);\n if (actionRequired) result.actionRequired = actionRequired;\n return result;\n}\n\nfunction extractDetailMessage(body: unknown): string | undefined {\n if (!isPlainRecord(body)) return undefined;\n return pickString(body, \"detail\", \"message\", \"error\");\n}\n\nexport function classifyTransactionError(status: number, body: unknown): DiditTransactionError {\n const detail = extractDetailMessage(body);\n if (status === 401 || status === 403) {\n const serialized = `${detail ?? \"\"} ${pickString(isPlainRecord(body) ? body : {}, \"code\") ?? \"\"}`;\n if (/expired/i.test(serialized)) {\n return new DiditTransactionError(\"expired_token\", detail, { status });\n }\n return new DiditTransactionError(\"invalid_token\", detail, { status });\n }\n if (status === 400 || status === 422) {\n return new DiditTransactionError(\"validation\", detail, {\n status,\n fieldErrors: isPlainRecord(body) ? body : undefined\n });\n }\n return new DiditTransactionError(\"network\", `Request failed with status ${status}.`, { status });\n}\n\nasync function readJsonBody(response: Response): Promise<unknown> {\n try {\n return await response.json();\n } catch {\n return null;\n }\n}\n\nasync function performRequest(url: string, init: RequestInit): Promise<SubmitTransactionResult> {\n if (typeof fetch !== \"function\") {\n throw new DiditTransactionError(\"network\", \"fetch is not available in this environment.\");\n }\n\n let response: Response;\n try {\n response = await fetch(url, init);\n } catch {\n throw new DiditTransactionError(\"network\");\n }\n\n const body = await readJsonBody(response);\n if (!response.ok) {\n throw classifyTransactionError(response.status, body);\n }\n if (!isPlainRecord(body)) {\n throw new DiditTransactionError(\"network\", \"Unexpected empty response from the Didit API.\", {\n status: response.status\n });\n }\n return mapTransactionResponse(body);\n}\n\nexport interface TransactionRequestArgs {\n baseUrl: string;\n transactionToken: string;\n}\n\nexport async function submitTransactionRequest(\n args: TransactionRequestArgs & { transaction: DiditTransactionPayload }\n): Promise<SubmitTransactionResult> {\n const fingerprint = await getDeviceFingerprintPayload().catch(() => null);\n const body = buildTransactionRequestBody(args.transaction);\n if (fingerprint) {\n body.fingerprint_v2 = fingerprint;\n }\n return performRequest(`${args.baseUrl}/v1/transactions/`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Transaction-Token\": args.transactionToken,\n ...buildFingerprintHeaders(fingerprint)\n },\n body: JSON.stringify(body)\n });\n}\n\nexport async function fetchTransaction(\n args: TransactionRequestArgs & { transactionId: string }\n): Promise<SubmitTransactionResult> {\n return performRequest(`${args.baseUrl}/v1/transactions/${args.transactionId}/`, {\n method: \"GET\",\n headers: { \"X-Transaction-Token\": args.transactionToken }\n });\n}\n\nfunction delay(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/** Terminal auth failures that will never succeed on retry: keep polling would just burn the token's remaining uses. */\nfunction isTerminalPollError(error: unknown): error is DiditTransactionError {\n return error instanceof DiditTransactionError && (error.type === \"invalid_token\" || error.type === \"expired_token\");\n}\n\n/**\n * Re-fetches the transaction after an action flow finished or its modal was\n * closed. Polls with a bounded retry (never relies on a single event/attempt)\n * and stops early once the required action is cleared or the status moved on.\n * Returns the latest successfully fetched result, or null when every attempt\n * failed.\n *\n * A terminal auth failure (invalid_token/expired_token - e.g. a maxUses\n * token exhausted by the poll's own GETs, or the token TTL elapsing while\n * the user was in the action flow) aborts immediately instead of retrying:\n * it can never succeed, and each attempt would otherwise still count\n * against the token's use_count server-side. The error is rethrown so the\n * caller can surface it instead of silently returning a stale result.\n *\n * `isAborted` is polled between attempts so a caller that tears down (e.g.\n * DiditSdk.destroy()) can stop the loop from making further network calls.\n */\nexport async function pollTransactionAfterAction(\n args: TransactionRequestArgs & {\n transactionId: string;\n initialStatus?: string;\n intervalMs?: number;\n maxAttempts?: number;\n isAborted?: () => boolean;\n }\n): Promise<SubmitTransactionResult | null> {\n const intervalMs = args.intervalMs ?? ACTION_POLL_INTERVAL_MS;\n const maxAttempts = Math.max(1, args.maxAttempts ?? ACTION_POLL_MAX_ATTEMPTS);\n let latest: SubmitTransactionResult | null = null;\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n if (args.isAborted?.()) return latest;\n if (attempt > 0) {\n await delay(intervalMs);\n }\n if (args.isAborted?.()) return latest;\n try {\n latest = await fetchTransaction(args);\n const actionResolved = !latest.actionRequired;\n const statusMoved = args.initialStatus !== undefined && latest.status !== args.initialStatus;\n if (actionResolved || statusMoved) {\n return latest;\n }\n } catch (error) {\n if (isTerminalPollError(error)) {\n throw error;\n }\n // Transient failure; keep polling until the bound is reached.\n }\n }\n return latest;\n}\n","import type {\n DiditSdkState,\n DiditSdkConfiguration,\n VerificationResult,\n VerificationCallback,\n StateChangeCallback,\n EventCallback,\n VerificationEvent,\n SessionData,\n VerificationStatus,\n StartVerificationOptions,\n SubmitTransactionOptions,\n SubmitTransactionResult,\n TransactionActionCompletedCallback,\n TransactionActionCompletedError\n} from \"./types\";\nimport type { SubmitEventOptions } from \"@didit-protocol/signals\";\n\nimport { submitEvent } from \"@didit-protocol/signals\";\nimport { VerificationModal } from \"./modal\";\nimport { DEFAULT_CONFIG } from \"./constants\";\nimport { SDKLogger, buildVerificationUrl, createVerificationError } from \"./utils\";\nimport {\n DEFAULT_TRANSACTION_BASE_URL,\n DiditTransactionError,\n pollTransactionAfterAction,\n submitTransactionRequest\n} from \"./transactions\";\n\ntype TransactionActionOutcome = \"finished\" | \"aborted\";\n\n/**\n * Embedded mode renders inside an element that already exists on the\n * integrator's page. Without it the modal never shows anything (embedded mode\n * never activates the overlay), so the launch fails with a message the\n * integrator can act on instead of silently presenting nothing.\n */\nfunction assertEmbeddedHostExists(configuration: DiditSdkConfiguration | undefined): void {\n if (!configuration?.embedded) return;\n const containerId = configuration.embeddedContainerId;\n if (!containerId) {\n throw new Error(\"Embedded mode requires embeddedContainerId: the id of the element that hosts the verification.\");\n }\n if (typeof document === \"undefined\" || !document.getElementById(containerId)) {\n throw new Error(`Embedded container \"#${containerId}\" was not found in the page.`);\n }\n}\n\nexport class DiditSdk {\n private static _instance: DiditSdk | null = null;\n\n public static get shared(): DiditSdk {\n if (!DiditSdk._instance) {\n DiditSdk._instance = new DiditSdk();\n }\n return DiditSdk._instance;\n }\n\n public static reset(): void {\n if (DiditSdk._instance) {\n DiditSdk._instance.destroy();\n DiditSdk._instance = null;\n }\n }\n\n private _state: DiditSdkState = \"idle\";\n private _configuration: DiditSdkConfiguration | undefined;\n private _sessionId: string | undefined;\n private _url: string | undefined;\n private _modal: VerificationModal | null = null;\n private _errorMessage: string | undefined;\n private _actionModal: VerificationModal | null = null;\n private _actionModalSettle: ((outcome: TransactionActionOutcome) => void) | null = null;\n /**\n * Bumped by destroy() to invalidate any transaction action in flight\n * (pending action modal and/or its follow-up poll) so a torn-down SDK\n * instance can never deliver a late onActionCompleted. A new\n * submitTransaction call always reads the current generation, so it is\n * unaffected by a destroy() that happened before it started.\n */\n private _actionGeneration = 0;\n\n public onComplete: VerificationCallback | undefined;\n public onStateChange: StateChangeCallback | undefined;\n public onEvent: EventCallback | undefined;\n\n public get state(): DiditSdkState {\n return this._state;\n }\n\n public get configuration(): DiditSdkConfiguration | undefined {\n return this._configuration;\n }\n\n public get isPresented(): boolean {\n return this._modal?.isOpen() ?? false;\n }\n\n /**\n * True while a transaction's wallet-ownership action modal (auto-launched\n * by submitTransaction) is on screen. verification_session actions are\n * never auto-launched, so they never affect this flag - see\n * {@link submitTransaction}. Tracked separately from {@link isPresented},\n * which reflects the verification modal only.\n */\n public get isActionModalPresented(): boolean {\n return this._actionModal?.isOpen() ?? false;\n }\n\n public get errorMessage(): string | undefined {\n return this._errorMessage;\n }\n\n private constructor() {\n SDKLogger.log(\"DiditSdk initialized\");\n }\n\n public async startVerification(options: StartVerificationOptions): Promise<void> {\n const config = options.configuration;\n this._configuration = config;\n\n SDKLogger.isEnabled = config?.loggingEnabled ?? DEFAULT_CONFIG.loggingEnabled;\n\n SDKLogger.log(\"Starting verification with options:\", options);\n if (this._modal) {\n this._modal.destroy();\n this._modal = null;\n }\n // A new launch is not in an error state any more, whatever the last one did.\n this._errorMessage = undefined;\n\n try {\n const { url } = options;\n\n if (!url || typeof url !== \"string\") {\n throw new Error(\"Invalid options: url is required\");\n }\n assertEmbeddedHostExists(config);\n\n this._modal = new VerificationModal(config, {\n onClose: () => this.handleModalClose(),\n onCloseConfirmed: () => this.handleModalCloseConfirmed(),\n onMessage: (event) => this.handleVerificationEvent(event),\n onIframeLoad: () => this.handleIframeLoad()\n });\n\n this._url = buildVerificationUrl(url, config);\n this.setState(\"loading\");\n\n this.emitInternalEvent(\"didit:started\", {});\n\n this._modal?.open(this._url);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n /**\n * Submits a transaction (including travel-rule and crypto-monitoring payloads)\n * directly from the end-user device.\n *\n * The request is authenticated with a short-lived transaction token minted by\n * your backend (POST /v3/transactions/sdk-token/) and sent via the\n * X-Transaction-Token header. Device intelligence is attached automatically:\n * the SDK collects a didit-fp-v2 fingerprint and sends it as the X-Didit-PID /\n * X-Didit-FP-Hash headers plus a `fingerprint_v2` body field.\n *\n * When the response contains an `actionRequired` block, the contract differs\n * by type:\n * - `wallet_ownership` (a same-origin, Didit-hosted widget): when\n * `autoLaunchAction` is not false, the SDK opens the action URL in the\n * verification modal itself. Once the flow completes or the modal is\n * closed, the transaction is re-fetched with a bounded poll (never a\n * single event) and `onActionCompleted` is invoked with the refreshed\n * result.\n * - `verification_session` (a biometric verification session): never\n * auto-launched, regardless of `autoLaunchAction`. It is only ever\n * returned in `result.actionRequired` for the host application to launch\n * with its own verification integration (e.g. `startVerification`).\n *\n * @param options Submission options: transactionToken, transaction payload,\n * optional baseUrl (defaults to https://verification.didit.me),\n * autoLaunchAction (defaults to true, applies to wallet_ownership actions\n * only) and onActionCompleted callback.\n * @returns The created transaction: transactionId, status, travelRuleStatus\n * and actionRequired when a user action is pending.\n * @throws {DiditTransactionError} Typed as \"invalid_token\", \"expired_token\",\n * \"validation\" (with fieldErrors) or \"network\".\n */\n public async submitTransaction(options: SubmitTransactionOptions): Promise<SubmitTransactionResult> {\n if (!options?.transactionToken || typeof options.transactionToken !== \"string\") {\n throw new DiditTransactionError(\"invalid_token\", \"transactionToken is required.\");\n }\n if (!options.transaction || typeof options.transaction !== \"object\") {\n throw new DiditTransactionError(\"validation\", \"transaction payload is required.\");\n }\n if (!options.transaction.txnId || typeof options.transaction.txnId !== \"string\") {\n throw new DiditTransactionError(\"validation\", \"transaction.txnId is required.\");\n }\n if (!options.transaction.details || typeof options.transaction.details !== \"object\") {\n throw new DiditTransactionError(\"validation\", \"transaction.details is required.\");\n }\n\n const baseUrl = (options.baseUrl ?? DEFAULT_TRANSACTION_BASE_URL).replace(/\\/+$/, \"\");\n SDKLogger.log(\"Submitting transaction:\", options.transaction.txnId);\n\n const result = await submitTransactionRequest({\n baseUrl,\n transactionToken: options.transactionToken,\n transaction: options.transaction\n });\n\n SDKLogger.log(\"Transaction submitted:\", result);\n\n // Only wallet_ownership is a same-origin, Didit-hosted widget that is\n // safe for the SDK to open on the integrator's behalf. verification_session\n // is never auto-launched: it is already returned in result.actionRequired\n // above for the host to launch with its own verification integration.\n const autoLaunchAction = options.autoLaunchAction ?? true;\n if (autoLaunchAction && result.actionRequired?.type === \"wallet_ownership\" && result.actionRequired.url) {\n void this.runTransactionAction(baseUrl, options.transactionToken, result, options.onActionCompleted);\n }\n\n return result;\n }\n\n /**\n * Queues an end-user event (sign-up, login, failed login, logout, password\n * reset, MFA, device change...) for Didit's event monitoring, so it appears\n * in the console tied to the same person as their verifications and\n * transactions. Returns the event id.\n *\n * The request is authenticated with a short-lived monitoring token minted by\n * your backend for that person (POST /v3/events/sdk-token/) and sent via the\n * X-Monitoring-Token header; the person always comes from the token. Events\n * are batched to /v1/events/batch/ with the device fingerprint attached, and\n * sent when 25 are waiting, every 5 seconds and when the page is hidden or\n * closed. Tune the queue with `configureEvents` and send right away with\n * `flush`, both exported by this package.\n *\n * @param options monitoringToken, the event and an optional baseUrl\n * (defaults to https://verification.didit.me).\n * @returns The event id: yours when you set event.eventId, otherwise a new UUID.\n * @throws {DiditEventError} \"invalid_token\" without a monitoringToken,\n * \"validation\" without an event category and action type.\n */\n public submitEvent(options: SubmitEventOptions): string {\n SDKLogger.log(\"Submitting event:\", options?.event?.category, options?.event?.actionType);\n return submitEvent(options);\n }\n\n /**\n * Dismisses everything currently on screen in one deterministic call: a\n * pending transaction action modal is treated as an abort (no follow-up\n * poll, no onActionCompleted) and the verification modal is always closed\n * afterwards, regardless of whether an action modal was present.\n */\n public close(): void {\n SDKLogger.log(\"Closing verification programmatically\");\n this._actionModalSettle?.(\"aborted\");\n this.handleModalCloseConfirmed();\n }\n\n public destroy(): void {\n SDKLogger.log(\"Destroying SDK instance\");\n // Invalidate any transaction action in flight so a poll that is already\n // running cannot deliver onActionCompleted after teardown.\n this._actionGeneration++;\n this._actionModalSettle?.(\"aborted\");\n this._modal?.destroy();\n this._modal = null;\n this.reset();\n this.setState(\"idle\");\n }\n\n private async runTransactionAction(\n baseUrl: string,\n transactionToken: string,\n submitResult: SubmitTransactionResult,\n onActionCompleted: TransactionActionCompletedCallback | undefined\n ): Promise<void> {\n const generation = this._actionGeneration;\n let delivered = false;\n\n // Guarantees at-most-once delivery: a throwing integrator callback must\n // not be re-invoked by a surrounding catch, and a destroy() that\n // happened while we were awaiting the modal/poll must suppress delivery\n // entirely rather than calling back into a torn-down integration.\n const deliver = (result: SubmitTransactionResult, error?: TransactionActionCompletedError): void => {\n if (delivered || generation !== this._actionGeneration) return;\n delivered = true;\n try {\n onActionCompleted?.(result, error);\n } catch (callbackError) {\n SDKLogger.error(\"onActionCompleted callback threw:\", callbackError);\n }\n };\n\n try {\n const outcome = await this.presentTransactionActionModal(submitResult.actionRequired!.url);\n if (outcome === \"aborted\" || generation !== this._actionGeneration) {\n return;\n }\n if (!submitResult.transactionId) {\n deliver(submitResult);\n return;\n }\n\n let refreshed: SubmitTransactionResult | null = null;\n let pollError: DiditTransactionError | undefined;\n try {\n refreshed = await pollTransactionAfterAction({\n baseUrl,\n transactionToken,\n transactionId: submitResult.transactionId,\n initialStatus: submitResult.status,\n isAborted: () => generation !== this._actionGeneration\n });\n } catch (error) {\n if (error instanceof DiditTransactionError) {\n pollError = error;\n } else {\n throw error;\n }\n }\n\n if (pollError) {\n // Terminal auth failure (invalid_token/expired_token): surface it\n // instead of silently handing back the stale pre-action result.\n deliver(submitResult, { type: pollError.type, message: pollError.message });\n return;\n }\n deliver(refreshed ?? submitResult);\n } catch (error) {\n SDKLogger.error(\"Transaction action follow-up failed:\", error);\n deliver(submitResult);\n }\n }\n\n private presentTransactionActionModal(url: string): Promise<TransactionActionOutcome> {\n // Abort any previous action modal before opening a new one.\n this._actionModalSettle?.(\"aborted\");\n\n return new Promise<TransactionActionOutcome>((resolve) => {\n let settled = false;\n const settle = (outcome: TransactionActionOutcome): void => {\n if (settled) return;\n settled = true;\n const modal = this._actionModal;\n this._actionModal = null;\n this._actionModalSettle = null;\n modal?.destroy();\n resolve(outcome);\n };\n\n // this._actionModalSettle is assigned only after the modal is\n // successfully constructed and opened. If either throws (e.g. no\n // `document` in Node/SSR, or document.body not ready yet), the\n // settle callback must not be left dangling: a later close() would\n // otherwise find a stale this._actionModalSettle for a modal that\n // was never presented, \"settle\" it, and return early without ever\n // closing the actual verification modal.\n let modal: VerificationModal;\n try {\n modal = new VerificationModal(undefined, {\n onClose: () => {},\n onCloseConfirmed: () => settle(\"finished\"),\n onMessage: (event) => {\n this.onEvent?.(event);\n if (event.type === \"didit:completed\" || event.type === \"didit:cancelled\") {\n settle(\"finished\");\n }\n },\n onIframeLoad: () => {}\n });\n\n SDKLogger.log(\"Launching required transaction action:\", url);\n modal.open(url);\n } catch (error) {\n this._actionModal = null;\n this._actionModalSettle = null;\n throw error;\n }\n\n this._actionModal = modal;\n this._actionModalSettle = settle;\n });\n }\n\n private handleModalClose(): void {\n SDKLogger.log(\"Modal close requested\");\n }\n\n private handleModalCloseConfirmed(): void {\n SDKLogger.log(\"Modal close confirmed\");\n\n const sessionData = this.buildSessionData();\n\n this._modal?.close();\n this.reset();\n this.setState(\"idle\");\n\n const result: VerificationResult = {\n type: \"cancelled\",\n session: sessionData\n };\n\n this.onComplete?.(result);\n }\n\n private handleIframeLoad(): void {\n SDKLogger.log(\"Iframe loaded\");\n }\n\n private emitInternalEvent(type: VerificationEvent[\"type\"], data?: VerificationEvent[\"data\"]): void {\n const event: VerificationEvent = {\n type,\n data,\n timestamp: Date.now()\n };\n\n SDKLogger.log(\"Emitting internal event:\", event);\n this.onEvent?.(event);\n }\n\n private handleVerificationEvent(event: VerificationEvent): void {\n SDKLogger.log(\"Verification event:\", event);\n\n // Keep the session the flow told us about so a modal the user closes by\n // hand still reports the session it belongs to in the cancelled result.\n if (event.data?.sessionId) {\n this._sessionId = event.data.sessionId;\n }\n\n this.onEvent?.(event);\n\n switch (event.type) {\n case \"didit:ready\":\n SDKLogger.log(\"Verification iframe ready\");\n break;\n\n case \"didit:started\":\n SDKLogger.log(\"User started verification\");\n break;\n\n case \"didit:step_started\":\n SDKLogger.log(\"Step started:\", event.data?.step);\n break;\n\n case \"didit:step_completed\":\n SDKLogger.log(\"Step completed:\", event.data?.step, \"-> next:\", event.data?.nextStep);\n break;\n\n case \"didit:media_started\":\n SDKLogger.log(\"Media started:\", event.data?.mediaType, \"for step:\", event.data?.step);\n break;\n\n case \"didit:media_captured\":\n SDKLogger.log(\"Media captured for step:\", event.data?.step, \"isAuto:\", event.data?.isAuto);\n break;\n\n case \"didit:document_selected\":\n SDKLogger.log(\"Document selected:\", event.data?.documentType, \"country:\", event.data?.country);\n break;\n\n case \"didit:verification_submitted\":\n SDKLogger.log(\"Verification submitted for step:\", event.data?.step);\n break;\n\n case \"didit:code_sent\":\n SDKLogger.log(\"Code sent via:\", event.data?.channel, \"codeSize:\", event.data?.codeSize);\n break;\n\n case \"didit:code_verified\":\n SDKLogger.log(\"Code verified via:\", event.data?.channel);\n break;\n\n case \"didit:status_updated\":\n SDKLogger.log(\"Status updated:\", event.data?.status, \"step:\", event.data?.step);\n break;\n\n case \"didit:completed\":\n this.handleVerificationCompleted(event);\n break;\n\n case \"didit:cancelled\":\n this.handleVerificationCancelled(event);\n break;\n\n case \"didit:error\":\n this.handleVerificationError(event);\n break;\n\n case \"didit:step_changed\":\n SDKLogger.log(\"Step changed:\", event.data?.step);\n break;\n\n case \"didit:close_request\":\n break;\n }\n }\n\n private handleVerificationCompleted(event: VerificationEvent): void {\n SDKLogger.log(\"Verification completed:\", event.data);\n\n const sessionData = this.buildSessionData(event.data);\n\n if (this._configuration?.closeModalOnComplete) {\n this._modal?.close();\n this.reset();\n this.setState(\"idle\");\n }\n\n const result: VerificationResult = {\n type: \"completed\",\n session: sessionData\n };\n\n this.onComplete?.(result);\n }\n\n private handleVerificationCancelled(event: VerificationEvent): void {\n SDKLogger.log(\"Verification cancelled:\", event.data);\n\n const sessionData = this.buildSessionData(event.data);\n\n this._modal?.close();\n this.reset();\n this.setState(\"idle\");\n\n const result: VerificationResult = {\n type: \"cancelled\",\n session: sessionData\n };\n\n this.onComplete?.(result);\n }\n\n private handleVerificationError(event: VerificationEvent): void {\n SDKLogger.log(\"Verification error:\", event.data);\n }\n\n private handleError(error: unknown): void {\n SDKLogger.error(\"SDK error:\", error);\n\n let verificationError;\n\n if (error instanceof Error) {\n verificationError = createVerificationError(\"unknown\", error.message);\n } else {\n verificationError = createVerificationError(\"unknown\", \"An unknown error occurred\");\n }\n\n this._modal?.close();\n this._modal = null;\n // Clear what the failed launch left behind, then report the error as the\n // state the SDK is in: reset() alone would leave callers reading \"idle\"\n // with no error message right after onStateChange(\"error\").\n this.reset();\n this._errorMessage = verificationError.message;\n this.setState(\"error\");\n\n const result: VerificationResult = {\n type: \"failed\",\n error: verificationError\n };\n\n this.onComplete?.(result);\n }\n\n private setState(state: DiditSdkState): void {\n const previousState = this._state;\n this._state = state;\n\n if (previousState !== state) {\n SDKLogger.log(\"State changed:\", previousState, \"->\", state);\n this.onStateChange?.(state, this._errorMessage);\n }\n }\n\n private reset(): void {\n this._sessionId = undefined;\n this._url = undefined;\n this._errorMessage = undefined;\n this._configuration = undefined;\n }\n\n private buildSessionData(eventData?: VerificationEvent[\"data\"]): SessionData | undefined {\n const sessionId = eventData?.sessionId || this._sessionId;\n\n if (!sessionId) {\n return undefined;\n }\n\n return {\n sessionId,\n status: (eventData?.status || \"Pending\") as VerificationStatus\n };\n }\n}\n"],"names":["getDeviceFingerprintPayload","buildFingerprintHeaders","submitEvent"],"mappings":";;;;;;;;;;;AAAO,MAAM,cAAc,GAAG;AAC5B,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,cAAc,EAAE,MAER;AAEH,MAAM,WAAW,GAAG;AACzB,IAAA,OAAO,EAAE,qBAAqB;AAC9B,IAAA,SAAS,EAAE,uBAAuB;AAClC,IACA,MAAM,EAAE,2BAA2B;AACnC,IAAA,WAAW,EAAE,oBAAoB;AACjC,IAAA,SAAS,EAAE,kBAAkB;AAC7B,IAAA,eAAe,EAAE,yBAAyB;A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+
{"version":3,"file":"didit-sdk.cjs","sources":["../../src/constants.ts","../../src/utils.ts","../../src/translations.ts","../../src/modal.ts","../../src/transactions.ts","../../src/DiditSdk.ts"],"sourcesContent":["export const DEFAULT_CONFIG = {\n zIndex: 9999,\n showCloseButton: true,\n showExitConfirmation: true,\n loggingEnabled: false,\n closeModalOnComplete: false\n} as const;\n\nexport const CSS_CLASSES = {\n overlay: \"didit-modal-overlay\",\n container: \"didit-modal-container\",\n content: \"didit-modal-content\",\n iframe: \"didit-verification-iframe\",\n closeButton: \"didit-close-button\",\n closeIcon: \"didit-close-icon\",\n closeIconLegacy: \"didit-close-icon-legacy\",\n flowSized: \"didit-flow-sized\",\n sizeAnimated: \"didit-size-animated\",\n loading: \"didit-loading\",\n confirmOverlay: \"didit-confirm-overlay\",\n confirmBox: \"didit-confirm-box\",\n embedded: \"didit-embedded\",\n curtain: \"didit-modal-curtain\"\n} as const;\n\nexport const SDK_VERSION = \"__SDK_PACKAGE_VERSION__\";\n\n/**\n * The permissions the verification iframe gets, in a modal and embedded:\n * camera and microphone for capture, clipboard-write for the flow's copy\n * buttons, and digital-credentials-get so the flow can ask a digital ID wallet\n * (Google Wallet) through the W3C Digital Credentials API from inside the iframe.\n */\nexport const IFRAME_ALLOW =\n \"camera; microphone; fullscreen; autoplay; encrypted-media; geolocation; clipboard-write; digital-credentials-get\";\n\n/** The verification-URL query parameter each camera option is forwarded as. */\nexport const CAMERA_QUERY_PARAMS = {\n defaultDocumentCamera: \"document_camera\",\n defaultLivenessCamera: \"liveness_camera\",\n showDocumentCameraSwitchButton: \"document_camera_switch\",\n showLivenessCameraSwitchButton: \"liveness_camera_switch\"\n} as const;\n\nexport const CAMERA_LENSES = [\"front\", \"back\"] as const;\n\n/**\n * The verification-URL query parameters that tell the hosted flow how the SDK\n * presents it: `sdk_presentation=modal|embedded` and, in a modal,\n * `sdk_close_button=true|false` (whether the SDK draws its close button over\n * the flow's top bar).\n */\nexport const PRESENTATION_QUERY_PARAMS = {\n presentation: \"sdk_presentation\",\n closeButton: \"sdk_close_button\"\n} as const;\n\n/**\n * The verification-URL query parameter that carries the device id this page\n * already keeps for Didit, when it keeps one. A browser gives the flow in the\n * frame storage of its own, apart from this page's, so without it a\n * verification and this site's events never share a device id.\n */\nexport const DEVICE_ID_QUERY_PARAM = \"sdk_device_id\";\n\n/**\n * Posted by the hosted flow when it lays itself out for the modal, with\n * `data: { contentHeight, colorScheme?, dir?, kind? }` (`kind` is `handoff` or `step`, `step` when missing). The modal then grows to the\n * handoff card on a computer and follows the content height in a narrow\n * window. Handled by the modal and never delivered to `onEvent`.\n */\nexport const LAYOUT_MESSAGE_TYPE = \"didit:layout\";\n\n/** Languages the hosted flow lays out right to left. */\nexport const RTL_LANGUAGES = [\"ar\", \"fa\", \"he\"];\n\nexport const languages = [\n \"ar\",\n \"bg\",\n \"bn\",\n \"ca\",\n \"cnr\",\n \"cs\",\n \"da\",\n \"de\",\n \"el\",\n \"en\",\n \"es\",\n \"et\",\n \"fa\",\n \"fi\",\n \"fr\",\n \"he\",\n \"hi\",\n \"hr\",\n \"hu\",\n \"hy\",\n \"id\",\n \"it\",\n \"ja\",\n \"ka\",\n \"ko\",\n \"lt\",\n \"lv\",\n \"mk\",\n \"mn\",\n \"ms\",\n \"nl\",\n \"no\",\n \"pl\",\n \"pt-BR\",\n \"pt\",\n \"ro\",\n \"ru\",\n \"sk\",\n \"sl\",\n \"so\",\n \"sr\",\n \"sv\",\n \"th\",\n \"tr\",\n \"uk\",\n \"uz\",\n \"vi\",\n \"zh-CN\",\n \"zh-TW\",\n \"zh\",\n]\n","import {\n CAMERA_LENSES,\n CAMERA_QUERY_PARAMS,\n DEFAULT_CONFIG,\n DEVICE_ID_QUERY_PARAM,\n PRESENTATION_QUERY_PARAMS,\n RTL_LANGUAGES,\n languages\n} from \"./constants\";\nimport type { CameraLens, DiditSdkConfiguration } from \"./types\";\n\nclass SDKLogger {\n private static _enabled = false;\n\n static get isEnabled(): boolean {\n return this._enabled;\n }\n\n static set isEnabled(value: boolean) {\n this._enabled = value;\n }\n\n static log(...args: unknown[]): void {\n if (this._enabled) {\n console.log(\"[DiditSDK]\", ...args);\n }\n }\n\n static warn(...args: unknown[]): void {\n if (this._enabled) {\n console.warn(\"[DiditSDK]\", ...args);\n }\n }\n\n static error(...args: unknown[]): void {\n if (this._enabled) {\n console.error(\"[DiditSDK]\", ...args);\n }\n }\n}\n\nexport { SDKLogger };\n\nexport function generateModalId(): string {\n return `didit-modal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n}\n\nexport function isAllowedOrigin(origin: string, url: string): boolean {\n try {\n const originURL = new URL(origin);\n const urlURL = new URL(url);\n return originURL.hostname.endsWith(\".didit.me\") || originURL.hostname === urlURL.hostname;\n } catch {\n return false;\n }\n}\n\nexport function createVerificationError(\n type: \"sessionExpired\" | \"networkError\" | \"cameraAccessDenied\" | \"unknown\",\n customMessage?: string\n): { type: typeof type; message: string } {\n const messages = {\n sessionExpired: \"Your verification session has expired.\",\n networkError: \"A network error occurred. Please try again.\",\n cameraAccessDenied: \"Camera access is required for verification.\",\n unknown: customMessage || \"An unknown error occurred.\"\n };\n\n return {\n type,\n message: customMessage || messages[type]\n };\n}\n\nfunction isCameraLens(value: unknown): value is CameraLens {\n return (CAMERA_LENSES as readonly unknown[]).includes(value);\n}\n\nconst CAMERA_LENS_OPTIONS = [\"defaultDocumentCamera\", \"defaultLivenessCamera\"] as const;\nconst CAMERA_SWITCH_OPTIONS = [\"showDocumentCameraSwitchButton\", \"showLivenessCameraSwitchButton\"] as const;\n\n/**\n * The URL the verification iframe loads: the integrator's URL with the\n * configuration options the hosted page reads from its query string.\n *\n * The camera options (the same four the native SDKs expose) become query\n * parameters: `defaultDocumentCamera` -> `document_camera=<lens>`,\n * `defaultLivenessCamera` -> `liveness_camera=<lens>`,\n * `showDocumentCameraSwitchButton` -> `document_camera_switch=true|false`,\n * `showLivenessCameraSwitchButton` -> `liveness_camera_switch=true|false`.\n * How the SDK presents the flow is always added: `sdk_presentation=modal|embedded`\n * and, in a modal, `sdk_close_button=true|false`. `storedDeviceId`, when the\n * page has one, is added as `sdk_device_id`.\n * Each parameter is set (not appended) so the configuration wins over a value\n * already on the URL; existing query parameters and the hash are kept. A\n * value of the wrong shape is ignored with a warning rather than forwarded,\n * and a URL the browser cannot parse is returned as it came (the modal\n * reports it when it loads).\n */\nexport function buildVerificationUrl(\n url: string,\n configuration: DiditSdkConfiguration = {},\n storedDeviceId: string | null = null\n): string {\n const params = presentationParams(configuration);\n // The id this page already keeps for Didit (see getStoredDeviceId): the flow in the frame, whose\n // own storage the browser keeps apart from this page's, can then be told apart as the same\n // device as this site's events. Absent when the page keeps none; nothing is created for it.\n if (storedDeviceId) params.push([DEVICE_ID_QUERY_PARAM, storedDeviceId]);\n for (const option of CAMERA_LENS_OPTIONS) {\n const value = configuration[option];\n if (value === undefined) continue;\n if (!isCameraLens(value)) {\n SDKLogger.warn(`Ignoring ${option}: expected \"front\" or \"back\", got`, value);\n continue;\n }\n params.push([CAMERA_QUERY_PARAMS[option], value]);\n }\n for (const option of CAMERA_SWITCH_OPTIONS) {\n const value = configuration[option];\n if (value === undefined) continue;\n if (typeof value !== \"boolean\") {\n SDKLogger.warn(`Ignoring ${option}: expected a boolean, got`, value);\n continue;\n }\n params.push([CAMERA_QUERY_PARAMS[option], value ? \"true\" : \"false\"]);\n }\n try {\n const parsed = new URL(url);\n params.forEach(([name, value]) => parsed.searchParams.set(name, value));\n return parsed.toString();\n } catch {\n return url;\n }\n}\n\nfunction presentationParams(configuration: DiditSdkConfiguration): Array<[string, string]> {\n if (configuration.embedded) {\n return [[PRESENTATION_QUERY_PARAMS.presentation, \"embedded\"]];\n }\n const closeButton = configuration.showCloseButton ?? DEFAULT_CONFIG.showCloseButton;\n return [\n [PRESENTATION_QUERY_PARAMS.presentation, \"modal\"],\n [PRESENTATION_QUERY_PARAMS.closeButton, closeButton ? \"true\" : \"false\"]\n ];\n}\n\nexport function isRtlLanguage(language: string): boolean {\n return RTL_LANGUAGES.includes(language.split(\"-\")[0]);\n}\n\nexport function detectLanguageFromUrl(url: string): string {\n try {\n const { pathname } = new URL(url);\n const firstSegment = pathname.split(\"/\").filter(Boolean)[0];\n if (firstSegment && languages.includes(firstSegment)) {\n return firstSegment;\n }\n } catch {\n // we get it from the browser\n }\n\n const browserLang = navigator.language;\n if (languages.includes(browserLang)) return browserLang;\n const baseLang = browserLang.split(\"-\")[0];\n if (languages.includes(baseLang)) return baseLang;\n\n return \"en\";\n}\n","export interface ModalTranslations {\n exitTitle: string;\n exitMessage: string;\n continueButton: string;\n exitButton: string;\n ariaLabelModal: string;\n ariaLabelClose: string;\n}\n\nconst EN: ModalTranslations = {\n exitTitle: \"Exit verification?\",\n exitMessage: \"Exiting will end your verification process. Are you sure?\",\n continueButton: \"Continue\",\n exitButton: \"Exit\",\n ariaLabelModal: \"Didit Verification\",\n ariaLabelClose: \"Close verification\"\n};\n\nconst translationsMap: Record<string, ModalTranslations> = {\n ar: {\n exitTitle: \"الخروج من التحقق؟\",\n exitMessage: \"سيؤدي الخروج إلى إنهاء عملية التحقق الخاصة بك. هل أنت متأكد؟\",\n continueButton: \"متابعة\",\n exitButton: \"خروج\",\n ariaLabelModal: \"التحقق من Didit\",\n ariaLabelClose: \"إغلاق التحقق\"\n },\n bg: {\n exitTitle: \"Излизане от верификацията?\",\n exitMessage: \"Излизането ще прекрати процеса на верификация. Сигурни ли сте?\",\n continueButton: \"Продължи\",\n exitButton: \"Изход\",\n ariaLabelModal: \"Верификация Didit\",\n ariaLabelClose: \"Затваряне на верификацията\"\n },\n bn: {\n exitTitle: \"যাচাইকরণ থেকে বের হবেন?\",\n exitMessage: \"বের হলে আপনার যাচাইকরণ প্রক্রিয়া শেষ হয়ে যাবে। আপনি কি নিশ্চিত?\",\n continueButton: \"চালিয়ে যান\",\n exitButton: \"বের হন\",\n ariaLabelModal: \"Didit যাচাইকরণ\",\n ariaLabelClose: \"যাচাইকরণ বন্ধ করুন\"\n },\n bs: {\n exitTitle: \"Izaći iz verifikacije?\",\n exitMessage: \"Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?\",\n continueButton: \"Nastavi\",\n exitButton: \"Izađi\",\n ariaLabelModal: \"Didit verifikacija\",\n ariaLabelClose: \"Zatvori verifikaciju\"\n },\n ca: {\n exitTitle: \"Sortir de la verificació?\",\n exitMessage: \"Sortir finalitzarà el procés de verificació. N'esteu segur?\",\n continueButton: \"Continua\",\n exitButton: \"Sortir\",\n ariaLabelModal: \"Verificació Didit\",\n ariaLabelClose: \"Tancar verificació\"\n },\n cnr: {\n exitTitle: \"Izaći iz verifikacije?\",\n exitMessage: \"Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?\",\n continueButton: \"Nastavi\",\n exitButton: \"Izađi\",\n ariaLabelModal: \"Didit verifikacija\",\n ariaLabelClose: \"Zatvori verifikaciju\"\n },\n cs: {\n exitTitle: \"Opravdu chcete odejít?\",\n exitMessage: \"Když odejdete, proces ověření se přeruší. Opravdu chcete skončit?\",\n continueButton: \"Zůstat\",\n exitButton: \"Odejít\",\n ariaLabelModal: \"Ověření Didit\",\n ariaLabelClose: \"Zavřít ověření\"\n },\n da: {\n exitTitle: \"Forlad verifikation?\",\n exitMessage: \"Hvis du forlader, afsluttes din verifikationsproces. Er du sikker?\",\n continueButton: \"Fortsæt\",\n exitButton: \"Forlad\",\n ariaLabelModal: \"Didit-verifikation\",\n ariaLabelClose: \"Luk verifikation\"\n },\n de: {\n exitTitle: \"Verifizierung verlassen?\",\n exitMessage: \"Das Verlassen beendet Ihren Verifizierungsprozess. Sind Sie sicher?\",\n continueButton: \"Fortfahren\",\n exitButton: \"Verlassen\",\n ariaLabelModal: \"Didit-Verifizierung\",\n ariaLabelClose: \"Verifizierung schließen\"\n },\n el: {\n exitTitle: \"Έξοδος από την επαλήθευση;\",\n exitMessage: \"Η έξοδος θα τερματίσει τη διαδικασία επαλήθευσης. Είστε σίγουροι;\",\n continueButton: \"Συνέχεια\",\n exitButton: \"Έξοδος\",\n ariaLabelModal: \"Επαλήθευση Didit\",\n ariaLabelClose: \"Κλείσιμο επαλήθευσης\"\n },\n en: EN,\n es: {\n exitTitle: \"¿Salir de la verificación?\",\n exitMessage: \"Salir terminará tu proceso de verificación. ¿Estás seguro?\",\n continueButton: \"Continuar\",\n exitButton: \"Salir\",\n ariaLabelModal: \"Verificación Didit\",\n ariaLabelClose: \"Cerrar verificación\"\n },\n et: {\n exitTitle: \"Lahkuda kinnitamisest?\",\n exitMessage: \"Lahkumine lõpetab teie kinnitamisprotsessi. Kas olete kindel?\",\n continueButton: \"Jätka\",\n exitButton: \"Lahku\",\n ariaLabelModal: \"Didit kinnitus\",\n ariaLabelClose: \"Sulge kinnitus\"\n },\n fa: {\n exitTitle: \"خروج از تأیید هویت؟\",\n exitMessage: \"خروج باعث پایان فرآیند تأیید هویت شما میشود. آیا مطمئن هستید؟\",\n continueButton: \"ادامه\",\n exitButton: \"خروج\",\n ariaLabelModal: \"تأیید هویت Didit\",\n ariaLabelClose: \"بستن تأیید هویت\"\n },\n fi: {\n exitTitle: \"Poistu vahvistuksesta?\",\n exitMessage: \"Poistuminen päättää vahvistusprosessisi. Oletko varma?\",\n continueButton: \"Jatka\",\n exitButton: \"Poistu\",\n ariaLabelModal: \"Didit-vahvistus\",\n ariaLabelClose: \"Sulje vahvistus\"\n },\n fr: {\n exitTitle: \"Quitter la vérification ?\",\n exitMessage: \"Quitter mettra fin à votre processus de vérification. Êtes-vous sûr ?\",\n continueButton: \"Continuer\",\n exitButton: \"Quitter\",\n ariaLabelModal: \"Vérification Didit\",\n ariaLabelClose: \"Fermer la vérification\"\n },\n he: {\n exitTitle: \"לצאת מהאימות?\",\n exitMessage: \"יציאה תסיים את תהליך האימות שלך. האם אתה בטוח?\",\n continueButton: \"המשך\",\n exitButton: \"יציאה\",\n ariaLabelModal: \"אימות Didit\",\n ariaLabelClose: \"סגירת אימות\"\n },\n hi: {\n exitTitle: \"सत्यापन से बाहर निकलें?\",\n exitMessage: \"बाहर निकलने से आपकी सत्यापन प्रक्रिया समाप्त हो जाएगी। क्या आप सुनिश्चित हैं?\",\n continueButton: \"जारी रखें\",\n exitButton: \"बाहर निकलें\",\n ariaLabelModal: \"Didit सत्यापन\",\n ariaLabelClose: \"सत्यापन बंद करें\"\n },\n hr: {\n exitTitle: \"Izaći iz verifikacije?\",\n exitMessage: \"Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?\",\n continueButton: \"Nastavi\",\n exitButton: \"Izađi\",\n ariaLabelModal: \"Didit verifikacija\",\n ariaLabelClose: \"Zatvori verifikaciju\"\n },\n hu: {\n exitTitle: \"Kilépés az ellenőrzésből?\",\n exitMessage: \"A kilépés befejezi az ellenőrzési folyamatot. Biztos benne?\",\n continueButton: \"Folytatás\",\n exitButton: \"Kilépés\",\n ariaLabelModal: \"Didit ellenőrzés\",\n ariaLabelClose: \"Ellenőrzés bezárása\"\n },\n hy: {\n exitTitle: \"Դուրս գա՞լ ստուգումից\",\n exitMessage: \"Դուրս գալը կավարտի ձեր ստուգման գործընթացը։ Համոզված ե՞ք?\",\n continueButton: \"Շարունակել\",\n exitButton: \"Դուրս գալ\",\n ariaLabelModal: \"Didit ստուգում\",\n ariaLabelClose: \"Փակել ստուգումը\"\n },\n id: {\n exitTitle: \"Keluar dari verifikasi?\",\n exitMessage: \"Keluar akan mengakhiri proses verifikasi Anda. Apakah Anda yakin?\",\n continueButton: \"Lanjutkan\",\n exitButton: \"Keluar\",\n ariaLabelModal: \"Verifikasi Didit\",\n ariaLabelClose: \"Tutup verifikasi\"\n },\n it: {\n exitTitle: \"Uscire dalla verifica?\",\n exitMessage: \"L'uscita terminerà il processo di verifica. Sei sicuro?\",\n continueButton: \"Continua\",\n exitButton: \"Esci\",\n ariaLabelModal: \"Verifica Didit\",\n ariaLabelClose: \"Chiudi verifica\"\n },\n ja: {\n exitTitle: \"認証を終了しますか?\",\n exitMessage: \"終了すると認証プロセスが中断されます。よろしいですか?\",\n continueButton: \"続ける\",\n exitButton: \"終了\",\n ariaLabelModal: \"Didit 認証\",\n ariaLabelClose: \"認証を閉じる\"\n },\n ka: {\n exitTitle: \"გამოსვლა შემოწმებიდან?\",\n exitMessage: \"გამოსვლა დაასრულებს თქვენს შემოწმების პროცესს. დარწმუნებული ხართ?\",\n continueButton: \"გაგრძელება\",\n exitButton: \"გამოსვლა\",\n ariaLabelModal: \"Didit შემოწმება\",\n ariaLabelClose: \"შემოწმების დახურვა\"\n },\n kk: {\n exitTitle: \"Растаудан шығасыз ба?\",\n exitMessage: \"Шығу растау процесін аяқтайды. Сенімдісіз бе?\",\n continueButton: \"Жалғастыру\",\n exitButton: \"Шығу\",\n ariaLabelModal: \"Didit растауы\",\n ariaLabelClose: \"Растауды жабу\"\n },\n ko: {\n exitTitle: \"인증을 종료하시겠습니까?\",\n exitMessage: \"종료하면 인증 절차가 중단됩니다. 확실하십니까?\",\n continueButton: \"계속\",\n exitButton: \"종료\",\n ariaLabelModal: \"Didit 인증\",\n ariaLabelClose: \"인증 닫기\"\n },\n ky: {\n exitTitle: \"Текшерүүдөн чыгасызбы?\",\n exitMessage: \"Чыгуу текшерүү процессин токтотот. Ишенесизби?\",\n continueButton: \"Улантуу\",\n exitButton: \"Чыгуу\",\n ariaLabelModal: \"Didit текшерүүсү\",\n ariaLabelClose: \"Текшерүүнү жабуу\"\n },\n lt: {\n exitTitle: \"Išeiti iš patvirtinimo?\",\n exitMessage: \"Išėjimas nutrauks jūsų patvirtinimo procesą. Ar esate tikri?\",\n continueButton: \"Tęsti\",\n exitButton: \"Išeiti\",\n ariaLabelModal: \"Didit patvirtinimas\",\n ariaLabelClose: \"Uždaryti patvirtinimą\"\n },\n lv: {\n exitTitle: \"Iziet no verifikācijas?\",\n exitMessage: \"Iziešana pārtrauks jūsu verifikācijas procesu. Vai esat pārliecināts?\",\n continueButton: \"Turpināt\",\n exitButton: \"Iziet\",\n ariaLabelModal: \"Didit verifikācija\",\n ariaLabelClose: \"Aizvērt verifikāciju\"\n },\n mk: {\n exitTitle: \"Излези од верификацијата?\",\n exitMessage: \"Излегувањето ќе го прекине процесот на верификација. Дали сте сигурни?\",\n continueButton: \"Продолжи\",\n exitButton: \"Излези\",\n ariaLabelModal: \"Верификација Didit\",\n ariaLabelClose: \"Затвори верификација\"\n },\n mn: {\n exitTitle: \"Баталгаажуулалтаас гарах уу?\",\n exitMessage: \"Гарвал таны баталгаажуулалтын процесс дуусна. Та итгэлтэй байна уу?\",\n continueButton: \"Үргэлжлүүлэх\",\n exitButton: \"Гарах\",\n ariaLabelModal: \"Didit баталгаажуулалт\",\n ariaLabelClose: \"Баталгаажуулалтыг хаах\"\n },\n ms: {\n exitTitle: \"Keluar dari pengesahan?\",\n exitMessage: \"Keluar akan menamatkan proses pengesahan anda. Adakah anda pasti?\",\n continueButton: \"Teruskan\",\n exitButton: \"Keluar\",\n ariaLabelModal: \"Pengesahan Didit\",\n ariaLabelClose: \"Tutup pengesahan\"\n },\n nl: {\n exitTitle: \"Verificatie verlaten?\",\n exitMessage: \"Verlaten beëindigt uw verificatieproces. Weet u het zeker?\",\n continueButton: \"Doorgaan\",\n exitButton: \"Verlaten\",\n ariaLabelModal: \"Didit-verificatie\",\n ariaLabelClose: \"Verificatie sluiten\"\n },\n no: {\n exitTitle: \"Forlat verifisering?\",\n exitMessage: \"Å forlate vil avslutte verifiseringsprosessen. Er du sikker?\",\n continueButton: \"Fortsett\",\n exitButton: \"Forlat\",\n ariaLabelModal: \"Didit-verifisering\",\n ariaLabelClose: \"Lukk verifisering\"\n },\n pl: {\n exitTitle: \"Czy wyjść z weryfikacji?\",\n exitMessage: \"Wyjście zakończy proces weryfikacji. Czy na pewno?\",\n continueButton: \"Kontynuuj\",\n exitButton: \"Wyjdź\",\n ariaLabelModal: \"Weryfikacja Didit\",\n ariaLabelClose: \"Zamknij weryfikację\"\n },\n \"pt-BR\": {\n exitTitle: \"Sair da verificação?\",\n exitMessage: \"Sair encerrará seu processo de verificação. Tem certeza?\",\n continueButton: \"Continuar\",\n exitButton: \"Sair\",\n ariaLabelModal: \"Verificação Didit\",\n ariaLabelClose: \"Fechar verificação\"\n },\n pt: {\n exitTitle: \"Sair da verificação?\",\n exitMessage: \"Sair terminará o seu processo de verificação. Tem a certeza?\",\n continueButton: \"Continuar\",\n exitButton: \"Sair\",\n ariaLabelModal: \"Verificação Didit\",\n ariaLabelClose: \"Fechar verificação\"\n },\n ro: {\n exitTitle: \"Ieși din verificare?\",\n exitMessage: \"Ieșirea va încheia procesul de verificare. Ești sigur?\",\n continueButton: \"Continuă\",\n exitButton: \"Ieși\",\n ariaLabelModal: \"Verificare Didit\",\n ariaLabelClose: \"Închide verificarea\"\n },\n ru: {\n exitTitle: \"Выйти из верификации?\",\n exitMessage: \"Выход завершит процесс верификации. Вы уверены?\",\n continueButton: \"Продолжить\",\n exitButton: \"Выйти\",\n ariaLabelModal: \"Верификация Didit\",\n ariaLabelClose: \"Закрыть верификацию\"\n },\n sk: {\n exitTitle: \"Opustiť overenie?\",\n exitMessage: \"Odchodom ukončíte proces overenia. Ste si istí?\",\n continueButton: \"Pokračovať\",\n exitButton: \"Odísť\",\n ariaLabelModal: \"Overenie Didit\",\n ariaLabelClose: \"Zavrieť overenie\"\n },\n sl: {\n exitTitle: \"Zapustiti preverjanje?\",\n exitMessage: \"Izhod bo prekinil postopek preverjanja. Ali ste prepričani?\",\n continueButton: \"Nadaljuj\",\n exitButton: \"Izhod\",\n ariaLabelModal: \"Preverjanje Didit\",\n ariaLabelClose: \"Zapri preverjanje\"\n },\n so: {\n exitTitle: \"Ka baxdo xaqiijinta?\",\n exitMessage: \"Ka bixitaanku wuxuu dhammayn doonaa habka xaqiijintaada. Ma hubtaa?\",\n continueButton: \"Sii wad\",\n exitButton: \"Ka bax\",\n ariaLabelModal: \"Xaqiijinta Didit\",\n ariaLabelClose: \"Xir xaqiijinta\"\n },\n sq: {\n exitTitle: \"Dilni nga verifikimi?\",\n exitMessage: \"Dalja do të përfundojë procesin tuaj të verifikimit. A jeni të sigurt?\",\n continueButton: \"Vazhdo\",\n exitButton: \"Dil\",\n ariaLabelModal: \"Verifikimi Didit\",\n ariaLabelClose: \"Mbyll verifikimin\"\n },\n sr: {\n exitTitle: \"Изаћи из верификације?\",\n exitMessage: \"Изласком ћете прекинути процес верификације. Да ли сте сигурни?\",\n continueButton: \"Настави\",\n exitButton: \"Изађи\",\n ariaLabelModal: \"Верификација Didit\",\n ariaLabelClose: \"Затвори верификацију\"\n },\n sv: {\n exitTitle: \"Lämna verifiering?\",\n exitMessage: \"Att lämna avslutar din verifieringsprocess. Är du säker?\",\n continueButton: \"Fortsätt\",\n exitButton: \"Lämna\",\n ariaLabelModal: \"Didit-verifiering\",\n ariaLabelClose: \"Stäng verifiering\"\n },\n th: {\n exitTitle: \"ออกจากการยืนยันตัวตน?\",\n exitMessage: \"การออกจะสิ้นสุดกระบวนการยืนยันตัวตนของคุณ คุณแน่ใจหรือไม่?\",\n continueButton: \"ดำเนินการต่อ\",\n exitButton: \"ออก\",\n ariaLabelModal: \"การยืนยันตัวตน Didit\",\n ariaLabelClose: \"ปิดการยืนยันตัวตน\"\n },\n tr: {\n exitTitle: \"Doğrulamadan çıkmak istiyor musunuz?\",\n exitMessage: \"Çıkış, doğrulama sürecinizi sonlandıracak. Emin misiniz?\",\n continueButton: \"Devam et\",\n exitButton: \"Çıkış\",\n ariaLabelModal: \"Didit doğrulama\",\n ariaLabelClose: \"Doğrulamayı kapat\"\n },\n uk: {\n exitTitle: \"Вийти з верифікації?\",\n exitMessage: \"Вихід завершить процес верифікації. Ви впевнені?\",\n continueButton: \"Продовжити\",\n exitButton: \"Вийти\",\n ariaLabelModal: \"Верифікація Didit\",\n ariaLabelClose: \"Закрити верифікацію\"\n },\n uz: {\n exitTitle: \"Tekshiruvdan chiqasizmi?\",\n exitMessage: \"Chiqish tekshiruv jarayonini tugatadi. Ishonchingiz komilmi?\",\n continueButton: \"Davom etish\",\n exitButton: \"Chiqish\",\n ariaLabelModal: \"Didit tekshiruvi\",\n ariaLabelClose: \"Tekshiruvni yopish\"\n },\n vi: {\n exitTitle: \"Thoát khỏi xác minh?\",\n exitMessage: \"Thoát sẽ kết thúc quá trình xác minh của bạn. Bạn có chắc không?\",\n continueButton: \"Tiếp tục\",\n exitButton: \"Thoát\",\n ariaLabelModal: \"Xác minh Didit\",\n ariaLabelClose: \"Đóng xác minh\"\n },\n \"zh-CN\": {\n exitTitle: \"退出验证?\",\n exitMessage: \"退出将结束您的验证流程。确定要退出吗?\",\n continueButton: \"继续\",\n exitButton: \"退出\",\n ariaLabelModal: \"Didit 验证\",\n ariaLabelClose: \"关闭验证\"\n },\n \"zh-TW\": {\n exitTitle: \"退出驗證?\",\n exitMessage: \"退出將結束您的驗證流程。確定要退出嗎?\",\n continueButton: \"繼續\",\n exitButton: \"退出\",\n ariaLabelModal: \"Didit 驗證\",\n ariaLabelClose: \"關閉驗證\"\n },\n zh: {\n exitTitle: \"退出验证?\",\n exitMessage: \"退出将结束您的验证流程。确定要退出吗?\",\n continueButton: \"继续\",\n exitButton: \"退出\",\n ariaLabelModal: \"Didit 验证\",\n ariaLabelClose: \"关闭验证\"\n }\n};\n\nexport function getTranslations(language: string): ModalTranslations {\n return translationsMap[language] ?? EN;\n}\n","import type { DiditSdkConfiguration, VerificationEvent } from \"./types\";\nimport { DEFAULT_CONFIG, CSS_CLASSES, IFRAME_ALLOW, LAYOUT_MESSAGE_TYPE } from \"./constants\";\nimport { SDKLogger, generateModalId, isAllowedOrigin, detectLanguageFromUrl, isRtlLanguage } from \"./utils\";\nimport { getTranslations } from \"./translations\";\n\nexport interface ModalState {\n isOpen: boolean;\n isLoading: boolean;\n showConfirmation: boolean;\n}\n\nexport interface ModalCallbacks {\n onClose: () => void;\n onCloseConfirmed: () => void;\n onMessage: (event: VerificationEvent) => void;\n onIframeLoad: () => void;\n}\n\nexport type FlowKind = \"handoff\" | \"step\";\n\n/** Until the flow reports its first layout the modal waits (hidden) at the size the handoff card needs. */\ntype ModalKind = FlowKind | \"pending\";\n\n/** The length of the one animation when the flow moves from the handoff card to a step or back. */\nconst SIZE_ANIMATION_MS = 300;\n\n/** How long the modal waits for the first layout before it shows at step size, so it can never hang. */\nexport const FIRST_LAYOUT_TIMEOUT_MS = 3000;\n\n/** The layout the hosted flow reports in a didit:layout message. */\nexport interface FlowLayout {\n /**\n * What the flow is showing: the computer handoff card, or a step (phone-sized). A flow that does\n * not say gets \"step\", the size every earlier version of the modal used.\n */\n kind: FlowKind;\n /** Height of the flow's content in CSS pixels, its top bar included. */\n contentHeight: number;\n colorScheme: \"light\" | \"dark\";\n dir: \"ltr\" | \"rtl\";\n /** Height of the strip the flow shows above its top bar (a sandbox session's), in CSS pixels; 0 without one. */\n topInset: number;\n}\n\n/** A strip is a line or two of text: a taller value is not one, and would push the close button out of reach. */\nconst MAX_TOP_INSET = 160;\n\n/** The inline scroll styles a modal overrides to lock the page, as they were before. */\ninterface PageScrollLock {\n holders: Set<VerificationModal>;\n root: { overflow: string; overscrollBehavior: string };\n /** Only set when the page scrolls its body rather than the window, so the body was locked too. */\n body: { overflow: string } | null;\n}\n\n/** The page's background colours before any modal lent it a ground, and each modal's ground. */\ninterface PageBackground {\n saved: { root: string; body: string };\n grounds: Map<VerificationModal, FlowLayout[\"colorScheme\"]>;\n}\n\n/** The flow's ground (site-ground in the design system), which a full-screen modal paints the page with. */\nconst FLOW_GROUND = { light: \"#ffffff\", dark: \"#0b0b0d\" } as const;\n\nexport class VerificationModal {\n /**\n * Every currently-open modal, oldest first. Used so a single Escape\n * keypress (or other document-level shortcut) only acts on the topmost\n * modal when multiple VerificationModal instances are open at once (e.g.\n * a transaction action modal stacked over the verification modal).\n */\n private static openModals: VerificationModal[] = [];\n\n private modalId: string;\n private config: Required<Pick<DiditSdkConfiguration, \"zIndex\" | \"showCloseButton\" | \"showExitConfirmation\">>;\n private callbacks: ModalCallbacks;\n private state: ModalState = {\n isOpen: false,\n isLoading: true,\n showConfirmation: false\n };\n\n private overlay: HTMLDivElement | null = null;\n private container: HTMLDivElement | null = null;\n private iframe: HTMLIFrameElement | null = null;\n private loadingEl: HTMLDivElement | null = null;\n private confirmOverlay: HTMLDivElement | null = null;\n private confirmationTrigger: HTMLElement | null = null;\n private containerElement: HTMLElement;\n\n private boundHandleMessage: ((event: MessageEvent) => void) | null = null;\n private boundHandleKeydown: ((event: KeyboardEvent) => void) | null = null;\n private boundHandleFocusChange: (() => void) | null = null;\n private confirmationFocusTimeout: number | null = null;\n private firstLayoutTimeout: number | null = null;\n private sizeTimeout: number | null = null;\n\n private embedded: boolean = false;\n private embeddedContainer: HTMLElement | null = null;\n private language: string = \"en\";\n\n /**\n * The page's own background colours, kept while full-screen modals lend it their ground, shared by\n * every open modal: the topmost one's ground shows and the last one to give it back restores them.\n */\n private static pageBackground: PageBackground | null = null;\n /**\n * The page's scroll styles from before the first open modal locked them, shared by every open\n * modal: the last one to close gives them back.\n */\n private static pageScrollLock: PageScrollLock | null = null;\n /** The ground below the layout viewport (see showCurtain), while this modal is open. */\n private curtain: HTMLDivElement | null = null;\n private boundPlaceCurtain: (() => void) | null = null;\n\n constructor(configuration: DiditSdkConfiguration | undefined, callbacks: ModalCallbacks) {\n this.modalId = generateModalId();\n this.config = {\n zIndex: configuration?.zIndex ?? DEFAULT_CONFIG.zIndex,\n showCloseButton: configuration?.showCloseButton ?? DEFAULT_CONFIG.showCloseButton,\n showExitConfirmation: configuration?.showExitConfirmation ?? DEFAULT_CONFIG.showExitConfirmation\n };\n this.callbacks = callbacks;\n this.containerElement = configuration?.containerElement ?? document.body;\n this.embedded = configuration?.embedded ?? false;\n if (this.embedded && configuration?.embeddedContainerId) {\n this.embeddedContainer = document.getElementById(configuration.embeddedContainerId);\n }\n }\n\n private injectStyles(): void {\n const styleId = \"didit-sdk-styles\";\n if (document.getElementById(styleId)) {\n return;\n }\n\n const styles = document.createElement(\"style\");\n styles.id = styleId;\n styles.textContent = `\n .${CSS_CLASSES.overlay} {\n display: none;\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n z-index: ${this.config.zIndex};\n justify-content: center;\n align-items: center;\n padding: 1rem;\n opacity: 0;\n transition: opacity 0.2s ease-out;\n }\n\n .${CSS_CLASSES.overlay}.active {\n display: flex;\n opacity: 1;\n }\n\n .${CSS_CLASSES.container} {\n position: relative;\n width: 100%;\n max-width: 440px;\n height: min(860px, calc(100vh - 2rem));\n height: min(860px, calc(100dvh - 2rem));\n border-radius: 16px;\n overflow: hidden;\n background: transparent;\n }\n\n .${CSS_CLASSES.overlay}.active .${CSS_CLASSES.container} {\n transform: scale(1);\n }\n\n .${CSS_CLASSES.iframe} {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n }\n\n .${CSS_CLASSES.closeButton} {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 24px;\n height: 24px;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n z-index: 10;\n outline: none;\n }\n\n .${CSS_CLASSES.closeButton}:hover,\n .${CSS_CLASSES.closeButton}:focus {\n background: transparent;\n opacity: 0.5;\n }\n\n .${CSS_CLASSES.closeButton} svg {\n stroke: #666;\n stroke-width: 2;\n stroke-linecap: round;\n }\n\n .${CSS_CLASSES.loading} {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n /* The flow's ground, so a phone's loader meets the ground below the viewport without a seam. */\n background: ${FLOW_GROUND.light};\n z-index: 5;\n }\n\n @media (prefers-color-scheme: dark) {\n .${CSS_CLASSES.loading} {\n background: ${FLOW_GROUND.dark};\n }\n }\n\n .${CSS_CLASSES.loading}.hidden {\n display: none;\n }\n\n .${CSS_CLASSES.loading} svg {\n width: 4rem;\n height: 4rem;\n animation: didit-spin 1s linear infinite;\n }\n\n .${CSS_CLASSES.loading} circle {\n stroke: #e5e5e5;\n stroke-width: 2.5;\n fill: none;\n }\n\n .${CSS_CLASSES.loading} path {\n stroke: #525252;\n stroke-width: 2.5;\n stroke-linecap: round;\n fill: none;\n }\n\n @keyframes didit-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n .${CSS_CLASSES.confirmOverlay} {\n display: none;\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 20;\n justify-content: center;\n align-items: center;\n opacity: 0;\n transition: opacity 0.15s ease-out;\n }\n\n .${CSS_CLASSES.confirmOverlay}.active {\n display: flex;\n opacity: 1;\n }\n\n .${CSS_CLASSES.confirmBox} {\n background: #fff;\n border-radius: 12px;\n padding: 1.5rem;\n text-align: center;\n max-width: 300px;\n margin: 1rem;\n transform: scale(0.95);\n transition: transform 0.15s ease-out;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n outline: none;\n }\n\n .${CSS_CLASSES.confirmOverlay}.active .${CSS_CLASSES.confirmBox} {\n transform: scale(1);\n }\n\n .${CSS_CLASSES.confirmBox} h3 {\n color: #1a1a2e;\n margin: 0 0 0.5rem 0;\n font-size: 1.125rem;\n font-weight: 600;\n }\n\n .${CSS_CLASSES.confirmBox} p {\n color: #666;\n font-size: 0.875rem;\n margin: 0 0 1.25rem 0;\n line-height: 1.5;\n }\n\n .didit-confirm-actions {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 1rem;\n }\n\n .didit-confirm-actions [data-action=\"continue\"] {\n background: #2563eb;\n color: #fff;\n border: none;\n padding: 0.625rem 1.25rem;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s ease;\n }\n\n .didit-confirm-actions [data-action=\"continue\"]:hover {\n background: #1d4ed8;\n }\n\n .didit-confirm-actions [data-action=\"exit\"] {\n background: transparent;\n border: none;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n color: #666;\n font-size: 0.875rem;\n cursor: pointer;\n padding: 0.625rem;\n transition: color 0.15s ease;\n }\n\n .didit-confirm-actions [data-action=\"exit\"]:hover {\n color: #1a1a2e;\n }\n\n .didit-confirm-actions button:focus-visible {\n outline: 2px solid #2567ff;\n outline-offset: 2px;\n }\n\n /*\n * Steps are phone-sized (440 x 860, above). On a computer the handoff card is wider\n * (board Start-Embedded): 960 x 660 on a window of 1000px or more, never wider than the\n * window less its margin and never taller than 90% of it. In a narrower window the\n * page stacks and the height follows its content (--didit-content-height, set from the\n * flow's layout message). Until the flow reports what it shows, the modal is the handoff\n * card at its final size with the spinner inside it (the flow stays hidden and lays itself\n * out for that size): it never opens small and grows. The first change of kind (a step\n * instead of the handoff, or the person continues on this computer) animates once.\n */\n @media (min-width: 541px) {\n .${CSS_CLASSES.container}[data-didit-kind=\"handoff\"],\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] {\n max-width: min(960px, calc(100vw - 2rem));\n height: min(var(--didit-content-height, 660px), calc(100vh * 0.9));\n height: min(var(--didit-content-height, 660px), calc(100dvh * 0.9));\n }\n\n .${CSS_CLASSES.container}.${CSS_CLASSES.sizeAnimated} {\n transition: max-width 0.25s ease, height 0.25s ease;\n }\n\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] .${CSS_CLASSES.iframe} {\n visibility: hidden;\n }\n }\n\n /*\n * While pending the card already looks like the first screen (ground, radius, shadow and\n * close button come from the flow-sized rules below, with the device theme); the loader\n * sits inside it on the card's own ground.\n */\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] .${CSS_CLASSES.loading} {\n background: transparent;\n }\n\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"][data-didit-theme=\"dark\"] .${CSS_CLASSES.loading} circle {\n stroke: rgba(255, 255, 255, 0.16);\n }\n\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"][data-didit-theme=\"dark\"] .${CSS_CLASSES.loading} path {\n stroke: #f5f5f7;\n }\n\n @media (min-width: 1000px) {\n .${CSS_CLASSES.container}[data-didit-kind=\"handoff\"],\n .${CSS_CLASSES.container}[data-didit-kind=\"pending\"] {\n height: min(660px, calc(100vh * 0.9));\n height: min(660px, calc(100dvh * 0.9));\n }\n }\n\n @media (max-width: 540px) {\n .${CSS_CLASSES.overlay} {\n padding: 0;\n }\n\n .${CSS_CLASSES.container} {\n max-width: 100%;\n height: 100vh;\n height: 100dvh;\n border-radius: 0;\n }\n }\n\n /*\n * The flow's ground right below the layout viewport, in the page itself (see showCurtain):\n * on a phone, iOS browsers with their toolbars collapsed show a band of the page there,\n * below every fixed element, the full-screen modal included.\n */\n .${CSS_CLASSES.curtain} {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n margin: 0;\n pointer-events: none;\n /* Under the modal where they meet for a frame while the toolbars move, above the page. */\n z-index: ${this.config.zIndex - 1};\n background: ${FLOW_GROUND.light};\n }\n\n .${CSS_CLASSES.curtain}[data-didit-theme=\"dark\"] {\n background: ${FLOW_GROUND.dark};\n }\n\n /* The exit confirmation's dimming continues over the ground below the viewport. */\n .${CSS_CLASSES.curtain}[data-didit-dimmed] {\n background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));\n }\n\n @media (max-width: 540px) {\n .${CSS_CLASSES.curtain} {\n display: block;\n }\n }\n\n /*\n * The hosted flow's layout message (didit:layout) brings the modal's size\n * (see above), theme and direction. Colours are the design system tokens\n * named beside them.\n */\n .${CSS_CLASSES.container}.${CSS_CLASSES.flowSized} {\n --didit-ground: #ffffff; /* site-ground */\n --didit-heading: #1a1a1a; /* c-heading */\n --didit-accent: #2567ff; /* c-accent */\n --didit-hover: rgba(120, 120, 128, 0.08); /* c-hover */\n --didit-close-fill: rgba(0, 0, 0, 0.06);\n --didit-drop: rgba(17, 24, 39, 0.35);\n --didit-ring: rgba(0, 0, 0, 0.06);\n background: var(--didit-ground);\n box-shadow: 0 30px 80px -24px var(--didit-drop), 0 0 0 1px var(--didit-ring);\n }\n\n .${CSS_CLASSES.container}.${CSS_CLASSES.flowSized}[data-didit-theme=\"dark\"] {\n --didit-ground: #0b0b0d;\n --didit-heading: #f5f5f7;\n --didit-accent: #4d8bff;\n --didit-hover: rgba(255, 255, 255, 0.06);\n --didit-close-fill: rgba(255, 255, 255, 0.06);\n --didit-drop: rgba(0, 0, 0, 0.55); /* c-shadow-pop, dark */\n --didit-ring: rgba(255, 255, 255, 0.08); /* c-shadow-pop, dark */\n }\n\n .${CSS_CLASSES.closeIcon} {\n display: none;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton} {\n top: calc(8px + var(--didit-top-inset, 0px));\n right: 8px;\n width: 44px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background: var(--didit-close-fill);\n color: var(--didit-heading);\n }\n\n .${CSS_CLASSES.flowSized}[data-didit-dir=\"rtl\"] .${CSS_CLASSES.closeButton} {\n right: auto;\n left: 8px;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:hover,\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:focus {\n background: var(--didit-close-fill);\n opacity: 1;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:hover {\n background-image: linear-gradient(var(--didit-hover), var(--didit-hover));\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton}:focus-visible {\n outline: 2px solid var(--didit-accent);\n outline-offset: 2px;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeIconLegacy} {\n display: none;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.closeButton} .${CSS_CLASSES.closeIcon} {\n display: block;\n stroke: currentColor;\n stroke-width: 1.75;\n stroke-linejoin: round;\n }\n\n /*\n * The exit confirmation is sized in rem, so with a large text size it\n * can be taller than a short flow: it scrolls inside the modal instead\n * of being clipped, and its width and actions follow a larger text size.\n * It never grows wider than the modal: a long word wraps instead.\n */\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.confirmOverlay} {\n padding: 1rem;\n overflow-y: auto;\n }\n\n .${CSS_CLASSES.flowSized} .${CSS_CLASSES.confirmBox} {\n min-width: 0;\n max-width: max(300px, 18.75rem);\n margin: auto;\n overflow-wrap: anywhere;\n /* Focusing the dialog scrolls it into view start-aligned; this keeps\n * the overlay's top padding visible so the title is never clipped. */\n scroll-margin-top: 1rem;\n }\n\n .${CSS_CLASSES.flowSized} .didit-confirm-actions {\n flex-wrap: wrap;\n }\n\n @media (max-width: 540px) {\n .${CSS_CLASSES.container}.${CSS_CLASSES.flowSized} {\n max-width: 100%;\n box-shadow: none;\n }\n }\n\n .${CSS_CLASSES.embedded} {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .${CSS_CLASSES.embedded} .${CSS_CLASSES.iframe} {\n width: 100%;\n height: 100%;\n max-height: none;\n }\n\n .${CSS_CLASSES.embedded} .${CSS_CLASSES.loading} {\n border-radius: 0;\n }\n `;\n\n document.head.appendChild(styles);\n }\n\n private createDOM(): void {\n this.injectStyles();\n\n if (this.embedded && this.embeddedContainer) {\n this.createEmbeddedDOM();\n return;\n }\n const t = getTranslations(this.language);\n\n this.overlay = document.createElement(\"div\");\n this.overlay.id = this.modalId;\n this.overlay.className = CSS_CLASSES.overlay;\n this.overlay.setAttribute(\"role\", \"dialog\");\n this.overlay.setAttribute(\"aria-modal\", \"true\");\n this.overlay.setAttribute(\"aria-label\", t.ariaLabelModal);\n\n this.container = document.createElement(\"div\");\n this.container.className = CSS_CLASSES.container;\n\n this.loadingEl = document.createElement(\"div\");\n this.loadingEl.className = CSS_CLASSES.loading;\n this.loadingEl.innerHTML = `\n <svg viewBox=\"0 0 24 24\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" />\n </svg>\n `;\n\n if (this.config.showCloseButton) {\n const closeBtn = document.createElement(\"button\");\n closeBtn.className = CSS_CLASSES.closeButton;\n closeBtn.setAttribute(\"aria-label\", t.ariaLabelClose);\n closeBtn.innerHTML = `\n <svg class=\"${CSS_CLASSES.closeIconLegacy}\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <line x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\" />\n <line x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\" />\n </svg>\n <svg class=\"${CSS_CLASSES.closeIcon}\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M7 7.03882L17 16.9611\" />\n <path d=\"M7.03968 17L16.9619 7\" />\n </svg>\n `;\n closeBtn.addEventListener(\"click\", () => this.handleCloseRequest(closeBtn));\n this.container.appendChild(closeBtn);\n }\n\n this.iframe = document.createElement(\"iframe\");\n this.iframe.className = CSS_CLASSES.iframe;\n this.iframe.setAttribute(\"allow\", IFRAME_ALLOW);\n this.iframe.setAttribute(\"title\", t.ariaLabelModal);\n this.iframe.addEventListener(\"load\", () => this.handleIframeLoad());\n\n this.confirmOverlay = document.createElement(\"div\");\n this.confirmOverlay.className = CSS_CLASSES.confirmOverlay;\n this.confirmOverlay.innerHTML = `\n <div class=\"${CSS_CLASSES.confirmBox}\" role=\"dialog\" aria-modal=\"true\" tabindex=\"-1\"\n aria-labelledby=\"${this.modalId}-exit-title\" aria-describedby=\"${this.modalId}-exit-message\">\n <h3 id=\"${this.modalId}-exit-title\">${t.exitTitle}</h3>\n <p id=\"${this.modalId}-exit-message\">${t.exitMessage}</p>\n <div class=\"didit-confirm-actions\">\n <button type=\"button\" data-action=\"continue\">${t.continueButton}</button>\n <button type=\"button\" data-action=\"exit\">${t.exitButton}</button>\n </div>\n </div>\n `;\n\n this.confirmOverlay.querySelector('[data-action=\"continue\"]')?.addEventListener(\"click\", () => {\n this.hideConfirmation();\n });\n this.confirmOverlay.querySelector('[data-action=\"exit\"]')?.addEventListener(\"click\", () => {\n this.confirmExit();\n });\n\n this.container.appendChild(this.loadingEl);\n this.container.appendChild(this.iframe);\n this.container.appendChild(this.confirmOverlay);\n this.overlay.appendChild(this.container);\n\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.handleCloseRequest();\n }\n });\n\n this.containerElement.appendChild(this.overlay);\n }\n\n private createEmbeddedDOM(): void {\n if (!this.embeddedContainer) return;\n\n this.container = document.createElement(\"div\");\n this.container.id = this.modalId;\n this.container.className = CSS_CLASSES.embedded;\n\n this.loadingEl = document.createElement(\"div\");\n this.loadingEl.className = CSS_CLASSES.loading;\n this.loadingEl.innerHTML = `\n <svg viewBox=\"0 0 24 24\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" />\n </svg>\n `;\n\n this.iframe = document.createElement(\"iframe\");\n this.iframe.className = CSS_CLASSES.iframe;\n this.iframe.setAttribute(\"allow\", IFRAME_ALLOW);\n this.iframe.setAttribute(\"title\", getTranslations(this.language).ariaLabelModal);\n this.iframe.addEventListener(\"load\", () => this.handleIframeLoad());\n\n this.container.appendChild(this.loadingEl);\n this.container.appendChild(this.iframe);\n this.embeddedContainer.appendChild(this.container);\n }\n\n private setupEventListeners(): void {\n // Idempotent: open() calls this every time it presents the modal, but a\n // modal that was already open (or re-opened without an intervening\n // close()) must not accumulate duplicate listeners.\n if (this.boundHandleMessage || this.boundHandleKeydown) {\n return;\n }\n\n this.boundHandleMessage = this.handleMessage.bind(this);\n window.addEventListener(\"message\", this.boundHandleMessage);\n\n this.boundHandleKeydown = this.handleKeydown.bind(this);\n document.addEventListener(\"keydown\", this.boundHandleKeydown);\n\n this.boundHandleFocusChange = () => {\n if (!this.state.showConfirmation || !this.isTopmost()) return;\n // An iframe can take focus without a focusin event in its parent document.\n // Wait until its focus transition finishes before moving focus back.\n if (this.confirmationFocusTimeout !== null) window.clearTimeout(this.confirmationFocusTimeout);\n this.confirmationFocusTimeout = window.setTimeout(() => {\n this.confirmationFocusTimeout = null;\n if (this.state.showConfirmation && this.isTopmost() && !this.confirmOverlay?.contains(document.activeElement)) {\n this.focusConfirmation();\n }\n }, 0);\n };\n document.addEventListener(\"focusin\", this.boundHandleFocusChange);\n document.addEventListener(\"focusout\", this.boundHandleFocusChange);\n window.addEventListener(\"blur\", this.boundHandleFocusChange);\n }\n\n private removeEventListeners(): void {\n if (this.boundHandleMessage) {\n window.removeEventListener(\"message\", this.boundHandleMessage);\n this.boundHandleMessage = null;\n }\n if (this.boundHandleKeydown) {\n document.removeEventListener(\"keydown\", this.boundHandleKeydown);\n this.boundHandleKeydown = null;\n }\n if (this.boundHandleFocusChange) {\n document.removeEventListener(\"focusin\", this.boundHandleFocusChange);\n document.removeEventListener(\"focusout\", this.boundHandleFocusChange);\n window.removeEventListener(\"blur\", this.boundHandleFocusChange);\n this.boundHandleFocusChange = null;\n }\n }\n\n private pushToTop(): void {\n const modals = VerificationModal.openModals;\n const existingIndex = modals.indexOf(this);\n if (existingIndex !== -1) {\n modals.splice(existingIndex, 1);\n }\n modals.push(this);\n }\n\n private removeFromStack(): void {\n const modals = VerificationModal.openModals;\n const existingIndex = modals.indexOf(this);\n if (existingIndex !== -1) {\n modals.splice(existingIndex, 1);\n }\n }\n\n private isTopmost(): boolean {\n const modals = VerificationModal.openModals;\n return modals.length > 0 && modals[modals.length - 1] === this;\n }\n\n private handleMessage(event: MessageEvent): void {\n if (!this.iframe?.src) return;\n if (!isAllowedOrigin(event.origin, this.iframe.src )) {\n return SDKLogger.warn(\"Received postMessage from unallowed origin:\", event.origin);\n }\n\n // Scope every message to this modal's own iframe. Without this check, a\n // second VerificationModal open at the same time (e.g. a transaction\n // action modal stacked over the verification modal) would also react to\n // postMessages meant for the other iframe.\n if (!this.iframe || event.source !== this.iframe.contentWindow) {\n return;\n }\n\n SDKLogger.log(\"Received postMessage:\", event.data);\n\n let messageData: VerificationEvent;\n try {\n if (typeof event.data === \"string\") {\n messageData = JSON.parse(event.data);\n } else {\n messageData = event.data;\n }\n } catch {\n SDKLogger.warn(\"Failed to parse postMessage:\", event.data);\n return;\n }\n\n if (messageData.type === \"didit:close_request\") {\n this.handleCloseRequest();\n return;\n }\n\n if ((messageData.type as string) === LAYOUT_MESSAGE_TYPE) {\n const layout = this.readFlowLayout(messageData.data);\n if (layout) {\n this.applyFlowLayout(layout);\n } else {\n SDKLogger.warn(\"Ignoring a layout message without a positive contentHeight:\", messageData.data);\n }\n return;\n }\n\n this.callbacks.onMessage(messageData);\n }\n\n /**\n * Reads a didit:layout message's data. Without a positive contentHeight the\n * message is ignored; a missing or unknown colorScheme follows the device,\n * a missing or unknown dir follows the verification URL's language, and the\n * close button keeps its place without a plausible topInset.\n */\n private readFlowLayout(data: unknown): FlowLayout | null {\n const fields = typeof data === \"object\" && data !== null ? (data as Record<string, unknown>) : {};\n const { contentHeight, colorScheme, dir, kind, topInset } = fields;\n if (typeof contentHeight !== \"number\" || !Number.isFinite(contentHeight) || contentHeight <= 0) {\n return null;\n }\n const prefersDark = window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ?? false;\n return {\n kind: kind === \"handoff\" ? \"handoff\" : \"step\",\n contentHeight: Math.ceil(contentHeight),\n colorScheme: colorScheme === \"light\" || colorScheme === \"dark\" ? colorScheme : prefersDark ? \"dark\" : \"light\",\n dir: dir === \"ltr\" || dir === \"rtl\" ? dir : isRtlLanguage(this.language) ? \"rtl\" : \"ltr\",\n topInset:\n typeof topInset === \"number\" && topInset > 0 && topInset <= MAX_TOP_INSET ? Math.ceil(topInset) : 0\n };\n }\n\n /** Embedded mode keeps filling the integrator's host element, whatever the flow reports. */\n private applyFlowLayout(layout: FlowLayout): void {\n if (this.embedded || !this.container) return;\n SDKLogger.log(\"Flow layout:\", layout);\n this.container.classList.add(CSS_CLASSES.flowSized);\n this.container.dataset.diditTheme = layout.colorScheme;\n this.container.dataset.diditDir = layout.dir;\n // The height the person sees now, before the reported content height can change it.\n const shownHeight = this.container.offsetHeight;\n this.container.style.setProperty(\"--didit-content-height\", `${layout.contentHeight}px`);\n // The close button sits under the flow's strip, over its top bar.\n this.container.style.setProperty(\"--didit-top-inset\", `${layout.topInset}px`);\n this.matchPageBackground(layout.colorScheme);\n if (this.curtain) this.curtain.dataset.diditTheme = layout.colorScheme;\n this.setModalKind(layout.kind, layout.kind === \"handoff\" && this.handoffHeight(layout) === shownHeight);\n }\n\n /** Whether the window is a computer-sized one: a phone is full screen and never waits for a layout. */\n private isPhoneWindow(): boolean {\n return window.matchMedia?.(\"(max-width: 540px)\").matches ?? false;\n }\n\n /** The height the handoff card takes for a layout, as the size rules above compute it (rounded like offsetHeight). */\n private handoffHeight(layout: FlowLayout): number {\n const cap = window.innerHeight * 0.9;\n return Math.round(Math.min(window.innerWidth >= 1000 ? 660 : layout.contentHeight, cap));\n }\n\n /**\n * Sets what the modal is sized for. Leaving \"pending\" shows the modal at its final size with no\n * transition; any later change animates once.\n */\n private setModalKind(kind: ModalKind, sizeUnchanged = false): void {\n if (!this.container) return;\n const previous = this.container.dataset.diditKind;\n if (previous === kind) return;\n if (this.firstLayoutTimeout !== null && kind !== \"pending\") {\n window.clearTimeout(this.firstLayoutTimeout);\n this.firstLayoutTimeout = null;\n }\n // Every change of kind animates, the pending card included (it is on screen), and only for the\n // length of the change, so resizing the window never lags behind.\n // Pending already is the handoff card: a handoff first layout of the same size moves nothing,\n // while a different reported height (a narrow window) animates the correction once.\n const staysPut = previous === \"pending\" && kind === \"handoff\" && sizeUnchanged;\n if (previous !== undefined && !staysPut) this.animateSizeOnce();\n this.container.dataset.diditKind = kind;\n // The final size is in place before the loader goes; a flow still loading keeps its loader.\n if (previous === \"pending\" && !this.state.isLoading) this.loadingEl?.classList.add(\"hidden\");\n }\n\n private animateSizeOnce(): void {\n this.container?.classList.add(CSS_CLASSES.sizeAnimated);\n if (this.sizeTimeout !== null) window.clearTimeout(this.sizeTimeout);\n this.sizeTimeout = window.setTimeout(() => {\n this.sizeTimeout = null;\n this.container?.classList.remove(CSS_CLASSES.sizeAnimated);\n }, SIZE_ANIMATION_MS);\n }\n\n /** A flow that reports no layout (an older one) still shows, at step size, after a short wait. */\n private waitForFirstLayout(): void {\n if (!this.container) return;\n // The card looks like the first screen from the first frame, in the device's theme.\n this.container.classList.add(CSS_CLASSES.flowSized);\n this.container.dataset.diditTheme = window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n this.setModalKind(\"pending\");\n this.firstLayoutTimeout = window.setTimeout(() => {\n this.firstLayoutTimeout = null;\n // A flow that never reported is an older one that paints itself: no card look around it.\n this.container?.classList.remove(CSS_CLASSES.flowSized);\n delete this.container?.dataset.diditTheme;\n this.setModalKind(\"step\");\n }, FIRST_LAYOUT_TIMEOUT_MS);\n }\n\n /**\n * On a phone Safari paints the bottom edge of the screen with the page's own background, past\n * any fixed overlay, and shows it when the keyboard moves the page. A full-screen modal lends\n * the page its ground colour while it is open, so no strip of the host page shows around it.\n */\n private matchPageBackground(colorScheme: FlowLayout[\"colorScheme\"]): void {\n if (!window.matchMedia?.(\"(max-width: 540px)\").matches) return;\n VerificationModal.pageBackground ??= {\n saved: { root: document.documentElement.style.backgroundColor, body: document.body.style.backgroundColor },\n grounds: new Map()\n };\n VerificationModal.pageBackground.grounds.set(this, colorScheme);\n VerificationModal.paintPageBackground();\n }\n\n private restorePageBackground(): void {\n const background = VerificationModal.pageBackground;\n if (!background?.grounds.delete(this)) return;\n if (background.grounds.size > 0) {\n VerificationModal.paintPageBackground();\n return;\n }\n VerificationModal.pageBackground = null;\n document.documentElement.style.backgroundColor = background.saved.root;\n document.body.style.backgroundColor = background.saved.body;\n }\n\n /** The page shows the ground of the topmost open modal that lends one. */\n private static paintPageBackground(): void {\n const background = VerificationModal.pageBackground;\n if (!background) return;\n const lender = [...VerificationModal.openModals].reverse().find((modal) => background.grounds.has(modal));\n const colorScheme = lender ? background.grounds.get(lender) : [...background.grounds.values()].pop();\n if (!colorScheme) return;\n document.documentElement.style.backgroundColor = FLOW_GROUND[colorScheme];\n document.body.style.backgroundColor = FLOW_GROUND[colorScheme];\n }\n\n /**\n * Stops the page scrolling under the modal. The lock is on the root element: Chrome for iOS keeps\n * scrolling a page whose body alone is `overflow: hidden` (a swipe over the modal scrolls the page\n * and toggles the browser's toolbars), and stops only when the root element is. A page that\n * scrolls its body instead of the window has its body locked too. The first modal to open keeps\n * the page's own values and the last one to close gives them back.\n */\n private lockPageScroll(): void {\n const lock = VerificationModal.pageScrollLock;\n if (lock) {\n lock.holders.add(this);\n return;\n }\n const root = document.documentElement;\n const body = document.body;\n // The body's overflow is the viewport's only while the root's is visible; otherwise a body with\n // an overflow of its own is a scroll container. Locking a body that is not one would clip the page\n // to the body's box.\n const clips = (overflow: string) => overflow !== \"\" && overflow !== \"visible\";\n const bodyScrollsItself =\n clips(window.getComputedStyle(root).overflowY) && clips(window.getComputedStyle(body).overflowY);\n VerificationModal.pageScrollLock = {\n holders: new Set([this]),\n root: { overflow: root.style.overflow, overscrollBehavior: root.style.overscrollBehavior },\n body: bodyScrollsItself ? { overflow: body.style.overflow } : null\n };\n root.style.overflow = \"hidden\";\n root.style.overscrollBehavior = \"none\";\n if (bodyScrollsItself) body.style.overflow = \"hidden\";\n }\n\n private unlockPageScroll(): void {\n const lock = VerificationModal.pageScrollLock;\n if (!lock || !lock.holders.delete(this) || lock.holders.size > 0) return;\n VerificationModal.pageScrollLock = null;\n const root = document.documentElement;\n root.style.overflow = lock.root.overflow;\n root.style.overscrollBehavior = lock.root.overscrollBehavior;\n if (lock.body) document.body.style.overflow = lock.body.overflow;\n }\n\n /**\n * On a phone, Chrome for iOS (and the other iOS browsers built on WebKit's web view) shows a band\n * of the page below the layout viewport while its toolbars are collapsed: the home indicator's\n * area, and more while the toolbars move. Fixed elements end at the layout viewport, so the\n * full-screen modal cannot cover it and the host page's own content showed under the flow. The\n * curtain is part of the page instead: right below the viewport, in the flow's ground, so that band\n * shows the modal's ground. The page cannot scroll while the modal is open (lockPageScroll), and the\n * curtain follows the viewport when it resizes. Only phone-sized windows draw it (see the styles).\n */\n private showCurtain(): void {\n if (!this.curtain) {\n const curtain = document.createElement(\"div\");\n curtain.className = CSS_CLASSES.curtain;\n curtain.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(curtain);\n this.curtain = curtain;\n this.boundPlaceCurtain = () => this.placeCurtain();\n window.addEventListener(\"resize\", this.boundPlaceCurtain);\n window.addEventListener(\"scroll\", this.boundPlaceCurtain);\n window.visualViewport?.addEventListener(\"resize\", this.boundPlaceCurtain);\n }\n // The device's theme until the newly loaded flow reports its own (applyFlowLayout).\n this.curtain.dataset.diditTheme = window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n this.placeCurtain();\n }\n\n /** Puts the curtain's top at the bottom of the layout viewport, whatever its containing block is. */\n private placeCurtain(): void {\n const curtain = this.curtain;\n if (!curtain) return;\n curtain.style.top = \"0px\";\n curtain.style.left = \"0px\";\n // At 0, 0 the curtain's box starts at its containing block's corner (the page's, or a positioned\n // body's), in viewport coordinates: the offset that brings its top to the viewport's bottom edge.\n const origin = curtain.getBoundingClientRect();\n curtain.style.top = `${window.innerHeight - origin.top}px`;\n curtain.style.left = `${-origin.left}px`;\n }\n\n private removeCurtain(): void {\n if (this.boundPlaceCurtain) {\n window.removeEventListener(\"resize\", this.boundPlaceCurtain);\n window.removeEventListener(\"scroll\", this.boundPlaceCurtain);\n window.visualViewport?.removeEventListener(\"resize\", this.boundPlaceCurtain);\n this.boundPlaceCurtain = null;\n }\n this.curtain?.remove();\n this.curtain = null;\n }\n\n /** Back to the neutral look until the newly loaded flow reports its theme and direction. */\n private resetFlowLayout(): void {\n if (this.embedded || !this.container) return;\n this.restorePageBackground();\n this.container.classList.remove(CSS_CLASSES.flowSized, CSS_CLASSES.sizeAnimated);\n delete this.container.dataset.diditTheme;\n delete this.container.dataset.diditDir;\n delete this.container.dataset.diditKind;\n this.container.style.removeProperty(\"--didit-content-height\");\n this.container.style.removeProperty(\"--didit-top-inset\");\n if (this.firstLayoutTimeout !== null) {\n window.clearTimeout(this.firstLayoutTimeout);\n this.firstLayoutTimeout = null;\n }\n if (this.sizeTimeout !== null) {\n window.clearTimeout(this.sizeTimeout);\n this.sizeTimeout = null;\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (!this.state.isOpen) return;\n\n // When multiple modals are open at once, only the topmost one should\n // react to a keypress aimed at it (e.g. Escape closing a stacked\n // transaction action modal must not also trigger the exit confirmation\n // of the verification modal underneath it).\n if (!this.isTopmost()) return;\n\n if (event.key === \"Tab\" && this.state.showConfirmation) {\n const buttons = Array.from(this.confirmOverlay?.querySelectorAll<HTMLButtonElement>(\"button\") ?? []);\n if (buttons.length) {\n event.preventDefault();\n const current = buttons.findIndex((button) => button === document.activeElement);\n const next = event.shiftKey\n ? (current <= 0 ? buttons.length - 1 : current - 1)\n : (current + 1) % buttons.length;\n buttons[next].focus();\n }\n return;\n }\n\n if (event.key === \"Escape\") {\n event.preventDefault();\n if (this.state.showConfirmation) {\n this.hideConfirmation();\n } else {\n this.handleCloseRequest();\n }\n }\n }\n\n private handleIframeLoad(): void {\n if (this.iframe?.src && this.iframe.src !== \"about:blank\") {\n this.state.isLoading = false;\n // A modal still waiting for its first layout keeps the loader over the hidden flow.\n if (this.container?.dataset.diditKind !== \"pending\") this.loadingEl?.classList.add(\"hidden\");\n this.callbacks.onIframeLoad();\n }\n }\n\n private handleCloseRequest(trigger?: HTMLElement): void {\n if (this.config.showExitConfirmation) {\n this.showConfirmation(trigger);\n } else {\n this.callbacks.onCloseConfirmed();\n }\n }\n\n private showConfirmation(trigger?: HTMLElement): void {\n if (!this.confirmOverlay || this.state.showConfirmation) return;\n const activeElement = document.activeElement;\n this.confirmationTrigger = trigger ?? (activeElement instanceof HTMLElement && activeElement !== document.body\n ? activeElement\n : this.container?.querySelector<HTMLButtonElement>(`.${CSS_CLASSES.closeButton}`) ?? this.iframe);\n this.state.showConfirmation = true;\n this.confirmOverlay.classList.add(\"active\");\n this.curtain?.setAttribute(\"data-didit-dimmed\", \"\");\n if (this.iframe) this.iframe.inert = true;\n const close = this.container?.querySelector<HTMLButtonElement>(`.${CSS_CLASSES.closeButton}`);\n if (close) close.inert = true;\n // A confirmation scrolled at a large text size opens again at its title.\n this.confirmOverlay.scrollTop = 0;\n if (this.isTopmost()) this.focusConfirmation();\n this.callbacks.onClose();\n }\n\n private focusConfirmation(): void {\n this.confirmOverlay?.querySelector<HTMLDivElement>(`.${CSS_CLASSES.confirmBox}`)?.focus({ preventScroll: true });\n }\n\n private hideConfirmation(restoreFocus = true): void {\n if (this.confirmationFocusTimeout !== null) {\n window.clearTimeout(this.confirmationFocusTimeout);\n this.confirmationFocusTimeout = null;\n }\n if (!this.state.showConfirmation) return;\n this.state.showConfirmation = false;\n this.confirmOverlay?.classList.remove(\"active\");\n this.curtain?.removeAttribute(\"data-didit-dimmed\");\n if (this.iframe) this.iframe.inert = false;\n const close = this.container?.querySelector<HTMLButtonElement>(`.${CSS_CLASSES.closeButton}`);\n if (close) close.inert = false;\n const trigger = this.confirmationTrigger;\n this.confirmationTrigger = null;\n if (restoreFocus && this.isTopmost() && trigger?.isConnected) {\n if (trigger === this.iframe) {\n // Firefox needs a browser task to reactivate an inert cross-origin frame.\n this.confirmationFocusTimeout = window.setTimeout(() => {\n this.confirmationFocusTimeout = null;\n if (this.state.isOpen && !this.state.showConfirmation && this.isTopmost() && trigger.isConnected) {\n trigger.focus({ preventScroll: true });\n }\n }, 0);\n } else {\n trigger.focus({ preventScroll: true });\n }\n }\n }\n\n private confirmExit(): void {\n this.hideConfirmation();\n this.callbacks.onCloseConfirmed();\n }\n\n open(verificationUrl: string): void {\n this.language = detectLanguageFromUrl(verificationUrl);\n\n if (!this.overlay && !this.container) {\n this.createDOM();\n }\n // Re-attach listeners every open() (idempotent) since close() now tears\n // them down; this lets the same instance be re-opened without a\n // destroy()/re-create cycle.\n this.setupEventListeners();\n\n SDKLogger.log(\"Opening with URL:\", verificationUrl);\n\n this.state.isLoading = true;\n this.hideConfirmation();\n this.loadingEl?.classList.remove(\"hidden\");\n this.resetFlowLayout();\n if (!this.embedded && !this.isPhoneWindow()) this.waitForFirstLayout();\n\n if (this.iframe) {\n this.iframe.src = verificationUrl;\n }\n\n this.state.isOpen = true;\n this.pushToTop();\n\n if (this.embedded) {\n return;\n }\n\n this.overlay?.classList.add(\"active\");\n // Idempotent: a re-open of a modal that is still open keeps its one hold on the lock, so\n // close() still gives the page back the values it had before any modal opened.\n this.lockPageScroll();\n this.showCurtain();\n }\n\n close(): void {\n SDKLogger.log(\"Closing\");\n\n this.hideConfirmation(false);\n this.state.isOpen = false;\n this.state.isLoading = true;\n this.state.showConfirmation = false;\n this.removeFromStack();\n this.removeEventListeners();\n this.resetFlowLayout();\n\n if (this.iframe) {\n this.iframe.src = \"about:blank\";\n }\n\n if (this.embedded) {\n return;\n }\n\n this.overlay?.classList.remove(\"active\");\n this.removeCurtain();\n this.unlockPageScroll();\n }\n\n destroy(): void {\n SDKLogger.log(\"Destroying\");\n\n this.close();\n this.removeEventListeners();\n\n if (this.embedded && this.container && this.container.parentNode) {\n this.container.parentNode.removeChild(this.container);\n } else if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n\n this.overlay = null;\n this.container = null;\n this.iframe = null;\n this.loadingEl = null;\n this.confirmOverlay = null;\n }\n\n isOpen(): boolean {\n return this.state.isOpen;\n }\n\n isLoading(): boolean {\n return this.state.isLoading;\n }\n}\n","import type {\n DiditTransactionDetails,\n DiditTransactionParticipant,\n DiditTransactionPayload,\n DiditTravelRuleDetails,\n SubmitTransactionResult,\n TransactionActionRequired,\n TransactionErrorType\n} from \"./types\";\n\nimport { buildFingerprintHeaders, getDeviceFingerprintPayload } from \"@didit-protocol/signals\";\n\nexport const DEFAULT_TRANSACTION_BASE_URL = \"https://verification.didit.me\";\n\nconst ACTION_POLL_INTERVAL_MS = 1500;\nconst ACTION_POLL_MAX_ATTEMPTS = 10;\n\nconst TRANSACTION_ERROR_MESSAGES: Record<TransactionErrorType, string> = {\n invalid_token: \"The transaction token is invalid.\",\n expired_token: \"The transaction token has expired.\",\n validation: \"The transaction payload failed validation.\",\n network: \"A network error occurred while contacting the Didit API.\"\n};\n\n/**\n * Typed error thrown by DiditSdk.submitTransaction.\n *\n * - \"invalid_token\": the X-Transaction-Token was rejected (missing, revoked, over max uses)\n * - \"expired_token\": the transaction token TTL has elapsed\n * - \"validation\": the payload failed validation; see fieldErrors for per-field details\n * - \"network\": the request could not complete or the API returned an unexpected error\n */\nexport class DiditTransactionError extends Error {\n public readonly type: TransactionErrorType;\n public readonly status?: number;\n public readonly fieldErrors?: Record<string, unknown>;\n\n constructor(\n type: TransactionErrorType,\n message?: string,\n options?: { status?: number; fieldErrors?: Record<string, unknown> }\n ) {\n super(message || TRANSACTION_ERROR_MESSAGES[type]);\n this.name = \"DiditTransactionError\";\n this.type = type;\n this.status = options?.status;\n this.fieldErrors = options?.fieldErrors;\n }\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction compact(record: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(record)) {\n if (value !== undefined) result[key] = value;\n }\n return result;\n}\n\nfunction mapDetails(details: DiditTransactionDetails): Record<string, unknown> {\n return compact({\n direction: details.direction,\n amount: details.amount,\n currency: details.currency,\n currencyType: details.currencyType,\n amountInDefaultCurrency: details.amountInDefaultCurrency,\n defaultCurrencyCode: details.defaultCurrencyCode,\n paymentDetails: details.paymentDetails,\n paymentTxnId: details.paymentTxnId,\n type: details.actionType,\n cryptoParams: details.cryptoParams\n });\n}\n\nfunction mapParticipant(participant: DiditTransactionParticipant | undefined): Record<string, unknown> | undefined {\n if (!participant) return undefined;\n return compact({\n type: participant.type,\n externalUserId: participant.externalUserId,\n fullName: participant.fullName,\n firstName: participant.firstName,\n lastName: participant.lastName,\n dob: participant.dob,\n address: participant.address,\n institutionInfo: participant.institutionInfo,\n device: participant.device,\n paymentMethod: participant.paymentMethod\n ? compact({\n type: participant.paymentMethod.type,\n accountId: participant.paymentMethod.accountId,\n issuingCountry: participant.paymentMethod.issuingCountry\n })\n : undefined\n });\n}\n\nfunction mapTravelRule(travelRule: DiditTravelRuleDetails | undefined): Record<string, unknown> | undefined {\n if (!travelRule) return undefined;\n return compact({\n status: travelRule.status,\n protocol: travelRule.protocol,\n required: travelRule.required,\n obligationsCount: travelRule.obligationsCount,\n originatorData: travelRule.originatorData,\n beneficiaryData: travelRule.beneficiaryData,\n metadata: travelRule.metadata\n });\n}\n\n/**\n * Maps the SDK-friendly camelCase payload onto the wire aliases accepted by the\n * Didit transactions API (txnId, txnDate, zoneId, type, info, subject,\n * counterparty, props, travelRule, includeCryptoScreening).\n */\nexport function buildTransactionRequestBody(transaction: DiditTransactionPayload): Record<string, unknown> {\n return compact({\n txnId: transaction.txnId,\n txnDate: transaction.txnDate,\n zoneId: transaction.zoneId,\n type: transaction.category,\n info: mapDetails(transaction.details),\n subject: mapParticipant(transaction.subject),\n counterparty: mapParticipant(transaction.counterparty),\n props: transaction.customProperties,\n travelRule: mapTravelRule(transaction.travelRule),\n includeCryptoScreening: transaction.includeCryptoScreening\n });\n}\n\nfunction pickString(record: Record<string, unknown>, ...keys: string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value) return value;\n }\n return undefined;\n}\n\nfunction mapActionRequired(raw: unknown): TransactionActionRequired | undefined {\n if (!isPlainRecord(raw)) return undefined;\n const type = pickString(raw, \"type\");\n const url = pickString(raw, \"url\");\n if (!type || !url) return undefined;\n const action: TransactionActionRequired = { type, url };\n const sessionId = pickString(raw, \"session_id\", \"sessionId\");\n if (sessionId) action.sessionId = sessionId;\n const sessionToken = pickString(raw, \"session_token\", \"sessionToken\");\n if (sessionToken) action.sessionToken = sessionToken;\n const status = pickString(raw, \"status\");\n if (status) action.status = status;\n const widgetSessionId = pickString(raw, \"widget_session_id\", \"widgetSessionId\");\n if (widgetSessionId) action.widgetSessionId = widgetSessionId;\n const expiresAt = pickString(raw, \"expires_at\", \"expiresAt\");\n if (expiresAt) action.expiresAt = expiresAt;\n return action;\n}\n\nfunction mapTravelRuleStatus(raw: Record<string, unknown>): string | undefined {\n const travelRule = raw.travel_rule ?? raw.travelRule;\n if (isPlainRecord(travelRule)) {\n const status = pickString(travelRule, \"status\");\n if (status) return status;\n }\n const props = raw.props;\n if (isPlainRecord(props)) {\n const status = pickString(props, \"travel_rule_status\", \"travelRuleStatus\");\n if (status) return status;\n }\n return pickString(raw, \"travel_rule_status\", \"travelRuleStatus\");\n}\n\nexport function mapTransactionResponse(raw: Record<string, unknown>): SubmitTransactionResult {\n const transactionId = pickString(raw, \"uuid\", \"transaction_id\", \"transactionId\");\n const status = pickString(raw, \"status\");\n if (!transactionId || !status) {\n // A missing id/status is not a valid transaction snapshot: fabricating\n // empty strings here would let a malformed response (envelope,\n // intercepting proxy, contract drift) look like a real result to\n // callers - e.g. the poll's statusMoved early-exit would trigger on an\n // empty status that merely differs from a real initialStatus.\n throw new DiditTransactionError(\n \"network\",\n \"Unexpected response shape from the Didit API: missing transaction id or status.\"\n );\n }\n const result: SubmitTransactionResult = { transactionId, status };\n const travelRuleStatus = mapTravelRuleStatus(raw);\n if (travelRuleStatus) result.travelRuleStatus = travelRuleStatus;\n const actionRequired = mapActionRequired(raw.action_required ?? raw.actionRequired);\n if (actionRequired) result.actionRequired = actionRequired;\n return result;\n}\n\nfunction extractDetailMessage(body: unknown): string | undefined {\n if (!isPlainRecord(body)) return undefined;\n return pickString(body, \"detail\", \"message\", \"error\");\n}\n\nexport function classifyTransactionError(status: number, body: unknown): DiditTransactionError {\n const detail = extractDetailMessage(body);\n if (status === 401 || status === 403) {\n const serialized = `${detail ?? \"\"} ${pickString(isPlainRecord(body) ? body : {}, \"code\") ?? \"\"}`;\n if (/expired/i.test(serialized)) {\n return new DiditTransactionError(\"expired_token\", detail, { status });\n }\n return new DiditTransactionError(\"invalid_token\", detail, { status });\n }\n if (status === 400 || status === 422) {\n return new DiditTransactionError(\"validation\", detail, {\n status,\n fieldErrors: isPlainRecord(body) ? body : undefined\n });\n }\n return new DiditTransactionError(\"network\", `Request failed with status ${status}.`, { status });\n}\n\nasync function readJsonBody(response: Response): Promise<unknown> {\n try {\n return await response.json();\n } catch {\n return null;\n }\n}\n\nasync function performRequest(url: string, init: RequestInit): Promise<SubmitTransactionResult> {\n if (typeof fetch !== \"function\") {\n throw new DiditTransactionError(\"network\", \"fetch is not available in this environment.\");\n }\n\n let response: Response;\n try {\n response = await fetch(url, init);\n } catch {\n throw new DiditTransactionError(\"network\");\n }\n\n const body = await readJsonBody(response);\n if (!response.ok) {\n throw classifyTransactionError(response.status, body);\n }\n if (!isPlainRecord(body)) {\n throw new DiditTransactionError(\"network\", \"Unexpected empty response from the Didit API.\", {\n status: response.status\n });\n }\n return mapTransactionResponse(body);\n}\n\nexport interface TransactionRequestArgs {\n baseUrl: string;\n transactionToken: string;\n}\n\nexport async function submitTransactionRequest(\n args: TransactionRequestArgs & { transaction: DiditTransactionPayload }\n): Promise<SubmitTransactionResult> {\n const fingerprint = await getDeviceFingerprintPayload().catch(() => null);\n const body = buildTransactionRequestBody(args.transaction);\n if (fingerprint) {\n body.fingerprint_v2 = fingerprint;\n }\n return performRequest(`${args.baseUrl}/v1/transactions/`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Transaction-Token\": args.transactionToken,\n ...buildFingerprintHeaders(fingerprint)\n },\n body: JSON.stringify(body)\n });\n}\n\nexport async function fetchTransaction(\n args: TransactionRequestArgs & { transactionId: string }\n): Promise<SubmitTransactionResult> {\n return performRequest(`${args.baseUrl}/v1/transactions/${args.transactionId}/`, {\n method: \"GET\",\n headers: { \"X-Transaction-Token\": args.transactionToken }\n });\n}\n\nfunction delay(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/** Terminal auth failures that will never succeed on retry: keep polling would just burn the token's remaining uses. */\nfunction isTerminalPollError(error: unknown): error is DiditTransactionError {\n return error instanceof DiditTransactionError && (error.type === \"invalid_token\" || error.type === \"expired_token\");\n}\n\n/**\n * Re-fetches the transaction after an action flow finished or its modal was\n * closed. Polls with a bounded retry (never relies on a single event/attempt)\n * and stops early once the required action is cleared or the status moved on.\n * Returns the latest successfully fetched result, or null when every attempt\n * failed.\n *\n * A terminal auth failure (invalid_token/expired_token - e.g. a maxUses\n * token exhausted by the poll's own GETs, or the token TTL elapsing while\n * the user was in the action flow) aborts immediately instead of retrying:\n * it can never succeed, and each attempt would otherwise still count\n * against the token's use_count server-side. The error is rethrown so the\n * caller can surface it instead of silently returning a stale result.\n *\n * `isAborted` is polled between attempts so a caller that tears down (e.g.\n * DiditSdk.destroy()) can stop the loop from making further network calls.\n */\nexport async function pollTransactionAfterAction(\n args: TransactionRequestArgs & {\n transactionId: string;\n initialStatus?: string;\n intervalMs?: number;\n maxAttempts?: number;\n isAborted?: () => boolean;\n }\n): Promise<SubmitTransactionResult | null> {\n const intervalMs = args.intervalMs ?? ACTION_POLL_INTERVAL_MS;\n const maxAttempts = Math.max(1, args.maxAttempts ?? ACTION_POLL_MAX_ATTEMPTS);\n let latest: SubmitTransactionResult | null = null;\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n if (args.isAborted?.()) return latest;\n if (attempt > 0) {\n await delay(intervalMs);\n }\n if (args.isAborted?.()) return latest;\n try {\n latest = await fetchTransaction(args);\n const actionResolved = !latest.actionRequired;\n const statusMoved = args.initialStatus !== undefined && latest.status !== args.initialStatus;\n if (actionResolved || statusMoved) {\n return latest;\n }\n } catch (error) {\n if (isTerminalPollError(error)) {\n throw error;\n }\n // Transient failure; keep polling until the bound is reached.\n }\n }\n return latest;\n}\n","import type {\n DiditSdkState,\n DiditSdkConfiguration,\n VerificationResult,\n VerificationCallback,\n StateChangeCallback,\n EventCallback,\n VerificationEvent,\n SessionData,\n VerificationStatus,\n StartVerificationOptions,\n SubmitTransactionOptions,\n SubmitTransactionResult,\n TransactionActionCompletedCallback,\n TransactionActionCompletedError\n} from \"./types\";\nimport type { SubmitEventOptions } from \"@didit-protocol/signals\";\n\nimport { getStoredDeviceId, submitEvent } from \"@didit-protocol/signals\";\nimport { VerificationModal } from \"./modal\";\nimport { DEFAULT_CONFIG } from \"./constants\";\nimport { SDKLogger, buildVerificationUrl, createVerificationError } from \"./utils\";\nimport {\n DEFAULT_TRANSACTION_BASE_URL,\n DiditTransactionError,\n pollTransactionAfterAction,\n submitTransactionRequest\n} from \"./transactions\";\n\ntype TransactionActionOutcome = \"finished\" | \"aborted\";\n\n/**\n * Embedded mode renders inside an element that already exists on the\n * integrator's page. Without it the modal never shows anything (embedded mode\n * never activates the overlay), so the launch fails with a message the\n * integrator can act on instead of silently presenting nothing.\n */\nfunction assertEmbeddedHostExists(configuration: DiditSdkConfiguration | undefined): void {\n if (!configuration?.embedded) return;\n const containerId = configuration.embeddedContainerId;\n if (!containerId) {\n throw new Error(\"Embedded mode requires embeddedContainerId: the id of the element that hosts the verification.\");\n }\n if (typeof document === \"undefined\" || !document.getElementById(containerId)) {\n throw new Error(`Embedded container \"#${containerId}\" was not found in the page.`);\n }\n}\n\n/**\n * The device id this page already keeps for Didit (it has sent events, transactions or sign-ins),\n * or null. Reading it never creates one, and a browser that refuses the read is not an error.\n */\nfunction storedDeviceId(): string | null {\n try {\n return getStoredDeviceId();\n } catch {\n return null;\n }\n}\n\nexport class DiditSdk {\n private static _instance: DiditSdk | null = null;\n\n public static get shared(): DiditSdk {\n if (!DiditSdk._instance) {\n DiditSdk._instance = new DiditSdk();\n }\n return DiditSdk._instance;\n }\n\n public static reset(): void {\n if (DiditSdk._instance) {\n DiditSdk._instance.destroy();\n DiditSdk._instance = null;\n }\n }\n\n private _state: DiditSdkState = \"idle\";\n private _configuration: DiditSdkConfiguration | undefined;\n private _sessionId: string | undefined;\n private _url: string | undefined;\n private _modal: VerificationModal | null = null;\n private _errorMessage: string | undefined;\n private _actionModal: VerificationModal | null = null;\n private _actionModalSettle: ((outcome: TransactionActionOutcome) => void) | null = null;\n /**\n * Bumped by destroy() to invalidate any transaction action in flight\n * (pending action modal and/or its follow-up poll) so a torn-down SDK\n * instance can never deliver a late onActionCompleted. A new\n * submitTransaction call always reads the current generation, so it is\n * unaffected by a destroy() that happened before it started.\n */\n private _actionGeneration = 0;\n\n public onComplete: VerificationCallback | undefined;\n public onStateChange: StateChangeCallback | undefined;\n public onEvent: EventCallback | undefined;\n\n public get state(): DiditSdkState {\n return this._state;\n }\n\n public get configuration(): DiditSdkConfiguration | undefined {\n return this._configuration;\n }\n\n public get isPresented(): boolean {\n return this._modal?.isOpen() ?? false;\n }\n\n /**\n * True while a transaction's wallet-ownership action modal (auto-launched\n * by submitTransaction) is on screen. verification_session actions are\n * never auto-launched, so they never affect this flag - see\n * {@link submitTransaction}. Tracked separately from {@link isPresented},\n * which reflects the verification modal only.\n */\n public get isActionModalPresented(): boolean {\n return this._actionModal?.isOpen() ?? false;\n }\n\n public get errorMessage(): string | undefined {\n return this._errorMessage;\n }\n\n private constructor() {\n SDKLogger.log(\"DiditSdk initialized\");\n }\n\n public async startVerification(options: StartVerificationOptions): Promise<void> {\n const config = options.configuration;\n this._configuration = config;\n\n SDKLogger.isEnabled = config?.loggingEnabled ?? DEFAULT_CONFIG.loggingEnabled;\n\n SDKLogger.log(\"Starting verification with options:\", options);\n if (this._modal) {\n this._modal.destroy();\n this._modal = null;\n }\n // A new launch is not in an error state any more, whatever the last one did.\n this._errorMessage = undefined;\n\n try {\n const { url } = options;\n\n if (!url || typeof url !== \"string\") {\n throw new Error(\"Invalid options: url is required\");\n }\n assertEmbeddedHostExists(config);\n\n this._modal = new VerificationModal(config, {\n onClose: () => this.handleModalClose(),\n onCloseConfirmed: () => this.handleModalCloseConfirmed(),\n onMessage: (event) => this.handleVerificationEvent(event),\n onIframeLoad: () => this.handleIframeLoad()\n });\n\n this._url = buildVerificationUrl(url, config, storedDeviceId());\n this.setState(\"loading\");\n\n this.emitInternalEvent(\"didit:started\", {});\n\n this._modal?.open(this._url);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n /**\n * Submits a transaction (including travel-rule and crypto-monitoring payloads)\n * directly from the end-user device.\n *\n * The request is authenticated with a short-lived transaction token minted by\n * your backend (POST /v3/transactions/sdk-token/) and sent via the\n * X-Transaction-Token header. Device intelligence is attached automatically:\n * the SDK collects a didit-fp-v2 fingerprint and sends it as the X-Didit-PID /\n * X-Didit-FP-Hash headers plus a `fingerprint_v2` body field.\n *\n * When the response contains an `actionRequired` block, the contract differs\n * by type:\n * - `wallet_ownership` (a same-origin, Didit-hosted widget): when\n * `autoLaunchAction` is not false, the SDK opens the action URL in the\n * verification modal itself. Once the flow completes or the modal is\n * closed, the transaction is re-fetched with a bounded poll (never a\n * single event) and `onActionCompleted` is invoked with the refreshed\n * result.\n * - `verification_session` (a biometric verification session): never\n * auto-launched, regardless of `autoLaunchAction`. It is only ever\n * returned in `result.actionRequired` for the host application to launch\n * with its own verification integration (e.g. `startVerification`).\n *\n * @param options Submission options: transactionToken, transaction payload,\n * optional baseUrl (defaults to https://verification.didit.me),\n * autoLaunchAction (defaults to true, applies to wallet_ownership actions\n * only) and onActionCompleted callback.\n * @returns The created transaction: transactionId, status, travelRuleStatus\n * and actionRequired when a user action is pending.\n * @throws {DiditTransactionError} Typed as \"invalid_token\", \"expired_token\",\n * \"validation\" (with fieldErrors) or \"network\".\n */\n public async submitTransaction(options: SubmitTransactionOptions): Promise<SubmitTransactionResult> {\n if (!options?.transactionToken || typeof options.transactionToken !== \"string\") {\n throw new DiditTransactionError(\"invalid_token\", \"transactionToken is required.\");\n }\n if (!options.transaction || typeof options.transaction !== \"object\") {\n throw new DiditTransactionError(\"validation\", \"transaction payload is required.\");\n }\n if (!options.transaction.txnId || typeof options.transaction.txnId !== \"string\") {\n throw new DiditTransactionError(\"validation\", \"transaction.txnId is required.\");\n }\n if (!options.transaction.details || typeof options.transaction.details !== \"object\") {\n throw new DiditTransactionError(\"validation\", \"transaction.details is required.\");\n }\n\n const baseUrl = (options.baseUrl ?? DEFAULT_TRANSACTION_BASE_URL).replace(/\\/+$/, \"\");\n SDKLogger.log(\"Submitting transaction:\", options.transaction.txnId);\n\n const result = await submitTransactionRequest({\n baseUrl,\n transactionToken: options.transactionToken,\n transaction: options.transaction\n });\n\n SDKLogger.log(\"Transaction submitted:\", result);\n\n // Only wallet_ownership is a same-origin, Didit-hosted widget that is\n // safe for the SDK to open on the integrator's behalf. verification_session\n // is never auto-launched: it is already returned in result.actionRequired\n // above for the host to launch with its own verification integration.\n const autoLaunchAction = options.autoLaunchAction ?? true;\n if (autoLaunchAction && result.actionRequired?.type === \"wallet_ownership\" && result.actionRequired.url) {\n void this.runTransactionAction(baseUrl, options.transactionToken, result, options.onActionCompleted);\n }\n\n return result;\n }\n\n /**\n * Queues an end-user event (sign-up, login, failed login, logout, password\n * reset, MFA, device change...) for Didit's event monitoring, so it appears\n * in the console tied to the same person as their verifications and\n * transactions. Returns the event id.\n *\n * The request is authenticated with a short-lived monitoring token minted by\n * your backend for that person (POST /v3/events/sdk-token/) and sent via the\n * X-Monitoring-Token header; the person always comes from the token. Events\n * are batched to /v1/events/batch/ with the device fingerprint attached, and\n * sent when 25 are waiting, every 5 seconds and when the page is hidden or\n * closed. Tune the queue with `configureEvents` and send right away with\n * `flush`, both exported by this package.\n *\n * @param options monitoringToken, the event and an optional baseUrl\n * (defaults to https://verification.didit.me).\n * @returns The event id: yours when you set event.eventId, otherwise a new UUID.\n * @throws {DiditEventError} \"invalid_token\" without a monitoringToken,\n * \"validation\" without an event category and action type.\n */\n public submitEvent(options: SubmitEventOptions): string {\n SDKLogger.log(\"Submitting event:\", options?.event?.category, options?.event?.actionType);\n return submitEvent(options);\n }\n\n /**\n * Dismisses everything currently on screen in one deterministic call: a\n * pending transaction action modal is treated as an abort (no follow-up\n * poll, no onActionCompleted) and the verification modal is always closed\n * afterwards, regardless of whether an action modal was present.\n */\n public close(): void {\n SDKLogger.log(\"Closing verification programmatically\");\n this._actionModalSettle?.(\"aborted\");\n this.handleModalCloseConfirmed();\n }\n\n public destroy(): void {\n SDKLogger.log(\"Destroying SDK instance\");\n // Invalidate any transaction action in flight so a poll that is already\n // running cannot deliver onActionCompleted after teardown.\n this._actionGeneration++;\n this._actionModalSettle?.(\"aborted\");\n this._modal?.destroy();\n this._modal = null;\n this.reset();\n this.setState(\"idle\");\n }\n\n private async runTransactionAction(\n baseUrl: string,\n transactionToken: string,\n submitResult: SubmitTransactionResult,\n onActionCompleted: TransactionActionCompletedCallback | undefined\n ): Promise<void> {\n const generation = this._actionGeneration;\n let delivered = false;\n\n // Guarantees at-most-once delivery: a throwing integrator callback must\n // not be re-invoked by a surrounding catch, and a destroy() that\n // happened while we were awaiting the modal/poll must suppress delivery\n // entirely rather than calling back into a torn-down integration.\n const deliver = (result: SubmitTransactionResult, error?: TransactionActionCompletedError): void => {\n if (delivered || generation !== this._actionGeneration) return;\n delivered = true;\n try {\n onActionCompleted?.(result, error);\n } catch (callbackError) {\n SDKLogger.error(\"onActionCompleted callback threw:\", callbackError);\n }\n };\n\n try {\n const outcome = await this.presentTransactionActionModal(submitResult.actionRequired!.url);\n if (outcome === \"aborted\" || generation !== this._actionGeneration) {\n return;\n }\n if (!submitResult.transactionId) {\n deliver(submitResult);\n return;\n }\n\n let refreshed: SubmitTransactionResult | null = null;\n let pollError: DiditTransactionError | undefined;\n try {\n refreshed = await pollTransactionAfterAction({\n baseUrl,\n transactionToken,\n transactionId: submitResult.transactionId,\n initialStatus: submitResult.status,\n isAborted: () => generation !== this._actionGeneration\n });\n } catch (error) {\n if (error instanceof DiditTransactionError) {\n pollError = error;\n } else {\n throw error;\n }\n }\n\n if (pollError) {\n // Terminal auth failure (invalid_token/expired_token): surface it\n // instead of silently handing back the stale pre-action result.\n deliver(submitResult, { type: pollError.type, message: pollError.message });\n return;\n }\n deliver(refreshed ?? submitResult);\n } catch (error) {\n SDKLogger.error(\"Transaction action follow-up failed:\", error);\n deliver(submitResult);\n }\n }\n\n private presentTransactionActionModal(url: string): Promise<TransactionActionOutcome> {\n // Abort any previous action modal before opening a new one.\n this._actionModalSettle?.(\"aborted\");\n\n return new Promise<TransactionActionOutcome>((resolve) => {\n let settled = false;\n const settle = (outcome: TransactionActionOutcome): void => {\n if (settled) return;\n settled = true;\n const modal = this._actionModal;\n this._actionModal = null;\n this._actionModalSettle = null;\n modal?.destroy();\n resolve(outcome);\n };\n\n // this._actionModalSettle is assigned only after the modal is\n // successfully constructed and opened. If either throws (e.g. no\n // `document` in Node/SSR, or document.body not ready yet), the\n // settle callback must not be left dangling: a later close() would\n // otherwise find a stale this._actionModalSettle for a modal that\n // was never presented, \"settle\" it, and return early without ever\n // closing the actual verification modal.\n let modal: VerificationModal;\n try {\n modal = new VerificationModal(undefined, {\n onClose: () => {},\n onCloseConfirmed: () => settle(\"finished\"),\n onMessage: (event) => {\n this.onEvent?.(event);\n if (event.type === \"didit:completed\" || event.type === \"didit:cancelled\") {\n settle(\"finished\");\n }\n },\n onIframeLoad: () => {}\n });\n\n SDKLogger.log(\"Launching required transaction action:\", url);\n modal.open(url);\n } catch (error) {\n this._actionModal = null;\n this._actionModalSettle = null;\n throw error;\n }\n\n this._actionModal = modal;\n this._actionModalSettle = settle;\n });\n }\n\n private handleModalClose(): void {\n SDKLogger.log(\"Modal close requested\");\n }\n\n private handleModalCloseConfirmed(): void {\n SDKLogger.log(\"Modal close confirmed\");\n\n const sessionData = this.buildSessionData();\n\n this._modal?.close();\n this.reset();\n this.setState(\"idle\");\n\n const result: VerificationResult = {\n type: \"cancelled\",\n session: sessionData\n };\n\n this.onComplete?.(result);\n }\n\n private handleIframeLoad(): void {\n SDKLogger.log(\"Iframe loaded\");\n }\n\n private emitInternalEvent(type: VerificationEvent[\"type\"], data?: VerificationEvent[\"data\"]): void {\n const event: VerificationEvent = {\n type,\n data,\n timestamp: Date.now()\n };\n\n SDKLogger.log(\"Emitting internal event:\", event);\n this.onEvent?.(event);\n }\n\n private handleVerificationEvent(event: VerificationEvent): void {\n SDKLogger.log(\"Verification event:\", event);\n\n // Keep the session the flow told us about so a modal the user closes by\n // hand still reports the session it belongs to in the cancelled result.\n if (event.data?.sessionId) {\n this._sessionId = event.data.sessionId;\n }\n\n this.onEvent?.(event);\n\n switch (event.type) {\n case \"didit:ready\":\n SDKLogger.log(\"Verification iframe ready\");\n break;\n\n case \"didit:started\":\n SDKLogger.log(\"User started verification\");\n break;\n\n case \"didit:step_started\":\n SDKLogger.log(\"Step started:\", event.data?.step);\n break;\n\n case \"didit:step_completed\":\n SDKLogger.log(\"Step completed:\", event.data?.step, \"-> next:\", event.data?.nextStep);\n break;\n\n case \"didit:media_started\":\n SDKLogger.log(\"Media started:\", event.data?.mediaType, \"for step:\", event.data?.step);\n break;\n\n case \"didit:media_captured\":\n SDKLogger.log(\"Media captured for step:\", event.data?.step, \"isAuto:\", event.data?.isAuto);\n break;\n\n case \"didit:document_selected\":\n SDKLogger.log(\"Document selected:\", event.data?.documentType, \"country:\", event.data?.country);\n break;\n\n case \"didit:verification_submitted\":\n SDKLogger.log(\"Verification submitted for step:\", event.data?.step);\n break;\n\n case \"didit:code_sent\":\n SDKLogger.log(\"Code sent via:\", event.data?.channel, \"codeSize:\", event.data?.codeSize);\n break;\n\n case \"didit:code_verified\":\n SDKLogger.log(\"Code verified via:\", event.data?.channel);\n break;\n\n case \"didit:status_updated\":\n SDKLogger.log(\"Status updated:\", event.data?.status, \"step:\", event.data?.step);\n break;\n\n case \"didit:completed\":\n this.handleVerificationCompleted(event);\n break;\n\n case \"didit:cancelled\":\n this.handleVerificationCancelled(event);\n break;\n\n case \"didit:error\":\n this.handleVerificationError(event);\n break;\n\n case \"didit:step_changed\":\n SDKLogger.log(\"Step changed:\", event.data?.step);\n break;\n\n case \"didit:close_request\":\n break;\n }\n }\n\n private handleVerificationCompleted(event: VerificationEvent): void {\n SDKLogger.log(\"Verification completed:\", event.data);\n\n const sessionData = this.buildSessionData(event.data);\n\n if (this._configuration?.closeModalOnComplete) {\n this._modal?.close();\n this.reset();\n this.setState(\"idle\");\n }\n\n const result: VerificationResult = {\n type: \"completed\",\n session: sessionData\n };\n\n this.onComplete?.(result);\n }\n\n private handleVerificationCancelled(event: VerificationEvent): void {\n SDKLogger.log(\"Verification cancelled:\", event.data);\n\n const sessionData = this.buildSessionData(event.data);\n\n this._modal?.close();\n this.reset();\n this.setState(\"idle\");\n\n const result: VerificationResult = {\n type: \"cancelled\",\n session: sessionData\n };\n\n this.onComplete?.(result);\n }\n\n private handleVerificationError(event: VerificationEvent): void {\n SDKLogger.log(\"Verification error:\", event.data);\n }\n\n private handleError(error: unknown): void {\n SDKLogger.error(\"SDK error:\", error);\n\n let verificationError;\n\n if (error instanceof Error) {\n verificationError = createVerificationError(\"unknown\", error.message);\n } else {\n verificationError = createVerificationError(\"unknown\", \"An unknown error occurred\");\n }\n\n this._modal?.close();\n this._modal = null;\n // Clear what the failed launch left behind, then report the error as the\n // state the SDK is in: reset() alone would leave callers reading \"idle\"\n // with no error message right after onStateChange(\"error\").\n this.reset();\n this._errorMessage = verificationError.message;\n this.setState(\"error\");\n\n const result: VerificationResult = {\n type: \"failed\",\n error: verificationError\n };\n\n this.onComplete?.(result);\n }\n\n private setState(state: DiditSdkState): void {\n const previousState = this._state;\n this._state = state;\n\n if (previousState !== state) {\n SDKLogger.log(\"State changed:\", previousState, \"->\", state);\n this.onStateChange?.(state, this._errorMessage);\n }\n }\n\n private reset(): void {\n this._sessionId = undefined;\n this._url = undefined;\n this._errorMessage = undefined;\n this._configuration = undefined;\n }\n\n private buildSessionData(eventData?: VerificationEvent[\"data\"]): SessionData | undefined {\n const sessionId = eventData?.sessionId || this._sessionId;\n\n if (!sessionId) {\n return undefined;\n }\n\n return {\n sessionId,\n status: (eventData?.status || \"Pending\") as VerificationStatus\n };\n }\n}\n"],"names":["getDeviceFingerprintPayload","buildFingerprintHeaders","getStoredDeviceId","submitEvent"],"mappings":";;;;;;;;;;;AAAO,MAAM,cAAc,GAAG;AAC5B,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,cAAc,EAAE,MAER;AAEH,MAAM,WAAW,GAAG;AACzB,IAAA,OAAO,EAAE,qBAAqB;AAC9B,IAAA,SAAS,EAAE,uBAAuB;A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