@btsd/aitu-bridge 0.7.2-canary.3 → 0.8.0-canary.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export declare function promisifyStorage(storage: any, subscribe: (fn: any) => void): {
2
- setItem: (keyName: string, keyValue: string) => Promise<void>;
3
- getItem: (keyName: string) => Promise<string | null>;
4
- clear: () => Promise<void>;
5
- };
6
- export declare function promisifyInvoke(invoke: any, subscribe: (fn: any) => void): (invokeMethodName: string, props?: any) => Promise<any | void>;
7
- export declare function promisifyMethod(method: Function, methodName: string, subscribe: (fn: any) => void): (...args: any[]) => Promise<any | void>;
1
+ import type { AituEventHandler } from "./types";
2
+ export declare function promisifyStorage(storage: (reqId: string, method: string, props: Record<string, string>) => void, subscribe: (fn: AituEventHandler) => void): {
3
+ setItem: (keyName: string, keyValue: string) => Promise<void>;
4
+ getItem: (keyName: string) => Promise<string | null>;
5
+ clear: () => Promise<void>;
6
+ };
7
+ export declare function promisifyInvoke(invoke: (reqId: string, methodName: string, props: any) => void, subscribe: (fn: AituEventHandler) => void): (invokeMethodName: string, props?: any) => Promise<any | void>;
8
+ export declare function promisifyMethod<Result, Fn extends (...args: any[]) => any = (...args: any) => any>(method: Fn, methodName: string, subscribe: (fn: AituEventHandler) => void): (...args: Parameters<Fn>) => Promise<Result>;
8
9
  //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { BridgeMethodResult, PublicApiMethods } from './types';
2
+ export declare const waitResponse: <T extends PublicApiMethods>(reqId: string) => Promise<BridgeMethodResult<T>>;
3
+ //# sourceMappingURL=waitResponse.d.ts.map
@@ -1,8 +1,7 @@
1
- import type { AituBridge } from './index';
2
- interface WebBridge {
3
- execute(method: keyof AituBridge, reqId: string, ...payload: any[]): void;
4
- origin: string;
5
- }
6
- declare let WebBridge: WebBridge | null;
7
- export default WebBridge;
1
+ import type { RequestMethods } from './types';
2
+ export interface WebBridge {
3
+ execute(method: RequestMethods, reqId: string, ...payload: unknown[]): void;
4
+ origin: string;
5
+ }
6
+ export declare const createWebBridge: () => WebBridge | null;
8
7
  //# sourceMappingURL=webBridge.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btsd/aitu-bridge",
3
- "version": "0.7.2-canary.3",
3
+ "version": "0.8.0-canary.4",
4
4
  "description": "",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -8,10 +8,12 @@
8
8
  "module": "dist/index.module.js",
9
9
  "unpkg": "dist/index.umd.js",
10
10
  "files": [
11
- "dist"
11
+ "dist",
12
+ "!dist/**/*.map"
12
13
  ],
