@vbotma/sdk 3.2.2 → 3.2.3
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/dts/host-features/ThemeParams/HostThemeParams.d.ts +21 -0
- package/dist/dts/host-features/index.d.ts +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +3 -3
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +949 -915
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var e = (
|
|
1
|
+
var pt = Object.defineProperty;
|
|
2
|
+
var ct = (n, t, r) => t in n ? pt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
|
|
3
|
+
var e = (n, t, r) => ct(n, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { batch as ue, signal as O, computed as w } from "@vbotma/signals";
|
|
5
|
-
import { supports as ee, isVBMAFp as ut, postEventFp as
|
|
6
|
-
import { CancelledError as
|
|
7
|
-
import { throwifyFpFn as
|
|
8
|
-
import { BetterPromise as
|
|
9
|
-
import { toRGBFullFp as
|
|
10
|
-
import { isAnyRGB as
|
|
11
|
-
import { either as b, function as p, option as N, taskEither as
|
|
12
|
-
import { errorClass as j, errorClassWithData as
|
|
13
|
-
import { parse as
|
|
14
|
-
function $(
|
|
15
|
-
return typeof
|
|
5
|
+
import { supports as ee, isVBMAFp as ut, postEventFp as ye, off as re, on as G, request2Fp as He, requestFp as lt, invokeCustomMethodFp as ht, retrieveLaunchParamsFp as le, retrieveRawInitDataFp as dt, captureSameReq as ft, getHostBridge as pe, logger as Oe } from "@vbotma/bridge";
|
|
6
|
+
import { CancelledError as $n, InvalidLaunchParamsError as Pn, InvokeCustomMethodFailedError as On, LaunchParamsRetrieveError as Dn, MethodParameterUnsupportedError as Gn, MethodUnsupportedError as jn, TimeoutError as Hn, UnknownEnvError as Un, applyPolyfills as Wn, createLogger as zn, createPostEvent as Kn, createStartParam as Nn, createStartParamFp as Qn, debug as Jn, decodeBase64Url as Yn, decodeBase64UrlFp as Zn, decodeStartParam as Xn, decodeStartParamFp as ei, deepSnakeToCamelObjKeys as ti, emitEvent as si, encodeBase64Url as ri, getReleaseVersion as ni, isSafeToCreateStartParam as ii, isVBMA as oi, isVBMAFp as ai, logger as pi, mockVBotEnv as ci, off as ui, offAll as li, on as hi, retrieveLaunchParams as di, retrieveLaunchParamsFp as fi, retrieveRawInitData as _i, retrieveRawInitDataFp as mi, retrieveRawLaunchParams as bi, retrieveRawLaunchParamsFp as gi, setDebug as Fi, setTargetOrigin as wi, supports as Ci, targetOrigin as Si } from "@vbotma/bridge";
|
|
7
|
+
import { throwifyFpFn as de, throwifyAnyEither as Ue, setStorageValue as _t, getStorageValue as mt, snakeToKebab as bt, createCbCollector as Ie, camelToKebab as We, BetterTaskEither as Fe } from "@vbotma/toolkit";
|
|
8
|
+
import { BetterPromise as ze } from "better-promises";
|
|
9
|
+
import { toRGBFullFp as gt, isRGB as _e, pipeQueryToSchema as Ft, pipeJsonToSchema as wt } from "@vbotma/transformers";
|
|
10
|
+
import { isAnyRGB as ki, isRGB as yi, isRGBA as Ii, isRGBAShort as Ei, isRGBShort as qi, parseInitDataQuery as Bi, parseInitDataQueryFp as Ai, parseLaunchParamsQuery as xi, parseLaunchParamsQueryFp as Mi, serializeInitDataQuery as Vi, serializeLaunchParamsQuery as Ti, toRGB as Ri, toRGBFp as Li, toRGBFull as $i, toRGBFullFp as Pi } from "@vbotma/transformers";
|
|
11
|
+
import { either as b, function as p, option as N, taskEither as u } from "fp-ts";
|
|
12
|
+
import { errorClass as j, errorClassWithData as Ee } from "error-kid";
|
|
13
|
+
import { parse as De, record as Ct, string as K, array as St, safeParse as we, looseObject as Ge, pipe as Ke, transform as Ne, date as Qe, optional as vt, number as Je, integer as kt } from "valibot";
|
|
14
|
+
function $(n) {
|
|
15
|
+
return typeof n == "function" ? n() : n;
|
|
16
16
|
}
|
|
17
17
|
class ne {
|
|
18
18
|
constructor({
|
|
19
19
|
onMounted: t,
|
|
20
|
-
restoreState:
|
|
21
|
-
initialState:
|
|
20
|
+
restoreState: r,
|
|
21
|
+
initialState: s,
|
|
22
22
|
onUnmounted: i,
|
|
23
23
|
isPageReload: a
|
|
24
24
|
}) {
|
|
@@ -38,7 +38,7 @@ class ne {
|
|
|
38
38
|
this.mount = () => {
|
|
39
39
|
if (this.isMounted())
|
|
40
40
|
return b.right(void 0);
|
|
41
|
-
const
|
|
41
|
+
const c = $(a) ? r() : void 0, o = c ? b.right(c) : typeof s == "function" ? s() : b.right(s);
|
|
42
42
|
return p.pipe(o, b.map((l) => {
|
|
43
43
|
ue(() => {
|
|
44
44
|
this._isMounted.set(!0), t == null || t(l);
|
|
@@ -51,20 +51,20 @@ class ne {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Ce(n) {
|
|
55
55
|
const t = {};
|
|
56
|
-
for (const
|
|
57
|
-
const
|
|
58
|
-
|
|
56
|
+
for (const r in n) {
|
|
57
|
+
const s = n[r];
|
|
58
|
+
s !== void 0 && (t[r] = s);
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
return
|
|
62
|
+
function me(n, t) {
|
|
63
|
+
const r = Object.keys(n), s = Object.keys(t);
|
|
64
|
+
return r.length !== s.length ? !1 : r.every((i) => Object.prototype.hasOwnProperty.call(t, i) && n[i] === t[i]);
|
|
65
65
|
}
|
|
66
66
|
class J {
|
|
67
|
-
constructor({ initialState: t, onChange:
|
|
67
|
+
constructor({ initialState: t, onChange: r }) {
|
|
68
68
|
e(this, "_state");
|
|
69
69
|
/**
|
|
70
70
|
* The current state.
|
|
@@ -75,10 +75,10 @@ class J {
|
|
|
75
75
|
* @param state - updates to apply.
|
|
76
76
|
*/
|
|
77
77
|
e(this, "setState", (t) => {
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const r = { ...this.state(), ...Ce(t) };
|
|
79
|
+
me(r, this.state()) || this._state.set(r);
|
|
80
80
|
});
|
|
81
|
-
this._state = O(t, { equals:
|
|
81
|
+
this._state = O(t, { equals: me }), this.state = w(this._state), this.state.sub(r);
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Creates a computed signal based on the state.
|
|
@@ -92,78 +92,78 @@ class J {
|
|
|
92
92
|
* @param state
|
|
93
93
|
*/
|
|
94
94
|
hasDiff(t) {
|
|
95
|
-
return !
|
|
95
|
+
return !me({ ...this.state(), ...Ce(t) }, this.state());
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return w(() => ee(
|
|
98
|
+
function W(n, t) {
|
|
99
|
+
return w(() => ee(n, $(t)));
|
|
100
100
|
}
|
|
101
101
|
// @__NO_SIDE_EFFECTS__
|
|
102
|
-
function h(
|
|
103
|
-
return Object.assign(
|
|
102
|
+
function h(n) {
|
|
103
|
+
return Object.assign(de(n), {
|
|
104
104
|
ifAvailable(...t) {
|
|
105
105
|
return p.pipe(
|
|
106
|
-
|
|
106
|
+
n.ifAvailable(...t),
|
|
107
107
|
N.match(
|
|
108
108
|
() => ({ ok: !1 }),
|
|
109
|
-
(
|
|
109
|
+
(r) => ({
|
|
110
110
|
ok: !0,
|
|
111
|
-
data: Ue(
|
|
111
|
+
data: Ue(r)
|
|
112
112
|
})
|
|
113
113
|
)
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
function X(
|
|
119
|
-
return [
|
|
118
|
+
function X(n) {
|
|
119
|
+
return [n];
|
|
120
120
|
}
|
|
121
|
-
class
|
|
121
|
+
class ce extends (/* @__PURE__ */ Ee(
|
|
122
122
|
"ValidationError",
|
|
123
|
-
(t,
|
|
123
|
+
(t, r) => ({ input: t, issues: r }),
|
|
124
124
|
"Validation error"
|
|
125
125
|
)) {
|
|
126
126
|
}
|
|
127
|
-
class
|
|
127
|
+
class qe extends (/* @__PURE__ */ j(
|
|
128
128
|
"CSSVarsBoundError",
|
|
129
129
|
"CSS variables are already bound"
|
|
130
130
|
)) {
|
|
131
131
|
}
|
|
132
|
-
class
|
|
132
|
+
class yt extends (/* @__PURE__ */ Ee("DeviceStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
|
|
133
133
|
}
|
|
134
|
-
class
|
|
134
|
+
class It extends (/* @__PURE__ */ Ee("SecureStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
|
|
135
135
|
}
|
|
136
|
-
class
|
|
136
|
+
class Et extends (/* @__PURE__ */ j(
|
|
137
137
|
"NotAvailableError",
|
|
138
138
|
X
|
|
139
139
|
)) {
|
|
140
140
|
}
|
|
141
|
-
class
|
|
141
|
+
class jr extends (/* @__PURE__ */ j(
|
|
142
142
|
"InvalidEnvError",
|
|
143
143
|
X
|
|
144
144
|
)) {
|
|
145
145
|
}
|
|
146
|
-
class
|
|
146
|
+
class qt extends (/* @__PURE__ */ j(
|
|
147
147
|
"FunctionNotAvailableError",
|
|
148
148
|
X
|
|
149
149
|
)) {
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class U extends (/* @__PURE__ */ j(
|
|
152
152
|
"InvalidArgumentsError",
|
|
153
|
-
(t,
|
|
153
|
+
(t, r) => [t, { cause: r }]
|
|
154
154
|
)) {
|
|
155
155
|
}
|
|
156
|
-
class
|
|
156
|
+
class Be extends (/* @__PURE__ */ j(
|
|
157
157
|
"ConcurrentCallError",
|
|
158
158
|
X
|
|
159
159
|
)) {
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class Bt extends (/* @__PURE__ */ j(
|
|
162
162
|
"SetEmojiStatusError",
|
|
163
163
|
(t) => [`Failed to set emoji status: ${t}`]
|
|
164
164
|
)) {
|
|
165
165
|
}
|
|
166
|
-
class
|
|
166
|
+
class Ye extends (/* @__PURE__ */ j(
|
|
167
167
|
"AccessDeniedError",
|
|
168
168
|
X
|
|
169
169
|
)) {
|
|
@@ -173,83 +173,83 @@ class At extends (/* @__PURE__ */ j(
|
|
|
173
173
|
X
|
|
174
174
|
)) {
|
|
175
175
|
}
|
|
176
|
-
class
|
|
176
|
+
class xt extends (/* @__PURE__ */ j(
|
|
177
177
|
"ShareMessageError",
|
|
178
178
|
X
|
|
179
179
|
)) {
|
|
180
180
|
}
|
|
181
|
-
class
|
|
181
|
+
class Mt extends (/* @__PURE__ */ j(
|
|
182
182
|
"UnknownThemeParamsKeyError",
|
|
183
183
|
(t) => [`Unknown theme params key passed: ${t}`]
|
|
184
184
|
)) {
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const
|
|
186
|
+
function B(n, t) {
|
|
187
|
+
const r = w(() => $(t.version) || "100"), s = w(() => $(t.isTma)), { requires: i, returns: a } = t, c = i ? typeof i == "object" ? i : { every: [i] } : void 0, o = (m) => {
|
|
188
188
|
if (!t.supports)
|
|
189
189
|
return !0;
|
|
190
190
|
const g = t.supports[m];
|
|
191
|
-
return ee(g.method, g.param,
|
|
191
|
+
return ee(g.method, g.param, r());
|
|
192
192
|
}, l = () => {
|
|
193
|
-
if (!
|
|
193
|
+
if (!c)
|
|
194
194
|
return;
|
|
195
|
-
const [m, g] = "every" in
|
|
195
|
+
const [m, g] = "every" in c ? ["every", c.every] : ["some", c.some];
|
|
196
196
|
for (let d = 0; d < g.length; d++) {
|
|
197
|
-
const
|
|
197
|
+
const A = g[d], T = typeof A == "function" ? A() : ee(A, r()) ? void 0 : `it is unsupported in Mini Apps version ${r()}`;
|
|
198
198
|
if (T && (m === "every" || d === g.length - 1))
|
|
199
199
|
return T;
|
|
200
200
|
}
|
|
201
201
|
}, _ = (...m) => {
|
|
202
202
|
for (const g in t.supports)
|
|
203
203
|
if (t.supports[g].shouldCheck(...m) && !o(g))
|
|
204
|
-
return `option ${g} is not supported in Mini Apps version ${
|
|
205
|
-
}, F = w(() => !l()), f = w(() =>
|
|
206
|
-
() =>
|
|
204
|
+
return `option ${g} is not supported in Mini Apps version ${r()}`;
|
|
205
|
+
}, F = w(() => !l()), f = w(() => r() !== "0.0"), v = w(() => t.isMounted ? t.isMounted() : !0), C = w(
|
|
206
|
+
() => s() && f() && F() && v()
|
|
207
207
|
), k = (m) => {
|
|
208
|
-
const g = new
|
|
209
|
-
return ["task", "promise"].includes(t.returns) ?
|
|
210
|
-
}, y = (...m) => a === "plain" ? b.tryCatch(() =>
|
|
208
|
+
const g = new qt(m);
|
|
209
|
+
return ["task", "promise"].includes(t.returns) ? u.left(g) : b.left(g);
|
|
210
|
+
}, y = (...m) => a === "plain" ? b.tryCatch(() => n(...m), (g) => g) : a === "promise" ? u.tryCatch(() => n(...m), (g) => g) : n(...m);
|
|
211
211
|
return Object.assign(
|
|
212
212
|
(...m) => {
|
|
213
213
|
var T;
|
|
214
214
|
const g = "Unable to call function:";
|
|
215
|
-
if (!
|
|
215
|
+
if (!s())
|
|
216
216
|
return k(`${g} it can't be called outside Mini Apps`);
|
|
217
217
|
if (!f())
|
|
218
218
|
return k(`${g} the SDK was not initialized. Use the SDK init() function`);
|
|
219
219
|
const d = l();
|
|
220
220
|
if (d)
|
|
221
221
|
return k(`${g} ${d}`);
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
return k(`${g} ${
|
|
222
|
+
const A = _(...m);
|
|
223
|
+
if (A)
|
|
224
|
+
return k(`${g} ${A}`);
|
|
225
225
|
if (!v()) {
|
|
226
226
|
const M = (T = t.isMounting) != null && T.call(t) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
|
|
227
227
|
return k(`${g} the component is ${M}`);
|
|
228
228
|
}
|
|
229
229
|
return y(...m);
|
|
230
230
|
},
|
|
231
|
-
|
|
231
|
+
n,
|
|
232
232
|
{
|
|
233
233
|
isAvailable: C,
|
|
234
234
|
ifAvailable(...m) {
|
|
235
235
|
return C() ? N.some(y(...m)) : N.none;
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
|
-
|
|
238
|
+
c ? { isSupported: F } : {},
|
|
239
239
|
t.supports ? { supports: o } : {}
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
-
function E(
|
|
243
|
-
return (t) =>
|
|
242
|
+
function E(n) {
|
|
243
|
+
return (t) => B(t, n);
|
|
244
244
|
}
|
|
245
|
-
class
|
|
245
|
+
class fe {
|
|
246
246
|
constructor({
|
|
247
247
|
isTma: t,
|
|
248
|
-
storage:
|
|
249
|
-
onClick:
|
|
248
|
+
storage: r,
|
|
249
|
+
onClick: s,
|
|
250
250
|
offClick: i,
|
|
251
251
|
initialState: a,
|
|
252
|
-
isPageReload:
|
|
252
|
+
isPageReload: c,
|
|
253
253
|
postEvent: o,
|
|
254
254
|
payload: l,
|
|
255
255
|
method: _,
|
|
@@ -337,13 +337,13 @@ class de {
|
|
|
337
337
|
const f = new J({
|
|
338
338
|
initialState: a,
|
|
339
339
|
onChange(m) {
|
|
340
|
-
|
|
340
|
+
r.set(m);
|
|
341
341
|
}
|
|
342
342
|
}), v = new ne({
|
|
343
343
|
initialState: a,
|
|
344
|
-
isPageReload:
|
|
344
|
+
isPageReload: c,
|
|
345
345
|
onMounted: f.setState,
|
|
346
|
-
restoreState:
|
|
346
|
+
restoreState: r.get
|
|
347
347
|
}), C = { version: F, requires: _, isTma: t }, k = E({
|
|
348
348
|
...C,
|
|
349
349
|
returns: "plain"
|
|
@@ -352,15 +352,15 @@ class de {
|
|
|
352
352
|
returns: "either",
|
|
353
353
|
isMounted: v.isMounted
|
|
354
354
|
});
|
|
355
|
-
this.isMounted = v.isMounted, this.isSupported =
|
|
356
|
-
const g = { ...this.state(), ...
|
|
355
|
+
this.isMounted = v.isMounted, this.isSupported = W(_, F), this.state = f.state, this.setStateFp = y((m) => {
|
|
356
|
+
const g = { ...this.state(), ...Ce(m) };
|
|
357
357
|
return f.hasDiff(g) ? p.pipe(
|
|
358
358
|
o(_, l(g)),
|
|
359
359
|
b.map(() => {
|
|
360
360
|
f.setState(g);
|
|
361
361
|
})
|
|
362
362
|
) : b.right(void 0);
|
|
363
|
-
}), this.setState = /* @__PURE__ */ h(this.setStateFp), this.onClickFp = k(
|
|
363
|
+
}), this.setState = /* @__PURE__ */ h(this.setStateFp), this.onClickFp = k(s), this.onClick = /* @__PURE__ */ h(this.onClickFp), this.offClickFp = k(i), this.offClick = /* @__PURE__ */ h(this.offClickFp), this.mountFp = k(() => {
|
|
364
364
|
const m = () => {
|
|
365
365
|
};
|
|
366
366
|
return p.pipe(v.mount(), b.match(m, m));
|
|
@@ -368,10 +368,10 @@ class de {
|
|
|
368
368
|
const g = y((d) => this.setStateFp({ [m]: d }));
|
|
369
369
|
return [/* @__PURE__ */ h(g), g];
|
|
370
370
|
}, this.stateBoolSetters = (m) => {
|
|
371
|
-
const [, g] = this.stateSetters(m), d = y(() => g(!1)),
|
|
371
|
+
const [, g] = this.stateSetters(m), d = y(() => g(!1)), A = y(() => g(!0));
|
|
372
372
|
return [
|
|
373
373
|
[/* @__PURE__ */ h(d), d],
|
|
374
|
-
[/* @__PURE__ */ h(
|
|
374
|
+
[/* @__PURE__ */ h(A), A]
|
|
375
375
|
];
|
|
376
376
|
};
|
|
377
377
|
}
|
|
@@ -383,7 +383,7 @@ class de {
|
|
|
383
383
|
return w(() => this.state()[t]);
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
class
|
|
386
|
+
class Vt {
|
|
387
387
|
constructor(t) {
|
|
388
388
|
/**
|
|
389
389
|
* Signal indicating if the component is currently visible.
|
|
@@ -466,75 +466,75 @@ class Mt {
|
|
|
466
466
|
* @see onClick
|
|
467
467
|
*/
|
|
468
468
|
e(this, "unmount");
|
|
469
|
-
const
|
|
469
|
+
const r = new fe({
|
|
470
470
|
...t,
|
|
471
471
|
method: "web_app_setup_back_button",
|
|
472
|
-
payload: (
|
|
472
|
+
payload: (s) => ({ is_visible: s.isVisible }),
|
|
473
473
|
initialState: { isVisible: !1 }
|
|
474
474
|
});
|
|
475
|
-
this.isVisible =
|
|
475
|
+
this.isVisible = r.stateGetter("isVisible"), this.isMounted = r.isMounted, this.isSupported = r.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = r.stateBoolSetters("isVisible"), this.onClick = r.onClick, this.onClickFp = r.onClickFp, this.offClick = r.offClick, this.offClickFp = r.offClickFp, this.mount = r.mount, this.mountFp = r.mountFp, this.unmount = r.unmount;
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
function S() {
|
|
479
479
|
return { isTma: w(() => ut()) };
|
|
480
480
|
}
|
|
481
|
-
function te(
|
|
482
|
-
return (t) => ({ ...t, ...$(
|
|
481
|
+
function te(n) {
|
|
482
|
+
return (t) => ({ ...t, ...$(n) });
|
|
483
483
|
}
|
|
484
484
|
// @__NO_SIDE_EFFECTS__
|
|
485
|
-
function ie(
|
|
486
|
-
return O(
|
|
485
|
+
function ie(n, t) {
|
|
486
|
+
return O(n, t);
|
|
487
487
|
}
|
|
488
|
-
const
|
|
488
|
+
const Ze = /* @__PURE__ */ ie(ye), se = (...n) => Ze()(...n), Tt = (...n) => Ue(se(...n)), V = te({
|
|
489
489
|
postEvent: se
|
|
490
490
|
});
|
|
491
|
-
function
|
|
491
|
+
function Rt(n) {
|
|
492
492
|
return {
|
|
493
|
-
get: () =>
|
|
493
|
+
get: () => mt(n),
|
|
494
494
|
set(t) {
|
|
495
|
-
|
|
495
|
+
_t(n, t);
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Lt() {
|
|
500
500
|
return performance.getEntriesByType("navigation")[0];
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
const
|
|
504
|
-
return !!
|
|
502
|
+
function $t() {
|
|
503
|
+
const n = Lt();
|
|
504
|
+
return !!n && n.type === "reload";
|
|
505
505
|
}
|
|
506
|
-
function Y(
|
|
506
|
+
function Y(n) {
|
|
507
507
|
return te({
|
|
508
|
-
storage:
|
|
509
|
-
isPageReload:
|
|
508
|
+
storage: Rt(n),
|
|
509
|
+
isPageReload: $t
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
|
-
const
|
|
512
|
+
const Se = /* @__PURE__ */ ie("0.0"), I = te({ version: Se });
|
|
513
513
|
// @__NO_SIDE_EFFECTS__
|
|
514
|
-
function Ae(
|
|
514
|
+
function Ae(n, t) {
|
|
515
515
|
return {
|
|
516
516
|
...p.pipe(
|
|
517
517
|
S(),
|
|
518
518
|
V,
|
|
519
519
|
I,
|
|
520
|
-
Y(
|
|
520
|
+
Y(n)
|
|
521
521
|
),
|
|
522
|
-
onClick(
|
|
523
|
-
return G(t,
|
|
522
|
+
onClick(r, s) {
|
|
523
|
+
return G(t, r, s);
|
|
524
524
|
},
|
|
525
|
-
offClick(
|
|
526
|
-
re(t,
|
|
525
|
+
offClick(r, s) {
|
|
526
|
+
re(t, r, s);
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const Hr = /* @__PURE__ */ new Vt(
|
|
531
531
|
/* @__PURE__ */ Ae("backButton", "back_button_pressed")
|
|
532
532
|
);
|
|
533
|
-
class
|
|
533
|
+
class xe {
|
|
534
534
|
constructor({
|
|
535
535
|
initialState: t,
|
|
536
|
-
onMounted:
|
|
537
|
-
restoreState:
|
|
536
|
+
onMounted: r,
|
|
537
|
+
restoreState: s,
|
|
538
538
|
onUnmounted: i,
|
|
539
539
|
isPageReload: a
|
|
540
540
|
}) {
|
|
@@ -552,15 +552,15 @@ class Be {
|
|
|
552
552
|
* Unmounts the component.
|
|
553
553
|
*/
|
|
554
554
|
e(this, "unmount");
|
|
555
|
-
this.mount = (
|
|
555
|
+
this.mount = (c) => {
|
|
556
556
|
if (this._isMounted())
|
|
557
|
-
return
|
|
558
|
-
const o = $(a) ?
|
|
557
|
+
return u.right(void 0);
|
|
558
|
+
const o = $(a) ? s() : void 0;
|
|
559
559
|
return p.pipe(
|
|
560
|
-
o ?
|
|
561
|
-
|
|
560
|
+
o ? u.right(o) : t(c),
|
|
561
|
+
u.map((l) => {
|
|
562
562
|
this._isMounted() || ue(() => {
|
|
563
|
-
this._isMounted.set(!0),
|
|
563
|
+
this._isMounted.set(!0), r == null || r(l);
|
|
564
564
|
});
|
|
565
565
|
})
|
|
566
566
|
);
|
|
@@ -571,21 +571,21 @@ class Be {
|
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
return new
|
|
574
|
+
function je() {
|
|
575
|
+
return new Et("Biometry is not available");
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
let t = !1,
|
|
579
|
-
return
|
|
577
|
+
function be(n) {
|
|
578
|
+
let t = !1, r = !1, s = "", i = !1, a = "", c = !1;
|
|
579
|
+
return n.available && (t = !0, r = n.token_saved, s = n.device_id, i = n.access_requested, a = n.type, c = n.access_granted), { available: t, tokenSaved: r, deviceId: s, type: a, accessGranted: c, accessRequested: i };
|
|
580
580
|
}
|
|
581
|
-
class
|
|
581
|
+
class Pt {
|
|
582
582
|
constructor({
|
|
583
583
|
version: t,
|
|
584
|
-
request:
|
|
585
|
-
postEvent:
|
|
584
|
+
request: r,
|
|
585
|
+
postEvent: s,
|
|
586
586
|
storage: i,
|
|
587
587
|
onInfoReceived: a,
|
|
588
|
-
offInfoReceived:
|
|
588
|
+
offInfoReceived: c,
|
|
589
589
|
isTma: o,
|
|
590
590
|
isPageReload: l
|
|
591
591
|
}) {
|
|
@@ -677,7 +677,7 @@ class $t {
|
|
|
677
677
|
*/
|
|
678
678
|
e(this, "unmount");
|
|
679
679
|
const _ = (m) => {
|
|
680
|
-
F.setState(
|
|
680
|
+
F.setState(be(m));
|
|
681
681
|
}, F = new J({
|
|
682
682
|
initialState: {
|
|
683
683
|
available: !1,
|
|
@@ -688,11 +688,11 @@ class $t {
|
|
|
688
688
|
tokenSaved: !1
|
|
689
689
|
},
|
|
690
690
|
onChange: i.set
|
|
691
|
-
}), f = new
|
|
691
|
+
}), f = new xe({
|
|
692
692
|
initialState(m) {
|
|
693
693
|
return p.pipe(
|
|
694
|
-
|
|
695
|
-
|
|
694
|
+
r("web_app_biometry_get_info", "biometry_info_received", m),
|
|
695
|
+
u.map(be)
|
|
696
696
|
);
|
|
697
697
|
},
|
|
698
698
|
isPageReload: l,
|
|
@@ -700,7 +700,7 @@ class $t {
|
|
|
700
700
|
F.setState(m), a(_);
|
|
701
701
|
},
|
|
702
702
|
onUnmounted() {
|
|
703
|
-
|
|
703
|
+
c(_);
|
|
704
704
|
},
|
|
705
705
|
restoreState: i.get
|
|
706
706
|
}), v = { version: t, requires: "web_app_biometry_request_auth", isTma: o }, C = E({
|
|
@@ -714,42 +714,42 @@ class $t {
|
|
|
714
714
|
isMounted: f.isMounted,
|
|
715
715
|
returns: "task"
|
|
716
716
|
});
|
|
717
|
-
this.isAvailable = F.getter("available"), this.isMounted = f.isMounted, this.isSupported =
|
|
718
|
-
|
|
717
|
+
this.isAvailable = F.getter("available"), this.isMounted = f.isMounted, this.isSupported = W("web_app_biometry_request_auth", t), this.state = F.state, this.unmount = f.unmount, this.mountFp = k(f.mount), this.authenticateFp = y((m) => this.isAvailable() ? p.pipe(
|
|
718
|
+
r("web_app_biometry_request_auth", "biometry_auth_requested", {
|
|
719
719
|
...m,
|
|
720
720
|
params: { reason: ((m || {}).reason || "").trim() }
|
|
721
721
|
}),
|
|
722
|
-
|
|
723
|
-
) :
|
|
724
|
-
|
|
722
|
+
u.map((g) => (F.setState({ token: g.token }), g))
|
|
723
|
+
) : u.left(je())), this.openSettingsFp = C(() => s("web_app_biometry_open_settings")), this.requestAccessFp = y((m) => p.pipe(
|
|
724
|
+
r("web_app_biometry_request_access", "biometry_info_received", {
|
|
725
725
|
...m,
|
|
726
726
|
params: { reason: ((m || {}).reason || "").trim() }
|
|
727
727
|
}),
|
|
728
|
-
|
|
729
|
-
const d =
|
|
730
|
-
return d.available ? (F.setState(d),
|
|
728
|
+
u.chain((g) => {
|
|
729
|
+
const d = be(g);
|
|
730
|
+
return d.available ? (F.setState(d), u.right(d.accessRequested)) : u.left(je());
|
|
731
731
|
})
|
|
732
732
|
)), this.updateTokenFp = y((m = {}) => {
|
|
733
733
|
var g;
|
|
734
734
|
return p.pipe(
|
|
735
|
-
|
|
735
|
+
r("web_app_biometry_update_token", "biometry_token_updated", {
|
|
736
736
|
...m,
|
|
737
737
|
params: { token: m.token || "", reason: (g = m.reason) == null ? void 0 : g.trim() }
|
|
738
738
|
}),
|
|
739
|
-
|
|
739
|
+
u.map((d) => d.status)
|
|
740
740
|
);
|
|
741
741
|
}), 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);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
const
|
|
744
|
+
const Ot = (n, t, r) => lt(n, t, {
|
|
745
745
|
postEvent: se,
|
|
746
|
-
...
|
|
747
|
-
}),
|
|
746
|
+
...r
|
|
747
|
+
}), Xe = (n, t, r) => He(n, t, {
|
|
748
748
|
postEvent: se,
|
|
749
|
-
...
|
|
750
|
-
}), Ur = (...
|
|
751
|
-
function
|
|
752
|
-
return new
|
|
749
|
+
...r
|
|
750
|
+
}), Ur = (...n) => ze.fn(() => Ot(...n)()), Wr = (...n) => ze.fn(() => Xe(...n)()), R = te({ request: Xe });
|
|
751
|
+
function Dt() {
|
|
752
|
+
return new Pt({
|
|
753
753
|
...p.pipe(
|
|
754
754
|
S(),
|
|
755
755
|
V,
|
|
@@ -757,17 +757,17 @@ function Ot() {
|
|
|
757
757
|
R,
|
|
758
758
|
Y("biometry")
|
|
759
759
|
),
|
|
760
|
-
offInfoReceived(
|
|
761
|
-
re("biometry_info_received",
|
|
760
|
+
offInfoReceived(n) {
|
|
761
|
+
re("biometry_info_received", n);
|
|
762
762
|
},
|
|
763
|
-
onInfoReceived(
|
|
764
|
-
return G("biometry_info_received",
|
|
763
|
+
onInfoReceived(n) {
|
|
764
|
+
return G("biometry_info_received", n);
|
|
765
765
|
}
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
const
|
|
769
|
-
class
|
|
770
|
-
constructor({ postEvent: t, storage:
|
|
768
|
+
const zr = /* @__PURE__ */ Dt();
|
|
769
|
+
class Gt {
|
|
770
|
+
constructor({ postEvent: t, storage: r, isTma: s, isPageReload: i }) {
|
|
771
771
|
/**
|
|
772
772
|
* Signal indicating if closing confirmation dialog is currently enabled.
|
|
773
773
|
*/
|
|
@@ -807,40 +807,40 @@ class Dt {
|
|
|
807
807
|
const a = new J({
|
|
808
808
|
initialState: { isConfirmationEnabled: !1 },
|
|
809
809
|
onChange(f) {
|
|
810
|
-
|
|
810
|
+
r.set(f);
|
|
811
811
|
}
|
|
812
|
-
}),
|
|
812
|
+
}), c = new ne({
|
|
813
813
|
onMounted: a.setState,
|
|
814
|
-
restoreState:
|
|
814
|
+
restoreState: r.get,
|
|
815
815
|
initialState: { isConfirmationEnabled: !1 },
|
|
816
816
|
isPageReload: i
|
|
817
|
-
}), o = { requires: "web_app_setup_closing_behavior", isTma:
|
|
817
|
+
}), o = { requires: "web_app_setup_closing_behavior", isTma: s }, l = E({
|
|
818
818
|
...o,
|
|
819
819
|
returns: "plain"
|
|
820
820
|
}), _ = E({
|
|
821
821
|
...o,
|
|
822
822
|
returns: "either",
|
|
823
|
-
isMounted:
|
|
823
|
+
isMounted: c.isMounted
|
|
824
824
|
}), F = (f) => f === this.isConfirmationEnabled() ? b.right(void 0) : (a.setState({ isConfirmationEnabled: f }), t("web_app_setup_closing_behavior", {
|
|
825
825
|
need_confirmation: f
|
|
826
826
|
}));
|
|
827
|
-
this.isConfirmationEnabled = a.getter("isConfirmationEnabled"), this.isMounted =
|
|
827
|
+
this.isConfirmationEnabled = a.getter("isConfirmationEnabled"), this.isMounted = c.isMounted, this.disableConfirmationFp = _(() => F(!1)), this.enableConfirmationFp = _(() => F(!0)), this.mountFp = l(() => {
|
|
828
828
|
const f = () => {
|
|
829
829
|
};
|
|
830
|
-
return p.pipe(
|
|
831
|
-
}), this.unmount =
|
|
830
|
+
return p.pipe(c.mount(), b.match(f, f));
|
|
831
|
+
}), this.unmount = c.unmount, this.disableConfirmation = /* @__PURE__ */ h(this.disableConfirmationFp), this.enableConfirmation = /* @__PURE__ */ h(this.enableConfirmationFp), this.mount = /* @__PURE__ */ h(this.mountFp);
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
return new
|
|
834
|
+
function jt() {
|
|
835
|
+
return new Gt(p.pipe(
|
|
836
836
|
S(),
|
|
837
837
|
Y("closingBehavior"),
|
|
838
838
|
V
|
|
839
839
|
));
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
class
|
|
843
|
-
constructor({ version: t, isTma:
|
|
841
|
+
const Kr = /* @__PURE__ */ jt();
|
|
842
|
+
class Ht {
|
|
843
|
+
constructor({ version: t, isTma: r, invokeCustomMethod: s }) {
|
|
844
844
|
/**
|
|
845
845
|
* Signal indicating if the component is supported.
|
|
846
846
|
*/
|
|
@@ -913,59 +913,59 @@ class jt {
|
|
|
913
913
|
const i = E({
|
|
914
914
|
version: t,
|
|
915
915
|
requires: "web_app_invoke_custom_method",
|
|
916
|
-
isTma:
|
|
916
|
+
isTma: r,
|
|
917
917
|
returns: "task"
|
|
918
918
|
});
|
|
919
|
-
this.isSupported =
|
|
919
|
+
this.isSupported = W("web_app_invoke_custom_method", t), this.deleteItemFp = i((a, c) => {
|
|
920
920
|
const o = Array.isArray(a) ? a : [a];
|
|
921
921
|
return p.pipe(
|
|
922
|
-
o.length ?
|
|
923
|
-
|
|
922
|
+
o.length ? s("deleteStorageValues", { keys: o }, c) : u.right(void 0),
|
|
923
|
+
u.map(() => {
|
|
924
924
|
})
|
|
925
925
|
);
|
|
926
|
-
}), this.getItemFp = i((a,
|
|
927
|
-
this.getItemsFp([a],
|
|
928
|
-
|
|
929
|
-
)), this.getItemsFp = i((a,
|
|
930
|
-
a.length ?
|
|
931
|
-
|
|
926
|
+
}), this.getItemFp = i((a, c) => p.pipe(
|
|
927
|
+
this.getItemsFp([a], c),
|
|
928
|
+
u.map((o) => o[a] || "")
|
|
929
|
+
)), this.getItemsFp = i((a, c) => p.pipe(
|
|
930
|
+
a.length ? s("getStorageValues", { keys: a }, c) : u.right({}),
|
|
931
|
+
u.map((o) => ({
|
|
932
932
|
// Fulfill the response with probably missing keys.
|
|
933
933
|
...a.reduce((l, _) => (l[_] = "", l), {}),
|
|
934
|
-
...
|
|
934
|
+
...De(Ct(K(), K()), o)
|
|
935
935
|
}))
|
|
936
936
|
)), this.getKeysFp = i((a) => p.pipe(
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
)), this.setItemFp = i((a,
|
|
940
|
-
|
|
941
|
-
|
|
937
|
+
s("getStorageKeys", {}, a),
|
|
938
|
+
u.map((c) => De(St(K()), c))
|
|
939
|
+
)), this.setItemFp = i((a, c, o) => p.pipe(
|
|
940
|
+
s("saveStorageValue", { key: a, value: c }, o),
|
|
941
|
+
u.map(() => {
|
|
942
942
|
})
|
|
943
|
-
)), this.clearFp = i((a) => p.pipe(this.getKeysFp(a),
|
|
943
|
+
)), this.clearFp = i((a) => p.pipe(this.getKeysFp(a), u.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);
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
const
|
|
947
|
-
function
|
|
948
|
-
return
|
|
946
|
+
const ge = /* @__PURE__ */ ie(0);
|
|
947
|
+
function Me() {
|
|
948
|
+
return ge.set(ge() + 1), ge().toString();
|
|
949
949
|
}
|
|
950
|
-
function Ut(
|
|
951
|
-
return
|
|
952
|
-
...
|
|
950
|
+
function Ut(n, t, r) {
|
|
951
|
+
return ht(n, t, Me(), {
|
|
952
|
+
...r || {},
|
|
953
953
|
postEvent: se
|
|
954
954
|
});
|
|
955
955
|
}
|
|
956
|
-
const
|
|
956
|
+
const Ve = te({
|
|
957
957
|
invokeCustomMethod: Ut
|
|
958
958
|
});
|
|
959
959
|
function Wt() {
|
|
960
|
-
return new
|
|
960
|
+
return new Ht(p.pipe(
|
|
961
961
|
S(),
|
|
962
962
|
I,
|
|
963
|
-
|
|
963
|
+
Ve
|
|
964
964
|
));
|
|
965
965
|
}
|
|
966
|
-
const
|
|
967
|
-
class
|
|
968
|
-
constructor({ isTma: t, request:
|
|
966
|
+
const Nr = /* @__PURE__ */ Wt();
|
|
967
|
+
class zt {
|
|
968
|
+
constructor({ isTma: t, request: r, version: s, createRequestId: i }) {
|
|
969
969
|
/**
|
|
970
970
|
* Retrieves an item using its key.
|
|
971
971
|
* @since Mini Apps v9.0
|
|
@@ -1003,69 +1003,69 @@ class Ht {
|
|
|
1003
1003
|
*/
|
|
1004
1004
|
e(this, "clear");
|
|
1005
1005
|
const a = E({
|
|
1006
|
-
version:
|
|
1006
|
+
version: s,
|
|
1007
1007
|
requires: "web_app_device_storage_get_key",
|
|
1008
1008
|
isTma: t,
|
|
1009
1009
|
returns: "task"
|
|
1010
|
-
}),
|
|
1010
|
+
}), c = (o, l, _) => {
|
|
1011
1011
|
const F = i();
|
|
1012
1012
|
return p.pipe(
|
|
1013
|
-
|
|
1013
|
+
r(o, ["device_storage_failed", l], {
|
|
1014
1014
|
params: { ..._, req_id: F },
|
|
1015
1015
|
capture: ((f) => "payload" in f ? f.payload.req_id === F : !0)
|
|
1016
1016
|
}),
|
|
1017
|
-
|
|
1017
|
+
u.chain((f) => f.event === "device_storage_failed" ? u.left(new yt(f.payload.error || "UNKNOWN_ERROR")) : u.right(f.payload))
|
|
1018
1018
|
);
|
|
1019
1019
|
};
|
|
1020
1020
|
this.getItemFp = a((o) => p.pipe(
|
|
1021
|
-
|
|
1022
|
-
|
|
1021
|
+
c("web_app_device_storage_get_key", "device_storage_key_received", { key: o }),
|
|
1022
|
+
u.map((l) => l.value)
|
|
1023
1023
|
)), this.setItemFp = a((o, l) => p.pipe(
|
|
1024
|
-
|
|
1025
|
-
|
|
1024
|
+
c("web_app_device_storage_save_key", "device_storage_key_saved", { key: o, value: l }),
|
|
1025
|
+
u.map(() => {
|
|
1026
1026
|
})
|
|
1027
1027
|
)), this.deleteItemFp = a((o) => this.setItemFp(o, null)), this.clearFp = a(() => p.pipe(
|
|
1028
|
-
|
|
1029
|
-
|
|
1028
|
+
c("web_app_device_storage_clear", "device_storage_cleared", {}),
|
|
1029
|
+
u.map(() => {
|
|
1030
1030
|
})
|
|
1031
1031
|
)), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.clear = /* @__PURE__ */ h(this.clearFp);
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
const
|
|
1035
|
-
function
|
|
1036
|
-
return new
|
|
1034
|
+
const et = te({ createRequestId: Me });
|
|
1035
|
+
function Kt() {
|
|
1036
|
+
return new zt(p.pipe(
|
|
1037
1037
|
S(),
|
|
1038
1038
|
I,
|
|
1039
1039
|
R,
|
|
1040
|
-
|
|
1040
|
+
et
|
|
1041
1041
|
));
|
|
1042
1042
|
}
|
|
1043
|
-
const
|
|
1044
|
-
function
|
|
1045
|
-
return
|
|
1046
|
-
|
|
1047
|
-
|
|
1043
|
+
const Qr = /* @__PURE__ */ Kt();
|
|
1044
|
+
function Nt({ request: n, ...t }) {
|
|
1045
|
+
return B((r) => p.pipe(
|
|
1046
|
+
n("web_app_request_emoji_status_access", "emoji_status_access_requested", r),
|
|
1047
|
+
u.map((s) => s.status)
|
|
1048
1048
|
), { ...t, requires: "web_app_request_emoji_status_access", returns: "task" });
|
|
1049
1049
|
}
|
|
1050
1050
|
// @__NO_SIDE_EFFECTS__
|
|
1051
|
-
function
|
|
1052
|
-
return
|
|
1051
|
+
function Qt() {
|
|
1052
|
+
return Nt(p.pipe(
|
|
1053
1053
|
S(),
|
|
1054
1054
|
I,
|
|
1055
1055
|
R
|
|
1056
1056
|
));
|
|
1057
1057
|
}
|
|
1058
|
-
const
|
|
1059
|
-
function
|
|
1060
|
-
return
|
|
1061
|
-
|
|
1058
|
+
const Jt = /* @__PURE__ */ Qt(), Jr = /* @__PURE__ */ h(Jt);
|
|
1059
|
+
function Yt({ request: n, ...t }) {
|
|
1060
|
+
return B((r, s) => p.pipe(
|
|
1061
|
+
n("web_app_set_emoji_status", ["emoji_status_set", "emoji_status_failed"], {
|
|
1062
1062
|
params: {
|
|
1063
|
-
custom_emoji_id:
|
|
1064
|
-
duration: (
|
|
1063
|
+
custom_emoji_id: r,
|
|
1064
|
+
duration: (s || {}).duration
|
|
1065
1065
|
},
|
|
1066
|
-
...
|
|
1066
|
+
...s
|
|
1067
1067
|
}),
|
|
1068
|
-
|
|
1068
|
+
u.chainW((i) => i.event === "emoji_status_failed" ? u.left(new Bt(i.payload.error)) : u.right(void 0))
|
|
1069
1069
|
), {
|
|
1070
1070
|
...t,
|
|
1071
1071
|
requires: "web_app_set_emoji_status",
|
|
@@ -1073,16 +1073,16 @@ function Jt({ request: r, ...t }) {
|
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
1075
1075
|
// @__NO_SIDE_EFFECTS__
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1076
|
+
function Zt() {
|
|
1077
|
+
return Yt(p.pipe(
|
|
1078
1078
|
S(),
|
|
1079
1079
|
R,
|
|
1080
1080
|
I
|
|
1081
1081
|
));
|
|
1082
1082
|
}
|
|
1083
|
-
const
|
|
1084
|
-
class
|
|
1085
|
-
constructor({ postEvent: t, isTma:
|
|
1083
|
+
const Xt = /* @__PURE__ */ Zt(), Yr = /* @__PURE__ */ h(Xt);
|
|
1084
|
+
class es {
|
|
1085
|
+
constructor({ postEvent: t, isTma: r, version: s }) {
|
|
1086
1086
|
/**
|
|
1087
1087
|
* Signal indicating if the component is supported.
|
|
1088
1088
|
*/
|
|
@@ -1125,49 +1125,49 @@ class Xt {
|
|
|
1125
1125
|
e(this, "selectionChanged");
|
|
1126
1126
|
const i = "web_app_trigger_haptic_feedback", a = E({
|
|
1127
1127
|
requires: i,
|
|
1128
|
-
isTma:
|
|
1129
|
-
version:
|
|
1128
|
+
isTma: r,
|
|
1129
|
+
version: s,
|
|
1130
1130
|
returns: "plain"
|
|
1131
1131
|
});
|
|
1132
|
-
this.isSupported =
|
|
1132
|
+
this.isSupported = W(i, s), this.impactOccurredFp = a((c) => t(i, { type: "impact", impact_style: c })), this.notificationOccurredFp = a((c) => t(i, { type: "notification", notification_type: c })), this.selectionChangedFp = a(() => t(i, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1136
|
-
return new
|
|
1135
|
+
function ts() {
|
|
1136
|
+
return new es(p.pipe(
|
|
1137
1137
|
S(),
|
|
1138
1138
|
V,
|
|
1139
1139
|
I
|
|
1140
1140
|
));
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1143
|
-
function
|
|
1144
|
-
return
|
|
1142
|
+
const Zr = /* @__PURE__ */ ts();
|
|
1143
|
+
function ss({ postEvent: n, ...t }) {
|
|
1144
|
+
return B(() => n("web_app_add_to_home_screen"), { ...t, requires: "web_app_add_to_home_screen", returns: "either" });
|
|
1145
1145
|
}
|
|
1146
1146
|
// @__NO_SIDE_EFFECTS__
|
|
1147
|
-
function
|
|
1148
|
-
return
|
|
1147
|
+
function rs() {
|
|
1148
|
+
return ss(p.pipe(
|
|
1149
1149
|
S(),
|
|
1150
1150
|
I,
|
|
1151
1151
|
V
|
|
1152
1152
|
));
|
|
1153
1153
|
}
|
|
1154
|
-
const
|
|
1155
|
-
function
|
|
1156
|
-
return
|
|
1157
|
-
|
|
1158
|
-
|
|
1154
|
+
const ns = /* @__PURE__ */ rs(), Xr = /* @__PURE__ */ h(ns);
|
|
1155
|
+
function is({ request: n, ...t }) {
|
|
1156
|
+
return B((r) => p.pipe(
|
|
1157
|
+
n("web_app_check_home_screen", "home_screen_checked", r),
|
|
1158
|
+
u.map((s) => s.status || "unknown")
|
|
1159
1159
|
), { ...t, requires: "web_app_check_home_screen", returns: "task" });
|
|
1160
1160
|
}
|
|
1161
1161
|
// @__NO_SIDE_EFFECTS__
|
|
1162
|
-
function
|
|
1163
|
-
return
|
|
1162
|
+
function os() {
|
|
1163
|
+
return is(p.pipe(
|
|
1164
1164
|
S(),
|
|
1165
1165
|
I,
|
|
1166
1166
|
R
|
|
1167
1167
|
));
|
|
1168
1168
|
}
|
|
1169
|
-
const
|
|
1170
|
-
class
|
|
1169
|
+
const as = /* @__PURE__ */ os(), en = /* @__PURE__ */ h(as);
|
|
1170
|
+
class ps {
|
|
1171
1171
|
constructor({ retrieveInitData: t }) {
|
|
1172
1172
|
e(this, "_state", O());
|
|
1173
1173
|
e(this, "_raw", O());
|
|
@@ -1188,8 +1188,8 @@ class as {
|
|
|
1188
1188
|
* the [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery) method.
|
|
1189
1189
|
*/
|
|
1190
1190
|
e(this, "canSendAfterDate", w(() => {
|
|
1191
|
-
const t = this.authDate(),
|
|
1192
|
-
return
|
|
1191
|
+
const t = this.authDate(), r = this.canSendAfter();
|
|
1192
|
+
return r && t ? new Date(t.getTime() + r * 1e3) : void 0;
|
|
1193
1193
|
}));
|
|
1194
1194
|
/**
|
|
1195
1195
|
* @see InitDataType.chat
|
|
@@ -1246,40 +1246,40 @@ class as {
|
|
|
1246
1246
|
this.restoreFp = () => p.pipe(
|
|
1247
1247
|
t(),
|
|
1248
1248
|
b.map(N.match(() => {
|
|
1249
|
-
}, ({ raw:
|
|
1250
|
-
this._state.set(
|
|
1249
|
+
}, ({ raw: r, obj: s }) => {
|
|
1250
|
+
this._state.set(s), this._raw.set(r);
|
|
1251
1251
|
}))
|
|
1252
|
-
), this.restore =
|
|
1252
|
+
), this.restore = de(this.restoreFp);
|
|
1253
1253
|
}
|
|
1254
1254
|
fromState(t) {
|
|
1255
1255
|
return w(() => {
|
|
1256
|
-
const
|
|
1257
|
-
return
|
|
1256
|
+
const r = this._state();
|
|
1257
|
+
return r ? r[t] : void 0;
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1262
|
-
return new
|
|
1261
|
+
function cs() {
|
|
1262
|
+
return new ps({
|
|
1263
1263
|
retrieveInitData() {
|
|
1264
1264
|
return p.pipe(
|
|
1265
1265
|
b.Do,
|
|
1266
1266
|
b.bindW("obj", () => p.pipe(
|
|
1267
|
-
|
|
1268
|
-
b.map(({ vbWebAppData:
|
|
1267
|
+
le(),
|
|
1268
|
+
b.map(({ vbWebAppData: n }) => n ? N.some(n) : N.none)
|
|
1269
1269
|
)),
|
|
1270
|
-
b.bindW("raw",
|
|
1271
|
-
b.map(({ obj:
|
|
1270
|
+
b.bindW("raw", dt),
|
|
1271
|
+
b.map(({ obj: n, raw: t }) => p.pipe(
|
|
1272
1272
|
N.Do,
|
|
1273
|
-
N.bind("obj", () =>
|
|
1273
|
+
N.bind("obj", () => n),
|
|
1274
1274
|
N.bind("raw", () => t)
|
|
1275
1275
|
))
|
|
1276
1276
|
);
|
|
1277
1277
|
}
|
|
1278
1278
|
});
|
|
1279
1279
|
}
|
|
1280
|
-
const
|
|
1280
|
+
const tn = /* @__PURE__ */ cs();
|
|
1281
1281
|
class us {
|
|
1282
|
-
constructor({ version: t, request:
|
|
1282
|
+
constructor({ version: t, request: r, isTma: s }) {
|
|
1283
1283
|
/**
|
|
1284
1284
|
* Signal indicating if any invoice is currently opened.
|
|
1285
1285
|
*/
|
|
@@ -1316,99 +1316,99 @@ class us {
|
|
|
1316
1316
|
e(this, "openUrl");
|
|
1317
1317
|
const i = E({
|
|
1318
1318
|
version: t,
|
|
1319
|
-
isTma:
|
|
1319
|
+
isTma: s,
|
|
1320
1320
|
requires: "web_app_open_invoice",
|
|
1321
1321
|
returns: "task"
|
|
1322
|
-
}), a = O(!1),
|
|
1322
|
+
}), a = O(!1), c = () => {
|
|
1323
1323
|
a.set(!1);
|
|
1324
1324
|
};
|
|
1325
|
-
this.isSupported =
|
|
1326
|
-
this.isOpened() ?
|
|
1327
|
-
|
|
1325
|
+
this.isSupported = W("web_app_open_invoice", t), this.isOpened = w(a), this.openSlugFp = i((o, l) => p.pipe(
|
|
1326
|
+
this.isOpened() ? u.left(new Be("Invoice is already opened")) : u.right(void 0),
|
|
1327
|
+
u.chain(() => (a.set(!0), r("web_app_open_invoice", "invoice_closed", {
|
|
1328
1328
|
...l,
|
|
1329
1329
|
params: { slug: o },
|
|
1330
1330
|
capture: (_) => o === _.slug
|
|
1331
1331
|
}))),
|
|
1332
|
-
|
|
1332
|
+
u.mapBoth((_) => (c(), _), (_) => (c(), _.status))
|
|
1333
1333
|
)), this.openUrlFp = i((o, l) => {
|
|
1334
1334
|
const { hostname: _, pathname: F } = new URL(o, window.location.href);
|
|
1335
1335
|
if (_ !== "t.me")
|
|
1336
|
-
return
|
|
1336
|
+
return u.left(new U(`Link has unexpected hostname: ${_}`));
|
|
1337
1337
|
const f = F.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
|
|
1338
|
-
return f ? this.openSlugFp(f[2], l) :
|
|
1338
|
+
return f ? this.openSlugFp(f[2], l) : u.left(new U(
|
|
1339
1339
|
'Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'
|
|
1340
1340
|
));
|
|
1341
1341
|
}), this.openUrl = /* @__PURE__ */ h(this.openUrlFp), this.openSlug = /* @__PURE__ */ h(this.openSlugFp);
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function ls() {
|
|
1345
1345
|
return new us(p.pipe(S(), R, I));
|
|
1346
1346
|
}
|
|
1347
|
-
const
|
|
1348
|
-
function
|
|
1349
|
-
return
|
|
1350
|
-
if (typeof
|
|
1347
|
+
const sn = /* @__PURE__ */ ls();
|
|
1348
|
+
function hs({ postEvent: n, ...t }) {
|
|
1349
|
+
return B((r, s = {}) => {
|
|
1350
|
+
if (typeof r == "string")
|
|
1351
1351
|
try {
|
|
1352
|
-
|
|
1352
|
+
r = new URL(r);
|
|
1353
1353
|
} catch (i) {
|
|
1354
|
-
return b.left(new
|
|
1354
|
+
return b.left(new U(`"${r.toString()}" is invalid URL`, i));
|
|
1355
1355
|
}
|
|
1356
|
-
return
|
|
1357
|
-
url:
|
|
1358
|
-
try_browser:
|
|
1359
|
-
try_instant_view:
|
|
1356
|
+
return n("web_app_open_link", {
|
|
1357
|
+
url: r.toString(),
|
|
1358
|
+
try_browser: s.tryBrowser,
|
|
1359
|
+
try_instant_view: s.tryInstantView
|
|
1360
1360
|
});
|
|
1361
1361
|
}, { ...t, returns: "either" });
|
|
1362
1362
|
}
|
|
1363
1363
|
// @__NO_SIDE_EFFECTS__
|
|
1364
|
-
function
|
|
1365
|
-
return
|
|
1364
|
+
function ds() {
|
|
1365
|
+
return hs(p.pipe(S(), V));
|
|
1366
1366
|
}
|
|
1367
|
-
const
|
|
1368
|
-
function
|
|
1369
|
-
return
|
|
1370
|
-
const i =
|
|
1371
|
-
return i.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", $(t)) ? (
|
|
1372
|
-
}, { ...
|
|
1367
|
+
const fs = /* @__PURE__ */ ds(), rn = /* @__PURE__ */ h(fs);
|
|
1368
|
+
function _s({ postEvent: n, version: t, ...r }) {
|
|
1369
|
+
return B((s) => {
|
|
1370
|
+
const i = s.toString();
|
|
1371
|
+
return i.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", $(t)) ? (s = new URL(s), n("web_app_open_tg_link", { path_full: s.pathname + s.search })) : (window.location.href = i, b.right(void 0)) : b.left(new U(`"${i}" is invalid URL`));
|
|
1372
|
+
}, { ...r, returns: "either" });
|
|
1373
1373
|
}
|
|
1374
1374
|
// @__NO_SIDE_EFFECTS__
|
|
1375
|
-
function
|
|
1376
|
-
return
|
|
1375
|
+
function ms() {
|
|
1376
|
+
return _s(p.pipe(
|
|
1377
1377
|
S(),
|
|
1378
1378
|
V,
|
|
1379
1379
|
I
|
|
1380
1380
|
));
|
|
1381
1381
|
}
|
|
1382
|
-
const
|
|
1383
|
-
function
|
|
1384
|
-
return
|
|
1385
|
-
"https://t.me/share/url?" + new URLSearchParams({ url:
|
|
1382
|
+
const tt = /* @__PURE__ */ ms(), nn = /* @__PURE__ */ h(tt);
|
|
1383
|
+
function bs({ openVbotLink: n, ...t }) {
|
|
1384
|
+
return B((r, s) => n(
|
|
1385
|
+
"https://t.me/share/url?" + new URLSearchParams({ url: r, text: s || "" }).toString().replace(/\+/g, "%20")
|
|
1386
1386
|
), { ...t, returns: "either" });
|
|
1387
1387
|
}
|
|
1388
1388
|
// @__NO_SIDE_EFFECTS__
|
|
1389
|
-
function
|
|
1390
|
-
return
|
|
1389
|
+
function gs() {
|
|
1390
|
+
return bs({
|
|
1391
1391
|
...S(),
|
|
1392
|
-
openVbotLink:
|
|
1392
|
+
openVbotLink: tt
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
1395
|
-
const
|
|
1396
|
-
function
|
|
1397
|
-
let t = !1,
|
|
1398
|
-
return
|
|
1395
|
+
const Fs = /* @__PURE__ */ gs(), on = /* @__PURE__ */ h(Fs);
|
|
1396
|
+
function ws(n) {
|
|
1397
|
+
let t = !1, r, s;
|
|
1398
|
+
return n.available && (t = !0, r = n.access_requested, s = n.access_granted), {
|
|
1399
1399
|
available: t,
|
|
1400
|
-
accessGranted:
|
|
1401
|
-
accessRequested:
|
|
1400
|
+
accessGranted: s || !1,
|
|
1401
|
+
accessRequested: r || !1
|
|
1402
1402
|
};
|
|
1403
1403
|
}
|
|
1404
|
-
class
|
|
1404
|
+
class Cs {
|
|
1405
1405
|
constructor({
|
|
1406
1406
|
version: t,
|
|
1407
|
-
request:
|
|
1408
|
-
postEvent:
|
|
1407
|
+
request: r,
|
|
1408
|
+
postEvent: s,
|
|
1409
1409
|
storage: i,
|
|
1410
1410
|
isTma: a,
|
|
1411
|
-
isPageReload:
|
|
1411
|
+
isPageReload: c
|
|
1412
1412
|
}) {
|
|
1413
1413
|
/**
|
|
1414
1414
|
* Complete location manager state.
|
|
@@ -1477,14 +1477,14 @@ class ws {
|
|
|
1477
1477
|
accessRequested: !1
|
|
1478
1478
|
},
|
|
1479
1479
|
onChange: i.set
|
|
1480
|
-
}), l = new
|
|
1481
|
-
isPageReload:
|
|
1480
|
+
}), l = new xe({
|
|
1481
|
+
isPageReload: c,
|
|
1482
1482
|
restoreState: i.get,
|
|
1483
1483
|
onMounted: o.setState,
|
|
1484
1484
|
initialState(C) {
|
|
1485
1485
|
return p.pipe(
|
|
1486
|
-
|
|
1487
|
-
|
|
1486
|
+
r("web_app_check_location", "location_checked", C),
|
|
1487
|
+
u.map(ws)
|
|
1488
1488
|
);
|
|
1489
1489
|
}
|
|
1490
1490
|
}), _ = { version: t, requires: "web_app_check_location", isTma: a }, F = E({
|
|
@@ -1498,9 +1498,9 @@ class ws {
|
|
|
1498
1498
|
returns: "task",
|
|
1499
1499
|
isMounted: l.isMounted
|
|
1500
1500
|
});
|
|
1501
|
-
this.isAvailable = o.getter("available"), this.isAccessRequested = o.getter("accessRequested"), this.isAccessGranted = o.getter("accessGranted"), this.isSupported =
|
|
1502
|
-
|
|
1503
|
-
|
|
1501
|
+
this.isAvailable = o.getter("available"), this.isAccessRequested = o.getter("accessRequested"), this.isAccessGranted = o.getter("accessGranted"), this.isSupported = W("web_app_check_location", t), this.isMounted = l.isMounted, this.state = o.state, this.unmount = l.unmount, this.mountFp = f(l.mount), this.openSettingsFp = F(() => s("web_app_open_location_settings")), this.requestLocationFp = v((C) => p.pipe(
|
|
1502
|
+
r("web_app_request_location", "location_requested", C),
|
|
1503
|
+
u.map((k) => {
|
|
1504
1504
|
if (!k.available)
|
|
1505
1505
|
return o.setState({ available: !1 }), null;
|
|
1506
1506
|
const { available: y, ...m } = k;
|
|
@@ -1509,8 +1509,8 @@ class ws {
|
|
|
1509
1509
|
)), this.mount = /* @__PURE__ */ h(this.mountFp), this.openSettings = /* @__PURE__ */ h(this.openSettingsFp), this.requestLocation = /* @__PURE__ */ h(this.requestLocationFp);
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1513
|
-
return new
|
|
1512
|
+
function Ss() {
|
|
1513
|
+
return new Cs(p.pipe(
|
|
1514
1514
|
S(),
|
|
1515
1515
|
V,
|
|
1516
1516
|
I,
|
|
@@ -1518,9 +1518,9 @@ function Cs() {
|
|
|
1518
1518
|
Y("locationManager")
|
|
1519
1519
|
));
|
|
1520
1520
|
}
|
|
1521
|
-
const
|
|
1522
|
-
class
|
|
1523
|
-
constructor({ defaults: t, ...
|
|
1521
|
+
const an = /* @__PURE__ */ Ss();
|
|
1522
|
+
class vs {
|
|
1523
|
+
constructor({ defaults: t, ...r }) {
|
|
1524
1524
|
//#region Properties.
|
|
1525
1525
|
/**
|
|
1526
1526
|
* The button background color.
|
|
@@ -1708,8 +1708,8 @@ class Ss {
|
|
|
1708
1708
|
* @see offClickFp
|
|
1709
1709
|
*/
|
|
1710
1710
|
e(this, "offClick");
|
|
1711
|
-
const
|
|
1712
|
-
...
|
|
1711
|
+
const s = new fe({
|
|
1712
|
+
...r,
|
|
1713
1713
|
version: "100",
|
|
1714
1714
|
initialState: {
|
|
1715
1715
|
hasShineEffect: !1,
|
|
@@ -1728,49 +1728,49 @@ class Ss {
|
|
|
1728
1728
|
color: a.bgColor,
|
|
1729
1729
|
text_color: a.textColor
|
|
1730
1730
|
})
|
|
1731
|
-
}), i = (a,
|
|
1732
|
-
const o =
|
|
1733
|
-
return w(() => o() || $(
|
|
1731
|
+
}), i = (a, c) => {
|
|
1732
|
+
const o = s.stateGetter(a);
|
|
1733
|
+
return w(() => o() || $(c));
|
|
1734
1734
|
};
|
|
1735
|
-
this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.hasShineEffect =
|
|
1735
|
+
this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.hasShineEffect = s.stateGetter("hasShineEffect"), this.isEnabled = s.stateGetter("isEnabled"), this.isLoaderVisible = s.stateGetter("isLoaderVisible"), this.text = s.stateGetter("text"), this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.state = s.state, [this.setBgColor, this.setBgColorFp] = s.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = s.stateSetters("textColor"), [
|
|
1736
1736
|
[this.disableShineEffect, this.disableShineEffectFp],
|
|
1737
1737
|
[this.enableShineEffect, this.enableShineEffectFp]
|
|
1738
|
-
] =
|
|
1738
|
+
] = s.stateBoolSetters("hasShineEffect"), [
|
|
1739
1739
|
[this.disable, this.disableFp],
|
|
1740
1740
|
[this.enable, this.enableFp]
|
|
1741
|
-
] =
|
|
1741
|
+
] = s.stateBoolSetters("isEnabled"), [
|
|
1742
1742
|
[this.hideLoader, this.hideLoaderFp],
|
|
1743
1743
|
[this.showLoader, this.showLoaderFp]
|
|
1744
|
-
] =
|
|
1744
|
+
] = s.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = s.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.setParams = s.setState, this.setParamsFp = s.setStateFp, this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
|
|
1745
1745
|
}
|
|
1746
1746
|
//#endregion
|
|
1747
1747
|
}
|
|
1748
|
-
function
|
|
1749
|
-
document.documentElement.style.setProperty(
|
|
1748
|
+
function Te(n, t) {
|
|
1749
|
+
document.documentElement.style.setProperty(n, t);
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1752
|
-
document.documentElement.style.removeProperty(
|
|
1751
|
+
function Re(n) {
|
|
1752
|
+
document.documentElement.style.removeProperty(n);
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1754
|
+
function ks(n) {
|
|
1755
1755
|
return p.pipe(
|
|
1756
|
-
|
|
1756
|
+
gt(n),
|
|
1757
1757
|
b.map((t) => Math.sqrt(
|
|
1758
|
-
[0.299, 0.587, 0.114].reduce((
|
|
1758
|
+
[0.299, 0.587, 0.114].reduce((r, s, i) => {
|
|
1759
1759
|
const a = parseInt(t.slice(1 + i * 2, 1 + (i + 1) * 2), 16);
|
|
1760
|
-
return
|
|
1760
|
+
return r + a * a * s;
|
|
1761
1761
|
}, 0)
|
|
1762
1762
|
) < 120)
|
|
1763
1763
|
);
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1766
|
-
class
|
|
1765
|
+
const st = de(ks);
|
|
1766
|
+
class ys {
|
|
1767
1767
|
constructor({
|
|
1768
1768
|
initialState: t,
|
|
1769
|
-
onChange:
|
|
1770
|
-
offChange:
|
|
1769
|
+
onChange: r,
|
|
1770
|
+
offChange: s,
|
|
1771
1771
|
isTma: i,
|
|
1772
1772
|
storage: a,
|
|
1773
|
-
isPageReload:
|
|
1773
|
+
isPageReload: c
|
|
1774
1774
|
}) {
|
|
1775
1775
|
//#region Colors.
|
|
1776
1776
|
/**
|
|
@@ -1852,7 +1852,7 @@ class ks {
|
|
|
1852
1852
|
*/
|
|
1853
1853
|
e(this, "isDark", w(() => {
|
|
1854
1854
|
const t = this.bgColor();
|
|
1855
|
-
return !t ||
|
|
1855
|
+
return !t || st(t);
|
|
1856
1856
|
}));
|
|
1857
1857
|
//#endregion
|
|
1858
1858
|
//#region Mounting.
|
|
@@ -1879,12 +1879,12 @@ class ks {
|
|
|
1879
1879
|
o.setState(C.theme_params);
|
|
1880
1880
|
}, _ = new ne({
|
|
1881
1881
|
initialState: () => b.right($(t)),
|
|
1882
|
-
isPageReload:
|
|
1882
|
+
isPageReload: c,
|
|
1883
1883
|
onMounted(C) {
|
|
1884
|
-
o.setState(C),
|
|
1884
|
+
o.setState(C), r(l);
|
|
1885
1885
|
},
|
|
1886
1886
|
onUnmounted() {
|
|
1887
|
-
|
|
1887
|
+
s(l);
|
|
1888
1888
|
},
|
|
1889
1889
|
restoreState: a.get
|
|
1890
1890
|
}), F = { isTma: i, returns: "either" }, f = E(F), v = E({
|
|
@@ -1893,62 +1893,62 @@ class ks {
|
|
|
1893
1893
|
});
|
|
1894
1894
|
this.accentTextColor = o.getter("accent_text_color"), this.bgColor = o.getter("bg_color"), this.buttonColor = o.getter("button_color"), this.buttonTextColor = o.getter("button_text_color"), this.bottomBarBgColor = o.getter("bottom_bar_bg_color"), this.destructiveTextColor = o.getter("destructive_text_color"), this.headerBgColor = o.getter("header_bg_color"), this.hintColor = o.getter("hint_color"), this.linkColor = o.getter("link_color"), this.secondaryBgColor = o.getter("secondary_bg_color"), this.sectionBgColor = o.getter("section_bg_color"), this.sectionHeaderTextColor = o.getter("section_header_text_color"), this.sectionSeparatorColor = o.getter("section_separator_color"), this.subtitleTextColor = o.getter("subtitle_text_color"), this.textColor = o.getter("text_color"), this.state = o.state, this.isMounted = _.isMounted, this.bindCssVarsFp = v((C) => {
|
|
1895
1895
|
if (this._isCssVarsBound())
|
|
1896
|
-
return b.left(new
|
|
1897
|
-
C || (C = (m) => `--tg-theme-${
|
|
1896
|
+
return b.left(new qe());
|
|
1897
|
+
C || (C = (m) => `--tg-theme-${bt(m)}`);
|
|
1898
1898
|
const k = (m) => {
|
|
1899
1899
|
Object.entries(o.state()).forEach(([g, d]) => {
|
|
1900
1900
|
d && m(g, d);
|
|
1901
1901
|
});
|
|
1902
1902
|
}, y = () => {
|
|
1903
1903
|
k((m, g) => {
|
|
1904
|
-
|
|
1904
|
+
Te(C(m), g);
|
|
1905
1905
|
});
|
|
1906
1906
|
};
|
|
1907
1907
|
return y(), o.state.sub(y), this._isCssVarsBound.set(!0), b.right(() => {
|
|
1908
|
-
k(
|
|
1908
|
+
k(Re), o.state.unsub(y), this._isCssVarsBound.set(!1);
|
|
1909
1909
|
});
|
|
1910
1910
|
}), this.mountFp = f(_.mount), this.unmount = _.unmount, this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.mount = /* @__PURE__ */ h(this.mountFp);
|
|
1911
1911
|
}
|
|
1912
1912
|
//#endregion
|
|
1913
1913
|
}
|
|
1914
|
-
const
|
|
1915
|
-
function
|
|
1916
|
-
return new
|
|
1914
|
+
const ve = /* @__PURE__ */ ie({});
|
|
1915
|
+
function Is() {
|
|
1916
|
+
return new ys({
|
|
1917
1917
|
...p.pipe(
|
|
1918
1918
|
S(),
|
|
1919
1919
|
Y("themeParams")
|
|
1920
1920
|
),
|
|
1921
|
-
offChange(
|
|
1922
|
-
re("theme_changed",
|
|
1921
|
+
offChange(n) {
|
|
1922
|
+
re("theme_changed", n);
|
|
1923
1923
|
},
|
|
1924
|
-
onChange(
|
|
1925
|
-
G("theme_changed",
|
|
1924
|
+
onChange(n) {
|
|
1925
|
+
G("theme_changed", n);
|
|
1926
1926
|
},
|
|
1927
|
-
initialState:
|
|
1927
|
+
initialState: ve
|
|
1928
1928
|
});
|
|
1929
1929
|
}
|
|
1930
|
-
const
|
|
1930
|
+
const he = /* @__PURE__ */ Is();
|
|
1931
1931
|
// @__NO_SIDE_EFFECTS__
|
|
1932
|
-
function
|
|
1932
|
+
function rt(n, t, r) {
|
|
1933
1933
|
return p.pipe(
|
|
1934
|
-
/* @__PURE__ */ Ae(
|
|
1935
|
-
(
|
|
1934
|
+
/* @__PURE__ */ Ae(n, t),
|
|
1935
|
+
(s) => ({ ...s, defaults: r })
|
|
1936
1936
|
);
|
|
1937
1937
|
}
|
|
1938
|
-
const
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
bgColor: w(() =>
|
|
1941
|
-
textColor: w(() =>
|
|
1938
|
+
const pn = /* @__PURE__ */ new vs(
|
|
1939
|
+
/* @__PURE__ */ rt("mainButton", "main_button_pressed", {
|
|
1940
|
+
bgColor: w(() => he.buttonColor() || "#2481cc"),
|
|
1941
|
+
textColor: w(() => he.buttonTextColor() || "#ffffff")
|
|
1942
1942
|
})
|
|
1943
1943
|
);
|
|
1944
|
-
class
|
|
1944
|
+
class Es {
|
|
1945
1945
|
constructor({
|
|
1946
1946
|
storage: t,
|
|
1947
|
-
isPageReload:
|
|
1948
|
-
version:
|
|
1947
|
+
isPageReload: r,
|
|
1948
|
+
version: s,
|
|
1949
1949
|
postEvent: i,
|
|
1950
1950
|
isTma: a,
|
|
1951
|
-
theme:
|
|
1951
|
+
theme: c,
|
|
1952
1952
|
onVisibilityChanged: o,
|
|
1953
1953
|
offVisibilityChanged: l
|
|
1954
1954
|
}) {
|
|
@@ -1962,7 +1962,7 @@ class Is {
|
|
|
1962
1962
|
*/
|
|
1963
1963
|
e(this, "isDark", w(() => {
|
|
1964
1964
|
const t = this.bgColorRgb();
|
|
1965
|
-
return t ?
|
|
1965
|
+
return t ? st(t) : !1;
|
|
1966
1966
|
}));
|
|
1967
1967
|
/**
|
|
1968
1968
|
* Signal indicating if the mini app is currently active.
|
|
@@ -2127,9 +2127,9 @@ class Is {
|
|
|
2127
2127
|
[this.headerColor, "web_app_set_header_color"],
|
|
2128
2128
|
[this.bgColor, "web_app_set_background_color"],
|
|
2129
2129
|
[this.bottomBarColor, "web_app_set_bottom_bar_color"]
|
|
2130
|
-
].forEach(([
|
|
2131
|
-
const M =
|
|
2132
|
-
if (!
|
|
2130
|
+
].forEach(([A, T]) => {
|
|
2131
|
+
const M = A();
|
|
2132
|
+
if (!_e(M) && (T !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(M))) {
|
|
2133
2133
|
const P = d[M];
|
|
2134
2134
|
P && i(T, { color: P });
|
|
2135
2135
|
}
|
|
@@ -2143,16 +2143,16 @@ class Is {
|
|
|
2143
2143
|
isActive: !0
|
|
2144
2144
|
});
|
|
2145
2145
|
},
|
|
2146
|
-
isPageReload:
|
|
2146
|
+
isPageReload: r,
|
|
2147
2147
|
onMounted: (d) => {
|
|
2148
|
-
o(_),
|
|
2148
|
+
o(_), c.sub(F), v.setState(d);
|
|
2149
2149
|
},
|
|
2150
2150
|
onUnmounted() {
|
|
2151
|
-
l(_),
|
|
2151
|
+
l(_), c.unsub(F);
|
|
2152
2152
|
},
|
|
2153
2153
|
restoreState: t.get
|
|
2154
2154
|
});
|
|
2155
|
-
this.isMounted = f.isMounted, this.mountFp =
|
|
2155
|
+
this.isMounted = f.isMounted, this.mountFp = B(() => {
|
|
2156
2156
|
const d = () => {
|
|
2157
2157
|
};
|
|
2158
2158
|
return p.pipe(f.mount(), b.match(d, d));
|
|
@@ -2167,34 +2167,34 @@ class Is {
|
|
|
2167
2167
|
onChange: t.set
|
|
2168
2168
|
});
|
|
2169
2169
|
this.state = v.state;
|
|
2170
|
-
const C = (d) =>
|
|
2170
|
+
const C = (d) => _e(d) ? d : $(c)[d], k = (d) => w(() => C(d()));
|
|
2171
2171
|
this.isActive = v.getter("isActive"), this.isSupported = w(() => [
|
|
2172
2172
|
"web_app_set_header_color",
|
|
2173
2173
|
"web_app_set_background_color",
|
|
2174
2174
|
"web_app_set_bottom_bar_color"
|
|
2175
|
-
].some((d) => ee(d, $(
|
|
2175
|
+
].some((d) => ee(d, $(s))));
|
|
2176
2176
|
const y = O(!1);
|
|
2177
|
-
this.isCssVarsBound = w(y), this.bindCssVarsFp =
|
|
2177
|
+
this.isCssVarsBound = w(y), this.bindCssVarsFp = B((d) => {
|
|
2178
2178
|
if (y())
|
|
2179
|
-
return b.left(new
|
|
2180
|
-
const [
|
|
2179
|
+
return b.left(new qe());
|
|
2180
|
+
const [A, T] = Ie(() => {
|
|
2181
2181
|
y.set(!1);
|
|
2182
2182
|
}), M = (P, L) => {
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2183
|
+
const H = () => {
|
|
2184
|
+
Te(P, L() || null);
|
|
2185
2185
|
};
|
|
2186
|
-
|
|
2186
|
+
H(), A(L.sub(H), Re.bind(null, P));
|
|
2187
2187
|
};
|
|
2188
2188
|
return d || (d = (P) => `--tg-${We(P)}`), M(d("bgColor"), this.bgColorRgb), M(d("bottomBarColor"), this.bottomBarColorRgb), M(d("headerColor"), this.headerColorRgb), y.set(!0), b.right(T);
|
|
2189
2189
|
}, { isTma: a, returns: "either", isMounted: this.isMounted }), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp);
|
|
2190
2190
|
const m = (d) => {
|
|
2191
|
-
const
|
|
2191
|
+
const A = v.getter(d), T = k(A), M = {
|
|
2192
2192
|
headerColor: "web_app_set_header_color",
|
|
2193
2193
|
bgColor: "web_app_set_background_color",
|
|
2194
2194
|
bottomBarColor: "web_app_set_bottom_bar_color"
|
|
2195
|
-
}[d], P =
|
|
2195
|
+
}[d], P = B(
|
|
2196
2196
|
(L) => {
|
|
2197
|
-
if (L ===
|
|
2197
|
+
if (L === A())
|
|
2198
2198
|
return b.right(void 0);
|
|
2199
2199
|
if (M === "web_app_set_header_color" && (L === "bg_color" || L === "secondary_bg_color"))
|
|
2200
2200
|
return p.pipe(
|
|
@@ -2203,9 +2203,9 @@ class Is {
|
|
|
2203
2203
|
v.setState({ [d]: L });
|
|
2204
2204
|
})
|
|
2205
2205
|
);
|
|
2206
|
-
const
|
|
2206
|
+
const H = C(L);
|
|
2207
2207
|
return p.pipe(
|
|
2208
|
-
|
|
2208
|
+
H ? i(M, { color: H }) : b.left(new Mt(L)),
|
|
2209
2209
|
b.map(() => {
|
|
2210
2210
|
v.setState({ [d]: L });
|
|
2211
2211
|
})
|
|
@@ -2213,7 +2213,7 @@ class Is {
|
|
|
2213
2213
|
},
|
|
2214
2214
|
{
|
|
2215
2215
|
isTma: a,
|
|
2216
|
-
version:
|
|
2216
|
+
version: s,
|
|
2217
2217
|
requires: M,
|
|
2218
2218
|
isMounted: this.isMounted,
|
|
2219
2219
|
returns: "either",
|
|
@@ -2221,12 +2221,12 @@ class Is {
|
|
|
2221
2221
|
rgb: {
|
|
2222
2222
|
method: "web_app_set_header_color",
|
|
2223
2223
|
param: "color",
|
|
2224
|
-
shouldCheck:
|
|
2224
|
+
shouldCheck: _e
|
|
2225
2225
|
}
|
|
2226
2226
|
} : void 0
|
|
2227
2227
|
}
|
|
2228
2228
|
);
|
|
2229
|
-
return [
|
|
2229
|
+
return [A, T, /* @__PURE__ */ h(P), P];
|
|
2230
2230
|
};
|
|
2231
2231
|
[
|
|
2232
2232
|
this.bgColor,
|
|
@@ -2249,29 +2249,29 @@ class Is {
|
|
|
2249
2249
|
}
|
|
2250
2250
|
//#endregion
|
|
2251
2251
|
}
|
|
2252
|
-
function
|
|
2253
|
-
return new
|
|
2252
|
+
function qs() {
|
|
2253
|
+
return new Es({
|
|
2254
2254
|
...p.pipe(
|
|
2255
2255
|
S(),
|
|
2256
2256
|
V,
|
|
2257
2257
|
I,
|
|
2258
2258
|
Y("miniApp")
|
|
2259
2259
|
),
|
|
2260
|
-
offVisibilityChanged(
|
|
2261
|
-
re("visibility_changed",
|
|
2260
|
+
offVisibilityChanged(n) {
|
|
2261
|
+
re("visibility_changed", n);
|
|
2262
2262
|
},
|
|
2263
|
-
onVisibilityChanged(
|
|
2264
|
-
G("visibility_changed",
|
|
2263
|
+
onVisibilityChanged(n) {
|
|
2264
|
+
G("visibility_changed", n);
|
|
2265
2265
|
},
|
|
2266
|
-
theme:
|
|
2266
|
+
theme: he.state
|
|
2267
2267
|
});
|
|
2268
2268
|
}
|
|
2269
|
-
const
|
|
2269
|
+
const Bs = /* @__PURE__ */ qs();
|
|
2270
2270
|
function As() {
|
|
2271
|
-
const
|
|
2272
|
-
return `notif_${
|
|
2271
|
+
const n = Date.now(), t = Math.random().toString(36).substring(2, 9);
|
|
2272
|
+
return `notif_${n}_${t}`;
|
|
2273
2273
|
}
|
|
2274
|
-
class
|
|
2274
|
+
class xs {
|
|
2275
2275
|
constructor({}) {
|
|
2276
2276
|
/**
|
|
2277
2277
|
* Sends a notification to the native app.
|
|
@@ -2284,55 +2284,55 @@ class Bs {
|
|
|
2284
2284
|
*/
|
|
2285
2285
|
e(this, "send");
|
|
2286
2286
|
this.sendFp = (t) => p.pipe(
|
|
2287
|
-
|
|
2288
|
-
|
|
2287
|
+
u.fromEither(
|
|
2288
|
+
ye("web_app_send_notification", {
|
|
2289
2289
|
id: As(),
|
|
2290
2290
|
message: t.message,
|
|
2291
2291
|
title: t.title,
|
|
2292
2292
|
type: t.type ?? "default"
|
|
2293
2293
|
})
|
|
2294
2294
|
),
|
|
2295
|
-
|
|
2295
|
+
u.map(() => {
|
|
2296
2296
|
})
|
|
2297
|
-
), this.send = (t) => this.sendFp(t)().then((
|
|
2298
|
-
if (
|
|
2299
|
-
throw
|
|
2300
|
-
return
|
|
2297
|
+
), this.send = (t) => this.sendFp(t)().then((s) => {
|
|
2298
|
+
if (s._tag === "Left")
|
|
2299
|
+
throw s.left;
|
|
2300
|
+
return s.right;
|
|
2301
2301
|
});
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
2304
|
-
function
|
|
2305
|
-
return new
|
|
2304
|
+
function Ms() {
|
|
2305
|
+
return new xs(p.pipe(S()));
|
|
2306
2306
|
}
|
|
2307
|
-
const
|
|
2308
|
-
function
|
|
2309
|
-
const t =
|
|
2310
|
-
if (
|
|
2311
|
-
return b.left(new
|
|
2307
|
+
const cn = /* @__PURE__ */ Ms();
|
|
2308
|
+
function Vs(n) {
|
|
2309
|
+
const t = n.message.trim(), r = (n.title || "").trim(), s = n.buttons || [];
|
|
2310
|
+
if (r.length > 64)
|
|
2311
|
+
return b.left(new U(`Invalid title: ${r}`));
|
|
2312
2312
|
if (!t || t.length > 256)
|
|
2313
|
-
return b.left(new
|
|
2314
|
-
if (
|
|
2315
|
-
return b.left(new
|
|
2313
|
+
return b.left(new U(`Invalid message: ${t}`));
|
|
2314
|
+
if (s.length > 3)
|
|
2315
|
+
return b.left(new U(`Invalid buttons count: ${s.length}`));
|
|
2316
2316
|
const i = [];
|
|
2317
|
-
if (!
|
|
2317
|
+
if (!s.length)
|
|
2318
2318
|
i.push({ type: "close", id: "" });
|
|
2319
2319
|
else
|
|
2320
|
-
for (let a = 0; a <
|
|
2321
|
-
const
|
|
2320
|
+
for (let a = 0; a < s.length; a++) {
|
|
2321
|
+
const c = s[a], o = c.id || "";
|
|
2322
2322
|
if (o.length > 64)
|
|
2323
|
-
return b.left(new
|
|
2324
|
-
if (!
|
|
2325
|
-
const l =
|
|
2323
|
+
return b.left(new U(`Button with index ${a} has invalid id: ${o}`));
|
|
2324
|
+
if (!c.type || c.type === "default" || c.type === "destructive") {
|
|
2325
|
+
const l = c.text.trim();
|
|
2326
2326
|
if (!l || l.length > 64)
|
|
2327
|
-
return b.left(new
|
|
2328
|
-
i.push({ type:
|
|
2327
|
+
return b.left(new U(`Button with index ${a} has invalid text: ${l}`));
|
|
2328
|
+
i.push({ type: c.type, text: l, id: o });
|
|
2329
2329
|
} else
|
|
2330
|
-
i.push({ type:
|
|
2330
|
+
i.push({ type: c.type, id: o });
|
|
2331
2331
|
}
|
|
2332
|
-
return b.right({ title:
|
|
2332
|
+
return b.right({ title: r, message: t, buttons: i });
|
|
2333
2333
|
}
|
|
2334
|
-
class
|
|
2335
|
-
constructor({ version: t, isTma:
|
|
2334
|
+
class Ts {
|
|
2335
|
+
constructor({ version: t, isTma: r, request: s }) {
|
|
2336
2336
|
/**
|
|
2337
2337
|
* Signal indicating if any popup is currently opened.
|
|
2338
2338
|
*/
|
|
@@ -2373,92 +2373,92 @@ class Vs {
|
|
|
2373
2373
|
e(this, "show");
|
|
2374
2374
|
const i = O(!1), a = () => {
|
|
2375
2375
|
i.set(!1);
|
|
2376
|
-
},
|
|
2376
|
+
}, c = E({
|
|
2377
2377
|
version: t,
|
|
2378
|
-
isTma:
|
|
2378
|
+
isTma: r,
|
|
2379
2379
|
requires: "web_app_open_popup",
|
|
2380
2380
|
returns: "task"
|
|
2381
2381
|
});
|
|
2382
|
-
this.isSupported =
|
|
2383
|
-
this.isOpened() ?
|
|
2384
|
-
|
|
2385
|
-
|
|
2382
|
+
this.isSupported = W("web_app_open_popup", t), this.isOpened = w(i), this.showFp = c((o) => p.pipe(
|
|
2383
|
+
this.isOpened() ? u.left(new Be("A popup is already opened")) : u.right(void 0),
|
|
2384
|
+
u.chainW(() => u.fromEither(Vs(o))),
|
|
2385
|
+
u.chain((l) => (i.set(!0), s("web_app_open_popup", "popup_closed", {
|
|
2386
2386
|
...o,
|
|
2387
2387
|
params: l
|
|
2388
2388
|
}))),
|
|
2389
|
-
|
|
2389
|
+
u.mapBoth(
|
|
2390
2390
|
(l) => (a(), l),
|
|
2391
2391
|
(l) => (a(), l.button_id)
|
|
2392
2392
|
)
|
|
2393
2393
|
)), this.show = /* @__PURE__ */ h(this.showFp);
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2397
|
-
return new
|
|
2396
|
+
function Rs() {
|
|
2397
|
+
return new Ts(p.pipe(S(), R, I));
|
|
2398
2398
|
}
|
|
2399
|
-
const un = /* @__PURE__ */
|
|
2400
|
-
function
|
|
2401
|
-
return
|
|
2402
|
-
|
|
2403
|
-
|
|
2399
|
+
const un = /* @__PURE__ */ Rs();
|
|
2400
|
+
function Ls({ request: n, ...t }) {
|
|
2401
|
+
return B((r) => p.pipe(
|
|
2402
|
+
n("web_app_request_phone", "phone_requested", r),
|
|
2403
|
+
u.map((s) => s.status)
|
|
2404
2404
|
), { ...t, requires: "web_app_request_phone", returns: "task" });
|
|
2405
2405
|
}
|
|
2406
2406
|
// @__NO_SIDE_EFFECTS__
|
|
2407
|
-
function
|
|
2408
|
-
return
|
|
2407
|
+
function $s() {
|
|
2408
|
+
return Ls(p.pipe(
|
|
2409
2409
|
S(),
|
|
2410
2410
|
I,
|
|
2411
2411
|
R
|
|
2412
2412
|
));
|
|
2413
2413
|
}
|
|
2414
|
-
const
|
|
2415
|
-
function
|
|
2416
|
-
invokeCustomMethod:
|
|
2414
|
+
const nt = /* @__PURE__ */ $s(), ln = /* @__PURE__ */ h(nt);
|
|
2415
|
+
function Ps({
|
|
2416
|
+
invokeCustomMethod: n,
|
|
2417
2417
|
requestPhoneAccess: t,
|
|
2418
|
-
...
|
|
2418
|
+
...r
|
|
2419
2419
|
}) {
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2422
|
-
...
|
|
2423
|
-
timeout: (
|
|
2420
|
+
const s = (c) => p.pipe(
|
|
2421
|
+
n("getRequestedContact", {}, {
|
|
2422
|
+
...c,
|
|
2423
|
+
timeout: (c || {}).timeout || 5e3
|
|
2424
2424
|
}),
|
|
2425
|
-
|
|
2426
|
-
const l =
|
|
2425
|
+
u.chainW((o) => {
|
|
2426
|
+
const l = we(K(), o);
|
|
2427
2427
|
if (!l.success)
|
|
2428
|
-
return
|
|
2428
|
+
return u.left(new ce(o, l.issues));
|
|
2429
2429
|
if (!l.output)
|
|
2430
|
-
return
|
|
2431
|
-
const _ =
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
contact:
|
|
2435
|
-
user_id:
|
|
2430
|
+
return u.right(void 0);
|
|
2431
|
+
const _ = we(
|
|
2432
|
+
Ft(
|
|
2433
|
+
Ge({
|
|
2434
|
+
contact: wt(Ge({
|
|
2435
|
+
user_id: Je(),
|
|
2436
2436
|
phone_number: K(),
|
|
2437
2437
|
first_name: K(),
|
|
2438
|
-
last_name:
|
|
2438
|
+
last_name: vt(K())
|
|
2439
2439
|
})),
|
|
2440
|
-
auth_date:
|
|
2440
|
+
auth_date: Ke(
|
|
2441
2441
|
K(),
|
|
2442
|
-
|
|
2443
|
-
|
|
2442
|
+
Ne((F) => new Date(Number(F) * 1e3)),
|
|
2443
|
+
Qe()
|
|
2444
2444
|
),
|
|
2445
2445
|
hash: K()
|
|
2446
2446
|
})
|
|
2447
2447
|
),
|
|
2448
2448
|
l.output
|
|
2449
2449
|
);
|
|
2450
|
-
return _.success ?
|
|
2450
|
+
return _.success ? u.right({ raw: l.output, parsed: _.output }) : u.left(new ce(l.output, _.issues));
|
|
2451
2451
|
})
|
|
2452
|
-
), i = (
|
|
2453
|
-
|
|
2454
|
-
|
|
2452
|
+
), i = (c) => p.pipe(
|
|
2453
|
+
s(c),
|
|
2454
|
+
u.match(
|
|
2455
2455
|
// All other errors except validation ones should be ignored. Receiving validation error
|
|
2456
2456
|
// means that we have some data, but we are unable to parse it properly. So, there is no
|
|
2457
2457
|
// need to make some more requests further, the problem is local.
|
|
2458
|
-
(o) =>
|
|
2458
|
+
(o) => ce.is(o) ? b.left(o) : b.right(void 0),
|
|
2459
2459
|
(o) => b.right(o)
|
|
2460
2460
|
)
|
|
2461
|
-
), a = (
|
|
2461
|
+
), a = (c) => Fe(
|
|
2462
2462
|
async (o, l, _) => {
|
|
2463
2463
|
let F = 50;
|
|
2464
2464
|
for (; !_.isRejected; ) {
|
|
@@ -2470,63 +2470,63 @@ function $s({
|
|
|
2470
2470
|
await new Promise((v) => setTimeout(v, F)), F += 50;
|
|
2471
2471
|
}
|
|
2472
2472
|
},
|
|
2473
|
-
|
|
2473
|
+
c
|
|
2474
2474
|
);
|
|
2475
|
-
return
|
|
2475
|
+
return B((c) => Fe.fn((o) => p.pipe(
|
|
2476
2476
|
// Try to get the requested contact. Probably, we already requested it before.
|
|
2477
2477
|
i(o),
|
|
2478
|
-
|
|
2478
|
+
u.chain((l) => l ? u.right(l) : p.pipe(
|
|
2479
2479
|
t(o),
|
|
2480
|
-
|
|
2480
|
+
u.chainW((_) => _ === "sent" ? a(o) : u.left(new Ye("User denied access")))
|
|
2481
2481
|
))
|
|
2482
|
-
),
|
|
2482
|
+
), c), { ...r, returns: "task", requires: "web_app_request_phone" });
|
|
2483
2483
|
}
|
|
2484
2484
|
// @__NO_SIDE_EFFECTS__
|
|
2485
|
-
function
|
|
2486
|
-
return
|
|
2487
|
-
...p.pipe(S(),
|
|
2488
|
-
requestPhoneAccess:
|
|
2485
|
+
function Os() {
|
|
2486
|
+
return Ps({
|
|
2487
|
+
...p.pipe(S(), Ve, I),
|
|
2488
|
+
requestPhoneAccess: nt
|
|
2489
2489
|
});
|
|
2490
2490
|
}
|
|
2491
|
-
function
|
|
2492
|
-
return
|
|
2493
|
-
|
|
2491
|
+
function Ds({ requestContact: n, ...t }) {
|
|
2492
|
+
return B(
|
|
2493
|
+
n,
|
|
2494
2494
|
{ ...t, returns: "task", requires: "web_app_request_phone" }
|
|
2495
2495
|
);
|
|
2496
2496
|
}
|
|
2497
2497
|
// @__NO_SIDE_EFFECTS__
|
|
2498
|
-
function
|
|
2499
|
-
return
|
|
2498
|
+
function Gs() {
|
|
2499
|
+
return Ds({
|
|
2500
2500
|
...p.pipe(S(), I),
|
|
2501
|
-
requestContact(
|
|
2501
|
+
requestContact(n) {
|
|
2502
2502
|
return p.pipe(
|
|
2503
|
-
|
|
2504
|
-
|
|
2503
|
+
it(n),
|
|
2504
|
+
u.map((t) => t.parsed)
|
|
2505
2505
|
);
|
|
2506
2506
|
}
|
|
2507
2507
|
});
|
|
2508
2508
|
}
|
|
2509
|
-
const
|
|
2510
|
-
function
|
|
2511
|
-
return
|
|
2512
|
-
|
|
2513
|
-
|
|
2509
|
+
const it = /* @__PURE__ */ Os(), hn = /* @__PURE__ */ h(it), js = /* @__PURE__ */ Gs(), dn = /* @__PURE__ */ h(js);
|
|
2510
|
+
function Hs({ request: n, ...t }) {
|
|
2511
|
+
return B((r) => p.pipe(
|
|
2512
|
+
n("web_app_request_write_access", "write_access_requested", r),
|
|
2513
|
+
u.map((s) => s.status)
|
|
2514
2514
|
), { ...t, requires: "web_app_request_write_access", returns: "task" });
|
|
2515
2515
|
}
|
|
2516
2516
|
// @__NO_SIDE_EFFECTS__
|
|
2517
2517
|
function Us() {
|
|
2518
|
-
return
|
|
2518
|
+
return Hs(p.pipe(
|
|
2519
2519
|
S(),
|
|
2520
2520
|
I,
|
|
2521
2521
|
R
|
|
2522
2522
|
));
|
|
2523
2523
|
}
|
|
2524
|
-
const Ws = /* @__PURE__ */ Us(),
|
|
2525
|
-
class
|
|
2524
|
+
const Ws = /* @__PURE__ */ Us(), fn = /* @__PURE__ */ h(Ws);
|
|
2525
|
+
class zs {
|
|
2526
2526
|
constructor({
|
|
2527
2527
|
version: t,
|
|
2528
|
-
onClosed:
|
|
2529
|
-
onTextReceived:
|
|
2528
|
+
onClosed: r,
|
|
2529
|
+
onTextReceived: s,
|
|
2530
2530
|
isTma: i,
|
|
2531
2531
|
postEvent: a
|
|
2532
2532
|
}) {
|
|
@@ -2609,10 +2609,10 @@ class Hs {
|
|
|
2609
2609
|
* @see openFp
|
|
2610
2610
|
*/
|
|
2611
2611
|
e(this, "open");
|
|
2612
|
-
const
|
|
2612
|
+
const c = { version: t, requires: "web_app_open_scan_qr_popup", isTma: i }, o = E({ ...c, returns: "either" }), l = E({ ...c, returns: "task" }), _ = O(!1), F = () => {
|
|
2613
2613
|
_.set(!1);
|
|
2614
2614
|
};
|
|
2615
|
-
this.isSupported =
|
|
2615
|
+
this.isSupported = W("web_app_open_scan_qr_popup", t), this.isOpened = w(_), this.captureFp = l((f) => {
|
|
2616
2616
|
let v;
|
|
2617
2617
|
return p.pipe(
|
|
2618
2618
|
this.openFp({
|
|
@@ -2621,46 +2621,46 @@ class Hs {
|
|
|
2621
2621
|
f.capture(C) && (v = C, this.close());
|
|
2622
2622
|
}
|
|
2623
2623
|
}),
|
|
2624
|
-
|
|
2624
|
+
u.map(() => v)
|
|
2625
2625
|
);
|
|
2626
2626
|
}), this.closeFp = o(() => p.pipe(a("web_app_close_scan_qr_popup"), b.map(F))), this.openFp = l((f) => p.pipe(
|
|
2627
|
-
_() ?
|
|
2628
|
-
|
|
2627
|
+
_() ? u.left(new Be("The QR Scanner is already opened")) : async () => a("web_app_open_scan_qr_popup", { text: f.text }),
|
|
2628
|
+
u.chainW(() => {
|
|
2629
2629
|
_.set(!0);
|
|
2630
|
-
const [v, C] =
|
|
2630
|
+
const [v, C] = Ie(), k = (y) => (C(), _.set(!1), y);
|
|
2631
2631
|
return p.pipe(
|
|
2632
|
-
|
|
2632
|
+
Fe((y) => {
|
|
2633
2633
|
v(
|
|
2634
2634
|
// The scanner was closed externally.
|
|
2635
|
-
|
|
2635
|
+
r(y),
|
|
2636
2636
|
// The scanner was closed internally.
|
|
2637
2637
|
_.sub((m) => {
|
|
2638
2638
|
m || y();
|
|
2639
2639
|
}),
|
|
2640
|
-
|
|
2640
|
+
s(f.onCaptured)
|
|
2641
2641
|
);
|
|
2642
2642
|
}, f),
|
|
2643
|
-
|
|
2643
|
+
u.mapBoth(k, k)
|
|
2644
2644
|
);
|
|
2645
2645
|
})
|
|
2646
2646
|
)), this.open = /* @__PURE__ */ h(this.openFp), this.capture = /* @__PURE__ */ h(this.captureFp), this.close = /* @__PURE__ */ h(this.closeFp);
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
|
-
function
|
|
2650
|
-
return new
|
|
2649
|
+
function Ks() {
|
|
2650
|
+
return new zs({
|
|
2651
2651
|
...p.pipe(S(), V, I),
|
|
2652
|
-
onClosed(
|
|
2653
|
-
return G("scan_qr_popup_closed",
|
|
2652
|
+
onClosed(n) {
|
|
2653
|
+
return G("scan_qr_popup_closed", n);
|
|
2654
2654
|
},
|
|
2655
|
-
onTextReceived(
|
|
2655
|
+
onTextReceived(n) {
|
|
2656
2656
|
return G("qr_text_received", (t) => {
|
|
2657
|
-
|
|
2657
|
+
n(t.data);
|
|
2658
2658
|
});
|
|
2659
2659
|
}
|
|
2660
2660
|
});
|
|
2661
2661
|
}
|
|
2662
|
-
const
|
|
2663
|
-
class
|
|
2662
|
+
const _n = /* @__PURE__ */ Ks();
|
|
2663
|
+
class Ns {
|
|
2664
2664
|
constructor({}) {
|
|
2665
2665
|
/**
|
|
2666
2666
|
* Signal indicating if refresh is currently in progress.
|
|
@@ -2693,25 +2693,25 @@ class Ks {
|
|
|
2693
2693
|
G("refresh_requested", () => {
|
|
2694
2694
|
t.set(!0);
|
|
2695
2695
|
}), this.isRefreshing = w(t), this.finishRefreshFp = () => p.pipe(
|
|
2696
|
-
|
|
2697
|
-
|
|
2696
|
+
u.fromEither(ye("web_app_finish_refresh")),
|
|
2697
|
+
u.map(() => {
|
|
2698
2698
|
t.set(!1);
|
|
2699
2699
|
})
|
|
2700
|
-
), this.finishRefresh = () => this.finishRefreshFp()().then((
|
|
2701
|
-
if (
|
|
2702
|
-
throw
|
|
2703
|
-
return
|
|
2704
|
-
}), this.onRefreshRequest = (
|
|
2705
|
-
|
|
2700
|
+
), this.finishRefresh = () => this.finishRefreshFp()().then((s) => {
|
|
2701
|
+
if (s._tag === "Left")
|
|
2702
|
+
throw s.left;
|
|
2703
|
+
return s.right;
|
|
2704
|
+
}), this.onRefreshRequest = (r) => G("refresh_requested", () => {
|
|
2705
|
+
r();
|
|
2706
2706
|
});
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2710
|
-
return new
|
|
2709
|
+
function Qs() {
|
|
2710
|
+
return new Ns(p.pipe(S()));
|
|
2711
2711
|
}
|
|
2712
|
-
const
|
|
2713
|
-
class
|
|
2714
|
-
constructor({ defaults: t, ...
|
|
2712
|
+
const mn = /* @__PURE__ */ Qs();
|
|
2713
|
+
class Js {
|
|
2714
|
+
constructor({ defaults: t, ...r }) {
|
|
2715
2715
|
//#region Properties.
|
|
2716
2716
|
/**
|
|
2717
2717
|
* Signal indicating if the component is supported.
|
|
@@ -2934,8 +2934,8 @@ class Qs {
|
|
|
2934
2934
|
* @see offClick
|
|
2935
2935
|
*/
|
|
2936
2936
|
e(this, "offClick");
|
|
2937
|
-
const
|
|
2938
|
-
...
|
|
2937
|
+
const s = new fe({
|
|
2938
|
+
...r,
|
|
2939
2939
|
initialState: {
|
|
2940
2940
|
hasShineEffect: !1,
|
|
2941
2941
|
isEnabled: !0,
|
|
@@ -2955,34 +2955,34 @@ class Qs {
|
|
|
2955
2955
|
text_color: a.textColor,
|
|
2956
2956
|
position: a.position
|
|
2957
2957
|
})
|
|
2958
|
-
}), i = (a,
|
|
2959
|
-
const o =
|
|
2960
|
-
return w(() => o() || $(
|
|
2958
|
+
}), i = (a, c) => {
|
|
2959
|
+
const o = s.stateGetter(a);
|
|
2960
|
+
return w(() => o() || $(c));
|
|
2961
2961
|
};
|
|
2962
|
-
this.isSupported =
|
|
2962
|
+
this.isSupported = W("web_app_setup_secondary_button", r.version), this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.position = s.stateGetter("position"), this.hasShineEffect = s.stateGetter("hasShineEffect"), this.isEnabled = s.stateGetter("isEnabled"), this.isLoaderVisible = s.stateGetter("isLoaderVisible"), this.text = s.stateGetter("text"), this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.state = s.state, [this.setPosition, this.setPositionFp] = s.stateSetters("position"), [this.setBgColor, this.setBgColorFp] = s.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = s.stateSetters("textColor"), [
|
|
2963
2963
|
[this.disableShineEffect, this.disableShineEffectFp],
|
|
2964
2964
|
[this.enableShineEffect, this.enableShineEffectFp]
|
|
2965
|
-
] =
|
|
2965
|
+
] = s.stateBoolSetters("hasShineEffect"), [
|
|
2966
2966
|
[this.disable, this.disableFp],
|
|
2967
2967
|
[this.enable, this.enableFp]
|
|
2968
|
-
] =
|
|
2968
|
+
] = s.stateBoolSetters("isEnabled"), [
|
|
2969
2969
|
[this.hideLoader, this.hideLoaderFp],
|
|
2970
2970
|
[this.showLoader, this.showLoaderFp]
|
|
2971
|
-
] =
|
|
2971
|
+
] = s.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = s.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.setParams = s.setState, this.setParamsFp = s.setStateFp, this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
|
|
2972
2972
|
}
|
|
2973
2973
|
//#endregion
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2976
|
-
return new
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
bgColor: w(() =>
|
|
2979
|
-
textColor: w(() =>
|
|
2975
|
+
function Ys() {
|
|
2976
|
+
return new Js(
|
|
2977
|
+
/* @__PURE__ */ rt("secondaryButton", "secondary_button_pressed", {
|
|
2978
|
+
bgColor: w(() => Bs.bottomBarColorRgb() || "#000000"),
|
|
2979
|
+
textColor: w(() => he.buttonColor() || "#2481cc")
|
|
2980
2980
|
})
|
|
2981
2981
|
);
|
|
2982
2982
|
}
|
|
2983
|
-
const
|
|
2984
|
-
class
|
|
2985
|
-
constructor({ isTma: t, request:
|
|
2983
|
+
const bn = /* @__PURE__ */ Ys();
|
|
2984
|
+
class Zs {
|
|
2985
|
+
constructor({ isTma: t, request: r, version: s, createRequestId: i }) {
|
|
2986
2986
|
/**
|
|
2987
2987
|
* Retrieves an item using its key.
|
|
2988
2988
|
* @since Mini Apps v9.0
|
|
@@ -3029,50 +3029,50 @@ class Ys {
|
|
|
3029
3029
|
*/
|
|
3030
3030
|
e(this, "clear");
|
|
3031
3031
|
const a = E({
|
|
3032
|
-
version:
|
|
3032
|
+
version: s,
|
|
3033
3033
|
requires: "web_app_secure_storage_get_key",
|
|
3034
3034
|
isTma: t,
|
|
3035
3035
|
returns: "task"
|
|
3036
|
-
}),
|
|
3036
|
+
}), c = (o, l, _) => {
|
|
3037
3037
|
const F = i();
|
|
3038
3038
|
return p.pipe(
|
|
3039
|
-
|
|
3039
|
+
r(o, ["secure_storage_failed", l], {
|
|
3040
3040
|
params: { ..._, req_id: F },
|
|
3041
3041
|
capture: ((f) => "payload" in f ? f.payload.req_id === F : !0)
|
|
3042
3042
|
}),
|
|
3043
|
-
|
|
3043
|
+
u.chain((f) => f.event === "secure_storage_failed" ? u.left(new It(f.payload.error || "UNKNOWN_ERROR")) : u.right(f.payload))
|
|
3044
3044
|
);
|
|
3045
3045
|
};
|
|
3046
3046
|
this.getItemFp = a((o) => p.pipe(
|
|
3047
|
-
|
|
3048
|
-
|
|
3047
|
+
c("web_app_secure_storage_get_key", "secure_storage_key_received", { key: o }),
|
|
3048
|
+
u.map((l) => ({
|
|
3049
3049
|
value: l.value,
|
|
3050
3050
|
canRestore: !!l.can_restore
|
|
3051
3051
|
}))
|
|
3052
3052
|
)), this.setItemFp = a((o, l) => p.pipe(
|
|
3053
|
-
|
|
3054
|
-
|
|
3053
|
+
c("web_app_secure_storage_save_key", "secure_storage_key_saved", { key: o, value: l }),
|
|
3054
|
+
u.map(() => {
|
|
3055
3055
|
})
|
|
3056
3056
|
)), this.deleteItemFp = a((o) => this.setItemFp(o, null)), this.clearFp = a(() => p.pipe(
|
|
3057
|
-
|
|
3058
|
-
|
|
3057
|
+
c("web_app_secure_storage_clear", "secure_storage_cleared", {}),
|
|
3058
|
+
u.map(() => {
|
|
3059
3059
|
})
|
|
3060
3060
|
)), this.restoreItemFp = a((o) => p.pipe(
|
|
3061
|
-
|
|
3062
|
-
|
|
3061
|
+
c("web_app_secure_storage_restore_key", "secure_storage_key_restored", { key: o }),
|
|
3062
|
+
u.map((l) => l.value)
|
|
3063
3063
|
)), 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);
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
|
-
function
|
|
3067
|
-
return new
|
|
3066
|
+
function Xs() {
|
|
3067
|
+
return new Zs(p.pipe(
|
|
3068
3068
|
S(),
|
|
3069
3069
|
I,
|
|
3070
3070
|
R,
|
|
3071
|
-
|
|
3071
|
+
et
|
|
3072
3072
|
));
|
|
3073
3073
|
}
|
|
3074
|
-
const
|
|
3075
|
-
class
|
|
3074
|
+
const gn = /* @__PURE__ */ Xs();
|
|
3075
|
+
class er {
|
|
3076
3076
|
constructor(t) {
|
|
3077
3077
|
/**
|
|
3078
3078
|
* Signal indicating if the component is currently visible.
|
|
@@ -3155,20 +3155,20 @@ class Xs {
|
|
|
3155
3155
|
* @see onClick
|
|
3156
3156
|
*/
|
|
3157
3157
|
e(this, "unmount");
|
|
3158
|
-
const
|
|
3158
|
+
const r = new fe({
|
|
3159
3159
|
...t,
|
|
3160
3160
|
method: "web_app_setup_settings_button",
|
|
3161
|
-
payload: (
|
|
3161
|
+
payload: (s) => ({ is_visible: s.isVisible }),
|
|
3162
3162
|
initialState: { isVisible: !1 }
|
|
3163
3163
|
});
|
|
3164
|
-
this.isVisible =
|
|
3164
|
+
this.isVisible = r.stateGetter("isVisible"), this.isMounted = r.isMounted, this.isSupported = r.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = r.stateBoolSetters("isVisible"), this.onClick = r.onClick, this.onClickFp = r.onClickFp, this.offClick = r.offClick, this.offClickFp = r.offClickFp, this.mount = r.mount, this.mountFp = r.mountFp, this.unmount = r.unmount;
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
-
const
|
|
3167
|
+
const Fn = /* @__PURE__ */ new er(
|
|
3168
3168
|
/* @__PURE__ */ Ae("settingsButton", "settings_button_pressed")
|
|
3169
3169
|
);
|
|
3170
|
-
class
|
|
3171
|
-
constructor({ postEvent: t, storage:
|
|
3170
|
+
class tr {
|
|
3171
|
+
constructor({ postEvent: t, storage: r, isTma: s, isPageReload: i, version: a }) {
|
|
3172
3172
|
/**
|
|
3173
3173
|
* Signal indicating if the component is supported.
|
|
3174
3174
|
*/
|
|
@@ -3212,17 +3212,17 @@ class er {
|
|
|
3212
3212
|
* @see enableVerticalFp
|
|
3213
3213
|
*/
|
|
3214
3214
|
e(this, "enableVertical");
|
|
3215
|
-
const
|
|
3216
|
-
initialState:
|
|
3215
|
+
const c = { isVerticalEnabled: !0 }, o = new J({
|
|
3216
|
+
initialState: c,
|
|
3217
3217
|
onChange(C) {
|
|
3218
|
-
|
|
3218
|
+
r.set(C);
|
|
3219
3219
|
}
|
|
3220
3220
|
}), l = new ne({
|
|
3221
|
-
initialState:
|
|
3221
|
+
initialState: c,
|
|
3222
3222
|
isPageReload: i,
|
|
3223
3223
|
onMounted: o.setState,
|
|
3224
|
-
restoreState:
|
|
3225
|
-
}), _ = { requires: "web_app_setup_swipe_behavior", isTma:
|
|
3224
|
+
restoreState: r.get
|
|
3225
|
+
}), _ = { requires: "web_app_setup_swipe_behavior", isTma: s, version: a }, F = E({
|
|
3226
3226
|
..._,
|
|
3227
3227
|
returns: "plain"
|
|
3228
3228
|
}), f = E({
|
|
@@ -3238,216 +3238,216 @@ class er {
|
|
|
3238
3238
|
})
|
|
3239
3239
|
) : b.right(void 0);
|
|
3240
3240
|
};
|
|
3241
|
-
this.isSupported =
|
|
3241
|
+
this.isSupported = W("web_app_setup_swipe_behavior", a), this.isVerticalEnabled = o.getter("isVerticalEnabled"), this.isMounted = l.isMounted, this.disableVerticalFp = f(() => v(!1)), this.enableVerticalFp = f(() => v(!0)), this.mountFp = F(() => {
|
|
3242
3242
|
const C = () => {
|
|
3243
3243
|
};
|
|
3244
3244
|
return p.pipe(l.mount(), b.match(C, C));
|
|
3245
3245
|
}), this.unmount = l.unmount, this.disableVertical = /* @__PURE__ */ h(this.disableVerticalFp), this.enableVertical = /* @__PURE__ */ h(this.enableVerticalFp), this.mount = /* @__PURE__ */ h(this.mountFp);
|
|
3246
3246
|
}
|
|
3247
3247
|
}
|
|
3248
|
-
function
|
|
3249
|
-
return new
|
|
3248
|
+
function sr() {
|
|
3249
|
+
return new tr(p.pipe(
|
|
3250
3250
|
S(),
|
|
3251
3251
|
V,
|
|
3252
3252
|
I,
|
|
3253
3253
|
Y("swipeBehavior")
|
|
3254
3254
|
));
|
|
3255
3255
|
}
|
|
3256
|
-
const
|
|
3257
|
-
async function
|
|
3256
|
+
const wn = /* @__PURE__ */ sr();
|
|
3257
|
+
async function Cn(n) {
|
|
3258
3258
|
try {
|
|
3259
|
-
const { clipboard:
|
|
3260
|
-
if (
|
|
3261
|
-
return await
|
|
3259
|
+
const { clipboard: r } = navigator;
|
|
3260
|
+
if (r)
|
|
3261
|
+
return await r.writeText(n);
|
|
3262
3262
|
} catch {
|
|
3263
3263
|
}
|
|
3264
3264
|
const t = document.createElement("textarea");
|
|
3265
|
-
t.value =
|
|
3265
|
+
t.value = n, t.style.top = "0", t.style.left = "0", t.style.position = "fixed", document.body.appendChild(t), t.focus(), t.select();
|
|
3266
3266
|
try {
|
|
3267
3267
|
document.execCommand("copy");
|
|
3268
3268
|
} finally {
|
|
3269
3269
|
document.body.removeChild(t);
|
|
3270
3270
|
}
|
|
3271
3271
|
}
|
|
3272
|
-
function
|
|
3273
|
-
return
|
|
3274
|
-
|
|
3272
|
+
function rr({ request: n, ...t }) {
|
|
3273
|
+
return B((r, s, i) => p.pipe(
|
|
3274
|
+
n(
|
|
3275
3275
|
"web_app_request_file_download",
|
|
3276
3276
|
"file_download_requested",
|
|
3277
|
-
{ ...i, params: { url:
|
|
3277
|
+
{ ...i, params: { url: r, file_name: s } }
|
|
3278
3278
|
),
|
|
3279
|
-
|
|
3279
|
+
u.chain((a) => a.status === "downloading" ? u.right(void 0) : u.left(new Ye("User denied the action")))
|
|
3280
3280
|
), { ...t, requires: "web_app_request_file_download", returns: "task" });
|
|
3281
3281
|
}
|
|
3282
3282
|
// @__NO_SIDE_EFFECTS__
|
|
3283
|
-
function
|
|
3284
|
-
return
|
|
3283
|
+
function nr() {
|
|
3284
|
+
return rr(p.pipe(
|
|
3285
3285
|
S(),
|
|
3286
3286
|
R,
|
|
3287
3287
|
I
|
|
3288
3288
|
));
|
|
3289
3289
|
}
|
|
3290
|
-
const
|
|
3291
|
-
function
|
|
3292
|
-
return
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
const i =
|
|
3296
|
-
|
|
3297
|
-
|
|
3290
|
+
const ir = /* @__PURE__ */ nr(), Sn = /* @__PURE__ */ h(ir);
|
|
3291
|
+
function or({ invokeCustomMethod: n, ...t }) {
|
|
3292
|
+
return B((r) => p.pipe(
|
|
3293
|
+
n("getCurrentTime", {}, r),
|
|
3294
|
+
u.chain((s) => {
|
|
3295
|
+
const i = we(
|
|
3296
|
+
Ke(Je(), kt(), Ne((a) => new Date(a * 1e3)), Qe()),
|
|
3297
|
+
s
|
|
3298
3298
|
);
|
|
3299
|
-
return i.success ?
|
|
3299
|
+
return i.success ? u.right(i.output) : u.left(new ce(s, i.issues));
|
|
3300
3300
|
})
|
|
3301
3301
|
), { ...t, requires: "web_app_invoke_custom_method", returns: "task" });
|
|
3302
3302
|
}
|
|
3303
3303
|
// @__NO_SIDE_EFFECTS__
|
|
3304
|
-
function
|
|
3305
|
-
return
|
|
3304
|
+
function ar() {
|
|
3305
|
+
return or(p.pipe(
|
|
3306
3306
|
S(),
|
|
3307
|
-
|
|
3307
|
+
Ve,
|
|
3308
3308
|
I
|
|
3309
3309
|
));
|
|
3310
3310
|
}
|
|
3311
|
-
const
|
|
3312
|
-
function
|
|
3313
|
-
return
|
|
3311
|
+
const pr = /* @__PURE__ */ ar(), vn = /* @__PURE__ */ h(pr);
|
|
3312
|
+
function cr({ postEvent: n, ...t }) {
|
|
3313
|
+
return B(() => n("web_app_hide_keyboard"), { ...t, returns: "either", requires: "web_app_hide_keyboard" });
|
|
3314
3314
|
}
|
|
3315
3315
|
// @__NO_SIDE_EFFECTS__
|
|
3316
3316
|
function ur() {
|
|
3317
|
-
return
|
|
3317
|
+
return cr(p.pipe(
|
|
3318
3318
|
S(),
|
|
3319
3319
|
V,
|
|
3320
3320
|
I
|
|
3321
3321
|
));
|
|
3322
3322
|
}
|
|
3323
|
-
const
|
|
3324
|
-
function
|
|
3325
|
-
return
|
|
3323
|
+
const lr = /* @__PURE__ */ ur(), kn = /* @__PURE__ */ h(lr);
|
|
3324
|
+
function hr({ request: n, createRequestId: t, ...r }) {
|
|
3325
|
+
return B((s) => {
|
|
3326
3326
|
const i = t();
|
|
3327
3327
|
return p.pipe(
|
|
3328
|
-
|
|
3329
|
-
...
|
|
3328
|
+
n("web_app_read_text_from_clipboard", "clipboard_text_received", {
|
|
3329
|
+
...s,
|
|
3330
3330
|
params: { req_id: i },
|
|
3331
|
-
capture:
|
|
3331
|
+
capture: ft(i)
|
|
3332
3332
|
}),
|
|
3333
|
-
|
|
3333
|
+
u.map(({ data: a = null }) => a)
|
|
3334
3334
|
);
|
|
3335
|
-
}, { ...
|
|
3335
|
+
}, { ...r, requires: "web_app_read_text_from_clipboard", returns: "task" });
|
|
3336
3336
|
}
|
|
3337
3337
|
// @__NO_SIDE_EFFECTS__
|
|
3338
|
-
function
|
|
3339
|
-
return
|
|
3338
|
+
function dr() {
|
|
3339
|
+
return hr({
|
|
3340
3340
|
...p.pipe(
|
|
3341
3341
|
S(),
|
|
3342
3342
|
I,
|
|
3343
3343
|
R
|
|
3344
3344
|
),
|
|
3345
|
-
createRequestId:
|
|
3345
|
+
createRequestId: Me
|
|
3346
3346
|
});
|
|
3347
3347
|
}
|
|
3348
|
-
const
|
|
3349
|
-
function
|
|
3350
|
-
const t = {},
|
|
3351
|
-
if (
|
|
3352
|
-
const [,
|
|
3353
|
-
|
|
3354
|
-
const [
|
|
3355
|
-
if (
|
|
3348
|
+
const fr = /* @__PURE__ */ dr(), yn = /* @__PURE__ */ h(fr);
|
|
3349
|
+
function _r(n) {
|
|
3350
|
+
const t = {}, r = n.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
|
|
3351
|
+
if (r) {
|
|
3352
|
+
const [, s, i] = r;
|
|
3353
|
+
s && (t.appVersion = s), i && i.slice(1, i.length - 1).split(";").forEach((a) => {
|
|
3354
|
+
const [c, o] = a.trim().split(" ");
|
|
3355
|
+
if (c === "Android")
|
|
3356
3356
|
t.androidVersion = o;
|
|
3357
|
-
else if (
|
|
3357
|
+
else if (c === "SDK") {
|
|
3358
3358
|
const l = parseInt(o, 10);
|
|
3359
3359
|
l && (t.sdkVersion = l);
|
|
3360
|
-
} else o ? (t.manufacturer =
|
|
3360
|
+
} else o ? (t.manufacturer = c, t.model = o) : t.performanceClass = c;
|
|
3361
3361
|
});
|
|
3362
3362
|
}
|
|
3363
3363
|
return t;
|
|
3364
3364
|
}
|
|
3365
|
-
function
|
|
3366
|
-
return
|
|
3365
|
+
function In() {
|
|
3366
|
+
return _r(navigator.userAgent);
|
|
3367
3367
|
}
|
|
3368
|
-
function
|
|
3369
|
-
return
|
|
3370
|
-
const { size:
|
|
3371
|
-
return !
|
|
3372
|
-
new
|
|
3373
|
-
) :
|
|
3368
|
+
function mr({ postEvent: n, ...t }) {
|
|
3369
|
+
return B((r) => {
|
|
3370
|
+
const { size: s } = new Blob([r]);
|
|
3371
|
+
return !s || s > 4096 ? b.left(
|
|
3372
|
+
new U(s ? "Maximum size of data to send is 4096 bytes" : "Attempted to send empty data")
|
|
3373
|
+
) : n("web_app_data_send", { data: r });
|
|
3374
3374
|
}, { ...t, returns: "either" });
|
|
3375
3375
|
}
|
|
3376
3376
|
// @__NO_SIDE_EFFECTS__
|
|
3377
|
-
function
|
|
3378
|
-
return
|
|
3377
|
+
function br() {
|
|
3378
|
+
return mr(p.pipe(S(), V));
|
|
3379
3379
|
}
|
|
3380
|
-
const
|
|
3381
|
-
function
|
|
3382
|
-
return
|
|
3383
|
-
|
|
3380
|
+
const gr = /* @__PURE__ */ br(), En = /* @__PURE__ */ h(gr);
|
|
3381
|
+
function Fr({ request: n, ...t }) {
|
|
3382
|
+
return B((r, s) => p.pipe(
|
|
3383
|
+
n(
|
|
3384
3384
|
"web_app_send_prepared_message",
|
|
3385
3385
|
["prepared_message_failed", "prepared_message_sent"],
|
|
3386
3386
|
{
|
|
3387
|
-
...
|
|
3388
|
-
params: { id:
|
|
3387
|
+
...s,
|
|
3388
|
+
params: { id: r }
|
|
3389
3389
|
}
|
|
3390
3390
|
),
|
|
3391
|
-
|
|
3391
|
+
u.chain((i) => i.event === "prepared_message_failed" ? u.left(new xt(i.payload.error)) : u.right(void 0))
|
|
3392
3392
|
), { ...t, requires: "web_app_send_prepared_message", returns: "task" });
|
|
3393
3393
|
}
|
|
3394
3394
|
// @__NO_SIDE_EFFECTS__
|
|
3395
|
-
function
|
|
3396
|
-
return
|
|
3395
|
+
function wr() {
|
|
3396
|
+
return Fr(p.pipe(
|
|
3397
3397
|
S(),
|
|
3398
3398
|
R,
|
|
3399
3399
|
I
|
|
3400
3400
|
));
|
|
3401
3401
|
}
|
|
3402
|
-
const
|
|
3403
|
-
function
|
|
3404
|
-
return
|
|
3405
|
-
text:
|
|
3406
|
-
media_url:
|
|
3407
|
-
widget_link:
|
|
3402
|
+
const Cr = /* @__PURE__ */ wr(), qn = /* @__PURE__ */ h(Cr);
|
|
3403
|
+
function Sr({ postEvent: n, ...t }) {
|
|
3404
|
+
return B((r, s = {}) => n("web_app_share_to_story", {
|
|
3405
|
+
text: s.text,
|
|
3406
|
+
media_url: r,
|
|
3407
|
+
widget_link: s.widgetLink
|
|
3408
3408
|
}), { ...t, requires: "web_app_share_to_story", returns: "either" });
|
|
3409
3409
|
}
|
|
3410
3410
|
// @__NO_SIDE_EFFECTS__
|
|
3411
|
-
function
|
|
3412
|
-
return
|
|
3411
|
+
function vr() {
|
|
3412
|
+
return Sr(p.pipe(
|
|
3413
3413
|
S(),
|
|
3414
3414
|
V,
|
|
3415
3415
|
I
|
|
3416
3416
|
));
|
|
3417
3417
|
}
|
|
3418
|
-
const
|
|
3419
|
-
function
|
|
3420
|
-
return
|
|
3421
|
-
query:
|
|
3418
|
+
const kr = /* @__PURE__ */ vr(), Bn = /* @__PURE__ */ h(kr), ke = /* @__PURE__ */ ie(!1);
|
|
3419
|
+
function yr({ isInlineMode: n, postEvent: t, ...r }) {
|
|
3420
|
+
return B((s, i) => t("web_app_switch_inline_query", {
|
|
3421
|
+
query: s,
|
|
3422
3422
|
chat_types: i || []
|
|
3423
3423
|
}), {
|
|
3424
|
-
...
|
|
3424
|
+
...r,
|
|
3425
3425
|
requires: {
|
|
3426
|
-
every: ["web_app_switch_inline_query", () => $(
|
|
3426
|
+
every: ["web_app_switch_inline_query", () => $(n) ? void 0 : "The application must be launched in the inline mode"]
|
|
3427
3427
|
},
|
|
3428
3428
|
returns: "either"
|
|
3429
3429
|
});
|
|
3430
3430
|
}
|
|
3431
3431
|
// @__NO_SIDE_EFFECTS__
|
|
3432
|
-
function
|
|
3433
|
-
return
|
|
3432
|
+
function Ir() {
|
|
3433
|
+
return yr({
|
|
3434
3434
|
...p.pipe(
|
|
3435
3435
|
S(),
|
|
3436
3436
|
V,
|
|
3437
3437
|
I
|
|
3438
3438
|
),
|
|
3439
|
-
isInlineMode:
|
|
3439
|
+
isInlineMode: ke
|
|
3440
3440
|
});
|
|
3441
3441
|
}
|
|
3442
|
-
const
|
|
3443
|
-
class
|
|
3442
|
+
const Er = /* @__PURE__ */ Ir(), An = /* @__PURE__ */ h(Er);
|
|
3443
|
+
class qr {
|
|
3444
3444
|
constructor({
|
|
3445
3445
|
storage: t,
|
|
3446
|
-
isPageReload:
|
|
3447
|
-
onContentSafeAreaInsetsChanged:
|
|
3446
|
+
isPageReload: r,
|
|
3447
|
+
onContentSafeAreaInsetsChanged: s,
|
|
3448
3448
|
onSafeAreaInsetsChanged: i,
|
|
3449
3449
|
onViewportChanged: a,
|
|
3450
|
-
onFullscreenChanged:
|
|
3450
|
+
onFullscreenChanged: c,
|
|
3451
3451
|
offContentSafeAreaInsetsChanged: o,
|
|
3452
3452
|
offFullscreenChanged: l,
|
|
3453
3453
|
offSafeAreaInsetsChanged: _,
|
|
@@ -3657,7 +3657,7 @@ class Er {
|
|
|
3657
3657
|
width: 0
|
|
3658
3658
|
},
|
|
3659
3659
|
onChange: t.set
|
|
3660
|
-
}),
|
|
3660
|
+
}), A = (q) => {
|
|
3661
3661
|
d.setState({
|
|
3662
3662
|
isExpanded: q.is_expanded,
|
|
3663
3663
|
height: q.height,
|
|
@@ -3670,19 +3670,19 @@ class Er {
|
|
|
3670
3670
|
d.setState({ safeAreaInsets: q });
|
|
3671
3671
|
}, P = (q) => {
|
|
3672
3672
|
d.setState({ contentSafeAreaInsets: q });
|
|
3673
|
-
}, L = new
|
|
3673
|
+
}, L = new xe({
|
|
3674
3674
|
initialState(q) {
|
|
3675
3675
|
const Z = (z) => () => {
|
|
3676
3676
|
const [Q, D] = z === "safe-area" ? ["web_app_request_safe_area", "safe_area_changed"] : ["web_app_request_content_safe_area", "content_safe_area_changed"];
|
|
3677
|
-
return ee(Q, $(y)) ? f(Q, D, q) :
|
|
3678
|
-
}, x = (z) => () => typeof z == "boolean" ?
|
|
3677
|
+
return ee(Q, $(y)) ? f(Q, D, q) : u.right({ top: 0, left: 0, right: 0, bottom: 0 });
|
|
3678
|
+
}, x = (z) => () => typeof z == "boolean" ? u.right(z) : u.fromEither(z());
|
|
3679
3679
|
return p.pipe(
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3680
|
+
u.Do,
|
|
3681
|
+
u.bindW("safeAreaInsets", Z("safe-area")),
|
|
3682
|
+
u.bindW("contentSafeAreaInsets", Z("content-safe-area")),
|
|
3683
|
+
u.bindW("isFullscreen", x(C)),
|
|
3684
|
+
u.bindW("isViewportStable", x(v)),
|
|
3685
|
+
u.chainW(({ isViewportStable: z, ...Q }) => z ? u.right({
|
|
3686
3686
|
...Q,
|
|
3687
3687
|
height: window.innerHeight,
|
|
3688
3688
|
isExpanded: !0,
|
|
@@ -3690,7 +3690,7 @@ class Er {
|
|
|
3690
3690
|
width: window.innerWidth
|
|
3691
3691
|
}) : p.pipe(
|
|
3692
3692
|
f("web_app_request_viewport", "viewport_changed", q),
|
|
3693
|
-
|
|
3693
|
+
u.map((D) => ({
|
|
3694
3694
|
...Q,
|
|
3695
3695
|
height: D.height,
|
|
3696
3696
|
isExpanded: D.is_expanded,
|
|
@@ -3700,40 +3700,40 @@ class Er {
|
|
|
3700
3700
|
))
|
|
3701
3701
|
);
|
|
3702
3702
|
},
|
|
3703
|
-
isPageReload:
|
|
3703
|
+
isPageReload: r,
|
|
3704
3704
|
onMounted(q) {
|
|
3705
|
-
a(
|
|
3705
|
+
a(A), c(T), i(M), s(P), d.setState(q);
|
|
3706
3706
|
},
|
|
3707
3707
|
onUnmounted() {
|
|
3708
|
-
F(
|
|
3708
|
+
F(A), l(T), _(M), o(P);
|
|
3709
3709
|
},
|
|
3710
3710
|
restoreState: t.get
|
|
3711
|
-
}),
|
|
3712
|
-
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 =
|
|
3713
|
-
const
|
|
3711
|
+
}), H = (q) => w(() => this.safeAreaInsets()[q]), oe = (q) => w(() => this.contentSafeAreaInsets()[q]);
|
|
3712
|
+
this.state = d.state, this.height = d.getter("height"), this.stableHeight = d.getter("stableHeight"), this.width = d.getter("width"), this.isExpanded = d.getter("isExpanded"), this.safeAreaInsets = d.getter("safeAreaInsets"), this.safeAreaInsetTop = H("top"), this.safeAreaInsetBottom = H("bottom"), this.safeAreaInsetLeft = H("left"), this.safeAreaInsetRight = H("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = oe("top"), this.contentSafeAreaInsetBottom = oe("bottom"), this.contentSafeAreaInsetLeft = oe("left"), this.contentSafeAreaInsetRight = oe("right");
|
|
3713
|
+
const ot = E({ isTma: k, returns: "task" }), Le = E({
|
|
3714
3714
|
isTma: k,
|
|
3715
3715
|
returns: "either"
|
|
3716
|
-
}),
|
|
3716
|
+
}), at = E({
|
|
3717
3717
|
isTma: k,
|
|
3718
3718
|
requires: "web_app_request_fullscreen",
|
|
3719
3719
|
version: y,
|
|
3720
3720
|
returns: "task"
|
|
3721
|
-
}),
|
|
3721
|
+
}), $e = (q) => at((Z) => p.pipe(
|
|
3722
3722
|
f(
|
|
3723
3723
|
q ? "web_app_request_fullscreen" : "web_app_exit_fullscreen",
|
|
3724
3724
|
["fullscreen_changed", "fullscreen_failed"],
|
|
3725
3725
|
Z
|
|
3726
3726
|
),
|
|
3727
|
-
|
|
3727
|
+
u.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? u.left(new At(x.payload.error)) : (d.setState({
|
|
3728
3728
|
isFullscreen: "is_fullscreen" in x.payload ? x.payload.is_fullscreen : !0
|
|
3729
|
-
}),
|
|
3729
|
+
}), u.right(void 0)))
|
|
3730
3730
|
));
|
|
3731
|
-
this.isMounted = L.isMounted, this.mountFp =
|
|
3731
|
+
this.isMounted = L.isMounted, this.mountFp = ot(L.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = $e(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = $e(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
|
|
3732
3732
|
const ae = O(!1);
|
|
3733
|
-
this.isCssVarsBound = w(ae), this.bindCssVarsFp =
|
|
3733
|
+
this.isCssVarsBound = w(ae), this.bindCssVarsFp = Le(
|
|
3734
3734
|
(q) => {
|
|
3735
3735
|
if (ae())
|
|
3736
|
-
return b.left(new
|
|
3736
|
+
return b.left(new qe());
|
|
3737
3737
|
q || (q = (x) => `--vb-viewport-${We(x)}`);
|
|
3738
3738
|
const Z = [
|
|
3739
3739
|
["height", this.height],
|
|
@@ -3750,10 +3750,10 @@ class Er {
|
|
|
3750
3750
|
].reduce((x, [z, Q]) => {
|
|
3751
3751
|
const D = q(z);
|
|
3752
3752
|
if (D) {
|
|
3753
|
-
const
|
|
3754
|
-
|
|
3753
|
+
const Pe = () => {
|
|
3754
|
+
Te(D, `${Q()}px`);
|
|
3755
3755
|
};
|
|
3756
|
-
x.push({ update:
|
|
3756
|
+
x.push({ update: Pe, removeListener: Q.sub(Pe), cssVar: D });
|
|
3757
3757
|
}
|
|
3758
3758
|
return x;
|
|
3759
3759
|
}, []);
|
|
@@ -3761,24 +3761,24 @@ class Er {
|
|
|
3761
3761
|
x.update();
|
|
3762
3762
|
}), ae.set(!0), b.right(() => {
|
|
3763
3763
|
Z.forEach((x) => {
|
|
3764
|
-
x.removeListener(),
|
|
3764
|
+
x.removeListener(), Re(x.cssVar);
|
|
3765
3765
|
}), ae.set(!1);
|
|
3766
3766
|
});
|
|
3767
3767
|
}
|
|
3768
|
-
), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp =
|
|
3768
|
+
), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Le(() => m("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
|
|
3769
3769
|
}
|
|
3770
3770
|
//#endregion
|
|
3771
3771
|
}
|
|
3772
|
-
function
|
|
3773
|
-
const
|
|
3774
|
-
on: (
|
|
3775
|
-
G(a,
|
|
3772
|
+
function Br() {
|
|
3773
|
+
const n = (a) => ({
|
|
3774
|
+
on: (c) => {
|
|
3775
|
+
G(a, c);
|
|
3776
3776
|
},
|
|
3777
|
-
off: (
|
|
3778
|
-
re(a,
|
|
3777
|
+
off: (c) => {
|
|
3778
|
+
re(a, c);
|
|
3779
3779
|
}
|
|
3780
|
-
}), t =
|
|
3781
|
-
return new
|
|
3780
|
+
}), t = n("viewport_changed"), r = n("fullscreen_changed"), s = n("safe_area_changed"), i = n("content_safe_area_changed");
|
|
3781
|
+
return new qr({
|
|
3782
3782
|
...p.pipe(
|
|
3783
3783
|
S(),
|
|
3784
3784
|
Y("viewport"),
|
|
@@ -3787,22 +3787,22 @@ function qr() {
|
|
|
3787
3787
|
R
|
|
3788
3788
|
),
|
|
3789
3789
|
isFullscreen() {
|
|
3790
|
-
return p.pipe(
|
|
3790
|
+
return p.pipe(le(), b.map((a) => !!a.vbWebAppFullscreen));
|
|
3791
3791
|
},
|
|
3792
3792
|
isViewportStable() {
|
|
3793
|
-
return p.pipe(
|
|
3793
|
+
return p.pipe(le(), b.map((a) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(a.vbWebAppPlatform)));
|
|
3794
3794
|
},
|
|
3795
3795
|
offContentSafeAreaInsetsChanged: i.off,
|
|
3796
|
-
offFullscreenChanged:
|
|
3797
|
-
offSafeAreaInsetsChanged:
|
|
3796
|
+
offFullscreenChanged: r.off,
|
|
3797
|
+
offSafeAreaInsetsChanged: s.off,
|
|
3798
3798
|
offViewportChanged: t.off,
|
|
3799
3799
|
onContentSafeAreaInsetsChanged: i.on,
|
|
3800
|
-
onFullscreenChanged:
|
|
3801
|
-
onSafeAreaInsetsChanged:
|
|
3800
|
+
onFullscreenChanged: r.on,
|
|
3801
|
+
onSafeAreaInsetsChanged: s.on,
|
|
3802
3802
|
onViewportChanged: t.on
|
|
3803
3803
|
});
|
|
3804
3804
|
}
|
|
3805
|
-
const
|
|
3805
|
+
const xn = /* @__PURE__ */ Br();
|
|
3806
3806
|
class Ar {
|
|
3807
3807
|
constructor({ request: t }) {
|
|
3808
3808
|
/**
|
|
@@ -3830,19 +3830,19 @@ class Ar {
|
|
|
3830
3830
|
* Convenience method to select a folder.
|
|
3831
3831
|
*/
|
|
3832
3832
|
e(this, "selectFolder");
|
|
3833
|
-
this.requestAccessFp = (
|
|
3833
|
+
this.requestAccessFp = (r) => p.pipe(
|
|
3834
3834
|
t("web_app_request_storage_access", "storage_access_granted", {
|
|
3835
3835
|
params: {
|
|
3836
|
-
access_type:
|
|
3837
|
-
multiple:
|
|
3838
|
-
accept:
|
|
3839
|
-
max_file_size:
|
|
3840
|
-
read_content:
|
|
3836
|
+
access_type: r.accessType,
|
|
3837
|
+
multiple: r.multiple,
|
|
3838
|
+
accept: r.accept,
|
|
3839
|
+
max_file_size: r.maxFileSize,
|
|
3840
|
+
read_content: r.readContent
|
|
3841
3841
|
}
|
|
3842
3842
|
}),
|
|
3843
|
-
|
|
3844
|
-
accessType:
|
|
3845
|
-
items:
|
|
3843
|
+
u.map((s) => ({
|
|
3844
|
+
accessType: s.access_type,
|
|
3845
|
+
items: s.items.map((i) => ({
|
|
3846
3846
|
name: i.name,
|
|
3847
3847
|
path: i.path,
|
|
3848
3848
|
size: i.size,
|
|
@@ -3851,54 +3851,87 @@ class Ar {
|
|
|
3851
3851
|
lastModified: i.last_modified
|
|
3852
3852
|
}))
|
|
3853
3853
|
}))
|
|
3854
|
-
), this.requestAccess = (
|
|
3854
|
+
), this.requestAccess = (r) => this.requestAccessFp(r)().then((i) => {
|
|
3855
3855
|
if (i._tag === "Left")
|
|
3856
3856
|
throw i.left;
|
|
3857
3857
|
return i.right;
|
|
3858
|
-
}), this.selectFile = (
|
|
3858
|
+
}), this.selectFile = (r) => this.requestAccess({
|
|
3859
3859
|
accessType: "file",
|
|
3860
3860
|
multiple: !1,
|
|
3861
|
-
...
|
|
3862
|
-
}), this.selectFiles = (
|
|
3861
|
+
...r
|
|
3862
|
+
}), this.selectFiles = (r) => this.requestAccess({
|
|
3863
3863
|
accessType: "file",
|
|
3864
3864
|
multiple: !0,
|
|
3865
|
-
...
|
|
3865
|
+
...r
|
|
3866
3866
|
}), this.selectFolder = () => this.requestAccess({
|
|
3867
3867
|
accessType: "folder"
|
|
3868
3868
|
});
|
|
3869
3869
|
}
|
|
3870
3870
|
}
|
|
3871
|
-
function
|
|
3871
|
+
function xr() {
|
|
3872
3872
|
return new Ar({
|
|
3873
|
-
request:
|
|
3873
|
+
request: He
|
|
3874
3874
|
});
|
|
3875
3875
|
}
|
|
3876
|
-
const
|
|
3877
|
-
|
|
3876
|
+
const Mn = /* @__PURE__ */ xr();
|
|
3877
|
+
class Vn {
|
|
3878
|
+
/**
|
|
3879
|
+
* Sets the theme params of the Mini App.
|
|
3880
|
+
* Sends 'theme_changed' event to the Mini App.
|
|
3881
|
+
*/
|
|
3882
|
+
static setTheme(t) {
|
|
3883
|
+
pe().send("theme_changed", { theme_params: t });
|
|
3884
|
+
}
|
|
3885
|
+
/**
|
|
3886
|
+
* Listens to 'web_app_set_background_color' method call from Mini App.
|
|
3887
|
+
*/
|
|
3888
|
+
static onBackgroundColorChange(t) {
|
|
3889
|
+
return pe().on("web_app_set_background_color", (s) => {
|
|
3890
|
+
s && typeof s.color == "string" && t(s.color);
|
|
3891
|
+
});
|
|
3892
|
+
}
|
|
3893
|
+
/**
|
|
3894
|
+
* Listens to 'web_app_set_header_color' method call from Mini App.
|
|
3895
|
+
*/
|
|
3896
|
+
static onHeaderColorChange(t) {
|
|
3897
|
+
return pe().on("web_app_set_header_color", (s) => {
|
|
3898
|
+
s && ("color_key" in s && s.color_key ? t(s.color_key) : "color" in s && s.color && t(s.color));
|
|
3899
|
+
});
|
|
3900
|
+
}
|
|
3901
|
+
/**
|
|
3902
|
+
* Listens to 'web_app_set_bottom_bar_color' method call from Mini App.
|
|
3903
|
+
*/
|
|
3904
|
+
static onBottomBarColorChange(t) {
|
|
3905
|
+
return pe().on("web_app_set_bottom_bar_color", (s) => {
|
|
3906
|
+
s && s.color && t(s.color);
|
|
3907
|
+
});
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
function Mr(n = {}) {
|
|
3878
3911
|
const {
|
|
3879
3912
|
version: t,
|
|
3880
|
-
isInlineMode:
|
|
3881
|
-
themeParams:
|
|
3882
|
-
} =
|
|
3883
|
-
if (t && typeof
|
|
3884
|
-
|
|
3913
|
+
isInlineMode: r,
|
|
3914
|
+
themeParams: s
|
|
3915
|
+
} = n;
|
|
3916
|
+
if (t && typeof r == "boolean" && s)
|
|
3917
|
+
Se.set(t), ke.set(r), ve.set(s);
|
|
3885
3918
|
else {
|
|
3886
|
-
const o = p.pipe(
|
|
3919
|
+
const o = p.pipe(le(), b.matchW(
|
|
3887
3920
|
(l) => l,
|
|
3888
3921
|
(l) => {
|
|
3889
|
-
|
|
3922
|
+
Se.set(t || l.vbWebAppVersion), ke.set(typeof r == "boolean" ? r : !!l.vbWebAppBotInline), ve.set(s || l.vbWebAppThemeParams);
|
|
3890
3923
|
}
|
|
3891
3924
|
));
|
|
3892
3925
|
if (o)
|
|
3893
3926
|
return b.left(o);
|
|
3894
3927
|
}
|
|
3895
|
-
|
|
3896
|
-
const [i, a] =
|
|
3928
|
+
n.postEvent && Ze.set(n.postEvent);
|
|
3929
|
+
const [i, a] = Ie(
|
|
3897
3930
|
G("reload_iframe", () => {
|
|
3898
|
-
|
|
3931
|
+
Oe().log("Received a request to reload the page"), Tt("iframe_will_reload"), window.location.reload();
|
|
3899
3932
|
})
|
|
3900
|
-
), { acceptCustomStyles:
|
|
3901
|
-
if (
|
|
3933
|
+
), { acceptCustomStyles: c = !0 } = n;
|
|
3934
|
+
if (c) {
|
|
3902
3935
|
const o = document.createElement("style");
|
|
3903
3936
|
o.id = "telegram-custom-styles", document.head.appendChild(o), i(
|
|
3904
3937
|
G("set_custom_style", (l) => {
|
|
@@ -3911,176 +3944,177 @@ function xr(r = {}) {
|
|
|
3911
3944
|
}
|
|
3912
3945
|
return p.pipe(
|
|
3913
3946
|
se("iframe_ready", { reload_supported: !0 }),
|
|
3914
|
-
b.map(() => (
|
|
3947
|
+
b.map(() => (Oe().log("The package was initialized"), a))
|
|
3915
3948
|
);
|
|
3916
3949
|
}
|
|
3917
|
-
const
|
|
3950
|
+
const Tn = de(Mr);
|
|
3918
3951
|
export {
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3952
|
+
Ye as AccessDeniedError,
|
|
3953
|
+
Vt as BackButton,
|
|
3954
|
+
Pt as Biometry,
|
|
3955
|
+
qe as CSSVarsBoundError,
|
|
3956
|
+
$n as CancelledError,
|
|
3957
|
+
Gt as ClosingBehavior,
|
|
3958
|
+
Ht as CloudStorage,
|
|
3959
|
+
Be as ConcurrentCallError,
|
|
3960
|
+
zt as DeviceStorage,
|
|
3961
|
+
yt as DeviceStorageMethodError,
|
|
3929
3962
|
At as FullscreenFailedError,
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3963
|
+
qt as FunctionUnavailableError,
|
|
3964
|
+
es as HapticFeedback,
|
|
3965
|
+
Vn as HostThemeParams,
|
|
3966
|
+
ps as InitData,
|
|
3967
|
+
U as InvalidArgumentsError,
|
|
3968
|
+
jr as InvalidEnvError,
|
|
3969
|
+
Pn as InvalidLaunchParamsError,
|
|
3936
3970
|
us as Invoice,
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3971
|
+
On as InvokeCustomMethodFailedError,
|
|
3972
|
+
Dn as LaunchParamsRetrieveError,
|
|
3973
|
+
Cs as LocationManager,
|
|
3974
|
+
vs as MainButton,
|
|
3975
|
+
Gn as MethodParameterUnsupportedError,
|
|
3976
|
+
jn as MethodUnsupportedError,
|
|
3977
|
+
Es as MiniApp,
|
|
3978
|
+
Et as NotAvailableError,
|
|
3979
|
+
xs as Notification,
|
|
3980
|
+
Ts as Popup,
|
|
3981
|
+
zs as QrScanner,
|
|
3982
|
+
Ns as Refresh,
|
|
3983
|
+
Js as SecondaryButton,
|
|
3984
|
+
Zs as SecureStorage,
|
|
3985
|
+
It as SecureStorageMethodError,
|
|
3986
|
+
Bt as SetEmojiStatusError,
|
|
3987
|
+
er as SettingsButton,
|
|
3988
|
+
xt as ShareMessageError,
|
|
3955
3989
|
Ar as StoragePermission,
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3990
|
+
tr as SwipeBehavior,
|
|
3991
|
+
ys as ThemeParams,
|
|
3992
|
+
Hn as TimeoutError,
|
|
3993
|
+
Un as UnknownEnvError,
|
|
3994
|
+
Mt as UnknownThemeParamsKeyError,
|
|
3995
|
+
ce as ValidationError,
|
|
3996
|
+
qr as Viewport,
|
|
3997
|
+
Xr as addToHomeScreen,
|
|
3998
|
+
ns as addToHomeScreenFp,
|
|
3999
|
+
Wn as applyPolyfills,
|
|
4000
|
+
Hr as backButton,
|
|
4001
|
+
zr as biometry,
|
|
4002
|
+
en as checkHomeScreenStatus,
|
|
4003
|
+
as as checkHomeScreenStatusFp,
|
|
4004
|
+
Kr as closingBehavior,
|
|
4005
|
+
Nr as cloudStorage,
|
|
4006
|
+
Cn as copyTextToClipboard,
|
|
4007
|
+
zn as createLogger,
|
|
4008
|
+
Kn as createPostEvent,
|
|
4009
|
+
Me as createRequestId,
|
|
4010
|
+
Nn as createStartParam,
|
|
4011
|
+
Qn as createStartParamFp,
|
|
4012
|
+
Jn as debug,
|
|
4013
|
+
Yn as decodeBase64Url,
|
|
4014
|
+
Zn as decodeBase64UrlFp,
|
|
4015
|
+
Xn as decodeStartParam,
|
|
4016
|
+
ei as decodeStartParamFp,
|
|
4017
|
+
ti as deepSnakeToCamelObjKeys,
|
|
4018
|
+
Qr as deviceStorage,
|
|
4019
|
+
Sn as downloadFile,
|
|
4020
|
+
ir as downloadFileFp,
|
|
4021
|
+
si as emitEvent,
|
|
4022
|
+
ri as encodeBase64Url,
|
|
4023
|
+
vn as getCurrentTime,
|
|
4024
|
+
pr as getCurrentTimeFp,
|
|
4025
|
+
ni as getReleaseVersion,
|
|
4026
|
+
Zr as hapticFeedback,
|
|
4027
|
+
kn as hideKeyboard,
|
|
4028
|
+
lr as hideKeyboardFp,
|
|
4029
|
+
Tn as init,
|
|
4030
|
+
tn as initData,
|
|
4031
|
+
Mr as initFp,
|
|
4032
|
+
sn as invoice,
|
|
3999
4033
|
Ut as invokeCustomMethod,
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4034
|
+
ki as isAnyRGB,
|
|
4035
|
+
st as isColorDark,
|
|
4036
|
+
ks as isColorDarkFp,
|
|
4037
|
+
yi as isRGB,
|
|
4038
|
+
Ii as isRGBA,
|
|
4039
|
+
Ei as isRGBAShort,
|
|
4040
|
+
qi as isRGBShort,
|
|
4041
|
+
ii as isSafeToCreateStartParam,
|
|
4042
|
+
oi as isVBMA,
|
|
4043
|
+
ai as isVBMAFp,
|
|
4044
|
+
an as locationManager,
|
|
4045
|
+
pi as logger,
|
|
4046
|
+
pn as mainButton,
|
|
4047
|
+
Bs as miniApp,
|
|
4048
|
+
ci as mockVBotEnv,
|
|
4049
|
+
cn as notification,
|
|
4050
|
+
ui as off,
|
|
4051
|
+
li as offAll,
|
|
4052
|
+
hi as on,
|
|
4053
|
+
rn as openLink,
|
|
4054
|
+
fs as openLinkFp,
|
|
4055
|
+
nn as openVBotLink,
|
|
4056
|
+
tt as openVBotLinkFp,
|
|
4057
|
+
Bi as parseInitDataQuery,
|
|
4058
|
+
Ai as parseInitDataQueryFp,
|
|
4059
|
+
xi as parseLaunchParamsQuery,
|
|
4060
|
+
Mi as parseLaunchParamsQueryFp,
|
|
4027
4061
|
un as popup,
|
|
4028
|
-
|
|
4062
|
+
Tt as postEvent,
|
|
4029
4063
|
se as postEventFp,
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4064
|
+
_n as qrScanner,
|
|
4065
|
+
yn as readTextFromClipboard,
|
|
4066
|
+
fr as readTextFromClipboardFp,
|
|
4067
|
+
mn as refresh,
|
|
4034
4068
|
Ur as request,
|
|
4035
4069
|
Wr as request2,
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4070
|
+
Xe as request2Fp,
|
|
4071
|
+
dn as requestContact,
|
|
4072
|
+
hn as requestContactComplete,
|
|
4073
|
+
it as requestContactCompleteFp,
|
|
4074
|
+
js as requestContactFp,
|
|
4075
|
+
Jr as requestEmojiStatusAccess,
|
|
4076
|
+
Jt as requestEmojiStatusAccessFp,
|
|
4077
|
+
Ot as requestFp,
|
|
4078
|
+
ln as requestPhoneAccess,
|
|
4079
|
+
nt as requestPhoneAccessFp,
|
|
4080
|
+
fn as requestWriteAccess,
|
|
4047
4081
|
Ws as requestWriteAccessFp,
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4082
|
+
In as retrieveAndroidDeviceData,
|
|
4083
|
+
_r as retrieveAndroidDeviceDataFrom,
|
|
4084
|
+
di as retrieveLaunchParams,
|
|
4085
|
+
fi as retrieveLaunchParamsFp,
|
|
4086
|
+
_i as retrieveRawInitData,
|
|
4087
|
+
mi as retrieveRawInitDataFp,
|
|
4088
|
+
bi as retrieveRawLaunchParams,
|
|
4089
|
+
gi as retrieveRawLaunchParamsFp,
|
|
4090
|
+
bn as secondaryButton,
|
|
4091
|
+
gn as secureStorage,
|
|
4092
|
+
En as sendData,
|
|
4093
|
+
gr as sendDataFp,
|
|
4094
|
+
Vi as serializeInitDataQuery,
|
|
4095
|
+
Ti as serializeLaunchParamsQuery,
|
|
4096
|
+
Fi as setDebug,
|
|
4097
|
+
Yr as setEmojiStatus,
|
|
4098
|
+
Xt as setEmojiStatusFp,
|
|
4099
|
+
wi as setTargetOrigin,
|
|
4100
|
+
Fn as settingsButton,
|
|
4101
|
+
qn as shareMessage,
|
|
4102
|
+
Cr as shareMessageFp,
|
|
4103
|
+
Bn as shareStory,
|
|
4104
|
+
kr as shareStoryFp,
|
|
4105
|
+
on as shareURL,
|
|
4106
|
+
Fs as shareURLFp,
|
|
4107
|
+
Mn as storagePermission,
|
|
4108
|
+
Ci as supports,
|
|
4109
|
+
wn as swipeBehavior,
|
|
4076
4110
|
An as switchInlineQuery,
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4111
|
+
Er as switchInlineQueryFp,
|
|
4112
|
+
Si as targetOrigin,
|
|
4113
|
+
he as themeParams,
|
|
4114
|
+
Ri as toRGB,
|
|
4115
|
+
Li as toRGBFp,
|
|
4116
|
+
$i as toRGBFull,
|
|
4117
|
+
Pi as toRGBFullFp,
|
|
4118
|
+
xn as viewport
|
|
4085
4119
|
};
|
|
4086
4120
|
//# sourceMappingURL=index.js.map
|