@vbotma/sdk 3.2.3 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dts/host-features/Notification/HostNotification.d.ts +7 -0
- package/dist/dts/host-features/index.d.ts +2 -1
- package/dist/dts/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +3 -3
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +135 -122
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2,19 +2,19 @@ var pt = Object.defineProperty;
|
|
|
2
2
|
var ct = (n, t, r) => t in n ? pt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
|
|
3
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 ye, off as
|
|
6
|
-
import { CancelledError as
|
|
5
|
+
import { supports as ee, isVBMAFp as ut, postEventFp as ye, off as ne, on as G, request2Fp as je, requestFp as lt, invokeCustomMethodFp as ht, retrieveLaunchParamsFp as le, retrieveRawInitDataFp as dt, captureSameReq as ft, getHostBridge as re, logger as Oe } from "@vbotma/bridge";
|
|
6
|
+
import { CancelledError as Pn, InvalidLaunchParamsError as On, InvokeCustomMethodFailedError as Dn, LaunchParamsRetrieveError as Gn, MethodParameterUnsupportedError as Hn, MethodUnsupportedError as jn, TimeoutError as Un, UnknownEnvError as Wn, applyPolyfills as zn, createLogger as Kn, createPostEvent as Nn, createStartParam as Qn, createStartParamFp as Jn, debug as Yn, decodeBase64Url as Zn, decodeBase64UrlFp as Xn, decodeStartParam as ei, decodeStartParamFp as ti, deepSnakeToCamelObjKeys as si, defineHostBridge as ri, emitEvent as ni, encodeBase64Url as ii, getHostBridge as oi, getReleaseVersion as ai, isSafeToCreateStartParam as pi, isVBMA as ci, isVBMAFp as ui, logger as li, mockVBotEnv as hi, off as di, offAll as fi, on as _i, retrieveLaunchParams as mi, retrieveLaunchParamsFp as bi, retrieveRawInitData as gi, retrieveRawInitDataFp as Fi, retrieveRawLaunchParams as wi, retrieveRawLaunchParamsFp as Ci, setDebug as Si, setTargetOrigin as vi, supports as ki, targetOrigin as yi } from "@vbotma/bridge";
|
|
7
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
8
|
import { BetterPromise as ze } from "better-promises";
|
|
9
9
|
import { toRGBFullFp as gt, isRGB as _e, pipeQueryToSchema as Ft, pipeJsonToSchema as wt } from "@vbotma/transformers";
|
|
10
|
-
import { isAnyRGB as
|
|
10
|
+
import { isAnyRGB as Ei, isRGB as qi, isRGBA as Bi, isRGBAShort as Ai, isRGBShort as xi, parseInitDataQuery as Mi, parseInitDataQueryFp as Vi, parseLaunchParamsQuery as Ti, parseLaunchParamsQueryFp as Ri, serializeInitDataQuery as Li, serializeLaunchParamsQuery as $i, toRGB as Pi, toRGBFp as Oi, toRGBFull as Di, toRGBFullFp as Gi } from "@vbotma/transformers";
|
|
11
11
|
import { either as b, function as p, option as N, taskEither as u } from "fp-ts";
|
|
12
|
-
import { errorClass as
|
|
12
|
+
import { errorClass as H, errorClassWithData as Ee } from "error-kid";
|
|
13
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
14
|
function $(n) {
|
|
15
15
|
return typeof n == "function" ? n() : n;
|
|
16
16
|
}
|
|
17
|
-
class
|
|
17
|
+
class ie {
|
|
18
18
|
constructor({
|
|
19
19
|
onMounted: t,
|
|
20
20
|
restoreState: r,
|
|
@@ -124,7 +124,7 @@ class ce extends (/* @__PURE__ */ Ee(
|
|
|
124
124
|
"Validation error"
|
|
125
125
|
)) {
|
|
126
126
|
}
|
|
127
|
-
class qe extends (/* @__PURE__ */
|
|
127
|
+
class qe extends (/* @__PURE__ */ H(
|
|
128
128
|
"CSSVarsBoundError",
|
|
129
129
|
"CSS variables are already bound"
|
|
130
130
|
)) {
|
|
@@ -133,52 +133,52 @@ class yt extends (/* @__PURE__ */ Ee("DeviceStorageMethodError", (t) => ({ error
|
|
|
133
133
|
}
|
|
134
134
|
class It extends (/* @__PURE__ */ Ee("SecureStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
|
|
135
135
|
}
|
|
136
|
-
class Et extends (/* @__PURE__ */
|
|
136
|
+
class Et extends (/* @__PURE__ */ H(
|
|
137
137
|
"NotAvailableError",
|
|
138
138
|
X
|
|
139
139
|
)) {
|
|
140
140
|
}
|
|
141
|
-
class
|
|
141
|
+
class Hr extends (/* @__PURE__ */ H(
|
|
142
142
|
"InvalidEnvError",
|
|
143
143
|
X
|
|
144
144
|
)) {
|
|
145
145
|
}
|
|
146
|
-
class qt extends (/* @__PURE__ */
|
|
146
|
+
class qt extends (/* @__PURE__ */ H(
|
|
147
147
|
"FunctionNotAvailableError",
|
|
148
148
|
X
|
|
149
149
|
)) {
|
|
150
150
|
}
|
|
151
|
-
class U extends (/* @__PURE__ */
|
|
151
|
+
class U extends (/* @__PURE__ */ H(
|
|
152
152
|
"InvalidArgumentsError",
|
|
153
153
|
(t, r) => [t, { cause: r }]
|
|
154
154
|
)) {
|
|
155
155
|
}
|
|
156
|
-
class Be extends (/* @__PURE__ */
|
|
156
|
+
class Be extends (/* @__PURE__ */ H(
|
|
157
157
|
"ConcurrentCallError",
|
|
158
158
|
X
|
|
159
159
|
)) {
|
|
160
160
|
}
|
|
161
|
-
class Bt extends (/* @__PURE__ */
|
|
161
|
+
class Bt extends (/* @__PURE__ */ H(
|
|
162
162
|
"SetEmojiStatusError",
|
|
163
163
|
(t) => [`Failed to set emoji status: ${t}`]
|
|
164
164
|
)) {
|
|
165
165
|
}
|
|
166
|
-
class Ye extends (/* @__PURE__ */
|
|
166
|
+
class Ye extends (/* @__PURE__ */ H(
|
|
167
167
|
"AccessDeniedError",
|
|
168
168
|
X
|
|
169
169
|
)) {
|
|
170
170
|
}
|
|
171
|
-
class At extends (/* @__PURE__ */
|
|
171
|
+
class At extends (/* @__PURE__ */ H(
|
|
172
172
|
"FullscreenFailedError",
|
|
173
173
|
X
|
|
174
174
|
)) {
|
|
175
175
|
}
|
|
176
|
-
class xt extends (/* @__PURE__ */
|
|
176
|
+
class xt extends (/* @__PURE__ */ H(
|
|
177
177
|
"ShareMessageError",
|
|
178
178
|
X
|
|
179
179
|
)) {
|
|
180
180
|
}
|
|
181
|
-
class Mt extends (/* @__PURE__ */
|
|
181
|
+
class Mt extends (/* @__PURE__ */ H(
|
|
182
182
|
"UnknownThemeParamsKeyError",
|
|
183
183
|
(t) => [`Unknown theme params key passed: ${t}`]
|
|
184
184
|
)) {
|
|
@@ -339,7 +339,7 @@ class fe {
|
|
|
339
339
|
onChange(m) {
|
|
340
340
|
r.set(m);
|
|
341
341
|
}
|
|
342
|
-
}), v = new
|
|
342
|
+
}), v = new ie({
|
|
343
343
|
initialState: a,
|
|
344
344
|
isPageReload: c,
|
|
345
345
|
onMounted: f.setState,
|
|
@@ -482,10 +482,10 @@ function te(n) {
|
|
|
482
482
|
return (t) => ({ ...t, ...$(n) });
|
|
483
483
|
}
|
|
484
484
|
// @__NO_SIDE_EFFECTS__
|
|
485
|
-
function
|
|
485
|
+
function oe(n, t) {
|
|
486
486
|
return O(n, t);
|
|
487
487
|
}
|
|
488
|
-
const Ze = /* @__PURE__ */
|
|
488
|
+
const Ze = /* @__PURE__ */ oe(ye), se = (...n) => Ze()(...n), Tt = (...n) => Ue(se(...n)), V = te({
|
|
489
489
|
postEvent: se
|
|
490
490
|
});
|
|
491
491
|
function Rt(n) {
|
|
@@ -509,7 +509,7 @@ function Y(n) {
|
|
|
509
509
|
isPageReload: $t
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
|
-
const Se = /* @__PURE__ */
|
|
512
|
+
const Se = /* @__PURE__ */ oe("0.0"), I = te({ version: Se });
|
|
513
513
|
// @__NO_SIDE_EFFECTS__
|
|
514
514
|
function Ae(n, t) {
|
|
515
515
|
return {
|
|
@@ -523,11 +523,11 @@ function Ae(n, t) {
|
|
|
523
523
|
return G(t, r, s);
|
|
524
524
|
},
|
|
525
525
|
offClick(r, s) {
|
|
526
|
-
|
|
526
|
+
ne(t, r, s);
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const jr = /* @__PURE__ */ new Vt(
|
|
531
531
|
/* @__PURE__ */ Ae("backButton", "back_button_pressed")
|
|
532
532
|
);
|
|
533
533
|
class xe {
|
|
@@ -571,7 +571,7 @@ class xe {
|
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function He() {
|
|
575
575
|
return new Et("Biometry is not available");
|
|
576
576
|
}
|
|
577
577
|
function be(n) {
|
|
@@ -720,14 +720,14 @@ class Pt {
|
|
|
720
720
|
params: { reason: ((m || {}).reason || "").trim() }
|
|
721
721
|
}),
|
|
722
722
|
u.map((g) => (F.setState({ token: g.token }), g))
|
|
723
|
-
) : u.left(
|
|
723
|
+
) : u.left(He())), this.openSettingsFp = C(() => s("web_app_biometry_open_settings")), this.requestAccessFp = y((m) => p.pipe(
|
|
724
724
|
r("web_app_biometry_request_access", "biometry_info_received", {
|
|
725
725
|
...m,
|
|
726
726
|
params: { reason: ((m || {}).reason || "").trim() }
|
|
727
727
|
}),
|
|
728
728
|
u.chain((g) => {
|
|
729
729
|
const d = be(g);
|
|
730
|
-
return d.available ? (F.setState(d), u.right(d.accessRequested)) : u.left(
|
|
730
|
+
return d.available ? (F.setState(d), u.right(d.accessRequested)) : u.left(He());
|
|
731
731
|
})
|
|
732
732
|
)), this.updateTokenFp = y((m = {}) => {
|
|
733
733
|
var g;
|
|
@@ -744,7 +744,7 @@ class Pt {
|
|
|
744
744
|
const Ot = (n, t, r) => lt(n, t, {
|
|
745
745
|
postEvent: se,
|
|
746
746
|
...r
|
|
747
|
-
}), Xe = (n, t, r) =>
|
|
747
|
+
}), Xe = (n, t, r) => je(n, t, {
|
|
748
748
|
postEvent: se,
|
|
749
749
|
...r
|
|
750
750
|
}), Ur = (...n) => ze.fn(() => Ot(...n)()), Wr = (...n) => ze.fn(() => Xe(...n)()), R = te({ request: Xe });
|
|
@@ -758,7 +758,7 @@ function Dt() {
|
|
|
758
758
|
Y("biometry")
|
|
759
759
|
),
|
|
760
760
|
offInfoReceived(n) {
|
|
761
|
-
|
|
761
|
+
ne("biometry_info_received", n);
|
|
762
762
|
},
|
|
763
763
|
onInfoReceived(n) {
|
|
764
764
|
return G("biometry_info_received", n);
|
|
@@ -809,7 +809,7 @@ class Gt {
|
|
|
809
809
|
onChange(f) {
|
|
810
810
|
r.set(f);
|
|
811
811
|
}
|
|
812
|
-
}), c = new
|
|
812
|
+
}), c = new ie({
|
|
813
813
|
onMounted: a.setState,
|
|
814
814
|
restoreState: r.get,
|
|
815
815
|
initialState: { isConfirmationEnabled: !1 },
|
|
@@ -831,15 +831,15 @@ class Gt {
|
|
|
831
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
|
|
834
|
+
function Ht() {
|
|
835
835
|
return new Gt(p.pipe(
|
|
836
836
|
S(),
|
|
837
837
|
Y("closingBehavior"),
|
|
838
838
|
V
|
|
839
839
|
));
|
|
840
840
|
}
|
|
841
|
-
const Kr = /* @__PURE__ */
|
|
842
|
-
class
|
|
841
|
+
const Kr = /* @__PURE__ */ Ht();
|
|
842
|
+
class jt {
|
|
843
843
|
constructor({ version: t, isTma: r, invokeCustomMethod: s }) {
|
|
844
844
|
/**
|
|
845
845
|
* Signal indicating if the component is supported.
|
|
@@ -943,7 +943,7 @@ class Ht {
|
|
|
943
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 ge = /* @__PURE__ */
|
|
946
|
+
const ge = /* @__PURE__ */ oe(0);
|
|
947
947
|
function Me() {
|
|
948
948
|
return ge.set(ge() + 1), ge().toString();
|
|
949
949
|
}
|
|
@@ -957,7 +957,7 @@ const Ve = te({
|
|
|
957
957
|
invokeCustomMethod: Ut
|
|
958
958
|
});
|
|
959
959
|
function Wt() {
|
|
960
|
-
return new
|
|
960
|
+
return new jt(p.pipe(
|
|
961
961
|
S(),
|
|
962
962
|
I,
|
|
963
963
|
Ve
|
|
@@ -1877,7 +1877,7 @@ class ys {
|
|
|
1877
1877
|
onChange: a.set
|
|
1878
1878
|
}), l = (C) => {
|
|
1879
1879
|
o.setState(C.theme_params);
|
|
1880
|
-
}, _ = new
|
|
1880
|
+
}, _ = new ie({
|
|
1881
1881
|
initialState: () => b.right($(t)),
|
|
1882
1882
|
isPageReload: c,
|
|
1883
1883
|
onMounted(C) {
|
|
@@ -1894,7 +1894,7 @@ class ys {
|
|
|
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
1896
|
return b.left(new qe());
|
|
1897
|
-
C || (C = (m) => `--
|
|
1897
|
+
C || (C = (m) => `--vb-theme-${bt(m)}`);
|
|
1898
1898
|
const k = (m) => {
|
|
1899
1899
|
Object.entries(o.state()).forEach(([g, d]) => {
|
|
1900
1900
|
d && m(g, d);
|
|
@@ -1911,7 +1911,7 @@ class ys {
|
|
|
1911
1911
|
}
|
|
1912
1912
|
//#endregion
|
|
1913
1913
|
}
|
|
1914
|
-
const ve = /* @__PURE__ */
|
|
1914
|
+
const ve = /* @__PURE__ */ oe({});
|
|
1915
1915
|
function Is() {
|
|
1916
1916
|
return new ys({
|
|
1917
1917
|
...p.pipe(
|
|
@@ -1919,7 +1919,7 @@ function Is() {
|
|
|
1919
1919
|
Y("themeParams")
|
|
1920
1920
|
),
|
|
1921
1921
|
offChange(n) {
|
|
1922
|
-
|
|
1922
|
+
ne("theme_changed", n);
|
|
1923
1923
|
},
|
|
1924
1924
|
onChange(n) {
|
|
1925
1925
|
G("theme_changed", n);
|
|
@@ -2134,7 +2134,7 @@ class Es {
|
|
|
2134
2134
|
P && i(T, { color: P });
|
|
2135
2135
|
}
|
|
2136
2136
|
});
|
|
2137
|
-
}, f = new
|
|
2137
|
+
}, f = new ie({
|
|
2138
2138
|
initialState() {
|
|
2139
2139
|
return b.right({
|
|
2140
2140
|
bgColor: "bg_color",
|
|
@@ -2180,10 +2180,10 @@ class Es {
|
|
|
2180
2180
|
const [A, T] = Ie(() => {
|
|
2181
2181
|
y.set(!1);
|
|
2182
2182
|
}), M = (P, L) => {
|
|
2183
|
-
const
|
|
2183
|
+
const j = () => {
|
|
2184
2184
|
Te(P, L() || null);
|
|
2185
2185
|
};
|
|
2186
|
-
|
|
2186
|
+
j(), A(L.sub(j), 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);
|
|
@@ -2203,9 +2203,9 @@ class Es {
|
|
|
2203
2203
|
v.setState({ [d]: L });
|
|
2204
2204
|
})
|
|
2205
2205
|
);
|
|
2206
|
-
const
|
|
2206
|
+
const j = C(L);
|
|
2207
2207
|
return p.pipe(
|
|
2208
|
-
|
|
2208
|
+
j ? i(M, { color: j }) : b.left(new Mt(L)),
|
|
2209
2209
|
b.map(() => {
|
|
2210
2210
|
v.setState({ [d]: L });
|
|
2211
2211
|
})
|
|
@@ -2258,7 +2258,7 @@ function qs() {
|
|
|
2258
2258
|
Y("miniApp")
|
|
2259
2259
|
),
|
|
2260
2260
|
offVisibilityChanged(n) {
|
|
2261
|
-
|
|
2261
|
+
ne("visibility_changed", n);
|
|
2262
2262
|
},
|
|
2263
2263
|
onVisibilityChanged(n) {
|
|
2264
2264
|
G("visibility_changed", n);
|
|
@@ -2506,8 +2506,8 @@ function Gs() {
|
|
|
2506
2506
|
}
|
|
2507
2507
|
});
|
|
2508
2508
|
}
|
|
2509
|
-
const it = /* @__PURE__ */ Os(), hn = /* @__PURE__ */ h(it),
|
|
2510
|
-
function
|
|
2509
|
+
const it = /* @__PURE__ */ Os(), hn = /* @__PURE__ */ h(it), Hs = /* @__PURE__ */ Gs(), dn = /* @__PURE__ */ h(Hs);
|
|
2510
|
+
function js({ request: n, ...t }) {
|
|
2511
2511
|
return B((r) => p.pipe(
|
|
2512
2512
|
n("web_app_request_write_access", "write_access_requested", r),
|
|
2513
2513
|
u.map((s) => s.status)
|
|
@@ -2515,7 +2515,7 @@ function Hs({ request: n, ...t }) {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
// @__NO_SIDE_EFFECTS__
|
|
2517
2517
|
function Us() {
|
|
2518
|
-
return
|
|
2518
|
+
return js(p.pipe(
|
|
2519
2519
|
S(),
|
|
2520
2520
|
I,
|
|
2521
2521
|
R
|
|
@@ -3217,7 +3217,7 @@ class tr {
|
|
|
3217
3217
|
onChange(C) {
|
|
3218
3218
|
r.set(C);
|
|
3219
3219
|
}
|
|
3220
|
-
}), l = new
|
|
3220
|
+
}), l = new ie({
|
|
3221
3221
|
initialState: c,
|
|
3222
3222
|
isPageReload: i,
|
|
3223
3223
|
onMounted: o.setState,
|
|
@@ -3415,7 +3415,7 @@ function vr() {
|
|
|
3415
3415
|
I
|
|
3416
3416
|
));
|
|
3417
3417
|
}
|
|
3418
|
-
const kr = /* @__PURE__ */ vr(), Bn = /* @__PURE__ */ h(kr), ke = /* @__PURE__ */
|
|
3418
|
+
const kr = /* @__PURE__ */ vr(), Bn = /* @__PURE__ */ h(kr), ke = /* @__PURE__ */ oe(!1);
|
|
3419
3419
|
function yr({ isInlineMode: n, postEvent: t, ...r }) {
|
|
3420
3420
|
return B((s, i) => t("web_app_switch_inline_query", {
|
|
3421
3421
|
query: s,
|
|
@@ -3708,8 +3708,8 @@ class qr {
|
|
|
3708
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 =
|
|
3711
|
+
}), j = (q) => w(() => this.safeAreaInsets()[q]), ae = (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 = j("top"), this.safeAreaInsetBottom = j("bottom"), this.safeAreaInsetLeft = j("left"), this.safeAreaInsetRight = j("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = ae("top"), this.contentSafeAreaInsetBottom = ae("bottom"), this.contentSafeAreaInsetLeft = ae("left"), this.contentSafeAreaInsetRight = ae("right");
|
|
3713
3713
|
const ot = E({ isTma: k, returns: "task" }), Le = E({
|
|
3714
3714
|
isTma: k,
|
|
3715
3715
|
returns: "either"
|
|
@@ -3729,10 +3729,10 @@ class qr {
|
|
|
3729
3729
|
}), u.right(void 0)))
|
|
3730
3730
|
));
|
|
3731
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
|
-
const
|
|
3733
|
-
this.isCssVarsBound = w(
|
|
3732
|
+
const pe = O(!1);
|
|
3733
|
+
this.isCssVarsBound = w(pe), this.bindCssVarsFp = Le(
|
|
3734
3734
|
(q) => {
|
|
3735
|
-
if (
|
|
3735
|
+
if (pe())
|
|
3736
3736
|
return b.left(new qe());
|
|
3737
3737
|
q || (q = (x) => `--vb-viewport-${We(x)}`);
|
|
3738
3738
|
const Z = [
|
|
@@ -3759,10 +3759,10 @@ class qr {
|
|
|
3759
3759
|
}, []);
|
|
3760
3760
|
return Z.forEach((x) => {
|
|
3761
3761
|
x.update();
|
|
3762
|
-
}),
|
|
3762
|
+
}), pe.set(!0), b.right(() => {
|
|
3763
3763
|
Z.forEach((x) => {
|
|
3764
3764
|
x.removeListener(), Re(x.cssVar);
|
|
3765
|
-
}),
|
|
3765
|
+
}), pe.set(!1);
|
|
3766
3766
|
});
|
|
3767
3767
|
}
|
|
3768
3768
|
), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Le(() => m("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
|
|
@@ -3775,7 +3775,7 @@ function Br() {
|
|
|
3775
3775
|
G(a, c);
|
|
3776
3776
|
},
|
|
3777
3777
|
off: (c) => {
|
|
3778
|
-
|
|
3778
|
+
ne(a, c);
|
|
3779
3779
|
}
|
|
3780
3780
|
}), t = n("viewport_changed"), r = n("fullscreen_changed"), s = n("safe_area_changed"), i = n("content_safe_area_changed");
|
|
3781
3781
|
return new qr({
|
|
@@ -3870,23 +3870,33 @@ class Ar {
|
|
|
3870
3870
|
}
|
|
3871
3871
|
function xr() {
|
|
3872
3872
|
return new Ar({
|
|
3873
|
-
request:
|
|
3873
|
+
request: je
|
|
3874
3874
|
});
|
|
3875
3875
|
}
|
|
3876
3876
|
const Mn = /* @__PURE__ */ xr();
|
|
3877
3877
|
class Vn {
|
|
3878
|
+
/**
|
|
3879
|
+
* Listens to 'web_app_send_notification' method call from Mini App.
|
|
3880
|
+
*/
|
|
3881
|
+
static onSend(t) {
|
|
3882
|
+
return re().on("web_app_send_notification", (s) => {
|
|
3883
|
+
s && t(s);
|
|
3884
|
+
});
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
class Tn {
|
|
3878
3888
|
/**
|
|
3879
3889
|
* Sets the theme params of the Mini App.
|
|
3880
3890
|
* Sends 'theme_changed' event to the Mini App.
|
|
3881
3891
|
*/
|
|
3882
3892
|
static setTheme(t) {
|
|
3883
|
-
|
|
3893
|
+
re().send("theme_changed", { theme_params: t });
|
|
3884
3894
|
}
|
|
3885
3895
|
/**
|
|
3886
3896
|
* Listens to 'web_app_set_background_color' method call from Mini App.
|
|
3887
3897
|
*/
|
|
3888
3898
|
static onBackgroundColorChange(t) {
|
|
3889
|
-
return
|
|
3899
|
+
return re().on("web_app_set_background_color", (s) => {
|
|
3890
3900
|
s && typeof s.color == "string" && t(s.color);
|
|
3891
3901
|
});
|
|
3892
3902
|
}
|
|
@@ -3894,7 +3904,7 @@ class Vn {
|
|
|
3894
3904
|
* Listens to 'web_app_set_header_color' method call from Mini App.
|
|
3895
3905
|
*/
|
|
3896
3906
|
static onHeaderColorChange(t) {
|
|
3897
|
-
return
|
|
3907
|
+
return re().on("web_app_set_header_color", (s) => {
|
|
3898
3908
|
s && ("color_key" in s && s.color_key ? t(s.color_key) : "color" in s && s.color && t(s.color));
|
|
3899
3909
|
});
|
|
3900
3910
|
}
|
|
@@ -3902,7 +3912,7 @@ class Vn {
|
|
|
3902
3912
|
* Listens to 'web_app_set_bottom_bar_color' method call from Mini App.
|
|
3903
3913
|
*/
|
|
3904
3914
|
static onBottomBarColorChange(t) {
|
|
3905
|
-
return
|
|
3915
|
+
return re().on("web_app_set_bottom_bar_color", (s) => {
|
|
3906
3916
|
s && s.color && t(s.color);
|
|
3907
3917
|
});
|
|
3908
3918
|
}
|
|
@@ -3947,32 +3957,33 @@ function Mr(n = {}) {
|
|
|
3947
3957
|
b.map(() => (Oe().log("The package was initialized"), a))
|
|
3948
3958
|
);
|
|
3949
3959
|
}
|
|
3950
|
-
const
|
|
3960
|
+
const Rn = de(Mr);
|
|
3951
3961
|
export {
|
|
3952
3962
|
Ye as AccessDeniedError,
|
|
3953
3963
|
Vt as BackButton,
|
|
3954
3964
|
Pt as Biometry,
|
|
3955
3965
|
qe as CSSVarsBoundError,
|
|
3956
|
-
|
|
3966
|
+
Pn as CancelledError,
|
|
3957
3967
|
Gt as ClosingBehavior,
|
|
3958
|
-
|
|
3968
|
+
jt as CloudStorage,
|
|
3959
3969
|
Be as ConcurrentCallError,
|
|
3960
3970
|
zt as DeviceStorage,
|
|
3961
3971
|
yt as DeviceStorageMethodError,
|
|
3962
3972
|
At as FullscreenFailedError,
|
|
3963
3973
|
qt as FunctionUnavailableError,
|
|
3964
3974
|
es as HapticFeedback,
|
|
3965
|
-
Vn as
|
|
3975
|
+
Vn as HostNotification,
|
|
3976
|
+
Tn as HostThemeParams,
|
|
3966
3977
|
ps as InitData,
|
|
3967
3978
|
U as InvalidArgumentsError,
|
|
3968
|
-
|
|
3969
|
-
|
|
3979
|
+
Hr as InvalidEnvError,
|
|
3980
|
+
On as InvalidLaunchParamsError,
|
|
3970
3981
|
us as Invoice,
|
|
3971
|
-
|
|
3972
|
-
|
|
3982
|
+
Dn as InvokeCustomMethodFailedError,
|
|
3983
|
+
Gn as LaunchParamsRetrieveError,
|
|
3973
3984
|
Cs as LocationManager,
|
|
3974
3985
|
vs as MainButton,
|
|
3975
|
-
|
|
3986
|
+
Hn as MethodParameterUnsupportedError,
|
|
3976
3987
|
jn as MethodUnsupportedError,
|
|
3977
3988
|
Es as MiniApp,
|
|
3978
3989
|
Et as NotAvailableError,
|
|
@@ -3989,75 +4000,77 @@ export {
|
|
|
3989
4000
|
Ar as StoragePermission,
|
|
3990
4001
|
tr as SwipeBehavior,
|
|
3991
4002
|
ys as ThemeParams,
|
|
3992
|
-
|
|
3993
|
-
|
|
4003
|
+
Un as TimeoutError,
|
|
4004
|
+
Wn as UnknownEnvError,
|
|
3994
4005
|
Mt as UnknownThemeParamsKeyError,
|
|
3995
4006
|
ce as ValidationError,
|
|
3996
4007
|
qr as Viewport,
|
|
3997
4008
|
Xr as addToHomeScreen,
|
|
3998
4009
|
ns as addToHomeScreenFp,
|
|
3999
|
-
|
|
4000
|
-
|
|
4010
|
+
zn as applyPolyfills,
|
|
4011
|
+
jr as backButton,
|
|
4001
4012
|
zr as biometry,
|
|
4002
4013
|
en as checkHomeScreenStatus,
|
|
4003
4014
|
as as checkHomeScreenStatusFp,
|
|
4004
4015
|
Kr as closingBehavior,
|
|
4005
4016
|
Nr as cloudStorage,
|
|
4006
4017
|
Cn as copyTextToClipboard,
|
|
4007
|
-
|
|
4008
|
-
|
|
4018
|
+
Kn as createLogger,
|
|
4019
|
+
Nn as createPostEvent,
|
|
4009
4020
|
Me as createRequestId,
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4021
|
+
Qn as createStartParam,
|
|
4022
|
+
Jn as createStartParamFp,
|
|
4023
|
+
Yn as debug,
|
|
4024
|
+
Zn as decodeBase64Url,
|
|
4025
|
+
Xn as decodeBase64UrlFp,
|
|
4026
|
+
ei as decodeStartParam,
|
|
4027
|
+
ti as decodeStartParamFp,
|
|
4028
|
+
si as deepSnakeToCamelObjKeys,
|
|
4029
|
+
ri as defineHostBridge,
|
|
4018
4030
|
Qr as deviceStorage,
|
|
4019
4031
|
Sn as downloadFile,
|
|
4020
4032
|
ir as downloadFileFp,
|
|
4021
|
-
|
|
4022
|
-
|
|
4033
|
+
ni as emitEvent,
|
|
4034
|
+
ii as encodeBase64Url,
|
|
4023
4035
|
vn as getCurrentTime,
|
|
4024
4036
|
pr as getCurrentTimeFp,
|
|
4025
|
-
|
|
4037
|
+
oi as getHostBridge,
|
|
4038
|
+
ai as getReleaseVersion,
|
|
4026
4039
|
Zr as hapticFeedback,
|
|
4027
4040
|
kn as hideKeyboard,
|
|
4028
4041
|
lr as hideKeyboardFp,
|
|
4029
|
-
|
|
4042
|
+
Rn as init,
|
|
4030
4043
|
tn as initData,
|
|
4031
4044
|
Mr as initFp,
|
|
4032
4045
|
sn as invoice,
|
|
4033
4046
|
Ut as invokeCustomMethod,
|
|
4034
|
-
|
|
4047
|
+
Ei as isAnyRGB,
|
|
4035
4048
|
st as isColorDark,
|
|
4036
4049
|
ks as isColorDarkFp,
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4050
|
+
qi as isRGB,
|
|
4051
|
+
Bi as isRGBA,
|
|
4052
|
+
Ai as isRGBAShort,
|
|
4053
|
+
xi as isRGBShort,
|
|
4054
|
+
pi as isSafeToCreateStartParam,
|
|
4055
|
+
ci as isVBMA,
|
|
4056
|
+
ui as isVBMAFp,
|
|
4044
4057
|
an as locationManager,
|
|
4045
|
-
|
|
4058
|
+
li as logger,
|
|
4046
4059
|
pn as mainButton,
|
|
4047
4060
|
Bs as miniApp,
|
|
4048
|
-
|
|
4061
|
+
hi as mockVBotEnv,
|
|
4049
4062
|
cn as notification,
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4063
|
+
di as off,
|
|
4064
|
+
fi as offAll,
|
|
4065
|
+
_i as on,
|
|
4053
4066
|
rn as openLink,
|
|
4054
4067
|
fs as openLinkFp,
|
|
4055
4068
|
nn as openVBotLink,
|
|
4056
4069
|
tt as openVBotLinkFp,
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4070
|
+
Mi as parseInitDataQuery,
|
|
4071
|
+
Vi as parseInitDataQueryFp,
|
|
4072
|
+
Ti as parseLaunchParamsQuery,
|
|
4073
|
+
Ri as parseLaunchParamsQueryFp,
|
|
4061
4074
|
un as popup,
|
|
4062
4075
|
Tt as postEvent,
|
|
4063
4076
|
se as postEventFp,
|
|
@@ -4071,7 +4084,7 @@ export {
|
|
|
4071
4084
|
dn as requestContact,
|
|
4072
4085
|
hn as requestContactComplete,
|
|
4073
4086
|
it as requestContactCompleteFp,
|
|
4074
|
-
|
|
4087
|
+
Hs as requestContactFp,
|
|
4075
4088
|
Jr as requestEmojiStatusAccess,
|
|
4076
4089
|
Jt as requestEmojiStatusAccessFp,
|
|
4077
4090
|
Ot as requestFp,
|
|
@@ -4081,22 +4094,22 @@ export {
|
|
|
4081
4094
|
Ws as requestWriteAccessFp,
|
|
4082
4095
|
In as retrieveAndroidDeviceData,
|
|
4083
4096
|
_r as retrieveAndroidDeviceDataFrom,
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4097
|
+
mi as retrieveLaunchParams,
|
|
4098
|
+
bi as retrieveLaunchParamsFp,
|
|
4099
|
+
gi as retrieveRawInitData,
|
|
4100
|
+
Fi as retrieveRawInitDataFp,
|
|
4101
|
+
wi as retrieveRawLaunchParams,
|
|
4102
|
+
Ci as retrieveRawLaunchParamsFp,
|
|
4090
4103
|
bn as secondaryButton,
|
|
4091
4104
|
gn as secureStorage,
|
|
4092
4105
|
En as sendData,
|
|
4093
4106
|
gr as sendDataFp,
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4107
|
+
Li as serializeInitDataQuery,
|
|
4108
|
+
$i as serializeLaunchParamsQuery,
|
|
4109
|
+
Si as setDebug,
|
|
4097
4110
|
Yr as setEmojiStatus,
|
|
4098
4111
|
Xt as setEmojiStatusFp,
|
|
4099
|
-
|
|
4112
|
+
vi as setTargetOrigin,
|
|
4100
4113
|
Fn as settingsButton,
|
|
4101
4114
|
qn as shareMessage,
|
|
4102
4115
|
Cr as shareMessageFp,
|
|
@@ -4105,16 +4118,16 @@ export {
|
|
|
4105
4118
|
on as shareURL,
|
|
4106
4119
|
Fs as shareURLFp,
|
|
4107
4120
|
Mn as storagePermission,
|
|
4108
|
-
|
|
4121
|
+
ki as supports,
|
|
4109
4122
|
wn as swipeBehavior,
|
|
4110
4123
|
An as switchInlineQuery,
|
|
4111
4124
|
Er as switchInlineQueryFp,
|
|
4112
|
-
|
|
4125
|
+
yi as targetOrigin,
|
|
4113
4126
|
he as themeParams,
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4127
|
+
Pi as toRGB,
|
|
4128
|
+
Oi as toRGBFp,
|
|
4129
|
+
Di as toRGBFull,
|
|
4130
|
+
Gi as toRGBFullFp,
|
|
4118
4131
|
xn as viewport
|
|
4119
4132
|
};
|
|
4120
4133
|
//# sourceMappingURL=index.js.map
|