@tma.js/sdk 3.1.8 → 3.2.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/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  var nt = Object.defineProperty;
2
2
  var it = (s, t, r) => t in s ? nt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[t] = r;
3
3
  var e = (s, t, r) => it(s, typeof t != "symbol" ? t + "" : t, r);
4
- import { batch as ce, signal as O, computed as C } from "@tma.js/signals";
4
+ import { batch as ce, signal as j, computed as C } from "@tma.js/signals";
5
5
  import { supports as ee, isTMAFp as ot, postEventFp as at, off as ne, on as z, requestFp as pt, request2Fp as ut, invokeCustomMethodFp as ct, retrieveLaunchParamsFp as le, retrieveRawInitDataFp as lt, captureSameReq as ht, logger as Re } from "@tma.js/bridge";
6
- import { CancelledError as vn, InvalidLaunchParamsError as kn, InvokeCustomMethodFailedError as yn, LaunchParamsRetrieveError as In, MethodParameterUnsupportedError as En, MethodUnsupportedError as qn, TimeoutError as An, UnknownEnvError as Bn, applyPolyfills as xn, createLogger as Mn, createPostEvent as Vn, createStartParam as Tn, createStartParamFp as Ln, debug as $n, decodeBase64Url as Rn, decodeBase64UrlFp as Pn, decodeStartParam as On, decodeStartParamFp as Dn, deepSnakeToCamelObjKeys as Gn, emitEvent as jn, encodeBase64Url as Un, getReleaseVersion as Wn, isSafeToCreateStartParam as Hn, isTMA as Kn, isTMAFp as Qn, logger as zn, mockTelegramEnv as Nn, off as Jn, offAll as Yn, on as Zn, retrieveLaunchParams as Xn, retrieveLaunchParamsFp as ei, retrieveRawInitData as ti, retrieveRawInitDataFp as si, retrieveRawLaunchParams as ri, retrieveRawLaunchParamsFp as ni, setDebug as ii, setTargetOrigin as oi, supports as ai, targetOrigin as pi } from "@tma.js/bridge";
7
- import { throwifyFpFn as te, throwifyAnyEither as Ge, getStorageValue as dt, setStorageValue as _t, snakeToKebab as ft, createCbCollector as ke, camelToKebab as je, BetterTaskEither as ge } from "@tma.js/toolkit";
8
- import { toRGBFullFp as mt, isRGB as _e, pipeQueryToSchema as bt, pipeJsonToSchema as gt } from "@tma.js/transformers";
9
- import { isAnyRGB as ci, isRGB as li, isRGBA as hi, isRGBAShort as di, isRGBShort as _i, parseInitDataQuery as fi, parseInitDataQueryFp as mi, parseLaunchParamsQuery as bi, parseLaunchParamsQueryFp as gi, serializeInitDataQuery as Fi, serializeLaunchParamsQuery as wi, toRGB as Ci, toRGBFp as Si, toRGBFull as vi, toRGBFullFp as ki } from "@tma.js/transformers";
10
- import { either as b, function as u, option as Q, taskEither as c } from "fp-ts";
11
- import { errorClassWithData as ye, errorClass as G } from "error-kid";
12
- import { parse as Pe, record as Ft, string as K, array as wt, safeParse as Fe, looseObject as Oe, pipe as Ue, transform as We, date as He, optional as Ct, number as Ke, integer as St } from "valibot";
13
- function R(s) {
6
+ import { CancelledError as vn, InvalidLaunchParamsError as kn, InvokeCustomMethodFailedError as In, LaunchParamsRetrieveError as yn, MethodParameterUnsupportedError as En, MethodUnsupportedError as qn, TimeoutError as An, UnknownEnvError as Bn, applyPolyfills as xn, createLogger as Mn, createPostEvent as Vn, createStartParam as Tn, createStartParamFp as Ln, debug as $n, decodeBase64Url as Rn, decodeBase64UrlFp as Pn, decodeStartParam as jn, decodeStartParamFp as On, deepSnakeToCamelObjKeys as Dn, emitEvent as Gn, encodeBase64Url as Un, getReleaseVersion as Wn, isSafeToCreateStartParam as Hn, isTMA as Kn, isTMAFp as Qn, logger as zn, mockTelegramEnv as Nn, off as Jn, offAll as Yn, on as Zn, retrieveLaunchParams as Xn, retrieveLaunchParamsFp as ei, retrieveRawInitData as ti, retrieveRawInitDataFp as si, retrieveRawLaunchParams as ri, retrieveRawLaunchParamsFp as ni, setDebug as ii, setTargetOrigin as oi, supports as ai, targetOrigin as pi } from "@tma.js/bridge";
7
+ import { throwifyFpFn as te, throwifyAnyEither as De, getStorageValue as dt, setStorageValue as _t, snakeToKebab as mt, createCbCollector as ke, camelToKebab as Ge, BetterTaskEither as ge } from "@tma.js/toolkit";
8
+ import { toRGBFullFp as ft, isRGB as _e, pipeQueryToSchema as bt, pipeJsonToSchema as gt } from "@tma.js/transformers";
9
+ import { isAnyRGB as ci, isRGB as li, isRGBA as hi, isRGBAShort as di, isRGBShort as _i, parseInitDataQuery as mi, parseInitDataQueryFp as fi, parseLaunchParamsQuery as bi, parseLaunchParamsQueryFp as gi, serializeInitDataQuery as Fi, serializeLaunchParamsQuery as Ci, toRGB as wi, toRGBFp as Si, toRGBFull as vi, toRGBFullFp as ki } from "@tma.js/transformers";
10
+ import { either as b, function as u, option as Q, taskEither as l } from "fp-ts";
11
+ import { errorClassWithData as Ie, errorClass as D } from "error-kid";
12
+ import { parse as Pe, record as Ft, string as K, array as Ct, safeParse as Fe, looseObject as je, pipe as Ue, transform as We, date as He, optional as wt, number as Ke, integer as St } from "valibot";
13
+ function V(s) {
14
14
  return typeof s == "function" ? s() : s;
15
15
  }
16
16
  class ie {
@@ -19,9 +19,9 @@ class ie {
19
19
  restoreState: r,
20
20
  initialState: n,
21
21
  onUnmounted: a,
22
- isPageReload: o
22
+ isPageReload: p
23
23
  }) {
24
- e(this, "_isMounted", O(!1));
24
+ e(this, "_isMounted", j(!1));
25
25
  /**
26
26
  * Signal indicating if the component is mounted.
27
27
  */
@@ -37,10 +37,10 @@ class ie {
37
37
  this.mount = () => {
38
38
  if (this.isMounted())
39
39
  return b.right(void 0);
40
- const p = R(o) ? r() : void 0, i = p ? b.right(p) : typeof n == "function" ? n() : b.right(n);
41
- return u.pipe(i, b.map((l) => {
40
+ const o = V(p) ? r() : void 0, i = o ? b.right(o) : typeof n == "function" ? n() : b.right(n);
41
+ return u.pipe(i, b.map((c) => {
42
42
  ce(() => {
43
- this._isMounted.set(!0), t == null || t(l);
43
+ this._isMounted.set(!0), t == null || t(c);
44
44
  });
45
45
  }));
46
46
  }, this.unmount = () => {
@@ -50,7 +50,7 @@ class ie {
50
50
  };
51
51
  }
52
52
  }
53
- function we(s) {
53
+ function Ce(s) {
54
54
  const t = {};
55
55
  for (const r in s) {
56
56
  const n = s[r];
@@ -58,7 +58,7 @@ function we(s) {
58
58
  }
59
59
  return t;
60
60
  }
61
- function fe(s, t) {
61
+ function me(s, t) {
62
62
  const r = Object.keys(s), n = Object.keys(t);
63
63
  return r.length !== n.length ? !1 : r.every((a) => Object.prototype.hasOwnProperty.call(t, a) && s[a] === t[a]);
64
64
  }
@@ -74,10 +74,10 @@ class J {
74
74
  * @param state - updates to apply.
75
75
  */
76
76
  e(this, "setState", (t) => {
77
- const r = { ...this.state(), ...we(t) };
78
- fe(r, this.state()) || this._state.set(r);
77
+ const r = { ...this.state(), ...Ce(t) };
78
+ me(r, this.state()) || this._state.set(r);
79
79
  });
80
- this._state = O(t, { equals: fe }), this.state = C(this._state), this.state.sub(r);
80
+ this._state = j(t, { equals: me }), this.state = C(this._state), this.state.sub(r);
81
81
  }
82
82
  /**
83
83
  * Creates a computed signal based on the state.
@@ -91,11 +91,11 @@ class J {
91
91
  * @param state
92
92
  */
93
93
  hasDiff(t) {
94
- return !fe({ ...this.state(), ...we(t) }, this.state());
94
+ return !me({ ...this.state(), ...Ce(t) }, this.state());
95
95
  }
96
96
  }
97
97
  function W(s, t) {
98
- return C(() => ee(s, R(t)));
98
+ return C(() => ee(s, V(t)));
99
99
  }
100
100
  // @__NO_SIDE_EFFECTS__
101
101
  function h(s) {
@@ -107,7 +107,7 @@ function h(s) {
107
107
  () => ({ ok: !1 }),
108
108
  (r) => ({
109
109
  ok: !0,
110
- data: Ge(r)
110
+ data: De(r)
111
111
  })
112
112
  )
113
113
  );
@@ -117,132 +117,132 @@ function h(s) {
117
117
  function X(s) {
118
118
  return [s];
119
119
  }
120
- class ue extends (/* @__PURE__ */ ye({
120
+ class ue extends (/* @__PURE__ */ Ie({
121
121
  name: "ValidationError",
122
122
  data: (t, r) => ({ input: t, issues: r }),
123
123
  super: "Validation error"
124
124
  })) {
125
125
  }
126
- class Ie extends (/* @__PURE__ */ G({
126
+ class ye extends (/* @__PURE__ */ D({
127
127
  name: "CSSVarsBoundError",
128
128
  super: "CSS variables are already bound"
129
129
  })) {
130
130
  }
131
- class vt extends (/* @__PURE__ */ ye({
131
+ class vt extends (/* @__PURE__ */ Ie({
132
132
  name: "DeviceStorageMethodError",
133
133
  data: (t) => ({ error: t }),
134
134
  super: (t) => [t]
135
135
  })) {
136
136
  }
137
- class kt extends (/* @__PURE__ */ ye({
137
+ class kt extends (/* @__PURE__ */ Ie({
138
138
  name: "SecureStorageMethodError",
139
139
  data: (t) => ({ error: t }),
140
140
  super: (t) => [t]
141
141
  })) {
142
142
  }
143
- class yt extends (/* @__PURE__ */ G({
143
+ class It extends (/* @__PURE__ */ D({
144
144
  name: "NotAvailableError",
145
145
  super: X
146
146
  })) {
147
147
  }
148
- class Mr extends (/* @__PURE__ */ G({
148
+ class Mr extends (/* @__PURE__ */ D({
149
149
  name: "InvalidEnvError",
150
150
  super: X
151
151
  })) {
152
152
  }
153
- class It extends (/* @__PURE__ */ G({
153
+ class yt extends (/* @__PURE__ */ D({
154
154
  name: "FunctionNotAvailableError",
155
155
  super: X
156
156
  })) {
157
157
  }
158
- class U extends (/* @__PURE__ */ G({
158
+ class U extends (/* @__PURE__ */ D({
159
159
  name: "InvalidArgumentsError",
160
160
  super: (t, r) => [t, { cause: r }]
161
161
  })) {
162
162
  }
163
- class Ee extends (/* @__PURE__ */ G({
163
+ class Ee extends (/* @__PURE__ */ D({
164
164
  name: "ConcurrentCallError",
165
165
  super: X
166
166
  })) {
167
167
  }
168
- class Et extends (/* @__PURE__ */ G({
168
+ class Et extends (/* @__PURE__ */ D({
169
169
  name: "SetEmojiStatusError",
170
170
  super: (t) => [`Failed to set emoji status: ${t}`]
171
171
  })) {
172
172
  }
173
- class Qe extends (/* @__PURE__ */ G({
173
+ class Qe extends (/* @__PURE__ */ D({
174
174
  name: "AccessDeniedError",
175
175
  super: X
176
176
  })) {
177
177
  }
178
- class qt extends (/* @__PURE__ */ G({
178
+ class qt extends (/* @__PURE__ */ D({
179
179
  name: "FullscreenFailedError",
180
180
  super: X
181
181
  })) {
182
182
  }
183
- class At extends (/* @__PURE__ */ G({
183
+ class At extends (/* @__PURE__ */ D({
184
184
  name: "ShareMessageError",
185
185
  super: X
186
186
  })) {
187
187
  }
188
- class Bt extends (/* @__PURE__ */ G({
188
+ class Bt extends (/* @__PURE__ */ D({
189
189
  name: "UnknownThemeParamsKeyError",
190
190
  super: (t) => [`Unknown theme params key passed: ${t}`]
191
191
  })) {
192
192
  }
193
193
  function A(s, t) {
194
- const r = C(() => R(t.version) || "100"), n = C(() => R(t.isTma)), { requires: a, returns: o } = t, p = a ? typeof a == "object" ? a : { every: [a] } : void 0, i = (m) => {
194
+ const r = C(() => V(t.version) || "100"), n = C(() => V(t.isTma)), { requires: a, returns: p } = t, o = a ? typeof a == "object" ? a : { every: [a] } : void 0, i = (f) => {
195
195
  if (!t.supports)
196
196
  return !0;
197
- const g = t.supports[m];
197
+ const g = t.supports[f];
198
198
  return ee(g.method, g.param, r());
199
- }, l = () => {
200
- if (!p)
199
+ }, c = () => {
200
+ if (!o)
201
201
  return;
202
- const [m, g] = "every" in p ? ["every", p.every] : ["some", p.some];
202
+ const [f, g] = "every" in o ? ["every", o.every] : ["some", o.some];
203
203
  for (let d = 0; d < g.length; d++) {
204
- const B = g[d], T = typeof B == "function" ? B() : ee(B, r()) ? void 0 : `it is unsupported in Mini Apps version ${r()}`;
205
- if (T && (m === "every" || d === g.length - 1))
206
- return T;
204
+ const B = g[d], L = typeof B == "function" ? B() : ee(B, r()) ? void 0 : `it is unsupported in Mini Apps version ${r()}`;
205
+ if (L && (f === "every" || d === g.length - 1))
206
+ return L;
207
207
  }
208
- }, f = (...m) => {
208
+ }, m = (...f) => {
209
209
  for (const g in t.supports)
210
- if (t.supports[g].shouldCheck(...m) && !i(g))
210
+ if (t.supports[g].shouldCheck(...f) && !i(g))
211
211
  return `option ${g} is not supported in Mini Apps version ${r()}`;
212
- }, F = C(() => !l()), _ = C(() => r() !== "0.0"), S = C(() => t.isMounted ? t.isMounted() : !0), w = C(
212
+ }, F = C(() => !c()), _ = C(() => r() !== "0.0"), S = C(() => t.isMounted ? t.isMounted() : !0), w = C(
213
213
  () => n() && _() && F() && S()
214
- ), k = (m) => {
215
- const g = new It(m);
216
- return ["task", "promise"].includes(t.returns) ? c.left(g) : b.left(g);
217
- }, y = (...m) => o === "plain" ? b.tryCatch(() => s(...m), (g) => g) : o === "promise" ? c.tryCatch(() => s(...m), (g) => g) : s(...m);
214
+ ), k = (f) => {
215
+ const g = new yt(f);
216
+ return ["task", "promise"].includes(t.returns) ? l.left(g) : b.left(g);
217
+ }, I = (...f) => p === "plain" ? b.tryCatch(() => s(...f), (g) => g) : p === "promise" ? l.tryCatch(() => s(...f), (g) => g) : s(...f);
218
218
  return Object.assign(
219
- (...m) => {
220
- var T;
219
+ (...f) => {
220
+ var L;
221
221
  const g = "Unable to call function:";
222
222
  if (!n())
223
223
  return k(`${g} it can't be called outside Mini Apps`);
224
224
  if (!_())
225
225
  return k(`${g} the SDK was not initialized. Use the SDK init() function`);
226
- const d = l();
226
+ const d = c();
227
227
  if (d)
228
228
  return k(`${g} ${d}`);
229
- const B = f(...m);
229
+ const B = m(...f);
230
230
  if (B)
231
231
  return k(`${g} ${B}`);
232
232
  if (!S()) {
233
- const M = (T = t.isMounting) != null && T.call(t) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
233
+ const M = (L = t.isMounting) != null && L.call(t) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
234
234
  return k(`${g} the component is ${M}`);
235
235
  }
236
- return y(...m);
236
+ return I(...f);
237
237
  },
238
238
  s,
239
239
  {
240
240
  isAvailable: w,
241
- ifAvailable(...m) {
242
- return w() ? Q.some(y(...m)) : Q.none;
241
+ ifAvailable(...f) {
242
+ return w() ? Q.some(I(...f)) : Q.none;
243
243
  }
244
244
  },
245
- p ? { isSupported: F } : {},
245
+ o ? { isSupported: F } : {},
246
246
  t.supports ? { supports: i } : {}
247
247
  );
248
248
  }
@@ -255,11 +255,11 @@ class de {
255
255
  storage: r,
256
256
  onClick: n,
257
257
  offClick: a,
258
- initialState: o,
259
- isPageReload: p,
258
+ initialState: p,
259
+ isPageReload: o,
260
260
  postEvent: i,
261
- payload: l,
262
- method: f,
261
+ payload: c,
262
+ method: m,
263
263
  version: F
264
264
  }) {
265
265
  /**
@@ -342,40 +342,40 @@ class de {
342
342
  */
343
343
  e(this, "unmount");
344
344
  const _ = new J({
345
- initialState: o,
346
- onChange(m) {
347
- r.set(m);
345
+ initialState: p,
346
+ onChange(f) {
347
+ r.set(f);
348
348
  }
349
349
  }), S = new ie({
350
- initialState: o,
351
- isPageReload: p,
350
+ initialState: p,
351
+ isPageReload: o,
352
352
  onMounted: _.setState,
353
353
  restoreState: r.get
354
- }), w = { version: F, requires: f, isTma: t }, k = E({
354
+ }), w = { version: F, requires: m, isTma: t }, k = E({
355
355
  ...w,
356
356
  returns: "plain"
357
- }), y = E({
357
+ }), I = E({
358
358
  ...w,
359
359
  returns: "either",
360
360
  isMounted: S.isMounted
361
361
  });
362
- this.isMounted = S.isMounted, this.isSupported = W(f, F), this.state = _.state, this.setStateFp = y((m) => {
363
- const g = { ...this.state(), ...we(m) };
362
+ this.isMounted = S.isMounted, this.isSupported = W(m, F), this.state = _.state, this.setStateFp = I((f) => {
363
+ const g = { ...this.state(), ...Ce(f) };
364
364
  return _.hasDiff(g) ? u.pipe(
365
- i(f, l(g)),
365
+ i(m, c(g)),
366
366
  b.map(() => {
367
367
  _.setState(g);
368
368
  })
369
369
  ) : b.right(void 0);
370
370
  }), this.setState = /* @__PURE__ */ h(this.setStateFp), this.onClickFp = k(n), this.onClick = /* @__PURE__ */ h(this.onClickFp), this.offClickFp = k(a), this.offClick = /* @__PURE__ */ h(this.offClickFp), this.mountFp = k(() => {
371
- const m = () => {
371
+ const f = () => {
372
372
  };
373
- return u.pipe(S.mount(), b.match(m, m));
374
- }), this.mount = /* @__PURE__ */ h(this.mountFp), this.unmount = S.unmount, this.stateSetters = (m) => {
375
- const g = y((d) => this.setStateFp({ [m]: d }));
373
+ return u.pipe(S.mount(), b.match(f, f));
374
+ }), this.mount = /* @__PURE__ */ h(this.mountFp), this.unmount = S.unmount, this.stateSetters = (f) => {
375
+ const g = I((d) => this.setStateFp({ [f]: d }));
376
376
  return [/* @__PURE__ */ h(g), g];
377
- }, this.stateBoolSetters = (m) => {
378
- const [, g] = this.stateSetters(m), d = y(() => g(!1)), B = y(() => g(!0));
377
+ }, this.stateBoolSetters = (f) => {
378
+ const [, g] = this.stateSetters(f), d = I(() => g(!1)), B = I(() => g(!0));
379
379
  return [
380
380
  [/* @__PURE__ */ h(d), d],
381
381
  [/* @__PURE__ */ h(B), B]
@@ -486,13 +486,13 @@ function v() {
486
486
  return { isTma: C(() => ot()) };
487
487
  }
488
488
  function se(s) {
489
- return (t) => ({ ...t, ...R(s) });
489
+ return (t) => ({ ...t, ...V(s) });
490
490
  }
491
491
  // @__NO_SIDE_EFFECTS__
492
492
  function oe(s, t) {
493
- return O(s, t);
493
+ return j(s, t);
494
494
  }
495
- const ze = /* @__PURE__ */ oe(at), re = (...s) => ze()(...s), Mt = (...s) => Ge(re(...s)), V = se({
495
+ const ze = /* @__PURE__ */ oe(at), re = (...s) => ze()(...s), Mt = (...s) => De(re(...s)), T = se({
496
496
  postEvent: re
497
497
  });
498
498
  function Vt(s) {
@@ -516,14 +516,14 @@ function Y(s) {
516
516
  isPageReload: Lt
517
517
  });
518
518
  }
519
- const Ce = /* @__PURE__ */ oe("0.0"), I = se({ version: Ce });
519
+ const we = /* @__PURE__ */ oe("0.0"), y = se({ version: we });
520
520
  // @__NO_SIDE_EFFECTS__
521
521
  function qe(s, t) {
522
522
  return {
523
523
  ...u.pipe(
524
524
  v(),
525
- V,
526
- I,
525
+ T,
526
+ y,
527
527
  Y(s)
528
528
  ),
529
529
  onClick(r, n) {
@@ -543,9 +543,9 @@ class Ae {
543
543
  onMounted: r,
544
544
  restoreState: n,
545
545
  onUnmounted: a,
546
- isPageReload: o
546
+ isPageReload: p
547
547
  }) {
548
- e(this, "_isMounted", O(!1));
548
+ e(this, "_isMounted", j(!1));
549
549
  /**
550
550
  * Signal indicating if the component is mounted.
551
551
  */
@@ -559,15 +559,15 @@ class Ae {
559
559
  * Unmounts the component.
560
560
  */
561
561
  e(this, "unmount");
562
- this.mount = (p) => {
562
+ this.mount = (o) => {
563
563
  if (this._isMounted())
564
- return c.right(void 0);
565
- const i = R(o) ? n() : void 0;
564
+ return l.right(void 0);
565
+ const i = V(p) ? n() : void 0;
566
566
  return u.pipe(
567
- i ? c.right(i) : t(p),
568
- c.map((l) => {
567
+ i ? l.right(i) : t(o),
568
+ l.map((c) => {
569
569
  this._isMounted() || ce(() => {
570
- this._isMounted.set(!0), r == null || r(l);
570
+ this._isMounted.set(!0), r == null || r(c);
571
571
  });
572
572
  })
573
573
  );
@@ -578,12 +578,12 @@ class Ae {
578
578
  };
579
579
  }
580
580
  }
581
- function De() {
582
- return new yt("Biometry is not available");
581
+ function Oe() {
582
+ return new It("Biometry is not available");
583
583
  }
584
- function me(s) {
585
- let t = !1, r = !1, n = "", a = !1, o = "", p = !1;
586
- return s.available && (t = !0, r = s.token_saved, n = s.device_id, a = s.access_requested, o = s.type, p = s.access_granted), { available: t, tokenSaved: r, deviceId: n, type: o, accessGranted: p, accessRequested: a };
584
+ function fe(s) {
585
+ let t = !1, r = !1, n = "", a = !1, p = "", o = !1;
586
+ return s.available && (t = !0, r = s.token_saved, n = s.device_id, a = s.access_requested, p = s.type, o = s.access_granted), { available: t, tokenSaved: r, deviceId: n, type: p, accessGranted: o, accessRequested: a };
587
587
  }
588
588
  class $t {
589
589
  constructor({
@@ -591,10 +591,10 @@ class $t {
591
591
  request: r,
592
592
  postEvent: n,
593
593
  storage: a,
594
- onInfoReceived: o,
595
- offInfoReceived: p,
594
+ onInfoReceived: p,
595
+ offInfoReceived: o,
596
596
  isTma: i,
597
- isPageReload: l
597
+ isPageReload: c
598
598
  }) {
599
599
  /**
600
600
  * Signal indicating if biometry is available.
@@ -683,8 +683,8 @@ class $t {
683
683
  * Unmounts the component.
684
684
  */
685
685
  e(this, "unmount");
686
- const f = (m) => {
687
- F.setState(me(m));
686
+ const m = (f) => {
687
+ F.setState(fe(f));
688
688
  }, F = new J({
689
689
  initialState: {
690
690
  available: !1,
@@ -696,18 +696,18 @@ class $t {
696
696
  },
697
697
  onChange: a.set
698
698
  }), _ = new Ae({
699
- initialState(m) {
699
+ initialState(f) {
700
700
  return u.pipe(
701
- r("web_app_biometry_get_info", "biometry_info_received", m),
702
- c.map(me)
701
+ r("web_app_biometry_get_info", "biometry_info_received", f),
702
+ l.map(fe)
703
703
  );
704
704
  },
705
- isPageReload: l,
706
- onMounted(m) {
707
- F.setState(m), o(f);
705
+ isPageReload: c,
706
+ onMounted(f) {
707
+ F.setState(f), p(m);
708
708
  },
709
709
  onUnmounted() {
710
- p(f);
710
+ o(m);
711
711
  },
712
712
  restoreState: a.get
713
713
  }), S = { version: t, requires: "web_app_biometry_request_auth", isTma: i }, w = E({
@@ -716,34 +716,34 @@ class $t {
716
716
  }), k = E({
717
717
  ...S,
718
718
  returns: "task"
719
- }), y = E({
719
+ }), I = E({
720
720
  ...S,
721
721
  isMounted: _.isMounted,
722
722
  returns: "task"
723
723
  });
724
- this.isAvailable = F.getter("available"), this.isMounted = _.isMounted, this.isSupported = W("web_app_biometry_request_auth", t), this.state = F.state, this.unmount = _.unmount, this.mountFp = k(_.mount), this.authenticateFp = y((m) => this.isAvailable() ? u.pipe(
724
+ this.isAvailable = F.getter("available"), this.isMounted = _.isMounted, this.isSupported = W("web_app_biometry_request_auth", t), this.state = F.state, this.unmount = _.unmount, this.mountFp = k(_.mount), this.authenticateFp = I((f) => this.isAvailable() ? u.pipe(
725
725
  r("web_app_biometry_request_auth", "biometry_auth_requested", {
726
- ...m,
727
- params: { reason: ((m || {}).reason || "").trim() }
726
+ ...f,
727
+ params: { reason: ((f || {}).reason || "").trim() }
728
728
  }),
729
- c.map((g) => (F.setState({ token: g.token }), g))
730
- ) : c.left(De())), this.openSettingsFp = w(() => n("web_app_biometry_open_settings")), this.requestAccessFp = y((m) => u.pipe(
729
+ l.map((g) => (F.setState({ token: g.token }), g))
730
+ ) : l.left(Oe())), this.openSettingsFp = w(() => n("web_app_biometry_open_settings")), this.requestAccessFp = I((f) => u.pipe(
731
731
  r("web_app_biometry_request_access", "biometry_info_received", {
732
- ...m,
733
- params: { reason: ((m || {}).reason || "").trim() }
732
+ ...f,
733
+ params: { reason: ((f || {}).reason || "").trim() }
734
734
  }),
735
- c.chain((g) => {
736
- const d = me(g);
737
- return d.available ? (F.setState(d), c.right(d.accessRequested)) : c.left(De());
735
+ l.chain((g) => {
736
+ const d = fe(g);
737
+ return d.available ? (F.setState(d), l.right(d.accessRequested)) : l.left(Oe());
738
738
  })
739
- )), this.updateTokenFp = y((m = {}) => {
739
+ )), this.updateTokenFp = I((f = {}) => {
740
740
  var g;
741
741
  return u.pipe(
742
742
  r("web_app_biometry_update_token", "biometry_token_updated", {
743
- ...m,
744
- params: { token: m.token || "", reason: (g = m.reason) == null ? void 0 : g.trim() }
743
+ ...f,
744
+ params: { token: f.token || "", reason: (g = f.reason) == null ? void 0 : g.trim() }
745
745
  }),
746
- c.map((d) => d.status)
746
+ l.map((d) => d.status)
747
747
  );
748
748
  }), this.authenticate = /* @__PURE__ */ h(this.authenticateFp), this.openSettings = /* @__PURE__ */ h(this.openSettingsFp), this.requestAccess = /* @__PURE__ */ h(this.requestAccessFp), this.updateToken = /* @__PURE__ */ h(this.updateTokenFp), this.mount = /* @__PURE__ */ h(this.mountFp);
749
749
  }
@@ -754,14 +754,14 @@ const Rt = (s, t, r) => pt(s, t, {
754
754
  }), Ne = (s, t, r) => ut(s, t, {
755
755
  postEvent: re,
756
756
  ...r
757
- }), Tr = te(Rt), Lr = te(Ne), L = se({ request: Ne });
757
+ }), Tr = te(Rt), Lr = te(Ne), $ = se({ request: Ne });
758
758
  function Pt() {
759
759
  return new $t({
760
760
  ...u.pipe(
761
761
  v(),
762
- V,
763
- I,
764
- L,
762
+ T,
763
+ y,
764
+ $,
765
765
  Y("biometry")
766
766
  ),
767
767
  offInfoReceived(s) {
@@ -773,7 +773,7 @@ function Pt() {
773
773
  });
774
774
  }
775
775
  const $r = /* @__PURE__ */ Pt();
776
- class Ot {
776
+ class jt {
777
777
  constructor({ postEvent: t, storage: r, isTma: n, isPageReload: a }) {
778
778
  /**
779
779
  * Signal indicating if closing confirmation dialog is currently enabled.
@@ -811,42 +811,42 @@ class Ot {
811
811
  * @see enableConfirmationFp
812
812
  */
813
813
  e(this, "enableConfirmation");
814
- const o = new J({
814
+ const p = new J({
815
815
  initialState: { isConfirmationEnabled: !1 },
816
816
  onChange(_) {
817
817
  r.set(_);
818
818
  }
819
- }), p = new ie({
820
- onMounted: o.setState,
819
+ }), o = new ie({
820
+ onMounted: p.setState,
821
821
  restoreState: r.get,
822
822
  initialState: { isConfirmationEnabled: !1 },
823
823
  isPageReload: a
824
- }), i = { requires: "web_app_setup_closing_behavior", isTma: n }, l = E({
824
+ }), i = { requires: "web_app_setup_closing_behavior", isTma: n }, c = E({
825
825
  ...i,
826
826
  returns: "plain"
827
- }), f = E({
827
+ }), m = E({
828
828
  ...i,
829
829
  returns: "either",
830
- isMounted: p.isMounted
831
- }), F = (_) => _ === this.isConfirmationEnabled() ? b.right(void 0) : (o.setState({ isConfirmationEnabled: _ }), t("web_app_setup_closing_behavior", {
830
+ isMounted: o.isMounted
831
+ }), F = (_) => _ === this.isConfirmationEnabled() ? b.right(void 0) : (p.setState({ isConfirmationEnabled: _ }), t("web_app_setup_closing_behavior", {
832
832
  need_confirmation: _
833
833
  }));
834
- this.isConfirmationEnabled = o.getter("isConfirmationEnabled"), this.isMounted = p.isMounted, this.disableConfirmationFp = f(() => F(!1)), this.enableConfirmationFp = f(() => F(!0)), this.mountFp = l(() => {
834
+ this.isConfirmationEnabled = p.getter("isConfirmationEnabled"), this.isMounted = o.isMounted, this.disableConfirmationFp = m(() => F(!1)), this.enableConfirmationFp = m(() => F(!0)), this.mountFp = c(() => {
835
835
  const _ = () => {
836
836
  };
837
- return u.pipe(p.mount(), b.match(_, _));
838
- }), this.unmount = p.unmount, this.disableConfirmation = /* @__PURE__ */ h(this.disableConfirmationFp), this.enableConfirmation = /* @__PURE__ */ h(this.enableConfirmationFp), this.mount = /* @__PURE__ */ h(this.mountFp);
837
+ return u.pipe(o.mount(), b.match(_, _));
838
+ }), this.unmount = o.unmount, this.disableConfirmation = /* @__PURE__ */ h(this.disableConfirmationFp), this.enableConfirmation = /* @__PURE__ */ h(this.enableConfirmationFp), this.mount = /* @__PURE__ */ h(this.mountFp);
839
839
  }
840
840
  }
841
- function Dt() {
842
- return new Ot(u.pipe(
841
+ function Ot() {
842
+ return new jt(u.pipe(
843
843
  v(),
844
844
  Y("closingBehavior"),
845
- V
845
+ T
846
846
  ));
847
847
  }
848
- const Rr = /* @__PURE__ */ Dt();
849
- class Gt {
848
+ const Rr = /* @__PURE__ */ Ot();
849
+ class Dt {
850
850
  constructor({ version: t, isTma: r, invokeCustomMethod: n }) {
851
851
  /**
852
852
  * Signal indicating if the component is supported.
@@ -923,50 +923,50 @@ class Gt {
923
923
  isTma: r,
924
924
  returns: "task"
925
925
  });
926
- this.isSupported = W("web_app_invoke_custom_method", t), this.deleteItemFp = a((o, p) => {
927
- const i = Array.isArray(o) ? o : [o];
926
+ this.isSupported = W("web_app_invoke_custom_method", t), this.deleteItemFp = a((p, o) => {
927
+ const i = Array.isArray(p) ? p : [p];
928
928
  return u.pipe(
929
- i.length ? n("deleteStorageValues", { keys: i }, p) : c.right(void 0),
930
- c.map(() => {
929
+ i.length ? n("deleteStorageValues", { keys: i }, o) : l.right(void 0),
930
+ l.map(() => {
931
931
  })
932
932
  );
933
- }), this.getItemFp = a((o, p) => u.pipe(
934
- this.getItemsFp([o], p),
935
- c.map((i) => i[o] || "")
936
- )), this.getItemsFp = a((o, p) => u.pipe(
937
- o.length ? n("getStorageValues", { keys: o }, p) : c.right({}),
938
- c.map((i) => ({
933
+ }), this.getItemFp = a((p, o) => u.pipe(
934
+ this.getItemsFp([p], o),
935
+ l.map((i) => i[p] || "")
936
+ )), this.getItemsFp = a((p, o) => u.pipe(
937
+ p.length ? n("getStorageValues", { keys: p }, o) : l.right({}),
938
+ l.map((i) => ({
939
939
  // Fulfill the response with probably missing keys.
940
- ...o.reduce((l, f) => (l[f] = "", l), {}),
940
+ ...p.reduce((c, m) => (c[m] = "", c), {}),
941
941
  ...Pe(Ft(K(), K()), i)
942
942
  }))
943
- )), this.getKeysFp = a((o) => u.pipe(
944
- n("getStorageKeys", {}, o),
945
- c.map((p) => Pe(wt(K()), p))
946
- )), this.setItemFp = a((o, p, i) => u.pipe(
947
- n("saveStorageValue", { key: o, value: p }, i),
948
- c.map(() => {
943
+ )), this.getKeysFp = a((p) => u.pipe(
944
+ n("getStorageKeys", {}, p),
945
+ l.map((o) => Pe(Ct(K()), o))
946
+ )), this.setItemFp = a((p, o, i) => u.pipe(
947
+ n("saveStorageValue", { key: p, value: o }, i),
948
+ l.map(() => {
949
949
  })
950
- )), this.clearFp = a((o) => u.pipe(this.getKeysFp(o), c.chain(this.deleteItemFp))), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.getItems = /* @__PURE__ */ h(this.getItemsFp), this.getKeys = /* @__PURE__ */ h(this.getKeysFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.clear = /* @__PURE__ */ h(this.clearFp);
950
+ )), this.clearFp = a((p) => u.pipe(this.getKeysFp(p), l.chain(this.deleteItemFp))), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.getItems = /* @__PURE__ */ h(this.getItemsFp), this.getKeys = /* @__PURE__ */ h(this.getKeysFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.clear = /* @__PURE__ */ h(this.clearFp);
951
951
  }
952
952
  }
953
953
  const be = /* @__PURE__ */ oe(0);
954
954
  function Be() {
955
955
  return be.set(be() + 1), be().toString();
956
956
  }
957
- function jt(s, t, r) {
957
+ function Gt(s, t, r) {
958
958
  return ct(s, t, Be(), {
959
959
  ...r || {},
960
960
  postEvent: re
961
961
  });
962
962
  }
963
963
  const xe = se({
964
- invokeCustomMethod: jt
964
+ invokeCustomMethod: Gt
965
965
  });
966
966
  function Ut() {
967
- return new Gt(u.pipe(
967
+ return new Dt(u.pipe(
968
968
  v(),
969
- I,
969
+ y,
970
970
  xe
971
971
  ));
972
972
  }
@@ -1009,31 +1009,31 @@ class Wt {
1009
1009
  * @see clearFp
1010
1010
  */
1011
1011
  e(this, "clear");
1012
- const o = E({
1012
+ const p = E({
1013
1013
  version: n,
1014
1014
  requires: "web_app_device_storage_get_key",
1015
1015
  isTma: t,
1016
1016
  returns: "task"
1017
- }), p = (i, l, f) => {
1017
+ }), o = (i, c, m) => {
1018
1018
  const F = a();
1019
1019
  return u.pipe(
1020
- r(i, ["device_storage_failed", l], {
1021
- params: { ...f, req_id: F },
1020
+ r(i, ["device_storage_failed", c], {
1021
+ params: { ...m, req_id: F },
1022
1022
  capture: (_) => "payload" in _ ? _.payload.req_id === F : !0
1023
1023
  }),
1024
- c.chain((_) => _.event === "device_storage_failed" ? c.left(new vt(_.payload.error || "UNKNOWN_ERROR")) : c.right(_.payload))
1024
+ l.chain((_) => _.event === "device_storage_failed" ? l.left(new vt(_.payload.error || "UNKNOWN_ERROR")) : l.right(_.payload))
1025
1025
  );
1026
1026
  };
1027
- this.getItemFp = o((i) => u.pipe(
1028
- p("web_app_device_storage_get_key", "device_storage_key_received", { key: i }),
1029
- c.map((l) => l.value)
1030
- )), this.setItemFp = o((i, l) => u.pipe(
1031
- p("web_app_device_storage_save_key", "device_storage_key_saved", { key: i, value: l }),
1032
- c.map(() => {
1027
+ this.getItemFp = p((i) => u.pipe(
1028
+ o("web_app_device_storage_get_key", "device_storage_key_received", { key: i }),
1029
+ l.map((c) => c.value)
1030
+ )), this.setItemFp = p((i, c) => u.pipe(
1031
+ o("web_app_device_storage_save_key", "device_storage_key_saved", { key: i, value: c }),
1032
+ l.map(() => {
1033
1033
  })
1034
- )), this.deleteItemFp = o((i) => this.setItemFp(i, null)), this.clearFp = o(() => u.pipe(
1035
- p("web_app_device_storage_clear", "device_storage_cleared", {}),
1036
- c.map(() => {
1034
+ )), this.deleteItemFp = p((i) => this.setItemFp(i, null)), this.clearFp = p(() => u.pipe(
1035
+ o("web_app_device_storage_clear", "device_storage_cleared", {}),
1036
+ l.map(() => {
1037
1037
  })
1038
1038
  )), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.clear = /* @__PURE__ */ h(this.clearFp);
1039
1039
  }
@@ -1042,27 +1042,27 @@ const Je = se({ createRequestId: Be });
1042
1042
  function Ht() {
1043
1043
  return new Wt(u.pipe(
1044
1044
  v(),
1045
- I,
1046
- L,
1045
+ y,
1046
+ $,
1047
1047
  Je
1048
1048
  ));
1049
1049
  }
1050
- const Or = /* @__PURE__ */ Ht();
1050
+ const jr = /* @__PURE__ */ Ht();
1051
1051
  function Kt({ request: s, ...t }) {
1052
1052
  return A((r) => u.pipe(
1053
1053
  s("web_app_request_emoji_status_access", "emoji_status_access_requested", r),
1054
- c.map((n) => n.status)
1054
+ l.map((n) => n.status)
1055
1055
  ), { ...t, requires: "web_app_request_emoji_status_access", returns: "task" });
1056
1056
  }
1057
1057
  // @__NO_SIDE_EFFECTS__
1058
1058
  function Qt() {
1059
1059
  return Kt(u.pipe(
1060
1060
  v(),
1061
- I,
1062
- L
1061
+ y,
1062
+ $
1063
1063
  ));
1064
1064
  }
1065
- const zt = /* @__PURE__ */ Qt(), Dr = /* @__PURE__ */ h(zt);
1065
+ const zt = /* @__PURE__ */ Qt(), Or = /* @__PURE__ */ h(zt);
1066
1066
  function Nt({ request: s, ...t }) {
1067
1067
  return A((r, n) => u.pipe(
1068
1068
  s("web_app_set_emoji_status", ["emoji_status_set", "emoji_status_failed"], {
@@ -1072,7 +1072,7 @@ function Nt({ request: s, ...t }) {
1072
1072
  },
1073
1073
  ...n
1074
1074
  }),
1075
- c.chainW((a) => a.event === "emoji_status_failed" ? c.left(new Et(a.payload.error)) : c.right(void 0))
1075
+ l.chainW((a) => a.event === "emoji_status_failed" ? l.left(new Et(a.payload.error)) : l.right(void 0))
1076
1076
  ), {
1077
1077
  ...t,
1078
1078
  requires: "web_app_set_emoji_status",
@@ -1083,11 +1083,11 @@ function Nt({ request: s, ...t }) {
1083
1083
  function Jt() {
1084
1084
  return Nt(u.pipe(
1085
1085
  v(),
1086
- L,
1087
- I
1086
+ $,
1087
+ y
1088
1088
  ));
1089
1089
  }
1090
- const Yt = /* @__PURE__ */ Jt(), Gr = /* @__PURE__ */ h(Yt);
1090
+ const Yt = /* @__PURE__ */ Jt(), Dr = /* @__PURE__ */ h(Yt);
1091
1091
  class Zt {
1092
1092
  constructor({ postEvent: t, isTma: r, version: n }) {
1093
1093
  /**
@@ -1130,23 +1130,23 @@ class Zt {
1130
1130
  * @see selectionChangedFp
1131
1131
  */
1132
1132
  e(this, "selectionChanged");
1133
- const a = "web_app_trigger_haptic_feedback", o = E({
1133
+ const a = "web_app_trigger_haptic_feedback", p = E({
1134
1134
  requires: a,
1135
1135
  isTma: r,
1136
1136
  version: n,
1137
1137
  returns: "plain"
1138
1138
  });
1139
- this.isSupported = W(a, n), this.impactOccurredFp = o((p) => t(a, { type: "impact", impact_style: p })), this.notificationOccurredFp = o((p) => t(a, { type: "notification", notification_type: p })), this.selectionChangedFp = o(() => t(a, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1139
+ this.isSupported = W(a, n), this.impactOccurredFp = p((o) => t(a, { type: "impact", impact_style: o })), this.notificationOccurredFp = p((o) => t(a, { type: "notification", notification_type: o })), this.selectionChangedFp = p(() => t(a, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1140
1140
  }
1141
1141
  }
1142
1142
  function Xt() {
1143
1143
  return new Zt(u.pipe(
1144
1144
  v(),
1145
- V,
1146
- I
1145
+ T,
1146
+ y
1147
1147
  ));
1148
1148
  }
1149
- const jr = /* @__PURE__ */ Xt();
1149
+ const Gr = /* @__PURE__ */ Xt();
1150
1150
  function es({ postEvent: s, ...t }) {
1151
1151
  return A(() => s("web_app_add_to_home_screen"), { ...t, requires: "web_app_add_to_home_screen", returns: "either" });
1152
1152
  }
@@ -1154,30 +1154,30 @@ function es({ postEvent: s, ...t }) {
1154
1154
  function ts() {
1155
1155
  return es(u.pipe(
1156
1156
  v(),
1157
- I,
1158
- V
1157
+ y,
1158
+ T
1159
1159
  ));
1160
1160
  }
1161
1161
  const ss = /* @__PURE__ */ ts(), Ur = /* @__PURE__ */ h(ss);
1162
1162
  function rs({ request: s, ...t }) {
1163
1163
  return A((r) => u.pipe(
1164
1164
  s("web_app_check_home_screen", "home_screen_checked", r),
1165
- c.map((n) => n.status || "unknown")
1165
+ l.map((n) => n.status || "unknown")
1166
1166
  ), { ...t, requires: "web_app_check_home_screen", returns: "task" });
1167
1167
  }
1168
1168
  // @__NO_SIDE_EFFECTS__
1169
1169
  function ns() {
1170
1170
  return rs(u.pipe(
1171
1171
  v(),
1172
- I,
1173
- L
1172
+ y,
1173
+ $
1174
1174
  ));
1175
1175
  }
1176
1176
  const is = /* @__PURE__ */ ns(), Wr = /* @__PURE__ */ h(is);
1177
1177
  class os {
1178
1178
  constructor({ retrieveInitData: t }) {
1179
- e(this, "_state", O());
1180
- e(this, "_raw", O());
1179
+ e(this, "_state", j());
1180
+ e(this, "_raw", j());
1181
1181
  /**
1182
1182
  * Complete component state.
1183
1183
  */
@@ -1322,30 +1322,30 @@ class ps {
1322
1322
  isTma: n,
1323
1323
  requires: "web_app_open_invoice",
1324
1324
  returns: "task"
1325
- }), o = O(!1), p = () => {
1326
- o.set(!1);
1325
+ }), p = j(!1), o = () => {
1326
+ p.set(!1);
1327
1327
  };
1328
- this.isSupported = W("web_app_open_invoice", t), this.isOpened = C(o), this.openSlugFp = a((i, l) => u.pipe(
1329
- this.isOpened() ? c.left(new Ee("Invoice is already opened")) : c.right(void 0),
1330
- c.chain(() => (o.set(!0), r("web_app_open_invoice", "invoice_closed", {
1331
- ...l,
1328
+ this.isSupported = W("web_app_open_invoice", t), this.isOpened = C(p), this.openSlugFp = a((i, c) => u.pipe(
1329
+ this.isOpened() ? l.left(new Ee("Invoice is already opened")) : l.right(void 0),
1330
+ l.chain(() => (p.set(!0), r("web_app_open_invoice", "invoice_closed", {
1331
+ ...c,
1332
1332
  params: { slug: i },
1333
- capture: (f) => i === f.slug
1333
+ capture: (m) => i === m.slug
1334
1334
  }))),
1335
- c.mapBoth((f) => (p(), f), (f) => (p(), f.status))
1336
- )), this.openUrlFp = a((i, l) => {
1337
- const { hostname: f, pathname: F } = new URL(i, window.location.href);
1338
- if (f !== "t.me")
1339
- return c.left(new U(`Link has unexpected hostname: ${f}`));
1335
+ l.mapBoth((m) => (o(), m), (m) => (o(), m.status))
1336
+ )), this.openUrlFp = a((i, c) => {
1337
+ const { hostname: m, pathname: F } = new URL(i, window.location.href);
1338
+ if (m !== "t.me")
1339
+ return l.left(new U(`Link has unexpected hostname: ${m}`));
1340
1340
  const _ = F.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1341
- return _ ? this.openSlugFp(_[2], l) : c.left(new U(
1341
+ return _ ? this.openSlugFp(_[2], c) : l.left(new U(
1342
1342
  'Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'
1343
1343
  ));
1344
1344
  }), this.openUrl = /* @__PURE__ */ h(this.openUrlFp), this.openSlug = /* @__PURE__ */ h(this.openSlugFp);
1345
1345
  }
1346
1346
  }
1347
1347
  function us() {
1348
- return new ps(u.pipe(v(), L, I));
1348
+ return new ps(u.pipe(v(), $, y));
1349
1349
  }
1350
1350
  const Kr = /* @__PURE__ */ us();
1351
1351
  function cs({ postEvent: s, ...t }) {
@@ -1365,37 +1365,37 @@ function cs({ postEvent: s, ...t }) {
1365
1365
  }
1366
1366
  // @__NO_SIDE_EFFECTS__
1367
1367
  function ls() {
1368
- return cs(u.pipe(v(), V));
1368
+ return cs(u.pipe(v(), T));
1369
1369
  }
1370
1370
  const hs = /* @__PURE__ */ ls(), Qr = /* @__PURE__ */ h(hs);
1371
1371
  function ds({ postEvent: s, version: t, ...r }) {
1372
1372
  return A((n) => {
1373
1373
  const a = n.toString();
1374
- return a.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", R(t)) ? (n = new URL(n), s("web_app_open_tg_link", { path_full: n.pathname + n.search })) : (window.location.href = a, b.right(void 0)) : b.left(new U(`"${a}" is invalid URL`));
1374
+ return a.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", V(t)) ? (n = new URL(n), s("web_app_open_tg_link", { path_full: n.pathname + n.search })) : (window.location.href = a, b.right(void 0)) : b.left(new U(`"${a}" is invalid URL`));
1375
1375
  }, { ...r, returns: "either" });
1376
1376
  }
1377
1377
  // @__NO_SIDE_EFFECTS__
1378
1378
  function _s() {
1379
1379
  return ds(u.pipe(
1380
1380
  v(),
1381
- V,
1382
- I
1381
+ T,
1382
+ y
1383
1383
  ));
1384
1384
  }
1385
1385
  const Ye = /* @__PURE__ */ _s(), zr = /* @__PURE__ */ h(Ye);
1386
- function fs({ openTelegramLink: s, ...t }) {
1386
+ function ms({ openTelegramLink: s, ...t }) {
1387
1387
  return A((r, n) => s(
1388
1388
  "https://t.me/share/url?" + new URLSearchParams({ url: r, text: n || "" }).toString().replace(/\+/g, "%20")
1389
1389
  ), { ...t, returns: "either" });
1390
1390
  }
1391
1391
  // @__NO_SIDE_EFFECTS__
1392
- function ms() {
1393
- return fs({
1392
+ function fs() {
1393
+ return ms({
1394
1394
  ...v(),
1395
1395
  openTelegramLink: Ye
1396
1396
  });
1397
1397
  }
1398
- const bs = /* @__PURE__ */ ms(), Nr = /* @__PURE__ */ h(bs);
1398
+ const bs = /* @__PURE__ */ fs(), Nr = /* @__PURE__ */ h(bs);
1399
1399
  function gs(s) {
1400
1400
  let t = !1, r, n;
1401
1401
  return s.available && (t = !0, r = s.access_requested, n = s.access_granted), {
@@ -1410,8 +1410,8 @@ class Fs {
1410
1410
  request: r,
1411
1411
  postEvent: n,
1412
1412
  storage: a,
1413
- isTma: o,
1414
- isPageReload: p
1413
+ isTma: p,
1414
+ isPageReload: o
1415
1415
  }) {
1416
1416
  /**
1417
1417
  * Complete location manager state.
@@ -1480,49 +1480,49 @@ class Fs {
1480
1480
  accessRequested: !1
1481
1481
  },
1482
1482
  onChange: a.set
1483
- }), l = new Ae({
1484
- isPageReload: p,
1483
+ }), c = new Ae({
1484
+ isPageReload: o,
1485
1485
  restoreState: a.get,
1486
1486
  onMounted: i.setState,
1487
1487
  initialState(w) {
1488
1488
  return u.pipe(
1489
1489
  r("web_app_check_location", "location_checked", w),
1490
- c.map(gs)
1490
+ l.map(gs)
1491
1491
  );
1492
1492
  }
1493
- }), f = { version: t, requires: "web_app_check_location", isTma: o }, F = E({
1494
- ...f,
1493
+ }), m = { version: t, requires: "web_app_check_location", isTma: p }, F = E({
1494
+ ...m,
1495
1495
  returns: "either"
1496
1496
  }), _ = E({
1497
- ...f,
1497
+ ...m,
1498
1498
  returns: "task"
1499
1499
  }), S = E({
1500
- ...f,
1500
+ ...m,
1501
1501
  returns: "task",
1502
- isMounted: l.isMounted
1502
+ isMounted: c.isMounted
1503
1503
  });
1504
- this.isAvailable = i.getter("available"), this.isAccessRequested = i.getter("accessRequested"), this.isAccessGranted = i.getter("accessGranted"), this.isSupported = W("web_app_check_location", t), this.isMounted = l.isMounted, this.state = i.state, this.unmount = l.unmount, this.mountFp = _(l.mount), this.openSettingsFp = F(() => n("web_app_open_location_settings")), this.requestLocationFp = S((w) => u.pipe(
1504
+ this.isAvailable = i.getter("available"), this.isAccessRequested = i.getter("accessRequested"), this.isAccessGranted = i.getter("accessGranted"), this.isSupported = W("web_app_check_location", t), this.isMounted = c.isMounted, this.state = i.state, this.unmount = c.unmount, this.mountFp = _(c.mount), this.openSettingsFp = F(() => n("web_app_open_location_settings")), this.requestLocationFp = S((w) => u.pipe(
1505
1505
  r("web_app_request_location", "location_requested", w),
1506
- c.map((k) => {
1506
+ l.map((k) => {
1507
1507
  if (!k.available)
1508
1508
  return i.setState({ available: !1 }), null;
1509
- const { available: y, ...m } = k;
1510
- return m;
1509
+ const { available: I, ...f } = k;
1510
+ return f;
1511
1511
  })
1512
1512
  )), this.mount = /* @__PURE__ */ h(this.mountFp), this.openSettings = /* @__PURE__ */ h(this.openSettingsFp), this.requestLocation = /* @__PURE__ */ h(this.requestLocationFp);
1513
1513
  }
1514
1514
  }
1515
- function ws() {
1515
+ function Cs() {
1516
1516
  return new Fs(u.pipe(
1517
1517
  v(),
1518
- V,
1519
- I,
1520
- L,
1518
+ T,
1519
+ y,
1520
+ $,
1521
1521
  Y("locationManager")
1522
1522
  ));
1523
1523
  }
1524
- const Jr = /* @__PURE__ */ ws();
1525
- class Cs {
1524
+ const Jr = /* @__PURE__ */ Cs();
1525
+ class ws {
1526
1526
  constructor({ defaults: t, ...r }) {
1527
1527
  //#region Properties.
1528
1528
  /**
@@ -1565,6 +1565,11 @@ class Cs {
1565
1565
  * params colors.
1566
1566
  */
1567
1567
  e(this, "textColor");
1568
+ /**
1569
+ * The ID of custom emoji icon displayed alongside button text.
1570
+ * @since Mini Apps v9.5
1571
+ */
1572
+ e(this, "iconCustomEmojiId");
1568
1573
  //#endregion
1569
1574
  //#region Methods.
1570
1575
  /**
@@ -1639,6 +1644,15 @@ class Cs {
1639
1644
  * @see setTextFp
1640
1645
  */
1641
1646
  e(this, "setText");
1647
+ /**
1648
+ * Updates the button custom emoji ID.
1649
+ * @since Mini Apps v9.5
1650
+ */
1651
+ e(this, "setIconCustomEmojiIdFp");
1652
+ /**
1653
+ * @see setIconCustomEmojiIdFp
1654
+ */
1655
+ e(this, "setIconCustomEmojiId");
1642
1656
  /**
1643
1657
  * Shows the button loader.
1644
1658
  */
@@ -1719,7 +1733,8 @@ class Cs {
1719
1733
  isEnabled: !0,
1720
1734
  isLoaderVisible: !1,
1721
1735
  isVisible: !1,
1722
- text: "Continue"
1736
+ text: "Continue",
1737
+ iconCustomEmojiId: ""
1723
1738
  },
1724
1739
  method: "web_app_setup_main_button",
1725
1740
  payload: (o) => ({
@@ -1729,13 +1744,17 @@ class Cs {
1729
1744
  is_progress_visible: o.isLoaderVisible,
1730
1745
  text: o.text,
1731
1746
  color: o.bgColor,
1732
- text_color: o.textColor
1747
+ text_color: o.textColor,
1748
+ icon_custom_emoji_id: o.iconCustomEmojiId
1733
1749
  })
1734
- }), a = (o, p) => {
1735
- const i = n.stateGetter(o);
1736
- return C(() => i() || R(p));
1750
+ }), a = (o, i) => {
1751
+ const c = n.stateGetter(o);
1752
+ return C(() => c() || V(i));
1753
+ }, p = (o, i) => {
1754
+ const c = n.stateGetter(o);
1755
+ return C(() => c() || V(i));
1737
1756
  };
1738
- this.bgColor = a("bgColor", t.bgColor), this.textColor = a("textColor", t.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"), [
1757
+ this.bgColor = a("bgColor", t.bgColor), this.textColor = a("textColor", t.textColor), this.hasShineEffect = n.stateGetter("hasShineEffect"), this.isEnabled = n.stateGetter("isEnabled"), this.isLoaderVisible = n.stateGetter("isLoaderVisible"), this.text = n.stateGetter("text"), this.iconCustomEmojiId = p("iconCustomEmojiId", ""), 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"), [
1739
1758
  [this.disableShineEffect, this.disableShineEffectFp],
1740
1759
  [this.enableShineEffect, this.enableShineEffectFp]
1741
1760
  ] = n.stateBoolSetters("hasShineEffect"), [
@@ -1744,7 +1763,7 @@ class Cs {
1744
1763
  ] = n.stateBoolSetters("isEnabled"), [
1745
1764
  [this.hideLoader, this.hideLoaderFp],
1746
1765
  [this.showLoader, this.showLoaderFp]
1747
- ] = n.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = n.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = n.stateBoolSetters("isVisible"), this.setParams = n.setState, this.setParamsFp = n.setStateFp, 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;
1766
+ ] = n.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = n.stateSetters("text"), [this.setIconCustomEmojiId, this.setIconCustomEmojiIdFp] = n.stateSetters("iconCustomEmojiId"), [[this.hide, this.hideFp], [this.show, this.showFp]] = n.stateBoolSetters("isVisible"), this.setParams = n.setState, this.setParamsFp = n.setStateFp, 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;
1748
1767
  }
1749
1768
  //#endregion
1750
1769
  }
@@ -1756,11 +1775,11 @@ function Ve(s) {
1756
1775
  }
1757
1776
  function Ss(s) {
1758
1777
  return u.pipe(
1759
- mt(s),
1778
+ ft(s),
1760
1779
  b.map((t) => Math.sqrt(
1761
1780
  [0.299, 0.587, 0.114].reduce((r, n, a) => {
1762
- const o = parseInt(t.slice(1 + a * 2, 1 + (a + 1) * 2), 16);
1763
- return r + o * o * n;
1781
+ const p = parseInt(t.slice(1 + a * 2, 1 + (a + 1) * 2), 16);
1782
+ return r + p * p * n;
1764
1783
  }, 0)
1765
1784
  ) < 120)
1766
1785
  );
@@ -1772,8 +1791,8 @@ class vs {
1772
1791
  onChange: r,
1773
1792
  offChange: n,
1774
1793
  isTma: a,
1775
- storage: o,
1776
- isPageReload: p
1794
+ storage: p,
1795
+ isPageReload: o
1777
1796
  }) {
1778
1797
  //#region Colors.
1779
1798
  /**
@@ -1814,7 +1833,7 @@ class vs {
1814
1833
  e(this, "textColor");
1815
1834
  //#endregion
1816
1835
  //#region CSS variables.
1817
- e(this, "_isCssVarsBound", O(!1));
1836
+ e(this, "_isCssVarsBound", j(!1));
1818
1837
  /**
1819
1838
  * True if CSS variables are currently bound.
1820
1839
  */
@@ -1877,40 +1896,40 @@ class vs {
1877
1896
  e(this, "unmount");
1878
1897
  const i = new J({
1879
1898
  initialState: {},
1880
- onChange: o.set
1881
- }), l = (w) => {
1899
+ onChange: p.set
1900
+ }), c = (w) => {
1882
1901
  i.setState(w.theme_params);
1883
- }, f = new ie({
1884
- initialState: () => b.right(R(t)),
1885
- isPageReload: p,
1902
+ }, m = new ie({
1903
+ initialState: () => b.right(V(t)),
1904
+ isPageReload: o,
1886
1905
  onMounted(w) {
1887
- i.setState(w), r(l);
1906
+ i.setState(w), r(c);
1888
1907
  },
1889
1908
  onUnmounted() {
1890
- n(l);
1909
+ n(c);
1891
1910
  },
1892
- restoreState: o.get
1911
+ restoreState: p.get
1893
1912
  }), F = { isTma: a, returns: "either" }, _ = E(F), S = E({
1894
1913
  ...F,
1895
- isMounted: f.isMounted
1914
+ isMounted: m.isMounted
1896
1915
  });
1897
- this.accentTextColor = i.getter("accent_text_color"), this.bgColor = i.getter("bg_color"), this.buttonColor = i.getter("button_color"), this.buttonTextColor = i.getter("button_text_color"), this.bottomBarBgColor = i.getter("bottom_bar_bg_color"), this.destructiveTextColor = i.getter("destructive_text_color"), this.headerBgColor = i.getter("header_bg_color"), this.hintColor = i.getter("hint_color"), this.linkColor = i.getter("link_color"), this.secondaryBgColor = i.getter("secondary_bg_color"), this.sectionBgColor = i.getter("section_bg_color"), this.sectionHeaderTextColor = i.getter("section_header_text_color"), this.sectionSeparatorColor = i.getter("section_separator_color"), this.subtitleTextColor = i.getter("subtitle_text_color"), this.textColor = i.getter("text_color"), this.state = i.state, this.isMounted = f.isMounted, this.bindCssVarsFp = S((w) => {
1916
+ this.accentTextColor = i.getter("accent_text_color"), this.bgColor = i.getter("bg_color"), this.buttonColor = i.getter("button_color"), this.buttonTextColor = i.getter("button_text_color"), this.bottomBarBgColor = i.getter("bottom_bar_bg_color"), this.destructiveTextColor = i.getter("destructive_text_color"), this.headerBgColor = i.getter("header_bg_color"), this.hintColor = i.getter("hint_color"), this.linkColor = i.getter("link_color"), this.secondaryBgColor = i.getter("secondary_bg_color"), this.sectionBgColor = i.getter("section_bg_color"), this.sectionHeaderTextColor = i.getter("section_header_text_color"), this.sectionSeparatorColor = i.getter("section_separator_color"), this.subtitleTextColor = i.getter("subtitle_text_color"), this.textColor = i.getter("text_color"), this.state = i.state, this.isMounted = m.isMounted, this.bindCssVarsFp = S((w) => {
1898
1917
  if (this._isCssVarsBound())
1899
- return b.left(new Ie());
1900
- w || (w = (m) => `--tg-theme-${ft(m)}`);
1901
- const k = (m) => {
1918
+ return b.left(new ye());
1919
+ w || (w = (f) => `--tg-theme-${mt(f)}`);
1920
+ const k = (f) => {
1902
1921
  Object.entries(i.state()).forEach(([g, d]) => {
1903
- d && m(g, d);
1922
+ d && f(g, d);
1904
1923
  });
1905
- }, y = () => {
1906
- k((m, g) => {
1907
- Me(w(m), g);
1924
+ }, I = () => {
1925
+ k((f, g) => {
1926
+ Me(w(f), g);
1908
1927
  });
1909
1928
  };
1910
- return y(), i.state.sub(y), this._isCssVarsBound.set(!0), b.right(() => {
1911
- k(Ve), i.state.unsub(y), this._isCssVarsBound.set(!1);
1929
+ return I(), i.state.sub(I), this._isCssVarsBound.set(!0), b.right(() => {
1930
+ k(Ve), i.state.unsub(I), this._isCssVarsBound.set(!1);
1912
1931
  });
1913
- }), this.mountFp = _(f.mount), this.unmount = f.unmount, this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.mount = /* @__PURE__ */ h(this.mountFp);
1932
+ }), this.mountFp = _(m.mount), this.unmount = m.unmount, this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.mount = /* @__PURE__ */ h(this.mountFp);
1914
1933
  }
1915
1934
  //#endregion
1916
1935
  }
@@ -1938,22 +1957,23 @@ function Xe(s, t, r) {
1938
1957
  (n) => ({ ...n, defaults: r })
1939
1958
  );
1940
1959
  }
1941
- const Yr = /* @__PURE__ */ new Cs(
1960
+ const Yr = /* @__PURE__ */ new ws(
1942
1961
  /* @__PURE__ */ Xe("mainButton", "main_button_pressed", {
1943
1962
  bgColor: C(() => he.buttonColor() || "#2481cc"),
1944
- textColor: C(() => he.buttonTextColor() || "#ffffff")
1963
+ textColor: C(() => he.buttonTextColor() || "#ffffff"),
1964
+ iconCustomEmojiId: C(() => "")
1945
1965
  })
1946
1966
  );
1947
- class ys {
1967
+ class Is {
1948
1968
  constructor({
1949
1969
  storage: t,
1950
1970
  isPageReload: r,
1951
1971
  version: n,
1952
1972
  postEvent: a,
1953
- isTma: o,
1954
- theme: p,
1973
+ isTma: p,
1974
+ theme: o,
1955
1975
  onVisibilityChanged: i,
1956
- offVisibilityChanged: l
1976
+ offVisibilityChanged: c
1957
1977
  }) {
1958
1978
  //#region Other properties.
1959
1979
  /**
@@ -2123,18 +2143,18 @@ class ys {
2123
2143
  * @see readyFp
2124
2144
  */
2125
2145
  e(this, "ready");
2126
- const f = (d) => {
2146
+ const m = (d) => {
2127
2147
  S.setState({ isActive: d.is_visible });
2128
2148
  }, F = (d) => {
2129
2149
  [
2130
2150
  [this.headerColor, "web_app_set_header_color"],
2131
2151
  [this.bgColor, "web_app_set_background_color"],
2132
2152
  [this.bottomBarColor, "web_app_set_bottom_bar_color"]
2133
- ].forEach(([B, T]) => {
2153
+ ].forEach(([B, L]) => {
2134
2154
  const M = B();
2135
- if (!_e(M) && (T !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(M))) {
2155
+ if (!_e(M) && (L !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(M))) {
2136
2156
  const P = d[M];
2137
- P && a(T, { color: P });
2157
+ P && a(L, { color: P });
2138
2158
  }
2139
2159
  });
2140
2160
  }, _ = new ie({
@@ -2148,10 +2168,10 @@ class ys {
2148
2168
  },
2149
2169
  isPageReload: r,
2150
2170
  onMounted: (d) => {
2151
- i(f), p.sub(F), S.setState(d);
2171
+ i(m), o.sub(F), S.setState(d);
2152
2172
  },
2153
2173
  onUnmounted() {
2154
- l(f), p.unsub(F);
2174
+ c(m), o.unsub(F);
2155
2175
  },
2156
2176
  restoreState: t.get
2157
2177
  });
@@ -2159,7 +2179,7 @@ class ys {
2159
2179
  const d = () => {
2160
2180
  };
2161
2181
  return u.pipe(_.mount(), b.match(d, d));
2162
- }, { isTma: o, returns: "plain" }), this.mount = /* @__PURE__ */ h(this.mountFp), this.unmount = _.unmount;
2182
+ }, { isTma: p, returns: "plain" }), this.mount = /* @__PURE__ */ h(this.mountFp), this.unmount = _.unmount;
2163
2183
  const S = new J({
2164
2184
  initialState: {
2165
2185
  bgColor: "bg_color",
@@ -2170,52 +2190,52 @@ class ys {
2170
2190
  onChange: t.set
2171
2191
  });
2172
2192
  this.state = S.state;
2173
- const w = (d) => _e(d) ? d : R(p)[d], k = (d) => C(() => w(d()));
2193
+ const w = (d) => _e(d) ? d : V(o)[d], k = (d) => C(() => w(d()));
2174
2194
  this.isActive = S.getter("isActive"), this.isSupported = C(() => [
2175
2195
  "web_app_set_header_color",
2176
2196
  "web_app_set_background_color",
2177
2197
  "web_app_set_bottom_bar_color"
2178
- ].some((d) => ee(d, R(n))));
2179
- const y = O(!1);
2180
- this.isCssVarsBound = C(y), this.bindCssVarsFp = A((d) => {
2181
- if (y())
2182
- return b.left(new Ie());
2183
- const [B, T] = ke(() => {
2184
- y.set(!1);
2185
- }), M = (P, $) => {
2186
- const j = () => {
2187
- Me(P, $() || null);
2198
+ ].some((d) => ee(d, V(n))));
2199
+ const I = j(!1);
2200
+ this.isCssVarsBound = C(I), this.bindCssVarsFp = A((d) => {
2201
+ if (I())
2202
+ return b.left(new ye());
2203
+ const [B, L] = ke(() => {
2204
+ I.set(!1);
2205
+ }), M = (P, R) => {
2206
+ const G = () => {
2207
+ Me(P, R() || null);
2188
2208
  };
2189
- j(), B($.sub(j), Ve.bind(null, P));
2209
+ G(), B(R.sub(G), Ve.bind(null, P));
2190
2210
  };
2191
- return d || (d = (P) => `--tg-${je(P)}`), M(d("bgColor"), this.bgColorRgb), M(d("bottomBarColor"), this.bottomBarColorRgb), M(d("headerColor"), this.headerColorRgb), y.set(!0), b.right(T);
2192
- }, { isTma: o, returns: "either", isMounted: this.isMounted }), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp);
2193
- const m = (d) => {
2194
- const B = S.getter(d), T = k(B), M = {
2211
+ return d || (d = (P) => `--tg-${Ge(P)}`), M(d("bgColor"), this.bgColorRgb), M(d("bottomBarColor"), this.bottomBarColorRgb), M(d("headerColor"), this.headerColorRgb), I.set(!0), b.right(L);
2212
+ }, { isTma: p, returns: "either", isMounted: this.isMounted }), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp);
2213
+ const f = (d) => {
2214
+ const B = S.getter(d), L = k(B), M = {
2195
2215
  headerColor: "web_app_set_header_color",
2196
2216
  bgColor: "web_app_set_background_color",
2197
2217
  bottomBarColor: "web_app_set_bottom_bar_color"
2198
2218
  }[d], P = A(
2199
- ($) => {
2200
- if ($ === B())
2219
+ (R) => {
2220
+ if (R === B())
2201
2221
  return b.right(void 0);
2202
- if (M === "web_app_set_header_color" && ($ === "bg_color" || $ === "secondary_bg_color"))
2222
+ if (M === "web_app_set_header_color" && (R === "bg_color" || R === "secondary_bg_color"))
2203
2223
  return u.pipe(
2204
- a("web_app_set_header_color", { color_key: $ }),
2224
+ a("web_app_set_header_color", { color_key: R }),
2205
2225
  b.map(() => {
2206
- S.setState({ [d]: $ });
2226
+ S.setState({ [d]: R });
2207
2227
  })
2208
2228
  );
2209
- const j = w($);
2229
+ const G = w(R);
2210
2230
  return u.pipe(
2211
- j ? a(M, { color: j }) : b.left(new Bt($)),
2231
+ G ? a(M, { color: G }) : b.left(new Bt(R)),
2212
2232
  b.map(() => {
2213
- S.setState({ [d]: $ });
2233
+ S.setState({ [d]: R });
2214
2234
  })
2215
2235
  );
2216
2236
  },
2217
2237
  {
2218
- isTma: o,
2238
+ isTma: p,
2219
2239
  version: n,
2220
2240
  requires: M,
2221
2241
  isMounted: this.isMounted,
@@ -2229,35 +2249,35 @@ class ys {
2229
2249
  } : void 0
2230
2250
  }
2231
2251
  );
2232
- return [B, T, /* @__PURE__ */ h(P), P];
2252
+ return [B, L, /* @__PURE__ */ h(P), P];
2233
2253
  };
2234
2254
  [
2235
2255
  this.bgColor,
2236
2256
  this.bgColorRgb,
2237
2257
  this.setBgColor,
2238
2258
  this.setBgColorFp
2239
- ] = m("bgColor"), [
2259
+ ] = f("bgColor"), [
2240
2260
  this.headerColor,
2241
2261
  this.headerColorRgb,
2242
2262
  this.setHeaderColor,
2243
2263
  this.setHeaderColorFp
2244
- ] = m("headerColor"), [
2264
+ ] = f("headerColor"), [
2245
2265
  this.bottomBarColor,
2246
2266
  this.bottomBarColorRgb,
2247
2267
  this.setBottomBarColor,
2248
2268
  this.setBottomBarColorFp
2249
- ] = m("bottomBarColor");
2250
- const g = E({ isTma: o, returns: "either" });
2269
+ ] = f("bottomBarColor");
2270
+ const g = E({ isTma: p, returns: "either" });
2251
2271
  this.closeFp = g((d) => a("web_app_close", { return_back: d })), this.close = /* @__PURE__ */ h(this.closeFp), this.readyFp = g(() => a("web_app_ready")), this.ready = /* @__PURE__ */ h(this.readyFp);
2252
2272
  }
2253
2273
  //#endregion
2254
2274
  }
2255
- function Is() {
2256
- return new ys({
2275
+ function ys() {
2276
+ return new Is({
2257
2277
  ...u.pipe(
2258
2278
  v(),
2259
- V,
2260
- I,
2279
+ T,
2280
+ y,
2261
2281
  Y("miniApp")
2262
2282
  ),
2263
2283
  offVisibilityChanged(s) {
@@ -2269,7 +2289,7 @@ function Is() {
2269
2289
  theme: he.state
2270
2290
  });
2271
2291
  }
2272
- const Es = /* @__PURE__ */ Is();
2292
+ const Es = /* @__PURE__ */ ys();
2273
2293
  function qs(s) {
2274
2294
  const t = s.message.trim(), r = (s.title || "").trim(), n = s.buttons || [];
2275
2295
  if (r.length > 64)
@@ -2282,17 +2302,17 @@ function qs(s) {
2282
2302
  if (!n.length)
2283
2303
  a.push({ type: "close", id: "" });
2284
2304
  else
2285
- for (let o = 0; o < n.length; o++) {
2286
- const p = n[o], i = p.id || "";
2305
+ for (let p = 0; p < n.length; p++) {
2306
+ const o = n[p], i = o.id || "";
2287
2307
  if (i.length > 64)
2288
- return b.left(new U(`Button with index ${o} has invalid id: ${i}`));
2289
- if (!p.type || p.type === "default" || p.type === "destructive") {
2290
- const l = p.text.trim();
2291
- if (!l || l.length > 64)
2292
- return b.left(new U(`Button with index ${o} has invalid text: ${l}`));
2293
- a.push({ type: p.type, text: l, id: i });
2308
+ return b.left(new U(`Button with index ${p} has invalid id: ${i}`));
2309
+ if (!o.type || o.type === "default" || o.type === "destructive") {
2310
+ const c = o.text.trim();
2311
+ if (!c || c.length > 64)
2312
+ return b.left(new U(`Button with index ${p} has invalid text: ${c}`));
2313
+ a.push({ type: o.type, text: c, id: i });
2294
2314
  } else
2295
- a.push({ type: p.type, id: i });
2315
+ a.push({ type: o.type, id: i });
2296
2316
  }
2297
2317
  return b.right({ title: r, message: t, buttons: a });
2298
2318
  }
@@ -2336,44 +2356,44 @@ class As {
2336
2356
  * @see showFp
2337
2357
  */
2338
2358
  e(this, "show");
2339
- const a = O(!1), o = () => {
2359
+ const a = j(!1), p = () => {
2340
2360
  a.set(!1);
2341
- }, p = E({
2361
+ }, o = E({
2342
2362
  version: t,
2343
2363
  isTma: r,
2344
2364
  requires: "web_app_open_popup",
2345
2365
  returns: "task"
2346
2366
  });
2347
- this.isSupported = W("web_app_open_popup", t), this.isOpened = C(a), this.showFp = p((i) => u.pipe(
2348
- this.isOpened() ? c.left(new Ee("A popup is already opened")) : c.right(void 0),
2349
- c.chainW(() => c.fromEither(qs(i))),
2350
- c.chain((l) => (a.set(!0), n("web_app_open_popup", "popup_closed", {
2367
+ this.isSupported = W("web_app_open_popup", t), this.isOpened = C(a), this.showFp = o((i) => u.pipe(
2368
+ this.isOpened() ? l.left(new Ee("A popup is already opened")) : l.right(void 0),
2369
+ l.chainW(() => l.fromEither(qs(i))),
2370
+ l.chain((c) => (a.set(!0), n("web_app_open_popup", "popup_closed", {
2351
2371
  ...i,
2352
- params: l
2372
+ params: c
2353
2373
  }))),
2354
- c.mapBoth(
2355
- (l) => (o(), l),
2356
- (l) => (o(), l.button_id)
2374
+ l.mapBoth(
2375
+ (c) => (p(), c),
2376
+ (c) => (p(), c.button_id)
2357
2377
  )
2358
2378
  )), this.show = /* @__PURE__ */ h(this.showFp);
2359
2379
  }
2360
2380
  }
2361
2381
  function Bs() {
2362
- return new As(u.pipe(v(), L, I));
2382
+ return new As(u.pipe(v(), $, y));
2363
2383
  }
2364
2384
  const Zr = /* @__PURE__ */ Bs();
2365
2385
  function xs({ request: s, ...t }) {
2366
2386
  return A((r) => u.pipe(
2367
2387
  s("web_app_request_phone", "phone_requested", r),
2368
- c.map((n) => n.status)
2388
+ l.map((n) => n.status)
2369
2389
  ), { ...t, requires: "web_app_request_phone", returns: "task" });
2370
2390
  }
2371
2391
  // @__NO_SIDE_EFFECTS__
2372
2392
  function Ms() {
2373
2393
  return xs(u.pipe(
2374
2394
  v(),
2375
- I,
2376
- L
2395
+ y,
2396
+ $
2377
2397
  ));
2378
2398
  }
2379
2399
  const et = /* @__PURE__ */ Ms(), Xr = /* @__PURE__ */ h(et);
@@ -2382,25 +2402,25 @@ function Vs({
2382
2402
  requestPhoneAccess: t,
2383
2403
  ...r
2384
2404
  }) {
2385
- const n = (p) => u.pipe(
2405
+ const n = (o) => u.pipe(
2386
2406
  s("getRequestedContact", {}, {
2387
- ...p,
2388
- timeout: (p || {}).timeout || 5e3
2407
+ ...o,
2408
+ timeout: (o || {}).timeout || 5e3
2389
2409
  }),
2390
- c.chainW((i) => {
2391
- const l = Fe(K(), i);
2392
- if (!l.success)
2393
- return c.left(new ue(i, l.issues));
2394
- if (!l.output)
2395
- return c.right(void 0);
2396
- const f = Fe(
2410
+ l.chainW((i) => {
2411
+ const c = Fe(K(), i);
2412
+ if (!c.success)
2413
+ return l.left(new ue(i, c.issues));
2414
+ if (!c.output)
2415
+ return l.right(void 0);
2416
+ const m = Fe(
2397
2417
  bt(
2398
- Oe({
2399
- contact: gt(Oe({
2418
+ je({
2419
+ contact: gt(je({
2400
2420
  user_id: Ke(),
2401
2421
  phone_number: K(),
2402
2422
  first_name: K(),
2403
- last_name: Ct(K())
2423
+ last_name: wt(K())
2404
2424
  })),
2405
2425
  auth_date: Ue(
2406
2426
  K(),
@@ -2410,46 +2430,46 @@ function Vs({
2410
2430
  hash: K()
2411
2431
  })
2412
2432
  ),
2413
- l.output
2433
+ c.output
2414
2434
  );
2415
- return f.success ? c.right({ raw: l.output, parsed: f.output }) : c.left(new ue(l.output, f.issues));
2435
+ return m.success ? l.right({ raw: c.output, parsed: m.output }) : l.left(new ue(c.output, m.issues));
2416
2436
  })
2417
- ), a = (p) => u.pipe(
2418
- n(p),
2419
- c.match(
2437
+ ), a = (o) => u.pipe(
2438
+ n(o),
2439
+ l.match(
2420
2440
  // All other errors except validation ones should be ignored. Receiving validation error
2421
2441
  // means that we have some data, but we are unable to parse it properly. So, there is no
2422
2442
  // need to make some more requests further, the problem is local.
2423
2443
  (i) => ue.is(i) ? b.left(i) : b.right(void 0),
2424
2444
  (i) => b.right(i)
2425
2445
  )
2426
- ), o = (p) => ge(
2427
- async (i, l, f) => {
2446
+ ), p = (o) => ge(
2447
+ async (i, c, m) => {
2428
2448
  let F = 50;
2429
- for (; !f.isRejected; ) {
2430
- const _ = await a(f)();
2449
+ for (; !m.isRejected; ) {
2450
+ const _ = await a(m)();
2431
2451
  if (_._tag === "Left")
2432
- return l(_.left);
2452
+ return c(_.left);
2433
2453
  if (_.right)
2434
2454
  return i(_.right);
2435
2455
  await new Promise((S) => setTimeout(S, F)), F += 50;
2436
2456
  }
2437
2457
  },
2438
- p
2458
+ o
2439
2459
  );
2440
- return A((p) => ge.fn((i) => u.pipe(
2460
+ return A((o) => ge.fn((i) => u.pipe(
2441
2461
  // Try to get the requested contact. Probably, we already requested it before.
2442
2462
  a(i),
2443
- c.chain((l) => l ? c.right(l) : u.pipe(
2463
+ l.chain((c) => c ? l.right(c) : u.pipe(
2444
2464
  t(i),
2445
- c.chainW((f) => f === "sent" ? o(i) : c.left(new Qe("User denied access")))
2465
+ l.chainW((m) => m === "sent" ? p(i) : l.left(new Qe("User denied access")))
2446
2466
  ))
2447
- ), p), { ...r, returns: "task", requires: "web_app_request_phone" });
2467
+ ), o), { ...r, returns: "task", requires: "web_app_request_phone" });
2448
2468
  }
2449
2469
  // @__NO_SIDE_EFFECTS__
2450
2470
  function Ts() {
2451
2471
  return Vs({
2452
- ...u.pipe(v(), xe, I),
2472
+ ...u.pipe(v(), xe, y),
2453
2473
  requestPhoneAccess: et
2454
2474
  });
2455
2475
  }
@@ -2462,11 +2482,11 @@ function Ls({ requestContact: s, ...t }) {
2462
2482
  // @__NO_SIDE_EFFECTS__
2463
2483
  function $s() {
2464
2484
  return Ls({
2465
- ...u.pipe(v(), I),
2485
+ ...u.pipe(v(), y),
2466
2486
  requestContact(s) {
2467
2487
  return u.pipe(
2468
2488
  tt(s),
2469
- c.map((t) => t.parsed)
2489
+ l.map((t) => t.parsed)
2470
2490
  );
2471
2491
  }
2472
2492
  });
@@ -2475,25 +2495,25 @@ const tt = /* @__PURE__ */ Ts(), en = /* @__PURE__ */ h(tt), Rs = /* @__PURE__ *
2475
2495
  function Ps({ request: s, ...t }) {
2476
2496
  return A((r) => u.pipe(
2477
2497
  s("web_app_request_write_access", "write_access_requested", r),
2478
- c.map((n) => n.status)
2498
+ l.map((n) => n.status)
2479
2499
  ), { ...t, requires: "web_app_request_write_access", returns: "task" });
2480
2500
  }
2481
2501
  // @__NO_SIDE_EFFECTS__
2482
- function Os() {
2502
+ function js() {
2483
2503
  return Ps(u.pipe(
2484
2504
  v(),
2485
- I,
2486
- L
2505
+ y,
2506
+ $
2487
2507
  ));
2488
2508
  }
2489
- const Ds = /* @__PURE__ */ Os(), sn = /* @__PURE__ */ h(Ds);
2490
- class Gs {
2509
+ const Os = /* @__PURE__ */ js(), sn = /* @__PURE__ */ h(Os);
2510
+ class Ds {
2491
2511
  constructor({
2492
2512
  version: t,
2493
2513
  onClosed: r,
2494
2514
  onTextReceived: n,
2495
2515
  isTma: a,
2496
- postEvent: o
2516
+ postEvent: p
2497
2517
  }) {
2498
2518
  /**
2499
2519
  * Signal indicating if the scanner is currently opened.
@@ -2574,10 +2594,10 @@ class Gs {
2574
2594
  * @see openFp
2575
2595
  */
2576
2596
  e(this, "open");
2577
- const p = { version: t, requires: "web_app_open_scan_qr_popup", isTma: a }, i = E({ ...p, returns: "either" }), l = E({ ...p, returns: "task" }), f = O(!1), F = () => {
2578
- f.set(!1);
2597
+ const o = { version: t, requires: "web_app_open_scan_qr_popup", isTma: a }, i = E({ ...o, returns: "either" }), c = E({ ...o, returns: "task" }), m = j(!1), F = () => {
2598
+ m.set(!1);
2579
2599
  };
2580
- this.isSupported = W("web_app_open_scan_qr_popup", t), this.isOpened = C(f), this.captureFp = l((_) => {
2600
+ this.isSupported = W("web_app_open_scan_qr_popup", t), this.isOpened = C(m), this.captureFp = c((_) => {
2581
2601
  let S;
2582
2602
  return u.pipe(
2583
2603
  this.openFp({
@@ -2586,34 +2606,34 @@ class Gs {
2586
2606
  _.capture(w) && (S = w, this.close());
2587
2607
  }
2588
2608
  }),
2589
- c.map(() => S)
2609
+ l.map(() => S)
2590
2610
  );
2591
- }), this.closeFp = i(() => u.pipe(o("web_app_close_scan_qr_popup"), b.map(F))), this.openFp = l((_) => u.pipe(
2592
- f() ? c.left(new Ee("The QR Scanner is already opened")) : async () => o("web_app_open_scan_qr_popup", { text: _.text }),
2593
- c.chainW(() => {
2594
- f.set(!0);
2595
- const [S, w] = ke(), k = (y) => (w(), f.set(!1), y);
2611
+ }), this.closeFp = i(() => u.pipe(p("web_app_close_scan_qr_popup"), b.map(F))), this.openFp = c((_) => u.pipe(
2612
+ m() ? l.left(new Ee("The QR Scanner is already opened")) : async () => p("web_app_open_scan_qr_popup", { text: _.text }),
2613
+ l.chainW(() => {
2614
+ m.set(!0);
2615
+ const [S, w] = ke(), k = (I) => (w(), m.set(!1), I);
2596
2616
  return u.pipe(
2597
- ge((y) => {
2617
+ ge((I) => {
2598
2618
  S(
2599
2619
  // The scanner was closed externally.
2600
- r(y),
2620
+ r(I),
2601
2621
  // The scanner was closed internally.
2602
- f.sub((m) => {
2603
- m || y();
2622
+ m.sub((f) => {
2623
+ f || I();
2604
2624
  }),
2605
2625
  n(_.onCaptured)
2606
2626
  );
2607
2627
  }, _),
2608
- c.mapBoth(k, k)
2628
+ l.mapBoth(k, k)
2609
2629
  );
2610
2630
  })
2611
2631
  )), this.open = /* @__PURE__ */ h(this.openFp), this.capture = /* @__PURE__ */ h(this.captureFp), this.close = /* @__PURE__ */ h(this.closeFp);
2612
2632
  }
2613
2633
  }
2614
- function js() {
2615
- return new Gs({
2616
- ...u.pipe(v(), V, I),
2634
+ function Gs() {
2635
+ return new Ds({
2636
+ ...u.pipe(v(), T, y),
2617
2637
  onClosed(s) {
2618
2638
  return z("scan_qr_popup_closed", s);
2619
2639
  },
@@ -2624,7 +2644,7 @@ function js() {
2624
2644
  }
2625
2645
  });
2626
2646
  }
2627
- const rn = /* @__PURE__ */ js();
2647
+ const rn = /* @__PURE__ */ Gs();
2628
2648
  class Us {
2629
2649
  constructor({ defaults: t, ...r }) {
2630
2650
  //#region Properties.
@@ -2676,6 +2696,11 @@ class Us {
2676
2696
  * params colors.
2677
2697
  */
2678
2698
  e(this, "textColor");
2699
+ /**
2700
+ * The ID of custom emoji icon displayed alongside button text.
2701
+ * @since Mini Apps v9.5
2702
+ */
2703
+ e(this, "iconCustomEmojiId");
2679
2704
  //#endregion
2680
2705
  //#region Methods.
2681
2706
  /**
@@ -2768,6 +2793,15 @@ class Us {
2768
2793
  * @see setPositionFp
2769
2794
  */
2770
2795
  e(this, "setPosition");
2796
+ /**
2797
+ * Updates the button custom emoji Id.
2798
+ * @since Mini Apps v9.5
2799
+ */
2800
+ e(this, "setIconCustomEmojiIdFp");
2801
+ /**
2802
+ * @see setIconCustomEmojiIdFp
2803
+ */
2804
+ e(this, "setIconCustomEmojiId");
2771
2805
  /**
2772
2806
  * Shows the button loader.
2773
2807
  * @since Mini Apps v7.10
@@ -2857,7 +2891,8 @@ class Us {
2857
2891
  isLoaderVisible: !1,
2858
2892
  isVisible: !1,
2859
2893
  text: "Cancel",
2860
- position: "left"
2894
+ position: "left",
2895
+ iconCustomEmojiId: ""
2861
2896
  },
2862
2897
  method: "web_app_setup_secondary_button",
2863
2898
  payload: (o) => ({
@@ -2868,13 +2903,17 @@ class Us {
2868
2903
  text: o.text,
2869
2904
  color: o.bgColor,
2870
2905
  text_color: o.textColor,
2871
- position: o.position
2906
+ position: o.position,
2907
+ icon_custom_emoji_id: o.iconCustomEmojiId
2872
2908
  })
2873
- }), a = (o, p) => {
2874
- const i = n.stateGetter(o);
2875
- return C(() => i() || R(p));
2909
+ }), a = (o, i) => {
2910
+ const c = n.stateGetter(o);
2911
+ return C(() => c() || V(i));
2912
+ }, p = (o, i) => {
2913
+ const c = n.stateGetter(o);
2914
+ return C(() => c() || V(i));
2876
2915
  };
2877
- this.isSupported = W("web_app_setup_secondary_button", r.version), this.bgColor = a("bgColor", t.bgColor), this.textColor = a("textColor", t.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"), [
2916
+ this.isSupported = W("web_app_setup_secondary_button", r.version), this.bgColor = a("bgColor", t.bgColor), this.textColor = a("textColor", t.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.iconCustomEmojiId = p("iconCustomEmojiId", ""), 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"), [
2878
2917
  [this.disableShineEffect, this.disableShineEffectFp],
2879
2918
  [this.enableShineEffect, this.enableShineEffectFp]
2880
2919
  ] = n.stateBoolSetters("hasShineEffect"), [
@@ -2883,7 +2922,7 @@ class Us {
2883
2922
  ] = n.stateBoolSetters("isEnabled"), [
2884
2923
  [this.hideLoader, this.hideLoaderFp],
2885
2924
  [this.showLoader, this.showLoaderFp]
2886
- ] = n.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = n.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = n.stateBoolSetters("isVisible"), this.setParams = n.setState, this.setParamsFp = n.setStateFp, 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;
2925
+ ] = n.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = n.stateSetters("text"), [this.setIconCustomEmojiId, this.setIconCustomEmojiIdFp] = n.stateSetters("iconCustomEmojiId"), [[this.hide, this.hideFp], [this.show, this.showFp]] = n.stateBoolSetters("isVisible"), this.setParams = n.setState, this.setParamsFp = n.setStateFp, 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;
2887
2926
  }
2888
2927
  //#endregion
2889
2928
  }
@@ -2891,7 +2930,8 @@ function Ws() {
2891
2930
  return new Us(
2892
2931
  /* @__PURE__ */ Xe("secondaryButton", "secondary_button_pressed", {
2893
2932
  bgColor: C(() => Es.bottomBarColorRgb() || "#000000"),
2894
- textColor: C(() => he.buttonColor() || "#2481cc")
2933
+ textColor: C(() => he.buttonColor() || "#2481cc"),
2934
+ iconCustomEmojiId: C(() => "")
2895
2935
  })
2896
2936
  );
2897
2937
  }
@@ -2943,46 +2983,46 @@ class Hs {
2943
2983
  * @see clearFp
2944
2984
  */
2945
2985
  e(this, "clear");
2946
- const o = E({
2986
+ const p = E({
2947
2987
  version: n,
2948
2988
  requires: "web_app_secure_storage_get_key",
2949
2989
  isTma: t,
2950
2990
  returns: "task"
2951
- }), p = (i, l, f) => {
2991
+ }), o = (i, c, m) => {
2952
2992
  const F = a();
2953
2993
  return u.pipe(
2954
- r(i, ["secure_storage_failed", l], {
2955
- params: { ...f, req_id: F },
2994
+ r(i, ["secure_storage_failed", c], {
2995
+ params: { ...m, req_id: F },
2956
2996
  capture: (_) => "payload" in _ ? _.payload.req_id === F : !0
2957
2997
  }),
2958
- c.chain((_) => _.event === "secure_storage_failed" ? c.left(new kt(_.payload.error || "UNKNOWN_ERROR")) : c.right(_.payload))
2998
+ l.chain((_) => _.event === "secure_storage_failed" ? l.left(new kt(_.payload.error || "UNKNOWN_ERROR")) : l.right(_.payload))
2959
2999
  );
2960
3000
  };
2961
- this.getItemFp = o((i) => u.pipe(
2962
- p("web_app_secure_storage_get_key", "secure_storage_key_received", { key: i }),
2963
- c.map((l) => ({
2964
- value: l.value,
2965
- canRestore: !!l.can_restore
3001
+ this.getItemFp = p((i) => u.pipe(
3002
+ o("web_app_secure_storage_get_key", "secure_storage_key_received", { key: i }),
3003
+ l.map((c) => ({
3004
+ value: c.value,
3005
+ canRestore: !!c.can_restore
2966
3006
  }))
2967
- )), this.setItemFp = o((i, l) => u.pipe(
2968
- p("web_app_secure_storage_save_key", "secure_storage_key_saved", { key: i, value: l }),
2969
- c.map(() => {
3007
+ )), this.setItemFp = p((i, c) => u.pipe(
3008
+ o("web_app_secure_storage_save_key", "secure_storage_key_saved", { key: i, value: c }),
3009
+ l.map(() => {
2970
3010
  })
2971
- )), this.deleteItemFp = o((i) => this.setItemFp(i, null)), this.clearFp = o(() => u.pipe(
2972
- p("web_app_secure_storage_clear", "secure_storage_cleared", {}),
2973
- c.map(() => {
3011
+ )), this.deleteItemFp = p((i) => this.setItemFp(i, null)), this.clearFp = p(() => u.pipe(
3012
+ o("web_app_secure_storage_clear", "secure_storage_cleared", {}),
3013
+ l.map(() => {
2974
3014
  })
2975
- )), this.restoreItemFp = o((i) => u.pipe(
2976
- p("web_app_secure_storage_restore_key", "secure_storage_key_restored", { key: i }),
2977
- c.map((l) => l.value)
3015
+ )), this.restoreItemFp = p((i) => u.pipe(
3016
+ o("web_app_secure_storage_restore_key", "secure_storage_key_restored", { key: i }),
3017
+ l.map((c) => c.value)
2978
3018
  )), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.clear = /* @__PURE__ */ h(this.clearFp), this.restoreItem = /* @__PURE__ */ h(this.restoreItemFp);
2979
3019
  }
2980
3020
  }
2981
3021
  function Ks() {
2982
3022
  return new Hs(u.pipe(
2983
3023
  v(),
2984
- I,
2985
- L,
3024
+ y,
3025
+ $,
2986
3026
  Je
2987
3027
  ));
2988
3028
  }
@@ -3083,7 +3123,7 @@ const an = /* @__PURE__ */ new Qs(
3083
3123
  /* @__PURE__ */ qe("settingsButton", "settings_button_pressed")
3084
3124
  );
3085
3125
  class zs {
3086
- constructor({ postEvent: t, storage: r, isTma: n, isPageReload: a, version: o }) {
3126
+ constructor({ postEvent: t, storage: r, isTma: n, isPageReload: a, version: p }) {
3087
3127
  /**
3088
3128
  * Signal indicating if the component is supported.
3089
3129
  */
@@ -3127,22 +3167,22 @@ class zs {
3127
3167
  * @see enableVerticalFp
3128
3168
  */
3129
3169
  e(this, "enableVertical");
3130
- const p = { isVerticalEnabled: !0 }, i = new J({
3131
- initialState: p,
3170
+ const o = { isVerticalEnabled: !0 }, i = new J({
3171
+ initialState: o,
3132
3172
  onChange(w) {
3133
3173
  r.set(w);
3134
3174
  }
3135
- }), l = new ie({
3136
- initialState: p,
3175
+ }), c = new ie({
3176
+ initialState: o,
3137
3177
  isPageReload: a,
3138
3178
  onMounted: i.setState,
3139
3179
  restoreState: r.get
3140
- }), f = { requires: "web_app_setup_swipe_behavior", isTma: n, version: o }, F = E({
3141
- ...f,
3180
+ }), m = { requires: "web_app_setup_swipe_behavior", isTma: n, version: p }, F = E({
3181
+ ...m,
3142
3182
  returns: "plain"
3143
3183
  }), _ = E({
3144
- ...f,
3145
- isMounted: l.isMounted,
3184
+ ...m,
3185
+ isMounted: c.isMounted,
3146
3186
  returns: "either"
3147
3187
  }), S = (w) => {
3148
3188
  const k = { isVerticalEnabled: w };
@@ -3153,18 +3193,18 @@ class zs {
3153
3193
  })
3154
3194
  ) : b.right(void 0);
3155
3195
  };
3156
- this.isSupported = W("web_app_setup_swipe_behavior", o), this.isVerticalEnabled = i.getter("isVerticalEnabled"), this.isMounted = l.isMounted, this.disableVerticalFp = _(() => S(!1)), this.enableVerticalFp = _(() => S(!0)), this.mountFp = F(() => {
3196
+ this.isSupported = W("web_app_setup_swipe_behavior", p), this.isVerticalEnabled = i.getter("isVerticalEnabled"), this.isMounted = c.isMounted, this.disableVerticalFp = _(() => S(!1)), this.enableVerticalFp = _(() => S(!0)), this.mountFp = F(() => {
3157
3197
  const w = () => {
3158
3198
  };
3159
- return u.pipe(l.mount(), b.match(w, w));
3160
- }), this.unmount = l.unmount, this.disableVertical = /* @__PURE__ */ h(this.disableVerticalFp), this.enableVertical = /* @__PURE__ */ h(this.enableVerticalFp), this.mount = /* @__PURE__ */ h(this.mountFp);
3199
+ return u.pipe(c.mount(), b.match(w, w));
3200
+ }), this.unmount = c.unmount, this.disableVertical = /* @__PURE__ */ h(this.disableVerticalFp), this.enableVertical = /* @__PURE__ */ h(this.enableVerticalFp), this.mount = /* @__PURE__ */ h(this.mountFp);
3161
3201
  }
3162
3202
  }
3163
3203
  function Ns() {
3164
3204
  return new zs(u.pipe(
3165
3205
  v(),
3166
- V,
3167
- I,
3206
+ T,
3207
+ y,
3168
3208
  Y("swipeBehavior")
3169
3209
  ));
3170
3210
  }
@@ -3191,27 +3231,27 @@ function Js({ request: s, ...t }) {
3191
3231
  "file_download_requested",
3192
3232
  { ...a, params: { url: r, file_name: n } }
3193
3233
  ),
3194
- c.chain((o) => o.status === "downloading" ? c.right(void 0) : c.left(new Qe("User denied the action")))
3234
+ l.chain((p) => p.status === "downloading" ? l.right(void 0) : l.left(new Qe("User denied the action")))
3195
3235
  ), { ...t, requires: "web_app_request_file_download", returns: "task" });
3196
3236
  }
3197
3237
  // @__NO_SIDE_EFFECTS__
3198
3238
  function Ys() {
3199
3239
  return Js(u.pipe(
3200
3240
  v(),
3201
- L,
3202
- I
3241
+ $,
3242
+ y
3203
3243
  ));
3204
3244
  }
3205
3245
  const Zs = /* @__PURE__ */ Ys(), cn = /* @__PURE__ */ h(Zs);
3206
3246
  function Xs({ invokeCustomMethod: s, ...t }) {
3207
3247
  return A((r) => u.pipe(
3208
3248
  s("getCurrentTime", {}, r),
3209
- c.chain((n) => {
3249
+ l.chain((n) => {
3210
3250
  const a = Fe(
3211
- Ue(Ke(), St(), We((o) => new Date(o * 1e3)), He()),
3251
+ Ue(Ke(), St(), We((p) => new Date(p * 1e3)), He()),
3212
3252
  n
3213
3253
  );
3214
- return a.success ? c.right(a.output) : c.left(new ue(n, a.issues));
3254
+ return a.success ? l.right(a.output) : l.left(new ue(n, a.issues));
3215
3255
  })
3216
3256
  ), { ...t, requires: "web_app_invoke_custom_method", returns: "task" });
3217
3257
  }
@@ -3220,7 +3260,7 @@ function er() {
3220
3260
  return Xs(u.pipe(
3221
3261
  v(),
3222
3262
  xe,
3223
- I
3263
+ y
3224
3264
  ));
3225
3265
  }
3226
3266
  const tr = /* @__PURE__ */ er(), ln = /* @__PURE__ */ h(tr);
@@ -3231,8 +3271,8 @@ function sr({ postEvent: s, ...t }) {
3231
3271
  function rr() {
3232
3272
  return sr(u.pipe(
3233
3273
  v(),
3234
- V,
3235
- I
3274
+ T,
3275
+ y
3236
3276
  ));
3237
3277
  }
3238
3278
  const nr = /* @__PURE__ */ rr(), hn = /* @__PURE__ */ h(nr);
@@ -3245,7 +3285,7 @@ function ir({ request: s, createRequestId: t, ...r }) {
3245
3285
  params: { req_id: a },
3246
3286
  capture: ht(a)
3247
3287
  }),
3248
- c.map(({ data: o = null }) => o)
3288
+ l.map(({ data: p = null }) => p)
3249
3289
  );
3250
3290
  }, { ...r, requires: "web_app_read_text_from_clipboard", returns: "task" });
3251
3291
  }
@@ -3254,8 +3294,8 @@ function or() {
3254
3294
  return ir({
3255
3295
  ...u.pipe(
3256
3296
  v(),
3257
- I,
3258
- L
3297
+ y,
3298
+ $
3259
3299
  ),
3260
3300
  createRequestId: Be
3261
3301
  });
@@ -3265,14 +3305,14 @@ function pr(s) {
3265
3305
  const t = {}, r = s.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3266
3306
  if (r) {
3267
3307
  const [, n, a] = r;
3268
- n && (t.appVersion = n), a && a.slice(1, a.length - 1).split(";").forEach((o) => {
3269
- const [p, i] = o.trim().split(" ");
3270
- if (p === "Android")
3308
+ n && (t.appVersion = n), a && a.slice(1, a.length - 1).split(";").forEach((p) => {
3309
+ const [o, i] = p.trim().split(" ");
3310
+ if (o === "Android")
3271
3311
  t.androidVersion = i;
3272
- else if (p === "SDK") {
3273
- const l = parseInt(i, 10);
3274
- l && (t.sdkVersion = l);
3275
- } else i ? (t.manufacturer = p, t.model = i) : t.performanceClass = p;
3312
+ else if (o === "SDK") {
3313
+ const c = parseInt(i, 10);
3314
+ c && (t.sdkVersion = c);
3315
+ } else i ? (t.manufacturer = o, t.model = i) : t.performanceClass = o;
3276
3316
  });
3277
3317
  }
3278
3318
  return t;
@@ -3290,9 +3330,9 @@ function ur({ postEvent: s, ...t }) {
3290
3330
  }
3291
3331
  // @__NO_SIDE_EFFECTS__
3292
3332
  function cr() {
3293
- return ur(u.pipe(v(), V));
3333
+ return ur(u.pipe(v(), T));
3294
3334
  }
3295
- const lr = /* @__PURE__ */ cr(), fn = /* @__PURE__ */ h(lr);
3335
+ const lr = /* @__PURE__ */ cr(), mn = /* @__PURE__ */ h(lr);
3296
3336
  function hr({ request: s, ...t }) {
3297
3337
  return A((r, n) => u.pipe(
3298
3338
  s(
@@ -3303,19 +3343,19 @@ function hr({ request: s, ...t }) {
3303
3343
  params: { id: r }
3304
3344
  }
3305
3345
  ),
3306
- c.chain((a) => a.event === "prepared_message_failed" ? c.left(new At(a.payload.error)) : c.right(void 0))
3346
+ l.chain((a) => a.event === "prepared_message_failed" ? l.left(new At(a.payload.error)) : l.right(void 0))
3307
3347
  ), { ...t, requires: "web_app_send_prepared_message", returns: "task" });
3308
3348
  }
3309
3349
  // @__NO_SIDE_EFFECTS__
3310
3350
  function dr() {
3311
3351
  return hr(u.pipe(
3312
3352
  v(),
3313
- L,
3314
- I
3353
+ $,
3354
+ y
3315
3355
  ));
3316
3356
  }
3317
- const _r = /* @__PURE__ */ dr(), mn = /* @__PURE__ */ h(_r);
3318
- function fr({ postEvent: s, ...t }) {
3357
+ const _r = /* @__PURE__ */ dr(), fn = /* @__PURE__ */ h(_r);
3358
+ function mr({ postEvent: s, ...t }) {
3319
3359
  return A((r, n = {}) => s("web_app_share_to_story", {
3320
3360
  text: n.text,
3321
3361
  media_url: r,
@@ -3323,14 +3363,14 @@ function fr({ postEvent: s, ...t }) {
3323
3363
  }), { ...t, requires: "web_app_share_to_story", returns: "either" });
3324
3364
  }
3325
3365
  // @__NO_SIDE_EFFECTS__
3326
- function mr() {
3327
- return fr(u.pipe(
3366
+ function fr() {
3367
+ return mr(u.pipe(
3328
3368
  v(),
3329
- V,
3330
- I
3369
+ T,
3370
+ y
3331
3371
  ));
3332
3372
  }
3333
- const br = /* @__PURE__ */ mr(), bn = /* @__PURE__ */ h(br), ve = /* @__PURE__ */ oe(!1);
3373
+ const br = /* @__PURE__ */ fr(), bn = /* @__PURE__ */ h(br), ve = /* @__PURE__ */ oe(!1);
3334
3374
  function gr({ isInlineMode: s, postEvent: t, ...r }) {
3335
3375
  return A((n, a) => t("web_app_switch_inline_query", {
3336
3376
  query: n,
@@ -3338,7 +3378,7 @@ function gr({ isInlineMode: s, postEvent: t, ...r }) {
3338
3378
  }), {
3339
3379
  ...r,
3340
3380
  requires: {
3341
- every: ["web_app_switch_inline_query", () => R(s) ? void 0 : "The application must be launched in the inline mode"]
3381
+ every: ["web_app_switch_inline_query", () => V(s) ? void 0 : "The application must be launched in the inline mode"]
3342
3382
  },
3343
3383
  returns: "either"
3344
3384
  });
@@ -3348,31 +3388,31 @@ function Fr() {
3348
3388
  return gr({
3349
3389
  ...u.pipe(
3350
3390
  v(),
3351
- V,
3352
- I
3391
+ T,
3392
+ y
3353
3393
  ),
3354
3394
  isInlineMode: ve
3355
3395
  });
3356
3396
  }
3357
- const wr = /* @__PURE__ */ Fr(), gn = /* @__PURE__ */ h(wr);
3358
- class Cr {
3397
+ const Cr = /* @__PURE__ */ Fr(), gn = /* @__PURE__ */ h(Cr);
3398
+ class wr {
3359
3399
  constructor({
3360
3400
  storage: t,
3361
3401
  isPageReload: r,
3362
3402
  onContentSafeAreaInsetsChanged: n,
3363
3403
  onSafeAreaInsetsChanged: a,
3364
- onViewportChanged: o,
3365
- onFullscreenChanged: p,
3404
+ onViewportChanged: p,
3405
+ onFullscreenChanged: o,
3366
3406
  offContentSafeAreaInsetsChanged: i,
3367
- offFullscreenChanged: l,
3368
- offSafeAreaInsetsChanged: f,
3407
+ offFullscreenChanged: c,
3408
+ offSafeAreaInsetsChanged: m,
3369
3409
  offViewportChanged: F,
3370
3410
  request: _,
3371
3411
  isViewportStable: S,
3372
3412
  isFullscreen: w,
3373
3413
  isTma: k,
3374
- version: y,
3375
- postEvent: m
3414
+ version: I,
3415
+ postEvent: f
3376
3416
  }) {
3377
3417
  //#region Other properties.
3378
3418
  /**
@@ -3579,25 +3619,25 @@ class Cr {
3579
3619
  width: q.width,
3580
3620
  stableHeight: q.is_state_stable ? q.height : void 0
3581
3621
  });
3582
- }, T = (q) => {
3622
+ }, L = (q) => {
3583
3623
  d.setState({ isFullscreen: q.is_fullscreen });
3584
3624
  }, M = (q) => {
3585
3625
  d.setState({ safeAreaInsets: q });
3586
3626
  }, P = (q) => {
3587
3627
  d.setState({ contentSafeAreaInsets: q });
3588
- }, $ = new Ae({
3628
+ }, R = new Ae({
3589
3629
  initialState(q) {
3590
3630
  const Z = (H) => () => {
3591
- const [N, D] = H === "safe-area" ? ["web_app_request_safe_area", "safe_area_changed"] : ["web_app_request_content_safe_area", "content_safe_area_changed"];
3592
- return ee(N, R(y)) ? _(N, D, q) : c.right({ top: 0, left: 0, right: 0, bottom: 0 });
3593
- }, x = (H) => () => typeof H == "boolean" ? c.right(H) : c.fromEither(H());
3631
+ const [N, O] = H === "safe-area" ? ["web_app_request_safe_area", "safe_area_changed"] : ["web_app_request_content_safe_area", "content_safe_area_changed"];
3632
+ return ee(N, V(I)) ? _(N, O, q) : l.right({ top: 0, left: 0, right: 0, bottom: 0 });
3633
+ }, x = (H) => () => typeof H == "boolean" ? l.right(H) : l.fromEither(H());
3594
3634
  return u.pipe(
3595
- c.Do,
3596
- c.bindW("safeAreaInsets", Z("safe-area")),
3597
- c.bindW("contentSafeAreaInsets", Z("content-safe-area")),
3598
- c.bindW("isFullscreen", x(w)),
3599
- c.bindW("isViewportStable", x(S)),
3600
- c.chainW(({ isViewportStable: H, ...N }) => H ? c.right({
3635
+ l.Do,
3636
+ l.bindW("safeAreaInsets", Z("safe-area")),
3637
+ l.bindW("contentSafeAreaInsets", Z("content-safe-area")),
3638
+ l.bindW("isFullscreen", x(w)),
3639
+ l.bindW("isViewportStable", x(S)),
3640
+ l.chainW(({ isViewportStable: H, ...N }) => H ? l.right({
3601
3641
  ...N,
3602
3642
  height: window.innerHeight,
3603
3643
  isExpanded: !0,
@@ -3605,33 +3645,33 @@ class Cr {
3605
3645
  width: window.innerWidth
3606
3646
  }) : u.pipe(
3607
3647
  _("web_app_request_viewport", "viewport_changed", q),
3608
- c.map((D) => ({
3648
+ l.map((O) => ({
3609
3649
  ...N,
3610
- height: D.height,
3611
- isExpanded: D.is_expanded,
3612
- stableHeight: D.is_state_stable ? D.height : 0,
3613
- width: D.width
3650
+ height: O.height,
3651
+ isExpanded: O.is_expanded,
3652
+ stableHeight: O.is_state_stable ? O.height : 0,
3653
+ width: O.width
3614
3654
  }))
3615
3655
  ))
3616
3656
  );
3617
3657
  },
3618
3658
  isPageReload: r,
3619
3659
  onMounted(q) {
3620
- o(B), p(T), a(M), n(P), d.setState(q);
3660
+ p(B), o(L), a(M), n(P), d.setState(q);
3621
3661
  },
3622
3662
  onUnmounted() {
3623
- F(B), l(T), f(M), i(P);
3663
+ F(B), c(L), m(M), i(P);
3624
3664
  },
3625
3665
  restoreState: t.get
3626
- }), j = (q) => C(() => this.safeAreaInsets()[q]), ae = (q) => C(() => this.contentSafeAreaInsets()[q]);
3627
- 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 = j("top"), this.safeAreaInsetBottom = j("bottom"), this.safeAreaInsetLeft = j("left"), this.safeAreaInsetRight = j("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = ae("top"), this.contentSafeAreaInsetBottom = ae("bottom"), this.contentSafeAreaInsetLeft = ae("left"), this.contentSafeAreaInsetRight = ae("right");
3666
+ }), G = (q) => C(() => this.safeAreaInsets()[q]), ae = (q) => C(() => this.contentSafeAreaInsets()[q]);
3667
+ 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 = G("top"), this.safeAreaInsetBottom = G("bottom"), this.safeAreaInsetLeft = G("left"), this.safeAreaInsetRight = G("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = ae("top"), this.contentSafeAreaInsetBottom = ae("bottom"), this.contentSafeAreaInsetLeft = ae("left"), this.contentSafeAreaInsetRight = ae("right");
3628
3668
  const st = E({ isTma: k, returns: "task" }), Te = E({
3629
3669
  isTma: k,
3630
3670
  returns: "either"
3631
3671
  }), rt = E({
3632
3672
  isTma: k,
3633
3673
  requires: "web_app_request_fullscreen",
3634
- version: y,
3674
+ version: I,
3635
3675
  returns: "task"
3636
3676
  }), Le = (q) => rt((Z) => u.pipe(
3637
3677
  _(
@@ -3639,17 +3679,17 @@ class Cr {
3639
3679
  ["fullscreen_changed", "fullscreen_failed"],
3640
3680
  Z
3641
3681
  ),
3642
- c.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? c.left(new qt(x.payload.error)) : (d.setState({
3682
+ l.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? l.left(new qt(x.payload.error)) : (d.setState({
3643
3683
  isFullscreen: "is_fullscreen" in x.payload ? x.payload.is_fullscreen : !0
3644
- }), c.right(void 0)))
3684
+ }), l.right(void 0)))
3645
3685
  ));
3646
- this.isMounted = $.isMounted, this.mountFp = st($.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = Le(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = Le(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
3647
- const pe = O(!1);
3686
+ this.isMounted = R.isMounted, this.mountFp = st(R.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = Le(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = Le(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
3687
+ const pe = j(!1);
3648
3688
  this.isCssVarsBound = C(pe), this.bindCssVarsFp = Te(
3649
3689
  (q) => {
3650
3690
  if (pe())
3651
- return b.left(new Ie());
3652
- q || (q = (x) => `--tg-viewport-${je(x)}`);
3691
+ return b.left(new ye());
3692
+ q || (q = (x) => `--tg-viewport-${Ge(x)}`);
3653
3693
  const Z = [
3654
3694
  ["height", this.height],
3655
3695
  ["stableHeight", this.stableHeight],
@@ -3663,12 +3703,12 @@ class Cr {
3663
3703
  ["contentSafeAreaInsetLeft", this.contentSafeAreaInsetLeft],
3664
3704
  ["contentSafeAreaInsetRight", this.contentSafeAreaInsetRight]
3665
3705
  ].reduce((x, [H, N]) => {
3666
- const D = q(H);
3667
- if (D) {
3706
+ const O = q(H);
3707
+ if (O) {
3668
3708
  const $e = () => {
3669
- Me(D, `${N()}px`);
3709
+ Me(O, `${N()}px`);
3670
3710
  };
3671
- x.push({ update: $e, removeListener: N.sub($e), cssVar: D });
3711
+ x.push({ update: $e, removeListener: N.sub($e), cssVar: O });
3672
3712
  }
3673
3713
  return x;
3674
3714
  }, []);
@@ -3680,32 +3720,32 @@ class Cr {
3680
3720
  }), pe.set(!1);
3681
3721
  });
3682
3722
  }
3683
- ), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Te(() => m("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
3723
+ ), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Te(() => f("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
3684
3724
  }
3685
3725
  //#endregion
3686
3726
  }
3687
3727
  function Sr() {
3688
- const s = (o) => ({
3689
- on: (p) => {
3690
- z(o, p);
3728
+ const s = (p) => ({
3729
+ on: (o) => {
3730
+ z(p, o);
3691
3731
  },
3692
- off: (p) => {
3693
- ne(o, p);
3732
+ off: (o) => {
3733
+ ne(p, o);
3694
3734
  }
3695
3735
  }), t = s("viewport_changed"), r = s("fullscreen_changed"), n = s("safe_area_changed"), a = s("content_safe_area_changed");
3696
- return new Cr({
3736
+ return new wr({
3697
3737
  ...u.pipe(
3698
3738
  v(),
3699
3739
  Y("viewport"),
3700
- I,
3701
- V,
3702
- L
3740
+ y,
3741
+ T,
3742
+ $
3703
3743
  ),
3704
3744
  isFullscreen() {
3705
- return u.pipe(le(), b.map((o) => !!o.tgWebAppFullscreen));
3745
+ return u.pipe(le(), b.map((p) => !!p.tgWebAppFullscreen));
3706
3746
  },
3707
3747
  isViewportStable() {
3708
- return u.pipe(le(), b.map((o) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(o.tgWebAppPlatform)));
3748
+ return u.pipe(le(), b.map((p) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(p.tgWebAppPlatform)));
3709
3749
  },
3710
3750
  offContentSafeAreaInsetsChanged: a.off,
3711
3751
  offFullscreenChanged: r.off,
@@ -3725,28 +3765,28 @@ function vr(s = {}) {
3725
3765
  themeParams: n
3726
3766
  } = s;
3727
3767
  if (t && typeof r == "boolean" && n)
3728
- Ce.set(t), ve.set(r), Se.set(n);
3768
+ we.set(t), ve.set(r), Se.set(n);
3729
3769
  else {
3730
3770
  const i = u.pipe(le(), b.matchW(
3731
- (l) => l,
3732
- (l) => {
3733
- Ce.set(t || l.tgWebAppVersion), ve.set(typeof r == "boolean" ? r : !!l.tgWebAppBotInline), Se.set(n || l.tgWebAppThemeParams);
3771
+ (c) => c,
3772
+ (c) => {
3773
+ we.set(t || c.tgWebAppVersion), ve.set(typeof r == "boolean" ? r : !!c.tgWebAppBotInline), Se.set(n || c.tgWebAppThemeParams);
3734
3774
  }
3735
3775
  ));
3736
3776
  if (i)
3737
3777
  return b.left(i);
3738
3778
  }
3739
3779
  s.postEvent && ze.set(s.postEvent);
3740
- const [a, o] = ke(
3780
+ const [a, p] = ke(
3741
3781
  z("reload_iframe", () => {
3742
3782
  Re().log("Received a request to reload the page"), Mt("iframe_will_reload"), window.location.reload();
3743
3783
  })
3744
- ), { acceptCustomStyles: p = !0 } = s;
3745
- if (p) {
3784
+ ), { acceptCustomStyles: o = !0 } = s;
3785
+ if (o) {
3746
3786
  const i = document.createElement("style");
3747
3787
  i.id = "telegram-custom-styles", document.head.appendChild(i), a(
3748
- z("set_custom_style", (l) => {
3749
- i.innerHTML = l;
3788
+ z("set_custom_style", (c) => {
3789
+ i.innerHTML = c;
3750
3790
  }),
3751
3791
  () => {
3752
3792
  document.head.removeChild(i);
@@ -3755,39 +3795,39 @@ function vr(s = {}) {
3755
3795
  }
3756
3796
  return u.pipe(
3757
3797
  re("iframe_ready", { reload_supported: !0 }),
3758
- b.map(() => (Re().log("The package was initialized"), o))
3798
+ b.map(() => (Re().log("The package was initialized"), p))
3759
3799
  );
3760
3800
  }
3761
- const wn = te(vr);
3801
+ const Cn = te(vr);
3762
3802
  export {
3763
3803
  Qe as AccessDeniedError,
3764
3804
  xt as BackButton,
3765
3805
  $t as Biometry,
3766
- Ie as CSSVarsBoundError,
3806
+ ye as CSSVarsBoundError,
3767
3807
  vn as CancelledError,
3768
- Ot as ClosingBehavior,
3769
- Gt as CloudStorage,
3808
+ jt as ClosingBehavior,
3809
+ Dt as CloudStorage,
3770
3810
  Ee as ConcurrentCallError,
3771
3811
  Wt as DeviceStorage,
3772
3812
  vt as DeviceStorageMethodError,
3773
3813
  qt as FullscreenFailedError,
3774
- It as FunctionUnavailableError,
3814
+ yt as FunctionUnavailableError,
3775
3815
  Zt as HapticFeedback,
3776
3816
  os as InitData,
3777
3817
  U as InvalidArgumentsError,
3778
3818
  Mr as InvalidEnvError,
3779
3819
  kn as InvalidLaunchParamsError,
3780
3820
  ps as Invoice,
3781
- yn as InvokeCustomMethodFailedError,
3782
- In as LaunchParamsRetrieveError,
3821
+ In as InvokeCustomMethodFailedError,
3822
+ yn as LaunchParamsRetrieveError,
3783
3823
  Fs as LocationManager,
3784
- Cs as MainButton,
3824
+ ws as MainButton,
3785
3825
  En as MethodParameterUnsupportedError,
3786
3826
  qn as MethodUnsupportedError,
3787
- ys as MiniApp,
3788
- yt as NotAvailableError,
3827
+ Is as MiniApp,
3828
+ It as NotAvailableError,
3789
3829
  As as Popup,
3790
- Gs as QrScanner,
3830
+ Ds as QrScanner,
3791
3831
  Us as SecondaryButton,
3792
3832
  Hs as SecureStorage,
3793
3833
  kt as SecureStorageMethodError,
@@ -3800,7 +3840,7 @@ export {
3800
3840
  Bn as UnknownEnvError,
3801
3841
  Bt as UnknownThemeParamsKeyError,
3802
3842
  ue as ValidationError,
3803
- Cr as Viewport,
3843
+ wr as Viewport,
3804
3844
  Ur as addToHomeScreen,
3805
3845
  ss as addToHomeScreenFp,
3806
3846
  xn as applyPolyfills,
@@ -3819,25 +3859,25 @@ export {
3819
3859
  $n as debug,
3820
3860
  Rn as decodeBase64Url,
3821
3861
  Pn as decodeBase64UrlFp,
3822
- On as decodeStartParam,
3823
- Dn as decodeStartParamFp,
3824
- Gn as deepSnakeToCamelObjKeys,
3825
- Or as deviceStorage,
3862
+ jn as decodeStartParam,
3863
+ On as decodeStartParamFp,
3864
+ Dn as deepSnakeToCamelObjKeys,
3865
+ jr as deviceStorage,
3826
3866
  cn as downloadFile,
3827
3867
  Zs as downloadFileFp,
3828
- jn as emitEvent,
3868
+ Gn as emitEvent,
3829
3869
  Un as encodeBase64Url,
3830
3870
  ln as getCurrentTime,
3831
3871
  tr as getCurrentTimeFp,
3832
3872
  Wn as getReleaseVersion,
3833
- jr as hapticFeedback,
3873
+ Gr as hapticFeedback,
3834
3874
  hn as hideKeyboard,
3835
3875
  nr as hideKeyboardFp,
3836
- wn as init,
3876
+ Cn as init,
3837
3877
  Hr as initData,
3838
3878
  vr as initFp,
3839
3879
  Kr as invoice,
3840
- jt as invokeCustomMethod,
3880
+ Gt as invokeCustomMethod,
3841
3881
  ci as isAnyRGB,
3842
3882
  Ze as isColorDark,
3843
3883
  Ss as isColorDarkFp,
@@ -3860,8 +3900,8 @@ export {
3860
3900
  hs as openLinkFp,
3861
3901
  zr as openTelegramLink,
3862
3902
  Ye as openTelegramLinkFp,
3863
- fi as parseInitDataQuery,
3864
- mi as parseInitDataQueryFp,
3903
+ mi as parseInitDataQuery,
3904
+ fi as parseInitDataQueryFp,
3865
3905
  bi as parseLaunchParamsQuery,
3866
3906
  gi as parseLaunchParamsQueryFp,
3867
3907
  Zr as popup,
@@ -3877,13 +3917,13 @@ export {
3877
3917
  en as requestContactComplete,
3878
3918
  tt as requestContactCompleteFp,
3879
3919
  Rs as requestContactFp,
3880
- Dr as requestEmojiStatusAccess,
3920
+ Or as requestEmojiStatusAccess,
3881
3921
  zt as requestEmojiStatusAccessFp,
3882
3922
  Rt as requestFp,
3883
3923
  Xr as requestPhoneAccess,
3884
3924
  et as requestPhoneAccessFp,
3885
3925
  sn as requestWriteAccess,
3886
- Ds as requestWriteAccessFp,
3926
+ Os as requestWriteAccessFp,
3887
3927
  _n as retrieveAndroidDeviceData,
3888
3928
  pr as retrieveAndroidDeviceDataFrom,
3889
3929
  Xn as retrieveLaunchParams,
@@ -3894,16 +3934,16 @@ export {
3894
3934
  ni as retrieveRawLaunchParamsFp,
3895
3935
  nn as secondaryButton,
3896
3936
  on as secureStorage,
3897
- fn as sendData,
3937
+ mn as sendData,
3898
3938
  lr as sendDataFp,
3899
3939
  Fi as serializeInitDataQuery,
3900
- wi as serializeLaunchParamsQuery,
3940
+ Ci as serializeLaunchParamsQuery,
3901
3941
  ii as setDebug,
3902
- Gr as setEmojiStatus,
3942
+ Dr as setEmojiStatus,
3903
3943
  Yt as setEmojiStatusFp,
3904
3944
  oi as setTargetOrigin,
3905
3945
  an as settingsButton,
3906
- mn as shareMessage,
3946
+ fn as shareMessage,
3907
3947
  _r as shareMessageFp,
3908
3948
  bn as shareStory,
3909
3949
  br as shareStoryFp,
@@ -3912,10 +3952,10 @@ export {
3912
3952
  ai as supports,
3913
3953
  pn as swipeBehavior,
3914
3954
  gn as switchInlineQuery,
3915
- wr as switchInlineQueryFp,
3955
+ Cr as switchInlineQueryFp,
3916
3956
  pi as targetOrigin,
3917
3957
  he as themeParams,
3918
- Ci as toRGB,
3958
+ wi as toRGB,
3919
3959
  Si as toRGBFp,
3920
3960
  vi as toRGBFull,
3921
3961
  ki as toRGBFullFp,