Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vkontakte/vk-bridge

Package Overview
Dependencies
Maintainers
7
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vkontakte/vk-bridge - npm Package Compare versions

Comparing version 2.14.1 to 2.14.2

2

dist/browser.min.js

@@ -1,2 +0,2 @@

!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var p in t=arguments[n])Object.prototype.hasOwnProperty.call(t,p)&&(e[p]=t[p]);return e},e.apply(this,arguments)};function t(e,t,n){if(n||2===arguments.length)for(var o,p=0,r=t.length;p<r;p++)!o&&p in t||(o||(o=Array.prototype.slice.call(t,0,p)),o[p]=t[p]);return e.concat(o||Array.prototype.slice.call(t))}function n(t,n,o){var p=function(e){var t={current:0,next:function(){return++this.current}},n={};return{add:function(o,p){var r=null!=p?p:"".concat(t.next(),"_").concat(e);return n[r]=o,r},resolve:function(e,t,o){var p=n[e];p&&(o(t)?p.resolve(t):p.reject(t),n[e]=null)}}}(o);return n((function(e){if(e.detail&&e.detail.data&&"object"==typeof e.detail.data&&"request_id"in e.detail.data){var t=e.detail.data,n=t.request_id,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var p=0;for(o=Object.getOwnPropertySymbols(e);p<o.length;p++)t.indexOf(o[p])<0&&Object.prototype.propertyIsEnumerable.call(e,o[p])&&(n[o[p]]=e[o[p]])}return n}(t,["request_id"]);n&&p.resolve(n,o,(function(e){return!("error_type"in e)}))}})),function(n,o){return void 0===o&&(o={}),new Promise((function(r,i){var a=p.add({resolve:r,reject:i},o.request_id);t(n,e(e({},o),{request_id:a}))}))}}var o="undefined"!=typeof window,p=Boolean(o&&window.AndroidBridge),r=Boolean(o&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),i=Boolean(o&&window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView.postMessage),a=o&&!p&&!r,s=a&&/(^\?|&)vk_platform=mobile_web(&|$)/.test(location.search),d=a?"message":"VKWebAppEvent",b=t(["VKWebAppInit","VKWebAppGetCommunityAuthToken","VKWebAppAddToCommunity","VKWebAppAddToHomeScreenInfo","VKWebAppClose","VKWebAppCopyText","VKWebAppCreateHash","VKWebAppGetUserInfo","VKWebAppSetLocation","VKWebAppSendToClient","VKWebAppGetClientVersion","VKWebAppGetPhoneNumber","VKWebAppGetEmail","VKWebAppGetGroupInfo","VKWebAppGetGeodata","VKWebAppGetCommunityToken","VKWebAppGetConfig","VKWebAppGetLaunchParams","VKWebAppSetTitle","VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppJoinGroup","VKWebAppLeaveGroup","VKWebAppAllowMessagesFromGroup","VKWebAppDenyNotifications","VKWebAppAllowNotifications","VKWebAppOpenPayForm","VKWebAppOpenApp","VKWebAppShare","VKWebAppShowWallPostBox","VKWebAppScroll","VKWebAppShowOrderBox","VKWebAppShowLeaderBoardBox","VKWebAppShowInviteBox","VKWebAppShowRequestBox","VKWebAppAddToFavorites","VKWebAppShowStoryBox","VKWebAppStorageGet","VKWebAppStorageGetKeys","VKWebAppStorageSet","VKWebAppFlashGetInfo","VKWebAppSubscribeStoryApp","VKWebAppOpenWallPost","VKWebAppCheckAllowedScopes","VKWebAppCheckBannerAd","VKWebAppHideBannerAd","VKWebAppShowBannerAd","VKWebAppCheckNativeAds","VKWebAppShowNativeAds","VKWebAppRetargetingPixel","VKWebAppConversionHit","VKWebAppShowSubscriptionBox","VKWebAppCheckSurvey","VKWebAppShowSurvey","VKWebAppScrollTop","VKWebAppScrollTopStart","VKWebAppScrollTopStop","VKWebAppShowSlidesSheet","VKWebAppTranslate","VKWebAppRecommend","VKWebAppAddToProfile"],a&&!s?["VKWebAppResizeWindow","VKWebAppAddToMenu","VKWebAppShowInstallPushBox","VKWebAppGetFriends","VKWebAppShowCommunityWidgetPreviewBox","VKWebAppCallStart","VKWebAppCallJoin","VKWebAppCallGetStatus"]:["VKWebAppShowImages"],!0),A=o?window.AndroidBridge:void 0,u=r?window.webkit.messageHandlers:void 0,l=a?parent:void 0;var c,W,f,V,K,w,S,m;!function(e){e.REWARD="reward",e.INTERSTITIAL="interstitial"}(c||(c={})),function(e){e.RESIZE="resize",e.OVERLAY="overlay"}(W||(W={})),function(e){e.TOP="top",e.BOTTOM="bottom"}(f||(f={})),function(e){e.LEFT="left",e.RIGHT="right",e.CENTER="center"}(V||(V={})),function(e){e.CAMERA="camera",e.LOCATION="location",e.PHOTO="photo"}(K||(K={})),function(e){e.RU="ru",e.UK="uk",e.UA="ua",e.EN="en",e.BE="be",e.KZ="kz",e.PT="pt",e.ES="es"}(w||(w={})),function(e){e.ADMIN="admin",e.EDITOR="editor",e.MEMBER="member",e.MODER="moder",e.NONE="none"}(S||(S={})),function(e){e.DESKTOP_WEB="desktop_web",e.DESKTOP_WEB_MESSENGER="desktop_web_messenger",e.DESKTOP_APP_MESSENGER="desktop_app_messenger",e.MOBILE_WEB="mobile_web",e.MOBILE_ANDROID="mobile_android",e.MOBILE_ANDROID_MESSENGER="mobile_android_messenger",e.MOBILE_IPHONE="mobile_iphone",e.MOBILE_IPHONE_MESSENGER="mobile_iphone_messenger",e.MOBILE_IPAD="mobile_ipad"}(m||(m={}));var v=function(e){var o=void 0,s=[],c=Math.random().toString(36).substring(2,5);function W(e){s.push(e)}function f(){return r||p}function V(){return a&&window.parent!==window}function K(){return f()||V()}function w(e){if(r||p)return t([],s,!0).map((function(t){return t.call(null,e)}));var n=null==e?void 0:e.data;if(a&&n){if(i&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){}var d=n.type,b=n.data,A=n.frameId;d&&("VKWebAppSettings"!==d?t([],s,!0).map((function(e){return e({detail:{type:d,data:b}})})):o=A)}}i&&/(android)/i.test(navigator.userAgent)?document.addEventListener(d,w):"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener(d,w);var S=n((function(t,n){A&&A[t]?A[t](JSON.stringify(n)):u&&u[t]&&"function"==typeof u[t].postMessage?u[t].postMessage(n):i?window.ReactNativeWebView.postMessage(JSON.stringify({handler:t,params:n})):l&&"function"==typeof l.postMessage&&l.postMessage({handler:t,params:n,type:"vk-connect",webFrameId:o,connectVersion:e},"*")}),W,c);return{send:S,sendPromise:S,subscribe:W,unsubscribe:function(e){var t=s.indexOf(e);t>-1&&s.splice(t,1)},supports:function(e){return p?!(!A||"function"!=typeof A[e]):r?!(!u||!u[e]||"function"!=typeof u[e].postMessage):!!a&&b.includes(e)},isWebView:f,isIframe:V,isEmbedded:K,isStandalone:function(){return!K()}}}("2.14.1");window.vkBridge=window.vkConnect=v}();
!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var p in t=arguments[n])Object.prototype.hasOwnProperty.call(t,p)&&(e[p]=t[p]);return e},e.apply(this,arguments)};function t(e,t,n){if(n||2===arguments.length)for(var o,p=0,r=t.length;p<r;p++)!o&&p in t||(o||(o=Array.prototype.slice.call(t,0,p)),o[p]=t[p]);return e.concat(o||Array.prototype.slice.call(t))}function n(t,n,o){var p=function(e){var t={current:0,next:function(){return++this.current}},n={};return{add:function(o,p){var r=null!=p?p:"".concat(t.next(),"_").concat(e);return n[r]=o,r},resolve:function(e,t,o){var p=n[e];p&&(o(t)?p.resolve(t):p.reject(t),n[e]=null)}}}(o);return n((function(e){if(e.detail&&e.detail.data&&"object"==typeof e.detail.data&&"request_id"in e.detail.data){var t=e.detail.data,n=t.request_id,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var p=0;for(o=Object.getOwnPropertySymbols(e);p<o.length;p++)t.indexOf(o[p])<0&&Object.prototype.propertyIsEnumerable.call(e,o[p])&&(n[o[p]]=e[o[p]])}return n}(t,["request_id"]);n&&p.resolve(n,o,(function(e){return!("error_type"in e)}))}})),function(n,o){return void 0===o&&(o={}),new Promise((function(r,i){var a=p.add({resolve:r,reject:i},o.request_id);t(n,e(e({},o),{request_id:a}))}))}}var o="undefined"!=typeof window,p=Boolean(o&&window.AndroidBridge),r=Boolean(o&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),i=Boolean(o&&window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView.postMessage),a=o&&!p&&!r,s=a&&/(^\?|&)vk_platform=mobile_web(&|$)/.test(location.search),d=a?"message":"VKWebAppEvent",b=t(["VKWebAppInit","VKWebAppGetCommunityAuthToken","VKWebAppAddToCommunity","VKWebAppAddToHomeScreenInfo","VKWebAppClose","VKWebAppCopyText","VKWebAppCreateHash","VKWebAppGetUserInfo","VKWebAppSetLocation","VKWebAppSendToClient","VKWebAppGetClientVersion","VKWebAppGetPhoneNumber","VKWebAppGetEmail","VKWebAppGetGroupInfo","VKWebAppGetGeodata","VKWebAppGetCommunityToken","VKWebAppGetConfig","VKWebAppGetLaunchParams","VKWebAppSetTitle","VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppJoinGroup","VKWebAppLeaveGroup","VKWebAppAllowMessagesFromGroup","VKWebAppDenyNotifications","VKWebAppAllowNotifications","VKWebAppOpenPayForm","VKWebAppOpenApp","VKWebAppShare","VKWebAppShowWallPostBox","VKWebAppScroll","VKWebAppShowOrderBox","VKWebAppShowLeaderBoardBox","VKWebAppShowInviteBox","VKWebAppShowRequestBox","VKWebAppAddToFavorites","VKWebAppShowStoryBox","VKWebAppStorageGet","VKWebAppStorageGetKeys","VKWebAppStorageSet","VKWebAppFlashGetInfo","VKWebAppSubscribeStoryApp","VKWebAppOpenWallPost","VKWebAppCheckAllowedScopes","VKWebAppCheckBannerAd","VKWebAppHideBannerAd","VKWebAppShowBannerAd","VKWebAppCheckNativeAds","VKWebAppShowNativeAds","VKWebAppRetargetingPixel","VKWebAppConversionHit","VKWebAppShowSubscriptionBox","VKWebAppCheckSurvey","VKWebAppShowSurvey","VKWebAppScrollTop","VKWebAppScrollTopStart","VKWebAppScrollTopStop","VKWebAppShowSlidesSheet","VKWebAppTranslate","VKWebAppRecommend","VKWebAppAddToProfile","VKWebAppGetFriends"],a&&!s?["VKWebAppResizeWindow","VKWebAppAddToMenu","VKWebAppShowInstallPushBox","VKWebAppShowCommunityWidgetPreviewBox","VKWebAppCallStart","VKWebAppCallJoin","VKWebAppCallGetStatus"]:["VKWebAppShowImages"],!0),A=o?window.AndroidBridge:void 0,u=r?window.webkit.messageHandlers:void 0,l=a?parent:void 0;var c,W,f,V,K,w,S,m;!function(e){e.REWARD="reward",e.INTERSTITIAL="interstitial"}(c||(c={})),function(e){e.RESIZE="resize",e.OVERLAY="overlay"}(W||(W={})),function(e){e.TOP="top",e.BOTTOM="bottom"}(f||(f={})),function(e){e.LEFT="left",e.RIGHT="right",e.CENTER="center"}(V||(V={})),function(e){e.CAMERA="camera",e.LOCATION="location",e.PHOTO="photo"}(K||(K={})),function(e){e.RU="ru",e.UK="uk",e.UA="ua",e.EN="en",e.BE="be",e.KZ="kz",e.PT="pt",e.ES="es"}(w||(w={})),function(e){e.ADMIN="admin",e.EDITOR="editor",e.MEMBER="member",e.MODER="moder",e.NONE="none"}(S||(S={})),function(e){e.DESKTOP_WEB="desktop_web",e.DESKTOP_WEB_MESSENGER="desktop_web_messenger",e.DESKTOP_APP_MESSENGER="desktop_app_messenger",e.MOBILE_WEB="mobile_web",e.MOBILE_ANDROID="mobile_android",e.MOBILE_ANDROID_MESSENGER="mobile_android_messenger",e.MOBILE_IPHONE="mobile_iphone",e.MOBILE_IPHONE_MESSENGER="mobile_iphone_messenger",e.MOBILE_IPAD="mobile_ipad"}(m||(m={}));var v=function(e){var o=void 0,s=[],c=Math.random().toString(36).substring(2,5);function W(e){s.push(e)}function f(){return r||p}function V(){return a&&window.parent!==window}function K(){return f()||V()}function w(e){if(r||p)return t([],s,!0).map((function(t){return t.call(null,e)}));var n=null==e?void 0:e.data;if(a&&n){if(i&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){}var d=n.type,b=n.data,A=n.frameId;d&&("VKWebAppSettings"!==d?t([],s,!0).map((function(e){return e({detail:{type:d,data:b}})})):o=A)}}i&&/(android)/i.test(navigator.userAgent)?document.addEventListener(d,w):"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener(d,w);var S=n((function(t,n){A&&A[t]?A[t](JSON.stringify(n)):u&&u[t]&&"function"==typeof u[t].postMessage?u[t].postMessage(n):i?window.ReactNativeWebView.postMessage(JSON.stringify({handler:t,params:n})):l&&"function"==typeof l.postMessage&&l.postMessage({handler:t,params:n,type:"vk-connect",webFrameId:o,connectVersion:e},"*")}),W,c);return{send:S,sendPromise:S,subscribe:W,unsubscribe:function(e){var t=s.indexOf(e);t>-1&&s.splice(t,1)},supports:function(e){return p?!(!A||"function"!=typeof A[e]):r?!(!u||!u[e]||"function"!=typeof u[e].postMessage):!!a&&b.includes(e)},isWebView:f,isIframe:V,isEmbedded:K,isStandalone:function(){return!K()}}}("2.14.2");window.vkBridge=window.vkConnect=v}();
//# sourceMappingURL=browser.min.js.map

@@ -228,3 +228,4 @@ /******************************************************************************

'VKWebAppRecommend',
'VKWebAppAddToProfile'
'VKWebAppAddToProfile',
'VKWebAppGetFriends'
], (IS_DESKTOP_VK

@@ -235,3 +236,2 @@ ? [

'VKWebAppShowInstallPushBox',
'VKWebAppGetFriends',
'VKWebAppShowCommunityWidgetPreviewBox',

@@ -439,3 +439,3 @@ 'VKWebAppCallStart',

var version = "2.14.1";
var version = "2.14.2";

@@ -442,0 +442,0 @@ var EAdsFormats;

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.apply(this,arguments)};function t(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function n(t,n,o){var r=function(e){var t={current:0,next:function(){return++this.current}},n={};return{add:function(o,r){var a=null!=r?r:"".concat(t.next(),"_").concat(e);return n[a]=o,a},resolve:function(e,t,o){var r=n[e];r&&(o(t)?r.resolve(t):r.reject(t),n[e]=null)}}}(o);return n((function(e){if(e.detail&&e.detail.data&&"object"==typeof e.detail.data&&"request_id"in e.detail.data){var t=e.detail.data,n=t.request_id,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(t,["request_id"]);n&&r.resolve(n,o,(function(e){return!("error_type"in e)}))}})),function(n,o){return void 0===o&&(o={}),new Promise((function(a,p){var s=r.add({resolve:a,reject:p},o.request_id);t(n,e(e({},o),{request_id:s}))}))}}var o="undefined"!=typeof window,r=Boolean(o&&window.AndroidBridge),a=Boolean(o&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),p=Boolean(o&&window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView.postMessage),s=o&&!r&&!a,i=s&&/(^\?|&)vk_platform=mobile_web(&|$)/.test(location.search),u=s?"message":"VKWebAppEvent",d=t(["VKWebAppInit","VKWebAppGetCommunityAuthToken","VKWebAppAddToCommunity","VKWebAppAddToHomeScreenInfo","VKWebAppClose","VKWebAppCopyText","VKWebAppCreateHash","VKWebAppGetUserInfo","VKWebAppSetLocation","VKWebAppSendToClient","VKWebAppGetClientVersion","VKWebAppGetPhoneNumber","VKWebAppGetEmail","VKWebAppGetGroupInfo","VKWebAppGetGeodata","VKWebAppGetCommunityToken","VKWebAppGetConfig","VKWebAppGetLaunchParams","VKWebAppSetTitle","VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppJoinGroup","VKWebAppLeaveGroup","VKWebAppAllowMessagesFromGroup","VKWebAppDenyNotifications","VKWebAppAllowNotifications","VKWebAppOpenPayForm","VKWebAppOpenApp","VKWebAppShare","VKWebAppShowWallPostBox","VKWebAppScroll","VKWebAppShowOrderBox","VKWebAppShowLeaderBoardBox","VKWebAppShowInviteBox","VKWebAppShowRequestBox","VKWebAppAddToFavorites","VKWebAppShowStoryBox","VKWebAppStorageGet","VKWebAppStorageGetKeys","VKWebAppStorageSet","VKWebAppFlashGetInfo","VKWebAppSubscribeStoryApp","VKWebAppOpenWallPost","VKWebAppCheckAllowedScopes","VKWebAppCheckBannerAd","VKWebAppHideBannerAd","VKWebAppShowBannerAd","VKWebAppCheckNativeAds","VKWebAppShowNativeAds","VKWebAppRetargetingPixel","VKWebAppConversionHit","VKWebAppShowSubscriptionBox","VKWebAppCheckSurvey","VKWebAppShowSurvey","VKWebAppScrollTop","VKWebAppScrollTopStart","VKWebAppScrollTopStop","VKWebAppShowSlidesSheet","VKWebAppTranslate","VKWebAppRecommend","VKWebAppAddToProfile"],s&&!i?["VKWebAppResizeWindow","VKWebAppAddToMenu","VKWebAppShowInstallPushBox","VKWebAppGetFriends","VKWebAppShowCommunityWidgetPreviewBox","VKWebAppCallStart","VKWebAppCallJoin","VKWebAppCallGetStatus"]:["VKWebAppShowImages"],!0),c=o?window.AndroidBridge:void 0,l=a?window.webkit.messageHandlers:void 0,b=s?parent:void 0;var A,f,v,m,W,V,_,K;exports.EAdsFormats=void 0,(A=exports.EAdsFormats||(exports.EAdsFormats={})).REWARD="reward",A.INTERSTITIAL="interstitial",exports.BannerAdLayoutType=void 0,(f=exports.BannerAdLayoutType||(exports.BannerAdLayoutType={})).RESIZE="resize",f.OVERLAY="overlay",exports.BannerAdLocation=void 0,(v=exports.BannerAdLocation||(exports.BannerAdLocation={})).TOP="top",v.BOTTOM="bottom",exports.BannerAdAlign=void 0,(m=exports.BannerAdAlign||(exports.BannerAdAlign={})).LEFT="left",m.RIGHT="right",m.CENTER="center",exports.EGrantedPermission=void 0,(W=exports.EGrantedPermission||(exports.EGrantedPermission={})).CAMERA="camera",W.LOCATION="location",W.PHOTO="photo",exports.EGetLaunchParamsResponseLanguages=void 0,(V=exports.EGetLaunchParamsResponseLanguages||(exports.EGetLaunchParamsResponseLanguages={})).RU="ru",V.UK="uk",V.UA="ua",V.EN="en",V.BE="be",V.KZ="kz",V.PT="pt",V.ES="es",exports.EGetLaunchParamsResponseGroupRole=void 0,(_=exports.EGetLaunchParamsResponseGroupRole||(exports.EGetLaunchParamsResponseGroupRole={})).ADMIN="admin",_.EDITOR="editor",_.MEMBER="member",_.MODER="moder",_.NONE="none",exports.EGetLaunchParamsResponsePlatforms=void 0,(K=exports.EGetLaunchParamsResponsePlatforms||(exports.EGetLaunchParamsResponsePlatforms={})).DESKTOP_WEB="desktop_web",K.DESKTOP_WEB_MESSENGER="desktop_web_messenger",K.DESKTOP_APP_MESSENGER="desktop_app_messenger",K.MOBILE_WEB="mobile_web",K.MOBILE_ANDROID="mobile_android",K.MOBILE_ANDROID_MESSENGER="mobile_android_messenger",K.MOBILE_IPHONE="mobile_iphone",K.MOBILE_IPHONE_MESSENGER="mobile_iphone_messenger",K.MOBILE_IPAD="mobile_ipad";var w=function(e){var o=void 0,i=[],A=Math.random().toString(36).substring(2,5);function f(e){i.push(e)}function v(){return a||r}function m(){return s&&window.parent!==window}function W(){return v()||m()}function V(e){if(a||r)return t([],i,!0).map((function(t){return t.call(null,e)}));var n=null==e?void 0:e.data;if(s&&n){if(p&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){}var u=n.type,d=n.data,c=n.frameId;u&&("VKWebAppSettings"!==u?t([],i,!0).map((function(e){return e({detail:{type:u,data:d}})})):o=c)}}p&&/(android)/i.test(navigator.userAgent)?document.addEventListener(u,V):"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener(u,V);var _=n((function(t,n){c&&c[t]?c[t](JSON.stringify(n)):l&&l[t]&&"function"==typeof l[t].postMessage?l[t].postMessage(n):p?window.ReactNativeWebView.postMessage(JSON.stringify({handler:t,params:n})):b&&"function"==typeof b.postMessage&&b.postMessage({handler:t,params:n,type:"vk-connect",webFrameId:o,connectVersion:e},"*")}),f,A);return{send:_,sendPromise:_,subscribe:f,unsubscribe:function(e){var t=i.indexOf(e);t>-1&&i.splice(t,1)},supports:function(e){return r?!(!c||"function"!=typeof c[e]):a?!(!l||!l[e]||"function"!=typeof l[e].postMessage):!!s&&d.includes(e)},isWebView:v,isIframe:m,isEmbedded:W,isStandalone:function(){return!W()}}}("2.14.1");exports.applyMiddleware=function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return n.includes(void 0)||n.includes(null)?t.apply(void 0,n.filter((function(e){return"function"==typeof e}))):function(t){if(0===n.length)return t;var o,r={subscribe:t.subscribe,send:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.send.apply(t,e)}},a=n.filter((function(e){return"function"==typeof e})).map((function(e){return e(r)})).reduce((function(e,t){return function(n){return e(t(n))}}));return o=a(t.send),e(e({},t),{send:o})}},exports.default=w,exports.parseURLSearchParamsForGetLaunchParams=function(e){var t={};try{var n=new URLSearchParams(e);n.forEach((function(e,n){switch(n){case"vk_ts":case"vk_is_recommended":case"vk_profile_id":case"vk_has_profile_button":case"vk_testing_group_id":case"vk_user_id":case"vk_app_id":case"vk_group_id":t[n]=Number(e);break;case"sign":case"vk_chat_id":case"vk_ref":case"vk_access_token_settings":t[n]=e;break;case"odr_enabled":t.odr_enabled="1"===e?1:void 0;break;case"vk_is_app_user":case"vk_are_notifications_enabled":case"vk_is_favorite":t[n]=function(e){switch(e){case"0":return 0;case"1":return 1;default:return}}(e);break;case"vk_language":t.vk_language=function(e){return Object.values(exports.EGetLaunchParamsResponseLanguages).some((function(t){return t===e}))}(e)?e:void 0;break;case"vk_viewer_group_role":t.vk_viewer_group_role=function(e){return Object.values(exports.EGetLaunchParamsResponseGroupRole).some((function(t){return t===e}))}(e)?e:void 0;break;case"vk_platform":t.vk_platform=function(e){return Object.values(exports.EGetLaunchParamsResponsePlatforms).some((function(t){return t===e}))}(e)?e:void 0}}))}catch(e){console.warn(e)}return t};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.apply(this,arguments)};function t(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function n(t,n,o){var r=function(e){var t={current:0,next:function(){return++this.current}},n={};return{add:function(o,r){var a=null!=r?r:"".concat(t.next(),"_").concat(e);return n[a]=o,a},resolve:function(e,t,o){var r=n[e];r&&(o(t)?r.resolve(t):r.reject(t),n[e]=null)}}}(o);return n((function(e){if(e.detail&&e.detail.data&&"object"==typeof e.detail.data&&"request_id"in e.detail.data){var t=e.detail.data,n=t.request_id,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(t,["request_id"]);n&&r.resolve(n,o,(function(e){return!("error_type"in e)}))}})),function(n,o){return void 0===o&&(o={}),new Promise((function(a,p){var s=r.add({resolve:a,reject:p},o.request_id);t(n,e(e({},o),{request_id:s}))}))}}var o="undefined"!=typeof window,r=Boolean(o&&window.AndroidBridge),a=Boolean(o&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),p=Boolean(o&&window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView.postMessage),s=o&&!r&&!a,i=s&&/(^\?|&)vk_platform=mobile_web(&|$)/.test(location.search),u=s?"message":"VKWebAppEvent",d=t(["VKWebAppInit","VKWebAppGetCommunityAuthToken","VKWebAppAddToCommunity","VKWebAppAddToHomeScreenInfo","VKWebAppClose","VKWebAppCopyText","VKWebAppCreateHash","VKWebAppGetUserInfo","VKWebAppSetLocation","VKWebAppSendToClient","VKWebAppGetClientVersion","VKWebAppGetPhoneNumber","VKWebAppGetEmail","VKWebAppGetGroupInfo","VKWebAppGetGeodata","VKWebAppGetCommunityToken","VKWebAppGetConfig","VKWebAppGetLaunchParams","VKWebAppSetTitle","VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppJoinGroup","VKWebAppLeaveGroup","VKWebAppAllowMessagesFromGroup","VKWebAppDenyNotifications","VKWebAppAllowNotifications","VKWebAppOpenPayForm","VKWebAppOpenApp","VKWebAppShare","VKWebAppShowWallPostBox","VKWebAppScroll","VKWebAppShowOrderBox","VKWebAppShowLeaderBoardBox","VKWebAppShowInviteBox","VKWebAppShowRequestBox","VKWebAppAddToFavorites","VKWebAppShowStoryBox","VKWebAppStorageGet","VKWebAppStorageGetKeys","VKWebAppStorageSet","VKWebAppFlashGetInfo","VKWebAppSubscribeStoryApp","VKWebAppOpenWallPost","VKWebAppCheckAllowedScopes","VKWebAppCheckBannerAd","VKWebAppHideBannerAd","VKWebAppShowBannerAd","VKWebAppCheckNativeAds","VKWebAppShowNativeAds","VKWebAppRetargetingPixel","VKWebAppConversionHit","VKWebAppShowSubscriptionBox","VKWebAppCheckSurvey","VKWebAppShowSurvey","VKWebAppScrollTop","VKWebAppScrollTopStart","VKWebAppScrollTopStop","VKWebAppShowSlidesSheet","VKWebAppTranslate","VKWebAppRecommend","VKWebAppAddToProfile","VKWebAppGetFriends"],s&&!i?["VKWebAppResizeWindow","VKWebAppAddToMenu","VKWebAppShowInstallPushBox","VKWebAppShowCommunityWidgetPreviewBox","VKWebAppCallStart","VKWebAppCallJoin","VKWebAppCallGetStatus"]:["VKWebAppShowImages"],!0),c=o?window.AndroidBridge:void 0,l=a?window.webkit.messageHandlers:void 0,b=s?parent:void 0;var A,f,v,m,W,V,_,K;exports.EAdsFormats=void 0,(A=exports.EAdsFormats||(exports.EAdsFormats={})).REWARD="reward",A.INTERSTITIAL="interstitial",exports.BannerAdLayoutType=void 0,(f=exports.BannerAdLayoutType||(exports.BannerAdLayoutType={})).RESIZE="resize",f.OVERLAY="overlay",exports.BannerAdLocation=void 0,(v=exports.BannerAdLocation||(exports.BannerAdLocation={})).TOP="top",v.BOTTOM="bottom",exports.BannerAdAlign=void 0,(m=exports.BannerAdAlign||(exports.BannerAdAlign={})).LEFT="left",m.RIGHT="right",m.CENTER="center",exports.EGrantedPermission=void 0,(W=exports.EGrantedPermission||(exports.EGrantedPermission={})).CAMERA="camera",W.LOCATION="location",W.PHOTO="photo",exports.EGetLaunchParamsResponseLanguages=void 0,(V=exports.EGetLaunchParamsResponseLanguages||(exports.EGetLaunchParamsResponseLanguages={})).RU="ru",V.UK="uk",V.UA="ua",V.EN="en",V.BE="be",V.KZ="kz",V.PT="pt",V.ES="es",exports.EGetLaunchParamsResponseGroupRole=void 0,(_=exports.EGetLaunchParamsResponseGroupRole||(exports.EGetLaunchParamsResponseGroupRole={})).ADMIN="admin",_.EDITOR="editor",_.MEMBER="member",_.MODER="moder",_.NONE="none",exports.EGetLaunchParamsResponsePlatforms=void 0,(K=exports.EGetLaunchParamsResponsePlatforms||(exports.EGetLaunchParamsResponsePlatforms={})).DESKTOP_WEB="desktop_web",K.DESKTOP_WEB_MESSENGER="desktop_web_messenger",K.DESKTOP_APP_MESSENGER="desktop_app_messenger",K.MOBILE_WEB="mobile_web",K.MOBILE_ANDROID="mobile_android",K.MOBILE_ANDROID_MESSENGER="mobile_android_messenger",K.MOBILE_IPHONE="mobile_iphone",K.MOBILE_IPHONE_MESSENGER="mobile_iphone_messenger",K.MOBILE_IPAD="mobile_ipad";var w=function(e){var o=void 0,i=[],A=Math.random().toString(36).substring(2,5);function f(e){i.push(e)}function v(){return a||r}function m(){return s&&window.parent!==window}function W(){return v()||m()}function V(e){if(a||r)return t([],i,!0).map((function(t){return t.call(null,e)}));var n=null==e?void 0:e.data;if(s&&n){if(p&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){}var u=n.type,d=n.data,c=n.frameId;u&&("VKWebAppSettings"!==u?t([],i,!0).map((function(e){return e({detail:{type:u,data:d}})})):o=c)}}p&&/(android)/i.test(navigator.userAgent)?document.addEventListener(u,V):"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener(u,V);var _=n((function(t,n){c&&c[t]?c[t](JSON.stringify(n)):l&&l[t]&&"function"==typeof l[t].postMessage?l[t].postMessage(n):p?window.ReactNativeWebView.postMessage(JSON.stringify({handler:t,params:n})):b&&"function"==typeof b.postMessage&&b.postMessage({handler:t,params:n,type:"vk-connect",webFrameId:o,connectVersion:e},"*")}),f,A);return{send:_,sendPromise:_,subscribe:f,unsubscribe:function(e){var t=i.indexOf(e);t>-1&&i.splice(t,1)},supports:function(e){return r?!(!c||"function"!=typeof c[e]):a?!(!l||!l[e]||"function"!=typeof l[e].postMessage):!!s&&d.includes(e)},isWebView:v,isIframe:m,isEmbedded:W,isStandalone:function(){return!W()}}}("2.14.2");exports.applyMiddleware=function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return n.includes(void 0)||n.includes(null)?t.apply(void 0,n.filter((function(e){return"function"==typeof e}))):function(t){if(0===n.length)return t;var o,r={subscribe:t.subscribe,send:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.send.apply(t,e)}},a=n.filter((function(e){return"function"==typeof e})).map((function(e){return e(r)})).reduce((function(e,t){return function(n){return e(t(n))}}));return o=a(t.send),e(e({},t),{send:o})}},exports.default=w,exports.parseURLSearchParamsForGetLaunchParams=function(e){var t={};try{var n=new URLSearchParams(e);n.forEach((function(e,n){switch(n){case"vk_ts":case"vk_is_recommended":case"vk_profile_id":case"vk_has_profile_button":case"vk_testing_group_id":case"vk_user_id":case"vk_app_id":case"vk_group_id":t[n]=Number(e);break;case"sign":case"vk_chat_id":case"vk_ref":case"vk_access_token_settings":t[n]=e;break;case"odr_enabled":t.odr_enabled="1"===e?1:void 0;break;case"vk_is_app_user":case"vk_are_notifications_enabled":case"vk_is_favorite":t[n]=function(e){switch(e){case"0":return 0;case"1":return 1;default:return}}(e);break;case"vk_language":t.vk_language=function(e){return Object.values(exports.EGetLaunchParamsResponseLanguages).some((function(t){return t===e}))}(e)?e:void 0;break;case"vk_viewer_group_role":t.vk_viewer_group_role=function(e){return Object.values(exports.EGetLaunchParamsResponseGroupRole).some((function(t){return t===e}))}(e)?e:void 0;break;case"vk_platform":t.vk_platform=function(e){return Object.values(exports.EGetLaunchParamsResponsePlatforms).some((function(t){return t===e}))}(e)?e:void 0}}))}catch(e){console.warn(e)}return t};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).vkBridge={})}(this,(function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},n.apply(this,arguments)};function t(e,n,t){if(t||2===arguments.length)for(var o,r=0,a=n.length;r<a;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function o(e,t,o){var r=function(e){var n={current:0,next:function(){return++this.current}},t={};return{add:function(o,r){var a=null!=r?r:"".concat(n.next(),"_").concat(e);return t[a]=o,a},resolve:function(e,n,o){var r=t[e];r&&(o(n)?r.resolve(n):r.reject(n),t[e]=null)}}}(o);return t((function(e){if(e.detail&&e.detail.data&&"object"==typeof e.detail.data&&"request_id"in e.detail.data){var n=e.detail.data,t=n.request_id,o=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t}(n,["request_id"]);t&&r.resolve(t,o,(function(e){return!("error_type"in e)}))}})),function(t,o){return void 0===o&&(o={}),new Promise((function(a,p){var i=r.add({resolve:a,reject:p},o.request_id);e(t,n(n({},o),{request_id:i}))}))}}var r="undefined"!=typeof window,a=Boolean(r&&window.AndroidBridge),p=Boolean(r&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),i=Boolean(r&&window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView.postMessage),s=r&&!a&&!p,u=s&&/(^\?|&)vk_platform=mobile_web(&|$)/.test(location.search),d=s?"message":"VKWebAppEvent",c=t(["VKWebAppInit","VKWebAppGetCommunityAuthToken","VKWebAppAddToCommunity","VKWebAppAddToHomeScreenInfo","VKWebAppClose","VKWebAppCopyText","VKWebAppCreateHash","VKWebAppGetUserInfo","VKWebAppSetLocation","VKWebAppSendToClient","VKWebAppGetClientVersion","VKWebAppGetPhoneNumber","VKWebAppGetEmail","VKWebAppGetGroupInfo","VKWebAppGetGeodata","VKWebAppGetCommunityToken","VKWebAppGetConfig","VKWebAppGetLaunchParams","VKWebAppSetTitle","VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppJoinGroup","VKWebAppLeaveGroup","VKWebAppAllowMessagesFromGroup","VKWebAppDenyNotifications","VKWebAppAllowNotifications","VKWebAppOpenPayForm","VKWebAppOpenApp","VKWebAppShare","VKWebAppShowWallPostBox","VKWebAppScroll","VKWebAppShowOrderBox","VKWebAppShowLeaderBoardBox","VKWebAppShowInviteBox","VKWebAppShowRequestBox","VKWebAppAddToFavorites","VKWebAppShowStoryBox","VKWebAppStorageGet","VKWebAppStorageGetKeys","VKWebAppStorageSet","VKWebAppFlashGetInfo","VKWebAppSubscribeStoryApp","VKWebAppOpenWallPost","VKWebAppCheckAllowedScopes","VKWebAppCheckBannerAd","VKWebAppHideBannerAd","VKWebAppShowBannerAd","VKWebAppCheckNativeAds","VKWebAppShowNativeAds","VKWebAppRetargetingPixel","VKWebAppConversionHit","VKWebAppShowSubscriptionBox","VKWebAppCheckSurvey","VKWebAppShowSurvey","VKWebAppScrollTop","VKWebAppScrollTopStart","VKWebAppScrollTopStop","VKWebAppShowSlidesSheet","VKWebAppTranslate","VKWebAppRecommend","VKWebAppAddToProfile"],s&&!u?["VKWebAppResizeWindow","VKWebAppAddToMenu","VKWebAppShowInstallPushBox","VKWebAppGetFriends","VKWebAppShowCommunityWidgetPreviewBox","VKWebAppCallStart","VKWebAppCallJoin","VKWebAppCallGetStatus"]:["VKWebAppShowImages"],!0),l=r?window.AndroidBridge:void 0,b=p?window.webkit.messageHandlers:void 0,f=s?parent:void 0;var A,v,m,W,V,_,K,w;e.EAdsFormats=void 0,(A=e.EAdsFormats||(e.EAdsFormats={})).REWARD="reward",A.INTERSTITIAL="interstitial",e.BannerAdLayoutType=void 0,(v=e.BannerAdLayoutType||(e.BannerAdLayoutType={})).RESIZE="resize",v.OVERLAY="overlay",e.BannerAdLocation=void 0,(m=e.BannerAdLocation||(e.BannerAdLocation={})).TOP="top",m.BOTTOM="bottom",e.BannerAdAlign=void 0,(W=e.BannerAdAlign||(e.BannerAdAlign={})).LEFT="left",W.RIGHT="right",W.CENTER="center",e.EGrantedPermission=void 0,(V=e.EGrantedPermission||(e.EGrantedPermission={})).CAMERA="camera",V.LOCATION="location",V.PHOTO="photo",e.EGetLaunchParamsResponseLanguages=void 0,(_=e.EGetLaunchParamsResponseLanguages||(e.EGetLaunchParamsResponseLanguages={})).RU="ru",_.UK="uk",_.UA="ua",_.EN="en",_.BE="be",_.KZ="kz",_.PT="pt",_.ES="es",e.EGetLaunchParamsResponseGroupRole=void 0,(K=e.EGetLaunchParamsResponseGroupRole||(e.EGetLaunchParamsResponseGroupRole={})).ADMIN="admin",K.EDITOR="editor",K.MEMBER="member",K.MODER="moder",K.NONE="none",e.EGetLaunchParamsResponsePlatforms=void 0,(w=e.EGetLaunchParamsResponsePlatforms||(e.EGetLaunchParamsResponsePlatforms={})).DESKTOP_WEB="desktop_web",w.DESKTOP_WEB_MESSENGER="desktop_web_messenger",w.DESKTOP_APP_MESSENGER="desktop_app_messenger",w.MOBILE_WEB="mobile_web",w.MOBILE_ANDROID="mobile_android",w.MOBILE_ANDROID_MESSENGER="mobile_android_messenger",w.MOBILE_IPHONE="mobile_iphone",w.MOBILE_IPHONE_MESSENGER="mobile_iphone_messenger",w.MOBILE_IPAD="mobile_ipad";var h=function(e){var n=void 0,r=[],u=Math.random().toString(36).substring(2,5);function A(e){r.push(e)}function v(){return p||a}function m(){return s&&window.parent!==window}function W(){return v()||m()}function V(e){if(p||a)return t([],r,!0).map((function(n){return n.call(null,e)}));var o=null==e?void 0:e.data;if(s&&o){if(i&&"string"==typeof o)try{o=JSON.parse(o)}catch(e){}var u=o.type,d=o.data,c=o.frameId;u&&("VKWebAppSettings"!==u?t([],r,!0).map((function(e){return e({detail:{type:u,data:d}})})):n=c)}}i&&/(android)/i.test(navigator.userAgent)?document.addEventListener(d,V):"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener(d,V);var _=o((function(t,o){l&&l[t]?l[t](JSON.stringify(o)):b&&b[t]&&"function"==typeof b[t].postMessage?b[t].postMessage(o):i?window.ReactNativeWebView.postMessage(JSON.stringify({handler:t,params:o})):f&&"function"==typeof f.postMessage&&f.postMessage({handler:t,params:o,type:"vk-connect",webFrameId:n,connectVersion:e},"*")}),A,u);return{send:_,sendPromise:_,subscribe:A,unsubscribe:function(e){var n=r.indexOf(e);n>-1&&r.splice(n,1)},supports:function(e){return a?!(!l||"function"!=typeof l[e]):p?!(!b||!b[e]||"function"!=typeof b[e].postMessage):!!s&&c.includes(e)},isWebView:v,isIframe:m,isEmbedded:W,isStandalone:function(){return!W()}}}("2.14.1");e.applyMiddleware=function e(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return t.includes(void 0)||t.includes(null)?e.apply(void 0,t.filter((function(e){return"function"==typeof e}))):function(e){if(0===t.length)return e;var o,r={subscribe:e.subscribe,send:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.send.apply(e,n)}},a=t.filter((function(e){return"function"==typeof e})).map((function(e){return e(r)})).reduce((function(e,n){return function(t){return e(n(t))}}));return o=a(e.send),n(n({},e),{send:o})}},e.default=h,e.parseURLSearchParamsForGetLaunchParams=function(n){var t={};try{var o=new URLSearchParams(n);o.forEach((function(n,o){switch(o){case"vk_ts":case"vk_is_recommended":case"vk_profile_id":case"vk_has_profile_button":case"vk_testing_group_id":case"vk_user_id":case"vk_app_id":case"vk_group_id":t[o]=Number(n);break;case"sign":case"vk_chat_id":case"vk_ref":case"vk_access_token_settings":t[o]=n;break;case"odr_enabled":t.odr_enabled="1"===n?1:void 0;break;case"vk_is_app_user":case"vk_are_notifications_enabled":case"vk_is_favorite":t[o]=function(e){switch(e){case"0":return 0;case"1":return 1;default:return}}(n);break;case"vk_language":t.vk_language=function(n){return Object.values(e.EGetLaunchParamsResponseLanguages).some((function(e){return e===n}))}(n)?n:void 0;break;case"vk_viewer_group_role":t.vk_viewer_group_role=function(n){return Object.values(e.EGetLaunchParamsResponseGroupRole).some((function(e){return e===n}))}(n)?n:void 0;break;case"vk_platform":t.vk_platform=function(n){return Object.values(e.EGetLaunchParamsResponsePlatforms).some((function(e){return e===n}))}(n)?n:void 0}}))}catch(e){console.warn(e)}return t},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).vkBridge={})}(this,(function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},n.apply(this,arguments)};function t(e,n,t){if(t||2===arguments.length)for(var o,r=0,a=n.length;r<a;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function o(e,t,o){var r=function(e){var n={current:0,next:function(){return++this.current}},t={};return{add:function(o,r){var a=null!=r?r:"".concat(n.next(),"_").concat(e);return t[a]=o,a},resolve:function(e,n,o){var r=t[e];r&&(o(n)?r.resolve(n):r.reject(n),t[e]=null)}}}(o);return t((function(e){if(e.detail&&e.detail.data&&"object"==typeof e.detail.data&&"request_id"in e.detail.data){var n=e.detail.data,t=n.request_id,o=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t}(n,["request_id"]);t&&r.resolve(t,o,(function(e){return!("error_type"in e)}))}})),function(t,o){return void 0===o&&(o={}),new Promise((function(a,p){var i=r.add({resolve:a,reject:p},o.request_id);e(t,n(n({},o),{request_id:i}))}))}}var r="undefined"!=typeof window,a=Boolean(r&&window.AndroidBridge),p=Boolean(r&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),i=Boolean(r&&window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView.postMessage),s=r&&!a&&!p,u=s&&/(^\?|&)vk_platform=mobile_web(&|$)/.test(location.search),d=s?"message":"VKWebAppEvent",c=t(["VKWebAppInit","VKWebAppGetCommunityAuthToken","VKWebAppAddToCommunity","VKWebAppAddToHomeScreenInfo","VKWebAppClose","VKWebAppCopyText","VKWebAppCreateHash","VKWebAppGetUserInfo","VKWebAppSetLocation","VKWebAppSendToClient","VKWebAppGetClientVersion","VKWebAppGetPhoneNumber","VKWebAppGetEmail","VKWebAppGetGroupInfo","VKWebAppGetGeodata","VKWebAppGetCommunityToken","VKWebAppGetConfig","VKWebAppGetLaunchParams","VKWebAppSetTitle","VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppJoinGroup","VKWebAppLeaveGroup","VKWebAppAllowMessagesFromGroup","VKWebAppDenyNotifications","VKWebAppAllowNotifications","VKWebAppOpenPayForm","VKWebAppOpenApp","VKWebAppShare","VKWebAppShowWallPostBox","VKWebAppScroll","VKWebAppShowOrderBox","VKWebAppShowLeaderBoardBox","VKWebAppShowInviteBox","VKWebAppShowRequestBox","VKWebAppAddToFavorites","VKWebAppShowStoryBox","VKWebAppStorageGet","VKWebAppStorageGetKeys","VKWebAppStorageSet","VKWebAppFlashGetInfo","VKWebAppSubscribeStoryApp","VKWebAppOpenWallPost","VKWebAppCheckAllowedScopes","VKWebAppCheckBannerAd","VKWebAppHideBannerAd","VKWebAppShowBannerAd","VKWebAppCheckNativeAds","VKWebAppShowNativeAds","VKWebAppRetargetingPixel","VKWebAppConversionHit","VKWebAppShowSubscriptionBox","VKWebAppCheckSurvey","VKWebAppShowSurvey","VKWebAppScrollTop","VKWebAppScrollTopStart","VKWebAppScrollTopStop","VKWebAppShowSlidesSheet","VKWebAppTranslate","VKWebAppRecommend","VKWebAppAddToProfile","VKWebAppGetFriends"],s&&!u?["VKWebAppResizeWindow","VKWebAppAddToMenu","VKWebAppShowInstallPushBox","VKWebAppShowCommunityWidgetPreviewBox","VKWebAppCallStart","VKWebAppCallJoin","VKWebAppCallGetStatus"]:["VKWebAppShowImages"],!0),l=r?window.AndroidBridge:void 0,b=p?window.webkit.messageHandlers:void 0,f=s?parent:void 0;var A,v,m,W,V,_,K,w;e.EAdsFormats=void 0,(A=e.EAdsFormats||(e.EAdsFormats={})).REWARD="reward",A.INTERSTITIAL="interstitial",e.BannerAdLayoutType=void 0,(v=e.BannerAdLayoutType||(e.BannerAdLayoutType={})).RESIZE="resize",v.OVERLAY="overlay",e.BannerAdLocation=void 0,(m=e.BannerAdLocation||(e.BannerAdLocation={})).TOP="top",m.BOTTOM="bottom",e.BannerAdAlign=void 0,(W=e.BannerAdAlign||(e.BannerAdAlign={})).LEFT="left",W.RIGHT="right",W.CENTER="center",e.EGrantedPermission=void 0,(V=e.EGrantedPermission||(e.EGrantedPermission={})).CAMERA="camera",V.LOCATION="location",V.PHOTO="photo",e.EGetLaunchParamsResponseLanguages=void 0,(_=e.EGetLaunchParamsResponseLanguages||(e.EGetLaunchParamsResponseLanguages={})).RU="ru",_.UK="uk",_.UA="ua",_.EN="en",_.BE="be",_.KZ="kz",_.PT="pt",_.ES="es",e.EGetLaunchParamsResponseGroupRole=void 0,(K=e.EGetLaunchParamsResponseGroupRole||(e.EGetLaunchParamsResponseGroupRole={})).ADMIN="admin",K.EDITOR="editor",K.MEMBER="member",K.MODER="moder",K.NONE="none",e.EGetLaunchParamsResponsePlatforms=void 0,(w=e.EGetLaunchParamsResponsePlatforms||(e.EGetLaunchParamsResponsePlatforms={})).DESKTOP_WEB="desktop_web",w.DESKTOP_WEB_MESSENGER="desktop_web_messenger",w.DESKTOP_APP_MESSENGER="desktop_app_messenger",w.MOBILE_WEB="mobile_web",w.MOBILE_ANDROID="mobile_android",w.MOBILE_ANDROID_MESSENGER="mobile_android_messenger",w.MOBILE_IPHONE="mobile_iphone",w.MOBILE_IPHONE_MESSENGER="mobile_iphone_messenger",w.MOBILE_IPAD="mobile_ipad";var h=function(e){var n=void 0,r=[],u=Math.random().toString(36).substring(2,5);function A(e){r.push(e)}function v(){return p||a}function m(){return s&&window.parent!==window}function W(){return v()||m()}function V(e){if(p||a)return t([],r,!0).map((function(n){return n.call(null,e)}));var o=null==e?void 0:e.data;if(s&&o){if(i&&"string"==typeof o)try{o=JSON.parse(o)}catch(e){}var u=o.type,d=o.data,c=o.frameId;u&&("VKWebAppSettings"!==u?t([],r,!0).map((function(e){return e({detail:{type:u,data:d}})})):n=c)}}i&&/(android)/i.test(navigator.userAgent)?document.addEventListener(d,V):"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener(d,V);var _=o((function(t,o){l&&l[t]?l[t](JSON.stringify(o)):b&&b[t]&&"function"==typeof b[t].postMessage?b[t].postMessage(o):i?window.ReactNativeWebView.postMessage(JSON.stringify({handler:t,params:o})):f&&"function"==typeof f.postMessage&&f.postMessage({handler:t,params:o,type:"vk-connect",webFrameId:n,connectVersion:e},"*")}),A,u);return{send:_,sendPromise:_,subscribe:A,unsubscribe:function(e){var n=r.indexOf(e);n>-1&&r.splice(n,1)},supports:function(e){return a?!(!l||"function"!=typeof l[e]):p?!(!b||!b[e]||"function"!=typeof b[e].postMessage):!!s&&c.includes(e)},isWebView:v,isIframe:m,isEmbedded:W,isStandalone:function(){return!W()}}}("2.14.2");e.applyMiddleware=function e(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return t.includes(void 0)||t.includes(null)?e.apply(void 0,t.filter((function(e){return"function"==typeof e}))):function(e){if(0===t.length)return e;var o,r={subscribe:e.subscribe,send:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.send.apply(e,n)}},a=t.filter((function(e){return"function"==typeof e})).map((function(e){return e(r)})).reduce((function(e,n){return function(t){return e(n(t))}}));return o=a(e.send),n(n({},e),{send:o})}},e.default=h,e.parseURLSearchParamsForGetLaunchParams=function(n){var t={};try{var o=new URLSearchParams(n);o.forEach((function(n,o){switch(o){case"vk_ts":case"vk_is_recommended":case"vk_profile_id":case"vk_has_profile_button":case"vk_testing_group_id":case"vk_user_id":case"vk_app_id":case"vk_group_id":t[o]=Number(n);break;case"sign":case"vk_chat_id":case"vk_ref":case"vk_access_token_settings":t[o]=n;break;case"odr_enabled":t.odr_enabled="1"===n?1:void 0;break;case"vk_is_app_user":case"vk_are_notifications_enabled":case"vk_is_favorite":t[o]=function(e){switch(e){case"0":return 0;case"1":return 1;default:return}}(n);break;case"vk_language":t.vk_language=function(n){return Object.values(e.EGetLaunchParamsResponseLanguages).some((function(e){return e===n}))}(n)?n:void 0;break;case"vk_viewer_group_role":t.vk_viewer_group_role=function(n){return Object.values(e.EGetLaunchParamsResponseGroupRole).some((function(e){return e===n}))}(n)?n:void 0;break;case"vk_platform":t.vk_platform=function(n){return Object.values(e.EGetLaunchParamsResponsePlatforms).some((function(e){return e===n}))}(n)?n:void 0}}))}catch(e){console.warn(e)}return t},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.js.map
{
"name": "@vkontakte/vk-bridge",
"version": "2.14.1",
"version": "2.14.2",
"description": "Connects a Mini App with VK client",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc