text: function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}window.CustomEvent||function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}();var t=["VKWebAppGetAuthToken","VKWebAppCallAPIMethod","VKWebAppAddToCommunity","VKWebAppGetGeodata","VKWebAppGetUserInfo","VKWebAppGetPhoneNumber","VKWebAppGetClientVersion","VKWebAppGetCommunityAuthToken","VKWebAppGetCommunityToken","VKWebAppOpenPayForm","VKWebAppShare","VKWebAppAllowNotifications","VKWebAppDenyNotifications","VKWebAppShowWallPostBox","VKWebAppGetEmail","VKWebAppAllowMessagesFromGroup","VKWebAppJoinGroup","VKWebAppOpenApp","VKWebAppSetLocation","VKWebAppScroll","VKWebAppResizeWindow"],n="undefined"!=typeof window,a=n&&window.webkit&&void 0!==window.webkit.messageHandlers&&void 0!==window.webkit.messageHandlers.VKWebAppClose,o=n&&window.AndroidBridge,i=a&&window.webkit.messageHandlers,p=!o&&!i,d=p?"message":"VKWebAppEvent",r={},s=0,u="",l=[];window.addEventListener(d,function(t){var n=null,a={};if(p){if(t.data.type&&"VKWebAppSettings"===t.data.type)return void(u=t.data.frameId);t.data.hasOwnProperty("frameId")&&delete t.data.frameId,t.data.hasOwnProperty("connectVersion")&&delete t.data.connectVersion}if(l.length>0&&b(t),p?t.data&&t.data.data&&(a=e({},t.data),n=r[a.data.request_id]):t.detail&&t.detail.data&&(a=e({},t.detail),n=r[a.data.request_id]),a.data&&a.data.request_id&&(n=r[a.data.request_id]))return n.customRequestId&&delete a.data.request_id,a.data.error_type?n.reject(a):n.resolve(a)});var b=function(t){var n=l.slice(),a={};p?a.detail=e({},t.data):t.detail&&t.detail.data&&(a.detail=e({},t.detail)),n.forEach(function(e){e(a)})},c={send:function(e,t){t||(t={});var n=t.request_id?t.request_id:"method#"+s++,a=!1;if(t.hasOwnProperty("request_id")||(a=!0,t.request_id=n),o&&"function"==typeof o[e]&&o[e](JSON.stringify(t)),i&&i[e]&&"function"==typeof i[e].postMessage&&i[e].postMessage(t),p&&parent.postMessage({handler:e,params:t,frameId:u,type:"vk-connect"},"*"),"VKWebAppInit"!==e)return new Promise(function(e,o){r[n]={resolve:e,reject:o,params:t,customRequestId:a}})},supports:function(e){return!(!o||"function"!=typeof o[e])||!(!i||!i[e]||"function"!=typeof i[e].postMessage)||!!~t.indexOf(e)},subscribe:function(e){l.push(e)}};export default c;
  