@tma.js/sdk 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ var Le = (s, e, r) => e in s ? $e(s, e, { enumerable: !0, configurable: !0, writ
3
3
  var t = (s, e, r) => Le(s, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { computed as w, signal as j, batch as Ct } from "@tma.js/signals";
5
5
  import { supports as ot, isTMAFp as Re, postEventFp as Pe, off as ct, on as Y, requestFp as Oe, invokeCustomMethodFp as De, retrieveRawInitDataFp as Ue, retrieveLaunchParamsFp as St, captureSameReq as Ge, logger as re } from "@tma.js/bridge";
6
- import { CancelledError as lo, InvalidLaunchParamsError as po, InvokeCustomMethodFailedError as ho, LaunchParamsRetrieveError as fo, MethodParameterUnsupportedError as _o, MethodUnsupportedError as mo, TimeoutError as bo, UnknownEnvError as go, applyPolyfills as wo, createLogger as Fo, createPostEvent as Co, createStartParam as So, createStartParamFp as vo, debug as yo, decodeBase64Url as ko, decodeBase64UrlFp as Eo, decodeStartParam as Ao, decodeStartParamFp as Io, deepSnakeToCamelObjKeys as Bo, emitEvent as xo, encodeBase64Url as qo, getReleaseVersion as Mo, isSafeToCreateStartParam as Vo, isTMA as To, isTMAFp as $o, logger as Lo, mockTelegramEnv as Ro, off as Po, offAll as Oo, on as Do, retrieveLaunchParams as Uo, retrieveLaunchParamsFp as Go, retrieveRawInitData as jo, retrieveRawInitDataFp as Ho, retrieveRawLaunchParams as Wo, retrieveRawLaunchParamsFp as Ko, setDebug as Qo, setTargetOrigin as zo, supports as No, targetOrigin as Jo } from "@tma.js/bridge";
7
- import { throwifyFpFn as yt, throwifyAnyEither as ce, getStorageValue as je, setStorageValue as He, snakeToKebab as We, createCbCollector as Lt, camelToKebab as le, BetterTaskEither as xt } from "@tma.js/toolkit";
6
+ import { CancelledError as lo, InvalidLaunchParamsError as po, InvokeCustomMethodFailedError as ho, LaunchParamsRetrieveError as fo, MethodParameterUnsupportedError as _o, MethodUnsupportedError as mo, TimeoutError as bo, UnknownEnvError as go, applyPolyfills as wo, createLogger as Fo, createPostEvent as Co, createStartParam as So, createStartParamFp as vo, debug as yo, decodeBase64Url as ko, decodeBase64UrlFp as Eo, decodeStartParam as Ao, decodeStartParamFp as Io, deepSnakeToCamelObjKeys as xo, emitEvent as Bo, encodeBase64Url as qo, getReleaseVersion as Mo, isSafeToCreateStartParam as Vo, isTMA as To, isTMAFp as $o, logger as Lo, mockTelegramEnv as Ro, off as Po, offAll as Oo, on as Do, retrieveLaunchParams as Uo, retrieveLaunchParamsFp as Go, retrieveRawInitData as jo, retrieveRawInitDataFp as Ho, retrieveRawLaunchParams as Wo, retrieveRawLaunchParamsFp as Ko, setDebug as Qo, setTargetOrigin as zo, supports as No, targetOrigin as Jo } from "@tma.js/bridge";
7
+ import { throwifyFpFn as yt, throwifyAnyEither as ce, getStorageValue as je, setStorageValue as He, snakeToKebab as We, createCbCollector as Lt, camelToKebab as le, BetterTaskEither as Bt } from "@tma.js/toolkit";
8
8
  import { BetterPromise as Ke } from "better-promises";
9
9
  import { toRGBFullFp as Qe, isRGB as Et, pipeQueryToSchema as ze, pipeJsonToSchema as Ne } from "@tma.js/transformers";
10
10
  import { isAnyRGB as Zo, isRGB as Xo, isRGBA as ti, isRGBAShort as ei, isRGBShort as si, parseInitDataQuery as ri, parseInitDataQueryFp as ni, parseLaunchParamsQuery as oi, parseLaunchParamsQueryFp as ii, serializeInitDataQuery as ai, serializeLaunchParamsQuery as ui, toRGB as ci, toRGBFp as li, toRGBFull as pi, toRGBFullFp as hi } from "@tma.js/transformers";
@@ -74,8 +74,8 @@ function c(s, e, r, n, i, o, u, a, p) {
74
74
  case 9:
75
75
  return p(a(u(o(i(n(r(e(s))))))));
76
76
  default: {
77
- for (var l = arguments[0], _ = 1; _ < arguments.length; _++)
78
- l = arguments[_](l);
77
+ for (var l = arguments[0], m = 1; m < arguments.length; m++)
78
+ l = arguments[m](l);
79
79
  return l;
80
80
  }
81
81
  }
@@ -131,7 +131,7 @@ function Pt(s) {
131
131
  };
132
132
  };
133
133
  }
134
- var M = me, I = be, as = /* @__PURE__ */ lt(2, function(s, e) {
134
+ var V = me, I = be, as = /* @__PURE__ */ lt(2, function(s, e) {
135
135
  return rt(s) ? s : e(s.right);
136
136
  }), Ot = function(s, e) {
137
137
  return c(s, D(e));
@@ -159,7 +159,7 @@ var M = me, I = be, as = /* @__PURE__ */ lt(2, function(s, e) {
159
159
  chain: as
160
160
  }, fs = function(s, e) {
161
161
  return function(r) {
162
- return rt(r) ? M(s(r.left)) : I(e(r.right));
162
+ return rt(r) ? V(s(r.left)) : I(e(r.right));
163
163
  };
164
164
  }, rt = ns, we = function(s, e) {
165
165
  return function(r) {
@@ -169,14 +169,14 @@ var M = me, I = be, as = /* @__PURE__ */ lt(2, function(s, e) {
169
169
  try {
170
170
  return I(s());
171
171
  } catch (r) {
172
- return M(e(r));
172
+ return V(e(r));
173
173
  }
174
174
  }, ms = /* @__PURE__ */ cs(Rt), bs = /* @__PURE__ */ Pt(ds), ie = bs;
175
- function R(s) {
175
+ function P(s) {
176
176
  return typeof s == "function" ? s() : s;
177
177
  }
178
178
  function z(s, e) {
179
- return w(() => ot(s, R(e)));
179
+ return w(() => ot(s, P(e)));
180
180
  }
181
181
  var it = ss, ht = rs, gs = function(s, e) {
182
182
  return c(s, Cs(e));
@@ -207,10 +207,10 @@ var it = ss, ht = rs, gs = function(s, e) {
207
207
  function Is(s) {
208
208
  return _e(I, s.of);
209
209
  }
210
- function Bs(s) {
211
- return _e(M, s.of);
212
- }
213
210
  function xs(s) {
211
+ return _e(V, s.of);
212
+ }
213
+ function Bs(s) {
214
214
  return is(s, us);
215
215
  }
216
216
  function qs(s) {
@@ -286,22 +286,22 @@ var Ut = function(s, e) {
286
286
  });
287
287
  }
288
288
  return new (r || (r = Promise))(function(o, u) {
289
- function a(_) {
289
+ function a(m) {
290
290
  try {
291
- l(n.next(_));
292
- } catch (f) {
293
- u(f);
291
+ l(n.next(m));
292
+ } catch (_) {
293
+ u(_);
294
294
  }
295
295
  }
296
- function p(_) {
296
+ function p(m) {
297
297
  try {
298
- l(n.throw(_));
299
- } catch (f) {
300
- u(f);
298
+ l(n.throw(m));
299
+ } catch (_) {
300
+ u(_);
301
301
  }
302
302
  }
303
- function l(_) {
304
- _.done ? o(_.value) : i(_.value).then(a, p);
303
+ function l(m) {
304
+ m.done ? o(m.value) : i(m.value).then(a, p);
305
305
  }
306
306
  l((n = n.apply(s, e || [])).next());
307
307
  });
@@ -314,8 +314,8 @@ var Ut = function(s, e) {
314
314
  return this;
315
315
  }), u;
316
316
  function a(l) {
317
- return function(_) {
318
- return p([l, _]);
317
+ return function(m) {
318
+ return p([l, m]);
319
319
  };
320
320
  }
321
321
  function p(l) {
@@ -356,15 +356,15 @@ var Ut = function(s, e) {
356
356
  continue;
357
357
  }
358
358
  l = e.call(s, r);
359
- } catch (_) {
360
- l = [6, _], i = 0;
359
+ } catch (m) {
360
+ l = [6, m], i = 0;
361
361
  } finally {
362
362
  n = o = 0;
363
363
  }
364
364
  if (l[0] & 5) throw l[1];
365
365
  return { value: l[0] ? l[1] : void 0, done: !0 };
366
366
  }
367
- }, T = /* @__PURE__ */ Bs(Se), x = /* @__PURE__ */ Is(Se), ve = Gt, Gs = /* @__PURE__ */ Ts(Ht), js = function(s, e) {
367
+ }, $ = /* @__PURE__ */ xs(Se), q = /* @__PURE__ */ Is(Se), ve = Gt, Gs = /* @__PURE__ */ Ts(Ht), js = function(s, e) {
368
368
  return function() {
369
369
  return Ds(void 0, void 0, void 0, function() {
370
370
  var r;
@@ -389,7 +389,7 @@ var Ut = function(s, e) {
389
389
  return c(s, B(e));
390
390
  }, Ws = function(s, e) {
391
391
  return c(s, Ks(e));
392
- }, B = /* @__PURE__ */ xs(Ht), Wt = /* @__PURE__ */ lt(3, Vs(Ht)), Ks = /* @__PURE__ */ qs(Ps), Kt = /* @__PURE__ */ lt(2, Ms(Os)), Qs = x, zs = "TaskEither", Ns = {
392
+ }, B = /* @__PURE__ */ Bs(Ht), Wt = /* @__PURE__ */ lt(3, Vs(Ht)), Ks = /* @__PURE__ */ qs(Ps), Kt = /* @__PURE__ */ lt(2, Ms(Os)), Qs = q, zs = "TaskEither", Ns = {
393
393
  URI: zs,
394
394
  map: Hs,
395
395
  ap: Ws,
@@ -460,66 +460,65 @@ class rr extends K(
460
460
  ) {
461
461
  }
462
462
  function A(s, e) {
463
- const r = w(() => R(e.version) || "100"), n = w(() => R(e.isTma)), { requires: i } = e, o = i ? typeof i == "object" ? i : { every: [i] } : void 0, u = (F) => {
463
+ const r = w(() => P(e.version) || "100"), n = w(() => P(e.isTma)), { requires: i, returns: o } = e, u = i ? typeof i == "object" ? i : { every: [i] } : void 0, a = (f) => {
464
464
  if (!e.supports)
465
465
  return !0;
466
- const b = e.supports[F];
466
+ const b = e.supports[f];
467
467
  return ot(b.method, b.param, r());
468
- }, a = () => {
469
- if (!o)
468
+ }, p = () => {
469
+ if (!u)
470
470
  return;
471
- const [F, b] = "every" in o ? ["every", o.every] : ["some", o.some];
472
- for (let m = 0; m < b.length; m++) {
473
- const S = b[m], h = typeof S == "function" ? S() : ot(S, r()) ? void 0 : `it is unsupported in Mini Apps version ${r()}`;
474
- if (h && (F === "every" || m === b.length - 1))
475
- return h;
471
+ const [f, b] = "every" in u ? ["every", u.every] : ["some", u.some];
472
+ for (let d = 0; d < b.length; d++) {
473
+ const x = b[d], R = typeof x == "function" ? x() : ot(x, r()) ? void 0 : `it is unsupported in Mini Apps version ${r()}`;
474
+ if (R && (f === "every" || d === b.length - 1))
475
+ return R;
476
476
  }
477
- }, p = (...F) => {
477
+ }, l = (...f) => {
478
478
  for (const b in e.supports)
479
- if (e.supports[b].shouldCheck(...F) && !u(b))
479
+ if (e.supports[b].shouldCheck(...f) && !a(b))
480
480
  return `option ${b} is not supported in Mini Apps version ${r()}`;
481
- }, l = w(() => !a()), _ = w(() => r() !== "0.0"), f = w(() => e.isMounted ? e.isMounted() : !0), g = w(
482
- () => n() && _() && l() && f()
483
- ), C = (F) => {
484
- const b = new Xs(F);
485
- return ["task", "promise"].includes(e.returns) ? T(b) : M(b);
486
- };
481
+ }, m = w(() => !p()), _ = w(() => r() !== "0.0"), g = w(() => e.isMounted ? e.isMounted() : !0), C = w(
482
+ () => n() && _() && m() && g()
483
+ ), y = (f) => {
484
+ const b = new Xs(f);
485
+ return ["task", "promise"].includes(e.returns) ? $(b) : V(b);
486
+ }, S = (...f) => o === "plain" ? _s(() => s(...f), (b) => b) : o === "promise" ? js(() => s(...f), (b) => b) : s(...f);
487
487
  return Object.assign(
488
- (...F) => {
489
- var V;
488
+ (...f) => {
489
+ var R;
490
490
  const b = "Unable to call function:";
491
491
  if (!n())
492
- return C(`${b} it can't be called outside Mini Apps`);
492
+ return y(`${b} it can't be called outside Mini Apps`);
493
493
  if (!_())
494
- return C(`${b} the SDK was not initialized. Use the SDK init() function`);
495
- const m = a();
496
- if (m)
497
- return C(`${b} ${m}`);
498
- const S = p(...F);
499
- if (S)
500
- return C(`${b} ${S}`);
501
- if (!f()) {
502
- const L = (V = e.isMounting) != null && V.call(e) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
503
- return C(`${b} the component is ${L}`);
494
+ return y(`${b} the SDK was not initialized. Use the SDK init() function`);
495
+ const d = p();
496
+ if (d)
497
+ return y(`${b} ${d}`);
498
+ const x = l(...f);
499
+ if (x)
500
+ return y(`${b} ${x}`);
501
+ if (!g()) {
502
+ const T = (R = e.isMounting) != null && R.call(e) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
503
+ return y(`${b} the component is ${T}`);
504
504
  }
505
- const { returns: h } = e;
506
- return h === "plain" ? _s(() => s(...F), (L) => L) : h === "promise" ? js(() => s(...F), (L) => L) : s(...F);
505
+ return S(...f);
507
506
  },
508
507
  s,
509
508
  {
510
- isAvailable: g,
511
- ifAvailable(...F) {
512
- return g() ? ht(s(...F)) : it;
509
+ isAvailable: C,
510
+ ifAvailable(...f) {
511
+ return C() ? ht(S(...f)) : it;
513
512
  }
514
513
  },
515
- o ? { isSupported: l } : {},
516
- e.supports ? { supports: u } : {}
514
+ u ? { isSupported: m } : {},
515
+ e.supports ? { supports: a } : {}
517
516
  );
518
517
  }
519
518
  function E(s) {
520
519
  return (e) => A(e, s);
521
520
  }
522
- function d(s) {
521
+ function h(s) {
523
522
  return Object.assign(yt(s), {
524
523
  ifAvailable(...e) {
525
524
  return c(
@@ -603,7 +602,7 @@ class dt {
603
602
  this.mount = () => {
604
603
  if (this.isMounted())
605
604
  return I(void 0);
606
- const u = R(o) ? r() : void 0, a = u ? I(u) : typeof n == "function" ? n() : I(n);
605
+ const u = P(o) ? r() : void 0, a = u ? I(u) : typeof n == "function" ? n() : I(n);
607
606
  return c(a, D((p) => {
608
607
  Ct(() => {
609
608
  this._isMounted.set(!0), e == null || e(p);
@@ -627,7 +626,7 @@ class kt {
627
626
  postEvent: a,
628
627
  payload: p,
629
628
  method: l,
630
- version: _
629
+ version: m
631
630
  }) {
632
631
  /**
633
632
  * Signal indicating if the component is currently mounted.
@@ -708,44 +707,44 @@ class kt {
708
707
  * @see onClick
709
708
  */
710
709
  t(this, "unmount");
711
- const f = new tt({
710
+ const _ = new tt({
712
711
  initialState: o,
713
- onChange(m) {
714
- r.set(m);
712
+ onChange(f) {
713
+ r.set(f);
715
714
  }
716
715
  }), g = new dt({
717
716
  initialState: o,
718
717
  isPageReload: u,
719
- onMounted: f.setState,
718
+ onMounted: _.setState,
720
719
  restoreState: r.get
721
- }), C = { version: _, requires: l, isTma: e }, F = E({
720
+ }), C = { version: m, requires: l, isTma: e }, y = E({
722
721
  ...C,
723
722
  returns: "plain"
724
- }), b = E({
723
+ }), S = E({
725
724
  ...C,
726
725
  returns: "either",
727
726
  isMounted: g.isMounted
728
727
  });
729
- this.isMounted = g.isMounted, this.isSupported = z(l, _), this.state = f.state, this.setStateFp = b((m) => {
730
- const S = { ...this.state(), ...Mt(m) };
731
- return f.hasDiff(S) ? c(
732
- a(l, p(S)),
728
+ this.isMounted = g.isMounted, this.isSupported = z(l, m), this.state = _.state, this.setStateFp = S((f) => {
729
+ const b = { ...this.state(), ...Mt(f) };
730
+ return _.hasDiff(b) ? c(
731
+ a(l, p(b)),
733
732
  D(() => {
734
- f.setState(S);
733
+ _.setState(b);
735
734
  })
736
735
  ) : I(void 0);
737
- }), this.setState = d(this.setStateFp), this.onClickFp = F(n), this.onClick = d(this.onClickFp), this.offClickFp = F(i), this.offClick = d(this.offClickFp), this.mountFp = F(() => {
738
- const m = () => {
736
+ }), this.setState = h(this.setStateFp), this.onClickFp = y(n), this.onClick = h(this.onClickFp), this.offClickFp = y(i), this.offClick = h(this.offClickFp), this.mountFp = y(() => {
737
+ const f = () => {
739
738
  };
740
- return c(g.mount(), pt(m, m));
741
- }), this.mount = d(this.mountFp), this.unmount = g.unmount, this.stateSetters = (m) => {
742
- const S = b((h) => this.setStateFp({ [m]: h }));
743
- return [d(S), S];
744
- }, this.stateBoolSetters = (m) => {
745
- const [, S] = this.stateSetters(m), h = b(() => S(!1)), V = b(() => S(!0));
739
+ return c(g.mount(), pt(f, f));
740
+ }), this.mount = h(this.mountFp), this.unmount = g.unmount, this.stateSetters = (f) => {
741
+ const b = S((d) => this.setStateFp({ [f]: d }));
742
+ return [h(b), b];
743
+ }, this.stateBoolSetters = (f) => {
744
+ const [, b] = this.stateSetters(f), d = S(() => b(!1)), x = S(() => b(!0));
746
745
  return [
747
- [d(h), h],
748
- [d(V), V]
746
+ [h(d), d],
747
+ [h(x), x]
749
748
  ];
750
749
  };
751
750
  }
@@ -849,7 +848,7 @@ class nr {
849
848
  this.isVisible = r.stateGetter("isVisible"), this.isMounted = r.isMounted, this.isSupported = r.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = r.stateBoolSetters("isVisible"), 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;
850
849
  }
851
850
  }
852
- function v() {
851
+ function F() {
853
852
  return { isTma: w(() => Re()) };
854
853
  }
855
854
  function or(s) {
@@ -868,7 +867,7 @@ function ar() {
868
867
  return !!s && s.type === "reload";
869
868
  }
870
869
  function ft(s) {
871
- return (e) => ({ ...e, ...R(s) });
870
+ return (e) => ({ ...e, ...P(s) });
872
871
  }
873
872
  function et(s) {
874
873
  return ft({
@@ -880,15 +879,15 @@ function et(s) {
880
879
  function _t(s, e) {
881
880
  return j(s, e);
882
881
  }
883
- const ke = /* @__PURE__ */ _t(Pe), mt = (...s) => ke()(...s), ur = (...s) => ce(mt(...s)), $ = ft({
882
+ const ke = /* @__PURE__ */ _t(Pe), mt = (...s) => ke()(...s), ur = (...s) => ce(mt(...s)), L = ft({
884
883
  postEvent: mt
885
- }), Vt = /* @__PURE__ */ _t("0.0"), y = ft({ version: Vt });
884
+ }), Vt = /* @__PURE__ */ _t("0.0"), v = ft({ version: Vt });
886
885
  function Nt(s, e) {
887
886
  return {
888
887
  ...c(
889
- v(),
890
- $,
891
- y,
888
+ F(),
889
+ L,
890
+ v,
892
891
  et(s)
893
892
  ),
894
893
  onClick(r, n) {
@@ -924,10 +923,10 @@ class Jt {
924
923
  t(this, "unmount");
925
924
  this.mount = (u) => {
926
925
  if (this._isMounted())
927
- return x(void 0);
928
- const a = R(o) ? n() : void 0;
926
+ return q(void 0);
927
+ const a = P(o) ? n() : void 0;
929
928
  return c(
930
- a ? x(a) : e(u),
929
+ a ? q(a) : e(u),
931
930
  B((p) => {
932
931
  this._isMounted() || Ct(() => {
933
932
  this._isMounted.set(!0), r == null || r(p);
@@ -1044,9 +1043,9 @@ class cr {
1044
1043
  * Unmounts the component.
1045
1044
  */
1046
1045
  t(this, "unmount");
1047
- const l = (m) => {
1048
- _.setState(It(m));
1049
- }, _ = new tt({
1046
+ const l = (f) => {
1047
+ m.setState(It(f));
1048
+ }, m = new tt({
1050
1049
  initialState: {
1051
1050
  available: !1,
1052
1051
  type: "unknown",
@@ -1056,16 +1055,16 @@ class cr {
1056
1055
  tokenSaved: !1
1057
1056
  },
1058
1057
  onChange: i.set
1059
- }), f = new Jt({
1060
- initialState(m) {
1058
+ }), _ = new Jt({
1059
+ initialState(f) {
1061
1060
  return c(
1062
- r("web_app_biometry_get_info", "biometry_info_received", m),
1061
+ r("web_app_biometry_get_info", "biometry_info_received", f),
1063
1062
  B(It)
1064
1063
  );
1065
1064
  },
1066
1065
  isPageReload: p,
1067
- onMounted(m) {
1068
- _.setState(m), o(l);
1066
+ onMounted(f) {
1067
+ m.setState(f), o(l);
1069
1068
  },
1070
1069
  onUnmounted() {
1071
1070
  u(l);
@@ -1074,39 +1073,39 @@ class cr {
1074
1073
  }), g = { version: e, requires: "web_app_biometry_request_auth", isTma: a }, C = E({
1075
1074
  ...g,
1076
1075
  returns: "either"
1077
- }), F = E({
1076
+ }), y = E({
1078
1077
  ...g,
1079
1078
  returns: "task"
1080
- }), b = E({
1079
+ }), S = E({
1081
1080
  ...g,
1082
- isMounted: f.isMounted,
1081
+ isMounted: _.isMounted,
1083
1082
  returns: "task"
1084
1083
  });
1085
- this.isAvailable = _.getter("available"), this.isMounted = f.isMounted, this.isSupported = z("web_app_biometry_request_auth", e), this.state = _.state, this.unmount = f.unmount, this.mountFp = F(f.mount), this.authenticateFp = b((m) => this.isAvailable() ? c(
1084
+ this.isAvailable = m.getter("available"), this.isMounted = _.isMounted, this.isSupported = z("web_app_biometry_request_auth", e), this.state = m.state, this.unmount = _.unmount, this.mountFp = y(_.mount), this.authenticateFp = S((f) => this.isAvailable() ? c(
1086
1085
  r("web_app_biometry_request_auth", "biometry_auth_requested", {
1087
- ...m,
1088
- params: { reason: ((m || {}).reason || "").trim() }
1086
+ ...f,
1087
+ params: { reason: ((f || {}).reason || "").trim() }
1089
1088
  }),
1090
- B((S) => (_.setState({ token: S.token }), S))
1091
- ) : T(ue)), this.openSettingsFp = C(() => n("web_app_biometry_open_settings")), this.requestAccessFp = b((m) => c(
1089
+ B((b) => (m.setState({ token: b.token }), b))
1090
+ ) : $(ue)), this.openSettingsFp = C(() => n("web_app_biometry_open_settings")), this.requestAccessFp = S((f) => c(
1092
1091
  r("web_app_biometry_request_access", "biometry_info_received", {
1093
- ...m,
1094
- params: { reason: ((m || {}).reason || "").trim() }
1092
+ ...f,
1093
+ params: { reason: ((f || {}).reason || "").trim() }
1095
1094
  }),
1096
- Z((S) => {
1097
- const h = It(S);
1098
- return h.available ? (_.setState(h), x(h.accessRequested)) : T(ue);
1095
+ Z((b) => {
1096
+ const d = It(b);
1097
+ return d.available ? (m.setState(d), q(d.accessRequested)) : $(ue);
1099
1098
  })
1100
- )), this.updateTokenFp = b((m = {}) => {
1101
- var S;
1099
+ )), this.updateTokenFp = S((f = {}) => {
1100
+ var b;
1102
1101
  return c(
1103
1102
  r("web_app_biometry_update_token", "biometry_token_updated", {
1104
- ...m,
1105
- params: { token: m.token || "", reason: (S = m.reason) == null ? void 0 : S.trim() }
1103
+ ...f,
1104
+ params: { token: f.token || "", reason: (b = f.reason) == null ? void 0 : b.trim() }
1106
1105
  }),
1107
- B((h) => h.status)
1106
+ B((d) => d.status)
1108
1107
  );
1109
- }), this.authenticate = d(this.authenticateFp), this.openSettings = d(this.openSettingsFp), this.requestAccess = d(this.requestAccessFp), this.updateToken = d(this.updateTokenFp), this.mount = d(this.mountFp);
1108
+ }), this.authenticate = h(this.authenticateFp), this.openSettings = h(this.openSettingsFp), this.requestAccess = h(this.requestAccessFp), this.updateToken = h(this.updateTokenFp), this.mount = h(this.mountFp);
1110
1109
  }
1111
1110
  }
1112
1111
  const Ee = (s, e, r) => Oe(s, e, {
@@ -1116,9 +1115,9 @@ const Ee = (s, e, r) => Oe(s, e, {
1116
1115
  request: Ee
1117
1116
  }), En = new cr({
1118
1117
  ...c(
1119
- v(),
1120
- $,
1121
- y,
1118
+ F(),
1119
+ L,
1120
+ v,
1122
1121
  U,
1123
1122
  et("biometry")
1124
1123
  ),
@@ -1169,8 +1168,8 @@ class lr {
1169
1168
  t(this, "enableConfirmation");
1170
1169
  const o = new tt({
1171
1170
  initialState: { isConfirmationEnabled: !1 },
1172
- onChange(f) {
1173
- r.set(f);
1171
+ onChange(_) {
1172
+ r.set(_);
1174
1173
  }
1175
1174
  }), u = new dt({
1176
1175
  onMounted: o.setState,
@@ -1184,20 +1183,20 @@ class lr {
1184
1183
  ...a,
1185
1184
  returns: "either",
1186
1185
  isMounted: u.isMounted
1187
- }), _ = (f) => f === this.isConfirmationEnabled() ? I(void 0) : (o.setState({ isConfirmationEnabled: f }), e("web_app_setup_closing_behavior", {
1188
- need_confirmation: f
1186
+ }), m = (_) => _ === this.isConfirmationEnabled() ? I(void 0) : (o.setState({ isConfirmationEnabled: _ }), e("web_app_setup_closing_behavior", {
1187
+ need_confirmation: _
1189
1188
  }));
1190
- this.isConfirmationEnabled = o.getter("isConfirmationEnabled"), this.isMounted = u.isMounted, this.disableConfirmationFp = l(() => _(!1)), this.enableConfirmationFp = l(() => _(!0)), this.mountFp = p(() => {
1191
- const f = () => {
1189
+ this.isConfirmationEnabled = o.getter("isConfirmationEnabled"), this.isMounted = u.isMounted, this.disableConfirmationFp = l(() => m(!1)), this.enableConfirmationFp = l(() => m(!0)), this.mountFp = p(() => {
1190
+ const _ = () => {
1192
1191
  };
1193
- return c(u.mount(), pt(f, f));
1194
- }), this.unmount = u.unmount, this.disableConfirmation = d(this.disableConfirmationFp), this.enableConfirmation = d(this.enableConfirmationFp), this.mount = d(this.mountFp);
1192
+ return c(u.mount(), pt(_, _));
1193
+ }), this.unmount = u.unmount, this.disableConfirmation = h(this.disableConfirmationFp), this.enableConfirmation = h(this.enableConfirmationFp), this.mount = h(this.mountFp);
1195
1194
  }
1196
1195
  }
1197
1196
  const An = new lr(c(
1198
- v(),
1197
+ F(),
1199
1198
  et("closingBehavior"),
1200
- $
1199
+ L
1201
1200
  ));
1202
1201
  class pr {
1203
1202
  constructor({ version: e, isTma: r, invokeCustomMethod: n }) {
@@ -1279,7 +1278,7 @@ class pr {
1279
1278
  this.isSupported = z("web_app_invoke_custom_method", e), this.deleteItemFp = i((o, u) => {
1280
1279
  const a = Array.isArray(o) ? o : [o];
1281
1280
  return c(
1282
- a.length ? n("deleteStorageValues", { keys: a }, u) : x(void 0),
1281
+ a.length ? n("deleteStorageValues", { keys: a }, u) : q(void 0),
1283
1282
  B(() => {
1284
1283
  })
1285
1284
  );
@@ -1287,7 +1286,7 @@ class pr {
1287
1286
  this.getItemsFp([o], u),
1288
1287
  B((a) => a[o] || "")
1289
1288
  )), this.getItemsFp = i((o, u) => c(
1290
- o.length ? n("getStorageValues", { keys: o }, u) : x({}),
1289
+ o.length ? n("getStorageValues", { keys: o }, u) : q({}),
1291
1290
  B((a) => ({
1292
1291
  // Fulfill the response with probably missing keys.
1293
1292
  ...o.reduce((p, l) => (p[l] = "", p), {}),
@@ -1300,12 +1299,12 @@ class pr {
1300
1299
  n("saveStorageValue", { key: o, value: u }, a),
1301
1300
  B(() => {
1302
1301
  })
1303
- )), this.clearFp = i((o) => c(this.getKeysFp(o), Z(this.deleteItemFp))), this.deleteItem = d(this.deleteItemFp), this.getItem = d(this.getItemFp), this.getItems = d(this.getItemsFp), this.getKeys = d(this.getKeysFp), this.setItem = d(this.setItemFp), this.clear = d(this.clearFp);
1302
+ )), this.clearFp = i((o) => c(this.getKeysFp(o), Z(this.deleteItemFp))), this.deleteItem = h(this.deleteItemFp), this.getItem = h(this.getItemFp), this.getItems = h(this.getItemsFp), this.getKeys = h(this.getKeysFp), this.setItem = h(this.setItemFp), this.clear = h(this.clearFp);
1304
1303
  }
1305
1304
  }
1306
- const Bt = /* @__PURE__ */ _t(0);
1305
+ const xt = /* @__PURE__ */ _t(0);
1307
1306
  function Ae() {
1308
- return Bt.set(Bt() + 1), Bt().toString();
1307
+ return xt.set(xt() + 1), xt().toString();
1309
1308
  }
1310
1309
  function hr(s, e, r) {
1311
1310
  return De(s, e, Ae(), {
@@ -1316,8 +1315,8 @@ function hr(s, e, r) {
1316
1315
  const Yt = ft({
1317
1316
  invokeCustomMethod: hr
1318
1317
  }), In = new pr(c(
1319
- v(),
1320
- y,
1318
+ F(),
1319
+ v,
1321
1320
  Yt
1322
1321
  ));
1323
1322
  function dr({ request: s, ...e }) {
@@ -1327,10 +1326,10 @@ function dr({ request: s, ...e }) {
1327
1326
  ), { ...e, requires: "web_app_request_emoji_status_access", returns: "task" });
1328
1327
  }
1329
1328
  const fr = dr(c(
1330
- v(),
1331
- y,
1329
+ F(),
1330
+ v,
1332
1331
  U
1333
- )), Bn = d(fr);
1332
+ )), xn = h(fr);
1334
1333
  function _r({ request: s, ...e }) {
1335
1334
  return A((r, n) => c(
1336
1335
  s("web_app_set_emoji_status", ["emoji_status_set", "emoji_status_failed"], {
@@ -1340,7 +1339,7 @@ function _r({ request: s, ...e }) {
1340
1339
  },
1341
1340
  ...n
1342
1341
  }),
1343
- at((i) => i && "error" in i ? T(new tr(i.error)) : x(void 0))
1342
+ at((i) => i && "error" in i ? $(new tr(i.error)) : q(void 0))
1344
1343
  ), {
1345
1344
  ...e,
1346
1345
  requires: "web_app_set_emoji_status",
@@ -1348,10 +1347,10 @@ function _r({ request: s, ...e }) {
1348
1347
  });
1349
1348
  }
1350
1349
  const mr = _r(c(
1351
- v(),
1350
+ F(),
1352
1351
  U,
1353
- y
1354
- )), xn = d(mr);
1352
+ v
1353
+ )), Bn = h(mr);
1355
1354
  class br {
1356
1355
  constructor({ postEvent: e, isTma: r, version: n }) {
1357
1356
  /**
@@ -1400,22 +1399,22 @@ class br {
1400
1399
  version: n,
1401
1400
  returns: "plain"
1402
1401
  });
1403
- this.isSupported = z(i, n), this.impactOccurredFp = o((u) => e(i, { type: "impact", impact_style: u })), this.notificationOccurredFp = o((u) => e(i, { type: "notification", notification_type: u })), this.selectionChangedFp = o(() => e(i, { type: "selection_change" })), this.impactOccurred = d(this.impactOccurredFp), this.notificationOccurred = d(this.notificationOccurredFp), this.selectionChanged = d(this.selectionChangedFp);
1402
+ this.isSupported = z(i, n), this.impactOccurredFp = o((u) => e(i, { type: "impact", impact_style: u })), this.notificationOccurredFp = o((u) => e(i, { type: "notification", notification_type: u })), this.selectionChangedFp = o(() => e(i, { type: "selection_change" })), this.impactOccurred = h(this.impactOccurredFp), this.notificationOccurred = h(this.notificationOccurredFp), this.selectionChanged = h(this.selectionChangedFp);
1404
1403
  }
1405
1404
  }
1406
1405
  const qn = new br(c(
1407
- v(),
1408
- $,
1409
- y
1406
+ F(),
1407
+ L,
1408
+ v
1410
1409
  ));
1411
1410
  function gr({ postEvent: s, ...e }) {
1412
1411
  return A(() => s("web_app_add_to_home_screen"), { ...e, requires: "web_app_add_to_home_screen", returns: "either" });
1413
1412
  }
1414
1413
  const wr = gr(c(
1415
- v(),
1416
- y,
1417
- $
1418
- )), Mn = d(wr);
1414
+ F(),
1415
+ v,
1416
+ L
1417
+ )), Mn = h(wr);
1419
1418
  function Fr({ request: s, ...e }) {
1420
1419
  return A((r) => c(
1421
1420
  s("web_app_check_home_screen", "home_screen_checked", r),
@@ -1423,10 +1422,10 @@ function Fr({ request: s, ...e }) {
1423
1422
  ), { ...e, requires: "web_app_check_home_screen", returns: "task" });
1424
1423
  }
1425
1424
  const Cr = Fr(c(
1426
- v(),
1427
- y,
1425
+ F(),
1426
+ v,
1428
1427
  U
1429
- )), Vn = d(Cr);
1428
+ )), Vn = h(Cr);
1430
1429
  class Sr {
1431
1430
  constructor({ retrieveInitData: e }) {
1432
1431
  t(this, "_state", j());
@@ -1576,7 +1575,7 @@ class vr {
1576
1575
  o.set(!1);
1577
1576
  };
1578
1577
  this.isSupported = z("web_app_open_invoice", e), this.isOpened = w(o), this.openSlugFp = i((a, p) => c(
1579
- this.isOpened() ? T(new zt("Invoice is already opened")) : x(void 0),
1578
+ this.isOpened() ? $(new zt("Invoice is already opened")) : q(void 0),
1580
1579
  Z(() => (o.set(!0), r("web_app_open_invoice", "invoice_closed", {
1581
1580
  ...p,
1582
1581
  params: { slug: a },
@@ -1584,24 +1583,24 @@ class vr {
1584
1583
  }))),
1585
1584
  Wt((l) => (u(), l), (l) => (u(), l.status))
1586
1585
  )), this.openUrlFp = i((a, p) => {
1587
- const { hostname: l, pathname: _ } = new URL(a, window.location.href);
1586
+ const { hostname: l, pathname: m } = new URL(a, window.location.href);
1588
1587
  if (l !== "t.me")
1589
- return T(new Q(`Link has unexpected hostname: ${l}`));
1590
- const f = _.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1591
- return f ? this.openSlugFp(f[2], p) : T(new Q(
1588
+ return $(new Q(`Link has unexpected hostname: ${l}`));
1589
+ const _ = m.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1590
+ return _ ? this.openSlugFp(_[2], p) : $(new Q(
1592
1591
  'Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'
1593
1592
  ));
1594
- }), this.openUrl = d(this.openUrlFp), this.openSlug = d(this.openSlugFp);
1593
+ }), this.openUrl = h(this.openUrlFp), this.openSlug = h(this.openSlugFp);
1595
1594
  }
1596
1595
  }
1597
- const $n = new vr(c(v(), U, y));
1596
+ const $n = new vr(c(F(), U, v));
1598
1597
  function yr({ postEvent: s, ...e }) {
1599
1598
  return A((r, n = {}) => {
1600
1599
  if (typeof r == "string")
1601
1600
  try {
1602
1601
  r = new URL(r);
1603
1602
  } catch (i) {
1604
- return M(new Q(`"${r.toString()}" is invalid URL`, i));
1603
+ return V(new Q(`"${r.toString()}" is invalid URL`, i));
1605
1604
  }
1606
1605
  return s("web_app_open_link", {
1607
1606
  url: r.toString(),
@@ -1611,30 +1610,30 @@ function yr({ postEvent: s, ...e }) {
1611
1610
  }, { ...e, returns: "either" });
1612
1611
  }
1613
1612
  const kr = yr(c(
1614
- v(),
1615
- $
1616
- )), Ln = d(kr);
1613
+ F(),
1614
+ L
1615
+ )), Ln = h(kr);
1617
1616
  function Er({ postEvent: s, version: e, ...r }) {
1618
1617
  return A((n) => {
1619
1618
  const i = n.toString();
1620
- return i.match(/^https:\/\/t.me\/.+/) ? ot("web_app_open_tg_link", R(e)) ? (n = new URL(n), s("web_app_open_tg_link", { path_full: n.pathname + n.search })) : (window.location.href = i, I(void 0)) : M(new Q(`"${i}" is invalid URL`));
1619
+ return i.match(/^https:\/\/t.me\/.+/) ? ot("web_app_open_tg_link", P(e)) ? (n = new URL(n), s("web_app_open_tg_link", { path_full: n.pathname + n.search })) : (window.location.href = i, I(void 0)) : V(new Q(`"${i}" is invalid URL`));
1621
1620
  }, { ...r, returns: "either" });
1622
1621
  }
1623
1622
  const Ie = Er(c(
1624
- v(),
1625
- $,
1626
- y
1627
- )), Rn = d(Ie);
1623
+ F(),
1624
+ L,
1625
+ v
1626
+ )), Rn = h(Ie);
1628
1627
  function Ar({ openTelegramLink: s, ...e }) {
1629
1628
  return A((r, n) => s(
1630
1629
  "https://t.me/share/url?" + new URLSearchParams({ url: r, text: n || "" }).toString().replace(/\+/g, "%20")
1631
1630
  ), { ...e, returns: "either" });
1632
1631
  }
1633
1632
  const Ir = Ar({
1634
- ...v(),
1633
+ ...F(),
1635
1634
  openTelegramLink: Ie
1636
- }), Pn = d(Ir);
1637
- function Br(s) {
1635
+ }), Pn = h(Ir);
1636
+ function xr(s) {
1638
1637
  let e = !1, r, n;
1639
1638
  return s.available && (e = !0, r = s.access_requested, n = s.access_granted), {
1640
1639
  available: e,
@@ -1642,7 +1641,7 @@ function Br(s) {
1642
1641
  accessRequested: r || !1
1643
1642
  };
1644
1643
  }
1645
- class xr {
1644
+ class Br {
1646
1645
  constructor({
1647
1646
  version: e,
1648
1647
  request: r,
@@ -1725,13 +1724,13 @@ class xr {
1725
1724
  initialState(C) {
1726
1725
  return c(
1727
1726
  r("web_app_check_location", "location_checked", C),
1728
- B(Br)
1727
+ B(xr)
1729
1728
  );
1730
1729
  }
1731
- }), l = { version: e, requires: "web_app_check_location", isTma: o }, _ = E({
1730
+ }), l = { version: e, requires: "web_app_check_location", isTma: o }, m = E({
1732
1731
  ...l,
1733
1732
  returns: "either"
1734
- }), f = E({
1733
+ }), _ = E({
1735
1734
  ...l,
1736
1735
  returns: "task"
1737
1736
  }), g = E({
@@ -1739,21 +1738,21 @@ class xr {
1739
1738
  returns: "task",
1740
1739
  isMounted: p.isMounted
1741
1740
  });
1742
- this.isAvailable = a.getter("available"), this.isAccessRequested = a.getter("accessRequested"), this.isAccessGranted = a.getter("accessGranted"), this.isSupported = z("web_app_check_location", e), this.isMounted = p.isMounted, this.state = a.state, this.unmount = p.unmount, this.mountFp = f(p.mount), this.openSettingsFp = _(() => n("web_app_open_location_settings")), this.requestLocationFp = g((C) => c(
1741
+ this.isAvailable = a.getter("available"), this.isAccessRequested = a.getter("accessRequested"), this.isAccessGranted = a.getter("accessGranted"), this.isSupported = z("web_app_check_location", e), this.isMounted = p.isMounted, this.state = a.state, this.unmount = p.unmount, this.mountFp = _(p.mount), this.openSettingsFp = m(() => n("web_app_open_location_settings")), this.requestLocationFp = g((C) => c(
1743
1742
  r("web_app_request_location", "location_requested", C),
1744
- B((F) => {
1745
- if (!F.available)
1743
+ B((y) => {
1744
+ if (!y.available)
1746
1745
  return a.setState({ available: !1 }), null;
1747
- const { available: b, ...m } = F;
1748
- return m;
1746
+ const { available: S, ...f } = y;
1747
+ return f;
1749
1748
  })
1750
- )), this.mount = d(this.mountFp), this.openSettings = d(this.openSettingsFp), this.requestLocation = d(this.requestLocationFp);
1749
+ )), this.mount = h(this.mountFp), this.openSettings = h(this.openSettingsFp), this.requestLocation = h(this.requestLocationFp);
1751
1750
  }
1752
1751
  }
1753
- const On = new xr(c(
1754
- v(),
1755
- $,
1756
- y,
1752
+ const On = new Br(c(
1753
+ F(),
1754
+ L,
1755
+ v,
1757
1756
  U,
1758
1757
  et("locationManager")
1759
1758
  ));
@@ -1968,7 +1967,7 @@ class qr {
1968
1967
  })
1969
1968
  }), i = (o, u) => {
1970
1969
  const a = n.stateGetter(o);
1971
- return w(() => a() || R(u));
1970
+ return w(() => a() || P(u));
1972
1971
  };
1973
1972
  this.bgColor = i("bgColor", e.bgColor), this.textColor = i("textColor", e.textColor), this.hasShineEffect = n.stateGetter("hasShineEffect"), this.isEnabled = n.stateGetter("isEnabled"), this.isLoaderVisible = n.stateGetter("isLoaderVisible"), this.text = n.stateGetter("text"), this.isVisible = n.stateGetter("isVisible"), this.isMounted = n.isMounted, this.state = n.state, [this.setBgColor, this.setBgColorFp] = n.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = n.stateSetters("textColor"), [
1974
1973
  [this.disableShineEffect, this.disableShineEffectFp],
@@ -1983,7 +1982,7 @@ class qr {
1983
1982
  }
1984
1983
  //#endregion
1985
1984
  }
1986
- function Be(s, e, r) {
1985
+ function xe(s, e, r) {
1987
1986
  return c(
1988
1987
  Nt(s, e),
1989
1988
  (n) => ({ ...n, defaults: r })
@@ -2007,7 +2006,7 @@ function Mr(s) {
2007
2006
  ) < 120)
2008
2007
  );
2009
2008
  }
2010
- const xe = yt(Mr);
2009
+ const Be = yt(Mr);
2011
2010
  class Vr {
2012
2011
  constructor({
2013
2012
  initialState: e,
@@ -2097,7 +2096,7 @@ class Vr {
2097
2096
  */
2098
2097
  t(this, "isDark", w(() => {
2099
2098
  const e = this.bgColor();
2100
- return !e || xe(e);
2099
+ return !e || Be(e);
2101
2100
  }));
2102
2101
  //#endregion
2103
2102
  //#region Mounting.
@@ -2123,7 +2122,7 @@ class Vr {
2123
2122
  }), p = (C) => {
2124
2123
  a.setState(C.theme_params);
2125
2124
  }, l = new dt({
2126
- initialState: () => I(R(e)),
2125
+ initialState: () => I(P(e)),
2127
2126
  isPageReload: u,
2128
2127
  onMounted(C) {
2129
2128
  a.setState(C), r(p);
@@ -2132,33 +2131,33 @@ class Vr {
2132
2131
  n(p);
2133
2132
  },
2134
2133
  restoreState: o.get
2135
- }), _ = { isTma: i, returns: "either" }, f = E(_), g = E({
2136
- ..._,
2134
+ }), m = { isTma: i, returns: "either" }, _ = E(m), g = E({
2135
+ ...m,
2137
2136
  isMounted: l.isMounted
2138
2137
  });
2139
2138
  this.accentTextColor = a.getter("accent_text_color"), this.bgColor = a.getter("bg_color"), this.buttonColor = a.getter("button_color"), this.buttonTextColor = a.getter("button_text_color"), this.bottomBarBgColor = a.getter("bottom_bar_bg_color"), this.destructiveTextColor = a.getter("destructive_text_color"), this.headerBgColor = a.getter("header_bg_color"), this.hintColor = a.getter("hint_color"), this.linkColor = a.getter("link_color"), this.secondaryBgColor = a.getter("secondary_bg_color"), this.sectionBgColor = a.getter("section_bg_color"), this.sectionHeaderTextColor = a.getter("section_header_text_color"), this.sectionSeparatorColor = a.getter("section_separator_color"), this.subtitleTextColor = a.getter("subtitle_text_color"), this.textColor = a.getter("text_color"), this.state = a.state, this.isMounted = l.isMounted, this.bindCssVarsFp = g((C) => {
2140
2139
  if (this._isCssVarsBound())
2141
- return M(new Qt());
2142
- C || (C = (m) => `--tg-theme-${We(m)}`);
2143
- const F = (m) => {
2144
- Object.entries(a.state()).forEach(([S, h]) => {
2145
- h && m(S, h);
2140
+ return V(new Qt());
2141
+ C || (C = (f) => `--tg-theme-${We(f)}`);
2142
+ const y = (f) => {
2143
+ Object.entries(a.state()).forEach(([b, d]) => {
2144
+ d && f(b, d);
2146
2145
  });
2147
- }, b = () => {
2148
- F((m, S) => {
2149
- Zt(C(m), S);
2146
+ }, S = () => {
2147
+ y((f, b) => {
2148
+ Zt(C(f), b);
2150
2149
  });
2151
2150
  };
2152
- return b(), a.state.sub(b), this._isCssVarsBound.set(!0), I(() => {
2153
- F(Xt), a.state.unsub(b), this._isCssVarsBound.set(!1);
2151
+ return S(), a.state.sub(S), this._isCssVarsBound.set(!0), I(() => {
2152
+ y(Xt), a.state.unsub(S), this._isCssVarsBound.set(!1);
2154
2153
  });
2155
- }), this.mountFp = f(l.mount), this.unmount = l.unmount, this.bindCssVars = d(this.bindCssVarsFp), this.mount = d(this.mountFp);
2154
+ }), this.mountFp = _(l.mount), this.unmount = l.unmount, this.bindCssVars = h(this.bindCssVarsFp), this.mount = h(this.mountFp);
2156
2155
  }
2157
2156
  //#endregion
2158
2157
  }
2159
2158
  const vt = new Vr({
2160
2159
  ...c(
2161
- v(),
2160
+ F(),
2162
2161
  et("themeParams")
2163
2162
  ),
2164
2163
  offChange(s) {
@@ -2169,7 +2168,7 @@ const vt = new Vr({
2169
2168
  },
2170
2169
  initialState: Tt
2171
2170
  }), Dn = new qr(
2172
- Be("mainButton", "main_button_pressed", {
2171
+ xe("mainButton", "main_button_pressed", {
2173
2172
  bgColor: w(() => vt.buttonColor() || "#2481cc"),
2174
2173
  textColor: w(() => vt.buttonTextColor() || "#ffffff")
2175
2174
  })
@@ -2195,7 +2194,7 @@ class Tr {
2195
2194
  */
2196
2195
  t(this, "isDark", w(() => {
2197
2196
  const e = this.bgColorRgb();
2198
- return e ? xe(e) : !1;
2197
+ return e ? Be(e) : !1;
2199
2198
  }));
2200
2199
  /**
2201
2200
  * Signal indicating if the mini app is currently active.
@@ -2353,44 +2352,43 @@ class Tr {
2353
2352
  * @see readyFp
2354
2353
  */
2355
2354
  t(this, "ready");
2356
- const l = (h) => {
2357
- g.setState({ isActive: h.is_visible });
2358
- }, _ = (h) => {
2355
+ const l = (d) => {
2356
+ g.setState({ isActive: d.is_visible });
2357
+ }, m = (d) => {
2359
2358
  [
2360
2359
  [this.headerColor, "web_app_set_header_color"],
2361
2360
  [this.bgColor, "web_app_set_background_color"],
2362
2361
  [this.bottomBarColor, "web_app_set_bottom_bar_color"]
2363
- ].forEach(([V, L]) => {
2364
- const P = V();
2365
- if (!Et(P) && (L === "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(P))) {
2366
- const O = h[P];
2367
- O && i(L, { color: O });
2362
+ ].forEach(([x, R]) => {
2363
+ const T = x();
2364
+ if (!Et(T) && (R === "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(T))) {
2365
+ const O = d[T];
2366
+ O && i(R, { color: O });
2368
2367
  }
2369
2368
  });
2370
- }, f = new dt({
2369
+ }, _ = new dt({
2371
2370
  initialState() {
2372
- const h = R(u);
2373
2371
  return I({
2374
- bgColor: h.bg_color || "bg_color",
2375
- headerColor: h.header_bg_color || "header_bg_color",
2376
- bottomBarColor: h.bottom_bar_bg_color || "bottom_bar_bg_color",
2372
+ bgColor: "bg_color",
2373
+ headerColor: "header_bg_color",
2374
+ bottomBarColor: "bottom_bar_bg_color",
2377
2375
  isActive: !0
2378
2376
  });
2379
2377
  },
2380
2378
  isPageReload: r,
2381
- onMounted: (h) => {
2382
- this.setBgColorFp.ifAvailable(h.bgColor), this.setBottomBarColorFp.ifAvailable(h.bottomBarColor), this.setHeaderColorFp.ifAvailable(h.headerColor), a(l), u.sub(_), g.setState(h);
2379
+ onMounted: (d) => {
2380
+ a(l), u.sub(m), g.setState(d);
2383
2381
  },
2384
2382
  onUnmounted() {
2385
- p(l), u.unsub(_);
2383
+ p(l), u.unsub(m);
2386
2384
  },
2387
2385
  restoreState: e.get
2388
2386
  });
2389
- this.isMounted = f.isMounted, this.mountFp = A(() => {
2390
- const h = () => {
2387
+ this.isMounted = _.isMounted, this.mountFp = A(() => {
2388
+ const d = () => {
2391
2389
  };
2392
- return c(f.mount(), pt(h, h));
2393
- }, { isTma: o, returns: "plain" }), this.mount = d(this.mountFp), this.unmount = f.unmount;
2390
+ return c(_.mount(), pt(d, d));
2391
+ }, { isTma: o, returns: "plain" }), this.mount = h(this.mountFp), this.unmount = _.unmount;
2394
2392
  const g = new tt({
2395
2393
  initialState: {
2396
2394
  bgColor: "bg_color",
@@ -2401,52 +2399,52 @@ class Tr {
2401
2399
  onChange: e.set
2402
2400
  });
2403
2401
  this.state = g.state;
2404
- const C = (h) => Et(h) ? h : R(u)[h], F = (h) => w(() => C(h()));
2402
+ const C = (d) => Et(d) ? d : P(u)[d], y = (d) => w(() => C(d()));
2405
2403
  this.isActive = g.getter("isActive"), this.isSupported = w(() => [
2406
2404
  "web_app_set_header_color",
2407
2405
  "web_app_set_background_color",
2408
2406
  "web_app_set_bottom_bar_color"
2409
- ].some((h) => ot(h, R(n))));
2410
- const b = j(!1);
2411
- this.isCssVarsBound = w(b), this.bindCssVarsFp = A((h) => {
2412
- if (b())
2413
- return M(new Qt());
2414
- const [V, L] = Lt(() => {
2415
- b.set(!1);
2416
- }), P = (O, G) => {
2407
+ ].some((d) => ot(d, P(n))));
2408
+ const S = j(!1);
2409
+ this.isCssVarsBound = w(S), this.bindCssVarsFp = A((d) => {
2410
+ if (S())
2411
+ return V(new Qt());
2412
+ const [x, R] = Lt(() => {
2413
+ S.set(!1);
2414
+ }), T = (O, G) => {
2417
2415
  const H = () => {
2418
2416
  Zt(O, G() || null);
2419
2417
  };
2420
- H(), V(G.sub(H), Xt.bind(null, O));
2418
+ H(), x(G.sub(H), Xt.bind(null, O));
2421
2419
  };
2422
- return h || (h = (O) => `--tg-${le(O)}`), P(h("bgColor"), this.bgColorRgb), P(h("bottomBarColor"), this.bottomBarColorRgb), P(h("headerColor"), this.headerColorRgb), b.set(!0), I(L);
2423
- }, { isTma: o, returns: "either", isMounted: this.isMounted }), this.bindCssVars = d(this.bindCssVarsFp);
2424
- const m = (h) => {
2425
- const V = g.getter(h), L = F(V), P = {
2420
+ return d || (d = (O) => `--tg-${le(O)}`), T(d("bgColor"), this.bgColorRgb), T(d("bottomBarColor"), this.bottomBarColorRgb), T(d("headerColor"), this.headerColorRgb), S.set(!0), I(R);
2421
+ }, { isTma: o, returns: "either", isMounted: this.isMounted }), this.bindCssVars = h(this.bindCssVarsFp);
2422
+ const f = (d) => {
2423
+ const x = g.getter(d), R = y(x), T = {
2426
2424
  headerColor: "web_app_set_header_color",
2427
2425
  bgColor: "web_app_set_background_color",
2428
2426
  bottomBarColor: "web_app_set_bottom_bar_color"
2429
- }[h], O = A(
2427
+ }[d], O = A(
2430
2428
  (G) => {
2431
- if (G === V())
2429
+ if (G === x())
2432
2430
  return I(void 0);
2433
- if (P === "web_app_set_header_color" && (G === "bg_color" || G === "secondary_bg_color"))
2431
+ if (T === "web_app_set_header_color" && (G === "bg_color" || G === "secondary_bg_color"))
2434
2432
  return i("web_app_set_header_color", { color_key: G });
2435
2433
  const H = C(G);
2436
2434
  return c(
2437
- H ? i(P, { color: H }) : M(new rr(G)),
2435
+ H ? i(T, { color: H }) : V(new rr(G)),
2438
2436
  D(() => {
2439
- g.setState({ [h]: H });
2437
+ g.setState({ [d]: H });
2440
2438
  })
2441
2439
  );
2442
2440
  },
2443
2441
  {
2444
2442
  isTma: o,
2445
2443
  version: n,
2446
- requires: P,
2444
+ requires: T,
2447
2445
  isMounted: this.isMounted,
2448
2446
  returns: "either",
2449
- supports: h === "headerColor" ? {
2447
+ supports: d === "headerColor" ? {
2450
2448
  rgb: {
2451
2449
  method: "web_app_set_header_color",
2452
2450
  param: "color",
@@ -2455,34 +2453,34 @@ class Tr {
2455
2453
  } : void 0
2456
2454
  }
2457
2455
  );
2458
- return [V, L, d(O), O];
2456
+ return [x, R, h(O), O];
2459
2457
  };
2460
2458
  [
2461
2459
  this.bgColor,
2462
2460
  this.bgColorRgb,
2463
2461
  this.setBgColor,
2464
2462
  this.setBgColorFp
2465
- ] = m("bgColor"), [
2463
+ ] = f("bgColor"), [
2466
2464
  this.headerColor,
2467
2465
  this.headerColorRgb,
2468
2466
  this.setHeaderColor,
2469
2467
  this.setHeaderColorFp
2470
- ] = m("headerColor"), [
2468
+ ] = f("headerColor"), [
2471
2469
  this.bottomBarColor,
2472
2470
  this.bottomBarColorRgb,
2473
2471
  this.setBottomBarColor,
2474
2472
  this.setBottomBarColorFp
2475
- ] = m("bottomBarColor");
2476
- const S = E({ isTma: o, returns: "either" });
2477
- this.closeFp = S((h) => i("web_app_close", { return_back: h })), this.close = d(this.closeFp), this.readyFp = S(() => i("web_app_ready")), this.ready = d(this.readyFp);
2473
+ ] = f("bottomBarColor");
2474
+ const b = E({ isTma: o, returns: "either" });
2475
+ this.closeFp = b((d) => i("web_app_close", { return_back: d })), this.close = h(this.closeFp), this.readyFp = b(() => i("web_app_ready")), this.ready = h(this.readyFp);
2478
2476
  }
2479
2477
  //#endregion
2480
2478
  }
2481
2479
  const $r = new Tr({
2482
2480
  ...c(
2483
- v(),
2484
- $,
2485
- y,
2481
+ F(),
2482
+ L,
2483
+ v,
2486
2484
  et("miniApp")
2487
2485
  ),
2488
2486
  offVisibilityChanged(s) {
@@ -2496,11 +2494,11 @@ const $r = new Tr({
2496
2494
  function Lr(s) {
2497
2495
  const e = s.message.trim(), r = (s.title || "").trim(), n = s.buttons || [];
2498
2496
  if (r.length > 64)
2499
- return M(new Q(`Invalid title: ${r}`));
2497
+ return V(new Q(`Invalid title: ${r}`));
2500
2498
  if (!e || e.length > 256)
2501
- return M(new Q(`Invalid message: ${e}`));
2499
+ return V(new Q(`Invalid message: ${e}`));
2502
2500
  if (n.length > 3)
2503
- return M(new Q(`Invalid buttons count: ${n.length}`));
2501
+ return V(new Q(`Invalid buttons count: ${n.length}`));
2504
2502
  const i = [];
2505
2503
  if (!n.length)
2506
2504
  i.push({ type: "close", id: "" });
@@ -2508,11 +2506,11 @@ function Lr(s) {
2508
2506
  for (let o = 0; o < n.length; o++) {
2509
2507
  const u = n[o], a = u.id || "";
2510
2508
  if (a.length > 64)
2511
- return M(new Q(`Button with index ${o} has invalid id: ${a}`));
2509
+ return V(new Q(`Button with index ${o} has invalid id: ${a}`));
2512
2510
  if (!u.type || u.type === "default" || u.type === "destructive") {
2513
2511
  const p = u.text.trim();
2514
2512
  if (!p || p.length > 64)
2515
- return M(new Q(`Button with index ${o} has invalid text: ${p}`));
2513
+ return V(new Q(`Button with index ${o} has invalid text: ${p}`));
2516
2514
  i.push({ type: u.type, text: p, id: a });
2517
2515
  } else
2518
2516
  i.push({ type: u.type, id: a });
@@ -2568,7 +2566,7 @@ class Rr {
2568
2566
  returns: "task"
2569
2567
  });
2570
2568
  this.isSupported = z("web_app_open_popup", e), this.isOpened = w(i), this.showFp = u((a) => c(
2571
- this.isOpened() ? T(new zt("A popup is already opened")) : x(void 0),
2569
+ this.isOpened() ? $(new zt("A popup is already opened")) : q(void 0),
2572
2570
  at(() => ve(Lr(a))),
2573
2571
  Z((p) => (i.set(!0), n("web_app_open_popup", "popup_closed", {
2574
2572
  ...a,
@@ -2578,10 +2576,10 @@ class Rr {
2578
2576
  (p) => (o(), p),
2579
2577
  (p) => (o(), p.button_id)
2580
2578
  )
2581
- )), this.show = d(this.showFp);
2579
+ )), this.show = h(this.showFp);
2582
2580
  }
2583
2581
  }
2584
- const Un = new Rr(c(v(), U, y));
2582
+ const Un = new Rr(c(F(), U, v));
2585
2583
  function Pr({ request: s, ...e }) {
2586
2584
  return A((r) => c(
2587
2585
  s("web_app_request_phone", "phone_requested", r),
@@ -2589,10 +2587,10 @@ function Pr({ request: s, ...e }) {
2589
2587
  ), { ...e, requires: "web_app_request_phone", returns: "task" });
2590
2588
  }
2591
2589
  const qe = Pr(c(
2592
- v(),
2593
- y,
2590
+ F(),
2591
+ v,
2594
2592
  U
2595
- )), Gn = d(qe);
2593
+ )), Gn = h(qe);
2596
2594
  function Or({
2597
2595
  invokeCustomMethod: s,
2598
2596
  requestPhoneAccess: e,
@@ -2606,9 +2604,9 @@ function Or({
2606
2604
  at((a) => {
2607
2605
  const p = qt(J(), a);
2608
2606
  if (!p.success)
2609
- return T(new Ft(a, p.issues));
2607
+ return $(new Ft(a, p.issues));
2610
2608
  if (!p.output)
2611
- return x(void 0);
2609
+ return q(void 0);
2612
2610
  const l = qt(
2613
2611
  ze(
2614
2612
  oe({
@@ -2620,7 +2618,7 @@ function Or({
2620
2618
  })),
2621
2619
  auth_date: pe(
2622
2620
  J(),
2623
- he((_) => new Date(Number(_) * 1e3)),
2621
+ he((m) => new Date(Number(m) * 1e3)),
2624
2622
  de()
2625
2623
  ),
2626
2624
  hash: J()
@@ -2628,7 +2626,7 @@ function Or({
2628
2626
  ),
2629
2627
  p.output
2630
2628
  );
2631
- return l.success ? x({ raw: p.output, parsed: l.output }) : T(new Ft(p.output, l.issues));
2629
+ return l.success ? q({ raw: p.output, parsed: l.output }) : $(new Ft(p.output, l.issues));
2632
2630
  })
2633
2631
  ), i = (u) => c(
2634
2632
  n(u),
@@ -2636,29 +2634,29 @@ function Or({
2636
2634
  // All other errors except validation ones should be ignored. Receiving validation error
2637
2635
  // means that we have some data, but we are unable to parse it properly. So, there is no
2638
2636
  // need to make some more requests further, the problem is local.
2639
- (a) => Ft.is(a) ? M(a) : I(void 0),
2637
+ (a) => Ft.is(a) ? V(a) : I(void 0),
2640
2638
  (a) => I(a)
2641
2639
  )
2642
- ), o = (u) => xt(
2640
+ ), o = (u) => Bt(
2643
2641
  async (a, p, l) => {
2644
- let _ = 50;
2642
+ let m = 50;
2645
2643
  for (; !l.isRejected; ) {
2646
- const f = await i(l)();
2647
- if (f._tag === "Left")
2648
- return p(f.left);
2649
- if (f.right)
2650
- return a(f.right);
2651
- await new Promise((g) => setTimeout(g, _)), _ += 50;
2644
+ const _ = await i(l)();
2645
+ if (_._tag === "Left")
2646
+ return p(_.left);
2647
+ if (_.right)
2648
+ return a(_.right);
2649
+ await new Promise((g) => setTimeout(g, m)), m += 50;
2652
2650
  }
2653
2651
  },
2654
2652
  u
2655
2653
  );
2656
- return A((u) => xt.fn((a) => c(
2654
+ return A((u) => Bt.fn((a) => c(
2657
2655
  // Try to get the requested contact. Probably, we already requested it before.
2658
2656
  i(a),
2659
- Z((p) => p ? x(p) : c(
2657
+ Z((p) => p ? q(p) : c(
2660
2658
  e(a),
2661
- at((l) => l === "sent" ? o(a) : T(new ye("User denied access")))
2659
+ at((l) => l === "sent" ? o(a) : $(new ye("User denied access")))
2662
2660
  ))
2663
2661
  ), u), { ...r, returns: "task", requires: "web_app_request_phone" });
2664
2662
  }
@@ -2669,17 +2667,17 @@ function Dr({ requestContact: s, ...e }) {
2669
2667
  );
2670
2668
  }
2671
2669
  const Me = Or({
2672
- ...c(v(), Yt, y),
2670
+ ...c(F(), Yt, v),
2673
2671
  requestPhoneAccess: qe
2674
- }), jn = d(Me), Ur = Dr({
2675
- ...c(v(), y),
2672
+ }), jn = h(Me), Ur = Dr({
2673
+ ...c(F(), v),
2676
2674
  requestContact(s) {
2677
2675
  return c(
2678
2676
  Me(s),
2679
2677
  B((e) => e.parsed)
2680
2678
  );
2681
2679
  }
2682
- }), Hn = d(Ur);
2680
+ }), Hn = h(Ur);
2683
2681
  function Gr({ request: s, ...e }) {
2684
2682
  return A((r) => c(
2685
2683
  s("web_app_request_write_access", "write_access_requested", r),
@@ -2687,10 +2685,10 @@ function Gr({ request: s, ...e }) {
2687
2685
  ), { ...e, requires: "web_app_request_write_access", returns: "task" });
2688
2686
  }
2689
2687
  const jr = Gr(c(
2690
- v(),
2691
- y,
2688
+ F(),
2689
+ v,
2692
2690
  U
2693
- )), Wn = d(jr);
2691
+ )), Wn = h(jr);
2694
2692
  class Hr {
2695
2693
  constructor({
2696
2694
  version: e,
@@ -2717,7 +2715,7 @@ class Hr {
2717
2715
  * @since Mini Apps v6.4
2718
2716
  * @example
2719
2717
  * pipe(
2720
- * qrScanner.captureOneFp({
2718
+ * qrScanner.captureFp({
2721
2719
  * capture(scannedQr) {
2722
2720
  * return scannedQr === 'any expected by me qr';
2723
2721
  * }
@@ -2778,36 +2776,36 @@ class Hr {
2778
2776
  * @see openFp
2779
2777
  */
2780
2778
  t(this, "open");
2781
- const u = { version: e, requires: "web_app_open_scan_qr_popup", isTma: i }, a = E({ ...u, returns: "either" }), p = E({ ...u, returns: "task" }), l = j(!1), _ = () => {
2779
+ const u = { version: e, requires: "web_app_open_scan_qr_popup", isTma: i }, a = E({ ...u, returns: "either" }), p = E({ ...u, returns: "task" }), l = j(!1), m = () => {
2782
2780
  l.set(!1);
2783
2781
  };
2784
- this.isSupported = z("web_app_open_scan_qr_popup", e), this.isOpened = w(l), this.captureFp = p((f) => {
2782
+ this.isSupported = z("web_app_open_scan_qr_popup", e), this.isOpened = w(l), this.captureFp = p((_) => {
2785
2783
  let g;
2786
2784
  return c(
2787
2785
  this.openFp({
2788
- ...f,
2786
+ ..._,
2789
2787
  onCaptured: (C) => {
2790
- f.capture(C) && (g = C, this.close());
2788
+ _.capture(C) && (g = C, this.close());
2791
2789
  }
2792
2790
  }),
2793
2791
  B(() => g)
2794
2792
  );
2795
- }), this.closeFp = a(() => c(o("web_app_close_scan_qr_popup"), D(_))), this.openFp = p((f) => c(
2796
- this.isOpened() ? T(new zt("The QR Scanner is already opened")) : async () => o("web_app_open_scan_qr_popup", { text: f.text }),
2793
+ }), this.closeFp = a(() => c(o("web_app_close_scan_qr_popup"), D(m))), this.openFp = p((_) => c(
2794
+ this.isOpened() ? $(new zt("The QR Scanner is already opened")) : async () => o("web_app_open_scan_qr_popup", { text: _.text }),
2797
2795
  at(() => {
2798
- const [g, C] = Lt(), F = (b) => (C(), b);
2796
+ const [g, C] = Lt(), y = (S) => (C(), S);
2799
2797
  return c(
2800
- xt((b) => {
2801
- g(r(b), n(f.onCaptured));
2802
- }, f),
2803
- Wt(F, F)
2798
+ Bt((S) => {
2799
+ g(r(S), n(_.onCaptured));
2800
+ }, _),
2801
+ Wt(y, y)
2804
2802
  );
2805
2803
  })
2806
- )), this.open = d(this.openFp), this.capture = d(this.captureFp), this.close = d(this.closeFp);
2804
+ )), this.open = h(this.openFp), this.capture = h(this.captureFp), this.close = h(this.closeFp);
2807
2805
  }
2808
2806
  }
2809
2807
  const Kn = new Hr({
2810
- ...c(v(), $, y),
2808
+ ...c(F(), L, v),
2811
2809
  onClosed(s) {
2812
2810
  return Y("scan_qr_popup_closed", s);
2813
2811
  },
@@ -3064,7 +3062,7 @@ class Wr {
3064
3062
  })
3065
3063
  }), i = (o, u) => {
3066
3064
  const a = n.stateGetter(o);
3067
- return w(() => a() || R(u));
3065
+ return w(() => a() || P(u));
3068
3066
  };
3069
3067
  this.isSupported = z("web_app_setup_secondary_button", r.version), this.bgColor = i("bgColor", e.bgColor), this.textColor = i("textColor", e.textColor), this.position = n.stateGetter("position"), this.hasShineEffect = n.stateGetter("hasShineEffect"), this.isEnabled = n.stateGetter("isEnabled"), this.isLoaderVisible = n.stateGetter("isLoaderVisible"), this.text = n.stateGetter("text"), this.isVisible = n.stateGetter("isVisible"), this.isMounted = n.isMounted, this.state = n.state, [this.setPosition, this.setPositionFp] = n.stateSetters("position"), [this.setBgColor, this.setBgColorFp] = n.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = n.stateSetters("textColor"), [
3070
3068
  [this.disableShineEffect, this.disableShineEffectFp],
@@ -3080,7 +3078,7 @@ class Wr {
3080
3078
  //#endregion
3081
3079
  }
3082
3080
  const Qn = new Wr(
3083
- Be("secondaryButton", "secondary_button_pressed", {
3081
+ xe("secondaryButton", "secondary_button_pressed", {
3084
3082
  bgColor: w(() => $r.bottomBarColorRgb() || "#000000"),
3085
3083
  textColor: w(() => vt.buttonColor() || "#2481cc")
3086
3084
  })
@@ -3238,11 +3236,11 @@ class Qr {
3238
3236
  }), p = { requires: "web_app_setup_swipe_behavior", isTma: n, version: o }, l = E({
3239
3237
  ...p,
3240
3238
  returns: "plain"
3241
- }), _ = E({
3239
+ }), m = E({
3242
3240
  ...p,
3243
3241
  isMounted: a.isMounted,
3244
3242
  returns: "either"
3245
- }), f = (g) => {
3243
+ }), _ = (g) => {
3246
3244
  const C = { isVerticalEnabled: g };
3247
3245
  return u.hasDiff(C) ? c(
3248
3246
  e("web_app_setup_swipe_behavior", { allow_vertical_swipe: g }),
@@ -3251,17 +3249,17 @@ class Qr {
3251
3249
  })
3252
3250
  ) : I(void 0);
3253
3251
  };
3254
- this.isSupported = z("web_app_setup_swipe_behavior", o), this.isVerticalEnabled = u.getter("isVerticalEnabled"), this.isMounted = a.isMounted, this.disableVerticalFp = _(() => f(!1)), this.enableVerticalFp = _(() => f(!0)), this.mountFp = l(() => {
3252
+ this.isSupported = z("web_app_setup_swipe_behavior", o), this.isVerticalEnabled = u.getter("isVerticalEnabled"), this.isMounted = a.isMounted, this.disableVerticalFp = m(() => _(!1)), this.enableVerticalFp = m(() => _(!0)), this.mountFp = l(() => {
3255
3253
  const g = () => {
3256
3254
  };
3257
3255
  return c(a.mount(), pt(g, g));
3258
- }), this.unmount = a.unmount, this.disableVertical = d(this.disableVerticalFp), this.enableVertical = d(this.enableVerticalFp), this.mount = d(this.mountFp);
3256
+ }), this.unmount = a.unmount, this.disableVertical = h(this.disableVerticalFp), this.enableVertical = h(this.enableVerticalFp), this.mount = h(this.mountFp);
3259
3257
  }
3260
3258
  }
3261
3259
  const Nn = new Qr(c(
3262
- v(),
3263
- $,
3264
- y,
3260
+ F(),
3261
+ L,
3262
+ v,
3265
3263
  et("swipeBehavior")
3266
3264
  ));
3267
3265
  async function Jn(s) {
@@ -3286,14 +3284,14 @@ function zr({ request: s, ...e }) {
3286
3284
  "file_download_requested",
3287
3285
  { ...i, params: { url: r, file_name: n } }
3288
3286
  ),
3289
- Z((o) => o.status === "downloading" ? x(void 0) : T(new ye("User denied the action")))
3287
+ Z((o) => o.status === "downloading" ? q(void 0) : $(new ye("User denied the action")))
3290
3288
  ), { ...e, requires: "web_app_request_file_download", returns: "task" });
3291
3289
  }
3292
3290
  const Nr = zr(c(
3293
- v(),
3291
+ F(),
3294
3292
  U,
3295
- y
3296
- )), Yn = d(Nr);
3293
+ v
3294
+ )), Yn = h(Nr);
3297
3295
  function Jr({ invokeCustomMethod: s, ...e }) {
3298
3296
  return A((r) => c(
3299
3297
  s("getCurrentTime", {}, r),
@@ -3302,23 +3300,23 @@ function Jr({ invokeCustomMethod: s, ...e }) {
3302
3300
  pe(fe(), ts(), he((o) => new Date(o * 1e3)), de()),
3303
3301
  n
3304
3302
  );
3305
- return i.success ? x(i.output) : T(new Ft(n, i.issues));
3303
+ return i.success ? q(i.output) : $(new Ft(n, i.issues));
3306
3304
  })
3307
3305
  ), { ...e, requires: "web_app_invoke_custom_method", returns: "task" });
3308
3306
  }
3309
3307
  const Yr = Jr(c(
3310
- v(),
3308
+ F(),
3311
3309
  Yt,
3312
- y
3313
- )), Zn = d(Yr);
3310
+ v
3311
+ )), Zn = h(Yr);
3314
3312
  function Zr({ postEvent: s, ...e }) {
3315
3313
  return A(() => s("web_app_hide_keyboard"), { ...e, returns: "either", requires: "web_app_hide_keyboard" });
3316
3314
  }
3317
3315
  const Xr = Zr(c(
3318
- v(),
3319
- $,
3320
- y
3321
- )), Xn = d(Xr);
3316
+ F(),
3317
+ L,
3318
+ v
3319
+ )), Xn = h(Xr);
3322
3320
  function tn({ request: s, createRequestId: e, ...r }) {
3323
3321
  return A((n) => {
3324
3322
  const i = e();
@@ -3334,12 +3332,12 @@ function tn({ request: s, createRequestId: e, ...r }) {
3334
3332
  }
3335
3333
  const en = tn({
3336
3334
  ...c(
3337
- v(),
3338
- y,
3335
+ F(),
3336
+ v,
3339
3337
  U
3340
3338
  ),
3341
3339
  createRequestId: Ae
3342
- }), to = d(en);
3340
+ }), to = h(en);
3343
3341
  function sn(s) {
3344
3342
  const e = {}, r = s.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3345
3343
  if (r) {
@@ -3362,12 +3360,12 @@ function eo() {
3362
3360
  function rn({ postEvent: s, ...e }) {
3363
3361
  return A((r) => {
3364
3362
  const { size: n } = new Blob([r]);
3365
- return !n || n > 4096 ? M(
3363
+ return !n || n > 4096 ? V(
3366
3364
  new Q(n ? "Maximum size of data to send is 4096 bytes" : "Attempted to send empty data")
3367
3365
  ) : s("web_app_data_send", { data: r });
3368
3366
  }, { ...e, returns: "either" });
3369
3367
  }
3370
- const nn = rn(c(v(), $)), so = d(nn);
3368
+ const nn = rn(c(F(), L)), so = h(nn);
3371
3369
  function on({ request: s, ...e }) {
3372
3370
  return A((r, n) => c(
3373
3371
  s(
@@ -3378,14 +3376,14 @@ function on({ request: s, ...e }) {
3378
3376
  params: { id: r }
3379
3377
  }
3380
3378
  ),
3381
- Z((i) => i && "error" in i ? T(new sr(i.error)) : x(void 0))
3379
+ Z((i) => i && "error" in i ? $(new sr(i.error)) : q(void 0))
3382
3380
  ), { ...e, requires: "web_app_send_prepared_message", returns: "task" });
3383
3381
  }
3384
3382
  const an = on(c(
3385
- v(),
3383
+ F(),
3386
3384
  U,
3387
- y
3388
- )), ro = d(an);
3385
+ v
3386
+ )), ro = h(an);
3389
3387
  function un({ postEvent: s, ...e }) {
3390
3388
  return A((r, n = {}) => s("web_app_share_to_story", {
3391
3389
  text: n.text,
@@ -3394,10 +3392,10 @@ function un({ postEvent: s, ...e }) {
3394
3392
  }), { ...e, requires: "web_app_share_to_story", returns: "either" });
3395
3393
  }
3396
3394
  const cn = un(c(
3397
- v(),
3398
- $,
3399
- y
3400
- )), no = d(cn), $t = /* @__PURE__ */ _t(!1);
3395
+ F(),
3396
+ L,
3397
+ v
3398
+ )), no = h(cn), $t = /* @__PURE__ */ _t(!1);
3401
3399
  function ln({ isInlineMode: s, postEvent: e, ...r }) {
3402
3400
  return A((n, i) => e("web_app_switch_inline_query", {
3403
3401
  query: n,
@@ -3405,19 +3403,19 @@ function ln({ isInlineMode: s, postEvent: e, ...r }) {
3405
3403
  }), {
3406
3404
  ...r,
3407
3405
  requires: {
3408
- every: ["web_app_switch_inline_query", () => R(s) ? void 0 : "The application must be launched in the inline mode"]
3406
+ every: ["web_app_switch_inline_query", () => P(s) ? void 0 : "The application must be launched in the inline mode"]
3409
3407
  },
3410
3408
  returns: "either"
3411
3409
  });
3412
3410
  }
3413
3411
  const pn = ln({
3414
3412
  ...c(
3415
- v(),
3416
- $,
3417
- y
3413
+ F(),
3414
+ L,
3415
+ v
3418
3416
  ),
3419
3417
  isInlineMode: $t
3420
- }), oo = d(pn);
3418
+ }), oo = h(pn);
3421
3419
  class hn {
3422
3420
  constructor({
3423
3421
  storage: e,
@@ -3429,13 +3427,13 @@ class hn {
3429
3427
  offContentSafeAreaInsetsChanged: a,
3430
3428
  offFullscreenChanged: p,
3431
3429
  offSafeAreaInsetsChanged: l,
3432
- offViewportChanged: _,
3433
- request: f,
3430
+ offViewportChanged: m,
3431
+ request: _,
3434
3432
  isViewportStable: g,
3435
3433
  isFullscreen: C,
3436
- isTma: F,
3437
- version: b,
3438
- postEvent: m
3434
+ isTma: y,
3435
+ version: S,
3436
+ postEvent: f
3439
3437
  }) {
3440
3438
  //#region Other properties.
3441
3439
  /**
@@ -3624,50 +3622,50 @@ class hn {
3624
3622
  * @see expandFp
3625
3623
  */
3626
3624
  t(this, "expand");
3627
- const S = { top: 0, right: 0, left: 0, bottom: 0 }, h = new tt({
3625
+ const b = { top: 0, right: 0, left: 0, bottom: 0 }, d = new tt({
3628
3626
  initialState: {
3629
- contentSafeAreaInsets: S,
3627
+ contentSafeAreaInsets: b,
3630
3628
  height: 0,
3631
3629
  isExpanded: !1,
3632
3630
  isFullscreen: !1,
3633
- safeAreaInsets: S,
3631
+ safeAreaInsets: b,
3634
3632
  stableHeight: 0,
3635
3633
  width: 0
3636
3634
  },
3637
3635
  onChange: e.set
3638
- }), V = (k) => {
3639
- h.setState({
3636
+ }), x = (k) => {
3637
+ d.setState({
3640
3638
  isExpanded: k.is_expanded,
3641
3639
  height: k.height,
3642
3640
  width: k.width,
3643
3641
  stableHeight: k.is_state_stable ? k.height : void 0
3644
3642
  });
3645
- }, L = (k) => {
3646
- h.setState({ isFullscreen: k.is_fullscreen });
3647
- }, P = (k) => {
3648
- h.setState({ safeAreaInsets: k });
3643
+ }, R = (k) => {
3644
+ d.setState({ isFullscreen: k.is_fullscreen });
3645
+ }, T = (k) => {
3646
+ d.setState({ safeAreaInsets: k });
3649
3647
  }, O = (k) => {
3650
- h.setState({ contentSafeAreaInsets: k });
3648
+ d.setState({ contentSafeAreaInsets: k });
3651
3649
  }, G = new Jt({
3652
3650
  initialState(k) {
3653
3651
  const st = (N) => () => {
3654
3652
  const [X, W] = N === "safe-area" ? ["web_app_request_safe_area", "safe_area_changed"] : ["web_app_request_content_safe_area", "content_safe_area_changed"];
3655
- return ot(X, R(b)) ? f(X, W, k) : x({ top: 0, left: 0, right: 0, bottom: 0 });
3656
- }, q = (N) => () => typeof N == "boolean" ? x(N) : ve(N());
3653
+ return ot(X, P(S)) ? _(X, W, k) : q({ top: 0, left: 0, right: 0, bottom: 0 });
3654
+ }, M = (N) => () => typeof N == "boolean" ? q(N) : ve(N());
3657
3655
  return c(
3658
3656
  Js,
3659
3657
  wt("safeAreaInsets", st("safe-area")),
3660
3658
  wt("contentSafeAreaInsets", st("content-safe-area")),
3661
- wt("isFullscreen", q(C)),
3662
- wt("isViewportStable", q(g)),
3663
- at(({ isViewportStable: N, ...X }) => N ? x({
3659
+ wt("isFullscreen", M(C)),
3660
+ wt("isViewportStable", M(g)),
3661
+ at(({ isViewportStable: N, ...X }) => N ? q({
3664
3662
  ...X,
3665
3663
  height: window.innerHeight,
3666
3664
  isExpanded: !0,
3667
3665
  stableHeight: window.innerHeight,
3668
3666
  width: window.innerWidth
3669
3667
  }) : c(
3670
- f("web_app_request_viewport", "viewport_changed", k),
3668
+ _("web_app_request_viewport", "viewport_changed", k),
3671
3669
  B((W) => ({
3672
3670
  ...X,
3673
3671
  height: W.height,
@@ -3680,37 +3678,37 @@ class hn {
3680
3678
  },
3681
3679
  isPageReload: r,
3682
3680
  onMounted(k) {
3683
- o(V), u(L), i(P), n(O), h.setState(k);
3681
+ o(x), u(R), i(T), n(O), d.setState(k);
3684
3682
  },
3685
3683
  onUnmounted() {
3686
- _(V), p(L), l(P), a(O);
3684
+ m(x), p(R), l(T), a(O);
3687
3685
  },
3688
3686
  restoreState: e.get
3689
3687
  }), H = (k) => w(() => this.safeAreaInsets()[k]), bt = (k) => w(() => this.contentSafeAreaInsets()[k]);
3690
- this.state = h.state, this.height = h.getter("height"), this.stableHeight = h.getter("stableHeight"), this.width = h.getter("width"), this.isExpanded = h.getter("isExpanded"), this.safeAreaInsets = h.getter("safeAreaInsets"), this.safeAreaInsetTop = H("top"), this.safeAreaInsetBottom = H("bottom"), this.safeAreaInsetLeft = H("left"), this.safeAreaInsetRight = H("right"), this.contentSafeAreaInsets = h.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = bt("top"), this.contentSafeAreaInsetBottom = bt("bottom"), this.contentSafeAreaInsetLeft = bt("left"), this.contentSafeAreaInsetRight = bt("right");
3691
- const Ve = E({ isTma: F, returns: "task" }), te = E({
3692
- isTma: F,
3688
+ this.state = d.state, this.height = d.getter("height"), this.stableHeight = d.getter("stableHeight"), this.width = d.getter("width"), this.isExpanded = d.getter("isExpanded"), this.safeAreaInsets = d.getter("safeAreaInsets"), this.safeAreaInsetTop = H("top"), this.safeAreaInsetBottom = H("bottom"), this.safeAreaInsetLeft = H("left"), this.safeAreaInsetRight = H("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = bt("top"), this.contentSafeAreaInsetBottom = bt("bottom"), this.contentSafeAreaInsetLeft = bt("left"), this.contentSafeAreaInsetRight = bt("right");
3689
+ const Ve = E({ isTma: y, returns: "task" }), te = E({
3690
+ isTma: y,
3693
3691
  returns: "either"
3694
3692
  }), Te = E({
3695
- isTma: F,
3693
+ isTma: y,
3696
3694
  requires: "web_app_request_fullscreen",
3697
- version: b,
3695
+ version: S,
3698
3696
  returns: "task"
3699
3697
  }), ee = (k) => Te((st) => c(
3700
- f(
3698
+ _(
3701
3699
  k ? "web_app_request_fullscreen" : "web_app_exit_fullscreen",
3702
3700
  ["fullscreen_changed", "fullscreen_failed"],
3703
3701
  st
3704
3702
  ),
3705
- Z((q) => "error" in q && q.error !== "ALREADY_FULLSCREEN" ? T(new er(q.error)) : (h.setState({ isFullscreen: "is_fullscreen" in q ? q.is_fullscreen : !0 }), x(void 0)))
3703
+ Z((M) => "error" in M && M.error !== "ALREADY_FULLSCREEN" ? $(new er(M.error)) : (d.setState({ isFullscreen: "is_fullscreen" in M ? M.is_fullscreen : !0 }), q(void 0)))
3706
3704
  ));
3707
- this.isMounted = G.isMounted, this.mountFp = Ve(G.mount), this.mount = d(this.mountFp), this.isFullscreen = h.getter("isFullscreen"), this.requestFullscreenFp = ee(!0), this.requestFullscreen = d(this.requestFullscreenFp), this.exitFullscreenFp = ee(!1), this.exitFullscreen = d(this.exitFullscreenFp);
3705
+ this.isMounted = G.isMounted, this.mountFp = Ve(G.mount), this.mount = h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = ee(!0), this.requestFullscreen = h(this.requestFullscreenFp), this.exitFullscreenFp = ee(!1), this.exitFullscreen = h(this.exitFullscreenFp);
3708
3706
  const gt = j(!1);
3709
3707
  this.isCssVarsBound = w(gt), this.bindCssVarsFp = te(
3710
3708
  (k) => {
3711
3709
  if (gt())
3712
- return M(new Qt());
3713
- k || (k = (q) => `--tg-viewport-${le(q)}`);
3710
+ return V(new Qt());
3711
+ k || (k = (M) => `--tg-viewport-${le(M)}`);
3714
3712
  const st = [
3715
3713
  ["height", this.height],
3716
3714
  ["stableHeight", this.stableHeight],
@@ -3723,25 +3721,25 @@ class hn {
3723
3721
  ["contentSafeAreaInsetBottom", this.contentSafeAreaInsetBottom],
3724
3722
  ["contentSafeAreaInsetLeft", this.contentSafeAreaInsetLeft],
3725
3723
  ["contentSafeAreaInsetRight", this.contentSafeAreaInsetRight]
3726
- ].reduce((q, [N, X]) => {
3724
+ ].reduce((M, [N, X]) => {
3727
3725
  const W = k(N);
3728
3726
  if (W) {
3729
3727
  const se = () => {
3730
3728
  Zt(W, `${X()}px`);
3731
3729
  };
3732
- q.push({ update: se, removeListener: X.sub(se), cssVar: W });
3730
+ M.push({ update: se, removeListener: X.sub(se), cssVar: W });
3733
3731
  }
3734
- return q;
3732
+ return M;
3735
3733
  }, []);
3736
- return st.forEach((q) => {
3737
- q.update();
3734
+ return st.forEach((M) => {
3735
+ M.update();
3738
3736
  }), gt.set(!0), I(() => {
3739
- st.forEach((q) => {
3740
- q.removeListener(), Xt(q.cssVar);
3737
+ st.forEach((M) => {
3738
+ M.removeListener(), Xt(M.cssVar);
3741
3739
  }), gt.set(!1);
3742
3740
  });
3743
3741
  }
3744
- ), this.bindCssVars = d(this.bindCssVarsFp), this.expandFp = te(() => m("web_app_expand")), this.expand = d(this.expandFp);
3742
+ ), this.bindCssVars = h(this.bindCssVarsFp), this.expandFp = te(() => f("web_app_expand")), this.expand = h(this.expandFp);
3745
3743
  }
3746
3744
  //#endregion
3747
3745
  }
@@ -3756,10 +3754,10 @@ function dn() {
3756
3754
  }), e = s("viewport_changed"), r = s("fullscreen_changed"), n = s("safe_area_changed"), i = s("content_safe_area_changed");
3757
3755
  return new hn({
3758
3756
  ...c(
3759
- v(),
3757
+ F(),
3760
3758
  et("viewport"),
3761
- y,
3762
- $,
3759
+ v,
3760
+ L,
3763
3761
  U
3764
3762
  ),
3765
3763
  isFullscreen() {
@@ -3795,7 +3793,7 @@ function fn(s = {}) {
3795
3793
  }
3796
3794
  ));
3797
3795
  if (a)
3798
- return M(a);
3796
+ return V(a);
3799
3797
  }
3800
3798
  s.postEvent && ke.set(s.postEvent);
3801
3799
  const [i, o] = Lt(
@@ -3839,7 +3837,7 @@ export {
3839
3837
  vr as Invoice,
3840
3838
  ho as InvokeCustomMethodFailedError,
3841
3839
  fo as LaunchParamsRetrieveError,
3842
- xr as LocationManager,
3840
+ Br as LocationManager,
3843
3841
  qr as MainButton,
3844
3842
  _o as MethodParameterUnsupportedError,
3845
3843
  mo as MethodUnsupportedError,
@@ -3878,10 +3876,10 @@ export {
3878
3876
  Eo as decodeBase64UrlFp,
3879
3877
  Ao as decodeStartParam,
3880
3878
  Io as decodeStartParamFp,
3881
- Bo as deepSnakeToCamelObjKeys,
3879
+ xo as deepSnakeToCamelObjKeys,
3882
3880
  Yn as downloadFile,
3883
3881
  Nr as downloadFileFp,
3884
- xo as emitEvent,
3882
+ Bo as emitEvent,
3885
3883
  qo as encodeBase64Url,
3886
3884
  Zn as getCurrentTime,
3887
3885
  Yr as getCurrentTimeFp,
@@ -3895,7 +3893,7 @@ export {
3895
3893
  $n as invoice,
3896
3894
  hr as invokeCustomMethod,
3897
3895
  Zo as isAnyRGB,
3898
- xe as isColorDark,
3896
+ Be as isColorDark,
3899
3897
  Mr as isColorDarkFp,
3900
3898
  Xo as isRGB,
3901
3899
  ti as isRGBA,
@@ -3931,7 +3929,7 @@ export {
3931
3929
  jn as requestContactComplete,
3932
3930
  Me as requestContactCompleteFp,
3933
3931
  Ur as requestContactFp,
3934
- Bn as requestEmojiStatusAccess,
3932
+ xn as requestEmojiStatusAccess,
3935
3933
  fr as requestEmojiStatusAccessFp,
3936
3934
  Ee as requestFp,
3937
3935
  Gn as requestPhoneAccess,
@@ -3952,7 +3950,7 @@ export {
3952
3950
  ai as serializeInitDataQuery,
3953
3951
  ui as serializeLaunchParamsQuery,
3954
3952
  Qo as setDebug,
3955
- xn as setEmojiStatus,
3953
+ Bn as setEmojiStatus,
3956
3954
  mr as setEmojiStatusFp,
3957
3955
  zo as setTargetOrigin,
3958
3956
  zn as settingsButton,