@divkitframework/divkit
Version:
DivKit for the web
1,310 lines • 413 kB
JavaScript
var Ql = Object.defineProperty;
var ec = (r, t, e) => t in r ? Ql(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var Fr = (r, t, e) => ec(r, typeof t != "symbol" ? t + "" : t, e);
/*!
DivKit v32.61.0
https://github.com/divkit/divkit
@licence Apache-2.0
*/
function E() {
}
const tc = (r) => r;
function rc(r) {
return r();
}
function ic() {
return /* @__PURE__ */ Object.create(null);
}
function us(r) {
r.forEach(rc);
}
function nc(r) {
return typeof r == "function";
}
function oc(r, t) {
return r != r ? t == t : r !== t || r && typeof r == "object" || typeof r == "function";
}
function $(r, ...t) {
if (r == null) {
for (const i of t)
i(void 0);
return E;
}
const e = r.subscribe(...t);
return e.unsubscribe ? () => e.unsubscribe() : e;
}
function Wo(r) {
let t;
return $(r, (e) => t = e)(), t;
}
function sc(r, t, { bubbles: e = !1, cancelable: i = !1 } = {}) {
return new CustomEvent(r, { detail: t, bubbles: e, cancelable: i });
}
let In;
function Fn(r) {
In = r;
}
function jo() {
if (!In) throw new Error("Function called outside component initialization");
return In;
}
function Xr(r) {
jo().$$.on_destroy.push(r);
}
function ac() {
const r = jo();
return (t, e, { cancelable: i = !1 } = {}) => {
const n = r.$$.callbacks[t];
if (n) {
const o = sc(
/** @type {string} */
t,
e,
{ cancelable: i }
);
return n.slice().forEach((l) => {
l.call(r, o);
}), !o.defaultPrevented;
}
return !0;
};
}
function zi(r, t) {
return jo().$$.context.set(r, t), t;
}
function xr(r) {
return jo().$$.context.get(r);
}
const An = [], Bs = [];
let Kn = [];
const Ls = [], al = /* @__PURE__ */ Promise.resolve();
let Uo = !1;
function lc() {
Uo || (Uo = !0, al.then(uc));
}
function Si() {
return lc(), al;
}
function cc(r) {
Kn.push(r);
}
const So = /* @__PURE__ */ new Set();
let sn = 0;
function uc() {
if (sn !== 0)
return;
const r = In;
do {
try {
for (; sn < An.length; ) {
const t = An[sn];
sn++, Fn(t), dc(t.$$);
}
} catch (t) {
throw An.length = 0, sn = 0, t;
}
for (Fn(null), An.length = 0, sn = 0; Bs.length; ) Bs.pop()();
for (let t = 0; t < Kn.length; t += 1) {
const e = Kn[t];
So.has(e) || (So.add(e), e());
}
Kn.length = 0;
} while (An.length);
for (; Ls.length; )
Ls.pop()();
Uo = !1, So.clear(), Fn(r);
}
function dc(r) {
if (r.fragment !== null) {
r.update(), us(r.before_update);
const t = r.dirty;
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx, t), r.after_update.forEach(cc);
}
}
function fc(r) {
return (r == null ? void 0 : r.length) !== void 0 ? r : Array.from(r);
}
const gc = (
/** @type {const} */
[
"allowfullscreen",
"allowpaymentrequest",
"async",
"autofocus",
"autoplay",
"checked",
"controls",
"default",
"defer",
"disabled",
"formnovalidate",
"hidden",
"inert",
"ismap",
"loop",
"multiple",
"muted",
"nomodule",
"novalidate",
"open",
"playsinline",
"readonly",
"required",
"reversed",
"selected"
]
), hc = /* @__PURE__ */ new Set([...gc]), vc = /[&"<]/g, pc = /[&<]/g;
function ct(r, t = !1) {
const e = String(r), i = t ? vc : pc;
i.lastIndex = 0;
let n = "", o = 0;
for (; i.test(e); ) {
const l = i.lastIndex - 1, c = e[l];
n += e.substring(o, l) + (c === "&" ? "&" : c === '"' ? """ : "<"), o = l + 1;
}
return n + e.substring(o);
}
const mc = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
function Hs(r) {
return mc.test(r) || r.toLowerCase() === "!doctype";
}
const _c = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
function hn(r, t) {
const e = Object.assign({}, ...r);
if (t) {
const n = t.classes, o = t.styles;
n && (e.class == null ? e.class = n : e.class += " " + n), o && (e.style == null ? e.style = Go(o) : e.style = Go(
bc(e.style, o)
));
}
let i = "";
return Object.keys(e).forEach((n) => {
if (_c.test(n)) return;
const o = e[n];
o === !0 ? i += " " + n : hc.has(n.toLowerCase()) ? o && (i += " " + n) : o != null && (i += ` ${n}="${o}"`);
}), i;
}
function bc(r, t) {
const e = {};
for (const i of r.split(";")) {
const n = i.indexOf(":"), o = i.slice(0, n).trim(), l = i.slice(n + 1).trim();
o && (e[o] = l);
}
for (const i in t) {
const n = t[i];
n ? e[i] = n : delete e[i];
}
return e;
}
function Yr(r) {
return typeof r == "string" || r && typeof r == "object" ? ct(r, !0) : r;
}
function vn(r) {
const t = {};
for (const e in r)
t[e] = Yr(r[e]);
return t;
}
function Br(r, t) {
r = fc(r);
let e = "";
for (let i = 0; i < r.length; i += 1)
e += t(r[i], i);
return e;
}
const yc = {
$$render: () => ""
};
function er(r, t) {
if (!r || !r.$$render)
throw t === "svelte:component" && (t += " this={...}"), new Error(
`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`
);
return r;
}
let Fo;
function Dr(r) {
function t(e, i, n, o, l) {
const c = In, g = {
on_destroy: Fo,
context: new Map(l || (c ? c.$$.context : [])),
// these will be immediately discarded
on_mount: [],
before_update: [],
after_update: [],
callbacks: ic()
};
Fn({ $$: g });
const f = r(e, i, n, o);
return Fn(c), f;
}
return {
render: (e = {}, { $$slots: i = {}, context: n = /* @__PURE__ */ new Map() } = {}) => {
Fo = [];
const o = { title: "", head: "", css: /* @__PURE__ */ new Set() }, l = t(o, e, {}, i, n);
return us(Fo), {
html: l,
css: {
code: Array.from(o.css).map((c) => c.code).join(`
`),
map: null
// TODO
},
head: o.title + o.head
};
},
$$render: t
};
}
function k(r, t, e) {
if (t == null || e) return "";
const i = `="${ct(t, !0)}"`;
return ` ${r}${i}`;
}
function Go(r) {
return Object.keys(r).filter((t) => r[t] != null && r[t] !== "").map((t) => `${t}: ${Yr(r[t])};`).join(" ");
}
function Kr(r) {
const t = Go(r);
return t ? ` style="${t}"` : "";
}
const an = [];
function wc(r, t) {
return {
subscribe: Vi(r, t).subscribe
};
}
function Vi(r, t = E) {
let e;
const i = /* @__PURE__ */ new Set();
function n(c) {
if (oc(r, c) && (r = c, e)) {
const g = !an.length;
for (const f of i)
f[1](), an.push(f, r);
if (g) {
for (let f = 0; f < an.length; f += 2)
an[f][0](an[f + 1]);
an.length = 0;
}
}
}
function o(c) {
n(c(r));
}
function l(c, g = E) {
const f = [c, g];
return i.add(f), i.size === 1 && (e = t(n, o) || E), c(r), () => {
i.delete(f), i.size === 0 && e && (e(), e = null);
};
}
return { set: n, update: o, subscribe: l };
}
function tn(r, t, e) {
const i = !Array.isArray(r), n = i ? [r] : r;
if (!n.every(Boolean))
throw new Error("derived() expects stores as input, got a falsy value");
const o = t.length < 2;
return wc(e, (l, c) => {
let g = !1;
const f = [];
let v = 0, x = E;
const T = () => {
if (v)
return;
x();
const P = t(i ? f[0] : f, l, c);
o ? l(P) : x = nc(P) ? P : E;
}, O = n.map(
(P, G) => $(
P,
(I) => {
f[G] = I, v &= ~(1 << G), g && T();
},
() => {
v |= 1 << G;
}
)
);
return g = !0, T(), function() {
us(O), x(), g = !1;
};
});
}
const $c = "divkit-6d515", jc = "divkit-27458", kc = "divkit-82db1", Ec = "divkit-be734", Ac = "divkit-9a652", Ur = {
root_platform_desktop: $c,
root__clickable: jc,
"root__clickable-no-transition": "divkit-3bb57",
"root__any-actions": "divkit-ba614",
root: kc,
root__selectable: Ec,
root__unselectable: Ac,
"root__only-desktop": "divkit-316e7",
"root_restrict-scroll": "divkit-0a135",
"root_disabled-context-menu": "divkit-f5cb3"
}, Gr = Symbol("root");
function A(r, t = {}) {
const e = r;
return e.level = t.level || "error", t.additional && (e.additional = t.additional), e;
}
const xc = "divkit-bf0ea", Cc = "divkit-bab07", Vc = "divkit-07f20", Sc = "divkit-27458", Fc = "divkit-90c49", Ic = "divkit-b33bc", Dc = "divkit-f6ff9", qo = {
outer: xc,
outer_width_content: Cc,
outer_height_content: Vc,
root__clickable: Sc,
"root__clickable-no-transition": "divkit-3bb57",
"outer_hide-on-transition-in": "divkit-c5f24",
"outer_halign-self_start": "divkit-002ec",
"outer_halign-self_center": "divkit-204f8",
"outer_halign-self_end": "divkit-bd7ba",
"outer_halign-self_stretch": "divkit-02d12",
"outer_valign-self_start": "divkit-fd8aa",
"outer_valign-self_center": "divkit-62df2",
"outer_valign-self_end": "divkit-819a0",
"outer_valign-self_stretch": "divkit-8a331",
"outer_parent-flex_vertical": "divkit-46b27",
"outer_parent-flex_horizontal": "divkit-be075",
"outer_valign-self_baseline": "divkit-2b876",
"outer_width-constrained": "divkit-5bdb7",
"outer_parent-grid": "divkit-47ef2",
"outer_height-constrained": "divkit-351c8",
"outer_parent-overlap": "divkit-747b0",
"outer_scroll-snap_start": "divkit-91fd4",
"outer_scroll-snap_center": "divkit-c525d",
"outer_scroll-snap_end": "divkit-67470",
outer__border: Fc,
outer_visibility_invisible: Ic,
outer_visibility_gone: Dc,
"outer_has-action-animation": "divkit-4d4f3",
"outer_has-custom-focus": "divkit-b630e"
};
function Ar(r) {
if (!r)
return;
let t = "";
for (const e in r)
if (r.hasOwnProperty(e)) {
if (!r[e] && r[e] !== 0)
continue;
t && (t += ";"), t += e + ":" + String(r[e]);
}
return t || void 0;
}
function Me(r) {
if (typeof r != "number" && typeof r != "string" || !r)
return "0";
const t = Number(r);
return Number.isNaN(t) ? "0" : Math.ceil(t * 1e3) / 1e4 + "em";
}
function Ir(r) {
let t = Me(r);
return t === "0" && (t += "em"), t;
}
function ll(r, t) {
for (; r.length < t; )
r = "0" + r;
return r;
}
function _r(r, t = 1, e = "transparent") {
if (r = (typeof r == "string" && r || "").toLowerCase(), r.charAt(0) !== "#")
return e;
const i = Ei(r);
return i ? (i.a *= t, ds(i)) : e;
}
function Tc(r, t, e = "transparent") {
if (r = (typeof r == "string" && r || "").toLowerCase(), r.charAt(0) !== "#")
return e;
const i = Ei(r);
return i ? (i.a = t, ds(i)) : e;
}
function ds(r) {
return r.a === 255 ? `#${[r.r, r.g, r.b].map((t) => ll(Math.round(t).toString(16), 2)).join("")}` : `rgba(${r.r},${r.g},${r.b},${(r.a / 255).toFixed(2)})`;
}
function Ei(r) {
const t = (
// #AARRGGBB
r.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i) || // #ARGB
r.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i) || // #RRGGBB
r.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i) || // #RGB
r.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i)
);
if (t) {
if (t.length === 5) {
const [f, v, x, T, O] = t, P = x.length === 2 ? x : x + x, G = T.length === 2 ? T : T + T, I = O.length === 2 ? O : O + O, S = v.length === 2 ? v : v + v;
return {
a: parseInt(S, 16),
r: parseInt(P, 16),
g: parseInt(G, 16),
b: parseInt(I, 16)
};
}
const [e, i, n, o] = t, l = i.length === 2 ? i : i + i, c = n.length === 2 ? n : n + n, g = o.length === 2 ? o : o + o;
return {
a: 255,
r: parseInt(l, 16),
g: parseInt(c, 16),
b: parseInt(g, 16)
};
}
return null;
}
function Jo(r) {
let t = String(r);
return t.indexOf("&") > -1 && (t = t.replace(/&/g, "&")), t.indexOf("<") > -1 && (t = t.replace(/</g, "<")), t.indexOf(">") > -1 && (t = t.replace(/>/g, ">")), t.indexOf('"') > -1 && (t = t.replace(/"/g, """)), t;
}
const Mi = Boolean;
function ko(r, t) {
if (r.length === 1 && r[0].type === "solid")
return Pc({
bg: r[0]
});
const e = r.map((i) => {
if (i.type === "solid")
return Mc({
bg: i
});
if (i.type === "gradient")
return Oc({
bg: i
});
if (i.type === "image")
return Rc({
bg: i,
direction: t
});
if (i.type === "radial_gradient")
return Nc({
bg: i
});
}).filter(Mi).reverse().reduce(function(i, n) {
return i.image.push(n.image), i.size.push(n.size || "auto"), i.position.push(n.pos || "50% 50%"), i;
}, {
image: [],
size: [],
position: []
});
return {
image: e.image.join(","),
size: e.size.join(","),
position: e.position.join(",")
};
}
function Mc(r) {
const t = _r(r.bg.color || "transparent");
return {
size: void 0,
pos: void 0,
image: `linear-gradient(to bottom,${t},${t})`
};
}
function Pc(r) {
return {
color: _r(r.bg.color || "transparent"),
size: "auto",
position: "50% 50%"
};
}
function cl(r) {
return r.every((i) => i.color && typeof i.position == "number" && i.position >= 0 && i.position <= 1) ? r.sort((i, n) => Math.abs(i.position - n.position) < 1e-6 ? 0 : i.position - n.position).map((i) => `${_r(i.color)} ${(i.position * 100).toFixed(2)}%`).join(",") : void 0;
}
function Oc(r) {
var i, n, o, l;
if (!Array.isArray((i = r.bg) == null ? void 0 : i.colors) && !Array.isArray((n = r.bg) == null ? void 0 : n.color_map))
return;
const t = (o = r.bg.colors) == null ? void 0 : o.filter(Mi);
if (!(t != null && t.length) && !((l = r.bg) != null && l.color_map))
return;
let e;
if (r.bg.color_map) {
const c = cl(r.bg.color_map);
if (!c)
return;
e = "linear-gradient(" + (90 - Number(r.bg.angle || 0) + "deg") + "," + c + ")";
} else {
if (!t)
return;
e = "linear-gradient(" + (90 - Number(r.bg.angle || 0) + "deg") + "," + t.map((c) => _r(c)).join(",") + ")";
}
return {
size: void 0,
pos: void 0,
image: e
};
}
const zc = {
nearest_corner: "closest-corner",
farthest_corner: "farthest-corner",
nearest_side: "closest-side",
farthest_side: "farthest-side"
};
function Ws(r) {
if (r && typeof r == "object" && "type" in r && r.value !== void 0) {
if (r.type === "fixed")
return Ir(r.value);
if (r.type === "relative")
return `${Number(r.value) * 100}%`;
}
return "50%";
}
function Nc(r) {
var c, g, f, v;
if (!Array.isArray((c = r.bg) == null ? void 0 : c.colors) && !Array.isArray((g = r.bg) == null ? void 0 : g.color_map))
return;
const t = (f = r.bg.colors) == null ? void 0 : f.filter(Mi);
if (!(t != null && t.length) && !((v = r.bg) != null && v.color_map))
return;
let e;
if (r.bg.color_map ? e = cl(r.bg.color_map) : t && (e = t.map((x) => _r(x)).join(",")), !e)
return;
const i = r.bg.radius;
let n;
i && typeof i == "object" && "type" in i && i.value !== void 0 && (i.type === "fixed" ? n = Ir(i.value) : i.type === "relative" && (n = zc[i.value]));
const o = Ws(r.bg.center_x), l = Ws(r.bg.center_y);
return {
size: void 0,
pos: void 0,
image: `radial-gradient(circle ${n || "farthest-corner"} at ${o} ${l},` + e + ")"
};
}
function Rc(r) {
var e;
const t = (e = r.bg) == null ? void 0 : e.image_url;
if (t)
return {
size: ul(r.bg.scale),
pos: dl(r.bg, r.direction),
image: 'url("' + Jo(t) + '")'
};
}
function ul(r) {
return r === "fit" ? "contain" : r === "stretch" ? "fill" : r === "no_scale" ? "none" : "cover";
}
function Bc(r) {
return r === "none" ? "auto" : r === "fill" ? "100% 100%" : r;
}
function dl(r, t) {
let e, i;
return r.content_alignment_horizontal === "left" || t === "ltr" && r.content_alignment_horizontal === "start" || t === "rtl" && r.content_alignment_horizontal === "end" ? e = "0%" : r.content_alignment_horizontal === "right" || t === "ltr" && r.content_alignment_horizontal === "end" || t === "rtl" && r.content_alignment_horizontal === "start" ? e = "100%" : e = "50%", r.content_alignment_vertical === "top" ? i = "0%" : r.content_alignment_vertical === "bottom" ? i = "100%" : i = "50%", e + " " + i;
}
function Tr(r, t) {
const e = Number(r);
return Number.isNaN(e) || e < 0 ? t : e;
}
function Us(r, t, e) {
return typeof t == "number" && (r && t > 0 && t <= 100 || !r && t >= 0 && t < 100) ? t : e;
}
function Lc(r) {
return r.is_enabled !== 0 && r.is_enabled !== !1 && r.index !== void 0;
}
function Hc(r, {
visibilityActions: t,
disappearActions: e,
rootCtx: i,
componentContext: n
}) {
const o = [];
t && t.forEach((O) => {
o.push({
type: "visibility",
index: o.length,
action: O,
visible: !1,
count: 0,
finished: !1
});
}), e && e.forEach((O) => {
o.push({
type: "disappear",
index: o.length,
action: O,
// false, so disappear only works after the element becomes visible
visible: !1,
count: 0,
finished: !1
});
});
const l = o.map((O, P) => {
const G = O.type === "visibility";
return n.getDerivedFromVars({
index: P,
visibility_percentage: O.action.visibility_percentage,
visibility_duration: G ? O.action.visibility_duration : O.action.disappear_duration,
log_limit: O.action.log_limit,
is_enabled: O.action.is_enabled
}, void 0, !0);
});
let c;
const g = () => {
c && c.disconnect(), o.forEach((O) => {
O.timer && clearTimeout(O.timer);
});
}, f = tn(l, (O) => O);
let v;
const x = (O) => {
const P = O.type === "visibility";
n.execAnyActions([O.action], {
logType: P ? "visible" : "disappear",
node: r,
processUrls: !1
});
}, T = f.subscribe((O) => {
v = O.filter(Lc);
const P = {};
v.forEach((S) => {
P[S.index] = S;
}), g();
const G = [...new Set(v.map((S) => {
const Ce = o[S.index].type === "visibility";
return Us(
Ce,
S.visibility_percentage,
Ce ? 50 : 0
) / 100;
}))];
if (!G.length)
return;
const I = (S) => {
S.forEach((Ce) => {
v.forEach((q) => {
const le = o[q.index], ue = le.type === "visibility", oe = Us(
ue,
q.visibility_percentage,
ue ? 50 : 0
);
let ge;
oe === 0 ? ge = Ce.intersectionRatio >= 1e-12 : ge = Ce.intersectionRatio >= oe / 100, (ue ? !le.visible && ge : le.visible && !ge) ? le.finished || (le.timer = setTimeout(() => {
++le.count;
const me = q.log_limit === 0 ? 1 / 0 : q.log_limit || 1;
le.count >= me && (le.finished = !0), x(le);
}, Tr(q.visibility_duration, 800))) : (ue ? !ge : ge) && le.timer && clearTimeout(le.timer), le.visible = ge;
});
});
};
c = new IntersectionObserver(I, {
threshold: G
}), c.observe(r);
});
return {
destroy() {
v == null || v.forEach((O) => {
const P = o[O.index];
!P || P.type !== "disappear" || !P.visible || P.finished || i.registerTimeout(window.setTimeout(() => {
x(P);
}, O.visibility_duration));
}), g(), T();
}
};
}
function Gs(r, t) {
t && r.push(t);
}
function gr(r, t, e) {
const i = [];
Gs(i, t[r]);
for (const n in e)
if (e.hasOwnProperty(n)) {
const o = e[n];
if (o) {
const l = `${r}_${n}` + (typeof o == "string" ? `_${o}` : "");
Gs(i, t[l]);
}
}
return i.join(" ");
}
const fs = Symbol("state");
function Ii(r, t) {
var l, c;
const e = r.top || 0, i = ((l = t === "ltr" ? r.end : r.start) != null ? l : r.right) || 0, n = r.bottom || 0, o = ((c = t === "ltr" ? r.start : r.end) != null ? c : r.left) || 0;
return e === 0 && i === 0 && n === 0 && o === 0 ? "" : Me(e) + " " + Me(i) + " " + Me(n) + " " + Me(o);
}
function $n(r) {
if (typeof r != "number" && typeof r != "string")
return !1;
const t = Number(r);
return !Number.isNaN(t);
}
function fi(r) {
return $n(r) && r >= 0;
}
function ho(r, t, e) {
var n, o;
if (!r)
return e;
const i = [
r.top,
(n = t === "ltr" ? r.end : r.start) != null ? n : r.right,
r.bottom,
(o = t === "ltr" ? r.start : r.end) != null ? o : r.left
];
for (let l = 0; l < i.length; ++l)
if (i[l] && !fi(i[l]))
return e;
return Ii(r, t);
}
function Wc(r, t) {
return !fi(r) || r === void 0 || r > 1 ? t : Number(r);
}
const Uc = Object.prototype.hasOwnProperty;
function jn(r, t) {
if (Object.is(r, t))
return !0;
if (typeof r != "object" || r === null || typeof t != "object" || t === null)
return Object.is(r, t);
const e = Object.keys(r), i = Object.keys(t);
if (e.length !== i.length)
return !1;
for (let n = 0; n < e.length; n++) {
const o = e[n];
if (!Uc.call(t, o) || !jn(r[o], t[o]))
return !1;
}
return !0;
}
function Hi(r, t) {
return jn(r, t) ? t : r;
}
function Gc(r, t) {
return r === "visible" || r === "invisible" || r === "gone" ? r : t;
}
function fl(r, t) {
return r === "linear" || r === "ease" || r === "ease_in_out" || r === "ease_in" || r === "ease_out" ? r : t;
}
function vo(r, t) {
const e = Number(r);
return Number.isNaN(e) ? t : e;
}
function po(r) {
const t = [];
return r.name === "set" ? (r.items || []).forEach((e) => {
t.push(...po(e));
}) : t.push(r), t;
}
function rn(r, t) {
if (!r || typeof r != "object")
return t;
const e = [
"top",
"right",
"bottom",
"left"
];
for (let i = 0; i < e.length; ++i)
if (r[e[i]] && !fi(r[e[i]]))
return t;
return r;
}
function qc(r, t) {
if (!r && !t)
return {};
if (!t)
return r;
if (!r)
return t;
const e = {};
return [
"top",
"right",
"bottom",
"left",
"start",
"end"
].forEach((i) => {
const n = r[i];
n && (e[i] = n);
const o = t[i];
o && (e[i] = (e[i] || 0) + o);
}), e;
}
function Jc(r, t) {
const e = [
r["top-left"],
r["top-right"],
r["bottom-right"],
r["bottom-left"]
];
for (let i = 0; i < e.length; ++i)
if (e[i] && !fi(e[i]))
return t;
return r;
}
function Xn(r, t = 0, e = 10) {
return [
r["top-left"],
r["top-right"],
r["bottom-right"],
r["bottom-left"]
].map((i) => Me((i || t) / e * 10)).join(" ");
}
function Yc(r) {
var t, e, i, n, o, l;
return Me(((e = (t = r.offset) == null ? void 0 : t.x) == null ? void 0 : e.value) || 0) + " " + Me(((n = (i = r.offset) == null ? void 0 : i.y) == null ? void 0 : n.value) || 0) + " " + Me((o = r.blur) != null ? o : 2) + " " + _r(r.color || "#000000", (l = r.alpha) != null ? l : 0.19);
}
function Kc(r, t) {
var e, i, n, o, l, c;
return "drop-shadow(" + _r(r.color || "#000000", (e = r.alpha) != null ? e : 0.19) + " " + Me((((n = (i = r.offset) == null ? void 0 : i.x) == null ? void 0 : n.value) || 0) * 10 / t) + " " + Me((((l = (o = r.offset) == null ? void 0 : o.y) == null ? void 0 : l.value) || 0) * 10 / t) + " " + Me(((c = r.blur) != null ? c : 2) * 10 / t) + ")";
}
let Io;
function mo() {
return typeof matchMedia > "u" ? !1 : (Io || (Io = window.matchMedia("(prefers-reduced-motion)")), Io.matches);
}
const Xc = 8, Zc = (r, t, e, i) => {
let n;
return (e || i) && typeof ResizeObserver < "u" && (n = new ResizeObserver(async () => {
let o = 0;
const l = {}, c = (f, v) => {
if (f) {
const x = t.getVariable(f, "integer");
if (x) {
if (v = Math.round(v), l[f] || (l[f] = /* @__PURE__ */ new Set()), !l[f].has(v))
return x.setValue(v), l[f].add(v), !0;
} else {
const T = new Error("Missing variable");
T.level = "error", T.additional = {
variableName: f
}, t.logError(T);
}
}
return !1;
}, g = () => {
if (!r)
return !1;
const f = r.getBoundingClientRect(), v = c(e, f.width), x = c(i, f.height);
return v || x;
};
for (; g(); ) {
if (++o > Xc) {
const f = new Error("Recursive layout in size_provider");
f.level = "warn", f.additional = {
widthVariableName: e,
heightVariableName: i
}, t.logError(f);
break;
}
await Si();
}
}), n.observe(r)), n;
}, gs = Symbol("enabled");
function ai(r, t) {
return r === 1 || r === 0 || r === !1 || r === !0 ? !!r : t;
}
function pn(r) {
return [
r.state_description,
r.description,
r.hint
].filter(Boolean).join(", ");
}
const mn = 2;
function qs(r, t = 1) {
if (!(!r || typeof r.value != "number")) {
if (r.type === "translation-fixed")
return Me(r.value * t);
if (r.type === "translation-percentage")
return `${r.value * t}%`;
}
}
function Pn(r, t = 1) {
if (!(!r || typeof r.value != "number")) {
if (r.type === "pivot-fixed")
return Me(r.value * t);
if (r.type === "pivot-percentage")
return `${r.value * t}%`;
}
}
function Qc(r) {
return r.map((t) => {
if (t.type === "rotation") {
if (typeof t.angle == "number") {
const e = Pn(t.pivot_x) || "50%", i = Pn(t.pivot_y) || "50%", n = Pn(t.pivot_x, -1) || "-50%", o = Pn(t.pivot_y, -1) || "-50%";
return `translate(${e}, ${i}) rotate(${t.angle}deg) translate(${n}, ${o})`;
}
} else if (t.type === "translation") {
const e = qs(t.x) || 0, i = qs(t.y) || 0;
return `translate(${e}, ${i})`;
}
}).filter(Boolean).join(" ");
}
const Yo = Symbol("visibility"), eu = "divkit-ee5cc", tu = {
actionable__button: eu
};
function ru() {
}
const Qi = Symbol("action");
function gl(r) {
if (r.startsWith("tel:"))
return "tel";
if (r.startsWith("/"))
return "https";
const t = /^([^/]+):\/\//.exec(r);
return t && t[1] || "";
}
function hl(r, t) {
return t.has(r);
}
const iu = /* @__PURE__ */ new Set(["button", "image", "checkbox", "radio", "header"]), Eo = Dr((r, t, e, i) => {
let n, o, l = E, c = () => (l(), l = $(n, (fe) => o = fe), n), { componentContext: g } = t, { id: f = "" } = t, { actions: v = void 0 } = t, { doubleTapActions: x = void 0 } = t, { longTapActions: T = void 0 } = t, { pressStartActions: O = void 0 } = t, { pressEndActions: P = void 0 } = t, { hoverStartActions: G = void 0 } = t, { hoverEndActions: I = void 0 } = t, { cls: S = "" } = t, { style: Ce = null } = t, { attrs: q = void 0 } = t, { use: le = ru } = t, { customAction: ue = null } = t, { isNativeActionAnimation: oe = !0 } = t, { hasInnerFocusable: ge = !1 } = t, { customAccessibility: pe = void 0 } = t, { captureFocusOnAction: ne = !0 } = t;
const me = xr(Gr), he = xr(Qi);
zi(Qi, {
hasAction() {
return !!(he.hasAction() || v != null && v.length || (pe == null ? void 0 : pe.mode) === "exclude");
}
});
let ve, Pe = "", ze, Re = null, He = !1, Be, Xe, Ze = !1;
function ce(fe) {
}
function ie(fe) {
he.hasAction();
}
Xr(() => {
typeof window < "u" && (window.removeEventListener("pointermove", ce), window.removeEventListener("pointerup", ie), window.removeEventListener("pointercancel", ie)), f && !ge && g.detachViewInfo("focus");
}), t.componentContext === void 0 && e.componentContext && g !== void 0 && e.componentContext(g), t.id === void 0 && e.id && f !== void 0 && e.id(f), t.actions === void 0 && e.actions && v !== void 0 && e.actions(v), t.doubleTapActions === void 0 && e.doubleTapActions && x !== void 0 && e.doubleTapActions(x), t.longTapActions === void 0 && e.longTapActions && T !== void 0 && e.longTapActions(T), t.pressStartActions === void 0 && e.pressStartActions && O !== void 0 && e.pressStartActions(O), t.pressEndActions === void 0 && e.pressEndActions && P !== void 0 && e.pressEndActions(P), t.hoverStartActions === void 0 && e.hoverStartActions && G !== void 0 && e.hoverStartActions(G), t.hoverEndActions === void 0 && e.hoverEndActions && I !== void 0 && e.hoverEndActions(I), t.cls === void 0 && e.cls && S !== void 0 && e.cls(S), t.style === void 0 && e.style && Ce !== void 0 && e.style(Ce), t.attrs === void 0 && e.attrs && q !== void 0 && e.attrs(q), t.use === void 0 && e.use && le !== void 0 && e.use(le), t.customAction === void 0 && e.customAction && ue !== void 0 && e.customAction(ue), t.isNativeActionAnimation === void 0 && e.isNativeActionAnimation && oe !== void 0 && e.isNativeActionAnimation(oe), t.hasInnerFocusable === void 0 && e.hasInnerFocusable && ge !== void 0 && e.hasInnerFocusable(ge), t.customAccessibility === void 0 && e.customAccessibility && pe !== void 0 && e.customAccessibility(pe), t.captureFocusOnAction === void 0 && e.captureFocusOnAction && ne !== void 0 && e.captureFocusOnAction(ne), Ze = (pe == null ? void 0 : pe.mode) === "exclude", c(n = g.getDerivedFromVars(v, void 0, !0));
{
if (Array.isArray(o) && (o != null && o.length))
for (let fe = 0; fe < o.length; ++fe) {
const te = o[fe].url;
if (te) {
Pe = te, ze = o[fe].target || void 0;
break;
}
}
He = !!ue, (Pe || Array.isArray(o) && (o != null && o.length)) && (he.hasAction() || Ze) ? (Pe = "", g.logError(A(new Error("Actionable element is forbidden inside other actionable element or inside accessibility mode=exlucde"), {
level: "warn",
additional: { actions: o }
}))) : Pe && !hl(gl(Pe), me.getBuiltinProtocols()) ? (Pe = "", He = !0) : !Pe && Array.isArray(o) && (o != null && o.length) && (He = !0, o.some((fe) => fe.url || fe.typed || fe.menu_items) || g.logError(A(new Error("The component has a list of actions, but does not have a real action"), {
level: "warn",
additional: { actions: o }
})));
}
return pe != null && pe.type && iu.has(pe.type) ? pe.type === "header" ? Be = "heading" : pe.type === "image" ? Be = "img" : Be = pe.type : Pe ? Be = void 0 : He && (Be = "button"), (Be === "checkbox" || Be === "radio") && typeof (pe == null ? void 0 : pe.is_checked) == "boolean" ? Xe = pe.is_checked : Xe = void 0, l(), `${Pe ? `<a${hn(
[
{ href: Yr(Pe) },
{ target: Yr(ze) },
{ style: Yr(Ce) },
{ role: Yr(Be) },
{
"aria-checked": Yr(Xe)
},
{
class: ct(S, !0) + " " + ct(Ur["root__any-actions"], !0) + " " + ct(
oe ? Ur.root__clickable : Ur["root__clickable-no-transition"],
!0
) + " " + ct(
T != null && T.length ? Ur["root_disabled-context-menu"] : "",
!0
)
},
{
tabindex: Yr(g.fakeElement === mn ? -1 : null)
},
vn(q)
],
{}
)}${k("this", ve, 0)}>${i.default ? i.default({}) : ""}</a>` : `${He ? `<button${hn(
[
{
class: ct(S, !0) + " " + ct(tu.actionable__button, !0) + " " + ct(Ur["root__any-actions"], !0) + ct(
` ${oe ? Ur.root__clickable : Ur["root__clickable-no-transition"]} ${Ur.root__unselectable}`,
!0
) + " " + ct(
T != null && T.length ? Ur["root_disabled-context-menu"] : "",
!0
)
},
{ style: Yr(Ce) },
{ role: Yr(Be) },
{
"aria-checked": Yr(Xe)
},
{ type: "button" },
{
tabindex: Yr(g.fakeElement === mn ? -1 : null)
},
vn(q)
],
{}
)}${k("this", ve, 0)}>${i.default ? i.default({}) : ""}</button>` : `<span${hn(
[
{
class: ct(S, !0) + " " + ct(
T != null && T.length ? Ur["root_disabled-context-menu"] : "",
!0
) + " " + ct("", !0)
},
{ style: Yr(Ce) },
{ role: Yr(Be) },
{
"aria-checked": Yr(Xe)
},
{
"aria-hidden": Yr(Ze || void 0)
},
vn(q)
],
{}
)}${k("this", ve, 0)}>${i.default ? i.default({}) : ""}</span>`}`}`;
}), On = {
"outer-background": "divkit-7b038",
"outer-background_clip": "divkit-8fdbd",
"outer-background__item": "divkit-f9881",
"outer-background__item_hidden": "divkit-ea047"
};
function hi(r) {
return $n(r) && r > 0;
}
function vl(r, t) {
return r.map((e) => {
if (!e) {
t(A(new Error("Incorrect filter"), {
level: "warn"
}));
return;
}
if (e.type === "blur") {
if (hi(e.radius))
return `blur(${Ir(e.radius / 2)})`;
} else {
if (e.type === "rtl_mirror")
return;
t(A(new Error("Unknown filter"), {
level: "warn",
additional: {
filter: e.type
}
}));
}
}).filter(Boolean).join(" ");
}
const nu = Dr((r, t, e, i) => {
let n, { direction: o } = t, { componentContext: l } = t, { background: c = [] } = t, { radius: g = "" } = t;
return t.direction === void 0 && e.direction && o !== void 0 && e.direction(o), t.componentContext === void 0 && e.componentContext && l !== void 0 && e.componentContext(l), t.background === void 0 && e.background && c !== void 0 && e.background(c), t.radius === void 0 && e.radius && g !== void 0 && e.radius(g), n = c.map((f) => {
const v = {}, x = { style: v };
if (f.type === "nine_patch_image" && f.insets)
v["border-image"] = `url("${f.image_url}") ${f.insets.top || 0} ${f.insets.right || 0} ${f.insets.bottom || 0} ${f.insets.left || 0} fill`, v["border-image-width"] = "auto";
else {
const T = ko([f], o);
f.type === "solid" && (v["background-color"] = T.color), f.type === "gradient" && (v["background-image"] = T.image), f.type === "image" && (v.opacity = Number(f.alpha), x.image_url = f.image_url, v["object-fit"] = T.size, v["object-position"] = T.position, Array.isArray(f.filters) && f.filters.length && (v.filter = vl(f.filters, l.logError), o === "rtl" && f.filters.some((O) => O.type === "rtl_mirror") && (v.transform = "scale(-1,1)")));
}
return x;
}), `<span${k("class", On["outer-background"] + (g ? " " + On["outer-background_clip"] : ""), 0)}${Kr({ "border-radius": g })}>${Br(n, (f) => `${f.image_url ? `<img${k("src", f.image_url, 0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${k("class", On["outer-background__item"], 0)}${k("style", Ar(f.style), 0)}>` : `<span${k("class", On["outer-background__item"], 0)}${k("style", Ar(f.style), 0)}></span>`}`)}</span>`;
}), ou = {
left: "start",
center: "center",
right: "end",
start: "start",
end: "end"
}, su = {
left: "end",
center: "center",
right: "start",
start: "start",
end: "end"
}, au = {
top: "start",
center: "center",
bottom: "end",
baseline: "baseline"
}, Do = (r) => `The component id with the "${r}" property for state change is missing. Either specify the id, or specify the "transition_trigger" property without "state_change" value.`;
function lu(r) {
return r.some((t) => t.name === "native");
}
const gi = Dr((r, t, e, i) => {
var Ss, Fs, Is, Ds, Ts, Ms, Ps, Os, zs, Ns, Rs;
let n, o, l, c, g, f, v, x, T, O, P, G, I, S, Ce, q, le, ue, oe, ge, pe, ne, me, he, ve, Pe, ze = E, Re = () => (ze(), ze = $(Ce, (U) => Pe = U), Ce), He, Be = E, Xe = () => (Be(), Be = $(q, (U) => He = U), q), Ze, ce = E, ie = () => (ce(), ce = $(qe, (U) => Ze = U), qe), fe, te, se, Ve = E, ot = () => (Ve(), Ve = $(S, (U) => se = U), S), bt, tt = E, et = () => (tt(), tt = $(le, (U) => bt = U), le), B, rt = E, Je = () => (rt(), rt = $(I, (U) => B = U), I), Ke, Ge, je, lt = E, $t = () => (lt(), lt = $(G, (U) => je = U), G), ut, zt = E, Zt = () => (zt(), zt = $(o, (U) => ut = U), o), Ne, Z = E, kt = () => (Z(), Z = $(P, (U) => Ne = U), P), Se, Kt = E, Ct = () => (Kt(), Kt = $(O, (U) => Se = U), O), dt, ht = E, ae = () => (ht(), ht = $(T, (U) => dt = U), T), $e, tr = E, Ut = () => (tr(), tr = $(x, (U) => $e = U), x), ke, nt = E, be = () => (nt(), nt = $(g, (U) => ke = U), g), ft, nr = E, Q = () => (nr(), nr = $(v, (U) => ft = U), v), Ie, st = E, vt = () => (st(), st = $(f, (U) => Ie = U), f), It, jt = E, de = () => (jt(), jt = $(c, (U) => It = U), c), yt, Lt = E, Ye = () => (Lt(), Lt = $(l, (U) => yt = U), l), Ht, Wt, { componentContext: y } = t, { cls: _e = "" } = t, { style: Qt = void 0 } = t, { layoutParams: J = {} } = t, { customDescription: ar = !1 } = t, { customPaddings: or = !1 } = t, { customActions: Gt = "" } = t, { additionalPaddings: Yt = null } = t, { heightByAspect: pr = !1 } = t, { parentOf: lr = void 0 } = t, { parentOfSimpleMode: Vt = void 0 } = t, { replaceItems: wt = void 0 } = t, { hasInnerFocusable: X = !1 } = t, { alwaysCustomFocus: Pt = !1 } = t, { devapi: sr = void 0 } = t;
const Dt = xr(Gr), Ue = xr(fs), { isEnabled: Tt } = xr(gs);
Wt = $(Tt, (U) => Ht = U);
const hr = xr(Yo), Rt = Dt.direction;
Ge = $(Rt, (U) => Ke = U);
let at, pt, Y = null, qe, Ee, St = [], d = {}, M = {}, ee = !1, De = 1, Fe = "transparent", gt = 0, H = {
"top-left": 0,
"top-right": 0,
"bottom-right": 0,
"bottom-left": 0
}, Bt = "", a = null, W = "", ir = {}, Te, Pr, D, Rr = 0, fr = 0, Nt = 0, Or = !1, $r = !1, Qe = {}, Mt, br, qt, N = 0, Cr = 0, Lr = 0, jr = !1, ri = !1, u = 1, h, m, V, b, F = [], L = !1, xe = !1, ye, it, Le, Ae = [], mt = [], Et = [], yr = [], Sr = [], Hr = [], Zr = [], ni = [], Ft = [], Ot = [], re = "", s, p, j, _, z = !1, C = "visible", We, Oe, cr = !1, dr = !0, Xt, yi, Qr, oi;
function ji() {
a = null, W = "", u = 1, z = !1, C = "visible", We = void 0, dr = !0, F = y.fakeElement ? [] : y.json.transition_triggers || ["state_change", "visibility_change"], L = F.indexOf("state_change") !== -1, xe = F.indexOf("visibility_change") !== -1, at && Vs(at), Xt == null || Xt(), Ht && (Xt = Dt.processVariableTriggers(y, y.json.variable_triggers));
}
function Gl(U, _t) {
if (!Array.isArray(lr) || !wt || Vt && (Array.isArray(_t) ? _t.length : 0) !== 1)
return;
const rr = lr.findIndex((Jt) => (Jt == null ? void 0 : Jt.id) === U), wr = lr.slice();
wr.splice(rr, 1, ...(_t || []).map((Jt) => ({ json: Jt, id: Jt == null ? void 0 : Jt.id }))), lr = wr, wt(wr.map((Jt) => Jt == null ? void 0 : Jt.json));
}
function ql(U) {
const _t = vo(U.start_value, 1), rr = vo(U.end_value, 1), wr = Tr(U.start_delay, 0), Jt = mo() ? 0 : Tr(U.duration, 300), Vr = fl(U.interpolator, "ease_in_out").replace(/_/g, "-");
switch (U.name) {
case "fade":
return s = _t, p = rr, `opacity ${Jt}ms ${Vr} ${wr}ms`;
case "scale":
return j = _t, _ = rr, `transform ${Jt}ms ${Vr} ${wr}ms`;
case "native":
case "no_animation":
return "";
default:
return y.logError(A(new Error("Unknown action_animation name"), {
additional: { animation: U.name }
})), "";
}
}
const Jl = hr.visible;
te = $(Jl, (U) => fe = U);
const xs = Vi(pe);
zi(Yo, { visible: xs });
async function Yl(U) {
const _t = U === "visible" ? "in" : "out", rr = _t === "in" ? y.json.transition_in : y.json.transition_out;
if (xe && rr) {
let wr;
U === "gone" && (wr = at.getBoundingClientRect()), await Si(), _t === "in" && (it = !0), Ue.runVisibilityTransition(
{
...y.json,
visibility: "visible"
},
y,
rr,
at,
_t,
wr
).then(() => {
_t === "in" && (it = !1);
}).catch((Jt) => {
throw _t === "in" && (it = !1), Jt;
});
}
}
function Cs() {
if (Y && at) {
const U = Dt.getExtensionContext(y);
Y.forEach((_t) => {
var rr;
(rr = _t.unmountView) == null || rr.call(_t, at, U);
}), Y = null;
}
}
function Vs(U) {
var rr, wr;
yi == null || yi.destroy(), at = U, L && y.json.transition_in && (y.id ? Ue.registerChildWithTransitionIn(y.json, y, y.json.transition_in, U).then(() => {
ye = !1;
}).catch((Jt) => {
throw ye = !1, Jt;
}) : y.logError(A(new Error(Do("transition_in")), { level: "warn" }))), L && y.json.transition_out && (y.id ? Ue.registerChildWithTransitionOut(y.json, y, y.json.transition_out, U) : y.logError(A(new Error(Do("transition_out")), { level: "warn" }))), y.fakeElement || (y.json.transition_change && !y.id && y.logError(A(new Error(Do("transition_change")), { level: "warn" })), Ue.registerChildWithTransitionChange(y.json, y, y.json.transition_change, U).then(() => {
Le = !1;
}).catch((Jt) => {
throw Le = !1, Jt;
}));
const _t = y.id;
return _t && (Qr == null || Qr(), Qr = Dt.registerId(_t, {
context: () => y,
node: () => at
}), Ue.registerChild(_t)), y.json.tooltips && y.attachViewInfo("tooltips", y.json.tooltips), Oe && (Oe.disconnect(), Oe = void 0), Oe = Zc(at, y, (rr = y.json.layout_provider) == null ? void 0 : rr.width_variable_name, (wr = y.json.layout_provider) == null ? void 0 : wr.height_variable_name), y.attachViewInfo("node", () => U), yi = {
destroy() {
y.detachViewInfo("node"), Qr && (Qr(), Qr = void 0), _t && Ue.unregisterChild(_t), oi && oi.destroy();
}
}, yi;
}
function Kl() {
oi == null || oi.destroy();
const U = !y.fakeElement || y.fakeElement === mn, _t = U ? y.json.visibility_actions || y.json.visibility_action && [y.json.visibility_action] : [], rr = U ? y.json.disappear_actions : [];
Array.isArray(_t) && _t.length || Array.isArray(rr) && rr.length ? oi = Hc(at, {
visibilityActions: _t,
disappearActions: rr,
rootCtx: Dt,
componentContext: y
}) : oi = void 0;
}
function Xl() {
y.json.focus && ((Pt || !Wo(Dt.isPointerFocus)) && (cr = !0), y.execAnyActions(yr));
}
function Zl() {
y.json.focus && (cr = !1, y.execAnyActions(Sr));
}
Xr(() => {
St.forEach((U) => {
Dt.unregisterParentOf(U);
}), St = [], Oe && (Oe.disconnect(), Oe = void 0), y.detachViewInfo("tooltips"), Xt == null || Xt(), Cs();
}), t.componentContext === void 0 && e.componentContext && y !== void 0 && e.componentContext(y), t.cls === void 0 && e.cls && _e !== void 0 && e.cls(_e), t.style === void 0 && e.style && Qt !== void 0 && e.style(Qt), t.layoutParams === void 0 && e.layoutParams && J !== void 0 && e.layoutParams(J), t.customDescription === void 0 && e.customDescription && ar !== void 0 && e.customDescription(ar), t.customPaddings === void 0 && e.customPaddings && or !== void 0 && e.customPaddings(or), t.customActions === void 0 && e.customActions && Gt !== void 0 && e.customActions(Gt), t.additionalPaddings === void 0 && e.additionalPaddings && Yt !== void 0 && e.additionalPaddings(Yt), t.heightByAspect === void 0 && e.heightByAspect && pr !== void 0 && e.heightByAspect(pr), t.parentOf === void 0 && e.parentOf && lr !== void 0 && e.parentOf(lr), t.parentOfSimpleMode === void 0 && e.parentOfSimpleMode && Vt !== void 0 && e.parentOfSimpleMode(Vt), t.replaceItems === void 0 && e.replaceItems && wt !== void 0 && e.replaceItems(wt), t.hasInnerFocusable === void 0 && e.hasInnerFocusable && X !== void 0 && e.hasInnerFocusable(X), t.alwaysCustomFocus === void 0 && e.alwaysCustomFocus && Pt !== void 0 && e.alwaysCustomFocus(Pt), t.devapi === void 0 && e.devapi && sr !== void 0 && e.devapi(sr), n = y.origJson, n && ji(), Ht ? (Xt == null || Xt(), Xt = Dt.processVariableTriggers(y, y.json.variable_triggers)) : Xt == null || Xt(), Zt(o = y.getDerivedFromVars(y.json.focus)), Ye(l = y.getDerivedFromVars(y.json.border)), de(c = y.getDerivedFromVars(y.json.paddings)), be(g = y.getDerivedFromVars(y.json.margins)), vt(f = y.getDerivedFromVars(y.json.width)), Q(v = y.getDerivedFromVars(y.json.alignment_horizontal)), Ut(x = y.getDerivedFromVars(y.json.height)), ae(T = y.getDerivedFromVars(y.json.alignment_vertical)), Ct(O = y.getDerivedFromVars(y.json.alpha)), kt(P = y.getDerivedFromVars(y.json.accessibility)), $t(G = y.getDerivedFromVars(y.json.background)), Je(I = y.getDerivedFromVars(y.json.action_animation)), ot(S = y.getDerivedFromVars(y.json.visibility)), Re(Ce = y.getDerivedFromVars(y.json.transform)), Xe(q = y.getDerivedFromVars(y.json.transformations)), et(le = y.getDerivedFromVars(y.json.capture_focus_on_action)), St.forEach((U) => {
Dt.unregisterParentOf(U);
}), St = [], lr && lr.forEach((U) => {
U != null && U.id && (St.push(U.id), Dt.registerParentOf(U.id, {
replaceWith: Gl,
isSingleMode: !!Vt
}));
});
{
const U = cr && (ut != null && ut.border) ? ut.border : yt;
let _t = {}, rr = {}, wr = !1, Jt = "";
if (U) {
if (ai(U.has_shadow, !1)) {
const Vr = U.shadow;
Vr ? _t["box-shadow"] = Yc(Vr) : _t["box-shadow"] = "0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)";
}
if (U.stroke) {
wr = !0, De = Tr(U.stroke.width, De), Fe = _r(U.stroke.color, 1, Fe);
const Vr = ((Ss = U.stroke.style) == null ? void 0 : Ss.type) === "dashed" ? "dashed" : "solid";
rr["--divkit-border"] = `${Me(De + 1)} ${Vr} ${Fe}`;
}
if (U.corners_radius && typeof U.corners_radius == "object") {
H = Jc(U.corners_radius, H), _t["border-radius"] = Xn(H);
const Vr = {};
["top-left", "top-right", "bottom-right", "bottom-left"].forEach((Wr) => {
Vr[Wr] = (H[Wr] || 0) + 1;
}), rr["--divkit-border-radius"] = Xn(Vr);
} else U.corner_radius && (gt = Tr(U.corner_radius, gt), H = {
"top-left": gt,
"top-right": gt,
"bottom-right": gt,
"bottom-left": gt
}, _t["border-radius"] = Me(gt), rr["--divkit-border-radius"] = Me(gt + 1));
if (wr && De && (U.corners_radius || U.corner_radius)) {
let Vr = { ...H };
["top-left", "top-right", "bottom-right", "bottom-left"].forEach((Wr) => {
Vr[Wr] = (Vr[Wr] || 0) + De / 2;
}), Jt = Xn(Vr);
}
}
d = Hi(_t, d), M = Hi(rr, M), ee = wr, Bt = Jt;
}
a = rn(
It && !or ? It : void 0,
a
), ue = Ii(qc(a, Yt), Ke), W = ho(ke, Ke, W);
{
let U, _t, rr, wr, Jt = {}, Vr = 0, Wr = 0, pi = !1, xi = !1;
const zr = (Fs = y.json.width) == null ? void 0 : Fs.type;
if (zr === "fixed")
Rr = Tr(Ie == null ? void 0 : Ie.value, Rr), _t = Me(Rr);
else if (zr === "wrap_content" || (zr === "match_parent" || !zr) && J.parentHorizontalWrapContent)
U = "content", (zr === "wrap_content" && (Ie != null && Ie.constrained) || (zr === "match_parent" || !zr) && J.parentHorizontalWrapContent) && (Jt["width-constrained"] = !0, J.parentContainerOrientation === "horizontal" && (Wr = 1)), (zr === "match_parent" || !zr) && y.logError(A(new Error("Incorrect child size. Container with wrap_content size contains child with match_parent size along the main axis"), { level: "warn" }));
else if (U = "parent", J.parentContainerOrientation === "vertical" && J.parentContainerWrap && (xi = !0, y.logError(A(new Error("Cannot place a match_parent items on the cross-axis of wrap"), { level: "error" }))), J.parentContainerOrientation === "vertical" && J.parentContainerKnownWidth || J.stretchWidth || J.parentContainerOrientation === "horizontal" && J.treatMatchParentAs100) {
const Er = (Ds = (Is = Ke === "ltr" ? ke == null ? void 0 : ke.start : ke == null ? void 0 : ke.end) != null ? Is : ke == null ? void 0 : ke.left) != null ? Ds : 0, ii = (Ms = (Ts = Ke === "ltr" ? ke == null ? void 0 : ke.end : ke == null ? void 0 : ke.start) != null ? Ts : ke == null ? void 0 : ke.right) != null ? Ms : 0, qr = `calc(100% - ${Ir(Er + ii)})`;
J.stretchWidth ? (_t = "0", rr = qr) : _t = qr;
} else J.parentContainerOrientation === "horizontal" && (Vr = (Ie && "weight" in Ie && Ie.weight || 1) * (J.multiplyGrow || 1), J.parentContainerWrap && (pi = !0));
if (zr === "wrap_content" || zr === "match_parent") {
const Er = Ie;
let ii, qr;
Er.min_size && fi(Er.min_size.value) && (ii = Er.min_size.value), Er.max_size && fi(Er.max_size.value) && (qr = Er.max_size.value), ii !== void 0 && qr !== void 0 && ii > qr && (y.logError(A(new Error("Element has incorrect width constraints (min size is bigger than max size)."), {
additional: {
id: y.json.id,
minSize: ii + "dp",
maxSize: qr + "dp"
}
})), ii = qr = void 0), ii !== void 0 && (rr = Me(ii)), qr !== void 0 && (wr = Me(qr));
}
if (U === "parent")
Jt["halign-self"] = "stretch";
else {
const Er = ft;
Er === "left" || Er === "center" || Er === "right" || Er === "start" || Er === "end" ? Jt["halign-self"] = (Ke === "ltr" ? ou : su)[Er] : Jt["halign-self"] = J.parentHAlign || "start";
}
U && (Jt.width = U), Te = _t, Pr = rr, D = wr, fr = Vr, Nt = Wr, ir = Hi(Jt, ir), Or = pi, $r = xi;
}
{
let U, _t, rr, wr, Jt = {}, Vr = 0, Wr = 0, pi = !1, xi = !1;
const zr = (Ps = y.json.height) == null ? void 0 : Ps.type;
if (!pr) if (zr === "fixed")
N = Tr($e == null ? void 0 : $e.value, N), _t = Me(N);
else if (zr === "match_parent" && !J.parentVerticalWrapContent)
if (U = "parent", J.parentContainerOrientation === "horizontal" && J.parentContainerWrap && (xi = !0, y.logError(A(new Error("Cannot place a match_parent items on the cross-axis of wrap"), { level: "error" }))), J.parentContainerOrientation === "horizontal" && J.parentContainerKnownHeight || J.stretchHeight || J.parentContainerOrientation === "vertical" && J.treatMatchParentAs100) {
const Er = (Os = ke == null ? void 0 : ke.top) != null ? Os : 0, ii = (zs = ke == null ? void 0 : ke.bottom) != null ? zs : 0, qr = `calc(100% - ${Ir(Er + ii)})`;
J.stretchHeight ? (_t = "0", rr = qr) : _t = qr;
} else J.parentContainerOrientation === "vertical" && (Vr = (($e == null ? void 0 : $e.weight) || 1) * (J.multiplyGrow || 1), J.parentContainerWrap && (pi = !0));
else
U = "content", (zr === "wrap_content" && ($e != null && $e.constrained) || zr === "match_paren