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