13
14
  "scripts": {
14
- "test": "echo \"Error: no test specified\" && exit 1",
15
+ "test": "vitest",
16
+ "coverage": "vitest run --coverage",
15
17
  "build": "microbundle --define VERSION=$(node -p \"require('./package.json').version\")",
16
18
  "test-api": "api-extractor run --local --verbose",
17
19
  "test-api:ci": "api-extractor run --verbose",
@@ -36,6 +38,10 @@
36
38
  "homepage": "https://github.com/btsdigital/aitu-bridge#readme",
37
39
  "devDependencies": {
38
40
  "@microsoft/api-extractor": "^7.55.2",
39
- "microbundle": "^0.15.1"
41
+ "@vitest/coverage-v8": "^4.0.16",
42
+ "jsdom": "^27.4.0",
43
+ "microbundle": "^0.15.1",
44
+ "typescript": "^5.8.2",
45
+ "vitest": "^4.0.16"
40
46
  }
41
47
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY;IACpB,mBAAmB,IAAA;IACnB,2BAA2B,IAAA;IAC3B,UAAU,IAAA;CACb;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,MAAO,GAAG,KAAG,YAY5C,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],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;OAGG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAErD;;;OAGG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAE7C;;;;;OAKG;IACH,YAAY,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAEhE;;;OAGG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACnC;;;;;;;;;;OAUG;IACH,qBAAqB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACnD;;;;;;;;;OASG;IACH,uBAAuB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACrD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,eAAe,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACzH;AA0sBD;;;GAGG;AACH,QAAA,MAAM,MAAM,YAAgB,CAAC;AAE7B,eAAe,MAAM,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/webBridge.ts","../src/error.ts","../src/index.ts"],"sourcesContent":["function createCounter(prefix = 'm:') {\n return {\n current: 0,\n next() {\n return prefix + ++this.current;\n },\n };\n}\n\nfunction createRequestResolver(prefix: string) {\n type PromiseController = {\n resolve: (value: any) => any;\n reject: (reason: any) => any;\n };\n\n const counter = createCounter(prefix);\n const promiseControllers: Record<string, PromiseController | null> = {};\n\n return {\n add(controller: PromiseController, customId = ''): number | string {\n const id = customId + counter.next()\n promiseControllers[id] = controller;\n return id;\n },\n\n resolve<T>(reqId: number | string, data: T, isSuccess: (data: T) => boolean, error: any) {\n const requestPromise = promiseControllers[reqId];\n\n if (requestPromise) {\n if (isSuccess(error)) {\n requestPromise.resolve(data);\n } else {\n requestPromise.reject(error);\n }\n\n promiseControllers[reqId] = null;\n }\n },\n };\n}\n\nfunction handleSubscribe(subscribe: (handler: (event: any) => void) => void, requestResolver: ReturnType<typeof createRequestResolver>) {\n subscribe(event => {\n if (!event.detail) {\n return;\n }\n\n if ('reqId' in event.detail) {\n const { reqId, data, error } = event.detail;\n\n if (reqId) {\n requestResolver.resolve(reqId, data, (error) => !(error), error);\n }\n }\n })\n}\n\nexport function promisifyStorage(storage, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('storage:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return {\n setItem: (keyName: string, keyValue: string): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'setItem', { keyName, keyValue });\n });\n },\n getItem: (keyName: string): Promise<string | null> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'getItem', { keyName });\n });\n },\n clear: (): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'clear', {});\n });\n },\n }\n}\n\nexport function promisifyInvoke(invoke, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('invoke:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(invokeMethodName: string, props: any = {}): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject }, invokeMethodName + ':');\n\n invoke(reqId, invokeMethodName, props);\n });\n };\n}\n\nexport function promisifyMethod(method: Function, methodName: string, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver(methodName + ':');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(...args: any[]): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n method(reqId, ...args);\n });\n };\n}\n\n\n\n","import type { AituBridge } from './index';\n\nconst AITU_DOMAIN_PARAM = '__aitu-domain'\n\nconst searchParams = new URLSearchParams(window.location.search)\n\nlet aituOrigin = searchParams.get(AITU_DOMAIN_PARAM)\n\nif(aituOrigin){\n localStorage.setItem('mini-app-domain', aituOrigin)\n}else{\n aituOrigin = localStorage.getItem('mini-app-domain')\n}\ninterface WebBridge {\n execute(method: keyof AituBridge, reqId: string, ...payload: any[] ): void\n origin: string\n}\n\nlet WebBridge: WebBridge | null = null\n\nif (aituOrigin) {\n WebBridge = {\n origin: aituOrigin,\n execute: (method, reqId, ...payload) => {\n window.top.postMessage({\n source: 'aitu-bridge',\n method,\n reqId,\n payload: [...payload],\n },\n WebBridge.origin\n )\n }\n\n }\n window.addEventListener('message', event => {\n if (event.origin === aituOrigin && event.data) {\n\n // dispatch aitu events\n window.dispatchEvent(new CustomEvent('aituEvents', { detail: event.data }));\n\n // try to detect handler call\n if (typeof event.data !== 'string' || event.data === '') {\n return;\n }\n\n try {\n const message = JSON.parse(event.data)\n\n if (message && message['method']) {\n if (message.method === 'setCustomBackArrowOnClickHandler') {\n (window as any).onAituBridgeBackArrowClick()\n } else if (message.method === 'setHeaderMenuItemClickHandler') {\n (window as any).onAituBridgeHeaderMenuItemClick(message.param)\n }\n }\n } catch (e) {\n console.log('Error parsing message data: ' + e);\n }\n }\n })\n}\n\nexport default WebBridge\n","/**\n * @public\n */\nexport enum BridgeErrors {\n PermissionDenyError,\n PermissionSecurityDenyError,\n OtherError\n}\n\n/**\n * @public\n */\nexport const classifyBridgeError = (e: any): BridgeErrors => {\n const permissionDeny = \"permission deny\";\n const permissionSecurityDeny = \"permission security deny\";\n\n if (e.msg) {\n if (e.msg.startsWith(permissionDeny)) {\n return BridgeErrors.PermissionDenyError;\n } else if (e.msg.startsWith(permissionSecurityDeny)) {\n return BridgeErrors.PermissionSecurityDenyError\n }\n }\n return BridgeErrors.OtherError;\n}\n","/**\n * Aitu Bridge is a JavaScript library designed to simplify integration with the Aitu Superapp.\n * It allows your application to access platform features such as retrieving a user’s phone number or geolocation.\n * {@link https://docs.aitu.io/aituapps/aitu.apps/methods | Read the official documentation to learn more.}\n * @packageDocumentation\n */\n\nimport { promisifyMethod, promisifyStorage, promisifyInvoke } from './utils';\n\nimport WebBridge from './webBridge';\nexport * from './error';\n\ndeclare const VERSION: string;\n\n/**\n * @public\n */\nexport enum EInvokeRequest {\n getMe = 'GetMe',\n getPhone = 'GetPhone',\n getContacts = 'GetContacts',\n getUserProfile = 'GetUserProfile',\n enableNotifications = 'AllowNotifications',\n disableNotifications = 'DisableNotifications',\n enablePrivateMessaging = 'EnablePrivateMessaging',\n disablePrivateMessaging = 'DisablePrivateMessaging',\n}\n\n/**\n * @public\n * Represents a header menu item click handler.\n */\nexport type HeaderMenuItemClickHandlerType = (id: string) => Promise<void>;\n\n/**\n * @public\n * Represents a back arrow click handler.\n */\nexport type BackArrowClickHandlerType = () => Promise<void>;\n\n/**\n * @public\n * Represents an error that can occur during NFC passport operations.\n */\nexport interface NFCPassportError {\n /**\n * Error code indicating the type of NFC passport issue.\n *\n * - `nfc_passport_mismatch` — The passport does not match the requested parameters\n * (date of birth, passport number, expiration date).\n * - `nfc_document_read_failure` — Document reading error\n * (read errors, algorithm errors, unknown algorithms, other documents that are not passports, etc.).\n * - `nfc_session_timeout` — Session timeout: the document reading was not completed\n * in time (depends on the OS).\n * - `nfc_permission_denied` — The user denied NFC permission or the device has no NFC chip.\n * - `nfc_session_cancelled` — The user cancelled the NFC session (iOS).\n */\n code: 'nfc_passport_mismatch' | 'nfc_document_read_failure' | 'nfc_session_timeout' | 'nfc_permission_denied' | 'nfc_session_cancelled';\n\n /**\n * Human-readable error message describing the issue.\n */\n msg: string;\n}\n\n/**\n * @public\n * Represents an error indicating that the app URL does not match the expected value.\n */\nexport interface AppUrlDoesntMatchError {\n code: 'url_does_not_match';\n msg: string;\n}\n\n/**\n * @public\n * Represents a permission denied error.\n */\nexport interface PermissionDeniedError {\n code: 'permission_denied';\n msg: string;\n meta: {\n can_retry: boolean;\n };\n}\n\n/**\n * @public\n * Represents phone number response.\n */\nexport interface GetPhoneResponse {\n phone: string;\n sign: string;\n}\n\n/**\n * @public\n * Represents user information response.\n */\nexport interface GetMeResponse {\n name: string;\n lastname: string;\n id: string;\n avatar?: string;\n avatarThumb?: string;\n notifications_allowed: boolean;\n private_messaging_enabled: boolean;\n sign: string;\n}\n\n/**\n * @public\n * Represents a generic response object.\n */\nexport interface ResponseObject {\n phone?: string;\n name?: string;\n lastname?: string;\n}\n\n/**\n * @public\n * Represents a geographic location response.\n */\nexport interface GetGeoResponse {\n latitude: number;\n longitude: number;\n}\n\n/**\n * @public\n * Represents a contacts list response.\n */\nexport interface GetContactsResponse {\n contacts: Array<{\n first_name: string;\n last_name: string;\n phone: string;\n }>;\n sign: string;\n}\n\n/**\n * @public\n * Represents a selected contact response.\n */\nexport interface SelectContactResponse {\n phone: string;\n name: string;\n lastname: string;\n}\n\n/**\n * @public\n * Represents a user profile response.\n */\nexport interface GetUserProfileResponse {\n name: string;\n lastname?: string;\n phone?: string;\n avatar?: string;\n avatarThumb?: string;\n}\n\nconst MAX_HEADER_MENU_ITEMS_COUNT = 3;\n\n/**\n * @public\n * Represents header menu item icons.\n */\nexport enum HeaderMenuIcon {\n Search = 'Search',\n ShoppingCart = 'ShoppingCart',\n Menu = 'Menu',\n Share = 'Share',\n Notifications = 'Notifications',\n Help = 'Help',\n Error = 'Error',\n Person = 'Person',\n Sort = 'Sort',\n Filter = 'Filter',\n Close = 'Close',\n SystemNotifications = 'SystemNotifications',\n}\n\n/**\n * @public\n * Represents navigation item display modes.\n */\nexport enum NavigationItemMode {\n SystemBackArrow = 'SystemBackArrow',\n CustomBackArrow = 'CustomBackArrow',\n NoItem = 'NoItem',\n UserProfile = 'UserProfile',\n}\n\n/**\n * @public\n * Represents a header menu item.\n */\nexport interface HeaderMenuItem {\n id: string;\n icon: HeaderMenuIcon;\n badge?: string;\n}\n\n/**\n * @public\n * Represents user steps per day.\n */\nexport interface UserStepsPerDay {\n date: string;\n steps: number;\n}\n\n/**\n * @public\n * Represents a user step information response.\n */\nexport interface UserStepInfoResponse {\n steps: UserStepsPerDay[];\n}\n\n/**\n * @public\n * Represents a successful response.\n */\nexport type SuccessResponse = 'success';\n\n/**\n * @public\n * Represents the status of a response.\n *\n * - `success` — The operation completed successfully.\n * - `failed` — The operation failed.\n */\nexport type ResponseType = SuccessResponse | 'failed';\n\n/**\n * @public\n * Represents biometry check response.\n */\nexport type BiometryResponse = ResponseType | 'unavailable' | 'cancelled';\n\n/**\n * @public\n * Represents passport data read from an NFC chip.\n */\nexport interface PassportDataResponse {\n documentNumber: string;\n dateOfBirth: string;\n dateOfExpiry: string;\n firstName: string;\n lastName: string;\n gender: string;\n nationality: string;\n documentType: string;\n}\n\n/**\n * @public\n * Generic bridge invocation type.\n */\nexport type BridgeInvoke<T extends EInvokeRequest, R> = (method: T, data?: {}) => Promise<R>;\n\n/**\n * @public\n * Interface for persistent key-value storage.\n */\nexport interface BridgeStorage {\n setItem: (keyName: string, keyValue: string) => Promise<void>;\n getItem: (keyName: string) => Promise<string | null>;\n clear: () => Promise<void>;\n}\n\n/**\n * @public\n * Main interface for interacting with the Aitu Bridge API.\n */\nexport interface AituBridge {\n /**\n * Version of the Aitu Bridge API available in SemVer format.\n */\n version: string;\n\n /**\n * Low-level bridge invocation method used internally\n * to communicate with native Aitu functionality.\n */\n invoke: BridgeInvoke<EInvokeRequest, ResponseObject>;\n\n /**\n * Provides access to persistent key-value storage\n * scoped to the current mini-app.\n */\n storage: BridgeStorage;\n\n /**\n * Returns basic information about the currently authorized user.\n * @returns A promise resolving to a {@link GetMeResponse} containing user details.\n */\n getMe: () => Promise<GetMeResponse>;\n\n /**\n * Requests the user's phone number after explicit user confirmation.\n * @returns A promise resolving to a {@link GetPhoneResponse} containing the phone number.\n */\n getPhone: () => Promise<GetPhoneResponse>;\n\n /**\n * Requests access to the user's contact list.\n * @returns A promise resolving to a {@link GetContactsResponse} containing the contacts.\n */\n getContacts: () => Promise<GetContactsResponse>;\n\n /**\n * Retrieves the user's current geographic location.\n * @returns A promise resolving to a {@link GetGeoResponse} containing latitude and longitude.\n */\n getGeo: () => Promise<GetGeoResponse>;\n\n /**\n * Opens the native contact picker UI and allows the user\n * to select a single contact.\n * @returns A promise resolving to a {@link SelectContactResponse} containing the selected contact details.\n */\n selectContact: () => Promise<SelectContactResponse>;\n\n /**\n * Opens the device camera and scans a QR code.\n * @returns A string with the result of scanning the QR code is returned.\n */\n getQr: () => Promise<string>;\n\n /**\n * Requests an SMS verification code from the user.\n * @returns A string with code is returned.\n */\n getSMSCode: () => Promise<string>;\n\n /**\n * Retrieves public profile information for a specific user.\n *\n * @param userId - Aitu user identifier\n * @returns A promise resolving to a {@link GetUserProfileResponse} containing the user's profile data.\n */\n getUserProfile: (userId: string) => Promise<GetUserProfileResponse>;\n /**\n * Opens the user's profile within the host application.\n * @returns A promise that resolves with a {@link ResponseType} indicating the result of the operation.\n */\n openUserProfile: () => Promise<ResponseType>;\n\n /**\n * Opens the system share dialog with a text payload.\n *\n * @param text - Text to share\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.\n */\n share: (text: string) => Promise<ResponseType>;\n\n /**\n * Sets the title displayed in the mini-app header.\n *\n * @param text - Header title\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n setTitle: (text: string) => Promise<ResponseType>;\n\n /**\n * Copies the specified text to the system clipboard.\n *\n * @param text - Text to copy\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the copy operation.\n */\n copyToClipboard: (text: string) => Promise<ResponseType>;\n\n /**\n * Shares an image with an optional text description.\n *\n * @deprecated Use {@link AituBridge.shareFile} instead.\n * @param text - Description text\n * @param image - Image data encoded in Base64\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.\n */\n shareImage: (text: string, image: string) => Promise<ResponseType>;\n\n /**\n * Shares a file via the system sharing interface.\n *\n * @param text - Description text\n * @param filename - Name of the file\n * @param base64Data - File data encoded in Base64\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.\n */\n shareFile: (text: string, filename: string, base64Data: string) => Promise<ResponseType>;\n\n /**\n * Enables push notifications for the mini-app.\n */\n enableNotifications: () => Promise<{}>;\n\n /**\n * Disables push notifications for the mini-app.\n */\n disableNotifications: () => Promise<{}>;\n\n /**\n * Enables private messaging between the mini-app and the user.\n *\n * @param appId - Mini-app identifier\n */\n enablePrivateMessaging: (appId: string) => Promise<string>;\n\n /**\n * Disables private messaging between the mini-app and the user.\n *\n * @param appId - Mini-app identifier\n */\n disablePrivateMessaging: (appId: string) => Promise<string>;\n\n /**\n * Opens the Aitu application settings screen.\n * @returns A promise resolving to a ResponseType indicating the result of the operation.\n */\n openSettings: () => Promise<ResponseType>;\n\n /**\n * Closes the current mini-app.\n * @returns A promise resolving to a ResponseType indicating the result of the operation.\n */\n closeApplication: () => Promise<ResponseType>;\n\n /**\n * Registers a handler that is triggered when the device is shaken.\n * @param handler - Shake event handler\n */\n setShakeHandler: (handler: any) => void;\n\n /**\n * Registers a handler that is triggered when a tab becomes active.\n *\n * @param handler - Callback with active tab name\n */\n setTabActiveHandler: (handler: (tabname: string) => void) => void;\n\n /**\n * Triggers device vibration using a custom vibration pattern.\n *\n * @param pattern - Array of vibration durations in milliseconds\n * @returns A promise resolving to a {@link SuccessResponse} indicating the result of the vibration operation.\n */\n vibrate: (pattern: number[]) => Promise<SuccessResponse>;\n\n /**\n * Indicates whether the current environment supports Aitu Bridge.\n * @returns A boolean indicating support status.\n */\n isSupported: () => boolean;\n\n /**\n * Checks whether a specific bridge method is supported.\n *\n * @param method - Method name\n * @returns A boolean indicating support status.\n */\n supports: (method: string) => boolean;\n /**\n * Subscribes to Aitu Bridge events.\n */\n sub: any;\n\n /**\n * Enables protection against screenshots and screen recording.\n */\n enableScreenCapture: () => Promise<{}>;\n\n /**\n * Disables protection against screenshots and screen recording.\n */\n disableScreenCapture: () => Promise<{}>;\n\n /**\n * Sets custom menu items in the mini-app header.\n *\n * @param items - Header menu configuration\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n setHeaderMenuItems: (items: Array<HeaderMenuItem>) => Promise<ResponseType>;\n\n /**\n * Registers a click handler for header menu items.\n * @param handler - Header menu item click handler\n */\n setHeaderMenuItemClickHandler: (handler: HeaderMenuItemClickHandlerType) => void;\n\n /**\n * Enables or disables custom back arrow handling.\n *\n * @param enabled - Whether custom handling is enabled\n * @returns A promise resolving to a ResponseType indicating the result of the operation.\n */\n setCustomBackArrowMode: (enabled: boolean) => Promise<ResponseType>;\n\n /**\n * Returns whether custom back arrow mode is enabled.\n * @returns A promise resolving to a boolean indicating the current mode.\n */\n getCustomBackArrowMode: () => Promise<boolean>;\n\n /**\n * Controls the visibility of the custom back arrow.\n *\n * @param visible - Arrow visibility state\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;\n /**\n * Opens the payment interface for a specified transaction.\n * @param transactionId - Transaction identifier\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the payment operation.\n */\n openPayment: (transactionId: string) => Promise<ResponseType>;\n /**\n * Sets a custom handler for back arrow click events.\n * @param handler - Back arrow click handler\n */\n setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;\n /**\n * Checks biometric authentication status.\n * @returns A promise resolving to a {@link BiometryResponse} indicating the result of the check.\n */\n checkBiometry: () => Promise<BiometryResponse>;\n\n /**\n * Opens an external URL outside the mini-app context.\n *\n * @param url - External URL to open\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n openExternalUrl: (url: string) => Promise<ResponseType>;\n\n /**\n * Enables swipe-back navigation gesture.\n * @returns A promise resolving to a {@link ResponseType} when the gesture is enabled.\n */\n enableSwipeBack: () => Promise<ResponseType>;\n\n /**\n * Disables swipe-back navigation gesture.\n * @returns A promise resolving to a {@link ResponseType} when the gesture is disabled.\n */\n disableSwipeBack: () => Promise<ResponseType>;\n\n /**\n * Sets the navigation item display mode.\n *\n * @param mode - Navigation item mode\n * @returns A promise that resolves when the mode is set.\n */\n setNavigationItemMode: (mode: NavigationItemMode) => Promise<void>;\n\n /**\n * Returns the current navigation item mode.\n * @returns A promise resolving to the current {@link NavigationItemMode}.\n */\n getNavigationItemMode: () => Promise<NavigationItemMode>;\n\n /**\n * Retrieves step count data from HealthKit or Google Fit.\n * @returns A promise resolving to a {@link UserStepInfoResponse} containing the user's step data.\n */\n getUserStepInfo: () => Promise<UserStepInfoResponse>;\n\n /**\n * Checks whether eSIM is supported on the device.\n * @returns A promise resolving to a {@link ResponseType} indicating if eSIM is supported.\n */\n isESimSupported: () => Promise<ResponseType>;\n\n /**\n * Activates an eSIM using the provided activation code.\n *\n * @param activationCode - eSIM activation code\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the activation.\n */\n activateESim: (activationCode: string) => Promise<ResponseType>;\n\n /**\n * Reads raw data from an NFC tag.\n * @returns A promise resolving to a string containing the raw NFC data.\n */\n readNFCData: () => Promise<string>;\n /**\n * Subscribes to user step updates from HealthKit/Google Fit.\n *\n * Establishes a real-time subscription that listens for step count changes\n * from the underlying health data provider. The promise resolves once the\n * subscription request has been processed. To stop receiving updates, call\n * {@link AituBridge.unsubscribeUserStepInfo}.\n *\n * @returns A promise that resolves with a `ResponseType` indicating\n * whether the subscription was successfully created.\n */\n subscribeUserStepInfo: () => Promise<ResponseType>;\n /**\n * Unsubscribes from user step updates from HealthKit/Google Fit.\n *\n * Stops the active step-count subscription created by\n * {@link AituBridge.subscribeUserStepInfo}. Once unsubscribed, no further step updates\n * will be delivered.\n *\n * @returns A promise that resolves with a `ResponseType` indicating\n * whether the unsubscription was successful.\n */\n unsubscribeUserStepInfo: () => Promise<ResponseType>;\n /**\n * Reads data from the NFC chip of an ePassport using BAC (Basic Access Control).\n *\n * Initiates a BAC-protected NFC read operation on an ePassport. The caller must\n * provide the passport number, date of birth, and expiration date—values taken\n * from the machine-readable zone (MRZ). These values are used to derive the\n * cryptographic access keys required by BAC to open a secure session with the\n * passport’s NFC chip.\n *\n * Once BAC is successfully established, the function retrieves data groups\n * from the chip, typically including the holder’s biographical information\n * (DG1) and, if supported and permitted, biometric data such as the facial\n * image (DG2).\n *\n * @param passportNumber - Passport number taken from the MRZ.\n * @param dateOfBirth - Holder’s date of birth (MRZ format: YYMMDD).\n * @param expirationDate - Passport expiration date (MRZ format: YYMMDD).\n *\n * @returns A promise resolving to a `PassportDataResponse` containing the decoded\n * data groups read from the passport’s NFC chip.\n *\n * @throws {@link NFCPassportError} When an NFC passport operation fails. Possible codes:\n * - `nfc_passport_mismatch` — Passport does not match the provided MRZ values.\n * - `nfc_document_read_failure` — General failure to read the document.\n * - `nfc_session_timeout` — NFC session timed out before completion.\n * - `nfc_permission_denied` — NFC permission denied or NFC unavailable.\n * - `nfc_session_cancelled` — User cancelled the NFC session (iOS).\n */\n readNFCPassport: (passportNumber: string, dateOfBirth: string, expirationDate: string) => Promise<PassportDataResponse>;\n}\n\nconst invokeMethod = 'invoke';\nconst storageMethod = 'storage';\nconst getGeoMethod = 'getGeo';\nconst getQrMethod = 'getQr';\nconst getSMSCodeMethod = 'getSMSCode';\nconst selectContactMethod = 'selectContact';\nconst openSettingsMethod = 'openSettings';\nconst closeApplicationMethod = 'closeApplication';\nconst shareMethod = 'share';\nconst setTitleMethod = 'setTitle';\nconst copyToClipboardMethod = 'copyToClipboard';\nconst shareImageMethod = 'shareImage';\nconst shareFileMethod = 'shareFile';\nconst setShakeHandlerMethod = 'setShakeHandler';\nconst vibrateMethod = 'vibrate';\nconst enableScreenCaptureMethod = 'enableScreenCapture';\nconst disableScreenCaptureMethod = 'disableScreenCapture';\nconst setTabActiveHandlerMethod = 'setTabActiveHandler';\nconst setHeaderMenuItemsMethod = 'setHeaderMenuItems';\nconst setHeaderMenuItemClickHandlerMethod = 'setHeaderMenuItemClickHandler';\nconst setCustomBackArrowModeMethod = 'setCustomBackArrowMode';\nconst getCustomBackArrowModeMethod = 'getCustomBackArrowMode';\nconst setCustomBackArrowVisibleMethod = 'setCustomBackArrowVisible';\nconst openPaymentMethod = 'openPayment';\nconst setCustomBackArrowOnClickHandlerMethod = 'setCustomBackArrowOnClickHandler';\nconst checkBiometryMethod = 'checkBiometry';\nconst openExternalUrlMethod = 'openExternalUrl';\nconst enableSwipeBackMethod = 'enableSwipeBack';\nconst disableSwipeBackMethod = 'disableSwipeBack';\nconst setNavigationItemModeMethod = 'setNavigationItemMode';\nconst getNavigationItemModeMethod = 'getNavigationItemMode';\nconst getUserStepInfoMethod = 'getUserStepInfo';\n\nconst android = typeof window !== 'undefined' && (window as any).AndroidBridge;\nconst ios = typeof window !== 'undefined' && (window as any).webkit && (window as any).webkit.messageHandlers;\nconst web = typeof window !== 'undefined' && window.top !== window && WebBridge;\n\nconst buildBridge = (): AituBridge => {\n const subs = [];\n\n if (typeof window !== 'undefined') {\n window.addEventListener('aituEvents', (e: any) => {\n [...subs].map((fn) => fn.call(null, e));\n });\n }\n\n const invoke = (reqId, method, data = {}) => {\n const isAndroid = android && android[invokeMethod];\n const isIos = ios && ios[invokeMethod];\n\n if (isAndroid) {\n android[invokeMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[invokeMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(invokeMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--invoke-isUnknown');\n }\n };\n\n const storage = (reqId, method, data = {}) => {\n const isAndroid = android && android[storageMethod];\n const isIos = ios && ios[storageMethod];\n\n if (isAndroid) {\n android[storageMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[storageMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(storageMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--storage-isUnknown');\n }\n };\n\n const getGeo = (reqId) => {\n const isAndroid = android && android[getGeoMethod];\n const isIos = ios && ios[getGeoMethod];\n\n if (isAndroid) {\n android[getGeoMethod](reqId);\n } else if (isIos) {\n ios[getGeoMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getGeoMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getGeo-isUnknown');\n }\n };\n\n const getQr = (reqId) => {\n const isAndroid = android && android[getQrMethod];\n const isIos = ios && ios[getQrMethod];\n\n if (isAndroid) {\n android[getQrMethod](reqId);\n } else if (isIos) {\n ios[getQrMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getQrMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getQr-isUnknown');\n }\n };\n\n const getSMSCode = (reqId) => {\n const isAndroid = android && android[getSMSCodeMethod];\n const isIos = ios && ios[getSMSCodeMethod];\n\n if (isAndroid) {\n android[getSMSCodeMethod](reqId);\n } else if (isIos) {\n ios[getSMSCodeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getSMSCodeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getSMSCode-isUnknown');\n }\n };\n\n const selectContact = (reqId) => {\n const isAndroid = android && android[selectContactMethod];\n const isIos = ios && ios[selectContactMethod];\n\n if (isAndroid) {\n android[selectContactMethod](reqId);\n } else if (isIos) {\n ios[selectContactMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(selectContactMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--selectContact-isUnknown');\n }\n };\n\n const openSettings = (reqId) => {\n const isAndroid = android && android[openSettingsMethod];\n const isIos = ios && ios[openSettingsMethod];\n\n if (isAndroid) {\n android[openSettingsMethod](reqId);\n } else if (isIos) {\n ios[openSettingsMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(openSettingsMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--openSettings-isUnknown');\n }\n };\n\n const closeApplication = (reqId) => {\n const isAndroid = android && android[closeApplicationMethod];\n const isIos = ios && ios[closeApplicationMethod];\n\n if (isAndroid) {\n android[closeApplicationMethod](reqId);\n } else if (isIos) {\n ios[closeApplicationMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(closeApplicationMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--closeApplication-isUnknown');\n }\n };\n\n const share = (reqId, text) => {\n const isAndroid = android && android[shareMethod];\n const isIos = ios && ios[shareMethod];\n\n if (isAndroid) {\n android[shareMethod](reqId, text);\n } else if (isIos) {\n ios[shareMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(shareMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--share-isUnknown');\n }\n };\n\n const setTitle = (reqId, text) => {\n const isAndroid = android && android[setTitleMethod];\n const isIos = ios && ios[setTitleMethod];\n\n if (isAndroid) {\n android[setTitleMethod](reqId, text);\n } else if (isIos) {\n ios[setTitleMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(setTitleMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--setTitle-isUnknown');\n }\n };\n\n const copyToClipboard = (reqId, text) => {\n const isAndroid = android && android[copyToClipboardMethod];\n const isIos = ios && ios[copyToClipboardMethod];\n\n if (isAndroid) {\n android[copyToClipboardMethod](reqId, text);\n } else if (isIos) {\n ios[copyToClipboardMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(copyToClipboardMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--copyToClipboard-isUnknown');\n }\n };\n\n const enableScreenCapture = (reqId) => {\n const isAndroid = android && android[enableScreenCaptureMethod];\n const isIos = ios && ios[enableScreenCaptureMethod];\n\n if (isAndroid) {\n android[enableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[enableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableScreenCapture-isUnknown');\n }\n };\n\n const disableScreenCapture = (reqId) => {\n const isAndroid = android && android[disableScreenCaptureMethod];\n const isIos = ios && ios[disableScreenCaptureMethod];\n\n if (isAndroid) {\n android[disableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[disableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableScreenCapture-isUnknown');\n }\n };\n\n const shareImage = (reqId, text, image) => {\n // !!!======================!!!\n // !!!===== Deprecated =====!!!\n // !!!======================!!!\n\n // const isAndroid = android && android[shareImageMethod];\n // const isIos = ios && ios[shareImageMethod];\n\n // if (isAndroid) {\n // android[shareImageMethod](reqId, text, image);\n // } else if (isIos) {\n // ios[shareImageMethod].postMessage({ reqId, text, image });\n // } else if (typeof window !== 'undefined') {\n // console.log('--shareImage-isWeb');\n // }\n\n // new one - fallback to shareFile\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n // get extension from base64 mime type and merge with name\n const ext = image.split(';')[0].split('/')[1];\n const filename = 'image.' + ext;\n // remove mime type\n const base64Data = image.substr(image.indexOf(',') + 1);\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, { text, filename, base64Data });\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n };\n\n const shareFile = (reqId, text, filename, base64Data) => {\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, text, filename, base64Data);\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n };\n\n const enableNotifications = () => invokePromise(EInvokeRequest.enableNotifications);\n\n const disableNotifications = () => invokePromise(EInvokeRequest.disableNotifications);\n\n const setShakeHandler = (handler) => {\n const isAndroid = android && android[setShakeHandlerMethod];\n const isIos = ios && ios[setShakeHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeShake = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setShakeHandler-isUnknown');\n }\n };\n\n const setTabActiveHandler = (handler: (tabname: string) => void) => {\n const isAndroid = android && android[setTabActiveHandlerMethod];\n const isIos = ios && ios[setTabActiveHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeTabActive = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setTabActiveHandler-isUnknown');\n }\n };\n\n const vibrate = (reqId, pattern) => {\n if (\n !Array.isArray(pattern) ||\n pattern.some((timing) => timing < 1 || timing !== Math.floor(timing)) ||\n pattern.reduce((total, timing) => total + timing) > 10000\n ) {\n console.error('Pattern should be an array of positive integers no longer than 10000ms total');\n return;\n }\n\n const isAndroid = android && android[vibrateMethod];\n const isIos = ios && ios[vibrateMethod];\n\n if (isAndroid) {\n android[vibrateMethod](reqId, JSON.stringify(pattern));\n } else if (isIos) {\n ios[vibrateMethod].postMessage({ reqId, pattern });\n } else if (web) {\n web.execute(vibrateMethod, reqId, pattern);\n } else if (typeof window !== 'undefined') {\n console.log('--vibrate-isUnknown');\n }\n };\n\n const isSupported = () => {\n const iosSup = ios && (window as any).webkit.messageHandlers.invoke;\n return Boolean(android || iosSup || web);\n };\n\n // TODO: implement web support\n const supports = (method) =>\n (android && typeof android[method] === 'function') ||\n (ios && ios[method] && typeof ios[method].postMessage === 'function') ||\n (web && typeof web[method] === 'function');\n\n const sub = (listener: any) => {\n subs.push(listener);\n };\n\n const createMethod = <Params extends unknown[], Result>(\n name: string,\n options?: {\n transformToObject?: (args: Params) => Record<string, Params[number]>;\n isWebSupported?: boolean;\n }\n ) => {\n const method = (reqId: string, ...args: Params) => {\n const isAndroid = !!android && !!android[name];\n const isIos = !!ios && !!ios[name];\n const isWeb = !!options?.isWebSupported && !!web;\n\n if (isAndroid) {\n android[name](reqId, ...args);\n } else if (isIos) {\n ios[name].postMessage({\n reqId,\n ...options?.transformToObject?.(args),\n });\n } else if (isWeb) {\n web.execute(name as unknown as keyof AituBridge, reqId, ...args);\n } else if (typeof window !== 'undefined') {\n console.log(`--${name}-isUnknown`);\n }\n };\n\n return promisifyMethod(method, name, sub) as (...args: Params) => Promise<Result>;\n };\n\n const setHeaderMenuItems = (reqId, items: Array<HeaderMenuItem>) => {\n if (items.length > MAX_HEADER_MENU_ITEMS_COUNT) {\n console.error('SetHeaderMenuItems: items count should not be more than ' + MAX_HEADER_MENU_ITEMS_COUNT);\n return;\n }\n\n const isAndroid = android && android[setHeaderMenuItemsMethod];\n const isIos = ios && ios[setHeaderMenuItemsMethod];\n\n const itemsJsonArray = JSON.stringify(items);\n\n if (isAndroid) {\n android[setHeaderMenuItemsMethod](reqId, itemsJsonArray);\n } else if (isIos) {\n ios[setHeaderMenuItemsMethod].postMessage({ reqId, itemsJsonArray });\n } else if (web) {\n web.execute(setHeaderMenuItemsMethod, reqId, itemsJsonArray);\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItems-isUnknown');\n }\n };\n\n const setHeaderMenuItemClickHandler = (handler: HeaderMenuItemClickHandlerType) => {\n const isAndroid = android && android[setHeaderMenuItemClickHandlerMethod];\n const isIos = ios && ios[setHeaderMenuItemClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeHeaderMenuItemClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItemClickHandler-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowMode = (reqId, enabled: boolean) => {\n const isAndroid = android && android[setCustomBackArrowModeMethod];\n const isIos = ios && ios[setCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowModeMethod](reqId, enabled);\n } else if (isIos) {\n ios[setCustomBackArrowModeMethod].postMessage({ reqId, enabled });\n } else if (web) {\n web.execute(setCustomBackArrowModeMethod, reqId, enabled);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowMode-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте getNavigationItemMode\n */\n const getCustomBackArrowMode = (reqId) => {\n const isAndroid = android && android[getCustomBackArrowModeMethod];\n const isIos = ios && ios[getCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[getCustomBackArrowModeMethod](reqId);\n } else if (isIos) {\n ios[getCustomBackArrowModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getCustomBackArrowModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getCustomBackArrowMode-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowVisible = (reqId, visible: boolean) => {\n const isAndroid = android && android[setCustomBackArrowVisibleMethod];\n const isIos = ios && ios[setCustomBackArrowVisibleMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowVisibleMethod](reqId, visible);\n } else if (isIos) {\n ios[setCustomBackArrowVisibleMethod].postMessage({ reqId, visible });\n } else if (web) {\n web.execute(setCustomBackArrowVisibleMethod, reqId, visible);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowVisible-isUnknown');\n }\n };\n\n const setCustomBackArrowOnClickHandler = (handler: BackArrowClickHandlerType) => {\n const isAndroid = android && android[setCustomBackArrowOnClickHandlerMethod];\n const isIos = ios && ios[setCustomBackArrowOnClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeBackArrowClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowOnClickHandler-isUnknown');\n }\n };\n\n const openPayment = (reqId, transactionId: string) => {\n const isAndroid = android && android[openPaymentMethod];\n const isIos = ios && ios[openPaymentMethod];\n\n if (isAndroid) {\n android[openPaymentMethod](reqId, transactionId);\n } else if (isIos) {\n ios[openPaymentMethod].postMessage({ reqId, transactionId });\n } else {\n console.log('--openPayment-isUnknown');\n }\n };\n\n const checkBiometry = (reqId) => {\n const isAndroid = android && android[checkBiometryMethod];\n const isIos = ios && ios[checkBiometryMethod];\n\n if (isAndroid) {\n android[checkBiometryMethod](reqId);\n } else if (isIos) {\n ios[checkBiometryMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(checkBiometryMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--checkBiometry-isUnknown');\n }\n };\n\n const openExternalUrl = (reqId, url: string) => {\n const isAndroid = android && android[openExternalUrlMethod];\n const isIos = ios && ios[openExternalUrlMethod];\n\n if (isAndroid) {\n android[openExternalUrlMethod](reqId, url);\n } else if (isIos) {\n ios[openExternalUrlMethod].postMessage({ reqId, url });\n } else {\n console.log('--openExternalUrlMethod-isUnknown');\n }\n };\n\n const enableSwipeBack = (reqId) => {\n const isAndroid = android && android[enableSwipeBackMethod];\n const isIos = ios && ios[enableSwipeBackMethod];\n\n if (isAndroid) {\n android[enableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[enableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableSwipeBack-isUnknown');\n }\n };\n\n const disableSwipeBack = (reqId) => {\n const isAndroid = android && android[disableSwipeBackMethod];\n const isIos = ios && ios[disableSwipeBackMethod];\n\n if (isAndroid) {\n android[disableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[disableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableSwipeBack-isUnknown');\n }\n };\n\n const setNavigationItemMode = (reqId, mode: NavigationItemMode) => {\n const isAndroid = android && android[setNavigationItemModeMethod];\n const isIos = ios && ios[setNavigationItemModeMethod];\n\n if (isAndroid) {\n android[setNavigationItemModeMethod](reqId, mode);\n } else if (isIos) {\n ios[setNavigationItemModeMethod].postMessage({ reqId, mode });\n } else if (web) {\n web.execute(setNavigationItemModeMethod, reqId, mode);\n } else if (typeof window !== 'undefined') {\n console.log('--setNavigationItemMode-isUnknown');\n }\n };\n\n const getNavigationItemMode = (reqId) => {\n const isAndroid = android && android[getNavigationItemModeMethod];\n const isIos = ios && ios[getNavigationItemModeMethod];\n\n if (isAndroid) {\n android[getNavigationItemModeMethod](reqId);\n } else if (isIos) {\n ios[getNavigationItemModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getNavigationItemModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getNavigationItemMode-isUnknown');\n }\n };\n\n const getUserStepInfo = (reqId) => {\n const isAndroid = android && android[getUserStepInfoMethod];\n const isIos = ios && ios[getUserStepInfoMethod];\n\n if (isAndroid) {\n android[getUserStepInfoMethod](reqId);\n } else if (isIos) {\n ios[getUserStepInfoMethod].postMessage({ reqId });\n } else if (web) {\n console.log('--getUserStepInfo-isWeb');\n } else if (typeof window !== 'undefined') {\n console.log('--getUserStepInfo-isUnknown');\n }\n };\n\n const invokePromise = promisifyInvoke(invoke, sub);\n const storagePromise = promisifyStorage(storage, sub);\n const getGeoPromise = promisifyMethod(getGeo, getGeoMethod, sub);\n const getQrPromise = promisifyMethod(getQr, getQrMethod, sub);\n const getSMSCodePromise = promisifyMethod(getSMSCode, getSMSCodeMethod, sub);\n const selectContactPromise = promisifyMethod(selectContact, selectContactMethod, sub);\n const openSettingsPromise = promisifyMethod(openSettings, openSettingsMethod, sub);\n const closeApplicationPromise = promisifyMethod(closeApplication, closeApplicationMethod, sub);\n const sharePromise = promisifyMethod(share, shareMethod, sub);\n const setTitlePromise = promisifyMethod(setTitle, setTitleMethod, sub);\n const copyToClipboardPromise = promisifyMethod(copyToClipboard, copyToClipboardMethod, sub);\n const shareImagePromise = promisifyMethod(shareImage, shareImageMethod, sub);\n const shareFilePromise = promisifyMethod(shareFile, shareFileMethod, sub);\n const vibratePromise = promisifyMethod(vibrate, vibrateMethod, sub);\n const enableScreenCapturePromise = promisifyMethod(enableScreenCapture, enableScreenCaptureMethod, sub);\n const disableScreenCapturePromise = promisifyMethod(disableScreenCapture, disableScreenCaptureMethod, sub);\n const setHeaderMenuItemsPromise = promisifyMethod(setHeaderMenuItems, setHeaderMenuItemsMethod, sub);\n const setCustomBackArrowModePromise = promisifyMethod(setCustomBackArrowMode, setCustomBackArrowModeMethod, sub);\n const getCustomBackArrowModePromise = promisifyMethod(getCustomBackArrowMode, getCustomBackArrowModeMethod, sub);\n const setCustomBackArrowVisiblePromise = promisifyMethod(setCustomBackArrowVisible, setCustomBackArrowVisibleMethod, sub);\n const openPaymentPromise = promisifyMethod(openPayment, openPaymentMethod, sub);\n const checkBiometryPromise = promisifyMethod(checkBiometry, checkBiometryMethod, sub);\n const openExternalUrlPromise = promisifyMethod(openExternalUrl, openExternalUrlMethod, sub);\n const enableSwipeBackPromise = promisifyMethod(enableSwipeBack, enableSwipeBackMethod, sub);\n const disableSwipeBackPromise = promisifyMethod(disableSwipeBack, disableSwipeBackMethod, sub);\n const setNavigationItemModePromise = promisifyMethod(setNavigationItemMode, setNavigationItemModeMethod, sub);\n const getNavigationItemModePromise = promisifyMethod(getNavigationItemMode, getNavigationItemModeMethod, sub);\n const getUserStepInfoPromise = promisifyMethod(getUserStepInfo, getUserStepInfoMethod, sub);\n const isESimSupported = createMethod<never, ResponseType>('isESimSupported');\n const activateESim = createMethod<[activationCode: string], ResponseType>('activateESim', {\n transformToObject: ([activationCode]) => ({\n activationCode,\n }),\n });\n const readNFCData = createMethod<never, string>('readNFCData');\n\n const readNFCPassport = createMethod<[passportNumber: string, dateOfBirth: string, expirationDate: string], PassportDataResponse>(\n 'readNFCPassport',\n {\n transformToObject: ([passportNumber, dateOfBirth, expirationDate]) => ({\n passportNumber,\n dateOfBirth,\n expirationDate,\n }),\n }\n );\n\n const subscribeUserStepInfo = createMethod<never, ResponseType>('subscribeUserStepInfo');\n\n const unsubscribeUserStepInfo = createMethod<never, ResponseType>('unsubscribeUserStepInfo');\n\n const openUserProfile = createMethod<never, ResponseType>('openUserProfile');\n\n return {\n version: VERSION,\n copyToClipboard: copyToClipboardPromise,\n invoke: invokePromise,\n storage: storagePromise,\n getMe: () => invokePromise(EInvokeRequest.getMe),\n getPhone: () => invokePromise(EInvokeRequest.getPhone),\n getContacts: () => invokePromise(EInvokeRequest.getContacts),\n getGeo: getGeoPromise,\n getQr: getQrPromise,\n getSMSCode: getSMSCodePromise,\n getUserProfile: (id: string) => invokePromise(EInvokeRequest.getUserProfile, { id }),\n openUserProfile,\n selectContact: selectContactPromise,\n enableNotifications,\n disableNotifications,\n enablePrivateMessaging: (appId: string) => invokePromise(EInvokeRequest.enablePrivateMessaging, { appId }),\n disablePrivateMessaging: (appId: string) => invokePromise(EInvokeRequest.disablePrivateMessaging, { appId }),\n openSettings: openSettingsPromise,\n closeApplication: closeApplicationPromise,\n setTitle: setTitlePromise,\n share: sharePromise,\n shareImage: shareImagePromise,\n shareFile: shareFilePromise,\n setShakeHandler,\n setTabActiveHandler,\n vibrate: vibratePromise,\n isSupported,\n supports,\n sub,\n enableScreenCapture: enableScreenCapturePromise,\n disableScreenCapture: disableScreenCapturePromise,\n setHeaderMenuItems: setHeaderMenuItemsPromise,\n setHeaderMenuItemClickHandler,\n setCustomBackArrowMode: setCustomBackArrowModePromise,\n getCustomBackArrowMode: getCustomBackArrowModePromise,\n setCustomBackArrowVisible: setCustomBackArrowVisiblePromise,\n openPayment: openPaymentPromise,\n setCustomBackArrowOnClickHandler,\n checkBiometry: checkBiometryPromise,\n openExternalUrl: openExternalUrlPromise,\n enableSwipeBack: enableSwipeBackPromise,\n disableSwipeBack: disableSwipeBackPromise,\n setNavigationItemMode: setNavigationItemModePromise,\n getNavigationItemMode: getNavigationItemModePromise,\n getUserStepInfo: getUserStepInfoPromise,\n isESimSupported,\n activateESim,\n readNFCData,\n subscribeUserStepInfo,\n unsubscribeUserStepInfo,\n readNFCPassport,\n };\n};\n\n/**\n * @public\n * AituBridge instance for interacting with the Aitu mini-app environment.\n */\nconst bridge = buildBridge();\n\nexport default bridge;\n"],"names":["createRequestResolver","prefix","counter","current","next","this","createCounter","promiseControllers","add","controller","customId","id","resolve","reqId","data","isSuccess","error","requestPromise","reject","handleSubscribe","subscribe","requestResolver","event","detail","_event$detail","promisifyMethod","method","methodName","_arguments","arguments","Promise","apply","concat","slice","call","aituOrigin","URLSearchParams","window","location","search","get","localStorage","setItem","getItem","WebBridge","origin","execute","top","postMessage","source","payload","addEventListener","dispatchEvent","CustomEvent","message","JSON","parse","onAituBridgeBackArrowClick","onAituBridgeHeaderMenuItemClick","param","e","console","log","BridgeErrors","EInvokeRequest","HeaderMenuIcon","NavigationItemMode","invokeMethod","storageMethod","getGeoMethod","getQrMethod","getSMSCodeMethod","selectContactMethod","openSettingsMethod","closeApplicationMethod","shareMethod","setTitleMethod","copyToClipboardMethod","shareFileMethod","setShakeHandlerMethod","vibrateMethod","enableScreenCaptureMethod","disableScreenCaptureMethod","setTabActiveHandlerMethod","setHeaderMenuItemsMethod","setHeaderMenuItemClickHandlerMethod","setCustomBackArrowModeMethod","getCustomBackArrowModeMethod","setCustomBackArrowVisibleMethod","openPaymentMethod","setCustomBackArrowOnClickHandlerMethod","checkBiometryMethod","openExternalUrlMethod","enableSwipeBackMethod","disableSwipeBackMethod","setNavigationItemModeMethod","getNavigationItemModeMethod","getUserStepInfoMethod","android","AndroidBridge","ios","webkit","messageHandlers","web","bridge","subs","map","fn","sub","listener","push","createMethod","name","options","args","isIos","isWeb","isWebSupported","_extends","transformToObject","invokePromise","invokeMethodName","props","stringify","invoke","storagePromise","storage","keyName","keyValue","clear","promisifyStorage","getGeoPromise","getQrPromise","getSMSCodePromise","selectContactPromise","openSettingsPromise","closeApplicationPromise","sharePromise","text","setTitlePromise","copyToClipboardPromise","shareImagePromise","image","isAndroid","filename","split","base64Data","substr","indexOf","shareFilePromise","vibratePromise","pattern","Array","isArray","some","timing","Math","floor","reduce","total","enableScreenCapturePromise","disableScreenCapturePromise","setHeaderMenuItemsPromise","items","length","itemsJsonArray","setCustomBackArrowModePromise","enabled","getCustomBackArrowModePromise","setCustomBackArrowVisiblePromise","visible","openPaymentPromise","transactionId","checkBiometryPromise","openExternalUrlPromise","url","enableSwipeBackPromise","disableSwipeBackPromise","setNavigationItemModePromise","mode","getNavigationItemModePromise","getUserStepInfoPromise","isESimSupported","activateESim","_ref","activationCode","readNFCData","readNFCPassport","_ref2","passportNumber","dateOfBirth","expirationDate","subscribeUserStepInfo","unsubscribeUserStepInfo","openUserProfile","version","copyToClipboard","getMe","getPhone","getContacts","getGeo","getQr","getSMSCode","getUserProfile","selectContact","enableNotifications","disableNotifications","enablePrivateMessaging","appId","disablePrivateMessaging","openSettings","closeApplication","setTitle","share","shareImage","shareFile","setShakeHandler","handler","onAituBridgeShake","setTabActiveHandler","onAituBridgeTabActive","vibrate","isSupported","iosSup","Boolean","supports","enableScreenCapture","disableScreenCapture","setHeaderMenuItems","setHeaderMenuItemClickHandler","setCustomBackArrowMode","getCustomBackArrowMode","setCustomBackArrowVisible","openPayment","setCustomBackArrowOnClickHandler","checkBiometry","openExternalUrl","enableSwipeBack","disableSwipeBack","setNavigationItemMode","getNavigationItemMode","getUserStepInfo","buildBridge","msg","startsWith","PermissionDenyError","PermissionSecurityDenyError","OtherError"],"mappings":"wNASA,SAASA,EAAsBC,GAM3B,IAAMC,EAfV,SAAuBD,GACnB,YADmBA,IAAAA,IAAAA,EAAS,MACrB,CACHE,QAAS,EACTC,KAAA,WACI,OAAOH,KAAWI,KAAKF,OAC3B,EAER,CAQoBG,CAAcL,GACxBM,EAA+D,CAAA,EAErE,MAAO,CACHC,aAAIC,EAA+BC,YAAAA,IAAAA,EAAW,IAC1C,IAAMC,EAAKD,EAAWR,EAAQE,OAE9B,OADAG,EAAmBI,GAAMF,EAClBE,CACX,EAEAC,QAAA,SAAWC,EAAwBC,EAASC,EAAiCC,GACzE,IAAMC,EAAiBV,EAAmBM,GAEtCI,IACIF,EAAUC,GACVC,EAAeL,QAAQE,GAEvBG,EAAeC,OAAOF,GAG1BT,EAAmBM,GAAS,KAEpC,EAER,CAEA,SAASM,EAAgBC,EAAoDC,GACzED,EAAU,SAA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AAAA,EAAEuL,IAAIC,WALU,4BAMvB,OAAOrL,QAAYA,aAACuL,2BAE3B,CACD,OAAOvL,QAAYA,aAACwL,UACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.modern.mjs","sources":["../src/utils.ts","../src/webBridge.ts","../src/error.ts","../src/index.ts"],"sourcesContent":["function createCounter(prefix = 'm:') {\n return {\n current: 0,\n next() {\n return prefix + ++this.current;\n },\n };\n}\n\nfunction createRequestResolver(prefix: string) {\n type PromiseController = {\n resolve: (value: any) => any;\n reject: (reason: any) => any;\n };\n\n const counter = createCounter(prefix);\n const promiseControllers: Record<string, PromiseController | null> = {};\n\n return {\n add(controller: PromiseController, customId = ''): number | string {\n const id = customId + counter.next()\n promiseControllers[id] = controller;\n return id;\n },\n\n resolve<T>(reqId: number | string, data: T, isSuccess: (data: T) => boolean, error: any) {\n const requestPromise = promiseControllers[reqId];\n\n if (requestPromise) {\n if (isSuccess(error)) {\n requestPromise.resolve(data);\n } else {\n requestPromise.reject(error);\n }\n\n promiseControllers[reqId] = null;\n }\n },\n };\n}\n\nfunction handleSubscribe(subscribe: (handler: (event: any) => void) => void, requestResolver: ReturnType<typeof createRequestResolver>) {\n subscribe(event => {\n if (!event.detail) {\n return;\n }\n\n if ('reqId' in event.detail) {\n const { reqId, data, error } = event.detail;\n\n if (reqId) {\n requestResolver.resolve(reqId, data, (error) => !(error), error);\n }\n }\n })\n}\n\nexport function promisifyStorage(storage, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('storage:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return {\n setItem: (keyName: string, keyValue: string): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'setItem', { keyName, keyValue });\n });\n },\n getItem: (keyName: string): Promise<string | null> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'getItem', { keyName });\n });\n },\n clear: (): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'clear', {});\n });\n },\n }\n}\n\nexport function promisifyInvoke(invoke, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('invoke:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(invokeMethodName: string, props: any = {}): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject }, invokeMethodName + ':');\n\n invoke(reqId, invokeMethodName, props);\n });\n };\n}\n\nexport function promisifyMethod(method: Function, methodName: string, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver(methodName + ':');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(...args: any[]): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n method(reqId, ...args);\n });\n };\n}\n\n\n\n","import type { AituBridge } from './index';\n\nconst AITU_DOMAIN_PARAM = '__aitu-domain'\n\nconst searchParams = new URLSearchParams(window.location.search)\n\nlet aituOrigin = searchParams.get(AITU_DOMAIN_PARAM)\n\nif(aituOrigin){\n localStorage.setItem('mini-app-domain', aituOrigin)\n}else{\n aituOrigin = localStorage.getItem('mini-app-domain')\n}\ninterface WebBridge {\n execute(method: keyof AituBridge, reqId: string, ...payload: any[] ): void\n origin: string\n}\n\nlet WebBridge: WebBridge | null = null\n\nif (aituOrigin) {\n WebBridge = {\n origin: aituOrigin,\n execute: (method, reqId, ...payload) => {\n window.top.postMessage({\n source: 'aitu-bridge',\n method,\n reqId,\n payload: [...payload],\n },\n WebBridge.origin\n )\n }\n\n }\n window.addEventListener('message', event => {\n if (event.origin === aituOrigin && event.data) {\n\n // dispatch aitu events\n window.dispatchEvent(new CustomEvent('aituEvents', { detail: event.data }));\n\n // try to detect handler call\n if (typeof event.data !== 'string' || event.data === '') {\n return;\n }\n\n try {\n const message = JSON.parse(event.data)\n\n if (message && message['method']) {\n if (message.method === 'setCustomBackArrowOnClickHandler') {\n (window as any).onAituBridgeBackArrowClick()\n } else if (message.method === 'setHeaderMenuItemClickHandler') {\n (window as any).onAituBridgeHeaderMenuItemClick(message.param)\n }\n }\n } catch (e) {\n console.log('Error parsing message data: ' + e);\n }\n }\n })\n}\n\nexport default WebBridge\n","/**\n * @public\n */\nexport enum BridgeErrors {\n PermissionDenyError,\n PermissionSecurityDenyError,\n OtherError\n}\n\n/**\n * @public\n */\nexport const classifyBridgeError = (e: any): BridgeErrors => {\n const permissionDeny = \"permission deny\";\n const permissionSecurityDeny = \"permission security deny\";\n\n if (e.msg) {\n if (e.msg.startsWith(permissionDeny)) {\n return BridgeErrors.PermissionDenyError;\n } else if (e.msg.startsWith(permissionSecurityDeny)) {\n return BridgeErrors.PermissionSecurityDenyError\n }\n }\n return BridgeErrors.OtherError;\n}\n","/**\n * Aitu Bridge is a JavaScript library designed to simplify integration with the Aitu Superapp.\n * It allows your application to access platform features such as retrieving a user’s phone number or geolocation.\n * {@link https://docs.aitu.io/aituapps/aitu.apps/methods | Read the official documentation to learn more.}\n * @packageDocumentation\n */\n\nimport { promisifyMethod, promisifyStorage, promisifyInvoke } from './utils';\n\nimport WebBridge from './webBridge';\nexport * from './error';\n\ndeclare const VERSION: string;\n\n/**\n * @public\n */\nexport enum EInvokeRequest {\n getMe = 'GetMe',\n getPhone = 'GetPhone',\n getContacts = 'GetContacts',\n getUserProfile = 'GetUserProfile',\n enableNotifications = 'AllowNotifications',\n disableNotifications = 'DisableNotifications',\n enablePrivateMessaging = 'EnablePrivateMessaging',\n disablePrivateMessaging = 'DisablePrivateMessaging',\n}\n\n/**\n * @public\n * Represents a header menu item click handler.\n */\nexport type HeaderMenuItemClickHandlerType = (id: string) => Promise<void>;\n\n/**\n * @public\n * Represents a back arrow click handler.\n */\nexport type BackArrowClickHandlerType = () => Promise<void>;\n\n/**\n * @public\n * Represents an error that can occur during NFC passport operations.\n */\nexport interface NFCPassportError {\n /**\n * Error code indicating the type of NFC passport issue.\n *\n * - `nfc_passport_mismatch` — The passport does not match the requested parameters\n * (date of birth, passport number, expiration date).\n * - `nfc_document_read_failure` — Document reading error\n * (read errors, algorithm errors, unknown algorithms, other documents that are not passports, etc.).\n * - `nfc_session_timeout` — Session timeout: the document reading was not completed\n * in time (depends on the OS).\n * - `nfc_permission_denied` — The user denied NFC permission or the device has no NFC chip.\n * - `nfc_session_cancelled` — The user cancelled the NFC session (iOS).\n */\n code: 'nfc_passport_mismatch' | 'nfc_document_read_failure' | 'nfc_session_timeout' | 'nfc_permission_denied' | 'nfc_session_cancelled';\n\n /**\n * Human-readable error message describing the issue.\n */\n msg: string;\n}\n\n/**\n * @public\n * Represents an error indicating that the app URL does not match the expected value.\n */\nexport interface AppUrlDoesntMatchError {\n code: 'url_does_not_match';\n msg: string;\n}\n\n/**\n * @public\n * Represents a permission denied error.\n */\nexport interface PermissionDeniedError {\n code: 'permission_denied';\n msg: string;\n meta: {\n can_retry: boolean;\n };\n}\n\n/**\n * @public\n * Represents phone number response.\n */\nexport interface GetPhoneResponse {\n phone: string;\n sign: string;\n}\n\n/**\n * @public\n * Represents user information response.\n */\nexport interface GetMeResponse {\n name: string;\n lastname: string;\n id: string;\n avatar?: string;\n avatarThumb?: string;\n notifications_allowed: boolean;\n private_messaging_enabled: boolean;\n sign: string;\n}\n\n/**\n * @public\n * Represents a generic response object.\n */\nexport interface ResponseObject {\n phone?: string;\n name?: string;\n lastname?: string;\n}\n\n/**\n * @public\n * Represents a geographic location response.\n */\nexport interface GetGeoResponse {\n latitude: number;\n longitude: number;\n}\n\n/**\n * @public\n * Represents a contacts list response.\n */\nexport interface GetContactsResponse {\n contacts: Array<{\n first_name: string;\n last_name: string;\n phone: string;\n }>;\n sign: string;\n}\n\n/**\n * @public\n * Represents a selected contact response.\n */\nexport interface SelectContactResponse {\n phone: string;\n name: string;\n lastname: string;\n}\n\n/**\n * @public\n * Represents a user profile response.\n */\nexport interface GetUserProfileResponse {\n name: string;\n lastname?: string;\n phone?: string;\n avatar?: string;\n avatarThumb?: string;\n}\n\nconst MAX_HEADER_MENU_ITEMS_COUNT = 3;\n\n/**\n * @public\n * Represents header menu item icons.\n */\nexport enum HeaderMenuIcon {\n Search = 'Search',\n ShoppingCart = 'ShoppingCart',\n Menu = 'Menu',\n Share = 'Share',\n Notifications = 'Notifications',\n Help = 'Help',\n Error = 'Error',\n Person = 'Person',\n Sort = 'Sort',\n Filter = 'Filter',\n Close = 'Close',\n SystemNotifications = 'SystemNotifications',\n}\n\n/**\n * @public\n * Represents navigation item display modes.\n */\nexport enum NavigationItemMode {\n SystemBackArrow = 'SystemBackArrow',\n CustomBackArrow = 'CustomBackArrow',\n NoItem = 'NoItem',\n UserProfile = 'UserProfile',\n}\n\n/**\n * @public\n * Represents a header menu item.\n */\nexport interface HeaderMenuItem {\n id: string;\n icon: HeaderMenuIcon;\n badge?: string;\n}\n\n/**\n * @public\n * Represents user steps per day.\n */\nexport interface UserStepsPerDay {\n date: string;\n steps: number;\n}\n\n/**\n * @public\n * Represents a user step information response.\n */\nexport interface UserStepInfoResponse {\n steps: UserStepsPerDay[];\n}\n\n/**\n * @public\n * Represents a successful response.\n */\nexport type SuccessResponse = 'success';\n\n/**\n * @public\n * Represents the status of a response.\n *\n * - `success` — The operation completed successfully.\n * - `failed` — The operation failed.\n */\nexport type ResponseType = SuccessResponse | 'failed';\n\n/**\n * @public\n * Represents biometry check response.\n */\nexport type BiometryResponse = ResponseType | 'unavailable' | 'cancelled';\n\n/**\n * @public\n * Represents passport data read from an NFC chip.\n */\nexport interface PassportDataResponse {\n documentNumber: string;\n dateOfBirth: string;\n dateOfExpiry: string;\n firstName: string;\n lastName: string;\n gender: string;\n nationality: string;\n documentType: string;\n}\n\n/**\n * @public\n * Generic bridge invocation type.\n */\nexport type BridgeInvoke<T extends EInvokeRequest, R> = (method: T, data?: {}) => Promise<R>;\n\n/**\n * @public\n * Interface for persistent key-value storage.\n */\nexport interface BridgeStorage {\n setItem: (keyName: string, keyValue: string) => Promise<void>;\n getItem: (keyName: string) => Promise<string | null>;\n clear: () => Promise<void>;\n}\n\n/**\n * @public\n * Main interface for interacting with the Aitu Bridge API.\n */\nexport interface AituBridge {\n /**\n * Version of the Aitu Bridge API available in SemVer format.\n */\n version: string;\n\n /**\n * Low-level bridge invocation method used internally\n * to communicate with native Aitu functionality.\n */\n invoke: BridgeInvoke<EInvokeRequest, ResponseObject>;\n\n /**\n * Provides access to persistent key-value storage\n * scoped to the current mini-app.\n */\n storage: BridgeStorage;\n\n /**\n * Returns basic information about the currently authorized user.\n * @returns A promise resolving to a {@link GetMeResponse} containing user details.\n */\n getMe: () => Promise<GetMeResponse>;\n\n /**\n * Requests the user's phone number after explicit user confirmation.\n * @returns A promise resolving to a {@link GetPhoneResponse} containing the phone number.\n */\n getPhone: () => Promise<GetPhoneResponse>;\n\n /**\n * Requests access to the user's contact list.\n * @returns A promise resolving to a {@link GetContactsResponse} containing the contacts.\n */\n getContacts: () => Promise<GetContactsResponse>;\n\n /**\n * Retrieves the user's current geographic location.\n * @returns A promise resolving to a {@link GetGeoResponse} containing latitude and longitude.\n */\n getGeo: () => Promise<GetGeoResponse>;\n\n /**\n * Opens the native contact picker UI and allows the user\n * to select a single contact.\n * @returns A promise resolving to a {@link SelectContactResponse} containing the selected contact details.\n */\n selectContact: () => Promise<SelectContactResponse>;\n\n /**\n * Opens the device camera and scans a QR code.\n * @returns A string with the result of scanning the QR code is returned.\n */\n getQr: () => Promise<string>;\n\n /**\n * Requests an SMS verification code from the user.\n * @returns A string with code is returned.\n */\n getSMSCode: () => Promise<string>;\n\n /**\n * Retrieves public profile information for a specific user.\n *\n * @param userId - Aitu user identifier\n * @returns A promise resolving to a {@link GetUserProfileResponse} containing the user's profile data.\n */\n getUserProfile: (userId: string) => Promise<GetUserProfileResponse>;\n /**\n * Opens the user's profile within the host application.\n * @returns A promise that resolves with a {@link ResponseType} indicating the result of the operation.\n */\n openUserProfile: () => Promise<ResponseType>;\n\n /**\n * Opens the system share dialog with a text payload.\n *\n * @param text - Text to share\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.\n */\n share: (text: string) => Promise<ResponseType>;\n\n /**\n * Sets the title displayed in the mini-app header.\n *\n * @param text - Header title\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n setTitle: (text: string) => Promise<ResponseType>;\n\n /**\n * Copies the specified text to the system clipboard.\n *\n * @param text - Text to copy\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the copy operation.\n */\n copyToClipboard: (text: string) => Promise<ResponseType>;\n\n /**\n * Shares an image with an optional text description.\n *\n * @deprecated Use {@link AituBridge.shareFile} instead.\n * @param text - Description text\n * @param image - Image data encoded in Base64\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.\n */\n shareImage: (text: string, image: string) => Promise<ResponseType>;\n\n /**\n * Shares a file via the system sharing interface.\n *\n * @param text - Description text\n * @param filename - Name of the file\n * @param base64Data - File data encoded in Base64\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.\n */\n shareFile: (text: string, filename: string, base64Data: string) => Promise<ResponseType>;\n\n /**\n * Enables push notifications for the mini-app.\n */\n enableNotifications: () => Promise<{}>;\n\n /**\n * Disables push notifications for the mini-app.\n */\n disableNotifications: () => Promise<{}>;\n\n /**\n * Enables private messaging between the mini-app and the user.\n *\n * @param appId - Mini-app identifier\n */\n enablePrivateMessaging: (appId: string) => Promise<string>;\n\n /**\n * Disables private messaging between the mini-app and the user.\n *\n * @param appId - Mini-app identifier\n */\n disablePrivateMessaging: (appId: string) => Promise<string>;\n\n /**\n * Opens the Aitu application settings screen.\n * @returns A promise resolving to a ResponseType indicating the result of the operation.\n */\n openSettings: () => Promise<ResponseType>;\n\n /**\n * Closes the current mini-app.\n * @returns A promise resolving to a ResponseType indicating the result of the operation.\n */\n closeApplication: () => Promise<ResponseType>;\n\n /**\n * Registers a handler that is triggered when the device is shaken.\n * @param handler - Shake event handler\n */\n setShakeHandler: (handler: any) => void;\n\n /**\n * Registers a handler that is triggered when a tab becomes active.\n *\n * @param handler - Callback with active tab name\n */\n setTabActiveHandler: (handler: (tabname: string) => void) => void;\n\n /**\n * Triggers device vibration using a custom vibration pattern.\n *\n * @param pattern - Array of vibration durations in milliseconds\n * @returns A promise resolving to a {@link SuccessResponse} indicating the result of the vibration operation.\n */\n vibrate: (pattern: number[]) => Promise<SuccessResponse>;\n\n /**\n * Indicates whether the current environment supports Aitu Bridge.\n * @returns A boolean indicating support status.\n */\n isSupported: () => boolean;\n\n /**\n * Checks whether a specific bridge method is supported.\n *\n * @param method - Method name\n * @returns A boolean indicating support status.\n */\n supports: (method: string) => boolean;\n /**\n * Subscribes to Aitu Bridge events.\n */\n sub: any;\n\n /**\n * Enables protection against screenshots and screen recording.\n */\n enableScreenCapture: () => Promise<{}>;\n\n /**\n * Disables protection against screenshots and screen recording.\n */\n disableScreenCapture: () => Promise<{}>;\n\n /**\n * Sets custom menu items in the mini-app header.\n *\n * @param items - Header menu configuration\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n setHeaderMenuItems: (items: Array<HeaderMenuItem>) => Promise<ResponseType>;\n\n /**\n * Registers a click handler for header menu items.\n * @param handler - Header menu item click handler\n */\n setHeaderMenuItemClickHandler: (handler: HeaderMenuItemClickHandlerType) => void;\n\n /**\n * Enables or disables custom back arrow handling.\n *\n * @param enabled - Whether custom handling is enabled\n * @returns A promise resolving to a ResponseType indicating the result of the operation.\n */\n setCustomBackArrowMode: (enabled: boolean) => Promise<ResponseType>;\n\n /**\n * Returns whether custom back arrow mode is enabled.\n * @returns A promise resolving to a boolean indicating the current mode.\n */\n getCustomBackArrowMode: () => Promise<boolean>;\n\n /**\n * Controls the visibility of the custom back arrow.\n *\n * @param visible - Arrow visibility state\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;\n /**\n * Opens the payment interface for a specified transaction.\n * @param transactionId - Transaction identifier\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the payment operation.\n */\n openPayment: (transactionId: string) => Promise<ResponseType>;\n /**\n * Sets a custom handler for back arrow click events.\n * @param handler - Back arrow click handler\n */\n setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;\n /**\n * Checks biometric authentication status.\n * @returns A promise resolving to a {@link BiometryResponse} indicating the result of the check.\n */\n checkBiometry: () => Promise<BiometryResponse>;\n\n /**\n * Opens an external URL outside the mini-app context.\n *\n * @param url - External URL to open\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.\n */\n openExternalUrl: (url: string) => Promise<ResponseType>;\n\n /**\n * Enables swipe-back navigation gesture.\n * @returns A promise resolving to a {@link ResponseType} when the gesture is enabled.\n */\n enableSwipeBack: () => Promise<ResponseType>;\n\n /**\n * Disables swipe-back navigation gesture.\n * @returns A promise resolving to a {@link ResponseType} when the gesture is disabled.\n */\n disableSwipeBack: () => Promise<ResponseType>;\n\n /**\n * Sets the navigation item display mode.\n *\n * @param mode - Navigation item mode\n * @returns A promise that resolves when the mode is set.\n */\n setNavigationItemMode: (mode: NavigationItemMode) => Promise<void>;\n\n /**\n * Returns the current navigation item mode.\n * @returns A promise resolving to the current {@link NavigationItemMode}.\n */\n getNavigationItemMode: () => Promise<NavigationItemMode>;\n\n /**\n * Retrieves step count data from HealthKit or Google Fit.\n * @returns A promise resolving to a {@link UserStepInfoResponse} containing the user's step data.\n */\n getUserStepInfo: () => Promise<UserStepInfoResponse>;\n\n /**\n * Checks whether eSIM is supported on the device.\n * @returns A promise resolving to a {@link ResponseType} indicating if eSIM is supported.\n */\n isESimSupported: () => Promise<ResponseType>;\n\n /**\n * Activates an eSIM using the provided activation code.\n *\n * @param activationCode - eSIM activation code\n * @returns A promise resolving to a {@link ResponseType} indicating the result of the activation.\n */\n activateESim: (activationCode: string) => Promise<ResponseType>;\n\n /**\n * Reads raw data from an NFC tag.\n * @returns A promise resolving to a string containing the raw NFC data.\n */\n readNFCData: () => Promise<string>;\n /**\n * Subscribes to user step updates from HealthKit/Google Fit.\n *\n * Establishes a real-time subscription that listens for step count changes\n * from the underlying health data provider. The promise resolves once the\n * subscription request has been processed. To stop receiving updates, call\n * {@link AituBridge.unsubscribeUserStepInfo}.\n *\n * @returns A promise that resolves with a `ResponseType` indicating\n * whether the subscription was successfully created.\n */\n subscribeUserStepInfo: () => Promise<ResponseType>;\n /**\n * Unsubscribes from user step updates from HealthKit/Google Fit.\n *\n * Stops the active step-count subscription created by\n * {@link AituBridge.subscribeUserStepInfo}. Once unsubscribed, no further step updates\n * will be delivered.\n *\n * @returns A promise that resolves with a `ResponseType` indicating\n * whether the unsubscription was successful.\n */\n unsubscribeUserStepInfo: () => Promise<ResponseType>;\n /**\n * Reads data from the NFC chip of an ePassport using BAC (Basic Access Control).\n *\n * Initiates a BAC-protected NFC read operation on an ePassport. The caller must\n * provide the passport number, date of birth, and expiration date—values taken\n * from the machine-readable zone (MRZ). These values are used to derive the\n * cryptographic access keys required by BAC to open a secure session with the\n * passport’s NFC chip.\n *\n * Once BAC is successfully established, the function retrieves data groups\n * from the chip, typically including the holder’s biographical information\n * (DG1) and, if supported and permitted, biometric data such as the facial\n * image (DG2).\n *\n * @param passportNumber - Passport number taken from the MRZ.\n * @param dateOfBirth - Holder’s date of birth (MRZ format: YYMMDD).\n * @param expirationDate - Passport expiration date (MRZ format: YYMMDD).\n *\n * @returns A promise resolving to a `PassportDataResponse` containing the decoded\n * data groups read from the passport’s NFC chip.\n *\n * @throws {@link NFCPassportError} When an NFC passport operation fails. Possible codes:\n * - `nfc_passport_mismatch` — Passport does not match the provided MRZ values.\n * - `nfc_document_read_failure` — General failure to read the document.\n * - `nfc_session_timeout` — NFC session timed out before completion.\n * - `nfc_permission_denied` — NFC permission denied or NFC unavailable.\n * - `nfc_session_cancelled` — User cancelled the NFC session (iOS).\n */\n readNFCPassport: (passportNumber: string, dateOfBirth: string, expirationDate: string) => Promise<PassportDataResponse>;\n}\n\nconst invokeMethod = 'invoke';\nconst storageMethod = 'storage';\nconst getGeoMethod = 'getGeo';\nconst getQrMethod = 'getQr';\nconst getSMSCodeMethod = 'getSMSCode';\nconst selectContactMethod = 'selectContact';\nconst openSettingsMethod = 'openSettings';\nconst closeApplicationMethod = 'closeApplication';\nconst shareMethod = 'share';\nconst setTitleMethod = 'setTitle';\nconst copyToClipboardMethod = 'copyToClipboard';\nconst shareImageMethod = 'shareImage';\nconst shareFileMethod = 'shareFile';\nconst setShakeHandlerMethod = 'setShakeHandler';\nconst vibrateMethod = 'vibrate';\nconst enableScreenCaptureMethod = 'enableScreenCapture';\nconst disableScreenCaptureMethod = 'disableScreenCapture';\nconst setTabActiveHandlerMethod = 'setTabActiveHandler';\nconst setHeaderMenuItemsMethod = 'setHeaderMenuItems';\nconst setHeaderMenuItemClickHandlerMethod = 'setHeaderMenuItemClickHandler';\nconst setCustomBackArrowModeMethod = 'setCustomBackArrowMode';\nconst getCustomBackArrowModeMethod = 'getCustomBackArrowMode';\nconst setCustomBackArrowVisibleMethod = 'setCustomBackArrowVisible';\nconst openPaymentMethod = 'openPayment';\nconst setCustomBackArrowOnClickHandlerMethod = 'setCustomBackArrowOnClickHandler';\nconst checkBiometryMethod = 'checkBiometry';\nconst openExternalUrlMethod = 'openExternalUrl';\nconst enableSwipeBackMethod = 'enableSwipeBack';\nconst disableSwipeBackMethod = 'disableSwipeBack';\nconst setNavigationItemModeMethod = 'setNavigationItemMode';\nconst getNavigationItemModeMethod = 'getNavigationItemMode';\nconst getUserStepInfoMethod = 'getUserStepInfo';\n\nconst android = typeof window !== 'undefined' && (window as any).AndroidBridge;\nconst ios = typeof window !== 'undefined' && (window as any).webkit && (window as any).webkit.messageHandlers;\nconst web = typeof window !== 'undefined' && window.top !== window && WebBridge;\n\nconst buildBridge = (): AituBridge => {\n const subs = [];\n\n if (typeof window !== 'undefined') {\n window.addEventListener('aituEvents', (e: any) => {\n [...subs].map((fn) => fn.call(null, e));\n });\n }\n\n const invoke = (reqId, method, data = {}) => {\n const isAndroid = android && android[invokeMethod];\n const isIos = ios && ios[invokeMethod];\n\n if (isAndroid) {\n android[invokeMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[invokeMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(invokeMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--invoke-isUnknown');\n }\n };\n\n const storage = (reqId, method, data = {}) => {\n const isAndroid = android && android[storageMethod];\n const isIos = ios && ios[storageMethod];\n\n if (isAndroid) {\n android[storageMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[storageMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(storageMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--storage-isUnknown');\n }\n };\n\n const getGeo = (reqId) => {\n const isAndroid = android && android[getGeoMethod];\n const isIos = ios && ios[getGeoMethod];\n\n if (isAndroid) {\n android[getGeoMethod](reqId);\n } else if (isIos) {\n ios[getGeoMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getGeoMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getGeo-isUnknown');\n }\n };\n\n const getQr = (reqId) => {\n const isAndroid = android && android[getQrMethod];\n const isIos = ios && ios[getQrMethod];\n\n if (isAndroid) {\n android[getQrMethod](reqId);\n } else if (isIos) {\n ios[getQrMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getQrMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getQr-isUnknown');\n }\n };\n\n const getSMSCode = (reqId) => {\n const isAndroid = android && android[getSMSCodeMethod];\n const isIos = ios && ios[getSMSCodeMethod];\n\n if (isAndroid) {\n android[getSMSCodeMethod](reqId);\n } else if (isIos) {\n ios[getSMSCodeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getSMSCodeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getSMSCode-isUnknown');\n }\n };\n\n const selectContact = (reqId) => {\n const isAndroid = android && android[selectContactMethod];\n const isIos = ios && ios[selectContactMethod];\n\n if (isAndroid) {\n android[selectContactMethod](reqId);\n } else if (isIos) {\n ios[selectContactMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(selectContactMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--selectContact-isUnknown');\n }\n };\n\n const openSettings = (reqId) => {\n const isAndroid = android && android[openSettingsMethod];\n const isIos = ios && ios[openSettingsMethod];\n\n if (isAndroid) {\n android[openSettingsMethod](reqId);\n } else if (isIos) {\n ios[openSettingsMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(openSettingsMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--openSettings-isUnknown');\n }\n };\n\n const closeApplication = (reqId) => {\n const isAndroid = android && android[closeApplicationMethod];\n const isIos = ios && ios[closeApplicationMethod];\n\n if (isAndroid) {\n android[closeApplicationMethod](reqId);\n } else if (isIos) {\n ios[closeApplicationMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(closeApplicationMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--closeApplication-isUnknown');\n }\n };\n\n const share = (reqId, text) => {\n const isAndroid = android && android[shareMethod];\n const isIos = ios && ios[shareMethod];\n\n if (isAndroid) {\n android[shareMethod](reqId, text);\n } else if (isIos) {\n ios[shareMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(shareMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--share-isUnknown');\n }\n };\n\n const setTitle = (reqId, text) => {\n const isAndroid = android && android[setTitleMethod];\n const isIos = ios && ios[setTitleMethod];\n\n if (isAndroid) {\n android[setTitleMethod](reqId, text);\n } else if (isIos) {\n ios[setTitleMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(setTitleMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--setTitle-isUnknown');\n }\n };\n\n const copyToClipboard = (reqId, text) => {\n const isAndroid = android && android[copyToClipboardMethod];\n const isIos = ios && ios[copyToClipboardMethod];\n\n if (isAndroid) {\n android[copyToClipboardMethod](reqId, text);\n } else if (isIos) {\n ios[copyToClipboardMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(copyToClipboardMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--copyToClipboard-isUnknown');\n }\n };\n\n const enableScreenCapture = (reqId) => {\n const isAndroid = android && android[enableScreenCaptureMethod];\n const isIos = ios && ios[enableScreenCaptureMethod];\n\n if (isAndroid) {\n android[enableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[enableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableScreenCapture-isUnknown');\n }\n };\n\n const disableScreenCapture = (reqId) => {\n const isAndroid = android && android[disableScreenCaptureMethod];\n const isIos = ios && ios[disableScreenCaptureMethod];\n\n if (isAndroid) {\n android[disableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[disableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableScreenCapture-isUnknown');\n }\n };\n\n const shareImage = (reqId, text, image) => {\n // !!!======================!!!\n // !!!===== Deprecated =====!!!\n // !!!======================!!!\n\n // const isAndroid = android && android[shareImageMethod];\n // const isIos = ios && ios[shareImageMethod];\n\n // if (isAndroid) {\n // android[shareImageMethod](reqId, text, image);\n // } else if (isIos) {\n // ios[shareImageMethod].postMessage({ reqId, text, image });\n // } else if (typeof window !== 'undefined') {\n // console.log('--shareImage-isWeb');\n // }\n\n // new one - fallback to shareFile\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n // get extension from base64 mime type and merge with name\n const ext = image.split(';')[0].split('/')[1];\n const filename = 'image.' + ext;\n // remove mime type\n const base64Data = image.substr(image.indexOf(',') + 1);\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, { text, filename, base64Data });\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n };\n\n const shareFile = (reqId, text, filename, base64Data) => {\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, text, filename, base64Data);\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n };\n\n const enableNotifications = () => invokePromise(EInvokeRequest.enableNotifications);\n\n const disableNotifications = () => invokePromise(EInvokeRequest.disableNotifications);\n\n const setShakeHandler = (handler) => {\n const isAndroid = android && android[setShakeHandlerMethod];\n const isIos = ios && ios[setShakeHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeShake = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setShakeHandler-isUnknown');\n }\n };\n\n const setTabActiveHandler = (handler: (tabname: string) => void) => {\n const isAndroid = android && android[setTabActiveHandlerMethod];\n const isIos = ios && ios[setTabActiveHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeTabActive = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setTabActiveHandler-isUnknown');\n }\n };\n\n const vibrate = (reqId, pattern) => {\n if (\n !Array.isArray(pattern) ||\n pattern.some((timing) => timing < 1 || timing !== Math.floor(timing)) ||\n pattern.reduce((total, timing) => total + timing) > 10000\n ) {\n console.error('Pattern should be an array of positive integers no longer than 10000ms total');\n return;\n }\n\n const isAndroid = android && android[vibrateMethod];\n const isIos = ios && ios[vibrateMethod];\n\n if (isAndroid) {\n android[vibrateMethod](reqId, JSON.stringify(pattern));\n } else if (isIos) {\n ios[vibrateMethod].postMessage({ reqId, pattern });\n } else if (web) {\n web.execute(vibrateMethod, reqId, pattern);\n } else if (typeof window !== 'undefined') {\n console.log('--vibrate-isUnknown');\n }\n };\n\n const isSupported = () => {\n const iosSup = ios && (window as any).webkit.messageHandlers.invoke;\n return Boolean(android || iosSup || web);\n };\n\n // TODO: implement web support\n const supports = (method) =>\n (android && typeof android[method] === 'function') ||\n (ios && ios[method] && typeof ios[method].postMessage === 'function') ||\n (web && typeof web[method] === 'function');\n\n const sub = (listener: any) => {\n subs.push(listener);\n };\n\n const createMethod = <Params extends unknown[], Result>(\n name: string,\n options?: {\n transformToObject?: (args: Params) => Record<string, Params[number]>;\n isWebSupported?: boolean;\n }\n ) => {\n const method = (reqId: string, ...args: Params) => {\n const isAndroid = !!android && !!android[name];\n const isIos = !!ios && !!ios[name];\n const isWeb = !!options?.isWebSupported && !!web;\n\n if (isAndroid) {\n android[name](reqId, ...args);\n } else if (isIos) {\n ios[name].postMessage({\n reqId,\n ...options?.transformToObject?.(args),\n });\n } else if (isWeb) {\n web.execute(name as unknown as keyof AituBridge, reqId, ...args);\n } else if (typeof window !== 'undefined') {\n console.log(`--${name}-isUnknown`);\n }\n };\n\n return promisifyMethod(method, name, sub) as (...args: Params) => Promise<Result>;\n };\n\n const setHeaderMenuItems = (reqId, items: Array<HeaderMenuItem>) => {\n if (items.length > MAX_HEADER_MENU_ITEMS_COUNT) {\n console.error('SetHeaderMenuItems: items count should not be more than ' + MAX_HEADER_MENU_ITEMS_COUNT);\n return;\n }\n\n const isAndroid = android && android[setHeaderMenuItemsMethod];\n const isIos = ios && ios[setHeaderMenuItemsMethod];\n\n const itemsJsonArray = JSON.stringify(items);\n\n if (isAndroid) {\n android[setHeaderMenuItemsMethod](reqId, itemsJsonArray);\n } else if (isIos) {\n ios[setHeaderMenuItemsMethod].postMessage({ reqId, itemsJsonArray });\n } else if (web) {\n web.execute(setHeaderMenuItemsMethod, reqId, itemsJsonArray);\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItems-isUnknown');\n }\n };\n\n const setHeaderMenuItemClickHandler = (handler: HeaderMenuItemClickHandlerType) => {\n const isAndroid = android && android[setHeaderMenuItemClickHandlerMethod];\n const isIos = ios && ios[setHeaderMenuItemClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeHeaderMenuItemClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItemClickHandler-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowMode = (reqId, enabled: boolean) => {\n const isAndroid = android && android[setCustomBackArrowModeMethod];\n const isIos = ios && ios[setCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowModeMethod](reqId, enabled);\n } else if (isIos) {\n ios[setCustomBackArrowModeMethod].postMessage({ reqId, enabled });\n } else if (web) {\n web.execute(setCustomBackArrowModeMethod, reqId, enabled);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowMode-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте getNavigationItemMode\n */\n const getCustomBackArrowMode = (reqId) => {\n const isAndroid = android && android[getCustomBackArrowModeMethod];\n const isIos = ios && ios[getCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[getCustomBackArrowModeMethod](reqId);\n } else if (isIos) {\n ios[getCustomBackArrowModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getCustomBackArrowModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getCustomBackArrowMode-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowVisible = (reqId, visible: boolean) => {\n const isAndroid = android && android[setCustomBackArrowVisibleMethod];\n const isIos = ios && ios[setCustomBackArrowVisibleMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowVisibleMethod](reqId, visible);\n } else if (isIos) {\n ios[setCustomBackArrowVisibleMethod].postMessage({ reqId, visible });\n } else if (web) {\n web.execute(setCustomBackArrowVisibleMethod, reqId, visible);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowVisible-isUnknown');\n }\n };\n\n const setCustomBackArrowOnClickHandler = (handler: BackArrowClickHandlerType) => {\n const isAndroid = android && android[setCustomBackArrowOnClickHandlerMethod];\n const isIos = ios && ios[setCustomBackArrowOnClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeBackArrowClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowOnClickHandler-isUnknown');\n }\n };\n\n const openPayment = (reqId, transactionId: string) => {\n const isAndroid = android && android[openPaymentMethod];\n const isIos = ios && ios[openPaymentMethod];\n\n if (isAndroid) {\n android[openPaymentMethod](reqId, transactionId);\n } else if (isIos) {\n ios[openPaymentMethod].postMessage({ reqId, transactionId });\n } else {\n console.log('--openPayment-isUnknown');\n }\n };\n\n const checkBiometry = (reqId) => {\n const isAndroid = android && android[checkBiometryMethod];\n const isIos = ios && ios[checkBiometryMethod];\n\n if (isAndroid) {\n android[checkBiometryMethod](reqId);\n } else if (isIos) {\n ios[checkBiometryMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(checkBiometryMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--checkBiometry-isUnknown');\n }\n };\n\n const openExternalUrl = (reqId, url: string) => {\n const isAndroid = android && android[openExternalUrlMethod];\n const isIos = ios && ios[openExternalUrlMethod];\n\n if (isAndroid) {\n android[openExternalUrlMethod](reqId, url);\n } else if (isIos) {\n ios[openExternalUrlMethod].postMessage({ reqId, url });\n } else {\n console.log('--openExternalUrlMethod-isUnknown');\n }\n };\n\n const enableSwipeBack = (reqId) => {\n const isAndroid = android && android[enableSwipeBackMethod];\n const isIos = ios && ios[enableSwipeBackMethod];\n\n if (isAndroid) {\n android[enableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[enableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableSwipeBack-isUnknown');\n }\n };\n\n const disableSwipeBack = (reqId) => {\n const isAndroid = android && android[disableSwipeBackMethod];\n const isIos = ios && ios[disableSwipeBackMethod];\n\n if (isAndroid) {\n android[disableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[disableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableSwipeBack-isUnknown');\n }\n };\n\n const setNavigationItemMode = (reqId, mode: NavigationItemMode) => {\n const isAndroid = android && android[setNavigationItemModeMethod];\n const isIos = ios && ios[setNavigationItemModeMethod];\n\n if (isAndroid) {\n android[setNavigationItemModeMethod](reqId, mode);\n } else if (isIos) {\n ios[setNavigationItemModeMethod].postMessage({ reqId, mode });\n } else if (web) {\n web.execute(setNavigationItemModeMethod, reqId, mode);\n } else if (typeof window !== 'undefined') {\n console.log('--setNavigationItemMode-isUnknown');\n }\n };\n\n const getNavigationItemMode = (reqId) => {\n const isAndroid = android && android[getNavigationItemModeMethod];\n const isIos = ios && ios[getNavigationItemModeMethod];\n\n if (isAndroid) {\n android[getNavigationItemModeMethod](reqId);\n } else if (isIos) {\n ios[getNavigationItemModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getNavigationItemModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getNavigationItemMode-isUnknown');\n }\n };\n\n const getUserStepInfo = (reqId) => {\n const isAndroid = android && android[getUserStepInfoMethod];\n const isIos = ios && ios[getUserStepInfoMethod];\n\n if (isAndroid) {\n android[getUserStepInfoMethod](reqId);\n } else if (isIos) {\n ios[getUserStepInfoMethod].postMessage({ reqId });\n } else if (web) {\n console.log('--getUserStepInfo-isWeb');\n } else if (typeof window !== 'undefined') {\n console.log('--getUserStepInfo-isUnknown');\n }\n };\n\n const invokePromise = promisifyInvoke(invoke, sub);\n const storagePromise = promisifyStorage(storage, sub);\n const getGeoPromise = promisifyMethod(getGeo, getGeoMethod, sub);\n const getQrPromise = promisifyMethod(getQr, getQrMethod, sub);\n const getSMSCodePromise = promisifyMethod(getSMSCode, getSMSCodeMethod, sub);\n const selectContactPromise = promisifyMethod(selectContact, selectContactMethod, sub);\n const openSettingsPromise = promisifyMethod(openSettings, openSettingsMethod, sub);\n const closeApplicationPromise = promisifyMethod(closeApplication, closeApplicationMethod, sub);\n const sharePromise = promisifyMethod(share, shareMethod, sub);\n const setTitlePromise = promisifyMethod(setTitle, setTitleMethod, sub);\n const copyToClipboardPromise = promisifyMethod(copyToClipboard, copyToClipboardMethod, sub);\n const shareImagePromise = promisifyMethod(shareImage, shareImageMethod, sub);\n const shareFilePromise = promisifyMethod(shareFile, shareFileMethod, sub);\n const vibratePromise = promisifyMethod(vibrate, vibrateMethod, sub);\n const enableScreenCapturePromise = promisifyMethod(enableScreenCapture, enableScreenCaptureMethod, sub);\n const disableScreenCapturePromise = promisifyMethod(disableScreenCapture, disableScreenCaptureMethod, sub);\n const setHeaderMenuItemsPromise = promisifyMethod(setHeaderMenuItems, setHeaderMenuItemsMethod, sub);\n const setCustomBackArrowModePromise = promisifyMethod(setCustomBackArrowMode, setCustomBackArrowModeMethod, sub);\n const getCustomBackArrowModePromise = promisifyMethod(getCustomBackArrowMode, getCustomBackArrowModeMethod, sub);\n const setCustomBackArrowVisiblePromise = promisifyMethod(setCustomBackArrowVisible, setCustomBackArrowVisibleMethod, sub);\n const openPaymentPromise = promisifyMethod(openPayment, openPaymentMethod, sub);\n const checkBiometryPromise = promisifyMethod(checkBiometry, checkBiometryMethod, sub);\n const openExternalUrlPromise = promisifyMethod(openExternalUrl, openExternalUrlMethod, sub);\n const enableSwipeBackPromise = promisifyMethod(enableSwipeBack, enableSwipeBackMethod, sub);\n const disableSwipeBackPromise = promisifyMethod(disableSwipeBack, disableSwipeBackMethod, sub);\n const setNavigationItemModePromise = promisifyMethod(setNavigationItemMode, setNavigationItemModeMethod, sub);\n const getNavigationItemModePromise = promisifyMethod(getNavigationItemMode, getNavigationItemModeMethod, sub);\n const getUserStepInfoPromise = promisifyMethod(getUserStepInfo, getUserStepInfoMethod, sub);\n const isESimSupported = createMethod<never, ResponseType>('isESimSupported');\n const activateESim = createMethod<[activationCode: string], ResponseType>('activateESim', {\n transformToObject: ([activationCode]) => ({\n activationCode,\n }),\n });\n const readNFCData = createMethod<never, string>('readNFCData');\n\n const readNFCPassport = createMethod<[passportNumber: string, dateOfBirth: string, expirationDate: string], PassportDataResponse>(\n 'readNFCPassport',\n {\n transformToObject: ([passportNumber, dateOfBirth, expirationDate]) => ({\n passportNumber,\n dateOfBirth,\n expirationDate,\n }),\n }\n );\n\n const subscribeUserStepInfo = createMethod<never, ResponseType>('subscribeUserStepInfo');\n\n const unsubscribeUserStepInfo = createMethod<never, ResponseType>('unsubscribeUserStepInfo');\n\n const openUserProfile = createMethod<never, ResponseType>('openUserProfile');\n\n return {\n version: VERSION,\n copyToClipboard: copyToClipboardPromise,\n invoke: invokePromise,\n storage: storagePromise,\n getMe: () => invokePromise(EInvokeRequest.getMe),\n getPhone: () => invokePromise(EInvokeRequest.getPhone),\n getContacts: () => invokePromise(EInvokeRequest.getContacts),\n getGeo: getGeoPromise,\n getQr: getQrPromise,\n getSMSCode: getSMSCodePromise,\n getUserProfile: (id: string) => invokePromise(EInvokeRequest.getUserProfile, { id }),\n openUserProfile,\n selectContact: selectContactPromise,\n enableNotifications,\n disableNotifications,\n enablePrivateMessaging: (appId: string) => invokePromise(EInvokeRequest.enablePrivateMessaging, { appId }),\n disablePrivateMessaging: (appId: string) => invokePromise(EInvokeRequest.disablePrivateMessaging, { appId }),\n openSettings: openSettingsPromise,\n closeApplication: closeApplicationPromise,\n setTitle: setTitlePromise,\n share: sharePromise,\n shareImage: shareImagePromise,\n shareFile: shareFilePromise,\n setShakeHandler,\n setTabActiveHandler,\n vibrate: vibratePromise,\n isSupported,\n supports,\n sub,\n enableScreenCapture: enableScreenCapturePromise,\n disableScreenCapture: disableScreenCapturePromise,\n setHeaderMenuItems: setHeaderMenuItemsPromise,\n setHeaderMenuItemClickHandler,\n setCustomBackArrowMode: setCustomBackArrowModePromise,\n getCustomBackArrowMode: getCustomBackArrowModePromise,\n setCustomBackArrowVisible: setCustomBackArrowVisiblePromise,\n openPayment: openPaymentPromise,\n setCustomBackArrowOnClickHandler,\n checkBiometry: checkBiometryPromise,\n openExternalUrl: openExternalUrlPromise,\n enableSwipeBack: enableSwipeBackPromise,\n disableSwipeBack: disableSwipeBackPromise,\n setNavigationItemMode: setNavigationItemModePromise,\n getNavigationItemMode: getNavigationItemModePromise,\n getUserStepInfo: getUserStepInfoPromise,\n isESimSupported,\n activateESim,\n readNFCData,\n subscribeUserStepInfo,\n unsubscribeUserStepInfo,\n readNFCPassport,\n };\n};\n\n/**\n * @public\n * AituBridge instance for interacting with the Aitu mini-app environment.\n */\nconst bridge = buildBridge();\n\nexport default bridge;\n"],"names":["createRequestResolver","prefix","counter","current","next","this","createCounter","promiseControllers","add","controller","customId","id","resolve","reqId","data","isSuccess","error","requestPromise","reject","handleSubscribe","subscribe","requestResolver","event","detail","promisifyMethod","method","methodName","args","Promise","aituOrigin","URLSearchParams","window","location","search","get","localStorage","setItem","getItem","WebBridge","origin","execute","payload","top","postMessage","source","addEventListener","dispatchEvent","CustomEvent","message","JSON","parse","onAituBridgeBackArrowClick","onAituBridgeHeaderMenuItemClick","param","e","console","log","BridgeErrors","WebBridge$1","classifyBridgeError","msg","startsWith","PermissionDenyError","PermissionSecurityDenyError","OtherError","EInvokeRequest","HeaderMenuIcon","NavigationItemMode","invokeMethod","storageMethod","getGeoMethod","getQrMethod","getSMSCodeMethod","selectContactMethod","openSettingsMethod","closeApplicationMethod","shareMethod","setTitleMethod","copyToClipboardMethod","shareFileMethod","setShakeHandlerMethod","vibrateMethod","enableScreenCaptureMethod","disableScreenCaptureMethod","setTabActiveHandlerMethod","setHeaderMenuItemsMethod","setHeaderMenuItemClickHandlerMethod","setCustomBackArrowModeMethod","getCustomBackArrowModeMethod","setCustomBackArrowVisibleMethod","openPaymentMethod","setCustomBackArrowOnClickHandlerMethod","checkBiometryMethod","openExternalUrlMethod","enableSwipeBackMethod","disableSwipeBackMethod","setNavigationItemModeMethod","getNavigationItemModeMethod","getUserStepInfoMethod","android","AndroidBridge","ios","webkit","messageHandlers","web","bridge","buildBridge","subs","map","fn","call","sub","listener","push","createMethod","name","options","isIos","isWeb","isWebSupported","_extends","transformToObject","invokePromise","invoke","invokeMethodName","props","stringify","promisifyInvoke","storagePromise","storage","keyName","keyValue","clear","promisifyStorage","getGeoPromise","getQrPromise","getSMSCodePromise","selectContactPromise","openSettingsPromise","closeApplicationPromise","sharePromise","share","text","setTitlePromise","setTitle","copyToClipboardPromise","copyToClipboard","shareImagePromise","shareImage","image","isAndroid","filename","split","base64Data","substr","indexOf","shareFilePromise","shareFile","vibratePromise","vibrate","pattern","Array","isArray","some","timing","Math","floor","reduce","total","enableScreenCapturePromise","disableScreenCapturePromise","setHeaderMenuItemsPromise","setHeaderMenuItems","items","length","itemsJsonArray","setCustomBackArrowModePromise","setCustomBackArrowMode","enabled","getCustomBackArrowModePromise","setCustomBackArrowVisiblePromise","setCustomBackArrowVisible","visible","openPaymentPromise","openPayment","transactionId","checkBiometryPromise","openExternalUrlPromise","openExternalUrl","url","enableSwipeBackPromise","disableSwipeBackPromise","setNavigationItemModePromise","setNavigationItemMode","mode","getNavigationItemModePromise","getUserStepInfoPromise","isESimSupported","activateESim","activationCode","readNFCData","readNFCPassport","passportNumber","dateOfBirth","expirationDate","subscribeUserStepInfo","unsubscribeUserStepInfo","openUserProfile","version","getMe","getPhone","getContacts","getGeo","getQr","getSMSCode","getUserProfile","selectContact","enableNotifications","disableNotifications","enablePrivateMessaging","appId","disablePrivateMessaging","openSettings","closeApplication","setShakeHandler","handler","onAituBridgeShake","setTabActiveHandler","onAituBridgeTabActive","isSupported","iosSup","Boolean","supports","enableScreenCapture","disableScreenCapture","setHeaderMenuItemClickHandler","getCustomBackArrowMode","setCustomBackArrow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