@divkitframework/divkit 28.10.0 → 28.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/typings/common.d.ts +6 -1
package/dist/esm/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{M:()=>Qn,Os:()=>xr,sY:()=>uo}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function i(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class n{constructor(t){i(this,"_listeners","WeakMap"in r?new WeakMap:void 0),i(this,"_observer",void 0),i(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const r of t){var e;n.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function o(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return o}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t,e,r){return t.set(r),e}let u;function d(t){u=t}function p(){if(!u)throw new Error("Function called outside component initialization");return u}function g(t){p().$$.on_destroy.push(t)}function v(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}n.entries="WeakMap"in r?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(C)),_}function x(t){y.push(t)}const k=new Set;let E=0;function C(){if(0!==E)return;const t=u;do{try{for(;E<h.length;){const t=h[E];E++,d(t),F(t.$$)}}catch(t){throw h.length=0,E=0,t}for(d(null),h.length=0,E=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function F(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["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"]),V=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function D(t){return V.test(t)||"!doctype"===t.toLowerCase()}const j=/[\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 P(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=W(i):r.style=W(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(j.test(t))return;const e=r[t];!0===e?i+=" "+t:A.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const S=/[&"]/g,O=/[&<]/g;function I(t,e=!1){const r=String(t),i=e?S:O;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return n+r.substring(o)}function T(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function M(t){const e={};for(const r in t)e[r]=T(t[r]);return e}function N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let i="";for(let r=0;r<t.length;r+=1)i+=e(t[r],r);return i}const z={$$render:()=>""};function J(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> 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 <${e}>.`);return t}let R,B;function U(t){function e(e,r,i,n,o){const a=u;d({$$:{on_destroy:R,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,i,n);return d(a),s}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{R=[];const n={title:"",head:"",css:new Set},o=e(n,t,{},r,i);return s(R),{html:o,css:{code:Array.from(n.css).map((t=>t.code)).join("\n"),map:null},head:n.title+n.head}},$$render:e}}function L(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${I(e,!0)}"`}`}function W(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${T(t[e])};`)).join(" ")}function H(t){const e=W(t);return e?` style="${e}"`:""}function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t,e,r,i){var n;const o=null===(n=r[t])||void 0===n?void 0:n.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!i||!r[t])return e;if("toAttribute"===i)switch(o){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(B=class extends HTMLElement{constructor(t,e,r){super(),Z(this,"$$ctor",void 0),Z(this,"$$s",void 0),Z(this,"$$c",void 0),Z(this,"$$cn",!1),Z(this,"$$d",{}),Z(this,"$$r",!1),Z(this,"$$p_d",{}),Z(this,"$$l",{}),Z(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}(e,"name",t)},m:function(t,r){!function(t,e,r){t.insertBefore(e,r||null)}(t,e,r)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},r=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const n of this.$$s)n in r&&(e[n]=[t(n)]);for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Y(a,o.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const i=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Y(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,r){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,r,this.$$p_d,"toProp"),null===(i=this.$$c)||void 0===i||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const X=[];function K(t,e=o){let r;const i=new Set;function n(e){if(o=e,((n=t)!=n?o==o:n!==o||n&&"object"==typeof n||"function"==typeof n)&&(t=e,r)){const e=!X.length;for(const e of i)e[1](),X.push(e,t);if(e){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}var n,o}function a(e){n(e(t))}return{set:n,update:a,subscribe:function(s,l=o){const c=[s,l];return i.add(c),1===i.size&&(r=e(n,a)||o),s(t),()=>{i.delete(c),0===i.size&&r&&(r(),r=null)}}}}function Q(t,e,r){const i=!Array.isArray(t),n=i?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,r)=>{let c=!1;const u=[];let d=0,p=o;const g=()=>{if(d)return;p();const n=e(i?u[0]:u,t,r);a?t(n):p="function"==typeof n?n:o},v=n.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&g()}),(()=>{d|=1<<e}))));return c=!0,g(),function(){s(v),p(),c=!1}},{subscribe:K(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",it="divkit-ee112",nt="divkit-aa145",ot="divkit-f0cba",at=Symbol("root");function st(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const lt={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_multiline:"divkit-ee8e3",text_truncate_none:"divkit-c6ea1",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002","text_has-focus-color":"divkit-cb341"},ct={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function ut(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function dt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function gt(t,e){for(;t.length<e;)t="0"+t;return t}function vt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const i=ft(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>gt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function ft(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ht(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:vt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=vt(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>vt(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:wt(t.bg.scale),pos:$t(t.bg),image:'url("'+ht(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);if(!r.length)return;const i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=pt(i.value):"relative"===i.type&&(n=bt[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>vt(t))).join(",")+")"}}({bg:t}):void 0)).filter(mt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const bt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function _t(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return pt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function wt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function $t(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function xt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(r),!0).forEach((function(e){Ft(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ft(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function At(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Vt(t,e){e&&t.push(e)}function Dt(t,e,r){const i=[];Vt(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&Vt(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const jt=Symbol("state");function Pt(t){return dt(t.top||0)+" "+dt(t.right||0)+" "+dt(t.bottom||0)+" "+dt(t.left||0)}function St(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function Ot(t){return St(t)&&t>=0}function It(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!Ot(r[t]))return e;return Pt(t)}function Tt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const Mt=Object.prototype.hasOwnProperty;function Nt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!Mt.call(e,n)||!Nt(t[n],e[n]))return!1}return!0}function zt(t,e){return Nt(t,e)?e:t}function Jt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Rt(t,e){const r=Number(t);return isNaN(r)?e:r}function Bt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Bt(t))})):e.push(t),e}function Ut(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!Ot(t[r[i]]))return e;return t}function Lt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>dt((t||e)/r*10))).join(" ")}function Wt(){}const Ht=Symbol("action"),qt=U(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:c}=e,{use:u=Wt}=e,{customAction:d=null}=e,{isNativeActionAnimation:p=!0}=e;const g=f(at),h=f(Ht);let m;v(Ht,{hasAction:()=>Boolean(h.hasAction()||(null==n?void 0:n.length))});let y,b="",_=!1;if(void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==c&&r.attrs(c),void 0===e.use&&r.use&&void 0!==u&&r.use(u),void 0===e.customAction&&r.customAction&&void 0!==d&&r.customAction(d),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){b=e,y=n[t].target||void 0;break}}return Array.isArray(n)&&(null==n?void 0:n.length)&&h.hasAction()&&(b="",g.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}}))),_=Boolean(d),b&&!kt(xt(b),g.getBuiltinProtocols())?(b="",_=!0):!b&&Array.isArray(n)&&(null==n?void 0:n.length)&&(_=!0,n.some((t=>t.url||t.typed))||g.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:n}}))),b?`<a${P([{href:T(b)},{target:T(y)},{style:T(l)},{class:I(s,!0)+" "+I(p?tt:et,!0)+" "+I(null!=a&&a.length?ot:"",!0)},M(c)],{})}${L("this",m,0)}>${i.default?i.default({}):""}</a>`:` <span${P([{class:I(s,!0)+I(_?` ${p?tt:et} ${rt}`:"",!0)+" "+I(null!=a&&a.length?ot:"",!0)},{style:T(l)},{role:T(_?"button":null)},{tabindex:T(_?0:null)},M(c)],{})}${L("this",m,0)}>${i.default?i.default({}):""}</span>`})),Gt="divkit-b921d";function Zt(t){return St(t)&&t>0}function Yt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Zt(t.radius))return`blur(${pt(t.radius/2)})`}else e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Xt=U(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=f(at);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),n=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const i=yt([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Yt(t.filters,s.logError)))}return r})),`<span${L("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${H({"border-radius":a})}>${N(n,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Gt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Gt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Xt,Qt=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S,O,I,T,M,N,z,R,B,U,W,H,q,G,Z,Y,X,K,Q,tt,et,rt=o,it=o,nt=o,ot=o,lt=o,gt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,Et=o,Ft=o,Vt=o,St=o,Mt=o,Nt=o,Wt=o,{json:Ht={}}=e,{origJson:Gt}=e,{templateContext:Zt}=e,{cls:Yt=""}=e,{style:Xt}=e,{layoutParams:Qt={}}=e,{customDescription:te=!1}=e,{customPaddings:ee=!1}=e,{customActions:re=""}=e,{additionalPaddings:ie=null}=e,{heightByAspect:ne=!1}=e,{parentOf:oe}=e,{replaceItems:ae}=e;const se={left:"start",center:"center",right:"end"},le={top:"start",center:"center",bottom:"end",baseline:"baseline"},ce=f(at),ue=f(jt);let de,pe,ge=null,ve=[];function fe(t,e){if(!Array.isArray(oe)||!ae)return;const r=oe.findIndex((e=>(null==e?void 0:e.id)===t)),i=oe.slice();i.splice(r,1,...e||[]),oe=i,ae(i)}let he,me,ye,be,_e,we,$e,xe,ke,Ee,Ce={},Fe={},Ae=!1,Ve=1,De="transparent",je=0,Pe={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Se="",Oe=null,Ie="",Te={},Me=0,Ne=0,ze=0,Je=!1,Re=!1,Be={},Ue=0,Le=0,We=0,He=!1,qe=!1,Ge=1;const Ze=Qt.fakeElement?[]:Ht.transition_triggers||["state_change","visibility_change"],Ye=-1!==Ze.indexOf("state_change")&&Ht.id,Xe=-1!==Ze.indexOf("visibility_change")&&Ht.id;let Ke,Qe,tr,er,rr,ir,nr,or,ar,sr,lr=[],cr=[],ur=[],dr=[],pr=[],gr=[],vr="",fr=!1,hr="visible",mr=0,yr=0;function br(){Ht.focus&&(I||(sr=!0),ce.execAnyActions(dr))}function _r(){Ht.focus&&(sr=!1,ce.execAnyActions(pr))}g((()=>{var t;ve.forEach((t=>{ce.unregisterParentOf(t)})),ve=[],null===(t=Ht.tooltips)||void 0===t||t.forEach((t=>{ce.unregisterTooltip(t)}))})),void 0===e.json&&r.json&&void 0!==Ht&&r.json(Ht),void 0===e.origJson&&r.origJson&&void 0!==Gt&&r.origJson(Gt),void 0===e.templateContext&&r.templateContext&&void 0!==Zt&&r.templateContext(Zt),void 0===e.cls&&r.cls&&void 0!==Yt&&r.cls(Yt),void 0===e.style&&r.style&&void 0!==Xt&&r.style(Xt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Qt&&r.layoutParams(Qt),void 0===e.customDescription&&r.customDescription&&void 0!==te&&r.customDescription(te),void 0===e.customPaddings&&r.customPaddings&&void 0!==ee&&r.customPaddings(ee),void 0===e.customActions&&r.customActions&&void 0!==re&&r.customActions(re),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ie&&r.additionalPaddings(ie),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ne&&r.heightByAspect(ne),void 0===e.parentOf&&r.parentOf&&void 0!==oe&&r.parentOf(oe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ae&&r.replaceItems(ae),ve.forEach((t=>{ce.unregisterParentOf(t)})),ve=[],oe&&oe.forEach((t=>{t.id&&(ve.push(t.id),ce.registerParentOf(t.id,{replaceWith:fe}))})),n=ce.getDerivedFromVars(Ht.focus),lt(),lt=l(n,(t=>z=t)),a=ce.getDerivedFromVars(Ht.border),Wt(),Wt=l(a,(t=>et=t));{const t=sr&&(null==z?void 0:z.border)?z.border:et;let e={},r={},i=!1,n="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,i,n,o,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(i=t.offset)||void 0===i||null===(n=i.y)||void 0===n?void 0:n.value)||0)+" "+dt(null!==(o=t.blur)&&void 0!==o?o:2)+" "+vt(t.color||"#000000",null!==(a=t.alpha)&&void 0!==a?a:.19)}(r):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(i=!0,Ve=Tt(t.stroke.width,Ve),De=vt(t.stroke.color,1,De),r.border=`${dt(Ve)} solid ${De}`),t.corners_radius?(Pe=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!Ot(r[t]))return e;return t}(t.corners_radius,Pe),r["border-radius"]=e["border-radius"]=Lt(Pe)):t.corner_radius&&(je=Tt(t.corner_radius,je),Pe={"top-left":je,"top-right":je,"bottom-right":je,"bottom-left":je},r["border-radius"]=e["border-radius"]=dt(je)),i&&Ve&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Pe);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Ve/2})),n=Lt(t)}}Ce=zt(e,Ce),Fe=zt(r,Fe),Ae=i,Se=n}s=ce.getDerivedFromVars(Ht.paddings),Nt(),Nt=l(s,(t=>tt=t)),Oe=Ut(tt&&!ee?tt:void 0,Oe),c=Pt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}(Oe,ie)),u=ce.getDerivedFromVars(Ht.margins),St(),St=l(u,(t=>K=t)),Ie=It(K,Ie),d=ce.getDerivedFromVars(Ht.width),Ft(),Ft=l(d,(t=>Y=t)),p=ce.getDerivedFromVars(Ht.alignment_horizontal),Mt(),Mt=l(p,(t=>Q=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Me=Tt(null==Y?void 0:Y.value,Me),e=dt(Me);else if("wrap_content"!==c&&(Qt.overlapParent||"match_parent"!==c&&c||!Qt.parentHorizontalWrapContent))t="parent","vertical"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,ce.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==K?void 0:K.left)||0)+((null==K?void 0:K.right)||0))})`:"horizontal"===Qt.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,Qt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&Qt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Qt.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"!==c&&c||ce.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=Q;n["halign-self"]="left"===t||"center"===t||"right"===t?se[t]:Qt.parentHAlign||"start"}t&&(n.width=t),he=e,me=r,ye=i,Ne=o,ze=a,Te=zt(n,Te),Je=s,Re=l}v=ce.getDerivedFromVars(Ht.height),Et(),Et=l(v,(t=>Z=t)),h=ce.getDerivedFromVars(Ht.alignment_vertical),Vt(),Vt=l(h,(t=>X=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ne);else if("fixed"===c)Ue=Tt(null==Z?void 0:Z.value,Ue),e=dt(Ue);else if("match_parent"!==c||!Qt.overlapParent&&Qt.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&Qt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Qt.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&Ot(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"===c&&ce.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,ce.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==K?void 0:K.top)||0)+((null==K?void 0:K.bottom)||0))})`:"vertical"===Qt.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,Qt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Qt.parentContainerOrientation?n["valign-self"]=le[t]:n["valign-self"]=Qt.parentVAlign||"start"}t&&(n.height=t),be=e,_e=r,we=i,Le=o,We=a,Be=zt(n,Be),He=s,qe=l}var wr,$r,xr;if(m=!!Qt.overlapParent||void 0,y=Qt.overlapParent&&(!Y||"match_parent"===Y.type)&&"match_parent"===(null==Z?void 0:Z.type),b=Qt.gridArea?`${Qt.gridArea.y+1}/${Qt.gridArea.x+1}/span ${Qt.gridArea.rowSpan}/span ${Qt.gridArea.colSpan}`:void 0,_=ce.getDerivedFromVars(Ht.alpha),$t(),$t=l(_,(t=>G=t)),$r=Ge,Ge=!Ot(wr=G)||void 0===wr||wr>1?$r:Number(wr),$e=1===Ge?void 0:Ge,w=ce.getDerivedFromVars(Ht.accessibility),wt(),wt=l(w,(t=>q=t)),pe=void 0,q&&!te&&q.description&&(pe={},pe["aria-label"]=q.description),x=ce.getDerivedFromVars(Ht.background),_t(),_t=l(x,(t=>H=t)),xe=sr&&(null==z?void 0:z.background)?z.background:H,ke={},Ee=!1,Array.isArray(xe)&&(Ee=xe.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Se),!Ee)){const t=yt(xe);ke["background-color"]=t.color,ke["background-image"]=t.image,ke["background-size"]=t.size,ke["background-position"]=t.position,ke["background-repeat"]="no-repeat"}Ke=void 0,Ye&&Ht.transition_in&&ce.isRunning("stateChange")&&(Ke=!0),tr=void 0,Ye&&Ht.transition_change&&ce.isRunning("stateChange")&&ue.hasTransitionChange(Ht.id)&&(tr=!0),k=ce.getDerivedFromVars(Ht.action),ht(),ht=l(k,(t=>U=t)),E=ce.getDerivedFromVars(Ht.actions),bt(),bt=l(E,(t=>W=t)),C=ce.getDerivedFromVars(Ht.doubletap_actions),ft(),ft=l(C,(t=>B=t)),F=ce.getDerivedFromVars(Ht.longtap_actions),gt(),gt=l(F,(t=>R=t));{let t=W||U&&[U]||[],e=B||[],r=R||[],i=(null==z?void 0:z.on_focus)||[],n=(null==z?void 0:z.on_blur)||[];Qt.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],ce.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ce.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ce.logError(st(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],ce.logError(st(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],ce.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&re&&(t=[],e=[],r=[],ce.logError(st(new Error(`Cannot use action on component "${re}"`)))),lr=t,cr=e,ur=r,dr=i,pr=n}A=ce.getDerivedFromVars(Ht.action_animation),ot(),ot=l(A,(t=>N=t)),N&&(gr=Bt(N),vr=gr.map((function(t){const e=Rt(t.start_value,1),r=Rt(t.end_value,1),i=Tt(t.start_delay,0),n=Tt(t.duration,300),o=Jt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return er=e,rr=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return ir=e,nr=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ce.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),V=ce.getDerivedFromVars(Ht.visibility),nt(),nt=l(V,(t=>M=t));{const t=hr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(M,hr);t!==e&&(!fr||"visible"!==hr&&"visible"!==e?hr=e:async function(t){hr=t;const e="visible"===t?"in":"out",r="in"===e?Ht.transition_in:Ht.transition_out;Xe&&r&&(await $(),"in"===e&&(Qe=!0),ue.runVisibilityTransition(Object.assign(Object.assign({},Ht),{visibility:"visible"}),Zt,r,de,e).then((()=>{"in"===e&&(Qe=!1)})).catch((t=>{throw"in"===e&&(Qe=!1),t})))}(e)),fr||(fr=!0)}if(D=Object.assign(Object.assign(Object.assign({},Te),Be),{"parent-overlap":m,"parent-overlap-absolute":y,"scroll-snap":Qt.scrollSnap,"hide-on-transition-in":Ke||Qe||tr,visibility:hr,"has-action-animation":Boolean(vr),"parent-flex":Qt.parentContainerOrientation||void 0,"parent-grid":Boolean(Qt.gridArea)||void 0,"has-custom-focus":Boolean(sr&&Ht.focus)}),j=ce.getDerivedFromVars(Ht.transform),it(),it=l(j,(t=>T=t)),T&&void 0!==T.rotation){const t=T.pivot_x||{type:"pivot-percentage",value:50};mr=Rt(t.value,mr);const e="pivot-fixed"===t.type?dt(mr):`${mr}%`,r=T.pivot_y||{type:"pivot-percentage",value:50};yr=Rt(r.value,yr),or=`${e} ${"pivot-fixed"===r.type?dt(yr):`${yr}%`}`,ar=`rotate(${T.rotation}deg)`}return P=Je||He?"100%":Ne||Le?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Xt),ke),Ce),{width:he,"min-width":me,"max-width":ye,height:be,"min-height":_e,"max-height":we||(null==Xt?void 0:Xt["max-height"]),"grid-area":b,padding:c,margin:Ie,opacity:$e,transition:vr,"transform-origin":or,transform:ar,"flex-grow":Ne||Le||void 0,"flex-shrink":ze||We?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":er,"--divkit-animation-opacity-end":rr,"--divkit-animation-scale-start":ir,"--divkit-animation-scale-end":nr}),O=ce.isPointerFocus,rt(),rt=l(O,(t=>I=t)),rt(),it(),nt(),ot(),lt(),gt(),ft(),ht(),bt(),_t(),wt(),$t(),Et(),Ft(),Vt(),St(),Mt(),Nt(),Wt(),Re||qe?"":`${J(qt,"Actionable").$$render(t,{use:function(t){var e;de=t,Ye&&Ht.transition_in&&ue.registerChildWithTransitionIn(Ht,Zt,Ht.transition_in,t).then((()=>{Ke=!1})).catch((t=>{throw Ke=!1,t})),Ye&&Ht.transition_out&&ue.registerChildWithTransitionOut(Ht,Zt,Ht.transition_out,t),Ye&&Ht.transition_change&&ue.registerChildWithTransitionChange(Ht,Zt,Ht.transition_change,t).then((()=>{tr=!1})).catch((t=>{throw tr=!1,t}));const r=Qt.fakeElement?[]:Ht.visibility_actions||Ht.visibility_action&&[Ht.visibility_action],i=Qt.fakeElement?[]:Ht.disappear_actions;(Array.isArray(r)&&r.length||Array.isArray(i)&&i.length)&&function(t,{visibilityActions:e,disappearActions:r,rootCtx:i}){const n=[];e&&e.forEach((t=>{n.push({type:"visibility",index:n.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{n.push({type:"disappear",index:n.length,action:t,visible:!1,count:0,finished:!1})}));const o=n.map((t=>{const e="visibility"===t.type,r=i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:e?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit});return Ct(Ct({},r),{},{visibility_percentage:At(e,r.visibility_percentage,e?50:0)})})),a=[...new Set(o.map((t=>t.visibility_percentage/100)))];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=o[e.index],n="visibility"===e.type;let a;a=0===r.visibility_percentage?t.intersectionRatio>=1e-12:t.intersectionRatio>=r.visibility_percentage/100;const s=n?!e.visible&&a:e.visible&&!a,l=n?!a:a;s?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===r.log_limit?1/0:r.log_limit||1;++e.count>=t&&(e.finished=!0);const o=i.getJsonWithVars(e.action),a=o.url,s=o.typed;if(a){const t=xt(a);t&&!kt(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(o):o.log_id&&i.execCustomAction(o))}else s&&i.execAction(o);i.logStat(n?"visible":"disappear",o)}),o[e.index].visibility_duration||800)):l&&e.timer&&clearTimeout(e.timer),e.visible=a}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:r,disappearActions:i,rootCtx:ce});const n=Ht.id;n&&ue.registerChild(n),null===(e=Ht.tooltips)||void 0===e||e.forEach((e=>{ce.registerTooltip(t,e)}));let o=null;if(Array.isArray(Ht.extensions)){const e=ce.getExtensionContext();ge=Ht.extensions.map((r=>{var i;const n=ce.getExtension(r.id,r.params);return n&&(null===(i=n.mountView)||void 0===i||i.call(n,t,e)),n})).filter(mt)}return{destroy(){if(n&&ue.unregisterChild(n),ge){const e=ce.getExtensionContext();ge.forEach((r=>{var i;null===(i=r.unmountView)||void 0===i||i.call(r,t,e)})),ge=null}o&&o.destroy()}}},cls:Yt+" "+Dt("outer",ct,D),style:ut(S),actions:lr,doubleTapActions:cr,longTapActions:ur,attrs:pe,isNativeActionAnimation:!gr.length||(xr=gr,xr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ee?`${J(Kt,"OuterBackground").$$render(t,{background:xe,radius:Se},{},{})}`:""}${i.default?i.default({focusHandler:br,blurHandler:_r,hasCustomFocus:sr}):""}${Ae?`<span${L("class",ct.outer__border,0)}${L("style",ut(Fe),0)}></span>`:""}`})}`})),te=Qt,ee={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function re(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function ie(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function ne(t,e){return ie(t)||e}const oe=U(((t,e,r,i)=>{let n,o,a,s,l,c;var u,d;let{text:p}=e,{rootFontSize:g}=e,{textStyles:v={}}=e,{singleline:h=!1}=e,{actions:m}=e;const y=f(at);let b,_="none",w=12,$=1.25,x="",k="",E="",C=null;void 0===e.text&&r.text&&void 0!==p&&r.text(p),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==v&&r.textStyles(v),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==m&&r.actions(m);{let t="none";(v.underline||v.strike)&&("single"===v.underline&&"single"===v.strike?t="both":"single"===v.underline?t="underline":"single"===v.strike&&(t="strike")),_=t}return w=re(v.font_size,w),Zt(v.line_height)&&($=Number(v.line_height)/w),Ot(v.letter_spacing)&&(x=dt(v.letter_spacing)),b=ne(v.font_weight,b),k="string"==typeof v.font_family&&v.font_family?y.typefaceProvider(v.font_family,{fontWeight:b||400}):"",E=vt(v.text_color,1,E),n=v.top_offset?dt(v.top_offset):"",o=v.background?yt([v.background]):null,C=(null===(u=v.border)||void 0===u?void 0:u.stroke)&&v.border.stroke.color&&"transparent"!==vt(v.border.stroke.color)&&Zt(v.border.stroke.width)?{color:v.border.stroke.color,width:v.border.stroke.width}:null,a=re(null===(d=v.border)||void 0===d?void 0:d.corner_radius,0),s=v.text_shadow?function(t,e){var r,i,n,o,a,s;return"drop-shadow("+vt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(n=i.x)||void 0===n?void 0:n.value)||0)/e)+" "+dt(10*((null===(o=t.offset)||void 0===o||null===(a=o.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(v.text_shadow,w):void 0,l={singleline:h,decoration:_},c={"font-size":dt(10*w/g),"line-height":$,"letter-spacing":x,"font-weight":b,"font-family":k,filter:s,color:E,background:(null==o?void 0:o.color)||void 0,"box-shadow":C?`inset 0 0 0 ${dt(C.width)} ${C.color}`:void 0,"border-radius":a?dt(a):void 0},`${n?`<span${L("class",ee["text-range__top-offset"],0)}${H({"margin-top":n})}></span>`:""}${J(qt,"Actionable").$$render(t,{cls:Dt("text-range",ee,l),actions:m,style:ut(c)},{},{default:()=>`${I(p)}`})}`})),ae=oe;function se(t,e){return"left"===t||"center"===t||"right"===t?t:e}function le(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function ce(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ue(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const de=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,I,T,M,z,R,B,U,W,H=o,q=o,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,it=o,nt=o,ot=o,ct=o,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ft}=e,{layoutParams:ht}=e;const mt=f(at);let bt=!1,_t="",wt=12,$t=1.25,xt=!1,kt="",Et="",Ct=!1,Ft="left",At="top",Vt="",jt="",Pt="",St=!1,Ot=[],It=[];var Tt,Mt;g((()=>{It.forEach((([t,e])=>{mt.removeSvgFilter(t,e)}))})),void 0===e.json&&r.json&&void 0!==pt&&r.json(pt),void 0===e.templateContext&&r.templateContext&&void 0!==gt&&r.templateContext(gt),void 0===e.origJson&&r.origJson&&void 0!==ft&&r.origJson(ft),void 0===e.layoutParams&&r.layoutParams&&void 0!==ht&&r.layoutParams(ht),n=mt.getDerivedFromVars(pt.text),ct(),ct=l(n,(t=>W=t)),Tt=W,Mt=_t,_t=String(null!=Tt?Tt:"")||Mt,_t?bt=!1:(bt=!0,mt.logError(st(new Error('Missing "text" prop for div "text"')))),a=mt.getDerivedFromVars(pt.ranges),q(),q=l(a,(t=>D=t)),s=mt.getDerivedFromVars(pt.images),H(),H=l(s,(t=>V=t)),c=mt.getDerivedFromVars({font_size:pt.font_size,letter_spacing:pt.letter_spacing,font_weight:pt.font_weight,font_family:pt.font_family,text_color:pt.text_color,underline:pt.underline,strike:pt.strike,line_height:pt.line_height,text_shadow:pt.text_shadow}),G(),G=l(c,(t=>j=t)),u=mt.getDerivedFromVars(pt.font_size),ot(),ot=l(u,(t=>U=t)),wt=re(U,wt),d=mt.getDerivedFromVars(pt.line_height),nt(),nt=l(d,(t=>B=t));{const t=B;Zt(t)?($t=Number(t)/wt,xt=!0):xt=!1}p=mt.getDerivedFromVars(pt.max_lines),tt(),tt=l(p,(t=>M=t)),v=1===M;{let t="",e="",r=!1;if(M&&M>1){let i=Number(M);t=i*$t+"em",e=i,r=!0}kt=t,Et=e,Ct=r}h=mt.getDerivedFromVars(pt.text_alignment_horizontal),it(),it=l(h,(t=>R=t)),Ft=se(R,Ft),m=mt.getDerivedFromVars(pt.text_alignment_vertical),et(),et=l(m,(t=>z=t)),At=le(z,At),y=!D||_t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=_t.length,b=mt.getDerivedFromVars(pt.text_color),Q(),Q=l(b,(t=>T=t)),_=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";M&&y&&_&&(t=vt(T||D&&D[0]&&D[0].text_color,1,Vt)),Vt=t}w=mt.getDerivedFromVars(pt.focused_text_color),K(),K=l(w,(t=>I=t)),jt=vt(I,1,jt),$=mt.getDerivedFromVars(pt.truncate),X(),X=l($,(t=>O=t)),x="none"===O?"none":"",k=mt.getDerivedFromVars(pt.text_gradient),Y(),Y=l(k,(t=>S=t));{let t="";if(S){const e=yt([S]);e.image&&(t=e.image)}Pt=t}return E=mt.getDerivedFromVars(pt.selectable),Z(),Z=l(E,(t=>P=t)),St=ce(P,St),function(t,e,r){let i=[];if(It.forEach((([t,e])=>{mt.removeSvgFilter(t,e)})),It=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Ot=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":dt(10*(Number(e.font_size)||12)/wt)};let a="";const s=t.image.tint_color,c=ue(t.image.tint_mode,"source_in");if(s){const e=vt(t.image.tint_color);a=mt.addSvgFilter(e,c),It.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},j)}),Ot=i}(_t,D,V),C={singleline:v,multiline:Ct,halign:Ft,valign:At,truncate:x,"has-focus-color":Boolean(jt)},F={gradient:Boolean(Pt)},A={"font-size":dt(wt),"line-height":$t,"max-height":kt,"-webkit-line-clamp":Et,color:Vt,"background-image":Pt,"--divkit-text-focus-color":jt},H(),q(),G(),Z(),Y(),X(),K(),Q(),tt(),et(),it(),nt(),ot(),ct(),bt?"":`${J(te,"Outer").$$render(t,{cls:Dt("text",lt,C)+" "+(St?"":rt),json:pt,origJson:ft,templateContext:gt,layoutParams:ht},{},{default:()=>`<span${L("class",Dt("text__inner",lt,F),0)}${L("style",ut(A),0)}>${Ot.length?`${N(Ot,((e,r)=>"text"in e?e.text?`${J(ae,"TextRangeView").$$render(t,{text:e.text,rootFontSize:wt,textStyles:e.textStyles,singleline:v,actions:e.actions},{},{})}`:"":e.image?`<span${L("style",ut(e.image.wrapperStyle),0)}><img${L("class",lt.text__image,0)}${L("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${L("style",ut({width:e.image.width,height:e.image.height,"margin-top":xt?`-${e.image.height}`:void 0,"margin-bottom":xt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${J(ae,"TextRangeView").$$render(t,{text:_t,rootFontSize:wt,textStyles:j,singleline:v},{},{})}`}</span>`})}`})),pe=de,ge={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function ve(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function fe(t,e,r){const i=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),n=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+n:t.left=e.style.width+i),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+n:t.right=e.style.width+i)}function he(t,e,r){let i;const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return i="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+n:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],i.map(dt).join(" ")}function me(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function ye(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function be(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)i={width:Tt(null===(o=(n=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Tt(null===(a=n.item_height)||void 0===a?void 0:a.value,10),radius:Tt(null===(s=n.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Tt(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?vt(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=vt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}let _e;function we(){if(void 0!==_e)return _e;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),_e=1===t.scrollHeight,document.body.removeChild(t),_e}const $e="divkit-a7719",xe="divkit-f6e9a";function ke(t,e,r,i,n,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:n.left+a,width:Math.max(0,n.right-n.left-a-s),height:i.top-r.bottom-l-c,style:e.style}):t.push({top:n.top+l,left:r.right+a,width:i.left-r.right-a-s,height:Math.max(0,n.bottom-n.top-l-c),style:e.style})}function Ee(t,e,r,i,n,o){const a={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if(null==e?void 0:e.show_at_start){let s,l;"space-around"===n||"space-evenly"===n?(s=o.left-e.style.width,l=o.top-e.style.height):(s=r[0].left-e.style.width-e.margins.left-e.margins.right,l=r[0].top-e.style.height-e.margins.top-e.margins.bottom),ke(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,i)}if(null==e?void 0:e.show_between)for(let n=0;n<r.length-1;++n)ke(t,e,r[n],r[n+1],a,i);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===n||"space-evenly"===n?(l=o.bottom+e.style.height,c=o.right+e.style.width):(l=s.bottom+e.style.height+e.margins.top+e.margins.bottom,c=s.right+e.style.width+e.margins.left+e.margins.right),ke(t,e,s,{top:l,right:0,bottom:0,left:c},a,i)}}const Ce=U(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e;const u=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect(),e=window.getComputedStyle(n),r={top:t.top+parseFloat(e.paddingTop),right:t.right-parseFloat(e.paddingRight),bottom:t.bottom-parseFloat(e.paddingBottom),left:t.left+parseFloat(e.paddingLeft)};p=[];let i=[...n.children].filter((t=>t!==d&&!t.classList.contains(ct.outer__border))),u=[];for(;i.length;){const t=[],e=i.shift();t.push(e);let r=e.getBoundingClientRect(),n=r.right,a=r.bottom;for(;i.length;){let e=i[0],r=e.getBoundingClientRect();if("vertical"===o){if(r.top<a)break}else if(r.left<n)break;n=Math.max(n,r.right),a=Math.max(a,r.bottom),t.push(e),i.shift()}u.push(t)}const g=[];u.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&Ee(p,a,e,"vertical"===o,"vertical"===o?c:l,r);const i={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};g.push(i)})),s&&Ee(p,s,g,"horizontal"===o,"vertical"===o?l:c,r),p.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let d,p=[],v=!1,f=null,h=null;return g((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),void 0===e.contentHAlign&&r.contentHAlign&&void 0!==l&&r.contentHAlign(l),void 0===e.contentVAlign&&r.contentVAlign&&void 0!==c&&r.contentVAlign(c),n=null,(v&&n||f||h)&&(f&&(f.disconnect(),f=null),h&&(h.disconnect(),h=null),v&&n&&("undefined"!=typeof MutationObserver&&(f=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(xe))&&!(null==r?void 0:r.contains($e))}))&&u()})),f.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(u),h.observe(n)))),v&&n&&u(),` <div${L("class",$e,0)}${L("this",d,0)}>${N(p,(t=>`<div${L("class","divkit-c770e",0)}${H({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${L("class",xe,0)}${H({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`})),Fe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O=o,I=o,T=o,M=o,z=o,R=o,B=o,U=o,L=o,W=o;var H,q,G,Z,Y,X;let{json:K={}}=e,{templateContext:tt}=e,{origJson:et}=e,{layoutParams:rt}=e;const it={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},nt={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},ot=["rounded_rectangle","circle"],lt=f(at);let ct,ut,dt=!1,pt="vertical",gt="top",vt="left",ft=null,ht=null,mt={};void 0===e.json&&r.json&&void 0!==K&&r.json(K),void 0===e.templateContext&&r.templateContext&&void 0!==tt&&r.templateContext(tt),void 0===e.origJson&&r.origJson&&void 0!==et&&r.origJson(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),n=K.items,(null==n?void 0:n.length)&&Array.isArray(n)?dt=!1:(dt=!0,lt.logError(st(new Error('Incorrect or empty "items" prop for div "container"')))),a=(!dt&&n||[]).map((t=>{let e=t,r=tt;return({templateContext:r,json:e}=lt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];a.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),ct=Q(t,(t=>[...t])),U(),U=l(ct,(t=>j=t))}if(s=lt.getDerivedFromVars(K.orientation),W(),W=l(s,(t=>S=t)),pt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(S,pt),c=lt.getDerivedFromVars(K.layout_mode),L(),L=l(c,(t=>P=t)),u="wrap"===P,d="horizontal"!==pt&&!u&&j.some(me),p="vertical"!==pt&&!u&&j.some(ye),g=lt.getDerivedFromVars(K.content_alignment_vertical),B(),B=l(g,(t=>D=t)),gt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(D,gt),v=lt.getDerivedFromVars(K.content_alignment_horizontal),R(),R=l(v,(t=>V=t)),vt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(V,vt),h=lt.getDerivedFromVars(K.separator),z(),z=l(h,(t=>A=t)),(null==A?void 0:A.style)&&"overlap"!==pt&&we()){const t=be(A.style,ot,(null==ft?void 0:ft.style)||null);ft=t?{show_at_start:Boolean(null!==(H=A.show_at_start)&&void 0!==H&&H),show_at_end:Boolean(null!==(q=A.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(G=A.show_between)||void 0===G||G),style:t,margins:ve(A.margins)}:null}else ft=null;if(m=lt.getDerivedFromVars(K.line_separator),M(),M=l(m,(t=>F=t)),(null==F?void 0:F.style)&&"overlap"!==pt&&we()){const t=be(F.style,ot,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(Z=F.show_at_start)&&void 0!==Z&&Z),show_at_end:Boolean(null!==(Y=F.show_at_end)&&void 0!==Y&&Y),show_between:Boolean(null===(X=F.show_between)||void 0===X||X),style:t,margins:ve(F.margins)}:null}else ht=null;y=ft||ht?function(t,e,r){const i={};return fe(i,e,"vertical"===t),fe(i,r,"horizontal"===t),i}(pt,ft,ht):null,b=lt.getDerivedFromVars(K.aspect),T(),T=l(b,(t=>C=t));{const t=null==C?void 0:C.ratio;ut=t&&Zt(t)?t:void 0}_=lt.getDerivedFromVars(K.width),O(),O=l(_,(t=>k=t)),w=lt.getDerivedFromVars(K.height),I(),I=l(w,(t=>E=t));{let t={};(null==rt?void 0:rt.fakeElement)&&(t.fakeElement=!0),"overlap"===pt&&(t.overlapParent=!0),"horizontal"!==pt&&(t.parentHAlign=u?"start":it[vt]),"vertical"!==pt&&(t.parentVAlign=u?"start":nt[gt]),ut||p||E&&"wrap_content"!==E.type&&("match_parent"!==E.type||!(null==rt?void 0:rt.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!d&&("wrap_content"===(null==k?void 0:k.type)||"match_parent"===(null==k?void 0:k.type)&&(null==rt?void 0:rt.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===pt&&(t.parentContainerOrientation="horizontal"),"vertical"===pt&&(t.parentContainerOrientation="vertical"),u&&(t.parentContainerWrap=!0),mt=zt(t,mt)}return $={orientation:pt,valign:gt,halign:vt,wrap:u},x={gap:ft||ht?he(pt,ft,ht):void 0,"aspect-ratio":ut},O(),I(),T(),M(),z(),R(),B(),U(),L(),W(),dt?"":`${J(te,"Outer").$$render(t,{cls:Dt("container",ge,$),style:x,json:K,origJson:et,templateContext:tt,layoutParams:rt,additionalPaddings:y,heightByAspect:Boolean(ut),parentOf:n,replaceItems:function(t){K=Object.assign(Object.assign({},K),{items:t})}},{},{default:()=>`${N(a,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:mt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} ${ft||ht?`${J(Ce,"ContainerSeparators").$$render(t,{separator:ft,lineSeparator:ht,orientation:pt,contentHAlign:vt,contentVAlign:gt},{},{})}`:""}`})}`})),Ae=Fe,Ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function De(t,e){return"vertical"===t||"horizontal"===t?t:e}const je=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g=o,{json:v={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const b=f(at);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.templateContext&&r.templateContext&&void 0!==h&&r.templateContext(h),void 0===e.origJson&&r.origJson&&void 0!==m&&r.origJson(m),void 0===e.layoutParams&&r.layoutParams&&void 0!==y&&r.layoutParams(y),n=b.getDerivedFromVars(v.delimiter_style),g(),g=l(n,(t=>p=t)),_=De(null==p?void 0:p.orientation,_),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=vt(null==p?void 0:p.color,1,w),s="horizontal"===_?"100%":dt(1),c="horizontal"===_?dt(1):"100%",u={background:w,width:s,height:c},d={orientation:_},g(),`${J(te,"Outer").$$render(t,{cls:Dt("separator",Ve,d),json:v,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>a?`<span${L("class",Ve.separator__inner,0)}${L("style",ut(u),0)}></span>`:""})}`})),Pe={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Se(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Oe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,I,T,M,N,z,R,B,U=o,W=o,q=o,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,rt=o,it=o,nt=o,{json:ot={}}=e,{templateContext:lt}=e,{origJson:ct}=e,{layoutParams:dt}=e;const pt=f(at);let gt,ft=0,ht="rgba(0,0,0,0.08)",mt=!1,yt="",bt="none",_t="50% 50%",xt="0",kt="source_in",Et="",Ct="",Ft=0,At=0,Vt=0,jt="",Pt="";g((()=>{pt.removeSvgFilter(gt,kt)})),void 0===e.json&&r.json&&void 0!==ot&&r.json(ot),void 0===e.templateContext&&r.templateContext&&void 0!==lt&&r.templateContext(lt),void 0===e.origJson&&r.origJson&&void 0!==ct&&r.origJson(ct),void 0===e.layoutParams&&r.layoutParams&&void 0!==dt&&r.layoutParams(dt),n=pt.getDerivedFromVars(ot.image_url),nt(),nt=l(n,(t=>B=t)),a=pt.getDerivedFromVars(ot.gif_url),it(),it=l(a,(t=>R=t)),s=B||R,ft=0,s?mt=!1:(mt=!0,pt.logError(st(new Error('Missing "image_url" for "image"')))),c=pt.getDerivedFromVars(ot.width),rt(),rt=l(c,(t=>z=t)),u="wrap_content"===(null==z?void 0:z.type),d=pt.getDerivedFromVars(ot.height),et(),et=l(d,(t=>N=t)),p="wrap_content"===(null==N?void 0:N.type),v=pt.getDerivedFromVars(ot.preview),tt(),tt=l(v,(t=>M=t)),yt=M?`url("${Se(M)}")`:"",h=pt.getDerivedFromVars(ot.placeholder_color),Q(),Q=l(h,(t=>T=t)),ht=vt(T,1,ht),m=pt.getDerivedFromVars(ot.scale),K(),K=l(m,(t=>I=t)),bt=wt(I)||bt,y=pt.getDerivedFromVars({content_alignment_horizontal:ot.content_alignment_horizontal,content_alignment_vertical:ot.content_alignment_vertical}),X(),X=l(y,(t=>O=t)),_t=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:$t(t)}(O,_t),b=pt.getDerivedFromVars(ot.accessibility),Y(),Y=l(b,(t=>S=t)),_=(null==S?void 0:S.description)||"",w=pt.getDerivedFromVars(ot.aspect),Z(),Z=l(w,(t=>P=t));{const t=null==P?void 0:P.ratio;xt=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}$=pt.getDerivedFromVars(ot.tint_color),G(),G=l($,(t=>j=t)),x=pt.getDerivedFromVars(ot.tint_mode),q(),q=l(x,(t=>D=t));{const t=j?vt(j):void 0,e=ue(D,kt);t===gt&&e===kt||(pt.removeSvgFilter(gt,kt),Et=t?pt.addSvgFilter(t,e):"",gt=t,kt=e)}if(k=pt.getDerivedFromVars(ot.appearance_animation),W(),W=l(k,(t=>V=t)),V&&"fade"===V.type){const t=V;Ct=Jt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Vt=Tt(t.duration,300),At=Tt(t.start_delay,0),Ft=Tt(t.alpha,0)}E=pt.getDerivedFromVars(ot.filters),U(),U=l(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Yt(A,pt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),jt=t,Pt=e}return C={aspect:"0"!==xt,"is-width-content":u,"is-height-content":p,loaded:!1,"before-appearance":Boolean(Ct)&&!0},F={"background-image":yt,"background-color":yt?void 0:ht,"background-size":bt,"clip-path":Pt||void 0,"object-fit":bt,"object-position":_t,filter:["",jt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ct||void 0,"--divkit-appearance-fade-start":Ct?Ft:void 0,"--divkit-appearance-delay":Ct?`${At}ms`:void 0,"--divkit-appearance-duration":Ct?`${Vt}ms`:void 0},U(),W(),q(),G(),Z(),Y(),X(),K(),Q(),tt(),et(),rt(),it(),nt(),mt?"":`${J(te,"Outer").$$render(t,{cls:Dt("image",Pe,C),json:ot,origJson:ct,templateContext:lt,layoutParams:dt,customDescription:!0},{},{default:()=>C.aspect?`<span${L("class",Pe["image__aspect-wrapper"],0)}${H({"padding-bottom":`${xt}%`})}><img${L("class",Pe.image__image,0)}${L("src",s,0)} loading="lazy" decoding="async"${L("style",ut(F),0)}${L("alt",_,0)}${L("aria-hidden",_?null:"true",0)}></span>`:`<img${L("class",Pe.image__image,0)}${L("src",s,0)} loading="lazy" decoding="async"${L("style",ut(F),0)}${L("alt",_,0)}${L("aria-hidden",_?null:"true",0)}>`})}`})),Ie={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function Te(t){return t>0&&t<1}function Me(t){return String(Math.ceil(1e3*t)/1e3)}function Ne(t,e,r){if(t.some(Te)){const e=Math.max(...t.filter(Te).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${dt(i*t[e]/n)},${Me(t[e])}fr)`:t[e]?o[e]=`${Me(t[e])}fr`:o[e]="auto";return o.join(" ")}const ze=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b=o,_=o,w=o,$=o,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=f(at);let A,V,D=!1,j=1,P=[],S=[],O=[],I=[],T=0,M=!1,z="top",R="left";void 0===e.json&&r.json&&void 0!==x&&r.json(x),void 0===e.templateContext&&r.templateContext&&void 0!==k&&r.templateContext(k),void 0===e.origJson&&r.origJson&&void 0!==E&&r.origJson(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),n=x.items,(null==n?void 0:n.length)&&Array.isArray(n)?D=!1:(D=!0,F.logError(st(new Error('Incorrect or empty "items" prop for div "grid"')))),a=F.getDerivedFromVars(x.column_count),$(),$=l(a,(t=>y=t)),j=re(y,j),s=(!D&&n||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];s.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=Q(t,(t=>[...t])),w(),w=l(A,(t=>m=t))}{const t={};let e=0,r=0;P=[],S=[],O=[],I=[],M=!1,V=s.map(((i,n)=>{var o,a,s,l;const c=m[n],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},g="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,v="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let i=e;i<e+u;++i)for(let e=r;e<r+d;++e)t[i+"_"+e]?M=!0:(t[i+"_"+e]=!0,(!P[i]||P[i]<g)&&(P[i]=g),(!S[e]||S[e]<v)&&(S[e]=v),(!O[i]||O[i]<f)&&(O[i]=f),(!I[e]||I[e]<h)&&(I[e]=h));do{++e,e>=j&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:p,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(M=!0),M&&F.logError(st(new Error('Mismatching "grid" rows/columns'))),T=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=l(c,(t=>h=t)),z=le(h,z),u=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=l(u,(t=>v=t)),R=se(v,R),d={valign:z,halign:R},p={"grid-template-columns":Ne(P,O,j),"grid-template-rows":Ne(S,I,T)},g=D||M,b(),_(),w(),$(),g?"":`${J(te,"Outer").$$render(t,{cls:Dt("grid",Ie,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C,parentOf:x.items,replaceItems:function(t){x=Object.assign(Object.assign({},x),{items:t})}},{},{default:()=>`${N(V,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Je=ze,Re={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function Be(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function Ue(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Le=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,T,M,z=o,R=o,B=o,U=o,W=o,H=o,q=o,G=o,Z=o,Y=o,{json:X={}}=e,{templateContext:K}=e,{origJson:tt}=e,{layoutParams:et}=e;const rt=f(at);let it,ot,lt=[],ct=!1,pt=!1,gt=null,vt=!1;const ft=rt.getCustomization("galleryLeftClass"),ht=rt.getCustomization("galleryRightClass");let mt=!1;T=l(rt.isDesktop,(t=>O=t));let yt,bt,_t,wt,$t=1,xt="horizontal",kt="start",Et=8,Ct="",Ft=[],At={},Vt=!1,jt={},Pt=0;const St=Ue((function(){if(!it)return;const t=it.scrollLeft,e=it.scrollWidth,r=it.offsetWidth;ct=t>2,pt=t+r<e-2}),50);function Ot(){let t=[],e=lt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<$t;++e){const i=lt[e].children[r];i&&t.push(i)}return t}function Mt(t,e,r="smooth"){const i="horizontal"===xt,n=i?"offsetLeft":"offsetTop",o=i?"left":"top",a=t[e];a&&it.scroll({[o]:Math.max(0,a[n]+.01-Et/2),behavior:r})}function Nt(t){const e=Ot(),r=it.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===xt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===xt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!X.id||mt||(null==et?void 0:et.fakeElement)||rt.registerInstance(X.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Mt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Ot();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Mt(r,i)},setNextItem(t){const e="horizontal"===xt?it.scrollLeft+it.offsetWidth===it.scrollWidth:it.scrollTop+it.offsetHeight===it.scrollHeight,r=Ot();if(e&&"ring"===t)return void Mt(r,0);const i=Nt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Mt(r,n)}}),g((()=>{vt=!1,X.id&&!(null==et?void 0:et.fakeElement)&&rt.unregisterInstance(X.id)})),void 0===e.json&&r.json&&void 0!==X&&r.json(X),void 0===e.templateContext&&r.templateContext&&void 0!==K&&r.templateContext(K),void 0===e.origJson&&r.origJson&&void 0!==tt&&r.origJson(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),n=X.items,(null==n?void 0:n.length)&&Array.isArray(n)?mt=!1:(mt=!0,rt.logError(st(new Error('Incorrect or empty "items" prop for div "gallery"')))),a=(!mt&&n||[]).map((t=>{let e=t,r=K;return({templateContext:r,json:e}=rt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=O&&vt&&!mt,s?"undefined"!=typeof ResizeObserver&&(gt=new ResizeObserver((()=>{St()})),gt.observe(ot)):gt&&(gt.disconnect(),gt=null),c=rt.getDerivedFromVars(X.column_count),Z(),Z=l(c,(t=>S=t)),$t=re(S,$t),u=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(a,$t),d=rt.getDerivedFromVars(X.orientation),G(),G=l(d,(t=>P=t)),xt=De(P,xt),p=rt.getDerivedFromVars(X.cross_content_alignment),q(),q=l(p,(t=>j=t)),kt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(j,kt),v=rt.getDerivedFromVars(X.item_spacing),H(),H=l(v,(t=>D=t)),Et=Tt(D,Et),yt=dt(Et),h=rt.getDerivedFromVars(X.cross_spacing),W(),W=l(h,(t=>V=t)),_t=Tt(V,Et),bt=dt(_t),m=rt.getDerivedFromVars(X.paddings),U(),U=l(m,(t=>A=t)),Ct=It(A,Ct),y="horizontal"===xt?"grid-template-columns":"grid-template-rows";{let t=[];a.forEach((e=>{const r="horizontal"===xt?"width":"height";t.push(rt.getDerivedFromVars(e.json[r]))})),wt=Q(t,(t=>t)),B(),B=l(wt,(t=>F=t))}Ft=[],$t>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===xt||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),b=rt.getDerivedFromVars(X.scroll_mode),R(),R=l(b,(t=>C=t));{const t={};let e={};Vt=!1,(null==et?void 0:et.fakeElement)&&(e.fakeElement=!0),"horizontal"===xt?e.parentVAlign=kt:e.parentHAlign=kt,"paging"===C&&(Vt=!0,e.scrollSnap="start",t["horizontal"===xt?"scroll-padding-left":"scroll-padding-top"]=dt(Et/2)),1===$t&&(e.parentLayoutOrientation=xt),At=zt(t,At),jt=zt(e,jt)}return _=rt.getDerivedFromVars(X.restrict_parent_scroll),Y(),Y=l(_,(t=>M=t)),w={padding:Ct,"grid-gap":bt},$={"grid-gap":yt,[y]:Be(Ft)},x={orientation:xt,"scroll-snap":Vt},k=rt.getDerivedFromVars(X.default_item),z(),z=l(k,(t=>E=t)),Pt=Tt(E,Pt),z(),R(),B(),U(),W(),H(),q(),G(),Z(),T(),Y()," "+(mt?"":`${J(te,"Outer").$$render(t,{cls:Dt("gallery",Re,x),json:X,origJson:tt,templateContext:K,layoutParams:et,customPaddings:!0,customActions:"gallery",parentOf:n,replaceItems:function(t){X=Object.assign(Object.assign({},X),{items:t})}},{},{default:()=>`<div class="${I(Re.gallery__scroller,!0)+" "+I(M?nt:"",!0)}"${L("style",ut(At),0)}${L("this",it,0)}><div${L("class",Re["gallery__items-grid"],0)}${L("style",ut(w),0)}${L("this",ot,0)}>${N(u,((e,r)=>`<div${L("class",Re.gallery__items,0)}${L("style",ut($),0)}${L("this",lt[r],0)}>${N(e,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} </div>`))}</div></div> ${"horizontal"===xt?`${ct&&s?` <div${L("class",ft||`${Re.gallery__arrow} ${Re.gallery__arrow_left}`,0)}>${ft?"":`<svg${L("class",Re["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Re["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${pt&&s?` <div${L("class",ht||`${Re.gallery__arrow} ${Re.gallery__arrow_right}`,0)}>${ht?"":`<svg${L("class",Re["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Re["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),We=Le,He={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},qe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S=o,O=o,T=o,M=o,z=o,R=o,B=o,U=o,W=o;var q,G;let{json:Z={}}=e,{templateContext:Y}=e,{origJson:X}=e,{layoutParams:Q}=e;const tt=f(at),et=tt.genId("tabs");let rt=!1,it=K([]);x=l(it,(t=>w=t));let ot,lt,ct,gt={};const ft=tt.getJsonWithVars(Z.selected_tab);let ht,mt,yt=ft&&Number(ft)||0,bt=12,_t="",wt="",$t="",xt="",kt="",Et="",Ct="",Ft="",At="",Vt="",jt=0,St="",Mt="",Nt=null,Jt=!1,Rt=!1,Bt=yt,Wt=[],Ht=[];async function Gt(t,e=!1){if(Bt=yt,yt=t,Jt||(Jt=!0,lt.style.height=dt(lt.clientHeight),ct.style.transform=`translate3d(${100*-Bt}%,0,0)`),Rt=!0,async function(t){await $(),ct.style.transform=`translate3d(${t}%,0,0)`}(100*-yt),function(t=!1){const e=t?Math.max(0,yt-1):Math.min(yt,Bt),r=t?Math.min(n.length-1,yt+1):Math.max(yt,Bt);Wt=Wt.map(((t,i)=>t||i>=e&&i<=r)),Ht=Ht.map(((t,i)=>i>=e&&i<=r))}(),async function(){await $();const t=document.getElementById(`${et}-panel-${yt}`);t&&(lt.style.height=dt(t.offsetHeight))}(),Xt&&clearTimeout(Xt),Xt=window.setTimeout((()=>{Ht=n.map(((t,e)=>e===yt))}),400),Yt=-yt*lt.clientWidth,e){await $();const t=ot.querySelector(`.${He.tabs__item_selected}`);t&&t.focus()}}let Yt,Xt=null;if(!Z.id||rt||(null==Q?void 0:Q.fakeElement)||tt.registerInstance(Z.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');Gt(t)},setPreviousItem(t){let e=yt-1;e<0&&(e="ring"===t?n.length-1:yt),Gt(e)},setNextItem(t){let e=yt+1;e>n.length-1&&(e="ring"===t?0:yt),Gt(e)}}),g((()=>{Z.id&&!(null==Q?void 0:Q.fakeElement)&&tt.unregisterInstance(Z.id)})),void 0===e.json&&r.json&&void 0!==Z&&r.json(Z),void 0===e.templateContext&&r.templateContext&&void 0!==Y&&r.templateContext(Y),void 0===e.origJson&&r.origJson&&void 0!==X&&r.origJson(X),void 0===e.layoutParams&&r.layoutParams&&void 0!==Q&&r.layoutParams(Q),n=Z.items||[],Array.isArray(n)&&n.length){let t=[];n.forEach(((e,r)=>{const i=tt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):tt.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),it.set(t)}else it.set([]);(null==w?void 0:w.length)?rt=!1:(rt=!0,tt.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"')))),a=tt.getDerivedFromVars(Z.width),U(),U=l(a,(t=>j=t)),s=tt.getDerivedFromVars(Z.height),B(),B=l(s,(t=>D=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==j?void 0:j.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),gt=zt(t,gt)}if(!rt&&(yt<0||yt>=n.length)&&(tt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab,length:n.length}})),yt=yt<0?0:n.length-1),rt||w.some((t=>yt===t.index))||(tt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab}})),yt=(null===(q=w[0])||void 0===q?void 0:q.index)||0),c=tt.getDerivedFromVars(Z.tab_title_style),R(),R=l(c,(t=>V=t)),u=V||{},bt=re(u.font_size,bt),u.font_size||u.paddings){const t=u.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};_t=It(e,_t)}{const t=u.line_height;void 0!==t&&Zt(t)&&(wt=dt(t/bt*10))}{const t=u.letter_spacing;void 0!==t&&Ot(t)&&($t=dt(t/bt*10))}if(u.corner_radius||u.corners_radius||u.font_size){const t=null!==(G=u.corner_radius)&&void 0!==G?G:1e3;u.corners_radius?xt=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!Ot(n[t]))return i;return Lt(t,e,r)}(u.corners_radius,t,bt,xt):Ot(t)&&(xt=dt(t/bt*10))}return ht=ne(u.active_font_weight||u.font_weight,ht),kt=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:ht||400}):"",mt=ne(u.inactive_font_weight||u.font_weight,mt),Et=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:mt||400}):"",Ct=vt(u.active_text_color,1,Ct),Ft=vt(u.inactive_text_color,1,Ft),At=vt(u.active_background_color,1,At),Vt=vt(u.inactive_background_color,1,Vt),jt=Tt(u.item_spacing,jt),d=tt.getDerivedFromVars(Z.has_separator),z(),z=l(d,(t=>A=t)),p=tt.getDerivedFromVars(Z.separator_color),M(),M=l(p,(t=>F=t)),v=tt.getDerivedFromVars(Z.separator_paddings),T(),T=l(v,(t=>C=t)),A&&(F&&(St=vt(F,1,St)),C&&(Mt=It(C,Mt))),h={background:St,margin:Mt},m=tt.getDerivedFromVars(Z.switch_tabs_by_content_swipe_enabled),O(),O=l(m,(t=>E=t)),y=void 0===E||Boolean(E),b=tt.getDerivedFromVars(Z.restrict_parent_scroll),W(),W=l(b,(t=>P=t)),_=tt.getDerivedFromVars(Z.title_paddings),S(),S=l(_,(t=>k=t)),Nt=Ut(k||void 0,Nt),rt||(Wt=n.map(((t,e)=>e===yt)),Ht=n.map(((t,e)=>e===yt))),x(),S(),O(),T(),M(),z(),R(),B(),U(),W(),rt?"":`${J(te,"Outer").$$render(t,{cls:Dt("tabs",He,{}),json:Z,origJson:X,templateContext:Y,layoutParams:Q,customActions:"tabs"},{},{default:()=>` <div class="${I(He.tabs__list,!0)+" "+I(P?nt:"",!0)}" role="tablist"${H({"--divkit-tabs-title-padding":Nt?Pt(Nt):"","--divkit-tabs-font-size":dt(bt),"--divkit-tabs-paddings":_t,"--divkit-tabs-line-height":wt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ht||"","--divkit-tabs-inactive-font-weight":mt||"","--divkit-tabs-active-font-family":kt||"","--divkit-tabs-inactive-font-family":Et||"","--divkit-tabs-active-text-color":Ct,"--divkit-tabs-inactive-text-color":Ft,"--divkit-tabs-active-background-color":At,"--divkit-tabs-inactive-background-color":Vt,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":jt?pt(jt):""})}${L("this",ot,0)}>${N(w,(e=>{let r=e.index,i=r===yt;return` ${J(qt,"Actionable").$$render(t,{cls:Dt("tabs__item",He,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=Q&&Q.fakeElement?[]:[e.title_click_action],attrs:{id:`${et}-tab-${r}`,"aria-controls":`${et}-panel-${r}`,role:"tab",tabindex:!i||null!=Q&&Q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=Q&&Q.fakeElement?null:t=>function(t,e){return yt===e||(Gt(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${A?`<div${L("class",He.tabs__separator,0)}${L("style",ut(h),0)}></div>`:""} <div class="${I(He.tabs__panels,!0)+" "+I(P?nt:"",!0)}"${L("this",lt,0)}><div${L("class",Dt("tabs__swiper",He,{inited:Jt,animated:Rt}),0)}${L("this",ct,0)}>${N(w,(e=>{let r=e.index;return` <div${L("class",Dt("tabs__panel",He,{visible:Ht[r]}),0)} role="tabpanel" id="${I(et,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(et,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${Wt[r]?`${J(Wr,"Unknown").$$render(t,{div:n[r].div,templateContext:Y,layoutParams:gt},{},{})}`:""} </div>`}))}</div></div>`})}`})),Ge=qe,Ze="divkit-eb860",Ye="divkit-e08c6";function Xe(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}function Ke(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function Qe(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...Qe(t))})):e.push(t),e}Xe([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),Xe([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const tr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},er=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w=o,$=o,x=o,k=o,E=o,C=o;var F,A,V,D;let{ownerNode:j}=e,{data:P}=e,{internalId:S}=e,{templateContext:O}=e;const T=f(at);Date.now();return g((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==j&&r.ownerNode(j),void 0===e.data&&r.data&&void 0!==P&&r.data(P),void 0===e.internalId&&r.internalId&&void 0!==S&&r.internalId(S),void 0===e.templateContext&&r.templateContext&&void 0!==O&&r.templateContext(O),n=T.isDesktop,k(),k=l(n,(t=>y=t)),a=T.getDerivedFromVars(P.position),x(),x=l(a,(t=>m=t)),s=T.getDerivedFromVars(null===(A=null===(F=P.offset)||void 0===F?void 0:F.x)||void 0===A?void 0:A.value),$(),$=l(s,(t=>h=t)),c=T.getDerivedFromVars(null===(D=null===(V=P.offset)||void 0===V?void 0:V.y)||void 0===D?void 0:D.value),w(),w=l(c,(t=>v=t)),u=T.getDerivedFromVars(P.animation_in),E(),E=l(u,(t=>b=t)),d=T.getDerivedFromVars(P.animation_out),C(),C=l(d,(t=>_=t)),p={visible:!1},w(),$(),x(),k(),E(),C(),` <div class="${I(Dt("tooltip",tr,p),!0)+" "+I(y?it:"",!0)}"${H({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${J(Wr,"Unknown").$$render(t,{div:P.div,templateContext:O},{},{})}</div>`}));function rr(t){return"change_bounds"===t.type?t:"set"===t.type?rr(t.items[0]):null}const ir=U(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=f(at),u=f(jt);let d,p=new Map,h=new Set,m=!1,y=null,b=[],_=[],w=[],x=[];function k(t,e,r){let{json:i,templateContext:n,transitions:o,node:a}=e;i=c.getJsonWithVars(i),o=c.getJsonWithVars(o);const s=Qe(o),l=a.getBoundingClientRect();return{json:Object.assign(Object.assign({},i),{margins:void 0,alpha:(u=s,u.some((t=>"fade"===t.type))?void 0:i.alpha)}),templateContext:n,elementBbox:l,rootBbox:t,transitions:s,alpha:i.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node};var u}const E=o.div_id||o.id;async function C(t){if(F===t)return;c.setRunning("stateChange",!0);const e=new Set(h);b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[];let r=[];if(d){const t=d.getBoundingClientRect();r=w.map((e=>k(t,e,"out")))}x.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],x=[];const i=n.find((e=>e.state_id===t))||null;if(i?(F=t,null==j||j.setValue(F),A=i):c.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!d)return;const o=d.getBoundingClientRect();let a=_.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>k(o,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||h.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const s=r.concat(a),l=s.reduce(((t,e)=>Math.max(t,Ke(e.transitions))),0),u=x.filter((t=>p.has(t.id))).map((t=>({json:Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}}),templateContext:t.templateContext,rootBbox:o,beforeBbox:p.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:rr(t.transitions),resolvePromise:t.resolvePromise})));b=[...s.map((t=>Object.assign(Object.assign({},t),{maxDuration:l}))),...u],p.clear(),c.setRunning("stateChange",!1)}let F;E?(null==l?void 0:l.fakeElement)||(u.registerInstance(E,{setState:C,getChild(t){if(y&&y.has(t))return y.get(t);c.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}),v(jt,{registerInstance(t,e){y||(y=new Map),y.has(t)?c.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):y.set(t,e)},unregisterInstance(t){null==y||y.delete(t)},runVisibilityTransition(t,e,r,i,n){if(!d)return Promise.resolve();const o=k(d.getBoundingClientRect(),{json:t,templateContext:e,transitions:r,node:i},n),a=Ke(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return b=[...b.filter((t=>t.node!==o.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return _.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return w.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return x.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(m=!0,c.logError(st(new Error('Missing "id" prop for div "state"'))));let A=null;const V=c.getJsonWithVars(o.default_state_id),D=o.state_id_variable,j=D?c.getVariable(D,"string"):null;let P=!1;return g((()=>{E&&!(null==l?void 0:l.fakeElement)&&u.unregisterInstance(E)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),n=o.states||[],(null==n?void 0:n.length)?m=!1:(m=!0,c.logError(st(new Error('Empty "states" prop for div "state"')))),function(t){if(!P&&(P=!0,t.length)){const e=(null==j?void 0:j.getValue())||V;e?(F=e,A=t.find((t=>t.state_id===F))||null,A||c.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:F}}))):(A=t[0],F=A.state_id),j&&(j.setValue(F),j.subscribe((t=>{C(t)})))}}(n),m?"":`${J(te,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=A)&&void 0!==e&&e.div?`${J(Wr,"Unknown").$$render(t,{div:A.div,templateContext:a},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",d,0)}>${N(b,(e=>"direction"in e?`<div${L("class",Ze,0)}${H({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",Ye,0)}>${J(Wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`:`<div${L("class",Ze,0)}><div${L("class",Ye,0)}>${J(Wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`))}</div>`}})} ${null!=l&&l.tooltips?`${N(null==l?void 0:l.tooltips,(e=>`${J(er,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,templateContext:a},{},{})}`))}`:""}`})),nr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},or=U(((t,e,r,i)=>{let n,a,s,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C=o,F=o,A=o,V=o,D=o,j=o;var P,S,O,T,M,z,R;let{json:B={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:H}=e;const q=f(at),G=q.genId("pager");let Z,Y=!1,X=!1,K=0,Q=0,tt=!1,et="horizontal",rt="",it="",ot="";function lt(t,e="smooth"){const r="horizontal"===et,i=Z.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:i[n],behavior:e}),K=t}Ue((function(){if(!Y)return;const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===et?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:K}();t!==K&&(K=t)}),50),B.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(B.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');lt(t)},setPreviousItem(t){let e=K-1;e<0&&(e="ring"===t?n.length-1:K),lt(e)},setNextItem(t){let e=K+1;e>n.length-1&&(e="ring"===t?0:K),lt(e)}}),g((()=>{Y=!1,B.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(B.id)})),void 0===e.json&&r.json&&void 0!==B&&r.json(B),void 0===e.templateContext&&r.templateContext&&void 0!==U&&r.templateContext(U),void 0===e.origJson&&r.origJson&&void 0!==W&&r.origJson(W),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),(null===(P=B.items)||void 0===P?void 0:P.length)&&Array.isArray(B.items)?X=!1:(X=!0,q.logError(st(new Error('Incorrect or empty "items" prop for div "pager"')))),n=(!X&&B.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a=q.getDerivedFromVars(B.layout_mode),F(),F=l(a,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(tt=!0,q.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):tt=!1:(tt=!0,q.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),s=q.getDerivedFromVars(B.orientation),D(),D=l(s,(t=>k=t)),et=De(k,et),u=q.getDerivedFromVars(B.item_spacing),V(),V=l(u,(t=>x=t));{const t=null==x?void 0:x.value;t&&Ot(t)&&(rt=dt(t||0))}if(d=q.getDerivedFromVars(B.paddings),A(),A=l(d,(t=>$=t)),it=It($,it),p=q.getDerivedFromVars(B.restrict_parent_scroll),j(),j=l(p,(t=>E=t)),v="horizontal"===et?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=pt("horizontal"===et?((null===(S=B.paddings)||void 0===S?void 0:S.left)||0)+((null===(O=B.paddings)||void 0===O?void 0:O.right)||0):((null===(T=B.paddings)||void 0===T?void 0:T.top)||0)+((null===(M=B.paddings)||void 0===M?void 0:M.bottom)||0)),e=null===(z=w.neighbour_page_width)||void 0===z?void 0:z.value;ot=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${rt})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(R=w.page_width)||void 0===R?void 0:R.value;ot=`${Number(t)}%`}return h={"grid-gap":rt,padding:it,[v]:ot},m={orientation:et},y=X||tt,b=q.getStore("pagers"),C(),C=l(b,(t=>_=t)),function(t,e){const r=B.id;if(r){const i=new Map(_);c(b,_=i.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:lt}),_)}}(n.length,K),function(t){var e;if(t===Q)return;Q=t;const r=q.getJsonWithVars(null===(e=n[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(K),C(),F(),A(),V(),D(),j(),y?"":`${J(te,"Outer").$$render(t,{cls:Dt("pager",nr,m),json:B,origJson:W,templateContext:U,layoutParams:H,customPaddings:!0,parentOf:B.items,replaceItems:function(t){B=Object.assign(Object.assign({},B),{items:t})}},{},{default:()=>`<div class="${I(nr.pager__items,!0)+" "+I(E?nt:"",!0)}"${L("style",ut(h),0)}${L("this",Z,0)}>${N(n,(e=>`<div${L("class",nr.pager__item,0)}>${J(Wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})} </div>`))}</div>`})}`})),ar=or,sr={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},lr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,x,k,E,C,F=o,A=o,V=o,D=o,j=o,P=o,S=o,O=o,T=o;var M,z;let{json:R={}}=e,{templateContext:B}=e,{origJson:U}=e,{layoutParams:W}=e;const q=["rounded_rectangle","circle"],G=f(at);let Z,Y,X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,it=10,nt=5;if(void 0===e.json&&r.json&&void 0!==R&&r.json(R),void 0===e.templateContext&&r.templateContext&&void 0!==B&&r.templateContext(B),void 0===e.origJson&&r.origJson&&void 0!==U&&r.origJson(U),void 0===e.layoutParams&&r.layoutParams&&void 0!==W&&r.layoutParams(W),n=G.getDerivedFromVars(R.shape),P(),P=l(n,(t=>x=t)),a=G.getDerivedFromVars(R.active_item_color),D(),D=l(a,(t=>_=t)),s=G.getDerivedFromVars(R.inactive_item_color),j(),j=l(s,(t=>w=t)),c=G.getDerivedFromVars(R.active_item_size),S(),S=l(c,(t=>k=t)),u=G.getDerivedFromVars(R.active_shape),T(),T=l(u,(t=>C=t)),d=G.getDerivedFromVars(R.inactive_shape),O(),O=l(d,(t=>E=t)),C&&(K=be({type:"shape_drawable",shape:C},q,K)),E&&(Q=be({type:"shape_drawable",shape:E},q,Q)),!C&&!E&&x){const t=re(k,1.3);Q=be({type:"shape_drawable",shape:x,color:Q.background},q,Q),Q.background=vt(w,1,Q.background),K=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:K.background}),K.background=vt(_,1,K.background)}if(p=G.getDerivedFromVars(R.space_between_centers),A(),A=l(p,(t=>y=t)),g=G.getDerivedFromVars(R.items_placement),V(),V=l(g,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)et="default",y&&(rt=Tt(y.value,rt));else if(et=b.type,"default"===et)rt=Tt(null===(M=b.space_between_centers)||void 0===M?void 0:M.value,rt);else if("stretch"===et){const t=b;it=re(t.max_visible_items,it),nt=Tt(null===(z=t.item_spacing)||void 0===z?void 0:z.value,nt)}return v=G.getStore("pagers"),F(),F=l(v,(t=>m=t)),async function(t){if(R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await $(),Y)){const t=Y.children[X.currentItem].offsetLeft;Z.scroll({left:t-Z.clientWidth/2,behavior:"smooth"})}}(m),h={placement:et},F(),A(),V(),D(),j(),P(),S(),O(),T(),`${J(te,"Outer").$$render(t,{cls:Dt("indicator",sr,h),json:R,origJson:U,templateContext:B,layoutParams:W},{},{default:()=>`<div${L("class",sr.indicator__scroller,0)}${L("this",Z,0)}><div${L("class",sr.indicator__items,0)} role="tablist"${H({margin:"default"===et?`0 ${dt(Math.max(0,K.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Q.width),"--divkit-indicator-inactive-height":dt(Q.height),"--divkit-indicator-inactive-border-radius":dt(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":dt(K.width),"--divkit-indicator-active-height":dt(K.height),"--divkit-indicator-active-border-radius":dt(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/Q.width,"--divkit-indicator-default-margin":"default"===et?`0 ${dt((rt-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?dt(nt):"","--divkit-indicator-stretch-max-count":"stretch"===et?it:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?dt((it-1)*nt):""})}${L("this",Y,0)}>${X?`${N(Array(X.size),((t,e)=>{let r=e===X.currentItem;return` <div class="${I(Dt("indicator__item",sr,{active:r}),!0)+" "+I(tt,!0)}" role="tab" id="${I(X.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(X.instId,!0)+"-panel-"+I(e,!0)}"${L("aria-selected",r?"true":"false",0)}${L("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),cr=lr,ur={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function dr(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&vt(t.text_color)||"#000",n=ie(t.font_weight);if(Zt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:dt(t.font_size),fontWeight:n,textColor:i};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function pr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const gr="function"==typeof BigInt;function vr(t){return gr?BigInt(t):Number(t)}const fr=vr("9223372036854775807"),hr=vr("-9223372036854775808");function mr(t){const e=vr(t);if(e>fr||e<hr)throw new Error("Integer overflow.");return e}const yr=mr(0);function br(t){let e=t;return e<0&&(e=-e),e}function _r(t){let e=0;return t>0?e=1:t<0&&(e=-1),mr(e)}class wr{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=K(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const $r={string:class extends wr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends wr{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends wr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>fr||t<hr)throw new Error("Incorrect variable value");return mr(t)}fromString(t){const e=mr(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends wr{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends wr{convertValue(t){if("string"!=typeof t||!ft(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends wr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends wr{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}},array:class extends wr{convertValue(t){if(!Array.isArray(t))throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Array variable does not support setter from string")}getType(){return"array"}}};function xr(t,e,r){if(!(e in $r))throw new Error("Unsupported variable type");return new $r[e](t,r)}function kr(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const Er=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,T,M,z,R,B,U,W,q,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,rt=o,it=o,nt=o,ot=o;var lt,ct,ut,gt;let{json:vt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:mt}=e;const yt={width:10,height:10,borderRadius:5,background:"#000"},bt=["rounded_rectangle","circle"],_t=["rounded_rectangle"],wt=f(at),$t=f(Ht);let xt,kt=0,Et=100;const Ct=vt.thumb_value_variable,Ft=vt.thumb_secondary_value_variable;U=l(Ct&&wt.getVariable(Ct,"integer")||xr("temp","integer",0),(t=>B=t)),R=l(Ft&&wt.getVariable(Ft,"integer")||xr("temp","integer",0),(t=>z=t));let At,Vt,jt,Pt=pr(B||0,kt,Et),St=pr(z||0,kt,Et),It=yt,Tt=It,Mt=yt,Nt=yt,zt=null,Jt=null,Bt=jt,Ut="",Lt="",Wt=!1,qt=!1;function Gt(){if(!xt)return;const t=Et-kt,e=(null==zt?void 0:zt.width)||0,r=(null==Jt?void 0:Jt.width)||0;Math.max(e,r)*t>=(null==xt?void 0:xt.clientWidth)?qt||(wt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),qt=!0):qt=!1}Ue(Gt,50),void 0===e.json&&r.json&&void 0!==vt&&r.json(vt),void 0===e.templateContext&&r.templateContext&&void 0!==ft&&r.templateContext(ft),void 0===e.origJson&&r.origJson&&void 0!==ht&&r.origJson(ht),void 0===e.layoutParams&&r.layoutParams&&void 0!==mt&&r.layoutParams(mt),n=wt.getDerivedFromVars(vt.min_value),ot(),ot=l(n,(t=>q=t)),a=wt.getDerivedFromVars(vt.max_value),nt(),nt=l(a,(t=>W=t)),kt=Rt(q,kt),Et=Rt(W,Et),Gt();{const t=pr(B||0,kt,Et);t!==Pt&&(Pt=t)}{const t=pr(z||0,kt,Et);t!==St&&(St=t)}s=wt.getDerivedFromVars(vt.thumb_style),it(),it=l(s,(t=>M=t)),It=be(M,bt,It),c=wt.getDerivedFromVars(vt.thumb_secondary_style),rt(),rt=l(c,(t=>T=t)),Tt=be(T,bt,It),u=wt.getDerivedFromVars(vt.track_inactive_style),et(),et=l(u,(t=>O=t)),Mt=be(O,_t,Mt),d=wt.getDerivedFromVars(vt.track_active_style),tt(),tt=l(d,(t=>S=t)),Nt=be(S,_t,Nt),p=wt.getDerivedFromVars(vt.tick_mark_active_style),Q(),Q=l(p,(t=>P=t));{let t=be(P,bt,yt);t!==yt&&(zt=t)}zt?(At=Ft?kr(Math.min(Pt,St),Math.max(Pt,St)+1,kt,Et,!0):kr(kt,Pt,kt,Et,!0),Gt()):At=[],g=wt.getDerivedFromVars(vt.tick_mark_inactive_style),K(),K=l(g,(t=>j=t));{let t=be(j,bt,yt);t!==yt&&(Jt=t)}Jt?(Vt=Ft?kr(Math.min(Pt,St),Math.max(Pt,St)+1,kt,Et,!1):kr(Pt+1,Et+1,kt,Et,!0),Gt()):Vt=[],v=wt.getDerivedFromVars(vt.thumb_text_style),X(),X=l(v,(t=>D=t)),jt=dr(D,jt),h=wt.getDerivedFromVars(vt.thumb_secondary_text_style),Y(),Y=l(h,(t=>V=t)),Bt=dr(V,jt),m=wt.getDerivedFromVars(vt.accessibility),Z(),Z=l(m,(t=>A=t)),(null==A?void 0:A.description)?Ut=A.description:wt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=wt.getDerivedFromVars(vt.secondary_value_accessibility),G(),G=l(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:Ft&&wt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;$t.hasAction()?(wt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):It===yt?(wt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===yt?(wt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===yt&&(wt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Wt&&(Wt=t)}return b=dt(Math.max(...[It.width,Tt.width,0].filter(Ot))),_=dt(Math.max(...[It.height,Tt.height,0].filter(Ot))),w=(Pt-kt)/(Et-kt),$=Ft?(St-kt)/(Et-kt):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":dt(It.width),"--divkit-slider-thumb-height":dt(It.height),"--divkit-slider-thumb-secondary-width":dt(Tt.width),"--divkit-slider-thumb-secondary-height":dt(Tt.height),"--divkit-slider-text-offset-x":(null===(lt=null==jt?void 0:jt.offset)||void 0===lt?void 0:lt.x)?pt(jt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ct=null==jt?void 0:jt.offset)||void 0===ct?void 0:ct.y)?pt(jt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(ut=null==Bt?void 0:Bt.offset)||void 0===ut?void 0:ut.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Bt?void 0:Bt.offset)||void 0===gt?void 0:gt.y)?pt(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":zt?dt(zt.width):void 0,"--divkit-slider-tick-active-height":zt?dt(zt.height):void 0,"--divkit-slider-tick-active-border-radius":zt?dt(zt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==zt?void 0:zt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==zt?void 0:zt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Jt?dt(Jt.width):void 0,"--divkit-slider-tick-inactive-height":Jt?dt(Jt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Jt?dt(Jt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Jt?void 0:Jt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Jt?void 0:Jt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Z(),Y(),X(),K(),Q(),tt(),et(),rt(),it(),R(),U(),nt(),ot()," "+(Wt?"":`${J(te,"Outer").$$render(t,{cls:Dt("slider",ur,C),style:E,customDescription:!0,customActions:"slider",json:vt,origJson:ht,templateContext:ft,layoutParams:mt},{},{default:()=>{var t,e,r,i,n,o;return`<div${L("class",ur["slider__tracks-wrapper"],0)}><div${L("class",ur["slider__tracks-inner"],0)}${L("this",xt,0)}><div${L("class",ur.slider__track,0)}${H({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${L("class",ur["slider__active-track"],0)}${H({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:dt(Nt.height),"border-radius":dt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div> ${N(At,(t=>`<div class="${I(ur.slider__tick,!0)+" "+I(ur.slider__tick_active,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} ${N(Vt,(t=>`<div class="${I(ur.slider__tick,!0)+" "+I(ur.slider__tick_inactive,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} <div${L("class",ur.slider__thumb,0)}${H({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${jt?`<div${L("class",ur["slider__thumb-text"],0)}><div${L("class",ur["slider__thumb-text-inner"],0)}${H({"font-size":(null===(t=jt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=jt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=jt)||void 0===r?void 0:r.textColor)||"#000"})}>${I(Pt)}</div></div>`:""}</div> ${Ft?`<div class="${I(ur.slider__thumb,!0)+" "+I(ur.slider__thumb_secondary,!0)}"${H({"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}>${Bt?`<div class="${I(ur["slider__thumb-text"],!0)+" "+I(ur["slider__thumb-text_secondary"],!0)}"><div${L("class",ur["slider__thumb-text-inner"],0)}${H({"font-size":(null===(i=Bt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Bt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Bt)||void 0===o?void 0:o.textColor)||"#000"})}>${I(St)}</div></div>`:""}</div>`:""} <input type="range"${L("class",ur.slider__input,0)}${L("min",kt,0)}${L("max",Et,0)} step="1"${L("value",Pt,0)}${L("aria-label",Ut,0)}> ${Ft?`<input type="range"${L("class",`${ur.slider__input} ${ur.slider__input_secondary}`,0)}${L("min",kt,0)}${L("max",Et,0)} step="1"${L("value",St,0)}${L("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),Cr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_right":"divkit-e8038",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_top":"divkit-bdccd","input_alignment-vertical_bottom":"divkit-fc670","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function Fr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Fr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,i=e.length-1;const n=e.length-t.length;for(;r<i&&r<t.length&&t[r]===e[r];)++r;for(;i-n>=r&&t[i-n]===e[i];)--i;return++i,{start:r,added:i-r,removed:i-r-n}}function Ar(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Vr{constructor(t){this.char=t}}class Dr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class jr{constructor(t){Ar(this,"filters",new Map),Ar(this,"destructedValue",[]),Ar(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof Vr)t+=r.char;else if(r instanceof Dr)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof Dr&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(st(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new Dr(null,this.filters.get(e.key),e.placeholder):new Vr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=Fr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const i=this.buildBodySubstring(r,t),n=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=n?this.calculateMaxShift(n,o):void 0;this.replaceChars(i,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(n,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,i=e;for(;i<this.destructedValue.length;)this.destructedValue[i]instanceof Dr&&++r,++i;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let i=0;for(;i<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+i);)++i;return Math.max(0,i-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof Dr&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof Dr&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let i;i=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=i}calculateInsertableSubstring(t,e){let r="",i=e;const n=()=>{for(var t;i<this.destructedValue.length&&!(this.destructedValue[i]instanceof Dr);)++i;return null===(t=this.destructedValue[i])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=n();null!=e&&e.test(t)&&(r+=t,++i)})),r}collectValueRange(t,e){let r="",i=t;for(;i<=e;){const t=this.destructedValue[i];t instanceof Dr&&null!==t.char&&(r+=t.char),++i}return r}replaceChars(t,e,r){let i=this.calculateInsertableSubstring(t,e);void 0!==r&&(i=i.substring(0,r));let n=e,o=0;for(;n<this.destructedValue.length&&o<i.length;){const t=this.destructedValue[n],e=i[o];t instanceof Dr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof Dr);)++e;return e}}class Pr extends jr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Sr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Or extends jr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Sr(this,"currencyFormatter",new Intl.NumberFormat),Sr(this,"decimalSeparator","."),Sr(this,"localeDigits",{}),Sr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(st(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),i=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:i,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Fr(this.value,t),i=this.value.lastIndexOf(this.decimalSeparator),n=t.lastIndexOf(this.decimalSeparator),o=i!==n||-1===i&&-1===n,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,i=0;for(;i<t.length;){if(t[i]===this.decimalSeparator&&!this.inDiff(e,i)){r=i;break}i++}let n=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(n=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(i=r;i<t.length;)this.isDigit(t[i])&&!this.inDiff(e,i)&&a--,i++;else{let r=!1;for(let i=0;i<t.length;i++){const n=t[i];n===this.decimalSeparator?r=!0:!this.inDiff(e,i)&&r&&this.isDigit(n)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==n,l=[];i=t.length-1;let c=!1;for(;i>=0;){const u=t[i],d=l.length<=o;this.isDigit(u)?this.inDiff(e,i)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&i===n?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==i&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=i),i--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function Ir(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function Tr(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),i=t.parentNode,n=Array.from(i.childNodes).indexOf(t)+1;r.setStart(i,n),r.setEnd(i,n),e.addRange(r)}}catch(t){}else for(let r=0,i=t.childNodes.length;r<i;++r){const i=t.childNodes[r],n=Ir(i);if(e<=n)return void Tr(i,e);e-=n}else try{const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStart(t,e),i.setEnd(t,e),r.addRange(i)}}catch(t){}}const Mr=U(((t,e,r,i)=>{let n,a,s,u,d,p,g,v,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S,O,T,M,N,z,R,B,U,W,H,q,G,Z,Y,X,K,Q,tt,et,rt=o,it=o;var nt;let{json:ot={}}=e,{templateContext:lt}=e,{origJson:ct}=e,{layoutParams:gt}=e;const ft=f(at);let ht,mt=null;const yt=ot.text_variable,bt=null===(nt=ot.mask)||void 0===nt?void 0:nt.raw_text_variable;let _t=!1;yt||(_t=!0,ft.logError(st(new Error('Missing "text_variable" in "input"'))));let wt=yt&&ft.getVariable(yt,"string")||xr("temp","string","");m=l(wt,(t=>h=t));let $t=bt&&ft.getVariable(bt,"string")||xr("temp","string","");b=l($t,(t=>y=t));let xt="",kt="";C=l(ft.getDerivedFromVars(ot.mask),(t=>E=t)),Q=l(ft.getDerivedFromVars(ot.hint_text),(t=>K=t)),X=l(ft.getDerivedFromVars(ot.hint_color),(t=>Y=t));let Et="";Z=l(ft.getDerivedFromVars(ot.font_size),(t=>G=t));let Ct,Ft=12;q=l(ft.getDerivedFromVars(ot.font_weight),(t=>H=t)),W=l(ft.getDerivedFromVars(ot.font_family),(t=>U=t));let At,Vt="";B=l(ft.getDerivedFromVars(ot.line_height),(t=>R=t)),z=l(ft.getDerivedFromVars(ot.letter_spacing),(t=>N=t));let jt="";M=l(ft.getDerivedFromVars(ot.text_color),(t=>T=t));let Ot="#000";O=l(ft.getDerivedFromVars(ot.highlight_color),(t=>S=t));let It="";P=l(ft.getDerivedFromVars(ot.text_alignment_horizontal),(t=>j=t));let Mt="left";D=l(ft.getDerivedFromVars(ot.text_alignment_vertical),(t=>V=t));let Nt="center";A=l(ft.getDerivedFromVars(ot.keyboard_type),(t=>F=t));const zt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Jt="multi_line_text",Rt="text";const Bt="undefined"!=typeof document&&"inputMode"in document.createElement("input");let Lt;k=l(ft.getDerivedFromVars(ot.max_visible_lines),(t=>x=t));let Wt="",Ht=null,qt="",Gt="",Yt="";function Xt(t){ht instanceof HTMLInputElement?ht.selectionStart=ht.selectionEnd=t:Tr(ht,t)}async function Kt(){if(!ht||!mt)return;mt.overrideRawValue(y),$t.set(mt.rawValue),c(wt,h=xt=kt=mt.value,h);const t=mt.cursorPosition;await $(),document.activeElement===ht&&Xt(t)}var Qt;et=l(ft.getDerivedFromVars(ot.select_all_on_focus),(t=>tt=t)),void 0===e.json&&r.json&&void 0!==ot&&r.json(ot),void 0===e.templateContext&&r.templateContext&&void 0!==lt&&r.templateContext(lt),void 0===e.origJson&&r.origJson&&void 0!==ct&&r.origJson(ct),void 0===e.layoutParams&&r.layoutParams&&void 0!==gt&&r.layoutParams(gt),"fixed_length"===(null==(Qt=E)?void 0:Qt.type)?mt=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const i={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(i),r):new Pr(i,e)}return r||null}(Qt,ft.logError,mt):"currency"===(null==Qt?void 0:Qt.type)&&(mt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new Or(t.locale,e)}(Qt,ft.logError,mt)),mt&&Kt(),mt||xt===h||(xt=kt=h),mt&&mt.rawValue!==y&&Kt(),n=K,Et=vt(Y,1,Et),Ft=re(G,Ft),Ct=ne(H,Ct),Vt=U&&"string"==typeof U?ft.typefaceProvider(U,{fontWeight:Ct||400}):"";{const t=R;Zt(t)&&(At=t/Ft)}return St(N)&&(jt=dt(N)),Ot=vt(T,1,Ot),It=vt(S,1,It),Mt=se(j,Mt),Nt=le(V,Nt),F&&F in zt&&(Rt=zt[F],Jt=F),"currency"===(null==E?void 0:E.type)&&(Rt=Bt?"text":"tel",Lt="decimal"),a="multi_line_text"===Jt,s=ft.getDerivedFromVars(ot.paddings),it(),it=l(s,(t=>w=t)),Zt(x)&&(Wt=`calc(${x*(At||1.25)*(Ft/10)+"em"} + ${pt(Tt(null==w?void 0:w.top,0)+Tt(null==w?void 0:w.bottom,0))})`),Ht=Ut(w||void 0,Ht),qt=Ht?Pt({top:(Number(Ht.top)||0)/Ft*10,right:(Number(Ht.right)||0)/Ft*10,bottom:(Number(Ht.bottom)||0)/Ft*10,left:(Number(Ht.left)||0)/Ft*10}):"",Gt=Ht?Pt({top:(Number(Ht.top)||0)/Ft*10,bottom:(Number(Ht.bottom)||0)/Ft*10}):"",u=ft.getDerivedFromVars(ot.accessibility),rt(),rt=l(u,(t=>_=t)),(null==_?void 0:_.description)?Yt=_.description:ft.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(It),multiline:a,"alignment-horizontal":Mt,"alignment-vertical":Nt},p={"--divkit-input-hint-color":Et,"--divkit-input-highlight-color":It,"--divkit-input-line-height":At,"font-weight":Ct,"font-family":Vt,"letter-spacing":jt,color:Ot,"max-height":Wt},g={"font-size":dt(Ft),padding:qt},v={"font-size":dt(Ft),padding:Gt},m(),b(),rt(),it(),k(),C(),A(),D(),P(),O(),M(),z(),B(),W(),q(),Z(),X(),Q(),et(),_t?"":`${J(te,"Outer").$$render(t,{cls:Dt("input",Cr,d),style:p,customDescription:!0,customActions:"input",customPaddings:!0,json:ot,origJson:ct,templateContext:lt,layoutParams:gt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return a?`<span${L("class",Cr["input__scroll-wrapper"],0)}>${!kt&&n?`<div${L("class",Cr.input__placeholder,0)} aria-hidden="true"${L("style",ut(g),0)}>${I(n)}</div>`:""} <span aria-hidden="true"${L("style",ut(v),0)}></span> <span${L("class",Dt("input__input",Cr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",Yt,0)}${L("style",ut(g),0)}${L("this",ht,0)}>${i=kt,void 0===i?"":i}</span></span>`:`<input${L("type",Rt,0)}${L("inputmode",Lt,0)}${L("class",Dt("input__input",Cr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",Yt,0)}${L("style",ut(g),0)}${L("placeholder",n,0)}${L("value",xt,0)}${L("this",ht,0)}>`;var i}})}`})),Nr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},zr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O=o,T=o,{json:M={}}=e,{templateContext:z}=e,{origJson:R}=e,{layoutParams:B}=e;const U=f(at),W=M.value_variable;let H=!1;W||(H=!0,U.logError(st(new Error('Missing "value_variable" in "select"')))),S=l(W&&U.getVariable(W,"string")||xr("temp","string",""),(t=>P=t));let q="";const G=M.options,Z=Array.isArray(G)&&G.filter((t=>"string"==typeof t.value))||[];Array.isArray(Z)&&Z.length||U.logError(st(new Error('Empty selection "items" in "select"')));let Y="",X=null,K="";D=l(U.getDerivedFromVars(M.hint_text),(t=>V=t)),A=l(U.getDerivedFromVars(M.hint_color),(t=>F=t));let Q="rgba(0,0,0,.45)";C=l(U.getDerivedFromVars(M.font_size),(t=>E=t));let tt,et=12;k=l(U.getDerivedFromVars(M.font_weight),(t=>x=t)),$=l(U.getDerivedFromVars(M.font_family),(t=>w=t));let rt,it="";_=l(U.getDerivedFromVars(M.line_height),(t=>b=t)),y=l(U.getDerivedFromVars(M.letter_spacing),(t=>m=t));let nt="";h=l(U.getDerivedFromVars(M.text_color),(t=>v=t));let ot="#000",lt="";void 0===e.json&&r.json&&void 0!==M&&r.json(M),void 0===e.templateContext&&r.templateContext&&void 0!==z&&r.templateContext(z),void 0===e.origJson&&r.origJson&&void 0!==R&&r.origJson(R),void 0===e.layoutParams&&r.layoutParams&&void 0!==B&&r.layoutParams(B),q=P;{const t=Z.find((t=>t.value===P));t?Y="string"==typeof t.text?t.text:t.value:(Y="",P&&U.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}n=U.getDerivedFromVars(M.paddings),T(),T=l(n,(t=>j=t)),et=re(E,et),X=Ut(j||void 0,X),K=X?Pt({top:(Number(X.top)||0)/et*10,right:(Number(X.right)||0)/et*10,bottom:(Number(X.bottom)||0)/et*10,left:(Number(X.left)||0)/et*10}):"",a=V,Q=vt(F,1,Q),tt=ne(x,tt),it=w&&"string"==typeof w?U.typefaceProvider(w,{fontWeight:tt||400}):"";{const t=b;Zt(t)&&(rt=t/et)}return St(m)&&(nt=dt(m/et*10)),ot=vt(v,1,ot),s=U.getDerivedFromVars(M.accessibility),O(),O=l(s,(t=>g=t)),(null==g?void 0:g.description)?lt=g.description:U.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),c={hint:!Y},u={"--divkit-input-hint-color":Q,"font-weight":tt,"font-family":it,color:ot},d={padding:K,"font-size":dt(et),"line-height":rt,"letter-spacing":nt},p={"font-size":dt(et),"line-height":rt,"letter-spacing":nt},O(),h(),y(),_(),$(),k(),C(),A(),D(),T(),S(),H?"":`${J(te,"Outer").$$render(t,{cls:Dt("select",Nr,c),style:u,customDescription:!0,customActions:"select",customPaddings:!0,json:M,origJson:R,templateContext:z,layoutParams:B},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",Nr["select__select-text"],0)}${L("style",ut(d),0)} aria-hidden="true"> ${I(Y||a||"")}</span> <select${L("class",Dt("select__select",Nr,{"has-custom-focus":t}),0)}${L("aria-label",lt,0)}${L("style",ut(p),0)}>${N(Z,(t=>`<option${L("class",Nr.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),Jr={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},Rr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k=o,E=o,{json:C={}}=e,{templateContext:F}=e,{origJson:A}=e,{layoutParams:V}=e;const D=f(at);let j,P=!1,S=!1;x=l(D.getDerivedFromVars(C.video_sources),(t=>$=t));let O=[];w=l(D.getDerivedFromVars(C.repeatable),(t=>_=t));let I=!1;b=l(D.getDerivedFromVars(C.autostart),(t=>y=t));let T=!1;m=l(D.getDerivedFromVars(C.muted),(t=>h=t));let M,z=!1;v=l(D.getDerivedFromVars(C.preview),(t=>p=t));let R="fit",B="0";const U=C.elapsed_time_variable;var W,q;(U&&D.getVariable(U,"integer")||xr("temp","integer",0)).subscribe((t=>{S&&(S=!1)})),!C.id||P||(null==V?void 0:V.fakeElement)||D.registerInstance(C.id,{pause(){},start(){}}),g((()=>{!C.id||P||(null==V?void 0:V.fakeElement)||D.unregisterInstance(C.id)})),void 0===e.json&&r.json&&void 0!==C&&r.json(C),void 0===e.templateContext&&r.templateContext&&void 0!==F&&r.templateContext(F),void 0===e.origJson&&r.origJson&&void 0!==A&&r.origJson(A),void 0===e.layoutParams&&r.layoutParams&&void 0!==V&&r.layoutParams(V),W=$,q=O,O=Array.isArray(W)&&W.length?W.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):q,O.length?P=!1:(P=!0,D.logError(st(new Error('Missing "video_sources" in "video"')))),I=ce(_,I),T=ce(y,T),z=ce(h,z),M="string"==typeof p?Se(p):M,n=D.getDerivedFromVars(C.scale),E(),E=l(n,(t=>d=t)),R=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(d)||R,a=D.getDerivedFromVars(C.aspect),k(),k=l(a,(t=>u=t));{const t=null==u?void 0:u.ratio;B=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}return s={aspect:"0"!==B},c={"object-fit":R},k(),E(),v(),m(),b(),w(),x(),P?"":`${J(te,"Outer").$$render(t,{cls:Dt("video",Jr,s),customActions:"video",json:C,origJson:A,templateContext:F,layoutParams:V},{},{default:()=>s.aspect?`<div${L("class",Jr["video__aspect-wrapper"],0)}${H({"padding-bottom":`${B}%`})}><video${L("class",Jr.video__video,0)}${L("style",ut(c),0)} playsinline ${I?"loop":""} ${T?"autoplay":""} ${z?"muted":""}${L("poster",M,0)}${L("this",j,0)}>${N(O,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",Jr.video__video,0)}${L("style",ut(c),0)} playsinline ${I?"loop":""} ${T?"autoplay":""} ${z?"muted":""}${L("poster",M,0)}${L("this",j,0)}>${N(O,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),Br=Rr,Ur=U(((t,e,r,i)=>{let n,o,a;var s;let{json:l={}}=e,{templateContext:c}=e,{origJson:u}=e,{layoutParams:d}=e;const p=f(at);let g=null,v="",h={},m=!1;if(void 0===e.json&&r.json&&void 0!==l&&r.json(l),void 0===e.templateContext&&r.templateContext&&void 0!==c&&r.templateContext(c),void 0===e.origJson&&r.origJson&&void 0!==u&&r.origJson(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),"string"==typeof l.custom_type&&l.custom_type&&(null===(s=p.customComponents)||void 0===s?void 0:s.has(l.custom_type))){if(g=p.customComponents.get(l.custom_type),"function"==typeof g.template){const t=p.getExtensionContext(),e=new Map;for(const[r,i]of t.variables)e.set(r,i.getValue());v=g.template({props:l.custom_props,variables:e})}else v=g.template&&"string"==typeof g.template?g.template:"";h={shadowrootmode:g.shadowRootMode||"open"}}else g=null,v=";",p.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return n=l.items,void 0===n||Array.isArray(n)?m=!1:(m=!0,p.logError(st(new Error('Incorrect "items" prop for div "custom"')))),o=(!m&&n||[]).map((t=>{let e=t,r=c;return({templateContext:r,json:e}=p.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a={fakeElement:null==d?void 0:d.fakeElement},g?`${J(te,"Outer").$$render(t,{json:l,origJson:u,templateContext:c,layoutParams:d},{},{default:()=>{return(e=g.element)?`<${g.element}${P([M(l.custom_props||{})],{})}${L("this",undefined,0)}>${D(e)?"":`${v?`<template${P([M(h)],{})}> ${v}</template>`:""} ${!m&&n?`${N(o,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:a,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`:""}`}${D(e)?"":`</${e}>`}`:"";var e}})}`:""})),Lr={};Lr.text=pe,Lr.container=Ae,Lr.separator=je,Lr.image=Oe,Lr.gif=Oe,Lr.grid=Je,Lr.gallery=We,Lr.tabs=Ge,Lr.state=ir,Lr.pager=ar,Lr.indicator=cr,Lr.slider=Er,Lr.input=Mr,Lr.select=zr,Lr.video=Br,Lr.custom=Ur;const Wr=U(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=f(at);let c,u,d;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=n,u=o,d=c&&Lr[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Lr[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(st(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${J(d||z,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),Hr=U(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${L("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return` <filter${L("id",n[t],0)}><feFlood${L("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${L("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${L("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function qr(t,e,r,i){const n=r[t.type];if(!n)return i(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const i=Object.keys(r).filter((t=>"__proto__"!==t)),n=i.filter((t=>"$"!==t.charAt(0))),o=i.filter((t=>"$"===t.charAt(0)));return n.forEach((i=>{const n=r[i];"object"==typeof n&&null!==n?(e[i]=Array.isArray(n)?[]:{},t(e[i],n)):e[i]=n})),o.forEach((t=>{const i=r[t],n=a[i];if(void 0!==n){const r=t.substring(1);e[r]=n}})),e}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Gr(){}function Zr(t){return{subscribe:e=>(e(t),Gr)}}function Yr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Xr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Kr(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function Qr(t){try{return mr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function ti(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ei(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,ei.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function ri(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function ii(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Fe,JsonStringContents:function(){var t,e,r;for(t=ve,e=[],r=Ae();r!==i;)e.push(r),r=Ae();return fe=t,e=jt(e)}},a=Fe,s="@{",l="}",c="@{}",u="\\",d="?",p=":",g="||",v="&&",f="==",h="!=",m=">=",y=">",b="<=",_="<",w="+",$="-",x="/",k="*",E="%",C="!",F="(",A=")",V=",",D="'",j=".",P="e",S="E",O="true",I="false",T=/^[^}]/,M=/^[^'}]/,N=/^[0-9]/,z=/^[a-zA-Z_0-9.]/,J=/^[a-zA-Z_]/,R=/^[ \t\r\n]/,B=we("@{",!1),U=we("}",!1),L=we("@{}",!1),W=we("\\",!1),H={type:"any"},q=$e(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),K=we("==",!1),Q=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),it=we("<",!1),nt=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ct=we("!",!1),ut=we("(",!1),dt=we(")",!1),pt=we(",",!1),gt=xe("string"),vt=we("'",!1),ft=$e(["'","}"],!0,!1),ht=xe("integer"),mt=$e([["0","9"]],!1,!1),yt=xe("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),$t=xe("boolean"),xt=we("true",!1),kt=we("false",!1),Et=$e([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=xe("identifier"),Ft=$e([["a","z"],["A","Z"],"_"],!1,!1),At=xe("whitespace"),Vt=$e([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},jt=function(t){return Kr(t)},Pt=function(t){return t},St=function(){return""},Ot=function(){return _e()},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},Mt=function(t){return t},Nt=function(t){return ti(t)},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Rt=function(t,e){return Xr(t,e)},Bt=function(t,e){return Xr(t,e)},Ut=function(t,e){return Yr(t,e)},Lt=function(t,e){return Yr(t,e)},Wt=function(t,e){return Yr(t,e)},Ht=function(t,e){return Yr(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Kt=function(t){return t},Qt=function(t){return Kr(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return ti(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:Qr(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},pe=function(){return{type:"BooleanLiteral",value:!1}},ge=function(){return{type:"Identifier",name:_e()}},ve=0,fe=0,he=[{line:1,column:1}],me=0,ye=[],be=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function _e(){return t.substring(fe,ve)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function $e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function xe(t){return{type:"other",description:t}}function ke(e){var r,i=he[e];if(i)return i;for(r=e-1;!he[r];)r--;for(i={line:(i=he[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return he[e]=i,i}function Ee(t,e,r){var i=ke(t),o=ke(e),a={source:n,start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:o.line,column:o.column}};return r&&n&&"function"==typeof n.offset&&(a.start=n.offset(a.start),a.end=n.offset(a.end)),a}function Ce(t){ve<me||(ve>me&&(me=ve,ye=[]),ye.push(t))}function Fe(){var t,e;return t=ve,Re(),(e=Ve())!==i?(Re(),fe=t,t=Dt(e)):(ve=t,t=i),t}function Ae(){var e,r,n,o,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(ve)?(a=l,ve++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=Pt(o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=St()),(e=r)===i&&(e=ve,r=ve,be++,92===t.charCodeAt(ve)?(n=u,ve++):(n=i,0===be&&Ce(W)),n===i&&(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B))),be--,n===i?r=void 0:(ve=r,r=i),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Ot()):(ve=e,e=i)):(ve=e,e=i),e===i))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],T.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(q)),o!==i)for(;o!==i;)n.push(o),T.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(q));else n=i;n!==i?(125===t.charCodeAt(ve)?(o=l,ve++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=It()):(ve=e,e=i)):(ve=e,e=i)}else ve=e,e=i;e===i&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=Tt()),(e=r)===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=Mt(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Nt(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=zt()),e=r))))}return e}function Ve(){var e,r,n,o,a,s;return e=ve,(r=De())!==i?(Re(),63===t.charCodeAt(ve)?(n=d,ve++):(n=i,0===be&&Ce(G)),n!==i?(Re(),(o=Ve())!==i?(Re(),58===t.charCodeAt(ve)?(a=p,ve++):(a=i,0===be&&Ce(Z)),a!==i?(Re(),(s=Ve())!==i?(fe=e,e=Jt(r,o,s)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=De()),e}function De(){var e,r,n,o,a,s,l,c;if(e=ve,(r=je())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===g?(s=g,ve+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===g?(s=g,ve+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Rt(r,n)}else ve=e,e=i;return e}function je(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Pe())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===v?(s=v,ve+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===v?(s=v,ve+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Bt(r,n)}else ve=e,e=i;return e}function Pe(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Se())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===f?(s=f,ve+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(ve,2)===h?(s=h,ve+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===f?(s=f,ve+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(ve,2)===h?(s=h,ve+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Ut(r,n)}else ve=e,e=i;return e}function Se(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Oe())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===m?(s=m,ve+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ve)?(s=y,ve++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ve,2)===b?(s=b,ve+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ve)?(s=_,ve++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===m?(s=m,ve+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ve)?(s=y,ve++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ve,2)===b?(s=b,ve+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ve)?(s=_,ve++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Lt(r,n)}else ve=e,e=i;return e}function Oe(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Ie())!==i){for(n=[],o=ve,a=Re(),43===t.charCodeAt(ve)?(s=w,ve++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ve)?(s=$,ve++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),43===t.charCodeAt(ve)?(s=w,ve++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ve)?(s=$,ve++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Wt(r,n)}else ve=e,e=i;return e}function Ie(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Te())!==i){for(n=[],o=ve,a=Re(),47===t.charCodeAt(ve)?(s=x,ve++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ve)?(s=k,ve++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Te())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),47===t.charCodeAt(ve)?(s=x,ve++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ve)?(s=k,ve++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Te())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Ht(r,n)}else ve=e,e=i;return e}function Te(){var e,r,n;return(e=ze())===i&&(e=Ne())===i&&(e=ve,33===t.charCodeAt(ve)?(r=C,ve++):(r=i,0===be&&Ce(ct)),r===i&&(43===t.charCodeAt(ve)?(r=w,ve++):(r=i,0===be&&Ce(nt)),r===i&&(45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)))),r!==i?(Re(),(n=Te())!==i?(fe=e,e=qt(r,n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ve,(r=Je())!==i?(Re(),40===t.charCodeAt(ve)?(n=F,ve++):(n=i,0===be&&Ce(ut)),n!==i?(Re(),o=function(){var e,r,n,o,a,s;if(e=ve,(r=Ve())!==i){for(n=[],o=ve,Re(),44===t.charCodeAt(ve)?(a=V,ve++):(a=i,0===be&&Ce(pt)),a!==i?(Re(),(s=Ve())!==i?o=s:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,Re(),44===t.charCodeAt(ve)?(a=V,ve++):(a=i,0===be&&Ce(pt)),a!==i?(Re(),(s=Ve())!==i?o=s:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Yt(r,n)}else ve=e,e=i;return e===i&&(e=Re()),e}(),o!==i?(Re(),41===t.charCodeAt(ve)?(a=A,ve++):(a=i,0===be&&Ce(dt)),a!==i?(fe=e,e=Gt(r,o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,(r=Je())!==i&&(fe=e,r=Zt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return be++,e=ve,39===t.charCodeAt(ve)?(r=D,ve++):(r=i,0===be&&Ce(vt)),r!==i?(n=function(){var t,e,r;for(t=ve,e=[],r=Me();r!==i;)e.push(r),r=Me();return fe=t,t=e=Qt(e)}(),39===t.charCodeAt(ve)?(o=D,ve++):(o=i,0===be&&Ce(vt)),o!==i?(fe=e,e=Kt(n)):(ve=e,e=i)):(ve=e,e=i),be--,e===i&&(r=i,0===be&&Ce(gt)),e}(),e===i&&(e=ze())===i&&(e=Ne())===i&&(e=function(){var e,r;return be++,e=ve,t.substr(ve,4)===O?(r=O,ve+=4):(r=i,0===be&&Ce(xt)),r!==i&&(fe=e,r=de()),(e=r)===i&&(e=ve,t.substr(ve,5)===I?(r=I,ve+=5):(r=i,0===be&&Ce(kt)),r!==i&&(fe=e,r=pe()),e=r),be--,e===i&&(r=i,0===be&&Ce($t)),e}(),e===i&&(e=ve,40===t.charCodeAt(ve)?(r=F,ve++):(r=i,0===be&&Ce(ut)),r!==i&&(n=Ve())!==i?(41===t.charCodeAt(ve)?(o=A,ve++):(o=i,0===be&&Ce(dt)),o!==i?(fe=e,e=Xt(n)):(ve=e,e=i)):(ve=e,e=i))),e}())),e}())),e}function Me(){var e,r,n,o,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(ve)?(a=l,ve++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=te(o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=ee()),(e=r)===i&&(e=ve,r=ve,be++,92===t.charCodeAt(ve)?(n=u,ve++):(n=i,0===be&&Ce(W)),n===i&&(39===t.charCodeAt(ve)?(n=D,ve++):(n=i,0===be&&Ce(vt)),n===i&&(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B)))),be--,n===i?r=void 0:(ve=r,r=i),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=re()):(ve=e,e=i)):(ve=e,e=i),e===i))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],M.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(ft)),o!==i)for(;o!==i;)n.push(o),M.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(ft));else n=i;n!==i?(125===t.charCodeAt(ve)?(o=l,ve++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=ie()):(ve=e,e=i)):(ve=e,e=i)}else ve=e,e=i;e===i&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=ne()),(e=r)===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=oe(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=ae(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=se()),e=r))))}return e}function Ne(){var e,r,n,o;if(be++,e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));else n=i;return n!==i?(fe=e,e=le()):(ve=e,e=i),be--,e===i&&(r=i,0===be&&Ce(ht)),e}function ze(){var e,r,n,o,a,s,l,c,u,d;for(be++,e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));if(46===t.charCodeAt(ve)?(o=j,ve++):(o=i,0===be&&Ce(bt)),o!==i){if(a=[],N.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=i,0===be&&Ce(mt)),s!==i)for(;s!==i;)a.push(s),N.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=i,0===be&&Ce(mt));else a=i;if(a!==i){if(s=ve,101===t.charCodeAt(ve)?(l=P,ve++):(l=i,0===be&&Ce(_t)),l===i&&(69===t.charCodeAt(ve)?(l=S,ve++):(l=i,0===be&&Ce(wt))),l!==i){if(43===t.charCodeAt(ve)?(c=w,ve++):(c=i,0===be&&Ce(nt)),c===i&&(45===t.charCodeAt(ve)?(c=$,ve++):(c=i,0===be&&Ce(ot))),c===i&&(c=null),u=[],N.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=i,0===be&&Ce(mt)),d!==i)for(;d!==i;)u.push(d),N.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=i,0===be&&Ce(mt));else u=i;u!==i?s=l=[l,c,u]:(ve=s,s=i)}else ve=s,s=i;s===i&&(s=null),fe=e,e=ce()}else ve=e,e=i}else ve=e,e=i;if(e===i){if(e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));else n=i;if(n!==i)if(101===t.charCodeAt(ve)?(o=P,ve++):(o=i,0===be&&Ce(_t)),o===i&&(69===t.charCodeAt(ve)?(o=S,ve++):(o=i,0===be&&Ce(wt))),o!==i){if(43===t.charCodeAt(ve)?(a=w,ve++):(a=i,0===be&&Ce(nt)),a===i&&(45===t.charCodeAt(ve)?(a=$,ve++):(a=i,0===be&&Ce(ot))),a===i&&(a=null),s=[],N.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=i,0===be&&Ce(mt)),l!==i)for(;l!==i;)s.push(l),N.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=i,0===be&&Ce(mt));else s=i;s!==i?(fe=e,e=ue()):(ve=e,e=i)}else ve=e,e=i;else ve=e,e=i}return be--,e===i&&(r=i,0===be&&Ce(yt)),e}function Je(){var e,r,n,o,a;if(be++,e=ve,r=ve,be++,n=function(){var e,r,n,o;return e=ve,t.substr(ve,4)===O?(r=O,ve+=4):(r=i,0===be&&Ce(xt)),r===i&&(t.substr(ve,5)===I?(r=I,ve+=5):(r=i,0===be&&Ce(kt))),r!==i?(n=ve,be++,z.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(Et)),be--,o===i?n=void 0:(ve=n,n=i),n!==i?e=r=[r,n]:(ve=e,e=i)):(ve=e,e=i),e}(),be--,n===i?r=void 0:(ve=r,r=i),r!==i)if(J.test(t.charAt(ve))?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(Ft)),n!==i){for(o=[],z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=i,0===be&&Ce(Et));a!==i;)o.push(a),z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=i,0===be&&Ce(Et));fe=e,e=ge()}else ve=e,e=i;else ve=e,e=i;return be--,e===i&&(r=i,0===be&&Ce(Ct)),e}function Re(){var e,r;for(be++,e=[],R.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=i,0===be&&Ce(Vt));r!==i;)e.push(r),R.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=i,0===be&&Ce(Vt));return be--,r=i,0===be&&Ce(At),e}if((r=a())!==i&&ve===t.length)return r;throw r!==i&&ve<t.length&&Ce({type:"end"}),function(t,e,r){return new ei(ei.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(ei,Error),ei.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(i){var s=this.location.end,l=ri("",o.line.toString().length," "),c=i[n.line-1],u=(n.line===s.line?s.column:c.length+1)-n.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+ri("",n.column-1," ")+ri("",u,"^")}else e+="\n at "+a}return e},ei.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const ni=new Map,oi=new Map;function ai(t,e,r){const i={args:e,cb:r},n=ni.get(t)||[];ni.has(t)||ni.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");oi.set(o,i)}function si(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function li(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{li(t,e)}));break;case"BinaryExpression":case"LogicalExpression":li(t.left,e),li(t.right,e);break;case"UnaryExpression":li(t.argument,e);break;case"ConditionalExpression":li(t.test,e),li(t.consequent,e),li(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{li(t,e)}))}}function ci(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function ui(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function di(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return ui(t.value);if("color"===t.type)return bi(yi(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";if("array"===t.type)return"<array>";throw new Error(`Unexpected type ${t.type}`)}function pi(t){let e=di(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function gi(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function vi(t,e){if(gr)return mr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function fi(t,e){if(e<hr||e>fr)throw new Error("Integer overflow.");!gr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function hi(t){const e=[];return li(t,{Variable(t){e.push(t.id.name)}}),e}function mi(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function yi(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function bi(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return gt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function _i(t){return bi(yi(t))}const wi=Number.MAX_VALUE,$i=Number.MIN_VALUE,xi="string",ki="integer",Ei="number",Ci="boolean",Fi="color",Ai="url",Vi="datetime",Di="dict",ji="array";function Pi(t,e){return{type:xi,value:di(e)}}function Si(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ei,value:r}}function Oi(t,e,r,i){const n=t.variables.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=_i(o)),{type:i,value:o}}function Ii(t,e,r){return Oi(t,e,r,r.type)}function Ti(t,e,r){return Oi(t,e,r,"color")}function Mi(t,e,r){return Oi(t,e,r,"url")}const Ni=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:ki,value:mr(i)}},zi=Ni("getUTCFullYear"),Ji=Ni("getUTCMonth"),Ri=Ni("getUTCDate"),Bi=Ni("getUTCDay"),Ui=Ni("getUTCHours"),Li=Ni("getUTCMinutes"),Wi=Ni("getUTCSeconds"),Hi=Ni("getUTCMilliseconds");function qi(t,e,r,i){if(!i.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let n="";const o=e.type===xi?e.value:di(e);for(;n.length+o.length<r.value;)n+=i.value;return n.length>0&&n.length+o.length>r.value&&(n=n.substring(0,Number(r.value)-Number(o.length))),n}function Gi(t,e,r,i){const n=qi(t,e,r,i);return{type:xi,value:n+di(e)}}function Zi(t,e,r,i){const n=qi(t,e,r,i);return{type:xi,value:di(e)+n}}function Yi(t){return(e,r)=>{const i=yi(r.value);return{type:Ei,value:i[t]/255}}}function Xi(t){return(e,r,i)=>{const n=yi(r.value);return n[t]=255*i.value,{type:Fi,value:bi(n)}}}const Ki=Yi("a"),Qi=Yi("r"),tn=Yi("g"),en=Yi("b"),rn=Xi("a"),nn=Xi("r"),on=Xi("g"),an=Xi("b");function sn(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=mr(e.value)/mr(r);return fi(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=mr(n)%mr(i)),{type:ki,value:n}}const ln=36e5;function cn(t,e){return(r,i,...n)=>{let o=function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const i=r[e[t]];if(void 0===i)throw new Error(`Missing property "${e[t]}" in the dict.`);r=i}return r}(i.value,n.map((t=>t.value))),a=typeof o;if(a!==t)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");fi(r,o)}return"string"===t&&"color"===e&&(o=_i(o)),{type:e,value:o}}}function un(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=_i(r)),{type:e,value:r}}}}const dn=cn("string","string"),pn=cn("number","number"),gn=cn("number","integer"),vn=cn("boolean","boolean"),fn=cn("string","color"),hn=cn("string","url"),mn=un(dn,"string"),yn=un(pn,"number"),bn=un(gn,"integer"),_n=un(vn,"boolean"),wn=un(fn,"color"),$n=un(hn,"url");function xn(t,e){return(r,i,n)=>{if(n.value<0||n.value>=i.value.length)throw new Error(`Requested index (${n.value}) out of bounds array size (${i.value.length}).`);let o=i.value[Number(n.value)],a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"obejct"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");fi(r,o)}return"string"===t&&"color"===e&&(o=_i(o)),{type:e,value:o}}}function kn(t,e){return(r,i,n,o)=>{try{return t(r,i,n)}catch(t){let r=o.value;return"color"===e&&(r=_i(r)),{type:e,value:r}}}}const En=xn("string","string"),Cn=xn("number","number"),Fn=xn("number","integer"),An=xn("boolean","boolean"),Vn=xn("string","color"),Dn=xn("string","url"),jn=xn("array","array"),Pn=xn("object","dict"),Sn=kn(En,"string"),On=kn(Cn,"number"),In=kn(Fn,"integer"),Tn=kn(An,"boolean"),Mn=kn(Vn,"color"),Nn=kn(Dn,"url");function zn(t){return t.map(pi).join(", ")}ai("toString",[ki],Pi),ai("toString",[Ei],Pi),ai("toString",[Ci],Pi),ai("toString",[Fi],Pi),ai("toString",[Ai],Pi),ai("toNumber",[ki],Si),ai("toNumber",[xi],Si),ai("toInteger",[Ei],(function(t,e){if(e.value>fr||e.value<hr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:ki,value:mr(r)}})),ai("toInteger",[xi],(function(t,e){let r;try{r=mr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>fr||r<hr)throw new Error("Unable to convert value to Integer.");return{type:ki,value:r}})),ai("toInteger",[Ci],(function(t,e){return{type:ki,value:mr(e.value?1:0)}})),ai("toBoolean",[ki],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Ci,value:r}})),ai("toBoolean",[xi],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Ci,value:"true"===e.value?1:0}})),ai("toColor",[xi],(function(t,e){return{type:Fi,value:_i(e.value)}})),ai("toUrl",[xi],(function(t,e){return{type:Ai,value:e.value}})),ai("encodeUri",[xi],(function(t,e){try{return{type:xi,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),ai("decodeUri",[xi],(function(t,e){try{return{type:xi,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),ai("getIntegerValue",[xi,ki],Ii),ai("getNumberValue",[xi,Ei],Ii),ai("getBooleanValue",[xi,Ci],Ii),ai("getStringValue",[xi,xi],Ii),ai("getColorValue",[xi,Fi],Ti),ai("getColorValue",[xi,xi],Ti),ai("getUrlValue",[xi,Ai],Mi),ai("getUrlValue",[xi,xi],Mi),ai("parseUnixTime",[ki],(function(t,e){return{type:Vi,value:new Date(1e3*Number(e.value))}})),ai("nowLocal",[],(function(){return{type:Vi,value:new Date}})),ai("addMillis",[Vi,ki],(function(t,e,r){return{type:Vi,value:new Date(e.value.getTime()+Number(r.value))}})),ai("setYear",[Vi,ki],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:Vi,value:i}})),ai("setMonth",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<1||i>12)throw new Error(`Expecting month in [1..12], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMonth(i-1),{type:Vi,value:n}})),ai("setDay",[Vi,ki],(function(t,e,r){const i=new Date(e.value),n=Number(r.value);if(n<=0&&-1!==n||n>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(i))throw new Error(`Unable to set day ${n} for date ${di(e)}.`);return i.setUTCDate(-1===n?0:n),{type:Vi,value:i}})),ai("setHours",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>23)throw new Error(`Expecting hours in [0..23], instead got ${i}.`);const n=new Date(e.value);return n.setUTCHours(i),{type:Vi,value:n}})),ai("setMinutes",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting minutes in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMinutes(i),{type:Vi,value:n}})),ai("setSeconds",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting seconds in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCSeconds(i),{type:Vi,value:n}})),ai("setMillis",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>999)throw new Error(`Expecting millis in [0..999], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMilliseconds(i),{type:Vi,value:n}})),ai("getYear",[Vi],zi),ai("getMonth",[Vi],Ji),ai("getDay",[Vi],Ri),ai("getDayOfWeek",[Vi],Bi),ai("getHours",[Vi],Ui),ai("getMinutes",[Vi],Li),ai("getSeconds",[Vi],Wi),ai("getMillis",[Vi],Hi),ai("getIntervalSeconds",[ki],(function(t,e){return sn(t,e,1e3,60)})),ai("getIntervalTotalSeconds",[ki],(function(t,e){return sn(t,e,1e3)})),ai("getIntervalMinutes",[ki],(function(t,e){return sn(t,e,6e4,60)})),ai("getIntervalTotalMinutes",[ki],(function(t,e){return sn(t,e,6e4)})),ai("getIntervalHours",[ki],(function(t,e){return sn(t,e,ln,24)})),ai("getIntervalTotalHours",[ki],(function(t,e){return sn(t,e,ln)})),ai("getIntervalTotalDays",[ki],(function(t,e){return sn(t,e,864e5)})),ai("getIntervalTotalWeeks",[ki],(function(t,e){return sn(t,e,6048e5)})),ai("len",[xi],(function(t,e){return{type:ki,value:mr(e.value.length)}})),ai("contains",[xi,xi],(function(t,e,r){return{type:Ci,value:e.value.includes(r.value)?1:0}})),ai("substring",[xi,ki,ki],(function(t,e,r,i){if(i.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||i.value<0||i.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:xi,value:e.value.substring(Number(r.value),Number(i.value))}})),ai("replaceAll",[xi,xi,xi],(function(t,e,r,i){let n;return n=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),i.value):e.value,{type:xi,value:n}})),ai("index",[xi,xi],(function(t,e,r){return{type:ki,value:mr(e.value.indexOf(r.value))}})),ai("lastIndex",[xi,xi],(function(t,e,r){return{type:ki,value:mr(e.value.lastIndexOf(r.value))}})),ai("trim",[xi],(function(t,e){return{type:xi,value:e.value.trim()}})),ai("trimLeft",[xi],(function(t,e){return{type:xi,value:e.value.replace(/^\s+/,"")}})),ai("trimRight",[xi],(function(t,e){return{type:xi,value:e.value.replace(/\s+$/,"")}})),ai("toUpperCase",[xi],(function(t,e){return{type:xi,value:e.value.toUpperCase()}})),ai("toLowerCase",[xi],(function(t,e){return{type:xi,value:e.value.toLowerCase()}})),ai("padStart",[xi,ki,xi],Gi),ai("padStart",[ki,ki,xi],Gi),ai("padEnd",[xi,ki,xi],Zi),ai("padEnd",[ki,ki,xi],Zi),ai("testRegex",[xi,xi],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Ci,value:i.test(e.value)?1:0}})),ai("div",[ki,ki],(function(t,e,r){if(r.value===yr)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=vi(0,i),fi(t,i),{type:ki,value:i}})),ai("div",[Ei,Ei],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value/r.value;return{type:Ei,value:i}})),ai("mod",[ki,ki],(function(t,e,r){if(r.value===yr)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=vi(0,i),fi(t,i),{type:ki,value:i}})),ai("mod",[Ei,Ei],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value%r.value;return{type:Ei,value:i}})),ai("mul",[{type:ki,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:yr;for(let i=1;i<e.length;++i)r*=e[i].value,r=vi(0,r),fi(t,r);return{type:ki,value:r}})),ai("mul",[{type:Ei,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Ei,value:r}})),ai("sub",[{type:ki,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:yr;for(let i=1;i<e.length;++i)r-=e[i].value,r=vi(0,r),fi(t,r);return{type:ki,value:r}})),ai("sub",[{type:Ei,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Ei,value:r}})),ai("sum",[{type:ki,isVararg:!0}],(function(t,...e){let r=yr;for(let i=0;i<e.length;++i)r+=e[i].value,r=vi(0,r),fi(t,r);return{type:ki,value:r}})),ai("sum",[{type:Ei,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ei,value:r}})),ai("abs",[ki],(function(t,e){const r=br(e.value);return fi(t,r),{type:e.type,value:r}})),ai("abs",[Ei],(function(t,e){const r=Math.abs(e.value);return{type:Ei,value:r}})),ai("max",[{type:ki,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:ki,value:r}})),ai("max",[{type:Ei,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ei,value:Math.max(...e.map((t=>t.value)))}})),ai("min",[{type:ki,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:ki,value:r}})),ai("min",[{type:Ei,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ei,value:Math.min(...e.map((t=>t.value)))}})),ai("maxNumber",[],(function(){return{type:Ei,value:wi}})),ai("minNumber",[],(function(){return{type:Ei,value:$i}})),ai("maxInteger",[],(function(t){return fi(t,fr),{type:ki,value:fr}})),ai("minInteger",[],(function(t){return fi(t,hr),{type:ki,value:hr}})),ai("round",[Ei],(function(t,e){const r=Math.sign(e.value);return{type:Ei,value:r*Math.round(Math.abs(e.value))}})),ai("floor",[Ei],(function(t,e){return{type:Ei,value:Math.floor(e.value)}})),ai("ceil",[Ei],(function(t,e){return{type:Ei,value:Math.ceil(e.value)}})),ai("signum",[ki],(function(t,e){return{type:ki,value:_r(e.value)}})),ai("signum",[Ei],(function(t,e){return{type:Ei,value:Math.sign(e.value)}})),ai("copySign",[ki,ki],(function(t,e,r){let i;if(r.value===yr)i=e.value;else if(e.value===yr)i=0;else{const t=_r(r.value);i=br(e.value)*t}return fi(t,i),{type:ki,value:i}})),ai("copySign",[Ei,Ei],(function(t,e,r){let i=Math.sign(r.value);0===i&&(i=Object.is(i,0)?1:-1);const n=Math.abs(e.value)*i;return{type:Ei,value:n}})),ai("getColorAlpha",[xi],Ki),ai("getColorAlpha",[Fi],Ki),ai("getColorRed",[xi],Qi),ai("getColorRed",[Fi],Qi),ai("getColorGreen",[xi],tn),ai("getColorGreen",[Fi],tn),ai("getColorBlue",[xi],en),ai("getColorBlue",[Fi],en),ai("setColorAlpha",[xi,Ei],rn),ai("setColorAlpha",[Fi,Ei],rn),ai("setColorRed",[xi,Ei],nn),ai("setColorRed",[Fi,Ei],nn),ai("setColorGreen",[xi,Ei],on),ai("setColorGreen",[Fi,Ei],on),ai("setColorBlue",[xi,Ei],an),ai("setColorBlue",[Fi,Ei],an),ai("rgb",[Ei,Ei,Ei],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Fi,value:bi(n)}})),ai("argb",[Ei,Ei,Ei,Ei],(function(t,e,r,i,n){const o={a:255*e.value,r:255*r.value,g:255*i.value,b:255*n.value};return{type:Fi,value:bi(o)}})),ai("getDictString",[Di,{type:xi,isVararg:!0}],dn),ai("getStringFromDict",[Di,{type:xi,isVararg:!0}],dn),ai("getDictNumber",[Di,{type:xi,isVararg:!0}],pn),ai("getNumberFromDict",[Di,{type:xi,isVararg:!0}],pn),ai("getDictInteger",[Di,{type:xi,isVararg:!0}],gn),ai("getIntegerFromDict",[Di,{type:xi,isVararg:!0}],gn),ai("getDictBoolean",[Di,{type:xi,isVararg:!0}],vn),ai("getBooleanFromDict",[Di,{type:xi,isVararg:!0}],vn),ai("getDictColor",[Di,{type:xi,isVararg:!0}],fn),ai("getColorFromDict",[Di,{type:xi,isVararg:!0}],fn),ai("getDictUrl",[Di,{type:xi,isVararg:!0}],hn),ai("getUrlFromDict",[Di,{type:xi,isVararg:!0}],hn),ai("getDictOptString",[xi,Di,{type:xi,isVararg:!0}],mn),ai("getOptStringFromDict",[xi,Di,{type:xi,isVararg:!0}],mn),ai("getDictOptNumber",[Ei,Di,{type:xi,isVararg:!0}],yn),ai("getOptNumberFromDict",[Ei,Di,{type:xi,isVararg:!0}],yn),ai("getDictOptInteger",[ki,Di,{type:xi,isVararg:!0}],bn),ai("getOptIntegerFromDict",[ki,Di,{type:xi,isVararg:!0}],bn),ai("getDictOptBoolean",[Ci,Di,{type:xi,isVararg:!0}],_n),ai("getOptBooleanFromDict",[Ci,Di,{type:xi,isVararg:!0}],_n),ai("getDictOptColor",[Fi,Di,{type:xi,isVararg:!0}],wn),ai("getOptColorFromDict",[Fi,Di,{type:xi,isVararg:!0}],wn),ai("getDictOptColor",[xi,Di,{type:xi,isVararg:!0}],wn),ai("getOptColorFromDict",[xi,Di,{type:xi,isVararg:!0}],wn),ai("getDictOptUrl",[xi,Di,{type:xi,isVararg:!0}],$n),ai("getOptUrlFromDict",[xi,Di,{type:xi,isVararg:!0}],$n),ai("getDictOptUrl",[Ai,Di,{type:xi,isVararg:!0}],$n),ai("getOptUrlFromDict",[Ai,Di,{type:xi,isVararg:!0}],$n),ai("getArrayString",[ji,ki],En),ai("getStringFromArray",[ji,ki],En),ai("getArrayNumber",[ji,ki],Cn),ai("getNumberFromArray",[ji,ki],Cn),ai("getArrayInteger",[ji,ki],Fn),ai("getIntegerFromArray",[ji,ki],Fn),ai("getArrayBoolean",[ji,ki],An),ai("getBooleanFromArray",[ji,ki],An),ai("getArrayColor",[ji,ki],Vn),ai("getColorFromArray",[ji,ki],Vn),ai("getArrayUrl",[ji,ki],Dn),ai("getUrlFromArray",[ji,ki],Dn),ai("getArrayFromArray",[ji,ki],jn),ai("getDictFromArray",[ji,ki],Pn),ai("getArrayOptString",[ji,ki,xi],Sn),ai("getOptStringFromArray",[ji,ki,xi],Sn),ai("getArrayOptNumber",[ji,ki,Ei],On),ai("getOptNumberFromArray",[ji,ki,Ei],On),ai("getArrayOptInteger",[ji,ki,ki],In),ai("getOptIntegerFromArray",[ji,ki,ki],In),ai("getArrayOptBoolean",[ji,ki,Ci],Tn),ai("getOptBooleanFromArray",[ji,ki,Ci],Tn),ai("getArrayOptColor",[ji,ki,Fi],Mn),ai("getOptColorFromArray",[ji,ki,Fi],Mn),ai("getArrayOptColor",[ji,ki,xi],Mn),ai("getOptColorFromArray",[ji,ki,xi],Mn),ai("getArrayOptUrl",[ji,ki,Ai],Nn),ai("getOptUrlFromArray",[ji,ki,Ai],Nn),ai("getArrayOptUrl",[ji,ki,xi],Nn),ai("getOptUrlFromArray",[ji,ki,xi],Nn),ai("getOptArrayFromArray",[ji,ki],(function(t,e,r){try{return jn(t,e,r)}catch(t){return{type:"array",value:[]}}})),ai("getOptDictFromArray",[ji,ki],(function(t,e,r){try{return Pn(t,e,r)}catch(t){return{type:"dict",value:{}}}}));const Jn={StringLiteral:function(t,e){return{type:xi,value:e.value}},NumberLiteral:function(t,e){return{type:Ei,value:e.value}},IntegerLiteral:function(t,e){return fi(t,e.value),{type:ki,value:e.value}},BooleanLiteral:function(t,e){return{type:Ci,value:e.value?1:0}},UnaryExpression:function(t,e){const r=ci(Rn(t,e.argument));switch(e.operator){case"!":if(r.type===Ci)return{type:Ci,value:r.value?0:1};mi(`${e.operator}${pi(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===ki){const e=r.value*mr(i);return fi(t,e),{type:ki,value:e}}if(r.type===Ei)return{type:Ei,value:r.value*i};mi(`${e.operator}${pi(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=ci(Rn(t,e.test));if(r.type===Ci)return r.value?Rn(t,e.consequent):Rn(t,e.alternate);mi(`${pi(r)} ? ${pi(Rn(t,e.consequent))} : ${pi(Rn(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return Rn(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=di(Rn(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:xi,value:r}},LogicalExpression:function(t,e){const r=ci(Rn(t,e.left));if(r.type!==Ci&&mi(`${pi(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ci,value:0};const i=ci(Rn(t,e.right));return i.type!==Ci&&mi(`${pi(r)} ${e.operator} ${pi(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${gi(i.type)}.`),{type:Ci,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Rn(t,e.left),n=Rn(t,e.right);if(i.type!==n.type&&mi(`${pi(i)} ${e.operator} ${pi(n)}`,`Operator '${r}' cannot be applied to different types: ${gi(i.type)} and ${gi(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===Vi&&r.type===Vi?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Ci,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ei&&e.type!==ki&&e.type!==Vi&&mi(`${pi(e)} ${t} ${pi(r)}`,`Operator '${t}' cannot be applied to ${gi(e.type)} type.`);const n=e.type===Vi?e.value.getTime():e.value,o=r.type===Vi?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Ci,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==xi&&r.type!==Ei&&r.type!==ki&&mi(`${pi(r)} ${e} ${pi(i)}`,`Operator '${e}' cannot be applied to ${gi(r.type)} type.`),r.type===xi)return"-"===e&&mi(`${pi(r)} - ${pi(i)}`,`Operator '${e}' cannot be applied to ${gi(r.type)} type.`),{type:xi,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===ki)try{n=vi(0,n),fi(t,n)}catch(t){mi(`${pi(r)} ${e} ${pi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r,i){let n;if(r.type!==ki&&r.type!==Ei&&mi(`${pi(r)} ${e} ${pi(i)}`,`Operator '${e}' cannot be applied to ${gi(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&mi(`${pi(r)} ${e} ${pi(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===ki)try{n=vi(0,n),fi(t,n)}catch(t){mi(`${pi(r)} ${e} ${pi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let i;const n=e.arguments.map((e=>Rn(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(oi.has(o))i=oi.get(o);else{const t=function(t,e){const r=ni.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=si(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t||"type"in t&&"missing"===t.type){const e=n.map((t=>gi(t.type))).join(", "),i=`${r}(${zn(n)})`;"few"===t.type&&0===n.length?mi(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?mi(i,`Function '${r}' has no matching override for given argument types: ${e}.`):mi(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){mi(`${r}(${zn(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.variables.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function Rn(t,e){if(e.type in Jn)return Jn[e.type](t,e);throw new Error("Unsupported expression")}function Bn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(li(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const i=Rn(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class Un{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return li(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Bn(t,this.ast);r.warnings.forEach(e);const i=r.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const n=i.value;if(n instanceof Date)return ui(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=ft(String(n));if(t)return bi(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return n>2147483647||n<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(n);if("array"===i.type||"dict"===i.type)try{return JSON.stringify(n)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return n}catch(t){return void e(st(new Error("Expression execution error")))}}}function Ln(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=ii(t,{startRule:"JsonStringContents"}),i=hi(r);return e.vars.push(...i),new Un(r)}catch(e){return void r(st(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Ln(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Ln(t[n],e,r);return i}}var i;return t}function Wn(t,e,r){if(t){if(t instanceof Un)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Wn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Wn(t[n],e,r);return i}}return t}function Hn(t,e){const r={vars:[],hasExpression:!1},i=Ln(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Wn(i,t,e)}}const qn={pagers:function(){return K(new Map)}},Gn=new Map,Zn=new Map;function Yn(t){const e=Gn.get(t)||K("");return Gn.has(t)||Gn.set(t,e),e}function Xn(t){const e=Zn.get(t)||new Map;return Zn.has(t)||Zn.set(t,e),e}class Kn{setVariable(t){const e=t.getName(),r=Xn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Yn(this).set(e)}getVariable(t){return Xn(this).get(t)}}function Qn(){return new Kn}function to(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const eo=new Set(["start","stop","pause","resume","cancel","reset"]);class ro{constructor(t){to(this,"timers",new Map),to(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(st(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(st(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&eo.has(e)))return void this.logError(st(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const i=t.tickStarted=performance.now(),n=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-i-n)%r,e()}),n)};e()}}start(t){if("running"===t.state)return void this.logError(st(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(st(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(st(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(st(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(st(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(st(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(st(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(st(new Error("The timer is already running"))):this.logError(st(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function io(t,e,r,i){const{variable_name:n}=r;if(!n)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:n}}));const o=t.get(n);if(!o)return void e(st(new Error("Cannot find variable"),{additional:{name:n}}));const a=o.getType();"array"===a?i(o):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:n,type:a}}))}let no=K(!0),oo=0;function ao(){no.set(!1)}function so(){no.set(!0)}const lo=U(((t,e,r,i)=>{let n,o;var a,s,c,u;let{id:d}=e,{json:p={}}=e,{platform:f="auto"}=e,{theme:h="system"}=e,{globalVariablesController:m=new Kn}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:_=["http","https","tel","mailto","intent"]}=e,{extensions:w=new Map}=e,{onError:x}=e,{onStat:k}=e,{onCustomAction:E}=e,{onComponent:C}=e,{typefaceProvider:F=(t=>"")}=e,{fetchInit:A={}}=e,{tooltipRoot:V}=e,{customComponents:D}=e,j=K("desktop"===f);if(o=l(j,(t=>n=t)),"auto"===f&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");j.set(!t.matches),t.addListener((()=>{j.set(!t.matches)}))}let P="light",S=null;function O(t){h=t}function T(){}const M=new Set(_);let N=!1;p||(N=!0,tt(st(new Error('"json" prop is required')))),d||(N=!0,tt(st(new Error('"id" prop is required'))));let z=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return st(new Error("Missing card"));if(!e.states||!e.states.length)return st(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Lr)return st(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return st(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return st(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const R=p.templates||{};z&&(N=!0,tt(z));const B={stateChange:!1},U=Yn(m),L=Xn(m),W=new Map,H=new Map,q=new Map;let G=null,Z=0,Y=[];function X(t){const e=Hn(t,tt);return e.hasExpression?e.applyVars(H):t}function tt(t){x?x({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function et(t,e){k&&k({type:t,action:e})}let rt=0;function nt(t){return`${d}-${rt++}`}let ot={},lt={};function ct(t){ut(X(t))}function ut(t){const e=t.url?String(t.url):"",r=t.typed;if(e)try{const r=e.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(r);if(!i)return;const n=new URLSearchParams(i[2]);switch(i[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=_t,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=ht(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=ht(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=ht(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const i=n.get("name"),o=n.get("value");if(i&&null!==o){const t=H.get(i);if(t){const e=t.getType();"dict"===e||"array"===e?tt(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:i}})):t.set(o)}else tt(st(new Error("Cannot find variable"),{additional:{name:i}}))}else tt(st(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const a=n.get("action"),s=n.get("id");G?G.execTimerAction(s,a):tt(st(new Error("Incorrect timer action"),{additional:{id:s,action:a}}));break;case"video":!function(t,e){if(t){const r=ht(t);r?"start"===e?r.start():"pause"===e?r.pause():tt(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):tt(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else tt(st(new Error("Missing id in video action"),{additional:{action:e}}))}(n.get("id"),n.get("action"));break;case"download":!function(t,e){if(t){let r;r="function"==typeof A?A(t):A,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,n,o;if(r){if(r.templates)for(const t in r.templates)R.hasOwnProperty(t)||(R[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>!vt.has(t.id)));if(i)return tt(st(new Error("Skipping transactional, child is not found"),{additional:{url:t,id:i.id}})),void dt(null===(n=e.download_callbacks)||void 0===n?void 0:n.on_fail_actions)}r.patch.changes.forEach((t=>{const e=vt.get(t.id);e&&e.replaceWith(t.id,t.items)})),dt(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_success_actions)}}else tt(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;tt(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),dt(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else tt(st(new Error("Missing url in download action"),{additional:{url:t}}))}(n.get("url"),t);break;case"show_tooltip":!function(t,e){var r;if(!t)return void tt(st(new Error("Missing id in show_tooltip action")));const i=ft.get(t);if(!i)return void tt(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&Y.some((e=>e.desc.id===t)))return;const n={internalId:++Z,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};Y=[...Y,n];const o=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;o&&(n.timeoutId=window.setTimeout((()=>{n.timeoutId=0,Y=Y.filter((t=>t.internalId!==n.internalId))}),o))}(n.get("id"),n.get("multiple"));break;case"hide_tooltip":!function(t){t?Y=Y.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):tt(st(new Error("Missing id in hide_tooltip action")))}(n.get("id"));break;default:tt(st(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){tt(st(t,{additional:{url:e}}))}else if(r)switch(r.type){case"set_variable":{const{variable_name:t,value:e}=r;if(t&&e){const r=H.get(t);r?r.getType()===e.type?r.setValue(e.value):tt(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):tt(st(new Error("Cannot find variable"),{additional:{name:t}}))}else tt(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:i,index:n,value:o}=r;!o||"number"!=typeof n&&void 0!==n?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:i}})):io(t,e,r,(t=>{const a=t.getValue();if("number"==typeof n&&(n<0||n>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:i,index:n,length:a.length}}));else{const e=a.slice();"number"==typeof n?e.splice(n,0,o.value):e.push(o.value),t.setValue(e)}}))}(H,tt,r);break;case"array_remove_value":!function(t,e,r){const{variable_name:i,index:n}=r;"number"==typeof n?io(t,e,r,(t=>{const o=t.getValue();if("number"==typeof n&&(n<0||n>=o.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:i,index:n,length:o.length}}));else{const e=o.slice();e.splice(n,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:i}}))}(H,tt,r);break;case"copy_to_clipboard":!function(t,e){!e.content||"text"!==e.content.type&&"url"!==e.content.type||"string"!=typeof e.content.value?t(st(new Error("Incorrect action"),{additional:{action:e}})):"undefined"!=typeof navigator&&"clipboard"in navigator&&navigator.clipboard&&"writeText"in navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e.content.value).catch((e=>{t(st(new Error("Failed to copy to the clipboard"),{additional:{originalError:String(e)}}))})):t(st(new Error("Clipboard is unavailable"),{additional:{action:e}}))}(tt,r);break;default:tt(st(new Error("Unknown type of action"),{additional:{type:r.type}}))}}async function dt(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url,o=i.typed;if(n){const t=xt(n);if(t)if(kt(t,M)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(ut(i),await $()):i.log_id&&(pt(i),await $())}else o&&ut(i)}t.forEach((t=>{t.log_id&&et("click",t)}))}}function pt(t){null==E||E(t)}const gt=new Map,vt=new Map,ft=new Map;function ht(t){if(gt.has(t))return gt.get(t);tt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const yt=new Map;function bt(t){for(const e of t)H.has(e)&&t.delete(e);return t}v(at,{logError:tt,logStat:et,hasTemplate:function(t){return t in R},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in R;){if(({json:t,templateContext:e}=qr(t,e,R,tt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:nt,genClass:function(t){return`divkit-${nt()}`},execAction:ut,execAnyActions:dt,execCustomAction:pt,isRunning:function(t){return B[t]},setRunning:function(t,e){B[t]=e},registerInstance:function(t,e){gt.has(t)?tt(st(new Error("Duplicate instance id"),{additional:{id:t}})):gt.set(t,e)},unregisterInstance:function(t){gt.delete(t)},registerParentOf:function(t,e){vt.set(t,e)},unregisterParentOf:function(t){vt.delete(t)},registerTooltip:function(t,e){ft.has(e.id)&&tt(st(new Error("Duplicate tooltip id"),{additional:{id:e.id}})),ft.set(e.id,{onwerNode:t,tooltip:e})},unregisterTooltip:function(t){ft.delete(t.id),Y.some((e=>e.desc.id===t.id))&&(Y=Y.filter((e=>e.desc.id!==t.id)))},onTooltipClose:function(t){Y=Y.filter((e=>e.internalId!==t))},tooltipRoot:V,addSvgFilter:function(t,e){const r=`${t}:${e}`;if(lt[r]=lt[r]||0,++lt[r],ot[r])return ot[r];const i=`${nt()}-svg-filter`;return ot=Object.assign(Object.assign({},ot),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;lt[r]&&0==--lt[r]&&(ot=Object.keys(ot).reduce(((t,e)=>(lt[e]&&(t[e]=ot[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Zr(t);const e=Hn(t,tt);return e.vars.length?Q(e.vars.map((t=>H.get(t)||function(t){const e=q.get(t)||K(void 0);return q.has(t)||q.set(t,e),e}(t))).filter(mt),(()=>e.applyVars(H))):e.hasExpression?Zr(e.applyVars(H)):Zr(t)},getJsonWithVars:X,getStore:function(t){return yt.has(t)||function(t){yt.has(t)||yt.set(t,qn[t]())}(t),yt.get(t)},getVariable:function(t,e){const r=H.get(t);if(r){const i=r.getType();if(i!==e)return void tt(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return M},getExtension:function(t,e){const r=w.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:H,logError:tt}},typefaceProvider:F,isDesktop:j,isPointerFocus:no,customComponents:D,registerComponent:void 0,unregisterComponent:void 0}),v(Ht,{hasAction:()=>!1});const _t={setState(t){throw new Error("Not implemented")},getChild(t){if(wt&&wt.has(t))return wt.get(t);tt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let wt=null;v(jt,{registerInstance(t,e){wt||(wt=new Map),wt.has(t)?tt(st(new Error("Duplicate state with id"),{additional:{id:t}})):wt.set(t,e)},unregisterInstance(t){null==wt||wt.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const $t=null===(a=null==p?void 0:p.card)||void 0===a?void 0:a.variables;Array.isArray($t)&&$t.forEach((t=>{if(t&&t.type in $r&&t.name){if(W.has(t.name))return void tt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&tt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=xr(t.name,t.type,t.value);W.set(t.name,e),H.set(t.name,e)}catch(e){tt(st(e,{additional:{name:t.name}}))}}}));const Et=p.palette;Et&&Et[P].forEach((t=>{if(W.has(t.name))tt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=xr(t.name,"color",t.color);W.set(t.name,e),H.set(t.name,e)}catch(e){tt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of L)H.has(t)||H.set(t,e);U.subscribe((t=>{if(t&&!H.has(t)){const e=L.get(t);H.set(t,e);const r=q.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Ct=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variable_triggers;Array.isArray(Ct)&&Ct.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void tt(st(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=ii(t.condition,{startRule:"JsonStringContents"}),n=hi(i);if(!n.length)return void tt(st(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return bt(e),e.size?new Promise((t=>{const r=U.subscribe((()=>{bt(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{Q(n.map((t=>H.get(t))).filter(mt),(()=>{const t=Bn(H,i);return t.warnings.forEach(tt),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=X(t);e.log_id&&ut(e)})),e=Boolean(i.value)):tt(st(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){tt(st(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else tt(st(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const Ft=null===(c=null==p?void 0:p.card)||void 0===c?void 0:c.timers;if(Ft){const t=G=new ro({logError:tt,applyVars:X,hasVariableWithType:function(t,e){const r=H.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=H.get(t);r?r.setValue(e):tt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:dt});Ft.forEach((e=>t.createTimer(e)))}const At=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.states;let Vt;return At&&!N&&(Vt={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:At.map((t=>({state_id:t.state_id.toString(),div:t.div})))}),g((()=>{oo--,oo||(window.removeEventListener("keydown",ao),window.removeEventListener("pointerdown",so)),G&&G.destroy(),Y.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==d&&r.id(d),void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.platform&&r.platform&&void 0!==f&&r.platform(f),void 0===e.theme&&r.theme&&void 0!==h&&r.theme(h),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==_&&r.builtinProtocols(_),void 0===e.extensions&&r.extensions&&void 0!==w&&r.extensions(w),void 0===e.onError&&r.onError&&void 0!==x&&r.onError(x),void 0===e.onStat&&r.onStat&&void 0!==k&&r.onStat(k),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==F&&r.typefaceProvider(F),void 0===e.fetchInit&&r.fetchInit&&void 0!==A&&r.fetchInit(A),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==V&&r.tooltipRoot(V),void 0===e.customComponents&&r.customComponents&&void 0!==D&&r.customComponents(D),void 0===e.setTheme&&r.setTheme&&void 0!==O&&r.setTheme(O),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==T&&r.getDebugVariables(T),void 0===e.execAction&&r.execAction&&void 0!==ct&&r.execAction(ct),"light"===h||"dark"===h?P=h:"system"===h?"undefined"!=typeof matchMedia?(S||(S=matchMedia("(prefers-color-scheme: dark)"),S.addListener((function(){"system"===h&&S&&(P=S.matches?"dark":"light")}))),P=S.matches?"dark":"light"):P="light":tt(st(new Error("Unsupported theme"))),P&&(Et&&Et[P].forEach((t=>{const e=H.get(t.name);e&&e.setValue(t.color)}))),o(),!N&&Vt?`<div class="${I("divkit-b023c",!0)+I(n?` ${it}`:"",!0)+I(y?` ${y}`:"",!0)}">${J(Hr,"RootSvgFilters").$$render(t,{svgFiltersMap:ot},{},{})} ${J(Wr,"Unknown").$$render(t,{div:Vt,templateContext:{},layoutParams:{tooltips:Y}},{},{})}</div>`:""})),co=lo;function uo(t){return co.render(t).html}var po=e.M,go=e.Os,vo=e.sY;export{po as createGlobalVariablesController,go as createVariable,vo as render};
|
|
1
|
+
var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{M:()=>Qn,Os:()=>xr,sY:()=>uo}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function i(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class n{constructor(t){i(this,"_listeners","WeakMap"in r?new WeakMap:void 0),i(this,"_observer",void 0),i(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const r of t){var e;n.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function o(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return o}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t,e,r){return t.set(r),e}let u;function d(t){u=t}function p(){if(!u)throw new Error("Function called outside component initialization");return u}function g(t){p().$$.on_destroy.push(t)}function v(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}n.entries="WeakMap"in r?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(C)),_}function x(t){y.push(t)}const k=new Set;let E=0;function C(){if(0!==E)return;const t=u;do{try{for(;E<h.length;){const t=h[E];E++,d(t),F(t.$$)}}catch(t){throw h.length=0,E=0,t}for(d(null),h.length=0,E=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function F(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["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"]),V=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function D(t){return V.test(t)||"!doctype"===t.toLowerCase()}const j=/[\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 P(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=W(i):r.style=W(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(j.test(t))return;const e=r[t];!0===e?i+=" "+t:A.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const S=/[&"]/g,O=/[&<]/g;function I(t,e=!1){const r=String(t),i=e?S:O;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return n+r.substring(o)}function T(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function M(t){const e={};for(const r in t)e[r]=T(t[r]);return e}function N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let i="";for(let r=0;r<t.length;r+=1)i+=e(t[r],r);return i}const z={$$render:()=>""};function J(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> 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 <${e}>.`);return t}let R,B;function U(t){function e(e,r,i,n,o){const a=u;d({$$:{on_destroy:R,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,i,n);return d(a),s}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{R=[];const n={title:"",head:"",css:new Set},o=e(n,t,{},r,i);return s(R),{html:o,css:{code:Array.from(n.css).map((t=>t.code)).join("\n"),map:null},head:n.title+n.head}},$$render:e}}function L(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${I(e,!0)}"`}`}function W(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${T(t[e])};`)).join(" ")}function H(t){const e=W(t);return e?` style="${e}"`:""}function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t,e,r,i){var n;const o=null===(n=r[t])||void 0===n?void 0:n.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!i||!r[t])return e;if("toAttribute"===i)switch(o){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(B=class extends HTMLElement{constructor(t,e,r){super(),Z(this,"$$ctor",void 0),Z(this,"$$s",void 0),Z(this,"$$c",void 0),Z(this,"$$cn",!1),Z(this,"$$d",{}),Z(this,"$$r",!1),Z(this,"$$p_d",{}),Z(this,"$$l",{}),Z(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}(e,"name",t)},m:function(t,r){!function(t,e,r){t.insertBefore(e,r||null)}(t,e,r)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},r=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const n of this.$$s)n in r&&(e[n]=[t(n)]);for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Y(a,o.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const i=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Y(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,r){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,r,this.$$p_d,"toProp"),null===(i=this.$$c)||void 0===i||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const X=[];function K(t,e=o){let r;const i=new Set;function n(e){if(o=e,((n=t)!=n?o==o:n!==o||n&&"object"==typeof n||"function"==typeof n)&&(t=e,r)){const e=!X.length;for(const e of i)e[1](),X.push(e,t);if(e){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}var n,o}function a(e){n(e(t))}return{set:n,update:a,subscribe:function(s,l=o){const c=[s,l];return i.add(c),1===i.size&&(r=e(n,a)||o),s(t),()=>{i.delete(c),0===i.size&&r&&(r(),r=null)}}}}function Q(t,e,r){const i=!Array.isArray(t),n=i?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,r)=>{let c=!1;const u=[];let d=0,p=o;const g=()=>{if(d)return;p();const n=e(i?u[0]:u,t,r);a?t(n):p="function"==typeof n?n:o},v=n.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&g()}),(()=>{d|=1<<e}))));return c=!0,g(),function(){s(v),p(),c=!1}},{subscribe:K(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",it="divkit-ee112",nt="divkit-aa145",ot="divkit-f0cba",at=Symbol("root");function st(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const lt={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_multiline:"divkit-ee8e3",text_truncate_none:"divkit-c6ea1",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002","text_has-focus-color":"divkit-cb341"},ct={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function ut(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function dt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function gt(t,e){for(;t.length<e;)t="0"+t;return t}function vt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const i=ft(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>gt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function ft(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ht(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:vt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=vt(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>vt(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:wt(t.bg.scale),pos:$t(t.bg),image:'url("'+ht(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);if(!r.length)return;const i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=pt(i.value):"relative"===i.type&&(n=bt[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>vt(t))).join(",")+")"}}({bg:t}):void 0)).filter(mt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const bt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function _t(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return pt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function wt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function $t(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function xt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(r),!0).forEach((function(e){Ft(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ft(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function At(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Vt(t,e){e&&t.push(e)}function Dt(t,e,r){const i=[];Vt(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&Vt(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const jt=Symbol("state");function Pt(t){return dt(t.top||0)+" "+dt(t.right||0)+" "+dt(t.bottom||0)+" "+dt(t.left||0)}function St(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function Ot(t){return St(t)&&t>=0}function It(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!Ot(r[t]))return e;return Pt(t)}function Tt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const Mt=Object.prototype.hasOwnProperty;function Nt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!Mt.call(e,n)||!Nt(t[n],e[n]))return!1}return!0}function zt(t,e){return Nt(t,e)?e:t}function Jt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Rt(t,e){const r=Number(t);return isNaN(r)?e:r}function Bt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Bt(t))})):e.push(t),e}function Ut(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!Ot(t[r[i]]))return e;return t}function Lt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>dt((t||e)/r*10))).join(" ")}function Wt(){}const Ht=Symbol("action"),qt=U(((t,e,r,i)=>{let{id:n=""}=e,{actions:o}=e,{doubleTapActions:a}=e,{longTapActions:s}=e,{cls:l=""}=e,{style:c=null}=e,{attrs:u}=e,{use:d=Wt}=e,{customAction:p=null}=e,{isNativeActionAnimation:h=!0}=e,{hasInnerFocusable:m=!1}=e;const y=f(at),b=f(Ht);let _;v(Ht,{hasAction:()=>Boolean(b.hasAction()||(null==o?void 0:o.length))});let w,$="",x=!1;if(g((()=>{n&&!m&&y.unregisterFocusable(n)})),void 0===e.id&&r.id&&void 0!==n&&r.id(n),void 0===e.actions&&r.actions&&void 0!==o&&r.actions(o),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==a&&r.doubleTapActions(a),void 0===e.longTapActions&&r.longTapActions&&void 0!==s&&r.longTapActions(s),void 0===e.cls&&r.cls&&void 0!==l&&r.cls(l),void 0===e.style&&r.style&&void 0!==c&&r.style(c),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==d&&r.use(d),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==h&&r.isNativeActionAnimation(h),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==m&&r.hasInnerFocusable(m),Array.isArray(o)&&(null==o?void 0:o.length))for(let t=0;t<o.length;++t){const e=o[t].url;if(e){$=e,w=o[t].target||void 0;break}}return Array.isArray(o)&&(null==o?void 0:o.length)&&b.hasAction()&&($="",y.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:o}}))),x=Boolean(p),$&&!kt(xt($),y.getBuiltinProtocols())?($="",x=!0):!$&&Array.isArray(o)&&(null==o?void 0:o.length)&&(x=!0,o.some((t=>t.url||t.typed))||y.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:o}}))),$?`<a${P([{href:T($)},{target:T(w)},{style:T(c)},{class:I(l,!0)+" "+I(h?tt:et,!0)+" "+I(null!=s&&s.length?ot:"",!0)},M(u)],{})}${L("this",_,0)}>${i.default?i.default({}):""}</a>`:` <span${P([{class:I(l,!0)+I(x?` ${h?tt:et} ${rt}`:"",!0)+" "+I(null!=s&&s.length?ot:"",!0)},{style:T(c)},{role:T(x?"button":null)},{tabindex:T(x?0:null)},M(u)],{})}${L("this",_,0)}>${i.default?i.default({}):""}</span>`})),Gt="divkit-b921d";function Zt(t){return St(t)&&t>0}function Yt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Zt(t.radius))return`blur(${pt(t.radius/2)})`}else e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Xt=U(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=f(at);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),n=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const i=yt([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Yt(t.filters,s.logError)))}return r})),`<span${L("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${H({"border-radius":a})}>${N(n,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Gt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Gt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Xt,Qt=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S,O,I,T,M,N,z,R,B,U,W,H,q,G,Z,Y,X,K,Q,tt,et,rt=o,it=o,nt=o,ot=o,lt=o,gt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,Et=o,Ft=o,Vt=o,St=o,Mt=o,Nt=o,Wt=o,{json:Ht={}}=e,{origJson:Gt}=e,{templateContext:Zt}=e,{cls:Yt=""}=e,{style:Xt}=e,{layoutParams:Qt={}}=e,{customDescription:te=!1}=e,{customPaddings:ee=!1}=e,{customActions:re=""}=e,{additionalPaddings:ie=null}=e,{heightByAspect:ne=!1}=e,{parentOf:oe}=e,{replaceItems:ae}=e,{hasInnerFocusable:se=!1}=e;const le={left:"start",center:"center",right:"end"},ce={top:"start",center:"center",bottom:"end",baseline:"baseline"},ue=f(at),de=f(jt);let pe,ge,ve=null,fe=[];function he(t,e){if(!Array.isArray(oe)||!ae)return;const r=oe.findIndex((e=>(null==e?void 0:e.id)===t)),i=oe.slice();i.splice(r,1,...e||[]),oe=i,ae(i)}let me,ye,be,_e,we,$e,xe,ke,Ee,Ce,Fe={},Ae={},Ve=!1,De=1,je="transparent",Pe=0,Se={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Oe="",Ie=null,Te="",Me={},Ne=0,ze=0,Je=0,Re=!1,Be=!1,Ue={},Le=0,We=0,He=0,qe=!1,Ge=!1,Ze=1;const Ye=Qt.fakeElement?[]:Ht.transition_triggers||["state_change","visibility_change"],Xe=-1!==Ye.indexOf("state_change")&&Ht.id,Ke=-1!==Ye.indexOf("visibility_change")&&Ht.id;let Qe,tr,er,rr,ir,nr,or,ar,sr,lr,cr=[],ur=[],dr=[],pr=[],gr=[],vr=[],fr="",hr=!1,mr="visible",yr=0,br=0;function _r(){Ht.focus&&(I||(lr=!0),ue.execAnyActions(pr))}function wr(){Ht.focus&&(lr=!1,ue.execAnyActions(gr))}g((()=>{var t;fe.forEach((t=>{ue.unregisterParentOf(t)})),fe=[],null===(t=Ht.tooltips)||void 0===t||t.forEach((t=>{ue.unregisterTooltip(t)}))})),void 0===e.json&&r.json&&void 0!==Ht&&r.json(Ht),void 0===e.origJson&&r.origJson&&void 0!==Gt&&r.origJson(Gt),void 0===e.templateContext&&r.templateContext&&void 0!==Zt&&r.templateContext(Zt),void 0===e.cls&&r.cls&&void 0!==Yt&&r.cls(Yt),void 0===e.style&&r.style&&void 0!==Xt&&r.style(Xt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Qt&&r.layoutParams(Qt),void 0===e.customDescription&&r.customDescription&&void 0!==te&&r.customDescription(te),void 0===e.customPaddings&&r.customPaddings&&void 0!==ee&&r.customPaddings(ee),void 0===e.customActions&&r.customActions&&void 0!==re&&r.customActions(re),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ie&&r.additionalPaddings(ie),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ne&&r.heightByAspect(ne),void 0===e.parentOf&&r.parentOf&&void 0!==oe&&r.parentOf(oe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ae&&r.replaceItems(ae),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==se&&r.hasInnerFocusable(se),fe.forEach((t=>{ue.unregisterParentOf(t)})),fe=[],oe&&oe.forEach((t=>{t.id&&(fe.push(t.id),ue.registerParentOf(t.id,{replaceWith:he}))})),n=ue.getDerivedFromVars(Ht.focus),lt(),lt=l(n,(t=>z=t)),a=ue.getDerivedFromVars(Ht.border),Wt(),Wt=l(a,(t=>et=t));{const t=lr&&(null==z?void 0:z.border)?z.border:et;let e={},r={},i=!1,n="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,i,n,o,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(i=t.offset)||void 0===i||null===(n=i.y)||void 0===n?void 0:n.value)||0)+" "+dt(null!==(o=t.blur)&&void 0!==o?o:2)+" "+vt(t.color||"#000000",null!==(a=t.alpha)&&void 0!==a?a:.19)}(r):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(i=!0,De=Tt(t.stroke.width,De),je=vt(t.stroke.color,1,je),r.border=`${dt(De)} solid ${je}`),t.corners_radius?(Se=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!Ot(r[t]))return e;return t}(t.corners_radius,Se),r["border-radius"]=e["border-radius"]=Lt(Se)):t.corner_radius&&(Pe=Tt(t.corner_radius,Pe),Se={"top-left":Pe,"top-right":Pe,"bottom-right":Pe,"bottom-left":Pe},r["border-radius"]=e["border-radius"]=dt(Pe)),i&&De&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Se);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+De/2})),n=Lt(t)}}Fe=zt(e,Fe),Ae=zt(r,Ae),Ve=i,Oe=n}s=ue.getDerivedFromVars(Ht.paddings),Nt(),Nt=l(s,(t=>tt=t)),Ie=Ut(tt&&!ee?tt:void 0,Ie),c=Pt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}(Ie,ie)),u=ue.getDerivedFromVars(Ht.margins),St(),St=l(u,(t=>K=t)),Te=It(K,Te),d=ue.getDerivedFromVars(Ht.width),Ft(),Ft=l(d,(t=>Y=t)),p=ue.getDerivedFromVars(Ht.alignment_horizontal),Mt(),Mt=l(p,(t=>Q=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Ne=Tt(null==Y?void 0:Y.value,Ne),e=dt(Ne);else if("wrap_content"!==c&&(Qt.overlapParent||"match_parent"!==c&&c||!Qt.parentHorizontalWrapContent))t="parent","vertical"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,ue.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==K?void 0:K.left)||0)+((null==K?void 0:K.right)||0))})`:"horizontal"===Qt.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,Qt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&Qt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Qt.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"!==c&&c||ue.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=Q;n["halign-self"]="left"===t||"center"===t||"right"===t?le[t]:Qt.parentHAlign||"start"}t&&(n.width=t),me=e,ye=r,be=i,ze=o,Je=a,Me=zt(n,Me),Re=s,Be=l}v=ue.getDerivedFromVars(Ht.height),Et(),Et=l(v,(t=>Z=t)),h=ue.getDerivedFromVars(Ht.alignment_vertical),Vt(),Vt=l(h,(t=>X=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ne);else if("fixed"===c)Le=Tt(null==Z?void 0:Z.value,Le),e=dt(Le);else if("match_parent"!==c||!Qt.overlapParent&&Qt.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&Qt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Qt.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&Ot(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"===c&&ue.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,ue.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==K?void 0:K.top)||0)+((null==K?void 0:K.bottom)||0))})`:"vertical"===Qt.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,Qt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Qt.parentContainerOrientation?n["valign-self"]=ce[t]:n["valign-self"]=Qt.parentVAlign||"start"}t&&(n.height=t),_e=e,we=r,$e=i,We=o,He=a,Ue=zt(n,Ue),qe=s,Ge=l}var $r,xr,kr;if(m=!!Qt.overlapParent||void 0,y=Qt.overlapParent&&(!Y||"match_parent"===Y.type)&&"match_parent"===(null==Z?void 0:Z.type),b=Qt.gridArea?`${Qt.gridArea.y+1}/${Qt.gridArea.x+1}/span ${Qt.gridArea.rowSpan}/span ${Qt.gridArea.colSpan}`:void 0,_=ue.getDerivedFromVars(Ht.alpha),$t(),$t=l(_,(t=>G=t)),xr=Ze,Ze=!Ot($r=G)||void 0===$r||$r>1?xr:Number($r),xe=1===Ze?void 0:Ze,w=ue.getDerivedFromVars(Ht.accessibility),wt(),wt=l(w,(t=>q=t)),ge=void 0,q&&!te&&q.description&&(ge={},ge["aria-label"]=q.description),x=ue.getDerivedFromVars(Ht.background),_t(),_t=l(x,(t=>H=t)),ke=lr&&(null==z?void 0:z.background)?z.background:H,Ee={},Ce=!1,Array.isArray(ke)&&(Ce=ke.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Oe),!Ce)){const t=yt(ke);Ee["background-color"]=t.color,Ee["background-image"]=t.image,Ee["background-size"]=t.size,Ee["background-position"]=t.position,Ee["background-repeat"]="no-repeat"}Qe=void 0,Xe&&Ht.transition_in&&ue.isRunning("stateChange")&&(Qe=!0),er=void 0,Xe&&Ht.transition_change&&ue.isRunning("stateChange")&&de.hasTransitionChange(Ht.id)&&(er=!0),k=ue.getDerivedFromVars(Ht.action),ht(),ht=l(k,(t=>U=t)),E=ue.getDerivedFromVars(Ht.actions),bt(),bt=l(E,(t=>W=t)),C=ue.getDerivedFromVars(Ht.doubletap_actions),ft(),ft=l(C,(t=>B=t)),F=ue.getDerivedFromVars(Ht.longtap_actions),gt(),gt=l(F,(t=>R=t));{let t=W||U&&[U]||[],e=B||[],r=R||[],i=(null==z?void 0:z.on_focus)||[],n=(null==z?void 0:z.on_blur)||[];Qt.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],ue.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ue.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ue.logError(st(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],ue.logError(st(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],ue.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&re&&(t=[],e=[],r=[],ue.logError(st(new Error(`Cannot use action on component "${re}"`)))),cr=t,ur=e,dr=r,pr=i,gr=n}A=ue.getDerivedFromVars(Ht.action_animation),ot(),ot=l(A,(t=>N=t)),N&&(vr=Bt(N),fr=vr.map((function(t){const e=Rt(t.start_value,1),r=Rt(t.end_value,1),i=Tt(t.start_delay,0),n=Tt(t.duration,300),o=Jt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return rr=e,ir=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return nr=e,or=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ue.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),V=ue.getDerivedFromVars(Ht.visibility),nt(),nt=l(V,(t=>M=t));{const t=mr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(M,mr);t!==e&&(!hr||"visible"!==mr&&"visible"!==e?mr=e:async function(t){mr=t;const e="visible"===t?"in":"out",r="in"===e?Ht.transition_in:Ht.transition_out;Ke&&r&&(await $(),"in"===e&&(tr=!0),de.runVisibilityTransition(Object.assign(Object.assign({},Ht),{visibility:"visible"}),Zt,r,pe,e).then((()=>{"in"===e&&(tr=!1)})).catch((t=>{throw"in"===e&&(tr=!1),t})))}(e)),hr||(hr=!0)}if(D=Object.assign(Object.assign(Object.assign({},Me),Ue),{"parent-overlap":m,"parent-overlap-absolute":y,"scroll-snap":Qt.scrollSnap,"hide-on-transition-in":Qe||tr||er,visibility:mr,"has-action-animation":Boolean(fr),"parent-flex":Qt.parentContainerOrientation||void 0,"parent-grid":Boolean(Qt.gridArea)||void 0,"has-custom-focus":Boolean(lr&&Ht.focus)}),j=ue.getDerivedFromVars(Ht.transform),it(),it=l(j,(t=>T=t)),T&&void 0!==T.rotation){const t=T.pivot_x||{type:"pivot-percentage",value:50};yr=Rt(t.value,yr);const e="pivot-fixed"===t.type?dt(yr):`${yr}%`,r=T.pivot_y||{type:"pivot-percentage",value:50};br=Rt(r.value,br),ar=`${e} ${"pivot-fixed"===r.type?dt(br):`${br}%`}`,sr=`rotate(${T.rotation}deg)`}return P=Re||qe?"100%":ze||We?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Xt),Ee),Fe),{width:me,"min-width":ye,"max-width":be,height:_e,"min-height":we,"max-height":$e||(null==Xt?void 0:Xt["max-height"]),"grid-area":b,padding:c,margin:Te,opacity:xe,transition:fr,"transform-origin":ar,transform:sr,"flex-grow":ze||We||void 0,"flex-shrink":Je||He?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":rr,"--divkit-animation-opacity-end":ir,"--divkit-animation-scale-start":nr,"--divkit-animation-scale-end":or}),O=ue.isPointerFocus,rt(),rt=l(O,(t=>I=t)),rt(),it(),nt(),ot(),lt(),gt(),ft(),ht(),bt(),_t(),wt(),$t(),Et(),Ft(),Vt(),St(),Mt(),Nt(),Wt(),Be||Ge?"":`${J(qt,"Actionable").$$render(t,{id:Ht.id,use:function(t){var e;pe=t,Xe&&Ht.transition_in&&de.registerChildWithTransitionIn(Ht,Zt,Ht.transition_in,t).then((()=>{Qe=!1})).catch((t=>{throw Qe=!1,t})),Xe&&Ht.transition_out&&de.registerChildWithTransitionOut(Ht,Zt,Ht.transition_out,t),Xe&&Ht.transition_change&&de.registerChildWithTransitionChange(Ht,Zt,Ht.transition_change,t).then((()=>{er=!1})).catch((t=>{throw er=!1,t}));const r=Qt.fakeElement?[]:Ht.visibility_actions||Ht.visibility_action&&[Ht.visibility_action],i=Qt.fakeElement?[]:Ht.disappear_actions;(Array.isArray(r)&&r.length||Array.isArray(i)&&i.length)&&function(t,{visibilityActions:e,disappearActions:r,rootCtx:i}){const n=[];e&&e.forEach((t=>{n.push({type:"visibility",index:n.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{n.push({type:"disappear",index:n.length,action:t,visible:!1,count:0,finished:!1})}));const o=n.map((t=>{const e="visibility"===t.type,r=i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:e?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit});return Ct(Ct({},r),{},{visibility_percentage:At(e,r.visibility_percentage,e?50:0)})})),a=[...new Set(o.map((t=>t.visibility_percentage/100)))];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=o[e.index],n="visibility"===e.type;let a;a=0===r.visibility_percentage?t.intersectionRatio>=1e-12:t.intersectionRatio>=r.visibility_percentage/100;const s=n?!e.visible&&a:e.visible&&!a,l=n?!a:a;s?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===r.log_limit?1/0:r.log_limit||1;++e.count>=t&&(e.finished=!0);const o=i.getJsonWithVars(e.action),a=o.url,s=o.typed;if(a){const t=xt(a);t&&!kt(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(o):o.log_id&&i.execCustomAction(o))}else s&&i.execAction(o);i.logStat(n?"visible":"disappear",o)}),o[e.index].visibility_duration||800)):l&&e.timer&&clearTimeout(e.timer),e.visible=a}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:r,disappearActions:i,rootCtx:ue});const n=Ht.id;n&&de.registerChild(n),null===(e=Ht.tooltips)||void 0===e||e.forEach((e=>{ue.registerTooltip(t,e)}));let o=null;if(Array.isArray(Ht.extensions)){const e=ue.getExtensionContext();ve=Ht.extensions.map((r=>{var i;const n=ue.getExtension(r.id,r.params);return n&&(null===(i=n.mountView)||void 0===i||i.call(n,t,e)),n})).filter(mt)}return{destroy(){if(n&&de.unregisterChild(n),ve){const e=ue.getExtensionContext();ve.forEach((r=>{var i;null===(i=r.unmountView)||void 0===i||i.call(r,t,e)})),ve=null}o&&o.destroy()}}},cls:Yt+" "+Dt("outer",ct,D),style:ut(S),actions:cr,doubleTapActions:ur,longTapActions:dr,attrs:ge,hasInnerFocusable:se,isNativeActionAnimation:!vr.length||(kr=vr,kr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ce?`${J(Kt,"OuterBackground").$$render(t,{background:ke,radius:Oe},{},{})}`:""}${i.default?i.default({focusHandler:_r,blurHandler:wr,hasCustomFocus:lr}):""}${Ve?`<span${L("class",ct.outer__border,0)}${L("style",ut(Ae),0)}></span>`:""}`})}`})),te=Qt,ee={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function re(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function ie(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function ne(t,e){return ie(t)||e}const oe=U(((t,e,r,i)=>{let n,o,a,s,l,c;var u,d;let{text:p}=e,{rootFontSize:g}=e,{textStyles:v={}}=e,{singleline:h=!1}=e,{actions:m}=e;const y=f(at);let b,_="none",w=12,$=1.25,x="",k="",E="",C=null;void 0===e.text&&r.text&&void 0!==p&&r.text(p),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==v&&r.textStyles(v),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==m&&r.actions(m);{let t="none";(v.underline||v.strike)&&("single"===v.underline&&"single"===v.strike?t="both":"single"===v.underline?t="underline":"single"===v.strike&&(t="strike")),_=t}return w=re(v.font_size,w),Zt(v.line_height)&&($=Number(v.line_height)/w),Ot(v.letter_spacing)&&(x=dt(v.letter_spacing)),b=ne(v.font_weight,b),k="string"==typeof v.font_family&&v.font_family?y.typefaceProvider(v.font_family,{fontWeight:b||400}):"",E=vt(v.text_color,1,E),n=v.top_offset?dt(v.top_offset):"",o=v.background?yt([v.background]):null,C=(null===(u=v.border)||void 0===u?void 0:u.stroke)&&v.border.stroke.color&&"transparent"!==vt(v.border.stroke.color)&&Zt(v.border.stroke.width)?{color:v.border.stroke.color,width:v.border.stroke.width}:null,a=re(null===(d=v.border)||void 0===d?void 0:d.corner_radius,0),s=v.text_shadow?function(t,e){var r,i,n,o,a,s;return"drop-shadow("+vt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(n=i.x)||void 0===n?void 0:n.value)||0)/e)+" "+dt(10*((null===(o=t.offset)||void 0===o||null===(a=o.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(v.text_shadow,w):void 0,l={singleline:h,decoration:_},c={"font-size":dt(10*w/g),"line-height":$,"letter-spacing":x,"font-weight":b,"font-family":k,filter:s,color:E,background:(null==o?void 0:o.color)||void 0,"box-shadow":C?`inset 0 0 0 ${dt(C.width)} ${C.color}`:void 0,"border-radius":a?dt(a):void 0},`${n?`<span${L("class",ee["text-range__top-offset"],0)}${H({"margin-top":n})}></span>`:""}${J(qt,"Actionable").$$render(t,{cls:Dt("text-range",ee,l),actions:m,style:ut(c)},{},{default:()=>`${I(p)}`})}`})),ae=oe;function se(t,e){return"left"===t||"center"===t||"right"===t?t:e}function le(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function ce(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ue(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const de=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,I,T,M,z,R,B,U,W,H=o,q=o,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,it=o,nt=o,ot=o,ct=o,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ft}=e,{layoutParams:ht}=e;const mt=f(at);let bt=!1,_t="",wt=12,$t=1.25,xt=!1,kt="",Et="",Ct=!1,Ft="left",At="top",Vt="",jt="",Pt="",St=!1,Ot=[],It=[];var Tt,Mt;g((()=>{It.forEach((([t,e])=>{mt.removeSvgFilter(t,e)}))})),void 0===e.json&&r.json&&void 0!==pt&&r.json(pt),void 0===e.templateContext&&r.templateContext&&void 0!==gt&&r.templateContext(gt),void 0===e.origJson&&r.origJson&&void 0!==ft&&r.origJson(ft),void 0===e.layoutParams&&r.layoutParams&&void 0!==ht&&r.layoutParams(ht),n=mt.getDerivedFromVars(pt.text),ct(),ct=l(n,(t=>W=t)),Tt=W,Mt=_t,_t=String(null!=Tt?Tt:"")||Mt,_t?bt=!1:(bt=!0,mt.logError(st(new Error('Missing "text" prop for div "text"')))),a=mt.getDerivedFromVars(pt.ranges),q(),q=l(a,(t=>D=t)),s=mt.getDerivedFromVars(pt.images),H(),H=l(s,(t=>V=t)),c=mt.getDerivedFromVars({font_size:pt.font_size,letter_spacing:pt.letter_spacing,font_weight:pt.font_weight,font_family:pt.font_family,text_color:pt.text_color,underline:pt.underline,strike:pt.strike,line_height:pt.line_height,text_shadow:pt.text_shadow}),G(),G=l(c,(t=>j=t)),u=mt.getDerivedFromVars(pt.font_size),ot(),ot=l(u,(t=>U=t)),wt=re(U,wt),d=mt.getDerivedFromVars(pt.line_height),nt(),nt=l(d,(t=>B=t));{const t=B;Zt(t)?($t=Number(t)/wt,xt=!0):xt=!1}p=mt.getDerivedFromVars(pt.max_lines),tt(),tt=l(p,(t=>M=t)),v=1===M;{let t="",e="",r=!1;if(M&&M>1){let i=Number(M);t=i*$t+"em",e=i,r=!0}kt=t,Et=e,Ct=r}h=mt.getDerivedFromVars(pt.text_alignment_horizontal),it(),it=l(h,(t=>R=t)),Ft=se(R,Ft),m=mt.getDerivedFromVars(pt.text_alignment_vertical),et(),et=l(m,(t=>z=t)),At=le(z,At),y=!D||_t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=_t.length,b=mt.getDerivedFromVars(pt.text_color),Q(),Q=l(b,(t=>T=t)),_=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";M&&y&&_&&(t=vt(T||D&&D[0]&&D[0].text_color,1,Vt)),Vt=t}w=mt.getDerivedFromVars(pt.focused_text_color),K(),K=l(w,(t=>I=t)),jt=vt(I,1,jt),$=mt.getDerivedFromVars(pt.truncate),X(),X=l($,(t=>O=t)),x="none"===O?"none":"",k=mt.getDerivedFromVars(pt.text_gradient),Y(),Y=l(k,(t=>S=t));{let t="";if(S){const e=yt([S]);e.image&&(t=e.image)}Pt=t}return E=mt.getDerivedFromVars(pt.selectable),Z(),Z=l(E,(t=>P=t)),St=ce(P,St),function(t,e,r){let i=[];if(It.forEach((([t,e])=>{mt.removeSvgFilter(t,e)})),It=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Ot=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":dt(10*(Number(e.font_size)||12)/wt)};let a="";const s=t.image.tint_color,c=ue(t.image.tint_mode,"source_in");if(s){const e=vt(t.image.tint_color);a=mt.addSvgFilter(e,c),It.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},j)}),Ot=i}(_t,D,V),C={singleline:v,multiline:Ct,halign:Ft,valign:At,truncate:x,"has-focus-color":Boolean(jt)},F={gradient:Boolean(Pt)},A={"font-size":dt(wt),"line-height":$t,"max-height":kt,"-webkit-line-clamp":Et,color:Vt,"background-image":Pt,"--divkit-text-focus-color":jt},H(),q(),G(),Z(),Y(),X(),K(),Q(),tt(),et(),it(),nt(),ot(),ct(),bt?"":`${J(te,"Outer").$$render(t,{cls:Dt("text",lt,C)+" "+(St?"":rt),json:pt,origJson:ft,templateContext:gt,layoutParams:ht},{},{default:()=>`<span${L("class",Dt("text__inner",lt,F),0)}${L("style",ut(A),0)}>${Ot.length?`${N(Ot,((e,r)=>"text"in e?e.text?`${J(ae,"TextRangeView").$$render(t,{text:e.text,rootFontSize:wt,textStyles:e.textStyles,singleline:v,actions:e.actions},{},{})}`:"":e.image?`<span${L("style",ut(e.image.wrapperStyle),0)}><img${L("class",lt.text__image,0)}${L("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${L("style",ut({width:e.image.width,height:e.image.height,"margin-top":xt?`-${e.image.height}`:void 0,"margin-bottom":xt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${J(ae,"TextRangeView").$$render(t,{text:_t,rootFontSize:wt,textStyles:j,singleline:v},{},{})}`}</span>`})}`})),pe=de,ge={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function ve(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function fe(t,e,r){const i=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),n=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+n:t.left=e.style.width+i),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+n:t.right=e.style.width+i)}function he(t,e,r){let i;const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return i="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+n:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],i.map(dt).join(" ")}function me(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function ye(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function be(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)i={width:Tt(null===(o=(n=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Tt(null===(a=n.item_height)||void 0===a?void 0:a.value,10),radius:Tt(null===(s=n.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Tt(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?vt(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=vt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}let _e;function we(){if(void 0!==_e)return _e;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),_e=1===t.scrollHeight,document.body.removeChild(t),_e}const $e="divkit-a7719",xe="divkit-f6e9a";function ke(t,e,r,i,n,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:n.left+a,width:Math.max(0,n.right-n.left-a-s),height:i.top-r.bottom-l-c,style:e.style}):t.push({top:n.top+l,left:r.right+a,width:i.left-r.right-a-s,height:Math.max(0,n.bottom-n.top-l-c),style:e.style})}function Ee(t,e,r,i,n,o){const a={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if(null==e?void 0:e.show_at_start){let s,l;"space-around"===n||"space-evenly"===n?(s=o.left-e.style.width,l=o.top-e.style.height):(s=r[0].left-e.style.width-e.margins.left-e.margins.right,l=r[0].top-e.style.height-e.margins.top-e.margins.bottom),ke(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,i)}if(null==e?void 0:e.show_between)for(let n=0;n<r.length-1;++n)ke(t,e,r[n],r[n+1],a,i);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===n||"space-evenly"===n?(l=o.bottom+e.style.height,c=o.right+e.style.width):(l=s.bottom+e.style.height+e.margins.top+e.margins.bottom,c=s.right+e.style.width+e.margins.left+e.margins.right),ke(t,e,s,{top:l,right:0,bottom:0,left:c},a,i)}}const Ce=U(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e;const u=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect(),e=window.getComputedStyle(n),r={top:t.top+parseFloat(e.paddingTop),right:t.right-parseFloat(e.paddingRight),bottom:t.bottom-parseFloat(e.paddingBottom),left:t.left+parseFloat(e.paddingLeft)};p=[];let i=[...n.children].filter((t=>t!==d&&!t.classList.contains(ct.outer__border))),u=[];for(;i.length;){const t=[],e=i.shift();t.push(e);let r=e.getBoundingClientRect(),n=r.right,a=r.bottom;for(;i.length;){let e=i[0],r=e.getBoundingClientRect();if("vertical"===o){if(r.top<a)break}else if(r.left<n)break;n=Math.max(n,r.right),a=Math.max(a,r.bottom),t.push(e),i.shift()}u.push(t)}const g=[];u.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&Ee(p,a,e,"vertical"===o,"vertical"===o?c:l,r);const i={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};g.push(i)})),s&&Ee(p,s,g,"horizontal"===o,"vertical"===o?l:c,r),p.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let d,p=[],v=!1,f=null,h=null;return g((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),void 0===e.contentHAlign&&r.contentHAlign&&void 0!==l&&r.contentHAlign(l),void 0===e.contentVAlign&&r.contentVAlign&&void 0!==c&&r.contentVAlign(c),n=null,(v&&n||f||h)&&(f&&(f.disconnect(),f=null),h&&(h.disconnect(),h=null),v&&n&&("undefined"!=typeof MutationObserver&&(f=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(xe))&&!(null==r?void 0:r.contains($e))}))&&u()})),f.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(u),h.observe(n)))),v&&n&&u(),` <div${L("class",$e,0)}${L("this",d,0)}>${N(p,(t=>`<div${L("class","divkit-c770e",0)}${H({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${L("class",xe,0)}${H({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`})),Fe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O=o,I=o,T=o,M=o,z=o,R=o,B=o,U=o,L=o,W=o;var H,q,G,Z,Y,X;let{json:K={}}=e,{templateContext:tt}=e,{origJson:et}=e,{layoutParams:rt}=e;const it={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},nt={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},ot=["rounded_rectangle","circle"],lt=f(at);let ct,ut,dt=!1,pt="vertical",gt="top",vt="left",ft=null,ht=null,mt={};void 0===e.json&&r.json&&void 0!==K&&r.json(K),void 0===e.templateContext&&r.templateContext&&void 0!==tt&&r.templateContext(tt),void 0===e.origJson&&r.origJson&&void 0!==et&&r.origJson(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),n=K.items,(null==n?void 0:n.length)&&Array.isArray(n)?dt=!1:(dt=!0,lt.logError(st(new Error('Incorrect or empty "items" prop for div "container"')))),a=(!dt&&n||[]).map((t=>{let e=t,r=tt;return({templateContext:r,json:e}=lt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];a.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),ct=Q(t,(t=>[...t])),U(),U=l(ct,(t=>j=t))}if(s=lt.getDerivedFromVars(K.orientation),W(),W=l(s,(t=>S=t)),pt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(S,pt),c=lt.getDerivedFromVars(K.layout_mode),L(),L=l(c,(t=>P=t)),u="wrap"===P,d="horizontal"!==pt&&!u&&j.some(me),p="vertical"!==pt&&!u&&j.some(ye),g=lt.getDerivedFromVars(K.content_alignment_vertical),B(),B=l(g,(t=>D=t)),gt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(D,gt),v=lt.getDerivedFromVars(K.content_alignment_horizontal),R(),R=l(v,(t=>V=t)),vt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(V,vt),h=lt.getDerivedFromVars(K.separator),z(),z=l(h,(t=>A=t)),(null==A?void 0:A.style)&&"overlap"!==pt&&we()){const t=be(A.style,ot,(null==ft?void 0:ft.style)||null);ft=t?{show_at_start:Boolean(null!==(H=A.show_at_start)&&void 0!==H&&H),show_at_end:Boolean(null!==(q=A.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(G=A.show_between)||void 0===G||G),style:t,margins:ve(A.margins)}:null}else ft=null;if(m=lt.getDerivedFromVars(K.line_separator),M(),M=l(m,(t=>F=t)),(null==F?void 0:F.style)&&"overlap"!==pt&&we()){const t=be(F.style,ot,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(Z=F.show_at_start)&&void 0!==Z&&Z),show_at_end:Boolean(null!==(Y=F.show_at_end)&&void 0!==Y&&Y),show_between:Boolean(null===(X=F.show_between)||void 0===X||X),style:t,margins:ve(F.margins)}:null}else ht=null;y=ft||ht?function(t,e,r){const i={};return fe(i,e,"vertical"===t),fe(i,r,"horizontal"===t),i}(pt,ft,ht):null,b=lt.getDerivedFromVars(K.aspect),T(),T=l(b,(t=>C=t));{const t=null==C?void 0:C.ratio;ut=t&&Zt(t)?t:void 0}_=lt.getDerivedFromVars(K.width),O(),O=l(_,(t=>k=t)),w=lt.getDerivedFromVars(K.height),I(),I=l(w,(t=>E=t));{let t={};(null==rt?void 0:rt.fakeElement)&&(t.fakeElement=!0),"overlap"===pt&&(t.overlapParent=!0),"horizontal"!==pt&&(t.parentHAlign=u?"start":it[vt]),"vertical"!==pt&&(t.parentVAlign=u?"start":nt[gt]),ut||p||E&&"wrap_content"!==E.type&&("match_parent"!==E.type||!(null==rt?void 0:rt.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!d&&("wrap_content"===(null==k?void 0:k.type)||"match_parent"===(null==k?void 0:k.type)&&(null==rt?void 0:rt.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===pt&&(t.parentContainerOrientation="horizontal"),"vertical"===pt&&(t.parentContainerOrientation="vertical"),u&&(t.parentContainerWrap=!0),mt=zt(t,mt)}return $={orientation:pt,valign:gt,halign:vt,wrap:u},x={gap:ft||ht?he(pt,ft,ht):void 0,"aspect-ratio":ut},O(),I(),T(),M(),z(),R(),B(),U(),L(),W(),dt?"":`${J(te,"Outer").$$render(t,{cls:Dt("container",ge,$),style:x,json:K,origJson:et,templateContext:tt,layoutParams:rt,additionalPaddings:y,heightByAspect:Boolean(ut),parentOf:n,replaceItems:function(t){K=Object.assign(Object.assign({},K),{items:t})}},{},{default:()=>`${N(a,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:mt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} ${ft||ht?`${J(Ce,"ContainerSeparators").$$render(t,{separator:ft,lineSeparator:ht,orientation:pt,contentHAlign:vt,contentVAlign:gt},{},{})}`:""}`})}`})),Ae=Fe,Ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function De(t,e){return"vertical"===t||"horizontal"===t?t:e}const je=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g=o,{json:v={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const b=f(at);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.templateContext&&r.templateContext&&void 0!==h&&r.templateContext(h),void 0===e.origJson&&r.origJson&&void 0!==m&&r.origJson(m),void 0===e.layoutParams&&r.layoutParams&&void 0!==y&&r.layoutParams(y),n=b.getDerivedFromVars(v.delimiter_style),g(),g=l(n,(t=>p=t)),_=De(null==p?void 0:p.orientation,_),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=vt(null==p?void 0:p.color,1,w),s="horizontal"===_?"100%":dt(1),c="horizontal"===_?dt(1):"100%",u={background:w,width:s,height:c},d={orientation:_},g(),`${J(te,"Outer").$$render(t,{cls:Dt("separator",Ve,d),json:v,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>a?`<span${L("class",Ve.separator__inner,0)}${L("style",ut(u),0)}></span>`:""})}`})),Pe={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Se(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Oe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,I,T,M,N,z,R,B,U=o,W=o,q=o,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,rt=o,it=o,nt=o,{json:ot={}}=e,{templateContext:lt}=e,{origJson:ct}=e,{layoutParams:dt}=e;const pt=f(at);let gt,ft=0,ht="rgba(0,0,0,0.08)",mt=!1,yt="",bt="none",_t="50% 50%",xt="0",kt="source_in",Et="",Ct="",Ft=0,At=0,Vt=0,jt="",Pt="";g((()=>{pt.removeSvgFilter(gt,kt)})),void 0===e.json&&r.json&&void 0!==ot&&r.json(ot),void 0===e.templateContext&&r.templateContext&&void 0!==lt&&r.templateContext(lt),void 0===e.origJson&&r.origJson&&void 0!==ct&&r.origJson(ct),void 0===e.layoutParams&&r.layoutParams&&void 0!==dt&&r.layoutParams(dt),n=pt.getDerivedFromVars(ot.image_url),nt(),nt=l(n,(t=>B=t)),a=pt.getDerivedFromVars(ot.gif_url),it(),it=l(a,(t=>R=t)),s=B||R,ft=0,s?mt=!1:(mt=!0,pt.logError(st(new Error('Missing "image_url" for "image"')))),c=pt.getDerivedFromVars(ot.width),rt(),rt=l(c,(t=>z=t)),u="wrap_content"===(null==z?void 0:z.type),d=pt.getDerivedFromVars(ot.height),et(),et=l(d,(t=>N=t)),p="wrap_content"===(null==N?void 0:N.type),v=pt.getDerivedFromVars(ot.preview),tt(),tt=l(v,(t=>M=t)),yt=M?`url("${Se(M)}")`:"",h=pt.getDerivedFromVars(ot.placeholder_color),Q(),Q=l(h,(t=>T=t)),ht=vt(T,1,ht),m=pt.getDerivedFromVars(ot.scale),K(),K=l(m,(t=>I=t)),bt=wt(I)||bt,y=pt.getDerivedFromVars({content_alignment_horizontal:ot.content_alignment_horizontal,content_alignment_vertical:ot.content_alignment_vertical}),X(),X=l(y,(t=>O=t)),_t=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:$t(t)}(O,_t),b=pt.getDerivedFromVars(ot.accessibility),Y(),Y=l(b,(t=>S=t)),_=(null==S?void 0:S.description)||"",w=pt.getDerivedFromVars(ot.aspect),Z(),Z=l(w,(t=>P=t));{const t=null==P?void 0:P.ratio;xt=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}$=pt.getDerivedFromVars(ot.tint_color),G(),G=l($,(t=>j=t)),x=pt.getDerivedFromVars(ot.tint_mode),q(),q=l(x,(t=>D=t));{const t=j?vt(j):void 0,e=ue(D,kt);t===gt&&e===kt||(pt.removeSvgFilter(gt,kt),Et=t?pt.addSvgFilter(t,e):"",gt=t,kt=e)}if(k=pt.getDerivedFromVars(ot.appearance_animation),W(),W=l(k,(t=>V=t)),V&&"fade"===V.type){const t=V;Ct=Jt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Vt=Tt(t.duration,300),At=Tt(t.start_delay,0),Ft=Tt(t.alpha,0)}E=pt.getDerivedFromVars(ot.filters),U(),U=l(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Yt(A,pt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),jt=t,Pt=e}return C={aspect:"0"!==xt,"is-width-content":u,"is-height-content":p,loaded:!1,"before-appearance":Boolean(Ct)&&!0},F={"background-image":yt,"background-color":yt?void 0:ht,"background-size":bt,"clip-path":Pt||void 0,"object-fit":bt,"object-position":_t,filter:["",jt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ct||void 0,"--divkit-appearance-fade-start":Ct?Ft:void 0,"--divkit-appearance-delay":Ct?`${At}ms`:void 0,"--divkit-appearance-duration":Ct?`${Vt}ms`:void 0},U(),W(),q(),G(),Z(),Y(),X(),K(),Q(),tt(),et(),rt(),it(),nt(),mt?"":`${J(te,"Outer").$$render(t,{cls:Dt("image",Pe,C),json:ot,origJson:ct,templateContext:lt,layoutParams:dt,customDescription:!0},{},{default:()=>C.aspect?`<span${L("class",Pe["image__aspect-wrapper"],0)}${H({"padding-bottom":`${xt}%`})}><img${L("class",Pe.image__image,0)}${L("src",s,0)} loading="lazy" decoding="async"${L("style",ut(F),0)}${L("alt",_,0)}${L("aria-hidden",_?null:"true",0)}></span>`:`<img${L("class",Pe.image__image,0)}${L("src",s,0)} loading="lazy" decoding="async"${L("style",ut(F),0)}${L("alt",_,0)}${L("aria-hidden",_?null:"true",0)}>`})}`})),Ie={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function Te(t){return t>0&&t<1}function Me(t){return String(Math.ceil(1e3*t)/1e3)}function Ne(t,e,r){if(t.some(Te)){const e=Math.max(...t.filter(Te).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${dt(i*t[e]/n)},${Me(t[e])}fr)`:t[e]?o[e]=`${Me(t[e])}fr`:o[e]="auto";return o.join(" ")}const ze=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b=o,_=o,w=o,$=o,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=f(at);let A,V,D=!1,j=1,P=[],S=[],O=[],I=[],T=0,M=!1,z="top",R="left";void 0===e.json&&r.json&&void 0!==x&&r.json(x),void 0===e.templateContext&&r.templateContext&&void 0!==k&&r.templateContext(k),void 0===e.origJson&&r.origJson&&void 0!==E&&r.origJson(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),n=x.items,(null==n?void 0:n.length)&&Array.isArray(n)?D=!1:(D=!0,F.logError(st(new Error('Incorrect or empty "items" prop for div "grid"')))),a=F.getDerivedFromVars(x.column_count),$(),$=l(a,(t=>y=t)),j=re(y,j),s=(!D&&n||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];s.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=Q(t,(t=>[...t])),w(),w=l(A,(t=>m=t))}{const t={};let e=0,r=0;P=[],S=[],O=[],I=[],M=!1,V=s.map(((i,n)=>{var o,a,s,l;const c=m[n],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},g="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,v="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let i=e;i<e+u;++i)for(let e=r;e<r+d;++e)t[i+"_"+e]?M=!0:(t[i+"_"+e]=!0,(!P[i]||P[i]<g)&&(P[i]=g),(!S[e]||S[e]<v)&&(S[e]=v),(!O[i]||O[i]<f)&&(O[i]=f),(!I[e]||I[e]<h)&&(I[e]=h));do{++e,e>=j&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:p,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(M=!0),M&&F.logError(st(new Error('Mismatching "grid" rows/columns'))),T=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=l(c,(t=>h=t)),z=le(h,z),u=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=l(u,(t=>v=t)),R=se(v,R),d={valign:z,halign:R},p={"grid-template-columns":Ne(P,O,j),"grid-template-rows":Ne(S,I,T)},g=D||M,b(),_(),w(),$(),g?"":`${J(te,"Outer").$$render(t,{cls:Dt("grid",Ie,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C,parentOf:x.items,replaceItems:function(t){x=Object.assign(Object.assign({},x),{items:t})}},{},{default:()=>`${N(V,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Je=ze,Re={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function Be(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function Ue(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Le=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,T,M,z=o,R=o,B=o,U=o,W=o,H=o,q=o,G=o,Z=o,Y=o,{json:X={}}=e,{templateContext:K}=e,{origJson:tt}=e,{layoutParams:et}=e;const rt=f(at);let it,ot,lt=[],ct=!1,pt=!1,gt=null,vt=!1;const ft=rt.getCustomization("galleryLeftClass"),ht=rt.getCustomization("galleryRightClass");let mt=!1;T=l(rt.isDesktop,(t=>O=t));let yt,bt,_t,wt,$t=1,xt="horizontal",kt="start",Et=8,Ct="",Ft=[],At={},Vt=!1,jt={},Pt=0;const St=Ue((function(){if(!it)return;const t=it.scrollLeft,e=it.scrollWidth,r=it.offsetWidth;ct=t>2,pt=t+r<e-2}),50);function Ot(){let t=[],e=lt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<$t;++e){const i=lt[e].children[r];i&&t.push(i)}return t}function Mt(t,e,r="smooth"){const i="horizontal"===xt,n=i?"offsetLeft":"offsetTop",o=i?"left":"top",a=t[e];a&&it.scroll({[o]:Math.max(0,a[n]+.01-Et/2),behavior:r})}function Nt(t){const e=Ot(),r=it.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===xt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===xt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!X.id||mt||(null==et?void 0:et.fakeElement)||rt.registerInstance(X.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Mt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Ot();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Mt(r,i)},setNextItem(t){const e="horizontal"===xt?it.scrollLeft+it.offsetWidth===it.scrollWidth:it.scrollTop+it.offsetHeight===it.scrollHeight,r=Ot();if(e&&"ring"===t)return void Mt(r,0);const i=Nt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Mt(r,n)}}),g((()=>{vt=!1,X.id&&!(null==et?void 0:et.fakeElement)&&rt.unregisterInstance(X.id)})),void 0===e.json&&r.json&&void 0!==X&&r.json(X),void 0===e.templateContext&&r.templateContext&&void 0!==K&&r.templateContext(K),void 0===e.origJson&&r.origJson&&void 0!==tt&&r.origJson(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),n=X.items,(null==n?void 0:n.length)&&Array.isArray(n)?mt=!1:(mt=!0,rt.logError(st(new Error('Incorrect or empty "items" prop for div "gallery"')))),a=(!mt&&n||[]).map((t=>{let e=t,r=K;return({templateContext:r,json:e}=rt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=O&&vt&&!mt,s?"undefined"!=typeof ResizeObserver&&(gt=new ResizeObserver((()=>{St()})),gt.observe(ot)):gt&&(gt.disconnect(),gt=null),c=rt.getDerivedFromVars(X.column_count),Z(),Z=l(c,(t=>S=t)),$t=re(S,$t),u=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(a,$t),d=rt.getDerivedFromVars(X.orientation),G(),G=l(d,(t=>P=t)),xt=De(P,xt),p=rt.getDerivedFromVars(X.cross_content_alignment),q(),q=l(p,(t=>j=t)),kt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(j,kt),v=rt.getDerivedFromVars(X.item_spacing),H(),H=l(v,(t=>D=t)),Et=Tt(D,Et),yt=dt(Et),h=rt.getDerivedFromVars(X.cross_spacing),W(),W=l(h,(t=>V=t)),_t=Tt(V,Et),bt=dt(_t),m=rt.getDerivedFromVars(X.paddings),U(),U=l(m,(t=>A=t)),Ct=It(A,Ct),y="horizontal"===xt?"grid-template-columns":"grid-template-rows";{let t=[];a.forEach((e=>{const r="horizontal"===xt?"width":"height";t.push(rt.getDerivedFromVars(e.json[r]))})),wt=Q(t,(t=>t)),B(),B=l(wt,(t=>F=t))}Ft=[],$t>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===xt||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),b=rt.getDerivedFromVars(X.scroll_mode),R(),R=l(b,(t=>C=t));{const t={};let e={};Vt=!1,(null==et?void 0:et.fakeElement)&&(e.fakeElement=!0),"horizontal"===xt?e.parentVAlign=kt:e.parentHAlign=kt,"paging"===C&&(Vt=!0,e.scrollSnap="start",t["horizontal"===xt?"scroll-padding-left":"scroll-padding-top"]=dt(Et/2)),1===$t&&(e.parentLayoutOrientation=xt),At=zt(t,At),jt=zt(e,jt)}return _=rt.getDerivedFromVars(X.restrict_parent_scroll),Y(),Y=l(_,(t=>M=t)),w={padding:Ct,"grid-gap":bt},$={"grid-gap":yt,[y]:Be(Ft)},x={orientation:xt,"scroll-snap":Vt},k=rt.getDerivedFromVars(X.default_item),z(),z=l(k,(t=>E=t)),Pt=Tt(E,Pt),z(),R(),B(),U(),W(),H(),q(),G(),Z(),T(),Y()," "+(mt?"":`${J(te,"Outer").$$render(t,{cls:Dt("gallery",Re,x),json:X,origJson:tt,templateContext:K,layoutParams:et,customPaddings:!0,customActions:"gallery",parentOf:n,replaceItems:function(t){X=Object.assign(Object.assign({},X),{items:t})}},{},{default:()=>`<div class="${I(Re.gallery__scroller,!0)+" "+I(M?nt:"",!0)}"${L("style",ut(At),0)}${L("this",it,0)}><div${L("class",Re["gallery__items-grid"],0)}${L("style",ut(w),0)}${L("this",ot,0)}>${N(u,((e,r)=>`<div${L("class",Re.gallery__items,0)}${L("style",ut($),0)}${L("this",lt[r],0)}>${N(e,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} </div>`))}</div></div> ${"horizontal"===xt?`${ct&&s?` <div${L("class",ft||`${Re.gallery__arrow} ${Re.gallery__arrow_left}`,0)}>${ft?"":`<svg${L("class",Re["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Re["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${pt&&s?` <div${L("class",ht||`${Re.gallery__arrow} ${Re.gallery__arrow_right}`,0)}>${ht?"":`<svg${L("class",Re["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Re["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),We=Le,He={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},qe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S=o,O=o,T=o,M=o,z=o,R=o,B=o,U=o,W=o;var q,G;let{json:Z={}}=e,{templateContext:Y}=e,{origJson:X}=e,{layoutParams:Q}=e;const tt=f(at),et=tt.genId("tabs");let rt=!1,it=K([]);x=l(it,(t=>w=t));let ot,lt,ct,gt={};const ft=tt.getJsonWithVars(Z.selected_tab);let ht,mt,yt=ft&&Number(ft)||0,bt=12,_t="",wt="",$t="",xt="",kt="",Et="",Ct="",Ft="",At="",Vt="",jt=0,St="",Mt="",Nt=null,Jt=!1,Rt=!1,Bt=yt,Wt=[],Ht=[];async function Gt(t,e=!1){if(Bt=yt,yt=t,Jt||(Jt=!0,lt.style.height=dt(lt.clientHeight),ct.style.transform=`translate3d(${100*-Bt}%,0,0)`),Rt=!0,async function(t){await $(),ct.style.transform=`translate3d(${t}%,0,0)`}(100*-yt),function(t=!1){const e=t?Math.max(0,yt-1):Math.min(yt,Bt),r=t?Math.min(n.length-1,yt+1):Math.max(yt,Bt);Wt=Wt.map(((t,i)=>t||i>=e&&i<=r)),Ht=Ht.map(((t,i)=>i>=e&&i<=r))}(),async function(){await $();const t=document.getElementById(`${et}-panel-${yt}`);t&&(lt.style.height=dt(t.offsetHeight))}(),Xt&&clearTimeout(Xt),Xt=window.setTimeout((()=>{Ht=n.map(((t,e)=>e===yt))}),400),Yt=-yt*lt.clientWidth,e){await $();const t=ot.querySelector(`.${He.tabs__item_selected}`);t&&t.focus()}}let Yt,Xt=null;if(!Z.id||rt||(null==Q?void 0:Q.fakeElement)||tt.registerInstance(Z.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');Gt(t)},setPreviousItem(t){let e=yt-1;e<0&&(e="ring"===t?n.length-1:yt),Gt(e)},setNextItem(t){let e=yt+1;e>n.length-1&&(e="ring"===t?0:yt),Gt(e)}}),g((()=>{Z.id&&!(null==Q?void 0:Q.fakeElement)&&tt.unregisterInstance(Z.id)})),void 0===e.json&&r.json&&void 0!==Z&&r.json(Z),void 0===e.templateContext&&r.templateContext&&void 0!==Y&&r.templateContext(Y),void 0===e.origJson&&r.origJson&&void 0!==X&&r.origJson(X),void 0===e.layoutParams&&r.layoutParams&&void 0!==Q&&r.layoutParams(Q),n=Z.items||[],Array.isArray(n)&&n.length){let t=[];n.forEach(((e,r)=>{const i=tt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):tt.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),it.set(t)}else it.set([]);(null==w?void 0:w.length)?rt=!1:(rt=!0,tt.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"')))),a=tt.getDerivedFromVars(Z.width),U(),U=l(a,(t=>j=t)),s=tt.getDerivedFromVars(Z.height),B(),B=l(s,(t=>D=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==j?void 0:j.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),gt=zt(t,gt)}if(!rt&&(yt<0||yt>=n.length)&&(tt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab,length:n.length}})),yt=yt<0?0:n.length-1),rt||w.some((t=>yt===t.index))||(tt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab}})),yt=(null===(q=w[0])||void 0===q?void 0:q.index)||0),c=tt.getDerivedFromVars(Z.tab_title_style),R(),R=l(c,(t=>V=t)),u=V||{},bt=re(u.font_size,bt),u.font_size||u.paddings){const t=u.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};_t=It(e,_t)}{const t=u.line_height;void 0!==t&&Zt(t)&&(wt=dt(t/bt*10))}{const t=u.letter_spacing;void 0!==t&&Ot(t)&&($t=dt(t/bt*10))}if(u.corner_radius||u.corners_radius||u.font_size){const t=null!==(G=u.corner_radius)&&void 0!==G?G:1e3;u.corners_radius?xt=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!Ot(n[t]))return i;return Lt(t,e,r)}(u.corners_radius,t,bt,xt):Ot(t)&&(xt=dt(t/bt*10))}return ht=ne(u.active_font_weight||u.font_weight,ht),kt=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:ht||400}):"",mt=ne(u.inactive_font_weight||u.font_weight,mt),Et=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:mt||400}):"",Ct=vt(u.active_text_color,1,Ct),Ft=vt(u.inactive_text_color,1,Ft),At=vt(u.active_background_color,1,At),Vt=vt(u.inactive_background_color,1,Vt),jt=Tt(u.item_spacing,jt),d=tt.getDerivedFromVars(Z.has_separator),z(),z=l(d,(t=>A=t)),p=tt.getDerivedFromVars(Z.separator_color),M(),M=l(p,(t=>F=t)),v=tt.getDerivedFromVars(Z.separator_paddings),T(),T=l(v,(t=>C=t)),A&&(F&&(St=vt(F,1,St)),C&&(Mt=It(C,Mt))),h={background:St,margin:Mt},m=tt.getDerivedFromVars(Z.switch_tabs_by_content_swipe_enabled),O(),O=l(m,(t=>E=t)),y=void 0===E||Boolean(E),b=tt.getDerivedFromVars(Z.restrict_parent_scroll),W(),W=l(b,(t=>P=t)),_=tt.getDerivedFromVars(Z.title_paddings),S(),S=l(_,(t=>k=t)),Nt=Ut(k||void 0,Nt),rt||(Wt=n.map(((t,e)=>e===yt)),Ht=n.map(((t,e)=>e===yt))),x(),S(),O(),T(),M(),z(),R(),B(),U(),W(),rt?"":`${J(te,"Outer").$$render(t,{cls:Dt("tabs",He,{}),json:Z,origJson:X,templateContext:Y,layoutParams:Q,customActions:"tabs"},{},{default:()=>` <div class="${I(He.tabs__list,!0)+" "+I(P?nt:"",!0)}" role="tablist"${H({"--divkit-tabs-title-padding":Nt?Pt(Nt):"","--divkit-tabs-font-size":dt(bt),"--divkit-tabs-paddings":_t,"--divkit-tabs-line-height":wt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ht||"","--divkit-tabs-inactive-font-weight":mt||"","--divkit-tabs-active-font-family":kt||"","--divkit-tabs-inactive-font-family":Et||"","--divkit-tabs-active-text-color":Ct,"--divkit-tabs-inactive-text-color":Ft,"--divkit-tabs-active-background-color":At,"--divkit-tabs-inactive-background-color":Vt,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":jt?pt(jt):""})}${L("this",ot,0)}>${N(w,(e=>{let r=e.index,i=r===yt;return` ${J(qt,"Actionable").$$render(t,{cls:Dt("tabs__item",He,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=Q&&Q.fakeElement?[]:[e.title_click_action],attrs:{id:`${et}-tab-${r}`,"aria-controls":`${et}-panel-${r}`,role:"tab",tabindex:!i||null!=Q&&Q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=Q&&Q.fakeElement?null:t=>function(t,e){return yt===e||(Gt(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${A?`<div${L("class",He.tabs__separator,0)}${L("style",ut(h),0)}></div>`:""} <div class="${I(He.tabs__panels,!0)+" "+I(P?nt:"",!0)}"${L("this",lt,0)}><div${L("class",Dt("tabs__swiper",He,{inited:Jt,animated:Rt}),0)}${L("this",ct,0)}>${N(w,(e=>{let r=e.index;return` <div${L("class",Dt("tabs__panel",He,{visible:Ht[r]}),0)} role="tabpanel" id="${I(et,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(et,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${Wt[r]?`${J(Wr,"Unknown").$$render(t,{div:n[r].div,templateContext:Y,layoutParams:gt},{},{})}`:""} </div>`}))}</div></div>`})}`})),Ge=qe,Ze="divkit-eb860",Ye="divkit-e08c6";function Xe(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}function Ke(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function Qe(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...Qe(t))})):e.push(t),e}Xe([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),Xe([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const tr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},er=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w=o,$=o,x=o,k=o,E=o,C=o;var F,A,V,D;let{ownerNode:j}=e,{data:P}=e,{internalId:S}=e,{templateContext:O}=e;const T=f(at);Date.now();return g((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==j&&r.ownerNode(j),void 0===e.data&&r.data&&void 0!==P&&r.data(P),void 0===e.internalId&&r.internalId&&void 0!==S&&r.internalId(S),void 0===e.templateContext&&r.templateContext&&void 0!==O&&r.templateContext(O),n=T.isDesktop,k(),k=l(n,(t=>y=t)),a=T.getDerivedFromVars(P.position),x(),x=l(a,(t=>m=t)),s=T.getDerivedFromVars(null===(A=null===(F=P.offset)||void 0===F?void 0:F.x)||void 0===A?void 0:A.value),$(),$=l(s,(t=>h=t)),c=T.getDerivedFromVars(null===(D=null===(V=P.offset)||void 0===V?void 0:V.y)||void 0===D?void 0:D.value),w(),w=l(c,(t=>v=t)),u=T.getDerivedFromVars(P.animation_in),E(),E=l(u,(t=>b=t)),d=T.getDerivedFromVars(P.animation_out),C(),C=l(d,(t=>_=t)),p={visible:!1},w(),$(),x(),k(),E(),C(),` <div class="${I(Dt("tooltip",tr,p),!0)+" "+I(y?it:"",!0)}"${H({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${J(Wr,"Unknown").$$render(t,{div:P.div,templateContext:O},{},{})}</div>`}));function rr(t){return"change_bounds"===t.type?t:"set"===t.type?rr(t.items[0]):null}const ir=U(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=f(at),u=f(jt);let d,p=new Map,h=new Set,m=!1,y=null,b=[],_=[],w=[],x=[];function k(t,e,r){let{json:i,templateContext:n,transitions:o,node:a}=e;i=c.getJsonWithVars(i),o=c.getJsonWithVars(o);const s=Qe(o),l=a.getBoundingClientRect();return{json:Object.assign(Object.assign({},i),{margins:void 0,alpha:(u=s,u.some((t=>"fade"===t.type))?void 0:i.alpha)}),templateContext:n,elementBbox:l,rootBbox:t,transitions:s,alpha:i.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node};var u}const E=o.div_id||o.id;async function C(t){if(F===t)return;c.setRunning("stateChange",!0);const e=new Set(h);b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[];let r=[];if(d){const t=d.getBoundingClientRect();r=w.map((e=>k(t,e,"out")))}x.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],x=[];const i=n.find((e=>e.state_id===t))||null;if(i?(F=t,null==j||j.setValue(F),A=i):c.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!d)return;const o=d.getBoundingClientRect();let a=_.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>k(o,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||h.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const s=r.concat(a),l=s.reduce(((t,e)=>Math.max(t,Ke(e.transitions))),0),u=x.filter((t=>p.has(t.id))).map((t=>({json:Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}}),templateContext:t.templateContext,rootBbox:o,beforeBbox:p.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:rr(t.transitions),resolvePromise:t.resolvePromise})));b=[...s.map((t=>Object.assign(Object.assign({},t),{maxDuration:l}))),...u],p.clear(),c.setRunning("stateChange",!1)}let F;E?(null==l?void 0:l.fakeElement)||(u.registerInstance(E,{setState:C,getChild(t){if(y&&y.has(t))return y.get(t);c.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}),v(jt,{registerInstance(t,e){y||(y=new Map),y.has(t)?c.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):y.set(t,e)},unregisterInstance(t){null==y||y.delete(t)},runVisibilityTransition(t,e,r,i,n){if(!d)return Promise.resolve();const o=k(d.getBoundingClientRect(),{json:t,templateContext:e,transitions:r,node:i},n),a=Ke(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return b=[...b.filter((t=>t.node!==o.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return _.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return w.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return x.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(m=!0,c.logError(st(new Error('Missing "id" prop for div "state"'))));let A=null;const V=c.getJsonWithVars(o.default_state_id),D=o.state_id_variable,j=D?c.getVariable(D,"string"):null;let P=!1;return g((()=>{E&&!(null==l?void 0:l.fakeElement)&&u.unregisterInstance(E)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),n=o.states||[],(null==n?void 0:n.length)?m=!1:(m=!0,c.logError(st(new Error('Empty "states" prop for div "state"')))),function(t){if(!P&&(P=!0,t.length)){const e=(null==j?void 0:j.getValue())||V;e?(F=e,A=t.find((t=>t.state_id===F))||null,A||c.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:F}}))):(A=t[0],F=A.state_id),j&&(j.setValue(F),j.subscribe((t=>{C(t)})))}}(n),m?"":`${J(te,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=A)&&void 0!==e&&e.div?`${J(Wr,"Unknown").$$render(t,{div:A.div,templateContext:a},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",d,0)}>${N(b,(e=>"direction"in e?`<div${L("class",Ze,0)}${H({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",Ye,0)}>${J(Wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`:`<div${L("class",Ze,0)}><div${L("class",Ye,0)}>${J(Wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`))}</div>`}})} ${null!=l&&l.tooltips?`${N(null==l?void 0:l.tooltips,(e=>`${J(er,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,templateContext:a},{},{})}`))}`:""}`})),nr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},or=U(((t,e,r,i)=>{let n,a,s,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C=o,F=o,A=o,V=o,D=o,j=o;var P,S,O,T,M,z,R;let{json:B={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:H}=e;const q=f(at),G=q.genId("pager");let Z,Y=!1,X=!1,K=0,Q=0,tt=!1,et="horizontal",rt="",it="",ot="";function lt(t,e="smooth"){const r="horizontal"===et,i=Z.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:i[n],behavior:e}),K=t}Ue((function(){if(!Y)return;const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===et?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:K}();t!==K&&(K=t)}),50),B.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(B.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');lt(t)},setPreviousItem(t){let e=K-1;e<0&&(e="ring"===t?n.length-1:K),lt(e)},setNextItem(t){let e=K+1;e>n.length-1&&(e="ring"===t?0:K),lt(e)}}),g((()=>{Y=!1,B.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(B.id)})),void 0===e.json&&r.json&&void 0!==B&&r.json(B),void 0===e.templateContext&&r.templateContext&&void 0!==U&&r.templateContext(U),void 0===e.origJson&&r.origJson&&void 0!==W&&r.origJson(W),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),(null===(P=B.items)||void 0===P?void 0:P.length)&&Array.isArray(B.items)?X=!1:(X=!0,q.logError(st(new Error('Incorrect or empty "items" prop for div "pager"')))),n=(!X&&B.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a=q.getDerivedFromVars(B.layout_mode),F(),F=l(a,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(tt=!0,q.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):tt=!1:(tt=!0,q.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),s=q.getDerivedFromVars(B.orientation),D(),D=l(s,(t=>k=t)),et=De(k,et),u=q.getDerivedFromVars(B.item_spacing),V(),V=l(u,(t=>x=t));{const t=null==x?void 0:x.value;t&&Ot(t)&&(rt=dt(t||0))}if(d=q.getDerivedFromVars(B.paddings),A(),A=l(d,(t=>$=t)),it=It($,it),p=q.getDerivedFromVars(B.restrict_parent_scroll),j(),j=l(p,(t=>E=t)),v="horizontal"===et?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=pt("horizontal"===et?((null===(S=B.paddings)||void 0===S?void 0:S.left)||0)+((null===(O=B.paddings)||void 0===O?void 0:O.right)||0):((null===(T=B.paddings)||void 0===T?void 0:T.top)||0)+((null===(M=B.paddings)||void 0===M?void 0:M.bottom)||0)),e=null===(z=w.neighbour_page_width)||void 0===z?void 0:z.value;ot=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${rt})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(R=w.page_width)||void 0===R?void 0:R.value;ot=`${Number(t)}%`}return h={"grid-gap":rt,padding:it,[v]:ot},m={orientation:et},y=X||tt,b=q.getStore("pagers"),C(),C=l(b,(t=>_=t)),function(t,e){const r=B.id;if(r){const i=new Map(_);c(b,_=i.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:lt}),_)}}(n.length,K),function(t){var e;if(t===Q)return;Q=t;const r=q.getJsonWithVars(null===(e=n[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(K),C(),F(),A(),V(),D(),j(),y?"":`${J(te,"Outer").$$render(t,{cls:Dt("pager",nr,m),json:B,origJson:W,templateContext:U,layoutParams:H,customPaddings:!0,parentOf:B.items,replaceItems:function(t){B=Object.assign(Object.assign({},B),{items:t})}},{},{default:()=>`<div class="${I(nr.pager__items,!0)+" "+I(E?nt:"",!0)}"${L("style",ut(h),0)}${L("this",Z,0)}>${N(n,(e=>`<div${L("class",nr.pager__item,0)}>${J(Wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})} </div>`))}</div>`})}`})),ar=or,sr={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},lr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,x,k,E,C,F=o,A=o,V=o,D=o,j=o,P=o,S=o,O=o,T=o;var M,z;let{json:R={}}=e,{templateContext:B}=e,{origJson:U}=e,{layoutParams:W}=e;const q=["rounded_rectangle","circle"],G=f(at);let Z,Y,X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,it=10,nt=5;if(void 0===e.json&&r.json&&void 0!==R&&r.json(R),void 0===e.templateContext&&r.templateContext&&void 0!==B&&r.templateContext(B),void 0===e.origJson&&r.origJson&&void 0!==U&&r.origJson(U),void 0===e.layoutParams&&r.layoutParams&&void 0!==W&&r.layoutParams(W),n=G.getDerivedFromVars(R.shape),P(),P=l(n,(t=>x=t)),a=G.getDerivedFromVars(R.active_item_color),D(),D=l(a,(t=>_=t)),s=G.getDerivedFromVars(R.inactive_item_color),j(),j=l(s,(t=>w=t)),c=G.getDerivedFromVars(R.active_item_size),S(),S=l(c,(t=>k=t)),u=G.getDerivedFromVars(R.active_shape),T(),T=l(u,(t=>C=t)),d=G.getDerivedFromVars(R.inactive_shape),O(),O=l(d,(t=>E=t)),C&&(K=be({type:"shape_drawable",shape:C},q,K)),E&&(Q=be({type:"shape_drawable",shape:E},q,Q)),!C&&!E&&x){const t=re(k,1.3);Q=be({type:"shape_drawable",shape:x,color:Q.background},q,Q),Q.background=vt(w,1,Q.background),K=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:K.background}),K.background=vt(_,1,K.background)}if(p=G.getDerivedFromVars(R.space_between_centers),A(),A=l(p,(t=>y=t)),g=G.getDerivedFromVars(R.items_placement),V(),V=l(g,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)et="default",y&&(rt=Tt(y.value,rt));else if(et=b.type,"default"===et)rt=Tt(null===(M=b.space_between_centers)||void 0===M?void 0:M.value,rt);else if("stretch"===et){const t=b;it=re(t.max_visible_items,it),nt=Tt(null===(z=t.item_spacing)||void 0===z?void 0:z.value,nt)}return v=G.getStore("pagers"),F(),F=l(v,(t=>m=t)),async function(t){if(R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await $(),Y)){const t=Y.children[X.currentItem].offsetLeft;Z.scroll({left:t-Z.clientWidth/2,behavior:"smooth"})}}(m),h={placement:et},F(),A(),V(),D(),j(),P(),S(),O(),T(),`${J(te,"Outer").$$render(t,{cls:Dt("indicator",sr,h),json:R,origJson:U,templateContext:B,layoutParams:W},{},{default:()=>`<div${L("class",sr.indicator__scroller,0)}${L("this",Z,0)}><div${L("class",sr.indicator__items,0)} role="tablist"${H({margin:"default"===et?`0 ${dt(Math.max(0,K.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Q.width),"--divkit-indicator-inactive-height":dt(Q.height),"--divkit-indicator-inactive-border-radius":dt(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":dt(K.width),"--divkit-indicator-active-height":dt(K.height),"--divkit-indicator-active-border-radius":dt(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/Q.width,"--divkit-indicator-default-margin":"default"===et?`0 ${dt((rt-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?dt(nt):"","--divkit-indicator-stretch-max-count":"stretch"===et?it:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?dt((it-1)*nt):""})}${L("this",Y,0)}>${X?`${N(Array(X.size),((t,e)=>{let r=e===X.currentItem;return` <div class="${I(Dt("indicator__item",sr,{active:r}),!0)+" "+I(tt,!0)}" role="tab" id="${I(X.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(X.instId,!0)+"-panel-"+I(e,!0)}"${L("aria-selected",r?"true":"false",0)}${L("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),cr=lr,ur={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function dr(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&vt(t.text_color)||"#000",n=ie(t.font_weight);if(Zt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:dt(t.font_size),fontWeight:n,textColor:i};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function pr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const gr="function"==typeof BigInt;function vr(t){return gr?BigInt(t):Number(t)}const fr=vr("9223372036854775807"),hr=vr("-9223372036854775808");function mr(t){const e=vr(t);if(e>fr||e<hr)throw new Error("Integer overflow.");return e}const yr=mr(0);function br(t){let e=t;return e<0&&(e=-e),e}function _r(t){let e=0;return t>0?e=1:t<0&&(e=-1),mr(e)}class wr{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=K(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const $r={string:class extends wr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends wr{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends wr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>fr||t<hr)throw new Error("Incorrect variable value");return mr(t)}fromString(t){const e=mr(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends wr{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends wr{convertValue(t){if("string"!=typeof t||!ft(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends wr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends wr{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}},array:class extends wr{convertValue(t){if(!Array.isArray(t))throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Array variable does not support setter from string")}getType(){return"array"}}};function xr(t,e,r){if(!(e in $r))throw new Error("Unsupported variable type");return new $r[e](t,r)}function kr(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const Er=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,T,M,z,R,B,U,W,q,G,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,rt=o,it=o,nt=o,ot=o,lt=o;var ct,ut,gt,vt;let{json:ft={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},_t=["rounded_rectangle","circle"],wt=["rounded_rectangle"],$t=f(at),xt=f(Ht);let kt,Et=0,Ct=100;const Ft=ft.thumb_value_variable,At=ft.thumb_secondary_value_variable;W=l(Ft&&$t.getVariable(Ft,"integer")||xr("temp","integer",0),(t=>U=t)),B=l(At&&$t.getVariable(At,"integer")||xr("temp","integer",0),(t=>R=t));let Vt,jt,Pt,St=pr(U||0,Et,Ct),It=pr(R||0,Et,Ct),Tt=bt,Mt=Tt,Nt=bt,zt=bt,Jt=null,Bt=null,Ut=Pt,Lt="",Wt="",qt=!1,Gt=!1;function Zt(){if(!kt)return;const t=Ct-Et,e=(null==Jt?void 0:Jt.width)||0,r=(null==Bt?void 0:Bt.width)||0;Math.max(e,r)*t>=(null==kt?void 0:kt.clientWidth)?Gt||($t.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}Ue(Zt,50),g((()=>{ft.id&&$t.unregisterFocusable(ft.id)})),void 0===e.json&&r.json&&void 0!==ft&&r.json(ft),void 0===e.templateContext&&r.templateContext&&void 0!==ht&&r.templateContext(ht),void 0===e.origJson&&r.origJson&&void 0!==mt&&r.origJson(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==yt&&r.layoutParams(yt),n=$t.getDerivedFromVars(ft.min_value),lt(),lt=l(n,(t=>G=t)),a=$t.getDerivedFromVars(ft.max_value),ot(),ot=l(a,(t=>q=t)),Et=Rt(G,Et),Ct=Rt(q,Ct),Zt();{const t=pr(U||0,Et,Ct);t!==St&&(St=t)}{const t=pr(R||0,Et,Ct);t!==It&&(It=t)}s=$t.getDerivedFromVars(ft.thumb_style),nt(),nt=l(s,(t=>z=t)),Tt=be(z,_t,Tt),c=$t.getDerivedFromVars(ft.thumb_secondary_style),it(),it=l(c,(t=>M=t)),Mt=be(M,_t,Tt),u=$t.getDerivedFromVars(ft.track_inactive_style),rt(),rt=l(u,(t=>T=t)),Nt=be(T,wt,Nt),d=$t.getDerivedFromVars(ft.track_active_style),et(),et=l(d,(t=>O=t)),zt=be(O,wt,zt),p=$t.getDerivedFromVars(ft.tick_mark_active_style),tt(),tt=l(p,(t=>S=t));{let t=be(S,_t,bt);t!==bt&&(Jt=t)}Jt?(Vt=At?kr(Math.min(St,It),Math.max(St,It)+1,Et,Ct,!0):kr(Et,St,Et,Ct,!0),Zt()):Vt=[],v=$t.getDerivedFromVars(ft.tick_mark_inactive_style),Q(),Q=l(v,(t=>P=t));{let t=be(P,_t,bt);t!==bt&&(Bt=t)}Bt?(jt=At?kr(Math.min(St,It),Math.max(St,It)+1,Et,Ct,!1):kr(St+1,Ct+1,Et,Ct,!0),Zt()):jt=[],h=$t.getDerivedFromVars(ft.thumb_text_style),K(),K=l(h,(t=>j=t)),Pt=dr(j,Pt),m=$t.getDerivedFromVars(ft.thumb_secondary_text_style),X(),X=l(m,(t=>D=t)),Ut=dr(D,Pt),y=$t.getDerivedFromVars(ft.accessibility),Y(),Y=l(y,(t=>V=t)),(null==V?void 0:V.description)?Lt=V.description:$t.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),b=$t.getDerivedFromVars(ft.secondary_value_accessibility),Z(),Z=l(b,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:At&&$t.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;xt.hasAction()?($t.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Tt===bt?($t.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):zt===bt?($t.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===bt&&($t.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=dt(Math.max(...[Tt.width,Mt.width,0].filter(Ot))),w=dt(Math.max(...[Tt.height,Mt.height,0].filter(Ot))),$=(St-Et)/(Ct-Et),x=At?(It-Et)/(Ct-Et):void 0,k=void 0!==x?Math.abs(x-$):$,E=void 0!==x?Math.min(x,$):0,C={"--divkit-slider-thumb-width":dt(Tt.width),"--divkit-slider-thumb-height":dt(Tt.height),"--divkit-slider-thumb-secondary-width":dt(Mt.width),"--divkit-slider-thumb-secondary-height":dt(Mt.height),"--divkit-slider-text-offset-x":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.x)?pt(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ut=null==Pt?void 0:Pt.offset)||void 0===ut?void 0:ut.y)?pt(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(gt=null==Ut?void 0:Ut.offset)||void 0===gt?void 0:gt.x)?pt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.y)?pt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Jt?dt(Jt.width):void 0,"--divkit-slider-tick-active-height":Jt?dt(Jt.height):void 0,"--divkit-slider-tick-active-border-radius":Jt?dt(Jt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Jt?void 0:Jt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Jt?void 0:Jt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?dt(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?dt(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?dt(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":_,"--divkit-slider-max-thumb-height":w,"--divkit-slider-track-part":$,"--divkit-slider-track-secondary-part":x},F={},Z(),Y(),X(),K(),Q(),tt(),et(),rt(),it(),nt(),B(),W(),ot(),lt()," "+(qt?"":`${J(te,"Outer").$$render(t,{cls:Dt("slider",ur,F),style:C,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,json:ft,origJson:mt,templateContext:ht,layoutParams:yt},{},{default:({focusHandler:t,blurHandler:e})=>{var r,i,n,o,a,s;return`<div${L("class",ur["slider__tracks-wrapper"],0)}><div${L("class",ur["slider__tracks-inner"],0)}${L("this",kt,0)}><div${L("class",ur.slider__track,0)}${H({height:dt(Nt.height),"border-radius":dt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div> <div${L("class",ur["slider__active-track"],0)}${H({left:(100*E).toFixed(2)+"%",width:(100*k).toFixed(2)+"%",height:dt(zt.height),"border-radius":dt(zt.borderRadius),background:zt.background,"box-shadow":zt.boxShadow||""})}></div> ${N(Vt,(t=>`<div class="${I(ur.slider__tick,!0)+" "+I(ur.slider__tick_active,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} ${N(jt,(t=>`<div class="${I(ur.slider__tick,!0)+" "+I(ur.slider__tick_inactive,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} <div${L("class",ur.slider__thumb,0)}${H({"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}>${Pt?`<div${L("class",ur["slider__thumb-text"],0)}><div${L("class",ur["slider__thumb-text-inner"],0)}${H({"font-size":(null===(r=Pt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(i=Pt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(n=Pt)||void 0===n?void 0:n.textColor)||"#000"})}>${I(St)}</div></div>`:""}</div> ${At?`<div class="${I(ur.slider__thumb,!0)+" "+I(ur.slider__thumb_secondary,!0)}"${H({"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Ut?`<div class="${I(ur["slider__thumb-text"],!0)+" "+I(ur["slider__thumb-text_secondary"],!0)}"><div${L("class",ur["slider__thumb-text-inner"],0)}${H({"font-size":(null===(o=Ut)||void 0===o?void 0:o.fontSize)||"1em","font-weight":(null===(a=Ut)||void 0===a?void 0:a.fontWeight)||"",color:(null===(s=Ut)||void 0===s?void 0:s.textColor)||"#000"})}>${I(It)}</div></div>`:""}</div>`:""} <input type="range"${L("class",ur.slider__input,0)}${L("min",Et,0)}${L("max",Ct,0)} step="1"${L("value",St,0)}${L("aria-label",Lt,0)}${L("this",undefined,0)}> ${At?`<input type="range"${L("class",`${ur.slider__input} ${ur.slider__input_secondary}`,0)}${L("min",Et,0)}${L("max",Ct,0)} step="1"${L("value",It,0)}${L("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Cr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_right":"divkit-e8038",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_top":"divkit-bdccd","input_alignment-vertical_bottom":"divkit-fc670","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function Fr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Fr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,i=e.length-1;const n=e.length-t.length;for(;r<i&&r<t.length&&t[r]===e[r];)++r;for(;i-n>=r&&t[i-n]===e[i];)--i;return++i,{start:r,added:i-r,removed:i-r-n}}function Ar(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Vr{constructor(t){this.char=t}}class Dr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class jr{constructor(t){Ar(this,"filters",new Map),Ar(this,"destructedValue",[]),Ar(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof Vr)t+=r.char;else if(r instanceof Dr)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof Dr&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(st(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new Dr(null,this.filters.get(e.key),e.placeholder):new Vr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=Fr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const i=this.buildBodySubstring(r,t),n=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=n?this.calculateMaxShift(n,o):void 0;this.replaceChars(i,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(n,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,i=e;for(;i<this.destructedValue.length;)this.destructedValue[i]instanceof Dr&&++r,++i;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let i=0;for(;i<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+i);)++i;return Math.max(0,i-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof Dr&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof Dr&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let i;i=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=i}calculateInsertableSubstring(t,e){let r="",i=e;const n=()=>{for(var t;i<this.destructedValue.length&&!(this.destructedValue[i]instanceof Dr);)++i;return null===(t=this.destructedValue[i])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=n();null!=e&&e.test(t)&&(r+=t,++i)})),r}collectValueRange(t,e){let r="",i=t;for(;i<=e;){const t=this.destructedValue[i];t instanceof Dr&&null!==t.char&&(r+=t.char),++i}return r}replaceChars(t,e,r){let i=this.calculateInsertableSubstring(t,e);void 0!==r&&(i=i.substring(0,r));let n=e,o=0;for(;n<this.destructedValue.length&&o<i.length;){const t=this.destructedValue[n],e=i[o];t instanceof Dr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof Dr);)++e;return e}}class Pr extends jr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Sr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Or extends jr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Sr(this,"currencyFormatter",new Intl.NumberFormat),Sr(this,"decimalSeparator","."),Sr(this,"localeDigits",{}),Sr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(st(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),i=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:i,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Fr(this.value,t),i=this.value.lastIndexOf(this.decimalSeparator),n=t.lastIndexOf(this.decimalSeparator),o=i!==n||-1===i&&-1===n,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,i=0;for(;i<t.length;){if(t[i]===this.decimalSeparator&&!this.inDiff(e,i)){r=i;break}i++}let n=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(n=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(i=r;i<t.length;)this.isDigit(t[i])&&!this.inDiff(e,i)&&a--,i++;else{let r=!1;for(let i=0;i<t.length;i++){const n=t[i];n===this.decimalSeparator?r=!0:!this.inDiff(e,i)&&r&&this.isDigit(n)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==n,l=[];i=t.length-1;let c=!1;for(;i>=0;){const u=t[i],d=l.length<=o;this.isDigit(u)?this.inDiff(e,i)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&i===n?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==i&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=i),i--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function Ir(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function Tr(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),i=t.parentNode,n=Array.from(i.childNodes).indexOf(t)+1;r.setStart(i,n),r.setEnd(i,n),e.addRange(r)}}catch(t){}else for(let r=0,i=t.childNodes.length;r<i;++r){const i=t.childNodes[r],n=Ir(i);if(e<=n)return void Tr(i,e);e-=n}else try{const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStart(t,e),i.setEnd(t,e),r.addRange(i)}}catch(t){}}const Mr=U(((t,e,r,i)=>{let n,a,s,u,d,p,v,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S,O,T,M,N,z,R,B,U,W,H,q,G,Z,Y,X,K,Q,tt,et,rt,it=o,nt=o;var ot;let{json:lt={}}=e,{templateContext:ct}=e,{origJson:gt}=e,{layoutParams:ft}=e;const ht=f(at);let mt,yt=null;const bt=lt.text_variable,_t=null===(ot=lt.mask)||void 0===ot?void 0:ot.raw_text_variable;let wt=!1;bt||(wt=!0,ht.logError(st(new Error('Missing "text_variable" in "input"'))));let $t=bt&&ht.getVariable(bt,"string")||xr("temp","string","");y=l($t,(t=>m=t));let xt=_t&&ht.getVariable(_t,"string")||xr("temp","string","");_=l(xt,(t=>b=t));let kt="",Et="";F=l(ht.getDerivedFromVars(lt.mask),(t=>C=t)),tt=l(ht.getDerivedFromVars(lt.hint_text),(t=>Q=t)),K=l(ht.getDerivedFromVars(lt.hint_color),(t=>X=t));let Ct="";Y=l(ht.getDerivedFromVars(lt.font_size),(t=>Z=t));let Ft,At=12;G=l(ht.getDerivedFromVars(lt.font_weight),(t=>q=t)),H=l(ht.getDerivedFromVars(lt.font_family),(t=>W=t));let Vt,jt="";U=l(ht.getDerivedFromVars(lt.line_height),(t=>B=t)),R=l(ht.getDerivedFromVars(lt.letter_spacing),(t=>z=t));let Ot="";N=l(ht.getDerivedFromVars(lt.text_color),(t=>M=t));let It="#000";T=l(ht.getDerivedFromVars(lt.highlight_color),(t=>O=t));let Mt="";S=l(ht.getDerivedFromVars(lt.text_alignment_horizontal),(t=>P=t));let Nt="left";j=l(ht.getDerivedFromVars(lt.text_alignment_vertical),(t=>D=t));let zt="center";V=l(ht.getDerivedFromVars(lt.keyboard_type),(t=>A=t));const Jt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Rt="multi_line_text",Bt="text";const Lt="undefined"!=typeof document&&"inputMode"in document.createElement("input");let Wt;E=l(ht.getDerivedFromVars(lt.max_visible_lines),(t=>k=t));let Ht="",qt=null,Gt="",Yt="",Xt="";function Kt(t){mt instanceof HTMLInputElement?mt.selectionStart=mt.selectionEnd=t:Tr(mt,t)}async function Qt(){if(!mt||!yt)return;yt.overrideRawValue(b),xt.set(yt.rawValue),c($t,m=kt=Et=yt.value,m);const t=yt.cursorPosition;await $(),document.activeElement===mt&&Kt(t)}var ee;rt=l(ht.getDerivedFromVars(lt.select_all_on_focus),(t=>et=t)),g((()=>{lt.id&&ht.unregisterFocusable(lt.id)})),void 0===e.json&&r.json&&void 0!==lt&&r.json(lt),void 0===e.templateContext&&r.templateContext&&void 0!==ct&&r.templateContext(ct),void 0===e.origJson&&r.origJson&&void 0!==gt&&r.origJson(gt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ft&&r.layoutParams(ft),"fixed_length"===(null==(ee=C)?void 0:ee.type)?yt=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const i={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(i),r):new Pr(i,e)}return r||null}(ee,ht.logError,yt):"currency"===(null==ee?void 0:ee.type)&&(yt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new Or(t.locale,e)}(ee,ht.logError,yt)),yt&&Qt(),yt||kt===m||(kt=Et=m),yt&&yt.rawValue!==b&&Qt(),n=Q,Ct=vt(X,1,Ct),At=re(Z,At),Ft=ne(q,Ft),jt=W&&"string"==typeof W?ht.typefaceProvider(W,{fontWeight:Ft||400}):"";{const t=B;Zt(t)&&(Vt=t/At)}return St(z)&&(Ot=dt(z)),It=vt(M,1,It),Mt=vt(O,1,Mt),Nt=se(P,Nt),zt=le(D,zt),A&&A in Jt&&(Bt=Jt[A],Rt=A),"currency"===(null==C?void 0:C.type)&&(Bt=Lt?"text":"tel",Wt="decimal"),a="multi_line_text"===Rt,s=ht.getDerivedFromVars(lt.paddings),nt(),nt=l(s,(t=>x=t)),Zt(k)&&(Ht=`calc(${k*(Vt||1.25)*(At/10)+"em"} + ${pt(Tt(null==x?void 0:x.top,0)+Tt(null==x?void 0:x.bottom,0))})`),qt=Ut(x||void 0,qt),Gt=qt?Pt({top:(Number(qt.top)||0)/At*10,right:(Number(qt.right)||0)/At*10,bottom:(Number(qt.bottom)||0)/At*10,left:(Number(qt.left)||0)/At*10}):"",Yt=qt?Pt({top:(Number(qt.top)||0)/At*10,bottom:(Number(qt.bottom)||0)/At*10}):"",u=ht.getDerivedFromVars(lt.accessibility),it(),it=l(u,(t=>w=t)),(null==w?void 0:w.description)?Xt=w.description:ht.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(Mt),multiline:a,"alignment-horizontal":Nt,"alignment-vertical":zt},p={"--divkit-input-hint-color":Ct,"--divkit-input-highlight-color":Mt,"--divkit-input-line-height":Vt,"font-weight":Ft,"font-family":jt,"letter-spacing":Ot,color:It,"max-height":Ht},v={"font-size":dt(At),padding:Gt},h={"font-size":dt(At),padding:Yt},y(),_(),it(),nt(),E(),F(),V(),j(),S(),T(),N(),R(),U(),H(),G(),Y(),K(),tt(),rt(),wt?"":`${J(te,"Outer").$$render(t,{cls:Dt("input",Cr,d),style:p,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,json:lt,origJson:gt,templateContext:ct,layoutParams:ft},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return a?`<span${L("class",Cr["input__scroll-wrapper"],0)}>${!Et&&n?`<div${L("class",Cr.input__placeholder,0)} aria-hidden="true"${L("style",ut(v),0)}>${I(n)}</div>`:""} <span aria-hidden="true"${L("style",ut(h),0)}></span> <span${L("class",Dt("input__input",Cr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",Xt,0)}${L("style",ut(v),0)}${L("this",mt,0)}>${i=Et,void 0===i?"":i}</span></span>`:`<input${L("type",Bt,0)}${L("inputmode",Wt,0)}${L("class",Dt("input__input",Cr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",Xt,0)}${L("style",ut(v),0)}${L("placeholder",n,0)}${L("value",kt,0)}${L("this",mt,0)}>`;var i}})}`})),Nr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},zr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,T=o,M=o,{json:z={}}=e,{templateContext:R}=e,{origJson:B}=e,{layoutParams:U}=e;const W=f(at),H=z.value_variable;let q=!1;H||(q=!0,W.logError(st(new Error('Missing "value_variable" in "select"')))),O=l(H&&W.getVariable(H,"string")||xr("temp","string",""),(t=>S=t));let G="";const Z=z.options,Y=Array.isArray(Z)&&Z.filter((t=>"string"==typeof t.value))||[];Array.isArray(Y)&&Y.length||W.logError(st(new Error('Empty selection "items" in "select"')));let X="",K=null,Q="";j=l(W.getDerivedFromVars(z.hint_text),(t=>D=t)),V=l(W.getDerivedFromVars(z.hint_color),(t=>A=t));let tt="rgba(0,0,0,.45)";F=l(W.getDerivedFromVars(z.font_size),(t=>C=t));let et,rt=12;E=l(W.getDerivedFromVars(z.font_weight),(t=>k=t)),x=l(W.getDerivedFromVars(z.font_family),(t=>$=t));let it,nt="";w=l(W.getDerivedFromVars(z.line_height),(t=>_=t)),b=l(W.getDerivedFromVars(z.letter_spacing),(t=>y=t));let ot="";m=l(W.getDerivedFromVars(z.text_color),(t=>h=t));let lt="#000",ct="";g((()=>{z.id&&W.unregisterFocusable(z.id)})),void 0===e.json&&r.json&&void 0!==z&&r.json(z),void 0===e.templateContext&&r.templateContext&&void 0!==R&&r.templateContext(R),void 0===e.origJson&&r.origJson&&void 0!==B&&r.origJson(B),void 0===e.layoutParams&&r.layoutParams&&void 0!==U&&r.layoutParams(U),G=S;{const t=Y.find((t=>t.value===S));t?X="string"==typeof t.text?t.text:t.value:(X="",S&&W.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}n=W.getDerivedFromVars(z.paddings),M(),M=l(n,(t=>P=t)),rt=re(C,rt),K=Ut(P||void 0,K),Q=K?Pt({top:(Number(K.top)||0)/rt*10,right:(Number(K.right)||0)/rt*10,bottom:(Number(K.bottom)||0)/rt*10,left:(Number(K.left)||0)/rt*10}):"",a=D,tt=vt(A,1,tt),et=ne(k,et),nt=$&&"string"==typeof $?W.typefaceProvider($,{fontWeight:et||400}):"";{const t=_;Zt(t)&&(it=t/rt)}return St(y)&&(ot=dt(y/rt*10)),lt=vt(h,1,lt),s=W.getDerivedFromVars(z.accessibility),T(),T=l(s,(t=>v=t)),(null==v?void 0:v.description)?ct=v.description:W.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),c={hint:!X},u={"--divkit-input-hint-color":tt,"font-weight":et,"font-family":nt,color:lt},d={padding:Q,"font-size":dt(rt),"line-height":it,"letter-spacing":ot},p={"font-size":dt(rt),"line-height":it,"letter-spacing":ot},T(),m(),b(),w(),x(),E(),F(),V(),j(),M(),O(),q?"":`${J(te,"Outer").$$render(t,{cls:Dt("select",Nr,c),style:u,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,json:z,origJson:B,templateContext:R,layoutParams:U},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",Nr["select__select-text"],0)}${L("style",ut(d),0)} aria-hidden="true"> ${I(X||a||"")}</span> <select${L("class",Dt("select__select",Nr,{"has-custom-focus":t}),0)}${L("aria-label",ct,0)}${L("style",ut(p),0)}${L("this",undefined,0)}>${N(Y,(t=>`<option${L("class",Nr.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),Jr={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},Rr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k=o,E=o,{json:C={}}=e,{templateContext:F}=e,{origJson:A}=e,{layoutParams:V}=e;const D=f(at);let j,P=!1,S=!1;x=l(D.getDerivedFromVars(C.video_sources),(t=>$=t));let O=[];w=l(D.getDerivedFromVars(C.repeatable),(t=>_=t));let I=!1;b=l(D.getDerivedFromVars(C.autostart),(t=>y=t));let T=!1;m=l(D.getDerivedFromVars(C.muted),(t=>h=t));let M,z=!1;v=l(D.getDerivedFromVars(C.preview),(t=>p=t));let R="fit",B="0";const U=C.elapsed_time_variable;var W,q;(U&&D.getVariable(U,"integer")||xr("temp","integer",0)).subscribe((t=>{S&&(S=!1)})),!C.id||P||(null==V?void 0:V.fakeElement)||D.registerInstance(C.id,{pause(){},start(){}}),g((()=>{!C.id||P||(null==V?void 0:V.fakeElement)||D.unregisterInstance(C.id)})),void 0===e.json&&r.json&&void 0!==C&&r.json(C),void 0===e.templateContext&&r.templateContext&&void 0!==F&&r.templateContext(F),void 0===e.origJson&&r.origJson&&void 0!==A&&r.origJson(A),void 0===e.layoutParams&&r.layoutParams&&void 0!==V&&r.layoutParams(V),W=$,q=O,O=Array.isArray(W)&&W.length?W.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):q,O.length?P=!1:(P=!0,D.logError(st(new Error('Missing "video_sources" in "video"')))),I=ce(_,I),T=ce(y,T),z=ce(h,z),M="string"==typeof p?Se(p):M,n=D.getDerivedFromVars(C.scale),E(),E=l(n,(t=>d=t)),R=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(d)||R,a=D.getDerivedFromVars(C.aspect),k(),k=l(a,(t=>u=t));{const t=null==u?void 0:u.ratio;B=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}return s={aspect:"0"!==B},c={"object-fit":R},k(),E(),v(),m(),b(),w(),x(),P?"":`${J(te,"Outer").$$render(t,{cls:Dt("video",Jr,s),customActions:"video",json:C,origJson:A,templateContext:F,layoutParams:V},{},{default:()=>s.aspect?`<div${L("class",Jr["video__aspect-wrapper"],0)}${H({"padding-bottom":`${B}%`})}><video${L("class",Jr.video__video,0)}${L("style",ut(c),0)} playsinline ${I?"loop":""} ${T?"autoplay":""} ${z?"muted":""}${L("poster",M,0)}${L("this",j,0)}>${N(O,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",Jr.video__video,0)}${L("style",ut(c),0)} playsinline ${I?"loop":""} ${T?"autoplay":""} ${z?"muted":""}${L("poster",M,0)}${L("this",j,0)}>${N(O,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),Br=Rr,Ur=U(((t,e,r,i)=>{let n,o,a;var s;let{json:l={}}=e,{templateContext:c}=e,{origJson:u}=e,{layoutParams:d}=e;const p=f(at);let g=null,v="",h={},m=!1;if(void 0===e.json&&r.json&&void 0!==l&&r.json(l),void 0===e.templateContext&&r.templateContext&&void 0!==c&&r.templateContext(c),void 0===e.origJson&&r.origJson&&void 0!==u&&r.origJson(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),"string"==typeof l.custom_type&&l.custom_type&&(null===(s=p.customComponents)||void 0===s?void 0:s.has(l.custom_type))){if(g=p.customComponents.get(l.custom_type),"function"==typeof g.template){const t=p.getExtensionContext(),e=new Map;for(const[r,i]of t.variables)e.set(r,i.getValue());v=g.template({props:l.custom_props,variables:e})}else v=g.template&&"string"==typeof g.template?g.template:"";h={shadowrootmode:g.shadowRootMode||"open"}}else g=null,v=";",p.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return n=l.items,void 0===n||Array.isArray(n)?m=!1:(m=!0,p.logError(st(new Error('Incorrect "items" prop for div "custom"')))),o=(!m&&n||[]).map((t=>{let e=t,r=c;return({templateContext:r,json:e}=p.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a={fakeElement:null==d?void 0:d.fakeElement},g?`${J(te,"Outer").$$render(t,{json:l,origJson:u,templateContext:c,layoutParams:d},{},{default:()=>{return(e=g.element)?`<${g.element}${P([M(l.custom_props||{})],{})}${L("this",undefined,0)}>${D(e)?"":`${v?`<template${P([M(h)],{})}> ${v}</template>`:""} ${!m&&n?`${N(o,(e=>`${J(Wr,"Unknown").$$render(t,{layoutParams:a,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`:""}`}${D(e)?"":`</${e}>`}`:"";var e}})}`:""})),Lr={};Lr.text=pe,Lr.container=Ae,Lr.separator=je,Lr.image=Oe,Lr.gif=Oe,Lr.grid=Je,Lr.gallery=We,Lr.tabs=Ge,Lr.state=ir,Lr.pager=ar,Lr.indicator=cr,Lr.slider=Er,Lr.input=Mr,Lr.select=zr,Lr.video=Br,Lr.custom=Ur;const Wr=U(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=f(at);let c,u,d;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=n,u=o,d=c&&Lr[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Lr[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(st(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${J(d||z,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),Hr=U(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${L("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return` <filter${L("id",n[t],0)}><feFlood${L("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${L("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${L("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function qr(t,e,r,i){const n=r[t.type];if(!n)return i(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const i=Object.keys(r).filter((t=>"__proto__"!==t)),n=i.filter((t=>"$"!==t.charAt(0))),o=i.filter((t=>"$"===t.charAt(0)));return n.forEach((i=>{const n=r[i];"object"==typeof n&&null!==n?(e[i]=Array.isArray(n)?[]:{},t(e[i],n)):e[i]=n})),o.forEach((t=>{const i=r[t],n=a[i];if(void 0!==n){const r=t.substring(1);e[r]=n}})),e}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Gr(){}function Zr(t){return{subscribe:e=>(e(t),Gr)}}function Yr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Xr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Kr(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function Qr(t){try{return mr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function ti(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ei(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,ei.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function ri(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function ii(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Fe,JsonStringContents:function(){var t,e,r;for(t=ve,e=[],r=Ae();r!==i;)e.push(r),r=Ae();return fe=t,e=jt(e)}},a=Fe,s="@{",l="}",c="@{}",u="\\",d="?",p=":",g="||",v="&&",f="==",h="!=",m=">=",y=">",b="<=",_="<",w="+",$="-",x="/",k="*",E="%",C="!",F="(",A=")",V=",",D="'",j=".",P="e",S="E",O="true",I="false",T=/^[^}]/,M=/^[^'}]/,N=/^[0-9]/,z=/^[a-zA-Z_0-9.]/,J=/^[a-zA-Z_]/,R=/^[ \t\r\n]/,B=we("@{",!1),U=we("}",!1),L=we("@{}",!1),W=we("\\",!1),H={type:"any"},q=$e(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),K=we("==",!1),Q=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),it=we("<",!1),nt=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ct=we("!",!1),ut=we("(",!1),dt=we(")",!1),pt=we(",",!1),gt=xe("string"),vt=we("'",!1),ft=$e(["'","}"],!0,!1),ht=xe("integer"),mt=$e([["0","9"]],!1,!1),yt=xe("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),$t=xe("boolean"),xt=we("true",!1),kt=we("false",!1),Et=$e([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=xe("identifier"),Ft=$e([["a","z"],["A","Z"],"_"],!1,!1),At=xe("whitespace"),Vt=$e([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},jt=function(t){return Kr(t)},Pt=function(t){return t},St=function(){return""},Ot=function(){return _e()},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},Mt=function(t){return t},Nt=function(t){return ti(t)},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Rt=function(t,e){return Xr(t,e)},Bt=function(t,e){return Xr(t,e)},Ut=function(t,e){return Yr(t,e)},Lt=function(t,e){return Yr(t,e)},Wt=function(t,e){return Yr(t,e)},Ht=function(t,e){return Yr(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Kt=function(t){return t},Qt=function(t){return Kr(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return ti(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:Qr(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},pe=function(){return{type:"BooleanLiteral",value:!1}},ge=function(){return{type:"Identifier",name:_e()}},ve=0,fe=0,he=[{line:1,column:1}],me=0,ye=[],be=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function _e(){return t.substring(fe,ve)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function $e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function xe(t){return{type:"other",description:t}}function ke(e){var r,i=he[e];if(i)return i;for(r=e-1;!he[r];)r--;for(i={line:(i=he[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return he[e]=i,i}function Ee(t,e,r){var i=ke(t),o=ke(e),a={source:n,start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:o.line,column:o.column}};return r&&n&&"function"==typeof n.offset&&(a.start=n.offset(a.start),a.end=n.offset(a.end)),a}function Ce(t){ve<me||(ve>me&&(me=ve,ye=[]),ye.push(t))}function Fe(){var t,e;return t=ve,Re(),(e=Ve())!==i?(Re(),fe=t,t=Dt(e)):(ve=t,t=i),t}function Ae(){var e,r,n,o,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(ve)?(a=l,ve++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=Pt(o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=St()),(e=r)===i&&(e=ve,r=ve,be++,92===t.charCodeAt(ve)?(n=u,ve++):(n=i,0===be&&Ce(W)),n===i&&(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B))),be--,n===i?r=void 0:(ve=r,r=i),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Ot()):(ve=e,e=i)):(ve=e,e=i),e===i))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],T.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(q)),o!==i)for(;o!==i;)n.push(o),T.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(q));else n=i;n!==i?(125===t.charCodeAt(ve)?(o=l,ve++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=It()):(ve=e,e=i)):(ve=e,e=i)}else ve=e,e=i;e===i&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=Tt()),(e=r)===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=Mt(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Nt(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=zt()),e=r))))}return e}function Ve(){var e,r,n,o,a,s;return e=ve,(r=De())!==i?(Re(),63===t.charCodeAt(ve)?(n=d,ve++):(n=i,0===be&&Ce(G)),n!==i?(Re(),(o=Ve())!==i?(Re(),58===t.charCodeAt(ve)?(a=p,ve++):(a=i,0===be&&Ce(Z)),a!==i?(Re(),(s=Ve())!==i?(fe=e,e=Jt(r,o,s)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=De()),e}function De(){var e,r,n,o,a,s,l,c;if(e=ve,(r=je())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===g?(s=g,ve+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===g?(s=g,ve+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Rt(r,n)}else ve=e,e=i;return e}function je(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Pe())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===v?(s=v,ve+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===v?(s=v,ve+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Bt(r,n)}else ve=e,e=i;return e}function Pe(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Se())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===f?(s=f,ve+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(ve,2)===h?(s=h,ve+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===f?(s=f,ve+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(ve,2)===h?(s=h,ve+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Ut(r,n)}else ve=e,e=i;return e}function Se(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Oe())!==i){for(n=[],o=ve,a=Re(),t.substr(ve,2)===m?(s=m,ve+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ve)?(s=y,ve++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ve,2)===b?(s=b,ve+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ve)?(s=_,ve++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),t.substr(ve,2)===m?(s=m,ve+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ve)?(s=y,ve++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ve,2)===b?(s=b,ve+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ve)?(s=_,ve++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Lt(r,n)}else ve=e,e=i;return e}function Oe(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Ie())!==i){for(n=[],o=ve,a=Re(),43===t.charCodeAt(ve)?(s=w,ve++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ve)?(s=$,ve++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),43===t.charCodeAt(ve)?(s=w,ve++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ve)?(s=$,ve++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Wt(r,n)}else ve=e,e=i;return e}function Ie(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Te())!==i){for(n=[],o=ve,a=Re(),47===t.charCodeAt(ve)?(s=x,ve++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ve)?(s=k,ve++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Te())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Re(),47===t.charCodeAt(ve)?(s=x,ve++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ve)?(s=k,ve++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Te())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Ht(r,n)}else ve=e,e=i;return e}function Te(){var e,r,n;return(e=ze())===i&&(e=Ne())===i&&(e=ve,33===t.charCodeAt(ve)?(r=C,ve++):(r=i,0===be&&Ce(ct)),r===i&&(43===t.charCodeAt(ve)?(r=w,ve++):(r=i,0===be&&Ce(nt)),r===i&&(45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)))),r!==i?(Re(),(n=Te())!==i?(fe=e,e=qt(r,n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ve,(r=Je())!==i?(Re(),40===t.charCodeAt(ve)?(n=F,ve++):(n=i,0===be&&Ce(ut)),n!==i?(Re(),o=function(){var e,r,n,o,a,s;if(e=ve,(r=Ve())!==i){for(n=[],o=ve,Re(),44===t.charCodeAt(ve)?(a=V,ve++):(a=i,0===be&&Ce(pt)),a!==i?(Re(),(s=Ve())!==i?o=s:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,Re(),44===t.charCodeAt(ve)?(a=V,ve++):(a=i,0===be&&Ce(pt)),a!==i?(Re(),(s=Ve())!==i?o=s:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Yt(r,n)}else ve=e,e=i;return e===i&&(e=Re()),e}(),o!==i?(Re(),41===t.charCodeAt(ve)?(a=A,ve++):(a=i,0===be&&Ce(dt)),a!==i?(fe=e,e=Gt(r,o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,(r=Je())!==i&&(fe=e,r=Zt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return be++,e=ve,39===t.charCodeAt(ve)?(r=D,ve++):(r=i,0===be&&Ce(vt)),r!==i?(n=function(){var t,e,r;for(t=ve,e=[],r=Me();r!==i;)e.push(r),r=Me();return fe=t,t=e=Qt(e)}(),39===t.charCodeAt(ve)?(o=D,ve++):(o=i,0===be&&Ce(vt)),o!==i?(fe=e,e=Kt(n)):(ve=e,e=i)):(ve=e,e=i),be--,e===i&&(r=i,0===be&&Ce(gt)),e}(),e===i&&(e=ze())===i&&(e=Ne())===i&&(e=function(){var e,r;return be++,e=ve,t.substr(ve,4)===O?(r=O,ve+=4):(r=i,0===be&&Ce(xt)),r!==i&&(fe=e,r=de()),(e=r)===i&&(e=ve,t.substr(ve,5)===I?(r=I,ve+=5):(r=i,0===be&&Ce(kt)),r!==i&&(fe=e,r=pe()),e=r),be--,e===i&&(r=i,0===be&&Ce($t)),e}(),e===i&&(e=ve,40===t.charCodeAt(ve)?(r=F,ve++):(r=i,0===be&&Ce(ut)),r!==i&&(n=Ve())!==i?(41===t.charCodeAt(ve)?(o=A,ve++):(o=i,0===be&&Ce(dt)),o!==i?(fe=e,e=Xt(n)):(ve=e,e=i)):(ve=e,e=i))),e}())),e}())),e}function Me(){var e,r,n,o,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(ve)?(a=l,ve++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=te(o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=ee()),(e=r)===i&&(e=ve,r=ve,be++,92===t.charCodeAt(ve)?(n=u,ve++):(n=i,0===be&&Ce(W)),n===i&&(39===t.charCodeAt(ve)?(n=D,ve++):(n=i,0===be&&Ce(vt)),n===i&&(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B)))),be--,n===i?r=void 0:(ve=r,r=i),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=re()):(ve=e,e=i)):(ve=e,e=i),e===i))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],M.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(ft)),o!==i)for(;o!==i;)n.push(o),M.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(ft));else n=i;n!==i?(125===t.charCodeAt(ve)?(o=l,ve++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=ie()):(ve=e,e=i)):(ve=e,e=i)}else ve=e,e=i;e===i&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=ne()),(e=r)===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=oe(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=ae(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=se()),e=r))))}return e}function Ne(){var e,r,n,o;if(be++,e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));else n=i;return n!==i?(fe=e,e=le()):(ve=e,e=i),be--,e===i&&(r=i,0===be&&Ce(ht)),e}function ze(){var e,r,n,o,a,s,l,c,u,d;for(be++,e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));if(46===t.charCodeAt(ve)?(o=j,ve++):(o=i,0===be&&Ce(bt)),o!==i){if(a=[],N.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=i,0===be&&Ce(mt)),s!==i)for(;s!==i;)a.push(s),N.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=i,0===be&&Ce(mt));else a=i;if(a!==i){if(s=ve,101===t.charCodeAt(ve)?(l=P,ve++):(l=i,0===be&&Ce(_t)),l===i&&(69===t.charCodeAt(ve)?(l=S,ve++):(l=i,0===be&&Ce(wt))),l!==i){if(43===t.charCodeAt(ve)?(c=w,ve++):(c=i,0===be&&Ce(nt)),c===i&&(45===t.charCodeAt(ve)?(c=$,ve++):(c=i,0===be&&Ce(ot))),c===i&&(c=null),u=[],N.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=i,0===be&&Ce(mt)),d!==i)for(;d!==i;)u.push(d),N.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=i,0===be&&Ce(mt));else u=i;u!==i?s=l=[l,c,u]:(ve=s,s=i)}else ve=s,s=i;s===i&&(s=null),fe=e,e=ce()}else ve=e,e=i}else ve=e,e=i;if(e===i){if(e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));else n=i;if(n!==i)if(101===t.charCodeAt(ve)?(o=P,ve++):(o=i,0===be&&Ce(_t)),o===i&&(69===t.charCodeAt(ve)?(o=S,ve++):(o=i,0===be&&Ce(wt))),o!==i){if(43===t.charCodeAt(ve)?(a=w,ve++):(a=i,0===be&&Ce(nt)),a===i&&(45===t.charCodeAt(ve)?(a=$,ve++):(a=i,0===be&&Ce(ot))),a===i&&(a=null),s=[],N.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=i,0===be&&Ce(mt)),l!==i)for(;l!==i;)s.push(l),N.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=i,0===be&&Ce(mt));else s=i;s!==i?(fe=e,e=ue()):(ve=e,e=i)}else ve=e,e=i;else ve=e,e=i}return be--,e===i&&(r=i,0===be&&Ce(yt)),e}function Je(){var e,r,n,o,a;if(be++,e=ve,r=ve,be++,n=function(){var e,r,n,o;return e=ve,t.substr(ve,4)===O?(r=O,ve+=4):(r=i,0===be&&Ce(xt)),r===i&&(t.substr(ve,5)===I?(r=I,ve+=5):(r=i,0===be&&Ce(kt))),r!==i?(n=ve,be++,z.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(Et)),be--,o===i?n=void 0:(ve=n,n=i),n!==i?e=r=[r,n]:(ve=e,e=i)):(ve=e,e=i),e}(),be--,n===i?r=void 0:(ve=r,r=i),r!==i)if(J.test(t.charAt(ve))?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(Ft)),n!==i){for(o=[],z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=i,0===be&&Ce(Et));a!==i;)o.push(a),z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=i,0===be&&Ce(Et));fe=e,e=ge()}else ve=e,e=i;else ve=e,e=i;return be--,e===i&&(r=i,0===be&&Ce(Ct)),e}function Re(){var e,r;for(be++,e=[],R.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=i,0===be&&Ce(Vt));r!==i;)e.push(r),R.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=i,0===be&&Ce(Vt));return be--,r=i,0===be&&Ce(At),e}if((r=a())!==i&&ve===t.length)return r;throw r!==i&&ve<t.length&&Ce({type:"end"}),function(t,e,r){return new ei(ei.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(ei,Error),ei.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(i){var s=this.location.end,l=ri("",o.line.toString().length," "),c=i[n.line-1],u=(n.line===s.line?s.column:c.length+1)-n.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+ri("",n.column-1," ")+ri("",u,"^")}else e+="\n at "+a}return e},ei.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const ni=new Map,oi=new Map;function ai(t,e,r){const i={args:e,cb:r},n=ni.get(t)||[];ni.has(t)||ni.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");oi.set(o,i)}function si(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function li(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{li(t,e)}));break;case"BinaryExpression":case"LogicalExpression":li(t.left,e),li(t.right,e);break;case"UnaryExpression":li(t.argument,e);break;case"ConditionalExpression":li(t.test,e),li(t.consequent,e),li(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{li(t,e)}))}}function ci(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function ui(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function di(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return ui(t.value);if("color"===t.type)return bi(yi(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";if("array"===t.type)return"<array>";throw new Error(`Unexpected type ${t.type}`)}function pi(t){let e=di(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function gi(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function vi(t,e){if(gr)return mr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function fi(t,e){if(e<hr||e>fr)throw new Error("Integer overflow.");!gr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function hi(t){const e=[];return li(t,{Variable(t){e.push(t.id.name)}}),e}function mi(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function yi(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function bi(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return gt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function _i(t){return bi(yi(t))}const wi=Number.MAX_VALUE,$i=Number.MIN_VALUE,xi="string",ki="integer",Ei="number",Ci="boolean",Fi="color",Ai="url",Vi="datetime",Di="dict",ji="array";function Pi(t,e){return{type:xi,value:di(e)}}function Si(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ei,value:r}}function Oi(t,e,r,i){const n=t.variables.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=_i(o)),{type:i,value:o}}function Ii(t,e,r){return Oi(t,e,r,r.type)}function Ti(t,e,r){return Oi(t,e,r,"color")}function Mi(t,e,r){return Oi(t,e,r,"url")}const Ni=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:ki,value:mr(i)}},zi=Ni("getUTCFullYear"),Ji=Ni("getUTCMonth"),Ri=Ni("getUTCDate"),Bi=Ni("getUTCDay"),Ui=Ni("getUTCHours"),Li=Ni("getUTCMinutes"),Wi=Ni("getUTCSeconds"),Hi=Ni("getUTCMilliseconds");function qi(t,e,r,i){if(!i.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let n="";const o=e.type===xi?e.value:di(e);for(;n.length+o.length<r.value;)n+=i.value;return n.length>0&&n.length+o.length>r.value&&(n=n.substring(0,Number(r.value)-Number(o.length))),n}function Gi(t,e,r,i){const n=qi(t,e,r,i);return{type:xi,value:n+di(e)}}function Zi(t,e,r,i){const n=qi(t,e,r,i);return{type:xi,value:di(e)+n}}function Yi(t){return(e,r)=>{const i=yi(r.value);return{type:Ei,value:i[t]/255}}}function Xi(t){return(e,r,i)=>{const n=yi(r.value);return n[t]=255*i.value,{type:Fi,value:bi(n)}}}const Ki=Yi("a"),Qi=Yi("r"),tn=Yi("g"),en=Yi("b"),rn=Xi("a"),nn=Xi("r"),on=Xi("g"),an=Xi("b");function sn(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=mr(e.value)/mr(r);return fi(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=mr(n)%mr(i)),{type:ki,value:n}}const ln=36e5;function cn(t,e){return(r,i,...n)=>{let o=function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const i=r[e[t]];if(void 0===i)throw new Error(`Missing property "${e[t]}" in the dict.`);r=i}return r}(i.value,n.map((t=>t.value))),a=typeof o;if(a!==t)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");fi(r,o)}return"string"===t&&"color"===e&&(o=_i(o)),{type:e,value:o}}}function un(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=_i(r)),{type:e,value:r}}}}const dn=cn("string","string"),pn=cn("number","number"),gn=cn("number","integer"),vn=cn("boolean","boolean"),fn=cn("string","color"),hn=cn("string","url"),mn=un(dn,"string"),yn=un(pn,"number"),bn=un(gn,"integer"),_n=un(vn,"boolean"),wn=un(fn,"color"),$n=un(hn,"url");function xn(t,e){return(r,i,n)=>{if(n.value<0||n.value>=i.value.length)throw new Error(`Requested index (${n.value}) out of bounds array size (${i.value.length}).`);let o=i.value[Number(n.value)],a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"obejct"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");fi(r,o)}return"string"===t&&"color"===e&&(o=_i(o)),{type:e,value:o}}}function kn(t,e){return(r,i,n,o)=>{try{return t(r,i,n)}catch(t){let r=o.value;return"color"===e&&(r=_i(r)),{type:e,value:r}}}}const En=xn("string","string"),Cn=xn("number","number"),Fn=xn("number","integer"),An=xn("boolean","boolean"),Vn=xn("string","color"),Dn=xn("string","url"),jn=xn("array","array"),Pn=xn("object","dict"),Sn=kn(En,"string"),On=kn(Cn,"number"),In=kn(Fn,"integer"),Tn=kn(An,"boolean"),Mn=kn(Vn,"color"),Nn=kn(Dn,"url");function zn(t){return t.map(pi).join(", ")}ai("toString",[ki],Pi),ai("toString",[Ei],Pi),ai("toString",[Ci],Pi),ai("toString",[Fi],Pi),ai("toString",[Ai],Pi),ai("toNumber",[ki],Si),ai("toNumber",[xi],Si),ai("toInteger",[Ei],(function(t,e){if(e.value>fr||e.value<hr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:ki,value:mr(r)}})),ai("toInteger",[xi],(function(t,e){let r;try{r=mr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>fr||r<hr)throw new Error("Unable to convert value to Integer.");return{type:ki,value:r}})),ai("toInteger",[Ci],(function(t,e){return{type:ki,value:mr(e.value?1:0)}})),ai("toBoolean",[ki],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Ci,value:r}})),ai("toBoolean",[xi],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Ci,value:"true"===e.value?1:0}})),ai("toColor",[xi],(function(t,e){return{type:Fi,value:_i(e.value)}})),ai("toUrl",[xi],(function(t,e){return{type:Ai,value:e.value}})),ai("encodeUri",[xi],(function(t,e){try{return{type:xi,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),ai("decodeUri",[xi],(function(t,e){try{return{type:xi,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),ai("getIntegerValue",[xi,ki],Ii),ai("getNumberValue",[xi,Ei],Ii),ai("getBooleanValue",[xi,Ci],Ii),ai("getStringValue",[xi,xi],Ii),ai("getColorValue",[xi,Fi],Ti),ai("getColorValue",[xi,xi],Ti),ai("getUrlValue",[xi,Ai],Mi),ai("getUrlValue",[xi,xi],Mi),ai("parseUnixTime",[ki],(function(t,e){return{type:Vi,value:new Date(1e3*Number(e.value))}})),ai("nowLocal",[],(function(){return{type:Vi,value:new Date}})),ai("addMillis",[Vi,ki],(function(t,e,r){return{type:Vi,value:new Date(e.value.getTime()+Number(r.value))}})),ai("setYear",[Vi,ki],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:Vi,value:i}})),ai("setMonth",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<1||i>12)throw new Error(`Expecting month in [1..12], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMonth(i-1),{type:Vi,value:n}})),ai("setDay",[Vi,ki],(function(t,e,r){const i=new Date(e.value),n=Number(r.value);if(n<=0&&-1!==n||n>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(i))throw new Error(`Unable to set day ${n} for date ${di(e)}.`);return i.setUTCDate(-1===n?0:n),{type:Vi,value:i}})),ai("setHours",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>23)throw new Error(`Expecting hours in [0..23], instead got ${i}.`);const n=new Date(e.value);return n.setUTCHours(i),{type:Vi,value:n}})),ai("setMinutes",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting minutes in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMinutes(i),{type:Vi,value:n}})),ai("setSeconds",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting seconds in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCSeconds(i),{type:Vi,value:n}})),ai("setMillis",[Vi,ki],(function(t,e,r){const i=Number(r.value);if(i<0||i>999)throw new Error(`Expecting millis in [0..999], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMilliseconds(i),{type:Vi,value:n}})),ai("getYear",[Vi],zi),ai("getMonth",[Vi],Ji),ai("getDay",[Vi],Ri),ai("getDayOfWeek",[Vi],Bi),ai("getHours",[Vi],Ui),ai("getMinutes",[Vi],Li),ai("getSeconds",[Vi],Wi),ai("getMillis",[Vi],Hi),ai("getIntervalSeconds",[ki],(function(t,e){return sn(t,e,1e3,60)})),ai("getIntervalTotalSeconds",[ki],(function(t,e){return sn(t,e,1e3)})),ai("getIntervalMinutes",[ki],(function(t,e){return sn(t,e,6e4,60)})),ai("getIntervalTotalMinutes",[ki],(function(t,e){return sn(t,e,6e4)})),ai("getIntervalHours",[ki],(function(t,e){return sn(t,e,ln,24)})),ai("getIntervalTotalHours",[ki],(function(t,e){return sn(t,e,ln)})),ai("getIntervalTotalDays",[ki],(function(t,e){return sn(t,e,864e5)})),ai("getIntervalTotalWeeks",[ki],(function(t,e){return sn(t,e,6048e5)})),ai("len",[xi],(function(t,e){return{type:ki,value:mr(e.value.length)}})),ai("contains",[xi,xi],(function(t,e,r){return{type:Ci,value:e.value.includes(r.value)?1:0}})),ai("substring",[xi,ki,ki],(function(t,e,r,i){if(i.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||i.value<0||i.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:xi,value:e.value.substring(Number(r.value),Number(i.value))}})),ai("replaceAll",[xi,xi,xi],(function(t,e,r,i){let n;return n=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),i.value):e.value,{type:xi,value:n}})),ai("index",[xi,xi],(function(t,e,r){return{type:ki,value:mr(e.value.indexOf(r.value))}})),ai("lastIndex",[xi,xi],(function(t,e,r){return{type:ki,value:mr(e.value.lastIndexOf(r.value))}})),ai("trim",[xi],(function(t,e){return{type:xi,value:e.value.trim()}})),ai("trimLeft",[xi],(function(t,e){return{type:xi,value:e.value.replace(/^\s+/,"")}})),ai("trimRight",[xi],(function(t,e){return{type:xi,value:e.value.replace(/\s+$/,"")}})),ai("toUpperCase",[xi],(function(t,e){return{type:xi,value:e.value.toUpperCase()}})),ai("toLowerCase",[xi],(function(t,e){return{type:xi,value:e.value.toLowerCase()}})),ai("padStart",[xi,ki,xi],Gi),ai("padStart",[ki,ki,xi],Gi),ai("padEnd",[xi,ki,xi],Zi),ai("padEnd",[ki,ki,xi],Zi),ai("testRegex",[xi,xi],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Ci,value:i.test(e.value)?1:0}})),ai("div",[ki,ki],(function(t,e,r){if(r.value===yr)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=vi(0,i),fi(t,i),{type:ki,value:i}})),ai("div",[Ei,Ei],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value/r.value;return{type:Ei,value:i}})),ai("mod",[ki,ki],(function(t,e,r){if(r.value===yr)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=vi(0,i),fi(t,i),{type:ki,value:i}})),ai("mod",[Ei,Ei],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value%r.value;return{type:Ei,value:i}})),ai("mul",[{type:ki,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:yr;for(let i=1;i<e.length;++i)r*=e[i].value,r=vi(0,r),fi(t,r);return{type:ki,value:r}})),ai("mul",[{type:Ei,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Ei,value:r}})),ai("sub",[{type:ki,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:yr;for(let i=1;i<e.length;++i)r-=e[i].value,r=vi(0,r),fi(t,r);return{type:ki,value:r}})),ai("sub",[{type:Ei,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Ei,value:r}})),ai("sum",[{type:ki,isVararg:!0}],(function(t,...e){let r=yr;for(let i=0;i<e.length;++i)r+=e[i].value,r=vi(0,r),fi(t,r);return{type:ki,value:r}})),ai("sum",[{type:Ei,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ei,value:r}})),ai("abs",[ki],(function(t,e){const r=br(e.value);return fi(t,r),{type:e.type,value:r}})),ai("abs",[Ei],(function(t,e){const r=Math.abs(e.value);return{type:Ei,value:r}})),ai("max",[{type:ki,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:ki,value:r}})),ai("max",[{type:Ei,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ei,value:Math.max(...e.map((t=>t.value)))}})),ai("min",[{type:ki,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:ki,value:r}})),ai("min",[{type:Ei,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ei,value:Math.min(...e.map((t=>t.value)))}})),ai("maxNumber",[],(function(){return{type:Ei,value:wi}})),ai("minNumber",[],(function(){return{type:Ei,value:$i}})),ai("maxInteger",[],(function(t){return fi(t,fr),{type:ki,value:fr}})),ai("minInteger",[],(function(t){return fi(t,hr),{type:ki,value:hr}})),ai("round",[Ei],(function(t,e){const r=Math.sign(e.value);return{type:Ei,value:r*Math.round(Math.abs(e.value))}})),ai("floor",[Ei],(function(t,e){return{type:Ei,value:Math.floor(e.value)}})),ai("ceil",[Ei],(function(t,e){return{type:Ei,value:Math.ceil(e.value)}})),ai("signum",[ki],(function(t,e){return{type:ki,value:_r(e.value)}})),ai("signum",[Ei],(function(t,e){return{type:Ei,value:Math.sign(e.value)}})),ai("copySign",[ki,ki],(function(t,e,r){let i;if(r.value===yr)i=e.value;else if(e.value===yr)i=0;else{const t=_r(r.value);i=br(e.value)*t}return fi(t,i),{type:ki,value:i}})),ai("copySign",[Ei,Ei],(function(t,e,r){let i=Math.sign(r.value);0===i&&(i=Object.is(i,0)?1:-1);const n=Math.abs(e.value)*i;return{type:Ei,value:n}})),ai("getColorAlpha",[xi],Ki),ai("getColorAlpha",[Fi],Ki),ai("getColorRed",[xi],Qi),ai("getColorRed",[Fi],Qi),ai("getColorGreen",[xi],tn),ai("getColorGreen",[Fi],tn),ai("getColorBlue",[xi],en),ai("getColorBlue",[Fi],en),ai("setColorAlpha",[xi,Ei],rn),ai("setColorAlpha",[Fi,Ei],rn),ai("setColorRed",[xi,Ei],nn),ai("setColorRed",[Fi,Ei],nn),ai("setColorGreen",[xi,Ei],on),ai("setColorGreen",[Fi,Ei],on),ai("setColorBlue",[xi,Ei],an),ai("setColorBlue",[Fi,Ei],an),ai("rgb",[Ei,Ei,Ei],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Fi,value:bi(n)}})),ai("argb",[Ei,Ei,Ei,Ei],(function(t,e,r,i,n){const o={a:255*e.value,r:255*r.value,g:255*i.value,b:255*n.value};return{type:Fi,value:bi(o)}})),ai("getDictString",[Di,{type:xi,isVararg:!0}],dn),ai("getStringFromDict",[Di,{type:xi,isVararg:!0}],dn),ai("getDictNumber",[Di,{type:xi,isVararg:!0}],pn),ai("getNumberFromDict",[Di,{type:xi,isVararg:!0}],pn),ai("getDictInteger",[Di,{type:xi,isVararg:!0}],gn),ai("getIntegerFromDict",[Di,{type:xi,isVararg:!0}],gn),ai("getDictBoolean",[Di,{type:xi,isVararg:!0}],vn),ai("getBooleanFromDict",[Di,{type:xi,isVararg:!0}],vn),ai("getDictColor",[Di,{type:xi,isVararg:!0}],fn),ai("getColorFromDict",[Di,{type:xi,isVararg:!0}],fn),ai("getDictUrl",[Di,{type:xi,isVararg:!0}],hn),ai("getUrlFromDict",[Di,{type:xi,isVararg:!0}],hn),ai("getDictOptString",[xi,Di,{type:xi,isVararg:!0}],mn),ai("getOptStringFromDict",[xi,Di,{type:xi,isVararg:!0}],mn),ai("getDictOptNumber",[Ei,Di,{type:xi,isVararg:!0}],yn),ai("getOptNumberFromDict",[Ei,Di,{type:xi,isVararg:!0}],yn),ai("getDictOptInteger",[ki,Di,{type:xi,isVararg:!0}],bn),ai("getOptIntegerFromDict",[ki,Di,{type:xi,isVararg:!0}],bn),ai("getDictOptBoolean",[Ci,Di,{type:xi,isVararg:!0}],_n),ai("getOptBooleanFromDict",[Ci,Di,{type:xi,isVararg:!0}],_n),ai("getDictOptColor",[Fi,Di,{type:xi,isVararg:!0}],wn),ai("getOptColorFromDict",[Fi,Di,{type:xi,isVararg:!0}],wn),ai("getDictOptColor",[xi,Di,{type:xi,isVararg:!0}],wn),ai("getOptColorFromDict",[xi,Di,{type:xi,isVararg:!0}],wn),ai("getDictOptUrl",[xi,Di,{type:xi,isVararg:!0}],$n),ai("getOptUrlFromDict",[xi,Di,{type:xi,isVararg:!0}],$n),ai("getDictOptUrl",[Ai,Di,{type:xi,isVararg:!0}],$n),ai("getOptUrlFromDict",[Ai,Di,{type:xi,isVararg:!0}],$n),ai("getArrayString",[ji,ki],En),ai("getStringFromArray",[ji,ki],En),ai("getArrayNumber",[ji,ki],Cn),ai("getNumberFromArray",[ji,ki],Cn),ai("getArrayInteger",[ji,ki],Fn),ai("getIntegerFromArray",[ji,ki],Fn),ai("getArrayBoolean",[ji,ki],An),ai("getBooleanFromArray",[ji,ki],An),ai("getArrayColor",[ji,ki],Vn),ai("getColorFromArray",[ji,ki],Vn),ai("getArrayUrl",[ji,ki],Dn),ai("getUrlFromArray",[ji,ki],Dn),ai("getArrayFromArray",[ji,ki],jn),ai("getDictFromArray",[ji,ki],Pn),ai("getArrayOptString",[ji,ki,xi],Sn),ai("getOptStringFromArray",[ji,ki,xi],Sn),ai("getArrayOptNumber",[ji,ki,Ei],On),ai("getOptNumberFromArray",[ji,ki,Ei],On),ai("getArrayOptInteger",[ji,ki,ki],In),ai("getOptIntegerFromArray",[ji,ki,ki],In),ai("getArrayOptBoolean",[ji,ki,Ci],Tn),ai("getOptBooleanFromArray",[ji,ki,Ci],Tn),ai("getArrayOptColor",[ji,ki,Fi],Mn),ai("getOptColorFromArray",[ji,ki,Fi],Mn),ai("getArrayOptColor",[ji,ki,xi],Mn),ai("getOptColorFromArray",[ji,ki,xi],Mn),ai("getArrayOptUrl",[ji,ki,Ai],Nn),ai("getOptUrlFromArray",[ji,ki,Ai],Nn),ai("getArrayOptUrl",[ji,ki,xi],Nn),ai("getOptUrlFromArray",[ji,ki,xi],Nn),ai("getOptArrayFromArray",[ji,ki],(function(t,e,r){try{return jn(t,e,r)}catch(t){return{type:"array",value:[]}}})),ai("getOptDictFromArray",[ji,ki],(function(t,e,r){try{return Pn(t,e,r)}catch(t){return{type:"dict",value:{}}}}));const Jn={StringLiteral:function(t,e){return{type:xi,value:e.value}},NumberLiteral:function(t,e){return{type:Ei,value:e.value}},IntegerLiteral:function(t,e){return fi(t,e.value),{type:ki,value:e.value}},BooleanLiteral:function(t,e){return{type:Ci,value:e.value?1:0}},UnaryExpression:function(t,e){const r=ci(Rn(t,e.argument));switch(e.operator){case"!":if(r.type===Ci)return{type:Ci,value:r.value?0:1};mi(`${e.operator}${pi(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===ki){const e=r.value*mr(i);return fi(t,e),{type:ki,value:e}}if(r.type===Ei)return{type:Ei,value:r.value*i};mi(`${e.operator}${pi(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=ci(Rn(t,e.test));if(r.type===Ci)return r.value?Rn(t,e.consequent):Rn(t,e.alternate);mi(`${pi(r)} ? ${pi(Rn(t,e.consequent))} : ${pi(Rn(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return Rn(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=di(Rn(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:xi,value:r}},LogicalExpression:function(t,e){const r=ci(Rn(t,e.left));if(r.type!==Ci&&mi(`${pi(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ci,value:0};const i=ci(Rn(t,e.right));return i.type!==Ci&&mi(`${pi(r)} ${e.operator} ${pi(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${gi(i.type)}.`),{type:Ci,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Rn(t,e.left),n=Rn(t,e.right);if(i.type!==n.type&&mi(`${pi(i)} ${e.operator} ${pi(n)}`,`Operator '${r}' cannot be applied to different types: ${gi(i.type)} and ${gi(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===Vi&&r.type===Vi?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Ci,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ei&&e.type!==ki&&e.type!==Vi&&mi(`${pi(e)} ${t} ${pi(r)}`,`Operator '${t}' cannot be applied to ${gi(e.type)} type.`);const n=e.type===Vi?e.value.getTime():e.value,o=r.type===Vi?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Ci,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==xi&&r.type!==Ei&&r.type!==ki&&mi(`${pi(r)} ${e} ${pi(i)}`,`Operator '${e}' cannot be applied to ${gi(r.type)} type.`),r.type===xi)return"-"===e&&mi(`${pi(r)} - ${pi(i)}`,`Operator '${e}' cannot be applied to ${gi(r.type)} type.`),{type:xi,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===ki)try{n=vi(0,n),fi(t,n)}catch(t){mi(`${pi(r)} ${e} ${pi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r,i){let n;if(r.type!==ki&&r.type!==Ei&&mi(`${pi(r)} ${e} ${pi(i)}`,`Operator '${e}' cannot be applied to ${gi(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&mi(`${pi(r)} ${e} ${pi(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===ki)try{n=vi(0,n),fi(t,n)}catch(t){mi(`${pi(r)} ${e} ${pi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let i;const n=e.arguments.map((e=>Rn(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(oi.has(o))i=oi.get(o);else{const t=function(t,e){const r=ni.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=si(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t||"type"in t&&"missing"===t.type){const e=n.map((t=>gi(t.type))).join(", "),i=`${r}(${zn(n)})`;"few"===t.type&&0===n.length?mi(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?mi(i,`Function '${r}' has no matching override for given argument types: ${e}.`):mi(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){mi(`${r}(${zn(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.variables.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function Rn(t,e){if(e.type in Jn)return Jn[e.type](t,e);throw new Error("Unsupported expression")}function Bn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(li(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const i=Rn(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class Un{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return li(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Bn(t,this.ast);r.warnings.forEach(e);const i=r.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const n=i.value;if(n instanceof Date)return ui(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=ft(String(n));if(t)return bi(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return n>2147483647||n<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(n);if("array"===i.type||"dict"===i.type)try{return JSON.stringify(n)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return n}catch(t){return void e(st(new Error("Expression execution error")))}}}function Ln(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=ii(t,{startRule:"JsonStringContents"}),i=hi(r);return e.vars.push(...i),new Un(r)}catch(e){return void r(st(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Ln(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Ln(t[n],e,r);return i}}var i;return t}function Wn(t,e,r){if(t){if(t instanceof Un)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Wn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Wn(t[n],e,r);return i}}return t}function Hn(t,e){const r={vars:[],hasExpression:!1},i=Ln(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Wn(i,t,e)}}const qn={pagers:function(){return K(new Map)}},Gn=new Map,Zn=new Map;function Yn(t){const e=Gn.get(t)||K("");return Gn.has(t)||Gn.set(t,e),e}function Xn(t){const e=Zn.get(t)||new Map;return Zn.has(t)||Zn.set(t,e),e}class Kn{setVariable(t){const e=t.getName(),r=Xn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Yn(this).set(e)}getVariable(t){return Xn(this).get(t)}}function Qn(){return new Kn}function to(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const eo=new Set(["start","stop","pause","resume","cancel","reset"]);class ro{constructor(t){to(this,"timers",new Map),to(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(st(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(st(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&eo.has(e)))return void this.logError(st(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const i=t.tickStarted=performance.now(),n=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-i-n)%r,e()}),n)};e()}}start(t){if("running"===t.state)return void this.logError(st(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(st(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(st(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(st(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(st(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(st(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(st(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(st(new Error("The timer is already running"))):this.logError(st(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function io(t,e,r,i){const{variable_name:n}=r;if(!n)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:n}}));const o=t.get(n);if(!o)return void e(st(new Error("Cannot find variable"),{additional:{name:n}}));const a=o.getType();"array"===a?i(o):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:n,type:a}}))}let no=K(!0),oo=0;function ao(){no.set(!1)}function so(){no.set(!0)}const lo=U(((t,e,r,i)=>{let n,o;var a,s,c,u;let{id:d}=e,{json:p={}}=e,{platform:f="auto"}=e,{theme:h="system"}=e,{globalVariablesController:m=new Kn}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:_=["http","https","tel","mailto","intent"]}=e,{extensions:w=new Map}=e,{onError:x}=e,{onStat:k}=e,{onCustomAction:E}=e,{onComponent:C}=e,{typefaceProvider:F=(t=>"")}=e,{fetchInit:A={}}=e,{tooltipRoot:V}=e,{customComponents:D}=e,j=K("desktop"===f);if(o=l(j,(t=>n=t)),"auto"===f&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");j.set(!t.matches),t.addListener((()=>{j.set(!t.matches)}))}let P="light",S=null;function O(t){h=t}function T(){}const M=new Set(_);let N=!1;p||(N=!0,tt(st(new Error('"json" prop is required')))),d||(N=!0,tt(st(new Error('"id" prop is required'))));let z=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return st(new Error("Missing card"));if(!e.states||!e.states.length)return st(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Lr)return st(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return st(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return st(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const R=p.templates||{};z&&(N=!0,tt(z));const B={stateChange:!1},U=Yn(m),L=Xn(m),W=new Map,H=new Map,q=new Map;let G=null,Z=0,Y=[];function X(t){const e=Hn(t,tt);return e.hasExpression?e.applyVars(H):t}function tt(t){x?x({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function et(t,e){k&&k({type:t,action:e})}let rt=0;function nt(t){return`${d}-${rt++}`}let ot={},lt={};function ct(t){ut(X(t))}function ut(t){const e=t.url?String(t.url):"",r=t.typed;if(e)try{const r=e.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(r);if(!i)return;const n=new URLSearchParams(i[2]);switch(i[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=wt,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=yt(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=yt(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=yt(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const i=n.get("name"),o=n.get("value");if(i&&null!==o){const t=H.get(i);if(t){const e=t.getType();"dict"===e||"array"===e?tt(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:i}})):t.set(o)}else tt(st(new Error("Cannot find variable"),{additional:{name:i}}))}else tt(st(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const a=n.get("action"),s=n.get("id");G?G.execTimerAction(s,a):tt(st(new Error("Incorrect timer action"),{additional:{id:s,action:a}}));break;case"video":!function(t,e){if(t){const r=yt(t);r?"start"===e?r.start():"pause"===e?r.pause():tt(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):tt(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else tt(st(new Error("Missing id in video action"),{additional:{action:e}}))}(n.get("id"),n.get("action"));break;case"download":!function(t,e){if(t){let r;r="function"==typeof A?A(t):A,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,n,o;if(r){if(r.templates)for(const t in r.templates)R.hasOwnProperty(t)||(R[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>!vt.has(t.id)));if(i)return tt(st(new Error("Skipping transactional, child is not found"),{additional:{url:t,id:i.id}})),void dt(null===(n=e.download_callbacks)||void 0===n?void 0:n.on_fail_actions)}r.patch.changes.forEach((t=>{const e=vt.get(t.id);e&&e.replaceWith(t.id,t.items)})),dt(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_success_actions)}}else tt(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;tt(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),dt(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else tt(st(new Error("Missing url in download action"),{additional:{url:t}}))}(n.get("url"),t);break;case"show_tooltip":!function(t,e){var r;if(!t)return void tt(st(new Error("Missing id in show_tooltip action")));const i=ht.get(t);if(!i)return void tt(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&Y.some((e=>e.desc.id===t)))return;const n={internalId:++Z,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};Y=[...Y,n];const o=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;o&&(n.timeoutId=window.setTimeout((()=>{n.timeoutId=0,Y=Y.filter((t=>t.internalId!==n.internalId))}),o))}(n.get("id"),n.get("multiple"));break;case"hide_tooltip":!function(t){t?Y=Y.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):tt(st(new Error("Missing id in hide_tooltip action")))}(n.get("id"));break;default:tt(st(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){tt(st(t,{additional:{url:e}}))}else if(r)switch(r.type){case"set_variable":{const{variable_name:t,value:e}=r;if(t&&e){const r=H.get(t);r?r.getType()===e.type?r.setValue(e.value):tt(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):tt(st(new Error("Cannot find variable"),{additional:{name:t}}))}else tt(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:i,index:n,value:o}=r;!o||"number"!=typeof n&&void 0!==n?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:i}})):io(t,e,r,(t=>{const a=t.getValue();if("number"==typeof n&&(n<0||n>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:i,index:n,length:a.length}}));else{const e=a.slice();"number"==typeof n?e.splice(n,0,o.value):e.push(o.value),t.setValue(e)}}))}(H,tt,r);break;case"array_remove_value":!function(t,e,r){const{variable_name:i,index:n}=r;"number"==typeof n?io(t,e,r,(t=>{const o=t.getValue();if("number"==typeof n&&(n<0||n>=o.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:i,index:n,length:o.length}}));else{const e=o.slice();e.splice(n,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:i}}))}(H,tt,r);break;case"copy_to_clipboard":!function(t,e){!e.content||"text"!==e.content.type&&"url"!==e.content.type||"string"!=typeof e.content.value?t(st(new Error("Incorrect action"),{additional:{action:e}})):"undefined"!=typeof navigator&&"clipboard"in navigator&&navigator.clipboard&&"writeText"in navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e.content.value).catch((e=>{t(st(new Error("Failed to copy to the clipboard"),{additional:{originalError:String(e)}}))})):t(st(new Error("Clipboard is unavailable"),{additional:{action:e}}))}(tt,r);break;case"focus_element":{const t=r.element_id&&ft.get(r.element_id);t?t.focus():tt(st(new Error("Incorrect focus_element action"),{additional:{elementId:r.element_id}}));break}default:tt(st(new Error("Unknown type of action"),{additional:{type:r.type}}))}}async function dt(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url,o=i.typed;if(n){const t=xt(n);if(t)if(kt(t,M)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(ut(i),await $()):i.log_id&&(pt(i),await $())}else o&&ut(i)}t.forEach((t=>{t.log_id&&et("click",t)}))}}function pt(t){null==E||E(t)}const gt=new Map,vt=new Map,ft=new Map,ht=new Map;function yt(t){if(gt.has(t))return gt.get(t);tt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const bt=new Map;function _t(t){for(const e of t)H.has(e)&&t.delete(e);return t}v(at,{logError:tt,logStat:et,hasTemplate:function(t){return t in R},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in R;){if(({json:t,templateContext:e}=qr(t,e,R,tt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:nt,genClass:function(t){return`divkit-${nt()}`},execAction:ut,execAnyActions:dt,execCustomAction:pt,isRunning:function(t){return B[t]},setRunning:function(t,e){B[t]=e},registerInstance:function(t,e){gt.has(t)?tt(st(new Error("Duplicate instance id"),{additional:{id:t}})):gt.set(t,e)},unregisterInstance:function(t){gt.delete(t)},registerParentOf:function(t,e){vt.set(t,e)},unregisterParentOf:function(t){vt.delete(t)},registerTooltip:function(t,e){ht.has(e.id)&&tt(st(new Error("Duplicate tooltip id"),{additional:{id:e.id}})),ht.set(e.id,{onwerNode:t,tooltip:e})},unregisterTooltip:function(t){ht.delete(t.id),Y.some((e=>e.desc.id===t.id))&&(Y=Y.filter((e=>e.desc.id!==t.id)))},onTooltipClose:function(t){Y=Y.filter((e=>e.internalId!==t))},tooltipRoot:V,registerFocusable:function(t,e){ft.set(t,e)},unregisterFocusable:function(t){ft.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(lt[r]=lt[r]||0,++lt[r],ot[r])return ot[r];const i=`${nt()}-svg-filter`;return ot=Object.assign(Object.assign({},ot),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;lt[r]&&0==--lt[r]&&(ot=Object.keys(ot).reduce(((t,e)=>(lt[e]&&(t[e]=ot[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Zr(t);const e=Hn(t,tt);return e.vars.length?Q(e.vars.map((t=>H.get(t)||function(t){const e=q.get(t)||K(void 0);return q.has(t)||q.set(t,e),e}(t))).filter(mt),(()=>e.applyVars(H))):e.hasExpression?Zr(e.applyVars(H)):Zr(t)},getJsonWithVars:X,getStore:function(t){return bt.has(t)||function(t){bt.has(t)||bt.set(t,qn[t]())}(t),bt.get(t)},getVariable:function(t,e){const r=H.get(t);if(r){const i=r.getType();if(i!==e)return void tt(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return M},getExtension:function(t,e){const r=w.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:H,logError:tt}},typefaceProvider:F,isDesktop:j,isPointerFocus:no,customComponents:D,registerComponent:void 0,unregisterComponent:void 0}),v(Ht,{hasAction:()=>!1});const wt={setState(t){throw new Error("Not implemented")},getChild(t){if($t&&$t.has(t))return $t.get(t);tt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let $t=null;v(jt,{registerInstance(t,e){$t||($t=new Map),$t.has(t)?tt(st(new Error("Duplicate state with id"),{additional:{id:t}})):$t.set(t,e)},unregisterInstance(t){null==$t||$t.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const Et=null===(a=null==p?void 0:p.card)||void 0===a?void 0:a.variables;Array.isArray(Et)&&Et.forEach((t=>{if(t&&t.type in $r&&t.name){if(W.has(t.name))return void tt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&tt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=xr(t.name,t.type,t.value);W.set(t.name,e),H.set(t.name,e)}catch(e){tt(st(e,{additional:{name:t.name}}))}}}));const Ct=p.palette;Ct&&Ct[P].forEach((t=>{if(W.has(t.name))tt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=xr(t.name,"color",t.color);W.set(t.name,e),H.set(t.name,e)}catch(e){tt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of L)H.has(t)||H.set(t,e);U.subscribe((t=>{if(t&&!H.has(t)){const e=L.get(t);H.set(t,e);const r=q.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Ft=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variable_triggers;Array.isArray(Ft)&&Ft.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void tt(st(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=ii(t.condition,{startRule:"JsonStringContents"}),n=hi(i);if(!n.length)return void tt(st(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return _t(e),e.size?new Promise((t=>{const r=U.subscribe((()=>{_t(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{Q(n.map((t=>H.get(t))).filter(mt),(()=>{const t=Bn(H,i);return t.warnings.forEach(tt),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=X(t);e.log_id&&ut(e)})),e=Boolean(i.value)):tt(st(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){tt(st(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else tt(st(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const At=null===(c=null==p?void 0:p.card)||void 0===c?void 0:c.timers;if(At){const t=G=new ro({logError:tt,applyVars:X,hasVariableWithType:function(t,e){const r=H.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=H.get(t);r?r.setValue(e):tt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:dt});At.forEach((e=>t.createTimer(e)))}const Vt=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.states;let Dt;return Vt&&!N&&(Dt={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:Vt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}),g((()=>{oo--,oo||(window.removeEventListener("keydown",ao),window.removeEventListener("pointerdown",so)),G&&G.destroy(),Y.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==d&&r.id(d),void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.platform&&r.platform&&void 0!==f&&r.platform(f),void 0===e.theme&&r.theme&&void 0!==h&&r.theme(h),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==_&&r.builtinProtocols(_),void 0===e.extensions&&r.extensions&&void 0!==w&&r.extensions(w),void 0===e.onError&&r.onError&&void 0!==x&&r.onError(x),void 0===e.onStat&&r.onStat&&void 0!==k&&r.onStat(k),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==F&&r.typefaceProvider(F),void 0===e.fetchInit&&r.fetchInit&&void 0!==A&&r.fetchInit(A),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==V&&r.tooltipRoot(V),void 0===e.customComponents&&r.customComponents&&void 0!==D&&r.customComponents(D),void 0===e.setTheme&&r.setTheme&&void 0!==O&&r.setTheme(O),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==T&&r.getDebugVariables(T),void 0===e.execAction&&r.execAction&&void 0!==ct&&r.execAction(ct),"light"===h||"dark"===h?P=h:"system"===h?"undefined"!=typeof matchMedia?(S||(S=matchMedia("(prefers-color-scheme: dark)"),S.addListener((function(){"system"===h&&S&&(P=S.matches?"dark":"light")}))),P=S.matches?"dark":"light"):P="light":tt(st(new Error("Unsupported theme"))),P&&(Ct&&Ct[P].forEach((t=>{const e=H.get(t.name);e&&e.setValue(t.color)}))),o(),!N&&Dt?`<div class="${I("divkit-b023c",!0)+I(n?` ${it}`:"",!0)+I(y?` ${y}`:"",!0)}">${J(Hr,"RootSvgFilters").$$render(t,{svgFiltersMap:ot},{},{})} ${J(Wr,"Unknown").$$render(t,{div:Dt,templateContext:{},layoutParams:{tooltips:Y}},{},{})}</div>`:""})),co=lo;function uo(t){return co.render(t).html}var po=e.M,go=e.Os,vo=e.sY;export{po as createGlobalVariablesController,go as createVariable,vo as render};
|
|
2
2
|
//# sourceMappingURL=server.mjs.map
|