@vbotma/sdk 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.iife.js +3 -3
- package/dist/index.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Bc=Object.defineProperty;var $c=(a,ee,Ae)=>ee in a?Bc(a,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):a[ee]=Ae;var s=(a,ee,Ae)=>$c(a,typeof ee!="symbol"?ee+"":ee,Ae);this.tmajs=this.tmajs||{};this.tmajs.sdk=(function(a){"use strict";let ee;function Ae(t,e){ee?ee.set(t,e):e()}function xe(t){if(ee)return t();ee=new Map;try{t()}finally{ee.forEach(e=>e()),ee=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 h=i;i=p,Ae(l,()=>{[...r].forEach(([f,g])=>{f(p,h),g&&c(f,!0)})})}};function u(p){const h=typeof p!="object"?{once:p}:p;return{once:h.once||!1,signal:h.signal||!1}}const c=(p,h)=>{const f=u(h),g=r.findIndex(([v,F])=>v===p&&F.once===f.once&&F.signal===f.signal);g>=0&&r.splice(g,1)},l=Object.assign(function(){return ni(l),i},{destroy(){r=[]},set:o,reset(){o(t)},sub(p,h){return r.push([p,u(h)]),()=>c(p,h)},unsub:c,unsubAll(){r=r.filter(p=>p[1].signal)}});return l}const je=[];function ni(t){je.length&&je[je.length-1].add(t)}function C(t,e){let n=new Set,r;function i(){return r||(r=D(u(),e))}function o(){i().set(u())}function u(){n.forEach(p=>{p.unsub(o,{signal:!0})});const c=new Set;let l;je.push(c);try{l=t()}finally{je.pop()}return c.forEach(p=>{p.sub(o,{signal:!0})}),n=c,l}return Object.assign(function(){return i()()},{destroy(){i().destroy()},sub(...c){return i().sub(...c)},unsub(...c){i().unsub(...c)},unsubAll(...c){i().unsubAll(...c)}})}var ri=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 si(t){return t}function yn(t,e,n,r,i,o,u,c,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 u(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return c(u(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return l(c(u(o(i(r(n(e(t.apply(this,arguments)))))))))}}}function d(t,e,n,r,i,o,u,c,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 u(o(i(r(n(e(t))))));case 8:return c(u(o(i(r(n(e(t)))))));case 9:return l(c(u(o(i(r(n(e(t))))))));default:{for(var p=arguments[0],h=1;h<arguments.length;h++)p=arguments[h](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,ri([i],r,!1))}}},ii={_tag:"None"},oi=function(t){return{_tag:"Some",value:t}},ai=function(t){return t._tag==="Left"},Sn=function(t){return{_tag:"Left",left:t}},Fn=function(t){return{_tag:"Right",right:t}},mt={};function ui(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 ci(t,e){return function(n){return function(r){return t.map(r,function(i){return e.map(i,n)})}}}function gt(t){return function(e,n){return function(r){return t.chain(r,function(i){return t.map(n(i),function(o){var u;return Object.assign({},i,(u={},u[e]=o,u))})})}}}var Fe=ii,Be=oi,li=function(t,e){return d(t,hi(e))},pi=function(t,e){return d(t,_i(e))},di="Option",hi=function(t){return function(e){return He(e)?Fe:Be(t(e.value))}},fi=Be,_i=function(t){return function(e){return He(e)||He(t)?Fe:Be(e.value(t.value))}},bi=Oe(2,function(t,e){return He(t)?Fe:e(t.value)}),mi={URI:di,map:li,ap:pi,chain:bi},He=function(t){return t._tag==="None"},gi=function(t,e){return function(n){return He(n)?t():e(n.value)}},wt=gi,wi=fi(mt),Cn=gt(mi),R=Sn,E=Fn,vt=Oe(2,function(t,e){return be(t)?t:e(t.right)}),yt=function(t,e){return d(t,Q(e))},kn=function(t,e){return d(t,Fi(e))},St="Either",Q=function(t){return function(e){return be(e)?e:E(t(e.right))}},vi={URI:St,map:yt},yi=E,Si=function(t){return function(e){return be(e)?e:be(t)?t:E(e.right(t.right))}},Fi=Si,Ci={URI:St,map:yt,ap:kn},ki={URI:St,map:yt,ap:kn,chain:vt},Ei=function(t,e){return function(n){return be(n)?R(t(n.left)):E(e(n.right))}},qi=function(t){return function(e){return be(e)?R(t(e.left)):e}},be=ai,Ft=function(t,e){return function(n){return be(n)?t(n.left):e(n.right)}},Ii=Ft,ue=Ft,Ai=ue,$e=function(t,e){try{return E(t())}catch(n){return R(e(n))}},Bi=yi(mt),$i=gt(ki),En=$i,Mi=vt,Ri=vt;function Ti(t){return yn(E,t.of)}function Pi(t){return yn(R,t.of)}function Li(t){return ci(t,vi)}function Vi(t){return ui(t,Ci)}function ji(t){return function(e,n){return t.chain(e,function(r){return be(r)?t.of(r):n(r.right)})}}function Oi(t){return function(e,n,r){return t.map(e,Ei(n,r))}}function Hi(t){return function(e,n){return function(r){return t.map(r,ue(e,n))}}}var Di=function(t){return $e(function(){return JSON.parse(t)},si)},Ct=function(t,e){return d(t,Ui(e))},qn=function(t,e){return d(t,Wi(e))},Ui=function(t){return function(e){return function(){return Promise.resolve().then(e).then(t)}}},Wi=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)})}}},kt=function(t){return function(){return Promise.resolve(t)}},Gi=Oe(2,function(t,e){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}),Et="Task",qt={URI:Et,map:Ct},In={of:kt},Ni={URI:Et,map:Ct,ap:qn},zi={URI:Et,map:Ct,of:kt,ap:qn,chain:Gi},Ki=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(u){u(o)})}return new(n||(n=Promise))(function(o,u){function c(h){try{p(r.next(h))}catch(f){u(f)}}function l(h){try{p(r.throw(h))}catch(f){u(f)}}function p(h){h.done?o(h.value):i(h.value).then(c,l)}p((r=r.apply(t,e||[])).next())})},Qi=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(p){return function(h){return l([p,h])}}function l(p){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=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(h){p=[6,h],i=0}finally{r=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},U=Pi(In),P=Ti(In),De=kt,et=Hi(qt),Ji=et,An=function(t,e){return function(){return Ki(void 0,void 0,void 0,function(){var n;return Qi(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(Fn)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Sn(e(n))];case 3:return[2]}})})}},Zi=function(t,e){return d(t,A(e))},Yi=function(t,e){return d(t,Xi(e))},A=Li(qt),Ue=Oe(3,Oi(qt)),Xi=Vi(Ni),It=Oe(2,ji(zi)),xi=P,eo="TaskEither",to={URI:eo,map:Zi,ap:Yi,chain:It},no=xi(mt),ro=gt(to),tt=ro,ne=It,ce=It;function te(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",C(this._isMounted));s(this,"mount");s(this,"unmount");this.mount=()=>{if(this.isMounted())return E(void 0);const u=te(o)?n():void 0,c=u?E(u):typeof r=="function"?r():E(r);return d(c,Q(l=>{xe(()=>{this._isMounted.set(!0),e==null||e(l)})}))},this.unmount=()=>{this._isMounted()&&xe(()=>{this._isMounted.set(!1),i==null||i()})}}}function At(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function Bt(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(),...At(e)};Bt(n,this.state())||this._state.set(n)});this._state=D(e,{equals:Bt}),this.state=C(this._state),this.state.sub(n)}getter(e){return C(()=>this._state()[e])}hasDiff(e){return!Bt({...this.state(),...At(e)},this.state())}}let le;function $t(t){return{lang:(t==null?void 0:t.lang)??(le==null?void 0:le.lang),message:t==null?void 0:t.message,abortEarly:(t==null?void 0:t.abortEarly)??(le==null?void 0:le.abortEarly),abortPipeEarly:(t==null?void 0:t.abortPipeEarly)??(le==null?void 0:le.abortPipeEarly)}}let Mt;function so(t){return Mt==null?void 0:Mt.get(t)}let Rt;function io(t){return Rt==null?void 0:Rt.get(t)}let Tt;function oo(t,e){var n;return(n=Tt==null?void 0:Tt.get(t))==null?void 0:n.get(e)}function ao(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 Z(t,e,n,r,i){const o=i&&"input"in i?i.input:n.value,u=(i==null?void 0:i.expected)??t.expects??null,c=(i==null?void 0:i.received)??ao(o),l={kind:t.kind,type:t.type,input:o,expected:u,received:c,message:`Invalid ${e}: ${u?`Expected ${u} but r`:"R"}eceived ${c}`,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",h=(i==null?void 0:i.message)??t.message??oo(t.reference,l.lang)??(p?io(l.lang):null)??r.message??so(l.lang);h!==void 0&&(l.message=typeof h=="function"?h(l):h),p&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function Y(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},$t())}}}function Bn(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function uo(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}var co=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function nt(t,e){return{kind:"validation",type:"check",reference:nt,async:!1,expects:null,requirement:t,message:e,"~run"(n,r){return n.typed&&!this.requirement(n.value)&&Z(this,"input",n,r),n}}}function Pt(t){return{kind:"validation",type:"integer",reference:Pt,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&Z(this,"integer",e,n),e}}}function pe(t){return{kind:"transformation",type:"transform",reference:pe,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function lo(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Lt(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Vt(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 Y(this)},"~run"(t){return t.typed=!0,t}}}function Mn(t,e){return{kind:"schema",type:"array",reference:Mn,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return Y(this)},"~run"(n,r){var o;const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let u=0;u<i.length;u++){const c=i[u],l=this.item["~run"]({value:c},r);if(l.issues){const p={type:"array",origin:"value",input:i,key:u,value:c};for(const h of l.issues)h.path?h.path.unshift(p):h.path=[p],(o=n.issues)==null||o.push(h);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}}else Z(this,"type",n,r);return n}}}function Ce(t){return{kind:"schema",type:"boolean",reference:Ce,expects:"boolean",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:Z(this,"type",e,n),e}}}function rt(t){return{kind:"schema",type:"date",reference:rt,expects:"Date",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return e.value instanceof Date?isNaN(e.value)?Z(this,"type",e,n,{received:'"Invalid Date"'}):e.typed=!0:Z(this,"type",e,n),e}}}function jt(t){return{kind:"schema",type:"function",reference:jt,expects:"Function",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="function"?e.typed=!0:Z(this,"type",e,n),e}}}function Ot(t,e){return{kind:"schema",type:"instance",reference:Ot,expects:t.name,async:!1,class:t,message:e,get"~standard"(){return Y(this)},"~run"(n,r){return n.value instanceof this.class?n.typed=!0:Z(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 Y(this)},"~run"(n,r){var o;const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const u in this.entries){const c=this.entries[u];if(u in i||(c.type==="exact_optional"||c.type==="optional"||c.type==="nullish")&&c.default!==void 0){const l=u in i?i[u]:Lt(c),p=c["~run"]({value:l},r);if(p.issues){const h={type:"object",origin:"value",input:i,key:u,value:l};for(const f of p.issues)f.path?f.path.unshift(h):f.path=[h],(o=n.issues)==null||o.push(f);if(n.issues||(n.issues=p.issues),r.abortEarly){n.typed=!1;break}}p.typed||(n.typed=!1),n.value[u]=p.value}else if(c.fallback!==void 0)n.value[u]=lo(c);else if(c.type!=="exact_optional"&&c.type!=="optional"&&c.type!=="nullish"&&(Z(this,"key",n,r,{input:void 0,expected:`"${u}"`,path:[{type:"object",origin:"key",input:i,key:u,value:i[u]}]}),r.abortEarly))break}if(!n.issues||!r.abortEarly)for(const u in i)Bn(i,u)&&!(u in this.entries)&&(n.value[u]=i[u])}else Z(this,"type",n,r);return n}}}function Me(t,e){return{kind:"schema",type:"nullish",reference:Me,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Y(this)},"~run"(n,r){return(n.value===null||n.value===void 0)&&(this.default!==void 0&&(n.value=Lt(this,n,r)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function ge(t){return{kind:"schema",type:"number",reference:ge,expects:"number",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Z(this,"type",e,n),e}}}function B(t,e){return{kind:"schema",type:"optional",reference:B,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Y(this)},"~run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=Lt(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function Ht(t,e,n){return{kind:"schema",type:"record",reference:Ht,expects:"Object",async:!1,key:t,value:e,message:n,get"~standard"(){return Y(this)},"~run"(r,i){var u,c;const o=r.value;if(o&&typeof o=="object"){r.typed=!0,r.value={};for(const l in o)if(Bn(o,l)){const p=o[l],h=this.key["~run"]({value:l},i);if(h.issues){const g={type:"object",origin:"key",input:o,key:l,value:p};for(const v of h.issues)v.path=[g],(u=r.issues)==null||u.push(v);if(r.issues||(r.issues=h.issues),i.abortEarly){r.typed=!1;break}}const f=this.value["~run"]({value:p},i);if(f.issues){const g={type:"object",origin:"value",input:o,key:l,value:p};for(const v of f.issues)v.path?v.path.unshift(g):v.path=[g],(c=r.issues)==null||c.push(v);if(r.issues||(r.issues=f.issues),i.abortEarly){r.typed=!1;break}}(!h.typed||!f.typed)&&(r.typed=!1),h.typed&&(r.value[h.value]=f.value)}}else Z(this,"type",r,i);return r}}}function S(t){return{kind:"schema",type:"string",reference:S,expects:"string",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:Z(this,"type",e,n),e}}}function Rn(t){let e;if(t)for(const n of t)e?e.push(...n.issues):e=n.issues;return e}function st(t,e){return{kind:"schema",type:"union",reference:st,expects:uo(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Y(this)},"~run"(n,r){let i,o,u;for(const c of this.options){const l=c["~run"]({value:n.value},r);if(l.typed)if(l.issues)o?o.push(l):o=[l];else{i=l;break}else u?u.push(l):u=[l]}if(i)return i;if(o){if(o.length===1)return o[0];Z(this,"type",n,r,{issues:Rn(o)}),n.typed=!0}else{if((u==null?void 0:u.length)===1)return u[0];Z(this,"type",n,r,{issues:Rn(u)})}return n}}}function Dt(){return{kind:"schema",type:"unknown",reference:Dt,expects:"unknown",async:!1,get"~standard"(){return Y(this)},"~run"(t){return t.typed=!0,t}}}function we(t,e,n){const r=t["~run"]({value:e},$t(n));if(r.issues)throw new co(r.issues);return r.value}function ae(...t){return{...t[0],pipe:t,get"~standard"(){return Y(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 Ut(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 po=Object.defineProperty,ho=(t,e,n)=>e in t?po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Tn=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n),fo=Object.defineProperty,_o=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Wt=(t,e,n)=>_o(t,typeof e!="symbol"?e+"":e,n);function Pn(t){return e=>e instanceof t}function Ln(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}};Wt(n,"is",Pn(n));let r=n;return Object.defineProperty(r,"name",{value:t}),r}function bo(t,e,n){const r=class extends Ln(t,n){constructor(...o){super(...o),Wt(this,"data"),this.data=e(...o)}};Wt(r,"is",Pn(r));let i=r;return Object.defineProperty(i,"name",{value:t}),i}let Vn=class extends Ln("CancelledError","Promise was canceled"){},Gt=class extends bo("TimeoutError",e=>({timeout:e}),(e,n)=>[`Timeout reached: ${e}ms`,{cause:n}]){};const mo=Symbol("resolved");function go(t){return{tag:mo,value:t}}function jn(t,e){return t.reject=e.reject,t.resolve=e.resolve,t}class ve extends Promise{constructor(e,n){let r,i,o,u;typeof e=="function"?(o=e,u=n||{}):u=e||{};let c,l;const p=()=>!!l,h=()=>!!c;let f={};const g=[],v=()=>{g.forEach(w=>w()),g.splice(0,g.length),f={}},F=new AbortController,k=()=>h()||p();super((w,y)=>{const{abortOnResolve:m=!0,abortOnReject:O=!0}=u;i=I=>{var j,L;k()||(w(I),c=[I],(j=f.resolved)==null||j.forEach(N=>N(I)),(L=f.finalized)==null||L.forEach(N=>N({kind:"resolved",result:I})),v(),m&&F.abort(go(I)))},r=I=>{var j,L;k()||(y(I),l=[I],(j=f.rejected)==null||j.forEach(N=>N(I)),(L=f.finalized)==null||L.forEach(N=>N({kind:"rejected",reason:I})),v(),O&&F.abort(I))};const{abortSignal:H}=u;if(H){if(H.aborted)return r(H.reason);const I=()=>{r(H.reason)};H.addEventListener("abort",I,!0),g.push(()=>{H.removeEventListener("abort",I,!0)})}const{timeout:W}=u;if(W){const I=setTimeout(()=>{r(new Gt(W))},W);g.push(()=>{clearTimeout(I)})}try{const I=()=>{},j=o&&o(i,r,{abortSignal:F.signal,get isRejected(){return p()},get isResolved(){return h()},on(L,N){if(c||l){if(L==="finalized"){const Ve=c?{kind:"resolved",result:c[0]}:{kind:"rejected",reason:l[0]};N(Ve)}else L==="resolved"&&c?N(c[0]):L==="rejected"&&l&&N(l[0]);return I}return f[L]||(f[L]=[]),f[L].push(N),()=>{const Ve=f[L]||[],Xe=Ve.indexOf(N);Xe>=0&&Ve.splice(Xe,1)}},get result(){return c==null?void 0:c[0]},get rejectReason(){return l==null?void 0:l[0]},throwIfRejected(){if(l)throw l[0]}});j instanceof Promise&&j.catch(r)}catch(I){r(I)}}),Tn(this,"reject"),Tn(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(u){i(u)}},n)}static resolve(e){return this.fn(()=>e)}static reject(e){return new ve((n,r)=>{r(e)})}cancel(){this.reject(new Vn)}catch(e){return this.then(void 0,e)}finally(e){return jn(super.finally(e),this)}then(e,n){return jn(super.then(e,n),this)}}function On(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function wo(t){return t.replace(/_[a-z]/g,e=>e[1].toUpperCase())}function vo(t){return Object.entries(t).reduce((e,[n,r])=>(e[wo(n)]=r,e),{})}function Nt(t){const e=vo(t);for(const n in e){const r=e[n];r&&typeof r=="object"&&!(r instanceof Date)&&(e[n]=Array.isArray(r)?r.map(Nt):Nt(r))}return e}function yo(t){return t.replace(/_([a-z])/g,(e,n)=>`-${n.toLowerCase()}`)}function Hn(t){return`tapps/${t}`}function zt(t,e){sessionStorage.setItem(Hn(t),JSON.stringify(e))}function Dn(t){const e=sessionStorage.getItem(Hn(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 Un(t,e){e||(e={});const{textColor:n,bgColor:r,shouldLog:i}=e,o=i===void 0?!0:i,u=typeof o=="boolean"?()=>o:o,c=(l,p,...h)=>{if(p||u()){const f="font-weight:bold;padding:0 5px;border-radius:100px",[g,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}`,`${f};background-color:${g};color:${v}`,"",`${f};${n?`color:${n};`:""}${r?`background-color:${r}`:""}`,...h)}};return[["log","forceLog"],["warn","forceWarn"],["error","forceError"]].reduce((l,[p,h])=>(l[p]=c.bind(void 0,p,!1),l[h]=c.bind(void 0,p,!0),l),{})}function Ne(t){const e=n=>{throw n};return typeof t=="function"?ve.resolve(d(t,et(e,n=>n))()):d(t,ue(e,n=>n))}function re(t){return Object.assign((...e)=>Ne(t(...e)),t)}const Re=Object.assign((t,e)=>d(An(()=>new ve((n,r,i)=>t(o=>n(E(o)),o=>n(R(o)),i),e),n=>n),ce(ue(U,P))),{fn:(t,e)=>Re((n,r,i)=>{const o=t(i);d(typeof o=="function"?o:De(o),Ji(r,n))()},e)});var So=Object.defineProperty,Fo=(t,e,n)=>e in t?So(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Kt=(t,e,n)=>Fo(t,typeof e!="symbol"?e+"":e,n);function Wn(t){return e=>e instanceof t}function K(t,e){const n=class extends Error{constructor(...o){const u=typeof e=="function"?e(...o):typeof e=="string"?[e]:e||[];super(...u),this.name=t}};Kt(n,"is",Wn(n));let r=n;return Object.defineProperty(r,"name",{value:t}),r}function it(t,e,n){const r=class extends K(t,n){constructor(...u){super(...u),Kt(this,"data"),this.data=e(...u)}};Kt(r,"is",Wn(r));let i=r;return Object.defineProperty(i,"name",{value:t}),i}function Co(t){const e=n=>{const r={};return new URLSearchParams(n).forEach((i,o)=>{const u=r[o];Array.isArray(u)?u.push(i):u===void 0?r[o]=i:r[o]=[u,i]}),we(t,r)};return ae(st([S(),Ot(URLSearchParams)]),nt(n=>{try{return e(n),!0}catch{return!1}},"The value doesn't match required schema"),pe(e))}function ko(t){return ae(S(),nt(e=>{try{return JSON.parse(e),!0}catch{return!1}},"Input is not a valid JSON value"),pe(JSON.parse),t)}function de(t){return ae(S(),ko(t))}function Qt(t){return ae(st([S(),Ot(URLSearchParams)]),Co(t))}function ot(t){return e=>t.test(e)}const Gn=ot(/^#[\da-f]{3}$/i),Nn=ot(/^#[\da-f]{4}$/i),ze=ot(/^#[\da-f]{6}$/i),zn=ot(/^#[\da-f]{8}$/i);function Kn(t){return[ze,zn,Gn,Nn].some(e=>e(t))}function Qn(t){let e="#";for(let n=0;n<t.length-1;n+=1)e+=t[1+n].repeat(2);return e}function at(t){const e=t.replace(/\s/g,"").toLowerCase();if(/^#[\da-f]{3}$/i.test(e))return E(Qn(e.toLowerCase()+"f"));if(/^#[\da-f]{4}$/i.test(e))return E(Qn(e.toLowerCase()));if(/^#[\da-f]{6}$/i.test(e))return E(e.toLowerCase()+"ff");if(/^#[\da-f]{8}$/i.test(e))return E(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?E(n.slice(1).reduce((r,i)=>r+parseInt(i,10).toString(16).padStart(2,"0"),"#").padEnd(9,"f")):R(new Error(`Value "${t}" does not satisfy any of known RGB formats.`))}function Jn(t){return d(at(t),Q(e=>e.slice(0,7)))}const Eo=re(Jn),qo=re(at);function Io(){return G({id:ge(),photo_url:B(S()),type:S(),title:S(),username:B(S())})}function Zn(){return G({added_to_attachment_menu:B(Ce()),allows_write_to_pm:B(Ce()),first_name:S(),id:ge(),is_bot:B(Ce()),is_premium:B(Ce()),last_name:B(S()),language_code:B(S()),photo_url:B(S()),username:B(S())})}function Ao(){return G({projectCode:S(),uid:S(),sessionId:S(),rootToken:S()})}function Bo(){return G({auth_date:ae(S(),pe(t=>new Date(Number(t)*1e3)),rt()),can_send_after:B(ae(S(),pe(Number),Pt())),chat:B(de(Io())),chat_type:B(S()),chat_instance:B(S()),hash:B(S()),query_id:B(S()),receiver:B(de(Zn())),start_param:B(S()),signature:B(S()),user:B(de(Zn())),auth:B(de(Ao()))})}function Yn(){return Qt(Bo())}function Jt(){return Ht(S(),ae(st([S(),ge()]),pe(t=>typeof t=="number"?`#${(t&16777215).toString(16).padStart(6,"0")}`:t),nt(Kn)))}function $o(){const t=B(ae(S(),pe(e=>e==="1")));return G({vbWebAppBotInline:t,vbWebAppData:B(Yn()),vbWebAppDefaultColors:B(de(Jt())),vbWebAppFullscreen:t,vbWebAppPlatform:S(),vbWebAppShowSettings:t,vbWebAppStartParam:B(S()),vbWebAppThemeParams:de(Jt()),vbWebAppVersion:S()})}function Mo(){return Qt($o())}function Xn(){return G({eventType:S(),eventData:B(Dt())})}function xn(t){return $e(()=>we(Yn(),t),e=>e)}function ut(t){return $e(()=>we(Mo(),t),e=>e)}const Ro=re(xn),er=re(ut);function tr(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 nr(t){return tr(t)}function rr(t){return tr(t,(e,n)=>e==="vbWebAppData"?nr(n):JSON.stringify(n))}function To(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 sr(t){return Vt(G({VBotWebviewProxy:G({postEvent:jt()})}),t)}function ir(){try{return window.self!==window.top}catch{return!0}}class or extends K("MethodUnsupportedError",(e,n)=>[`Method "${e}" is unsupported in Mini Apps version ${n}`]){}class ar extends K("MethodParameterUnsupportedError",(e,n,r)=>[`Parameter "${n}" of "${e}" method is unsupported in Mini Apps version ${r}`]){}class ur extends it("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 cr extends K("InvalidLaunchParamsError",(e,n)=>[`Invalid value for launch params: ${e}`,{cause:n}]){}class Zt extends K("UnknownEnvError"){}class lr extends K("InvokeCustomMethodError",e=>[`Server returned error: ${e}`]){}const pr="launchParams";function dr(t){return t.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}function Te(){return d(Ke(),Mi(ut))}const Po=re(Te);function Yt(){return d(Ke(),Q(t=>{const e=new URLSearchParams(t).get("vbWebAppData");return e?Be(e):Fe}))}function Lo(){return d(Yt(),Ai(t=>{throw t},t=>t),wt(()=>{},t=>t))}function Ke(){const t=[];for(const[e,n]of[[()=>dr(window.location.href),"window.location.href"],[()=>{const r=performance.getEntriesByType("navigation")[0];return r&&dr(r.name)},"performance navigation entries"],[()=>Dn(pr),"local storage"]]){const r=e();if(!r){t.push({source:n,error:new Error("Source is empty")});continue}const i=d(ut(r),Ii(o=>o,()=>!0));if(typeof i!="boolean"){t.push({source:n,error:i});continue}return zt(pr,r),E(r)}return R(new ur(t))}const Vo=re(Ke);function hr(t,e){const n=new Map,r=To(),i=(o,u,c=!1)=>{const l=n.get(o)||new Map;n.set(o,l);const p=l.get(u)||[];l.set(u,p);const h=p.findIndex(f=>f[1]===c);if(h>=0&&(r.off(o,p[h][0]),p.splice(h,1),!p.length&&(l.delete(u),!l.size))){const f=n.size;n.delete(o),f&&!n.size&&e()}};return{on(o,u,c){!n.size&&t();const l=()=>{i(o,u,c)},p=(...g)=>{c&&l(),o==="*"?u({name:g[0],payload:g[1]}):u(...g)};r.on(o,p);const h=n.get(o)||new Map;n.set(o,h);const f=h.get(u)||[];return h.set(u,f),f.push([p,c||!1]),l},off:i,emit:r.emit,clear(){const o=n.size;r.all.clear(),n.clear(),o&&e()}}}function ct(t,e){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:t,eventData:e}),source:window.parent}))}const Xt=D(!1),fr=D("https://web.telegram.org"),
|
|
3
|
-
`),e,u)}Uo(n,o)}const{on:X,off:ke,emit:Uo,clear:Wo}=hr(()=>{const t=window;!t.TelegramGameProxy&&(t.TelegramGameProxy={}),xt(t.TelegramGameProxy,"receiveEvent",ct),mr(t,"TelegramGameProxy"),!t.VBot&&(t.VBot={}),!t.VBot.WebView&&(t.VBot.WebView={}),xt(t.VBot.WebView,"receiveEvent",ct),mr(t.VBot,"WebView"),xt(t,"TelegramGameProxy_receiveEvent",ct),window.addEventListener("message",vr)},()=>{[["TelegramGameProxy_receiveEvent"],["TelegramGameProxy","receiveEvent"],["VBot","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",vr)}),Go=(...t)=>lt()(...t);function No(t,e){d(Pe(t,e),qi(n=>{throw n}))}function Pe(t,e){he().log("Posting event:",e?{eventType:t,eventData:e}:{eventType:t});const n=window,r=JSON.stringify({eventType:t,eventData:e});return ir()?(Go(r,br()),E(void 0)):sr(n)?(n.VBotWebviewProxy.postEvent(t,JSON.stringify(e)),E(void 0)):Vt(G({external:G({notify:jt()})}),n)?(n.external.notify(r),E(void 0)):R(new Zt)}function pt(t,e,n={}){const{capture:r=()=>!0,postEvent:i=Pe}=n,o=D(),[u,c]=Ge();(Array.isArray(e)?e:[e]).forEach(p=>{u(X(p,h=>{const f=Array.isArray(e);r(f?{event:p,payload:h}:h)&&o.set([f?{event:p,payload:h}:h])}))});const l=p=>(c(),p);return d(async()=>i(t,n.params),ce(()=>Re((p,h,f)=>{const g=o();if(g)return p(g[0]);const v=k=>{k&&p(k[0])},F=()=>{o.unsub(v)};o.sub(v),f.on("finalized",F)},n)),Ue(l,l))}function zo(t,e){const n=en(t,e);return typeof n=="function"?ve.fn(()=>Ne(n)):n}function en(t,e){const n=sr(window);if(!t)return n||d(Ke(),ue(()=>!1,()=>!0));if(n)return P(!0);const{timeout:r=100}=e||{};return d(pt("web_app_request_theme","theme_changed",{...e,timeout:r}),et(i=>Gt.is(i)||Zt.is(i)?E(!1):R(i),()=>E(!0)))}function Ko({launchParams:t,onEvent:e,resetPostMessage:n}={}){if(t){const o=typeof t=="string"||t instanceof URLSearchParams?t.toString():rr({...t,vbWebAppData:void 0})+(t.vbWebAppData?`&vbWebAppData=${encodeURIComponent(t.vbWebAppData.toString())}`:"");try{er(o)}catch(u){throw new cr(o,u)}zt("launchParams",o)}if(ir()){if(!e)return;n&<.reset();const o=lt();lt.set((...u)=>{const[c]=u,l=()=>{o(...u)};try{const p=we(de(Xn()),c);e({name:p.eventType,params:p.eventData},l)}catch{l()}});return}const r=window.VBotWebviewProxy||{},i=r.postEvent||(()=>{});window.VBotWebviewProxy={...r,postEvent(o,u){const c=()=>{i(o,u)};e?e({name:o,params:u?JSON.parse(u):void 0},c):c()}},he().log("Environment was mocked by the mockVBotEnv function")}function Qo(t,e="*"){const n=o=>{if(o.source===t.contentWindow)try{const u=JSON.parse(o.data),{eventType:c,eventData:l}=u;r.emit(c,l)}catch{}},r=hr(()=>{window.addEventListener("message",n)},()=>{window.removeEventListener("message",n)}),i={...r,send:(o,u)=>{if(t.contentWindow){const c=JSON.stringify({eventType:o,eventData:u});t.contentWindow.postMessage(c,e)}},clear:()=>{r.clear(),Qe===i&&(Qe=void 0)}};return Qe=i,i}let Qe;function _(){if(!Qe)throw new Error("HostBridge not initialized. Call defineHostBridge() first.");return Qe}function yr(t){return({req_id:e})=>e===t}const Sr={"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 tn(t,e){return Object.keys(Sr).find(n=>Sr[n].some(r=>e?typeof r=="object"&&r.method===t&&r.param===e:r===t))||null}function Fr(t){return t.split(".").map(Number)}function Jo(t,e){const n=Fr(t),r=Fr(e),i=Math.max(n.length,r.length);for(let o=0;o<i;o+=1){const u=n[o]||0,c=r[o]||0;if(u!==c)return u>c?1:-1}return 0}function fe(t,e,n){const r=n?tn(t,e):tn(t);return r?Jo(r,n||e)<=0:!1}function Zo(t,e="strict"){const n=typeof e=="function"?e:r=>{const{method:i,version:o}=r,u="param"in r?new ar(i,r.param,o):new or(i,o);if(e==="strict")throw u;return he().forceWarn(u.message)};return((r,i)=>fe(r,t)?r==="web_app_set_header_color"&&Vt(G({color:$n()}),i)&&!fe(r,"color",t)?n({version:t,method:r,param:"color"}):No(r,i):n({version:t,method:r}))}function Yo(t,e,n,r){return d(pt("web_app_invoke_custom_method","custom_method_invoked",{...r||{},params:{method:t,params:e,req_id:n},capture:yr(n)}),ne(({result:i,error:o})=>o?U(new lr(o)):P(i)))}function Xo(t,e,n={}){const{capture:r=()=>!0,postEvent:i=Pe}=n,o=D(),[u,c]=Ge();(Array.isArray(e)?e:[e]).forEach(p=>{u(X(p,h=>{(Array.isArray(e)?r({event:p,payload:h}):r(h))&&o.set([h])}))});const l=p=>(c(),p);return d(async()=>i(t,n.params),ce(()=>Re((p,h,f)=>{const g=o();if(g)return p(g[0]);const v=k=>{k&&p(k[0])},F=()=>{o.unsub(v)};o.sub(v),f.on("finalized",F)},n)),Ue(l,l))}function xo(){Object.hasOwn||(Object.hasOwn=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)})}function nn(t){return $e(()=>decodeURIComponent(atob(t.replace(/-/g,"+").replace(/_/g,"/")).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),e=>e)}const ea=re(nn);function rn(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,n)=>String.fromCharCode(parseInt(`0x${n}`)))).replace(/\+/g,"-").replace(/\//g,"_")}function Cr(t){const e=rn(typeof t=="string"?t:JSON.stringify(t));return e.length>512?R(new Error("Value is too long for start parameter")):E(e)}const ta=re(Cr);function na(t,e){return Ne(kr(t,typeof e=="function"?n=>$e(()=>e(n),r=>r):e))}function kr(t,e){return d(nn(t),Ri(n=>e?typeof e=="function"?e(n):Di(n):E(n)))}function ra(t){return rn(t).length<=512}function se(t,e){return C(()=>fe(t,te(e)))}function b(t){return Object.assign(re(t),{ifAvailable(...e){return d(t.ifAvailable(...e),wt(()=>({ok:!1}),n=>({ok:!0,data:Ne(n)})))}})}function Ee(t){return[t]}class Je extends it("ValidationError",(e,n)=>({input:e,issues:n}),"Validation error"){}class dt extends K("CSSVarsBoundError","CSS variables are already bound"){}class Er extends it("DeviceStorageMethodError",e=>({error:e}),e=>[e]){}class qr extends it("SecureStorageMethodError",e=>({error:e}),e=>[e]){}class Ir extends K("NotAvailableError",Ee){}class sa extends K("InvalidEnvError",Ee){}class Ar extends K("FunctionNotAvailableError",Ee){}class ie extends K("InvalidArgumentsError",(e,n)=>[e,{cause:n}]){}class ht extends K("ConcurrentCallError",Ee){}class Br extends K("SetEmojiStatusError",e=>[`Failed to set emoji status: ${e}`]){}class sn extends K("AccessDeniedError",Ee){}class $r extends K("FullscreenFailedError",Ee){}class Mr extends K("ShareMessageError",Ee){}class Rr extends K("UnknownThemeParamsKeyError",e=>[`Unknown theme params key passed: ${e}`]){}function V(t,e){const n=C(()=>te(e.version)||"100"),r=C(()=>te(e.isVBma)),{requires:i,returns:o}=e,u=i?typeof i=="object"?i:{every:[i]}:void 0,c=w=>{if(!e.supports)return!0;const y=e.supports[w];return fe(y.method,y.param,n())},l=()=>{if(!u)return;const[w,y]="every"in u?["every",u.every]:["some",u.some];for(let m=0;m<y.length;m++){const O=y[m],H=typeof O=="function"?O():fe(O,n())?void 0:`it is unsupported in Mini Apps version ${n()}`;if(H&&(w==="every"||m===y.length-1))return H}},p=(...w)=>{for(const y in e.supports)if(e.supports[y].shouldCheck(...w)&&!c(y))return`option ${y} is not supported in Mini Apps version ${n()}`},h=C(()=>!l()),f=C(()=>n()!=="0.0"),g=C(()=>e.isMounted?e.isMounted():!0),v=C(()=>r()&&f()&&h()&&g()),F=w=>{const y=new Ar(w);return["task","promise"].includes(e.returns)?U(y):R(y)},k=(...w)=>o==="plain"?$e(()=>t(...w),y=>y):o==="promise"?An(()=>t(...w),y=>y):t(...w);return Object.assign((...w)=>{var H;const y="Unable to call function:";if(!r())return F(`${y} it can't be called outside Mini Apps`);if(!f())return F(`${y} the SDK was not initialized. Use the SDK init() function`);const m=l();if(m)return F(`${y} ${m}`);const O=p(...w);if(O)return F(`${y} ${O}`);if(!g()){const W=(H=e.isMounting)!=null&&H.call(e)?"mounting. Wait for the mount completion":"unmounted. Use the mount() method";return F(`${y} the component is ${W}`)}return k(...w)},t,{isAvailable:v,ifAvailable(...w){return v()?Be(k(...w)):Fe}},u?{isSupported:h}:{},e.supports?{supports:c}:{})}function M(t){return e=>V(e,t)}class ft{constructor({isVBma:e,storage:n,onClick:r,offClick:i,initialState:o,isPageReload:u,postEvent:c,payload:l,method:p,version:h}){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 f=new me({initialState:o,onChange(w){n.set(w)}}),g=new We({initialState:o,isPageReload:u,onMounted:f.setState,restoreState:n.get}),v={version:h,requires:p,isVBma:e},F=M({...v,returns:"plain"}),k=M({...v,returns:"either",isMounted:g.isMounted});this.isMounted=g.isMounted,this.isSupported=se(p,h),this.state=f.state,this.setStateFp=k(w=>{const y={...this.state(),...At(w)};return f.hasDiff(y)?d(c(p,l(y)),Q(()=>{f.setState(y)})):E(void 0)}),this.setState=b(this.setStateFp),this.onClickFp=F(r),this.onClick=b(this.onClickFp),this.offClickFp=F(i),this.offClick=b(this.offClickFp),this.mountFp=F(()=>{const w=()=>{};return d(g.mount(),ue(w,w))}),this.mount=b(this.mountFp),this.unmount=g.unmount,this.stateSetters=w=>{const y=k(m=>this.setStateFp({[w]:m}));return[b(y),y]},this.stateBoolSetters=w=>{const[,y]=this.stateSetters(w),m=k(()=>y(!1)),O=k(()=>y(!0));return[[b(m),m],[b(O),O]]}}stateGetter(e){return C(()=>this.state()[e])}}class Tr{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 ft({...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 q(){return{isVBma:C(()=>en())}}function Le(t){return e=>({...e,...te(t)})}function Ze(t,e){return D(t,e)}const Pr=Ze(Pe),qe=(...t)=>Pr()(...t),Lr=(...t)=>Ne(qe(...t)),J=Le({postEvent:qe});function ia(t){return{get:()=>Dn(t),set(e){zt(t,e)}}}function oa(){return performance.getEntriesByType("navigation")[0]}function aa(){const t=oa();return!!t&&t.type==="reload"}function ye(t){return Le({storage:ia(t),isPageReload:aa})}const on=Ze("0.0"),$=Le({version:on});function an(t,e){return{...d(q(),J,$,ye(t)),onClick(n,r){return X(e,n,r)},offClick(n,r){ke(e,n,r)}}}const ua=new Tr(an("backButton","back_button_pressed"));class un{constructor({initialState:e,onMounted:n,restoreState:r,onUnmounted:i,isPageReload:o}){s(this,"_isMounted",D(!1));s(this,"isMounted",C(this._isMounted));s(this,"mount");s(this,"unmount");this.mount=u=>{if(this._isMounted())return P(void 0);const c=te(o)?r():void 0;return d(c?P(c):e(u),A(l=>{this._isMounted()||xe(()=>{this._isMounted.set(!0),n==null||n(l)})}))},this.unmount=()=>{this._isMounted()&&xe(()=>{this._isMounted.set(!1),i==null||i()})}}}function Vr(){return new Ir("Biometry is not available")}function cn(t){let e=!1,n=!1,r="",i=!1,o="",u=!1;return t.available&&(e=!0,n=t.token_saved,r=t.device_id,i=t.access_requested,o=t.type,u=t.access_granted),{available:e,tokenSaved:n,deviceId:r,type:o,accessGranted:u,accessRequested:i}}class jr{constructor({version:e,request:n,postEvent:r,storage:i,onInfoReceived:o,offInfoReceived:u,isVBma:c,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=w=>{h.setState(cn(w))},h=new me({initialState:{available:!1,type:"unknown",accessGranted:!1,accessRequested:!1,deviceId:"",tokenSaved:!1},onChange:i.set}),f=new un({initialState(w){return d(n("web_app_biometry_get_info","biometry_info_received",w),A(cn))},isPageReload:l,onMounted(w){h.setState(w),o(p)},onUnmounted(){u(p)},restoreState:i.get}),g={version:e,requires:"web_app_biometry_request_auth",isVBma:c},v=M({...g,returns:"either"}),F=M({...g,returns:"task"}),k=M({...g,isMounted:f.isMounted,returns:"task"});this.isAvailable=h.getter("available"),this.isMounted=f.isMounted,this.isSupported=se("web_app_biometry_request_auth",e),this.state=h.state,this.unmount=f.unmount,this.mountFp=F(f.mount),this.authenticateFp=k(w=>this.isAvailable()?d(n("web_app_biometry_request_auth","biometry_auth_requested",{...w,params:{reason:((w||{}).reason||"").trim()}}),A(y=>(h.setState({token:y.token}),y))):U(Vr())),this.openSettingsFp=v(()=>r("web_app_biometry_open_settings")),this.requestAccessFp=k(w=>d(n("web_app_biometry_request_access","biometry_info_received",{...w,params:{reason:((w||{}).reason||"").trim()}}),ne(y=>{const m=cn(y);return m.available?(h.setState(m),P(m.accessRequested)):U(Vr())}))),this.updateTokenFp=k((w={})=>{var y;return d(n("web_app_biometry_update_token","biometry_token_updated",{...w,params:{token:w.token||"",reason:(y=w.reason)==null?void 0:y.trim()}}),A(m=>m.status))}),this.authenticate=b(this.authenticateFp),this.openSettings=b(this.openSettingsFp),this.requestAccess=b(this.requestAccessFp),this.updateToken=b(this.updateTokenFp),this.mount=b(this.mountFp)}}const Or=(t,e,n)=>Xo(t,e,{postEvent:qe,...n}),ln=(t,e,n)=>pt(t,e,{postEvent:qe,...n}),ca=(...t)=>ve.fn(()=>Or(...t)()),la=(...t)=>ve.fn(()=>ln(...t)()),x=Le({request:ln});function pa(){return new jr({...d(q(),J,$,x,ye("biometry")),offInfoReceived(t){ke("biometry_info_received",t)},onInfoReceived(t){return X("biometry_info_received",t)}})}const da=pa();class Hr{constructor({postEvent:e,storage:n,isVBma: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(f){n.set(f)}}),u=new We({onMounted:o.setState,restoreState:n.get,initialState:{isConfirmationEnabled:!1},isPageReload:i}),c={requires:"web_app_setup_closing_behavior",isVBma:r},l=M({...c,returns:"plain"}),p=M({...c,returns:"either",isMounted:u.isMounted}),h=f=>f===this.isConfirmationEnabled()?E(void 0):(o.setState({isConfirmationEnabled:f}),e("web_app_setup_closing_behavior",{need_confirmation:f}));this.isConfirmationEnabled=o.getter("isConfirmationEnabled"),this.isMounted=u.isMounted,this.disableConfirmationFp=p(()=>h(!1)),this.enableConfirmationFp=p(()=>h(!0)),this.mountFp=l(()=>{const f=()=>{};return d(u.mount(),ue(f,f))}),this.unmount=u.unmount,this.disableConfirmation=b(this.disableConfirmationFp),this.enableConfirmation=b(this.enableConfirmationFp),this.mount=b(this.mountFp)}}function ha(){return new Hr(d(q(),ye("closingBehavior"),J))}const fa=ha();class Dr{constructor({version:e,isVBma: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=M({version:e,requires:"web_app_invoke_custom_method",isVBma:n,returns:"task"});this.isSupported=se("web_app_invoke_custom_method",e),this.deleteItemFp=i((o,u)=>{const c=Array.isArray(o)?o:[o];return d(c.length?r("deleteStorageValues",{keys:c},u):P(void 0),A(()=>{}))}),this.getItemFp=i((o,u)=>d(this.getItemsFp([o],u),A(c=>c[o]||""))),this.getItemsFp=i((o,u)=>d(o.length?r("getStorageValues",{keys:o},u):P({}),A(c=>({...o.reduce((l,p)=>(l[p]="",l),{}),...we(Ht(S(),S()),c)})))),this.getKeysFp=i(o=>d(r("getStorageKeys",{},o),A(u=>we(Mn(S()),u)))),this.setItemFp=i((o,u,c)=>d(r("saveStorageValue",{key:o,value:u},c),A(()=>{}))),this.clearFp=i(o=>d(this.getKeysFp(o),ne(this.deleteItemFp))),this.deleteItem=b(this.deleteItemFp),this.getItem=b(this.getItemFp),this.getItems=b(this.getItemsFp),this.getKeys=b(this.getKeysFp),this.setItem=b(this.setItemFp),this.clear=b(this.clearFp)}}const pn=Ze(0);function _t(){return pn.set(pn()+1),pn().toString()}function Ur(t,e,n){return Yo(t,e,_t(),{...n||{},postEvent:qe})}const dn=Le({invokeCustomMethod:Ur});function _a(){return new Dr(d(q(),$,dn))}const ba=_a();class Wr{constructor({isVBma: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=M({version:r,requires:"web_app_device_storage_get_key",isVBma:e,returns:"task"}),u=(c,l,p)=>{const h=i();return d(n(c,["device_storage_failed",l],{params:{...p,req_id:h},capture:(f=>"payload"in f?f.payload.req_id===h:!0)}),ne(f=>f.event==="device_storage_failed"?U(new Er(f.payload.error||"UNKNOWN_ERROR")):P(f.payload)))};this.getItemFp=o(c=>d(u("web_app_device_storage_get_key","device_storage_key_received",{key:c}),A(l=>l.value))),this.setItemFp=o((c,l)=>d(u("web_app_device_storage_save_key","device_storage_key_saved",{key:c,value:l}),A(()=>{}))),this.deleteItemFp=o(c=>this.setItemFp(c,null)),this.clearFp=o(()=>d(u("web_app_device_storage_clear","device_storage_cleared",{}),A(()=>{}))),this.getItem=b(this.getItemFp),this.setItem=b(this.setItemFp),this.deleteItem=b(this.deleteItemFp),this.clear=b(this.clearFp)}}const Gr=Le({createRequestId:_t});function ma(){return new Wr(d(q(),$,x,Gr))}const ga=ma();function wa({request:t,...e}){return V(n=>d(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 va(){return wa(d(q(),$,x))}const Nr=va(),ya=b(Nr);function Sa({request:t,...e}){return V((n,r)=>d(t("web_app_set_emoji_status",["emoji_status_set","emoji_status_failed"],{params:{custom_emoji_id:n,duration:(r||{}).duration},...r}),ce(i=>i.event==="emoji_status_failed"?U(new Br(i.payload.error)):P(void 0))),{...e,requires:"web_app_set_emoji_status",returns:"task"})}function Fa(){return Sa(d(q(),x,$))}const zr=Fa(),Ca=b(zr);class Kr{constructor({postEvent:e,isVBma: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=M({requires:i,isVBma:n,version:r,returns:"plain"});this.isSupported=se(i,r),this.impactOccurredFp=o(u=>e(i,{type:"impact",impact_style:u})),this.notificationOccurredFp=o(u=>e(i,{type:"notification",notification_type:u})),this.selectionChangedFp=o(()=>e(i,{type:"selection_change"})),this.impactOccurred=b(this.impactOccurredFp),this.notificationOccurred=b(this.notificationOccurredFp),this.selectionChanged=b(this.selectionChangedFp)}}function ka(){return new Kr(d(q(),J,$))}const Ea=ka();function qa({postEvent:t,...e}){return V(()=>t("web_app_add_to_home_screen"),{...e,requires:"web_app_add_to_home_screen",returns:"either"})}function Ia(){return qa(d(q(),$,J))}const Qr=Ia(),Aa=b(Qr);function Ba({request:t,...e}){return V(n=>d(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 $a(){return Ba(d(q(),$,x))}const Jr=$a(),Ma=b(Jr);class Zr{constructor({retrieveInitData:e}){s(this,"_state",D());s(this,"_raw",D());s(this,"state",C(this._state));s(this,"authDate",this.fromState("auth_date"));s(this,"canSendAfter",this.fromState("can_send_after"));s(this,"canSendAfterDate",C(()=>{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",C(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=()=>d(e(),Q(wt(()=>{},({raw:n,obj:r})=>{this._state.set(r),this._raw.set(n)}))),this.restore=re(this.restoreFp)}fromState(e){return C(()=>{const n=this._state();return n?n[e]:void 0})}}function Ra(){return new Zr({retrieveInitData(){return d(Bi,En("obj",()=>d(Te(),Q(({vbWebAppData:t})=>t?Be(t):Fe))),En("raw",Yt),Q(({obj:t,raw:e})=>d(wi,Cn("obj",()=>t),Cn("raw",()=>e))))}})}const Ta=Ra();class Yr{constructor({version:e,request:n,isVBma:r}){s(this,"isOpened");s(this,"isSupported");s(this,"openSlugFp");s(this,"openSlug");s(this,"openUrlFp");s(this,"openUrl");const i=M({version:e,isVBma:r,requires:"web_app_open_invoice",returns:"task"}),o=D(!1),u=()=>{o.set(!1)};this.isSupported=se("web_app_open_invoice",e),this.isOpened=C(o),this.openSlugFp=i((c,l)=>d(this.isOpened()?U(new ht("Invoice is already opened")):P(void 0),ne(()=>(o.set(!0),n("web_app_open_invoice","invoice_closed",{...l,params:{slug:c},capture:p=>c===p.slug}))),Ue(p=>(u(),p),p=>(u(),p.status)))),this.openUrlFp=i((c,l)=>{const{hostname:p,pathname:h}=new URL(c,window.location.href);if(p!=="t.me")return U(new ie(`Link has unexpected hostname: ${p}`));const f=h.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);return f?this.openSlugFp(f[2],l):U(new ie('Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'))}),this.openUrl=b(this.openUrlFp),this.openSlug=b(this.openSlugFp)}}function Pa(){return new Yr(d(q(),x,$))}const La=Pa();function Va({postEvent:t,...e}){return V((n,r={})=>{if(typeof n=="string")try{n=new URL(n)}catch(i){return R(new ie(`"${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 ja(){return Va(d(q(),J))}const Xr=ja(),Oa=b(Xr);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",te(e))?(r=new URL(r),t("web_app_open_tg_link",{path_full:r.pathname+r.search})):(window.location.href=i,E(void 0)):R(new ie(`"${i}" is invalid URL`))},{...n,returns:"either"})}function Da(){return Ha(d(q(),J,$))}const hn=Da(),Ua=b(hn);function Wa({openVbotLink: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 Ga(){return Wa({...q(),openVbotLink:hn})}const xr=Ga(),Na=b(xr);function za(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 es{constructor({version:e,request:n,postEvent:r,storage:i,isVBma:o,isPageReload:u}){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 c=new me({initialState:{available:!1,accessGranted:!1,accessRequested:!1},onChange:i.set}),l=new un({isPageReload:u,restoreState:i.get,onMounted:c.setState,initialState(v){return d(n("web_app_check_location","location_checked",v),A(za))}}),p={version:e,requires:"web_app_check_location",isVBma:o},h=M({...p,returns:"either"}),f=M({...p,returns:"task"}),g=M({...p,returns:"task",isMounted:l.isMounted});this.isAvailable=c.getter("available"),this.isAccessRequested=c.getter("accessRequested"),this.isAccessGranted=c.getter("accessGranted"),this.isSupported=se("web_app_check_location",e),this.isMounted=l.isMounted,this.state=c.state,this.unmount=l.unmount,this.mountFp=f(l.mount),this.openSettingsFp=h(()=>r("web_app_open_location_settings")),this.requestLocationFp=g(v=>d(n("web_app_request_location","location_requested",v),A(F=>{if(!F.available)return c.setState({available:!1}),null;const{available:k,...w}=F;return w}))),this.mount=b(this.mountFp),this.openSettings=b(this.openSettingsFp),this.requestLocation=b(this.requestLocationFp)}}function Ka(){return new es(d(q(),J,$,x,ye("locationManager")))}const Qa=Ka();class ts{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 ft({...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,u)=>{const c=r.stateGetter(o);return C(()=>c()||te(u))};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 fn(t,e){document.documentElement.style.setProperty(t,e)}function _n(t){document.documentElement.style.removeProperty(t)}function ns(t){return d(at(t),Q(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 bn=re(ns);class rs{constructor({initialState:e,onChange:n,offChange:r,isVBma:i,storage:o,isPageReload:u}){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",C(this._isCssVarsBound));s(this,"bindCssVarsFp");s(this,"bindCssVars");s(this,"state");s(this,"isDark",C(()=>{const e=this.bgColor();return!e||bn(e)}));s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"unmount");const c=new me({initialState:{},onChange:o.set}),l=v=>{c.setState(v.theme_params)},p=new We({initialState:()=>E(te(e)),isPageReload:u,onMounted(v){c.setState(v),n(l)},onUnmounted(){r(l)},restoreState:o.get}),h={isVBma:i,returns:"either"},f=M(h),g=M({...h,isMounted:p.isMounted});this.accentTextColor=c.getter("accent_text_color"),this.bgColor=c.getter("bg_color"),this.buttonColor=c.getter("button_color"),this.buttonTextColor=c.getter("button_text_color"),this.bottomBarBgColor=c.getter("bottom_bar_bg_color"),this.destructiveTextColor=c.getter("destructive_text_color"),this.headerBgColor=c.getter("header_bg_color"),this.hintColor=c.getter("hint_color"),this.linkColor=c.getter("link_color"),this.secondaryBgColor=c.getter("secondary_bg_color"),this.sectionBgColor=c.getter("section_bg_color"),this.sectionHeaderTextColor=c.getter("section_header_text_color"),this.sectionSeparatorColor=c.getter("section_separator_color"),this.subtitleTextColor=c.getter("subtitle_text_color"),this.textColor=c.getter("text_color"),this.state=c.state,this.isMounted=p.isMounted,this.bindCssVarsFp=g(v=>{if(this._isCssVarsBound())return R(new dt);v||(v=w=>`--vb-theme-${yo(w)}`);const F=w=>{Object.entries(c.state()).forEach(([y,m])=>{m&&w(y,m)})},k=()=>{F((w,y)=>{fn(v(w),y)})};return k(),c.state.sub(k),this._isCssVarsBound.set(!0),E(()=>{F(_n),c.state.unsub(k),this._isCssVarsBound.set(!1)})}),this.mountFp=f(p.mount),this.unmount=p.unmount,this.bindCssVars=b(this.bindCssVarsFp),this.mount=b(this.mountFp)}}const mn=Ze({});function Ja(){return new rs({...d(q(),ye("themeParams")),offChange(t){ke("theme_changed",t)},onChange(t){X("theme_changed",t)},initialState:mn})}const Ye=Ja();function ss(t,e,n){return d(an(t,e),r=>({...r,defaults:n}))}const Za=new ts(ss("mainButton","main_button_pressed",{bgColor:C(()=>Ye.buttonColor()||"#2481cc"),textColor:C(()=>Ye.buttonTextColor()||"#ffffff")}));class is{constructor({storage:e,isPageReload:n,version:r,postEvent:i,isVBma:o,theme:u,onVisibilityChanged:c,offVisibilityChanged:l}){s(this,"isSupported");s(this,"isDark",C(()=>{const e=this.bgColorRgb();return e?bn(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=>{g.setState({isActive:m.is_visible})},h=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,H])=>{const W=O();if(!ze(W)&&(H!=="web_app_set_header_color"||!["bg_color","secondary_bg_color"].includes(W))){const I=m[W];I&&i(H,{color:I})}})},f=new We({initialState(){return E({bgColor:"bg_color",headerColor:"header_bg_color",bottomBarColor:"bottom_bar_bg_color",isActive:!0})},isPageReload:n,onMounted:m=>{c(p),u.sub(h),g.setState(m)},onUnmounted(){l(p),u.unsub(h)},restoreState:e.get});this.isMounted=f.isMounted,this.mountFp=V(()=>{const m=()=>{};return d(f.mount(),ue(m,m))},{isVBma:o,returns:"plain"}),this.mount=b(this.mountFp),this.unmount=f.unmount;const g=new me({initialState:{bgColor:"bg_color",bottomBarColor:"bottom_bar_bg_color",headerColor:"bg_color",isActive:!1},onChange:e.set});this.state=g.state;const v=m=>ze(m)?m:te(u)[m],F=m=>C(()=>v(m()));this.isActive=g.getter("isActive"),this.isSupported=C(()=>["web_app_set_header_color","web_app_set_background_color","web_app_set_bottom_bar_color"].some(m=>fe(m,te(r))));const k=D(!1);this.isCssVarsBound=C(k),this.bindCssVarsFp=V(m=>{if(k())return R(new dt);const[O,H]=Ge(()=>{k.set(!1)}),W=(I,j)=>{const L=()=>{fn(I,j()||null)};L(),O(j.sub(L),_n.bind(null,I))};return m||(m=I=>`--tg-${On(I)}`),W(m("bgColor"),this.bgColorRgb),W(m("bottomBarColor"),this.bottomBarColorRgb),W(m("headerColor"),this.headerColorRgb),k.set(!0),E(H)},{isVBma:o,returns:"either",isMounted:this.isMounted}),this.bindCssVars=b(this.bindCssVarsFp);const w=m=>{const O=g.getter(m),H=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(j=>{if(j===O())return E(void 0);if(W==="web_app_set_header_color"&&(j==="bg_color"||j==="secondary_bg_color"))return d(i("web_app_set_header_color",{color_key:j}),Q(()=>{g.setState({[m]:j})}));const L=v(j);return d(L?i(W,{color:L}):R(new Rr(j)),Q(()=>{g.setState({[m]:j})}))},{isVBma:o,version:r,requires:W,isMounted:this.isMounted,returns:"either",supports:m==="headerColor"?{rgb:{method:"web_app_set_header_color",param:"color",shouldCheck:ze}}:void 0});return[O,H,b(I),I]};[this.bgColor,this.bgColorRgb,this.setBgColor,this.setBgColorFp]=w("bgColor"),[this.headerColor,this.headerColorRgb,this.setHeaderColor,this.setHeaderColorFp]=w("headerColor"),[this.bottomBarColor,this.bottomBarColorRgb,this.setBottomBarColor,this.setBottomBarColorFp]=w("bottomBarColor");const y=M({isVBma:o,returns:"either"});this.closeFp=y(m=>i("web_app_close",{return_back:m})),this.close=b(this.closeFp),this.readyFp=y(()=>i("web_app_ready")),this.ready=b(this.readyFp)}}function Ya(){return new is({...d(q(),J,$,ye("miniApp")),offVisibilityChanged(t){ke("visibility_changed",t)},onVisibilityChanged(t){X("visibility_changed",t)},theme:Ye.state})}const os=Ya();function Xa(){const t=Date.now(),e=Math.random().toString(36).substring(2,9);return`notif_${t}_${e}`}class as{constructor({version:e,isVBma:n}){s(this,"isSupported");s(this,"sendFp");s(this,"send");const r=M({version:e,isVBma:n,requires:"web_app_send_notification",returns:"task"});this.isSupported=se("web_app_send_notification",e),this.sendFp=r(i=>d(De(Pe("web_app_send_notification",{id:Xa(),message:i.message,title:i.title,type:i.type??"default"})),A(()=>{}))),this.send=i=>this.sendFp(i)().then(u=>{if(u._tag==="Left")throw u.left;return u.right})}}function xa(){return new as($(q()))}const eu=xa();function tu(t){const e=t.message.trim(),n=(t.title||"").trim(),r=t.buttons||[];if(n.length>64)return R(new ie(`Invalid title: ${n}`));if(!e||e.length>256)return R(new ie(`Invalid message: ${e}`));if(r.length>3)return R(new ie(`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 u=r[o],c=u.id||"";if(c.length>64)return R(new ie(`Button with index ${o} has invalid id: ${c}`));if(!u.type||u.type==="default"||u.type==="destructive"){const l=u.text.trim();if(!l||l.length>64)return R(new ie(`Button with index ${o} has invalid text: ${l}`));i.push({type:u.type,text:l,id:c})}else i.push({type:u.type,id:c})}return E({title:n,message:e,buttons:i})}class us{constructor({version:e,isVBma:n,request:r}){s(this,"isOpened");s(this,"isSupported");s(this,"showFp");s(this,"show");const i=D(!1),o=()=>{i.set(!1)},u=M({version:e,isVBma:n,requires:"web_app_open_popup",returns:"task"});this.isSupported=se("web_app_open_popup",e),this.isOpened=C(i),this.showFp=u(c=>d(this.isOpened()?U(new ht("A popup is already opened")):P(void 0),ce(()=>De(tu(c))),ne(l=>(i.set(!0),r("web_app_open_popup","popup_closed",{...c,params:l}))),Ue(l=>(o(),l),l=>(o(),l.button_id)))),this.show=b(this.showFp)}}function nu(){return new us(d(q(),x,$))}const ru=nu();function su({request:t,...e}){return V(n=>d(t("web_app_request_phone","phone_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_phone",returns:"task"})}function iu(){return su(d(q(),$,x))}const gn=iu(),ou=b(gn);function au({invokeCustomMethod:t,requestPhoneAccess:e,...n}){const r=u=>d(t("getRequestedContact",{},{...u,timeout:(u||{}).timeout||5e3}),ce(c=>{const l=Ut(S(),c);if(!l.success)return U(new Je(c,l.issues));if(!l.output)return P(void 0);const p=Ut(Qt(G({contact:de(G({user_id:ge(),phone_number:S(),first_name:S(),last_name:B(S())})),auth_date:ae(S(),pe(h=>new Date(Number(h)*1e3)),rt()),hash:S()})),l.output);return p.success?P({raw:l.output,parsed:p.output}):U(new Je(l.output,p.issues))})),i=u=>d(r(u),et(c=>Je.is(c)?R(c):E(void 0),c=>E(c))),o=u=>Re(async(c,l,p)=>{let h=50;for(;!p.isRejected;){const f=await i(p)();if(f._tag==="Left")return l(f.left);if(f.right)return c(f.right);await new Promise(g=>setTimeout(g,h)),h+=50}},u);return V(u=>Re.fn(c=>d(i(c),ne(l=>l?P(l):d(e(c),ce(p=>p==="sent"?o(c):U(new sn("User denied access")))))),u),{...n,returns:"task",requires:"web_app_request_phone"})}function uu(){return au({...d(q(),dn,$),requestPhoneAccess:gn})}function cu({requestContact:t,...e}){return V(t,{...e,returns:"task",requires:"web_app_request_phone"})}function lu(){return cu({...d(q(),$),requestContact(t){return d(wn(t),A(e=>e.parsed))}})}const wn=uu(),pu=b(wn),cs=lu(),du=b(cs);function hu({request:t,...e}){return V(n=>d(t("web_app_request_write_access","write_access_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_write_access",returns:"task"})}function fu(){return hu(d(q(),$,x))}const ls=fu(),_u=b(ls);class ps{constructor({version:e,onClosed:n,onTextReceived:r,isVBma: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 u={version:e,requires:"web_app_open_scan_qr_popup",isVBma:i},c=M({...u,returns:"either"}),l=M({...u,returns:"task"}),p=D(!1),h=()=>{p.set(!1)};this.isSupported=se("web_app_open_scan_qr_popup",e),this.isOpened=C(p),this.captureFp=l(f=>{let g;return d(this.openFp({...f,onCaptured:v=>{f.capture(v)&&(g=v,this.close())}}),A(()=>g))}),this.closeFp=c(()=>d(o("web_app_close_scan_qr_popup"),Q(h))),this.openFp=l(f=>d(p()?U(new ht("The QR Scanner is already opened")):async()=>o("web_app_open_scan_qr_popup",{text:f.text}),ce(()=>{p.set(!0);const[g,v]=Ge(),F=k=>(v(),p.set(!1),k);return d(Re(k=>{g(n(k),p.sub(w=>{w||k()}),r(f.onCaptured))},f),Ue(F,F))}))),this.open=b(this.openFp),this.capture=b(this.captureFp),this.close=b(this.closeFp)}}function bu(){return new ps({...d(q(),J,$),onClosed(t){return X("scan_qr_popup_closed",t)},onTextReceived(t){return X("qr_text_received",e=>{t(e.data)})}})}const mu=bu();class ds{constructor({}){s(this,"isRefreshing");s(this,"finishRefreshFp");s(this,"finishRefresh");s(this,"onRefreshRequest");const e=D(!1);X("refresh_requested",()=>{e.set(!0)}),this.isRefreshing=C(e),this.finishRefreshFp=()=>d(De(Pe("web_app_finish_refresh")),A(()=>{e.set(!1)})),this.finishRefresh=()=>this.finishRefreshFp()().then(r=>{if(r._tag==="Left")throw r.left;return r.right}),this.onRefreshRequest=n=>X("refresh_requested",()=>{n()})}}function gu(){return new ds(d(q()))}const wu=gu();class hs{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 ft({...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,u)=>{const c=r.stateGetter(o);return C(()=>c()||te(u))};this.isSupported=se("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 vu(){return new hs(ss("secondaryButton","secondary_button_pressed",{bgColor:C(()=>os.bottomBarColorRgb()||"#000000"),textColor:C(()=>Ye.buttonColor()||"#2481cc")}))}const yu=vu();class fs{constructor({isVBma: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=M({version:r,requires:"web_app_secure_storage_get_key",isVBma:e,returns:"task"}),u=(c,l,p)=>{const h=i();return d(n(c,["secure_storage_failed",l],{params:{...p,req_id:h},capture:(f=>"payload"in f?f.payload.req_id===h:!0)}),ne(f=>f.event==="secure_storage_failed"?U(new qr(f.payload.error||"UNKNOWN_ERROR")):P(f.payload)))};this.getItemFp=o(c=>d(u("web_app_secure_storage_get_key","secure_storage_key_received",{key:c}),A(l=>({value:l.value,canRestore:!!l.can_restore})))),this.setItemFp=o((c,l)=>d(u("web_app_secure_storage_save_key","secure_storage_key_saved",{key:c,value:l}),A(()=>{}))),this.deleteItemFp=o(c=>this.setItemFp(c,null)),this.clearFp=o(()=>d(u("web_app_secure_storage_clear","secure_storage_cleared",{}),A(()=>{}))),this.restoreItemFp=o(c=>d(u("web_app_secure_storage_restore_key","secure_storage_key_restored",{key:c}),A(l=>l.value))),this.getItem=b(this.getItemFp),this.setItem=b(this.setItemFp),this.deleteItem=b(this.deleteItemFp),this.clear=b(this.clearFp),this.restoreItem=b(this.restoreItemFp)}}function Su(){return new fs(d(q(),$,x,Gr))}const Fu=Su();class _s{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 ft({...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 Cu=new _s(an("settingsButton","settings_button_pressed"));class bs{constructor({postEvent:e,storage:n,isVBma: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 u={isVerticalEnabled:!0},c=new me({initialState:u,onChange(v){n.set(v)}}),l=new We({initialState:u,isPageReload:i,onMounted:c.setState,restoreState:n.get}),p={requires:"web_app_setup_swipe_behavior",isVBma:r,version:o},h=M({...p,returns:"plain"}),f=M({...p,isMounted:l.isMounted,returns:"either"}),g=v=>{const F={isVerticalEnabled:v};return c.hasDiff(F)?d(e("web_app_setup_swipe_behavior",{allow_vertical_swipe:v}),Q(()=>{c.setState(F)})):E(void 0)};this.isSupported=se("web_app_setup_swipe_behavior",o),this.isVerticalEnabled=c.getter("isVerticalEnabled"),this.isMounted=l.isMounted,this.disableVerticalFp=f(()=>g(!1)),this.enableVerticalFp=f(()=>g(!0)),this.mountFp=h(()=>{const v=()=>{};return d(l.mount(),ue(v,v))}),this.unmount=l.unmount,this.disableVertical=b(this.disableVerticalFp),this.enableVertical=b(this.enableVerticalFp),this.mount=b(this.mountFp)}}function ku(){return new bs(d(q(),J,$,ye("swipeBehavior")))}const Eu=ku();async function qu(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 Iu({request:t,...e}){return V((n,r,i)=>d(t("web_app_request_file_download","file_download_requested",{...i,params:{url:n,file_name:r}}),ne(o=>o.status==="downloading"?P(void 0):U(new sn("User denied the action")))),{...e,requires:"web_app_request_file_download",returns:"task"})}function Au(){return Iu(d(q(),x,$))}const ms=Au(),Bu=b(ms);function $u({invokeCustomMethod:t,...e}){return V(n=>d(t("getCurrentTime",{},n),ne(r=>{const i=Ut(ae(ge(),Pt(),pe(o=>new Date(o*1e3)),rt()),r);return i.success?P(i.output):U(new Je(r,i.issues))})),{...e,requires:"web_app_invoke_custom_method",returns:"task"})}function Mu(){return $u(d(q(),dn,$))}const gs=Mu(),Ru=b(gs);function Tu({postEvent:t,...e}){return V(()=>t("web_app_hide_keyboard"),{...e,returns:"either",requires:"web_app_hide_keyboard"})}function Pu(){return Tu(d(q(),J,$))}const ws=Pu(),Lu=b(ws);function Vu({request:t,createRequestId:e,...n}){return V(r=>{const i=e();return d(t("web_app_read_text_from_clipboard","clipboard_text_received",{...r,params:{req_id:i},capture:yr(i)}),A(({data:o=null})=>o))},{...n,requires:"web_app_read_text_from_clipboard",returns:"task"})}function ju(){return Vu({...d(q(),$,x),createRequestId:_t})}const vs=ju(),Ou=b(vs);function ys(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[u,c]=o.trim().split(" ");if(u==="Android")e.androidVersion=c;else if(u==="SDK"){const l=parseInt(c,10);l&&(e.sdkVersion=l)}else c?(e.manufacturer=u,e.model=c):e.performanceClass=u})}return e}function Hu(){return ys(navigator.userAgent)}function Du({postEvent:t,...e}){return V(n=>{const{size:r}=new Blob([n]);return!r||r>4096?R(new ie(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 Uu(){return Du(d(q(),J))}const Ss=Uu(),Wu=b(Ss);function Gu({request:t,...e}){return V((n,r)=>d(t("web_app_send_prepared_message",["prepared_message_failed","prepared_message_sent"],{...r,params:{id:n}}),ne(i=>i.event==="prepared_message_failed"?U(new Mr(i.payload.error)):P(void 0))),{...e,requires:"web_app_send_prepared_message",returns:"task"})}function Nu(){return Gu(d(q(),x,$))}const Fs=Nu(),zu=b(Fs);function Ku({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 Qu(){return Ku(d(q(),J,$))}const Cs=Qu(),Ju=b(Cs),vn=Ze(!1);function Zu({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",()=>te(t)?void 0:"The application must be launched in the inline mode"]},returns:"either"})}function Yu(){return Zu({...d(q(),J,$),isInlineMode:vn})}const ks=Yu(),Xu=b(ks);class Es{constructor({storage:e,isPageReload:n,onContentSafeAreaInsetsChanged:r,onSafeAreaInsetsChanged:i,onViewportChanged:o,onFullscreenChanged:u,offContentSafeAreaInsetsChanged:c,offFullscreenChanged:l,offSafeAreaInsetsChanged:p,offViewportChanged:h,request:f,isViewportStable:g,isFullscreen:v,isVBma:F,version:k,postEvent:w}){s(this,"state");s(this,"height");s(this,"stableHeight");s(this,"width");s(this,"isExpanded");s(this,"isStable",C(()=>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 y={top:0,right:0,left:0,bottom:0},m=new me({initialState:{contentSafeAreaInsets:y,height:0,isExpanded:!1,isFullscreen:!1,safeAreaInsets:y,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})},H=T=>{m.setState({isFullscreen:T.is_fullscreen})},W=T=>{m.setState({safeAreaInsets:T})},I=T=>{m.setState({contentSafeAreaInsets:T})},j=new un({initialState(T){const Ie=_e=>()=>{const[Se,oe]=_e==="safe-area"?["web_app_request_safe_area","safe_area_changed"]:["web_app_request_content_safe_area","content_safe_area_changed"];return fe(Se,te(k))?f(Se,oe,T):P({top:0,left:0,right:0,bottom:0})},z=_e=>()=>typeof _e=="boolean"?P(_e):De(_e());return d(no,tt("safeAreaInsets",Ie("safe-area")),tt("contentSafeAreaInsets",Ie("content-safe-area")),tt("isFullscreen",z(v)),tt("isViewportStable",z(g)),ce(({isViewportStable:_e,...Se})=>_e?P({...Se,height:window.innerHeight,isExpanded:!0,stableHeight:window.innerHeight,width:window.innerWidth}):d(f("web_app_request_viewport","viewport_changed",T),A(oe=>({...Se,height:oe.height,isExpanded:oe.is_expanded,stableHeight:oe.is_state_stable?oe.height:0,width:oe.width})))))},isPageReload:n,onMounted(T){o(O),u(H),i(W),r(I),m.setState(T)},onUnmounted(){h(O),l(H),p(W),c(I)},restoreState:e.get}),L=T=>C(()=>this.safeAreaInsets()[T]),N=T=>C(()=>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=L("top"),this.safeAreaInsetBottom=L("bottom"),this.safeAreaInsetLeft=L("left"),this.safeAreaInsetRight=L("right"),this.contentSafeAreaInsets=m.getter("contentSafeAreaInsets"),this.contentSafeAreaInsetTop=N("top"),this.contentSafeAreaInsetBottom=N("bottom"),this.contentSafeAreaInsetLeft=N("left"),this.contentSafeAreaInsetRight=N("right");const Ve=M({isVBma:F,returns:"task"}),Xe=M({isVBma:F,returns:"either"}),Ac=M({isVBma:F,requires:"web_app_request_fullscreen",version:k,returns:"task"}),ei=T=>Ac(Ie=>d(f(T?"web_app_request_fullscreen":"web_app_exit_fullscreen",["fullscreen_changed","fullscreen_failed"],Ie),ne(z=>z.event==="fullscreen_failed"&&z.payload.error!=="ALREADY_FULLSCREEN"?U(new $r(z.payload.error)):(m.setState({isFullscreen:"is_fullscreen"in z.payload?z.payload.is_fullscreen:!0}),P(void 0)))));this.isMounted=j.isMounted,this.mountFp=Ve(j.mount),this.mount=b(this.mountFp),this.isFullscreen=m.getter("isFullscreen"),this.requestFullscreenFp=ei(!0),this.requestFullscreen=b(this.requestFullscreenFp),this.exitFullscreenFp=ei(!1),this.exitFullscreen=b(this.exitFullscreenFp);const bt=D(!1);this.isCssVarsBound=C(bt),this.bindCssVarsFp=Xe(T=>{if(bt())return R(new dt);T||(T=z=>`--vb-viewport-${On(z)}`);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((z,[_e,Se])=>{const oe=T(_e);if(oe){const ti=()=>{fn(oe,`${Se()}px`)};z.push({update:ti,removeListener:Se.sub(ti),cssVar:oe})}return z},[]);return Ie.forEach(z=>{z.update()}),bt.set(!0),E(()=>{Ie.forEach(z=>{z.removeListener(),_n(z.cssVar)}),bt.set(!1)})}),this.bindCssVars=b(this.bindCssVarsFp),this.expandFp=Xe(()=>w("web_app_expand")),this.expand=b(this.expandFp)}}function xu(){const t=o=>({on:u=>{X(o,u)},off:u=>{ke(o,u)}}),e=t("viewport_changed"),n=t("fullscreen_changed"),r=t("safe_area_changed"),i=t("content_safe_area_changed");return new Es({...d(q(),ye("viewport"),$,J,x),isFullscreen(){return d(Te(),Q(o=>!!o.vbWebAppFullscreen))},isViewportStable(){return d(Te(),Q(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 ec=xu();class qs{constructor({request:e}){s(this,"requestAccessFp");s(this,"requestAccess");s(this,"selectFile");s(this,"selectFiles");s(this,"selectFolder");this.requestAccessFp=n=>d(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 tc(){return new qs({request:pt})}const nc=tc();class Is{onSetup(e){return _().on("web_app_setup_back_button",r=>{r&&typeof r.is_visible=="boolean"&&e(r.is_visible)})}press(){_().send("back_button_pressed")}}const rc=new Is;class As{onSetup(e){return _().on("web_app_setup_main_button",r=>{r&&e(r)})}press(){_().send("main_button_pressed")}}const sc=new As;class Bs{onSetup(e){return _().on("web_app_setup_secondary_button",r=>{r&&e(r)})}press(){_().send("secondary_button_pressed")}}const ic=new Bs;class $s{onSetup(e){return _().on("web_app_setup_settings_button",r=>{r&&e(r)})}press(){_().send("settings_button_pressed")}}const oc=new $s;class Ms{onOpen(e){return _().on("web_app_open_popup",r=>{r&&e(r)})}close(e){_().send("popup_closed",{button_id:e})}}const ac=new Ms;class Rs{onExpand(e){return _().on("web_app_expand",()=>{e()})}onRequestContentSafeArea(e){return _().on("web_app_request_content_safe_area",()=>{e()})}onRequestSafeArea(e){return _().on("web_app_request_safe_area",()=>{e()})}onRequestViewport(e){return _().on("web_app_request_viewport",()=>{e()})}onToggleOrientationLock(e){return _().on("web_app_toggle_orientation_lock",r=>{r&&typeof r.locked=="boolean"&&e(r.locked)})}onRequestFullscreen(e){return _().on("web_app_request_fullscreen",()=>{e()})}setFullscreen(e){_().send("fullscreen_changed",{is_fullscreen:e})}setFullscreenFailed(e){_().send("fullscreen_failed",{error:e})}onExitFullscreen(e){return _().on("web_app_exit_fullscreen",()=>{e()})}setContentSafeArea(e){_().send("content_safe_area_changed",e)}setSafeArea(e){_().send("safe_area_changed",e)}setViewport(e){_().send("viewport_changed",e)}}const uc=new Rs;class Ts{onIframeReady(e){return _().on("iframe_ready",r=>{e(r||{})})}onIframeWillReload(e){return _().on("iframe_will_reload",()=>{e()})}onClose(e){return _().on("web_app_close",()=>{e()})}onHideKeyboard(e){return _().on("web_app_hide_keyboard",()=>{e()})}onReady(e){return _().on("web_app_ready",()=>{e()})}onRequestTheme(e){return _().on("web_app_request_theme",()=>{e()})}onBackgroundColorChange(e){return _().on("web_app_set_background_color",r=>{r&&typeof r.color=="string"&&e(r.color)})}onBottomBarColorChange(e){return _().on("web_app_set_bottom_bar_color",r=>{r&&r.color&&e(r.color)})}onHeaderColorChange(e){return _().on("web_app_set_header_color",r=>{r&&("color_key"in r&&r.color_key?e(r.color_key):"color"in r&&r.color&&e(r.color))})}reloadIframe(){_().send("reload_iframe")}setCustomStyle(e){_().send("set_custom_style",e)}setVisibility(e){_().send("visibility_changed",{is_visible:e})}}const cc=new Ts;class Ps{onHapticFeedback(e){return _().on("web_app_trigger_haptic_feedback",r=>{r&&e(r)})}}const lc=new Ps;class Ls{onGetInfo(e){return _().on("web_app_biometry_get_info",()=>{e()})}onOpenSettings(e){return _().on("web_app_biometry_open_settings",()=>{e()})}onRequestAccess(e){return _().on("web_app_biometry_request_access",r=>{e(r||{})})}onRequestAuth(e){return _().on("web_app_biometry_request_auth",r=>{e(r||{})})}onUpdateToken(e){return _().on("web_app_biometry_update_token",r=>{r&&e(r)})}setInfoReceived(e){_().send("biometry_info_received",e)}setAuthRequested(e){_().send("biometry_auth_requested",e)}setTokenUpdated(e){_().send("biometry_token_updated",e)}}const pc=new Ls;class Vs{onOpenInvoice(e){return _().on("web_app_open_invoice",r=>{r&&e(r)})}setInvoiceClosed(e){_().send("invoice_closed",e)}}const dc=new Vs;class js{onOpenPopup(e){return _().on("web_app_open_scan_qr_popup",r=>{e(r||{})})}onClosePopup(e){return _().on("web_app_close_scan_qr_popup",()=>{e()})}sendQrTextReceived(e){_().send("qr_text_received",e)}closePopup(){_().send("scan_qr_popup_closed")}}const hc=new js;class Os{onCheckLocation(e){return _().on("web_app_check_location",()=>{e()})}onOpenLocationSettings(e){return _().on("web_app_open_location_settings",()=>{e()})}onRequestLocation(e){return _().on("web_app_request_location",()=>{e()})}setLocationChecked(e){_().send("location_checked",e)}setLocationRequested(e){_().send("location_requested",e)}}const fc=new Os;class Hs{onOpenLink(e){return _().on("web_app_open_link",r=>{r&&e(r)})}onOpenTgLink(e){return _().on("web_app_open_tg_link",r=>{r&&e(r)})}}const _c=new Hs;class Ds{onRequestAccess(e){return _().on("web_app_request_emoji_status_access",()=>{e()})}onSetEmojiStatus(e){return _().on("web_app_set_emoji_status",r=>{r&&e(r)})}setAccessRequested(e){_().send("emoji_status_access_requested",e)}setEmojiStatusSet(e){_().send("emoji_status_set",e)}setEmojiStatusFailed(e){_().send("emoji_status_failed",e)}}const bc=new Ds;class Us{onAddToHomeScreen(e){return _().on("web_app_add_to_home_screen",()=>{e()})}onCheckHomeScreen(e){return _().on("web_app_check_home_screen",()=>{e()})}setHomeScreenChecked(e){_().send("home_screen_checked",e)}setHomeScreenAdded(){_().send("home_screen_added")}setHomeScreenFailed(e){_().send("home_screen_failed",e)}}const mc=new Us;class Ws{onRequestPhone(e){return _().on("web_app_request_phone",()=>{e()})}onRequestWriteAccess(e){return _().on("web_app_request_write_access",()=>{e()})}setPhoneRequested(e){_().send("phone_requested",e)}setWriteAccessRequested(e){_().send("write_access_requested",e)}}const gc=new Ws;class Gs{onSetupClosingBehavior(e){return _().on("web_app_setup_closing_behavior",r=>{r&&e(r)})}}const wc=new Gs;class Ns{onSetupSwipeBehavior(e){return _().on("web_app_setup_swipe_behavior",r=>{r&&e(r)})}}const vc=new Ns;class zs{onReadText(e){return _().on("web_app_read_text_from_clipboard",r=>{r&&e(r)})}sendTextReceived(e){_().send("clipboard_text_received",e)}}const yc=new zs;class Ks{onRequestFileDownload(e){return _().on("web_app_request_file_download",r=>{e(r||{})})}setFileDownloadRequested(e){_().send("file_download_requested",e)}}const Sc=new Ks;class Qs{onSendPreparedMessage(e){return _().on("web_app_send_prepared_message",r=>{r&&e(r)})}onShareToStory(e){return _().on("web_app_share_to_story",r=>{e(r||{})})}setPreparedMessageFailed(e){_().send("prepared_message_failed",e)}setPreparedMessageSent(){_().send("prepared_message_sent")}}const Fc=new Qs;class Js{onDataSend(e){return _().on("web_app_data_send",r=>{r&&e(r)})}onSwitchInlineQuery(e){return _().on("web_app_switch_inline_query",r=>{r&&e(r)})}}const Cc=new Js;class Zs{onInvokeCustomMethod(e){return _().on("web_app_invoke_custom_method",r=>{r&&e(r)})}setCustomMethodInvoked(e){_().send("custom_method_invoked",e)}}const kc=new Zs;class Ys{onSend(e){return _().on("web_app_send_notification",r=>{r&&e(r)})}}const Ec=new Ys;class Xs{setTheme(e){_().send("theme_changed",{theme_params:e})}onRequestTheme(e){return _().on("web_app_request_theme",()=>{e()})}}const qc=new Xs;function xs(t={}){const{version:e,isInlineMode:n,themeParams:r}=t;if(e&&typeof n=="boolean"&&r)on.set(e),vn.set(n),mn.set(r);else{const c=d(Te(),Ft(l=>l,l=>{on.set(e||l.vbWebAppVersion),vn.set(typeof n=="boolean"?n:!!l.vbWebAppBotInline),mn.set(r||l.vbWebAppThemeParams)}));if(c)return R(c)}t.postEvent&&Pr.set(t.postEvent);const[i,o]=Ge(X("reload_iframe",()=>{he().log("Received a request to reload the page"),Lr("iframe_will_reload"),window.location.reload()})),{acceptCustomStyles:u=!0}=t;if(u){const c=document.createElement("style");c.id="telegram-custom-styles",document.head.appendChild(c),i(X("set_custom_style",l=>{c.innerHTML=l}),()=>{document.head.removeChild(c)})}return d(qe("iframe_ready",{reload_supported:!0}),Q(()=>(he().log("The package was initialized"),o)))}const Ic=re(xs);return a.AccessDeniedError=sn,a.BackButton=Tr,a.Biometry=jr,a.CSSVarsBoundError=dt,a.CancelledError=Vn,a.ClosingBehavior=Hr,a.CloudStorage=Dr,a.ConcurrentCallError=ht,a.DeviceStorage=Wr,a.DeviceStorageMethodError=Er,a.FullscreenFailedError=$r,a.FunctionUnavailableError=Ar,a.HapticFeedback=Kr,a.HostBackButton=Is,a.HostBiometry=Ls,a.HostChat=Js,a.HostClipboard=zs,a.HostClosingBehavior=Gs,a.HostCustomMethod=Zs,a.HostEmojiStatus=Ds,a.HostFiles=Ks,a.HostHapticFeedback=Ps,a.HostHomeScreen=Us,a.HostInvoice=Vs,a.HostLink=Hs,a.HostLocationManager=Os,a.HostMainButton=As,a.HostMiniApp=Ts,a.HostNotification=Ys,a.HostPopup=Ms,a.HostPrivacy=Ws,a.HostQrScanner=js,a.HostSecondaryButton=Bs,a.HostSettingsButton=$s,a.HostSharing=Qs,a.HostSwipeBehavior=Ns,a.HostThemeParams=Xs,a.HostViewport=Rs,a.InitData=Zr,a.InvalidArgumentsError=ie,a.InvalidEnvError=sa,a.InvalidLaunchParamsError=cr,a.Invoice=Yr,a.InvokeCustomMethodFailedError=lr,a.LaunchParamsRetrieveError=ur,a.LocationManager=es,a.MainButton=ts,a.MethodParameterUnsupportedError=ar,a.MethodUnsupportedError=or,a.MiniApp=is,a.NotAvailableError=Ir,a.Notification=as,a.Popup=us,a.QrScanner=ps,a.Refresh=ds,a.SecondaryButton=hs,a.SecureStorage=fs,a.SecureStorageMethodError=qr,a.SetEmojiStatusError=Br,a.SettingsButton=_s,a.ShareMessageError=Mr,a.StoragePermission=qs,a.SwipeBehavior=bs,a.ThemeParams=rs,a.TimeoutError=Gt,a.UnknownEnvError=Zt,a.UnknownThemeParamsKeyError=Rr,a.ValidationError=Je,a.Viewport=Es,a.addToHomeScreen=Aa,a.addToHomeScreenFp=Qr,a.applyPolyfills=xo,a.backButton=ua,a.biometry=da,a.checkHomeScreenStatus=Ma,a.checkHomeScreenStatusFp=Jr,a.closingBehavior=fa,a.cloudStorage=ba,a.copyTextToClipboard=qu,a.createLogger=Un,a.createPostEvent=Zo,a.createRequestId=_t,a.createStartParam=ta,a.createStartParamFp=Cr,a.debug=_r,a.decodeBase64Url=ea,a.decodeBase64UrlFp=nn,a.decodeStartParam=na,a.decodeStartParamFp=kr,a.deepSnakeToCamelObjKeys=Nt,a.defineHostBridge=Qo,a.deviceStorage=ga,a.downloadFile=Bu,a.downloadFileFp=ms,a.emitEvent=ct,a.encodeBase64Url=rn,a.getCurrentTime=Ru,a.getCurrentTimeFp=gs,a.getHostBridge=_,a.getReleaseVersion=tn,a.hapticFeedback=Ea,a.hideKeyboard=Lu,a.hideKeyboardFp=ws,a.hostBackButton=rc,a.hostBiometry=pc,a.hostChat=Cc,a.hostClipboard=yc,a.hostClosingBehavior=wc,a.hostCustomMethod=kc,a.hostEmojiStatus=bc,a.hostFiles=Sc,a.hostHapticFeedback=lc,a.hostHomeScreen=mc,a.hostInvoice=dc,a.hostLink=_c,a.hostLocationManager=fc,a.hostMainButton=sc,a.hostMiniApp=cc,a.hostNotification=Ec,a.hostPopup=ac,a.hostPrivacy=gc,a.hostQrScanner=hc,a.hostSecondaryButton=ic,a.hostSettingsButton=oc,a.hostSharing=Fc,a.hostSwipeBehavior=vc,a.hostThemeParams=qc,a.hostViewport=uc,a.init=Ic,a.initData=Ta,a.initFp=xs,a.invoice=La,a.invokeCustomMethod=Ur,a.isAnyRGB=Kn,a.isColorDark=bn,a.isColorDarkFp=ns,a.isRGB=ze,a.isRGBA=zn,a.isRGBAShort=Nn,a.isRGBShort=Gn,a.isSafeToCreateStartParam=ra,a.isVBma=zo,a.isVBmaFp=en,a.locationManager=Qa,a.logger=he,a.mainButton=Za,a.miniApp=os,a.mockVBotEnv=Ko,a.notification=eu,a.off=ke,a.offAll=Wo,a.on=X,a.openLink=Oa,a.openLinkFp=Xr,a.openVBotLink=Ua,a.openVBotLinkFp=hn,a.parseInitDataQuery=Ro,a.parseInitDataQueryFp=xn,a.parseLaunchParamsQuery=er,a.parseLaunchParamsQueryFp=ut,a.popup=ru,a.postEvent=Lr,a.postEventFp=qe,a.qrScanner=mu,a.readTextFromClipboard=Ou,a.readTextFromClipboardFp=vs,a.refresh=wu,a.request=ca,a.request2=la,a.request2Fp=ln,a.requestContact=du,a.requestContactComplete=pu,a.requestContactCompleteFp=wn,a.requestContactFp=cs,a.requestEmojiStatusAccess=ya,a.requestEmojiStatusAccessFp=Nr,a.requestFp=Or,a.requestPhoneAccess=ou,a.requestPhoneAccessFp=gn,a.requestWriteAccess=_u,a.requestWriteAccessFp=ls,a.retrieveAndroidDeviceData=Hu,a.retrieveAndroidDeviceDataFrom=ys,a.retrieveLaunchParams=Po,a.retrieveLaunchParamsFp=Te,a.retrieveRawInitData=Lo,a.retrieveRawInitDataFp=Yt,a.retrieveRawLaunchParams=Vo,a.retrieveRawLaunchParamsFp=Ke,a.secondaryButton=yu,a.secureStorage=Fu,a.sendData=Wu,a.sendDataFp=Ss,a.serializeInitDataQuery=nr,a.serializeLaunchParamsQuery=rr,a.setDebug=Oo,a.setEmojiStatus=Ca,a.setEmojiStatusFp=zr,a.setTargetOrigin=Ho,a.settingsButton=Cu,a.shareMessage=zu,a.shareMessageFp=Fs,a.shareStory=Ju,a.shareStoryFp=Cs,a.shareURL=Na,a.shareURLFp=xr,a.storagePermission=nc,a.supports=fe,a.swipeBehavior=Eu,a.switchInlineQuery=Xu,a.switchInlineQueryFp=ks,a.targetOrigin=br,a.themeParams=Ye,a.toRGB=Eo,a.toRGBFp=Jn,a.toRGBFull=qo,a.toRGBFullFp=at,a.viewport=ec,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),a})({});
|
|
1
|
+
var Bc=Object.defineProperty;var $c=(a,ee,Ae)=>ee in a?Bc(a,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):a[ee]=Ae;var s=(a,ee,Ae)=>$c(a,typeof ee!="symbol"?ee+"":ee,Ae);this.tmajs=this.tmajs||{};this.tmajs.sdk=(function(a){"use strict";let ee;function Ae(t,e){ee?ee.set(t,e):e()}function xe(t){if(ee)return t();ee=new Map;try{t()}finally{ee.forEach(e=>e()),ee=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 h=i;i=p,Ae(l,()=>{[...r].forEach(([f,g])=>{f(p,h),g&&c(f,!0)})})}};function u(p){const h=typeof p!="object"?{once:p}:p;return{once:h.once||!1,signal:h.signal||!1}}const c=(p,h)=>{const f=u(h),g=r.findIndex(([v,F])=>v===p&&F.once===f.once&&F.signal===f.signal);g>=0&&r.splice(g,1)},l=Object.assign(function(){return ni(l),i},{destroy(){r=[]},set:o,reset(){o(t)},sub(p,h){return r.push([p,u(h)]),()=>c(p,h)},unsub:c,unsubAll(){r=r.filter(p=>p[1].signal)}});return l}const Oe=[];function ni(t){Oe.length&&Oe[Oe.length-1].add(t)}function C(t,e){let n=new Set,r;function i(){return r||(r=D(u(),e))}function o(){i().set(u())}function u(){n.forEach(p=>{p.unsub(o,{signal:!0})});const c=new Set;let l;Oe.push(c);try{l=t()}finally{Oe.pop()}return c.forEach(p=>{p.sub(o,{signal:!0})}),n=c,l}return Object.assign(function(){return i()()},{destroy(){i().destroy()},sub(...c){return i().sub(...c)},unsub(...c){i().unsub(...c)},unsubAll(...c){i().unsubAll(...c)}})}var ri=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 si(t){return t}function yn(t,e,n,r,i,o,u,c,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 u(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return c(u(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return l(c(u(o(i(r(n(e(t.apply(this,arguments)))))))))}}}function d(t,e,n,r,i,o,u,c,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 u(o(i(r(n(e(t))))));case 8:return c(u(o(i(r(n(e(t)))))));case 9:return l(c(u(o(i(r(n(e(t))))))));default:{for(var p=arguments[0],h=1;h<arguments.length;h++)p=arguments[h](p);return p}}}var je=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,ri([i],r,!1))}}},ii={_tag:"None"},oi=function(t){return{_tag:"Some",value:t}},ai=function(t){return t._tag==="Left"},Sn=function(t){return{_tag:"Left",left:t}},Fn=function(t){return{_tag:"Right",right:t}},mt={};function ui(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 ci(t,e){return function(n){return function(r){return t.map(r,function(i){return e.map(i,n)})}}}function gt(t){return function(e,n){return function(r){return t.chain(r,function(i){return t.map(n(i),function(o){var u;return Object.assign({},i,(u={},u[e]=o,u))})})}}}var Fe=ii,Be=oi,li=function(t,e){return d(t,hi(e))},pi=function(t,e){return d(t,_i(e))},di="Option",hi=function(t){return function(e){return He(e)?Fe:Be(t(e.value))}},fi=Be,_i=function(t){return function(e){return He(e)||He(t)?Fe:Be(e.value(t.value))}},bi=je(2,function(t,e){return He(t)?Fe:e(t.value)}),mi={URI:di,map:li,ap:pi,chain:bi},He=function(t){return t._tag==="None"},gi=function(t,e){return function(n){return He(n)?t():e(n.value)}},wt=gi,wi=fi(mt),Cn=gt(mi),R=Sn,E=Fn,vt=je(2,function(t,e){return be(t)?t:e(t.right)}),yt=function(t,e){return d(t,Q(e))},kn=function(t,e){return d(t,Fi(e))},St="Either",Q=function(t){return function(e){return be(e)?e:E(t(e.right))}},vi={URI:St,map:yt},yi=E,Si=function(t){return function(e){return be(e)?e:be(t)?t:E(e.right(t.right))}},Fi=Si,Ci={URI:St,map:yt,ap:kn},ki={URI:St,map:yt,ap:kn,chain:vt},Ei=function(t,e){return function(n){return be(n)?R(t(n.left)):E(e(n.right))}},qi=function(t){return function(e){return be(e)?R(t(e.left)):e}},be=ai,Ft=function(t,e){return function(n){return be(n)?t(n.left):e(n.right)}},Ii=Ft,ue=Ft,Ai=ue,$e=function(t,e){try{return E(t())}catch(n){return R(e(n))}},Bi=yi(mt),$i=gt(ki),En=$i,Mi=vt,Ri=vt;function Ti(t){return yn(E,t.of)}function Pi(t){return yn(R,t.of)}function Li(t){return ci(t,vi)}function Vi(t){return ui(t,Ci)}function Oi(t){return function(e,n){return t.chain(e,function(r){return be(r)?t.of(r):n(r.right)})}}function ji(t){return function(e,n,r){return t.map(e,Ei(n,r))}}function Hi(t){return function(e,n){return function(r){return t.map(r,ue(e,n))}}}var Di=function(t){return $e(function(){return JSON.parse(t)},si)},Ct=function(t,e){return d(t,Ui(e))},qn=function(t,e){return d(t,Wi(e))},Ui=function(t){return function(e){return function(){return Promise.resolve().then(e).then(t)}}},Wi=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)})}}},kt=function(t){return function(){return Promise.resolve(t)}},Gi=je(2,function(t,e){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}),Et="Task",qt={URI:Et,map:Ct},In={of:kt},Ni={URI:Et,map:Ct,ap:qn},zi={URI:Et,map:Ct,of:kt,ap:qn,chain:Gi},Ki=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(u){u(o)})}return new(n||(n=Promise))(function(o,u){function c(h){try{p(r.next(h))}catch(f){u(f)}}function l(h){try{p(r.throw(h))}catch(f){u(f)}}function p(h){h.done?o(h.value):i(h.value).then(c,l)}p((r=r.apply(t,e||[])).next())})},Qi=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(p){return function(h){return l([p,h])}}function l(p){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=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(h){p=[6,h],i=0}finally{r=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},U=Pi(In),P=Ti(In),De=kt,et=Hi(qt),Ji=et,An=function(t,e){return function(){return Ki(void 0,void 0,void 0,function(){var n;return Qi(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(Fn)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Sn(e(n))];case 3:return[2]}})})}},Zi=function(t,e){return d(t,A(e))},Yi=function(t,e){return d(t,Xi(e))},A=Li(qt),Ue=je(3,ji(qt)),Xi=Vi(Ni),It=je(2,Oi(zi)),xi=P,eo="TaskEither",to={URI:eo,map:Zi,ap:Yi,chain:It},no=xi(mt),ro=gt(to),tt=ro,ne=It,ce=It;function te(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",C(this._isMounted));s(this,"mount");s(this,"unmount");this.mount=()=>{if(this.isMounted())return E(void 0);const u=te(o)?n():void 0,c=u?E(u):typeof r=="function"?r():E(r);return d(c,Q(l=>{xe(()=>{this._isMounted.set(!0),e==null||e(l)})}))},this.unmount=()=>{this._isMounted()&&xe(()=>{this._isMounted.set(!1),i==null||i()})}}}function At(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function Bt(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(),...At(e)};Bt(n,this.state())||this._state.set(n)});this._state=D(e,{equals:Bt}),this.state=C(this._state),this.state.sub(n)}getter(e){return C(()=>this._state()[e])}hasDiff(e){return!Bt({...this.state(),...At(e)},this.state())}}let le;function $t(t){return{lang:(t==null?void 0:t.lang)??(le==null?void 0:le.lang),message:t==null?void 0:t.message,abortEarly:(t==null?void 0:t.abortEarly)??(le==null?void 0:le.abortEarly),abortPipeEarly:(t==null?void 0:t.abortPipeEarly)??(le==null?void 0:le.abortPipeEarly)}}let Mt;function so(t){return Mt==null?void 0:Mt.get(t)}let Rt;function io(t){return Rt==null?void 0:Rt.get(t)}let Tt;function oo(t,e){var n;return(n=Tt==null?void 0:Tt.get(t))==null?void 0:n.get(e)}function ao(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 Z(t,e,n,r,i){const o=i&&"input"in i?i.input:n.value,u=(i==null?void 0:i.expected)??t.expects??null,c=(i==null?void 0:i.received)??ao(o),l={kind:t.kind,type:t.type,input:o,expected:u,received:c,message:`Invalid ${e}: ${u?`Expected ${u} but r`:"R"}eceived ${c}`,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",h=(i==null?void 0:i.message)??t.message??oo(t.reference,l.lang)??(p?io(l.lang):null)??r.message??so(l.lang);h!==void 0&&(l.message=typeof h=="function"?h(l):h),p&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function Y(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},$t())}}}function Bn(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function uo(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}var co=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function nt(t,e){return{kind:"validation",type:"check",reference:nt,async:!1,expects:null,requirement:t,message:e,"~run"(n,r){return n.typed&&!this.requirement(n.value)&&Z(this,"input",n,r),n}}}function Pt(t){return{kind:"validation",type:"integer",reference:Pt,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&Z(this,"integer",e,n),e}}}function pe(t){return{kind:"transformation",type:"transform",reference:pe,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function lo(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Lt(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Vt(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 Y(this)},"~run"(t){return t.typed=!0,t}}}function Mn(t,e){return{kind:"schema",type:"array",reference:Mn,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return Y(this)},"~run"(n,r){var o;const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let u=0;u<i.length;u++){const c=i[u],l=this.item["~run"]({value:c},r);if(l.issues){const p={type:"array",origin:"value",input:i,key:u,value:c};for(const h of l.issues)h.path?h.path.unshift(p):h.path=[p],(o=n.issues)==null||o.push(h);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}}else Z(this,"type",n,r);return n}}}function Ce(t){return{kind:"schema",type:"boolean",reference:Ce,expects:"boolean",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:Z(this,"type",e,n),e}}}function rt(t){return{kind:"schema",type:"date",reference:rt,expects:"Date",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return e.value instanceof Date?isNaN(e.value)?Z(this,"type",e,n,{received:'"Invalid Date"'}):e.typed=!0:Z(this,"type",e,n),e}}}function Ot(t){return{kind:"schema",type:"function",reference:Ot,expects:"Function",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="function"?e.typed=!0:Z(this,"type",e,n),e}}}function jt(t,e){return{kind:"schema",type:"instance",reference:jt,expects:t.name,async:!1,class:t,message:e,get"~standard"(){return Y(this)},"~run"(n,r){return n.value instanceof this.class?n.typed=!0:Z(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 Y(this)},"~run"(n,r){var o;const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const u in this.entries){const c=this.entries[u];if(u in i||(c.type==="exact_optional"||c.type==="optional"||c.type==="nullish")&&c.default!==void 0){const l=u in i?i[u]:Lt(c),p=c["~run"]({value:l},r);if(p.issues){const h={type:"object",origin:"value",input:i,key:u,value:l};for(const f of p.issues)f.path?f.path.unshift(h):f.path=[h],(o=n.issues)==null||o.push(f);if(n.issues||(n.issues=p.issues),r.abortEarly){n.typed=!1;break}}p.typed||(n.typed=!1),n.value[u]=p.value}else if(c.fallback!==void 0)n.value[u]=lo(c);else if(c.type!=="exact_optional"&&c.type!=="optional"&&c.type!=="nullish"&&(Z(this,"key",n,r,{input:void 0,expected:`"${u}"`,path:[{type:"object",origin:"key",input:i,key:u,value:i[u]}]}),r.abortEarly))break}if(!n.issues||!r.abortEarly)for(const u in i)Bn(i,u)&&!(u in this.entries)&&(n.value[u]=i[u])}else Z(this,"type",n,r);return n}}}function Me(t,e){return{kind:"schema",type:"nullish",reference:Me,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Y(this)},"~run"(n,r){return(n.value===null||n.value===void 0)&&(this.default!==void 0&&(n.value=Lt(this,n,r)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function ge(t){return{kind:"schema",type:"number",reference:ge,expects:"number",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Z(this,"type",e,n),e}}}function B(t,e){return{kind:"schema",type:"optional",reference:B,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Y(this)},"~run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=Lt(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function Ht(t,e,n){return{kind:"schema",type:"record",reference:Ht,expects:"Object",async:!1,key:t,value:e,message:n,get"~standard"(){return Y(this)},"~run"(r,i){var u,c;const o=r.value;if(o&&typeof o=="object"){r.typed=!0,r.value={};for(const l in o)if(Bn(o,l)){const p=o[l],h=this.key["~run"]({value:l},i);if(h.issues){const g={type:"object",origin:"key",input:o,key:l,value:p};for(const v of h.issues)v.path=[g],(u=r.issues)==null||u.push(v);if(r.issues||(r.issues=h.issues),i.abortEarly){r.typed=!1;break}}const f=this.value["~run"]({value:p},i);if(f.issues){const g={type:"object",origin:"value",input:o,key:l,value:p};for(const v of f.issues)v.path?v.path.unshift(g):v.path=[g],(c=r.issues)==null||c.push(v);if(r.issues||(r.issues=f.issues),i.abortEarly){r.typed=!1;break}}(!h.typed||!f.typed)&&(r.typed=!1),h.typed&&(r.value[h.value]=f.value)}}else Z(this,"type",r,i);return r}}}function S(t){return{kind:"schema",type:"string",reference:S,expects:"string",async:!1,message:t,get"~standard"(){return Y(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:Z(this,"type",e,n),e}}}function Rn(t){let e;if(t)for(const n of t)e?e.push(...n.issues):e=n.issues;return e}function st(t,e){return{kind:"schema",type:"union",reference:st,expects:uo(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Y(this)},"~run"(n,r){let i,o,u;for(const c of this.options){const l=c["~run"]({value:n.value},r);if(l.typed)if(l.issues)o?o.push(l):o=[l];else{i=l;break}else u?u.push(l):u=[l]}if(i)return i;if(o){if(o.length===1)return o[0];Z(this,"type",n,r,{issues:Rn(o)}),n.typed=!0}else{if((u==null?void 0:u.length)===1)return u[0];Z(this,"type",n,r,{issues:Rn(u)})}return n}}}function Dt(){return{kind:"schema",type:"unknown",reference:Dt,expects:"unknown",async:!1,get"~standard"(){return Y(this)},"~run"(t){return t.typed=!0,t}}}function we(t,e,n){const r=t["~run"]({value:e},$t(n));if(r.issues)throw new co(r.issues);return r.value}function ae(...t){return{...t[0],pipe:t,get"~standard"(){return Y(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 Ut(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 po=Object.defineProperty,ho=(t,e,n)=>e in t?po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Tn=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n),fo=Object.defineProperty,_o=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Wt=(t,e,n)=>_o(t,typeof e!="symbol"?e+"":e,n);function Pn(t){return e=>e instanceof t}function Ln(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}};Wt(n,"is",Pn(n));let r=n;return Object.defineProperty(r,"name",{value:t}),r}function bo(t,e,n){const r=class extends Ln(t,n){constructor(...o){super(...o),Wt(this,"data"),this.data=e(...o)}};Wt(r,"is",Pn(r));let i=r;return Object.defineProperty(i,"name",{value:t}),i}let Vn=class extends Ln("CancelledError","Promise was canceled"){},Gt=class extends bo("TimeoutError",e=>({timeout:e}),(e,n)=>[`Timeout reached: ${e}ms`,{cause:n}]){};const mo=Symbol("resolved");function go(t){return{tag:mo,value:t}}function On(t,e){return t.reject=e.reject,t.resolve=e.resolve,t}class ve extends Promise{constructor(e,n){let r,i,o,u;typeof e=="function"?(o=e,u=n||{}):u=e||{};let c,l;const p=()=>!!l,h=()=>!!c;let f={};const g=[],v=()=>{g.forEach(w=>w()),g.splice(0,g.length),f={}},F=new AbortController,k=()=>h()||p();super((w,y)=>{const{abortOnResolve:m=!0,abortOnReject:j=!0}=u;i=I=>{var O,L;k()||(w(I),c=[I],(O=f.resolved)==null||O.forEach(N=>N(I)),(L=f.finalized)==null||L.forEach(N=>N({kind:"resolved",result:I})),v(),m&&F.abort(go(I)))},r=I=>{var O,L;k()||(y(I),l=[I],(O=f.rejected)==null||O.forEach(N=>N(I)),(L=f.finalized)==null||L.forEach(N=>N({kind:"rejected",reason:I})),v(),j&&F.abort(I))};const{abortSignal:H}=u;if(H){if(H.aborted)return r(H.reason);const I=()=>{r(H.reason)};H.addEventListener("abort",I,!0),g.push(()=>{H.removeEventListener("abort",I,!0)})}const{timeout:W}=u;if(W){const I=setTimeout(()=>{r(new Gt(W))},W);g.push(()=>{clearTimeout(I)})}try{const I=()=>{},O=o&&o(i,r,{abortSignal:F.signal,get isRejected(){return p()},get isResolved(){return h()},on(L,N){if(c||l){if(L==="finalized"){const Ve=c?{kind:"resolved",result:c[0]}:{kind:"rejected",reason:l[0]};N(Ve)}else L==="resolved"&&c?N(c[0]):L==="rejected"&&l&&N(l[0]);return I}return f[L]||(f[L]=[]),f[L].push(N),()=>{const Ve=f[L]||[],Xe=Ve.indexOf(N);Xe>=0&&Ve.splice(Xe,1)}},get result(){return c==null?void 0:c[0]},get rejectReason(){return l==null?void 0:l[0]},throwIfRejected(){if(l)throw l[0]}});O instanceof Promise&&O.catch(r)}catch(I){r(I)}}),Tn(this,"reject"),Tn(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(u){i(u)}},n)}static resolve(e){return this.fn(()=>e)}static reject(e){return new ve((n,r)=>{r(e)})}cancel(){this.reject(new Vn)}catch(e){return this.then(void 0,e)}finally(e){return On(super.finally(e),this)}then(e,n){return On(super.then(e,n),this)}}function jn(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function wo(t){return t.replace(/_[a-z]/g,e=>e[1].toUpperCase())}function vo(t){return Object.entries(t).reduce((e,[n,r])=>(e[wo(n)]=r,e),{})}function Nt(t){const e=vo(t);for(const n in e){const r=e[n];r&&typeof r=="object"&&!(r instanceof Date)&&(e[n]=Array.isArray(r)?r.map(Nt):Nt(r))}return e}function yo(t){return t.replace(/_([a-z])/g,(e,n)=>`-${n.toLowerCase()}`)}function Hn(t){return`tapps/${t}`}function zt(t,e){sessionStorage.setItem(Hn(t),JSON.stringify(e))}function Dn(t){const e=sessionStorage.getItem(Hn(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 Un(t,e){e||(e={});const{textColor:n,bgColor:r,shouldLog:i}=e,o=i===void 0?!0:i,u=typeof o=="boolean"?()=>o:o,c=(l,p,...h)=>{if(p||u()){const f="font-weight:bold;padding:0 5px;border-radius:100px",[g,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}`,`${f};background-color:${g};color:${v}`,"",`${f};${n?`color:${n};`:""}${r?`background-color:${r}`:""}`,...h)}};return[["log","forceLog"],["warn","forceWarn"],["error","forceError"]].reduce((l,[p,h])=>(l[p]=c.bind(void 0,p,!1),l[h]=c.bind(void 0,p,!0),l),{})}function Ne(t){const e=n=>{throw n};return typeof t=="function"?ve.resolve(d(t,et(e,n=>n))()):d(t,ue(e,n=>n))}function re(t){return Object.assign((...e)=>Ne(t(...e)),t)}const Re=Object.assign((t,e)=>d(An(()=>new ve((n,r,i)=>t(o=>n(E(o)),o=>n(R(o)),i),e),n=>n),ce(ue(U,P))),{fn:(t,e)=>Re((n,r,i)=>{const o=t(i);d(typeof o=="function"?o:De(o),Ji(r,n))()},e)});var So=Object.defineProperty,Fo=(t,e,n)=>e in t?So(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Kt=(t,e,n)=>Fo(t,typeof e!="symbol"?e+"":e,n);function Wn(t){return e=>e instanceof t}function K(t,e){const n=class extends Error{constructor(...o){const u=typeof e=="function"?e(...o):typeof e=="string"?[e]:e||[];super(...u),this.name=t}};Kt(n,"is",Wn(n));let r=n;return Object.defineProperty(r,"name",{value:t}),r}function it(t,e,n){const r=class extends K(t,n){constructor(...u){super(...u),Kt(this,"data"),this.data=e(...u)}};Kt(r,"is",Wn(r));let i=r;return Object.defineProperty(i,"name",{value:t}),i}function Co(t){const e=n=>{const r={};return new URLSearchParams(n).forEach((i,o)=>{const u=r[o];Array.isArray(u)?u.push(i):u===void 0?r[o]=i:r[o]=[u,i]}),we(t,r)};return ae(st([S(),jt(URLSearchParams)]),nt(n=>{try{return e(n),!0}catch{return!1}},"The value doesn't match required schema"),pe(e))}function ko(t){return ae(S(),nt(e=>{try{return JSON.parse(e),!0}catch{return!1}},"Input is not a valid JSON value"),pe(JSON.parse),t)}function de(t){return ae(S(),ko(t))}function Qt(t){return ae(st([S(),jt(URLSearchParams)]),Co(t))}function ot(t){return e=>t.test(e)}const Gn=ot(/^#[\da-f]{3}$/i),Nn=ot(/^#[\da-f]{4}$/i),ze=ot(/^#[\da-f]{6}$/i),zn=ot(/^#[\da-f]{8}$/i);function Kn(t){return[ze,zn,Gn,Nn].some(e=>e(t))}function Qn(t){let e="#";for(let n=0;n<t.length-1;n+=1)e+=t[1+n].repeat(2);return e}function at(t){const e=t.replace(/\s/g,"").toLowerCase();if(/^#[\da-f]{3}$/i.test(e))return E(Qn(e.toLowerCase()+"f"));if(/^#[\da-f]{4}$/i.test(e))return E(Qn(e.toLowerCase()));if(/^#[\da-f]{6}$/i.test(e))return E(e.toLowerCase()+"ff");if(/^#[\da-f]{8}$/i.test(e))return E(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?E(n.slice(1).reduce((r,i)=>r+parseInt(i,10).toString(16).padStart(2,"0"),"#").padEnd(9,"f")):R(new Error(`Value "${t}" does not satisfy any of known RGB formats.`))}function Jn(t){return d(at(t),Q(e=>e.slice(0,7)))}const Eo=re(Jn),qo=re(at);function Io(){return G({id:ge(),photo_url:B(S()),type:S(),title:S(),username:B(S())})}function Zn(){return G({added_to_attachment_menu:B(Ce()),allows_write_to_pm:B(Ce()),first_name:S(),id:ge(),is_bot:B(Ce()),is_premium:B(Ce()),last_name:B(S()),language_code:B(S()),photo_url:B(S()),username:B(S())})}function Ao(){return G({projectCode:S(),uid:S(),sessionId:S(),rootToken:S()})}function Bo(){return G({auth_date:ae(S(),pe(t=>new Date(Number(t)*1e3)),rt()),can_send_after:B(ae(S(),pe(Number),Pt())),chat:B(de(Io())),chat_type:B(S()),chat_instance:B(S()),hash:B(S()),query_id:B(S()),receiver:B(de(Zn())),start_param:B(S()),signature:B(S()),user:B(de(Zn())),auth:B(de(Ao()))})}function Yn(){return Qt(Bo())}function Jt(){return Ht(S(),ae(st([S(),ge()]),pe(t=>typeof t=="number"?`#${(t&16777215).toString(16).padStart(6,"0")}`:t),nt(Kn)))}function $o(){const t=B(ae(S(),pe(e=>e==="1")));return G({vbWebAppBotInline:t,vbWebAppData:B(Yn()),vbWebAppDefaultColors:B(de(Jt())),vbWebAppFullscreen:t,vbWebAppPlatform:S(),vbWebAppShowSettings:t,vbWebAppStartParam:B(S()),vbWebAppThemeParams:de(Jt()),vbWebAppVersion:S()})}function Mo(){return Qt($o())}function Xn(){return G({eventType:S(),eventData:B(Dt())})}function xn(t){return $e(()=>we(Yn(),t),e=>e)}function ut(t){return $e(()=>we(Mo(),t),e=>e)}const Ro=re(xn),er=re(ut);function tr(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 nr(t){return tr(t)}function rr(t){return tr(t,(e,n)=>e==="vbWebAppData"?nr(n):JSON.stringify(n))}function To(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 sr(t){return Vt(G({VBotWebviewProxy:G({postEvent:Ot()})}),t)}function ir(){try{return window.self!==window.top}catch{return!0}}class or extends K("MethodUnsupportedError",(e,n)=>[`Method "${e}" is unsupported in Mini Apps version ${n}`]){}class ar extends K("MethodParameterUnsupportedError",(e,n,r)=>[`Parameter "${n}" of "${e}" method is unsupported in Mini Apps version ${r}`]){}class ur extends it("LaunchParamsRetrieveError",e=>({errors:e}),e=>[["Unable to retrieve launch parameters from any known source. You should pass correct parameters to Mini App","","Collected errors:",...e.map(({source:n,error:r})=>`Source: ${n} / ${r instanceof Error?r.message:String(r)}`)].join(`
|
|
2
|
+
`)]){}class cr extends K("InvalidLaunchParamsError",(e,n)=>[`Invalid value for launch params: ${e}`,{cause:n}]){}class Zt extends K("UnknownEnvError"){}class lr extends K("InvokeCustomMethodError",e=>[`Server returned error: ${e}`]){}const pr="launchParams";function dr(t){return t.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}function Te(){return d(Ke(),Mi(ut))}const Po=re(Te);function Yt(){return d(Ke(),Q(t=>{const e=new URLSearchParams(t).get("vbWebAppData");return e?Be(e):Fe}))}function Lo(){return d(Yt(),Ai(t=>{throw t},t=>t),wt(()=>{},t=>t))}function Ke(){const t=[];for(const[e,n]of[[()=>dr(window.location.href),"window.location.href"],[()=>{const r=performance.getEntriesByType("navigation")[0];return r&&dr(r.name)},"performance navigation entries"],[()=>Dn(pr),"local storage"]]){const r=e();if(!r){t.push({source:n,error:new Error("Source is empty")});continue}const i=d(ut(r),Ii(o=>o,()=>!0));if(typeof i!="boolean"){t.push({source:n,error:i});continue}return zt(pr,r),E(r)}return R(new ur(t))}const Vo=re(Ke);function hr(t,e){const n=new Map,r=To(),i=(o,u,c=!1)=>{const l=n.get(o)||new Map;n.set(o,l);const p=l.get(u)||[];l.set(u,p);const h=p.findIndex(f=>f[1]===c);if(h>=0&&(r.off(o,p[h][0]),p.splice(h,1),!p.length&&(l.delete(u),!l.size))){const f=n.size;n.delete(o),f&&!n.size&&e()}};return{on(o,u,c){!n.size&&t();const l=()=>{i(o,u,c)},p=(...g)=>{c&&l(),o==="*"?u({name:g[0],payload:g[1]}):u(...g)};r.on(o,p);const h=n.get(o)||new Map;n.set(o,h);const f=h.get(u)||[];return h.set(u,f),f.push([p,c||!1]),l},off:i,emit:r.emit,clear(){const o=n.size;r.all.clear(),n.clear(),o&&e()}}}function ct(t,e){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:t,eventData:e}),source:window.parent}))}const Xt=D(!1),fr=D("https://web.telegram.org"),Oo=t=>{he().log("Event received:",t)},_r=C(Xt);function jo(t){t!==Xt()&&(Xt.set(t),(t?X:ke)("*",Oo))}const br=C(fr);function Ho(t){fr.set(t),he().log("New target origin set",t)}const lt=D((...t)=>{window.parent.postMessage(...t)}),he=D(Un("Bridge",{bgColor:"#9147ff",textColor:"white",shouldLog:_r}));function xt(t,e,n){const r=[n],i=t[e];typeof i=="function"&&r.push(i);const o=(...c)=>{r.forEach(l=>l(...c))},u=Object.assign((...c)=>{o(...c)},{unwrap(){const{length:c}=r;if(c===1){delete t[e];return}if(c===2){wr(t,e,r[1]);return}r.unshift(1),wr(t,e,o)}});gr(t,e,()=>u,c=>r.push(c))}function mr(t,e){const n=t[e];gr(t,e,()=>n,r=>{Object.entries(r).forEach(([i,o])=>{n[i]=o})})}function gr(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:n,set:r})}function wr(t,e,n){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n})}const Do={clipboard_text_received:G({req_id:S(),data:Me(S())}),custom_method_invoked:G({req_id:S(),result:B(Dt()),error:B(S())}),popup_closed:Me(G({button_id:Me(S(),()=>{})}),{}),viewport_changed:Me(G({height:ge(),width:Me(ge(),()=>window.innerWidth),is_state_stable:Ce(),is_expanded:Ce()}),()=>({height:window.innerHeight,is_state_stable:!0,is_expanded:!0})),theme_changed:G({theme_params:Jt()})};function vr(t){if(t.source!==window.parent)return;let e;try{e=we(de(Xn()),t.data)}catch{return}const{eventType:n,eventData:r}=e,i=Do[n];let o;try{o=i?we(i,r):r}catch(u){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,u)}Uo(n,o)}const{on:X,off:ke,emit:Uo,clear:Wo}=hr(()=>{const t=window;!t.TelegramGameProxy&&(t.TelegramGameProxy={}),xt(t.TelegramGameProxy,"receiveEvent",ct),mr(t,"TelegramGameProxy"),!t.VBot&&(t.VBot={}),!t.VBot.WebView&&(t.VBot.WebView={}),xt(t.VBot.WebView,"receiveEvent",ct),mr(t.VBot,"WebView"),xt(t,"TelegramGameProxy_receiveEvent",ct),window.addEventListener("message",vr)},()=>{[["TelegramGameProxy_receiveEvent"],["TelegramGameProxy","receiveEvent"],["VBot","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",vr)}),Go=(...t)=>lt()(...t);function No(t,e){d(Pe(t,e),qi(n=>{throw n}))}function Pe(t,e){he().log("Posting event:",e?{eventType:t,eventData:e}:{eventType:t});const n=window,r=JSON.stringify({eventType:t,eventData:e});return ir()?(Go(r,br()),E(void 0)):sr(n)?(n.VBotWebviewProxy.postEvent(t,JSON.stringify(e)),E(void 0)):Vt(G({external:G({notify:Ot()})}),n)?(n.external.notify(r),E(void 0)):R(new Zt)}function pt(t,e,n={}){const{capture:r=()=>!0,postEvent:i=Pe}=n,o=D(),[u,c]=Ge();(Array.isArray(e)?e:[e]).forEach(p=>{u(X(p,h=>{const f=Array.isArray(e);r(f?{event:p,payload:h}:h)&&o.set([f?{event:p,payload:h}:h])}))});const l=p=>(c(),p);return d(async()=>i(t,n.params),ce(()=>Re((p,h,f)=>{const g=o();if(g)return p(g[0]);const v=k=>{k&&p(k[0])},F=()=>{o.unsub(v)};o.sub(v),f.on("finalized",F)},n)),Ue(l,l))}function zo(t,e){const n=en(t,e);return typeof n=="function"?ve.fn(()=>Ne(n)):n}function en(t,e){const n=sr(window);if(!t)return n||d(Ke(),ue(()=>!1,()=>!0));if(n)return P(!0);const{timeout:r=100}=e||{};return d(pt("web_app_request_theme","theme_changed",{...e,timeout:r}),et(i=>Gt.is(i)||Zt.is(i)?E(!1):R(i),()=>E(!0)))}function Ko({launchParams:t,onEvent:e,resetPostMessage:n}={}){if(t){const o=typeof t=="string"||t instanceof URLSearchParams?t.toString():rr({...t,vbWebAppData:void 0})+(t.vbWebAppData?`&vbWebAppData=${encodeURIComponent(t.vbWebAppData.toString())}`:"");try{er(o)}catch(u){throw new cr(o,u)}zt("launchParams",o)}if(ir()){if(!e)return;n&<.reset();const o=lt();lt.set((...u)=>{const[c]=u,l=()=>{o(...u)};try{const p=we(de(Xn()),c);e({name:p.eventType,params:p.eventData},l)}catch{l()}});return}const r=window.VBotWebviewProxy||{},i=r.postEvent||(()=>{});window.VBotWebviewProxy={...r,postEvent(o,u){const c=()=>{i(o,u)};e?e({name:o,params:u?JSON.parse(u):void 0},c):c()}},he().log("Environment was mocked by the mockVBotEnv function")}function Qo(t,e="*"){const n=o=>{if(o.source===t.contentWindow)try{const u=JSON.parse(o.data),{eventType:c,eventData:l}=u;r.emit(c,l)}catch{}},r=hr(()=>{window.addEventListener("message",n)},()=>{window.removeEventListener("message",n)}),i={...r,send:(o,u)=>{if(t.contentWindow){const c=JSON.stringify({eventType:o,eventData:u});t.contentWindow.postMessage(c,e)}},clear:()=>{r.clear(),Qe===i&&(Qe=void 0)}};return Qe=i,i}let Qe;function _(){if(!Qe)throw new Error("HostBridge not initialized. Call defineHostBridge() first.");return Qe}function yr(t){return({req_id:e})=>e===t}const Sr={"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 tn(t,e){return Object.keys(Sr).find(n=>Sr[n].some(r=>e?typeof r=="object"&&r.method===t&&r.param===e:r===t))||null}function Fr(t){return t.split(".").map(Number)}function Jo(t,e){const n=Fr(t),r=Fr(e),i=Math.max(n.length,r.length);for(let o=0;o<i;o+=1){const u=n[o]||0,c=r[o]||0;if(u!==c)return u>c?1:-1}return 0}function fe(t,e,n){const r=n?tn(t,e):tn(t);return r?Jo(r,n||e)<=0:!1}function Zo(t,e="strict"){const n=typeof e=="function"?e:r=>{const{method:i,version:o}=r,u="param"in r?new ar(i,r.param,o):new or(i,o);if(e==="strict")throw u;return he().forceWarn(u.message)};return((r,i)=>fe(r,t)?r==="web_app_set_header_color"&&Vt(G({color:$n()}),i)&&!fe(r,"color",t)?n({version:t,method:r,param:"color"}):No(r,i):n({version:t,method:r}))}function Yo(t,e,n,r){return d(pt("web_app_invoke_custom_method","custom_method_invoked",{...r||{},params:{method:t,params:e,req_id:n},capture:yr(n)}),ne(({result:i,error:o})=>o?U(new lr(o)):P(i)))}function Xo(t,e,n={}){const{capture:r=()=>!0,postEvent:i=Pe}=n,o=D(),[u,c]=Ge();(Array.isArray(e)?e:[e]).forEach(p=>{u(X(p,h=>{(Array.isArray(e)?r({event:p,payload:h}):r(h))&&o.set([h])}))});const l=p=>(c(),p);return d(async()=>i(t,n.params),ce(()=>Re((p,h,f)=>{const g=o();if(g)return p(g[0]);const v=k=>{k&&p(k[0])},F=()=>{o.unsub(v)};o.sub(v),f.on("finalized",F)},n)),Ue(l,l))}function xo(){Object.hasOwn||(Object.hasOwn=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)})}function nn(t){return $e(()=>decodeURIComponent(atob(t.replace(/-/g,"+").replace(/_/g,"/")).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),e=>e)}const ea=re(nn);function rn(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,n)=>String.fromCharCode(parseInt(`0x${n}`)))).replace(/\+/g,"-").replace(/\//g,"_")}function Cr(t){const e=rn(typeof t=="string"?t:JSON.stringify(t));return e.length>512?R(new Error("Value is too long for start parameter")):E(e)}const ta=re(Cr);function na(t,e){return Ne(kr(t,typeof e=="function"?n=>$e(()=>e(n),r=>r):e))}function kr(t,e){return d(nn(t),Ri(n=>e?typeof e=="function"?e(n):Di(n):E(n)))}function ra(t){return rn(t).length<=512}function se(t,e){return C(()=>fe(t,te(e)))}function b(t){return Object.assign(re(t),{ifAvailable(...e){return d(t.ifAvailable(...e),wt(()=>({ok:!1}),n=>({ok:!0,data:Ne(n)})))}})}function Ee(t){return[t]}class Je extends it("ValidationError",(e,n)=>({input:e,issues:n}),"Validation error"){}class dt extends K("CSSVarsBoundError","CSS variables are already bound"){}class Er extends it("DeviceStorageMethodError",e=>({error:e}),e=>[e]){}class qr extends it("SecureStorageMethodError",e=>({error:e}),e=>[e]){}class Ir extends K("NotAvailableError",Ee){}class sa extends K("InvalidEnvError",Ee){}class Ar extends K("FunctionNotAvailableError",Ee){}class ie extends K("InvalidArgumentsError",(e,n)=>[e,{cause:n}]){}class ht extends K("ConcurrentCallError",Ee){}class Br extends K("SetEmojiStatusError",e=>[`Failed to set emoji status: ${e}`]){}class sn extends K("AccessDeniedError",Ee){}class $r extends K("FullscreenFailedError",Ee){}class Mr extends K("ShareMessageError",Ee){}class Rr extends K("UnknownThemeParamsKeyError",e=>[`Unknown theme params key passed: ${e}`]){}function V(t,e){const n=C(()=>te(e.version)||"100"),r=C(()=>te(e.isVBma)),{requires:i,returns:o}=e,u=i?typeof i=="object"?i:{every:[i]}:void 0,c=w=>{if(!e.supports)return!0;const y=e.supports[w];return fe(y.method,y.param,n())},l=()=>{if(!u)return;const[w,y]="every"in u?["every",u.every]:["some",u.some];for(let m=0;m<y.length;m++){const j=y[m],H=typeof j=="function"?j():fe(j,n())?void 0:`it is unsupported in Mini Apps version ${n()}`;if(H&&(w==="every"||m===y.length-1))return H}},p=(...w)=>{for(const y in e.supports)if(e.supports[y].shouldCheck(...w)&&!c(y))return`option ${y} is not supported in Mini Apps version ${n()}`},h=C(()=>!l()),f=C(()=>n()!=="0.0"),g=C(()=>e.isMounted?e.isMounted():!0),v=C(()=>r()&&f()&&h()&&g()),F=w=>{const y=new Ar(w);return["task","promise"].includes(e.returns)?U(y):R(y)},k=(...w)=>o==="plain"?$e(()=>t(...w),y=>y):o==="promise"?An(()=>t(...w),y=>y):t(...w);return Object.assign((...w)=>{var H;const y="Unable to call function:";if(!r())return F(`${y} it can't be called outside Mini Apps`);if(!f())return F(`${y} the SDK was not initialized. Use the SDK init() function`);const m=l();if(m)return F(`${y} ${m}`);const j=p(...w);if(j)return F(`${y} ${j}`);if(!g()){const W=(H=e.isMounting)!=null&&H.call(e)?"mounting. Wait for the mount completion":"unmounted. Use the mount() method";return F(`${y} the component is ${W}`)}return k(...w)},t,{isAvailable:v,ifAvailable(...w){return v()?Be(k(...w)):Fe}},u?{isSupported:h}:{},e.supports?{supports:c}:{})}function M(t){return e=>V(e,t)}class ft{constructor({isVBma:e,storage:n,onClick:r,offClick:i,initialState:o,isPageReload:u,postEvent:c,payload:l,method:p,version:h}){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 f=new me({initialState:o,onChange(w){n.set(w)}}),g=new We({initialState:o,isPageReload:u,onMounted:f.setState,restoreState:n.get}),v={version:h,requires:p,isVBma:e},F=M({...v,returns:"plain"}),k=M({...v,returns:"either",isMounted:g.isMounted});this.isMounted=g.isMounted,this.isSupported=se(p,h),this.state=f.state,this.setStateFp=k(w=>{const y={...this.state(),...At(w)};return f.hasDiff(y)?d(c(p,l(y)),Q(()=>{f.setState(y)})):E(void 0)}),this.setState=b(this.setStateFp),this.onClickFp=F(r),this.onClick=b(this.onClickFp),this.offClickFp=F(i),this.offClick=b(this.offClickFp),this.mountFp=F(()=>{const w=()=>{};return d(g.mount(),ue(w,w))}),this.mount=b(this.mountFp),this.unmount=g.unmount,this.stateSetters=w=>{const y=k(m=>this.setStateFp({[w]:m}));return[b(y),y]},this.stateBoolSetters=w=>{const[,y]=this.stateSetters(w),m=k(()=>y(!1)),j=k(()=>y(!0));return[[b(m),m],[b(j),j]]}}stateGetter(e){return C(()=>this.state()[e])}}class Tr{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 ft({...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 q(){return{isVBma:C(()=>en())}}function Le(t){return e=>({...e,...te(t)})}function Ze(t,e){return D(t,e)}const Pr=Ze(Pe),qe=(...t)=>Pr()(...t),Lr=(...t)=>Ne(qe(...t)),J=Le({postEvent:qe});function ia(t){return{get:()=>Dn(t),set(e){zt(t,e)}}}function oa(){return performance.getEntriesByType("navigation")[0]}function aa(){const t=oa();return!!t&&t.type==="reload"}function ye(t){return Le({storage:ia(t),isPageReload:aa})}const on=Ze("0.0"),$=Le({version:on});function an(t,e){return{...d(q(),J,$,ye(t)),onClick(n,r){return X(e,n,r)},offClick(n,r){ke(e,n,r)}}}const ua=new Tr(an("backButton","back_button_pressed"));class un{constructor({initialState:e,onMounted:n,restoreState:r,onUnmounted:i,isPageReload:o}){s(this,"_isMounted",D(!1));s(this,"isMounted",C(this._isMounted));s(this,"mount");s(this,"unmount");this.mount=u=>{if(this._isMounted())return P(void 0);const c=te(o)?r():void 0;return d(c?P(c):e(u),A(l=>{this._isMounted()||xe(()=>{this._isMounted.set(!0),n==null||n(l)})}))},this.unmount=()=>{this._isMounted()&&xe(()=>{this._isMounted.set(!1),i==null||i()})}}}function Vr(){return new Ir("Biometry is not available")}function cn(t){let e=!1,n=!1,r="",i=!1,o="",u=!1;return t.available&&(e=!0,n=t.token_saved,r=t.device_id,i=t.access_requested,o=t.type,u=t.access_granted),{available:e,tokenSaved:n,deviceId:r,type:o,accessGranted:u,accessRequested:i}}class Or{constructor({version:e,request:n,postEvent:r,storage:i,onInfoReceived:o,offInfoReceived:u,isVBma:c,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=w=>{h.setState(cn(w))},h=new me({initialState:{available:!1,type:"unknown",accessGranted:!1,accessRequested:!1,deviceId:"",tokenSaved:!1},onChange:i.set}),f=new un({initialState(w){return d(n("web_app_biometry_get_info","biometry_info_received",w),A(cn))},isPageReload:l,onMounted(w){h.setState(w),o(p)},onUnmounted(){u(p)},restoreState:i.get}),g={version:e,requires:"web_app_biometry_request_auth",isVBma:c},v=M({...g,returns:"either"}),F=M({...g,returns:"task"}),k=M({...g,isMounted:f.isMounted,returns:"task"});this.isAvailable=h.getter("available"),this.isMounted=f.isMounted,this.isSupported=se("web_app_biometry_request_auth",e),this.state=h.state,this.unmount=f.unmount,this.mountFp=F(f.mount),this.authenticateFp=k(w=>this.isAvailable()?d(n("web_app_biometry_request_auth","biometry_auth_requested",{...w,params:{reason:((w||{}).reason||"").trim()}}),A(y=>(h.setState({token:y.token}),y))):U(Vr())),this.openSettingsFp=v(()=>r("web_app_biometry_open_settings")),this.requestAccessFp=k(w=>d(n("web_app_biometry_request_access","biometry_info_received",{...w,params:{reason:((w||{}).reason||"").trim()}}),ne(y=>{const m=cn(y);return m.available?(h.setState(m),P(m.accessRequested)):U(Vr())}))),this.updateTokenFp=k((w={})=>{var y;return d(n("web_app_biometry_update_token","biometry_token_updated",{...w,params:{token:w.token||"",reason:(y=w.reason)==null?void 0:y.trim()}}),A(m=>m.status))}),this.authenticate=b(this.authenticateFp),this.openSettings=b(this.openSettingsFp),this.requestAccess=b(this.requestAccessFp),this.updateToken=b(this.updateTokenFp),this.mount=b(this.mountFp)}}const jr=(t,e,n)=>Xo(t,e,{postEvent:qe,...n}),ln=(t,e,n)=>pt(t,e,{postEvent:qe,...n}),ca=(...t)=>ve.fn(()=>jr(...t)()),la=(...t)=>ve.fn(()=>ln(...t)()),x=Le({request:ln});function pa(){return new Or({...d(q(),J,$,x,ye("biometry")),offInfoReceived(t){ke("biometry_info_received",t)},onInfoReceived(t){return X("biometry_info_received",t)}})}const da=pa();class Hr{constructor({postEvent:e,storage:n,isVBma: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(f){n.set(f)}}),u=new We({onMounted:o.setState,restoreState:n.get,initialState:{isConfirmationEnabled:!1},isPageReload:i}),c={requires:"web_app_setup_closing_behavior",isVBma:r},l=M({...c,returns:"plain"}),p=M({...c,returns:"either",isMounted:u.isMounted}),h=f=>f===this.isConfirmationEnabled()?E(void 0):(o.setState({isConfirmationEnabled:f}),e("web_app_setup_closing_behavior",{need_confirmation:f}));this.isConfirmationEnabled=o.getter("isConfirmationEnabled"),this.isMounted=u.isMounted,this.disableConfirmationFp=p(()=>h(!1)),this.enableConfirmationFp=p(()=>h(!0)),this.mountFp=l(()=>{const f=()=>{};return d(u.mount(),ue(f,f))}),this.unmount=u.unmount,this.disableConfirmation=b(this.disableConfirmationFp),this.enableConfirmation=b(this.enableConfirmationFp),this.mount=b(this.mountFp)}}function ha(){return new Hr(d(q(),ye("closingBehavior"),J))}const fa=ha();class Dr{constructor({version:e,isVBma: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=M({version:e,requires:"web_app_invoke_custom_method",isVBma:n,returns:"task"});this.isSupported=se("web_app_invoke_custom_method",e),this.deleteItemFp=i((o,u)=>{const c=Array.isArray(o)?o:[o];return d(c.length?r("deleteStorageValues",{keys:c},u):P(void 0),A(()=>{}))}),this.getItemFp=i((o,u)=>d(this.getItemsFp([o],u),A(c=>c[o]||""))),this.getItemsFp=i((o,u)=>d(o.length?r("getStorageValues",{keys:o},u):P({}),A(c=>({...o.reduce((l,p)=>(l[p]="",l),{}),...we(Ht(S(),S()),c)})))),this.getKeysFp=i(o=>d(r("getStorageKeys",{},o),A(u=>we(Mn(S()),u)))),this.setItemFp=i((o,u,c)=>d(r("saveStorageValue",{key:o,value:u},c),A(()=>{}))),this.clearFp=i(o=>d(this.getKeysFp(o),ne(this.deleteItemFp))),this.deleteItem=b(this.deleteItemFp),this.getItem=b(this.getItemFp),this.getItems=b(this.getItemsFp),this.getKeys=b(this.getKeysFp),this.setItem=b(this.setItemFp),this.clear=b(this.clearFp)}}const pn=Ze(0);function _t(){return pn.set(pn()+1),pn().toString()}function Ur(t,e,n){return Yo(t,e,_t(),{...n||{},postEvent:qe})}const dn=Le({invokeCustomMethod:Ur});function _a(){return new Dr(d(q(),$,dn))}const ba=_a();class Wr{constructor({isVBma: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=M({version:r,requires:"web_app_device_storage_get_key",isVBma:e,returns:"task"}),u=(c,l,p)=>{const h=i();return d(n(c,["device_storage_failed",l],{params:{...p,req_id:h},capture:(f=>"payload"in f?f.payload.req_id===h:!0)}),ne(f=>f.event==="device_storage_failed"?U(new Er(f.payload.error||"UNKNOWN_ERROR")):P(f.payload)))};this.getItemFp=o(c=>d(u("web_app_device_storage_get_key","device_storage_key_received",{key:c}),A(l=>l.value))),this.setItemFp=o((c,l)=>d(u("web_app_device_storage_save_key","device_storage_key_saved",{key:c,value:l}),A(()=>{}))),this.deleteItemFp=o(c=>this.setItemFp(c,null)),this.clearFp=o(()=>d(u("web_app_device_storage_clear","device_storage_cleared",{}),A(()=>{}))),this.getItem=b(this.getItemFp),this.setItem=b(this.setItemFp),this.deleteItem=b(this.deleteItemFp),this.clear=b(this.clearFp)}}const Gr=Le({createRequestId:_t});function ma(){return new Wr(d(q(),$,x,Gr))}const ga=ma();function wa({request:t,...e}){return V(n=>d(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 va(){return wa(d(q(),$,x))}const Nr=va(),ya=b(Nr);function Sa({request:t,...e}){return V((n,r)=>d(t("web_app_set_emoji_status",["emoji_status_set","emoji_status_failed"],{params:{custom_emoji_id:n,duration:(r||{}).duration},...r}),ce(i=>i.event==="emoji_status_failed"?U(new Br(i.payload.error)):P(void 0))),{...e,requires:"web_app_set_emoji_status",returns:"task"})}function Fa(){return Sa(d(q(),x,$))}const zr=Fa(),Ca=b(zr);class Kr{constructor({postEvent:e,isVBma: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=M({requires:i,isVBma:n,version:r,returns:"plain"});this.isSupported=se(i,r),this.impactOccurredFp=o(u=>e(i,{type:"impact",impact_style:u})),this.notificationOccurredFp=o(u=>e(i,{type:"notification",notification_type:u})),this.selectionChangedFp=o(()=>e(i,{type:"selection_change"})),this.impactOccurred=b(this.impactOccurredFp),this.notificationOccurred=b(this.notificationOccurredFp),this.selectionChanged=b(this.selectionChangedFp)}}function ka(){return new Kr(d(q(),J,$))}const Ea=ka();function qa({postEvent:t,...e}){return V(()=>t("web_app_add_to_home_screen"),{...e,requires:"web_app_add_to_home_screen",returns:"either"})}function Ia(){return qa(d(q(),$,J))}const Qr=Ia(),Aa=b(Qr);function Ba({request:t,...e}){return V(n=>d(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 $a(){return Ba(d(q(),$,x))}const Jr=$a(),Ma=b(Jr);class Zr{constructor({retrieveInitData:e}){s(this,"_state",D());s(this,"_raw",D());s(this,"state",C(this._state));s(this,"authDate",this.fromState("auth_date"));s(this,"canSendAfter",this.fromState("can_send_after"));s(this,"canSendAfterDate",C(()=>{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",C(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=()=>d(e(),Q(wt(()=>{},({raw:n,obj:r})=>{this._state.set(r),this._raw.set(n)}))),this.restore=re(this.restoreFp)}fromState(e){return C(()=>{const n=this._state();return n?n[e]:void 0})}}function Ra(){return new Zr({retrieveInitData(){return d(Bi,En("obj",()=>d(Te(),Q(({vbWebAppData:t})=>t?Be(t):Fe))),En("raw",Yt),Q(({obj:t,raw:e})=>d(wi,Cn("obj",()=>t),Cn("raw",()=>e))))}})}const Ta=Ra();class Yr{constructor({version:e,request:n,isVBma:r}){s(this,"isOpened");s(this,"isSupported");s(this,"openSlugFp");s(this,"openSlug");s(this,"openUrlFp");s(this,"openUrl");const i=M({version:e,isVBma:r,requires:"web_app_open_invoice",returns:"task"}),o=D(!1),u=()=>{o.set(!1)};this.isSupported=se("web_app_open_invoice",e),this.isOpened=C(o),this.openSlugFp=i((c,l)=>d(this.isOpened()?U(new ht("Invoice is already opened")):P(void 0),ne(()=>(o.set(!0),n("web_app_open_invoice","invoice_closed",{...l,params:{slug:c},capture:p=>c===p.slug}))),Ue(p=>(u(),p),p=>(u(),p.status)))),this.openUrlFp=i((c,l)=>{const{hostname:p,pathname:h}=new URL(c,window.location.href);if(p!=="t.me")return U(new ie(`Link has unexpected hostname: ${p}`));const f=h.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);return f?this.openSlugFp(f[2],l):U(new ie('Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'))}),this.openUrl=b(this.openUrlFp),this.openSlug=b(this.openSlugFp)}}function Pa(){return new Yr(d(q(),x,$))}const La=Pa();function Va({postEvent:t,...e}){return V((n,r={})=>{if(typeof n=="string")try{n=new URL(n)}catch(i){return R(new ie(`"${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 Oa(){return Va(d(q(),J))}const Xr=Oa(),ja=b(Xr);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",te(e))?(r=new URL(r),t("web_app_open_tg_link",{path_full:r.pathname+r.search})):(window.location.href=i,E(void 0)):R(new ie(`"${i}" is invalid URL`))},{...n,returns:"either"})}function Da(){return Ha(d(q(),J,$))}const hn=Da(),Ua=b(hn);function Wa({openVbotLink: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 Ga(){return Wa({...q(),openVbotLink:hn})}const xr=Ga(),Na=b(xr);function za(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 es{constructor({version:e,request:n,postEvent:r,storage:i,isVBma:o,isPageReload:u}){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 c=new me({initialState:{available:!1,accessGranted:!1,accessRequested:!1},onChange:i.set}),l=new un({isPageReload:u,restoreState:i.get,onMounted:c.setState,initialState(v){return d(n("web_app_check_location","location_checked",v),A(za))}}),p={version:e,requires:"web_app_check_location",isVBma:o},h=M({...p,returns:"either"}),f=M({...p,returns:"task"}),g=M({...p,returns:"task",isMounted:l.isMounted});this.isAvailable=c.getter("available"),this.isAccessRequested=c.getter("accessRequested"),this.isAccessGranted=c.getter("accessGranted"),this.isSupported=se("web_app_check_location",e),this.isMounted=l.isMounted,this.state=c.state,this.unmount=l.unmount,this.mountFp=f(l.mount),this.openSettingsFp=h(()=>r("web_app_open_location_settings")),this.requestLocationFp=g(v=>d(n("web_app_request_location","location_requested",v),A(F=>{if(!F.available)return c.setState({available:!1}),null;const{available:k,...w}=F;return w}))),this.mount=b(this.mountFp),this.openSettings=b(this.openSettingsFp),this.requestLocation=b(this.requestLocationFp)}}function Ka(){return new es(d(q(),J,$,x,ye("locationManager")))}const Qa=Ka();class ts{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 ft({...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,u)=>{const c=r.stateGetter(o);return C(()=>c()||te(u))};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 fn(t,e){document.documentElement.style.setProperty(t,e)}function _n(t){document.documentElement.style.removeProperty(t)}function ns(t){return d(at(t),Q(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 bn=re(ns);class rs{constructor({initialState:e,onChange:n,offChange:r,isVBma:i,storage:o,isPageReload:u}){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",C(this._isCssVarsBound));s(this,"bindCssVarsFp");s(this,"bindCssVars");s(this,"state");s(this,"isDark",C(()=>{const e=this.bgColor();return!e||bn(e)}));s(this,"isMounted");s(this,"mountFp");s(this,"mount");s(this,"unmount");const c=new me({initialState:{},onChange:o.set}),l=v=>{c.setState(v.theme_params)},p=new We({initialState:()=>E(te(e)),isPageReload:u,onMounted(v){c.setState(v),n(l)},onUnmounted(){r(l)},restoreState:o.get}),h={isVBma:i,returns:"either"},f=M(h),g=M({...h,isMounted:p.isMounted});this.accentTextColor=c.getter("accent_text_color"),this.bgColor=c.getter("bg_color"),this.buttonColor=c.getter("button_color"),this.buttonTextColor=c.getter("button_text_color"),this.bottomBarBgColor=c.getter("bottom_bar_bg_color"),this.destructiveTextColor=c.getter("destructive_text_color"),this.headerBgColor=c.getter("header_bg_color"),this.hintColor=c.getter("hint_color"),this.linkColor=c.getter("link_color"),this.secondaryBgColor=c.getter("secondary_bg_color"),this.sectionBgColor=c.getter("section_bg_color"),this.sectionHeaderTextColor=c.getter("section_header_text_color"),this.sectionSeparatorColor=c.getter("section_separator_color"),this.subtitleTextColor=c.getter("subtitle_text_color"),this.textColor=c.getter("text_color"),this.state=c.state,this.isMounted=p.isMounted,this.bindCssVarsFp=g(v=>{if(this._isCssVarsBound())return R(new dt);v||(v=w=>`--vb-theme-${yo(w)}`);const F=w=>{Object.entries(c.state()).forEach(([y,m])=>{m&&w(y,m)})},k=()=>{F((w,y)=>{fn(v(w),y)})};return k(),c.state.sub(k),this._isCssVarsBound.set(!0),E(()=>{F(_n),c.state.unsub(k),this._isCssVarsBound.set(!1)})}),this.mountFp=f(p.mount),this.unmount=p.unmount,this.bindCssVars=b(this.bindCssVarsFp),this.mount=b(this.mountFp)}}const mn=Ze({});function Ja(){return new rs({...d(q(),ye("themeParams")),offChange(t){ke("theme_changed",t)},onChange(t){X("theme_changed",t)},initialState:mn})}const Ye=Ja();function ss(t,e,n){return d(an(t,e),r=>({...r,defaults:n}))}const Za=new ts(ss("mainButton","main_button_pressed",{bgColor:C(()=>Ye.buttonColor()||"#2481cc"),textColor:C(()=>Ye.buttonTextColor()||"#ffffff")}));class is{constructor({storage:e,isPageReload:n,version:r,postEvent:i,isVBma:o,theme:u,onVisibilityChanged:c,offVisibilityChanged:l}){s(this,"isSupported");s(this,"isDark",C(()=>{const e=this.bgColorRgb();return e?bn(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=>{g.setState({isActive:m.is_visible})},h=m=>{[[this.headerColor,"web_app_set_header_color"],[this.bgColor,"web_app_set_background_color"],[this.bottomBarColor,"web_app_set_bottom_bar_color"]].forEach(([j,H])=>{const W=j();if(!ze(W)&&(H!=="web_app_set_header_color"||!["bg_color","secondary_bg_color"].includes(W))){const I=m[W];I&&i(H,{color:I})}})},f=new We({initialState(){return E({bgColor:"bg_color",headerColor:"header_bg_color",bottomBarColor:"bottom_bar_bg_color",isActive:!0})},isPageReload:n,onMounted:m=>{c(p),u.sub(h),g.setState(m)},onUnmounted(){l(p),u.unsub(h)},restoreState:e.get});this.isMounted=f.isMounted,this.mountFp=V(()=>{const m=()=>{};return d(f.mount(),ue(m,m))},{isVBma:o,returns:"plain"}),this.mount=b(this.mountFp),this.unmount=f.unmount;const g=new me({initialState:{bgColor:"bg_color",bottomBarColor:"bottom_bar_bg_color",headerColor:"bg_color",isActive:!1},onChange:e.set});this.state=g.state;const v=m=>ze(m)?m:te(u)[m],F=m=>C(()=>v(m()));this.isActive=g.getter("isActive"),this.isSupported=C(()=>["web_app_set_header_color","web_app_set_background_color","web_app_set_bottom_bar_color"].some(m=>fe(m,te(r))));const k=D(!1);this.isCssVarsBound=C(k),this.bindCssVarsFp=V(m=>{if(k())return R(new dt);const[j,H]=Ge(()=>{k.set(!1)}),W=(I,O)=>{const L=()=>{fn(I,O()||null)};L(),j(O.sub(L),_n.bind(null,I))};return m||(m=I=>`--tg-${jn(I)}`),W(m("bgColor"),this.bgColorRgb),W(m("bottomBarColor"),this.bottomBarColorRgb),W(m("headerColor"),this.headerColorRgb),k.set(!0),E(H)},{isVBma:o,returns:"either",isMounted:this.isMounted}),this.bindCssVars=b(this.bindCssVarsFp);const w=m=>{const j=g.getter(m),H=F(j),W={headerColor:"web_app_set_header_color",bgColor:"web_app_set_background_color",bottomBarColor:"web_app_set_bottom_bar_color"}[m],I=V(O=>{if(O===j())return E(void 0);if(W==="web_app_set_header_color"&&(O==="bg_color"||O==="secondary_bg_color"))return d(i("web_app_set_header_color",{color_key:O}),Q(()=>{g.setState({[m]:O})}));const L=v(O);return d(L?i(W,{color:L}):R(new Rr(O)),Q(()=>{g.setState({[m]:O})}))},{isVBma:o,version:r,requires:W,isMounted:this.isMounted,returns:"either",supports:m==="headerColor"?{rgb:{method:"web_app_set_header_color",param:"color",shouldCheck:ze}}:void 0});return[j,H,b(I),I]};[this.bgColor,this.bgColorRgb,this.setBgColor,this.setBgColorFp]=w("bgColor"),[this.headerColor,this.headerColorRgb,this.setHeaderColor,this.setHeaderColorFp]=w("headerColor"),[this.bottomBarColor,this.bottomBarColorRgb,this.setBottomBarColor,this.setBottomBarColorFp]=w("bottomBarColor");const y=M({isVBma:o,returns:"either"});this.closeFp=y(m=>i("web_app_close",{return_back:m})),this.close=b(this.closeFp),this.readyFp=y(()=>i("web_app_ready")),this.ready=b(this.readyFp)}}function Ya(){return new is({...d(q(),J,$,ye("miniApp")),offVisibilityChanged(t){ke("visibility_changed",t)},onVisibilityChanged(t){X("visibility_changed",t)},theme:Ye.state})}const os=Ya();function Xa(){const t=Date.now(),e=Math.random().toString(36).substring(2,9);return`notif_${t}_${e}`}class as{constructor({version:e,isVBma:n}){s(this,"isSupported");s(this,"sendFp");s(this,"send");const r=M({version:e,isVBma:n,requires:"web_app_send_notification",returns:"task"});this.isSupported=se("web_app_send_notification",e),this.sendFp=r(i=>d(De(Pe("web_app_send_notification",{id:Xa(),message:i.message,title:i.title,type:i.type??"default"})),A(()=>{}))),this.send=i=>this.sendFp(i)().then(u=>{if(u._tag==="Left")throw u.left;return u.right})}}function xa(){return new as($(q()))}const eu=xa();function tu(t){const e=t.message.trim(),n=(t.title||"").trim(),r=t.buttons||[];if(n.length>64)return R(new ie(`Invalid title: ${n}`));if(!e||e.length>256)return R(new ie(`Invalid message: ${e}`));if(r.length>3)return R(new ie(`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 u=r[o],c=u.id||"";if(c.length>64)return R(new ie(`Button with index ${o} has invalid id: ${c}`));if(!u.type||u.type==="default"||u.type==="destructive"){const l=u.text.trim();if(!l||l.length>64)return R(new ie(`Button with index ${o} has invalid text: ${l}`));i.push({type:u.type,text:l,id:c})}else i.push({type:u.type,id:c})}return E({title:n,message:e,buttons:i})}class us{constructor({version:e,isVBma:n,request:r}){s(this,"isOpened");s(this,"isSupported");s(this,"showFp");s(this,"show");const i=D(!1),o=()=>{i.set(!1)},u=M({version:e,isVBma:n,requires:"web_app_open_popup",returns:"task"});this.isSupported=se("web_app_open_popup",e),this.isOpened=C(i),this.showFp=u(c=>d(this.isOpened()?U(new ht("A popup is already opened")):P(void 0),ce(()=>De(tu(c))),ne(l=>(i.set(!0),r("web_app_open_popup","popup_closed",{...c,params:l}))),Ue(l=>(o(),l),l=>(o(),l.button_id)))),this.show=b(this.showFp)}}function nu(){return new us(d(q(),x,$))}const ru=nu();function su({request:t,...e}){return V(n=>d(t("web_app_request_phone","phone_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_phone",returns:"task"})}function iu(){return su(d(q(),$,x))}const gn=iu(),ou=b(gn);function au({invokeCustomMethod:t,requestPhoneAccess:e,...n}){const r=u=>d(t("getRequestedContact",{},{...u,timeout:(u||{}).timeout||5e3}),ce(c=>{const l=Ut(S(),c);if(!l.success)return U(new Je(c,l.issues));if(!l.output)return P(void 0);const p=Ut(Qt(G({contact:de(G({user_id:ge(),phone_number:S(),first_name:S(),last_name:B(S())})),auth_date:ae(S(),pe(h=>new Date(Number(h)*1e3)),rt()),hash:S()})),l.output);return p.success?P({raw:l.output,parsed:p.output}):U(new Je(l.output,p.issues))})),i=u=>d(r(u),et(c=>Je.is(c)?R(c):E(void 0),c=>E(c))),o=u=>Re(async(c,l,p)=>{let h=50;for(;!p.isRejected;){const f=await i(p)();if(f._tag==="Left")return l(f.left);if(f.right)return c(f.right);await new Promise(g=>setTimeout(g,h)),h+=50}},u);return V(u=>Re.fn(c=>d(i(c),ne(l=>l?P(l):d(e(c),ce(p=>p==="sent"?o(c):U(new sn("User denied access")))))),u),{...n,returns:"task",requires:"web_app_request_phone"})}function uu(){return au({...d(q(),dn,$),requestPhoneAccess:gn})}function cu({requestContact:t,...e}){return V(t,{...e,returns:"task",requires:"web_app_request_phone"})}function lu(){return cu({...d(q(),$),requestContact(t){return d(wn(t),A(e=>e.parsed))}})}const wn=uu(),pu=b(wn),cs=lu(),du=b(cs);function hu({request:t,...e}){return V(n=>d(t("web_app_request_write_access","write_access_requested",n),A(r=>r.status)),{...e,requires:"web_app_request_write_access",returns:"task"})}function fu(){return hu(d(q(),$,x))}const ls=fu(),_u=b(ls);class ps{constructor({version:e,onClosed:n,onTextReceived:r,isVBma: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 u={version:e,requires:"web_app_open_scan_qr_popup",isVBma:i},c=M({...u,returns:"either"}),l=M({...u,returns:"task"}),p=D(!1),h=()=>{p.set(!1)};this.isSupported=se("web_app_open_scan_qr_popup",e),this.isOpened=C(p),this.captureFp=l(f=>{let g;return d(this.openFp({...f,onCaptured:v=>{f.capture(v)&&(g=v,this.close())}}),A(()=>g))}),this.closeFp=c(()=>d(o("web_app_close_scan_qr_popup"),Q(h))),this.openFp=l(f=>d(p()?U(new ht("The QR Scanner is already opened")):async()=>o("web_app_open_scan_qr_popup",{text:f.text}),ce(()=>{p.set(!0);const[g,v]=Ge(),F=k=>(v(),p.set(!1),k);return d(Re(k=>{g(n(k),p.sub(w=>{w||k()}),r(f.onCaptured))},f),Ue(F,F))}))),this.open=b(this.openFp),this.capture=b(this.captureFp),this.close=b(this.closeFp)}}function bu(){return new ps({...d(q(),J,$),onClosed(t){return X("scan_qr_popup_closed",t)},onTextReceived(t){return X("qr_text_received",e=>{t(e.data)})}})}const mu=bu();class ds{constructor({}){s(this,"isRefreshing");s(this,"finishRefreshFp");s(this,"finishRefresh");s(this,"onRefreshRequest");const e=D(!1);X("refresh_requested",()=>{e.set(!0)}),this.isRefreshing=C(e),this.finishRefreshFp=()=>d(De(Pe("web_app_finish_refresh")),A(()=>{e.set(!1)})),this.finishRefresh=()=>this.finishRefreshFp()().then(r=>{if(r._tag==="Left")throw r.left;return r.right}),this.onRefreshRequest=n=>X("refresh_requested",()=>{n()})}}function gu(){return new ds(d(q()))}const wu=gu();class hs{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 ft({...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,u)=>{const c=r.stateGetter(o);return C(()=>c()||te(u))};this.isSupported=se("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 vu(){return new hs(ss("secondaryButton","secondary_button_pressed",{bgColor:C(()=>os.bottomBarColorRgb()||"#000000"),textColor:C(()=>Ye.buttonColor()||"#2481cc")}))}const yu=vu();class fs{constructor({isVBma: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=M({version:r,requires:"web_app_secure_storage_get_key",isVBma:e,returns:"task"}),u=(c,l,p)=>{const h=i();return d(n(c,["secure_storage_failed",l],{params:{...p,req_id:h},capture:(f=>"payload"in f?f.payload.req_id===h:!0)}),ne(f=>f.event==="secure_storage_failed"?U(new qr(f.payload.error||"UNKNOWN_ERROR")):P(f.payload)))};this.getItemFp=o(c=>d(u("web_app_secure_storage_get_key","secure_storage_key_received",{key:c}),A(l=>({value:l.value,canRestore:!!l.can_restore})))),this.setItemFp=o((c,l)=>d(u("web_app_secure_storage_save_key","secure_storage_key_saved",{key:c,value:l}),A(()=>{}))),this.deleteItemFp=o(c=>this.setItemFp(c,null)),this.clearFp=o(()=>d(u("web_app_secure_storage_clear","secure_storage_cleared",{}),A(()=>{}))),this.restoreItemFp=o(c=>d(u("web_app_secure_storage_restore_key","secure_storage_key_restored",{key:c}),A(l=>l.value))),this.getItem=b(this.getItemFp),this.setItem=b(this.setItemFp),this.deleteItem=b(this.deleteItemFp),this.clear=b(this.clearFp),this.restoreItem=b(this.restoreItemFp)}}function Su(){return new fs(d(q(),$,x,Gr))}const Fu=Su();class _s{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 ft({...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 Cu=new _s(an("settingsButton","settings_button_pressed"));class bs{constructor({postEvent:e,storage:n,isVBma: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 u={isVerticalEnabled:!0},c=new me({initialState:u,onChange(v){n.set(v)}}),l=new We({initialState:u,isPageReload:i,onMounted:c.setState,restoreState:n.get}),p={requires:"web_app_setup_swipe_behavior",isVBma:r,version:o},h=M({...p,returns:"plain"}),f=M({...p,isMounted:l.isMounted,returns:"either"}),g=v=>{const F={isVerticalEnabled:v};return c.hasDiff(F)?d(e("web_app_setup_swipe_behavior",{allow_vertical_swipe:v}),Q(()=>{c.setState(F)})):E(void 0)};this.isSupported=se("web_app_setup_swipe_behavior",o),this.isVerticalEnabled=c.getter("isVerticalEnabled"),this.isMounted=l.isMounted,this.disableVerticalFp=f(()=>g(!1)),this.enableVerticalFp=f(()=>g(!0)),this.mountFp=h(()=>{const v=()=>{};return d(l.mount(),ue(v,v))}),this.unmount=l.unmount,this.disableVertical=b(this.disableVerticalFp),this.enableVertical=b(this.enableVerticalFp),this.mount=b(this.mountFp)}}function ku(){return new bs(d(q(),J,$,ye("swipeBehavior")))}const Eu=ku();async function qu(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 Iu({request:t,...e}){return V((n,r,i)=>d(t("web_app_request_file_download","file_download_requested",{...i,params:{url:n,file_name:r}}),ne(o=>o.status==="downloading"?P(void 0):U(new sn("User denied the action")))),{...e,requires:"web_app_request_file_download",returns:"task"})}function Au(){return Iu(d(q(),x,$))}const ms=Au(),Bu=b(ms);function $u({invokeCustomMethod:t,...e}){return V(n=>d(t("getCurrentTime",{},n),ne(r=>{const i=Ut(ae(ge(),Pt(),pe(o=>new Date(o*1e3)),rt()),r);return i.success?P(i.output):U(new Je(r,i.issues))})),{...e,requires:"web_app_invoke_custom_method",returns:"task"})}function Mu(){return $u(d(q(),dn,$))}const gs=Mu(),Ru=b(gs);function Tu({postEvent:t,...e}){return V(()=>t("web_app_hide_keyboard"),{...e,returns:"either",requires:"web_app_hide_keyboard"})}function Pu(){return Tu(d(q(),J,$))}const ws=Pu(),Lu=b(ws);function Vu({request:t,createRequestId:e,...n}){return V(r=>{const i=e();return d(t("web_app_read_text_from_clipboard","clipboard_text_received",{...r,params:{req_id:i},capture:yr(i)}),A(({data:o=null})=>o))},{...n,requires:"web_app_read_text_from_clipboard",returns:"task"})}function Ou(){return Vu({...d(q(),$,x),createRequestId:_t})}const vs=Ou(),ju=b(vs);function ys(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[u,c]=o.trim().split(" ");if(u==="Android")e.androidVersion=c;else if(u==="SDK"){const l=parseInt(c,10);l&&(e.sdkVersion=l)}else c?(e.manufacturer=u,e.model=c):e.performanceClass=u})}return e}function Hu(){return ys(navigator.userAgent)}function Du({postEvent:t,...e}){return V(n=>{const{size:r}=new Blob([n]);return!r||r>4096?R(new ie(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 Uu(){return Du(d(q(),J))}const Ss=Uu(),Wu=b(Ss);function Gu({request:t,...e}){return V((n,r)=>d(t("web_app_send_prepared_message",["prepared_message_failed","prepared_message_sent"],{...r,params:{id:n}}),ne(i=>i.event==="prepared_message_failed"?U(new Mr(i.payload.error)):P(void 0))),{...e,requires:"web_app_send_prepared_message",returns:"task"})}function Nu(){return Gu(d(q(),x,$))}const Fs=Nu(),zu=b(Fs);function Ku({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 Qu(){return Ku(d(q(),J,$))}const Cs=Qu(),Ju=b(Cs),vn=Ze(!1);function Zu({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",()=>te(t)?void 0:"The application must be launched in the inline mode"]},returns:"either"})}function Yu(){return Zu({...d(q(),J,$),isInlineMode:vn})}const ks=Yu(),Xu=b(ks);class Es{constructor({storage:e,isPageReload:n,onContentSafeAreaInsetsChanged:r,onSafeAreaInsetsChanged:i,onViewportChanged:o,onFullscreenChanged:u,offContentSafeAreaInsetsChanged:c,offFullscreenChanged:l,offSafeAreaInsetsChanged:p,offViewportChanged:h,request:f,isViewportStable:g,isFullscreen:v,isVBma:F,version:k,postEvent:w}){s(this,"state");s(this,"height");s(this,"stableHeight");s(this,"width");s(this,"isExpanded");s(this,"isStable",C(()=>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 y={top:0,right:0,left:0,bottom:0},m=new me({initialState:{contentSafeAreaInsets:y,height:0,isExpanded:!1,isFullscreen:!1,safeAreaInsets:y,stableHeight:0,width:0},onChange:e.set}),j=T=>{m.setState({isExpanded:T.is_expanded,height:T.height,width:T.width,stableHeight:T.is_state_stable?T.height:void 0})},H=T=>{m.setState({isFullscreen:T.is_fullscreen})},W=T=>{m.setState({safeAreaInsets:T})},I=T=>{m.setState({contentSafeAreaInsets:T})},O=new un({initialState(T){const Ie=_e=>()=>{const[Se,oe]=_e==="safe-area"?["web_app_request_safe_area","safe_area_changed"]:["web_app_request_content_safe_area","content_safe_area_changed"];return fe(Se,te(k))?f(Se,oe,T):P({top:0,left:0,right:0,bottom:0})},z=_e=>()=>typeof _e=="boolean"?P(_e):De(_e());return d(no,tt("safeAreaInsets",Ie("safe-area")),tt("contentSafeAreaInsets",Ie("content-safe-area")),tt("isFullscreen",z(v)),tt("isViewportStable",z(g)),ce(({isViewportStable:_e,...Se})=>_e?P({...Se,height:window.innerHeight,isExpanded:!0,stableHeight:window.innerHeight,width:window.innerWidth}):d(f("web_app_request_viewport","viewport_changed",T),A(oe=>({...Se,height:oe.height,isExpanded:oe.is_expanded,stableHeight:oe.is_state_stable?oe.height:0,width:oe.width})))))},isPageReload:n,onMounted(T){o(j),u(H),i(W),r(I),m.setState(T)},onUnmounted(){h(j),l(H),p(W),c(I)},restoreState:e.get}),L=T=>C(()=>this.safeAreaInsets()[T]),N=T=>C(()=>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=L("top"),this.safeAreaInsetBottom=L("bottom"),this.safeAreaInsetLeft=L("left"),this.safeAreaInsetRight=L("right"),this.contentSafeAreaInsets=m.getter("contentSafeAreaInsets"),this.contentSafeAreaInsetTop=N("top"),this.contentSafeAreaInsetBottom=N("bottom"),this.contentSafeAreaInsetLeft=N("left"),this.contentSafeAreaInsetRight=N("right");const Ve=M({isVBma:F,returns:"task"}),Xe=M({isVBma:F,returns:"either"}),Ac=M({isVBma:F,requires:"web_app_request_fullscreen",version:k,returns:"task"}),ei=T=>Ac(Ie=>d(f(T?"web_app_request_fullscreen":"web_app_exit_fullscreen",["fullscreen_changed","fullscreen_failed"],Ie),ne(z=>z.event==="fullscreen_failed"&&z.payload.error!=="ALREADY_FULLSCREEN"?U(new $r(z.payload.error)):(m.setState({isFullscreen:"is_fullscreen"in z.payload?z.payload.is_fullscreen:!0}),P(void 0)))));this.isMounted=O.isMounted,this.mountFp=Ve(O.mount),this.mount=b(this.mountFp),this.isFullscreen=m.getter("isFullscreen"),this.requestFullscreenFp=ei(!0),this.requestFullscreen=b(this.requestFullscreenFp),this.exitFullscreenFp=ei(!1),this.exitFullscreen=b(this.exitFullscreenFp);const bt=D(!1);this.isCssVarsBound=C(bt),this.bindCssVarsFp=Xe(T=>{if(bt())return R(new dt);T||(T=z=>`--vb-viewport-${jn(z)}`);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((z,[_e,Se])=>{const oe=T(_e);if(oe){const ti=()=>{fn(oe,`${Se()}px`)};z.push({update:ti,removeListener:Se.sub(ti),cssVar:oe})}return z},[]);return Ie.forEach(z=>{z.update()}),bt.set(!0),E(()=>{Ie.forEach(z=>{z.removeListener(),_n(z.cssVar)}),bt.set(!1)})}),this.bindCssVars=b(this.bindCssVarsFp),this.expandFp=Xe(()=>w("web_app_expand")),this.expand=b(this.expandFp)}}function xu(){const t=o=>({on:u=>{X(o,u)},off:u=>{ke(o,u)}}),e=t("viewport_changed"),n=t("fullscreen_changed"),r=t("safe_area_changed"),i=t("content_safe_area_changed");return new Es({...d(q(),ye("viewport"),$,J,x),isFullscreen(){return d(Te(),Q(o=>!!o.vbWebAppFullscreen))},isViewportStable(){return d(Te(),Q(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 ec=xu();class qs{constructor({request:e}){s(this,"requestAccessFp");s(this,"requestAccess");s(this,"selectFile");s(this,"selectFiles");s(this,"selectFolder");this.requestAccessFp=n=>d(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 tc(){return new qs({request:pt})}const nc=tc();class Is{onSetup(e){return _().on("web_app_setup_back_button",r=>{r&&typeof r.is_visible=="boolean"&&e(r.is_visible)})}press(){_().send("back_button_pressed")}}const rc=new Is;class As{onSetup(e){return _().on("web_app_setup_main_button",r=>{r&&e(r)})}press(){_().send("main_button_pressed")}}const sc=new As;class Bs{onSetup(e){return _().on("web_app_setup_secondary_button",r=>{r&&e(r)})}press(){_().send("secondary_button_pressed")}}const ic=new Bs;class $s{onSetup(e){return _().on("web_app_setup_settings_button",r=>{r&&e(r)})}press(){_().send("settings_button_pressed")}}const oc=new $s;class Ms{onOpen(e){return _().on("web_app_open_popup",r=>{r&&e(r)})}close(e){_().send("popup_closed",{button_id:e})}}const ac=new Ms;class Rs{onExpand(e){return _().on("web_app_expand",()=>{e()})}onRequestContentSafeArea(e){return _().on("web_app_request_content_safe_area",()=>{e()})}onRequestSafeArea(e){return _().on("web_app_request_safe_area",()=>{e()})}onRequestViewport(e){return _().on("web_app_request_viewport",()=>{e()})}onToggleOrientationLock(e){return _().on("web_app_toggle_orientation_lock",r=>{r&&typeof r.locked=="boolean"&&e(r.locked)})}onRequestFullscreen(e){return _().on("web_app_request_fullscreen",()=>{e()})}setFullscreen(e){_().send("fullscreen_changed",{is_fullscreen:e})}setFullscreenFailed(e){_().send("fullscreen_failed",{error:e})}onExitFullscreen(e){return _().on("web_app_exit_fullscreen",()=>{e()})}setContentSafeArea(e){_().send("content_safe_area_changed",e)}setSafeArea(e){_().send("safe_area_changed",e)}setViewport(e){_().send("viewport_changed",e)}}const uc=new Rs;class Ts{onIframeReady(e){return _().on("iframe_ready",r=>{e(r||{})})}onIframeWillReload(e){return _().on("iframe_will_reload",()=>{e()})}onClose(e){return _().on("web_app_close",()=>{e()})}onHideKeyboard(e){return _().on("web_app_hide_keyboard",()=>{e()})}onReady(e){return _().on("web_app_ready",()=>{e()})}onRequestTheme(e){return _().on("web_app_request_theme",()=>{e()})}onBackgroundColorChange(e){return _().on("web_app_set_background_color",r=>{r&&typeof r.color=="string"&&e(r.color)})}onBottomBarColorChange(e){return _().on("web_app_set_bottom_bar_color",r=>{r&&r.color&&e(r.color)})}onHeaderColorChange(e){return _().on("web_app_set_header_color",r=>{r&&("color_key"in r&&r.color_key?e(r.color_key):"color"in r&&r.color&&e(r.color))})}reloadIframe(){_().send("reload_iframe")}setCustomStyle(e){_().send("set_custom_style",e)}setVisibility(e){_().send("visibility_changed",{is_visible:e})}}const cc=new Ts;class Ps{onHapticFeedback(e){return _().on("web_app_trigger_haptic_feedback",r=>{r&&e(r)})}}const lc=new Ps;class Ls{onGetInfo(e){return _().on("web_app_biometry_get_info",()=>{e()})}onOpenSettings(e){return _().on("web_app_biometry_open_settings",()=>{e()})}onRequestAccess(e){return _().on("web_app_biometry_request_access",r=>{e(r||{})})}onRequestAuth(e){return _().on("web_app_biometry_request_auth",r=>{e(r||{})})}onUpdateToken(e){return _().on("web_app_biometry_update_token",r=>{r&&e(r)})}setInfoReceived(e){_().send("biometry_info_received",e)}setAuthRequested(e){_().send("biometry_auth_requested",e)}setTokenUpdated(e){_().send("biometry_token_updated",e)}}const pc=new Ls;class Vs{onOpenInvoice(e){return _().on("web_app_open_invoice",r=>{r&&e(r)})}setInvoiceClosed(e){_().send("invoice_closed",e)}}const dc=new Vs;class Os{onOpenPopup(e){return _().on("web_app_open_scan_qr_popup",r=>{e(r||{})})}onClosePopup(e){return _().on("web_app_close_scan_qr_popup",()=>{e()})}sendQrTextReceived(e){_().send("qr_text_received",e)}closePopup(){_().send("scan_qr_popup_closed")}}const hc=new Os;class js{onCheckLocation(e){return _().on("web_app_check_location",()=>{e()})}onOpenLocationSettings(e){return _().on("web_app_open_location_settings",()=>{e()})}onRequestLocation(e){return _().on("web_app_request_location",()=>{e()})}setLocationChecked(e){_().send("location_checked",e)}setLocationRequested(e){_().send("location_requested",e)}}const fc=new js;class Hs{onOpenLink(e){return _().on("web_app_open_link",r=>{r&&e(r)})}onOpenTgLink(e){return _().on("web_app_open_tg_link",r=>{r&&e(r)})}}const _c=new Hs;class Ds{onRequestAccess(e){return _().on("web_app_request_emoji_status_access",()=>{e()})}onSetEmojiStatus(e){return _().on("web_app_set_emoji_status",r=>{r&&e(r)})}setAccessRequested(e){_().send("emoji_status_access_requested",e)}setEmojiStatusSet(e){_().send("emoji_status_set",e)}setEmojiStatusFailed(e){_().send("emoji_status_failed",e)}}const bc=new Ds;class Us{onAddToHomeScreen(e){return _().on("web_app_add_to_home_screen",()=>{e()})}onCheckHomeScreen(e){return _().on("web_app_check_home_screen",()=>{e()})}setHomeScreenChecked(e){_().send("home_screen_checked",e)}setHomeScreenAdded(){_().send("home_screen_added")}setHomeScreenFailed(e){_().send("home_screen_failed",e)}}const mc=new Us;class Ws{onRequestPhone(e){return _().on("web_app_request_phone",()=>{e()})}onRequestWriteAccess(e){return _().on("web_app_request_write_access",()=>{e()})}setPhoneRequested(e){_().send("phone_requested",e)}setWriteAccessRequested(e){_().send("write_access_requested",e)}}const gc=new Ws;class Gs{onSetupClosingBehavior(e){return _().on("web_app_setup_closing_behavior",r=>{r&&e(r)})}}const wc=new Gs;class Ns{onSetupSwipeBehavior(e){return _().on("web_app_setup_swipe_behavior",r=>{r&&e(r)})}}const vc=new Ns;class zs{onReadText(e){return _().on("web_app_read_text_from_clipboard",r=>{r&&e(r)})}sendTextReceived(e){_().send("clipboard_text_received",e)}}const yc=new zs;class Ks{onRequestFileDownload(e){return _().on("web_app_request_file_download",r=>{e(r||{})})}setFileDownloadRequested(e){_().send("file_download_requested",e)}}const Sc=new Ks;class Qs{onSendPreparedMessage(e){return _().on("web_app_send_prepared_message",r=>{r&&e(r)})}onShareToStory(e){return _().on("web_app_share_to_story",r=>{e(r||{})})}setPreparedMessageFailed(e){_().send("prepared_message_failed",e)}setPreparedMessageSent(){_().send("prepared_message_sent")}}const Fc=new Qs;class Js{onDataSend(e){return _().on("web_app_data_send",r=>{r&&e(r)})}onSwitchInlineQuery(e){return _().on("web_app_switch_inline_query",r=>{r&&e(r)})}}const Cc=new Js;class Zs{onInvokeCustomMethod(e){return _().on("web_app_invoke_custom_method",r=>{r&&e(r)})}setCustomMethodInvoked(e){_().send("custom_method_invoked",e)}}const kc=new Zs;class Ys{onSend(e){return _().on("web_app_send_notification",r=>{r&&e(r)})}}const Ec=new Ys;class Xs{setTheme(e){_().send("theme_changed",{theme_params:e})}onRequestTheme(e){return _().on("web_app_request_theme",()=>{e()})}}const qc=new Xs;function xs(t={}){const{version:e,isInlineMode:n,themeParams:r}=t;if(e&&typeof n=="boolean"&&r)on.set(e),vn.set(n),mn.set(r);else{const c=d(Te(),Ft(l=>l,l=>{on.set(e||l.vbWebAppVersion),vn.set(typeof n=="boolean"?n:!!l.vbWebAppBotInline),mn.set(r||l.vbWebAppThemeParams)}));if(c)return R(c)}t.postEvent&&Pr.set(t.postEvent);const[i,o]=Ge(X("reload_iframe",()=>{he().log("Received a request to reload the page"),Lr("iframe_will_reload"),window.location.reload()})),{acceptCustomStyles:u=!0}=t;if(u){const c=document.createElement("style");c.id="telegram-custom-styles",document.head.appendChild(c),i(X("set_custom_style",l=>{c.innerHTML=l}),()=>{document.head.removeChild(c)})}return d(qe("iframe_ready",{reload_supported:!0}),Q(()=>(he().log("The package was initialized"),o)))}const Ic=re(xs);return a.AccessDeniedError=sn,a.BackButton=Tr,a.Biometry=Or,a.CSSVarsBoundError=dt,a.CancelledError=Vn,a.ClosingBehavior=Hr,a.CloudStorage=Dr,a.ConcurrentCallError=ht,a.DeviceStorage=Wr,a.DeviceStorageMethodError=Er,a.FullscreenFailedError=$r,a.FunctionUnavailableError=Ar,a.HapticFeedback=Kr,a.HostBackButton=Is,a.HostBiometry=Ls,a.HostChat=Js,a.HostClipboard=zs,a.HostClosingBehavior=Gs,a.HostCustomMethod=Zs,a.HostEmojiStatus=Ds,a.HostFiles=Ks,a.HostHapticFeedback=Ps,a.HostHomeScreen=Us,a.HostInvoice=Vs,a.HostLink=Hs,a.HostLocationManager=js,a.HostMainButton=As,a.HostMiniApp=Ts,a.HostNotification=Ys,a.HostPopup=Ms,a.HostPrivacy=Ws,a.HostQrScanner=Os,a.HostSecondaryButton=Bs,a.HostSettingsButton=$s,a.HostSharing=Qs,a.HostSwipeBehavior=Ns,a.HostThemeParams=Xs,a.HostViewport=Rs,a.InitData=Zr,a.InvalidArgumentsError=ie,a.InvalidEnvError=sa,a.InvalidLaunchParamsError=cr,a.Invoice=Yr,a.InvokeCustomMethodFailedError=lr,a.LaunchParamsRetrieveError=ur,a.LocationManager=es,a.MainButton=ts,a.MethodParameterUnsupportedError=ar,a.MethodUnsupportedError=or,a.MiniApp=is,a.NotAvailableError=Ir,a.Notification=as,a.Popup=us,a.QrScanner=ps,a.Refresh=ds,a.SecondaryButton=hs,a.SecureStorage=fs,a.SecureStorageMethodError=qr,a.SetEmojiStatusError=Br,a.SettingsButton=_s,a.ShareMessageError=Mr,a.StoragePermission=qs,a.SwipeBehavior=bs,a.ThemeParams=rs,a.TimeoutError=Gt,a.UnknownEnvError=Zt,a.UnknownThemeParamsKeyError=Rr,a.ValidationError=Je,a.Viewport=Es,a.addToHomeScreen=Aa,a.addToHomeScreenFp=Qr,a.applyPolyfills=xo,a.backButton=ua,a.biometry=da,a.checkHomeScreenStatus=Ma,a.checkHomeScreenStatusFp=Jr,a.closingBehavior=fa,a.cloudStorage=ba,a.copyTextToClipboard=qu,a.createLogger=Un,a.createPostEvent=Zo,a.createRequestId=_t,a.createStartParam=ta,a.createStartParamFp=Cr,a.debug=_r,a.decodeBase64Url=ea,a.decodeBase64UrlFp=nn,a.decodeStartParam=na,a.decodeStartParamFp=kr,a.deepSnakeToCamelObjKeys=Nt,a.defineHostBridge=Qo,a.deviceStorage=ga,a.downloadFile=Bu,a.downloadFileFp=ms,a.emitEvent=ct,a.encodeBase64Url=rn,a.getCurrentTime=Ru,a.getCurrentTimeFp=gs,a.getHostBridge=_,a.getReleaseVersion=tn,a.hapticFeedback=Ea,a.hideKeyboard=Lu,a.hideKeyboardFp=ws,a.hostBackButton=rc,a.hostBiometry=pc,a.hostChat=Cc,a.hostClipboard=yc,a.hostClosingBehavior=wc,a.hostCustomMethod=kc,a.hostEmojiStatus=bc,a.hostFiles=Sc,a.hostHapticFeedback=lc,a.hostHomeScreen=mc,a.hostInvoice=dc,a.hostLink=_c,a.hostLocationManager=fc,a.hostMainButton=sc,a.hostMiniApp=cc,a.hostNotification=Ec,a.hostPopup=ac,a.hostPrivacy=gc,a.hostQrScanner=hc,a.hostSecondaryButton=ic,a.hostSettingsButton=oc,a.hostSharing=Fc,a.hostSwipeBehavior=vc,a.hostThemeParams=qc,a.hostViewport=uc,a.init=Ic,a.initData=Ta,a.initFp=xs,a.invoice=La,a.invokeCustomMethod=Ur,a.isAnyRGB=Kn,a.isColorDark=bn,a.isColorDarkFp=ns,a.isRGB=ze,a.isRGBA=zn,a.isRGBAShort=Nn,a.isRGBShort=Gn,a.isSafeToCreateStartParam=ra,a.isVBma=zo,a.isVBmaFp=en,a.locationManager=Qa,a.logger=he,a.mainButton=Za,a.miniApp=os,a.mockVBotEnv=Ko,a.notification=eu,a.off=ke,a.offAll=Wo,a.on=X,a.openLink=ja,a.openLinkFp=Xr,a.openVBotLink=Ua,a.openVBotLinkFp=hn,a.parseInitDataQuery=Ro,a.parseInitDataQueryFp=xn,a.parseLaunchParamsQuery=er,a.parseLaunchParamsQueryFp=ut,a.popup=ru,a.postEvent=Lr,a.postEventFp=qe,a.qrScanner=mu,a.readTextFromClipboard=ju,a.readTextFromClipboardFp=vs,a.refresh=wu,a.request=ca,a.request2=la,a.request2Fp=ln,a.requestContact=du,a.requestContactComplete=pu,a.requestContactCompleteFp=wn,a.requestContactFp=cs,a.requestEmojiStatusAccess=ya,a.requestEmojiStatusAccessFp=Nr,a.requestFp=jr,a.requestPhoneAccess=ou,a.requestPhoneAccessFp=gn,a.requestWriteAccess=_u,a.requestWriteAccessFp=ls,a.retrieveAndroidDeviceData=Hu,a.retrieveAndroidDeviceDataFrom=ys,a.retrieveLaunchParams=Po,a.retrieveLaunchParamsFp=Te,a.retrieveRawInitData=Lo,a.retrieveRawInitDataFp=Yt,a.retrieveRawLaunchParams=Vo,a.retrieveRawLaunchParamsFp=Ke,a.secondaryButton=yu,a.secureStorage=Fu,a.sendData=Wu,a.sendDataFp=Ss,a.serializeInitDataQuery=nr,a.serializeLaunchParamsQuery=rr,a.setDebug=jo,a.setEmojiStatus=Ca,a.setEmojiStatusFp=zr,a.setTargetOrigin=Ho,a.settingsButton=Cu,a.shareMessage=zu,a.shareMessageFp=Fs,a.shareStory=Ju,a.shareStoryFp=Cs,a.shareURL=Na,a.shareURLFp=xr,a.storagePermission=nc,a.supports=fe,a.swipeBehavior=Eu,a.switchInlineQuery=Xu,a.switchInlineQueryFp=ks,a.targetOrigin=br,a.themeParams=Ye,a.toRGB=Eo,a.toRGBFp=Jn,a.toRGBFull=qo,a.toRGBFullFp=at,a.viewport=ec,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),a})({});
|
|
4
4
|
//# sourceMappingURL=index.iife.js.map
|