@divkitframework/divkit 29.15.0 → 30.1.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/server.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>zi,createVariable:()=>Br,render:()=>ra}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function n(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 o{constructor(t){n(this,"_listeners","WeakMap"in r?new WeakMap:void 0),n(this,"_observer",void 0),n(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;o.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function i(){}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 i}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 v(t){p().$$.on_destroy.push(t)}function g(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}o.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),A(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 A(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 j=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"]),F=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function V(t){return F.test(t)||"!doctype"===t.toLowerCase()}const D=/[\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 S(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=H(n):r.style=H(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),o=e.slice(t+1).trim();n&&(r[n]=o)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(D.test(t))return;const e=r[t];!0===e?n+=" "+t:j.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const O=/[&"]/g,P=/[&<]/g;function I(t,e=!1){const r=String(t),n=e?O:P;n.lastIndex=0;let o="",i=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];o+=r.substring(i,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),i=t+1}return o+r.substring(i)}function M(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function T(t){const e={};for(const r in t)e[r]=M(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 n="";for(let r=0;r<t.length;r+=1)n+=e(t[r],r);return n}const z={$$render:()=>""};function R(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 B,U;function W(t){function e(e,r,n,o,i){const a=u;d({$$:{on_destroy:B,context:new Map(i||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,o);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{B=[];const o={title:"",head:"",css:new Set},i=e(o,t,{},r,n);return s(B),{html:i,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function L(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${I(e,!0)}"`}`}function H(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${M(t[e])};`)).join(" ")}function q(t){const e=H(t);return e?` style="${e}"`:""}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(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 n=r.call(t,"string");if("object"!=typeof n)return n;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,n){var o;const i=null===(o=r[t])||void 0===o?void 0:o.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)switch(i){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(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(U=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 o of this.$$s)o in r&&(e[o]=[t(o)]);for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=Y(a,i.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const n=()=>{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(n),n();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 n;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,r,this.$$p_d,"toProp"),null===(n=this.$$c)||void 0===n||n.$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 Q(t,e=i){let r;const n=new Set;function o(e){if(i=e,((o=t)!=o?i==i:o!==i||o&&"object"==typeof o||"function"==typeof o)&&(t=e,r)){const e=!X.length;for(const e of n)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 o,i}function a(e){o(e(t))}return{set:o,update:a,subscribe:function(s,l=i){const c=[s,l];return n.add(c),1===n.size&&(r=e(o,a)||i),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),o=n?[t]:t;if(!o.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=i;const v=()=>{if(d)return;p();const o=e(n?u[0]:u,t,r);a?t(o):p="function"==typeof o?o:i},g=o.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&v()}),(()=>{d|=1<<e}))));return c=!0,v(),function(){s(g),p(),c=!1}},{subscribe:Q(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",nt="divkit-ee112",ot="divkit-aa145",it="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_start:"divkit-e70de",text_halign_center:"divkit-e1659",text_halign_end:"divkit-e48b4",text_valign_start:"divkit-b7b70",text_valign_center:"divkit-ef58e",text_valign_end:"divkit-d4206",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 Number.isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function vt(t,e){for(;t.length<e;)t="0"+t;return t}function gt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const n=ft(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>vt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):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,n,o,i]=e,a=2===n.length?n:n+n,s=2===o.length?o:o+o,l=2===i.length?i:i+i,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,n,o]=e,i=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===o.length?o:o+o;return{a:255,r:parseInt(i,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,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:gt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=gt(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=>gt(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 n=t.bg.radius;let o;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?o=pt(n.value):"relative"===n.type&&(o=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${o||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>gt(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){if(t.startsWith("tel:"))return"tel";const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e){const r=Number(t);return Number.isNaN(r)||r<0?e:r}function Ct(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function At(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function jt(t,e){e&&t.push(e)}function Ft(t,e,r){const n=[];jt(n,e[t]);for(const o in r)if(r.hasOwnProperty(o)){const i=r[o];i&&jt(n,e[`${t}_${o}`+("string"==typeof i?`_${i}`:"")])}return n.join(" ")}const Vt=Symbol("state");function Dt(t,e){var r,n;const o=t.top||0,i=(null!==(r="ltr"===e?t.end:t.start)&&void 0!==r?r:t.right)||0,a=t.bottom||0,s=(null!==(n="ltr"===e?t.start:t.end)&&void 0!==n?n:t.left)||0;return 0===o&&0===i&&0===a&&0===s?"":dt(o)+" "+dt(i)+" "+dt(a)+" "+dt(s)}function St(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!Number.isNaN(e)}function Ot(t){return St(t)&&t>=0}function Pt(t,e,r){var n,o;if(!t)return r;const i=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(o="ltr"===e?t.start:t.end)&&void 0!==o?o:t.left];for(let t=0;t<i.length;++t)if(i[t]&&!Ot(i[t]))return r;return Dt(t,e)}const It=Object.prototype.hasOwnProperty;function Mt(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),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const o=r[n];if(!It.call(e,o)||!Mt(t[o],e[o]))return!1}return!0}function Tt(t,e){return Mt(t,e)?e:t}function Nt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function zt(t,e){const r=Number(t);return Number.isNaN(r)?e:r}function Rt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Rt(t))})):e.push(t),e}function Bt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!Ot(t[r[n]]))return e;return t}function Ut(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(t){return 0!==t.is_enabled&&!1!==t.is_enabled}let Lt;function Ht(){}const qt=Symbol("action"),Jt=W(((t,e,r,n)=>{let{componentContext:o}=e,{id:i=""}=e,{actions:a}=e,{doubleTapActions:s}=e,{longTapActions:l}=e,{cls:c=""}=e,{style:u=null}=e,{attrs:d}=e,{use:p=Ht}=e,{customAction:h=null}=e,{isNativeActionAnimation:m=!0}=e,{hasInnerFocusable:y=!1}=e;const b=f(at),_=f(qt);let w;g(qt,{hasAction:()=>Boolean(_.hasAction()||(null==a?void 0:a.length))});let $,x="",k=!1;if(v((()=>{i&&!y&&b.unregisterFocusable(i),clearTimeout(undefined)})),void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.id&&r.id&&void 0!==i&&r.id(i),void 0===e.actions&&r.actions&&void 0!==a&&r.actions(a),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==s&&r.doubleTapActions(s),void 0===e.longTapActions&&r.longTapActions&&void 0!==l&&r.longTapActions(l),void 0===e.cls&&r.cls&&void 0!==c&&r.cls(c),void 0===e.style&&r.style&&void 0!==u&&r.style(u),void 0===e.attrs&&r.attrs&&void 0!==d&&r.attrs(d),void 0===e.use&&r.use&&void 0!==p&&r.use(p),void 0===e.customAction&&r.customAction&&void 0!==h&&r.customAction(h),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==m&&r.isNativeActionAnimation(m),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==y&&r.hasInnerFocusable(y),Array.isArray(a)&&(null==a?void 0:a.length))for(let t=0;t<a.length;++t){const e=a[t].url;if(e){x=e,$=a[t].target||void 0;break}}return Array.isArray(a)&&(null==a?void 0:a.length)&&_.hasAction()&&(x="",o.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:a}}))),k=Boolean(h),x&&!kt(xt(x),b.getBuiltinProtocols())?(x="",k=!0):!x&&Array.isArray(a)&&(null==a?void 0:a.length)&&(k=!0,a.some((t=>t.url||t.typed||t.menu_items))||o.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:a}}))),x?`<a${S([{href:M(x)},{target:M($)},{style:M(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?it:"",!0)},T(d)],{})}${L("this",w,0)}>${n.default?n.default({}):""}</a>`:` <span${S([{class:I(c,!0)+I(k?` ${m?tt:et} ${rt}`:"",!0)+" "+I(null!=l&&l.length?it:"",!0)},{style:M(u)},{role:M(k?"button":null)},{tabindex:M(k?0:null)},T(d)],{})}${L("this",w,0)}>${n.default?n.default({}):""}</span>`})),Gt=Jt,Zt="divkit-b921d";function Yt(t){return St(t)&&t>0}function Xt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Yt(t.radius))return`blur(${pt(t.radius/2)})`}else{if("rtl_mirror"===t.type)return;e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:t.type}}))}else e(st(new Error("Incorrect filter"),{level:"warn"}))})).filter(Boolean).join(" ")}const Qt=W(((t,e,r,n)=>{let o,{direction:i}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return void 0===e.direction&&r.direction&&void 0!==i&&r.direction(i),void 0===e.componentContext&&r.componentContext&&void 0!==a&&r.componentContext(a),void 0===e.background&&r.background&&void 0!==s&&r.background(s),void 0===e.radius&&r.radius&&void 0!==l&&r.radius(l),o=s.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 n=yt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Xt(t.filters,a.logError),"rtl"===i&&t.filters.some((t=>"rtl_mirror"===t.type))&&(e.transform="scale(-1,1)")))}return r})),`<span${L("class","divkit-bf253"+(l?" divkit-dcad7":""),0)}${q({"border-radius":l})}>${N(o,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Zt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Zt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te={left:"start",center:"center",right:"end",start:"start",end:"end"},ee={left:"end",center:"center",right:"start",start:"start",end:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,tt,et,rt,nt,ot=i,it=i,lt=i,vt=i,ft=i,ht=i,bt=i,_t=i,wt=i,$t=i,jt=i,St=i,It=i,Ht=i,qt=i,Jt=i,Zt=i,Yt=i,{componentContext:Xt}=e,{cls:Qt=""}=e,{style:ne}=e,{layoutParams:oe={}}=e,{customDescription:ie=!1}=e,{customPaddings:ae=!1}=e,{customActions:se=""}=e,{additionalPaddings:le=null}=e,{heightByAspect:ce=!1}=e,{parentOf:ue}=e,{parentOfSimpleMode:de}=e,{replaceItems:pe}=e,{hasInnerFocusable:ve=!1}=e;const ge=f(at),fe=f(Vt);let he,me;tt=l(ge.direction,(t=>Q=t));let ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae,je,Fe,Ve,De,Se,Oe,Pe,Ie,Me,Te,Ne,ze=null,Re=[],Be={},Ue={},We=!1,Le=1,He="transparent",qe=0,Je={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ge="",Ze=null,Ye="",Xe={},Qe=0,Ke=0,tr=0,er=!1,rr=!1,nr={},or=0,ir=0,ar=0,sr=!1,lr=!1,cr=1,ur=[],dr=!1,pr=!1,vr=[],gr=[],fr=[],hr=[],mr=[],yr=[],br="",_r=!1,wr="visible",$r=0,xr=0,kr=!1,Er=null;function Cr(t,e){if(!Array.isArray(ue)||!pe)return;if(de&&1!==(Array.isArray(e)&&e.length||0))return;const r=ue.findIndex((e=>(null==e?void 0:e.id)===t)),n=ue.slice();n.splice(r,1,...e||[]),ue=n,pe(n)}function Ar(){if(ze&&he){const t=ge.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,he,t)})),ze=null}}function jr(t){var e;null==Ne||Ne.destroy(),he=t,dr&&Xt.json.transition_in&&fe.registerChildWithTransitionIn(Xt.json,Xt,Xt.json.transition_in,t).then((()=>{je=!1})).catch((t=>{throw je=!1,t})),dr&&Xt.json.transition_out&&fe.registerChildWithTransitionOut(Xt.json,Xt,Xt.json.transition_out,t),dr&&Xt.json.transition_change&&fe.registerChildWithTransitionChange(Xt.json,Xt,Xt.json.transition_change,t).then((()=>{Ve=!1})).catch((t=>{throw Ve=!1,t}));const r=Xt.fakeElement?[]:Xt.json.visibility_actions||Xt.json.visibility_action&&[Xt.json.visibility_action],n=Xt.fakeElement?[]:Xt.json.disappear_actions;let o;(Array.isArray(r)&&r.length||Array.isArray(n)&&n.length)&&(o=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:o}){const i=[];e&&e.forEach((t=>{i.push({type:"visibility",index:i.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{i.push({type:"disappear",index:i.length,action:t,visible:!1,count:0,finished:!1})}));const a=i.map(((t,e)=>{const r="visibility"===t.type;return o.getDerivedFromVars({index:e,visibility_percentage:t.action.visibility_percentage,visibility_duration:r?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit,is_enabled:t.action.is_enabled})}));let s;const l=()=>{s&&s.disconnect(),i.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t));let u;const d=t=>{const e="visibility"===t.type,r=o.getJsonWithVars(t.action),i=r.url,a=r.typed;if(i){const t=xt(i);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(r):r.log_id&&n.execCustomAction(r))}else a&&n.execAction(r);n.logStat(e?"visible":"disappear",r)},p=c.subscribe((e=>{u=e.filter(At);const r={};u.forEach((t=>{r[t.index]=t})),l();const n=[...new Set(u.map((t=>{const e="visibility"===i[t.index].type;return Ct(e,t.visibility_percentage,e?50:0)/100})))];n.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{u.forEach((e=>{const r=i[e.index],n="visibility"===r.type,o=Ct(n,e.visibility_percentage,n?50:0);let a;a=0===o?t.intersectionRatio>=1e-12:t.intersectionRatio>=o/100;const s=n?!a:a;(n?!r.visible&&a:r.visible&&!a)?r.finished||(r.timer=setTimeout((()=>{++r.count;const t=0===e.log_limit?1/0:e.log_limit||1;++r.count>=t&&(r.finished=!0),d(r)}),Et(e.visibility_duration,800))):s&&r.timer&&clearTimeout(r.timer),r.visible=a}))}))}),{threshold:n}),s.observe(t))}));return{destroy(){var t;null===(t=u)||void 0===t||t.forEach((t=>{const e=i[t.index];e&&"disappear"===e.type&&e.visible&&!e.finished&&n.registerTimeout(window.setTimeout((()=>{d(e)}),t.visibility_duration))})),l(),p()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:ge,componentContext:Xt}));const i=Xt.json.id;return i&&fe.registerChild(i),null===(e=Xt.json.tooltips)||void 0===e||e.forEach((e=>{ge.registerTooltip(t,e)})),Ne={destroy(){i&&fe.unregisterChild(i),o&&o.destroy(),Er&&Er.destroy()}},Ne}function Fr(){Xt.json.focus&&(function(t){let e;return l(t,(t=>e=t))(),e}(ge.isPointerFocus)||(kr=!0),Xt.execAnyActions(hr))}function Vr(){Xt.json.focus&&(kr=!1,Xt.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{ge.unregisterParentOf(t)})),Re=[],null===(t=Xt.json.tooltips)||void 0===t||t.forEach((t=>{ge.unregisterTooltip(t)})),Ar()})),void 0===e.componentContext&&r.componentContext&&void 0!==Xt&&r.componentContext(Xt),void 0===e.cls&&r.cls&&void 0!==Qt&&r.cls(Qt),void 0===e.style&&r.style&&void 0!==ne&&r.style(ne),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ie&&r.customDescription(ie),void 0===e.customPaddings&&r.customPaddings&&void 0!==ae&&r.customPaddings(ae),void 0===e.customActions&&r.customActions&&void 0!==se&&r.customActions(se),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==le&&r.additionalPaddings(le),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ce&&r.heightByAspect(ce),void 0===e.parentOf&&r.parentOf&&void 0!==ue&&r.parentOf(ue),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==de&&r.parentOfSimpleMode(de),void 0===e.replaceItems&&r.replaceItems&&void 0!==pe&&r.replaceItems(pe),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ve&&r.hasInnerFocusable(ve),o=Xt.origJson,o&&(Ze=null,Ye="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Ie=void 0,Me=void 0,ur=Xt.fakeElement?[]:Xt.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&Xt.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&Xt.json.id),he&&jr(he)),a=Xt.getDerivedFromVars(Xt.json.focus),vt(),vt=l(a,(t=>N=t)),s=Xt.getDerivedFromVars(Xt.json.border),Yt(),Yt=l(s,(t=>nt=t)),c=Xt.getDerivedFromVars(Xt.json.paddings),Zt(),Zt=l(c,(t=>rt=t)),u=Xt.getDerivedFromVars(Xt.json.margins),qt(),qt=l(u,(t=>X=t)),d=Xt.getDerivedFromVars(Xt.json.width),It(),It=l(d,(t=>Z=t)),p=Xt.getDerivedFromVars(Xt.json.alignment_horizontal),Jt(),Jt=l(p,(t=>et=t)),g=Xt.getDerivedFromVars(Xt.json.height),St(),St=l(g,(t=>G=t)),h=Xt.getDerivedFromVars(Xt.json.alignment_vertical),Ht(),Ht=l(h,(t=>Y=t)),m=Xt.getDerivedFromVars(Xt.json.alpha),jt(),jt=l(m,(t=>J=t)),y=Xt.getDerivedFromVars(Xt.json.accessibility),$t(),$t=l(y,(t=>q=t)),b=Xt.getDerivedFromVars(Xt.json.background),wt(),wt=l(b,(t=>H=t)),_=Xt.getDerivedFromVars(Xt.json.action),bt(),bt=l(_,(t=>U=t)),w=Xt.getDerivedFromVars(Xt.json.actions),_t(),_t=l(w,(t=>W=t)),x=Xt.getDerivedFromVars(Xt.json.doubletap_actions),ht(),ht=l(x,(t=>B=t)),k=Xt.getDerivedFromVars(Xt.json.longtap_actions),ft(),ft=l(k,(t=>z=t)),E=Xt.getDerivedFromVars(Xt.json.action_animation),lt(),lt=l(E,(t=>T=t)),C=Xt.getDerivedFromVars(Xt.json.visibility),it(),it=l(C,(t=>M=t)),A=Xt.getDerivedFromVars(Xt.json.transform),ot(),ot=l(A,(t=>I=t)),Re.forEach((t=>{ge.unregisterParentOf(t)})),Re=[],ue&&ue.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),ge.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(de)}))}));{const t=kr&&(null==N?void 0:N.border)?N.border:nt;let e={},r={},n=!1,o="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,o,i,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(n=t.offset)||void 0===n||null===(o=n.y)||void 0===o?void 0:o.value)||0)+" "+dt(null!==(i=t.blur)&&void 0!==i?i:2)+" "+gt(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&&(n=!0,Le=Et(t.stroke.width,Le),He=gt(t.stroke.color,1,He),r["--divkit-border"]=`${dt(Le+1)} solid ${He}`),t.corners_radius?(Je=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,Je),e["border-radius"]=Ut(Je),["top-left","top-right","bottom-right","bottom-left"].forEach((t=>{Je[t]=(Je[t]||0)+1})),r["--divkit-border-radius"]=Ut(Je)):t.corner_radius&&(qe=Et(t.corner_radius,qe),Je={"top-left":qe,"top-right":qe,"bottom-right":qe,"bottom-left":qe},e["border-radius"]=dt(qe),r["--divkit-border-radius"]=dt(qe+1)),n&&Le&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Je);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Le/2})),o=Ut(t)}}Be=Tt(e,Be),Ue=Tt(r,Ue),We=n,Ge=o}Ze=Bt(rt&&!ae?rt:void 0,Ze),j=Dt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left","start","end"].forEach((n=>{const o=t[n];o&&(r[n]=o);const i=e[n];i&&(r[n]=(r[n]||0)+i)})),r}(Ze,le),Q),Ye=Pt(X,Q,Ye);{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if("fixed"===c)Qe=Et(null==Z?void 0:Z.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(o["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"!==c&&c||Xt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,Xt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==X?void 0:X.left)||0)+((null==X?void 0:X.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(i=Z&&"weight"in Z&&Z.weight||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)o["halign-self"]="stretch";else{const t=et;o["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===Q?te:ee)[t]:oe.parentHAlign||"start"}t&&(o.width=t),ye=e,be=r,_e=n,Ke=i,tr=a,Xe=Tt(o,Xe),er=s,rr=l}{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==G?void 0:G.type;if(ce);else if("fixed"===c)or=Et(null==G?void 0:G.value,or),e=dt(or);else if("match_parent"!==c||oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==G?void 0:G.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(o["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=G;(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)&&(n=dt(t.max_size.value))}"match_parent"===c&&Xt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,Xt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==X?void 0:X.top)||0)+((null==X?void 0:X.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(i=(null==G?void 0:G.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)o["valign-self"]="stretch";else{const t=Y;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?o["valign-self"]=re[t]:o["valign-self"]=oe.parentVAlign||"start"}t&&(o.height=t),we=e,$e=r,xe=n,ir=i,ar=a,nr=Tt(o,nr),sr=s,lr=l}var Dr,Sr,Or;if(F=!!oe.overlapParent||void 0,V=oe.overlapParent&&(!Z||"match_parent"===Z.type)&&!oe.parentHorizontalWrapContent&&"match_parent"===(null==G?void 0:G.type)&&!oe.parentVerticalWrapContent,D=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,Sr=cr,cr=!Ot(Dr=J)||void 0===Dr||Dr>1?Sr:Number(Dr),ke=1===cr?void 0:cr,me=void 0,q&&!ie&&q.description&&(me={},me["aria-label"]=q.description),Ee=kr&&(null==N?void 0:N.background)?N.background:H,Ce={},Ae=!1,Array.isArray(Ee)&&(Ae=Ee.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ee);Ce["background-color"]=t.color,Ce["background-image"]=t.image,Ce["background-size"]=t.size,Ce["background-position"]=t.position,Ce["background-repeat"]="no-repeat"}je=void 0,dr&&Xt.json.transition_in&&ge.isRunning("stateChange")&&(je=!0),Ve=void 0,dr&&Xt.json.transition_change&&ge.isRunning("stateChange")&&fe.hasTransitionChange(Xt.json.id)&&(Ve=!0);{let t=W||U&&[U]||[],e=B||[],r=z||[],n=(null==N?void 0:N.on_focus)||[],o=(null==N?void 0:N.on_blur)||[];Xt.fakeElement?(t=[],e=[],r=[],n=[],o=[]):(Array.isArray(t)||(t=[],Xt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Xt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Xt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Xt.logError(st(new Error("FocusActions should be array")))),Array.isArray(o)||(o=[],Xt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&se&&(t=[],e=[],r=[],Xt.logError(st(new Error(`Cannot use action on component "${se}"`)))),vr=t.filter(Wt),gr=e.filter(Wt),fr=r.filter(Wt),hr=n.filter(Wt),mr=o.filter(Wt)}T&&(yr=Rt(T),br=yr.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=Et(t.start_delay,0),o="undefined"!=typeof matchMedia&&(Lt||(Lt=window.matchMedia("(prefers-reduced-motion)")),Lt.matches)?0:Et(t.duration,300),i=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return De=e,Se=r,`opacity ${o}ms ${i} ${n}ms`;case"scale":return Oe=e,Pe=r,`transform ${o}ms ${i} ${n}ms`;case"native":case"no_animation":return"";default:return Xt.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=wr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(M,wr);t!==e&&(!_r||"visible"!==wr&&"visible"!==e?wr=e:async function(t){wr=t;const e="visible"===t?"in":"out",r="in"===e?Xt.json.transition_in:Xt.json.transition_out;pr&&r&&(await $(),"in"===e&&(Fe=!0),fe.runVisibilityTransition(Object.assign(Object.assign({},Xt.json),{visibility:"visible"}),Xt,r,he,e).then((()=>{"in"===e&&(Fe=!1)})).catch((t=>{throw"in"===e&&(Fe=!1),t})))}(e)),_r||(_r=!0)}if(Xt.json&&he&&!Mt(Xt.json.extensions,Te)){let t=Te=Xt.json.extensions;$().then((()=>{if(t===Te&&he&&(Ar(),Array.isArray(Xt.json.extensions))){const t=ge.getExtensionContext();ze=Xt.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const o=ge.getExtension(n,e.params);return o&&(null===(r=o.mountView)||void 0===r||r.call(o,he,t)),o})).filter(mt)}}))}if(S=Object.assign(Object.assign(Object.assign({},Xe),nr),{"parent-overlap":F,"parent-overlap-absolute":V,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":je||Fe||Ve,visibility:wr,"has-action-animation":Boolean(br),"parent-flex":oe.parentContainerOrientation||void 0,"parent-grid":Boolean(oe.gridArea)||void 0,"has-custom-focus":Boolean(kr&&Xt.json.focus)}),I&&void 0!==I.rotation){const t=I.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=I.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr);Ie=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Me=`rotate(${I.rotation}deg)`}return O=er||sr?"100%":Ke||ir?0:void 0,P=Object.assign(Object.assign(Object.assign(Object.assign({},ne),Ce),Be),{width:ye,"min-width":be,"max-width":_e,height:we,"min-height":$e,"max-height":xe||(null==ne?void 0:ne["max-height"]),"grid-area":D,padding:j,margin:Ye,opacity:ke,transition:br,"transform-origin":Ie,transform:Me,"flex-grow":Ke||ir||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":O,"--divkit-animation-opacity-start":De,"--divkit-animation-opacity-end":Se,"--divkit-animation-scale-start":Oe,"--divkit-animation-scale-end":Pe}),ot(),it(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),jt(),St(),It(),Ht(),qt(),tt(),Jt(),Zt(),Yt(),rr||lr?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Xt,id:Xt.json.id,use:jr,cls:Qt+" "+Ft("outer",ct,S),style:ut(P),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:me,hasInnerFocusable:ve,isNativeActionAnimation:!yr.length||(Or=yr,Or.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Kt,"OuterBackground").$$render(t,{componentContext:Xt,direction:Q,background:Ee,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Fr,blurHandler:Vr,hasCustomFocus:kr}):""}${We?`<span${L("class",ct.outer__border,0)}${L("style",ut(Ue),0)}></span>`:""}`})}`})),oe=ne,ie={"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 ae(t,e){const r=Number(t);return Number.isNaN(r)||r<=0?e:r}function se(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function le(t,e){return se(t)||e}const ce=W(((t,e,r,n)=>{let o,i,a,s,l,c;var u,d;let{componentContext:p}=e,{text:v}=e,{rootFontSize:g}=e,{textStyles:h={}}=e,{singleline:m=!1}=e,{actions:y}=e;const b=f(at);let _,w="none",$=12,x=1.25,k="",E="",C="",A=null;void 0===e.componentContext&&r.componentContext&&void 0!==p&&r.componentContext(p),void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==h&&r.textStyles(h),void 0===e.singleline&&r.singleline&&void 0!==m&&r.singleline(m),void 0===e.actions&&r.actions&&void 0!==y&&r.actions(y),p.json&&(w="none",$=12,x=1.25,k="",_=void 0,E="",C="",A=null);{let t="none";(h.underline||h.strike)&&("single"===h.underline&&"single"===h.strike?t="both":"single"===h.underline?t="underline":"single"===h.strike&&(t="strike")),w=t}return $=ae(h.font_size,$),Yt(h.line_height)&&(x=Number(h.line_height)/$),Ot(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=le(h.font_weight,_),E="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",C=gt(h.text_color,1,C),o=h.top_offset?dt(h.top_offset):"",i=h.background?yt([h.background]):null,A=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Yt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ae(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,n,o,i,a,s;return"drop-shadow("+gt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(n=t.offset)||void 0===n||null===(o=n.x)||void 0===o?void 0:o.value)||0)/e)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(a=i.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(h.text_shadow,$):void 0,l={singleline:m,decoration:w},c={"font-size":dt(10*$/g),"line-height":x,"letter-spacing":k,"font-weight":_,"font-family":E,filter:s,color:C,background:(null==i?void 0:i.color)||void 0,"box-shadow":A?`inset 0 0 0 ${dt(A.width)} ${A.color}`:void 0,"border-radius":a?dt(a):void 0},`${o?`<span${L("class",ie["text-range__top-offset"],0)}${q({"margin-top":o})}></span>`:""}${R(Gt,"Actionable").$$render(t,{componentContext:p,cls:Ft("text-range",ie,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ue=ce;function de(t,e,r){return"left"===t||"center"===t||"right"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}function pe(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":t:e}function ve(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ge(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const fe=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,z,B,U,W,H,q,J,G,Z,Y=i,X=i,Q=i,K=i,tt=i,et=i,nt=i,ot=i,it=i,st=i,ct=i,pt=i,vt=i,ft=i,ht=i,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=f(at);W=l(_t.direction,(t=>U=t));let wt,$t="",xt=12,kt=1.25,Et=!1,Ct="",At="",jt=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Mt=[],Tt=[];var Nt;v((()=>{Tt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)}))})),void 0===e.componentContext&&r.componentContext&&void 0!==mt&&r.componentContext(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==bt&&r.layoutParams(bt),mt.json&&(xt=12,kt=1.25,Et=!1,Ct="",wt=void 0,At="",jt=!1,Vt="start",Dt="start",St="",Pt="",It=!1),o=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(o,(t=>Z=t)),a=mt.getDerivedFromVars(mt.json.ranges),Q(),Q=l(a,(t=>S=t)),s=mt.getDerivedFromVars(mt.json.images),X(),X=l(s,(t=>D=t)),c=mt.getDerivedFromVars({font_size:mt.json.font_size,letter_spacing:mt.json.letter_spacing,font_weight:mt.json.font_weight,font_family:mt.json.font_family,text_color:mt.json.text_color,underline:mt.json.underline,strike:mt.json.strike,line_height:mt.json.line_height,text_shadow:mt.json.text_shadow}),Y(),Y=l(c,(t=>V=t)),u=mt.getDerivedFromVars(mt.json.font_size),ft(),ft=l(u,(t=>G=t)),d=mt.getDerivedFromVars(mt.json.line_height),vt(),vt=l(d,(t=>J=t)),p=mt.getDerivedFromVars(mt.json.max_lines),it(),it=l(p,(t=>z=t)),g=mt.getDerivedFromVars(mt.json.text_alignment_horizontal),ct(),ct=l(g,(t=>H=t)),h=mt.getDerivedFromVars(mt.json.text_alignment_vertical),st(),st=l(h,(t=>B=t)),m=mt.getDerivedFromVars(mt.json.text_color),ot(),ot=l(m,(t=>T=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>M=t)),b=mt.getDerivedFromVars(mt.json.truncate),et(),et=l(b,(t=>I=t)),_=mt.getDerivedFromVars(mt.json.text_gradient),tt(),tt=l(_,(t=>P=t)),w=mt.getDerivedFromVars(mt.json.selectable),K(),K=l(w,(t=>O=t)),$=mt.getDerivedFromVars(mt.json.auto_ellipsize),pt(),pt=l($,(t=>q=t)),Nt=Z,$t=String(null!=Nt?Nt:""),xt=ae(G,xt);{const t=J;Yt(t)?(kt=Number(t)/xt,Et=!0):Et=!1}x=1===z;{let t,e="",r="",n=!1;if(z&&z>1){const o=Number(z);e=o*kt+"em",t=o,r=o,n=!0}else q&&1!==z&&(n=!0);Ct=e,wt=t,At=r,jt=n}Vt=de(H,U,Vt),Dt=pe(B,Dt),k=!S||$t&&1===S.length&&S[0]&&0===S[0].start&&"number"==typeof S[0].end&&S[0].end>=$t.length,E=Boolean(T)!==Boolean(S&&S[0]&&S[0].text_color);{let t="";z&&k&&E&&(t=gt(T||S&&S[0]&&S[0].text_color,1,St)),St=t}Ot=gt(M,1,Ot),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}Pt=t}return It=ve(O,It),function(t,e,r,n){let o=[];if(Tt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Tt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Mt=[]);const i=t;let a=e||[{start:0,end:i.length}],s=r||[],l=0,c=[],u=[];a.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),s.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.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)),u.forEach((t=>{var e,r;let a="image"===t.type?null:t.range,s=t.index;if(s>l){let a=Object.assign(Object.assign({},n),...c);o.push({text:i.substring(l,s),textStyles:a,actions:"rangeEnd"===t.type&&(null===(r=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===r?void 0:r.filter(Wt))||void 0})}if("rangeStart"===t.type&&a)c.push(a);else if("rangeEnd"===t.type)c=c.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},n),...c),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const a={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let s="";const l=t.image.tint_color,u=ge(t.image.tint_mode,"source_in");if(l){const e=gt(t.image.tint_color);s=_t.addSvgFilter(e,u),Tt.push([e,u])}o.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:a,svgFilterId:s,preloadRequired:Boolean(t.image.preload_required)}})}l=s})),l<i.length&&o.push({text:i.substring(l),textStyles:Object.assign({},n)}),Mt=o}($t,S,D,V),A={singleline:x,multiline:jt,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},j={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":At,color:St,"background-image":Pt,"--divkit-text-focus-color":Ot},Y(),X(),Q(),K(),tt(),et(),nt(),ot(),it(),st(),W(),ct(),pt(),vt(),ft(),ht(),`${R(oe,"Outer").$$render(t,{cls:Ft("text",lt,A)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${L("class",Ft("text__inner",lt,j),0)}${L("style",ut(F),0)}>${Mt.length?`${N(Mt,(e=>"text"in e?e.text?`${R(ue,"TextRangeView").$$render(t,{componentContext:mt,text:e.text,rootFontSize:xt,textStyles:e.textStyles,singleline:x,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)}${L("loading",e.image.preloadRequired?"eager":"lazy",0)} decoding="async" aria-hidden="true" alt=""${L("style",ut({width:e.image.width,height:e.image.height,"margin-top":Et?`-${e.image.height}`:void 0,"margin-bottom":Et?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${R(ue,"TextRangeView").$$render(t,{componentContext:mt,text:$t,rootFontSize:xt,textStyles:V,singleline:x},{},{})}`}</span>`})}`})),he=fe,me={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_overflow_visible:"divkit-f315a",container_orientation_vertical:"divkit-ddc33",container_valign_start:"divkit-a31f0",container_valign_center:"divkit-aae61",container_valign_end:"divkit-eac00","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_start:"divkit-efaf5",container_halign_center:"divkit-bac9d",container_halign_end:"divkit-ca36b","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 ye(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 be(t,e,r){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);null!=e&&e.show_at_start&&(r?t.top=e.style.height+o:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+o:t.right=e.style.width+n)}function _e(t,e,r){let n;const o=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),i=((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 n="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+o:0]:[null!=e&&e.show_between?e.style.height+i:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function we(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function $e(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function xe(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)n={width:Et(null===(i=(o=t.shape).item_width)||void 0===i?void 0:i.value,10),height:Et(null===(a=o.item_height)||void 0===a?void 0:a.value,10),radius:Et(null===(s=o.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*Et(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var o,i,a,s;return function(t,e,r){var n;const o={},i=e.stroke||(null==r?void 0:r.stroke),a=null!=i&&i.color?gt(i.color):"",s=null!=i&&i.width?Number(null!==(n=i.width)&&void 0!==n?n:1):"";o.width=t.width,o.height=t.height,o.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return o.background=gt(l),a&&s&&(o.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),o}(n,t.shape,{color:t.color,stroke:t.stroke})}let ke;function Ee(){if("undefined"==typeof document&&(ke=!0),void 0!==ke)return ke;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),ke=1===t.scrollHeight,document.body.removeChild(t),ke}const Ce="divkit-a7719",Ae="divkit-f6e9a";function je(t,e,r,n,o,i){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;i?t.push({top:r.bottom+l,left:o.left+a,width:Math.max(0,o.right-o.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:o.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,o.bottom-o.top-l-c),style:e.style})}function Fe(t,e,r,n,o,i){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"===o||"space-evenly"===o?(s=i.left-e.style.width,l=i.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),je(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,n)}if(null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)je(t,e,r[o],r[o+1],a,n);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===o||"space-evenly"===o?(l=i.bottom+e.style.height,c=i.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),je(t,e,s,{top:l,right:0,bottom:0,left:c},a,n)}}const Ve=W(((t,e,r,n)=>{let o,{orientation:i}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e,{direction:u}=e;const d=function(t,e){let r,n=0,o=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(o||(o=!0,setTimeout((()=>{o=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!o)return;const t=o.getBoundingClientRect(),e=window.getComputedStyle(o),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)};g=[];let n=[...o.children].filter((t=>t!==p&&!t.classList.contains(ct.outer__border))),d=[];for(;n.length;){const t=[],e=n.shift();t.push(e);let r=e.getBoundingClientRect(),o=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===i){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>o)break;a=Math.max(a,r.right),o=Math.min(o,r.left),s=Math.max(s,r.bottom),t.push(e),n.shift()}d.push(t)}const v=[];d.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)));"rtl"===u&&"horizontal"===i&&e.reverse(),a&&Fe(g,a,e,"vertical"===i,"vertical"===i?c:l,r);const n={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)))};v.push(n)})),"rtl"===u&&"vertical"===i&&v.reverse(),s&&Fe(g,s,v,"horizontal"===i,"vertical"===i?l:c,r),g.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let p,g=[],f=!1,h=null,m=null;return v((()=>{f=!1})),void 0===e.orientation&&r.orientation&&void 0!==i&&r.orientation(i),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),void 0===e.direction&&r.direction&&void 0!==u&&r.direction(u),o=null,(f&&o||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),f&&o&&("undefined"!=typeof MutationObserver&&(h=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(Ae))&&!(null==r?void 0:r.contains(Ce))}))&&d()})),h.observe(o,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(o)))),f&&o&&d(),` <div${L("class",Ce,0)}${L("this",p,0)}>${N(g,(t=>`<div${L("class","divkit-c770e",0)}${q({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${L("class",Ae,0)}${q({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>`})),De={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},Se={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Oe=["rounded_rectangle","circle"],Pe=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,z,B,U=i,W=i,L=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,tt=i;var et,rt,nt,ot,it,st,lt;let{componentContext:ct}=e,{layoutParams:ut}=e;const dt=f(at);let pt;O=l(dt.direction,(t=>S=t));let vt,gt="vertical",ft="start",ht="start",yt=null,bt=null,_t={},wt=[];void 0===e.componentContext&&r.componentContext&&void 0!==ct&&r.componentContext(ct),void 0===e.layoutParams&&r.layoutParams&&void 0!==ut&&r.layoutParams(ut),o=ct.origJson,o&&(gt="vertical",ft="start",ht="start",vt=void 0),a=ct.json.items,s=ct.getDerivedFromVars(null===(et=ct.json.item_builder)||void 0===et?void 0:et.data,void 0,!0),tt(),tt=l(s,(t=>B=t)),c=ct.getDerivedFromVars(ct.json.orientation),Q(),Q=l(c,(t=>z=t)),u=ct.getDerivedFromVars(ct.json.layout_mode),X(),X=l(u,(t=>T=t)),d=ct.getDerivedFromVars(ct.json.content_alignment_vertical),Z(),Z=l(d,(t=>I=t)),p=ct.getDerivedFromVars(ct.json.content_alignment_horizontal),G(),G=l(p,(t=>P=t)),v=ct.getDerivedFromVars(ct.json.separator),J(),J=l(v,(t=>D=t)),g=ct.getDerivedFromVars(ct.json.line_separator),q(),q=l(g,(t=>V=t)),h=ct.getDerivedFromVars(ct.json.aspect),H(),H=l(h,(t=>F=t)),m=ct.getDerivedFromVars(ct.json.width),W(),W=l(m,(t=>A=t)),y=ct.getDerivedFromVars(ct.json.height),L(),L=l(y,(t=>j=t)),b=ct.getDerivedFromVars(ct.json.clip_to_bounds),U(),U=l(b,(t=>C=t));{let t=[];if(ct.json.item_builder&&Array.isArray(B)&&Array.isArray(ct.json.item_builder.prototypes)){const e=ct.json.item_builder;t=[],B.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=dt.preparePrototypeVariables(e.data_element_name||"it",r);let o;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){o=r.div;break}if(ct.getJsonWithVars(r.selector,n)){o=r.div;break}}}o&&t.push({div:o,vars:n})}))}else t=(Array.isArray(a)&&a||[]).map((t=>({div:t})));wt=t.map(((t,e)=>ct.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];wt.forEach((e=>{t.push(ct.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),pt=K(t,(t=>[...t])),Y(),Y=l(pt,(t=>M=t))}if(gt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(z,gt),_="wrap"===T,w="horizontal"!==gt&&!_&&M.some(we),$="vertical"!==gt&&!_&&M.some($e),ft=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?"top"===t?"start":"bottom"===t?"end":t:e}(I,ft),ht=function(t,e,r){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}(P,S,ht),(null==D?void 0:D.style)&&"overlap"!==gt&&Ee()){const t=xe(D.style,Oe,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(rt=D.show_at_start)&&void 0!==rt&&rt),show_at_end:Boolean(null!==(nt=D.show_at_end)&&void 0!==nt&&nt),show_between:Boolean(null===(ot=D.show_between)||void 0===ot||ot),style:t,margins:ye(D.margins)}:null}else yt=null;if((null==V?void 0:V.style)&&"overlap"!==gt&&Ee()){const t=xe(V.style,Oe,(null==bt?void 0:bt.style)||null);bt=t?{show_at_start:Boolean(null!==(it=V.show_at_start)&&void 0!==it&&it),show_at_end:Boolean(null!==(st=V.show_at_end)&&void 0!==st&&st),show_between:Boolean(null===(lt=V.show_between)||void 0===lt||lt),style:t,margins:ye(V.margins)}:null}else bt=null;x=yt||bt?function(t,e,r){const n={};return be(n,e,"vertical"===t),be(n,r,"horizontal"===t),n}(gt,yt,bt):null;{const t=null==F?void 0:F.ratio;vt=t&&Yt(t)?t:void 0}{let t={};"overlap"===gt&&(t.overlapParent=!0),"horizontal"!==gt&&(t.parentHAlign=_?"start":De[ht]),"vertical"!==gt&&(t.parentVAlign=_?"start":Se[ft]),vt||$||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ut?void 0:ut.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!w&&("wrap_content"===(null==A?void 0:A.type)||"match_parent"===(null==A?void 0:A.type)&&(null==ut?void 0:ut.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===gt&&(t.parentContainerOrientation="horizontal"),"vertical"===gt&&(t.parentContainerOrientation="vertical"),_&&(t.parentContainerWrap=!0),_t=Tt(t,_t)}return k={orientation:gt,valign:ft,halign:ht,wrap:_,overflow:!1===C||0===C?"visible":void 0},E={gap:yt||bt?_e(gt,yt,bt):void 0,"aspect-ratio":vt},U(),W(),L(),H(),q(),J(),O(),G(),Z(),Y(),X(),Q(),tt(),`${R(oe,"Outer").$$render(t,{cls:Ft("container",me,k),componentContext:ct,layoutParams:ut,style:E,additionalPaddings:x,heightByAspect:Boolean(vt),parentOf:wt.map((t=>t.json)),replaceItems:function(t){ct=Object.assign(Object.assign({},ct),{json:Object.assign(Object.assign({},ct.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(wt,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e,layoutParams:_t},{},{})}`))} ${yt||bt?`${R(Ve,"ContainerSeparators").$$render(t,{direction:S,separator:yt,lineSeparator:bt,orientation:gt,contentHAlign:ht,contentVAlign:ft},{},{})}`:""}`})}`})),Ie=Pe,Me={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Te(t,e){return"vertical"===t||"horizontal"===t?t:e}const Ne=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g=i,{componentContext:f}=e,{layoutParams:h}=e,m="horizontal",y="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==f&&r.componentContext(f),void 0===e.layoutParams&&r.layoutParams&&void 0!==h&&r.layoutParams(h),o=f.origJson,o&&(m="horizontal",y="rgba(0,0,0,0.08)"),a=f.getDerivedFromVars(f.json.delimiter_style),g(),g=l(a,(t=>v=t)),m=Te(null==v?void 0:v.orientation,m),s=!((null==v?void 0:v.color)&&("transparent"===v.color||9===v.color.length&&0===v.color.indexOf("#00"))),y=gt(null==v?void 0:v.color,1,y),c="horizontal"===m?"100%":dt(1),u="horizontal"===m?dt(1):"100%",d={background:y,width:c,height:u},p={orientation:m},g(),`${R(oe,"Outer").$$render(t,{cls:Ft("separator",Me,p),componentContext:f,layoutParams:h},{},{default:()=>s?`<span${L("class",Me.separator__inner,0)}${L("style",ut(d),0)}></span>`:""})}`})),ze={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image_is-rtl-mirror":"divkit-ae78c","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Re(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ue=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,N,z,B,U,W,H,J,G,Z=i,Y=i,X=i,Q=i,K=i,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,dt=i,pt=i,{componentContext:vt}=e,{layoutParams:ft}=e;const ht=f(at);let mt;D=l(ht.direction,(t=>V=t));let yt,bt,_t=0,xt=!1,kt="rgba(0,0,0,0.08)",Ct=!1,At="",jt="none",Vt="50% 50%",Dt="0",St="source_in",Ot="",Pt="",It=0,Mt=0,Tt=0,zt="",Rt="",Bt=!1;v((()=>{ht.removeSvgFilter(bt,St)})),void 0===e.componentContext&&r.componentContext&&void 0!==vt&&r.componentContext(vt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ft&&r.layoutParams(ft),o=vt.origJson,o&&(jt="none",Vt="50% 50%",St="source_in"),a=vt.getDerivedFromVars(vt.json.image_url),ct(),ct=l(a,(t=>H=t)),s=vt.getDerivedFromVars(vt.json.gif_url),dt(),dt=l(s,(t=>J=t)),c=vt.getDerivedFromVars(vt.json.width),lt(),lt=l(c,(t=>W=t)),u=vt.getDerivedFromVars(vt.json.height),it(),it=l(u,(t=>U=t)),d=vt.getDerivedFromVars(vt.json.preview),ot(),ot=l(d,(t=>B=t)),p=vt.getDerivedFromVars(vt.json.placeholder_color),nt(),nt=l(p,(t=>z=t)),g=vt.getDerivedFromVars(vt.json.scale),rt(),rt=l(g,(t=>N=t)),h=vt.getDerivedFromVars({content_alignment_horizontal:vt.json.content_alignment_horizontal,content_alignment_vertical:vt.json.content_alignment_vertical}),et(),et=l(h,(t=>T=t)),m=vt.getDerivedFromVars(vt.json.accessibility),tt(),tt=l(m,(t=>M=t)),y=vt.getDerivedFromVars(vt.json.aspect),K(),K=l(y,(t=>I=t)),b=vt.getDerivedFromVars(vt.json.tint_color),Q(),Q=l(b,(t=>P=t)),_=vt.getDerivedFromVars(vt.json.tint_mode),X(),X=l(_,(t=>O=t)),w=vt.getDerivedFromVars(vt.json.appearance_animation),Y(),Y=l(w,(t=>S=t)),$=vt.getDerivedFromVars(vt.json.filters),Z(),Z=l($,(t=>F=t)),x=vt.getDerivedFromVars(vt.json.preload_required),pt(),pt=l(x,(t=>G=t));{let t="gif"===vt.json.type?J:H;xt="empty://"===t,xt&&(t=Be),yt=t}_t=0,yt?Ct=!1:(Ct=!0,vt.logError(st(new Error(`Missing "${"gif"===vt.json.type?"gif_url":"image_url"}" for "${vt.json.type}"`)))),k="wrap_content"===(null==W?void 0:W.type),E="wrap_content"===(null==U?void 0:U.type),At=B?`url("${Re(B)}")`:"",kt=gt(z,1,kt),jt=wt(N)||jt,Vt=function(t,e,r){let n=t.content_alignment_horizontal;const o=t.content_alignment_vertical;return"start"===n?n="ltr"===e?"left":"right":"end"===n&&(n="ltr"===e?"right":"left"),n&&"left"!==n&&"center"!==n&&"right"!==n||o&&"top"!==o&&"center"!==o&&"bottom"!==o?r:$t({content_alignment_horizontal:n,content_alignment_vertical:o})}(T,V,Vt),C=(null==M?void 0:M.description)||"";{const t=null==I?void 0:I.ratio;Dt=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=P?gt(P):void 0,e=ge(O,St);t===bt&&e===St||(ht.removeSvgFilter(bt,St),Ot=t?ht.addSvgFilter(t,e):"",bt=t,St=e)}if(S&&"fade"===S.type){const t=S;Pt=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Tt=Et(t.duration,300),Mt=Et(t.start_delay,0),It=Et(t.alpha,0)}{let t="",e="";Array.isArray(F)&&F.length&&(t=Xt(F,vt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),zt=t,Rt=e,Bt="rtl"===V&&Array.isArray(F)&&F.some((t=>"rtl_mirror"===t.type))}return A={aspect:"0"!==Dt,"is-width-content":k,"is-height-content":E,loaded:!1,"before-appearance":Boolean(Pt)&&!0,"is-rtl-mirror":Bt},j={"background-image":At,"background-color":At?void 0:kt,"background-size":jt,"clip-path":Rt||void 0,"object-fit":jt,"object-position":Vt,filter:["",zt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Pt||void 0,"--divkit-appearance-fade-start":Pt?It:void 0,"--divkit-appearance-delay":Pt?`${Mt}ms`:void 0,"--divkit-appearance-duration":Pt?`${Tt}ms`:void 0},Z(),D(),Y(),X(),Q(),K(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),dt(),pt(),Ct?"":`${R(oe,"Outer").$$render(t,{cls:Ft("image",ze,A),componentContext:vt,layoutParams:ft,customDescription:!0},{},{default:()=>A.aspect?`<span${L("class",ze["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Dt}%`})}><img${L("class",ze.image__image,0)}${L("src",yt,0)}${L("loading",G?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",C,0)}${L("aria-hidden",C?null:"true",0)}${L("this",mt,0)}></span>`:`<img${L("class",ze.image__image,0)}${L("src",yt,0)}${L("loading",G?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",C,0)}${L("aria-hidden",C?null:"true",0)}${L("this",mt,0)}>`})}`})),We={grid:"divkit-d9080",grid_halign_start:"divkit-fc24d",grid_halign_center:"divkit-a14a6",grid_halign_end:"divkit-cfd04",grid_valign_start:"divkit-c3106",grid_valign_center:"divkit-d4310",grid_valign_end:"divkit-fa9cf"};function Le(t){return t>0&&t<1}function He(t){return String(Math.ceil(1e3*t)/1e3)}function qe(t,e,r){if(t.some(Le)){const e=Math.max(...t.filter(Le).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,o=0;const i=[];if(t.every(Boolean)){o=t.reduce(((t,e)=>t+e),0);for(let i=0;i<r;++i){if(!e[i])continue;const r=e[i]/t[i]*o;r>n&&(n=r)}}for(let e=0;e<r;++e)n?i[e]=`minmax(${dt(n*t[e]/o)},${He(t[e])}fr)`:t[e]?i[e]=`${He(t[e])}fr`:i[e]="auto";return i.join(" ")}const Je=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,{componentContext:C}=e,{layoutParams:A}=e;m=l(f(at).direction,(t=>h=t));let j,F,V=1,D=[],S=[],O=[],P=[],I=0,M=!1,T="start",z="start";void 0===e.componentContext&&r.componentContext&&void 0!==C&&r.componentContext(C),void 0===e.layoutParams&&r.layoutParams&&void 0!==A&&r.layoutParams(A),o=C.origJson,o&&(V=1,T="start",z="start"),a=Array.isArray(C.json.items)&&C.json.items||[],s=C.getDerivedFromVars(C.json.column_count),E(),E=l(s,(t=>w=t)),c=C.getDerivedFromVars(C.json.content_alignment_vertical),x(),x=l(c,(t=>b=t)),u=C.getDerivedFromVars(C.json.content_alignment_horizontal),$(),$=l(u,(t=>y=t)),V=ae(w,V),d=a.map(((t,e)=>C.produceChildContext(t,{path:e})));{let t=[];d.forEach((e=>{t.push(C.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),k(),k=l(j,(t=>_=t))}{const t={};let e=0,r=0;D=[],S=[],O=[],P=[],M=!1,F=d.map(((n,o)=>{var i,a,s,l;const c=_[o],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(i=c.width)||void 0===i?void 0:i.type)?Number(c.width.weight||1)/u:0,g="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 n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?(M=!0,C.logError(st(new Error(`No space for item at index ${o}`)))):(t[n+"_"+e]=!0,(!D[n]||D[n]<v)&&(D[n]=v),(!S[e]||S[e]<g)&&(S[e]=g),(!O[n]||O[n]<f)&&(O[n]=f),(!P[e]||P[e]<h)&&(P[e]=h));do{++e,e>=V&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),I=r}return T=pe(b,T),z=de(y,h,z),p={valign:T,halign:z},v={"grid-template-columns":qe(D,O,V),"grid-template-rows":qe(S,P,I)},g=M,m(),$(),x(),k(),E(),g?"":`${R(oe,"Outer").$$render(t,{cls:Ft("grid",We,p),componentContext:C,style:v,layoutParams:A,parentOf:d.map((t=>t.json)),replaceItems:function(t){C=Object.assign(Object.assign({},C),{json:Object.assign(Object.assign({},C.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(F,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),Ge=Je,Ze={gallery:"divkit-cbb0f",gallery__scroller:"divkit-a4e39",gallery_scrollbar_none:"divkit-f49e7",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon-path":"divkit-b4173"},Ye="divkit-bf36b",Xe="divkit-a67bf",Qe="divkit-e2a31",Ke="divkit-c684b";function tr(t){const e=[];let r=t[0],n=1;for(let o=1;o<=t.length;o++)t[o]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[o],n=1):n++;return e.join(" ")}function er(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}function rr(t,e){let r=t%e;return r<0&&(r+=e),r}const nr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U,W,H,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,tt=i,et=i,rt=i,nt=i,{componentContext:it}=e,{layoutParams:st}=e;const lt=f(at);let ct;j=l(lt.direction,(t=>A=t));let pt,vt=[],gt=!1,ft=!1,ht=null,yt=!1;const bt=lt.getCustomization("galleryLeftClass"),_t=lt.getCustomization("galleryRightClass");let wt,$t,xt,kt,Ct,At=1,jt="horizontal",Vt="start",Dt=8,St="",Ot=[],It={},Mt=!1,Nt={},zt=0;W=l(lt.isDesktop,(t=>U=t));const Rt=er((function(){if(!ct)return;let t=ct.scrollLeft;"rtl"===A&&(t*=-1);const e=ct.scrollWidth,r=ct.offsetWidth;"ltr"===A?(gt=t>2,ft=t+r<e-2):(ft=t>2,gt=t+r<e-2)}),50);function Bt(){let t=[],e=vt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<At;++e){const n=vt[e].children[r];n&&t.push(n)}return t}function Ut(t,e="smooth"){const r="horizontal"===jt?"left":"top";ct.scroll({[r]:t,behavior:e})}function Wt(t,e,r="smooth"){const n="horizontal"===jt,o=n?"offsetLeft":"offsetTop",i=t[e];if(i){let t;if("ltr"!==A&&n){const e=ct.offsetWidth;t=i[o]+i.offsetWidth+.01-Dt/2-e}else t=i[o]+.01-Dt/2;Ut(t,r)}}function Lt(t){const e=Bt(),r=ct.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===jt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const o=e.map((t=>function(t,e){return"horizontal"===jt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),i=o.findIndex(Boolean);return-1!==i?"prev"===t&&2===o.filter(Boolean).length?i+1:i:"prev"===t?1:e.length-2}v((()=>{yt=!1,wt&&!it.fakeElement&&(lt.unregisterInstance(wt),wt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==it&&r.componentContext(it),void 0===e.layoutParams&&r.layoutParams&&void 0!==st&&r.layoutParams(st),o=it.origJson,o&&(At=1,jt="horizontal",Vt="start",Dt=8,St=""),a=Array.isArray(it.json.items)&&it.json.items||[],s=it.getDerivedFromVars(it.json.column_count),rt(),rt=l(s,(t=>B=t)),c=it.getDerivedFromVars(it.json.orientation),et(),et=l(c,(t=>z=t)),u=it.getDerivedFromVars(it.json.cross_content_alignment),tt(),tt=l(u,(t=>T=t)),d=it.getDerivedFromVars(it.json.item_spacing),Q(),Q=l(d,(t=>M=t)),p=it.getDerivedFromVars(it.json.cross_spacing),X(),X=l(p,(t=>P=t)),g=it.getDerivedFromVars(it.json.paddings),Y(),Y=l(g,(t=>O=t)),h=it.getDerivedFromVars(it.json.scroll_mode),G(),G=l(h,(t=>D=t)),m=it.getDerivedFromVars(it.json.restrict_parent_scroll),nt(),nt=l(m,(t=>H=t)),y=it.getDerivedFromVars(it.json.scrollbar),J(),J=l(y,(t=>V=t)),b=it.getDerivedFromVars(it.json.default_item),q(),q=l(b,(t=>F=t)),_=a.map(((t,e)=>it.produceChildContext(t,{path:e}))),w=U&&yt,w?"undefined"!=typeof ResizeObserver&&(ht=new ResizeObserver((()=>{Rt()})),ht.observe(pt)):ht&&(ht.disconnect(),ht=null),At=ae(B,At),$=function(t,e){let r=0,n=[];for(let o=0;o<t.length;++o)n[r]||(n[r]=[]),n[r].push(t[o]),++r>=e&&(r=0);return n}(_,At),jt=Te(z,jt),Vt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(T,Vt),Dt=Et(M,Dt),$t=dt(Dt),kt=Et(P,Dt),xt=dt(kt),St=Pt(O,A,St),x="horizontal"===jt?"grid-template-columns":"grid-template-rows";{let t=[];_.forEach((e=>{const r="horizontal"===jt?"width":"height";t.push(it.getDerivedFromVars(e.json[r]))})),Ct=K(t,(t=>t)),Z(),Z=l(Ct,(t=>S=t))}Ot=[],At>1?Ot.push("auto"):S.forEach((t=>{!t&&"horizontal"===jt||"match_parent"===(null==t?void 0:t.type)?Ot.push("100%"):Ot.push("max-content")}));{const t={};let e={};Mt=!1,"horizontal"===jt?e.parentVAlign=Vt:e.parentHAlign=Vt,"paging"===D&&(Mt=!0,e.scrollSnap="start",t["horizontal"===jt?"scroll-padding-left":"scroll-padding-top"]=dt(Dt/2)),1===At&&(e.parentLayoutOrientation=jt),It=Tt(t,It),Nt=Tt(e,Nt)}return k={padding:St,"grid-gap":xt},E={"grid-gap":$t,[x]:tr(Ot)},C={orientation:jt,"scroll-snap":Mt,scrollbar:"auto"===V?"auto":"none"},zt=Et(F,zt),it.json&&Rt(),it.json&&(wt&&(lt.unregisterInstance(wt),wt=void 0),it.json.id&&!it.fakeElement&&(wt=it.json.id,lt.registerInstance(wt,{setCurrentItem(t){const e=Bt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Wt(e,t)},setPreviousItem(t,e){const r=Lt("prev"),n=Bt();let o=r-t;o<0&&(o="ring"===e?rr(o,n.length):0),Wt(n,o)},setNextItem(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft*n+ct.offsetWidth===ct.scrollWidth:ct.scrollTop+ct.offsetHeight===ct.scrollHeight,i=Bt();if(o&&"ring"===e)return void Wt(i,0);let a=Lt("next")+t;a>i.length-1&&(a="ring"===e?rr(a,i.length):i.length-1),Wt(i,a)},scrollToStart(){Ut(0)},scrollToEnd(){Ut("ltr"===A||"horizontal"!==jt?1e6:-1e6)},scrollBackward(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n-t;a<0&&("clamp"===e?a=0:"ring"===e&&(a=rr(a,i))),Ut(a*n)},scrollForward(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n+t;a>i&&("clamp"===e?a=i:"ring"===e&&(a=rr(a,i))),Ut(a*n)},scrollToPosition(t){Ut("ltr"===A||"horizontal"!==jt?t:-t)}}))),j(),q(),J(),G(),Z(),Y(),X(),Q(),tt(),et(),rt(),W(),nt(),` ${R(oe,"Outer").$$render(t,{cls:Ft("gallery",Ze,C),componentContext:it,layoutParams:st,customPaddings:!0,customActions:"gallery",parentOf:a,replaceItems:function(t){it=Object.assign(Object.assign({},it),{json:Object.assign(Object.assign({},it.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ze.gallery__scroller,!0)+" "+I(H?ot:"",!0)}"${L("style",ut(It),0)}${L("this",ct,0)}><div${L("class",Ze["gallery__items-grid"],0)}${L("style",ut(k),0)}${L("this",pt,0)}>${N($,((e,r)=>`<div${L("class",Ze.gallery__items,0)}${L("style",ut(E),0)}${L("this",vt[r],0)}>${N(e,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e,layoutParams:Nt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===jt?`${gt&&w?` <div${L("class",bt||`${Ze.gallery__arrow} ${Ye} ${Qe}`,0)}>${bt?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ze["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>`:""} ${ft&&w?` <div${L("class",_t||`${Ze.gallery__arrow} ${Ye} ${Ke}`,0)}>${_t?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ze["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>`:""}`:""}`})}`})),or=nr,ir={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_height-parent_yes":"divkit-ae594",tabs__separator:"divkit-b85bf"},ar=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U=i,W=i,H=i,J=i,G=i,Z=i,Y=i,X=i,K=i;var tt,et;let{componentContext:rt}=e,{layoutParams:nt}=e;const it=f(at);S=l(it.direction,(t=>D=t));const lt=it.genId("tabs");let ct,vt=!1,ft=Q([]);j=l(ft,(t=>A=t));let ht,mt,yt,bt,_t,wt,$t,xt={},kt={},Ct=12,At="",jt="",Vt="",St="",It="",Mt="",Nt="",zt="",Rt="",Lt="",Ht=0,qt="",Jt="",Zt=null,Xt=!1,Qt=!1,Kt=[],te=[],ee=null;async function re(t,e=!1){if(wt=w,w=t,Xt||(Xt=!0,mt.style.height=dt(mt.clientHeight),yt.style.transform=`translate3d(${100*-(null!=wt?wt:w)}%,0,0)`),Qt=!0,async function(t){await $(),yt.style.transform=`translate3d(${t}%,0,0)`}(100*-w),function(t=!1){const e=t?Math.max(0,w-1):Math.min(w,null!=wt?wt:w),r=t?Math.min(a.length-1,w+1):Math.max(w,null!=wt?wt:w);Kt=Kt.map(((t,n)=>{var o;return t||(n>=e&&n<=r&&(null===(o=a[n])||void 0===o?void 0:o.div)?rt.produceChildContext(a[n].div,{path:n}):void 0)})),te=te.map(((t,n)=>n>=e&&n<=r))}(),async function(){if("match_parent"===(null==C?void 0:C.type))return;await $();const t=document.getElementById(`${lt}-panel-${w}`);t&&(mt.style.height=dt(t.offsetHeight))}(),ee&&clearTimeout(ee),ee=window.setTimeout((()=>{te=a.map(((t,e)=>e===w))}),400),$t=-w*mt.clientWidth,e){await $();const t=ht.querySelector(`.${ir.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{ct&&(it.unregisterInstance(ct),ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==rt&&r.componentContext(rt),void 0===e.layoutParams&&r.layoutParams&&void 0!==nt&&r.layoutParams(nt),o=rt.origJson,o&&(Ct=12,At="",St="",bt=void 0,It="",_t=void 0,Mt="",Nt="",zt="",Rt="",Lt="",Ht=0,qt="",Jt="",Zt=null),a=Array.isArray(rt.json.items)&&rt.json.items||[],s=a.map((t=>t.div)),c=rt.getDerivedFromVars(rt.json.width),X(),X=l(c,(t=>z=t)),u=rt.getDerivedFromVars(rt.json.height),U(),U=l(u,(t=>C=t)),d=rt.getJsonWithVars(rt.json.selected_tab),p=rt.getDerivedFromVars(rt.json.tab_title_style),Y(),Y=l(p,(t=>T=t)),g=rt.getDerivedFromVars(rt.json.has_separator),Z(),Z=l(g,(t=>M=t)),h=rt.getDerivedFromVars(rt.json.separator_color),G(),G=l(h,(t=>P=t)),m=rt.getDerivedFromVars(rt.json.separator_paddings),J(),J=l(m,(t=>O=t)),y=rt.getDerivedFromVars(rt.json.switch_tabs_by_content_swipe_enabled),H(),H=l(y,(t=>V=t)),b=rt.getDerivedFromVars(rt.json.restrict_parent_scroll),K(),K=l(b,(t=>B=t)),_=rt.getDerivedFromVars(rt.json.title_paddings),W(),W=l(_,(t=>F=t)),w=d&&Number(d)||0,Array.isArray(a)&&a.length){let t=[];a.forEach(((e,r)=>{const n=rt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):rt.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),ft.set(t)}else ft.set([]);(null==A?void 0:A.length)?vt=!1:(vt=!0,rt.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={parentContainerOrientation:"horizontal"};"wrap_content"===(null==z?void 0:z.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),xt=Tt(t,xt)}if(!vt&&(w<0||w>=a.length)&&(rt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:rt.json.selected_tab,length:a.length}})),w=w<0?0:a.length-1),vt||A.some((t=>w===t.index))||(rt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:rt.json.selected_tab}})),w=(null===(tt=A[0])||void 0===tt?void 0:tt.index)||0),x=T||{},Ct=ae(x.font_size,Ct),x.font_size||x.paddings){const t=x.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/Ct*10,right:(Number("ltr"===D?t.end:t.start)||Number(t.right)||0)/Ct*10,bottom:(Number(t.bottom)||0)/Ct*10,left:(Number("ltr"===D?t.start:t.end)||Number(t.left)||0)/Ct*10};At=Pt(e,D,At)}{const t=x.line_height;void 0!==t&&Yt(t)&&(jt=dt(t/Ct*10))}{const t=x.letter_spacing;void 0!==t&&Ot(t)&&(Vt=dt(t/Ct*10))}if(x.corner_radius||x.corners_radius||x.font_size){const t=null!==(et=x.corner_radius)&&void 0!==et?et:1e3;x.corners_radius?St=function(t,e,r,n){const o=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<o.length;++t)if(o[t]&&!Ot(o[t]))return n;return Ut(t,e,r)}(x.corners_radius,t,Ct,St):Ot(t)&&(St=dt(t/Ct*10))}return bt=le(x.active_font_weight||x.font_weight,bt),It=x.font_family&&"string"==typeof x.font_family?it.typefaceProvider(x.font_family,{fontWeight:bt||400}):"",_t=le(x.inactive_font_weight||x.font_weight,_t),Mt=x.font_family&&"string"==typeof x.font_family?it.typefaceProvider(x.font_family,{fontWeight:_t||400}):"",Nt=gt(x.active_text_color,1,Nt),zt=gt(x.inactive_text_color,1,zt),Rt=gt(x.active_background_color,1,Rt),Lt=gt(x.inactive_background_color,1,Lt),Ht=Et(x.item_spacing,Ht),M&&(P&&(qt=gt(P,1,qt)),O&&(Jt=Pt(O,D,Jt))),k={background:qt,margin:Jt},E=void 0===V||Boolean(V),Zt=Bt(F||void 0,Zt),function(t){vt||(Kt=t.map(((t,e)=>{if(e===w&&(null==t?void 0:t.div))return rt.produceChildContext(t.div,{path:e})})),te=t.map(((t,e)=>e===w)))}(a),rt.json&&(ct&&(it.unregisterInstance(ct),ct=void 0),!rt.json.id||vt||rt.fakeElement||(ct=rt.json.id,it.registerInstance(ct,{setCurrentItem(t){if(t<0||t>a.length-1)throw new Error('Item is out of range in "set-current-item" action');re(t)},setPreviousItem(t,e){let r=w-t;r<0&&(r="ring"===e?rr(r,a.length):0),re(r)},setNextItem(t,e){let r=w+t;r>a.length-1&&(r="ring"===e?rr(r,a.length):a.length-1),re(r)},scrollToStart(){re(0)},scrollToEnd(){re(a.length-1)}}))),kt={"height-parent":"match_parent"===(null==C?void 0:C.type)?"yes":""},U(),j(),W(),H(),S(),J(),G(),Z(),Y(),X(),K(),vt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("tabs",ir,kt),componentContext:rt,layoutParams:nt,customActions:"tabs",parentOf:s,parentOfSimpleMode:!0,replaceItems:function(t){rt.json.items&&(rt=Object.assign(Object.assign({},rt),{json:Object.assign(Object.assign({},rt.json),{items:rt.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(ir.tabs__list,!0)+" "+I(B?ot:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":Zt?Dt(Zt,D):"","--divkit-tabs-font-size":dt(Ct),"--divkit-tabs-paddings":At,"--divkit-tabs-line-height":jt,"--divkit-tabs-letter-spacing":Vt,"--divkit-tabs-active-font-weight":bt||"","--divkit-tabs-inactive-font-weight":_t||"","--divkit-tabs-active-font-family":It||"","--divkit-tabs-inactive-font-family":Mt||"","--divkit-tabs-active-text-color":Nt,"--divkit-tabs-inactive-text-color":zt,"--divkit-tabs-active-background-color":Rt,"--divkit-tabs-inactive-background-color":Lt,"--divkit-tabs-border-radius":St,"--divkit-tabs-items-spacing":Ht?pt(10*Ht/Ct):""})}${L("this",ht,0)}>${N(A,(e=>{let r=e.index,n=r===w;return` ${R(Gt,"Actionable").$$render(t,{componentContext:rt,cls:Ft("tabs__item",ir,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!rt.fakeElement?[e.title_click_action].filter(Wt):[],attrs:{id:`${lt}-tab-${r}`,"aria-controls":`${lt}-panel-${r}`,role:"tab",tabindex:n&&!rt.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:rt.fakeElement?null:t=>function(t,e){return w===e||(re(e),!1)}(0,r)},{},{default:()=>`${I(e.title)}`})}`}))}</div> ${M?`<div${L("class",ir.tabs__separator,0)}${L("style",ut(k),0)}></div>`:""} <div class="${I(ir.tabs__panels,!0)+" "+I(B?ot:"",!0)}"${L("this",mt,0)}><div${L("class",Ft("tabs__swiper",ir,{inited:Xt,animated:Qt}),0)}${L("this",yt,0)}>${N(A,(e=>{let r=e.index,n=Kt[r];return` <div${L("class",Ft("tabs__panel",ir,{visible:te[r]}),0)} role="tabpanel" id="${I(lt,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(lt,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${n?`${R(_n,"Unknown").$$render(t,{componentContext:n,layoutParams:xt},{},{})}`:""} </div>`}))}</div></div>`})}`})),sr=ar,lr="divkit-eb860",cr="divkit-e08c6";function ur(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),o=r-n;return t[n]*o+t[n+1]*(1-o)}}ur([.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]),ur([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 dr=W(((t,e,r,n)=>{let o,i,a,s,l,c,u,{componentContext:d}=e,{layoutParams:p}=e;const h=f(at),m=f(Vt);let y,b,_,w,x=!1,k=new Map,E=new Set,C=null,A=[],j=[],F=[],V=[],D=!1;function S(t){w=(null==t?void 0:t.div)?d.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}async function O(t){if(_===t)return;h.setRunning("stateChange",!0);new Set(E);A.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),A=[];V.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),j=[],F=[],V=[];const e=c.find((e=>e.state_id===t))||null;return e?(_=t,null==s||s.setValue(_),S(e)):d.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),void await $()}return g(Vt,{registerInstance(t,e){C||(C=new Map),C.has(t)?d.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):C.set(t,e)},unregisterInstance(t){null==C||C.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return j.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const o=t.id;if(!o)return Promise.resolve();const i={id:o,json:t,parentComponentContext:e,transitions:r,node:n};return V.push(i),new Promise((t=>{i.resolvePromise=t}))},hasTransitionChange:t=>!!t&&k.has(t),registerChild(t){E.add(t)},unregisterChild(t){E.delete(t)}}),v((()=>{b&&m.unregisterInstance(b)})),void 0===e.componentContext&&r.componentContext&&void 0!==d&&r.componentContext(d),void 0===e.layoutParams&&r.layoutParams&&void 0!==p&&r.layoutParams(p),o=d.json.div_id||d.json.id,i=d.getJsonWithVars(d.json.default_state_id),a=d.json.state_id_variable,s=a?d.getVariable(a,"string"):null,l=d.origJson,l&&(D=!1),o?x=!1:(x=!0,d.logError(st(new Error('Missing "id" prop for div "state"')))),d.json&&(E=new Set),c=Array.isArray(d.json.states)&&d.json.states||[],u=c.map((t=>t.div)),(null==c?void 0:c.length)?x=!1:(x=!0,d.logError(st(new Error('Empty "states" prop for div "state"')))),d.json&&(b&&(m.unregisterInstance(b),b=void 0),o&&!(null==d?void 0:d.fakeElement)&&(b=o,m.registerInstance(o,{setState:O,getChild:function(t){if(C&&C.has(t))return C.get(t);d.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!D&&function(t){if(!D&&(D=!0,t.length)){const e=(null==s?void 0:s.getValue())||i;if(e){_=e;const r=t.find((t=>t.state_id===_))||null;S(r),r||d.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:_}}))}else{const e=t[0];_=e.state_id,S(e)}s&&(s.setValue(_),s.subscribe((t=>{O(t)})))}}(c),x?"":`${R(oe,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:d,layoutParams:p,parentOf:u,parentOfSimpleMode:!0,replaceItems:function(t){const e=d.json.states;e&&(c=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]}))),d.json=Object.assign(Object.assign({},d.json),{states:c}),_&&S(c.find((t=>t.state_id===_))||null))}},{},{default:()=>`${w?`${R(_n,"Unknown").$$render(t,{componentContext:w},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",y,0)}>${N(A,(e=>"direction"in e?`<div${L("class",lr,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",cr,0)}>${R(_n,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${L("class",lr,0)}><div${L("class",cr,0)}>${R(_n,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})}`})),pr=dr,vr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f",pager__arrow:"divkit-d78c2","pager__arrow-icon-path":"divkit-a94d9"},gr=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P=i,M=i,T=i,z=i,B=i,U=i;var W,H,q,J,G,Z,Y,X,Q,K;let{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);C=l(rt.direction,(t=>E=t));const nt=rt.genId("pager"),it=rt.getCustomization("pagerLeftClass"),lt=rt.getCustomization("pagerRightClass");j=l(rt.isDesktop,(t=>A=t)),er((function(){if(!gt)return;const t=function(){const t=Array.from(vt.children),e=vt.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===bt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:ft}();t!==ft&&(ft=t)}),50);let ct,vt,gt=!1,ft=0,ht=0,yt=!1,bt="horizontal",_t="",wt="",$t="";function xt(t,e="smooth"){const r="horizontal"===bt,n=vt.children[t],o=r?"offsetLeft":"offsetTop",i=r?"left":"top";vt.scroll({[i]:n[o],behavior:e}),ft=t}v((()=>{gt=!1,ct&&(rt.unregisterInstance(ct),ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==tt&&r.componentContext(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),o=tt.origJson,o&&(wt=""),a=tt.getDerivedFromVars(tt.json.layout_mode),M(),M=l(a,(t=>F=t)),s=tt.getDerivedFromVars(tt.json.orientation),B(),B=l(s,(t=>S=t)),u=tt.getDerivedFromVars(tt.json.item_spacing),z(),z=l(u,(t=>D=t)),d=tt.getDerivedFromVars(tt.json.paddings),T(),T=l(d,(t=>V=t)),p=tt.getDerivedFromVars(tt.json.restrict_parent_scroll),U(),U=l(p,(t=>O=t)),g=(Array.isArray(tt.json.items)&&tt.json.items||[]).map(((t,e)=>tt.produceChildContext(t,{path:e}))),F?"percentage"!==F.type&&"fixed"!==F.type?(yt=!0,tt.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):yt=!1:(yt=!0,tt.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),bt=Te(S,bt);{const t=null==D?void 0:D.value;t&&Ot(t)&&(_t=dt(t||0))}if(wt=Pt(V,E,wt),h="horizontal"===bt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==F?void 0:F.type)){const t=pt("horizontal"===bt?(("ltr"===E?null===(W=tt.json.paddings)||void 0===W?void 0:W.start:null===(H=tt.json.paddings)||void 0===H?void 0:H.end)||(null===(q=tt.json.paddings)||void 0===q?void 0:q.left)||0)+(("ltr"===E?null===(J=tt.json.paddings)||void 0===J?void 0:J.end:null===(G=tt.json.paddings)||void 0===G?void 0:G.start)||(null===(Z=tt.json.paddings)||void 0===Z?void 0:Z.right)||0):((null===(Y=tt.json.paddings)||void 0===Y?void 0:Y.top)||0)+((null===(X=tt.json.paddings)||void 0===X?void 0:X.bottom)||0)),e=null===(Q=F.neighbour_page_width)||void 0===Q?void 0:Q.value;$t=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${_t})`:"100%"}else if("percentage"===(null==F?void 0:F.type)){const t=null===(K=F.page_width)||void 0===K?void 0:K.value;$t=`${Number(t)}%`}return m={"grid-gap":_t,padding:wt,[h]:$t},y={orientation:bt},b=yt,_=A&&gt&&!b,w="ltr"===E?ft>0:ft+1<g.length,$="ltr"===E?ft+1<g.length:ft>0,x=rt.getStore("pagers"),P(),P=l(x,(t=>k=t)),function(t,e){const r=tt.json.id;if(r){const n=new Map(k);c(x,k=n.set(r,{instId:nt,size:t,currentItem:e,scrollToPagerItem:xt}),k)}}(g.length,ft),function(t){var e;if(t===ht)return;ht=t;const r=tt.getJsonWithVars(null===(e=g[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&tt.execAnyActions(r)}(ft),tt.json&&(ct&&(rt.unregisterInstance(ct),ct=void 0),tt.json.id&&!tt.fakeElement&&(ct=tt.json.id,rt.registerInstance(ct,{setCurrentItem(t){if(t<0||t>g.length-1)throw new Error('Item is out of range in "set-current-item" action');xt(t)},setPreviousItem:function(t,e){let r=ft-t;r<0&&(r="ring"===e?rr(r,g.length):0),xt(r)},setNextItem:function(t,e){let r=ft+t;r>g.length-1&&(r="ring"===e?rr(r,g.length):g.length-1),xt(r)},scrollToStart(){xt(0)},scrollToEnd(){xt(g.length-1)}}))),P(),C(),j(),M(),T(),z(),B(),U(),b?"":`${R(oe,"Outer").$$render(t,{cls:Ft("pager",vr,y),componentContext:tt,layoutParams:et,customPaddings:!0,parentOf:g.map((t=>t.json)),replaceItems:function(t){tt=Object.assign(Object.assign({},tt),{json:Object.assign(Object.assign({},tt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(vr.pager__items,!0)+" "+I(O?ot:"",!0)}"${L("style",ut(m),0)}${L("this",vt,0)}>${N(g,(e=>`<div${L("class",vr.pager__item,0)}>${R(_n,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${w&&_?` <div${L("class",it||`${vr.pager__arrow} ${Ye} ${Qe}`,0)}>${it?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",vr["pager__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>`:""} ${$&&_?` <div${L("class",lt||`${vr.pager__arrow} ${Ye} ${Ke}`,0)}>${lt?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",vr["pager__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>`:""}`})}`})),fr=gr,hr={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_direction_ltr:"divkit-a7473",indicator_direction_rtl:"divkit-a7d63",indicator_placement_stretch:"divkit-b6bd3"},mr=["rounded_rectangle","circle"],yr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V=i,D=i,S=i,O=i,P=i,M=i,T=i,z=i,B=i;var U,W;let{componentContext:H}=e,{layoutParams:J}=e;const G=f(at);b=l(G.direction,(t=>y=t));let Z,Y,X,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,nt=10,ot=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==H&&r.componentContext(H),void 0===e.layoutParams&&r.layoutParams&&void 0!==J&&r.layoutParams(J),o=H.origJson,o&&(et="default",rt=15,nt=10,ot=5,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"}),a=H.getDerivedFromVars(H.json.shape),M(),M=l(a,(t=>C=t)),s=H.getDerivedFromVars(H.json.active_item_color),O(),O=l(s,(t=>k=t)),c=H.getDerivedFromVars(H.json.inactive_item_color),P(),P=l(c,(t=>E=t)),u=H.getDerivedFromVars(H.json.active_item_size),T(),T=l(u,(t=>A=t)),d=H.getDerivedFromVars(H.json.active_shape),B(),B=l(d,(t=>F=t)),p=H.getDerivedFromVars(H.json.inactive_shape),z(),z=l(p,(t=>j=t)),v=H.getDerivedFromVars(H.json.space_between_centers),D(),D=l(v,(t=>w=t)),g=H.getDerivedFromVars(H.json.items_placement),S(),S=l(g,(t=>x=t)),F&&(Q=xe({type:"shape_drawable",shape:F},mr,Q)),j&&(K=xe({type:"shape_drawable",shape:j},mr,K)),!F&&!j&&C){const t=ae(A,1.3);K=xe({type:"shape_drawable",shape:C,color:K.background},mr,K),K.background=gt(E,1,K.background),Q=Object.assign(Object.assign({},K),{width:K.width*t,height:K.height*t,borderRadius:K.borderRadius*t,background:Q.background}),Q.background=gt(k,1,Q.background)}if(!x||"default"!==x.type&&"stretch"!==x.type)et="default",w&&(rt=Et(w.value,rt));else if(et=x.type,"default"===et)rt=Et(null===(U=x.space_between_centers)||void 0===U?void 0:U.value,rt);else if("stretch"===et){const t=x;nt=ae(t.max_visible_items,nt),ot=Et(null===(W=t.item_spacing)||void 0===W?void 0:W.value,ot)}return h=G.getStore("pagers"),V(),V=l(h,(t=>_=t)),async function(t){if(H.json.pager_id&&t.has(H.json.pager_id)&&(X=t.get(H.json.pager_id),await $(),Y)){const t=Y.children[X.currentItem];if(t){const e=t.offsetLeft;Z.scroll({left:e-Z.clientWidth/2,behavior:"smooth"})}}}(_),m={placement:et,direction:y},b(),V(),D(),S(),O(),P(),M(),T(),z(),B(),`${R(oe,"Outer").$$render(t,{cls:Ft("indicator",hr,m),componentContext:H,layoutParams:J},{},{default:()=>`<div${L("class",hr.indicator__scroller,0)}${L("this",Z,0)}><div${L("class",hr.indicator__items,0)} role="tablist"${q({margin:"default"===et?`0 ${dt(Math.max(0,Q.width-K.width)/2)}`:"","--divkit-indicator-inactive-width":dt(K.width),"--divkit-indicator-inactive-height":dt(K.height),"--divkit-indicator-inactive-border-radius":dt(K.borderRadius),"--divkit-indicator-inactive-background":K.background||"","--divkit-indicator-inactive-box-shadow":K.boxShadow||"","--divkit-indicator-active-width":dt(Q.width),"--divkit-indicator-active-height":dt(Q.height),"--divkit-indicator-active-border-radius":dt(Q.borderRadius),"--divkit-indicator-active-background":Q.background||"","--divkit-indicator-active-box-shadow":Q.boxShadow||"","--divkit-indicator-active-scale":Q.width/K.width,"--divkit-indicator-default-margin":"default"===et?`0 ${dt((rt-K.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?dt(ot):"","--divkit-indicator-stretch-max-count":"stretch"===et?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?dt((nt-1)*ot):""})}${L("this",Y,0)}>${X?`${N(Array(X.size),((t,e)=>{let r=e===X.currentItem;return` <div class="${I(Ft("indicator__item",hr,{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>`})}`})),br=yr,_r={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider_direction_rtl:"divkit-fb7b5",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 wr(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&gt(t.text_color)||"#000",o=se(t.font_weight);if(Yt(t.font_size)&&"transparent"!==n){var i,a;const e={fontSize:dt(t.font_size),fontWeight:o,textColor:n};return"number"==typeof(null==r||null===(i=r.x)||void 0===i?void 0:i.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 $r(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const xr="function"==typeof BigInt;function kr(t){return xr?BigInt(t):Number(t)}const Er=kr("9223372036854775807"),Cr=kr("-9223372036854775808");function Ar(t){const e=kr(t);if(e>Er||e<Cr)throw new Error("Integer overflow.");if("number"==typeof e&&(Number.isNaN(e)||e!==Math.round(e)))throw new Error("Incorrect integer value.");return e}const jr=Ar(0);function Fr(t){let e=t;return e<0&&(e=-e),e}function Vr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ar(e)}class Dr{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=Q(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}}class Sr extends Dr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Or extends Dr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Ar(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Ar(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class Pr extends Dr{convertValue(t){if("number"!=typeof t||Number.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"}}class Ir extends Dr{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"}}class Mr extends Dr{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"}}class Tr extends Dr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Nr extends Dr{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"}}class zr extends Dr{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"}}const Rr={string:Sr,number:Pr,integer:Or,boolean:Ir,color:Mr,url:Tr,dict:Nr,array:zr};function Br(t,e,r){if(!(e in Rr))throw new Error("Unsupported variable type");return new Rr[e](t,r)}function Ur(){}function Wr(t){return t(this.value),Ur}function Lr(){throw new Error("Cannot change the value of this type of variable")}const Hr={string:class extends Sr{},number:class extends Pr{},integer:class extends Or{},boolean:class extends Ir{},color:class extends Mr{},url:class extends Tr{},dict:class extends Nr{},array:class extends zr{}};for(const t in Hr){const e=Hr[t];e.prototype.subscribe=Wr,e.prototype.set=Lr,e.prototype.setValue=Lr}const qr={width:10,height:10,borderRadius:5,background:"#000"},Jr=["rounded_rectangle","circle"],Gr=["rounded_rectangle"];function Zr(t,e,r,n,o){let i=[];if(o)for(let o=t;o<e;++o)i.push((o-r)/(n-r));else{for(let e=r;e<t;++e)i.push((e-r)/(n-r));for(let t=e;t<n+1;++t)i.push((t-r)/(n-r))}return i}const Yr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U,W,H,J,G,Z,Y,X,Q,K,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,ut=i,vt=i,gt=i,ft=i,ht=i,mt=i;var yt,bt,_t,wt;let{componentContext:$t}=e,{layoutParams:xt}=e;const kt=f(at),Et=f(qt);let Ct;P=l(kt.direction,(t=>O=t));let At,jt,Vt,Dt=0,St=100,Pt=qr,It=Pt,Mt=qr,Tt=qr,Nt=null,Rt=null,Bt=Vt,Ut="",Wt="",Lt=!1,Ht=$r(X||0,Dt,St),Jt=$r(Y||0,Dt,St);er((function(){}),50),v((()=>{Ct&&(kt.unregisterFocusable(Ct),Ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==$t&&r.componentContext($t),void 0===e.layoutParams&&r.layoutParams&&void 0!==xt&&r.layoutParams(xt),o=$t.origJson,o&&(Pt=qr,It=Pt,Mt=qr,Tt=qr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Wt=""),a=$t.json.thumb_value_variable,s=$t.json.thumb_secondary_value_variable,c=a&&$t.getVariable(a,"integer")||Br("temp","integer",0),ft(),ft=l(c,(t=>X=t)),u=s&&$t.getVariable(s,"integer")||Br("temp","integer",0),gt(),gt=l(u,(t=>Y=t)),d=$t.getDerivedFromVars($t.json.min_value),mt(),mt=l(d,(t=>K=t)),p=$t.getDerivedFromVars($t.json.max_value),ht(),ht=l(p,(t=>Q=t)),g=$t.getDerivedFromVars($t.json.thumb_style),vt(),vt=l(g,(t=>Z=t)),h=$t.getDerivedFromVars($t.json.thumb_secondary_style),ut(),ut=l(h,(t=>G=t)),m=$t.getDerivedFromVars($t.json.track_inactive_style),ct(),ct=l(m,(t=>J=t)),y=$t.getDerivedFromVars($t.json.track_active_style),lt(),lt=l(y,(t=>H=t)),b=$t.getDerivedFromVars($t.json.tick_mark_active_style),it(),it=l(b,(t=>W=t)),_=$t.getDerivedFromVars($t.json.tick_mark_inactive_style),ot(),ot=l(_,(t=>U=t)),w=$t.getDerivedFromVars($t.json.thumb_text_style),nt(),nt=l(w,(t=>B=t)),$=$t.getDerivedFromVars($t.json.thumb_secondary_text_style),rt(),rt=l($,(t=>z=t)),x=$t.getDerivedFromVars($t.json.accessibility),et(),et=l(x,(t=>T=t)),k=$t.getDerivedFromVars($t.json.secondary_value_accessibility),tt(),tt=l(k,(t=>M=t)),Dt=zt(K,Dt),St=zt(Q,St);{const t=$r(X||0,Dt,St);t!==Ht&&(Ht=t)}{const t=$r(Y||0,Dt,St);t!==Jt&&(Jt=t)}Pt=xe(Z,Jr,Pt),It=xe(G,Jr,Pt),Mt=xe(J,Gr,Mt),Tt=xe(H,Gr,Tt);{let t=xe(W,Jr,qr);t!==qr&&(Nt=t)}At=Nt?s?Zr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!0):Zr(Dt,Ht,Dt,St,!0):[];{let t=xe(U,Jr,qr);t!==qr&&(Rt=t)}jt=Rt?s?Zr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!1):Zr(Ht+1,St+1,Dt,St,!0):[],Vt=wr(B,Vt),Bt=wr(z,Vt),(null==T?void 0:T.description)?Ut=T.description:$t.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==M?void 0:M.description)?Wt=M.description:s&&$t.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Et.hasAction()?($t.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===qr?($t.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===qr?($t.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===qr&&($t.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Lt&&(Lt=t)}return E=dt(Math.max(...[Pt.width,It.width,0].filter(Ot))),C=dt(Math.max(...[Pt.height,It.height,0].filter(Ot))),A=(Ht-Dt)/(St-Dt),j=s?(Jt-Dt)/(St-Dt):void 0,F=void 0!==j?Math.abs(j-A):A,V=void 0!==j?Math.min(j,A):0,D={"--divkit-slider-thumb-width":dt(Pt.width),"--divkit-slider-thumb-height":dt(Pt.height),"--divkit-slider-thumb-secondary-width":dt(It.width),"--divkit-slider-thumb-secondary-height":dt(It.height),"--divkit-slider-text-offset-x":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(bt=null==Vt?void 0:Vt.offset)||void 0===bt?void 0:bt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(wt=null==Bt?void 0:Bt.offset)||void 0===wt?void 0:wt.y)?pt(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?dt(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?dt(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?dt(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?dt(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?dt(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?dt(Rt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Rt?void 0:Rt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":E,"--divkit-slider-max-thumb-height":C,"--divkit-slider-track-part":A,"--divkit-slider-track-secondary-part":j},S={direction:O},$t.json,P(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),ut(),vt(),gt(),ft(),ht(),mt()," "+(Lt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("slider",_r,S),style:D,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:$t,layoutParams:xt},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,o,i,a,l;return`<div${L("class",_r["slider__tracks-wrapper"],0)}><div${L("class",_r["slider__tracks-inner"],0)}${L("this",undefined,0)}><div${L("class",_r.slider__track,0)}${q({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${L("class",_r["slider__active-track"],0)}${q({left:"ltr"===O?(100*V).toFixed(2)+"%":void 0,right:"ltr"===O?void 0:(100*V).toFixed(2)+"%",width:(100*F).toFixed(2)+"%",height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> ${N(At,(t=>`<div class="${I(_r.slider__tick,!0)+" "+I(_r.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(jt,(t=>`<div class="${I(_r.slider__tick,!0)+" "+I(_r.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${L("class",_r.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${L("class",_r["slider__thumb-text"],0)}><div${L("class",_r["slider__thumb-text-inner"],0)}${q({"font-size":(null===(r=Vt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(n=Vt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Vt)||void 0===o?void 0:o.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${s?`<div class="${I(_r.slider__thumb,!0)+" "+I(_r.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(_r["slider__thumb-text"],!0)+" "+I(_r["slider__thumb-text_secondary"],!0)}"><div${L("class",_r["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=Bt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(a=Bt)||void 0===a?void 0:a.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",_r.slider__input,0)}${L("min",Dt,0)}${L("max",St,0)} step="1"${L("value",Ht,0)}${L("aria-label",Ut,0)}${L("this",undefined,0)}> ${s?`<input type="range"${L("class",`${_r.slider__input} ${_r.slider__input_secondary}`,0)}${L("min",Dt,0)}${L("max",St,0)} step="1"${L("value",Jt,0)}${L("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Xr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_end":"divkit-e9096",input__aligner:"divkit-e0491",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_start":"divkit-cd14f","input_alignment-vertical_end":"divkit-cd38f","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 Qr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Qr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const o=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-o>=r&&t[n-o]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-o}}function Kr(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 tn{constructor(t){this.char=t}}class en{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class rn{constructor(t){Kr(this,"filters",new Map),Kr(this,"destructedValue",[]),Kr(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 tn)t+=r.char;else if(r instanceof en)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 en&&!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 en(null,this.filters.get(e.key),e.placeholder):new tn(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=Qr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),o=this.buildTailSubstring(r);this.cleanup(r);const i=this.firstEmptyHolderIndex(),a=o?this.calculateMaxShift(o,i):void 0;this.replaceChars(n,i,a);const s=this.firstEmptyHolderIndex();this.replaceChars(o,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,n=e;for(;n<this.destructedValue.length;)this.destructedValue[n]instanceof en&&++r,++n;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let n=0;for(;n<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+n);)++n;return Math.max(0,n-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 en&&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 en&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let n;n=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=n}calculateInsertableSubstring(t,e){let r="",n=e;const o=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof en);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=o();null!=e&&e.test(t)&&(r+=t,++n)})),r}collectValueRange(t,e){let r="",n=t;for(;n<=e;){const t=this.destructedValue[n];t instanceof en&&null!==t.char&&(r+=t.char),++n}return r}replaceChars(t,e,r){let n=this.calculateInsertableSubstring(t,e);void 0!==r&&(n=n.substring(0,r));let o=e,i=0;for(;o<this.destructedValue.length&&i<n.length;){const t=this.destructedValue[o],e=n[i];t instanceof en&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof en);)++e;return e}}class nn extends rn{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function on(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 an extends rn{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),on(this,"currencyFormatter",new Intl.NumberFormat),on(this,"decimalSeparator","."),on(this,"localeDigits",{}),on(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),n=[{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:n,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Qr(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),o=t.lastIndexOf(this.decimalSeparator),i=n!==o||-1===n&&-1===o,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;i&&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,n=0;for(;n<t.length;){if(t[n]===this.decimalSeparator&&!this.inDiff(e,n)){r=n;break}n++}let o=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(o=e.start);const i=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=i;if(-1!==r)for(n=r;n<t.length;)this.isDigit(t[n])&&!this.inDiff(e,n)&&a--,n++;else{let r=!1;for(let n=0;n<t.length;n++){const o=t[n];o===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(o)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==o,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=i;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===o?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==n&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=n),n--}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 sn(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 ln(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(),n=t.parentNode,o=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,o),r.setEnd(n,o),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],o=sn(n);if(e<=o)return void ln(n,e);e-=o}else try{const r=window.getSelection();if(r){r.removeAllRanges();const n=document.createRange();n.setStart(t,e),n.setEnd(t,e),r.addRange(n)}}catch(t){}}const cn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),un={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url",password:"password"},dn=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,M,T,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,ot,it,lt,ct,vt,ft,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Ct=i,At=i,jt=i,Vt=i,Ot=i,Pt=i,It=i,Mt=i,Tt=i,Nt=i,zt=i;var Rt;let{componentContext:Ut}=e,{layoutParams:Wt}=e;const Lt=f(at);let Ht,qt;q=l(Lt.direction,(t=>H=t));let Jt,Gt,Zt,Xt=null,Qt="",Kt="",te=!1,ee="",re=12,ne="",ie="",se="#000",ce="",ue="start",ge="center",fe="multi_line_text",he="text",me="",ye=null,be="",_e="",we="",$e=!0;function xe(t){qt instanceof HTMLInputElement?qt.selectionStart=qt.selectionEnd=t:ln(qt,t)}async function ke(){if(!qt||!Xt)return;Xt.overrideRawValue(U),d.set(Xt.rawValue),c(u,B=Qt=Kt=Xt.value,B);const t=Xt.cursorPosition;await $(),document.activeElement===qt&&xe(t)}var Ee;v((()=>{Ht&&(Lt.unregisterFocusable(Ht),Ht=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Ut&&r.componentContext(Ut),void 0===e.layoutParams&&r.layoutParams&&void 0!==Wt&&r.layoutParams(Wt),o=Ut.origJson,o&&(ee="",re=12,Jt=void 0,ne="",Gt=void 0,se="#000",ce="",ue="left",ge="center",fe="multi_line_text",he="text",Zt=void 0,$e=!0),a=Ut.json.text_variable,s=null===(Rt=Ut.json.mask)||void 0===Rt?void 0:Rt.raw_text_variable,u=a&&Ut.getVariable(a,"string")||Br("temp","string",""),ht(),ht=l(u,(t=>B=t)),d=s&&Ut.getVariable(s,"string")||Br("temp","string",""),mt(),mt=l(d,(t=>U=t)),p=Ut.getDerivedFromVars(Ut.json.hint_text),Nt(),Nt=l(p,(t=>vt=t)),g=Ut.getDerivedFromVars(Ut.json.hint_color),Tt(),Tt=l(g,(t=>ct=t)),h=Ut.getDerivedFromVars(Ut.json.font_size),Mt(),Mt=l(h,(t=>lt=t)),m=Ut.getDerivedFromVars(Ut.json.font_weight),It(),It=l(m,(t=>it=t)),y=Ut.getDerivedFromVars(Ut.json.font_family),Pt(),Pt=l(y,(t=>ot=t)),b=Ut.getDerivedFromVars(Ut.json.line_height),Ot(),Ot=l(b,(t=>nt=t)),_=Ut.getDerivedFromVars(Ut.json.letter_spacing),Vt(),Vt=l(_,(t=>rt=t)),w=Ut.getDerivedFromVars(Ut.json.text_color),jt(),jt=l(w,(t=>et=t)),x=Ut.getDerivedFromVars(Ut.json.highlight_color),At(),At=l(x,(t=>tt=t)),k=Ut.getDerivedFromVars(Ut.json.text_alignment_horizontal),Ct(),Ct=l(k,(t=>K=t)),E=Ut.getDerivedFromVars(Ut.json.text_alignment_vertical),kt(),kt=l(E,(t=>Q=t)),C=Ut.getDerivedFromVars(Ut.json.keyboard_type),$t(),$t=l(C,(t=>Y=t)),A=Ut.getDerivedFromVars(Ut.json.mask),wt(),wt=l(A,(t=>Z=t)),j=Ut.getDerivedFromVars(Ut.json.max_visible_lines),_t(),_t=l(j,(t=>G=t)),F=Ut.getDerivedFromVars(Ut.json.paddings),bt(),bt=l(F,(t=>J=t)),V=Ut.getDerivedFromVars(Ut.json.accessibility),yt(),yt=l(V,(t=>W=t)),D=Ut.getDerivedFromVars(Ut.json.select_all_on_focus),zt(),zt=l(D,(t=>ft=t)),S=Ut.getDerivedFromVars(Ut.json.is_enabled),xt(),xt=l(S,(t=>X=t)),a?te=!1:(te=!0,Ut.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(Ee=Z)?void 0:Ee.type)?Xt=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 n={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(n),r):new nn(n,e)}return r||null}(Ee,Ut.logError,Xt):"currency"===(null==Ee?void 0:Ee.type)&&(Xt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new an(t.locale,e)}(Ee,Ut.logError,Xt)),Xt&&ke(),Xt||Qt===B||(Qt=Kt=B),Xt&&Xt.rawValue!==U&&ke(),O=vt,ee=gt(ct,1,ee),re=ae(lt,re),Jt=le(it,Jt),ne=ot&&"string"==typeof ot?Lt.typefaceProvider(ot,{fontWeight:Jt||400}):"";{const t=nt;Yt(t)&&(Gt=t/re)}return St(rt)&&(ie=dt(rt)),se=gt(et,1,se),ce=gt(tt,1,ce),ue=de(K,H,ue),ge=pe(Q,ge),$e=ve(X,$e),Y&&Y in un&&(he=un[Y],fe=Y),"currency"===(null==Z?void 0:Z.type)&&(he=cn?"text":"tel",Zt="decimal"),P="multi_line_text"===fe,me=Yt(G)?`calc(${G*(Gt||1.25)*(re/10)+"em"} + ${pt(Et(null==J?void 0:J.top,0)+Et(null==J?void 0:J.bottom,0))})`:"",ye=Bt(J||void 0,ye),be=ye?Dt({top:(Number(ye.top)||0)/re*10,right:(Number("ltr"===H?ye.end:ye.start)||Number(ye.right)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10,left:(Number("ltr"===H?ye.start:ye.end)||Number(ye.left)||0)/re*10},H):"",_e=ye?Dt({top:(Number(ye.top)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10},H):"",(null==W?void 0:W.description)?we=W.description:Ut.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),M={"highlight-color":Boolean(ce),multiline:P,"alignment-horizontal":ue,"alignment-vertical":ge},T={"--divkit-input-hint-color":ee,"--divkit-input-highlight-color":ce,"--divkit-input-line-height":Gt,"font-weight":Jt,"font-family":ne,"letter-spacing":ie,color:se,"max-height":me},N={"font-size":dt(re),padding:be},z={"font-size":dt(re),padding:_e},qt&&Ut.json&&(Ht&&(Lt.unregisterFocusable(Ht),Ht=void 0),Ut.json.id&&!Ut.fakeElement&&(Ht=Ut.json.id,Lt.registerFocusable(Ht,{focus(){qt&&qt.focus()}}))),ht(),mt(),yt(),q(),bt(),_t(),wt(),$t(),xt(),kt(),Ct(),At(),jt(),Vt(),Ot(),Pt(),It(),Mt(),Tt(),Nt(),zt(),te?"":`${R(oe,"Outer").$$render(t,{cls:Ft("input",Xr,M),style:T,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Ut,layoutParams:Wt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return P?`<span${L("class",Xr["input__scroll-wrapper"],0)}>${!Kt&&O?`<div${L("class",Xr.input__placeholder,0)} aria-hidden="true"${L("style",ut(N),0)}>${I(O)}</div>`:""} <span${L("class",Xr.input__aligner,0)} aria-hidden="true"${L("style",ut(z),0)}>​</span> ${$e?` <span${L("class",Ft("input__input",Xr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true" role="textbox" tabindex="0"${L("aria-label",we,0)} aria-multiline="true"${L("style",ut(N),0)}${L("this",qt,0)}>${n=Kt,void 0===n?"":n}</span>`:`<span${L("class",Ft("input__input",Xr,{multiline:!0}),0)} autocapitalize="off" contenteditable="false" role="textbox"${L("aria-label",we,0)} aria-disabled="true" aria-multiline="true"${L("style",ut(N),0)}${L("this",qt,0)}>${(t=>void 0===t?"":t)(Kt)}</span>`}</span>`:`<input${L("type",he,0)}${L("inputmode",Zt,0)}${L("class",Ft("input__input",Xr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",we,0)}${L("style",ut(N),0)} ${$e?"":"disabled"}${L("placeholder",O,0)}${L("value",Qt,0)}${L("this",qt,0)}>`;var n}})}`})),pn={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"},vn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U,W=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,K=i,tt=i,{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);let ot;T=l(nt.direction,(t=>M=t));let it,lt,ct=!1,pt="",vt=null,ft="",ht="rgba(0,0,0,.45)",mt=12,yt="",bt="",_t="#000",wt="";v((()=>{ot&&(nt.unregisterFocusable(ot),ot=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==et&&r.componentContext(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),o=et.origJson,o&&(vt=null,ht="rgba(0,0,0,.45)",mt=12,it=void 0,yt="",lt=void 0,bt="",_t="#000",wt=""),a=et.json.value_variable,s=et.json.options,c=Array.isArray(s)&&s.filter((t=>"string"==typeof t.value))||[],u=a&&et.getVariable(a,"string")||Br("temp","string",""),K(),K=l(u,(t=>B=t)),d=et.getDerivedFromVars(et.json.paddings),Q(),Q=l(d,(t=>z=t)),p=et.getDerivedFromVars(et.json.hint_text),tt(),tt=l(p,(t=>U=t)),g=et.getDerivedFromVars(et.json.hint_color),X(),X=l(g,(t=>P=t)),h=et.getDerivedFromVars(et.json.font_size),Y(),Y=l(h,(t=>O=t)),m=et.getDerivedFromVars(et.json.font_weight),Z(),Z=l(m,(t=>S=t)),y=et.getDerivedFromVars(et.json.font_family),G(),G=l(y,(t=>D=t)),b=et.getDerivedFromVars(et.json.line_height),J(),J=l(b,(t=>V=t)),_=et.getDerivedFromVars(et.json.letter_spacing),q(),q=l(_,(t=>F=t)),w=et.getDerivedFromVars(et.json.text_color),H(),H=l(w,(t=>j=t)),$=et.getDerivedFromVars(et.json.accessibility),W(),W=l($,(t=>A=t)),Array.isArray(c)&&c.length||et.logError(st(new Error('Empty selection "items" in "select"'))),a?ct=!1:(ct=!0,et.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=c.find((t=>t.value===B));t?pt=("string"==typeof t.text?t.text:t.value)||"":(pt="",B&&et.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}mt=ae(O,mt),vt=Bt(z||void 0,vt),ft=vt?Dt({top:(Number(vt.top)||0)/mt*10,right:(Number("ltr"===M?vt.end:vt.start)||Number(vt.right)||0)/mt*10,bottom:(Number(vt.bottom)||0)/mt*10,left:(Number("ltr"===M?vt.start:vt.end)||Number(vt.left)||0)/mt*10},M):"",ht=gt(P,1,ht),it=le(S,it),yt=D&&"string"==typeof D?nt.typefaceProvider(D,{fontWeight:it||400}):"";{const t=V;Yt(t)&&(lt=t/mt)}return St(F)&&(bt=dt(F/mt*10)),_t=gt(j,1,_t),(null==A?void 0:A.description)?wt=A.description:et.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),x={hint:!pt},k={"--divkit-input-hint-color":ht,"font-weight":it,"font-family":yt,color:_t},E={padding:ft,"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},C={"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},et.json,W(),H(),q(),J(),G(),Z(),Y(),X(),T(),Q(),K(),tt(),ct?"":`${R(oe,"Outer").$$render(t,{cls:Ft("select",pn,x),style:k,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:et,layoutParams:rt},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",pn["select__select-text"],0)}${L("style",ut(E),0)} aria-hidden="true"> ${I(pt||U||"​")}</span> <select${L("class",Ft("select__select",pn,{"has-custom-focus":t}),0)}${L("aria-label",wt,0)}${L("style",ut(C),0)}${L("this",undefined,0)}>${N(c,(t=>`<option${L("class",pn.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),gn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},fn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j=i,F=i,V=i,D=i,S=i,O=i,P=i,I=i,{componentContext:M}=e,{layoutParams:T}=e;const z=f(at);let B,U,W,H,J=!1,G=!1,Z=[],Y=!1,X=!1,Q=!1,K=!1,tt="fit",et="0";var rt,nt;v((()=>{B&&(z.unregisterInstance(B),B=void 0),H&&(H(),H=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==M&&r.componentContext(M),void 0===e.layoutParams&&r.layoutParams&&void 0!==T&&r.layoutParams(T),M.json&&(Y=!1,X=!1,Q=!1,K=!1,W=void 0,tt="fit"),o=M.json.elapsed_time_variable,a=o&&M.getVariable(o,"integer")||Br("temp","integer",0),a&&(H&&H(),H=a.subscribe((function(t){G&&(G=!1)}))),s=M.getDerivedFromVars(M.json.video_sources),I(),I=l(s,(t=>A=t)),c=M.getDerivedFromVars(M.json.repeatable),P(),P=l(c,(t=>C=t)),u=M.getDerivedFromVars(M.json.autostart),j(),j=l(u,(t=>_=t)),d=M.getDerivedFromVars(M.json.muted),O(),O=l(d,(t=>E=t)),p=M.getDerivedFromVars(M.json.preload_required),S(),S=l(p,(t=>k=t)),g=M.getDerivedFromVars(M.json.preview),D(),D=l(g,(t=>x=t)),h=M.getDerivedFromVars(M.json.scale),V(),V=l(h,(t=>$=t)),m=M.getDerivedFromVars(M.json.aspect),F(),F=l(m,(t=>w=t)),rt=A,nt=Z,Z=Array.isArray(rt)&&rt.length?rt.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})):nt,Z.length?J=!1:(J=!0,M.logError(st(new Error('Missing "video_sources" in "video"')))),Y=ve(C,Y),X=ve(_,X),Q=ve(E,Q),K=ve(k,K),W="string"==typeof x?Re(x):W,tt=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}($)||tt;{const t=null==w?void 0:w.ratio;et=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return M.json&&(B&&(z.unregisterInstance(B),B=void 0),!M.json.id||J||M.fakeElement||(B=M.json.id,z.registerInstance(B,{pause:function(){},start:function(){}}))),M.json,y={aspect:"0"!==et},b={"object-fit":tt},j(),F(),V(),D(),S(),O(),P(),I(),J?"":`${R(oe,"Outer").$$render(t,{cls:Ft("video",gn,y),customActions:"video",componentContext:M,layoutParams:T},{},{default:()=>y.aspect?`<div${L("class",gn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${et}%`})}><video${L("class",gn.video__video,0)}${L("style",ut(b),0)} playsinline ${Y?"loop":""} ${X?"autoplay":""} ${Q?"muted":""}${L("poster",W,0)}${L("preload",K?"metadata":"auto",0)}${L("this",U,0)}>${N(Z,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",gn.video__video,0)}${L("style",ut(b),0)} playsinline ${Y?"loop":""} ${X?"autoplay":""} ${Q?"muted":""}${L("poster",W,0)}${L("preload",K?"metadata":"auto",0)}${L("this",U,0)}>${N(Z,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),hn=fn,mn=W(((t,e,r,n)=>{let o,i;var a;let{componentContext:s}=e,{layoutParams:l}=e;const c=f(at);let u=null,d="",p={},v=!1;if(void 0===e.componentContext&&r.componentContext&&void 0!==s&&r.componentContext(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),"string"==typeof s.json.custom_type&&s.json.custom_type&&(null===(a=c.customComponents)||void 0===a?void 0:a.has(s.json.custom_type))){if(u=c.customComponents.get(s.json.custom_type),"function"==typeof u.template){const t=c.getExtensionContext(),e=new Map;for(const[r,n]of t.variables)e.set(r,n.getValue());d=u.template({props:s.json.custom_props,variables:e})}else d=u.template&&"string"==typeof u.template?u.template:"";p={shadowrootmode:u.shadowRootMode||"open"}}else u=null,d=";",s.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return o=s.json.items,void 0===o||Array.isArray(o)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),i=(!v&&o||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(oe,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${S([T(s.json.custom_props||{})],{})}${L("this",undefined,0)}>${V(e)?"":`${d?`<template${S([T(p)],{})}> ${d}</template>`:""} ${!v&&o?`${N(i,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),yn=mn,bn={};bn.text=he,bn.container=Ie,bn.separator=Ne,bn.image=Ue,bn.gif=Ue,bn.grid=Ge,bn.gallery=or,bn.tabs=sr,bn.state=pr,bn.pager=fr,bn.indicator=br,bn.slider=Yr,bn.input=dn,bn.select=vn,bn.video=hn,bn.custom=yn;const _n=W(((t,e,r,n)=>{let{componentContext:o}=e,{layoutParams:i}=e;const a=f(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.layoutParams&&r.layoutParams&&void 0!==i&&r.layoutParams(i);{const t=o.json;if(s=(null==t?void 0:t.type)&&bn[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",o.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||z,"svelte:component").$$render(t,{componentContext:o,layoutParams:i},{},{})}`:""})),wn=W(((t,e,r,n)=>{let{svgFiltersMap:o}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==o&&r.svgFiltersMap(o),Object.keys(o).length?`<svg${L("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(o)],(t=>{let[e,r]=t.split(":");return` <filter${L("id",o[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 $n(t,e,r,n){const o=r[t.type];if(!o)return n(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let i;const a={};for(i in e)e.hasOwnProperty(i)&&(a[i]=e[i]);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(a[i]=t[i]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),o=n.filter((t=>"$"!==t.charAt(0))),i=n.filter((t=>"$"===t.charAt(0)));return o.forEach((n=>{const o=r[n];"object"==typeof o&&null!==o?(e[n]=Array.isArray(o)?[]:{},t(e[n],o)):e[n]=o})),i.forEach((t=>{const n=r[t],o=a[n];if(void 0!==o){const r=t.substring(1);e[r]=o}})),e}({},o);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(s[i]=t[i]);return{json:s,templateContext:a}}function xn(){}function kn(t){return{subscribe:e=>(e(t),xn)}}function En(t,e){return e.length?e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t):t}function Cn(t,e){return e.length?e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t):t}function An(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 jn(t){try{return Ar(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Fn(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Vn(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,Vn.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function Dn(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}kn(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Vn,Error),Vn.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+i.line+":"+i.column;if(n){var s=this.location.end,l=Dn("",i.line.toString().length," "),c=n[o.line-1],u=(o.line===s.line?s.column:c.length+1)-o.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+i.line+" | "+c+"\n"+l+" | "+Dn("",o.column-1," ")+Dn("",u,"^")}else e+="\n at "+a}return e},Vn.buildMessage=function(t,e){var r={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function i(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};const Sn=Number.MAX_VALUE,On=Number.MIN_VALUE,Pn="string",In="integer",Mn="number",Tn="boolean",Nn="color",zn="url",Rn="datetime",Bn="dict",Un="array";function Wn(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=>{Wn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Wn(t.left,e),Wn(t.right,e);break;case"UnaryExpression":Wn(t.argument,e);break;case"ConditionalExpression":Wn(t.test,e),Wn(t.consequent,e),Wn(t.alternate,e);break;case"TryExpression":Wn(t.test,e),Wn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Wn(t,e)}))}}function Ln(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Hn(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function qn(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 Hn(t.value);if("color"===t.type)return to(Kn(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 Jn(t){let e=qn(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Gn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Zn(t,e){if(xr)return Ar(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Yn(t,e){if(e<Cr||e>Er)throw new Error("Integer overflow.");!xr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Xn(t){const e=[];return Wn(t,{Variable(t){e.push(t.id.name)}}),e}function Qn(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Kn(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function to(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 vt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function eo(t){return to(Kn(t))}function ro(t){return{type:Mn,value:Number(t.value)}}const no={string:"string",number:"number",integer:"number",boolean:"boolean",color:"string",url:"string",array:"array",dict:"object"};function oo(t,e,r){const n=no[r];let o=typeof e;if("array"===n&&!Array.isArray(e)||"array"!==n&&o!==n||"object"===o&&null===e)throw"object"===o&&(o=Array.isArray(e)?"array":null===e?"null":"dict"),new Error(`Incorrect value type: expected "${r}", got "${o}".`);if("number"===n&&"integer"===r){Yn(t,e);try{e=Ar(e)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===n&&"color"===r&&(e=eo(e)),{type:r,value:e}}const io=new Map,ao=new Map,so=new Map,lo=new Map;function co(t,e,r){const n={args:e,cb:r},o=io.get(t)||[];io.has(t)||io.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");ao.set(i,n)}function uo(t,e,r){const n={args:e,cb:r},o=so.get(t)||[];so.has(t)||so.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");lo.set(i,n)}function po(t,e){const r=t.args.length;let n=t.args.length,o=0;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==Mn||e[r].type!==In){if(n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}else++o}return{type:"match",conversions:o}}function vo(t,e,r){const n=("function"===t?io:so).get(e);if(!n)return{type:"missing"};let o=null,i=null;for(let t=0;t<n.length;++t){const e=po(n[t],r);"match"!==e.type?o||(o=e):(!i||i.conversions>e.conversions)&&(i={func:n[t],conversions:e.conversions})}if(!i){if(o)return o;throw new Error("Missing function")}return i}function go(t,e){return e.map(((e,r)=>{let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];return"object"!=typeof n&&(n={type:n}),n.type===Mn&&e.type===In?ro(e):e}))}function fo(t,e){return{type:Pn,value:qn(e)}}function ho(t,e){const r=Number(e.value);if(Number.isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Mn,value:r}}function mo(t,e,r,n){const o=t.variables.get(e.value);let i;return i=o&&o.getType()===n?o.getValue():r.value,"color"===n&&(i=eo(i)),{type:n,value:i}}function yo(t,e,r){return mo(t,e,r,r.type)}function bo(t,e,r){return mo(t,e,r,"color")}function _o(t,e,r){return mo(t,e,r,"url")}const wo=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:In,value:Ar(n)}},$o=wo("getUTCFullYear"),xo=wo("getUTCMonth"),ko=wo("getUTCDate"),Eo=wo("getUTCDay"),Co=wo("getUTCHours"),Ao=wo("getUTCMinutes"),jo=wo("getUTCSeconds"),Fo=wo("getUTCMilliseconds");function Vo(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let o="";const i=e.type===Pn?e.value:qn(e);for(;o.length+i.length<r.value;)o+=n.value;return o.length>0&&o.length+i.length>r.value&&(o=o.substring(0,Number(r.value)-Number(i.length))),o}function Do(t,e,r,n){const o=Vo(t,e,r,n);return{type:Pn,value:o+qn(e)}}function So(t,e,r,n){const o=Vo(t,e,r,n);return{type:Pn,value:qn(e)+o}}function Oo(t){return(e,r)=>{const n=Kn(r.value);return{type:Mn,value:n[t]/255}}}function Po(t){return(e,r,n)=>{const o=Kn(r.value);return o[t]=255*n.value,{type:Nn,value:to(o)}}}const Io=Oo("a"),Mo=Oo("r"),To=Oo("g"),No=Oo("b"),zo=Po("a"),Ro=Po("r"),Bo=Po("g"),Uo=Po("b");function Wo(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=Ar(e.value)/Ar(r);return Yn(t,o),"number"==typeof o&&(o=Math.floor(o)),n&&(o=Ar(o)%Ar(n)),{type:In,value:o}}const Lo=36e5;function Ho(t){return(e,r,...n)=>{if(0===n.length)throw new Error("Non empty argument list is required.");const 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 n=r[e[t]];if(void 0===n)throw new Error(`Missing property "${e[t]}" in the dict.`);r=n}return r}(r.value,n.map((t=>t.value)));return oo(e,o,t)}}function qo(t,e){return(r,n,o,...i)=>{try{return t(r,o,...i)}catch(t){let r=n.value;return"color"===e&&(r=eo(r)),{type:e,value:r}}}}const Jo=Ho(Pn),Go=Ho(Mn),Zo=Ho(In),Yo=Ho(Tn),Xo=Ho(Nn),Qo=Ho(zn),Ko=Ho(Un),ti=Ho(Bn),ei=qo(Jo,Pn),ri=qo(Go,Mn),ni=qo(Zo,In),oi=qo(Yo,Tn),ii=qo(Xo,Nn),ai=qo(Qo,zn);function si(t,e,...r){try{return Ko(t,e,...r)}catch(t){return{type:Un,value:[]}}}function li(t,e,...r){try{return ti(t,e,...r)}catch(t){return{type:Bn,value:{}}}}function ci(t,e){return(r,n,o)=>{if(o.value<0||o.value>=n.value.length)throw new Error(`Requested index (${o.value}) out of bounds array size (${n.value.length}).`);let i=n.value[Number(o.value)],a=typeof i;if("array"===t&&!Array.isArray(i)||"array"!==t&&a!==t||"object"===a&&null===i)throw"object"===a&&(a=Array.isArray(i)?"array":null===i?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Yn(r,i);try{i=Ar(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=eo(i)),{type:e,value:i}}}function ui(t,e){return(r,n,o,i)=>{try{return t(r,n,o)}catch(t){let r=i.value;return"color"===e&&(r=eo(r)),{type:e,value:r}}}}const di=ci("string","string"),pi=ci("number","number"),vi=ci("number","integer"),gi=ci("boolean","boolean"),fi=ci("string","color"),hi=ci("string","url"),mi=ci("array","array"),yi=ci("object","dict"),bi=ui(di,"string"),_i=ui(pi,"number"),wi=ui(vi,"integer"),$i=ui(gi,"boolean"),xi=ui(fi,"color"),ki=ui(hi,"url");function Ei(t){return(e,r,n)=>{if(!e.store)return{type:t,value:n.value};let o;o="boolean"===t?"boolean":"number"===t||"integer"===t?"number":"string";const i=e.store.getValue(r.value,o);return void 0===i?{type:t,value:n.value}:oo(e,i,t)}}function Ci(t){return t.map(Jn).join(", ")}co("toString",[In],fo),co("toString",[Mn],fo),co("toString",[Tn],fo),co("toString",[Nn],fo),co("toString",[zn],fo),co("toString",[Pn],fo),co("toNumber",[In],ho),co("toNumber",[Pn],ho),co("toInteger",[Mn],(function(t,e){if(e.value>Er||e.value<Cr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:In,value:Ar(r)}})),co("toInteger",[Pn],(function(t,e){let r;try{r=Ar(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:In,value:r}})),co("toInteger",[Tn],(function(t,e){return{type:In,value:Ar(e.value?1:0)}})),co("toBoolean",[In],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Tn,value:r}})),co("toBoolean",[Pn],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Tn,value:"true"===e.value?1:0}})),co("toColor",[Pn],(function(t,e){return{type:Nn,value:eo(e.value)}})),co("toUrl",[Pn],(function(t,e){return{type:zn,value:e.value}})),co("encodeUri",[Pn],(function(t,e){try{return{type:Pn,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),co("decodeUri",[Pn],(function(t,e){try{return{type:Pn,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),co("getIntegerValue",[Pn,In],yo),co("getNumberValue",[Pn,Mn],yo),co("getBooleanValue",[Pn,Tn],yo),co("getStringValue",[Pn,Pn],yo),co("getColorValue",[Pn,Nn],bo),co("getColorValue",[Pn,Pn],bo),co("getUrlValue",[Pn,zn],_o),co("getUrlValue",[Pn,Pn],_o),uo("toString",[In],fo),uo("toString",[Mn],fo),uo("toString",[Tn],fo),uo("toString",[Nn],fo),uo("toString",[zn],fo),uo("toString",[Pn],fo),co("parseUnixTime",[In],(function(t,e){return{type:Rn,value:new Date(1e3*Number(e.value))}})),co("nowLocal",[],(function(){return{type:Rn,value:new Date}})),co("addMillis",[Rn,In],(function(t,e,r){return{type:Rn,value:new Date(e.value.getTime()+Number(r.value))}})),co("setYear",[Rn,In],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Rn,value:n}})),co("setMonth",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMonth(n-1),{type:Rn,value:o}})),co("setDay",[Rn,In],(function(t,e,r){const n=new Date(e.value),o=Number(r.value);if(o<=0&&-1!==o||o>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${o} for date ${qn(e)}.`);return n.setUTCDate(-1===o?0:o),{type:Rn,value:n}})),co("setHours",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const o=new Date(e.value);return o.setUTCHours(n),{type:Rn,value:o}})),co("setMinutes",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMinutes(n),{type:Rn,value:o}})),co("setSeconds",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCSeconds(n),{type:Rn,value:o}})),co("setMillis",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMilliseconds(n),{type:Rn,value:o}})),co("getYear",[Rn],$o),co("getMonth",[Rn],xo),co("getDay",[Rn],ko),co("getDayOfWeek",[Rn],Eo),co("getHours",[Rn],Co),co("getMinutes",[Rn],Ao),co("getSeconds",[Rn],jo),co("getMillis",[Rn],Fo),co("getIntervalSeconds",[In],(function(t,e){return Wo(t,e,1e3,60)})),co("getIntervalTotalSeconds",[In],(function(t,e){return Wo(t,e,1e3)})),co("getIntervalMinutes",[In],(function(t,e){return Wo(t,e,6e4,60)})),co("getIntervalTotalMinutes",[In],(function(t,e){return Wo(t,e,6e4)})),co("getIntervalHours",[In],(function(t,e){return Wo(t,e,Lo,24)})),co("getIntervalTotalHours",[In],(function(t,e){return Wo(t,e,Lo)})),co("getIntervalTotalDays",[In],(function(t,e){return Wo(t,e,864e5)})),co("getIntervalTotalWeeks",[In],(function(t,e){return Wo(t,e,6048e5)})),co("len",[Pn],(function(t,e){return{type:In,value:Ar(e.value.length)}})),co("contains",[Pn,Pn],(function(t,e,r){return{type:Tn,value:e.value.includes(r.value)?1:0}})),co("substring",[Pn,In,In],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Pn,value:e.value.substring(Number(r.value),Number(n.value))}})),co("replaceAll",[Pn,Pn,Pn],(function(t,e,r,n){let o;return o=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:Pn,value:o}})),co("index",[Pn,Pn],(function(t,e,r){return{type:In,value:Ar(e.value.indexOf(r.value))}})),co("lastIndex",[Pn,Pn],(function(t,e,r){return{type:In,value:Ar(e.value.lastIndexOf(r.value))}})),co("trim",[Pn],(function(t,e){return{type:Pn,value:e.value.trim()}})),co("trimLeft",[Pn],(function(t,e){return{type:Pn,value:e.value.replace(/^\s+/,"")}})),co("trimRight",[Pn],(function(t,e){return{type:Pn,value:e.value.replace(/\s+$/,"")}})),co("toUpperCase",[Pn],(function(t,e){return{type:Pn,value:e.value.toUpperCase()}})),co("toLowerCase",[Pn],(function(t,e){return{type:Pn,value:e.value.toLowerCase()}})),co("padStart",[Pn,In,Pn],Do),co("padStart",[In,In,Pn],Do),co("padEnd",[Pn,In,Pn],So),co("padEnd",[In,In,Pn],So),co("testRegex",[Pn,Pn],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Tn,value:n.test(e.value)?1:0}})),co("div",[In,In],(function(t,e,r){if(r.value===jr)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Zn(0,n),Yn(t,n),{type:In,value:n}})),co("div",[Mn,Mn],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:Mn,value:n}})),co("mod",[In,In],(function(t,e,r){if(r.value===jr)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Zn(0,n),Yn(t,n),{type:In,value:n}})),co("mod",[Mn,Mn],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:Mn,value:n}})),co("mul",[{type:In,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:jr;for(let n=1;n<e.length;++n)r*=e[n].value,r=Zn(0,r),Yn(t,r);return{type:In,value:r}})),co("mul",[{type:Mn,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:Mn,value:r}})),co("sub",[{type:In,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:jr;for(let n=1;n<e.length;++n)r-=e[n].value,r=Zn(0,r),Yn(t,r);return{type:In,value:r}})),co("sub",[{type:Mn,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:Mn,value:r}})),co("sum",[{type:In,isVararg:!0}],(function(t,...e){let r=jr;for(let n=0;n<e.length;++n)r+=e[n].value,r=Zn(0,r),Yn(t,r);return{type:In,value:r}})),co("sum",[{type:Mn,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Mn,value:r}})),co("abs",[In],(function(t,e){const r=Fr(e.value);return Yn(t,r),{type:e.type,value:r}})),co("abs",[Mn],(function(t,e){const r=Math.abs(e.value);return{type:Mn,value:r}})),co("max",[{type:In,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:In,value:r}})),co("max",[{type:Mn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Mn,value:Math.max(...e.map((t=>t.value)))}})),co("min",[{type:In,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:In,value:r}})),co("min",[{type:Mn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Mn,value:Math.min(...e.map((t=>t.value)))}})),co("maxNumber",[],(function(){return{type:Mn,value:Sn}})),co("minNumber",[],(function(){return{type:Mn,value:On}})),co("maxInteger",[],(function(t){return Yn(t,Er),{type:In,value:Er}})),co("minInteger",[],(function(t){return Yn(t,Cr),{type:In,value:Cr}})),co("round",[Mn],(function(t,e){const r=Math.sign(e.value);return{type:Mn,value:r*Math.round(Math.abs(e.value))}})),co("floor",[Mn],(function(t,e){return{type:Mn,value:Math.floor(e.value)}})),co("ceil",[Mn],(function(t,e){return{type:Mn,value:Math.ceil(e.value)}})),co("signum",[In],(function(t,e){return{type:In,value:Vr(e.value)}})),co("signum",[Mn],(function(t,e){return{type:Mn,value:Math.sign(e.value)}})),co("copySign",[In,In],(function(t,e,r){let n;if(r.value===jr)n=e.value;else if(e.value===jr)n=Ar(0);else{const t=Vr(r.value);n=Fr(e.value)*t}return Yn(t,n),{type:In,value:n}})),co("copySign",[Mn,Mn],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const o=Math.abs(e.value)*n;return{type:Mn,value:o}})),co("getColorAlpha",[Pn],Io),co("getColorAlpha",[Nn],Io),co("getColorRed",[Pn],Mo),co("getColorRed",[Nn],Mo),co("getColorGreen",[Pn],To),co("getColorGreen",[Nn],To),co("getColorBlue",[Pn],No),co("getColorBlue",[Nn],No),co("setColorAlpha",[Pn,Mn],zo),co("setColorAlpha",[Nn,Mn],zo),co("setColorRed",[Pn,Mn],Ro),co("setColorRed",[Nn,Mn],Ro),co("setColorGreen",[Pn,Mn],Bo),co("setColorGreen",[Nn,Mn],Bo),co("setColorBlue",[Pn,Mn],Uo),co("setColorBlue",[Nn,Mn],Uo),co("rgb",[Mn,Mn,Mn],(function(t,e,r,n){const o={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Nn,value:to(o)}})),co("argb",[Mn,Mn,Mn,Mn],(function(t,e,r,n,o){const i={a:255*e.value,r:255*r.value,g:255*n.value,b:255*o.value};return{type:Nn,value:to(i)}})),function(){const t={type:Pn,isVararg:!0};co("getDictString",[Bn,t],Jo),co("getStringFromDict",[Bn,t],Jo),co("getDictNumber",[Bn,t],Go),co("getNumberFromDict",[Bn,t],Go),co("getDictInteger",[Bn,t],Zo),co("getIntegerFromDict",[Bn,t],Zo),co("getDictBoolean",[Bn,t],Yo),co("getBooleanFromDict",[Bn,t],Yo),co("getDictColor",[Bn,t],Xo),co("getColorFromDict",[Bn,t],Xo),co("getDictUrl",[Bn,t],Qo),co("getUrlFromDict",[Bn,t],Qo),co("getDictOptString",[Pn,Bn,t],ei),co("getOptStringFromDict",[Pn,Bn,t],ei),co("getDictOptNumber",[Mn,Bn,t],ri),co("getOptNumberFromDict",[Mn,Bn,t],ri),co("getDictOptInteger",[In,Bn,t],ni),co("getOptIntegerFromDict",[In,Bn,t],ni),co("getDictOptBoolean",[Tn,Bn,t],oi),co("getOptBooleanFromDict",[Tn,Bn,t],oi),co("getDictOptColor",[Nn,Bn,t],ii),co("getOptColorFromDict",[Nn,Bn,t],ii),co("getDictOptColor",[Pn,Bn,t],ii),co("getOptColorFromDict",[Pn,Bn,t],ii),co("getDictOptUrl",[Pn,Bn,t],ai),co("getOptUrlFromDict",[Pn,Bn,t],ai),co("getDictOptUrl",[zn,Bn,t],ai),co("getOptUrlFromDict",[zn,Bn,t],ai),co("getDictFromDict",[Bn,t],ti),co("getArrayFromDict",[Bn,t],Ko),co("getOptArrayFromDict",[Bn,t],si),co("getOptDictFromDict",[Bn,t],li),uo("getString",[Bn,t],Jo),uo("getBoolean",[Bn,t],Yo),uo("getInteger",[Bn,t],Zo),uo("getNumber",[Bn,t],Go),uo("getUrl",[Bn,t],Qo),uo("getColor",[Bn,t],Xo),uo("getArray",[Bn,t],Ko),uo("getDict",[Bn,t],ti)}(),co("getArrayString",[Un,In],di),co("getStringFromArray",[Un,In],di),co("getArrayNumber",[Un,In],pi),co("getNumberFromArray",[Un,In],pi),co("getArrayInteger",[Un,In],vi),co("getIntegerFromArray",[Un,In],vi),co("getArrayBoolean",[Un,In],gi),co("getBooleanFromArray",[Un,In],gi),co("getArrayColor",[Un,In],fi),co("getColorFromArray",[Un,In],fi),co("getArrayUrl",[Un,In],hi),co("getUrlFromArray",[Un,In],hi),co("getArrayFromArray",[Un,In],mi),co("getDictFromArray",[Un,In],yi),co("getArrayOptString",[Un,In,Pn],bi),co("getOptStringFromArray",[Un,In,Pn],bi),co("getArrayOptNumber",[Un,In,Mn],_i),co("getOptNumberFromArray",[Un,In,Mn],_i),co("getArrayOptInteger",[Un,In,In],wi),co("getOptIntegerFromArray",[Un,In,In],wi),co("getArrayOptBoolean",[Un,In,Tn],$i),co("getOptBooleanFromArray",[Un,In,Tn],$i),co("getArrayOptColor",[Un,In,Nn],xi),co("getOptColorFromArray",[Un,In,Nn],xi),co("getArrayOptColor",[Un,In,Pn],xi),co("getOptColorFromArray",[Un,In,Pn],xi),co("getArrayOptUrl",[Un,In,zn],ki),co("getOptUrlFromArray",[Un,In,zn],ki),co("getArrayOptUrl",[Un,In,Pn],ki),co("getOptUrlFromArray",[Un,In,Pn],ki),co("getOptArrayFromArray",[Un,In],(function(t,e,r){try{return mi(t,e,r)}catch(t){return{type:Un,value:[]}}})),co("getOptDictFromArray",[Un,In],(function(t,e,r){try{return yi(t,e,r)}catch(t){return{type:Bn,value:{}}}})),co("len",[Un],(function(t,e){return{type:In,value:Ar(e.value.length)}})),uo("getString",[Un,In],di),uo("getInteger",[Un,In],vi),uo("getNumber",[Un,In],pi),uo("getBoolean",[Un,In],gi),uo("getUrl",[Un,In],hi),uo("getColor",[Un,In],fi),uo("getArray",[Un,In],mi),uo("getDict",[Un,In],yi),co("getStoredIntegerValue",[Pn,In],Ei(In)),co("getStoredNumberValue",[Pn,Mn],Ei(Mn)),co("getStoredStringValue",[Pn,Pn],Ei(Pn)),co("getStoredUrlValue",[Pn,zn],Ei(zn)),co("getStoredUrlValue",[Pn,Pn],Ei(zn)),co("getStoredColorValue",[Pn,Nn],Ei(Nn)),co("getStoredColorValue",[Pn,Pn],Ei(Nn)),co("getStoredBooleanValue",[Pn,Tn],Ei(Tn));const Ai={StringLiteral:function(t,e){return{type:Pn,value:e.value}},NumberLiteral:function(t,e){return{type:Mn,value:e.value}},IntegerLiteral:function(t,e){return Yn(t,e.value),{type:In,value:e.value}},BooleanLiteral:function(t,e){return{type:Tn,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Ln(ji(t,e.argument));switch(e.operator){case"!":if(r.type===Tn)return{type:Tn,value:r.value?0:1};Qn(`${e.operator}${Jn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===In){const e=r.value*Ar(n);return Yn(t,e),{type:In,value:e}}if(r.type===Mn)return{type:Mn,value:r.value*n};Qn(`${e.operator}${Jn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Ln(ji(t,e.test));if(r.type===Tn)return r.value?ji(t,e.consequent):ji(t,e.alternate);Qn(`${Jn(r)} ? ${Jn(ji(t,e.consequent))} : ${Jn(ji(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return ji(t,e.test)}catch(r){return ji(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return ji(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=qn(ji(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Pn,value:r}},LogicalExpression:function(t,e){const r=Ln(ji(t,e.left));if(r.type!==Tn&&Qn(`${Jn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Tn,value:0};const n=Ln(ji(t,e.right));return n.type!==Tn&&Qn(`${Jn(r)} ${e.operator} ${Jn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Gn(n.type)}.`),{type:Tn,value:n.value}},BinaryExpression:function(t,e){const r=e.operator;let n=ji(t,e.left),o=ji(t,e.right);if(("number"===n.type&&"integer"===o.type||"integer"===n.type&&"number"===o.type)&&("integer"===n.type?n=ro(n):"integer"===o.type&&(o=ro(o))),n.type!==o.type&&Qn(`${Jn(n)} ${e.operator} ${Jn(o)}`,`Operator '${r}' cannot be applied to different types: ${Gn(n.type)} and ${Gn(o.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Rn&&r.type===Rn?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Tn,value:n?1:0}}(r,n,o);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Mn&&e.type!==In&&e.type!==Rn&&Qn(`${Jn(e)} ${t} ${Jn(r)}`,`Operator '${t}' cannot be applied to ${Gn(e.type)} type.`);const o=e.type===Rn?e.value.getTime():e.value,i=r.type===Rn?r.value.getTime():r.value;return n=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:Tn,value:n?1:0}}(r,n,o);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Pn&&r.type!==Mn&&r.type!==In&&Qn(`${Jn(r)} ${e} ${Jn(n)}`,`Operator '${e}' cannot be applied to ${Gn(r.type)} type.`),r.type===Pn)return"-"===e&&Qn(`${Jn(r)} - ${Jn(n)}`,`Operator '${e}' cannot be applied to ${Gn(r.type)} type.`),{type:Pn,value:r.value+n.value};let o="+"===e?r.value+n.value:r.value-n.value;if(r.type===In)try{o=Zn(0,o),Yn(t,o)}catch(t){Qn(`${Jn(r)} ${e} ${Jn(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let o;if(r.type!==In&&r.type!==Mn&&Qn(`${Jn(r)} ${e} ${Jn(n)}`,`Operator '${e}' cannot be applied to ${Gn(r.type)} type.`),"*"===e)o=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Qn(`${Jn(r)} ${e} ${Jn(n)}`,"Division by zero is not supported."),o="/"===e?r.value/n.value:r.value%n.value}if(r.type===In)try{o=Zn(0,o),Yn(t,o)}catch(t){Qn(`${Jn(r)} ${e} ${Jn(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n,o=e.arguments.map((e=>ji(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(ao.has(i))n=ao.get(i);else{const t=vo("function",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>Gn(t.type))).join(", "),n=`${r}(${Ci(o)})`;"few"===t.type&&0===o.length?Qn(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Qn(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Qn(n,`Unknown function name: ${r}.`)}n=t.func,t.conversions&&(o=go(n,o))}if(!n)throw new Error("Function not found");try{return n.cb(t,...o)}catch(t){Qn(`${r}(${Ci(o)})`,t.message)}},MethodExpression:function(t,e){const r=e.method.name;let n;e.arguments.unshift(e.object);let o=e.arguments.map((e=>ji(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(lo.has(i))n=lo.get(i);else{const t=vo("method",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.slice(1).map((t=>Gn(t.type))).join(", "),n=`${r}(${Ci(o.slice(1))})`;"few"===t.type&&1===o.length?Qn(n,`Non empty argument list is required for method '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Qn(n,`Method '${r}' has no matching override for given argument types: ${e}.`):Qn(n,`Unknown method name: ${r}.`)}n=t.func,t.conversions&&(o=go(n,o))}if(!n)throw new Error("Method not found");try{return n.cb(t,...o)}catch(t){Qn(`${r}(${Ci(o.slice(1))})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function ji(t,e){if(e.type in Ai)return Ai[e.type](t,e);throw new Error("Unsupported expression")}class Fi{constructor(t){this.ast=t}apply(t,e,r,n=!1){try{const o=function(t,e,r){try{const n={variables:t,warnings:[],safeIntegerOverflow:!1,store:e},o=ji(n,r);return n.safeIntegerOverflow&&n.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:o,warnings:n.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,r,this.ast);o.warnings.forEach(e);const i=o.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const a=i.value;if(a instanceof Date)return Hn(a);if("boolean"===i.type)return Boolean(a);if("color"===i.type){const t=ft(String(a));if(t)return to(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return a>2147483647||a<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(a);if(!n&&("array"===i.type||"dict"===i.type))try{return JSON.stringify(a)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return a}catch(t){return void e(st(new Error("Expression execution error")))}}}function Vi(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=function(t,e){var r,n={},o=(e=void 0!==e?e:{}).grammarSource,i={start:Ee,JsonStringContents:function(){var t,e,r;for(t=pe,e=[],r=Ce();r!==n;)e.push(r),r=Ce();return ve=t,At(e)}},a=Ee,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",A="!",j=".",F="(",V=")",D=",",S="'",O="e",P="E",I=/^[^}]/,M=/^[^'}]/,T=/^[0-9]/,N=/^[a-zA-Z_]/,z=/^[a-zA-Z_0-9]/,R=/^[ \t\r\n]/,B=be("@{",!1),U=be("}",!1),W=be("@{}",!1),L=be("\\",!1),H={type:"any"},q=_e(["}"],!0,!1),J=be("?",!1),G=be(":",!1),Z=be("!:",!1),Y=be("||",!1),X=be("&&",!1),Q=be("==",!1),K=be("!=",!1),tt=be(">=",!1),et=be(">",!1),rt=be("<=",!1),nt=be("<",!1),ot=be("+",!1),it=be("-",!1),at=be("/",!1),st=be("*",!1),lt=be("%",!1),ct=be("!",!1),ut=be(".",!1),dt=be("(",!1),pt=be(")",!1),vt=be(",",!1),gt=we("string"),ft=be("'",!1),ht=_e(["'","}"],!0,!1),mt=we("integer"),yt=_e([["0","9"]],!1,!1),bt=we("number"),_t=be("e",!1),wt=be("E",!1),$t=_e([["a","z"],["A","Z"],"_"],!1,!1),xt=_e([["a","z"],["A","Z"],"_",["0","9"]],!1,!1),kt=we("whitespace"),Et=_e([" ","\t","\r","\n"],!1,!1),Ct=function(t){return t},At=function(t){return An(t)},jt=function(t){return t},Ft=function(){return""},Vt=function(){return ye()},Dt=function(){throw new Error("Error tokenizing '"+t+"'.")},St=function(){throw new Error("Error tokenizing '"+t+"'.")},Ot=function(t){return t},Pt=function(t){return Fn(t)},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Mt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Tt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Nt=function(t,e){return Cn(t,e)},zt=function(t,e){return Cn(t,e)},Rt=function(t,e){return En(t,e)},Bt=function(t,e){return En(t,e)},Ut=function(t,e){return En(t,e)},Wt=function(t,e){return En(t,e)},Lt=function(t){return t},Ht=function(t){return t},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Jt=function(t,e){return function(t,e){return e.length?e.reduce(((t,e)=>{if(!e[5])throw new Error("Method expected after .");return{type:"MethodExpression",object:t,method:e[3],arguments:e[5][2]}}),t):t}(t,e)},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t,e){return[t,...e]},Yt=function(t){return t},Xt=function(t){return t},Qt=function(t){return An(t)},Kt=function(t){return t},te=function(){return""},ee=function(){return ye()},re=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ie=function(t){return Fn(t)},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){return{type:"IntegerLiteral",value:jn(ye())}},le=function(){return{type:"NumberLiteral",value:parseFloat(ye())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(ye())}},ue=function(){return"true"===(t=ye())||"false"===t?{type:"BooleanLiteral",value:"true"===t}:{type:"Variable",id:{type:"Identifier",name:t}};var t},de=function(){return{type:"Identifier",name:ye()}},pe=0,ve=0,ge=[{line:1,column:1}],fe=0,he=[],me=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=i[e.startRule]}function ye(){return t.substring(ve,pe)}function be(t,e){return{type:"literal",text:t,ignoreCase:e}}function _e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function we(t){return{type:"other",description:t}}function $e(e){var r,n=ge[e];if(n)return n;for(r=e-1;!ge[r];)r--;for(n={line:(n=ge[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return ge[e]=n,n}function xe(t,e,r){var n=$e(t),i=$e(e),a={source:o,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:i.line,column:i.column}};return r&&o&&"function"==typeof o.offset&&(a.start=o.offset(a.start),a.end=o.offset(a.end)),a}function ke(t){pe<fe||(pe>fe&&(fe=pe,he=[]),he.push(t))}function Ee(){var t,e;return t=pe,Ue(),(e=Ae())!==n?(Ue(),ve=t,t=Ct(e)):(pe=t,t=n),t}function Ce(){var e,r,o,i,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n?(o=Ue(),(i=Ae())!==n?(Ue(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===me&&ke(U)),a!==n?(ve=e,e=jt(i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=n,0===me&&ke(W)),r!==n&&(ve=e,r=Ft()),(e=r)===n&&(e=pe,r=pe,me++,92===t.charCodeAt(pe)?(o=u,pe++):(o=n,0===me&&ke(L)),o===n&&(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B))),me--,o===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=Vt()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n){if(o=[],I.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(q)),i!==n)for(;i!==n;)o.push(i),I.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(q));else o=n;o!==n?(125===t.charCodeAt(pe)?(i=l,pe++):(i=n,0===me&&ke(U)),i!==n?(ve=e,e=Dt()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n&&(ve=e,r=St()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)),o!==n?(ve=e,e=Ot(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=Pt(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n&&(ve=e,r=It()),e=r))))}return e}function Ae(){var e,r,o,i,a,s;return e=pe,(r=je())!==n?(Ue(),63===t.charCodeAt(pe)?(o=d,pe++):(o=n,0===me&&ke(J)),o!==n?(Ue(),(i=Ae())!==n?(Ue(),58===t.charCodeAt(pe)?(a=p,pe++):(a=n,0===me&&ke(G)),a!==n?(Ue(),(s=Ae())!==n?(ve=e,e=Mt(r,i,s)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=je()),e}function je(){var e,r,o,i;return e=pe,(r=Fe())!==n?(Ue(),t.substr(pe,2)===v?(o=v,pe+=2):(o=n,0===me&&ke(Z)),o!==n?(Ue(),(i=Ae())!==n?(ve=e,e=Tt(r,i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=Fe()),e}function Fe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Ve())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===me&&ke(Y)),s!==n?(l=Ue(),(c=Ve())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===me&&ke(Y)),s!==n?(l=Ue(),(c=Ve())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Nt(r,o)}else pe=e,e=n;return e}function Ve(){var e,r,o,i,a,s,l,c;if(e=pe,(r=De())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===me&&ke(X)),s!==n?(l=Ue(),(c=De())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===me&&ke(X)),s!==n?(l=Ue(),(c=De())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=zt(r,o)}else pe=e,e=n;return e}function De(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Se())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===me&&ke(Q)),s===n&&(t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===me&&ke(K))),s!==n?(l=Ue(),(c=Se())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===me&&ke(Q)),s===n&&(t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===me&&ke(K))),s!==n?(l=Ue(),(c=Se())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Rt(r,o)}else pe=e,e=n;return e}function Se(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Oe())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===y?(s=y,pe+=2):(s=n,0===me&&ke(tt)),s===n&&(62===t.charCodeAt(pe)?(s=b,pe++):(s=n,0===me&&ke(et)),s===n&&(t.substr(pe,2)===_?(s=_,pe+=2):(s=n,0===me&&ke(rt)),s===n&&(60===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===me&&ke(nt))))),s!==n?(l=Ue(),(c=Oe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===y?(s=y,pe+=2):(s=n,0===me&&ke(tt)),s===n&&(62===t.charCodeAt(pe)?(s=b,pe++):(s=n,0===me&&ke(et)),s===n&&(t.substr(pe,2)===_?(s=_,pe+=2):(s=n,0===me&&ke(rt)),s===n&&(60===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===me&&ke(nt))))),s!==n?(l=Ue(),(c=Oe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Bt(r,o)}else pe=e,e=n;return e}function Oe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Pe())!==n){for(o=[],i=pe,a=Ue(),43===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===me&&ke(ot)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===me&&ke(it))),s!==n?(l=Ue(),(c=Pe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),43===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===me&&ke(ot)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===me&&ke(it))),s!==n?(l=Ue(),(c=Pe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Ut(r,o)}else pe=e,e=n;return e}function Pe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Ie())!==n){for(o=[],i=pe,a=Ue(),47===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===me&&ke(at)),s===n&&(42===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===me&&ke(st)),s===n&&(37===t.charCodeAt(pe)?(s=C,pe++):(s=n,0===me&&ke(lt)))),s!==n?(l=Ue(),(c=Ie())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),47===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===me&&ke(at)),s===n&&(42===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===me&&ke(st)),s===n&&(37===t.charCodeAt(pe)?(s=C,pe++):(s=n,0===me&&ke(lt)))),s!==n?(l=Ue(),(c=Ie())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Wt(r,o)}else pe=e,e=n;return e}function Ie(){var e,r,o,i;return e=pe,r=pe,me++,45===t.charCodeAt(pe)?(o=x,pe++):(o=n,0===me&&ke(it)),me--,o!==n?(pe=r,r=void 0):r=n,r!==n&&(o=Re())!==n?(ve=e,e=Lt(o)):(pe=e,e=n),e===n&&(e=pe,r=pe,me++,45===t.charCodeAt(pe)?(o=x,pe++):(o=n,0===me&&ke(it)),me--,o!==n?(pe=r,r=void 0):r=n,r!==n&&(o=ze())!==n?(ve=e,e=Ht(o)):(pe=e,e=n),e===n&&(e=pe,33===t.charCodeAt(pe)?(r=A,pe++):(r=n,0===me&&ke(ct)),r===n&&(43===t.charCodeAt(pe)?(r=$,pe++):(r=n,0===me&&ke(ot)),r===n&&(45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)))),r!==n?(o=Ue(),(i=Me())!==n?(ve=e,e=qt(r,i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=Me()))),e}function Me(){var e,r,o,i,a,s,l,c,u,d,p,v,g,f,h;if(e=pe,r=function(){var e,r,o,i,a;return e=pe,(r=Be())!==n?(Ue(),40===t.charCodeAt(pe)?(o=F,pe++):(o=n,0===me&&ke(dt)),o!==n?(Ue(),(i=Te())!==n?(Ue(),41===t.charCodeAt(pe)?(a=V,pe++):(a=n,0===me&&ke(pt)),a!==n?(ve=e,e=Gt(r,i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=function(){var e,r,o,i;return e=function(){var e,r,o,i,a,s,l,c,u,d,p;if(e=pe,N.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke($t)),r!==n){if(o=[],i=[],z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt));else i=n;for(i===n&&(i=pe,46===t.charCodeAt(pe)?(a=j,pe++):(a=n,0===me&&ke(ut)),a!==n?(s=pe,me++,l=pe,c=Ue(),(u=Be())!==n?(d=Ue(),40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?l=c=[c,u,d,p]:(pe=l,l=n)):(pe=l,l=n),me--,l===n?s=void 0:(pe=s,s=n),s!==n?i=a=[a,s]:(pe=i,i=n)):(pe=i,i=n));i!==n;){if(o.push(i),i=[],z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt));else i=n;i===n&&(i=pe,46===t.charCodeAt(pe)?(a=j,pe++):(a=n,0===me&&ke(ut)),a!==n?(s=pe,me++,l=pe,c=Ue(),(u=Be())!==n?(d=Ue(),40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?l=c=[c,u,d,p]:(pe=l,l=n)):(pe=l,l=n),me--,l===n?s=void 0:(pe=s,s=n),s!==n?i=a=[a,s]:(pe=i,i=n)):(pe=i,i=n))}ve=e,e=ue()}else pe=e,e=n;return e}(),e===n&&(e=function(){var e,r,o,i;return me++,e=pe,39===t.charCodeAt(pe)?(r=S,pe++):(r=n,0===me&&ke(ft)),r!==n?(o=function(){var t,e,r;for(t=pe,e=[],r=Ne();r!==n;)e.push(r),r=Ne();return ve=t,Qt(e)}(),39===t.charCodeAt(pe)?(i=S,pe++):(i=n,0===me&&ke(ft)),i!==n?(ve=e,e=Xt(o)):(pe=e,e=n)):(pe=e,e=n),me--,e===n&&(r=n,0===me&&ke(gt)),e}(),e===n&&(e=Re())===n&&(e=ze())===n&&(e=pe,40===t.charCodeAt(pe)?(r=F,pe++):(r=n,0===me&&ke(dt)),r!==n?(Ue(),(o=Ae())!==n?(Ue(),41===t.charCodeAt(pe)?(i=V,pe++):(i=n,0===me&&ke(pt)),i!==n?(ve=e,e=Yt(o)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n))),e}()),e}(),r!==n){for(o=[],i=pe,a=Ue(),46===t.charCodeAt(pe)?(s=j,pe++):(s=n,0===me&&ke(ut)),s!==n?(l=Ue(),(c=Be())!==n?(u=Ue(),d=pe,40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?(v=Ue(),(g=Te())!==n?(f=Ue(),41===t.charCodeAt(pe)?(h=V,pe++):(h=n,0===me&&ke(pt)),h!==n?d=p=[p,v,g,f,h]:(pe=d,d=n)):(pe=d,d=n)):(pe=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),46===t.charCodeAt(pe)?(s=j,pe++):(s=n,0===me&&ke(ut)),s!==n?(l=Ue(),(c=Be())!==n?(u=Ue(),d=pe,40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?(v=Ue(),(g=Te())!==n?(f=Ue(),41===t.charCodeAt(pe)?(h=V,pe++):(h=n,0===me&&ke(pt)),h!==n?d=p=[p,v,g,f,h]:(pe=d,d=n)):(pe=d,d=n)):(pe=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(pe=i,i=n)):(pe=i,i=n);ve=e,e=Jt(r,o)}else pe=e,e=n;return e}function Te(){var e,r,o,i,a,s;if(e=pe,(r=Ae())!==n){for(o=[],i=pe,Ue(),44===t.charCodeAt(pe)?(a=D,pe++):(a=n,0===me&&ke(vt)),a!==n?(Ue(),(s=Ae())!==n?i=s:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,Ue(),44===t.charCodeAt(pe)?(a=D,pe++):(a=n,0===me&&ke(vt)),a!==n?(Ue(),(s=Ae())!==n?i=s:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Zt(r,o)}else pe=e,e=n;return e===n&&(e=Ue()),e}function Ne(){var e,r,o,i,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n?(o=Ue(),(i=Ae())!==n?(Ue(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===me&&ke(U)),a!==n?(ve=e,e=Kt(i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=n,0===me&&ke(W)),r!==n&&(ve=e,r=te()),(e=r)===n&&(e=pe,r=pe,me++,92===t.charCodeAt(pe)?(o=u,pe++):(o=n,0===me&&ke(L)),o===n&&(39===t.charCodeAt(pe)?(o=S,pe++):(o=n,0===me&&ke(ft)),o===n&&(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)))),me--,o===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=ee()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n){if(o=[],M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(ht)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(ht));else o=n;o!==n?(125===t.charCodeAt(pe)?(i=l,pe++):(i=n,0===me&&ke(U)),i!==n?(ve=e,e=re()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n&&(ve=e,r=ne()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)),o!==n?(ve=e,e=oe(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=ie(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n&&(ve=e,r=ae()),e=r))))}return e}function ze(){var e,r,o,i;if(me++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt)),i!==n)for(;i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));else o=n;return o!==n?(ve=e,e=se()):(pe=e,e=n),me--,e===n&&(r=n,0===me&&ke(mt)),e}function Re(){var e,r,o,i,a,s,l,c,u,d;for(me++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));if(46===t.charCodeAt(pe)?(i=j,pe++):(i=n,0===me&&ke(ut)),i!==n){if(a=[],T.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===me&&ke(yt)),s!==n)for(;s!==n;)a.push(s),T.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===me&&ke(yt));else a=n;if(a!==n){if(s=pe,101===t.charCodeAt(pe)?(l=O,pe++):(l=n,0===me&&ke(_t)),l===n&&(69===t.charCodeAt(pe)?(l=P,pe++):(l=n,0===me&&ke(wt))),l!==n){if(43===t.charCodeAt(pe)?(c=$,pe++):(c=n,0===me&&ke(ot)),c===n&&(45===t.charCodeAt(pe)?(c=x,pe++):(c=n,0===me&&ke(it))),c===n&&(c=null),u=[],T.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===me&&ke(yt)),d!==n)for(;d!==n;)u.push(d),T.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===me&&ke(yt));else u=n;u!==n?s=l=[l,c,u]:(pe=s,s=n)}else pe=s,s=n;s===n&&(s=null),ve=e,e=le()}else pe=e,e=n}else pe=e,e=n;if(e===n){if(e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt)),i!==n)for(;i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));else o=n;if(o!==n)if(101===t.charCodeAt(pe)?(i=O,pe++):(i=n,0===me&&ke(_t)),i===n&&(69===t.charCodeAt(pe)?(i=P,pe++):(i=n,0===me&&ke(wt))),i!==n){if(43===t.charCodeAt(pe)?(a=$,pe++):(a=n,0===me&&ke(ot)),a===n&&(45===t.charCodeAt(pe)?(a=x,pe++):(a=n,0===me&&ke(it))),a===n&&(a=null),s=[],T.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===me&&ke(yt)),l!==n)for(;l!==n;)s.push(l),T.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===me&&ke(yt));else s=n;s!==n?(ve=e,e=ce()):(pe=e,e=n)}else pe=e,e=n;else pe=e,e=n}return me--,e===n&&(r=n,0===me&&ke(bt)),e}function Be(){var e,r,o,i;if(e=pe,N.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke($t)),r!==n){for(o=[],z.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(xt));i!==n;)o.push(i),z.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(xt));ve=e,e=de()}else pe=e,e=n;return e}function Ue(){var e,r;for(me++,e=[],R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke(Et));r!==n;)e.push(r),R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke(Et));return me--,r=n,0===me&&ke(kt),e}if((r=a())!==n&&pe===t.length)return r;throw r!==n&&pe<t.length&&ke({type:"end"}),function(t,e,r){return new Vn(Vn.buildMessage(t,e),t,e,r)}(he,fe<t.length?t.charAt(fe):null,fe<t.length?xe(fe,fe+1):xe(fe,fe))}(t,{startRule:"JsonStringContents"}),n=Xn(r);return e.vars.push(...n),new Fi(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=>Vi(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Vi(t[o],e,r);return n}}var n;return t}function Di(t,e,r,n,o=!1){if(t){if(t instanceof Fi)return t.apply(e,r,n,o);if(Array.isArray(t))return t.map((t=>Di(t,e,r,n)));if("object"==typeof t){const o={};for(const i in t)o[i]=Di(t[i],e,r,n);return o}}return t}function Si(t,e,r){const n={vars:[],hasExpression:!1},o=Vi(t,n,e);return{vars:[...new Set(n.vars)],hasExpression:n.hasExpression,applyVars:(t,n)=>Di(o,t,e,r,n)}}const Oi={pagers:function(){return Q(new Map)}},Pi=new Map,Ii=new Map;function Mi(t){const e=Pi.get(t)||Q("");return Pi.has(t)||Pi.set(t,e),e}function Ti(t){const e=Ii.get(t)||new Map;return Ii.has(t)||Ii.set(t,e),e}class Ni{setVariable(t){const e=t.getName(),r=Ti(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Mi(this).set(e)}getVariable(t){return Ti(this).get(t)}list(){return Ti(this).values()}}function zi(){return new Ni}function Ri(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 Bi=new Set(["start","stop","pause","resume","cancel","reset"]);class Ui{constructor(t){Ri(this,"timers",new Map),Ri(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)&&Bi.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 n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}async tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),await 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((async()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&await this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),o=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((async()=>{await this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-o)%r,"running"===t.state&&e()}),o)};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))}async callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);return this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}async 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&&await this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Wi(t,e,r,n){const{variable_name:o}=r;if(!o)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:o}}));const i=t.get(o);if(!i)return void e(st(new Error("Cannot find variable"),{additional:{name:o}}));const a=i.getType();"array"===a?n(i):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:o,type:a}}))}const Li={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},Hi=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,C=i;var A,j,F,V;let{ownerNode:D}=e,{data:S}=e,{internalId:O}=e,{parentComponentContext:P}=e;b=l(f(at).isDesktop,(t=>y=t)),Date.now();return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==D&&r.ownerNode(D),void 0===e.data&&r.data&&void 0!==S&&r.data(S),void 0===e.internalId&&r.internalId&&void 0!==O&&r.internalId(O),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==P&&r.parentComponentContext(P),o=P.produceChildContext(S.div),a=P.getDerivedFromVars(S.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(j=null===(A=S.offset)||void 0===A?void 0:A.x)||void 0===j?void 0:j.value),x(),x=l(s,(t=>h=t)),c=P.getDerivedFromVars(null===(V=null===(F=S.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),$(),$=l(c,(t=>g=t)),u=P.getDerivedFromVars(S.animation_in),E(),E=l(u,(t=>_=t)),d=P.getDerivedFromVars(S.animation_out),C(),C=l(d,(t=>w=t)),p={visible:!1},$(),x(),k(),b(),E(),C(),` <div class="${I(Ft("tooltip",Li,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${R(_n,"Unknown").$$render(t,{componentContext:o},{},{})}</div>`})),qi={root_platform_desktop:"divkit-ee112",menu:"divkit-cedbe",menu_visible:"divkit-e4801",menu__list:"divkit-c8df2",menu__item:"divkit-ffd4a"},Ji=W(((t,e,r,n)=>{let o,i,a,{ownerNode:s}=e,{items:c}=e,{parentComponentContext:u}=e;const d=f(at),g=d.getCustomization("menuPopupClass")||"",h=d.getCustomization("menuItemClass")||"";a=l(d.isDesktop,(t=>i=t)),Date.now();const m=function(){const t=p();return(e,r,{cancelable:n=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}(e,r,{cancelable:n});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}();function y(){return m("close"),!0}return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==s&&r.ownerNode(s),void 0===e.items&&r.items&&void 0!==c&&r.items(c),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==u&&r.parentComponentContext(u),o={visible:!1},a(),` <div class="${I(Ft("menu",qi,o),!0)+" "+I(i?nt:"",!0)+" "+I(g,!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}><ul${L("class",qi.menu__list,0)}>${N(c,(e=>`<li>${R(Gt,"Actionable").$$render(t,{componentContext:u,actions:e.actions||e.action&&[e.action],cls:qi.menu__item+" "+h,customAction:y},{},{default:()=>`${I(e.text)} `})} </li>`))}</ul></div>`}));let Gi=Q(!0),Zi=0;function Yi(){Gi.set(!1)}function Xi(){Gi.set(!0)}const Qi=new Set(["string","integer","number","url","color","boolean"]);function Ki(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const ta=W(((t,e,r,n)=>{let o,i,a,s,c,u;var d,p,f,h;let{id:m}=e,{json:y={}}=e,{platform:b="auto"}=e,{theme:_="system"}=e,{globalVariablesController:w=new Ni}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:A}=e,{onStat:j}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:M="ltr"}=e,{store:T}=e,z=Q("desktop"===b);if(s=l(z,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");z.set(!t.matches),t.addListener((()=>{z.set(!t.matches)}))}let B="light",U=null;const W=Q("rtl"===M?"rtl":"ltr");function H(t){_=t}function q(){return new Map}function J(){return new Map}function G(t){y=t}u=l(W,(t=>c=t));const Z=new Set(E);let Y=!1,X=!1;m||(X=!0,ft(st(new Error('"id" prop is required'))));const tt={stateChange:!1},et=Mi(w),rt=Ti(w),ot=new Map,it=new Map,lt=new Map;let ct,ut=null,dt=0,pt=[];const vt=[];function gt(t,e,r,n=!1){const o=Si(e,t,T);if(!o.hasExpression)return e;const i=Ki(it,r);return o.applyVars(i,n)}function ft(t){A?A({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function ht(t,e){j&&j({type:t,action:e})}function yt(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in o;){if(({json:t,templateContext:e}=$n(t,e,o,ft)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let bt=0;function _t(t){return`${m}-${bt++}`}let wt={},$t={};function Et(t){Ct(gt(ft,t))}async function Ct(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Wt(t))return;const i=(null==e?void 0:e.logError)||ft;if(r)try{const n=r.replace(/div-action:\/\//,""),a=/([^?]+)\?(.+)/.exec(n);if(!a)return;const s=new URLSearchParams(a[2]);switch(a[1]){case"set_state":await async function(t){if(!t)throw new Error("Missing state id");let e=Mt,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 n=r[t],o=r[t+1];let i=e.getChild(n);if(!i)return;await i.setState(o),e=i}}(s.get("state_id"));break;case"set_current_item":case"set_previous_item":case"set_next_item":case"scroll_to_start":case"scroll_to_end":case"scroll_backward":case"scroll_forward":case"scroll_to_position":!function(t,e,{item:r,step:n,overflow:o}){var i,a,s,l,c;if(!e)throw new Error(`Missing id for "${t}" action`);const u=Number(r);if("set_current_item"===t&&Number.isNaN(u))throw new Error(`Incorrect item for "${t}" action`);let d=Number(n);if(n||"set_previous_item"!==t&&"set_next_item"!==t||(d=1),!n&&("scroll_backward"===t||"scroll_forward"===t||"scroll_to_position"===t)||Number.isNaN(d))throw new Error(`Incorrect step value for "${t}" action`);if(o&&"clamp"!==o&&"ring"!==o)throw new Error(`Incorrect overflow value for "${t}" action`);o=o||"clamp";const p=Pt(e);if(p)switch(t){case"set_current_item":return void p.setCurrentItem(u);case"set_previous_item":return void p.setPreviousItem(d,o);case"set_next_item":return void p.setNextItem(d,o);case"scroll_to_start":return void(null===(i=p.scrollToStart)||void 0===i||i.call(p));case"scroll_to_end":return void(null===(a=p.scrollToEnd)||void 0===a||a.call(p));case"scroll_backward":return void(null===(s=p.scrollBackward)||void 0===s||s.call(p,d,o));case"scroll_forward":return void(null===(l=p.scrollForward)||void 0===l||l.call(p,d,o));case"scroll_to_position":null===(c=p.scrollToPosition)||void 0===c||c.call(p,d)}}(a[1],s.get("id"),{item:s.get("item"),step:s.get("step"),overflow:s.get("overflow")});break;case"set_variable":const l=s.get("name"),c=s.get("value");if(l&&null!==c){const t=it.get(l);if(t){const e=t.getType();"dict"===e||"array"===e?i(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:l}})):t.set(c)}else i(st(new Error("Cannot find variable"),{additional:{name:l}}))}else i(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const u=s.get("action"),d=s.get("id");ut?ut.execTimerAction(d,u):i(st(new Error("Incorrect timer action"),{additional:{id:d,action:u}}));break;case"video":!function(t,e,r){const n=(null==r?void 0:r.logError)||ft;if(t){const r=Pt(t);r?"start"===e?r.start():"pause"===e?r.pause():n(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):n(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else n(st(new Error("Missing id in video action"),{additional:{action:e}}))}(s.get("id"),s.get("action"),e);break;case"download":!function(t,e,r){const n=(null==r?void 0:r.logError)||ft;if(t){let r;r="function"==typeof S?S(t):S,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,a,s;if(r){if(r.templates)for(const t in r.templates)o.hasOwnProperty(t)||(o[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const o=r.patch.changes.find((t=>{const e=Dt.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));if(o)return n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:o.id}})),void At(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Dt.get(t.id);e&&e.replaceWith(t.id,t.items)})),At(null===(s=e.download_callbacks)||void 0===s?void 0:s.on_success_actions)}}else n(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var o;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),At(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}))}else n(st(new Error("Missing url in download action"),{additional:{url:t}}))}(s.get("url"),t,e);break;case"show_tooltip":!function(t,e,r){var n;const o=(null==r?void 0:r.logError)||ft;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=Ot.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&pt.some((e=>e.desc.id===t)))return;const a={internalId:++dt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};pt=[...pt,a];const s=null!==(n=i.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,pt=pt.filter((t=>t.internalId!==a.internalId))}),s))}(s.get("id"),s.get("multiple"),e);break;case"hide_tooltip":!function(t,e){const r=(null==e?void 0:e.logError)||ft;t?pt=pt.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):r(st(new Error("Missing id in hide_tooltip action")))}(s.get("id"),e);break;case"set_stored_value":!function(t,e,r,n,o){const i=(null==t?void 0:t.logError)||ft;if(!T)return void i(st(new Error("Store is not configured")));let a=r;e&&a&&n&&o?Qi.has(n)?("integer"===n||"number"===n?a=Number(a):"boolean"===n&&(a="true"===a),T.setValue(e,n,a,Number(o))):i(st(new Error("Incorrect stored type"))):i(st(new Error("Missing required params for set_stored_value")))}(e,s.get("name"),s.get("value"),s.get("type"),s.get("lifetime"));break;default:i(st(new Error("Unknown type of action"),{additional:{url:r}}))}}catch(t){i(st(t,{additional:{url:r}}))}else if(n)switch(n.type){case"set_variable":{const{variable_name:t,value:e}=n;if(t&&e){const r=it.get(t);r?r.getType()===e.type?r.setValue(e.value):i(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):i(st(new Error("Cannot find variable"),{additional:{name:t}}))}else i(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:n,index:o,value:i}=r;!i||"number"!=typeof o&&void 0!==o?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Wi(t,e,r,(t=>{const a=t.getValue();if("number"==typeof o&&(o<0||o>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:a.length}}));else{const e=a.slice();"number"==typeof o?e.splice(o,0,i.value):e.push(i.value),t.setValue(e)}}))}(it,i,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:o}=r;"number"==typeof o?Wi(t,e,r,(t=>{const i=t.getValue();if("number"==typeof o&&(o<0||o>=i.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:i.length}}));else{const e=i.slice();e.splice(o,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(it,i,n);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}}))}(i,n);break;case"focus_element":{const t=n.element_id&&St.get(n.element_id);t?t.focus():i(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}case"clear_focus":try{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}catch(t){}break;default:i(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function At(t,e={}){if(!t||!Array.isArray(t))return;const r=t.filter(Wt);for(let t=0;t<r.length;++t){let n=r[t];const o=n.url,i=n.typed;if(o){const t=xt(o);if(t)if(kt(t,Z)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=o)}else location.href=o}else"div-action"===t?(await Ct(n,e.componentContext),await $()):n.log_id&&(jt(n),await $())}else i?await Ct(n,e.componentContext):e.node&&Array.isArray(n.menu_items)&&n.menu_items.length&&(ct={items:n.menu_items,node:e.node})}r.forEach((t=>{t.log_id&&ht("click",t)}))}function jt(t){null==F||F(t)}const Ft=new Map,Dt=new Map,St=new Map,Ot=new Map;function Pt(t){if(Ft.has(t))return Ft.get(t);ft(st(new Error("Missing instance with id"),{additional:{id:t}}))}const It=new Map;g(at,{logStat:ht,hasTemplate:function(t){return t in o},processTemplate:yt,genId:_t,genClass:function(t){return`divkit-${_t()}`},execAction:Ct,execCustomAction:jt,isRunning:function(t){return tt[t]},setRunning:function(t,e){tt[t]=e},registerInstance:function(t,e){Ft.has(t)?ft(st(new Error("Duplicate instance id"),{additional:{id:t}})):Ft.set(t,e)},unregisterInstance:function(t){Ft.delete(t)},registerParentOf:function(t,e){Dt.set(t,e)},unregisterParentOf:function(t){Dt.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(Ot.has(r)&&ft(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),Ot.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(Ot.delete(e),pt.some((t=>t.desc.id===e))&&(pt=pt.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){pt=pt.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){St.set(t,e)},unregisterFocusable:function(t){St.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if($t[r]=$t[r]||0,++$t[r],wt[r])return wt[r];const n=`${_t()}-svg-filter`;return wt=Object.assign(Object.assign({},wt),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;$t[r]&&0==--$t[r]&&(wt=Object.keys(wt).reduce(((t,e)=>($t[e]&&(t[e]=wt[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Hr))throw new Error("Unsupported variable type");return new Hr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return It.has(t)||function(t){It.has(t)||It.set(t,Oi[t]())}(t),It.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return Z},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:it,logError:ft}},registerTimeout:function(t){vt.push(t)},typefaceProvider:D,isDesktop:z,isPointerFocus:Gi,customComponents:P,direction:W,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const Mt={setState(t){throw new Error("Not implemented")},getChild(t){if(Tt&&Tt.has(t))return Tt.get(t);ft(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Tt=null;function Nt(t){if(t.type in Rr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&ft(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Br(t.name,t.type,t.value);ot.set(t.name,e),it.set(t.name,e)}catch(e){ft(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Tt||(Tt=new Map),Tt.has(t)?ft(st(new Error("Duplicate state with id"),{additional:{id:t}})):Tt.set(t,e)},unregisterInstance(t){null==Tt||Tt.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const zt=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(zt)&&zt.forEach((t=>{if(t&&t.name){if(ot.has(t.name))return void ft(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Nt(t)}}));const Rt=y.palette;Rt&&Rt[B].forEach((t=>{if(ot.has(t.name))ft(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Br(t.name,"color",t.color);ot.set(t.name,e),it.set(t.name,e)}catch(e){ft(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of rt)it.has(t)||it.set(t,e);et.subscribe((t=>{if(t&&!it.has(t)){const e=rt.get(t);it.set(t,e);const r=lt.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Bt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Bt&&"undefined"!=typeof document){const t=ut=new Ui({logError:ft,applyVars:t=>gt(ft,t),hasVariableWithType:function(t,e){const r=it.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=it.get(t);r?r.setValue(e):ft(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:At});Bt.forEach((e=>t.createTimer(e)))}const Ut=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),ft(t)},execAnyActions:(t,e={})=>At(t,{componentContext:r,processUrls:e.processUrls,node:e.node}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return kn(e);const o=Ki(it,r),i=Si(e,t,T);return i.vars.length?K(i.vars.map((t=>o.get(t)||function(t){const e=lt.get(t)||Q(void 0);return lt.has(t)||lt.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(o,n))):i.hasExpression?kn(i.applyVars(o)):kn(e)}(r.logError,t,Ki(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>gt(r.logError,t,Ki(r.variables,e),n),produceChildContext(e,n={}){const o=t(r);let i=e,a=r.templateContext;const{templateContext:s,json:l}=yt(i,a);return o.json=l,o.templateContext=s,o.origJson=e,void 0!==n.path&&o.path.push(String(n.path)),e.type&&!n.isRootState&&o.path.push(e.type),o.variables=Ki(r.variables,n.variables),n.fake&&(o.fakeElement=!0),n.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const n=(r.variables||it).get(t);if(n){const o=n.getType();if(o!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:o}}))}return n}};return e?(r.parent=e,r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let Lt;v((()=>{Zi--,Zi||(window.removeEventListener("keydown",Yi),window.removeEventListener("pointerdown",Xi)),ut&&ut.destroy(),pt.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)})),vt.forEach((t=>{clearTimeout(t)}))})),void 0===e.id&&r.id&&void 0!==m&&r.id(m),void 0===e.json&&r.json&&void 0!==y&&r.json(y),void 0===e.platform&&r.platform&&void 0!==b&&r.platform(b),void 0===e.theme&&r.theme&&void 0!==_&&r.theme(_),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==w&&r.globalVariablesController(w),void 0===e.mix&&r.mix&&void 0!==x&&r.mix(x),void 0===e.customization&&r.customization&&void 0!==k&&r.customization(k),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==E&&r.builtinProtocols(E),void 0===e.extensions&&r.extensions&&void 0!==C&&r.extensions(C),void 0===e.onError&&r.onError&&void 0!==A&&r.onError(A),void 0===e.onStat&&r.onStat&&void 0!==j&&r.onStat(j),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==F&&r.onCustomAction(F),void 0===e.onComponent&&r.onComponent&&void 0!==V&&r.onComponent(V),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==D&&r.typefaceProvider(D),void 0===e.fetchInit&&r.fetchInit&&void 0!==S&&r.fetchInit(S),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==O&&r.tooltipRoot(O),void 0===e.customComponents&&r.customComponents&&void 0!==P&&r.customComponents(P),void 0===e.direction&&r.direction&&void 0!==M&&r.direction(M),void 0===e.store&&r.store&&void 0!==T&&r.store(T),void 0===e.setTheme&&r.setTheme&&void 0!==H&&r.setTheme(H),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==q&&r.getDebugVariables(q),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==J&&r.getDebugAllVariables(J),void 0===e.setData&&r.setData&&void 0!==G&&r.setData(G),void 0===e.execAction&&r.execAction&&void 0!==Et&&r.execAction(Et),"light"===_||"dark"===_?B=_:"system"===_?"undefined"!=typeof matchMedia?(U||(U=matchMedia("(prefers-color-scheme: dark)"),U.addListener((function(){"system"===_&&U&&(B=U.matches?"dark":"light")}))),B=U.matches?"dark":"light"):B="light":ft(st(new Error("Unsupported theme"))),B&&Rt&&Rt[B].forEach((t=>{const e=it.get(t.name);e&&e.setValue(t.color)}));{Y=!1;const t=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 bn)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}(y);t&&(Y=!0,ft(t))}if(o=y.templates||{},(null===(p=null==y?void 0:y.card)||void 0===p?void 0:p.variables)&&Array.isArray(y.card.variables)&&y.card.variables!==zt&&y.card.variables.forEach((t=>{t&&t.name&&!ot.has(t.name)&&Nt(t)})),i=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,i&&!Y&&!X){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:i.map((t=>({state_id:t.state_id.toString(),div:t.div})))};Lt=Ut.produceChildContext(t,{isRootState:!0})}return s(),u(),Y||X||!Lt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${L("dir",c,0)}>${R(wn,"RootSvgFilters").$$render(t,{svgFiltersMap:wt},{},{})} ${R(_n,"Unknown").$$render(t,{componentContext:Lt},{},{})} ${pt?`${N(pt,(e=>`${R(Hi,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:Lt},{},{})}`))}`:""} ${ct?`${R(Ji,"Menu").$$render(t,{ownerNode:ct.node,items:ct.items,parentComponentContext:Lt},{},{})}`:""}</div>`})),ea=ta;function ra(t){return ea.render(t).html}var na=exports;for(var oa in e)na[oa]=e[oa];e.__esModule&&Object.defineProperty(na,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>zi,createVariable:()=>Br,render:()=>ra}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function n(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 o{constructor(t){n(this,"_listeners","WeakMap"in r?new WeakMap:void 0),n(this,"_observer",void 0),n(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;o.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function i(){}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 i}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 v(t){p().$$.on_destroy.push(t)}function g(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}o.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),A(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 A(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 j=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"]),F=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function V(t){return F.test(t)||"!doctype"===t.toLowerCase()}const D=/[\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 S(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=H(n):r.style=H(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),o=e.slice(t+1).trim();n&&(r[n]=o)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(D.test(t))return;const e=r[t];!0===e?n+=" "+t:j.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const O=/[&"]/g,P=/[&<]/g;function I(t,e=!1){const r=String(t),n=e?O:P;n.lastIndex=0;let o="",i=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];o+=r.substring(i,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),i=t+1}return o+r.substring(i)}function M(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function T(t){const e={};for(const r in t)e[r]=M(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 n="";for(let r=0;r<t.length;r+=1)n+=e(t[r],r);return n}const z={$$render:()=>""};function R(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 B,U;function W(t){function e(e,r,n,o,i){const a=u;d({$$:{on_destroy:B,context:new Map(i||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,o);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{B=[];const o={title:"",head:"",css:new Set},i=e(o,t,{},r,n);return s(B),{html:i,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function L(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${I(e,!0)}"`}`}function H(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${M(t[e])};`)).join(" ")}function q(t){const e=H(t);return e?` style="${e}"`:""}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(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 n=r.call(t,"string");if("object"!=typeof n)return n;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,n){var o;const i=null===(o=r[t])||void 0===o?void 0:o.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)switch(i){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(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(U=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 o of this.$$s)o in r&&(e[o]=[t(o)]);for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=Y(a,i.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const n=()=>{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(n),n();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 n;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,r,this.$$p_d,"toProp"),null===(n=this.$$c)||void 0===n||n.$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 Q(t,e=i){let r;const n=new Set;function o(e){if(i=e,((o=t)!=o?i==i:o!==i||o&&"object"==typeof o||"function"==typeof o)&&(t=e,r)){const e=!X.length;for(const e of n)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 o,i}function a(e){o(e(t))}return{set:o,update:a,subscribe:function(s,l=i){const c=[s,l];return n.add(c),1===n.size&&(r=e(o,a)||i),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),o=n?[t]:t;if(!o.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=i;const v=()=>{if(d)return;p();const o=e(n?u[0]:u,t,r);a?t(o):p="function"==typeof o?o:i},g=o.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&v()}),(()=>{d|=1<<e}))));return c=!0,v(),function(){s(g),p(),c=!1}},{subscribe:Q(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",nt="divkit-ee112",ot="divkit-aa145",it="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_start:"divkit-e70de",text_halign_center:"divkit-e1659",text_halign_end:"divkit-e48b4",text_valign_start:"divkit-b7b70",text_valign_center:"divkit-ef58e",text_valign_end:"divkit-d4206",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 Number.isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function vt(t,e){for(;t.length<e;)t="0"+t;return t}function gt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const n=ft(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>vt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):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,n,o,i]=e,a=2===n.length?n:n+n,s=2===o.length?o:o+o,l=2===i.length?i:i+i,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,n,o]=e,i=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===o.length?o:o+o;return{a:255,r:parseInt(i,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,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:gt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=gt(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=>gt(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 n=t.bg.radius;let o;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?o=pt(n.value):"relative"===n.type&&(o=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${o||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>gt(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){if(t.startsWith("tel:"))return"tel";const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e){const r=Number(t);return Number.isNaN(r)||r<0?e:r}function Ct(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function At(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function jt(t,e){e&&t.push(e)}function Ft(t,e,r){const n=[];jt(n,e[t]);for(const o in r)if(r.hasOwnProperty(o)){const i=r[o];i&&jt(n,e[`${t}_${o}`+("string"==typeof i?`_${i}`:"")])}return n.join(" ")}const Vt=Symbol("state");function Dt(t,e){var r,n;const o=t.top||0,i=(null!==(r="ltr"===e?t.end:t.start)&&void 0!==r?r:t.right)||0,a=t.bottom||0,s=(null!==(n="ltr"===e?t.start:t.end)&&void 0!==n?n:t.left)||0;return 0===o&&0===i&&0===a&&0===s?"":dt(o)+" "+dt(i)+" "+dt(a)+" "+dt(s)}function St(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!Number.isNaN(e)}function Ot(t){return St(t)&&t>=0}function Pt(t,e,r){var n,o;if(!t)return r;const i=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(o="ltr"===e?t.start:t.end)&&void 0!==o?o:t.left];for(let t=0;t<i.length;++t)if(i[t]&&!Ot(i[t]))return r;return Dt(t,e)}const It=Object.prototype.hasOwnProperty;function Mt(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),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const o=r[n];if(!It.call(e,o)||!Mt(t[o],e[o]))return!1}return!0}function Tt(t,e){return Mt(t,e)?e:t}function Nt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function zt(t,e){const r=Number(t);return Number.isNaN(r)?e:r}function Rt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Rt(t))})):e.push(t),e}function Bt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!Ot(t[r[n]]))return e;return t}function Ut(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(t){return 0!==t.is_enabled&&!1!==t.is_enabled}let Lt;function Ht(){}const qt=Symbol("action"),Jt=W(((t,e,r,n)=>{let{componentContext:o}=e,{id:i=""}=e,{actions:a}=e,{doubleTapActions:s}=e,{longTapActions:l}=e,{cls:c=""}=e,{style:u=null}=e,{attrs:d}=e,{use:p=Ht}=e,{customAction:h=null}=e,{isNativeActionAnimation:m=!0}=e,{hasInnerFocusable:y=!1}=e;const b=f(at),_=f(qt);let w;g(qt,{hasAction:()=>Boolean(_.hasAction()||(null==a?void 0:a.length))});let $,x="",k=!1;if(v((()=>{i&&!y&&b.unregisterFocusable(i),clearTimeout(undefined)})),void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.id&&r.id&&void 0!==i&&r.id(i),void 0===e.actions&&r.actions&&void 0!==a&&r.actions(a),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==s&&r.doubleTapActions(s),void 0===e.longTapActions&&r.longTapActions&&void 0!==l&&r.longTapActions(l),void 0===e.cls&&r.cls&&void 0!==c&&r.cls(c),void 0===e.style&&r.style&&void 0!==u&&r.style(u),void 0===e.attrs&&r.attrs&&void 0!==d&&r.attrs(d),void 0===e.use&&r.use&&void 0!==p&&r.use(p),void 0===e.customAction&&r.customAction&&void 0!==h&&r.customAction(h),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==m&&r.isNativeActionAnimation(m),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==y&&r.hasInnerFocusable(y),Array.isArray(a)&&(null==a?void 0:a.length))for(let t=0;t<a.length;++t){const e=a[t].url;if(e){x=e,$=a[t].target||void 0;break}}return Array.isArray(a)&&(null==a?void 0:a.length)&&_.hasAction()&&(x="",o.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:a}}))),k=Boolean(h),x&&!kt(xt(x),b.getBuiltinProtocols())?(x="",k=!0):!x&&Array.isArray(a)&&(null==a?void 0:a.length)&&(k=!0,a.some((t=>t.url||t.typed||t.menu_items))||o.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:a}}))),x?`<a${S([{href:M(x)},{target:M($)},{style:M(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?it:"",!0)},T(d)],{})}${L("this",w,0)}>${n.default?n.default({}):""}</a>`:` <span${S([{class:I(c,!0)+I(k?` ${m?tt:et} ${rt}`:"",!0)+" "+I(null!=l&&l.length?it:"",!0)},{style:M(u)},{role:M(k?"button":null)},{tabindex:M(k?0:null)},T(d)],{})}${L("this",w,0)}>${n.default?n.default({}):""}</span>`})),Gt=Jt,Zt="divkit-b921d";function Yt(t){return St(t)&&t>0}function Xt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Yt(t.radius))return`blur(${pt(t.radius/2)})`}else{if("rtl_mirror"===t.type)return;e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:t.type}}))}else e(st(new Error("Incorrect filter"),{level:"warn"}))})).filter(Boolean).join(" ")}const Qt=W(((t,e,r,n)=>{let o,{direction:i}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return void 0===e.direction&&r.direction&&void 0!==i&&r.direction(i),void 0===e.componentContext&&r.componentContext&&void 0!==a&&r.componentContext(a),void 0===e.background&&r.background&&void 0!==s&&r.background(s),void 0===e.radius&&r.radius&&void 0!==l&&r.radius(l),o=s.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 n=yt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Xt(t.filters,a.logError),"rtl"===i&&t.filters.some((t=>"rtl_mirror"===t.type))&&(e.transform="scale(-1,1)")))}return r})),`<span${L("class","divkit-bf253"+(l?" divkit-dcad7":""),0)}${q({"border-radius":l})}>${N(o,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Zt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Zt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te={left:"start",center:"center",right:"end",start:"start",end:"end"},ee={left:"end",center:"center",right:"start",start:"start",end:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,tt,et,rt,nt,ot=i,it=i,lt=i,vt=i,ft=i,ht=i,bt=i,_t=i,wt=i,$t=i,jt=i,St=i,It=i,Ht=i,qt=i,Jt=i,Zt=i,Yt=i,{componentContext:Xt}=e,{cls:Qt=""}=e,{style:ne}=e,{layoutParams:oe={}}=e,{customDescription:ie=!1}=e,{customPaddings:ae=!1}=e,{customActions:se=""}=e,{additionalPaddings:le=null}=e,{heightByAspect:ce=!1}=e,{parentOf:ue}=e,{parentOfSimpleMode:de}=e,{replaceItems:pe}=e,{hasInnerFocusable:ve=!1}=e;const ge=f(at),fe=f(Vt);let he,me;tt=l(ge.direction,(t=>Q=t));let ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae,je,Fe,Ve,De,Se,Oe,Pe,Ie,Me,Te,Ne,ze=null,Re=[],Be={},Ue={},We=!1,Le=1,He="transparent",qe=0,Je={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ge="",Ze=null,Ye="",Xe={},Qe=0,Ke=0,tr=0,er=!1,rr=!1,nr={},or=0,ir=0,ar=0,sr=!1,lr=!1,cr=1,ur=[],dr=!1,pr=!1,vr=[],gr=[],fr=[],hr=[],mr=[],yr=[],br="",_r=!1,wr="visible",$r=0,xr=0,kr=!1,Er=null;function Cr(t,e){if(!Array.isArray(ue)||!pe)return;if(de&&1!==(Array.isArray(e)&&e.length||0))return;const r=ue.findIndex((e=>(null==e?void 0:e.id)===t)),n=ue.slice();n.splice(r,1,...e||[]),ue=n,pe(n)}function Ar(){if(ze&&he){const t=ge.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,he,t)})),ze=null}}function jr(t){var e;null==Ne||Ne.destroy(),he=t,dr&&Xt.json.transition_in&&fe.registerChildWithTransitionIn(Xt.json,Xt,Xt.json.transition_in,t).then((()=>{je=!1})).catch((t=>{throw je=!1,t})),dr&&Xt.json.transition_out&&fe.registerChildWithTransitionOut(Xt.json,Xt,Xt.json.transition_out,t),dr&&Xt.json.transition_change&&fe.registerChildWithTransitionChange(Xt.json,Xt,Xt.json.transition_change,t).then((()=>{Ve=!1})).catch((t=>{throw Ve=!1,t}));const r=Xt.fakeElement?[]:Xt.json.visibility_actions||Xt.json.visibility_action&&[Xt.json.visibility_action],n=Xt.fakeElement?[]:Xt.json.disappear_actions;let o;(Array.isArray(r)&&r.length||Array.isArray(n)&&n.length)&&(o=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:o}){const i=[];e&&e.forEach((t=>{i.push({type:"visibility",index:i.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{i.push({type:"disappear",index:i.length,action:t,visible:!1,count:0,finished:!1})}));const a=i.map(((t,e)=>{const r="visibility"===t.type;return o.getDerivedFromVars({index:e,visibility_percentage:t.action.visibility_percentage,visibility_duration:r?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit,is_enabled:t.action.is_enabled})}));let s;const l=()=>{s&&s.disconnect(),i.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t));let u;const d=t=>{const e="visibility"===t.type,r=o.getJsonWithVars(t.action),i=r.url,a=r.typed;if(i){const t=xt(i);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(r):r.log_id&&n.execCustomAction(r))}else a&&n.execAction(r);n.logStat(e?"visible":"disappear",r)},p=c.subscribe((e=>{u=e.filter(At);const r={};u.forEach((t=>{r[t.index]=t})),l();const n=[...new Set(u.map((t=>{const e="visibility"===i[t.index].type;return Ct(e,t.visibility_percentage,e?50:0)/100})))];n.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{u.forEach((e=>{const r=i[e.index],n="visibility"===r.type,o=Ct(n,e.visibility_percentage,n?50:0);let a;a=0===o?t.intersectionRatio>=1e-12:t.intersectionRatio>=o/100;const s=n?!a:a;(n?!r.visible&&a:r.visible&&!a)?r.finished||(r.timer=setTimeout((()=>{++r.count;const t=0===e.log_limit?1/0:e.log_limit||1;++r.count>=t&&(r.finished=!0),d(r)}),Et(e.visibility_duration,800))):s&&r.timer&&clearTimeout(r.timer),r.visible=a}))}))}),{threshold:n}),s.observe(t))}));return{destroy(){var t;null===(t=u)||void 0===t||t.forEach((t=>{const e=i[t.index];e&&"disappear"===e.type&&e.visible&&!e.finished&&n.registerTimeout(window.setTimeout((()=>{d(e)}),t.visibility_duration))})),l(),p()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:ge,componentContext:Xt}));const i=Xt.json.id;return i&&fe.registerChild(i),null===(e=Xt.json.tooltips)||void 0===e||e.forEach((e=>{ge.registerTooltip(t,e)})),Ne={destroy(){i&&fe.unregisterChild(i),o&&o.destroy(),Er&&Er.destroy()}},Ne}function Fr(){Xt.json.focus&&(function(t){let e;return l(t,(t=>e=t))(),e}(ge.isPointerFocus)||(kr=!0),Xt.execAnyActions(hr))}function Vr(){Xt.json.focus&&(kr=!1,Xt.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{ge.unregisterParentOf(t)})),Re=[],null===(t=Xt.json.tooltips)||void 0===t||t.forEach((t=>{ge.unregisterTooltip(t)})),Ar()})),void 0===e.componentContext&&r.componentContext&&void 0!==Xt&&r.componentContext(Xt),void 0===e.cls&&r.cls&&void 0!==Qt&&r.cls(Qt),void 0===e.style&&r.style&&void 0!==ne&&r.style(ne),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ie&&r.customDescription(ie),void 0===e.customPaddings&&r.customPaddings&&void 0!==ae&&r.customPaddings(ae),void 0===e.customActions&&r.customActions&&void 0!==se&&r.customActions(se),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==le&&r.additionalPaddings(le),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ce&&r.heightByAspect(ce),void 0===e.parentOf&&r.parentOf&&void 0!==ue&&r.parentOf(ue),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==de&&r.parentOfSimpleMode(de),void 0===e.replaceItems&&r.replaceItems&&void 0!==pe&&r.replaceItems(pe),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ve&&r.hasInnerFocusable(ve),o=Xt.origJson,o&&(Ze=null,Ye="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Ie=void 0,Me=void 0,ur=Xt.fakeElement?[]:Xt.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&Xt.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&Xt.json.id),he&&jr(he)),a=Xt.getDerivedFromVars(Xt.json.focus),vt(),vt=l(a,(t=>N=t)),s=Xt.getDerivedFromVars(Xt.json.border),Yt(),Yt=l(s,(t=>nt=t)),c=Xt.getDerivedFromVars(Xt.json.paddings),Zt(),Zt=l(c,(t=>rt=t)),u=Xt.getDerivedFromVars(Xt.json.margins),qt(),qt=l(u,(t=>X=t)),d=Xt.getDerivedFromVars(Xt.json.width),It(),It=l(d,(t=>Z=t)),p=Xt.getDerivedFromVars(Xt.json.alignment_horizontal),Jt(),Jt=l(p,(t=>et=t)),g=Xt.getDerivedFromVars(Xt.json.height),St(),St=l(g,(t=>G=t)),h=Xt.getDerivedFromVars(Xt.json.alignment_vertical),Ht(),Ht=l(h,(t=>Y=t)),m=Xt.getDerivedFromVars(Xt.json.alpha),jt(),jt=l(m,(t=>J=t)),y=Xt.getDerivedFromVars(Xt.json.accessibility),$t(),$t=l(y,(t=>q=t)),b=Xt.getDerivedFromVars(Xt.json.background),wt(),wt=l(b,(t=>H=t)),_=Xt.getDerivedFromVars(Xt.json.action),bt(),bt=l(_,(t=>U=t)),w=Xt.getDerivedFromVars(Xt.json.actions),_t(),_t=l(w,(t=>W=t)),x=Xt.getDerivedFromVars(Xt.json.doubletap_actions),ht(),ht=l(x,(t=>B=t)),k=Xt.getDerivedFromVars(Xt.json.longtap_actions),ft(),ft=l(k,(t=>z=t)),E=Xt.getDerivedFromVars(Xt.json.action_animation),lt(),lt=l(E,(t=>T=t)),C=Xt.getDerivedFromVars(Xt.json.visibility),it(),it=l(C,(t=>M=t)),A=Xt.getDerivedFromVars(Xt.json.transform),ot(),ot=l(A,(t=>I=t)),Re.forEach((t=>{ge.unregisterParentOf(t)})),Re=[],ue&&ue.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),ge.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(de)}))}));{const t=kr&&(null==N?void 0:N.border)?N.border:nt;let e={},r={},n=!1,o="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,o,i,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(n=t.offset)||void 0===n||null===(o=n.y)||void 0===o?void 0:o.value)||0)+" "+dt(null!==(i=t.blur)&&void 0!==i?i:2)+" "+gt(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&&(n=!0,Le=Et(t.stroke.width,Le),He=gt(t.stroke.color,1,He),r["--divkit-border"]=`${dt(Le+1)} solid ${He}`),t.corners_radius?(Je=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,Je),e["border-radius"]=Ut(Je),["top-left","top-right","bottom-right","bottom-left"].forEach((t=>{Je[t]=(Je[t]||0)+1})),r["--divkit-border-radius"]=Ut(Je)):t.corner_radius&&(qe=Et(t.corner_radius,qe),Je={"top-left":qe,"top-right":qe,"bottom-right":qe,"bottom-left":qe},e["border-radius"]=dt(qe),r["--divkit-border-radius"]=dt(qe+1)),n&&Le&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Je);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Le/2})),o=Ut(t)}}Be=Tt(e,Be),Ue=Tt(r,Ue),We=n,Ge=o}Ze=Bt(rt&&!ae?rt:void 0,Ze),j=Dt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left","start","end"].forEach((n=>{const o=t[n];o&&(r[n]=o);const i=e[n];i&&(r[n]=(r[n]||0)+i)})),r}(Ze,le),Q),Ye=Pt(X,Q,Ye);{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if("fixed"===c)Qe=Et(null==Z?void 0:Z.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(o["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"!==c&&c||Xt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,Xt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==X?void 0:X.left)||0)+((null==X?void 0:X.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(i=Z&&"weight"in Z&&Z.weight||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)o["halign-self"]="stretch";else{const t=et;o["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===Q?te:ee)[t]:oe.parentHAlign||"start"}t&&(o.width=t),ye=e,be=r,_e=n,Ke=i,tr=a,Xe=Tt(o,Xe),er=s,rr=l}{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==G?void 0:G.type;if(ce);else if("fixed"===c)or=Et(null==G?void 0:G.value,or),e=dt(or);else if("match_parent"!==c||oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==G?void 0:G.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(o["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=G;(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)&&(n=dt(t.max_size.value))}"match_parent"===c&&Xt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,Xt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==X?void 0:X.top)||0)+((null==X?void 0:X.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(i=(null==G?void 0:G.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)o["valign-self"]="stretch";else{const t=Y;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?o["valign-self"]=re[t]:o["valign-self"]=oe.parentVAlign||"start"}t&&(o.height=t),we=e,$e=r,xe=n,ir=i,ar=a,nr=Tt(o,nr),sr=s,lr=l}var Dr,Sr,Or;if(F=!!oe.overlapParent||void 0,V=oe.overlapParent&&(!Z||"match_parent"===Z.type)&&!oe.parentHorizontalWrapContent&&"match_parent"===(null==G?void 0:G.type)&&!oe.parentVerticalWrapContent,D=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,Sr=cr,cr=!Ot(Dr=J)||void 0===Dr||Dr>1?Sr:Number(Dr),ke=1===cr?void 0:cr,me=void 0,q&&!ie&&q.description&&(me={},me["aria-label"]=q.description),Ee=kr&&(null==N?void 0:N.background)?N.background:H,Ce={},Ae=!1,Array.isArray(Ee)&&(Ae=Ee.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ee);Ce["background-color"]=t.color,Ce["background-image"]=t.image,Ce["background-size"]=t.size,Ce["background-position"]=t.position,Ce["background-repeat"]="no-repeat"}je=void 0,dr&&Xt.json.transition_in&&ge.isRunning("stateChange")&&(je=!0),Ve=void 0,dr&&Xt.json.transition_change&&ge.isRunning("stateChange")&&fe.hasTransitionChange(Xt.json.id)&&(Ve=!0);{let t=W||U&&[U]||[],e=B||[],r=z||[],n=(null==N?void 0:N.on_focus)||[],o=(null==N?void 0:N.on_blur)||[];Xt.fakeElement?(t=[],e=[],r=[],n=[],o=[]):(Array.isArray(t)||(t=[],Xt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Xt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Xt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Xt.logError(st(new Error("FocusActions should be array")))),Array.isArray(o)||(o=[],Xt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&se&&(t=[],e=[],r=[],Xt.logError(st(new Error(`Cannot use action on component "${se}"`)))),vr=t.filter(Wt),gr=e.filter(Wt),fr=r.filter(Wt),hr=n.filter(Wt),mr=o.filter(Wt)}T&&(yr=Rt(T),br=yr.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=Et(t.start_delay,0),o="undefined"!=typeof matchMedia&&(Lt||(Lt=window.matchMedia("(prefers-reduced-motion)")),Lt.matches)?0:Et(t.duration,300),i=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return De=e,Se=r,`opacity ${o}ms ${i} ${n}ms`;case"scale":return Oe=e,Pe=r,`transform ${o}ms ${i} ${n}ms`;case"native":case"no_animation":return"";default:return Xt.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=wr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(M,wr);t!==e&&(!_r||"visible"!==wr&&"visible"!==e?wr=e:async function(t){wr=t;const e="visible"===t?"in":"out",r="in"===e?Xt.json.transition_in:Xt.json.transition_out;pr&&r&&(await $(),"in"===e&&(Fe=!0),fe.runVisibilityTransition(Object.assign(Object.assign({},Xt.json),{visibility:"visible"}),Xt,r,he,e).then((()=>{"in"===e&&(Fe=!1)})).catch((t=>{throw"in"===e&&(Fe=!1),t})))}(e)),_r||(_r=!0)}if(Xt.json&&he&&!Mt(Xt.json.extensions,Te)){let t=Te=Xt.json.extensions;$().then((()=>{if(t===Te&&he&&(Ar(),Array.isArray(Xt.json.extensions))){const t=ge.getExtensionContext();ze=Xt.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const o=ge.getExtension(n,e.params);return o&&(null===(r=o.mountView)||void 0===r||r.call(o,he,t)),o})).filter(mt)}}))}if(S=Object.assign(Object.assign(Object.assign({},Xe),nr),{"parent-overlap":F,"parent-overlap-absolute":V,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":je||Fe||Ve,visibility:wr,"has-action-animation":Boolean(br),"parent-flex":oe.parentContainerOrientation||void 0,"parent-grid":Boolean(oe.gridArea)||void 0,"has-custom-focus":Boolean(kr&&Xt.json.focus)}),I&&void 0!==I.rotation){const t=I.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=I.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr);Ie=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Me=`rotate(${I.rotation}deg)`}return O=er||sr?"100%":Ke||ir?0:void 0,P=Object.assign(Object.assign(Object.assign(Object.assign({},ne),Ce),Be),{width:ye,"min-width":be,"max-width":_e,height:we,"min-height":$e,"max-height":xe||(null==ne?void 0:ne["max-height"]),"grid-area":D,padding:j,margin:Ye,opacity:ke,transition:br,"transform-origin":Ie,transform:Me,"flex-grow":Ke||ir||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":O,"--divkit-animation-opacity-start":De,"--divkit-animation-opacity-end":Se,"--divkit-animation-scale-start":Oe,"--divkit-animation-scale-end":Pe}),ot(),it(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),jt(),St(),It(),Ht(),qt(),tt(),Jt(),Zt(),Yt(),rr||lr?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Xt,id:Xt.json.id,use:jr,cls:Qt+" "+Ft("outer",ct,S),style:ut(P),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:me,hasInnerFocusable:ve,isNativeActionAnimation:!yr.length||(Or=yr,Or.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Kt,"OuterBackground").$$render(t,{componentContext:Xt,direction:Q,background:Ee,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Fr,blurHandler:Vr,hasCustomFocus:kr}):""}${We?`<span${L("class",ct.outer__border,0)}${L("style",ut(Ue),0)}></span>`:""}`})}`})),oe=ne,ie={"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 ae(t,e){const r=Number(t);return Number.isNaN(r)||r<=0?e:r}function se(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function le(t,e){return se(t)||e}const ce=W(((t,e,r,n)=>{let o,i,a,s,l,c;var u,d;let{componentContext:p}=e,{text:v}=e,{rootFontSize:g}=e,{textStyles:h={}}=e,{singleline:m=!1}=e,{actions:y}=e;const b=f(at);let _,w="none",$=12,x=1.25,k="",E="",C="",A=null;void 0===e.componentContext&&r.componentContext&&void 0!==p&&r.componentContext(p),void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==h&&r.textStyles(h),void 0===e.singleline&&r.singleline&&void 0!==m&&r.singleline(m),void 0===e.actions&&r.actions&&void 0!==y&&r.actions(y),p.json&&(w="none",$=12,x=1.25,k="",_=void 0,E="",C="",A=null);{let t="none";(h.underline||h.strike)&&("single"===h.underline&&"single"===h.strike?t="both":"single"===h.underline?t="underline":"single"===h.strike&&(t="strike")),w=t}return $=ae(h.font_size,$),Yt(h.line_height)&&(x=Number(h.line_height)/$),Ot(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=le(h.font_weight,_),E="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",C=gt(h.text_color,1,C),o=h.top_offset?dt(h.top_offset):"",i=h.background?yt([h.background]):null,A=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Yt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ae(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,n,o,i,a,s;return"drop-shadow("+gt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(n=t.offset)||void 0===n||null===(o=n.x)||void 0===o?void 0:o.value)||0)/e)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(a=i.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(h.text_shadow,$):void 0,l={singleline:m,decoration:w},c={"font-size":dt(10*$/g),"line-height":x,"letter-spacing":k,"font-weight":_,"font-family":E,filter:s,color:C,background:(null==i?void 0:i.color)||void 0,"box-shadow":A?`inset 0 0 0 ${dt(A.width)} ${A.color}`:void 0,"border-radius":a?dt(a):void 0},`${o?`<span${L("class",ie["text-range__top-offset"],0)}${q({"margin-top":o})}></span>`:""}${R(Gt,"Actionable").$$render(t,{componentContext:p,cls:Ft("text-range",ie,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ue=ce;function de(t,e,r){return"left"===t||"center"===t||"right"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}function pe(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":t:e}function ve(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ge(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const fe=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,z,B,U,W,H,q,J,G,Z,Y=i,X=i,Q=i,K=i,tt=i,et=i,nt=i,ot=i,it=i,st=i,ct=i,pt=i,vt=i,ft=i,ht=i,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=f(at);W=l(_t.direction,(t=>U=t));let wt,$t="",xt=12,kt=1.25,Et=!1,Ct="",At="",jt=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Mt=[],Tt=[];var Nt;v((()=>{Tt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)}))})),void 0===e.componentContext&&r.componentContext&&void 0!==mt&&r.componentContext(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==bt&&r.layoutParams(bt),mt.json&&(xt=12,kt=1.25,Et=!1,Ct="",wt=void 0,At="",jt=!1,Vt="start",Dt="start",St="",Pt="",It=!1),o=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(o,(t=>Z=t)),a=mt.getDerivedFromVars(mt.json.ranges),Q(),Q=l(a,(t=>S=t)),s=mt.getDerivedFromVars(mt.json.images),X(),X=l(s,(t=>D=t)),c=mt.getDerivedFromVars({font_size:mt.json.font_size,letter_spacing:mt.json.letter_spacing,font_weight:mt.json.font_weight,font_family:mt.json.font_family,text_color:mt.json.text_color,underline:mt.json.underline,strike:mt.json.strike,line_height:mt.json.line_height,text_shadow:mt.json.text_shadow}),Y(),Y=l(c,(t=>V=t)),u=mt.getDerivedFromVars(mt.json.font_size),ft(),ft=l(u,(t=>G=t)),d=mt.getDerivedFromVars(mt.json.line_height),vt(),vt=l(d,(t=>J=t)),p=mt.getDerivedFromVars(mt.json.max_lines),it(),it=l(p,(t=>z=t)),g=mt.getDerivedFromVars(mt.json.text_alignment_horizontal),ct(),ct=l(g,(t=>H=t)),h=mt.getDerivedFromVars(mt.json.text_alignment_vertical),st(),st=l(h,(t=>B=t)),m=mt.getDerivedFromVars(mt.json.text_color),ot(),ot=l(m,(t=>T=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>M=t)),b=mt.getDerivedFromVars(mt.json.truncate),et(),et=l(b,(t=>I=t)),_=mt.getDerivedFromVars(mt.json.text_gradient),tt(),tt=l(_,(t=>P=t)),w=mt.getDerivedFromVars(mt.json.selectable),K(),K=l(w,(t=>O=t)),$=mt.getDerivedFromVars(mt.json.auto_ellipsize),pt(),pt=l($,(t=>q=t)),Nt=Z,$t=String(null!=Nt?Nt:""),xt=ae(G,xt);{const t=J;Yt(t)?(kt=Number(t)/xt,Et=!0):Et=!1}x=1===z;{let t,e="",r="",n=!1;if(z&&z>1){const o=Number(z);e=o*kt+"em",t=o,r=o,n=!0}else q&&1!==z&&(n=!0);Ct=e,wt=t,At=r,jt=n}Vt=de(H,U,Vt),Dt=pe(B,Dt),k=!S||$t&&1===S.length&&S[0]&&0===S[0].start&&"number"==typeof S[0].end&&S[0].end>=$t.length,E=Boolean(T)!==Boolean(S&&S[0]&&S[0].text_color);{let t="";z&&k&&E&&(t=gt(T||S&&S[0]&&S[0].text_color,1,St)),St=t}Ot=gt(M,1,Ot),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}Pt=t}return It=ve(O,It),function(t,e,r,n){let o=[];if(Tt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Tt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Mt=[]);const i=t;let a=e||[{start:0,end:i.length}],s=r||[],l=0,c=[],u=[];a.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),s.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.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)),u.forEach((t=>{var e,r;let a="image"===t.type?null:t.range,s=t.index;if(s>l){let a=Object.assign(Object.assign({},n),...c);o.push({text:i.substring(l,s),textStyles:a,actions:"rangeEnd"===t.type&&(null===(r=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===r?void 0:r.filter(Wt))||void 0})}if("rangeStart"===t.type&&a)c.push(a);else if("rangeEnd"===t.type)c=c.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},n),...c),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const a={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let s="";const l=t.image.tint_color,u=ge(t.image.tint_mode,"source_in");if(l){const e=gt(t.image.tint_color);s=_t.addSvgFilter(e,u),Tt.push([e,u])}o.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:a,svgFilterId:s,preloadRequired:Boolean(t.image.preload_required)}})}l=s})),l<i.length&&o.push({text:i.substring(l),textStyles:Object.assign({},n)}),Mt=o}($t,S,D,V),A={singleline:x,multiline:jt,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},j={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":At,color:St,"background-image":Pt,"--divkit-text-focus-color":Ot},Y(),X(),Q(),K(),tt(),et(),nt(),ot(),it(),st(),W(),ct(),pt(),vt(),ft(),ht(),`${R(oe,"Outer").$$render(t,{cls:Ft("text",lt,A)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${L("class",Ft("text__inner",lt,j),0)}${L("style",ut(F),0)}>${Mt.length?`${N(Mt,(e=>"text"in e?e.text?`${R(ue,"TextRangeView").$$render(t,{componentContext:mt,text:e.text,rootFontSize:xt,textStyles:e.textStyles,singleline:x,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)}${L("loading",e.image.preloadRequired?"eager":"lazy",0)} decoding="async" aria-hidden="true" alt=""${L("style",ut({width:e.image.width,height:e.image.height,"margin-top":Et?`-${e.image.height}`:void 0,"margin-bottom":Et?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${R(ue,"TextRangeView").$$render(t,{componentContext:mt,text:$t,rootFontSize:xt,textStyles:V,singleline:x},{},{})}`}</span>`})}`})),he=fe,me={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_overflow_visible:"divkit-f315a",container_orientation_vertical:"divkit-ddc33",container_valign_start:"divkit-a31f0",container_valign_center:"divkit-aae61",container_valign_end:"divkit-eac00","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_start:"divkit-efaf5",container_halign_center:"divkit-bac9d",container_halign_end:"divkit-ca36b","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 ye(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 be(t,e,r){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);null!=e&&e.show_at_start&&(r?t.top=e.style.height+o:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+o:t.right=e.style.width+n)}function _e(t,e,r){let n;const o=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),i=((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 n="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+o:0]:[null!=e&&e.show_between?e.style.height+i:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function we(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function $e(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function xe(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)n={width:Et(null===(i=(o=t.shape).item_width)||void 0===i?void 0:i.value,10),height:Et(null===(a=o.item_height)||void 0===a?void 0:a.value,10),radius:Et(null===(s=o.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*Et(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var o,i,a,s;return function(t,e,r){var n;const o={},i=e.stroke||(null==r?void 0:r.stroke),a=null!=i&&i.color?gt(i.color):"",s=null!=i&&i.width?Number(null!==(n=i.width)&&void 0!==n?n:1):"";o.width=t.width,o.height=t.height,o.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return o.background=gt(l),a&&s&&(o.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),o}(n,t.shape,{color:t.color,stroke:t.stroke})}let ke;function Ee(){if("undefined"==typeof document&&(ke=!0),void 0!==ke)return ke;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),ke=1===t.scrollHeight,document.body.removeChild(t),ke}const Ce="divkit-a7719",Ae="divkit-f6e9a";function je(t,e,r,n,o,i){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;i?t.push({top:r.bottom+l,left:o.left+a,width:Math.max(0,o.right-o.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:o.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,o.bottom-o.top-l-c),style:e.style})}function Fe(t,e,r,n,o,i){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"===o||"space-evenly"===o?(s=i.left-e.style.width,l=i.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),je(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,n)}if(null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)je(t,e,r[o],r[o+1],a,n);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===o||"space-evenly"===o?(l=i.bottom+e.style.height,c=i.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),je(t,e,s,{top:l,right:0,bottom:0,left:c},a,n)}}const Ve=W(((t,e,r,n)=>{let o,{orientation:i}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e,{direction:u}=e;const d=function(t,e){let r,n=0,o=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(o||(o=!0,setTimeout((()=>{o=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!o)return;const t=o.getBoundingClientRect(),e=window.getComputedStyle(o),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)};g=[];let n=[...o.children].filter((t=>t!==p&&!t.classList.contains(ct.outer__border))),d=[];for(;n.length;){const t=[],e=n.shift();t.push(e);let r=e.getBoundingClientRect(),o=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===i){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>o)break;a=Math.max(a,r.right),o=Math.min(o,r.left),s=Math.max(s,r.bottom),t.push(e),n.shift()}d.push(t)}const v=[];d.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)));"rtl"===u&&"horizontal"===i&&e.reverse(),a&&Fe(g,a,e,"vertical"===i,"vertical"===i?c:l,r);const n={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)))};v.push(n)})),"rtl"===u&&"vertical"===i&&v.reverse(),s&&Fe(g,s,v,"horizontal"===i,"vertical"===i?l:c,r),g.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let p,g=[],f=!1,h=null,m=null;return v((()=>{f=!1})),void 0===e.orientation&&r.orientation&&void 0!==i&&r.orientation(i),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),void 0===e.direction&&r.direction&&void 0!==u&&r.direction(u),o=null,(f&&o||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),f&&o&&("undefined"!=typeof MutationObserver&&(h=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(Ae))&&!(null==r?void 0:r.contains(Ce))}))&&d()})),h.observe(o,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(o)))),f&&o&&d(),` <div${L("class",Ce,0)}${L("this",p,0)}>${N(g,(t=>`<div${L("class","divkit-c770e",0)}${q({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${L("class",Ae,0)}${q({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>`})),De={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},Se={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Oe=["rounded_rectangle","circle"],Pe=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,z,B,U=i,W=i,L=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,tt=i;var et,rt,nt,ot,it,st,lt;let{componentContext:ct}=e,{layoutParams:ut}=e;const dt=f(at);let pt;O=l(dt.direction,(t=>S=t));let vt,gt="vertical",ft="start",ht="start",yt=null,bt=null,_t={},wt=[];void 0===e.componentContext&&r.componentContext&&void 0!==ct&&r.componentContext(ct),void 0===e.layoutParams&&r.layoutParams&&void 0!==ut&&r.layoutParams(ut),o=ct.origJson,o&&(gt="vertical",ft="start",ht="start",vt=void 0),a=ct.json.items,s=ct.getDerivedFromVars(null===(et=ct.json.item_builder)||void 0===et?void 0:et.data,void 0,!0),tt(),tt=l(s,(t=>B=t)),c=ct.getDerivedFromVars(ct.json.orientation),Q(),Q=l(c,(t=>z=t)),u=ct.getDerivedFromVars(ct.json.layout_mode),X(),X=l(u,(t=>T=t)),d=ct.getDerivedFromVars(ct.json.content_alignment_vertical),Z(),Z=l(d,(t=>I=t)),p=ct.getDerivedFromVars(ct.json.content_alignment_horizontal),G(),G=l(p,(t=>P=t)),v=ct.getDerivedFromVars(ct.json.separator),J(),J=l(v,(t=>D=t)),g=ct.getDerivedFromVars(ct.json.line_separator),q(),q=l(g,(t=>V=t)),h=ct.getDerivedFromVars(ct.json.aspect),H(),H=l(h,(t=>F=t)),m=ct.getDerivedFromVars(ct.json.width),W(),W=l(m,(t=>A=t)),y=ct.getDerivedFromVars(ct.json.height),L(),L=l(y,(t=>j=t)),b=ct.getDerivedFromVars(ct.json.clip_to_bounds),U(),U=l(b,(t=>C=t));{let t=[];if(ct.json.item_builder&&Array.isArray(B)&&Array.isArray(ct.json.item_builder.prototypes)){const e=ct.json.item_builder;t=[],B.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=dt.preparePrototypeVariables(e.data_element_name||"it",r);let o;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){o=r.div;break}if(ct.getJsonWithVars(r.selector,n)){o=r.div;break}}}o&&t.push({div:o,vars:n})}))}else t=(Array.isArray(a)&&a||[]).map((t=>({div:t})));wt=t.map(((t,e)=>ct.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];wt.forEach((e=>{t.push(ct.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),pt=K(t,(t=>[...t])),Y(),Y=l(pt,(t=>M=t))}if(gt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(z,gt),_="wrap"===T,w="horizontal"!==gt&&!_&&M.some(we),$="vertical"!==gt&&!_&&M.some($e),ft=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?"top"===t?"start":"bottom"===t?"end":t:e}(I,ft),ht=function(t,e,r){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}(P,S,ht),(null==D?void 0:D.style)&&"overlap"!==gt&&Ee()){const t=xe(D.style,Oe,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(rt=D.show_at_start)&&void 0!==rt&&rt),show_at_end:Boolean(null!==(nt=D.show_at_end)&&void 0!==nt&&nt),show_between:Boolean(null===(ot=D.show_between)||void 0===ot||ot),style:t,margins:ye(D.margins)}:null}else yt=null;if((null==V?void 0:V.style)&&"overlap"!==gt&&Ee()){const t=xe(V.style,Oe,(null==bt?void 0:bt.style)||null);bt=t?{show_at_start:Boolean(null!==(it=V.show_at_start)&&void 0!==it&&it),show_at_end:Boolean(null!==(st=V.show_at_end)&&void 0!==st&&st),show_between:Boolean(null===(lt=V.show_between)||void 0===lt||lt),style:t,margins:ye(V.margins)}:null}else bt=null;x=yt||bt?function(t,e,r){const n={};return be(n,e,"vertical"===t),be(n,r,"horizontal"===t),n}(gt,yt,bt):null;{const t=null==F?void 0:F.ratio;vt=t&&Yt(t)?t:void 0}{let t={};"overlap"===gt&&(t.overlapParent=!0),"horizontal"!==gt&&(t.parentHAlign=_?"start":De[ht]),"vertical"!==gt&&(t.parentVAlign=_?"start":Se[ft]),vt||$||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ut?void 0:ut.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!w&&("wrap_content"===(null==A?void 0:A.type)||"match_parent"===(null==A?void 0:A.type)&&(null==ut?void 0:ut.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===gt&&(t.parentContainerOrientation="horizontal"),"vertical"===gt&&(t.parentContainerOrientation="vertical"),_&&(t.parentContainerWrap=!0),_t=Tt(t,_t)}return k={orientation:gt,valign:ft,halign:ht,wrap:_,overflow:!1===C||0===C?"visible":void 0},E={gap:yt||bt?_e(gt,yt,bt):void 0,"aspect-ratio":vt},U(),W(),L(),H(),q(),J(),O(),G(),Z(),Y(),X(),Q(),tt(),`${R(oe,"Outer").$$render(t,{cls:Ft("container",me,k),componentContext:ct,layoutParams:ut,style:E,additionalPaddings:x,heightByAspect:Boolean(vt),parentOf:wt.map((t=>t.json)),replaceItems:function(t){ct=Object.assign(Object.assign({},ct),{json:Object.assign(Object.assign({},ct.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(wt,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e,layoutParams:_t},{},{})}`))} ${yt||bt?`${R(Ve,"ContainerSeparators").$$render(t,{direction:S,separator:yt,lineSeparator:bt,orientation:gt,contentHAlign:ht,contentVAlign:ft},{},{})}`:""}`})}`})),Ie=Pe,Me={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Te(t,e){return"vertical"===t||"horizontal"===t?t:e}const Ne=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g=i,{componentContext:f}=e,{layoutParams:h}=e,m="horizontal",y="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==f&&r.componentContext(f),void 0===e.layoutParams&&r.layoutParams&&void 0!==h&&r.layoutParams(h),o=f.origJson,o&&(m="horizontal",y="rgba(0,0,0,0.08)"),a=f.getDerivedFromVars(f.json.delimiter_style),g(),g=l(a,(t=>v=t)),m=Te(null==v?void 0:v.orientation,m),s=!((null==v?void 0:v.color)&&("transparent"===v.color||9===v.color.length&&0===v.color.indexOf("#00"))),y=gt(null==v?void 0:v.color,1,y),c="horizontal"===m?"100%":dt(1),u="horizontal"===m?dt(1):"100%",d={background:y,width:c,height:u},p={orientation:m},g(),`${R(oe,"Outer").$$render(t,{cls:Ft("separator",Me,p),componentContext:f,layoutParams:h},{},{default:()=>s?`<span${L("class",Me.separator__inner,0)}${L("style",ut(d),0)}></span>`:""})}`})),ze={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image_is-rtl-mirror":"divkit-ae78c","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Re(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ue=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,M,T,N,z,B,U,W,H,J,G,Z=i,Y=i,X=i,Q=i,K=i,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,dt=i,pt=i,{componentContext:vt}=e,{layoutParams:ft}=e;const ht=f(at);let mt;D=l(ht.direction,(t=>V=t));let yt,bt,_t=0,xt=!1,kt="rgba(0,0,0,0.08)",Ct=!1,At="",jt="none",Vt="50% 50%",Dt="0",St="source_in",Ot="",Pt="",It=0,Mt=0,Tt=0,zt="",Rt="",Bt=!1;v((()=>{ht.removeSvgFilter(bt,St)})),void 0===e.componentContext&&r.componentContext&&void 0!==vt&&r.componentContext(vt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ft&&r.layoutParams(ft),o=vt.origJson,o&&(jt="none",Vt="50% 50%",St="source_in"),a=vt.getDerivedFromVars(vt.json.image_url),ct(),ct=l(a,(t=>H=t)),s=vt.getDerivedFromVars(vt.json.gif_url),dt(),dt=l(s,(t=>J=t)),c=vt.getDerivedFromVars(vt.json.width),lt(),lt=l(c,(t=>W=t)),u=vt.getDerivedFromVars(vt.json.height),it(),it=l(u,(t=>U=t)),d=vt.getDerivedFromVars(vt.json.preview),ot(),ot=l(d,(t=>B=t)),p=vt.getDerivedFromVars(vt.json.placeholder_color),nt(),nt=l(p,(t=>z=t)),g=vt.getDerivedFromVars(vt.json.scale),rt(),rt=l(g,(t=>N=t)),h=vt.getDerivedFromVars({content_alignment_horizontal:vt.json.content_alignment_horizontal,content_alignment_vertical:vt.json.content_alignment_vertical}),et(),et=l(h,(t=>T=t)),m=vt.getDerivedFromVars(vt.json.accessibility),tt(),tt=l(m,(t=>M=t)),y=vt.getDerivedFromVars(vt.json.aspect),K(),K=l(y,(t=>I=t)),b=vt.getDerivedFromVars(vt.json.tint_color),Q(),Q=l(b,(t=>P=t)),_=vt.getDerivedFromVars(vt.json.tint_mode),X(),X=l(_,(t=>O=t)),w=vt.getDerivedFromVars(vt.json.appearance_animation),Y(),Y=l(w,(t=>S=t)),$=vt.getDerivedFromVars(vt.json.filters),Z(),Z=l($,(t=>F=t)),x=vt.getDerivedFromVars(vt.json.preload_required),pt(),pt=l(x,(t=>G=t));{let t="gif"===vt.json.type?J:H;xt="empty://"===t,xt&&(t=Be),yt=t}_t=0,yt?Ct=!1:(Ct=!0,vt.logError(st(new Error(`Missing "${"gif"===vt.json.type?"gif_url":"image_url"}" for "${vt.json.type}"`)))),k="wrap_content"===(null==W?void 0:W.type),E="wrap_content"===(null==U?void 0:U.type),At=B?`url("${Re(B)}")`:"",kt=gt(z,1,kt),jt=wt(N)||jt,Vt=function(t,e,r){let n=t.content_alignment_horizontal;const o=t.content_alignment_vertical;return"start"===n?n="ltr"===e?"left":"right":"end"===n&&(n="ltr"===e?"right":"left"),n&&"left"!==n&&"center"!==n&&"right"!==n||o&&"top"!==o&&"center"!==o&&"bottom"!==o?r:$t({content_alignment_horizontal:n,content_alignment_vertical:o})}(T,V,Vt),C=(null==M?void 0:M.description)||"";{const t=null==I?void 0:I.ratio;Dt=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=P?gt(P):void 0,e=ge(O,St);t===bt&&e===St||(ht.removeSvgFilter(bt,St),Ot=t?ht.addSvgFilter(t,e):"",bt=t,St=e)}if(S&&"fade"===S.type){const t=S;Pt=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Tt=Et(t.duration,300),Mt=Et(t.start_delay,0),It=Et(t.alpha,0)}{let t="",e="";Array.isArray(F)&&F.length&&(t=Xt(F,vt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),zt=t,Rt=e,Bt="rtl"===V&&Array.isArray(F)&&F.some((t=>"rtl_mirror"===t.type))}return A={aspect:"0"!==Dt,"is-width-content":k,"is-height-content":E,loaded:!1,"before-appearance":Boolean(Pt)&&!0,"is-rtl-mirror":Bt},j={"background-image":At,"background-color":At?void 0:kt,"background-size":jt,"clip-path":Rt||void 0,"object-fit":jt,"object-position":Vt,filter:["",zt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Pt||void 0,"--divkit-appearance-fade-start":Pt?It:void 0,"--divkit-appearance-delay":Pt?`${Mt}ms`:void 0,"--divkit-appearance-duration":Pt?`${Tt}ms`:void 0},Z(),D(),Y(),X(),Q(),K(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),dt(),pt(),Ct?"":`${R(oe,"Outer").$$render(t,{cls:Ft("image",ze,A),componentContext:vt,layoutParams:ft,customDescription:!0},{},{default:()=>A.aspect?`<span${L("class",ze["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Dt}%`})}><img${L("class",ze.image__image,0)}${L("src",yt,0)}${L("loading",G?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",C,0)}${L("aria-hidden",C?null:"true",0)}${L("this",mt,0)}></span>`:`<img${L("class",ze.image__image,0)}${L("src",yt,0)}${L("loading",G?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",C,0)}${L("aria-hidden",C?null:"true",0)}${L("this",mt,0)}>`})}`})),We={grid:"divkit-d9080",grid_halign_start:"divkit-fc24d",grid_halign_center:"divkit-a14a6",grid_halign_end:"divkit-cfd04",grid_valign_start:"divkit-c3106",grid_valign_center:"divkit-d4310",grid_valign_end:"divkit-fa9cf"};function Le(t){return t>0&&t<1}function He(t){return String(Math.ceil(1e3*t)/1e3)}function qe(t,e,r){if(t.some(Le)){const e=Math.max(...t.filter(Le).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,o=0;const i=[];if(t.every(Boolean)){o=t.reduce(((t,e)=>t+e),0);for(let i=0;i<r;++i){if(!e[i])continue;const r=e[i]/t[i]*o;r>n&&(n=r)}}for(let e=0;e<r;++e)n?i[e]=`minmax(${dt(n*t[e]/o)},${He(t[e])}fr)`:t[e]?i[e]=`${He(t[e])}fr`:i[e]="auto";return i.join(" ")}const Je=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,{componentContext:C}=e,{layoutParams:A}=e;m=l(f(at).direction,(t=>h=t));let j,F,V=1,D=[],S=[],O=[],P=[],I=0,M=!1,T="start",z="start";void 0===e.componentContext&&r.componentContext&&void 0!==C&&r.componentContext(C),void 0===e.layoutParams&&r.layoutParams&&void 0!==A&&r.layoutParams(A),o=C.origJson,o&&(V=1,T="start",z="start"),a=Array.isArray(C.json.items)&&C.json.items||[],s=C.getDerivedFromVars(C.json.column_count),E(),E=l(s,(t=>w=t)),c=C.getDerivedFromVars(C.json.content_alignment_vertical),x(),x=l(c,(t=>b=t)),u=C.getDerivedFromVars(C.json.content_alignment_horizontal),$(),$=l(u,(t=>y=t)),V=ae(w,V),d=a.map(((t,e)=>C.produceChildContext(t,{path:e})));{let t=[];d.forEach((e=>{t.push(C.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),k(),k=l(j,(t=>_=t))}{const t={};let e=0,r=0;D=[],S=[],O=[],P=[],M=!1,F=d.map(((n,o)=>{var i,a,s,l;const c=_[o],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(i=c.width)||void 0===i?void 0:i.type)?Number(c.width.weight||1)/u:0,g="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 n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?(M=!0,C.logError(st(new Error(`No space for item at index ${o}`)))):(t[n+"_"+e]=!0,(!D[n]||D[n]<v)&&(D[n]=v),(!S[e]||S[e]<g)&&(S[e]=g),(!O[n]||O[n]<f)&&(O[n]=f),(!P[e]||P[e]<h)&&(P[e]=h));do{++e,e>=V&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),I=r}return T=pe(b,T),z=de(y,h,z),p={valign:T,halign:z},v={"grid-template-columns":qe(D,O,V),"grid-template-rows":qe(S,P,I)},g=M,m(),$(),x(),k(),E(),g?"":`${R(oe,"Outer").$$render(t,{cls:Ft("grid",We,p),componentContext:C,style:v,layoutParams:A,parentOf:d.map((t=>t.json)),replaceItems:function(t){C=Object.assign(Object.assign({},C),{json:Object.assign(Object.assign({},C.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(F,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),Ge=Je,Ze={gallery:"divkit-cbb0f",gallery__scroller:"divkit-a4e39",gallery_scrollbar_none:"divkit-f49e7",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon-path":"divkit-b4173"},Ye="divkit-bf36b",Xe="divkit-a67bf",Qe="divkit-e2a31",Ke="divkit-c684b";function tr(t){const e=[];let r=t[0],n=1;for(let o=1;o<=t.length;o++)t[o]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[o],n=1):n++;return e.join(" ")}function er(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}function rr(t,e){let r=t%e;return r<0&&(r+=e),r}const nr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U,W,H,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,tt=i,et=i,rt=i,nt=i,{componentContext:it}=e,{layoutParams:st}=e;const lt=f(at);let ct;j=l(lt.direction,(t=>A=t));let pt,vt=[],gt=!1,ft=!1,ht=null,yt=!1;const bt=lt.getCustomization("galleryLeftClass"),_t=lt.getCustomization("galleryRightClass");let wt,$t,xt,kt,Ct,At=1,jt="horizontal",Vt="start",Dt=8,St="",Ot=[],It={},Mt=!1,Nt={},zt=0;W=l(lt.isDesktop,(t=>U=t));const Rt=er((function(){if(!ct)return;let t=ct.scrollLeft;"rtl"===A&&(t*=-1);const e=ct.scrollWidth,r=ct.offsetWidth;"ltr"===A?(gt=t>2,ft=t+r<e-2):(ft=t>2,gt=t+r<e-2)}),50);function Bt(){let t=[],e=vt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<At;++e){const n=vt[e].children[r];n&&t.push(n)}return t}function Ut(t,e="smooth"){const r="horizontal"===jt?"left":"top";ct.scroll({[r]:t,behavior:e})}function Wt(t,e,r="smooth"){const n="horizontal"===jt,o=n?"offsetLeft":"offsetTop",i=t[e];if(i){let t;if("ltr"!==A&&n){const e=ct.offsetWidth;t=i[o]+i.offsetWidth+.01-Dt/2-e}else t=i[o]+.01-Dt/2;Ut(t,r)}}function Lt(t){const e=Bt(),r=ct.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===jt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const o=e.map((t=>function(t,e){return"horizontal"===jt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),i=o.findIndex(Boolean);return-1!==i?"prev"===t&&2===o.filter(Boolean).length?i+1:i:"prev"===t?1:e.length-2}v((()=>{yt=!1,wt&&!it.fakeElement&&(lt.unregisterInstance(wt),wt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==it&&r.componentContext(it),void 0===e.layoutParams&&r.layoutParams&&void 0!==st&&r.layoutParams(st),o=it.origJson,o&&(At=1,jt="horizontal",Vt="start",Dt=8,St=""),a=Array.isArray(it.json.items)&&it.json.items||[],s=it.getDerivedFromVars(it.json.column_count),rt(),rt=l(s,(t=>B=t)),c=it.getDerivedFromVars(it.json.orientation),et(),et=l(c,(t=>z=t)),u=it.getDerivedFromVars(it.json.cross_content_alignment),tt(),tt=l(u,(t=>T=t)),d=it.getDerivedFromVars(it.json.item_spacing),Q(),Q=l(d,(t=>M=t)),p=it.getDerivedFromVars(it.json.cross_spacing),X(),X=l(p,(t=>P=t)),g=it.getDerivedFromVars(it.json.paddings),Y(),Y=l(g,(t=>O=t)),h=it.getDerivedFromVars(it.json.scroll_mode),G(),G=l(h,(t=>D=t)),m=it.getDerivedFromVars(it.json.restrict_parent_scroll),nt(),nt=l(m,(t=>H=t)),y=it.getDerivedFromVars(it.json.scrollbar),J(),J=l(y,(t=>V=t)),b=it.getDerivedFromVars(it.json.default_item),q(),q=l(b,(t=>F=t)),_=a.map(((t,e)=>it.produceChildContext(t,{path:e}))),w=U&&yt,w?"undefined"!=typeof ResizeObserver&&(ht=new ResizeObserver((()=>{Rt()})),ht.observe(pt)):ht&&(ht.disconnect(),ht=null),At=ae(B,At),$=function(t,e){let r=0,n=[];for(let o=0;o<t.length;++o)n[r]||(n[r]=[]),n[r].push(t[o]),++r>=e&&(r=0);return n}(_,At),jt=Te(z,jt),Vt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(T,Vt),Dt=Et(M,Dt),$t=dt(Dt),kt=Et(P,Dt),xt=dt(kt),St=Pt(O,A,St),x="horizontal"===jt?"grid-template-columns":"grid-template-rows";{let t=[];_.forEach((e=>{const r="horizontal"===jt?"width":"height";t.push(it.getDerivedFromVars(e.json[r]))})),Ct=K(t,(t=>t)),Z(),Z=l(Ct,(t=>S=t))}Ot=[],At>1?Ot.push("auto"):S.forEach((t=>{!t&&"horizontal"===jt||"match_parent"===(null==t?void 0:t.type)?Ot.push("100%"):Ot.push("max-content")}));{const t={};let e={};Mt=!1,"horizontal"===jt?e.parentVAlign=Vt:e.parentHAlign=Vt,"paging"===D&&(Mt=!0,e.scrollSnap="start",t["horizontal"===jt?"scroll-padding-left":"scroll-padding-top"]=dt(Dt/2)),1===At&&(e.parentLayoutOrientation=jt),It=Tt(t,It),Nt=Tt(e,Nt)}return k={padding:St,"grid-gap":xt},E={"grid-gap":$t,[x]:tr(Ot)},C={orientation:jt,"scroll-snap":Mt,scrollbar:"auto"===V?"auto":"none"},zt=Et(F,zt),it.json&&Rt(),it.json&&(wt&&(lt.unregisterInstance(wt),wt=void 0),it.json.id&&!it.fakeElement&&(wt=it.json.id,lt.registerInstance(wt,{setCurrentItem(t){const e=Bt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Wt(e,t)},setPreviousItem(t,e){const r=Lt("prev"),n=Bt();let o=r-t;o<0&&(o="ring"===e?rr(o,n.length):0),Wt(n,o)},setNextItem(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft*n+ct.offsetWidth===ct.scrollWidth:ct.scrollTop+ct.offsetHeight===ct.scrollHeight,i=Bt();if(o&&"ring"===e)return void Wt(i,0);let a=Lt("next")+t;a>i.length-1&&(a="ring"===e?rr(a,i.length):i.length-1),Wt(i,a)},scrollToStart(){Ut(0)},scrollToEnd(){Ut("ltr"===A||"horizontal"!==jt?1e6:-1e6)},scrollBackward(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n-t;a<0&&("clamp"===e?a=0:"ring"===e&&(a=rr(a,i))),Ut(a*n)},scrollForward(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n+t;a>i&&("clamp"===e?a=i:"ring"===e&&(a=rr(a,i))),Ut(a*n)},scrollToPosition(t){Ut("ltr"===A||"horizontal"!==jt?t:-t)}}))),j(),q(),J(),G(),Z(),Y(),X(),Q(),tt(),et(),rt(),W(),nt(),` ${R(oe,"Outer").$$render(t,{cls:Ft("gallery",Ze,C),componentContext:it,layoutParams:st,customPaddings:!0,customActions:"gallery",parentOf:a,replaceItems:function(t){it=Object.assign(Object.assign({},it),{json:Object.assign(Object.assign({},it.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ze.gallery__scroller,!0)+" "+I(H?ot:"",!0)}"${L("style",ut(It),0)}${L("this",ct,0)}><div${L("class",Ze["gallery__items-grid"],0)}${L("style",ut(k),0)}${L("this",pt,0)}>${N($,((e,r)=>`<div${L("class",Ze.gallery__items,0)}${L("style",ut(E),0)}${L("this",vt[r],0)}>${N(e,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e,layoutParams:Nt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===jt?`${gt&&w?` <div${L("class",bt||`${Ze.gallery__arrow} ${Ye} ${Qe}`,0)}>${bt?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ze["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>`:""} ${ft&&w?` <div${L("class",_t||`${Ze.gallery__arrow} ${Ye} ${Ke}`,0)}>${_t?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ze["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>`:""}`:""}`})}`})),or=nr,ir={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_height-parent_yes":"divkit-ae594",tabs__separator:"divkit-b85bf"},ar=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U=i,W=i,H=i,J=i,G=i,Z=i,Y=i,X=i,K=i;var tt,et;let{componentContext:rt}=e,{layoutParams:nt}=e;const it=f(at);S=l(it.direction,(t=>D=t));const lt=it.genId("tabs");let ct,vt=!1,ft=Q([]);j=l(ft,(t=>A=t));let ht,mt,yt,bt,_t,wt,$t,xt={},kt={},Ct=12,At="",jt="",Vt="",St="",It="",Mt="",Nt="",zt="",Rt="",Lt="",Ht=0,qt="",Jt="",Zt=null,Xt=!1,Qt=!1,Kt=[],te=[],ee=null;async function re(t,e=!1){if(wt=w,w=t,Xt||(Xt=!0,mt.style.height=dt(mt.clientHeight),yt.style.transform=`translate3d(${100*-(null!=wt?wt:w)}%,0,0)`),Qt=!0,async function(t){await $(),yt.style.transform=`translate3d(${t}%,0,0)`}(100*-w),function(t=!1){const e=t?Math.max(0,w-1):Math.min(w,null!=wt?wt:w),r=t?Math.min(a.length-1,w+1):Math.max(w,null!=wt?wt:w);Kt=Kt.map(((t,n)=>{var o;return t||(n>=e&&n<=r&&(null===(o=a[n])||void 0===o?void 0:o.div)?rt.produceChildContext(a[n].div,{path:n}):void 0)})),te=te.map(((t,n)=>n>=e&&n<=r))}(),async function(){if("match_parent"===(null==C?void 0:C.type))return;await $();const t=document.getElementById(`${lt}-panel-${w}`);t&&(mt.style.height=dt(t.offsetHeight))}(),ee&&clearTimeout(ee),ee=window.setTimeout((()=>{te=a.map(((t,e)=>e===w))}),400),$t=-w*mt.clientWidth,e){await $();const t=ht.querySelector(`.${ir.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{ct&&(it.unregisterInstance(ct),ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==rt&&r.componentContext(rt),void 0===e.layoutParams&&r.layoutParams&&void 0!==nt&&r.layoutParams(nt),o=rt.origJson,o&&(Ct=12,At="",St="",bt=void 0,It="",_t=void 0,Mt="",Nt="",zt="",Rt="",Lt="",Ht=0,qt="",Jt="",Zt=null),a=Array.isArray(rt.json.items)&&rt.json.items||[],s=a.map((t=>t.div)),c=rt.getDerivedFromVars(rt.json.width),X(),X=l(c,(t=>z=t)),u=rt.getDerivedFromVars(rt.json.height),U(),U=l(u,(t=>C=t)),d=rt.getJsonWithVars(rt.json.selected_tab),p=rt.getDerivedFromVars(rt.json.tab_title_style),Y(),Y=l(p,(t=>T=t)),g=rt.getDerivedFromVars(rt.json.has_separator),Z(),Z=l(g,(t=>M=t)),h=rt.getDerivedFromVars(rt.json.separator_color),G(),G=l(h,(t=>P=t)),m=rt.getDerivedFromVars(rt.json.separator_paddings),J(),J=l(m,(t=>O=t)),y=rt.getDerivedFromVars(rt.json.switch_tabs_by_content_swipe_enabled),H(),H=l(y,(t=>V=t)),b=rt.getDerivedFromVars(rt.json.restrict_parent_scroll),K(),K=l(b,(t=>B=t)),_=rt.getDerivedFromVars(rt.json.title_paddings),W(),W=l(_,(t=>F=t)),w=d&&Number(d)||0,Array.isArray(a)&&a.length){let t=[];a.forEach(((e,r)=>{const n=rt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):rt.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),ft.set(t)}else ft.set([]);(null==A?void 0:A.length)?vt=!1:(vt=!0,rt.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={parentContainerOrientation:"horizontal"};"wrap_content"===(null==z?void 0:z.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),xt=Tt(t,xt)}if(!vt&&(w<0||w>=a.length)&&(rt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:rt.json.selected_tab,length:a.length}})),w=w<0?0:a.length-1),vt||A.some((t=>w===t.index))||(rt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:rt.json.selected_tab}})),w=(null===(tt=A[0])||void 0===tt?void 0:tt.index)||0),x=T||{},Ct=ae(x.font_size,Ct),x.font_size||x.paddings){const t=x.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/Ct*10,right:(Number("ltr"===D?t.end:t.start)||Number(t.right)||0)/Ct*10,bottom:(Number(t.bottom)||0)/Ct*10,left:(Number("ltr"===D?t.start:t.end)||Number(t.left)||0)/Ct*10};At=Pt(e,D,At)}{const t=x.line_height;void 0!==t&&Yt(t)&&(jt=dt(t/Ct*10))}{const t=x.letter_spacing;void 0!==t&&Ot(t)&&(Vt=dt(t/Ct*10))}if(x.corner_radius||x.corners_radius||x.font_size){const t=null!==(et=x.corner_radius)&&void 0!==et?et:1e3;x.corners_radius?St=function(t,e,r,n){const o=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<o.length;++t)if(o[t]&&!Ot(o[t]))return n;return Ut(t,e,r)}(x.corners_radius,t,Ct,St):Ot(t)&&(St=dt(t/Ct*10))}return bt=le(x.active_font_weight||x.font_weight,bt),It=x.font_family&&"string"==typeof x.font_family?it.typefaceProvider(x.font_family,{fontWeight:bt||400}):"",_t=le(x.inactive_font_weight||x.font_weight,_t),Mt=x.font_family&&"string"==typeof x.font_family?it.typefaceProvider(x.font_family,{fontWeight:_t||400}):"",Nt=gt(x.active_text_color,1,Nt),zt=gt(x.inactive_text_color,1,zt),Rt=gt(x.active_background_color,1,Rt),Lt=gt(x.inactive_background_color,1,Lt),Ht=Et(x.item_spacing,Ht),M&&(P&&(qt=gt(P,1,qt)),O&&(Jt=Pt(O,D,Jt))),k={background:qt,margin:Jt},E=void 0===V||Boolean(V),Zt=Bt(F||void 0,Zt),function(t){vt||(Kt=t.map(((t,e)=>{if(e===w&&(null==t?void 0:t.div))return rt.produceChildContext(t.div,{path:e})})),te=t.map(((t,e)=>e===w)))}(a),rt.json&&(ct&&(it.unregisterInstance(ct),ct=void 0),!rt.json.id||vt||rt.fakeElement||(ct=rt.json.id,it.registerInstance(ct,{setCurrentItem(t){if(t<0||t>a.length-1)throw new Error('Item is out of range in "set-current-item" action');re(t)},setPreviousItem(t,e){let r=w-t;r<0&&(r="ring"===e?rr(r,a.length):0),re(r)},setNextItem(t,e){let r=w+t;r>a.length-1&&(r="ring"===e?rr(r,a.length):a.length-1),re(r)},scrollToStart(){re(0)},scrollToEnd(){re(a.length-1)}}))),kt={"height-parent":"match_parent"===(null==C?void 0:C.type)?"yes":""},U(),j(),W(),H(),S(),J(),G(),Z(),Y(),X(),K(),vt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("tabs",ir,kt),componentContext:rt,layoutParams:nt,customActions:"tabs",parentOf:s,parentOfSimpleMode:!0,replaceItems:function(t){rt.json.items&&(rt=Object.assign(Object.assign({},rt),{json:Object.assign(Object.assign({},rt.json),{items:rt.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(ir.tabs__list,!0)+" "+I(B?ot:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":Zt?Dt(Zt,D):"","--divkit-tabs-font-size":dt(Ct),"--divkit-tabs-paddings":At,"--divkit-tabs-line-height":jt,"--divkit-tabs-letter-spacing":Vt,"--divkit-tabs-active-font-weight":bt||"","--divkit-tabs-inactive-font-weight":_t||"","--divkit-tabs-active-font-family":It||"","--divkit-tabs-inactive-font-family":Mt||"","--divkit-tabs-active-text-color":Nt,"--divkit-tabs-inactive-text-color":zt,"--divkit-tabs-active-background-color":Rt,"--divkit-tabs-inactive-background-color":Lt,"--divkit-tabs-border-radius":St,"--divkit-tabs-items-spacing":Ht?pt(10*Ht/Ct):""})}${L("this",ht,0)}>${N(A,(e=>{let r=e.index,n=r===w;return` ${R(Gt,"Actionable").$$render(t,{componentContext:rt,cls:Ft("tabs__item",ir,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!rt.fakeElement?[e.title_click_action].filter(Wt):[],attrs:{id:`${lt}-tab-${r}`,"aria-controls":`${lt}-panel-${r}`,role:"tab",tabindex:n&&!rt.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:rt.fakeElement?null:t=>function(t,e){return w===e||(re(e),!1)}(0,r)},{},{default:()=>`${I(e.title)}`})}`}))}</div> ${M?`<div${L("class",ir.tabs__separator,0)}${L("style",ut(k),0)}></div>`:""} <div class="${I(ir.tabs__panels,!0)+" "+I(B?ot:"",!0)}"${L("this",mt,0)}><div${L("class",Ft("tabs__swiper",ir,{inited:Xt,animated:Qt}),0)}${L("this",yt,0)}>${N(A,(e=>{let r=e.index,n=Kt[r];return` <div${L("class",Ft("tabs__panel",ir,{visible:te[r]}),0)} role="tabpanel" id="${I(lt,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(lt,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${n?`${R(_n,"Unknown").$$render(t,{componentContext:n,layoutParams:xt},{},{})}`:""} </div>`}))}</div></div>`})}`})),sr=ar,lr="divkit-eb860",cr="divkit-e08c6";function ur(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),o=r-n;return t[n]*o+t[n+1]*(1-o)}}ur([.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]),ur([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 dr=W(((t,e,r,n)=>{let o,i,a,s,l,c,u,{componentContext:d}=e,{layoutParams:p}=e;const h=f(at),m=f(Vt);let y,b,_,w,x=!1,k=new Map,E=new Set,C=null,A=[],j=[],F=[],V=[],D=!1;function S(t){w=(null==t?void 0:t.div)?d.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}async function O(t){if(_===t)return;h.setRunning("stateChange",!0);new Set(E);A.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),A=[];V.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),j=[],F=[],V=[];const e=c.find((e=>e.state_id===t))||null;return e?(_=t,null==s||s.setValue(_),S(e)):d.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),void await $()}return g(Vt,{registerInstance(t,e){C||(C=new Map),C.has(t)?d.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):C.set(t,e)},unregisterInstance(t){null==C||C.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return j.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const o=t.id;if(!o)return Promise.resolve();const i={id:o,json:t,parentComponentContext:e,transitions:r,node:n};return V.push(i),new Promise((t=>{i.resolvePromise=t}))},hasTransitionChange:t=>!!t&&k.has(t),registerChild(t){E.add(t)},unregisterChild(t){E.delete(t)}}),v((()=>{b&&m.unregisterInstance(b)})),void 0===e.componentContext&&r.componentContext&&void 0!==d&&r.componentContext(d),void 0===e.layoutParams&&r.layoutParams&&void 0!==p&&r.layoutParams(p),o=d.json.div_id||d.json.id,i=d.getJsonWithVars(d.json.default_state_id),a=d.json.state_id_variable,s=a?d.getVariable(a,"string"):null,l=d.origJson,l&&(D=!1),o?x=!1:(x=!0,d.logError(st(new Error('Missing "id" prop for div "state"')))),d.json&&(E=new Set),c=Array.isArray(d.json.states)&&d.json.states||[],u=c.map((t=>t.div)),(null==c?void 0:c.length)?x=!1:(x=!0,d.logError(st(new Error('Empty "states" prop for div "state"')))),d.json&&(b&&(m.unregisterInstance(b),b=void 0),o&&!(null==d?void 0:d.fakeElement)&&(b=o,m.registerInstance(o,{setState:O,getChild:function(t){if(C&&C.has(t))return C.get(t);d.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!D&&function(t){if(!D&&(D=!0,t.length)){const e=(null==s?void 0:s.getValue())||i;if(e){_=e;const r=t.find((t=>t.state_id===_))||null;S(r),r||d.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:_}}))}else{const e=t[0];_=e.state_id,S(e)}s&&(s.setValue(_),s.subscribe((t=>{O(t)})))}}(c),x?"":`${R(oe,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:d,layoutParams:p,parentOf:u,parentOfSimpleMode:!0,replaceItems:function(t){const e=d.json.states;e&&(c=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]}))),d.json=Object.assign(Object.assign({},d.json),{states:c}),_&&S(c.find((t=>t.state_id===_))||null))}},{},{default:()=>`${w?`${R(_n,"Unknown").$$render(t,{componentContext:w},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",y,0)}>${N(A,(e=>"direction"in e?`<div${L("class",lr,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",cr,0)}>${R(_n,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${L("class",lr,0)}><div${L("class",cr,0)}>${R(_n,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})}`})),pr=dr,vr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f",pager__arrow:"divkit-d78c2","pager__arrow-icon-path":"divkit-a94d9"},gr=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P=i,M=i,T=i,z=i,B=i,U=i;var W,H,q,J,G,Z,Y,X,Q,K;let{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);C=l(rt.direction,(t=>E=t));const nt=rt.genId("pager"),it=rt.getCustomization("pagerLeftClass"),lt=rt.getCustomization("pagerRightClass");j=l(rt.isDesktop,(t=>A=t)),er((function(){if(!gt)return;const t=function(){const t=Array.from(vt.children),e=vt.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===bt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:ft}();t!==ft&&(ft=t)}),50);let ct,vt,gt=!1,ft=0,ht=0,yt=!1,bt="horizontal",_t="",wt="",$t="";function xt(t,e="smooth"){const r="horizontal"===bt,n=vt.children[t],o=r?"offsetLeft":"offsetTop",i=r?"left":"top";vt.scroll({[i]:n[o],behavior:e}),ft=t}v((()=>{gt=!1,ct&&(rt.unregisterInstance(ct),ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==tt&&r.componentContext(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),o=tt.origJson,o&&(wt=""),a=tt.getDerivedFromVars(tt.json.layout_mode),M(),M=l(a,(t=>F=t)),s=tt.getDerivedFromVars(tt.json.orientation),B(),B=l(s,(t=>S=t)),u=tt.getDerivedFromVars(tt.json.item_spacing),z(),z=l(u,(t=>D=t)),d=tt.getDerivedFromVars(tt.json.paddings),T(),T=l(d,(t=>V=t)),p=tt.getDerivedFromVars(tt.json.restrict_parent_scroll),U(),U=l(p,(t=>O=t)),g=(Array.isArray(tt.json.items)&&tt.json.items||[]).map(((t,e)=>tt.produceChildContext(t,{path:e}))),F?"percentage"!==F.type&&"fixed"!==F.type?(yt=!0,tt.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):yt=!1:(yt=!0,tt.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),bt=Te(S,bt);{const t=null==D?void 0:D.value;t&&Ot(t)&&(_t=dt(t||0))}if(wt=Pt(V,E,wt),h="horizontal"===bt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==F?void 0:F.type)){const t=pt("horizontal"===bt?(("ltr"===E?null===(W=tt.json.paddings)||void 0===W?void 0:W.start:null===(H=tt.json.paddings)||void 0===H?void 0:H.end)||(null===(q=tt.json.paddings)||void 0===q?void 0:q.left)||0)+(("ltr"===E?null===(J=tt.json.paddings)||void 0===J?void 0:J.end:null===(G=tt.json.paddings)||void 0===G?void 0:G.start)||(null===(Z=tt.json.paddings)||void 0===Z?void 0:Z.right)||0):((null===(Y=tt.json.paddings)||void 0===Y?void 0:Y.top)||0)+((null===(X=tt.json.paddings)||void 0===X?void 0:X.bottom)||0)),e=null===(Q=F.neighbour_page_width)||void 0===Q?void 0:Q.value;$t=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${_t})`:"100%"}else if("percentage"===(null==F?void 0:F.type)){const t=null===(K=F.page_width)||void 0===K?void 0:K.value;$t=`${Number(t)}%`}return m={"grid-gap":_t,padding:wt,[h]:$t},y={orientation:bt},b=yt,_=A&&gt&&!b,w="ltr"===E?ft>0:ft+1<g.length,$="ltr"===E?ft+1<g.length:ft>0,x=rt.getStore("pagers"),P(),P=l(x,(t=>k=t)),function(t,e){const r=tt.json.id;if(r){const n=new Map(k);c(x,k=n.set(r,{instId:nt,size:t,currentItem:e,scrollToPagerItem:xt}),k)}}(g.length,ft),function(t){var e;if(t===ht)return;ht=t;const r=tt.getJsonWithVars(null===(e=g[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&tt.execAnyActions(r)}(ft),tt.json&&(ct&&(rt.unregisterInstance(ct),ct=void 0),tt.json.id&&!tt.fakeElement&&(ct=tt.json.id,rt.registerInstance(ct,{setCurrentItem(t){if(t<0||t>g.length-1)throw new Error('Item is out of range in "set-current-item" action');xt(t)},setPreviousItem:function(t,e){let r=ft-t;r<0&&(r="ring"===e?rr(r,g.length):0),xt(r)},setNextItem:function(t,e){let r=ft+t;r>g.length-1&&(r="ring"===e?rr(r,g.length):g.length-1),xt(r)},scrollToStart(){xt(0)},scrollToEnd(){xt(g.length-1)}}))),P(),C(),j(),M(),T(),z(),B(),U(),b?"":`${R(oe,"Outer").$$render(t,{cls:Ft("pager",vr,y),componentContext:tt,layoutParams:et,customPaddings:!0,parentOf:g.map((t=>t.json)),replaceItems:function(t){tt=Object.assign(Object.assign({},tt),{json:Object.assign(Object.assign({},tt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(vr.pager__items,!0)+" "+I(O?ot:"",!0)}"${L("style",ut(m),0)}${L("this",vt,0)}>${N(g,(e=>`<div${L("class",vr.pager__item,0)}>${R(_n,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${w&&_?` <div${L("class",it||`${vr.pager__arrow} ${Ye} ${Qe}`,0)}>${it?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",vr["pager__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>`:""} ${$&&_?` <div${L("class",lt||`${vr.pager__arrow} ${Ye} ${Ke}`,0)}>${lt?"":`<svg${L("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",vr["pager__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>`:""}`})}`})),fr=gr,hr={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_direction_ltr:"divkit-a7473",indicator_direction_rtl:"divkit-a7d63",indicator_placement_stretch:"divkit-b6bd3"},mr=["rounded_rectangle","circle"],yr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V=i,D=i,S=i,O=i,P=i,M=i,T=i,z=i,B=i;var U,W;let{componentContext:H}=e,{layoutParams:J}=e;const G=f(at);b=l(G.direction,(t=>y=t));let Z,Y,X,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,nt=10,ot=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==H&&r.componentContext(H),void 0===e.layoutParams&&r.layoutParams&&void 0!==J&&r.layoutParams(J),o=H.origJson,o&&(et="default",rt=15,nt=10,ot=5,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"}),a=H.getDerivedFromVars(H.json.shape),M(),M=l(a,(t=>C=t)),s=H.getDerivedFromVars(H.json.active_item_color),O(),O=l(s,(t=>k=t)),c=H.getDerivedFromVars(H.json.inactive_item_color),P(),P=l(c,(t=>E=t)),u=H.getDerivedFromVars(H.json.active_item_size),T(),T=l(u,(t=>A=t)),d=H.getDerivedFromVars(H.json.active_shape),B(),B=l(d,(t=>F=t)),p=H.getDerivedFromVars(H.json.inactive_shape),z(),z=l(p,(t=>j=t)),v=H.getDerivedFromVars(H.json.space_between_centers),D(),D=l(v,(t=>w=t)),g=H.getDerivedFromVars(H.json.items_placement),S(),S=l(g,(t=>x=t)),F&&(Q=xe({type:"shape_drawable",shape:F},mr,Q)),j&&(K=xe({type:"shape_drawable",shape:j},mr,K)),!F&&!j&&C){const t=ae(A,1.3);K=xe({type:"shape_drawable",shape:C,color:K.background},mr,K),K.background=gt(E,1,K.background),Q=Object.assign(Object.assign({},K),{width:K.width*t,height:K.height*t,borderRadius:K.borderRadius*t,background:Q.background}),Q.background=gt(k,1,Q.background)}if(!x||"default"!==x.type&&"stretch"!==x.type)et="default",w&&(rt=Et(w.value,rt));else if(et=x.type,"default"===et)rt=Et(null===(U=x.space_between_centers)||void 0===U?void 0:U.value,rt);else if("stretch"===et){const t=x;nt=ae(t.max_visible_items,nt),ot=Et(null===(W=t.item_spacing)||void 0===W?void 0:W.value,ot)}return h=G.getStore("pagers"),V(),V=l(h,(t=>_=t)),async function(t){if(H.json.pager_id&&t.has(H.json.pager_id)&&(X=t.get(H.json.pager_id),await $(),Y)){const t=Y.children[X.currentItem];if(t){const e=t.offsetLeft;Z.scroll({left:e-Z.clientWidth/2,behavior:"smooth"})}}}(_),m={placement:et,direction:y},b(),V(),D(),S(),O(),P(),M(),T(),z(),B(),`${R(oe,"Outer").$$render(t,{cls:Ft("indicator",hr,m),componentContext:H,layoutParams:J},{},{default:()=>`<div${L("class",hr.indicator__scroller,0)}${L("this",Z,0)}><div${L("class",hr.indicator__items,0)} role="tablist"${q({margin:"default"===et?`0 ${dt(Math.max(0,Q.width-K.width)/2)}`:"","--divkit-indicator-inactive-width":dt(K.width),"--divkit-indicator-inactive-height":dt(K.height),"--divkit-indicator-inactive-border-radius":dt(K.borderRadius),"--divkit-indicator-inactive-background":K.background||"","--divkit-indicator-inactive-box-shadow":K.boxShadow||"","--divkit-indicator-active-width":dt(Q.width),"--divkit-indicator-active-height":dt(Q.height),"--divkit-indicator-active-border-radius":dt(Q.borderRadius),"--divkit-indicator-active-background":Q.background||"","--divkit-indicator-active-box-shadow":Q.boxShadow||"","--divkit-indicator-active-scale":Q.width/K.width,"--divkit-indicator-default-margin":"default"===et?`0 ${dt((rt-K.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?dt(ot):"","--divkit-indicator-stretch-max-count":"stretch"===et?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?dt((nt-1)*ot):""})}${L("this",Y,0)}>${X?`${N(Array(X.size),((t,e)=>{let r=e===X.currentItem;return` <div class="${I(Ft("indicator__item",hr,{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>`})}`})),br=yr,_r={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider_direction_rtl:"divkit-fb7b5",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 wr(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&gt(t.text_color)||"#000",o=se(t.font_weight);if(Yt(t.font_size)&&"transparent"!==n){var i,a;const e={fontSize:dt(t.font_size),fontWeight:o,textColor:n};return"number"==typeof(null==r||null===(i=r.x)||void 0===i?void 0:i.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 $r(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const xr="function"==typeof BigInt;function kr(t){return xr?BigInt(t):Number(t)}const Er=kr("9223372036854775807"),Cr=kr("-9223372036854775808");function Ar(t){const e=kr(t);if(e>Er||e<Cr)throw new Error("Integer overflow.");if("number"==typeof e&&(Number.isNaN(e)||e!==Math.round(e)))throw new Error("Incorrect integer value.");return e}const jr=Ar(0);function Fr(t){let e=t;return e<0&&(e=-e),e}function Vr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ar(e)}class Dr{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=Q(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}}class Sr extends Dr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Or extends Dr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Ar(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Ar(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class Pr extends Dr{convertValue(t){if("number"!=typeof t||Number.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"}}class Ir extends Dr{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"}}class Mr extends Dr{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"}}class Tr extends Dr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Nr extends Dr{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"}}class zr extends Dr{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"}}const Rr={string:Sr,number:Pr,integer:Or,boolean:Ir,color:Mr,url:Tr,dict:Nr,array:zr};function Br(t,e,r){if(!(e in Rr))throw new Error("Unsupported variable type");return new Rr[e](t,r)}function Ur(){}function Wr(t){return t(this.value),Ur}function Lr(){throw new Error("Cannot change the value of this type of variable")}const Hr={string:class extends Sr{},number:class extends Pr{},integer:class extends Or{},boolean:class extends Ir{},color:class extends Mr{},url:class extends Tr{},dict:class extends Nr{},array:class extends zr{}};for(const t in Hr){const e=Hr[t];e.prototype.subscribe=Wr,e.prototype.set=Lr,e.prototype.setValue=Lr}const qr={width:10,height:10,borderRadius:5,background:"#000"},Jr=["rounded_rectangle","circle"],Gr=["rounded_rectangle"];function Zr(t,e,r,n,o){let i=[];if(o)for(let o=t;o<e;++o)i.push((o-r)/(n-r));else{for(let e=r;e<t;++e)i.push((e-r)/(n-r));for(let t=e;t<n+1;++t)i.push((t-r)/(n-r))}return i}const Yr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U,W,H,J,G,Z,Y,X,Q,K,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,ut=i,vt=i,gt=i,ft=i,ht=i,mt=i;var yt,bt,_t,wt;let{componentContext:$t}=e,{layoutParams:xt}=e;const kt=f(at),Et=f(qt);let Ct;P=l(kt.direction,(t=>O=t));let At,jt,Vt,Dt=0,St=100,Pt=qr,It=Pt,Mt=qr,Tt=qr,Nt=null,Rt=null,Bt=Vt,Ut="",Wt="",Lt=!1,Ht=$r(X||0,Dt,St),Jt=$r(Y||0,Dt,St);er((function(){}),50),v((()=>{Ct&&(kt.unregisterFocusable(Ct),Ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==$t&&r.componentContext($t),void 0===e.layoutParams&&r.layoutParams&&void 0!==xt&&r.layoutParams(xt),o=$t.origJson,o&&(Pt=qr,It=Pt,Mt=qr,Tt=qr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Wt=""),a=$t.json.thumb_value_variable,s=$t.json.thumb_secondary_value_variable,c=a&&$t.getVariable(a,"integer")||Br("temp","integer",0),ft(),ft=l(c,(t=>X=t)),u=s&&$t.getVariable(s,"integer")||Br("temp","integer",0),gt(),gt=l(u,(t=>Y=t)),d=$t.getDerivedFromVars($t.json.min_value),mt(),mt=l(d,(t=>K=t)),p=$t.getDerivedFromVars($t.json.max_value),ht(),ht=l(p,(t=>Q=t)),g=$t.getDerivedFromVars($t.json.thumb_style),vt(),vt=l(g,(t=>Z=t)),h=$t.getDerivedFromVars($t.json.thumb_secondary_style),ut(),ut=l(h,(t=>G=t)),m=$t.getDerivedFromVars($t.json.track_inactive_style),ct(),ct=l(m,(t=>J=t)),y=$t.getDerivedFromVars($t.json.track_active_style),lt(),lt=l(y,(t=>H=t)),b=$t.getDerivedFromVars($t.json.tick_mark_active_style),it(),it=l(b,(t=>W=t)),_=$t.getDerivedFromVars($t.json.tick_mark_inactive_style),ot(),ot=l(_,(t=>U=t)),w=$t.getDerivedFromVars($t.json.thumb_text_style),nt(),nt=l(w,(t=>B=t)),$=$t.getDerivedFromVars($t.json.thumb_secondary_text_style),rt(),rt=l($,(t=>z=t)),x=$t.getDerivedFromVars($t.json.accessibility),et(),et=l(x,(t=>T=t)),k=$t.getDerivedFromVars($t.json.secondary_value_accessibility),tt(),tt=l(k,(t=>M=t)),Dt=zt(K,Dt),St=zt(Q,St);{const t=$r(X||0,Dt,St);t!==Ht&&(Ht=t)}{const t=$r(Y||0,Dt,St);t!==Jt&&(Jt=t)}Pt=xe(Z,Jr,Pt),It=xe(G,Jr,Pt),Mt=xe(J,Gr,Mt),Tt=xe(H,Gr,Tt);{let t=xe(W,Jr,qr);t!==qr&&(Nt=t)}At=Nt?s?Zr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!0):Zr(Dt,Ht,Dt,St,!0):[];{let t=xe(U,Jr,qr);t!==qr&&(Rt=t)}jt=Rt?s?Zr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!1):Zr(Ht+1,St+1,Dt,St,!0):[],Vt=wr(B,Vt),Bt=wr(z,Vt),(null==T?void 0:T.description)?Ut=T.description:$t.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==M?void 0:M.description)?Wt=M.description:s&&$t.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Et.hasAction()?($t.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===qr?($t.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===qr?($t.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===qr&&($t.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Lt&&(Lt=t)}return E=dt(Math.max(...[Pt.width,It.width,0].filter(Ot))),C=dt(Math.max(...[Pt.height,It.height,0].filter(Ot))),A=(Ht-Dt)/(St-Dt),j=s?(Jt-Dt)/(St-Dt):void 0,F=void 0!==j?Math.abs(j-A):A,V=void 0!==j?Math.min(j,A):0,D={"--divkit-slider-thumb-width":dt(Pt.width),"--divkit-slider-thumb-height":dt(Pt.height),"--divkit-slider-thumb-secondary-width":dt(It.width),"--divkit-slider-thumb-secondary-height":dt(It.height),"--divkit-slider-text-offset-x":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(bt=null==Vt?void 0:Vt.offset)||void 0===bt?void 0:bt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(wt=null==Bt?void 0:Bt.offset)||void 0===wt?void 0:wt.y)?pt(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?dt(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?dt(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?dt(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?dt(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?dt(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?dt(Rt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Rt?void 0:Rt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":E,"--divkit-slider-max-thumb-height":C,"--divkit-slider-track-part":A,"--divkit-slider-track-secondary-part":j},S={direction:O},$t.json,P(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),ut(),vt(),gt(),ft(),ht(),mt()," "+(Lt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("slider",_r,S),style:D,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:$t,layoutParams:xt},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,o,i,a,l;return`<div${L("class",_r["slider__tracks-wrapper"],0)}><div${L("class",_r["slider__tracks-inner"],0)}${L("this",undefined,0)}><div${L("class",_r.slider__track,0)}${q({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${L("class",_r["slider__active-track"],0)}${q({left:"ltr"===O?(100*V).toFixed(2)+"%":void 0,right:"ltr"===O?void 0:(100*V).toFixed(2)+"%",width:(100*F).toFixed(2)+"%",height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> ${N(At,(t=>`<div class="${I(_r.slider__tick,!0)+" "+I(_r.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(jt,(t=>`<div class="${I(_r.slider__tick,!0)+" "+I(_r.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${L("class",_r.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${L("class",_r["slider__thumb-text"],0)}><div${L("class",_r["slider__thumb-text-inner"],0)}${q({"font-size":(null===(r=Vt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(n=Vt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Vt)||void 0===o?void 0:o.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${s?`<div class="${I(_r.slider__thumb,!0)+" "+I(_r.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(_r["slider__thumb-text"],!0)+" "+I(_r["slider__thumb-text_secondary"],!0)}"><div${L("class",_r["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=Bt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(a=Bt)||void 0===a?void 0:a.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",_r.slider__input,0)}${L("min",Dt,0)}${L("max",St,0)} step="1"${L("value",Ht,0)}${L("aria-label",Ut,0)}${L("this",undefined,0)}> ${s?`<input type="range"${L("class",`${_r.slider__input} ${_r.slider__input_secondary}`,0)}${L("min",Dt,0)}${L("max",St,0)} step="1"${L("value",Jt,0)}${L("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Xr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_end":"divkit-e9096",input__aligner:"divkit-e0491",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_start":"divkit-cd14f","input_alignment-vertical_end":"divkit-cd38f","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 Qr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Qr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const o=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-o>=r&&t[n-o]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-o}}function Kr(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 tn{constructor(t){this.char=t}}class en{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class rn{constructor(t){Kr(this,"filters",new Map),Kr(this,"destructedValue",[]),Kr(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 tn)t+=r.char;else if(r instanceof en)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 en&&!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 en(null,this.filters.get(e.key),e.placeholder):new tn(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=Qr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),o=this.buildTailSubstring(r);this.cleanup(r);const i=this.firstEmptyHolderIndex(),a=o?this.calculateMaxShift(o,i):void 0;this.replaceChars(n,i,a);const s=this.firstEmptyHolderIndex();this.replaceChars(o,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,n=e;for(;n<this.destructedValue.length;)this.destructedValue[n]instanceof en&&++r,++n;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let n=0;for(;n<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+n);)++n;return Math.max(0,n-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 en&&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 en&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let n;n=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=n}calculateInsertableSubstring(t,e){let r="",n=e;const o=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof en);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=o();null!=e&&e.test(t)&&(r+=t,++n)})),r}collectValueRange(t,e){let r="",n=t;for(;n<=e;){const t=this.destructedValue[n];t instanceof en&&null!==t.char&&(r+=t.char),++n}return r}replaceChars(t,e,r){let n=this.calculateInsertableSubstring(t,e);void 0!==r&&(n=n.substring(0,r));let o=e,i=0;for(;o<this.destructedValue.length&&i<n.length;){const t=this.destructedValue[o],e=n[i];t instanceof en&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof en);)++e;return e}}class nn extends rn{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function on(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 an extends rn{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),on(this,"currencyFormatter",new Intl.NumberFormat),on(this,"decimalSeparator","."),on(this,"localeDigits",{}),on(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),n=[{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:n,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Qr(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),o=t.lastIndexOf(this.decimalSeparator),i=n!==o||-1===n&&-1===o,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;i&&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,n=0;for(;n<t.length;){if(t[n]===this.decimalSeparator&&!this.inDiff(e,n)){r=n;break}n++}let o=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(o=e.start);const i=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=i;if(-1!==r)for(n=r;n<t.length;)this.isDigit(t[n])&&!this.inDiff(e,n)&&a--,n++;else{let r=!1;for(let n=0;n<t.length;n++){const o=t[n];o===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(o)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==o,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=i;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===o?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==n&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=n),n--}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 sn(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 ln(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(),n=t.parentNode,o=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,o),r.setEnd(n,o),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],o=sn(n);if(e<=o)return void ln(n,e);e-=o}else try{const r=window.getSelection();if(r){r.removeAllRanges();const n=document.createRange();n.setStart(t,e),n.setEnd(t,e),r.addRange(n)}}catch(t){}}const cn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),un={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url",password:"password"},dn=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,M,T,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,ot,it,lt,ct,vt,ft,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Ct=i,At=i,jt=i,Vt=i,Ot=i,Pt=i,It=i,Mt=i,Tt=i,Nt=i,zt=i;var Rt;let{componentContext:Ut}=e,{layoutParams:Wt}=e;const Lt=f(at);let Ht,qt;q=l(Lt.direction,(t=>H=t));let Jt,Gt,Zt,Xt=null,Qt="",Kt="",te=!1,ee="",re=12,ne="",ie="",se="#000",ce="",ue="start",ge="center",fe="multi_line_text",he="text",me="",ye=null,be="",_e="",we="",$e=!0;function xe(t){qt instanceof HTMLInputElement?qt.selectionStart=qt.selectionEnd=t:ln(qt,t)}async function ke(){if(!qt||!Xt)return;Xt.overrideRawValue(U),d.set(Xt.rawValue),c(u,B=Qt=Kt=Xt.value,B);const t=Xt.cursorPosition;await $(),document.activeElement===qt&&xe(t)}var Ee;v((()=>{Ht&&(Lt.unregisterFocusable(Ht),Ht=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Ut&&r.componentContext(Ut),void 0===e.layoutParams&&r.layoutParams&&void 0!==Wt&&r.layoutParams(Wt),o=Ut.origJson,o&&(ee="",re=12,Jt=void 0,ne="",Gt=void 0,se="#000",ce="",ue="left",ge="center",fe="multi_line_text",he="text",Zt=void 0,$e=!0),a=Ut.json.text_variable,s=null===(Rt=Ut.json.mask)||void 0===Rt?void 0:Rt.raw_text_variable,u=a&&Ut.getVariable(a,"string")||Br("temp","string",""),ht(),ht=l(u,(t=>B=t)),d=s&&Ut.getVariable(s,"string")||Br("temp","string",""),mt(),mt=l(d,(t=>U=t)),p=Ut.getDerivedFromVars(Ut.json.hint_text),Nt(),Nt=l(p,(t=>vt=t)),g=Ut.getDerivedFromVars(Ut.json.hint_color),Tt(),Tt=l(g,(t=>ct=t)),h=Ut.getDerivedFromVars(Ut.json.font_size),Mt(),Mt=l(h,(t=>lt=t)),m=Ut.getDerivedFromVars(Ut.json.font_weight),It(),It=l(m,(t=>it=t)),y=Ut.getDerivedFromVars(Ut.json.font_family),Pt(),Pt=l(y,(t=>ot=t)),b=Ut.getDerivedFromVars(Ut.json.line_height),Ot(),Ot=l(b,(t=>nt=t)),_=Ut.getDerivedFromVars(Ut.json.letter_spacing),Vt(),Vt=l(_,(t=>rt=t)),w=Ut.getDerivedFromVars(Ut.json.text_color),jt(),jt=l(w,(t=>et=t)),x=Ut.getDerivedFromVars(Ut.json.highlight_color),At(),At=l(x,(t=>tt=t)),k=Ut.getDerivedFromVars(Ut.json.text_alignment_horizontal),Ct(),Ct=l(k,(t=>K=t)),E=Ut.getDerivedFromVars(Ut.json.text_alignment_vertical),kt(),kt=l(E,(t=>Q=t)),C=Ut.getDerivedFromVars(Ut.json.keyboard_type),$t(),$t=l(C,(t=>Y=t)),A=Ut.getDerivedFromVars(Ut.json.mask),wt(),wt=l(A,(t=>Z=t)),j=Ut.getDerivedFromVars(Ut.json.max_visible_lines),_t(),_t=l(j,(t=>G=t)),F=Ut.getDerivedFromVars(Ut.json.paddings),bt(),bt=l(F,(t=>J=t)),V=Ut.getDerivedFromVars(Ut.json.accessibility),yt(),yt=l(V,(t=>W=t)),D=Ut.getDerivedFromVars(Ut.json.select_all_on_focus),zt(),zt=l(D,(t=>ft=t)),S=Ut.getDerivedFromVars(Ut.json.is_enabled),xt(),xt=l(S,(t=>X=t)),a?te=!1:(te=!0,Ut.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(Ee=Z)?void 0:Ee.type)?Xt=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 n={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(n),r):new nn(n,e)}return r||null}(Ee,Ut.logError,Xt):"currency"===(null==Ee?void 0:Ee.type)&&(Xt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new an(t.locale,e)}(Ee,Ut.logError,Xt)),Xt&&ke(),Xt||Qt===B||(Qt=Kt=B),Xt&&Xt.rawValue!==U&&ke(),O=vt,ee=gt(ct,1,ee),re=ae(lt,re),Jt=le(it,Jt),ne=ot&&"string"==typeof ot?Lt.typefaceProvider(ot,{fontWeight:Jt||400}):"";{const t=nt;Yt(t)&&(Gt=t/re)}return St(rt)&&(ie=dt(rt)),se=gt(et,1,se),ce=gt(tt,1,ce),ue=de(K,H,ue),ge=pe(Q,ge),$e=ve(X,$e),Y&&Y in un&&(he=un[Y],fe=Y),"currency"===(null==Z?void 0:Z.type)&&(he=cn?"text":"tel",Zt="decimal"),P="multi_line_text"===fe,me=Yt(G)?`calc(${G*(Gt||1.25)*(re/10)+"em"} + ${pt(Et(null==J?void 0:J.top,0)+Et(null==J?void 0:J.bottom,0))})`:"",ye=Bt(J||void 0,ye),be=ye?Dt({top:(Number(ye.top)||0)/re*10,right:(Number("ltr"===H?ye.end:ye.start)||Number(ye.right)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10,left:(Number("ltr"===H?ye.start:ye.end)||Number(ye.left)||0)/re*10},H):"",_e=ye?Dt({top:(Number(ye.top)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10},H):"",(null==W?void 0:W.description)?we=W.description:Ut.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),M={"highlight-color":Boolean(ce),multiline:P,"alignment-horizontal":ue,"alignment-vertical":ge},T={"--divkit-input-hint-color":ee,"--divkit-input-highlight-color":ce,"--divkit-input-line-height":Gt,"font-weight":Jt,"font-family":ne,"letter-spacing":ie,color:se,"max-height":me},N={"font-size":dt(re),padding:be},z={"font-size":dt(re),padding:_e},qt&&Ut.json&&(Ht&&(Lt.unregisterFocusable(Ht),Ht=void 0),Ut.json.id&&!Ut.fakeElement&&(Ht=Ut.json.id,Lt.registerFocusable(Ht,{focus(){qt&&qt.focus()}}))),ht(),mt(),yt(),q(),bt(),_t(),wt(),$t(),xt(),kt(),Ct(),At(),jt(),Vt(),Ot(),Pt(),It(),Mt(),Tt(),Nt(),zt(),te?"":`${R(oe,"Outer").$$render(t,{cls:Ft("input",Xr,M),style:T,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Ut,layoutParams:Wt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return P?`<span${L("class",Xr["input__scroll-wrapper"],0)}>${!Kt&&O?`<div${L("class",Xr.input__placeholder,0)} aria-hidden="true"${L("style",ut(N),0)}>${I(O)}</div>`:""} <span${L("class",Xr.input__aligner,0)} aria-hidden="true"${L("style",ut(z),0)}>​</span> ${$e?` <span${L("class",Ft("input__input",Xr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true" role="textbox" tabindex="0"${L("aria-label",we,0)} aria-multiline="true"${L("style",ut(N),0)}${L("this",qt,0)}>${n=Kt,void 0===n?"":n}</span>`:`<span${L("class",Ft("input__input",Xr,{multiline:!0}),0)} autocapitalize="off" contenteditable="false" role="textbox"${L("aria-label",we,0)} aria-disabled="true" aria-multiline="true"${L("style",ut(N),0)}${L("this",qt,0)}>${(t=>void 0===t?"":t)(Kt)}</span>`}</span>`:`<input${L("type",he,0)}${L("inputmode",Zt,0)}${L("class",Ft("input__input",Xr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",we,0)}${L("style",ut(N),0)} ${$e?"":"disabled"}${L("placeholder",O,0)}${L("value",Qt,0)}${L("this",qt,0)}>`;var n}})}`})),pn={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"},vn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,M,T,z,B,U,W=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,K=i,tt=i,{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);let ot;T=l(nt.direction,(t=>M=t));let it,lt,ct=!1,pt="",vt=null,ft="",ht="rgba(0,0,0,.45)",mt=12,yt="",bt="",_t="#000",wt="";v((()=>{ot&&(nt.unregisterFocusable(ot),ot=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==et&&r.componentContext(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),o=et.origJson,o&&(vt=null,ht="rgba(0,0,0,.45)",mt=12,it=void 0,yt="",lt=void 0,bt="",_t="#000",wt=""),a=et.json.value_variable,s=et.json.options,c=Array.isArray(s)&&s.filter((t=>"string"==typeof t.value))||[],u=a&&et.getVariable(a,"string")||Br("temp","string",""),K(),K=l(u,(t=>B=t)),d=et.getDerivedFromVars(et.json.paddings),Q(),Q=l(d,(t=>z=t)),p=et.getDerivedFromVars(et.json.hint_text),tt(),tt=l(p,(t=>U=t)),g=et.getDerivedFromVars(et.json.hint_color),X(),X=l(g,(t=>P=t)),h=et.getDerivedFromVars(et.json.font_size),Y(),Y=l(h,(t=>O=t)),m=et.getDerivedFromVars(et.json.font_weight),Z(),Z=l(m,(t=>S=t)),y=et.getDerivedFromVars(et.json.font_family),G(),G=l(y,(t=>D=t)),b=et.getDerivedFromVars(et.json.line_height),J(),J=l(b,(t=>V=t)),_=et.getDerivedFromVars(et.json.letter_spacing),q(),q=l(_,(t=>F=t)),w=et.getDerivedFromVars(et.json.text_color),H(),H=l(w,(t=>j=t)),$=et.getDerivedFromVars(et.json.accessibility),W(),W=l($,(t=>A=t)),Array.isArray(c)&&c.length||et.logError(st(new Error('Empty selection "items" in "select"'))),a?ct=!1:(ct=!0,et.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=c.find((t=>t.value===B));t?pt=("string"==typeof t.text?t.text:t.value)||"":(pt="",B&&et.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}mt=ae(O,mt),vt=Bt(z||void 0,vt),ft=vt?Dt({top:(Number(vt.top)||0)/mt*10,right:(Number("ltr"===M?vt.end:vt.start)||Number(vt.right)||0)/mt*10,bottom:(Number(vt.bottom)||0)/mt*10,left:(Number("ltr"===M?vt.start:vt.end)||Number(vt.left)||0)/mt*10},M):"",ht=gt(P,1,ht),it=le(S,it),yt=D&&"string"==typeof D?nt.typefaceProvider(D,{fontWeight:it||400}):"";{const t=V;Yt(t)&&(lt=t/mt)}return St(F)&&(bt=dt(F/mt*10)),_t=gt(j,1,_t),(null==A?void 0:A.description)?wt=A.description:et.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),x={hint:!pt},k={"--divkit-input-hint-color":ht,"font-weight":it,"font-family":yt,color:_t},E={padding:ft,"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},C={"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},et.json,W(),H(),q(),J(),G(),Z(),Y(),X(),T(),Q(),K(),tt(),ct?"":`${R(oe,"Outer").$$render(t,{cls:Ft("select",pn,x),style:k,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:et,layoutParams:rt},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",pn["select__select-text"],0)}${L("style",ut(E),0)} aria-hidden="true"> ${I(pt||U||"​")}</span> <select${L("class",Ft("select__select",pn,{"has-custom-focus":t}),0)}${L("aria-label",wt,0)}${L("style",ut(C),0)}${L("this",undefined,0)}>${N(c,(t=>`<option${L("class",pn.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),gn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},fn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j=i,F=i,V=i,D=i,S=i,O=i,P=i,I=i,{componentContext:M}=e,{layoutParams:T}=e;const z=f(at);let B,U,W,H,J=!1,G=!1,Z=[],Y=!1,X=!1,Q=!1,K=!1,tt="fit",et="0";var rt,nt;v((()=>{B&&(z.unregisterInstance(B),B=void 0),H&&(H(),H=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==M&&r.componentContext(M),void 0===e.layoutParams&&r.layoutParams&&void 0!==T&&r.layoutParams(T),M.json&&(Y=!1,X=!1,Q=!1,K=!1,W=void 0,tt="fit"),o=M.json.elapsed_time_variable,a=o&&M.getVariable(o,"integer")||Br("temp","integer",0),a&&(H&&H(),H=a.subscribe((function(t){G&&(G=!1)}))),s=M.getDerivedFromVars(M.json.video_sources),I(),I=l(s,(t=>A=t)),c=M.getDerivedFromVars(M.json.repeatable),P(),P=l(c,(t=>C=t)),u=M.getDerivedFromVars(M.json.autostart),j(),j=l(u,(t=>_=t)),d=M.getDerivedFromVars(M.json.muted),O(),O=l(d,(t=>E=t)),p=M.getDerivedFromVars(M.json.preload_required),S(),S=l(p,(t=>k=t)),g=M.getDerivedFromVars(M.json.preview),D(),D=l(g,(t=>x=t)),h=M.getDerivedFromVars(M.json.scale),V(),V=l(h,(t=>$=t)),m=M.getDerivedFromVars(M.json.aspect),F(),F=l(m,(t=>w=t)),rt=A,nt=Z,Z=Array.isArray(rt)&&rt.length?rt.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})):nt,Z.length?J=!1:(J=!0,M.logError(st(new Error('Missing "video_sources" in "video"')))),Y=ve(C,Y),X=ve(_,X),Q=ve(E,Q),K=ve(k,K),W="string"==typeof x?Re(x):W,tt=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}($)||tt;{const t=null==w?void 0:w.ratio;et=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return M.json&&(B&&(z.unregisterInstance(B),B=void 0),!M.json.id||J||M.fakeElement||(B=M.json.id,z.registerInstance(B,{pause:function(){},start:function(){}}))),M.json,y={aspect:"0"!==et},b={"object-fit":tt},j(),F(),V(),D(),S(),O(),P(),I(),J?"":`${R(oe,"Outer").$$render(t,{cls:Ft("video",gn,y),customActions:"video",componentContext:M,layoutParams:T},{},{default:()=>y.aspect?`<div${L("class",gn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${et}%`})}><video${L("class",gn.video__video,0)}${L("style",ut(b),0)} playsinline ${Y?"loop":""} ${X?"autoplay":""} ${Q?"muted":""}${L("poster",W,0)}${L("preload",K?"metadata":"auto",0)}${L("this",U,0)}>${N(Z,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",gn.video__video,0)}${L("style",ut(b),0)} playsinline ${Y?"loop":""} ${X?"autoplay":""} ${Q?"muted":""}${L("poster",W,0)}${L("preload",K?"metadata":"auto",0)}${L("this",U,0)}>${N(Z,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),hn=fn,mn=W(((t,e,r,n)=>{let o,i;var a;let{componentContext:s}=e,{layoutParams:l}=e;const c=f(at);let u=null,d="",p={},v=!1;if(void 0===e.componentContext&&r.componentContext&&void 0!==s&&r.componentContext(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),"string"==typeof s.json.custom_type&&s.json.custom_type&&(null===(a=c.customComponents)||void 0===a?void 0:a.has(s.json.custom_type))){if(u=c.customComponents.get(s.json.custom_type),"function"==typeof u.template){const t=c.getExtensionContext(),e=new Map;for(const[r,n]of t.variables)e.set(r,n.getValue());d=u.template({props:s.json.custom_props,variables:e})}else d=u.template&&"string"==typeof u.template?u.template:"";p={shadowrootmode:u.shadowRootMode||"open"}}else u=null,d=";",s.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return o=s.json.items,void 0===o||Array.isArray(o)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),i=(!v&&o||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(oe,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${S([T(s.json.custom_props||{})],{})}${L("this",undefined,0)}>${V(e)?"":`${d?`<template${S([T(p)],{})}> ${d}</template>`:""} ${!v&&o?`${N(i,(e=>`${R(_n,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),yn=mn,bn={};bn.text=he,bn.container=Ie,bn.separator=Ne,bn.image=Ue,bn.gif=Ue,bn.grid=Ge,bn.gallery=or,bn.tabs=sr,bn.state=pr,bn.pager=fr,bn.indicator=br,bn.slider=Yr,bn.input=dn,bn.select=vn,bn.video=hn,bn.custom=yn;const _n=W(((t,e,r,n)=>{let{componentContext:o}=e,{layoutParams:i}=e;const a=f(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.layoutParams&&r.layoutParams&&void 0!==i&&r.layoutParams(i);{const t=o.json;if(s=(null==t?void 0:t.type)&&bn[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",o.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||z,"svelte:component").$$render(t,{componentContext:o,layoutParams:i},{},{})}`:""})),wn=W(((t,e,r,n)=>{let{svgFiltersMap:o}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==o&&r.svgFiltersMap(o),Object.keys(o).length?`<svg${L("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(o)],(t=>{let[e,r]=t.split(":");return` <filter${L("id",o[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 $n(t,e,r,n){const o=r[t.type];if(!o)return n(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let i;const a={};for(i in e)e.hasOwnProperty(i)&&(a[i]=e[i]);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(a[i]=t[i]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),o=n.filter((t=>"$"!==t.charAt(0))),i=n.filter((t=>"$"===t.charAt(0)));return o.forEach((n=>{const o=r[n];"object"==typeof o&&null!==o?(e[n]=Array.isArray(o)?[]:{},t(e[n],o)):e[n]=o})),i.forEach((t=>{const n=r[t],o=a[n];if(void 0!==o){const r=t.substring(1);e[r]=o}})),e}({},o);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(s[i]=t[i]);return{json:s,templateContext:a}}function xn(){}function kn(t){return{subscribe:e=>(e(t),xn)}}function En(t,e){return e.length?e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t):t}function Cn(t,e){return e.length?e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t):t}function An(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 jn(t){try{return Ar(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Fn(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Vn(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,Vn.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function Dn(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}kn(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Vn,Error),Vn.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+i.line+":"+i.column;if(n){var s=this.location.end,l=Dn("",i.line.toString().length," "),c=n[o.line-1],u=(o.line===s.line?s.column:c.length+1)-o.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+i.line+" | "+c+"\n"+l+" | "+Dn("",o.column-1," ")+Dn("",u,"^")}else e+="\n at "+a}return e},Vn.buildMessage=function(t,e){var r={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function i(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};const Sn=Number.MAX_VALUE,On=Number.MIN_VALUE,Pn="string",In="integer",Mn="number",Tn="boolean",Nn="color",zn="url",Rn="datetime",Bn="dict",Un="array";function Wn(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=>{Wn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Wn(t.left,e),Wn(t.right,e);break;case"UnaryExpression":Wn(t.argument,e);break;case"ConditionalExpression":Wn(t.test,e),Wn(t.consequent,e),Wn(t.alternate,e);break;case"TryExpression":Wn(t.test,e),Wn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Wn(t,e)}))}}function Ln(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Hn(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function qn(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 Hn(t.value);if("color"===t.type)return to(Kn(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 Jn(t){let e=qn(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Gn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Zn(t,e){if(xr)return Ar(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Yn(t,e){if(e<Cr||e>Er)throw new Error("Integer overflow.");!xr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Xn(t){const e=[];return Wn(t,{Variable(t){e.push(t.id.name)}}),e}function Qn(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Kn(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function to(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 vt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function eo(t){return to(Kn(t))}function ro(t){return{type:Mn,value:Number(t.value)}}const no={string:"string",number:"number",integer:"number",boolean:"boolean",color:"string",url:"string",array:"array",dict:"object"};function oo(t,e,r){const n=no[r];let o=typeof e;if("array"===n&&!Array.isArray(e)||"array"!==n&&o!==n||"object"===o&&null===e)throw"object"===o&&(o=Array.isArray(e)?"array":null===e?"null":"dict"),new Error(`Incorrect value type: expected "${r}", got "${o}".`);if("number"===n&&"integer"===r){Yn(t,e);try{e=Ar(e)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===n&&"color"===r&&(e=eo(e)),{type:r,value:e}}const io=new Map,ao=new Map,so=new Map,lo=new Map;function co(t,e,r){const n={args:e,cb:r},o=io.get(t)||[];io.has(t)||io.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");ao.set(i,n)}function uo(t,e,r){const n={args:e,cb:r},o=so.get(t)||[];so.has(t)||so.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");lo.set(i,n)}function po(t,e){const r=t.args.length;let n=t.args.length,o=0;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==Mn||e[r].type!==In){if(n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}else++o}return{type:"match",conversions:o}}function vo(t,e,r){const n=("function"===t?io:so).get(e);if(!n)return{type:"missing"};let o=null,i=null;for(let t=0;t<n.length;++t){const e=po(n[t],r);"match"!==e.type?o||(o=e):(!i||i.conversions>e.conversions)&&(i={func:n[t],conversions:e.conversions})}if(!i){if(o)return o;throw new Error("Missing function")}return i}function go(t,e){return e.map(((e,r)=>{let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];return"object"!=typeof n&&(n={type:n}),n.type===Mn&&e.type===In?ro(e):e}))}function fo(t,e){return{type:Pn,value:qn(e)}}function ho(t,e){const r=Number(e.value);if(Number.isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Mn,value:r}}function mo(t,e,r,n){const o=t.variables.get(e.value);let i;return i=o&&o.getType()===n?o.getValue():r.value,"color"===n&&(i=eo(i)),{type:n,value:i}}function yo(t,e,r){return mo(t,e,r,r.type)}function bo(t,e,r){return mo(t,e,r,"color")}function _o(t,e,r){return mo(t,e,r,"url")}const wo=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:In,value:Ar(n)}},$o=wo("getUTCFullYear"),xo=wo("getUTCMonth"),ko=wo("getUTCDate"),Eo=wo("getUTCDay"),Co=wo("getUTCHours"),Ao=wo("getUTCMinutes"),jo=wo("getUTCSeconds"),Fo=wo("getUTCMilliseconds");function Vo(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let o="";const i=e.type===Pn?e.value:qn(e);for(;o.length+i.length<r.value;)o+=n.value;return o.length>0&&o.length+i.length>r.value&&(o=o.substring(0,Number(r.value)-Number(i.length))),o}function Do(t,e,r,n){const o=Vo(t,e,r,n);return{type:Pn,value:o+qn(e)}}function So(t,e,r,n){const o=Vo(t,e,r,n);return{type:Pn,value:qn(e)+o}}function Oo(t){return(e,r)=>{const n=Kn(r.value);return{type:Mn,value:n[t]/255}}}function Po(t){return(e,r,n)=>{const o=Kn(r.value);return o[t]=255*n.value,{type:Nn,value:to(o)}}}const Io=Oo("a"),Mo=Oo("r"),To=Oo("g"),No=Oo("b"),zo=Po("a"),Ro=Po("r"),Bo=Po("g"),Uo=Po("b");function Wo(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=Ar(e.value)/Ar(r);return Yn(t,o),"number"==typeof o&&(o=Math.floor(o)),n&&(o=Ar(o)%Ar(n)),{type:In,value:o}}const Lo=36e5;function Ho(t){return(e,r,...n)=>{if(0===n.length)throw new Error("Non empty argument list is required.");const 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 n=r[e[t]];if(void 0===n)throw new Error(`Missing property "${e[t]}" in the dict.`);r=n}return r}(r.value,n.map((t=>t.value)));return oo(e,o,t)}}function qo(t,e){return(r,n,o,...i)=>{try{return t(r,o,...i)}catch(t){let r=n.value;return"color"===e&&(r=eo(r)),{type:e,value:r}}}}const Jo=Ho(Pn),Go=Ho(Mn),Zo=Ho(In),Yo=Ho(Tn),Xo=Ho(Nn),Qo=Ho(zn),Ko=Ho(Un),ti=Ho(Bn),ei=qo(Jo,Pn),ri=qo(Go,Mn),ni=qo(Zo,In),oi=qo(Yo,Tn),ii=qo(Xo,Nn),ai=qo(Qo,zn);function si(t,e,...r){try{return Ko(t,e,...r)}catch(t){return{type:Un,value:[]}}}function li(t,e,...r){try{return ti(t,e,...r)}catch(t){return{type:Bn,value:{}}}}function ci(t,e){return(r,n,o)=>{if(o.value<0||o.value>=n.value.length)throw new Error(`Requested index (${o.value}) out of bounds array size (${n.value.length}).`);let i=n.value[Number(o.value)],a=typeof i;if("array"===t&&!Array.isArray(i)||"array"!==t&&a!==t||"object"===a&&null===i)throw"object"===a&&(a=Array.isArray(i)?"array":null===i?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Yn(r,i);try{i=Ar(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=eo(i)),{type:e,value:i}}}function ui(t,e){return(r,n,o,i)=>{try{return t(r,n,o)}catch(t){let r=i.value;return"color"===e&&(r=eo(r)),{type:e,value:r}}}}const di=ci("string","string"),pi=ci("number","number"),vi=ci("number","integer"),gi=ci("boolean","boolean"),fi=ci("string","color"),hi=ci("string","url"),mi=ci("array","array"),yi=ci("object","dict"),bi=ui(di,"string"),_i=ui(pi,"number"),wi=ui(vi,"integer"),$i=ui(gi,"boolean"),xi=ui(fi,"color"),ki=ui(hi,"url");function Ei(t){return(e,r,n)=>{if(!e.store)return{type:t,value:n.value};let o;o="boolean"===t?"boolean":"number"===t||"integer"===t?"number":"string";const i=e.store.getValue(r.value,o);return void 0===i?{type:t,value:n.value}:oo(e,i,t)}}function Ci(t){return t.map(Jn).join(", ")}co("toString",[In],fo),co("toString",[Mn],fo),co("toString",[Tn],fo),co("toString",[Nn],fo),co("toString",[zn],fo),co("toString",[Pn],fo),co("toNumber",[In],ho),co("toNumber",[Pn],ho),co("toInteger",[Mn],(function(t,e){if(e.value>Er||e.value<Cr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:In,value:Ar(r)}})),co("toInteger",[Pn],(function(t,e){let r;try{r=Ar(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:In,value:r}})),co("toInteger",[Tn],(function(t,e){return{type:In,value:Ar(e.value?1:0)}})),co("toBoolean",[In],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Tn,value:r}})),co("toBoolean",[Pn],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Tn,value:"true"===e.value?1:0}})),co("toColor",[Pn],(function(t,e){return{type:Nn,value:eo(e.value)}})),co("toUrl",[Pn],(function(t,e){return{type:zn,value:e.value}})),co("encodeUri",[Pn],(function(t,e){try{return{type:Pn,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),co("decodeUri",[Pn],(function(t,e){try{return{type:Pn,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),co("getIntegerValue",[Pn,In],yo),co("getNumberValue",[Pn,Mn],yo),co("getBooleanValue",[Pn,Tn],yo),co("getStringValue",[Pn,Pn],yo),co("getColorValue",[Pn,Nn],bo),co("getColorValue",[Pn,Pn],bo),co("getUrlValue",[Pn,zn],_o),co("getUrlValue",[Pn,Pn],_o),uo("toString",[In],fo),uo("toString",[Mn],fo),uo("toString",[Tn],fo),uo("toString",[Nn],fo),uo("toString",[zn],fo),uo("toString",[Pn],fo),co("parseUnixTime",[In],(function(t,e){return{type:Rn,value:new Date(1e3*Number(e.value))}})),co("nowLocal",[],(function(){return{type:Rn,value:new Date}})),co("addMillis",[Rn,In],(function(t,e,r){return{type:Rn,value:new Date(e.value.getTime()+Number(r.value))}})),co("setYear",[Rn,In],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Rn,value:n}})),co("setMonth",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMonth(n-1),{type:Rn,value:o}})),co("setDay",[Rn,In],(function(t,e,r){const n=new Date(e.value),o=Number(r.value);if(o<=0&&-1!==o||o>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${o} for date ${qn(e)}.`);return n.setUTCDate(-1===o?0:o),{type:Rn,value:n}})),co("setHours",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const o=new Date(e.value);return o.setUTCHours(n),{type:Rn,value:o}})),co("setMinutes",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMinutes(n),{type:Rn,value:o}})),co("setSeconds",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCSeconds(n),{type:Rn,value:o}})),co("setMillis",[Rn,In],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMilliseconds(n),{type:Rn,value:o}})),co("getYear",[Rn],$o),co("getMonth",[Rn],xo),co("getDay",[Rn],ko),co("getDayOfWeek",[Rn],Eo),co("getHours",[Rn],Co),co("getMinutes",[Rn],Ao),co("getSeconds",[Rn],jo),co("getMillis",[Rn],Fo),co("getIntervalSeconds",[In],(function(t,e){return Wo(t,e,1e3,60)})),co("getIntervalTotalSeconds",[In],(function(t,e){return Wo(t,e,1e3)})),co("getIntervalMinutes",[In],(function(t,e){return Wo(t,e,6e4,60)})),co("getIntervalTotalMinutes",[In],(function(t,e){return Wo(t,e,6e4)})),co("getIntervalHours",[In],(function(t,e){return Wo(t,e,Lo,24)})),co("getIntervalTotalHours",[In],(function(t,e){return Wo(t,e,Lo)})),co("getIntervalTotalDays",[In],(function(t,e){return Wo(t,e,864e5)})),co("getIntervalTotalWeeks",[In],(function(t,e){return Wo(t,e,6048e5)})),co("len",[Pn],(function(t,e){return{type:In,value:Ar(e.value.length)}})),co("contains",[Pn,Pn],(function(t,e,r){return{type:Tn,value:e.value.includes(r.value)?1:0}})),co("substring",[Pn,In,In],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Pn,value:e.value.substring(Number(r.value),Number(n.value))}})),co("replaceAll",[Pn,Pn,Pn],(function(t,e,r,n){let o;return o=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:Pn,value:o}})),co("index",[Pn,Pn],(function(t,e,r){return{type:In,value:Ar(e.value.indexOf(r.value))}})),co("lastIndex",[Pn,Pn],(function(t,e,r){return{type:In,value:Ar(e.value.lastIndexOf(r.value))}})),co("trim",[Pn],(function(t,e){return{type:Pn,value:e.value.trim()}})),co("trimLeft",[Pn],(function(t,e){return{type:Pn,value:e.value.replace(/^\s+/,"")}})),co("trimRight",[Pn],(function(t,e){return{type:Pn,value:e.value.replace(/\s+$/,"")}})),co("toUpperCase",[Pn],(function(t,e){return{type:Pn,value:e.value.toUpperCase()}})),co("toLowerCase",[Pn],(function(t,e){return{type:Pn,value:e.value.toLowerCase()}})),co("padStart",[Pn,In,Pn],Do),co("padStart",[In,In,Pn],Do),co("padEnd",[Pn,In,Pn],So),co("padEnd",[In,In,Pn],So),co("testRegex",[Pn,Pn],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Tn,value:n.test(e.value)?1:0}})),co("div",[In,In],(function(t,e,r){if(r.value===jr)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Zn(0,n),Yn(t,n),{type:In,value:n}})),co("div",[Mn,Mn],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:Mn,value:n}})),co("mod",[In,In],(function(t,e,r){if(r.value===jr)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Zn(0,n),Yn(t,n),{type:In,value:n}})),co("mod",[Mn,Mn],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:Mn,value:n}})),co("mul",[{type:In,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:jr;for(let n=1;n<e.length;++n)r*=e[n].value,r=Zn(0,r),Yn(t,r);return{type:In,value:r}})),co("mul",[{type:Mn,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:Mn,value:r}})),co("sub",[{type:In,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:jr;for(let n=1;n<e.length;++n)r-=e[n].value,r=Zn(0,r),Yn(t,r);return{type:In,value:r}})),co("sub",[{type:Mn,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:Mn,value:r}})),co("sum",[{type:In,isVararg:!0}],(function(t,...e){let r=jr;for(let n=0;n<e.length;++n)r+=e[n].value,r=Zn(0,r),Yn(t,r);return{type:In,value:r}})),co("sum",[{type:Mn,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Mn,value:r}})),co("abs",[In],(function(t,e){const r=Fr(e.value);return Yn(t,r),{type:e.type,value:r}})),co("abs",[Mn],(function(t,e){const r=Math.abs(e.value);return{type:Mn,value:r}})),co("max",[{type:In,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:In,value:r}})),co("max",[{type:Mn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Mn,value:Math.max(...e.map((t=>t.value)))}})),co("min",[{type:In,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:In,value:r}})),co("min",[{type:Mn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Mn,value:Math.min(...e.map((t=>t.value)))}})),co("maxNumber",[],(function(){return{type:Mn,value:Sn}})),co("minNumber",[],(function(){return{type:Mn,value:On}})),co("maxInteger",[],(function(t){return Yn(t,Er),{type:In,value:Er}})),co("minInteger",[],(function(t){return Yn(t,Cr),{type:In,value:Cr}})),co("round",[Mn],(function(t,e){const r=Math.sign(e.value);return{type:Mn,value:r*Math.round(Math.abs(e.value))}})),co("floor",[Mn],(function(t,e){return{type:Mn,value:Math.floor(e.value)}})),co("ceil",[Mn],(function(t,e){return{type:Mn,value:Math.ceil(e.value)}})),co("signum",[In],(function(t,e){return{type:In,value:Vr(e.value)}})),co("signum",[Mn],(function(t,e){return{type:Mn,value:Math.sign(e.value)}})),co("copySign",[In,In],(function(t,e,r){let n;if(r.value===jr)n=e.value;else if(e.value===jr)n=Ar(0);else{const t=Vr(r.value);n=Fr(e.value)*t}return Yn(t,n),{type:In,value:n}})),co("copySign",[Mn,Mn],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const o=Math.abs(e.value)*n;return{type:Mn,value:o}})),co("getColorAlpha",[Pn],Io),co("getColorAlpha",[Nn],Io),co("getColorRed",[Pn],Mo),co("getColorRed",[Nn],Mo),co("getColorGreen",[Pn],To),co("getColorGreen",[Nn],To),co("getColorBlue",[Pn],No),co("getColorBlue",[Nn],No),co("setColorAlpha",[Pn,Mn],zo),co("setColorAlpha",[Nn,Mn],zo),co("setColorRed",[Pn,Mn],Ro),co("setColorRed",[Nn,Mn],Ro),co("setColorGreen",[Pn,Mn],Bo),co("setColorGreen",[Nn,Mn],Bo),co("setColorBlue",[Pn,Mn],Uo),co("setColorBlue",[Nn,Mn],Uo),co("rgb",[Mn,Mn,Mn],(function(t,e,r,n){const o={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Nn,value:to(o)}})),co("argb",[Mn,Mn,Mn,Mn],(function(t,e,r,n,o){const i={a:255*e.value,r:255*r.value,g:255*n.value,b:255*o.value};return{type:Nn,value:to(i)}})),function(){const t={type:Pn,isVararg:!0};co("getDictString",[Bn,t],Jo),co("getStringFromDict",[Bn,t],Jo),co("getDictNumber",[Bn,t],Go),co("getNumberFromDict",[Bn,t],Go),co("getDictInteger",[Bn,t],Zo),co("getIntegerFromDict",[Bn,t],Zo),co("getDictBoolean",[Bn,t],Yo),co("getBooleanFromDict",[Bn,t],Yo),co("getDictColor",[Bn,t],Xo),co("getColorFromDict",[Bn,t],Xo),co("getDictUrl",[Bn,t],Qo),co("getUrlFromDict",[Bn,t],Qo),co("getDictOptString",[Pn,Bn,t],ei),co("getOptStringFromDict",[Pn,Bn,t],ei),co("getDictOptNumber",[Mn,Bn,t],ri),co("getOptNumberFromDict",[Mn,Bn,t],ri),co("getDictOptInteger",[In,Bn,t],ni),co("getOptIntegerFromDict",[In,Bn,t],ni),co("getDictOptBoolean",[Tn,Bn,t],oi),co("getOptBooleanFromDict",[Tn,Bn,t],oi),co("getDictOptColor",[Nn,Bn,t],ii),co("getOptColorFromDict",[Nn,Bn,t],ii),co("getDictOptColor",[Pn,Bn,t],ii),co("getOptColorFromDict",[Pn,Bn,t],ii),co("getDictOptUrl",[Pn,Bn,t],ai),co("getOptUrlFromDict",[Pn,Bn,t],ai),co("getDictOptUrl",[zn,Bn,t],ai),co("getOptUrlFromDict",[zn,Bn,t],ai),co("getDictFromDict",[Bn,t],ti),co("getArrayFromDict",[Bn,t],Ko),co("getOptArrayFromDict",[Bn,t],si),co("getOptDictFromDict",[Bn,t],li),uo("getString",[Bn,t],Jo),uo("getBoolean",[Bn,t],Yo),uo("getInteger",[Bn,t],Zo),uo("getNumber",[Bn,t],Go),uo("getUrl",[Bn,t],Qo),uo("getColor",[Bn,t],Xo),uo("getArray",[Bn,t],Ko),uo("getDict",[Bn,t],ti)}(),co("getArrayString",[Un,In],di),co("getStringFromArray",[Un,In],di),co("getArrayNumber",[Un,In],pi),co("getNumberFromArray",[Un,In],pi),co("getArrayInteger",[Un,In],vi),co("getIntegerFromArray",[Un,In],vi),co("getArrayBoolean",[Un,In],gi),co("getBooleanFromArray",[Un,In],gi),co("getArrayColor",[Un,In],fi),co("getColorFromArray",[Un,In],fi),co("getArrayUrl",[Un,In],hi),co("getUrlFromArray",[Un,In],hi),co("getArrayFromArray",[Un,In],mi),co("getDictFromArray",[Un,In],yi),co("getArrayOptString",[Un,In,Pn],bi),co("getOptStringFromArray",[Un,In,Pn],bi),co("getArrayOptNumber",[Un,In,Mn],_i),co("getOptNumberFromArray",[Un,In,Mn],_i),co("getArrayOptInteger",[Un,In,In],wi),co("getOptIntegerFromArray",[Un,In,In],wi),co("getArrayOptBoolean",[Un,In,Tn],$i),co("getOptBooleanFromArray",[Un,In,Tn],$i),co("getArrayOptColor",[Un,In,Nn],xi),co("getOptColorFromArray",[Un,In,Nn],xi),co("getArrayOptColor",[Un,In,Pn],xi),co("getOptColorFromArray",[Un,In,Pn],xi),co("getArrayOptUrl",[Un,In,zn],ki),co("getOptUrlFromArray",[Un,In,zn],ki),co("getArrayOptUrl",[Un,In,Pn],ki),co("getOptUrlFromArray",[Un,In,Pn],ki),co("getOptArrayFromArray",[Un,In],(function(t,e,r){try{return mi(t,e,r)}catch(t){return{type:Un,value:[]}}})),co("getOptDictFromArray",[Un,In],(function(t,e,r){try{return yi(t,e,r)}catch(t){return{type:Bn,value:{}}}})),co("len",[Un],(function(t,e){return{type:In,value:Ar(e.value.length)}})),uo("getString",[Un,In],di),uo("getInteger",[Un,In],vi),uo("getNumber",[Un,In],pi),uo("getBoolean",[Un,In],gi),uo("getUrl",[Un,In],hi),uo("getColor",[Un,In],fi),uo("getArray",[Un,In],mi),uo("getDict",[Un,In],yi),co("getStoredIntegerValue",[Pn,In],Ei(In)),co("getStoredNumberValue",[Pn,Mn],Ei(Mn)),co("getStoredStringValue",[Pn,Pn],Ei(Pn)),co("getStoredUrlValue",[Pn,zn],Ei(zn)),co("getStoredUrlValue",[Pn,Pn],Ei(zn)),co("getStoredColorValue",[Pn,Nn],Ei(Nn)),co("getStoredColorValue",[Pn,Pn],Ei(Nn)),co("getStoredBooleanValue",[Pn,Tn],Ei(Tn));const Ai={StringLiteral:function(t,e){return{type:Pn,value:e.value}},NumberLiteral:function(t,e){return{type:Mn,value:e.value}},IntegerLiteral:function(t,e){return Yn(t,e.value),{type:In,value:e.value}},BooleanLiteral:function(t,e){return{type:Tn,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Ln(ji(t,e.argument));switch(e.operator){case"!":if(r.type===Tn)return{type:Tn,value:r.value?0:1};Qn(`${e.operator}${Jn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===In){const e=r.value*Ar(n);return Yn(t,e),{type:In,value:e}}if(r.type===Mn)return{type:Mn,value:r.value*n};Qn(`${e.operator}${Jn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Ln(ji(t,e.test));if(r.type===Tn)return r.value?ji(t,e.consequent):ji(t,e.alternate);Qn(`${Jn(r)} ? ${Jn(ji(t,e.consequent))} : ${Jn(ji(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return ji(t,e.test)}catch(r){return ji(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return ji(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=qn(ji(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Pn,value:r}},LogicalExpression:function(t,e){const r=Ln(ji(t,e.left));if(r.type!==Tn&&Qn(`${Jn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Tn,value:0};const n=Ln(ji(t,e.right));return n.type!==Tn&&Qn(`${Jn(r)} ${e.operator} ${Jn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Gn(n.type)}.`),{type:Tn,value:n.value}},BinaryExpression:function(t,e){const r=e.operator;let n=ji(t,e.left),o=ji(t,e.right);if(("number"===n.type&&"integer"===o.type||"integer"===n.type&&"number"===o.type)&&("integer"===n.type?n=ro(n):"integer"===o.type&&(o=ro(o))),n.type!==o.type&&Qn(`${Jn(n)} ${e.operator} ${Jn(o)}`,`Operator '${r}' cannot be applied to different types: ${Gn(n.type)} and ${Gn(o.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Rn&&r.type===Rn?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Tn,value:n?1:0}}(r,n,o);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Mn&&e.type!==In&&e.type!==Rn&&Qn(`${Jn(e)} ${t} ${Jn(r)}`,`Operator '${t}' cannot be applied to ${Gn(e.type)} type.`);const o=e.type===Rn?e.value.getTime():e.value,i=r.type===Rn?r.value.getTime():r.value;return n=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:Tn,value:n?1:0}}(r,n,o);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Pn&&r.type!==Mn&&r.type!==In&&Qn(`${Jn(r)} ${e} ${Jn(n)}`,`Operator '${e}' cannot be applied to ${Gn(r.type)} type.`),r.type===Pn)return"-"===e&&Qn(`${Jn(r)} - ${Jn(n)}`,`Operator '${e}' cannot be applied to ${Gn(r.type)} type.`),{type:Pn,value:r.value+n.value};let o="+"===e?r.value+n.value:r.value-n.value;if(r.type===In)try{o=Zn(0,o),Yn(t,o)}catch(t){Qn(`${Jn(r)} ${e} ${Jn(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let o;if(r.type!==In&&r.type!==Mn&&Qn(`${Jn(r)} ${e} ${Jn(n)}`,`Operator '${e}' cannot be applied to ${Gn(r.type)} type.`),"*"===e)o=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Qn(`${Jn(r)} ${e} ${Jn(n)}`,"Division by zero is not supported."),o="/"===e?r.value/n.value:r.value%n.value}if(r.type===In)try{o=Zn(0,o),Yn(t,o)}catch(t){Qn(`${Jn(r)} ${e} ${Jn(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n,o=e.arguments.map((e=>ji(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(ao.has(i))n=ao.get(i);else{const t=vo("function",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>Gn(t.type))).join(", "),n=`${r}(${Ci(o)})`;"few"===t.type&&0===o.length?Qn(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Qn(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Qn(n,`Unknown function name: ${r}.`)}n=t.func,t.conversions&&(o=go(n,o))}if(!n)throw new Error("Function not found");try{return n.cb(t,...o)}catch(t){Qn(`${r}(${Ci(o)})`,t.message)}},MethodExpression:function(t,e){const r=e.method.name;let n;e.arguments.unshift(e.object);let o=e.arguments.map((e=>ji(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(lo.has(i))n=lo.get(i);else{const t=vo("method",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.slice(1).map((t=>Gn(t.type))).join(", "),n=`${r}(${Ci(o.slice(1))})`;"few"===t.type&&1===o.length?Qn(n,`Non empty argument list is required for method '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Qn(n,`Method '${r}' has no matching override for given argument types: ${e}.`):Qn(n,`Unknown method name: ${r}.`)}n=t.func,t.conversions&&(o=go(n,o))}if(!n)throw new Error("Method not found");try{return n.cb(t,...o)}catch(t){Qn(`${r}(${Ci(o.slice(1))})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function ji(t,e){if(e.type in Ai)return Ai[e.type](t,e);throw new Error("Unsupported expression")}class Fi{constructor(t){this.ast=t}apply(t,e,r,n=!1){try{const o=function(t,e,r){try{const n={variables:t,warnings:[],safeIntegerOverflow:!1,store:e},o=ji(n,r);return n.safeIntegerOverflow&&n.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:o,warnings:n.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,r,this.ast);o.warnings.forEach(e);const i=o.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const a=i.value;if(a instanceof Date)return Hn(a);if("boolean"===i.type)return Boolean(a);if("color"===i.type){const t=ft(String(a));if(t)return to(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return a>2147483647||a<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(a);if(!n&&("array"===i.type||"dict"===i.type))try{return JSON.stringify(a)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return a}catch(t){return void e(st(new Error("Expression execution error")))}}}function Vi(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=function(t,e){var r,n={},o=(e=void 0!==e?e:{}).grammarSource,i={start:Ee,JsonStringContents:function(){var t,e,r;for(t=pe,e=[],r=Ce();r!==n;)e.push(r),r=Ce();return ve=t,At(e)}},a=Ee,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",A="!",j=".",F="(",V=")",D=",",S="'",O="e",P="E",I=/^[^}]/,M=/^[^'}]/,T=/^[0-9]/,N=/^[a-zA-Z_]/,z=/^[a-zA-Z_0-9]/,R=/^[ \t\r\n]/,B=be("@{",!1),U=be("}",!1),W=be("@{}",!1),L=be("\\",!1),H={type:"any"},q=_e(["}"],!0,!1),J=be("?",!1),G=be(":",!1),Z=be("!:",!1),Y=be("||",!1),X=be("&&",!1),Q=be("==",!1),K=be("!=",!1),tt=be(">=",!1),et=be(">",!1),rt=be("<=",!1),nt=be("<",!1),ot=be("+",!1),it=be("-",!1),at=be("/",!1),st=be("*",!1),lt=be("%",!1),ct=be("!",!1),ut=be(".",!1),dt=be("(",!1),pt=be(")",!1),vt=be(",",!1),gt=we("string"),ft=be("'",!1),ht=_e(["'","}"],!0,!1),mt=we("integer"),yt=_e([["0","9"]],!1,!1),bt=we("number"),_t=be("e",!1),wt=be("E",!1),$t=_e([["a","z"],["A","Z"],"_"],!1,!1),xt=_e([["a","z"],["A","Z"],"_",["0","9"]],!1,!1),kt=we("whitespace"),Et=_e([" ","\t","\r","\n"],!1,!1),Ct=function(t){return t},At=function(t){return An(t)},jt=function(t){return t},Ft=function(){return""},Vt=function(){return ye()},Dt=function(){throw new Error("Error tokenizing '"+t+"'.")},St=function(){throw new Error("Error tokenizing '"+t+"'.")},Ot=function(t){return t},Pt=function(t){return Fn(t)},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Mt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Tt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Nt=function(t,e){return Cn(t,e)},zt=function(t,e){return Cn(t,e)},Rt=function(t,e){return En(t,e)},Bt=function(t,e){return En(t,e)},Ut=function(t,e){return En(t,e)},Wt=function(t,e){return En(t,e)},Lt=function(t){return t},Ht=function(t){return t},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Jt=function(t,e){return function(t,e){return e.length?e.reduce(((t,e)=>{if(!e[5])throw new Error("Method expected after .");return{type:"MethodExpression",object:t,method:e[3],arguments:e[5][2]}}),t):t}(t,e)},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t,e){return[t,...e]},Yt=function(t){return t},Xt=function(t){return t},Qt=function(t){return An(t)},Kt=function(t){return t},te=function(){return""},ee=function(){return ye()},re=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ie=function(t){return Fn(t)},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){return{type:"IntegerLiteral",value:jn(ye())}},le=function(){return{type:"NumberLiteral",value:parseFloat(ye())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(ye())}},ue=function(){const t=ye();if(/\.\./.test(t)||/\.$/.test(t))throw new Error("Unexpected token: .");return function(t){return"true"===t||"false"===t?{type:"BooleanLiteral",value:"true"===t}:{type:"Variable",id:{type:"Identifier",name:t}}}(t)},de=function(){return{type:"Identifier",name:ye()}},pe=0,ve=0,ge=[{line:1,column:1}],fe=0,he=[],me=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=i[e.startRule]}function ye(){return t.substring(ve,pe)}function be(t,e){return{type:"literal",text:t,ignoreCase:e}}function _e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function we(t){return{type:"other",description:t}}function $e(e){var r,n=ge[e];if(n)return n;for(r=e-1;!ge[r];)r--;for(n={line:(n=ge[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return ge[e]=n,n}function xe(t,e,r){var n=$e(t),i=$e(e),a={source:o,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:i.line,column:i.column}};return r&&o&&"function"==typeof o.offset&&(a.start=o.offset(a.start),a.end=o.offset(a.end)),a}function ke(t){pe<fe||(pe>fe&&(fe=pe,he=[]),he.push(t))}function Ee(){var t,e;return t=pe,Ue(),(e=Ae())!==n?(Ue(),ve=t,t=Ct(e)):(pe=t,t=n),t}function Ce(){var e,r,o,i,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n?(o=Ue(),(i=Ae())!==n?(Ue(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===me&&ke(U)),a!==n?(ve=e,e=jt(i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=n,0===me&&ke(W)),r!==n&&(ve=e,r=Ft()),(e=r)===n&&(e=pe,r=pe,me++,92===t.charCodeAt(pe)?(o=u,pe++):(o=n,0===me&&ke(L)),o===n&&(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B))),me--,o===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=Vt()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n){if(o=[],I.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(q)),i!==n)for(;i!==n;)o.push(i),I.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(q));else o=n;o!==n?(125===t.charCodeAt(pe)?(i=l,pe++):(i=n,0===me&&ke(U)),i!==n?(ve=e,e=Dt()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n&&(ve=e,r=St()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)),o!==n?(ve=e,e=Ot(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=Pt(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n&&(ve=e,r=It()),e=r))))}return e}function Ae(){var e,r,o,i,a,s;return e=pe,(r=je())!==n?(Ue(),63===t.charCodeAt(pe)?(o=d,pe++):(o=n,0===me&&ke(J)),o!==n?(Ue(),(i=Ae())!==n?(Ue(),58===t.charCodeAt(pe)?(a=p,pe++):(a=n,0===me&&ke(G)),a!==n?(Ue(),(s=Ae())!==n?(ve=e,e=Mt(r,i,s)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=je()),e}function je(){var e,r,o,i;return e=pe,(r=Fe())!==n?(Ue(),t.substr(pe,2)===v?(o=v,pe+=2):(o=n,0===me&&ke(Z)),o!==n?(Ue(),(i=Ae())!==n?(ve=e,e=Tt(r,i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=Fe()),e}function Fe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Ve())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===me&&ke(Y)),s!==n?(l=Ue(),(c=Ve())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===me&&ke(Y)),s!==n?(l=Ue(),(c=Ve())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Nt(r,o)}else pe=e,e=n;return e}function Ve(){var e,r,o,i,a,s,l,c;if(e=pe,(r=De())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===me&&ke(X)),s!==n?(l=Ue(),(c=De())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===me&&ke(X)),s!==n?(l=Ue(),(c=De())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=zt(r,o)}else pe=e,e=n;return e}function De(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Se())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===me&&ke(Q)),s===n&&(t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===me&&ke(K))),s!==n?(l=Ue(),(c=Se())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===me&&ke(Q)),s===n&&(t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===me&&ke(K))),s!==n?(l=Ue(),(c=Se())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Rt(r,o)}else pe=e,e=n;return e}function Se(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Oe())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===y?(s=y,pe+=2):(s=n,0===me&&ke(tt)),s===n&&(62===t.charCodeAt(pe)?(s=b,pe++):(s=n,0===me&&ke(et)),s===n&&(t.substr(pe,2)===_?(s=_,pe+=2):(s=n,0===me&&ke(rt)),s===n&&(60===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===me&&ke(nt))))),s!==n?(l=Ue(),(c=Oe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===y?(s=y,pe+=2):(s=n,0===me&&ke(tt)),s===n&&(62===t.charCodeAt(pe)?(s=b,pe++):(s=n,0===me&&ke(et)),s===n&&(t.substr(pe,2)===_?(s=_,pe+=2):(s=n,0===me&&ke(rt)),s===n&&(60===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===me&&ke(nt))))),s!==n?(l=Ue(),(c=Oe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Bt(r,o)}else pe=e,e=n;return e}function Oe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Pe())!==n){for(o=[],i=pe,a=Ue(),43===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===me&&ke(ot)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===me&&ke(it))),s!==n?(l=Ue(),(c=Pe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),43===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===me&&ke(ot)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===me&&ke(it))),s!==n?(l=Ue(),(c=Pe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Ut(r,o)}else pe=e,e=n;return e}function Pe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Ie())!==n){for(o=[],i=pe,a=Ue(),47===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===me&&ke(at)),s===n&&(42===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===me&&ke(st)),s===n&&(37===t.charCodeAt(pe)?(s=C,pe++):(s=n,0===me&&ke(lt)))),s!==n?(l=Ue(),(c=Ie())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),47===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===me&&ke(at)),s===n&&(42===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===me&&ke(st)),s===n&&(37===t.charCodeAt(pe)?(s=C,pe++):(s=n,0===me&&ke(lt)))),s!==n?(l=Ue(),(c=Ie())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Wt(r,o)}else pe=e,e=n;return e}function Ie(){var e,r,o,i;return e=pe,r=pe,me++,45===t.charCodeAt(pe)?(o=x,pe++):(o=n,0===me&&ke(it)),me--,o!==n?(pe=r,r=void 0):r=n,r!==n&&(o=Re())!==n?(ve=e,e=Lt(o)):(pe=e,e=n),e===n&&(e=pe,r=pe,me++,45===t.charCodeAt(pe)?(o=x,pe++):(o=n,0===me&&ke(it)),me--,o!==n?(pe=r,r=void 0):r=n,r!==n&&(o=ze())!==n?(ve=e,e=Ht(o)):(pe=e,e=n),e===n&&(e=pe,33===t.charCodeAt(pe)?(r=A,pe++):(r=n,0===me&&ke(ct)),r===n&&(43===t.charCodeAt(pe)?(r=$,pe++):(r=n,0===me&&ke(ot)),r===n&&(45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)))),r!==n?(o=Ue(),(i=Me())!==n?(ve=e,e=qt(r,i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=Me()))),e}function Me(){var e,r,o,i,a,s,l,c,u,d,p,v,g,f,h;if(e=pe,r=function(){var e,r,o,i,a;return e=pe,(r=Be())!==n?(Ue(),40===t.charCodeAt(pe)?(o=F,pe++):(o=n,0===me&&ke(dt)),o!==n?(Ue(),(i=Te())!==n?(Ue(),41===t.charCodeAt(pe)?(a=V,pe++):(a=n,0===me&&ke(pt)),a!==n?(ve=e,e=Gt(r,i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=function(){var e,r,o,i;return e=function(){var e,r,o,i,a,s,l,c,u,d,p;if(e=pe,N.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke($t)),r!==n){if(o=[],i=[],z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt));else i=n;for(i===n&&(i=pe,46===t.charCodeAt(pe)?(a=j,pe++):(a=n,0===me&&ke(ut)),a!==n?(s=pe,me++,l=pe,c=Ue(),(u=Be())!==n?(d=Ue(),40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?l=c=[c,u,d,p]:(pe=l,l=n)):(pe=l,l=n),me--,l===n?s=void 0:(pe=s,s=n),s!==n?i=a=[a,s]:(pe=i,i=n)):(pe=i,i=n));i!==n;){if(o.push(i),i=[],z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt));else i=n;i===n&&(i=pe,46===t.charCodeAt(pe)?(a=j,pe++):(a=n,0===me&&ke(ut)),a!==n?(s=pe,me++,l=pe,c=Ue(),(u=Be())!==n?(d=Ue(),40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?l=c=[c,u,d,p]:(pe=l,l=n)):(pe=l,l=n),me--,l===n?s=void 0:(pe=s,s=n),s!==n?i=a=[a,s]:(pe=i,i=n)):(pe=i,i=n))}ve=e,e=ue()}else pe=e,e=n;return e}(),e===n&&(e=function(){var e,r,o,i;return me++,e=pe,39===t.charCodeAt(pe)?(r=S,pe++):(r=n,0===me&&ke(ft)),r!==n?(o=function(){var t,e,r;for(t=pe,e=[],r=Ne();r!==n;)e.push(r),r=Ne();return ve=t,Qt(e)}(),39===t.charCodeAt(pe)?(i=S,pe++):(i=n,0===me&&ke(ft)),i!==n?(ve=e,e=Xt(o)):(pe=e,e=n)):(pe=e,e=n),me--,e===n&&(r=n,0===me&&ke(gt)),e}(),e===n&&(e=Re())===n&&(e=ze())===n&&(e=pe,40===t.charCodeAt(pe)?(r=F,pe++):(r=n,0===me&&ke(dt)),r!==n?(Ue(),(o=Ae())!==n?(Ue(),41===t.charCodeAt(pe)?(i=V,pe++):(i=n,0===me&&ke(pt)),i!==n?(ve=e,e=Yt(o)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n))),e}()),e}(),r!==n){for(o=[],i=pe,a=Ue(),46===t.charCodeAt(pe)?(s=j,pe++):(s=n,0===me&&ke(ut)),s!==n?(l=Ue(),(c=Be())!==n?(u=Ue(),d=pe,40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?(v=Ue(),(g=Te())!==n?(f=Ue(),41===t.charCodeAt(pe)?(h=V,pe++):(h=n,0===me&&ke(pt)),h!==n?d=p=[p,v,g,f,h]:(pe=d,d=n)):(pe=d,d=n)):(pe=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),46===t.charCodeAt(pe)?(s=j,pe++):(s=n,0===me&&ke(ut)),s!==n?(l=Ue(),(c=Be())!==n?(u=Ue(),d=pe,40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?(v=Ue(),(g=Te())!==n?(f=Ue(),41===t.charCodeAt(pe)?(h=V,pe++):(h=n,0===me&&ke(pt)),h!==n?d=p=[p,v,g,f,h]:(pe=d,d=n)):(pe=d,d=n)):(pe=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(pe=i,i=n)):(pe=i,i=n);ve=e,e=Jt(r,o)}else pe=e,e=n;return e}function Te(){var e,r,o,i,a,s;if(e=pe,(r=Ae())!==n){for(o=[],i=pe,Ue(),44===t.charCodeAt(pe)?(a=D,pe++):(a=n,0===me&&ke(vt)),a!==n?(Ue(),(s=Ae())!==n?i=s:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,Ue(),44===t.charCodeAt(pe)?(a=D,pe++):(a=n,0===me&&ke(vt)),a!==n?(Ue(),(s=Ae())!==n?i=s:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Zt(r,o)}else pe=e,e=n;return e===n&&(e=Ue()),e}function Ne(){var e,r,o,i,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n?(o=Ue(),(i=Ae())!==n?(Ue(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===me&&ke(U)),a!==n?(ve=e,e=Kt(i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=n,0===me&&ke(W)),r!==n&&(ve=e,r=te()),(e=r)===n&&(e=pe,r=pe,me++,92===t.charCodeAt(pe)?(o=u,pe++):(o=n,0===me&&ke(L)),o===n&&(39===t.charCodeAt(pe)?(o=S,pe++):(o=n,0===me&&ke(ft)),o===n&&(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)))),me--,o===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=ee()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n){if(o=[],M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(ht)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(ht));else o=n;o!==n?(125===t.charCodeAt(pe)?(i=l,pe++):(i=n,0===me&&ke(U)),i!==n?(ve=e,e=re()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n&&(ve=e,r=ne()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)),o!==n?(ve=e,e=oe(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=ie(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n&&(ve=e,r=ae()),e=r))))}return e}function ze(){var e,r,o,i;if(me++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt)),i!==n)for(;i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));else o=n;return o!==n?(ve=e,e=se()):(pe=e,e=n),me--,e===n&&(r=n,0===me&&ke(mt)),e}function Re(){var e,r,o,i,a,s,l,c,u,d;for(me++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));if(46===t.charCodeAt(pe)?(i=j,pe++):(i=n,0===me&&ke(ut)),i!==n){if(a=[],T.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===me&&ke(yt)),s!==n)for(;s!==n;)a.push(s),T.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===me&&ke(yt));else a=n;if(a!==n){if(s=pe,101===t.charCodeAt(pe)?(l=O,pe++):(l=n,0===me&&ke(_t)),l===n&&(69===t.charCodeAt(pe)?(l=P,pe++):(l=n,0===me&&ke(wt))),l!==n){if(43===t.charCodeAt(pe)?(c=$,pe++):(c=n,0===me&&ke(ot)),c===n&&(45===t.charCodeAt(pe)?(c=x,pe++):(c=n,0===me&&ke(it))),c===n&&(c=null),u=[],T.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===me&&ke(yt)),d!==n)for(;d!==n;)u.push(d),T.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===me&&ke(yt));else u=n;u!==n?s=l=[l,c,u]:(pe=s,s=n)}else pe=s,s=n;s===n&&(s=null),ve=e,e=le()}else pe=e,e=n}else pe=e,e=n;if(e===n){if(e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt)),i!==n)for(;i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));else o=n;if(o!==n)if(101===t.charCodeAt(pe)?(i=O,pe++):(i=n,0===me&&ke(_t)),i===n&&(69===t.charCodeAt(pe)?(i=P,pe++):(i=n,0===me&&ke(wt))),i!==n){if(43===t.charCodeAt(pe)?(a=$,pe++):(a=n,0===me&&ke(ot)),a===n&&(45===t.charCodeAt(pe)?(a=x,pe++):(a=n,0===me&&ke(it))),a===n&&(a=null),s=[],T.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===me&&ke(yt)),l!==n)for(;l!==n;)s.push(l),T.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===me&&ke(yt));else s=n;s!==n?(ve=e,e=ce()):(pe=e,e=n)}else pe=e,e=n;else pe=e,e=n}return me--,e===n&&(r=n,0===me&&ke(bt)),e}function Be(){var e,r,o,i;if(e=pe,N.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke($t)),r!==n){for(o=[],z.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(xt));i!==n;)o.push(i),z.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(xt));ve=e,e=de()}else pe=e,e=n;return e}function Ue(){var e,r;for(me++,e=[],R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke(Et));r!==n;)e.push(r),R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke(Et));return me--,r=n,0===me&&ke(kt),e}if((r=a())!==n&&pe===t.length)return r;throw r!==n&&pe<t.length&&ke({type:"end"}),function(t,e,r){return new Vn(Vn.buildMessage(t,e),t,e,r)}(he,fe<t.length?t.charAt(fe):null,fe<t.length?xe(fe,fe+1):xe(fe,fe))}(t,{startRule:"JsonStringContents"}),n=Xn(r);return e.vars.push(...n),new Fi(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=>Vi(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Vi(t[o],e,r);return n}}var n;return t}function Di(t,e,r,n,o=!1){if(t){if(t instanceof Fi)return t.apply(e,r,n,o);if(Array.isArray(t))return t.map((t=>Di(t,e,r,n)));if("object"==typeof t){const o={};for(const i in t)o[i]=Di(t[i],e,r,n);return o}}return t}function Si(t,e,r){const n={vars:[],hasExpression:!1},o=Vi(t,n,e);return{vars:[...new Set(n.vars)],hasExpression:n.hasExpression,applyVars:(t,n)=>Di(o,t,e,r,n)}}const Oi={pagers:function(){return Q(new Map)}},Pi=new Map,Ii=new Map;function Mi(t){const e=Pi.get(t)||Q("");return Pi.has(t)||Pi.set(t,e),e}function Ti(t){const e=Ii.get(t)||new Map;return Ii.has(t)||Ii.set(t,e),e}class Ni{setVariable(t){const e=t.getName(),r=Ti(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Mi(this).set(e)}getVariable(t){return Ti(this).get(t)}list(){return Ti(this).values()}}function zi(){return new Ni}function Ri(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 Bi=new Set(["start","stop","pause","resume","cancel","reset"]);class Ui{constructor(t){Ri(this,"timers",new Map),Ri(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)&&Bi.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 n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}async tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),await 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((async()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&await this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),o=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((async()=>{await this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-o)%r,"running"===t.state&&e()}),o)};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))}async callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);return this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}async 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&&await this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Wi(t,e,r,n){const{variable_name:o}=r;if(!o)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:o}}));const i=t.get(o);if(!i)return void e(st(new Error("Cannot find variable"),{additional:{name:o}}));const a=i.getType();"array"===a?n(i):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:o,type:a}}))}const Li={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},Hi=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,C=i;var A,j,F,V;let{ownerNode:D}=e,{data:S}=e,{internalId:O}=e,{parentComponentContext:P}=e;b=l(f(at).isDesktop,(t=>y=t)),Date.now();return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==D&&r.ownerNode(D),void 0===e.data&&r.data&&void 0!==S&&r.data(S),void 0===e.internalId&&r.internalId&&void 0!==O&&r.internalId(O),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==P&&r.parentComponentContext(P),o=P.produceChildContext(S.div),a=P.getDerivedFromVars(S.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(j=null===(A=S.offset)||void 0===A?void 0:A.x)||void 0===j?void 0:j.value),x(),x=l(s,(t=>h=t)),c=P.getDerivedFromVars(null===(V=null===(F=S.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),$(),$=l(c,(t=>g=t)),u=P.getDerivedFromVars(S.animation_in),E(),E=l(u,(t=>_=t)),d=P.getDerivedFromVars(S.animation_out),C(),C=l(d,(t=>w=t)),p={visible:!1},$(),x(),k(),b(),E(),C(),` <div class="${I(Ft("tooltip",Li,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${R(_n,"Unknown").$$render(t,{componentContext:o},{},{})}</div>`})),qi={root_platform_desktop:"divkit-ee112",menu:"divkit-cedbe",menu_visible:"divkit-e4801",menu__list:"divkit-c8df2",menu__item:"divkit-ffd4a"},Ji=W(((t,e,r,n)=>{let o,i,a,{ownerNode:s}=e,{items:c}=e,{parentComponentContext:u}=e;const d=f(at),g=d.getCustomization("menuPopupClass")||"",h=d.getCustomization("menuItemClass")||"";a=l(d.isDesktop,(t=>i=t)),Date.now();const m=function(){const t=p();return(e,r,{cancelable:n=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}(e,r,{cancelable:n});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}();function y(){return m("close"),!0}return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==s&&r.ownerNode(s),void 0===e.items&&r.items&&void 0!==c&&r.items(c),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==u&&r.parentComponentContext(u),o={visible:!1},a(),` <div class="${I(Ft("menu",qi,o),!0)+" "+I(i?nt:"",!0)+" "+I(g,!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}><ul${L("class",qi.menu__list,0)}>${N(c,(e=>`<li>${R(Gt,"Actionable").$$render(t,{componentContext:u,actions:e.actions||e.action&&[e.action],cls:qi.menu__item+" "+h,customAction:y},{},{default:()=>`${I(e.text)} `})} </li>`))}</ul></div>`}));let Gi=Q(!0),Zi=0;function Yi(){Gi.set(!1)}function Xi(){Gi.set(!0)}const Qi=new Set(["string","integer","number","url","color","boolean"]);function Ki(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const ta=W(((t,e,r,n)=>{let o,i,a,s,c,u;var d,p,f,h;let{id:m}=e,{json:y={}}=e,{platform:b="auto"}=e,{theme:_="system"}=e,{globalVariablesController:w=new Ni}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:A}=e,{onStat:j}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:M="ltr"}=e,{store:T}=e,z=Q("desktop"===b);if(s=l(z,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");z.set(!t.matches),t.addListener((()=>{z.set(!t.matches)}))}let B="light",U=null;const W=Q("rtl"===M?"rtl":"ltr");function H(t){_=t}function q(){return new Map}function J(){return new Map}function G(t){y=t}u=l(W,(t=>c=t));const Z=new Set(E);let Y=!1,X=!1;m||(X=!0,ft(st(new Error('"id" prop is required'))));const tt={stateChange:!1},et=Mi(w),rt=Ti(w),ot=new Map,it=new Map,lt=new Map;let ct,ut=null,dt=0,pt=[];const vt=[];function gt(t,e,r,n=!1){const o=Si(e,t,T);if(!o.hasExpression)return e;const i=Ki(it,r);return o.applyVars(i,n)}function ft(t){A?A({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function ht(t,e){j&&j({type:t,action:e})}function yt(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in o;){if(({json:t,templateContext:e}=$n(t,e,o,ft)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let bt=0;function _t(t){return`${m}-${bt++}`}let wt={},$t={};function Et(t){Ct(gt(ft,t))}async function Ct(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Wt(t))return;const i=(null==e?void 0:e.logError)||ft;if(r)try{const n=r.replace(/div-action:\/\//,""),a=/([^?]+)\?(.+)/.exec(n);if(!a)return;const s=new URLSearchParams(a[2]);switch(a[1]){case"set_state":await async function(t){if(!t)throw new Error("Missing state id");let e=Mt,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 n=r[t],o=r[t+1];let i=e.getChild(n);if(!i)return;await i.setState(o),e=i}}(s.get("state_id"));break;case"set_current_item":case"set_previous_item":case"set_next_item":case"scroll_to_start":case"scroll_to_end":case"scroll_backward":case"scroll_forward":case"scroll_to_position":!function(t,e,{item:r,step:n,overflow:o}){var i,a,s,l,c;if(!e)throw new Error(`Missing id for "${t}" action`);const u=Number(r);if("set_current_item"===t&&Number.isNaN(u))throw new Error(`Incorrect item for "${t}" action`);let d=Number(n);if(n||"set_previous_item"!==t&&"set_next_item"!==t||(d=1),!n&&("scroll_backward"===t||"scroll_forward"===t||"scroll_to_position"===t)||Number.isNaN(d))throw new Error(`Incorrect step value for "${t}" action`);if(o&&"clamp"!==o&&"ring"!==o)throw new Error(`Incorrect overflow value for "${t}" action`);o=o||"clamp";const p=Pt(e);if(p)switch(t){case"set_current_item":return void p.setCurrentItem(u);case"set_previous_item":return void p.setPreviousItem(d,o);case"set_next_item":return void p.setNextItem(d,o);case"scroll_to_start":return void(null===(i=p.scrollToStart)||void 0===i||i.call(p));case"scroll_to_end":return void(null===(a=p.scrollToEnd)||void 0===a||a.call(p));case"scroll_backward":return void(null===(s=p.scrollBackward)||void 0===s||s.call(p,d,o));case"scroll_forward":return void(null===(l=p.scrollForward)||void 0===l||l.call(p,d,o));case"scroll_to_position":null===(c=p.scrollToPosition)||void 0===c||c.call(p,d)}}(a[1],s.get("id"),{item:s.get("item"),step:s.get("step"),overflow:s.get("overflow")});break;case"set_variable":const l=s.get("name"),c=s.get("value");if(l&&null!==c){const t=it.get(l);if(t){const e=t.getType();"dict"===e||"array"===e?i(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:l}})):t.set(c)}else i(st(new Error("Cannot find variable"),{additional:{name:l}}))}else i(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const u=s.get("action"),d=s.get("id");ut?ut.execTimerAction(d,u):i(st(new Error("Incorrect timer action"),{additional:{id:d,action:u}}));break;case"video":!function(t,e,r){const n=(null==r?void 0:r.logError)||ft;if(t){const r=Pt(t);r?"start"===e?r.start():"pause"===e?r.pause():n(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):n(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else n(st(new Error("Missing id in video action"),{additional:{action:e}}))}(s.get("id"),s.get("action"),e);break;case"download":!function(t,e,r){const n=(null==r?void 0:r.logError)||ft;if(t){let r;r="function"==typeof S?S(t):S,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,a,s;if(r){if(r.templates)for(const t in r.templates)o.hasOwnProperty(t)||(o[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const o=r.patch.changes.find((t=>{const e=Dt.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));if(o)return n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:o.id}})),void At(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Dt.get(t.id);e&&e.replaceWith(t.id,t.items)})),At(null===(s=e.download_callbacks)||void 0===s?void 0:s.on_success_actions)}}else n(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var o;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),At(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}))}else n(st(new Error("Missing url in download action"),{additional:{url:t}}))}(s.get("url"),t,e);break;case"show_tooltip":!function(t,e,r){var n;const o=(null==r?void 0:r.logError)||ft;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=Ot.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&pt.some((e=>e.desc.id===t)))return;const a={internalId:++dt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};pt=[...pt,a];const s=null!==(n=i.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,pt=pt.filter((t=>t.internalId!==a.internalId))}),s))}(s.get("id"),s.get("multiple"),e);break;case"hide_tooltip":!function(t,e){const r=(null==e?void 0:e.logError)||ft;t?pt=pt.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):r(st(new Error("Missing id in hide_tooltip action")))}(s.get("id"),e);break;case"set_stored_value":!function(t,e,r,n,o){const i=(null==t?void 0:t.logError)||ft;if(!T)return void i(st(new Error("Store is not configured")));let a=r;e&&a&&n&&o?Qi.has(n)?("integer"===n||"number"===n?a=Number(a):"boolean"===n&&(a="true"===a),T.setValue(e,n,a,Number(o))):i(st(new Error("Incorrect stored type"))):i(st(new Error("Missing required params for set_stored_value")))}(e,s.get("name"),s.get("value"),s.get("type"),s.get("lifetime"));break;default:i(st(new Error("Unknown type of action"),{additional:{url:r}}))}}catch(t){i(st(t,{additional:{url:r}}))}else if(n)switch(n.type){case"set_variable":{const{variable_name:t,value:e}=n;if(t&&e){const r=it.get(t);r?r.getType()===e.type?r.setValue(e.value):i(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):i(st(new Error("Cannot find variable"),{additional:{name:t}}))}else i(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:n,index:o,value:i}=r;!i||"number"!=typeof o&&void 0!==o?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Wi(t,e,r,(t=>{const a=t.getValue();if("number"==typeof o&&(o<0||o>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:a.length}}));else{const e=a.slice();"number"==typeof o?e.splice(o,0,i.value):e.push(i.value),t.setValue(e)}}))}(it,i,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:o}=r;"number"==typeof o?Wi(t,e,r,(t=>{const i=t.getValue();if("number"==typeof o&&(o<0||o>=i.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:i.length}}));else{const e=i.slice();e.splice(o,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(it,i,n);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}}))}(i,n);break;case"focus_element":{const t=n.element_id&&St.get(n.element_id);t?t.focus():i(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}case"clear_focus":try{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}catch(t){}break;default:i(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function At(t,e={}){if(!t||!Array.isArray(t))return;const r=t.filter(Wt);for(let t=0;t<r.length;++t){let n=r[t];const o=n.url,i=n.typed;if(o){const t=xt(o);if(t)if(kt(t,Z)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=o)}else location.href=o}else"div-action"===t?(await Ct(n,e.componentContext),await $()):n.log_id&&(jt(n),await $())}else i?await Ct(n,e.componentContext):e.node&&Array.isArray(n.menu_items)&&n.menu_items.length&&(ct={items:n.menu_items,node:e.node})}r.forEach((t=>{t.log_id&&ht("click",t)}))}function jt(t){null==F||F(t)}const Ft=new Map,Dt=new Map,St=new Map,Ot=new Map;function Pt(t){if(Ft.has(t))return Ft.get(t);ft(st(new Error("Missing instance with id"),{additional:{id:t}}))}const It=new Map;g(at,{logStat:ht,hasTemplate:function(t){return t in o},processTemplate:yt,genId:_t,genClass:function(t){return`divkit-${_t()}`},execAction:Ct,execCustomAction:jt,isRunning:function(t){return tt[t]},setRunning:function(t,e){tt[t]=e},registerInstance:function(t,e){Ft.has(t)?ft(st(new Error("Duplicate instance id"),{additional:{id:t}})):Ft.set(t,e)},unregisterInstance:function(t){Ft.delete(t)},registerParentOf:function(t,e){Dt.set(t,e)},unregisterParentOf:function(t){Dt.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(Ot.has(r)&&ft(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),Ot.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(Ot.delete(e),pt.some((t=>t.desc.id===e))&&(pt=pt.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){pt=pt.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){St.set(t,e)},unregisterFocusable:function(t){St.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if($t[r]=$t[r]||0,++$t[r],wt[r])return wt[r];const n=`${_t()}-svg-filter`;return wt=Object.assign(Object.assign({},wt),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;$t[r]&&0==--$t[r]&&(wt=Object.keys(wt).reduce(((t,e)=>($t[e]&&(t[e]=wt[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Hr))throw new Error("Unsupported variable type");return new Hr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return It.has(t)||function(t){It.has(t)||It.set(t,Oi[t]())}(t),It.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return Z},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:it,logError:ft}},registerTimeout:function(t){vt.push(t)},typefaceProvider:D,isDesktop:z,isPointerFocus:Gi,customComponents:P,direction:W,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const Mt={setState(t){throw new Error("Not implemented")},getChild(t){if(Tt&&Tt.has(t))return Tt.get(t);ft(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Tt=null;function Nt(t){if(t.type in Rr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&ft(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Br(t.name,t.type,t.value);ot.set(t.name,e),it.set(t.name,e)}catch(e){ft(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Tt||(Tt=new Map),Tt.has(t)?ft(st(new Error("Duplicate state with id"),{additional:{id:t}})):Tt.set(t,e)},unregisterInstance(t){null==Tt||Tt.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const zt=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(zt)&&zt.forEach((t=>{if(t&&t.name){if(ot.has(t.name))return void ft(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Nt(t)}}));const Rt=y.palette;Rt&&Rt[B].forEach((t=>{if(ot.has(t.name))ft(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Br(t.name,"color",t.color);ot.set(t.name,e),it.set(t.name,e)}catch(e){ft(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of rt)it.has(t)||it.set(t,e);et.subscribe((t=>{if(t&&!it.has(t)){const e=rt.get(t);it.set(t,e);const r=lt.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Bt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Bt&&"undefined"!=typeof document){const t=ut=new Ui({logError:ft,applyVars:t=>gt(ft,t),hasVariableWithType:function(t,e){const r=it.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=it.get(t);r?r.setValue(e):ft(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:At});Bt.forEach((e=>t.createTimer(e)))}const Ut=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),ft(t)},execAnyActions:(t,e={})=>At(t,{componentContext:r,processUrls:e.processUrls,node:e.node}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return kn(e);const o=Ki(it,r),i=Si(e,t,T);return i.vars.length?K(i.vars.map((t=>o.get(t)||function(t){const e=lt.get(t)||Q(void 0);return lt.has(t)||lt.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(o,n))):i.hasExpression?kn(i.applyVars(o)):kn(e)}(r.logError,t,Ki(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>gt(r.logError,t,Ki(r.variables,e),n),produceChildContext(e,n={}){const o=t(r);let i=e,a=r.templateContext;const{templateContext:s,json:l}=yt(i,a);return o.json=l,o.templateContext=s,o.origJson=e,void 0!==n.path&&o.path.push(String(n.path)),e.type&&!n.isRootState&&o.path.push(e.type),o.variables=Ki(r.variables,n.variables),n.fake&&(o.fakeElement=!0),n.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const n=(r.variables||it).get(t);if(n){const o=n.getType();if(o!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:o}}))}return n}};return e?(r.parent=e,r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let Lt;v((()=>{Zi--,Zi||(window.removeEventListener("keydown",Yi),window.removeEventListener("pointerdown",Xi)),ut&&ut.destroy(),pt.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)})),vt.forEach((t=>{clearTimeout(t)}))})),void 0===e.id&&r.id&&void 0!==m&&r.id(m),void 0===e.json&&r.json&&void 0!==y&&r.json(y),void 0===e.platform&&r.platform&&void 0!==b&&r.platform(b),void 0===e.theme&&r.theme&&void 0!==_&&r.theme(_),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==w&&r.globalVariablesController(w),void 0===e.mix&&r.mix&&void 0!==x&&r.mix(x),void 0===e.customization&&r.customization&&void 0!==k&&r.customization(k),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==E&&r.builtinProtocols(E),void 0===e.extensions&&r.extensions&&void 0!==C&&r.extensions(C),void 0===e.onError&&r.onError&&void 0!==A&&r.onError(A),void 0===e.onStat&&r.onStat&&void 0!==j&&r.onStat(j),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==F&&r.onCustomAction(F),void 0===e.onComponent&&r.onComponent&&void 0!==V&&r.onComponent(V),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==D&&r.typefaceProvider(D),void 0===e.fetchInit&&r.fetchInit&&void 0!==S&&r.fetchInit(S),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==O&&r.tooltipRoot(O),void 0===e.customComponents&&r.customComponents&&void 0!==P&&r.customComponents(P),void 0===e.direction&&r.direction&&void 0!==M&&r.direction(M),void 0===e.store&&r.store&&void 0!==T&&r.store(T),void 0===e.setTheme&&r.setTheme&&void 0!==H&&r.setTheme(H),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==q&&r.getDebugVariables(q),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==J&&r.getDebugAllVariables(J),void 0===e.setData&&r.setData&&void 0!==G&&r.setData(G),void 0===e.execAction&&r.execAction&&void 0!==Et&&r.execAction(Et),"light"===_||"dark"===_?B=_:"system"===_?"undefined"!=typeof matchMedia?(U||(U=matchMedia("(prefers-color-scheme: dark)"),U.addListener((function(){"system"===_&&U&&(B=U.matches?"dark":"light")}))),B=U.matches?"dark":"light"):B="light":ft(st(new Error("Unsupported theme"))),B&&Rt&&Rt[B].forEach((t=>{const e=it.get(t.name);e&&e.setValue(t.color)}));{Y=!1;const t=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 bn)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}(y);t&&(Y=!0,ft(t))}if(o=y.templates||{},(null===(p=null==y?void 0:y.card)||void 0===p?void 0:p.variables)&&Array.isArray(y.card.variables)&&y.card.variables!==zt&&y.card.variables.forEach((t=>{t&&t.name&&!ot.has(t.name)&&Nt(t)})),i=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,i&&!Y&&!X){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:i.map((t=>({state_id:t.state_id.toString(),div:t.div})))};Lt=Ut.produceChildContext(t,{isRootState:!0})}return s(),u(),Y||X||!Lt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${L("dir",c,0)}>${R(wn,"RootSvgFilters").$$render(t,{svgFiltersMap:wt},{},{})} ${R(_n,"Unknown").$$render(t,{componentContext:Lt},{},{})} ${pt?`${N(pt,(e=>`${R(Hi,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:Lt},{},{})}`))}`:""} ${ct?`${R(Ji,"Menu").$$render(t,{ownerNode:ct.node,items:ct.items,parentComponentContext:Lt},{},{})}`:""}</div>`})),ea=ta;function ra(t){return ea.render(t).html}var na=exports;for(var oa in e)na[oa]=e[oa];e.__esModule&&Object.defineProperty(na,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map