@vbotma/sdk 3.1.8

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.
Files changed (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/dist/dts/composables/AsyncMountable.d.ts +44 -0
  4. package/dist/dts/composables/Button.d.ts +140 -0
  5. package/dist/dts/composables/Mountable.d.ts +43 -0
  6. package/dist/dts/composables/Stateful.d.ts +35 -0
  7. package/dist/dts/errors.d.ts +51 -0
  8. package/dist/dts/features/BackButton/BackButton.d.ts +96 -0
  9. package/dist/dts/features/BackButton/exports.d.ts +2 -0
  10. package/dist/dts/features/BackButton/instance.d.ts +2 -0
  11. package/dist/dts/features/Biometry/Biometry.d.ts +121 -0
  12. package/dist/dts/features/Biometry/exports.d.ts +3 -0
  13. package/dist/dts/features/Biometry/instance.d.ts +2 -0
  14. package/dist/dts/features/Biometry/types.d.ts +84 -0
  15. package/dist/dts/features/ClosingBehavior/ClosingBehavior.d.ts +51 -0
  16. package/dist/dts/features/ClosingBehavior/exports.d.ts +2 -0
  17. package/dist/dts/features/ClosingBehavior/instance.d.ts +2 -0
  18. package/dist/dts/features/CloudStorage/CloudStorage.d.ts +90 -0
  19. package/dist/dts/features/CloudStorage/exports.d.ts +2 -0
  20. package/dist/dts/features/CloudStorage/instance.d.ts +2 -0
  21. package/dist/dts/features/DeviceStorage/DeviceStorage.d.ts +53 -0
  22. package/dist/dts/features/DeviceStorage/exports.d.ts +2 -0
  23. package/dist/dts/features/DeviceStorage/instance.d.ts +2 -0
  24. package/dist/dts/features/HapticFeedback/HapticFeedback.d.ts +57 -0
  25. package/dist/dts/features/HapticFeedback/exports.d.ts +2 -0
  26. package/dist/dts/features/HapticFeedback/instance.d.ts +2 -0
  27. package/dist/dts/features/InitData/InitData.d.ts +87 -0
  28. package/dist/dts/features/InitData/exports.d.ts +2 -0
  29. package/dist/dts/features/InitData/instance.d.ts +2 -0
  30. package/dist/dts/features/Invoice/Invoice.d.ts +54 -0
  31. package/dist/dts/features/Invoice/exports.d.ts +2 -0
  32. package/dist/dts/features/Invoice/instance.d.ts +2 -0
  33. package/dist/dts/features/LocationManager/LocationManager.d.ts +73 -0
  34. package/dist/dts/features/LocationManager/exports.d.ts +3 -0
  35. package/dist/dts/features/LocationManager/instance.d.ts +2 -0
  36. package/dist/dts/features/LocationManager/types.d.ts +65 -0
  37. package/dist/dts/features/MainButton/MainButton.d.ts +214 -0
  38. package/dist/dts/features/MainButton/exports.d.ts +2 -0
  39. package/dist/dts/features/MainButton/instance.d.ts +2 -0
  40. package/dist/dts/features/MiniApp/MiniApp.d.ts +192 -0
  41. package/dist/dts/features/MiniApp/exports.d.ts +2 -0
  42. package/dist/dts/features/MiniApp/instance.d.ts +2 -0
  43. package/dist/dts/features/Notification/Notification.d.ts +21 -0
  44. package/dist/dts/features/Notification/exports.d.ts +3 -0
  45. package/dist/dts/features/Notification/instance.d.ts +2 -0
  46. package/dist/dts/features/Notification/types.d.ts +19 -0
  47. package/dist/dts/features/Popup/Popup.d.ts +56 -0
  48. package/dist/dts/features/Popup/exports.d.ts +3 -0
  49. package/dist/dts/features/Popup/instance.d.ts +2 -0
  50. package/dist/dts/features/Popup/prepareParams.d.ts +9 -0
  51. package/dist/dts/features/Popup/types.d.ts +54 -0
  52. package/dist/dts/features/QrScanner/QrScanner.d.ts +131 -0
  53. package/dist/dts/features/QrScanner/exports.d.ts +2 -0
  54. package/dist/dts/features/QrScanner/instance.d.ts +2 -0
  55. package/dist/dts/features/Refresh/Refresh.d.ts +39 -0
  56. package/dist/dts/features/Refresh/exports.d.ts +3 -0
  57. package/dist/dts/features/Refresh/instance.d.ts +2 -0
  58. package/dist/dts/features/Refresh/types.d.ts +7 -0
  59. package/dist/dts/features/SecondaryButton/SecondaryButton.d.ts +253 -0
  60. package/dist/dts/features/SecondaryButton/exports.d.ts +2 -0
  61. package/dist/dts/features/SecondaryButton/instance.d.ts +2 -0
  62. package/dist/dts/features/SecureStorage/SecureStorage.d.ts +68 -0
  63. package/dist/dts/features/SecureStorage/exports.d.ts +2 -0
  64. package/dist/dts/features/SecureStorage/instance.d.ts +2 -0
  65. package/dist/dts/features/SettingsButton/SettingsButton.d.ts +96 -0
  66. package/dist/dts/features/SettingsButton/exports.d.ts +2 -0
  67. package/dist/dts/features/SettingsButton/instance.d.ts +2 -0
  68. package/dist/dts/features/StoragePermission/StoragePermission.d.ts +45 -0
  69. package/dist/dts/features/StoragePermission/exports.d.ts +3 -0
  70. package/dist/dts/features/StoragePermission/instance.d.ts +2 -0
  71. package/dist/dts/features/StoragePermission/types.d.ts +51 -0
  72. package/dist/dts/features/SwipeBehavior/SwipeBehavior.d.ts +62 -0
  73. package/dist/dts/features/SwipeBehavior/exports.d.ts +2 -0
  74. package/dist/dts/features/SwipeBehavior/instance.d.ts +2 -0
  75. package/dist/dts/features/ThemeParams/ThemeParams.d.ts +127 -0
  76. package/dist/dts/features/ThemeParams/exports.d.ts +2 -0
  77. package/dist/dts/features/ThemeParams/instance.d.ts +2 -0
  78. package/dist/dts/features/Viewport/Viewport.d.ts +219 -0
  79. package/dist/dts/features/Viewport/exports.d.ts +2 -0
  80. package/dist/dts/features/Viewport/instance.d.ts +2 -0
  81. package/dist/dts/features/emoji-status/exports.d.ts +2 -0
  82. package/dist/dts/features/emoji-status/requestEmojiStatusAccess.d.ts +16 -0
  83. package/dist/dts/features/emoji-status/setEmojiStatus.d.ts +28 -0
  84. package/dist/dts/features/home-screen/addToHomeScreen.d.ts +11 -0
  85. package/dist/dts/features/home-screen/checkHomeScreenStatus.d.ts +14 -0
  86. package/dist/dts/features/home-screen/exports.d.ts +2 -0
  87. package/dist/dts/features/links/exports.d.ts +3 -0
  88. package/dist/dts/features/links/openLink.d.ts +31 -0
  89. package/dist/dts/features/links/openTelegramLink.d.ts +18 -0
  90. package/dist/dts/features/links/shareURL.d.ts +18 -0
  91. package/dist/dts/features/privacy/exports.d.ts +3 -0
  92. package/dist/dts/features/privacy/requestContact.d.ts +59 -0
  93. package/dist/dts/features/privacy/requestPhoneAccess.d.ts +19 -0
  94. package/dist/dts/features/privacy/requestWriteAccess.d.ts +14 -0
  95. package/dist/dts/features/uncategorized/copyTextToClipboard.d.ts +5 -0
  96. package/dist/dts/features/uncategorized/downloadFile.d.ts +21 -0
  97. package/dist/dts/features/uncategorized/exports.d.ts +11 -0
  98. package/dist/dts/features/uncategorized/getCurrentTime.d.ts +15 -0
  99. package/dist/dts/features/uncategorized/hideKeyboard.d.ts +13 -0
  100. package/dist/dts/features/uncategorized/readTextFromClipboard.d.ts +13 -0
  101. package/dist/dts/features/uncategorized/retrieveAndroidDeviceData.d.ts +6 -0
  102. package/dist/dts/features/uncategorized/retrieveAndroidDeviceDataFrom.d.ts +14 -0
  103. package/dist/dts/features/uncategorized/sendData.d.ts +20 -0
  104. package/dist/dts/features/uncategorized/shareMessage.d.ts +14 -0
  105. package/dist/dts/features/uncategorized/shareStory.d.ts +50 -0
  106. package/dist/dts/features/uncategorized/switchInlineQuery.d.ts +28 -0
  107. package/dist/dts/fn-options/bottomButtonOptions.d.ts +11 -0
  108. package/dist/dts/fn-options/buttonOptions.d.ts +10 -0
  109. package/dist/dts/fn-options/createFnOption.d.ts +2 -0
  110. package/dist/dts/fn-options/sharedFeatureOptions.d.ts +8 -0
  111. package/dist/dts/fn-options/withCreateRequestId.d.ts +7 -0
  112. package/dist/dts/fn-options/withInvokeCustomMethod.d.ts +11 -0
  113. package/dist/dts/fn-options/withPostEvent.d.ts +8 -0
  114. package/dist/dts/fn-options/withRequest.d.ts +8 -0
  115. package/dist/dts/fn-options/withStateRestore.d.ts +13 -0
  116. package/dist/dts/fn-options/withVersion.d.ts +9 -0
  117. package/dist/dts/globals/createRequestId.d.ts +4 -0
  118. package/dist/dts/globals/invokeCustomMethod.d.ts +16 -0
  119. package/dist/dts/globals/isInlineMode.d.ts +4 -0
  120. package/dist/dts/globals/postEvent.d.ts +4 -0
  121. package/dist/dts/globals/request.d.ts +13 -0
  122. package/dist/dts/globals/resetGlobals.d.ts +4 -0
  123. package/dist/dts/globals/signals-registry.d.ts +39 -0
  124. package/dist/dts/globals/themeParams.d.ts +4 -0
  125. package/dist/dts/globals/version.d.ts +4 -0
  126. package/dist/dts/helpers/access.d.ts +2 -0
  127. package/dist/dts/helpers/component-storage.d.ts +9 -0
  128. package/dist/dts/helpers/createIsSupportedSignal.d.ts +5 -0
  129. package/dist/dts/helpers/css-vars.d.ts +11 -0
  130. package/dist/dts/helpers/isColorDark.d.ts +11 -0
  131. package/dist/dts/helpers/navigation.d.ts +5 -0
  132. package/dist/dts/helpers/removeUndefined.d.ts +10 -0
  133. package/dist/dts/helpers/shallowEqual.d.ts +1 -0
  134. package/dist/dts/index.d.ts +38 -0
  135. package/dist/dts/init.d.ts +42 -0
  136. package/dist/dts/types.d.ts +6 -0
  137. package/dist/dts/with-checks/throwifyWithChecksFp.d.ts +3 -0
  138. package/dist/dts/with-checks/withChecksFp.d.ts +170 -0
  139. package/dist/index.cjs +2 -0
  140. package/dist/index.cjs.map +1 -0
  141. package/dist/index.iife.js +4 -0
  142. package/dist/index.iife.js.map +1 -0
  143. package/dist/index.js +4088 -0
  144. package/dist/index.js.map +1 -0
  145. package/package.json +54 -0
@@ -0,0 +1,4 @@
1
+ var Bu=Object.defineProperty;var Mu=(c,X,Ae)=>X in c?Bu(c,X,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):c[X]=Ae;var s=(c,X,Ae)=>Mu(c,typeof X!="symbol"?X+"":X,Ae);this.tmajs=this.tmajs||{};this.tmajs.sdk=(function(c){"use strict";let X;function Ae(t,e){X?X.set(t,e):e()}function Ze(t){if(X)return t();X=new Map;try{t()}finally{X.forEach(e=>e()),X=void 0}}function D(t,e){e||(e={});const n=e.equals||Object.is;let r=[],i=t;const o=p=>{if(!n(i,p)){const f=i;i=p,Ae(l,()=>{[...r].forEach(([d,b])=>{d(p,f),b&&u(d,!0)})})}};function a(p){const f=typeof p!="object"?{once:p}:p;return{once:f.once||!1,signal:f.signal||!1}}const u=(p,f)=>{const d=a(f),b=r.findIndex(([v,F])=>v===p&&F.once===d.once&&F.signal===d.signal);b>=0&&r.splice(b,1)},l=Object.assign(function(){return As(l),i},{destroy(){r=[]},set:o,reset(){o(t)},sub(p,f){return r.push([p,a(f)]),()=>u(p,f)},unsub:u,unsubAll(){r=r.filter(p=>p[1].signal)}});return l}const Le=[];function As(t){Le.length&&Le[Le.length-1].add(t)}function S(t,e){let n=new Set,r;function i(){return r||(r=D(a(),e))}function o(){i().set(a())}function a(){n.forEach(p=>{p.unsub(o,{signal:!0})});const u=new Set;let l;Le.push(u);try{l=t()}finally{Le.pop()}return u.forEach(p=>{p.sub(o,{signal:!0})}),n=u,l}return Object.assign(function(){return i()()},{destroy(){i().destroy()},sub(...u){return i().sub(...u)},unsub(...u){i().unsub(...u)},unsubAll(...u){i().unsubAll(...u)}})}var $s=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function qs(t){return t}function vn(t,e,n,r,i,o,a,u,l){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return n(e(t.apply(this,arguments)))};case 4:return function(){return r(n(e(t.apply(this,arguments))))};case 5:return function(){return i(r(n(e(t.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(e(t.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return l(u(a(o(i(r(n(e(t.apply(this,arguments)))))))))}}}function h(t,e,n,r,i,o,a,u,l){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return n(e(t));case 4:return r(n(e(t)));case 5:return i(r(n(e(t))));case 6:return o(i(r(n(e(t)))));case 7:return a(o(i(r(n(e(t))))));case 8:return u(a(o(i(r(n(e(t)))))));case 9:return l(u(a(o(i(r(n(e(t))))))));default:{for(var p=arguments[0],f=1;f<arguments.length;f++)p=arguments[f](p);return p}}}var Oe=function(t,e){var n=typeof t=="number"?function(r){return r.length>=t}:t;return function(){var r=Array.from(arguments);return n(arguments)?e.apply(this,r):function(i){return e.apply(void 0,$s([i],r,!1))}}},Bs={_tag:"None"},Ms=function(t){return{_tag:"Some",value:t}},Ts=function(t){return t._tag==="Left"},wn=function(t){return{_tag:"Left",left:t}},yn=function(t){return{_tag:"Right",right:t}},_t={};function Rs(t,e){return function(n){return function(r){return t.ap(t.map(r,function(i){return function(o){return e.ap(i,o)}}),n)}}}function Ps(t,e){return function(n){return function(r){return t.map(r,function(i){return e.map(i,n)})}}}function mt(t){return function(e,n){return function(r){return t.chain(r,function(i){return t.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[e]=o,a))})})}}}var Fe=Bs,$e=Ms,Vs=function(t,e){return h(t,js(e))},Ls=function(t,e){return h(t,Us(e))},Os="Option",js=function(t){return function(e){return je(e)?Fe:$e(t(e.value))}},Ds=$e,Us=function(t){return function(e){return je(e)||je(t)?Fe:$e(e.value(t.value))}},Ws=Oe(2,function(t,e){return je(t)?Fe:e(t.value)}),Gs={URI:Os,map:Vs,ap:Ls,chain:Ws},je=function(t){return t._tag==="None"},Ns=function(t,e){return function(n){return je(n)?t():e(n.value)}},bt=Ns,xs=Ds(_t),Fn=mt(Gs),M=wn,k=yn,gt=Oe(2,function(t,e){return _e(t)?t:e(t.right)}),vt=function(t,e){return h(t,z(e))},Sn=function(t,e){return h(t,Js(e))},wt="Either",z=function(t){return function(e){return _e(e)?e:k(t(e.right))}},Hs={URI:wt,map:vt},zs=k,Ks=function(t){return function(e){return _e(e)?e:_e(t)?t:k(e.right(t.right))}},Js=Ks,Qs={URI:wt,map:vt,ap:Sn},Zs={URI:wt,map:vt,ap:Sn,chain:gt},Ys=function(t,e){return function(n){return _e(n)?M(t(n.left)):k(e(n.right))}},Xs=function(t){return function(e){return _e(e)?M(t(e.left)):e}},_e=Ts,yt=function(t,e){return function(n){return _e(n)?t(n.left):e(n.right)}},ei=yt,ae=yt,ti=ae,qe=function(t,e){try{return k(t())}catch(n){return M(e(n))}},ni=zs(_t),ri=mt(Zs),Cn=ri,si=gt,ii=gt;function oi(t){return vn(k,t.of)}function ai(t){return vn(M,t.of)}function ui(t){return Ps(t,Hs)}function ci(t){return Rs(t,Qs)}function li(t){return function(e,n){return t.chain(e,function(r){return _e(r)?t.of(r):n(r.right)})}}function pi(t){return function(e,n,r){return t.map(e,Ys(n,r))}}function hi(t){return function(e,n){return function(r){return t.map(r,ae(e,n))}}}var fi=function(t){return qe(function(){return JSON.parse(t)},qs)},Ft=function(t,e){return h(t,di(e))},kn=function(t,e){return h(t,_i(e))},di=function(t){return function(e){return function(){return Promise.resolve().then(e).then(t)}}},_i=function(t){return function(e){return function(){return Promise.all([Promise.resolve().then(e),Promise.resolve().then(t)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},St=function(t){return function(){return Promise.resolve(t)}},mi=Oe(2,function(t,e){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}),Ct="Task",kt={URI:Ct,map:Ft},En={of:St},bi={URI:Ct,map:Ft,ap:kn},gi={URI:Ct,map:Ft,of:St,ap:kn,chain:mi},vi=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(f){try{p(r.next(f))}catch(d){a(d)}}function l(f){try{p(r.throw(f))}catch(d){a(d)}}function p(f){f.done?o(f.value):i(f.value).then(u,l)}p((r=r.apply(t,e||[])).next())})},wi=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(p){return function(f){return l([p,f])}}function l(p){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,p[0]&&(n=0)),n;)try{if(r=1,i&&(o=p[0]&2?i.return:p[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,p[1])).done)return o;switch(i=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,i=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){n.label=p[1];break}if(p[0]===6&&n.label<o[1]){n.label=o[1],o=p;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(p);break}o[2]&&n.ops.pop(),n.trys.pop();continue}p=e.call(t,n)}catch(f){p=[6,f],i=0}finally{r=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},U=ai(En),R=oi(En),De=St,Ye=hi(kt),yi=Ye,In=function(t,e){return function(){return vi(void 0,void 0,void 0,function(){var n;return wi(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(yn)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,wn(e(n))];case 3:return[2]}})})}},Fi=function(t,e){return h(t,A(e))},Si=function(t,e){return h(t,Ci(e))},A=ui(kt),Ue=Oe(3,pi(kt)),Ci=ci(bi),Et=Oe(2,li(gi)),ki=R,Ei="TaskEither",Ii={URI:Ei,map:Fi,ap:Si,chain:Et},Ai=ki(_t),$i=mt(Ii),Xe=$i,te=Et,ue=Et;function ee(t){return typeof t=="function"?t():t}class We{constructor({onMounted:e,restoreState:n,initialState:r,onUnmounted:i,isPageReload:o}){s(this,"_isMounted",D(!1));s(this,"isMounted",S(this._isMounted));s(this,"mount");s(this,"unmount");this.mount=()=>{if(this.isMounted())return k(void 0);const a=ee(o)?n():void 0,u=a?k(a):typeof r=="function"?r():k(r);return h(u,z(l=>{Ze(()=>{this._isMounted.set(!0),e==null||e(l)})}))},this.unmount=()=>{this._isMounted()&&Ze(()=>{this._isMounted.set(!1),i==null||i()})}}}function It(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function At(t,e){const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:n.every(i=>Object.prototype.hasOwnProperty.call(e,i)&&t[i]===e[i])}class me{constructor({initialState:e,onChange:n}){s(this,"_state");s(this,"state");s(this,"setState",e=>{const n={...this.state(),...It(e)};At(n,this.state())||this._state.set(n)});this._state=D(e,{equals:At}),this.state=S(this._state),this.state.sub(n)}getter(e){return S(()=>this._state()[e])}hasDiff(e){return!At({...this.state(),...It(e)},this.state())}}let ce;function $t(t){return{lang:(t==null?void 0:t.lang)??(ce==null?void 0:ce.lang),message:t==null?void 0:t.message,abortEarly:(t==null?void 0:t.abortEarly)??(ce==null?void 0:ce.abortEarly),abortPipeEarly:(t==null?void 0:t.abortPipeEarly)??(ce==null?void 0:ce.abortPipeEarly)}}let qt;function qi(t){return qt==null?void 0:qt.get(t)}let Bt;function Bi(t){return Bt==null?void 0:Bt.get(t)}let Mt;function Mi(t,e){var n;return(n=Mt==null?void 0:Mt.get(t))==null?void 0:n.get(e)}function Ti(t){var n,r;const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&((r=(n=Object.getPrototypeOf(t))==null?void 0:n.constructor)==null?void 0:r.name))??"null":e}function J(t,e,n,r,i){const o=i&&"input"in i?i.input:n.value,a=(i==null?void 0:i.expected)??t.expects??null,u=(i==null?void 0:i.received)??Ti(o),l={kind:t.kind,type:t.type,input:o,expected:a,received:u,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${u}`,requirement:t.requirement,path:i==null?void 0:i.path,issues:i==null?void 0:i.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},p=t.kind==="schema",f=(i==null?void 0:i.message)??t.message??Mi(t.reference,l.lang)??(p?Bi(l.lang):null)??r.message??qi(l.lang);f!==void 0&&(l.message=typeof f=="function"?f(l):f),p&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function Q(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},$t())}}}function An(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ri(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}var Pi=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function et(t,e){return{kind:"validation",type:"check",reference:et,async:!1,expects:null,requirement:t,message:e,"~run"(n,r){return n.typed&&!this.requirement(n.value)&&J(this,"input",n,r),n}}}function Tt(t){return{kind:"validation",type:"integer",reference:Tt,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&J(this,"integer",e,n),e}}}function le(t){return{kind:"transformation",type:"transform",reference:le,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Vi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Rt(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Pt(t,e){return!t["~run"]({value:e},{abortEarly:!0}).issues}function $n(){return{kind:"schema",type:"any",reference:$n,expects:"any",async:!1,get"~standard"(){return Q(this)},"~run"(t){return t.typed=!0,t}}}function qn(t,e){return{kind:"schema",type:"array",reference:qn,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return Q(this)},"~run"(n,r){var o;const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let a=0;a<i.length;a++){const u=i[a],l=this.item["~run"]({value:u},r);if(l.issues){const p={type:"array",origin:"value",input:i,key:a,value:u};for(const f of l.issues)f.path?f.path.unshift(p):f.path=[p],(o=n.issues)==null||o.push(f);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}}else J(this,"type",n,r);return n}}}function Se(t){return{kind:"schema",type:"boolean",reference:Se,expects:"boolean",async:!1,message:t,get"~standard"(){return Q(this)},"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:J(this,"type",e,n),e}}}function tt(t){return{kind:"schema",type:"date",reference:tt,expects:"Date",async:!1,message:t,get"~standard"(){return Q(this)},"~run"(e,n){return e.value instanceof Date?isNaN(e.value)?J(this,"type",e,n,{received:'"Invalid Date"'}):e.typed=!0:J(this,"type",e,n),e}}}function Vt(t){return{kind:"schema",type:"function",reference:Vt,expects:"Function",async:!1,message:t,get"~standard"(){return Q(this)},"~run"(e,n){return typeof e.value=="function"?e.typed=!0:J(this,"type",e,n),e}}}function Lt(t,e){return{kind:"schema",type:"instance",reference:Lt,expects:t.name,async:!1,class:t,message:e,get"~standard"(){return Q(this)},"~run"(n,r){return n.value instanceof this.class?n.typed=!0:J(this,"type",n,r),n}}}function G(t,e){return{kind:"schema",type:"loose_object",reference:G,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return Q(this)},"~run"(n,r){var o;const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const a in this.entries){const u=this.entries[a];if(a in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=a in i?i[a]:Rt(u),p=u["~run"]({value:l},r);if(p.issues){const f={type:"object",origin:"value",input:i,key:a,value:l};for(const d of p.issues)d.path?d.path.unshift(f):d.path=[f],(o=n.issues)==null||o.push(d);if(n.issues||(n.issues=p.issues),r.abortEarly){n.typed=!1;break}}p.typed||(n.typed=!1),n.value[a]=p.value}else if(u.fallback!==void 0)n.value[a]=Vi(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(J(this,"key",n,r,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:i,key:a,value:i[a]}]}),r.abortEarly))break}if(!n.issues||!r.abortEarly)for(const a in i)An(i,a)&&!(a in this.entries)&&(n.value[a]=i[a])}else J(this,"type",n,r);return n}}}function Be(t,e){return{kind:"schema",type:"nullish",reference:Be,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Q(this)},"~run"(n,r){return(n.value===null||n.value===void 0)&&(this.default!==void 0&&(n.value=Rt(this,n,r)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function be(t){return{kind:"schema",type:"number",reference:be,expects:"number",async:!1,message:t,get"~standard"(){return Q(this)},"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:J(this,"type",e,n),e}}}function $(t,e){return{kind:"schema",type:"optional",reference:$,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Q(this)},"~run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=Rt(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function Ot(t,e,n){return{kind:"schema",type:"record",reference:Ot,expects:"Object",async:!1,key:t,value:e,message:n,get"~standard"(){return Q(this)},"~run"(r,i){var a,u;const o=r.value;if(o&&typeof o=="object"){r.typed=!0,r.value={};for(const l in o)if(An(o,l)){const p=o[l],f=this.key["~run"]({value:l},i);if(f.issues){const b={type:"object",origin:"key",input:o,key:l,value:p};for(const v of f.issues)v.path=[b],(a=r.issues)==null||a.push(v);if(r.issues||(r.issues=f.issues),i.abortEarly){r.typed=!1;break}}const d=this.value["~run"]({value:p},i);if(d.issues){const b={type:"object",origin:"value",input:o,key:l,value:p};for(const v of d.issues)v.path?v.path.unshift(b):v.path=[b],(u=r.issues)==null||u.push(v);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}(!f.typed||!d.typed)&&(r.typed=!1),f.typed&&(r.value[f.value]=d.value)}}else J(this,"type",r,i);return r}}}function y(t){return{kind:"schema",type:"string",reference:y,expects:"string",async:!1,message:t,get"~standard"(){return Q(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:J(this,"type",e,n),e}}}function Bn(t){let e;if(t)for(const n of t)e?e.push(...n.issues):e=n.issues;return e}function nt(t,e){return{kind:"schema",type:"union",reference:nt,expects:Ri(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Q(this)},"~run"(n,r){let i,o,a;for(const u of this.options){const l=u["~run"]({value:n.value},r);if(l.typed)if(l.issues)o?o.push(l):o=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(o){if(o.length===1)return o[0];J(this,"type",n,r,{issues:Bn(o)}),n.typed=!0}else{if((a==null?void 0:a.length)===1)return a[0];J(this,"type",n,r,{issues:Bn(a)})}return n}}}function jt(){return{kind:"schema",type:"unknown",reference:jt,expects:"unknown",async:!1,get"~standard"(){return Q(this)},"~run"(t){return t.typed=!0,t}}}function ge(t,e,n){const r=t["~run"]({value:e},$t(n));if(r.issues)throw new Pi(r.issues);return r.value}function ie(...t){return{...t[0],pipe:t,get"~standard"(){return Q(this)},"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=r["~run"](e,n))}return e}}}function Dt(t,e,n){const r=t["~run"]({value:e},$t(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var Li=Object.defineProperty,Oi=(t,e,n)=>e in t?Li(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mn=(t,e,n)=>Oi(t,typeof e!="symbol"?e+"":e,n),ji=Object.defineProperty,Di=(t,e,n)=>e in t?ji(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ut=(t,e,n)=>Di(t,typeof e!="symbol"?e+"":e,n);function Tn(t){return e=>e instanceof t}function Rn(t,e){const n=class extends Error{constructor(...i){const o=typeof e=="function"?e(...i):typeof e=="string"?[e]:e||[];super(...o),this.name=t}};Ut(n,"is",Tn(n));let r=n;return Object.defineProperty(r,"name",{value:t}),r}function Ui(t,e,n){const r=class extends Rn(t,n){constructor(...o){super(...o),Ut(this,"data"),this.data=e(...o)}};Ut(r,"is",Tn(r));let i=r;return Object.defineProperty(i,"name",{value:t}),i}let Pn=class extends Rn("CancelledError","Promise was canceled"){},Wt=class extends Ui("TimeoutError",e=>({timeout:e}),(e,n)=>[`Timeout reached: ${e}ms`,{cause:n}]){};const Wi=Symbol("resolved");function Gi(t){return{tag:Wi,value:t}}function Vn(t,e){return t.reject=e.reject,t.resolve=e.resolve,t}class ve extends Promise{constructor(e,n){let r,i,o,a;typeof e=="function"?(o=e,a=n||{}):a=e||{};let u,l;const p=()=>!!l,f=()=>!!u;let d={};const b=[],v=()=>{b.forEach(g=>g()),b.splice(0,b.length),d={}},F=new AbortController,C=()=>f()||p();super((g,w)=>{const{abortOnResolve:m=!0,abortOnReject:O=!0}=a;i=I=>{var L,P;C()||(g(I),u=[I],(L=d.resolved)==null||L.forEach(N=>N(I)),(P=d.finalized)==null||P.forEach(N=>N({kind:"resolved",result:I})),v(),m&&F.abort(Gi(I)))},r=I=>{var L,P;C()||(w(I),l=[I],(L=d.rejected)==null||L.forEach(N=>N(I)),(P=d.finalized)==null||P.forEach(N=>N({kind:"rejected",reason:I})),v(),O&&F.abort(I))};const{abortSignal:j}=a;if(j){if(j.aborted)return r(j.reason);const I=()=>{r(j.reason)};j.addEventListener("abort",I,!0),b.push(()=>{j.removeEventListener("abort",I,!0)})}const{timeout:W}=a;if(W){const I=setTimeout(()=>{r(new Wt(W))},W);b.push(()=>{clearTimeout(I)})}try{const I=()=>{},L=o&&o(i,r,{abortSignal:F.signal,get isRejected(){return p()},get isResolved(){return f()},on(P,N){if(u||l){if(P==="finalized"){const Ve=u?{kind:"resolved",result:u[0]}:{kind:"rejected",reason:l[0]};N(Ve)}else P==="resolved"&&u?N(u[0]):P==="rejected"&&l&&N(l[0]);return I}return d[P]||(d[P]=[]),d[P].push(N),()=>{const Ve=d[P]||[],Qe=Ve.indexOf(N);Qe>=0&&Ve.splice(Qe,1)}},get result(){return u==null?void 0:u[0]},get rejectReason(){return l==null?void 0:l[0]},throwIfRejected(){if(l)throw l[0]}});L instanceof Promise&&L.catch(r)}catch(I){r(I)}}),Mn(this,"reject"),Mn(this,"resolve"),this.reject=r,this.resolve=i}static fn(e,n){return new ve(async(r,i,o)=>{try{r(await e(o))}catch(a){i(a)}},n)}static resolve(e){return this.fn(()=>e)}static reject(e){return new ve((n,r)=>{r(e)})}cancel(){this.reject(new Pn)}catch(e){return this.then(void 0,e)}finally(e){return Vn(super.finally(e),this)}then(e,n){return Vn(super.then(e,n),this)}}function Ln(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Ni(t){return t.replace(/_[a-z]/g,e=>e[1].toUpperCase())}function xi(t){return Object.entries(t).reduce((e,[n,r])=>(e[Ni(n)]=r,e),{})}function Gt(t){const e=xi(t);for(const n in e){const r=e[n];r&&typeof r=="object"&&!(r instanceof Date)&&(e[n]=Array.isArray(r)?r.map(Gt):Gt(r))}return e}function Hi(t){return t.replace(/_([a-z])/g,(e,n)=>`-${n.toLowerCase()}`)}function On(t){return`tapps/${t}`}function Nt(t,e){sessionStorage.setItem(On(t),JSON.stringify(e))}function jn(t){const e=sessionStorage.getItem(On(t));try{return e?JSON.parse(e):void 0}catch{}}function Ge(...t){const e=t.flat(1);return[e.push.bind(e),()=>{e.forEach(n=>{n()})}]}function Dn(t,e){e||(e={});const{textColor:n,bgColor:r,shouldLog:i}=e,o=i===void 0?!0:i,a=typeof o=="boolean"?()=>o:o,u=(l,p,...f)=>{if(p||a()){const d="font-weight:bold;padding:0 5px;border-radius:100px",[b,v,F]={log:["#0089c3","white","INFO"],error:["#ff0000F0","white","ERR"],warn:["#D38E15","white","WARN"]}[l];console[l](`%c${F} ${Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,timeZone:"UTC"}).format(new Date)}%c %c${t}`,`${d};background-color:${b};color:${v}`,"",`${d};${n?`color:${n};`:""}${r?`background-color:${r}`:""}`,...f)}};return[["log","forceLog"],["warn","forceWarn"],["error","forceError"]].reduce((l,[p,f])=>(l[p]=u.bind(void 0,p,!1),l[f]=u.bind(void 0,p,!0),l),{})}function Ne(t){const e=n=>{throw n};return typeof t=="function"?ve.resolve(h(t,Ye(e,n=>n))()):h(t,ae(e,n=>n))}function ne(t){return Object.assign((...e)=>Ne(t(...e)),t)}const Me=Object.assign((t,e)=>h(In(()=>new ve((n,r,i)=>t(o=>n(k(o)),o=>n(M(o)),i),e),n=>n),ue(ae(U,R))),{fn:(t,e)=>Me((n,r,i)=>{const o=t(i);h(typeof o=="function"?o:De(o),yi(r,n))()},e)});var zi=Object.defineProperty,Ki=(t,e,n)=>e in t?zi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xt=(t,e,n)=>Ki(t,typeof e!="symbol"?e+"":e,n);function Un(t){return e=>e instanceof t}function H(t,e){const n=class extends Error{constructor(...o){const a=typeof e=="function"?e(...o):typeof e=="string"?[e]:e||[];super(...a),this.name=t}};xt(n,"is",Un(n));let r=n;return Object.defineProperty(r,"name",{value:t}),r}function rt(t,e,n){const r=class extends H(t,n){constructor(...a){super(...a),xt(this,"data"),this.data=e(...a)}};xt(r,"is",Un(r));let i=r;return Object.defineProperty(i,"name",{value:t}),i}function Ji(t){const e=n=>{const r={};return new URLSearchParams(n).forEach((i,o)=>{const a=r[o];Array.isArray(a)?a.push(i):a===void 0?r[o]=i:r[o]=[a,i]}),ge(t,r)};return ie(nt([y(),Lt(URLSearchParams)]),et(n=>{try{return e(n),!0}catch{return!1}},"The value doesn't match required schema"),le(e))}function Qi(t){return ie(y(),et(e=>{try{return JSON.parse(e),!0}catch{return!1}},"Input is not a valid JSON value"),le(JSON.parse),t)}function pe(t){return ie(y(),Qi(t))}function Ht(t){return ie(nt([y(),Lt(URLSearchParams)]),Ji(t))}function st(t){return e=>t.test(e)}const Wn=st(/^#[\da-f]{3}$/i),Gn=st(/^#[\da-f]{4}$/i),xe=st(/^#[\da-f]{6}$/i),Nn=st(/^#[\da-f]{8}$/i);function xn(t){return[xe,Nn,Wn,Gn].some(e=>e(t))}function Hn(t){let e="#";for(let n=0;n<t.length-1;n+=1)e+=t[1+n].repeat(2);return e}function it(t){const e=t.replace(/\s/g,"").toLowerCase();if(/^#[\da-f]{3}$/i.test(e))return k(Hn(e.toLowerCase()+"f"));if(/^#[\da-f]{4}$/i.test(e))return k(Hn(e.toLowerCase()));if(/^#[\da-f]{6}$/i.test(e))return k(e.toLowerCase()+"ff");if(/^#[\da-f]{8}$/i.test(e))return k(e.toLowerCase());const n=e.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/)||e.match(/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3})\)$/);return n?k(n.slice(1).reduce((r,i)=>r+parseInt(i,10).toString(16).padStart(2,"0"),"#").padEnd(9,"f")):M(new Error(`Value "${t}" does not satisfy any of known RGB formats.`))}function zn(t){return h(it(t),z(e=>e.slice(0,7)))}const Zi=ne(zn),Yi=ne(it);function Xi(){return G({id:be(),photo_url:$(y()),type:y(),title:y(),username:$(y())})}function Kn(){return G({added_to_attachment_menu:$(Se()),allows_write_to_pm:$(Se()),first_name:y(),id:be(),is_bot:$(Se()),is_premium:$(Se()),last_name:$(y()),language_code:$(y()),photo_url:$(y()),username:$(y())})}function eo(){return G({projectCode:y(),uid:y(),sessionId:y(),rootToken:y()})}function to(){return G({auth_date:ie(y(),le(t=>new Date(Number(t)*1e3)),tt()),can_send_after:$(ie(y(),le(Number),Tt())),chat:$(pe(Xi())),chat_type:$(y()),chat_instance:$(y()),hash:$(y()),query_id:$(y()),receiver:$(pe(Kn())),start_param:$(y()),signature:$(y()),user:$(pe(Kn())),auth:$(pe(eo()))})}function Jn(){return Ht(to())}function zt(){return Ot(y(),ie(nt([y(),be()]),le(t=>typeof t=="number"?`#${(t&16777215).toString(16).padStart(6,"0")}`:t),et(xn)))}function no(){const t=$(ie(y(),le(e=>e==="1")));return G({vbWebAppBotInline:t,vbWebAppData:$(Jn()),vbWebAppDefaultColors:$(pe(zt())),vbWebAppFullscreen:t,vbWebAppPlatform:y(),vbWebAppShowSettings:t,vbWebAppStartParam:$(y()),vbWebAppThemeParams:pe(zt()),vbWebAppVersion:y()})}function ro(){return Ht(no())}function Qn(){return G({eventType:y(),eventData:$(jt())})}function Zn(t){return qe(()=>ge(Jn(),t),e=>e)}function ot(t){return qe(()=>ge(ro(),t),e=>e)}const so=ne(Zn),Yn=ne(ot);function Xn(t,e){return e||(e=(n,r)=>JSON.stringify(r)),new URLSearchParams(Object.entries(t).reduce((n,[r,i])=>(Array.isArray(i)?n.push(...i.map(o=>[r,String(o)])):i!=null&&n.push([r,i instanceof Date?(i.getTime()/1e3|0).toString():typeof i=="string"||typeof i=="number"?String(i):typeof i=="boolean"?i?"1":"0":e(r,i)]),n),[])).toString()}function er(t){return Xn(t)}function tr(t){return Xn(t,(e,n)=>e==="vbWebAppData"?er(n):JSON.stringify(n))}function io(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(i){i(n)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,n)})}}}function nr(t){return Pt(G({VBotWebviewProxy:G({postEvent:Vt()})}),t)}function rr(){try{return window.self!==window.top}catch{return!0}}class sr extends H("MethodUnsupportedError",(e,n)=>[`Method "${e}" is unsupported in Mini Apps version ${n}`]){}class ir extends H("MethodParameterUnsupportedError",(e,n,r)=>[`Parameter "${n}" of "${e}" method is unsupported in Mini Apps version ${r}`]){}class or extends rt("LaunchParamsRetrieveError",e=>({errors:e}),e=>[["Unable to retrieve launch parameters from any known source. Perhaps, you have opened your app outside Telegram?","📖 Refer to docs for more information:","https://docs.vbot-mini-apps.com/packages/tma-js-bridge/environment","","Collected errors:",...e.map(({source:n,error:r})=>`Source: ${n} / ${r instanceof Error?r.message:String(r)}`)].join(`
2
+ `)]){}class ar extends H("InvalidLaunchParamsError",(e,n)=>[`Invalid value for launch params: ${e}`,{cause:n}]){}class Kt extends H("UnknownEnvError"){}class ur extends H("InvokeCustomMethodError",e=>[`Server returned error: ${e}`]){}const cr="launchParams";function lr(t){return t.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}function Te(){return h(He(),si(ot))}const oo=ne(Te);function Jt(){return h(He(),z(t=>{const e=new URLSearchParams(t).get("vbWebAppData");return e?$e(e):Fe}))}function ao(){return h(Jt(),ti(t=>{throw t},t=>t),bt(()=>{},t=>t))}function He(){const t=[];for(const[e,n]of[[()=>lr(window.location.href),"window.location.href"],[()=>{const r=performance.getEntriesByType("navigation")[0];return r&&lr(r.name)},"performance navigation entries"],[()=>jn(cr),"local storage"]]){const r=e();if(!r){t.push({source:n,error:new Error("Source is empty")});continue}const i=h(ot(r),ei(o=>o,()=>!0));if(typeof i!="boolean"){t.push({source:n,error:i});continue}return Nt(cr,r),k(r)}return M(new or(t))}const uo=ne(He);function co(t,e){const n=new Map,r=io(),i=(o,a,u=!1)=>{const l=n.get(o)||new Map;n.set(o,l);const p=l.get(a)||[];l.set(a,p);const f=p.findIndex(d=>d[1]===u);if(f>=0&&(r.off(o,p[f][0]),p.splice(f,1),!p.length&&(l.delete(a),!l.size))){const d=n.size;n.delete(o),d&&!n.size&&e()}};return{on(o,a,u){!n.size&&t();const l=()=>{i(o,a,u)},p=(...b)=>{u&&l(),o==="*"?a({name:b[0],payload:b[1]}):a(...b)};r.on(o,p);const f=n.get(o)||new Map;n.set(o,f);const d=f.get(a)||[];return f.set(a,d),d.push([p,u||!1]),l},off:i,emit:r.emit,clear(){const o=n.size;r.all.clear(),n.clear(),o&&e()}}}function at(t,e){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:t,eventData:e}),source:window.parent}))}const Qt=D(!1),pr=D("https://web.telegram.org"),lo=t=>{he().log("Event received:",t)},hr=S(Qt);function po(t){t!==Qt()&&(Qt.set(t),(t?Z:Ce)("*",lo))}const fr=S(pr);function ho(t){pr.set(t),he().log("New target origin set",t)}const ut=D((...t)=>{window.parent.postMessage(...t)}),he=D(Dn("Bridge",{bgColor:"#9147ff",textColor:"white",shouldLog:hr}));function Zt(t,e,n){const r=[n],i=t[e];typeof i=="function"&&r.push(i);const o=(...u)=>{r.forEach(l=>l(...u))},a=Object.assign((...u)=>{o(...u)},{unwrap(){const{length:u}=r;if(u===1){delete t[e];return}if(u===2){mr(t,e,r[1]);return}r.unshift(1),mr(t,e,o)}});_r(t,e,()=>a,u=>r.push(u))}function dr(t,e){const n=t[e];_r(t,e,()=>n,r=>{Object.entries(r).forEach(([i,o])=>{n[i]=o})})}function _r(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:n,set:r})}function mr(t,e,n){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n})}const fo={clipboard_text_received:G({req_id:y(),data:Be(y())}),custom_method_invoked:G({req_id:y(),result:$(jt()),error:$(y())}),popup_closed:Be(G({button_id:Be(y(),()=>{})}),{}),viewport_changed:Be(G({height:be(),width:Be(be(),()=>window.innerWidth),is_state_stable:Se(),is_expanded:Se()}),()=>({height:window.innerHeight,is_state_stable:!0,is_expanded:!0})),theme_changed:G({theme_params:zt()})};function br(t){if(t.source!==window.parent)return;let e;try{e=ge(pe(Qn()),t.data)}catch{return}const{eventType:n,eventData:r}=e,i=fo[n];let o;try{o=i?ge(i,r):r}catch(a){return he().forceError([`An error occurred processing the "${n}" event from the VBot application.`,"Please, file an issue here:","https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose"].join(`
3
+ `),e,a)}_o(n,o)}const{on:Z,off:Ce,emit:_o,clear:mo}=co(()=>{const t=window;!t.TelegramGameProxy&&(t.TelegramGameProxy={}),Zt(t.TelegramGameProxy,"receiveEvent",at),dr(t,"TelegramGameProxy"),!t.Telegram&&(t.Telegram={}),!t.VBot.WebView&&(t.VBot.WebView={}),Zt(t.VBot.WebView,"receiveEvent",at),dr(t.Telegram,"WebView"),Zt(t,"TelegramGameProxy_receiveEvent",at),window.addEventListener("message",br)},()=>{[["TelegramGameProxy_receiveEvent"],["TelegramGameProxy","receiveEvent"],["Telegram","WebView","receiveEvent"]].forEach(t=>{const e=window;let n=[void 0,e];for(const o of t)if(n=[n[1],n[1][o]],!n[1])return;const[r,i]=n;"unwrap"in i&&(i.unwrap(),r&&r!==e&&!Object.keys(r).length&&delete e[t[0]])}),window.removeEventListener("message",br)}),bo=(...t)=>ut()(...t);function go(t,e){h(Re(t,e),Xs(n=>{throw n}))}function Re(t,e){he().log("Posting event:",e?{eventType:t,eventData:e}:{eventType:t});const n=window,r=JSON.stringify({eventType:t,eventData:e});return rr()?(bo(r,fr()),k(void 0)):nr(n)?(n.VBotWebviewProxy.postEvent(t,JSON.stringify(e)),k(void 0)):Pt(G({external:G({notify:Vt()})}),n)?(n.external.notify(r),k(void 0)):M(new Kt)}function ct(t,e,n={}){const{capture:r=()=>!0,postEvent:i=Re}=n,o=D(),[a,u]=Ge();(Array.isArray(e)?e:[e]).forEach(p=>{a(Z(p,f=>{const d=Array.isArray(e);r(d?{event:p,payload:f}:f)&&o.set([d?{event:p,payload:f}:f])}))});const l=p=>(u(),p);return h(async()=>i(t,n.params),ue(()=>Me((p,f,d)=>{const b=o();if(b)return p(b[0]);const v=C=>{C&&p(C[0])},F=()=>{o.unsub(v)};o.sub(v),d.on("finalized",F)},n)),Ue(l,l))}function vo(t,e){const n=Yt(t,e);return typeof n=="function"?ve.fn(()=>Ne(n)):n}function Yt(t,e){const n=nr(window);if(!t)return n||h(He(),ae(()=>!1,()=>!0));if(n)return R(!0);const{timeout:r=100}=e||{};return h(ct("web_app_request_theme","theme_changed",{...e,timeout:r}),Ye(i=>Wt.is(i)||Kt.is(i)?k(!1):M(i),()=>k(!0)))}function wo({launchParams:t,onEvent:e,resetPostMessage:n}={}){if(t){const o=typeof t=="string"||t instanceof URLSearchParams?t.toString():tr({...t,vbWebAppData:void 0})+(t.vbWebAppData?`&vbWebAppData=${encodeURIComponent(t.vbWebAppData.toString())}`:"");try{Yn(o)}catch(a){throw new ar(o,a)}Nt("launchParams",o)}if(rr()){if(!e)return;n&&ut.reset();const o=ut();ut.set((...a)=>{const[u]=a,l=()=>{o(...a)};try{const p=ge(pe(Qn()),u);e({name:p.eventType,params:p.eventData},l)}catch{l()}});return}const r=window.VBotWebviewProxy||{},i=r.postEvent||(()=>{});window.VBotWebviewProxy={...r,postEvent(o,a){const u=()=>{i(o,a)};e?e({name:o,params:a?JSON.parse(a):void 0},u):u()}},he().log("Environment was mocked by the mockVBotEnv function")}function gr(t){return({req_id:e})=>e===t}const vr={"6.0":["iframe_ready","iframe_will_reload","web_app_close","web_app_data_send","web_app_expand","web_app_open_link","web_app_ready","web_app_request_theme","web_app_request_viewport","web_app_setup_main_button","web_app_setup_closing_behavior"],6.1:["web_app_open_tg_link","web_app_open_invoice","web_app_setup_back_button","web_app_set_background_color","web_app_set_header_color","web_app_trigger_haptic_feedback"],6.2:["web_app_open_popup"],6.4:["web_app_close_scan_qr_popup","web_app_open_scan_qr_popup","web_app_read_text_from_clipboard",{method:"web_app_open_link",param:"try_instant_view"}],6.7:["web_app_switch_inline_query"],6.9:["web_app_invoke_custom_method","web_app_request_write_access","web_app_request_phone",{method:"web_app_set_header_color",param:"color"}],"6.10":["web_app_setup_settings_button"],7.2:["web_app_biometry_get_info","web_app_biometry_open_settings","web_app_biometry_request_access","web_app_biometry_request_auth","web_app_biometry_update_token"],7.6:[{method:"web_app_open_link",param:"try_browser"},{method:"web_app_close",param:"return_back"}],7.7:["web_app_setup_swipe_behavior"],7.8:["web_app_share_to_story"],"7.10":["web_app_setup_secondary_button","web_app_set_bottom_bar_color",{method:"web_app_setup_main_button",param:"has_shine_effect"}],"8.0":["web_app_request_safe_area","web_app_request_content_safe_area","web_app_request_fullscreen","web_app_exit_fullscreen","web_app_set_emoji_status","web_app_add_to_home_screen","web_app_check_home_screen","web_app_request_emoji_status_access","web_app_check_location","web_app_open_location_settings","web_app_request_file_download","web_app_request_location","web_app_send_prepared_message","web_app_start_accelerometer","web_app_start_device_orientation","web_app_start_gyroscope","web_app_stop_accelerometer","web_app_stop_device_orientation","web_app_stop_gyroscope","web_app_toggle_orientation_lock"],"9.0":["web_app_device_storage_clear","web_app_device_storage_get_key","web_app_device_storage_save_key","web_app_secure_storage_clear","web_app_secure_storage_get_key","web_app_secure_storage_restore_key","web_app_secure_storage_save_key"],9.1:["web_app_hide_keyboard"],9.2:["web_app_send_notification","web_app_finish_refresh"]};function Xt(t,e){return Object.keys(vr).find(n=>vr[n].some(r=>e?typeof r=="object"&&r.method===t&&r.param===e:r===t))||null}function wr(t){return t.split(".").map(Number)}function yo(t,e){const n=wr(t),r=wr(e),i=Math.max(n.length,r.length);for(let o=0;o<i;o+=1){const a=n[o]||0,u=r[o]||0;if(a!==u)return a>u?1:-1}return 0}function fe(t,e,n){const r=n?Xt(t,e):Xt(t);return r?yo(r,n||e)<=0:!1}function Fo(t,e="strict"){const n=typeof e=="function"?e:r=>{const{method:i,version:o}=r,a="param"in r?new ir(i,r.param,o):new sr(i,o);if(e==="strict")throw a;return he().forceWarn(a.message)};return((r,i)=>fe(r,t)?r==="web_app_set_header_color"&&Pt(G({color:$n()}),i)&&!fe(r,"color",t)?n({version:t,method:r,param:"color"}):go(r,i):n({version:t,method:r}))}function So(t,e,n,r){return h(ct("web_app_invoke_custom_method","custom_method_invoked",{...r||{},params:{method:t,params:e,req_id:n},capture:gr(n)}),te(({result:i,error:o})=>o?U(new ur(o)):R(i)))}function Co(t,e,n={}){const{capture:r=()=>!0,postEvent:i=Re}=n,o=D(),[a,u]=Ge();(Array.isArray(e)?e:[e]).forEach(p=>{a(Z(p,f=>{(Array.isArray(e)?r({event:p,payload:f}):r(f))&&o.set([f])}))});const l=p=>(u(),p);return h(async()=>i(t,n.params),ue(()=>Me((p,f,d)=>{const b=o();if(b)return p(b[0]);const v=C=>{C&&p(C[0])},F=()=>{o.unsub(v)};o.sub(v),d.on("finalized",F)},n)),Ue(l,l))}function ko(){Object.hasOwn||(Object.hasOwn=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)})}function en(t){return qe(()=>decodeURIComponent(atob(t.replace(/-/g,"+").replace(/_/g,"/")).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),e=>e)}const Eo=ne(en);function tn(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,n)=>String.fromCharCode(parseInt(`0x${n}`)))).replace(/\+/g,"-").replace(/\//g,"_")}function yr(t){const e=tn(typeof t=="string"?t:JSON.stringify(t));return e.length>512?M(new Error("Value is too long for start parameter")):k(e)}const Io=ne(yr);function Ao(t,e){return Ne(Fr(t,typeof e=="function"?n=>qe(()=>e(n),r=>r):e))}function Fr(t,e){return h(en(t),ii(n=>e?typeof e=="function"?e(n):fi(n):k(n)))}function $o(t){return tn(t).length<=512}function oe(t,e){return S(()=>fe(t,ee(e)))}function _(t){return Object.assign(ne(t),{ifAvailable(...e){return h(t.ifAvailable(...e),bt(()=>({ok:!1}),n=>({ok:!0,data:Ne(n)})))}})}function ke(t){return[t]}class ze extends rt("ValidationError",(e,n)=>({input:e,issues:n}),"Validation error"){}class lt extends H("CSSVarsBoundError","CSS variables are already bound"){}class Sr extends rt("DeviceStorageMethodError",e=>({error:e}),e=>[e]){}class Cr extends rt("SecureStorageMethodError",e=>({error:e}),e=>[e]){}class kr extends H("NotAvailableError",ke){}class qo extends H("InvalidEnvError",ke){}class Er extends H("FunctionNotAvailableError",ke){}class re extends H("InvalidArgumentsError",(e,n)=>[e,{cause:n}]){}class pt extends H("ConcurrentCallError",ke){}class Ir extends H("SetEmojiStatusError",e=>[`Failed to set emoji status: ${e}`]){}class nn extends H("AccessDeniedError",ke){}class Ar extends H("FullscreenFailedError",ke){}class $r extends H("ShareMessageError",ke){}class qr extends H("UnknownThemeParamsKeyError",e=>[`Unknown theme params key passed: ${e}`]){}function V(t,e){const n=S(()=>ee(e.version)||"100"),r=S(()=>ee(e.isTma)),{requires:i,returns:o}=e,a=i?typeof i=="object"?i:{every:[i]}:void 0,u=g=>{if(!e.supports)return!0;const w=e.supports[g];return fe(w.method,w.param,n())},l=()=>{if(!a)return;const[g,w]="every"in a?["every",a.every]:["some",a.some];for(let m=0;m<w.length;m++){const O=w[m],j=typeof O=="function"?O():fe(O,n())?void 0:`it is unsupported in Mini Apps version ${n()}`;if(j&&(g==="every"||m===w.length-1))return j}},p=(...g)=>{for(const w in e.supports)if(e.supports[w].shouldCheck(...g)&&!u(w))return`option ${w} is not supported in Mini Apps version ${n()}`},f=S(()=>!l()),d=S(()=>n()!=="0.0"),b=S(()=>e.isMounted?e.isMounted():!0),v=S(()=>r()&&d()&&f()&&b()),F=g=>{const w=new Er(g);return["task","promise"].includes(e.returns)?U(w):M(w)},C=(...g)=>o==="plain"?qe(()=>t(...g),w=>w):o==="promise"?In(()=>t(...g),w=>w):t(...g);return Object.assign((...g)=>{var j;const w="Unable to call function:";if(!r())return F(`${w} it can't be called outside Mini Apps`);if(!d())return F(`${w} the SDK was not initialized. Use the SDK init() function`);const m=l();if(m)return F(`${w} ${m}`);const O=p(...g);if(O)return F(`${w} ${O}`);if(!b()){const W=(j=e.isMounting)!=null&&j.call(e)?"mounting. Wait for the mount completion":"unmounted. Use the mount() method";return F(`${w} the component is ${W}`)}return C(...g)},t,{isAvailable:v,ifAvailable(...g){return v()?$e(C(...g)):Fe}},a?{isSupported:f}:{},e.supports?{supports:u}:{})}function B(t){return e=>V(e,t)}class ht{constructor({isTma:e,storage:n,onClick:r,offClick:i,initialState:o,isPageReload:a,postEvent:u,payload:l,method:p,version:f}){s(this,"isMounted");s(this,"isSupported");s(this,"state");s(this,"stateSetters");s(this,"stateBoolSetters");s(this,"setStateFp");s(this,"setState");s(this,"onClickFp");s(this,"onClick");s(this,"offClickFp");s(this,"offClick");s(this,"mountFp");s(this,"mount");s(this,"unmount");const d=new me({initialState:o,onChange(g){n.set(g)}}),b=new We({initialState:o,isPageReload:a,onMounted:d.setState,restoreState:n.get}),v={version:f,requires:p,isTma:e},F=B({...v,returns:"plain"}),C=B({...v,returns:"either",isMounted:b.isMounted});this.isMounted=b.isMounted,this.isSupported=oe(p,f),this.state=d.state,this.setStateFp=C(g=>{const w={...this.state(),...It(g)};return d.hasDiff(w)?h(u(p,l(w)),z(()=>{d.setState(w)})):k(void 0)}),this.setState=_(this.setStateFp),this.onClickFp=F(r),this.onClick=_(this.onClickFp),this.offClickFp=F(i),this.offClick=_(this.offClickFp),this.mountFp=F(()=>{const g=()=>{};return h(b.mount(),ae(g,g))}),this.mount=_(this.mountFp),this.unmount=b.unmount,this.stateSetters=g=>{const w=C(m=>this.setStateFp({[g]:m}));return[_(w),w]},this.stateBoolSetters=g=>{const[,w]=this.stateSetters(g),m=C(()=>w(!1)),O=C(()=>w(!0));return[[_(m),m],[_(O),O]]}}stateGetter(e){return S(()=>this.state()[e])}}class Br{constructor(e){s(this,"isVisible");s(this,"isMounted");s(this,"isSupported");s(this,"hideFp");s(this,"hide");s(this,"showFp");s(this,"show");s(this,"onClickFp");s(this,"onClick");s(this,"offClickFp");s(this,"offClick");s(this,"mountFp");s(this,"mount");s(this,"unmount");const n=new ht({...e,method:"web_app_setup_back_button",payload:r=>({is_visible:r.isVisible}),initialState:{isVisible:!1}});this.isVisible=n.stateGetter("isVisible"),this.isMounted=n.isMounted,this.isSupported=n.isSupported,[[this.hide,this.hideFp],[this.show,this.showFp]]=n.stateBoolSetters("isVisible"),this.onClick=n.onClick,this.onClickFp=n.onClickFp,this.offClick=n.offClick,this.offClickFp=n.offClickFp,this.mount=n.mount,this.mountFp=n.mountFp,this.unmount=n.unmount}}function E(){return{isTma:S(()=>Yt())}}function Pe(t){return e=>({...e,...ee(t)})}function Ke(t,e){return D(t,e)}const Mr=Ke(Re),Ee=(...t)=>Mr()(...t),Tr=(...t)=>Ne(Ee(...t)),K=Pe({postEvent:Ee});function Bo(t){return{get:()=>jn(t),set(e){Nt(t,e)}}}function Mo(){return performance.getEntriesByType("navigation")[0]}function To(){const t=Mo();return!!t&&t.type==="reload"}function we(t){return Pe({storage:Bo(t),isPageReload:To})}const rn=Ke("0.0"),q=Pe({version:rn});function sn(t,e){return{...h(E(),K,q,we(t)),onClick(n,r){return Z(e,n,r)},offClick(n,r){Ce(e,n,r)}}}const Ro=new Br(sn("backButton","back_button_pressed"));class on{constructor({initialState:e,onMounted:n,restoreState:r,onUnmounted:i,isPageReload:o}){s(this,"_isMounted",D(!1));s(this,"isMounted",S(this._isMounted));s(this,"mount");s(this,"unmount");this.mount=a=>{if(this._isMounted())return R(void 0);const u=ee(o)?r():void 0;return h(u?R(u):e(a),A(l=>{this._isMounted()||Ze(()=>{this._isMounted.set(!0),n==null||n(l)})}))},this.unmount=()=>{this._isMounted()&&Ze(()=>{this._isMounted.set(!1),i==null||i()})}}}function Rr(){return new kr("Biometry is not available")}function an(t){let e=!1,n=!1,r="",i=!1,o="",a=!1;return t.available&&(e=!0,n=t.token_saved,r=t.device_id,i=t.access_requested,o=t.type,a=t.access_granted),{available:e,tokenSaved:n,deviceId:r,type:o,accessGranted:a,accessRequested:i}}class Pr{constructor({version:e,request:n,postEvent:r,storage:i,onInfoReceived:o,offInfoReceived:a,isTma:u,isPageReload:l}){s(this,"isAvailable");s(this,"isSupported");s(this,"isMounted");s(this,"state");s(this,"authenticateFp");s(this,"authenticate");s(this,"openSettingsFp");s(this,"openSettings");s(this,"requestAccessFp");s(this,"requestAccess");s(this,"updateTokenFp");s(this,"updateToken");s(this,"mountFp");s(this,"mount");s(this,"unmount");const p=g=>{f.setState(an(g))},f=new me({initialState:{available:!1,type:"unknown",accessGranted:!1,accessRequested:!1,deviceId:"",tokenSaved:!1},onChange:i.set}),d=new on({initialState(g){return h(n("web_app_biometry_get_info","biometry_info_received",g),A(an))},isPageReload:l,onMounted(g){f.setState(g),o(p)},onUnmounted(){a(p)},restoreState:i.get}),b={version:e,requires:"web_app_biometry_request_auth",isTma:u},v=B({...b,returns:"either"}),F=B({...b,returns:"task"}),C=B({...b,isMounted:d.isMounted,returns:"task"});this.isAvailable=f.getter("available"),this.isMounted=d.isMounted,this.isSupported=oe("web_app_biometry_request_auth",e),this.state=f.state,this.unmount=d.unmount,this.mountFp=F(d.mount),this.authenticateFp=C(g=>this.isAvailable()?h(n("web_app_biometry_request_auth","biometry_auth_requested",{...g,params:{reason:((g||{}).reason||"").trim()}}),A(w=>(f.setState({token:w.token}),w))):U(Rr())),this.openSettingsFp=v(()=>r("web_app_biometry_open_settings")),this.requestAccessFp=C(g=>h(n("web_app_biometry_request_access","biometry_info_received",{...g,params:{reason:((g||{}).reason||"").trim()}}),te(w=>{const m=an(w);return m.available?(f.setState(m),R(m.accessRequested)):U(Rr())}))),this.updateTokenFp=C((g={})=>{var w;return h(n("web_app_biometry_update_token","biometry_token_updated",{...g,params:{token:g.token||"",reason:(w=g.reason)==null?void 0:w.trim()}}),A(m=>m.status))}),this.authenticate=_(this.authenticateFp),this.openSettings=_(this.openSettingsFp),this.requestAccess=_(this.requestAccessFp),this.updateToken=_(this.updateTokenFp),this.mount=_(this.mountFp)}}const Vr=(t,e,n)=>Co(t,e,{postEvent:Ee,...n}),un=(t,e,n)=>ct(t,e,{postEvent:Ee,...n}),Po=(...t)=>ve.fn(()=>Vr(...t)()),Vo=(...t)=>ve.fn(()=>un(...t)()),Y=Pe({request:un});function Lo(){return new Pr({...h(E(),K,q,Y,we("biometry")),offInfoReceived(t){Ce("biometry_info_received",t)},onInfoReceived(t){return Z("biometry_info_received",t)}})}const Oo=Lo();class Lr{constructor({postEvent:e,storage:n,isTma:r,isPageReload:i}){s(this,"isConfirmationEnabled");s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"unmount");s(this,"disableConfirmationFp");s(this,"disableConfirmation");s(this,"enableConfirmationFp");s(this,"enableConfirmation");const o=new me({initialState:{isConfirmationEnabled:!1},onChange(d){n.set(d)}}),a=new We({onMounted:o.setState,restoreState:n.get,initialState:{isConfirmationEnabled:!1},isPageReload:i}),u={requires:"web_app_setup_closing_behavior",isTma:r},l=B({...u,returns:"plain"}),p=B({...u,returns:"either",isMounted:a.isMounted}),f=d=>d===this.isConfirmationEnabled()?k(void 0):(o.setState({isConfirmationEnabled:d}),e("web_app_setup_closing_behavior",{need_confirmation:d}));this.isConfirmationEnabled=o.getter("isConfirmationEnabled"),this.isMounted=a.isMounted,this.disableConfirmationFp=p(()=>f(!1)),this.enableConfirmationFp=p(()=>f(!0)),this.mountFp=l(()=>{const d=()=>{};return h(a.mount(),ae(d,d))}),this.unmount=a.unmount,this.disableConfirmation=_(this.disableConfirmationFp),this.enableConfirmation=_(this.enableConfirmationFp),this.mount=_(this.mountFp)}}function jo(){return new Lr(h(E(),we("closingBehavior"),K))}const Do=jo();class Or{constructor({version:e,isTma:n,invokeCustomMethod:r}){s(this,"isSupported");s(this,"deleteItemFp");s(this,"deleteItem");s(this,"getItemFp");s(this,"getItem");s(this,"getItemsFp");s(this,"getItems");s(this,"getKeysFp");s(this,"getKeys");s(this,"setItemFp");s(this,"setItem");s(this,"clearFp");s(this,"clear");const i=B({version:e,requires:"web_app_invoke_custom_method",isTma:n,returns:"task"});this.isSupported=oe("web_app_invoke_custom_method",e),this.deleteItemFp=i((o,a)=>{const u=Array.isArray(o)?o:[o];return h(u.length?r("deleteStorageValues",{keys:u},a):R(void 0),A(()=>{}))}),this.getItemFp=i((o,a)=>h(this.getItemsFp([o],a),A(u=>u[o]||""))),this.getItemsFp=i((o,a)=>h(o.length?r("getStorageValues",{keys:o},a):R({}),A(u=>({...o.reduce((l,p)=>(l[p]="",l),{}),...ge(Ot(y(),y()),u)})))),this.getKeysFp=i(o=>h(r("getStorageKeys",{},o),A(a=>ge(qn(y()),a)))),this.setItemFp=i((o,a,u)=>h(r("saveStorageValue",{key:o,value:a},u),A(()=>{}))),this.clearFp=i(o=>h(this.getKeysFp(o),te(this.deleteItemFp))),this.deleteItem=_(this.deleteItemFp),this.getItem=_(this.getItemFp),this.getItems=_(this.getItemsFp),this.getKeys=_(this.getKeysFp),this.setItem=_(this.setItemFp),this.clear=_(this.clearFp)}}const cn=Ke(0);function ft(){return cn.set(cn()+1),cn().toString()}function jr(t,e,n){return So(t,e,ft(),{...n||{},postEvent:Ee})}const ln=Pe({invokeCustomMethod:jr});function Uo(){return new Or(h(E(),q,ln))}const Wo=Uo();class Dr{constructor({isTma:e,request:n,version:r,createRequestId:i}){s(this,"getItemFp");s(this,"getItem");s(this,"setItemFp");s(this,"setItem");s(this,"deleteItemFp");s(this,"deleteItem");s(this,"clearFp");s(this,"clear");const o=B({version:r,requires:"web_app_device_storage_get_key",isTma:e,returns:"task"}),a=(u,l,p)=>{const f=i();return h(n(u,["device_storage_failed",l],{params:{...p,req_id:f},capture:(d=>"payload"in d?d.payload.req_id===f:!0)}),te(d=>d.event==="device_storage_failed"?U(new Sr(d.payload.error||"UNKNOWN_ERROR")):R(d.payload)))};this.getItemFp=o(u=>h(a("web_app_device_storage_get_key","device_storage_key_received",{key:u}),A(l=>l.value))),this.setItemFp=o((u,l)=>h(a("web_app_device_storage_save_key","device_storage_key_saved",{key:u,value:l}),A(()=>{}))),this.deleteItemFp=o(u=>this.setItemFp(u,null)),this.clearFp=o(()=>h(a("web_app_device_storage_clear","device_storage_cleared",{}),A(()=>{}))),this.getItem=_(this.getItemFp),this.setItem=_(this.setItemFp),this.deleteItem=_(this.deleteItemFp),this.clear=_(this.clearFp)}}const Ur=Pe({createRequestId:ft});function Go(){return new Dr(h(E(),q,Y,Ur))}const No=Go();function xo({request:t,...e}){return V(n=>h(t("web_app_request_emoji_status_access","emoji_status_access_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_emoji_status_access",returns:"task"})}function Ho(){return xo(h(E(),q,Y))}const Wr=Ho(),zo=_(Wr);function Ko({request:t,...e}){return V((n,r)=>h(t("web_app_set_emoji_status",["emoji_status_set","emoji_status_failed"],{params:{custom_emoji_id:n,duration:(r||{}).duration},...r}),ue(i=>i.event==="emoji_status_failed"?U(new Ir(i.payload.error)):R(void 0))),{...e,requires:"web_app_set_emoji_status",returns:"task"})}function Jo(){return Ko(h(E(),Y,q))}const Gr=Jo(),Qo=_(Gr);class Nr{constructor({postEvent:e,isTma:n,version:r}){s(this,"isSupported");s(this,"impactOccurredFp");s(this,"impactOccurred");s(this,"notificationOccurredFp");s(this,"notificationOccurred");s(this,"selectionChangedFp");s(this,"selectionChanged");const i="web_app_trigger_haptic_feedback",o=B({requires:i,isTma:n,version:r,returns:"plain"});this.isSupported=oe(i,r),this.impactOccurredFp=o(a=>e(i,{type:"impact",impact_style:a})),this.notificationOccurredFp=o(a=>e(i,{type:"notification",notification_type:a})),this.selectionChangedFp=o(()=>e(i,{type:"selection_change"})),this.impactOccurred=_(this.impactOccurredFp),this.notificationOccurred=_(this.notificationOccurredFp),this.selectionChanged=_(this.selectionChangedFp)}}function Zo(){return new Nr(h(E(),K,q))}const Yo=Zo();function Xo({postEvent:t,...e}){return V(()=>t("web_app_add_to_home_screen"),{...e,requires:"web_app_add_to_home_screen",returns:"either"})}function ea(){return Xo(h(E(),q,K))}const xr=ea(),ta=_(xr);function na({request:t,...e}){return V(n=>h(t("web_app_check_home_screen","home_screen_checked",n),A(r=>r.status||"unknown")),{...e,requires:"web_app_check_home_screen",returns:"task"})}function ra(){return na(h(E(),q,Y))}const Hr=ra(),sa=_(Hr);class zr{constructor({retrieveInitData:e}){s(this,"_state",D());s(this,"_raw",D());s(this,"state",S(this._state));s(this,"authDate",this.fromState("auth_date"));s(this,"canSendAfter",this.fromState("can_send_after"));s(this,"canSendAfterDate",S(()=>{const e=this.authDate(),n=this.canSendAfter();return n&&e?new Date(e.getTime()+n*1e3):void 0}));s(this,"chat",this.fromState("chat"));s(this,"chatType",this.fromState("chat_type"));s(this,"chatInstance",this.fromState("chat_instance"));s(this,"hash",this.fromState("hash"));s(this,"queryId",this.fromState("query_id"));s(this,"raw",S(this._raw));s(this,"receiver",this.fromState("receiver"));s(this,"signature",this.fromState("signature"));s(this,"startParam",this.fromState("start_param"));s(this,"auth",this.fromState("auth"));s(this,"user",this.fromState("user"));s(this,"restoreFp");s(this,"restore");this.restoreFp=()=>h(e(),z(bt(()=>{},({raw:n,obj:r})=>{this._state.set(r),this._raw.set(n)}))),this.restore=ne(this.restoreFp)}fromState(e){return S(()=>{const n=this._state();return n?n[e]:void 0})}}function ia(){return new zr({retrieveInitData(){return h(ni,Cn("obj",()=>h(Te(),z(({vbWebAppData:t})=>t?$e(t):Fe))),Cn("raw",Jt),z(({obj:t,raw:e})=>h(xs,Fn("obj",()=>t),Fn("raw",()=>e))))}})}const oa=ia();class Kr{constructor({version:e,request:n,isTma:r}){s(this,"isOpened");s(this,"isSupported");s(this,"openSlugFp");s(this,"openSlug");s(this,"openUrlFp");s(this,"openUrl");const i=B({version:e,isTma:r,requires:"web_app_open_invoice",returns:"task"}),o=D(!1),a=()=>{o.set(!1)};this.isSupported=oe("web_app_open_invoice",e),this.isOpened=S(o),this.openSlugFp=i((u,l)=>h(this.isOpened()?U(new pt("Invoice is already opened")):R(void 0),te(()=>(o.set(!0),n("web_app_open_invoice","invoice_closed",{...l,params:{slug:u},capture:p=>u===p.slug}))),Ue(p=>(a(),p),p=>(a(),p.status)))),this.openUrlFp=i((u,l)=>{const{hostname:p,pathname:f}=new URL(u,window.location.href);if(p!=="t.me")return U(new re(`Link has unexpected hostname: ${p}`));const d=f.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);return d?this.openSlugFp(d[2],l):U(new re('Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'))}),this.openUrl=_(this.openUrlFp),this.openSlug=_(this.openSlugFp)}}function aa(){return new Kr(h(E(),Y,q))}const ua=aa();function ca({postEvent:t,...e}){return V((n,r={})=>{if(typeof n=="string")try{n=new URL(n)}catch(i){return M(new re(`"${n.toString()}" is invalid URL`,i))}return t("web_app_open_link",{url:n.toString(),try_browser:r.tryBrowser,try_instant_view:r.tryInstantView})},{...e,returns:"either"})}function la(){return ca(h(E(),K))}const Jr=la(),pa=_(Jr);function ha({postEvent:t,version:e,...n}){return V(r=>{const i=r.toString();return i.match(/^https:\/\/t.me\/.+/)?fe("web_app_open_tg_link",ee(e))?(r=new URL(r),t("web_app_open_tg_link",{path_full:r.pathname+r.search})):(window.location.href=i,k(void 0)):M(new re(`"${i}" is invalid URL`))},{...n,returns:"either"})}function fa(){return ha(h(E(),K,q))}const pn=fa(),da=_(pn);function _a({openTelegramLink:t,...e}){return V((n,r)=>t("https://t.me/share/url?"+new URLSearchParams({url:n,text:r||""}).toString().replace(/\+/g,"%20")),{...e,returns:"either"})}function ma(){return _a({...E(),openTelegramLink:pn})}const Qr=ma(),ba=_(Qr);function ga(t){let e=!1,n,r;return t.available&&(e=!0,n=t.access_requested,r=t.access_granted),{available:e,accessGranted:r||!1,accessRequested:n||!1}}class Zr{constructor({version:e,request:n,postEvent:r,storage:i,isTma:o,isPageReload:a}){s(this,"state");s(this,"isAvailable");s(this,"isAccessGranted");s(this,"isAccessRequested");s(this,"isMounted");s(this,"isSupported");s(this,"openSettingsFp");s(this,"openSettings");s(this,"requestLocationFp");s(this,"requestLocation");s(this,"mountFp");s(this,"mount");s(this,"unmount");const u=new me({initialState:{available:!1,accessGranted:!1,accessRequested:!1},onChange:i.set}),l=new on({isPageReload:a,restoreState:i.get,onMounted:u.setState,initialState(v){return h(n("web_app_check_location","location_checked",v),A(ga))}}),p={version:e,requires:"web_app_check_location",isTma:o},f=B({...p,returns:"either"}),d=B({...p,returns:"task"}),b=B({...p,returns:"task",isMounted:l.isMounted});this.isAvailable=u.getter("available"),this.isAccessRequested=u.getter("accessRequested"),this.isAccessGranted=u.getter("accessGranted"),this.isSupported=oe("web_app_check_location",e),this.isMounted=l.isMounted,this.state=u.state,this.unmount=l.unmount,this.mountFp=d(l.mount),this.openSettingsFp=f(()=>r("web_app_open_location_settings")),this.requestLocationFp=b(v=>h(n("web_app_request_location","location_requested",v),A(F=>{if(!F.available)return u.setState({available:!1}),null;const{available:C,...g}=F;return g}))),this.mount=_(this.mountFp),this.openSettings=_(this.openSettingsFp),this.requestLocation=_(this.requestLocationFp)}}function va(){return new Zr(h(E(),K,q,Y,we("locationManager")))}const wa=va();class Yr{constructor({defaults:e,...n}){s(this,"bgColor");s(this,"hasShineEffect");s(this,"isEnabled");s(this,"isLoaderVisible");s(this,"isVisible");s(this,"isMounted");s(this,"state");s(this,"text");s(this,"textColor");s(this,"showFp");s(this,"show");s(this,"hideFp");s(this,"hide");s(this,"enableFp");s(this,"enable");s(this,"enableShineEffectFp");s(this,"enableShineEffect");s(this,"disableFp");s(this,"disable");s(this,"disableShineEffectFp");s(this,"disableShineEffect");s(this,"setBgColorFp");s(this,"setBgColor");s(this,"setTextColorFp");s(this,"setTextColor");s(this,"setTextFp");s(this,"setText");s(this,"showLoaderFp");s(this,"showLoader");s(this,"hideLoaderFp");s(this,"hideLoader");s(this,"setParamsFp");s(this,"setParams");s(this,"mountFp");s(this,"mount");s(this,"unmount");s(this,"onClickFp");s(this,"onClick");s(this,"offClickFp");s(this,"offClick");const r=new ht({...n,version:"100",initialState:{hasShineEffect:!1,isEnabled:!0,isLoaderVisible:!1,isVisible:!1,text:"Continue"},method:"web_app_setup_main_button",payload:o=>({has_shine_effect:o.hasShineEffect,is_visible:o.isVisible,is_active:o.isEnabled,is_progress_visible:o.isLoaderVisible,text:o.text,color:o.bgColor,text_color:o.textColor})}),i=(o,a)=>{const u=r.stateGetter(o);return S(()=>u()||ee(a))};this.bgColor=i("bgColor",e.bgColor),this.textColor=i("textColor",e.textColor),this.hasShineEffect=r.stateGetter("hasShineEffect"),this.isEnabled=r.stateGetter("isEnabled"),this.isLoaderVisible=r.stateGetter("isLoaderVisible"),this.text=r.stateGetter("text"),this.isVisible=r.stateGetter("isVisible"),this.isMounted=r.isMounted,this.state=r.state,[this.setBgColor,this.setBgColorFp]=r.stateSetters("bgColor"),[this.setTextColor,this.setTextColorFp]=r.stateSetters("textColor"),[[this.disableShineEffect,this.disableShineEffectFp],[this.enableShineEffect,this.enableShineEffectFp]]=r.stateBoolSetters("hasShineEffect"),[[this.disable,this.disableFp],[this.enable,this.enableFp]]=r.stateBoolSetters("isEnabled"),[[this.hideLoader,this.hideLoaderFp],[this.showLoader,this.showLoaderFp]]=r.stateBoolSetters("isLoaderVisible"),[this.setText,this.setTextFp]=r.stateSetters("text"),[[this.hide,this.hideFp],[this.show,this.showFp]]=r.stateBoolSetters("isVisible"),this.setParams=r.setState,this.setParamsFp=r.setStateFp,this.onClick=r.onClick,this.onClickFp=r.onClickFp,this.offClick=r.offClick,this.offClickFp=r.offClickFp,this.mount=r.mount,this.mountFp=r.mountFp,this.unmount=r.unmount}}function hn(t,e){document.documentElement.style.setProperty(t,e)}function fn(t){document.documentElement.style.removeProperty(t)}function Xr(t){return h(it(t),z(e=>Math.sqrt([.299,.587,.114].reduce((n,r,i)=>{const o=parseInt(e.slice(1+i*2,1+(i+1)*2),16);return n+o*o*r},0))<120))}const dn=ne(Xr);class es{constructor({initialState:e,onChange:n,offChange:r,isTma:i,storage:o,isPageReload:a}){s(this,"accentTextColor");s(this,"bgColor");s(this,"buttonColor");s(this,"buttonTextColor");s(this,"bottomBarBgColor");s(this,"destructiveTextColor");s(this,"headerBgColor");s(this,"hintColor");s(this,"linkColor");s(this,"secondaryBgColor");s(this,"sectionBgColor");s(this,"sectionHeaderTextColor");s(this,"sectionSeparatorColor");s(this,"subtitleTextColor");s(this,"textColor");s(this,"_isCssVarsBound",D(!1));s(this,"isCssVarsBound",S(this._isCssVarsBound));s(this,"bindCssVarsFp");s(this,"bindCssVars");s(this,"state");s(this,"isDark",S(()=>{const e=this.bgColor();return!e||dn(e)}));s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"unmount");const u=new me({initialState:{},onChange:o.set}),l=v=>{u.setState(v.theme_params)},p=new We({initialState:()=>k(ee(e)),isPageReload:a,onMounted(v){u.setState(v),n(l)},onUnmounted(){r(l)},restoreState:o.get}),f={isTma:i,returns:"either"},d=B(f),b=B({...f,isMounted:p.isMounted});this.accentTextColor=u.getter("accent_text_color"),this.bgColor=u.getter("bg_color"),this.buttonColor=u.getter("button_color"),this.buttonTextColor=u.getter("button_text_color"),this.bottomBarBgColor=u.getter("bottom_bar_bg_color"),this.destructiveTextColor=u.getter("destructive_text_color"),this.headerBgColor=u.getter("header_bg_color"),this.hintColor=u.getter("hint_color"),this.linkColor=u.getter("link_color"),this.secondaryBgColor=u.getter("secondary_bg_color"),this.sectionBgColor=u.getter("section_bg_color"),this.sectionHeaderTextColor=u.getter("section_header_text_color"),this.sectionSeparatorColor=u.getter("section_separator_color"),this.subtitleTextColor=u.getter("subtitle_text_color"),this.textColor=u.getter("text_color"),this.state=u.state,this.isMounted=p.isMounted,this.bindCssVarsFp=b(v=>{if(this._isCssVarsBound())return M(new lt);v||(v=g=>`--tg-theme-${Hi(g)}`);const F=g=>{Object.entries(u.state()).forEach(([w,m])=>{m&&g(w,m)})},C=()=>{F((g,w)=>{hn(v(g),w)})};return C(),u.state.sub(C),this._isCssVarsBound.set(!0),k(()=>{F(fn),u.state.unsub(C),this._isCssVarsBound.set(!1)})}),this.mountFp=d(p.mount),this.unmount=p.unmount,this.bindCssVars=_(this.bindCssVarsFp),this.mount=_(this.mountFp)}}const _n=Ke({});function ya(){return new es({...h(E(),we("themeParams")),offChange(t){Ce("theme_changed",t)},onChange(t){Z("theme_changed",t)},initialState:_n})}const Je=ya();function ts(t,e,n){return h(sn(t,e),r=>({...r,defaults:n}))}const Fa=new Yr(ts("mainButton","main_button_pressed",{bgColor:S(()=>Je.buttonColor()||"#2481cc"),textColor:S(()=>Je.buttonTextColor()||"#ffffff")}));class ns{constructor({storage:e,isPageReload:n,version:r,postEvent:i,isTma:o,theme:a,onVisibilityChanged:u,offVisibilityChanged:l}){s(this,"isSupported");s(this,"isDark",S(()=>{const e=this.bgColorRgb();return e?dn(e):!1}));s(this,"isActive");s(this,"state");s(this,"isCssVarsBound");s(this,"bindCssVarsFp");s(this,"bindCssVars");s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"unmount");s(this,"bgColor");s(this,"bgColorRgb");s(this,"setBgColorFp");s(this,"setBgColor");s(this,"headerColor");s(this,"headerColorRgb");s(this,"setHeaderColorFp");s(this,"setHeaderColor");s(this,"bottomBarColor");s(this,"bottomBarColorRgb");s(this,"setBottomBarColorFp");s(this,"setBottomBarColor");s(this,"closeFp");s(this,"close");s(this,"readyFp");s(this,"ready");const p=m=>{b.setState({isActive:m.is_visible})},f=m=>{[[this.headerColor,"web_app_set_header_color"],[this.bgColor,"web_app_set_background_color"],[this.bottomBarColor,"web_app_set_bottom_bar_color"]].forEach(([O,j])=>{const W=O();if(!xe(W)&&(j!=="web_app_set_header_color"||!["bg_color","secondary_bg_color"].includes(W))){const I=m[W];I&&i(j,{color:I})}})},d=new We({initialState(){return k({bgColor:"bg_color",headerColor:"header_bg_color",bottomBarColor:"bottom_bar_bg_color",isActive:!0})},isPageReload:n,onMounted:m=>{u(p),a.sub(f),b.setState(m)},onUnmounted(){l(p),a.unsub(f)},restoreState:e.get});this.isMounted=d.isMounted,this.mountFp=V(()=>{const m=()=>{};return h(d.mount(),ae(m,m))},{isTma:o,returns:"plain"}),this.mount=_(this.mountFp),this.unmount=d.unmount;const b=new me({initialState:{bgColor:"bg_color",bottomBarColor:"bottom_bar_bg_color",headerColor:"bg_color",isActive:!1},onChange:e.set});this.state=b.state;const v=m=>xe(m)?m:ee(a)[m],F=m=>S(()=>v(m()));this.isActive=b.getter("isActive"),this.isSupported=S(()=>["web_app_set_header_color","web_app_set_background_color","web_app_set_bottom_bar_color"].some(m=>fe(m,ee(r))));const C=D(!1);this.isCssVarsBound=S(C),this.bindCssVarsFp=V(m=>{if(C())return M(new lt);const[O,j]=Ge(()=>{C.set(!1)}),W=(I,L)=>{const P=()=>{hn(I,L()||null)};P(),O(L.sub(P),fn.bind(null,I))};return m||(m=I=>`--tg-${Ln(I)}`),W(m("bgColor"),this.bgColorRgb),W(m("bottomBarColor"),this.bottomBarColorRgb),W(m("headerColor"),this.headerColorRgb),C.set(!0),k(j)},{isTma:o,returns:"either",isMounted:this.isMounted}),this.bindCssVars=_(this.bindCssVarsFp);const g=m=>{const O=b.getter(m),j=F(O),W={headerColor:"web_app_set_header_color",bgColor:"web_app_set_background_color",bottomBarColor:"web_app_set_bottom_bar_color"}[m],I=V(L=>{if(L===O())return k(void 0);if(W==="web_app_set_header_color"&&(L==="bg_color"||L==="secondary_bg_color"))return h(i("web_app_set_header_color",{color_key:L}),z(()=>{b.setState({[m]:L})}));const P=v(L);return h(P?i(W,{color:P}):M(new qr(L)),z(()=>{b.setState({[m]:L})}))},{isTma:o,version:r,requires:W,isMounted:this.isMounted,returns:"either",supports:m==="headerColor"?{rgb:{method:"web_app_set_header_color",param:"color",shouldCheck:xe}}:void 0});return[O,j,_(I),I]};[this.bgColor,this.bgColorRgb,this.setBgColor,this.setBgColorFp]=g("bgColor"),[this.headerColor,this.headerColorRgb,this.setHeaderColor,this.setHeaderColorFp]=g("headerColor"),[this.bottomBarColor,this.bottomBarColorRgb,this.setBottomBarColor,this.setBottomBarColorFp]=g("bottomBarColor");const w=B({isTma:o,returns:"either"});this.closeFp=w(m=>i("web_app_close",{return_back:m})),this.close=_(this.closeFp),this.readyFp=w(()=>i("web_app_ready")),this.ready=_(this.readyFp)}}function Sa(){return new ns({...h(E(),K,q,we("miniApp")),offVisibilityChanged(t){Ce("visibility_changed",t)},onVisibilityChanged(t){Z("visibility_changed",t)},theme:Je.state})}const rs=Sa();function Ca(){const t=Date.now(),e=Math.random().toString(36).substring(2,9);return`notif_${t}_${e}`}class ss{constructor({}){s(this,"sendFp");s(this,"send");this.sendFp=e=>h(De(Re("web_app_send_notification",{id:Ca(),message:e.message,title:e.title,type:e.type??"default"})),A(()=>{})),this.send=e=>this.sendFp(e)().then(r=>{if(r._tag==="Left")throw r.left;return r.right})}}function ka(){return new ss(h(E()))}const Ea=ka();function Ia(t){const e=t.message.trim(),n=(t.title||"").trim(),r=t.buttons||[];if(n.length>64)return M(new re(`Invalid title: ${n}`));if(!e||e.length>256)return M(new re(`Invalid message: ${e}`));if(r.length>3)return M(new re(`Invalid buttons count: ${r.length}`));const i=[];if(!r.length)i.push({type:"close",id:""});else for(let o=0;o<r.length;o++){const a=r[o],u=a.id||"";if(u.length>64)return M(new re(`Button with index ${o} has invalid id: ${u}`));if(!a.type||a.type==="default"||a.type==="destructive"){const l=a.text.trim();if(!l||l.length>64)return M(new re(`Button with index ${o} has invalid text: ${l}`));i.push({type:a.type,text:l,id:u})}else i.push({type:a.type,id:u})}return k({title:n,message:e,buttons:i})}class is{constructor({version:e,isTma:n,request:r}){s(this,"isOpened");s(this,"isSupported");s(this,"showFp");s(this,"show");const i=D(!1),o=()=>{i.set(!1)},a=B({version:e,isTma:n,requires:"web_app_open_popup",returns:"task"});this.isSupported=oe("web_app_open_popup",e),this.isOpened=S(i),this.showFp=a(u=>h(this.isOpened()?U(new pt("A popup is already opened")):R(void 0),ue(()=>De(Ia(u))),te(l=>(i.set(!0),r("web_app_open_popup","popup_closed",{...u,params:l}))),Ue(l=>(o(),l),l=>(o(),l.button_id)))),this.show=_(this.showFp)}}function Aa(){return new is(h(E(),Y,q))}const $a=Aa();function qa({request:t,...e}){return V(n=>h(t("web_app_request_phone","phone_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_phone",returns:"task"})}function Ba(){return qa(h(E(),q,Y))}const mn=Ba(),Ma=_(mn);function Ta({invokeCustomMethod:t,requestPhoneAccess:e,...n}){const r=a=>h(t("getRequestedContact",{},{...a,timeout:(a||{}).timeout||5e3}),ue(u=>{const l=Dt(y(),u);if(!l.success)return U(new ze(u,l.issues));if(!l.output)return R(void 0);const p=Dt(Ht(G({contact:pe(G({user_id:be(),phone_number:y(),first_name:y(),last_name:$(y())})),auth_date:ie(y(),le(f=>new Date(Number(f)*1e3)),tt()),hash:y()})),l.output);return p.success?R({raw:l.output,parsed:p.output}):U(new ze(l.output,p.issues))})),i=a=>h(r(a),Ye(u=>ze.is(u)?M(u):k(void 0),u=>k(u))),o=a=>Me(async(u,l,p)=>{let f=50;for(;!p.isRejected;){const d=await i(p)();if(d._tag==="Left")return l(d.left);if(d.right)return u(d.right);await new Promise(b=>setTimeout(b,f)),f+=50}},a);return V(a=>Me.fn(u=>h(i(u),te(l=>l?R(l):h(e(u),ue(p=>p==="sent"?o(u):U(new nn("User denied access")))))),a),{...n,returns:"task",requires:"web_app_request_phone"})}function Ra(){return Ta({...h(E(),ln,q),requestPhoneAccess:mn})}function Pa({requestContact:t,...e}){return V(t,{...e,returns:"task",requires:"web_app_request_phone"})}function Va(){return Pa({...h(E(),q),requestContact(t){return h(bn(t),A(e=>e.parsed))}})}const bn=Ra(),La=_(bn),os=Va(),Oa=_(os);function ja({request:t,...e}){return V(n=>h(t("web_app_request_write_access","write_access_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_write_access",returns:"task"})}function Da(){return ja(h(E(),q,Y))}const as=Da(),Ua=_(as);class us{constructor({version:e,onClosed:n,onTextReceived:r,isTma:i,postEvent:o}){s(this,"isOpened");s(this,"isSupported");s(this,"captureFp");s(this,"capture");s(this,"closeFp");s(this,"close");s(this,"openFp");s(this,"open");const a={version:e,requires:"web_app_open_scan_qr_popup",isTma:i},u=B({...a,returns:"either"}),l=B({...a,returns:"task"}),p=D(!1),f=()=>{p.set(!1)};this.isSupported=oe("web_app_open_scan_qr_popup",e),this.isOpened=S(p),this.captureFp=l(d=>{let b;return h(this.openFp({...d,onCaptured:v=>{d.capture(v)&&(b=v,this.close())}}),A(()=>b))}),this.closeFp=u(()=>h(o("web_app_close_scan_qr_popup"),z(f))),this.openFp=l(d=>h(p()?U(new pt("The QR Scanner is already opened")):async()=>o("web_app_open_scan_qr_popup",{text:d.text}),ue(()=>{p.set(!0);const[b,v]=Ge(),F=C=>(v(),p.set(!1),C);return h(Me(C=>{b(n(C),p.sub(g=>{g||C()}),r(d.onCaptured))},d),Ue(F,F))}))),this.open=_(this.openFp),this.capture=_(this.captureFp),this.close=_(this.closeFp)}}function Wa(){return new us({...h(E(),K,q),onClosed(t){return Z("scan_qr_popup_closed",t)},onTextReceived(t){return Z("qr_text_received",e=>{t(e.data)})}})}const Ga=Wa();class cs{constructor({}){s(this,"isRefreshing");s(this,"finishRefreshFp");s(this,"finishRefresh");s(this,"onRefreshRequest");const e=D(!1);Z("refresh_requested",()=>{e.set(!0)}),this.isRefreshing=S(e),this.finishRefreshFp=()=>h(De(Re("web_app_finish_refresh",{isRefreshed:!0})),A(()=>{e.set(!1)})),this.finishRefresh=()=>this.finishRefreshFp()().then(r=>{if(r._tag==="Left")throw r.left;return r.right}),this.onRefreshRequest=n=>Z("refresh_requested",()=>{n()})}}function Na(){return new cs(h(E()))}const xa=Na();class ls{constructor({defaults:e,...n}){s(this,"isSupported");s(this,"position");s(this,"bgColor");s(this,"hasShineEffect");s(this,"isEnabled");s(this,"isLoaderVisible");s(this,"isVisible");s(this,"isMounted");s(this,"state");s(this,"text");s(this,"textColor");s(this,"showFp");s(this,"show");s(this,"hideFp");s(this,"hide");s(this,"enableFp");s(this,"enable");s(this,"enableShineEffectFp");s(this,"enableShineEffect");s(this,"disableFp");s(this,"disable");s(this,"disableShineEffectFp");s(this,"disableShineEffect");s(this,"setBgColorFp");s(this,"setBgColor");s(this,"setTextColorFp");s(this,"setTextColor");s(this,"setTextFp");s(this,"setText");s(this,"setPositionFp");s(this,"setPosition");s(this,"showLoaderFp");s(this,"showLoader");s(this,"hideLoaderFp");s(this,"hideLoader");s(this,"setParamsFp");s(this,"setParams");s(this,"mountFp");s(this,"mount");s(this,"unmount");s(this,"onClickFp");s(this,"onClick");s(this,"offClickFp");s(this,"offClick");const r=new ht({...n,initialState:{hasShineEffect:!1,isEnabled:!0,isLoaderVisible:!1,isVisible:!1,text:"Cancel",position:"left"},method:"web_app_setup_secondary_button",payload:o=>({has_shine_effect:o.hasShineEffect,is_visible:o.isVisible,is_active:o.isEnabled,is_progress_visible:o.isLoaderVisible,text:o.text,color:o.bgColor,text_color:o.textColor,position:o.position})}),i=(o,a)=>{const u=r.stateGetter(o);return S(()=>u()||ee(a))};this.isSupported=oe("web_app_setup_secondary_button",n.version),this.bgColor=i("bgColor",e.bgColor),this.textColor=i("textColor",e.textColor),this.position=r.stateGetter("position"),this.hasShineEffect=r.stateGetter("hasShineEffect"),this.isEnabled=r.stateGetter("isEnabled"),this.isLoaderVisible=r.stateGetter("isLoaderVisible"),this.text=r.stateGetter("text"),this.isVisible=r.stateGetter("isVisible"),this.isMounted=r.isMounted,this.state=r.state,[this.setPosition,this.setPositionFp]=r.stateSetters("position"),[this.setBgColor,this.setBgColorFp]=r.stateSetters("bgColor"),[this.setTextColor,this.setTextColorFp]=r.stateSetters("textColor"),[[this.disableShineEffect,this.disableShineEffectFp],[this.enableShineEffect,this.enableShineEffectFp]]=r.stateBoolSetters("hasShineEffect"),[[this.disable,this.disableFp],[this.enable,this.enableFp]]=r.stateBoolSetters("isEnabled"),[[this.hideLoader,this.hideLoaderFp],[this.showLoader,this.showLoaderFp]]=r.stateBoolSetters("isLoaderVisible"),[this.setText,this.setTextFp]=r.stateSetters("text"),[[this.hide,this.hideFp],[this.show,this.showFp]]=r.stateBoolSetters("isVisible"),this.setParams=r.setState,this.setParamsFp=r.setStateFp,this.onClick=r.onClick,this.onClickFp=r.onClickFp,this.offClick=r.offClick,this.offClickFp=r.offClickFp,this.mount=r.mount,this.mountFp=r.mountFp,this.unmount=r.unmount}}function Ha(){return new ls(ts("secondaryButton","secondary_button_pressed",{bgColor:S(()=>rs.bottomBarColorRgb()||"#000000"),textColor:S(()=>Je.buttonColor()||"#2481cc")}))}const za=Ha();class ps{constructor({isTma:e,request:n,version:r,createRequestId:i}){s(this,"getItemFp");s(this,"getItem");s(this,"restoreItemFp");s(this,"restoreItem");s(this,"setItemFp");s(this,"setItem");s(this,"deleteItemFp");s(this,"deleteItem");s(this,"clearFp");s(this,"clear");const o=B({version:r,requires:"web_app_secure_storage_get_key",isTma:e,returns:"task"}),a=(u,l,p)=>{const f=i();return h(n(u,["secure_storage_failed",l],{params:{...p,req_id:f},capture:(d=>"payload"in d?d.payload.req_id===f:!0)}),te(d=>d.event==="secure_storage_failed"?U(new Cr(d.payload.error||"UNKNOWN_ERROR")):R(d.payload)))};this.getItemFp=o(u=>h(a("web_app_secure_storage_get_key","secure_storage_key_received",{key:u}),A(l=>({value:l.value,canRestore:!!l.can_restore})))),this.setItemFp=o((u,l)=>h(a("web_app_secure_storage_save_key","secure_storage_key_saved",{key:u,value:l}),A(()=>{}))),this.deleteItemFp=o(u=>this.setItemFp(u,null)),this.clearFp=o(()=>h(a("web_app_secure_storage_clear","secure_storage_cleared",{}),A(()=>{}))),this.restoreItemFp=o(u=>h(a("web_app_secure_storage_restore_key","secure_storage_key_restored",{key:u}),A(l=>l.value))),this.getItem=_(this.getItemFp),this.setItem=_(this.setItemFp),this.deleteItem=_(this.deleteItemFp),this.clear=_(this.clearFp),this.restoreItem=_(this.restoreItemFp)}}function Ka(){return new ps(h(E(),q,Y,Ur))}const Ja=Ka();class hs{constructor(e){s(this,"isVisible");s(this,"isMounted");s(this,"isSupported");s(this,"hideFp");s(this,"hide");s(this,"showFp");s(this,"show");s(this,"onClickFp");s(this,"onClick");s(this,"offClickFp");s(this,"offClick");s(this,"mountFp");s(this,"mount");s(this,"unmount");const n=new ht({...e,method:"web_app_setup_settings_button",payload:r=>({is_visible:r.isVisible}),initialState:{isVisible:!1}});this.isVisible=n.stateGetter("isVisible"),this.isMounted=n.isMounted,this.isSupported=n.isSupported,[[this.hide,this.hideFp],[this.show,this.showFp]]=n.stateBoolSetters("isVisible"),this.onClick=n.onClick,this.onClickFp=n.onClickFp,this.offClick=n.offClick,this.offClickFp=n.offClickFp,this.mount=n.mount,this.mountFp=n.mountFp,this.unmount=n.unmount}}const Qa=new hs(sn("settingsButton","settings_button_pressed"));class fs{constructor({postEvent:e,storage:n,isTma:r,isPageReload:i,version:o}){s(this,"isSupported");s(this,"isVerticalEnabled");s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"unmount");s(this,"disableVerticalFp");s(this,"disableVertical");s(this,"enableVerticalFp");s(this,"enableVertical");const a={isVerticalEnabled:!0},u=new me({initialState:a,onChange(v){n.set(v)}}),l=new We({initialState:a,isPageReload:i,onMounted:u.setState,restoreState:n.get}),p={requires:"web_app_setup_swipe_behavior",isTma:r,version:o},f=B({...p,returns:"plain"}),d=B({...p,isMounted:l.isMounted,returns:"either"}),b=v=>{const F={isVerticalEnabled:v};return u.hasDiff(F)?h(e("web_app_setup_swipe_behavior",{allow_vertical_swipe:v}),z(()=>{u.setState(F)})):k(void 0)};this.isSupported=oe("web_app_setup_swipe_behavior",o),this.isVerticalEnabled=u.getter("isVerticalEnabled"),this.isMounted=l.isMounted,this.disableVerticalFp=d(()=>b(!1)),this.enableVerticalFp=d(()=>b(!0)),this.mountFp=f(()=>{const v=()=>{};return h(l.mount(),ae(v,v))}),this.unmount=l.unmount,this.disableVertical=_(this.disableVerticalFp),this.enableVertical=_(this.enableVerticalFp),this.mount=_(this.mountFp)}}function Za(){return new fs(h(E(),K,q,we("swipeBehavior")))}const Ya=Za();async function Xa(t){try{const{clipboard:n}=navigator;if(n)return await n.writeText(t)}catch{}const e=document.createElement("textarea");e.value=t,e.style.top="0",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")}finally{document.body.removeChild(e)}}function eu({request:t,...e}){return V((n,r,i)=>h(t("web_app_request_file_download","file_download_requested",{...i,params:{url:n,file_name:r}}),te(o=>o.status==="downloading"?R(void 0):U(new nn("User denied the action")))),{...e,requires:"web_app_request_file_download",returns:"task"})}function tu(){return eu(h(E(),Y,q))}const ds=tu(),nu=_(ds);function ru({invokeCustomMethod:t,...e}){return V(n=>h(t("getCurrentTime",{},n),te(r=>{const i=Dt(ie(be(),Tt(),le(o=>new Date(o*1e3)),tt()),r);return i.success?R(i.output):U(new ze(r,i.issues))})),{...e,requires:"web_app_invoke_custom_method",returns:"task"})}function su(){return ru(h(E(),ln,q))}const _s=su(),iu=_(_s);function ou({postEvent:t,...e}){return V(()=>t("web_app_hide_keyboard"),{...e,returns:"either",requires:"web_app_hide_keyboard"})}function au(){return ou(h(E(),K,q))}const ms=au(),uu=_(ms);function cu({request:t,createRequestId:e,...n}){return V(r=>{const i=e();return h(t("web_app_read_text_from_clipboard","clipboard_text_received",{...r,params:{req_id:i},capture:gr(i)}),A(({data:o=null})=>o))},{...n,requires:"web_app_read_text_from_clipboard",returns:"task"})}function lu(){return cu({...h(E(),q,Y),createRequestId:ft})}const bs=lu(),pu=_(bs);function gs(t){const e={},n=t.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);if(n){const[,r,i]=n;r&&(e.appVersion=r),i&&i.slice(1,i.length-1).split(";").forEach(o=>{const[a,u]=o.trim().split(" ");if(a==="Android")e.androidVersion=u;else if(a==="SDK"){const l=parseInt(u,10);l&&(e.sdkVersion=l)}else u?(e.manufacturer=a,e.model=u):e.performanceClass=a})}return e}function hu(){return gs(navigator.userAgent)}function fu({postEvent:t,...e}){return V(n=>{const{size:r}=new Blob([n]);return!r||r>4096?M(new re(r?"Maximum size of data to send is 4096 bytes":"Attempted to send empty data")):t("web_app_data_send",{data:n})},{...e,returns:"either"})}function du(){return fu(h(E(),K))}const vs=du(),_u=_(vs);function mu({request:t,...e}){return V((n,r)=>h(t("web_app_send_prepared_message",["prepared_message_failed","prepared_message_sent"],{...r,params:{id:n}}),te(i=>i.event==="prepared_message_failed"?U(new $r(i.payload.error)):R(void 0))),{...e,requires:"web_app_send_prepared_message",returns:"task"})}function bu(){return mu(h(E(),Y,q))}const ws=bu(),gu=_(ws);function vu({postEvent:t,...e}){return V((n,r={})=>t("web_app_share_to_story",{text:r.text,media_url:n,widget_link:r.widgetLink}),{...e,requires:"web_app_share_to_story",returns:"either"})}function wu(){return vu(h(E(),K,q))}const ys=wu(),yu=_(ys),gn=Ke(!1);function Fu({isInlineMode:t,postEvent:e,...n}){return V((r,i)=>e("web_app_switch_inline_query",{query:r,chat_types:i||[]}),{...n,requires:{every:["web_app_switch_inline_query",()=>ee(t)?void 0:"The application must be launched in the inline mode"]},returns:"either"})}function Su(){return Fu({...h(E(),K,q),isInlineMode:gn})}const Fs=Su(),Cu=_(Fs);class Ss{constructor({storage:e,isPageReload:n,onContentSafeAreaInsetsChanged:r,onSafeAreaInsetsChanged:i,onViewportChanged:o,onFullscreenChanged:a,offContentSafeAreaInsetsChanged:u,offFullscreenChanged:l,offSafeAreaInsetsChanged:p,offViewportChanged:f,request:d,isViewportStable:b,isFullscreen:v,isTma:F,version:C,postEvent:g}){s(this,"state");s(this,"height");s(this,"stableHeight");s(this,"width");s(this,"isExpanded");s(this,"isStable",S(()=>this.height()===this.stableHeight()));s(this,"contentSafeAreaInsets");s(this,"contentSafeAreaInsetTop");s(this,"contentSafeAreaInsetLeft");s(this,"contentSafeAreaInsetRight");s(this,"contentSafeAreaInsetBottom");s(this,"safeAreaInsets");s(this,"safeAreaInsetTop");s(this,"safeAreaInsetLeft");s(this,"safeAreaInsetRight");s(this,"safeAreaInsetBottom");s(this,"isFullscreen");s(this,"requestFullscreenFp");s(this,"requestFullscreen");s(this,"exitFullscreenFp");s(this,"exitFullscreen");s(this,"isCssVarsBound");s(this,"bindCssVarsFp");s(this,"bindCssVars");s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"expandFp");s(this,"expand");const w={top:0,right:0,left:0,bottom:0},m=new me({initialState:{contentSafeAreaInsets:w,height:0,isExpanded:!1,isFullscreen:!1,safeAreaInsets:w,stableHeight:0,width:0},onChange:e.set}),O=T=>{m.setState({isExpanded:T.is_expanded,height:T.height,width:T.width,stableHeight:T.is_state_stable?T.height:void 0})},j=T=>{m.setState({isFullscreen:T.is_fullscreen})},W=T=>{m.setState({safeAreaInsets:T})},I=T=>{m.setState({contentSafeAreaInsets:T})},L=new on({initialState(T){const Ie=de=>()=>{const[ye,se]=de==="safe-area"?["web_app_request_safe_area","safe_area_changed"]:["web_app_request_content_safe_area","content_safe_area_changed"];return fe(ye,ee(C))?d(ye,se,T):R({top:0,left:0,right:0,bottom:0})},x=de=>()=>typeof de=="boolean"?R(de):De(de());return h(Ai,Xe("safeAreaInsets",Ie("safe-area")),Xe("contentSafeAreaInsets",Ie("content-safe-area")),Xe("isFullscreen",x(v)),Xe("isViewportStable",x(b)),ue(({isViewportStable:de,...ye})=>de?R({...ye,height:window.innerHeight,isExpanded:!0,stableHeight:window.innerHeight,width:window.innerWidth}):h(d("web_app_request_viewport","viewport_changed",T),A(se=>({...ye,height:se.height,isExpanded:se.is_expanded,stableHeight:se.is_state_stable?se.height:0,width:se.width})))))},isPageReload:n,onMounted(T){o(O),a(j),i(W),r(I),m.setState(T)},onUnmounted(){f(O),l(j),p(W),u(I)},restoreState:e.get}),P=T=>S(()=>this.safeAreaInsets()[T]),N=T=>S(()=>this.contentSafeAreaInsets()[T]);this.state=m.state,this.height=m.getter("height"),this.stableHeight=m.getter("stableHeight"),this.width=m.getter("width"),this.isExpanded=m.getter("isExpanded"),this.safeAreaInsets=m.getter("safeAreaInsets"),this.safeAreaInsetTop=P("top"),this.safeAreaInsetBottom=P("bottom"),this.safeAreaInsetLeft=P("left"),this.safeAreaInsetRight=P("right"),this.contentSafeAreaInsets=m.getter("contentSafeAreaInsets"),this.contentSafeAreaInsetTop=N("top"),this.contentSafeAreaInsetBottom=N("bottom"),this.contentSafeAreaInsetLeft=N("left"),this.contentSafeAreaInsetRight=N("right");const Ve=B({isTma:F,returns:"task"}),Qe=B({isTma:F,returns:"either"}),qu=B({isTma:F,requires:"web_app_request_fullscreen",version:C,returns:"task"}),Es=T=>qu(Ie=>h(d(T?"web_app_request_fullscreen":"web_app_exit_fullscreen",["fullscreen_changed","fullscreen_failed"],Ie),te(x=>x.event==="fullscreen_failed"&&x.payload.error!=="ALREADY_FULLSCREEN"?U(new Ar(x.payload.error)):(m.setState({isFullscreen:"is_fullscreen"in x.payload?x.payload.is_fullscreen:!0}),R(void 0)))));this.isMounted=L.isMounted,this.mountFp=Ve(L.mount),this.mount=_(this.mountFp),this.isFullscreen=m.getter("isFullscreen"),this.requestFullscreenFp=Es(!0),this.requestFullscreen=_(this.requestFullscreenFp),this.exitFullscreenFp=Es(!1),this.exitFullscreen=_(this.exitFullscreenFp);const dt=D(!1);this.isCssVarsBound=S(dt),this.bindCssVarsFp=Qe(T=>{if(dt())return M(new lt);T||(T=x=>`--tg-viewport-${Ln(x)}`);const Ie=[["height",this.height],["stableHeight",this.stableHeight],["width",this.width],["safeAreaInsetTop",this.safeAreaInsetTop],["safeAreaInsetBottom",this.safeAreaInsetBottom],["safeAreaInsetLeft",this.safeAreaInsetLeft],["safeAreaInsetRight",this.safeAreaInsetRight],["contentSafeAreaInsetTop",this.contentSafeAreaInsetTop],["contentSafeAreaInsetBottom",this.contentSafeAreaInsetBottom],["contentSafeAreaInsetLeft",this.contentSafeAreaInsetLeft],["contentSafeAreaInsetRight",this.contentSafeAreaInsetRight]].reduce((x,[de,ye])=>{const se=T(de);if(se){const Is=()=>{hn(se,`${ye()}px`)};x.push({update:Is,removeListener:ye.sub(Is),cssVar:se})}return x},[]);return Ie.forEach(x=>{x.update()}),dt.set(!0),k(()=>{Ie.forEach(x=>{x.removeListener(),fn(x.cssVar)}),dt.set(!1)})}),this.bindCssVars=_(this.bindCssVarsFp),this.expandFp=Qe(()=>g("web_app_expand")),this.expand=_(this.expandFp)}}function ku(){const t=o=>({on:a=>{Z(o,a)},off:a=>{Ce(o,a)}}),e=t("viewport_changed"),n=t("fullscreen_changed"),r=t("safe_area_changed"),i=t("content_safe_area_changed");return new Ss({...h(E(),we("viewport"),q,K,Y),isFullscreen(){return h(Te(),z(o=>!!o.vbWebAppFullscreen))},isViewportStable(){return h(Te(),z(o=>["macos","tdesktop","unigram","webk","weba","web"].includes(o.vbWebAppPlatform)))},offContentSafeAreaInsetsChanged:i.off,offFullscreenChanged:n.off,offSafeAreaInsetsChanged:r.off,offViewportChanged:e.off,onContentSafeAreaInsetsChanged:i.on,onFullscreenChanged:n.on,onSafeAreaInsetsChanged:r.on,onViewportChanged:e.on})}const Eu=ku();class Cs{constructor({request:e}){s(this,"requestAccessFp");s(this,"requestAccess");s(this,"selectFile");s(this,"selectFiles");s(this,"selectFolder");this.requestAccessFp=n=>h(e("web_app_request_storage_access","storage_access_granted",{params:{access_type:n.accessType,multiple:n.multiple,accept:n.accept,max_file_size:n.maxFileSize,read_content:n.readContent}}),A(r=>({accessType:r.access_type,items:r.items.map(i=>({name:i.name,path:i.path,size:i.size,type:i.type,content:i.content,lastModified:i.last_modified}))}))),this.requestAccess=n=>this.requestAccessFp(n)().then(i=>{if(i._tag==="Left")throw i.left;return i.right}),this.selectFile=n=>this.requestAccess({accessType:"file",multiple:!1,...n}),this.selectFiles=n=>this.requestAccess({accessType:"file",multiple:!0,...n}),this.selectFolder=()=>this.requestAccess({accessType:"folder"})}}function Iu(){return new Cs({request:ct})}const Au=Iu();function ks(t={}){const{version:e,isInlineMode:n,themeParams:r}=t;if(e&&typeof n=="boolean"&&r)rn.set(e),gn.set(n),_n.set(r);else{const u=h(Te(),yt(l=>l,l=>{rn.set(e||l.vbWebAppVersion),gn.set(typeof n=="boolean"?n:!!l.vbWebAppBotInline),_n.set(r||l.vbWebAppThemeParams)}));if(u)return M(u)}t.postEvent&&Mr.set(t.postEvent);const[i,o]=Ge(Z("reload_iframe",()=>{he().log("Received a request to reload the page"),Tr("iframe_will_reload"),window.location.reload()})),{acceptCustomStyles:a=!0}=t;if(a){const u=document.createElement("style");u.id="telegram-custom-styles",document.head.appendChild(u),i(Z("set_custom_style",l=>{u.innerHTML=l}),()=>{document.head.removeChild(u)})}return h(Ee("iframe_ready",{reload_supported:!0}),z(()=>(he().log("The package was initialized"),o)))}const $u=ne(ks);return c.AccessDeniedError=nn,c.BackButton=Br,c.Biometry=Pr,c.CSSVarsBoundError=lt,c.CancelledError=Pn,c.ClosingBehavior=Lr,c.CloudStorage=Or,c.ConcurrentCallError=pt,c.DeviceStorage=Dr,c.DeviceStorageMethodError=Sr,c.FullscreenFailedError=Ar,c.FunctionUnavailableError=Er,c.HapticFeedback=Nr,c.InitData=zr,c.InvalidArgumentsError=re,c.InvalidEnvError=qo,c.InvalidLaunchParamsError=ar,c.Invoice=Kr,c.InvokeCustomMethodFailedError=ur,c.LaunchParamsRetrieveError=or,c.LocationManager=Zr,c.MainButton=Yr,c.MethodParameterUnsupportedError=ir,c.MethodUnsupportedError=sr,c.MiniApp=ns,c.NotAvailableError=kr,c.Notification=ss,c.Popup=is,c.QrScanner=us,c.Refresh=cs,c.SecondaryButton=ls,c.SecureStorage=ps,c.SecureStorageMethodError=Cr,c.SetEmojiStatusError=Ir,c.SettingsButton=hs,c.ShareMessageError=$r,c.StoragePermission=Cs,c.SwipeBehavior=fs,c.ThemeParams=es,c.TimeoutError=Wt,c.UnknownEnvError=Kt,c.UnknownThemeParamsKeyError=qr,c.ValidationError=ze,c.Viewport=Ss,c.addToHomeScreen=ta,c.addToHomeScreenFp=xr,c.applyPolyfills=ko,c.backButton=Ro,c.biometry=Oo,c.checkHomeScreenStatus=sa,c.checkHomeScreenStatusFp=Hr,c.closingBehavior=Do,c.cloudStorage=Wo,c.copyTextToClipboard=Xa,c.createLogger=Dn,c.createPostEvent=Fo,c.createRequestId=ft,c.createStartParam=Io,c.createStartParamFp=yr,c.debug=hr,c.decodeBase64Url=Eo,c.decodeBase64UrlFp=en,c.decodeStartParam=Ao,c.decodeStartParamFp=Fr,c.deepSnakeToCamelObjKeys=Gt,c.deviceStorage=No,c.downloadFile=nu,c.downloadFileFp=ds,c.emitEvent=at,c.encodeBase64Url=tn,c.getCurrentTime=iu,c.getCurrentTimeFp=_s,c.getReleaseVersion=Xt,c.hapticFeedback=Yo,c.hideKeyboard=uu,c.hideKeyboardFp=ms,c.init=$u,c.initData=oa,c.initFp=ks,c.invoice=ua,c.invokeCustomMethod=jr,c.isAnyRGB=xn,c.isColorDark=dn,c.isColorDarkFp=Xr,c.isRGB=xe,c.isRGBA=Nn,c.isRGBAShort=Gn,c.isRGBShort=Wn,c.isSafeToCreateStartParam=$o,c.isVBMA=vo,c.isVBMAFp=Yt,c.locationManager=wa,c.logger=he,c.mainButton=Fa,c.miniApp=rs,c.mockVBotEnv=wo,c.notification=Ea,c.off=Ce,c.offAll=mo,c.on=Z,c.openLink=pa,c.openLinkFp=Jr,c.openTelegramLink=da,c.openTelegramLinkFp=pn,c.parseInitDataQuery=so,c.parseInitDataQueryFp=Zn,c.parseLaunchParamsQuery=Yn,c.parseLaunchParamsQueryFp=ot,c.popup=$a,c.postEvent=Tr,c.postEventFp=Ee,c.qrScanner=Ga,c.readTextFromClipboard=pu,c.readTextFromClipboardFp=bs,c.refresh=xa,c.request=Po,c.request2=Vo,c.request2Fp=un,c.requestContact=Oa,c.requestContactComplete=La,c.requestContactCompleteFp=bn,c.requestContactFp=os,c.requestEmojiStatusAccess=zo,c.requestEmojiStatusAccessFp=Wr,c.requestFp=Vr,c.requestPhoneAccess=Ma,c.requestPhoneAccessFp=mn,c.requestWriteAccess=Ua,c.requestWriteAccessFp=as,c.retrieveAndroidDeviceData=hu,c.retrieveAndroidDeviceDataFrom=gs,c.retrieveLaunchParams=oo,c.retrieveLaunchParamsFp=Te,c.retrieveRawInitData=ao,c.retrieveRawInitDataFp=Jt,c.retrieveRawLaunchParams=uo,c.retrieveRawLaunchParamsFp=He,c.secondaryButton=za,c.secureStorage=Ja,c.sendData=_u,c.sendDataFp=vs,c.serializeInitDataQuery=er,c.serializeLaunchParamsQuery=tr,c.setDebug=po,c.setEmojiStatus=Qo,c.setEmojiStatusFp=Gr,c.setTargetOrigin=ho,c.settingsButton=Qa,c.shareMessage=gu,c.shareMessageFp=ws,c.shareStory=yu,c.shareStoryFp=ys,c.shareURL=ba,c.shareURLFp=Qr,c.storagePermission=Au,c.supports=fe,c.swipeBehavior=Ya,c.switchInlineQuery=Cu,c.switchInlineQueryFp=Fs,c.targetOrigin=fr,c.themeParams=Je,c.toRGB=Zi,c.toRGBFp=zn,c.toRGBFull=Yi,c.toRGBFullFp=it,c.viewport=Eu,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),c})({});
4
+ //# sourceMappingURL=index.iife.js.map