@divkitframework/divkit 29.11.0 → 29.12.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:()=>Pi,createVariable:()=>qr,render:()=>qi}),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),j(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 j(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),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:A.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 T(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function M(t){const e={};for(const r in t)e[r]=T(t[r]);return e}function N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let 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}: ${T(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){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 jt(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function At(t,e){e&&t.push(e)}function Ft(t,e,r){const n=[];At(n,e[t]);for(const o in r)if(r.hasOwnProperty(o)){const i=r[o];i&&At(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 Tt(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)||!Tt(t[o],e[o]))return!1}return!0}function Mt(t,e){return Tt(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)})),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))||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:T(x)},{target:T($)},{style:T(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?it:"",!0)},M(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:T(u)},{role:T(k?"button":null)},{tabindex:T(k?0:null)},M(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,j,A,F,V,D,S,O,P,I,T,M,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,tt,et,rt,nt,ot,it=i,lt=i,vt=i,ft=i,ht=i,bt=i,_t=i,wt=i,$t=i,At=i,St=i,It=i,Ht=i,qt=i,Jt=i,Zt=i,Yt=i,Xt=i,{componentContext:Qt}=e,{cls:ne=""}=e,{style:oe}=e,{layoutParams:ie={}}=e,{customDescription:ae=!1}=e,{customPaddings:se=!1}=e,{customActions:le=""}=e,{additionalPaddings:ce=null}=e,{heightByAspect:ue=!1}=e,{parentOf:de}=e,{parentOfSimpleMode:pe}=e,{replaceItems:ve}=e,{hasInnerFocusable:ge=!1}=e;const fe=f(at),he=f(Vt);let me,ye;I=l(fe.isPointerFocus,(t=>P=t)),et=l(fe.direction,(t=>tt=t));let be,_e,we,$e,xe,ke,Ee,Ce,je,Ae,Fe,Ve,De,Se,Oe,Pe,Ie,Te,Me,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(de)||!ve)return;if(pe&&1!==(Array.isArray(e)&&e.length||0))return;const r=de.findIndex((e=>(null==e?void 0:e.id)===t)),n=de.slice();n.splice(r,1,...e||[]),de=n,ve(n)}function jr(){if(ze&&me){const t=fe.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,me,t)})),ze=null}}function Ar(){Qt.json.focus&&(P||(kr=!0),Qt.execAnyActions(hr))}function Fr(){Qt.json.focus&&(kr=!1,Qt.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],null===(t=Qt.json.tooltips)||void 0===t||t.forEach((t=>{fe.unregisterTooltip(t)})),jr()})),void 0===e.componentContext&&r.componentContext&&void 0!==Qt&&r.componentContext(Qt),void 0===e.cls&&r.cls&&void 0!==ne&&r.cls(ne),void 0===e.style&&r.style&&void 0!==oe&&r.style(oe),void 0===e.layoutParams&&r.layoutParams&&void 0!==ie&&r.layoutParams(ie),void 0===e.customDescription&&r.customDescription&&void 0!==ae&&r.customDescription(ae),void 0===e.customPaddings&&r.customPaddings&&void 0!==se&&r.customPaddings(se),void 0===e.customActions&&r.customActions&&void 0!==le&&r.customActions(le),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ce&&r.additionalPaddings(ce),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ue&&r.heightByAspect(ue),void 0===e.parentOf&&r.parentOf&&void 0!==de&&r.parentOf(de),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==pe&&r.parentOfSimpleMode(pe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ve&&r.replaceItems(ve),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ge&&r.hasInnerFocusable(ge),Qt.json&&ie&&(Ze=null,Ye="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Te=void 0,Me=void 0,ur=Qt.fakeElement?[]:Qt.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&Qt.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&Qt.json.id)),o=Qt.getDerivedFromVars(Qt.json.focus),ft(),ft=l(o,(t=>z=t)),a=Qt.getDerivedFromVars(Qt.json.border),Xt(),Xt=l(a,(t=>ot=t)),s=Qt.getDerivedFromVars(Qt.json.paddings),Yt(),Yt=l(s,(t=>nt=t)),c=Qt.getDerivedFromVars(Qt.json.margins),Jt(),Jt=l(c,(t=>Q=t)),u=Qt.getDerivedFromVars(Qt.json.width),Ht(),Ht=l(u,(t=>Y=t)),d=Qt.getDerivedFromVars(Qt.json.alignment_horizontal),Zt(),Zt=l(d,(t=>rt=t)),p=Qt.getDerivedFromVars(Qt.json.height),It(),It=l(p,(t=>Z=t)),g=Qt.getDerivedFromVars(Qt.json.alignment_vertical),qt(),qt=l(g,(t=>X=t)),h=Qt.getDerivedFromVars(Qt.json.alpha),St(),St=l(h,(t=>G=t)),m=Qt.getDerivedFromVars(Qt.json.accessibility),At(),At=l(m,(t=>J=t)),y=Qt.getDerivedFromVars(Qt.json.background),$t(),$t=l(y,(t=>q=t)),b=Qt.getDerivedFromVars(Qt.json.action),_t(),_t=l(b,(t=>W=t)),_=Qt.getDerivedFromVars(Qt.json.actions),wt(),wt=l(_,(t=>H=t)),w=Qt.getDerivedFromVars(Qt.json.doubletap_actions),bt(),bt=l(w,(t=>U=t)),x=Qt.getDerivedFromVars(Qt.json.longtap_actions),ht(),ht=l(x,(t=>B=t)),k=Qt.getDerivedFromVars(Qt.json.action_animation),vt(),vt=l(k,(t=>N=t)),E=Qt.getDerivedFromVars(Qt.json.visibility),lt(),lt=l(E,(t=>M=t)),C=Qt.getDerivedFromVars(Qt.json.transform),it(),it=l(C,(t=>T=t)),Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],de&&de.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),fe.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(pe)}))}));{const t=kr&&(null==z?void 0:z.border)?z.border:ot;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=Mt(e,Be),Ue=Mt(r,Ue),We=n,Ge=o}Ze=Bt(nt&&!se?nt: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,ce),tt),Ye=Pt(Q,tt,Ye);{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Qe=Et(null==Y?void 0:Y.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&ie.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&ie.parentHorizontalWrapContent)&&(o["width-constrained"]=!0,"horizontal"===ie.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"!==c&&c||Qt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===ie.parentContainerOrientation&&ie.parentContainerWrap&&(l=!0,Qt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===ie.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===ie.parentContainerOrientation&&(i=Y&&"weight"in Y&&Y.weight||1,ie.parentContainerWrap&&(s=!0));if("parent"===t)o["halign-self"]="stretch";else{const t=rt;o["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===tt?te:ee)[t]:ie.parentHAlign||"start"}t&&(o.width=t),be=e,_e=r,we=n,Ke=i,tr=a,Xe=Mt(o,Xe),er=s,rr=l}{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ue);else if("fixed"===c)or=Et(null==Z?void 0:Z.value,or),e=dt(or);else if("match_parent"!==c||ie.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&ie.parentVerticalWrapContent)&&(o["height-constrained"]=!0,"vertical"===ie.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"===c&&Qt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===ie.parentContainerOrientation&&ie.parentContainerWrap&&(l=!0,Qt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===ie.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===ie.parentContainerOrientation&&(i=(null==Z?void 0:Z.weight)||1,ie.parentContainerWrap&&(s=!0));if("parent"===t)o["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===ie.parentContainerOrientation?o["valign-self"]=re[t]:o["valign-self"]=ie.parentVAlign||"start"}t&&(o.height=t),$e=e,xe=r,ke=n,ir=i,ar=a,nr=Mt(o,nr),sr=s,lr=l}var Vr,Dr,Sr;if(A=!!ie.overlapParent||void 0,F=ie.overlapParent&&(!Y||"match_parent"===Y.type)&&!ie.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!ie.parentVerticalWrapContent,V=ie.gridArea?`${ie.gridArea.y+1}/${ie.gridArea.x+1}/span ${ie.gridArea.rowSpan}/span ${ie.gridArea.colSpan}`:void 0,Dr=cr,cr=!Ot(Vr=G)||void 0===Vr||Vr>1?Dr:Number(Vr),Ee=1===cr?void 0:cr,ye=void 0,J&&!ae&&J.description&&(ye={},ye["aria-label"]=J.description),Ce=kr&&(null==z?void 0:z.background)?z.background:q,je={},Ae=!1,Array.isArray(Ce)&&(Ae=Ce.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ce);je["background-color"]=t.color,je["background-image"]=t.image,je["background-size"]=t.size,je["background-position"]=t.position,je["background-repeat"]="no-repeat"}Fe=void 0,dr&&Qt.json.transition_in&&fe.isRunning("stateChange")&&(Fe=!0),De=void 0,dr&&Qt.json.transition_change&&fe.isRunning("stateChange")&&he.hasTransitionChange(Qt.json.id)&&(De=!0);{let t=H||W&&[W]||[],e=U||[],r=B||[],n=(null==z?void 0:z.on_focus)||[],o=(null==z?void 0:z.on_blur)||[];Qt.fakeElement?(t=[],e=[],r=[],n=[],o=[]):(Array.isArray(t)||(t=[],Qt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Qt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Qt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Qt.logError(st(new Error("FocusActions should be array")))),Array.isArray(o)||(o=[],Qt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&le&&(t=[],e=[],r=[],Qt.logError(st(new Error(`Cannot use action on component "${le}"`)))),vr=t.filter(Wt),gr=e.filter(Wt),fr=r.filter(Wt),hr=n.filter(Wt),mr=o.filter(Wt)}N&&(yr=Rt(N),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 Se=e,Oe=r,`opacity ${o}ms ${i} ${n}ms`;case"scale":return Pe=e,Ie=r,`transform ${o}ms ${i} ${n}ms`;case"native":case"no_animation":return"";default:return Qt.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?Qt.json.transition_in:Qt.json.transition_out;pr&&r&&(await $(),"in"===e&&(Ve=!0),he.runVisibilityTransition(Object.assign(Object.assign({},Qt.json),{visibility:"visible"}),Qt,r,me,e).then((()=>{"in"===e&&(Ve=!1)})).catch((t=>{throw"in"===e&&(Ve=!1),t})))}(e)),_r||(_r=!0)}if(Qt.json&&me&&!Tt(Qt.json.extensions,Ne)){let t=Ne=Qt.json.extensions;$().then((()=>{if(t===Ne&&me&&(jr(),Array.isArray(Qt.json.extensions))){const t=fe.getExtensionContext();ze=Qt.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const o=fe.getExtension(n,e.params);return o&&(null===(r=o.mountView)||void 0===r||r.call(o,me,t)),o})).filter(mt)}}))}if(D=Object.assign(Object.assign(Object.assign({},Xe),nr),{"parent-overlap":A,"parent-overlap-absolute":F,"scroll-snap":ie.scrollSnap,"hide-on-transition-in":Fe||Ve||De,visibility:wr,"has-action-animation":Boolean(br),"parent-flex":ie.parentContainerOrientation||void 0,"parent-grid":Boolean(ie.gridArea)||void 0,"has-custom-focus":Boolean(kr&&Qt.json.focus)}),T&&void 0!==T.rotation){const t=T.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=T.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr),Te=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Me=`rotate(${T.rotation}deg)`}return S=er||sr?"100%":Ke||ir?0:void 0,O=Object.assign(Object.assign(Object.assign(Object.assign({},oe),je),Be),{width:be,"min-width":_e,"max-width":we,height:$e,"min-height":xe,"max-height":ke||(null==oe?void 0:oe["max-height"]),"grid-area":V,padding:j,margin:Ye,opacity:Ee,transition:br,"transform-origin":Te,transform:Me,"flex-grow":Ke||ir||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":S,"--divkit-animation-opacity-start":Se,"--divkit-animation-opacity-end":Oe,"--divkit-animation-scale-start":Pe,"--divkit-animation-scale-end":Ie}),I(),it(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),At(),St(),It(),Ht(),qt(),Jt(),et(),Zt(),Yt(),Xt(),rr||lr?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Qt,id:Qt.json.id,use:function(t){var e;me=t,dr&&Qt.json.transition_in&&he.registerChildWithTransitionIn(Qt.json,Qt,Qt.json.transition_in,t).then((()=>{Fe=!1})).catch((t=>{throw Fe=!1,t})),dr&&Qt.json.transition_out&&he.registerChildWithTransitionOut(Qt.json,Qt,Qt.json.transition_out,t),dr&&Qt.json.transition_change&&he.registerChildWithTransitionChange(Qt.json,Qt,Qt.json.transition_change,t).then((()=>{De=!1})).catch((t=>{throw De=!1,t}));const r=Qt.fakeElement?[]:Qt.json.visibility_actions||Qt.json.visibility_action&&[Qt.json.visibility_action],n=Qt.fakeElement?[]:Qt.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)).subscribe((e=>{const r=e.filter(jt),a={};r.forEach((t=>{a[t.index]=t})),l();const c=[...new Set(r.map((t=>{const e="visibility"===i[t.index].type;return Ct(e,t.visibility_percentage,e?50:0)/100})))];c.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{r.forEach((e=>{const r=i[e.index],a="visibility"===r.type,s=Ct(a,e.visibility_percentage,a?50:0);let l;l=0===s?t.intersectionRatio>=1e-12:t.intersectionRatio>=s/100;const c=a?!r.visible&&l:r.visible&&!l,u=a?!l:l;c?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);const i=o.getJsonWithVars(r.action),s=i.url,l=i.typed;if(s){const t=xt(s);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(i):i.log_id&&n.execCustomAction(i))}else l&&n.execAction(i);n.logStat(a?"visible":"disappear",i)}),Et(e.visibility_duration,800))):u&&r.timer&&clearTimeout(r.timer),r.visible=l}))}))}),{threshold:c}),s.observe(t))}));return{destroy(){l(),c()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:fe,componentContext:Qt}));const i=Qt.json.id;return i&&he.registerChild(i),null===(e=Qt.json.tooltips)||void 0===e||e.forEach((e=>{fe.registerTooltip(t,e)})),{destroy(){i&&he.unregisterChild(i),o&&o.destroy(),Er&&Er.destroy()}}},cls:ne+" "+Ft("outer",ct,D),style:ut(O),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:ye,hasInnerFocusable:ge,isNativeActionAnimation:!yr.length||(Sr=yr,Sr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Kt,"OuterBackground").$$render(t,{componentContext:Qt,direction:tt,background:Ce,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Ar,blurHandler:Fr,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="",j=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="",j=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,j=(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":j?`inset 0 0 0 ${dt(j.width)} ${j.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,j,A,F,V,D,S,O,P,I,T,M,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="",jt="",At=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Tt=[],Mt=[];var Nt;v((()=>{Mt.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,jt="",At=!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),X(),X=l(a,(t=>D=t)),s=mt.getDerivedFromVars(mt.json.images),Y(),Y=l(s,(t=>V=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}),Q(),Q=l(c,(t=>S=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=>M=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>T=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,jt=r,At=n}Vt=de(H,U,Vt),Dt=pe(B,Dt),k=!D||$t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=$t.length,E=Boolean(M)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";z&&k&&E&&(t=gt(M||D&&D[0]&&D[0].text_color,1,St)),St=t}Ot=gt(T,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){let n=[];if(Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Mt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Tt=[]);const o=t;let i=e||[{start:0,end:o.length}],a=r||[],s=0,l=[],c=[];i.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=o.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e,r;let i="image"===t.type?null:t.range,a=t.index;if(a>s){let i=Object.assign(Object.assign({},S),...l);n.push({text:o.substring(s,a),textStyles:i,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&&i)l.push(i);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},S),...l),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),o=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const i={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let a="";const s=t.image.tint_color,c=ge(t.image.tint_mode,"source_in");if(s){const e=gt(t.image.tint_color);a=_t.addSvgFilter(e,c),Mt.push([e,c])}n.push({image:{url:t.image.url,width:r,height:o,wrapperStyle:i,svgFilterId:a,preloadRequired:Boolean(t.image.preload_required)}})}s=a})),s<o.length&&n.push({text:o.substring(s),textStyles:Object.assign({},S)}),Tt=n}($t,D,V),j={singleline:x,multiline:At,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},A={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":jt,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,j)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${L("class",Ft("text__inner",lt,A),0)}${L("style",ut(F),0)}>${Tt.length?`${N(Tt,(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:S,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",je="divkit-f6e9a";function Ae(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),Ae(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)Ae(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),Ae(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(je))&&!(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",je,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,j,A,F,V,D,S,O,P,I,T,M,z,B=i,U=i,W=i,L=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i;var tt,et,rt,nt,ot,it,st;let{componentContext:lt}=e,{layoutParams:ct}=e;const ut=f(at);let dt;S=l(ut.direction,(t=>D=t));let pt,vt="vertical",gt="start",ft="start",ht=null,yt=null,bt={},_t=[];void 0===e.componentContext&&r.componentContext&&void 0!==lt&&r.componentContext(lt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ct&&r.layoutParams(ct),lt.json&&(vt="vertical",gt="start",ft="start",pt=void 0),o=lt.json.items,a=lt.getDerivedFromVars(null===(tt=lt.json.item_builder)||void 0===tt?void 0:tt.data,void 0,!0),Q(),Q=l(a,(t=>z=t)),s=lt.getDerivedFromVars(lt.json.orientation),X(),X=l(s,(t=>M=t)),c=lt.getDerivedFromVars(lt.json.layout_mode),Y(),Y=l(c,(t=>T=t)),u=lt.getDerivedFromVars(lt.json.content_alignment_vertical),G(),G=l(u,(t=>P=t)),d=lt.getDerivedFromVars(lt.json.content_alignment_horizontal),J(),J=l(d,(t=>O=t)),p=lt.getDerivedFromVars(lt.json.separator),q(),q=l(p,(t=>V=t)),v=lt.getDerivedFromVars(lt.json.line_separator),H(),H=l(v,(t=>F=t)),g=lt.getDerivedFromVars(lt.json.aspect),L(),L=l(g,(t=>A=t)),h=lt.getDerivedFromVars(lt.json.width),U(),U=l(h,(t=>C=t)),m=lt.getDerivedFromVars(lt.json.height),W(),W=l(m,(t=>j=t)),y=lt.getDerivedFromVars(lt.json.clip_to_bounds),B(),B=l(y,(t=>E=t));{let t=[];if(lt.json.item_builder&&Array.isArray(z)&&Array.isArray(lt.json.item_builder.prototypes)){const e=lt.json.item_builder;t=[],z.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=ut.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(lt.getJsonWithVars(r.selector,n)){o=r.div;break}}}o&&t.push({div:o,vars:n})}))}else t=(o||[]).map((t=>({div:t})));_t=t.map(((t,e)=>lt.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];_t.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),dt=K(t,(t=>[...t])),Z(),Z=l(dt,(t=>I=t))}if(vt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(M,vt),b="wrap"===T,_="horizontal"!==vt&&!b&&I.some(we),w="vertical"!==vt&&!b&&I.some($e),gt=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}(P,gt),ft=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}(O,D,ft),(null==V?void 0:V.style)&&"overlap"!==vt&&Ee()){const t=xe(V.style,Oe,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(et=V.show_at_start)&&void 0!==et&&et),show_at_end:Boolean(null!==(rt=V.show_at_end)&&void 0!==rt&&rt),show_between:Boolean(null===(nt=V.show_between)||void 0===nt||nt),style:t,margins:ye(V.margins)}:null}else ht=null;if((null==F?void 0:F.style)&&"overlap"!==vt&&Ee()){const t=xe(F.style,Oe,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(ot=F.show_at_start)&&void 0!==ot&&ot),show_at_end:Boolean(null!==(it=F.show_at_end)&&void 0!==it&&it),show_between:Boolean(null===(st=F.show_between)||void 0===st||st),style:t,margins:ye(F.margins)}:null}else yt=null;$=ht||yt?function(t,e,r){const n={};return be(n,e,"vertical"===t),be(n,r,"horizontal"===t),n}(vt,ht,yt):null;{const t=null==A?void 0:A.ratio;pt=t&&Yt(t)?t:void 0}{let t={};"overlap"===vt&&(t.overlapParent=!0),"horizontal"!==vt&&(t.parentHAlign=b?"start":De[ft]),"vertical"!==vt&&(t.parentVAlign=b?"start":Se[gt]),pt||w||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ct?void 0:ct.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!_&&("wrap_content"===(null==C?void 0:C.type)||"match_parent"===(null==C?void 0:C.type)&&(null==ct?void 0:ct.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===vt&&(t.parentContainerOrientation="horizontal"),"vertical"===vt&&(t.parentContainerOrientation="vertical"),b&&(t.parentContainerWrap=!0),bt=Mt(t,bt)}return x={orientation:vt,valign:gt,halign:ft,wrap:b,overflow:!1===E||0===E?"visible":void 0},k={gap:ht||yt?_e(vt,ht,yt):void 0,"aspect-ratio":pt},B(),U(),W(),L(),H(),q(),S(),J(),G(),Z(),Y(),X(),Q(),`${R(oe,"Outer").$$render(t,{cls:Ft("container",me,x),componentContext:lt,layoutParams:ct,style:k,additionalPaddings:$,heightByAspect:Boolean(pt),parentOf:_t.map((t=>t.json)),replaceItems:function(t){lt=Object.assign(Object.assign({},lt),{json:Object.assign(Object.assign({},lt.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(_t,(e=>`${R(En,"Unknown").$$render(t,{componentContext:e,layoutParams:bt},{},{})}`))} ${ht||yt?`${R(Ve,"ContainerSeparators").$$render(t,{direction:D,separator:ht,lineSeparator:yt,orientation:vt,contentHAlign:ft,contentVAlign:gt},{},{})}`:""}`})}`})),Ie=Pe,Te={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Me(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=i,{componentContext:g}=e,{layoutParams:f}=e,h="horizontal",m="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==g&&r.componentContext(g),void 0===e.layoutParams&&r.layoutParams&&void 0!==f&&r.layoutParams(f),g.json&&(h="horizontal",m="rgba(0,0,0,0.08)"),o=g.getDerivedFromVars(g.json.delimiter_style),v(),v=l(o,(t=>p=t)),h=Me(null==p?void 0:p.orientation,h),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),m=gt(null==p?void 0:p.color,1,m),s="horizontal"===h?"100%":dt(1),c="horizontal"===h?dt(1):"100%",u={background:m,width:s,height:c},d={orientation:h},v(),`${R(oe,"Outer").$$render(t,{cls:Ft("separator",Te,d),componentContext:g,layoutParams:f},{},{default:()=>a?`<span${L("class",Te.separator__inner,0)}${L("style",ut(u),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,j,A,F,V,D,S,O,P,I,T,M,N,z,B,U,W,H,J,G=i,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,{componentContext:pt}=e,{layoutParams:vt}=e;const ft=f(at);let ht;V=l(ft.direction,(t=>F=t));let mt,yt,bt=0,_t=!1,xt="rgba(0,0,0,0.08)",kt=!1,Ct="",jt="none",At="50% 50%",Vt="0",Dt="source_in",St="",Ot="",Pt=0,It=0,Tt=0,Mt="",zt="",Rt=!1;v((()=>{ft.removeSvgFilter(yt,Dt)})),void 0===e.componentContext&&r.componentContext&&void 0!==pt&&r.componentContext(pt),void 0===e.layoutParams&&r.layoutParams&&void 0!==vt&&r.layoutParams(vt),pt.json&&(jt="none",At="50% 50%",Dt="source_in"),o=pt.getDerivedFromVars(pt.json.image_url),lt(),lt=l(o,(t=>W=t)),a=pt.getDerivedFromVars(pt.json.gif_url),ct(),ct=l(a,(t=>H=t)),s=pt.getDerivedFromVars(pt.json.width),it(),it=l(s,(t=>U=t)),c=pt.getDerivedFromVars(pt.json.height),ot(),ot=l(c,(t=>B=t)),u=pt.getDerivedFromVars(pt.json.preview),nt(),nt=l(u,(t=>z=t)),d=pt.getDerivedFromVars(pt.json.placeholder_color),rt(),rt=l(d,(t=>N=t)),p=pt.getDerivedFromVars(pt.json.scale),et(),et=l(p,(t=>M=t)),g=pt.getDerivedFromVars({content_alignment_horizontal:pt.json.content_alignment_horizontal,content_alignment_vertical:pt.json.content_alignment_vertical}),tt(),tt=l(g,(t=>T=t)),h=pt.getDerivedFromVars(pt.json.accessibility),K(),K=l(h,(t=>I=t)),m=pt.getDerivedFromVars(pt.json.aspect),Q(),Q=l(m,(t=>P=t)),y=pt.getDerivedFromVars(pt.json.tint_color),X(),X=l(y,(t=>O=t)),b=pt.getDerivedFromVars(pt.json.tint_mode),Y(),Y=l(b,(t=>S=t)),_=pt.getDerivedFromVars(pt.json.appearance_animation),Z(),Z=l(_,(t=>D=t)),w=pt.getDerivedFromVars(pt.json.filters),G(),G=l(w,(t=>A=t)),$=pt.getDerivedFromVars(pt.json.preload_required),dt(),dt=l($,(t=>J=t));{let t="gif"===pt.json.type?H:W;_t="empty://"===t,_t&&(t=Be),mt=t}bt=0,mt?kt=!1:(kt=!0,pt.logError(st(new Error(`Missing "${"gif"===pt.json.type?"gif_url":"image_url"}" for "${pt.json.type}"`)))),x="wrap_content"===(null==U?void 0:U.type),k="wrap_content"===(null==B?void 0:B.type),Ct=z?`url("${Re(z)}")`:"",xt=gt(N,1,xt),jt=wt(M)||jt,At=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,F,At),E=(null==I?void 0:I.description)||"";{const t=null==P?void 0:P.ratio;Vt=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=O?gt(O):void 0,e=ge(S,Dt);t===yt&&e===Dt||(ft.removeSvgFilter(yt,Dt),St=t?ft.addSvgFilter(t,e):"",yt=t,Dt=e)}if(D&&"fade"===D.type){const t=D;Ot=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Tt=Et(t.duration,300),It=Et(t.start_delay,0),Pt=Et(t.alpha,0)}{let t="",e="";Array.isArray(A)&&A.length&&(t=Xt(A,pt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Mt=t,zt=e,Rt="rtl"===F&&Array.isArray(A)&&A.some((t=>"rtl_mirror"===t.type))}return C={aspect:"0"!==Vt,"is-width-content":x,"is-height-content":k,loaded:!1,"before-appearance":Boolean(Ot)&&!0,"is-rtl-mirror":Rt},j={"background-image":Ct,"background-color":Ct?void 0:xt,"background-size":jt,"clip-path":zt||void 0,"object-fit":jt,"object-position":At,filter:["",Mt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ot||void 0,"--divkit-appearance-fade-start":Ot?Pt:void 0,"--divkit-appearance-delay":Ot?`${It}ms`:void 0,"--divkit-appearance-duration":Ot?`${Tt}ms`:void 0},G(),V(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),dt(),kt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("image",ze,C),componentContext:pt,layoutParams:vt,customDescription:!0},{},{default:()=>C.aspect?`<span${L("class",ze["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Vt}%`})}><img${L("class",ze.image__image,0)}${L("src",mt,0)}${L("loading",J?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",E,0)}${L("aria-hidden",E?null:"true",0)}${L("this",ht,0)}></span>`:`<img${L("class",ze.image__image,0)}${L("src",mt,0)}${L("loading",J?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",E,0)}${L("aria-hidden",E?null:"true",0)}${L("this",ht,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,$=i,x=i,k=i,{componentContext:E}=e,{layoutParams:C}=e;h=l(f(at).direction,(t=>g=t));let j,A,F=1,V=[],D=[],S=[],O=[],P=0,I=!1,T="start",M="start";void 0===e.componentContext&&r.componentContext&&void 0!==E&&r.componentContext(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),E.json&&(F=1,T="start",M="start"),o=Array.isArray(E.json.items)&&E.json.items||[],a=E.getDerivedFromVars(E.json.column_count),k(),k=l(a,(t=>_=t)),s=E.getDerivedFromVars(E.json.content_alignment_vertical),$(),$=l(s,(t=>y=t)),c=E.getDerivedFromVars(E.json.content_alignment_horizontal),w(),w=l(c,(t=>m=t)),F=ae(_,F),u=o.map(((t,e)=>E.produceChildContext(t,{path:e})));{let t=[];u.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),x(),x=l(j,(t=>b=t))}{const t={};let e=0,r=0;V=[],D=[],S=[],O=[],I=!1,A=u.map(((n,o)=>{var i,a,s,l;const c=b[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]?(I=!0,E.logError(st(new Error(`No space for item at index ${o}`)))):(t[n+"_"+e]=!0,(!V[n]||V[n]<v)&&(V[n]=v),(!D[e]||D[e]<g)&&(D[e]=g),(!S[n]||S[n]<f)&&(S[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=F&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),P=r}return T=pe(y,T),M=de(m,g,M),d={valign:T,halign:M},p={"grid-template-columns":qe(V,S,F),"grid-template-rows":qe(D,O,P)},v=I,h(),w(),$(),x(),k(),v?"":`${R(oe,"Outer").$$render(t,{cls:Ft("grid",We,d),componentContext:E,style:p,layoutParams:C,parentOf:u.map((t=>t.json)),replaceItems:function(t){E=Object.assign(Object.assign({},E),{json:Object.assign(Object.assign({},E.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(A,(e=>`${R(En,"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,j,A,F,V,D,S,O,P,T,M,z,B,U,W,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,tt=i,et=i,rt=i,{componentContext:nt}=e,{layoutParams:it}=e;const st=f(at);let lt;j=l(st.direction,(t=>C=t));let ct,pt=[],vt=!1,gt=!1,ft=null,ht=!1;const yt=st.getCustomization("galleryLeftClass"),bt=st.getCustomization("galleryRightClass");let _t,wt,$t,xt,kt,Ct=1,jt="horizontal",At="start",Vt=8,Dt="",St=[],Ot={},It=!1,Tt={},Nt=0;U=l(st.isDesktop,(t=>B=t));const zt=er((function(){if(!lt)return;let t=lt.scrollLeft;"rtl"===C&&(t*=-1);const e=lt.scrollWidth,r=lt.offsetWidth;"ltr"===C?(vt=t>2,gt=t+r<e-2):(gt=t>2,vt=t+r<e-2)}),50);function Rt(){let t=[],e=pt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Ct;++e){const n=pt[e].children[r];n&&t.push(n)}return t}function Bt(t,e="smooth"){const r="horizontal"===jt?"left":"top";lt.scroll({[r]:t,behavior:e})}function Ut(t,e,r="smooth"){const n="horizontal"===jt,o=n?"offsetLeft":"offsetTop",i=t[e];if(i){let t;if("ltr"!==C&&n){const e=lt.offsetWidth;t=i[o]+i.offsetWidth+.01-Vt/2-e}else t=i[o]+.01-Vt/2;Bt(t,r)}}function Wt(t){const e=Rt(),r=lt.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((()=>{ht=!1,_t&&!nt.fakeElement&&(st.unregisterInstance(_t),_t=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==nt&&r.componentContext(nt),void 0===e.layoutParams&&r.layoutParams&&void 0!==it&&r.layoutParams(it),nt.json&&(Ct=1,jt="horizontal",At="start",Vt=8,Dt=""),o=Array.isArray(nt.json.items)&&nt.json.items||[],a=nt.getDerivedFromVars(nt.json.column_count),et(),et=l(a,(t=>z=t)),s=nt.getDerivedFromVars(nt.json.orientation),tt(),tt=l(s,(t=>M=t)),c=nt.getDerivedFromVars(nt.json.cross_content_alignment),Q(),Q=l(c,(t=>T=t)),u=nt.getDerivedFromVars(nt.json.item_spacing),X(),X=l(u,(t=>P=t)),d=nt.getDerivedFromVars(nt.json.cross_spacing),Y(),Y=l(d,(t=>O=t)),p=nt.getDerivedFromVars(nt.json.paddings),Z(),Z=l(p,(t=>S=t)),g=nt.getDerivedFromVars(nt.json.scroll_mode),J(),J=l(g,(t=>V=t)),h=nt.getDerivedFromVars(nt.json.restrict_parent_scroll),rt(),rt=l(h,(t=>W=t)),m=nt.getDerivedFromVars(nt.json.scrollbar),q(),q=l(m,(t=>F=t)),y=nt.getDerivedFromVars(nt.json.default_item),H(),H=l(y,(t=>A=t)),b=o.map(((t,e)=>nt.produceChildContext(t,{path:e}))),_=B&&ht,_?"undefined"!=typeof ResizeObserver&&(ft=new ResizeObserver((()=>{zt()})),ft.observe(ct)):ft&&(ft.disconnect(),ft=null),Ct=ae(z,Ct),w=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}(b,Ct),jt=Me(M,jt),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(T,At),Vt=Et(P,Vt),wt=dt(Vt),xt=Et(O,Vt),$t=dt(xt),Dt=Pt(S,C,Dt),$="horizontal"===jt?"grid-template-columns":"grid-template-rows";{let t=[];b.forEach((e=>{const r="horizontal"===jt?"width":"height";t.push(nt.getDerivedFromVars(e.json[r]))})),kt=K(t,(t=>t)),G(),G=l(kt,(t=>D=t))}St=[],Ct>1?St.push("auto"):D.forEach((t=>{!t&&"horizontal"===jt||"match_parent"===(null==t?void 0:t.type)?St.push("100%"):St.push("max-content")}));{const t={};let e={};It=!1,"horizontal"===jt?e.parentVAlign=At:e.parentHAlign=At,"paging"===V&&(It=!0,e.scrollSnap="start",t["horizontal"===jt?"scroll-padding-left":"scroll-padding-top"]=dt(Vt/2)),1===Ct&&(e.parentLayoutOrientation=jt),Ot=Mt(t,Ot),Tt=Mt(e,Tt)}return x={padding:Dt,"grid-gap":$t},k={"grid-gap":wt,[$]:tr(St)},E={orientation:jt,"scroll-snap":It,scrollbar:"auto"===F?"auto":"none"},Nt=Et(A,Nt),nt.json&&zt(),nt.json&&(_t&&(st.unregisterInstance(_t),_t=void 0),nt.json.id&&!nt.fakeElement&&(_t=nt.json.id,st.registerInstance(_t,{setCurrentItem(t){const e=Rt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Ut(e,t)},setPreviousItem(t,e){const r=Wt("prev"),n=Rt();let o=r-t;o<0&&(o="ring"===e?rr(o,n.length):0),Ut(n,o)},setNextItem(t,e){const r="horizontal"===jt,n="ltr"!==C&&r?-1:1,o=r?lt.scrollLeft*n+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,i=Rt();if(o&&"ring"===e)return void Ut(i,0);let a=Wt("next")+t;a>i.length-1&&(a="ring"===e?rr(a,i.length):i.length-1),Ut(i,a)},scrollToStart(){Bt(0)},scrollToEnd(){Bt("ltr"===C||"horizontal"!==jt?1e6:-1e6)},scrollBackward(t,e){const r="horizontal"===jt,n="ltr"!==C&&r?-1:1,o=r?lt.scrollLeft:lt.scrollTop,i=r?lt.scrollWidth-lt.offsetWidth:lt.scrollHeight-lt.offsetHeight;let a=o*n-t;a<0&&("clamp"===e?a=0:"ring"===e&&(a=rr(a,i))),Bt(a*n)},scrollForward(t,e){const r="horizontal"===jt,n="ltr"!==C&&r?-1:1,o=r?lt.scrollLeft:lt.scrollTop,i=r?lt.scrollWidth-lt.offsetWidth:lt.scrollHeight-lt.offsetHeight;let a=o*n+t;a>i&&("clamp"===e?a=i:"ring"===e&&(a=rr(a,i))),Bt(a*n)},scrollToPosition(t){Bt("ltr"===C||"horizontal"!==jt?t:-t)}}))),j(),H(),q(),J(),G(),Z(),Y(),X(),Q(),tt(),et(),U(),rt(),` ${R(oe,"Outer").$$render(t,{cls:Ft("gallery",Ze,E),componentContext:nt,layoutParams:it,customPaddings:!0,customActions:"gallery",parentOf:o,replaceItems:function(t){nt=Object.assign(Object.assign({},nt),{json:Object.assign(Object.assign({},nt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ze.gallery__scroller,!0)+" "+I(W?ot:"",!0)}"${L("style",ut(Ot),0)}${L("this",lt,0)}><div${L("class",Ze["gallery__items-grid"],0)}${L("style",ut(x),0)}${L("this",ct,0)}>${N(w,((e,r)=>`<div${L("class",Ze.gallery__items,0)}${L("style",ut(k),0)}${L("this",pt[r],0)}>${N(e,(e=>`${R(En,"Unknown").$$render(t,{componentContext:e,layoutParams:Tt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===jt?`${vt&&_?` <div${L("class",yt||`${Ze.gallery__arrow} ${Ye} ${Qe}`,0)}>${yt?"":`<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>`:""} ${gt&&_?` <div${L("class",bt||`${Ze.gallery__arrow} ${Ye} ${Ke}`,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="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,j,A,F,V,D,S,O,P,T,M,z,B=i,U=i,W=i,H=i,J=i,G=i,Z=i,Y=i,X=i;var K,tt;let{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);D=l(nt.direction,(t=>V=t));const it=nt.genId("tabs");let lt,ct=!1,vt=Q([]);j=l(vt,(t=>C=t));let ft,ht,mt,yt,bt,_t,wt,$t={},xt={},kt=12,Ct="",jt="",At="",Vt="",St="",It="",Tt="",Nt="",zt="",Rt="",Lt=0,Ht="",qt="",Jt=null,Zt=!1,Xt=!1,Qt=[],Kt=[],te=null;async function ee(t,e=!1){if(_t=_,_=t,Zt||(Zt=!0,ht.style.height=dt(ht.clientHeight),mt.style.transform=`translate3d(${100*-(null!=_t?_t:_)}%,0,0)`),Xt=!0,async function(t){await $(),mt.style.transform=`translate3d(${t}%,0,0)`}(100*-_),function(t=!1){const e=t?Math.max(0,_-1):Math.min(_,null!=_t?_t:_),r=t?Math.min(o.length-1,_+1):Math.max(_,null!=_t?_t:_);Qt=Qt.map(((t,n)=>{var i;return t||(n>=e&&n<=r&&(null===(i=o[n])||void 0===i?void 0:i.div)?et.produceChildContext(o[n].div,{path:n}):void 0)})),Kt=Kt.map(((t,n)=>n>=e&&n<=r))}(),async function(){if("match_parent"===(null==E?void 0:E.type))return;await $();const t=document.getElementById(`${it}-panel-${_}`);t&&(ht.style.height=dt(t.offsetHeight))}(),te&&clearTimeout(te),te=window.setTimeout((()=>{Kt=o.map(((t,e)=>e===_))}),400),wt=-_*ht.clientWidth,e){await $();const t=ft.querySelector(`.${ir.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{lt&&(nt.unregisterInstance(lt),lt=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),et.json&&(kt=12,Ct="",Vt="",yt=void 0,St="",bt=void 0,It="",Tt="",Nt="",zt="",Rt="",Lt=0,Ht="",qt="",Jt=null),o=et.json.items||[],a=o.map((t=>t.div)),s=et.getDerivedFromVars(et.json.width),Y(),Y=l(s,(t=>M=t)),c=et.getDerivedFromVars(et.json.height),B(),B=l(c,(t=>E=t)),u=et.getJsonWithVars(et.json.selected_tab),d=et.getDerivedFromVars(et.json.tab_title_style),Z(),Z=l(d,(t=>T=t)),p=et.getDerivedFromVars(et.json.has_separator),G(),G=l(p,(t=>P=t)),g=et.getDerivedFromVars(et.json.separator_color),J(),J=l(g,(t=>O=t)),h=et.getDerivedFromVars(et.json.separator_paddings),H(),H=l(h,(t=>S=t)),m=et.getDerivedFromVars(et.json.switch_tabs_by_content_swipe_enabled),W(),W=l(m,(t=>F=t)),y=et.getDerivedFromVars(et.json.restrict_parent_scroll),X(),X=l(y,(t=>z=t)),b=et.getDerivedFromVars(et.json.title_paddings),U(),U=l(b,(t=>A=t)),_=u&&Number(u)||0,Array.isArray(o)&&o.length){let t=[];o.forEach(((e,r)=>{const n=et.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):et.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),vt.set(t)}else vt.set([]);(null==C?void 0:C.length)?ct=!1:(ct=!0,et.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={parentContainerOrientation:"horizontal"};"wrap_content"===(null==M?void 0:M.type)&&(t.parentHorizontalWrapContent=!0),E&&"wrap_content"!==E.type||(t.parentVerticalWrapContent=!0),$t=Mt(t,$t)}if(!ct&&(_<0||_>=o.length)&&(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab,length:o.length}})),_=_<0?0:o.length-1),ct||C.some((t=>_===t.index))||(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab}})),_=(null===(K=C[0])||void 0===K?void 0:K.index)||0),w=T||{},kt=ae(w.font_size,kt),w.font_size||w.paddings){const t=w.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/kt*10,right:(Number("ltr"===V?t.end:t.start)||Number(t.right)||0)/kt*10,bottom:(Number(t.bottom)||0)/kt*10,left:(Number("ltr"===V?t.start:t.end)||Number(t.left)||0)/kt*10};Ct=Pt(e,V,Ct)}{const t=w.line_height;void 0!==t&&Yt(t)&&(jt=dt(t/kt*10))}{const t=w.letter_spacing;void 0!==t&&Ot(t)&&(At=dt(t/kt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(tt=w.corner_radius)&&void 0!==tt?tt:1e3;w.corners_radius?Vt=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)}(w.corners_radius,t,kt,Vt):Ot(t)&&(Vt=dt(t/kt*10))}return yt=le(w.active_font_weight||w.font_weight,yt),St=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:yt||400}):"",bt=le(w.inactive_font_weight||w.font_weight,bt),It=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:bt||400}):"",Tt=gt(w.active_text_color,1,Tt),Nt=gt(w.inactive_text_color,1,Nt),zt=gt(w.active_background_color,1,zt),Rt=gt(w.inactive_background_color,1,Rt),Lt=Et(w.item_spacing,Lt),P&&(O&&(Ht=gt(O,1,Ht)),S&&(qt=Pt(S,V,qt))),x={background:Ht,margin:qt},k=void 0===F||Boolean(F),Jt=Bt(A||void 0,Jt),function(t){ct||(Qt=t.map(((t,e)=>{if(e===_&&(null==t?void 0:t.div))return et.produceChildContext(t.div,{path:e})})),Kt=t.map(((t,e)=>e===_)))}(o),et.json&&(lt&&(nt.unregisterInstance(lt),lt=void 0),!et.json.id||ct||et.fakeElement||(lt=et.json.id,nt.registerInstance(lt,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ee(t)},setPreviousItem(t,e){let r=_-t;r<0&&(r="ring"===e?rr(r,o.length):0),ee(r)},setNextItem(t,e){let r=_+t;r>o.length-1&&(r="ring"===e?rr(r,o.length):o.length-1),ee(r)},scrollToStart(){ee(0)},scrollToEnd(){ee(o.length-1)}}))),xt={"height-parent":"match_parent"===(null==E?void 0:E.type)?"yes":""},B(),j(),U(),W(),D(),H(),J(),G(),Z(),Y(),X(),ct?"":`${R(oe,"Outer").$$render(t,{cls:Ft("tabs",ir,xt),componentContext:et,layoutParams:rt,customActions:"tabs",parentOf:a,parentOfSimpleMode:!0,replaceItems:function(t){et.json.items&&(et=Object.assign(Object.assign({},et),{json:Object.assign(Object.assign({},et.json),{items:et.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(ir.tabs__list,!0)+" "+I(z?ot:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":Jt?Dt(Jt,V):"","--divkit-tabs-font-size":dt(kt),"--divkit-tabs-paddings":Ct,"--divkit-tabs-line-height":jt,"--divkit-tabs-letter-spacing":At,"--divkit-tabs-active-font-weight":yt||"","--divkit-tabs-inactive-font-weight":bt||"","--divkit-tabs-active-font-family":St||"","--divkit-tabs-inactive-font-family":It||"","--divkit-tabs-active-text-color":Tt,"--divkit-tabs-inactive-text-color":Nt,"--divkit-tabs-active-background-color":zt,"--divkit-tabs-inactive-background-color":Rt,"--divkit-tabs-border-radius":Vt,"--divkit-tabs-items-spacing":Lt?pt(10*Lt/kt):""})}${L("this",ft,0)}>${N(C,(e=>{let r=e.index,n=r===_;return` ${R(Gt,"Actionable").$$render(t,{componentContext:et,cls:Ft("tabs__item",ir,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!et.fakeElement?[e.title_click_action].filter(Wt):[],attrs:{id:`${it}-tab-${r}`,"aria-controls":`${it}-panel-${r}`,role:"tab",tabindex:n&&!et.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:et.fakeElement?null:t=>function(t,e){return _===e||(ee(e),!1)}(0,r)},{},{default:()=>`${I(e.title)}`})}`}))}</div> ${P?`<div${L("class",ir.tabs__separator,0)}${L("style",ut(x),0)}></div>`:""} <div class="${I(ir.tabs__panels,!0)+" "+I(z?ot:"",!0)}"${L("this",ht,0)}><div${L("class",Ft("tabs__swiper",ir,{inited:Zt,animated:Xt}),0)}${L("this",mt,0)}>${N(C,(e=>{let r=e.index,n=Qt[r];return` <div${L("class",Ft("tabs__panel",ir,{visible:Kt[r]}),0)} role="tabpanel" id="${I(it,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(it,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${n?`${R(En,"Unknown").$$render(t,{componentContext:n,layoutParams:$t},{},{})}`:""} </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)}}function dr(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function pr(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...pr(t))})):e.push(t),e}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 vr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},gr=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 j,A,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===(A=null===(j=S.offset)||void 0===j?void 0:j.x)||void 0===A?void 0:A.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",vr,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${R(En,"Unknown").$$render(t,{componentContext:o},{},{})}</div>`}));function fr(t){return"change_bounds"===t.type?t:"set"===t.type?fr(t.items[0]):null}const hr=W(((t,e,r,n)=>{let o,i,a,s,l,c,{componentContext:u}=e,{layoutParams:d}=e;const p=f(at),h=f(Vt);let m,y,b,_,w=!1,x=new Map,k=new Set,E=null,C=[],j=[],A=[],F=[],V=!1;function D(t){_=(null==t?void 0:t.div)?u.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}function S(t,e,r){let{json:n,parentComponentContext:o,transitions:i,node:a}=e;n=u.getJsonWithVars(n),i=u.getJsonWithVars(i);const s=pr(i),l=a.getBoundingClientRect(),c=Object.assign(Object.assign({},n),{margins:void 0,alpha:(d=s,d.some((t=>"fade"===t.type))?void 0:n.alpha)});var d;return{json:c,componentContextCopy:o.produceChildContext(c,{fake:!0}),elementBbox:l,rootBbox:t,transitions:s,alpha:n.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node}}async function O(t){if(b===t)return;p.setRunning("stateChange",!0);const e=new Set(k);C.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),C=[];let r=[];if(m){const t=m.getBoundingClientRect();r=A.map((e=>S(t,e,"out")))}F.forEach((t=>{x.set(t.id,t.node.getBoundingClientRect())})),j=[],A=[],F=[];const n=l.find((e=>e.state_id===t))||null;if(n?(b=t,null==s||s.setValue(b),D(n)):u.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!m)return;const o=m.getBoundingClientRect();let i=j.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>S(o,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||k.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const a=r.concat(i),c=a.reduce(((t,e)=>Math.max(t,dr(e.transitions))),0),d=F.filter((t=>x.has(t.id))).map((t=>{const e=Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}});return{json:e,componentContextCopy:t.parentComponentContext.produceChildContext(e,{fake:!0}),rootBbox:o,beforeBbox:x.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:u.getJsonWithVars(fr(t.transitions)),resolvePromise:t.resolvePromise}}));C=[...a.map((t=>Object.assign(Object.assign({},t),{maxDuration:c}))),...d],x.clear(),p.setRunning("stateChange",!1)}return g(Vt,{registerInstance(t,e){E||(E=new Map),E.has(t)?u.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):E.set(t,e)},unregisterInstance(t){null==E||E.delete(t)},runVisibilityTransition(t,e,r,n,o){if(!m)return Promise.resolve();const i=S(m.getBoundingClientRect(),{json:t,parentComponentContext:e,transitions:r,node:n},o),a=dr(i.transitions),s=Object.assign(Object.assign({},i),{maxDuration:a});return C=[...C.filter((t=>t.node!==i.node)),s],new Promise((t=>{s.resolvePromise=t}))},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 A.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 F.push(i),new Promise((t=>{i.resolvePromise=t}))},hasTransitionChange:t=>!!t&&x.has(t),registerChild(t){k.add(t)},unregisterChild(t){k.delete(t)}}),v((()=>{y&&h.unregisterInstance(y)})),void 0===e.componentContext&&r.componentContext&&void 0!==u&&r.componentContext(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),o=u.json.div_id||u.json.id,i=u.getJsonWithVars(u.json.default_state_id),a=u.json.state_id_variable,s=a?u.getVariable(a,"string"):null,u.json&&(V=!1),o?w=!1:(w=!0,u.logError(st(new Error('Missing "id" prop for div "state"')))),u.json&&(k=new Set),l=u.json.states||[],c=l.map((t=>t.div)),(null==l?void 0:l.length)?w=!1:(w=!0,u.logError(st(new Error('Empty "states" prop for div "state"')))),u.json&&(y&&(h.unregisterInstance(y),y=void 0),o&&!(null==u?void 0:u.fakeElement)&&(y=o,h.registerInstance(o,{setState:O,getChild:function(t){if(E&&E.has(t))return E.get(t);u.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!V&&function(t){if(!V&&(V=!0,t.length)){const e=(null==s?void 0:s.getValue())||i;if(e){b=e;const r=t.find((t=>t.state_id===b))||null;D(r),r||u.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:b}}))}else{const e=t[0];b=e.state_id,D(e)}s&&(s.setValue(b),s.subscribe((t=>{O(t)})))}}(l),w?"":`${R(oe,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:u,layoutParams:d,parentOf:c,parentOfSimpleMode:!0,replaceItems:function(t){const e=u.json.states;e&&(l=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]}))),u.json=Object.assign(Object.assign({},u.json),{states:l}),b&&D(l.find((t=>t.state_id===b))||null))}},{},{default:()=>`${_?`${R(En,"Unknown").$$render(t,{componentContext:_},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",m,0)}>${N(C,(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(En,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${L("class",lr,0)}><div${L("class",cr,0)}>${R(En,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})} ${null!=u&&u.tooltips?`${N(u.tooltips,(e=>`${R(gr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:u},{},{})}`))}`:""}`})),mr=hr,yr={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"},br=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O=i,P=i,T=i,M=i,z=i,B=i;var U,W,H,q,J,G,Z,Y,X,Q;let{componentContext:K}=e,{layoutParams:tt}=e;const et=f(at);E=l(et.direction,(t=>k=t));const rt=et.genId("pager"),nt=et.getCustomization("pagerLeftClass"),it=et.getCustomization("pagerRightClass");j=l(et.isDesktop,(t=>C=t)),er((function(){if(!vt)return;const t=function(){const t=Array.from(ct.children),e=ct.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===yt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:gt}();t!==gt&&(gt=t)}),50);let lt,ct,vt=!1,gt=0,ft=0,ht=!1,yt="horizontal",bt="",_t="",wt="";function $t(t,e="smooth"){const r="horizontal"===yt,n=ct.children[t],o=r?"offsetLeft":"offsetTop",i=r?"left":"top";ct.scroll({[i]:n[o],behavior:e}),gt=t}v((()=>{vt=!1,lt&&(et.unregisterInstance(lt),lt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==K&&r.componentContext(K),void 0===e.layoutParams&&r.layoutParams&&void 0!==tt&&r.layoutParams(tt),K.json&&(_t=""),o=K.getDerivedFromVars(K.json.layout_mode),P(),P=l(o,(t=>A=t)),a=K.getDerivedFromVars(K.json.orientation),z(),z=l(a,(t=>D=t)),s=K.getDerivedFromVars(K.json.item_spacing),M(),M=l(s,(t=>V=t)),u=K.getDerivedFromVars(K.json.paddings),T(),T=l(u,(t=>F=t)),d=K.getDerivedFromVars(K.json.restrict_parent_scroll),B(),B=l(d,(t=>S=t)),p=(Array.isArray(K.json.items)&&K.json.items||[]).map(((t,e)=>K.produceChildContext(t,{path:e}))),A?"percentage"!==A.type&&"fixed"!==A.type?(ht=!0,K.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ht=!1:(ht=!0,K.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),yt=Me(D,yt);{const t=null==V?void 0:V.value;t&&Ot(t)&&(bt=dt(t||0))}if(_t=Pt(F,k,_t),g="horizontal"===yt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==A?void 0:A.type)){const t=pt("horizontal"===yt?(("ltr"===k?null===(U=K.json.paddings)||void 0===U?void 0:U.start:null===(W=K.json.paddings)||void 0===W?void 0:W.end)||(null===(H=K.json.paddings)||void 0===H?void 0:H.left)||0)+(("ltr"===k?null===(q=K.json.paddings)||void 0===q?void 0:q.end:null===(J=K.json.paddings)||void 0===J?void 0:J.start)||(null===(G=K.json.paddings)||void 0===G?void 0:G.right)||0):((null===(Z=K.json.paddings)||void 0===Z?void 0:Z.top)||0)+((null===(Y=K.json.paddings)||void 0===Y?void 0:Y.bottom)||0)),e=null===(X=A.neighbour_page_width)||void 0===X?void 0:X.value;wt=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${bt})`:"100%"}else if("percentage"===(null==A?void 0:A.type)){const t=null===(Q=A.page_width)||void 0===Q?void 0:Q.value;wt=`${Number(t)}%`}return h={"grid-gap":bt,padding:_t,[g]:wt},m={orientation:yt},y=ht,b=C&&vt&&!y,_="ltr"===k?gt>0:gt+1<p.length,w="ltr"===k?gt+1<p.length:gt>0,$=et.getStore("pagers"),O(),O=l($,(t=>x=t)),function(t,e){const r=K.json.id;if(r){const n=new Map(x);c($,x=n.set(r,{instId:rt,size:t,currentItem:e,scrollToPagerItem:$t}),x)}}(p.length,gt),function(t){var e;if(t===ft)return;ft=t;const r=K.getJsonWithVars(null===(e=p[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&K.execAnyActions(r)}(gt),K.json&&(lt&&(et.unregisterInstance(lt),lt=void 0),K.json.id&&!K.fakeElement&&(lt=K.json.id,et.registerInstance(lt,{setCurrentItem(t){if(t<0||t>p.length-1)throw new Error('Item is out of range in "set-current-item" action');$t(t)},setPreviousItem:function(t,e){let r=gt-t;r<0&&(r="ring"===e?rr(r,p.length):0),$t(r)},setNextItem:function(t,e){let r=gt+t;r>p.length-1&&(r="ring"===e?rr(r,p.length):p.length-1),$t(r)},scrollToStart(){$t(0)},scrollToEnd(){$t(p.length-1)}}))),O(),E(),j(),P(),T(),M(),z(),B(),y?"":`${R(oe,"Outer").$$render(t,{cls:Ft("pager",yr,m),componentContext:K,layoutParams:tt,customPaddings:!0,parentOf:p.map((t=>t.json)),replaceItems:function(t){K=Object.assign(Object.assign({},K),{json:Object.assign(Object.assign({},K.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(yr.pager__items,!0)+" "+I(S?ot:"",!0)}"${L("style",ut(h),0)}${L("this",ct,0)}>${N(p,(e=>`<div${L("class",yr.pager__item,0)}>${R(En,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${_&&b?` <div${L("class",nt||`${yr.pager__arrow} ${Ye} ${Qe}`,0)}>${nt?"":`<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",yr["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>`:""} ${w&&b?` <div${L("class",it||`${yr.pager__arrow} ${Ye} ${Ke}`,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",yr["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>`:""}`})}`})),_r=br,wr={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"},$r=["rounded_rectangle","circle"],xr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,j,A,F=i,V=i,D=i,S=i,O=i,P=i,T=i,M=i,z=i;var B,U;let{componentContext:W}=e,{layoutParams:H}=e;const J=f(at);y=l(J.direction,(t=>m=t));let G,Z,Y,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},K="default",et=15,rt=10,nt=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==W&&r.componentContext(W),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),W.json&&(K="default",et=15,rt=10,nt=5,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"}),o=W.getDerivedFromVars(W.json.shape),P(),P=l(o,(t=>E=t)),a=W.getDerivedFromVars(W.json.active_item_color),S(),S=l(a,(t=>x=t)),s=W.getDerivedFromVars(W.json.inactive_item_color),O(),O=l(s,(t=>k=t)),c=W.getDerivedFromVars(W.json.active_item_size),T(),T=l(c,(t=>C=t)),u=W.getDerivedFromVars(W.json.active_shape),z(),z=l(u,(t=>A=t)),d=W.getDerivedFromVars(W.json.inactive_shape),M(),M=l(d,(t=>j=t)),p=W.getDerivedFromVars(W.json.space_between_centers),V(),V=l(p,(t=>_=t)),v=W.getDerivedFromVars(W.json.items_placement),D(),D=l(v,(t=>w=t)),A&&(X=xe({type:"shape_drawable",shape:A},$r,X)),j&&(Q=xe({type:"shape_drawable",shape:j},$r,Q)),!A&&!j&&E){const t=ae(C,1.3);Q=xe({type:"shape_drawable",shape:E,color:Q.background},$r,Q),Q.background=gt(k,1,Q.background),X=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:X.background}),X.background=gt(x,1,X.background)}if(!w||"default"!==w.type&&"stretch"!==w.type)K="default",_&&(et=Et(_.value,et));else if(K=w.type,"default"===K)et=Et(null===(B=w.space_between_centers)||void 0===B?void 0:B.value,et);else if("stretch"===K){const t=w;rt=ae(t.max_visible_items,rt),nt=Et(null===(U=t.item_spacing)||void 0===U?void 0:U.value,nt)}return g=J.getStore("pagers"),F(),F=l(g,(t=>b=t)),async function(t){if(W.json.pager_id&&t.has(W.json.pager_id)&&(Y=t.get(W.json.pager_id),await $(),Z)){const t=Z.children[Y.currentItem];if(t){const e=t.offsetLeft;G.scroll({left:e-G.clientWidth/2,behavior:"smooth"})}}}(b),h={placement:K,direction:m},y(),F(),V(),D(),S(),O(),P(),T(),M(),z(),`${R(oe,"Outer").$$render(t,{cls:Ft("indicator",wr,h),componentContext:W,layoutParams:H},{},{default:()=>`<div${L("class",wr.indicator__scroller,0)}${L("this",G,0)}><div${L("class",wr.indicator__items,0)} role="tablist"${q({margin:"default"===K?`0 ${dt(Math.max(0,X.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Q.width),"--divkit-indicator-inactive-height":dt(Q.height),"--divkit-indicator-inactive-border-radius":dt(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":dt(X.width),"--divkit-indicator-active-height":dt(X.height),"--divkit-indicator-active-border-radius":dt(X.borderRadius),"--divkit-indicator-active-background":X.background||"","--divkit-indicator-active-box-shadow":X.boxShadow||"","--divkit-indicator-active-scale":X.width/Q.width,"--divkit-indicator-default-margin":"default"===K?`0 ${dt((et-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===K?dt(nt):"","--divkit-indicator-stretch-max-count":"stretch"===K?rt:"","--divkit-indicator-stretch-max-spacer":"stretch"===K?dt((rt-1)*nt):""})}${L("this",Z,0)}>${Y?`${N(Array(Y.size),((t,e)=>{let r=e===Y.currentItem;return` <div class="${I(Ft("indicator__item",wr,{active:r}),!0)+" "+I(tt,!0)}" role="tab" id="${I(Y.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(Y.instId,!0)+"-panel-"+I(e,!0)}"${L("aria-selected",r?"true":"false",0)}${L("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),kr=xr,Er={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 Cr(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 jr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Ar="function"==typeof BigInt;function Fr(t){return Ar?BigInt(t):Number(t)}const Vr=Fr("9223372036854775807"),Dr=Fr("-9223372036854775808");function Sr(t){const e=Fr(t);if(e>Vr||e<Dr)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 Or=Sr(0);function Pr(t){let e=t;return e<0&&(e=-e),e}function Ir(t){let e=0;return t>0?e=1:t<0&&(e=-1),Sr(e)}class Tr{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 Mr extends Tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Nr extends Tr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Sr(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Sr(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class zr extends Tr{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 Rr extends Tr{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 Br extends Tr{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 Ur extends Tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Wr extends Tr{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 Lr extends Tr{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 Hr={string:Mr,number:zr,integer:Nr,boolean:Rr,color:Br,url:Ur,dict:Wr,array:Lr};function qr(t,e,r){if(!(e in Hr))throw new Error("Unsupported variable type");return new Hr[e](t,r)}function Jr(){}function Gr(t){return t(this.value),Jr}function Zr(){throw new Error("Cannot change the value of this type of variable")}const Yr={string:class extends Mr{},number:class extends zr{},integer:class extends Nr{},boolean:class extends Rr{},color:class extends Br{},url:class extends Ur{},dict:class extends Wr{},array:class extends Lr{}};for(const t in Yr){const e=Yr[t];e.prototype.subscribe=Gr,e.prototype.set=Zr,e.prototype.setValue=Zr}const Xr={width:10,height:10,borderRadius:5,background:"#000"},Qr=["rounded_rectangle","circle"],Kr=["rounded_rectangle"];function tn(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 en=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,T,M,z,B,U,W,H,J,G,Z,Y,X,Q,K=i,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;var mt,yt,bt,_t;let{componentContext:wt}=e,{layoutParams:$t}=e;const xt=f(at),kt=f(qt);let Et,Ct;O=l(xt.direction,(t=>S=t));let jt,At,Vt,Dt=0,St=100,Pt=Xr,It=Pt,Tt=Xr,Mt=Xr,Nt=null,Rt=null,Bt=Vt,Ut="",Wt="",Lt=!1,Ht=jr(Y||0,Dt,St),Jt=jr(Z||0,Dt,St),Gt=!1;function Zt(){if(!Ct)return;const t=St-Dt,e=(null==Nt?void 0:Nt.width)||0,r=(null==Rt?void 0:Rt.width)||0;Math.max(e,r)*t>=(null==Ct?void 0:Ct.clientWidth)?Gt||(wt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}er(Zt,50),v((()=>{Et&&(xt.unregisterFocusable(Et),Et=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==wt&&r.componentContext(wt),void 0===e.layoutParams&&r.layoutParams&&void 0!==$t&&r.layoutParams($t),wt.json&&(Pt=Xr,It=Pt,Tt=Xr,Mt=Xr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Wt=""),o=wt.json.thumb_value_variable,a=wt.json.thumb_secondary_value_variable,s=o&&wt.getVariable(o,"integer")||qr("temp","integer",0),gt(),gt=l(s,(t=>Y=t)),c=a&&wt.getVariable(a,"integer")||qr("temp","integer",0),vt(),vt=l(c,(t=>Z=t)),u=wt.getDerivedFromVars(wt.json.min_value),ht(),ht=l(u,(t=>Q=t)),d=wt.getDerivedFromVars(wt.json.max_value),ft(),ft=l(d,(t=>X=t)),p=wt.getDerivedFromVars(wt.json.thumb_style),ut(),ut=l(p,(t=>G=t)),g=wt.getDerivedFromVars(wt.json.thumb_secondary_style),ct(),ct=l(g,(t=>J=t)),h=wt.getDerivedFromVars(wt.json.track_inactive_style),lt(),lt=l(h,(t=>H=t)),m=wt.getDerivedFromVars(wt.json.track_active_style),it(),it=l(m,(t=>W=t)),y=wt.getDerivedFromVars(wt.json.tick_mark_active_style),ot(),ot=l(y,(t=>U=t)),b=wt.getDerivedFromVars(wt.json.tick_mark_inactive_style),nt(),nt=l(b,(t=>B=t)),_=wt.getDerivedFromVars(wt.json.thumb_text_style),rt(),rt=l(_,(t=>z=t)),w=wt.getDerivedFromVars(wt.json.thumb_secondary_text_style),et(),et=l(w,(t=>M=t)),$=wt.getDerivedFromVars(wt.json.accessibility),tt(),tt=l($,(t=>T=t)),x=wt.getDerivedFromVars(wt.json.secondary_value_accessibility),K(),K=l(x,(t=>P=t)),Dt=zt(Q,Dt),St=zt(X,St),Zt();{const t=jr(Y||0,Dt,St);t!==Ht&&(Ht=t)}{const t=jr(Z||0,Dt,St);t!==Jt&&(Jt=t)}Pt=xe(G,Qr,Pt),It=xe(J,Qr,Pt),Tt=xe(H,Kr,Tt),Mt=xe(W,Kr,Mt);{let t=xe(U,Qr,Xr);t!==Xr&&(Nt=t)}Nt?(jt=a?tn(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!0):tn(Dt,Ht,Dt,St,!0),Zt()):jt=[];{let t=xe(B,Qr,Xr);t!==Xr&&(Rt=t)}Rt?(At=a?tn(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!1):tn(Ht+1,St+1,Dt,St,!0),Zt()):At=[],Vt=Cr(z,Vt),Bt=Cr(M,Vt),(null==T?void 0:T.description)?Ut=T.description:wt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==P?void 0:P.description)?Wt=P.description:a&&wt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(wt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===Xr?(wt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Mt===Xr?(wt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Tt===Xr&&(wt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Lt&&(Lt=t)}return k=dt(Math.max(...[Pt.width,It.width,0].filter(Ot))),E=dt(Math.max(...[Pt.height,It.height,0].filter(Ot))),C=(Ht-Dt)/(St-Dt),j=a?(Jt-Dt)/(St-Dt):void 0,A=void 0!==j?Math.abs(j-C):C,F=void 0!==j?Math.min(j,C):0,V={"--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===(mt=null==Vt?void 0:Vt.offset)||void 0===mt?void 0:mt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(bt=null==Bt?void 0:Bt.offset)||void 0===bt?void 0:bt.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.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":k,"--divkit-slider-max-thumb-height":E,"--divkit-slider-track-part":C,"--divkit-slider-track-secondary-part":j},D={direction:S},wt.json,O(),K(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),ut(),vt(),gt(),ft(),ht()," "+(Lt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("slider",Er,D),style:V,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:wt,layoutParams:$t},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,o,i,s,l;return`<div${L("class",Er["slider__tracks-wrapper"],0)}><div${L("class",Er["slider__tracks-inner"],0)}${L("this",Ct,0)}><div${L("class",Er.slider__track,0)}${q({height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> <div${L("class",Er["slider__active-track"],0)}${q({left:"ltr"===S?(100*F).toFixed(2)+"%":void 0,right:"ltr"===S?void 0:(100*F).toFixed(2)+"%",width:(100*A).toFixed(2)+"%",height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> ${N(jt,(t=>`<div class="${I(Er.slider__tick,!0)+" "+I(Er.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(At,(t=>`<div class="${I(Er.slider__tick,!0)+" "+I(Er.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${L("class",Er.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${L("class",Er["slider__thumb-text"],0)}><div${L("class",Er["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> ${a?`<div class="${I(Er.slider__thumb,!0)+" "+I(Er.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(Er["slider__thumb-text"],!0)+" "+I(Er["slider__thumb-text_secondary"],!0)}"><div${L("class",Er["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=Bt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(s=Bt)||void 0===s?void 0:s.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",Er.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)}> ${a?`<input type="range"${L("class",`${Er.slider__input} ${Er.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>`}})}`)})),rn={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 nn(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=nn(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 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{constructor(t){this.char=t}}class sn{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class ln{constructor(t){on(this,"filters",new Map),on(this,"destructedValue",[]),on(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 an)t+=r.char;else if(r instanceof sn)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 sn&&!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 sn(null,this.filters.get(e.key),e.placeholder):new an(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=nn(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 sn&&++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 sn&&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 sn&&(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 sn);)++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 sn&&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 sn&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof sn);)++e;return e}}class cn extends ln{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function un(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 dn extends ln{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),un(this,"currencyFormatter",new Intl.NumberFormat),un(this,"decimalSeparator","."),un(this,"localeDigits",{}),un(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=nn(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 pn(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 vn(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=pn(n);if(e<=o)return void vn(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 gn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),fn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url",password:"password"},hn=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,T,M,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,ot,it,lt,ct=i,vt=i,ft=i,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Ct=i,jt=i,At=i,Vt=i,Ot=i,Pt=i,It=i;var Tt;let{componentContext:Mt}=e,{layoutParams:Nt}=e;const zt=f(at);let Rt,Ut;W=l(zt.direction,(t=>U=t));let Wt,Lt,Ht,qt=null,Jt="",Gt="",Zt=!1,Xt="",Qt=12,Kt="",te="",ee="#000",re="",ne="start",ie="center",se="multi_line_text",ce="text",ue="",ve=null,ge="",fe="",he="";function me(t){Ut instanceof HTMLInputElement?Ut.selectionStart=Ut.selectionEnd=t:vn(Ut,t)}async function ye(){if(!Ut||!qt)return;qt.overrideRawValue(z),u.set(qt.rawValue),c(s,N=Jt=Gt=qt.value,N);const t=qt.cursorPosition;await $(),document.activeElement===Ut&&me(t)}var be;v((()=>{Rt&&(zt.unregisterFocusable(Rt),Rt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Mt&&r.componentContext(Mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Nt&&r.layoutParams(Nt),Mt.json&&(Xt="",Qt=12,Wt=void 0,Kt="",Lt=void 0,ee="#000",re="",ne="left",ie="center",se="multi_line_text",ce="text",Ht=void 0),o=Mt.json.text_variable,a=null===(Tt=Mt.json.mask)||void 0===Tt?void 0:Tt.raw_text_variable,s=o&&Mt.getVariable(o,"string")||qr("temp","string",""),ct(),ct=l(s,(t=>N=t)),u=a&&Mt.getVariable(a,"string")||qr("temp","string",""),vt(),vt=l(u,(t=>z=t)),d=Mt.getDerivedFromVars(Mt.json.hint_text),Pt(),Pt=l(d,(t=>it=t)),p=Mt.getDerivedFromVars(Mt.json.hint_color),Ot(),Ot=l(p,(t=>ot=t)),g=Mt.getDerivedFromVars(Mt.json.font_size),Vt(),Vt=l(g,(t=>nt=t)),h=Mt.getDerivedFromVars(Mt.json.font_weight),At(),At=l(h,(t=>rt=t)),m=Mt.getDerivedFromVars(Mt.json.font_family),jt(),jt=l(m,(t=>et=t)),y=Mt.getDerivedFromVars(Mt.json.line_height),Ct(),Ct=l(y,(t=>tt=t)),b=Mt.getDerivedFromVars(Mt.json.letter_spacing),kt(),kt=l(b,(t=>K=t)),_=Mt.getDerivedFromVars(Mt.json.text_color),xt(),xt=l(_,(t=>Q=t)),w=Mt.getDerivedFromVars(Mt.json.highlight_color),$t(),$t=l(w,(t=>X=t)),x=Mt.getDerivedFromVars(Mt.json.text_alignment_horizontal),wt(),wt=l(x,(t=>Y=t)),k=Mt.getDerivedFromVars(Mt.json.text_alignment_vertical),_t(),_t=l(k,(t=>Z=t)),E=Mt.getDerivedFromVars(Mt.json.keyboard_type),bt(),bt=l(E,(t=>G=t)),C=Mt.getDerivedFromVars(Mt.json.mask),yt(),yt=l(C,(t=>J=t)),j=Mt.getDerivedFromVars(Mt.json.max_visible_lines),mt(),mt=l(j,(t=>q=t)),A=Mt.getDerivedFromVars(Mt.json.paddings),ht(),ht=l(A,(t=>H=t)),F=Mt.getDerivedFromVars(Mt.json.accessibility),ft(),ft=l(F,(t=>B=t)),V=Mt.getDerivedFromVars(Mt.json.select_all_on_focus),It(),It=l(V,(t=>lt=t)),o?Zt=!1:(Zt=!0,Mt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(be=J)?void 0:be.type)?qt=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 cn(n,e)}return r||null}(be,Mt.logError,qt):"currency"===(null==be?void 0:be.type)&&(qt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new dn(t.locale,e)}(be,Mt.logError,qt)),qt&&ye(),qt||Jt===N||(Jt=Gt=N),qt&&qt.rawValue!==z&&ye(),D=it,Xt=gt(ot,1,Xt),Qt=ae(nt,Qt),Wt=le(rt,Wt),Kt=et&&"string"==typeof et?zt.typefaceProvider(et,{fontWeight:Wt||400}):"";{const t=tt;Yt(t)&&(Lt=t/Qt)}return St(K)&&(te=dt(K)),ee=gt(Q,1,ee),re=gt(X,1,re),ne=de(Y,U,ne),ie=pe(Z,ie),G&&G in fn&&(ce=fn[G],se=G),"currency"===(null==J?void 0:J.type)&&(ce=gn?"text":"tel",Ht="decimal"),S="multi_line_text"===se,ue=Yt(q)?`calc(${q*(Lt||1.25)*(Qt/10)+"em"} + ${pt(Et(null==H?void 0:H.top,0)+Et(null==H?void 0:H.bottom,0))})`:"",ve=Bt(H||void 0,ve),ge=ve?Dt({top:(Number(ve.top)||0)/Qt*10,right:(Number("ltr"===U?ve.end:ve.start)||Number(ve.right)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10,left:(Number("ltr"===U?ve.start:ve.end)||Number(ve.left)||0)/Qt*10},U):"",fe=ve?Dt({top:(Number(ve.top)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10},U):"",(null==B?void 0:B.description)?he=B.description:Mt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),O={"highlight-color":Boolean(re),multiline:S,"alignment-horizontal":ne,"alignment-vertical":ie},P={"--divkit-input-hint-color":Xt,"--divkit-input-highlight-color":re,"--divkit-input-line-height":Lt,"font-weight":Wt,"font-family":Kt,"letter-spacing":te,color:ee,"max-height":ue},T={"font-size":dt(Qt),padding:ge},M={"font-size":dt(Qt),padding:fe},Ut&&Mt.json&&(Rt&&(zt.unregisterFocusable(Rt),Rt=void 0),Mt.json.id&&!Mt.fakeElement&&(Rt=Mt.json.id,zt.registerFocusable(Rt,{focus(){Ut&&Ut.focus()}}))),ct(),vt(),ft(),W(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Ct(),jt(),At(),Vt(),Ot(),Pt(),It(),Zt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("input",rn,O),style:P,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Mt,layoutParams:Nt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return S?`<span${L("class",rn["input__scroll-wrapper"],0)}>${!Gt&&D?`<div${L("class",rn.input__placeholder,0)} aria-hidden="true"${L("style",ut(T),0)}>${I(D)}</div>`:""} <span${L("class",rn.input__aligner,0)} aria-hidden="true"${L("style",ut(M),0)}>​</span> <span${L("class",Ft("input__input",rn,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",he,0)}${L("style",ut(T),0)}${L("this",Ut,0)}>${n=Gt,void 0===n?"":n}</span></span>`:`<input${L("type",ce,0)}${L("inputmode",Ht,0)}${L("class",Ft("input__input",rn,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",he,0)}${L("style",ut(T),0)}${L("placeholder",D,0)}${L("value",Jt,0)}${L("this",Ut,0)}>`;var n}})}`})),mn={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"},yn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,T,M,z,B,U=i,W=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,K=i,{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);let nt;T=l(rt.direction,(t=>P=t));let ot,it,lt=!1,ct="",pt=null,vt="",ft="rgba(0,0,0,.45)",ht=12,mt="",yt="",bt="#000",_t="";v((()=>{nt&&(rt.unregisterFocusable(nt),nt=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),tt.json&&(pt=null,ft="rgba(0,0,0,.45)",ht=12,ot=void 0,mt="",it=void 0,yt="",bt="#000",_t=""),o=tt.json.value_variable,a=tt.json.options,s=Array.isArray(a)&&a.filter((t=>"string"==typeof t.value))||[],c=o&&tt.getVariable(o,"string")||qr("temp","string",""),Q(),Q=l(c,(t=>z=t)),u=tt.getDerivedFromVars(tt.json.paddings),X(),X=l(u,(t=>M=t)),d=tt.getDerivedFromVars(tt.json.hint_text),K(),K=l(d,(t=>B=t)),p=tt.getDerivedFromVars(tt.json.hint_color),Y(),Y=l(p,(t=>O=t)),g=tt.getDerivedFromVars(tt.json.font_size),Z(),Z=l(g,(t=>S=t)),h=tt.getDerivedFromVars(tt.json.font_weight),G(),G=l(h,(t=>D=t)),m=tt.getDerivedFromVars(tt.json.font_family),J(),J=l(m,(t=>V=t)),y=tt.getDerivedFromVars(tt.json.line_height),q(),q=l(y,(t=>F=t)),b=tt.getDerivedFromVars(tt.json.letter_spacing),H(),H=l(b,(t=>A=t)),_=tt.getDerivedFromVars(tt.json.text_color),W(),W=l(_,(t=>j=t)),w=tt.getDerivedFromVars(tt.json.accessibility),U(),U=l(w,(t=>C=t)),Array.isArray(s)&&s.length||tt.logError(st(new Error('Empty selection "items" in "select"'))),o?lt=!1:(lt=!0,tt.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=s.find((t=>t.value===z));t?ct=("string"==typeof t.text?t.text:t.value)||"":(ct="",z&&tt.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}ht=ae(S,ht),pt=Bt(M||void 0,pt),vt=pt?Dt({top:(Number(pt.top)||0)/ht*10,right:(Number("ltr"===P?pt.end:pt.start)||Number(pt.right)||0)/ht*10,bottom:(Number(pt.bottom)||0)/ht*10,left:(Number("ltr"===P?pt.start:pt.end)||Number(pt.left)||0)/ht*10},P):"",ft=gt(O,1,ft),ot=le(D,ot),mt=V&&"string"==typeof V?rt.typefaceProvider(V,{fontWeight:ot||400}):"";{const t=F;Yt(t)&&(it=t/ht)}return St(A)&&(yt=dt(A/ht*10)),bt=gt(j,1,bt),(null==C?void 0:C.description)?_t=C.description:tt.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),$={hint:!ct},x={"--divkit-input-hint-color":ft,"font-weight":ot,"font-family":mt,color:bt},k={padding:vt,"font-size":dt(ht),"line-height":it,"letter-spacing":yt},E={"font-size":dt(ht),"line-height":it,"letter-spacing":yt},tt.json,U(),W(),H(),q(),J(),G(),Z(),Y(),T(),X(),Q(),K(),lt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("select",mn,$),style:x,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:tt,layoutParams:et},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",mn["select__select-text"],0)}${L("style",ut(k),0)} aria-hidden="true"> ${I(ct||B||"​")}</span> <select${L("class",Ft("select__select",mn,{"has-custom-focus":t}),0)}${L("aria-label",_t,0)}${L("style",ut(E),0)}${L("this",undefined,0)}>${N(s,(t=>`<option${L("class",mn.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),bn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},_n=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C=i,j=i,A=i,F=i,V=i,D=i,S=i,{componentContext:O}=e,{layoutParams:P}=e;const I=f(at);let T,M,z,B,U=!1,W=!1,H=[],J=!1,G=!1,Z=!1,Y="fit",X="0";function Q(){const t=null==M?void 0:M.play();t&&t.catch((t=>{O.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}var K,tt;v((()=>{T&&(I.unregisterInstance(T),T=void 0),B&&(B(),B=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==O&&r.componentContext(O),void 0===e.layoutParams&&r.layoutParams&&void 0!==P&&r.layoutParams(P),O.json&&(J=!1,G=!1,Z=!1,z=void 0,Y="fit"),o=O.json.elapsed_time_variable,a=o&&O.getVariable(o,"integer")||qr("temp","integer",0),a&&(B&&B(),B=a.subscribe((function(t){W?W=!1:M&&(M.currentTime=Number(t)/1e3)}))),s=O.getDerivedFromVars(O.json.video_sources),S(),S=l(s,(t=>E=t)),c=O.getDerivedFromVars(O.json.repeatable),D(),D=l(c,(t=>k=t)),u=O.getDerivedFromVars(O.json.autostart),C(),C=l(u,(t=>b=t)),d=O.getDerivedFromVars(O.json.muted),V(),V=l(d,(t=>x=t)),p=O.getDerivedFromVars(O.json.preview),F(),F=l(p,(t=>$=t)),g=O.getDerivedFromVars(O.json.scale),A(),A=l(g,(t=>w=t)),h=O.getDerivedFromVars(O.json.aspect),j(),j=l(h,(t=>_=t)),K=E,tt=H,H=Array.isArray(K)&&K.length?K.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})):tt,H.length?U=!1:(U=!0,O.logError(st(new Error('Missing "video_sources" in "video"')))),J=ve(k,J),G=ve(b,G),Z=ve(x,Z),z="string"==typeof $?Re($):z,Y=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(w)||Y;{const t=null==_?void 0:_.ratio;X=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return O.json&&(T&&(I.unregisterInstance(T),T=void 0),!O.json.id||U||O.fakeElement||(T=O.json.id,I.registerInstance(T,{pause:function(){null==M||M.pause()},start:Q}))),O.json&&b&&M&&Q(),m={aspect:"0"!==X},y={"object-fit":Y},C(),j(),A(),F(),V(),D(),S(),U?"":`${R(oe,"Outer").$$render(t,{cls:Ft("video",bn,m),customActions:"video",componentContext:O,layoutParams:P},{},{default:()=>m.aspect?`<div${L("class",bn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${X}%`})}><video${L("class",bn.video__video,0)}${L("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${L("poster",z,0)}${L("this",M,0)}>${N(H,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",bn.video__video,0)}${L("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${L("poster",z,0)}${L("this",M,0)}>${N(H,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),wn=_n,$n=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([M(s.json.custom_props||{})],{})}${L("this",undefined,0)}>${V(e)?"":`${d?`<template${S([M(p)],{})}> ${d}</template>`:""} ${!v&&o?`${N(i,(e=>`${R(En,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),xn=$n,kn={};kn.text=he,kn.container=Ie,kn.separator=Ne,kn.image=Ue,kn.gif=Ue,kn.grid=Ge,kn.gallery=or,kn.tabs=sr,kn.state=mr,kn.pager=_r,kn.indicator=kr,kn.slider=en,kn.input=hn,kn.select=yn,kn.video=wn,kn.custom=xn;const En=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)&&kn[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},{},{})}`:""})),Cn=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 jn(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 An(){}function Fn(t){return{subscribe:e=>(e(t),An)}}function Vn(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Dn(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Sn(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 On(t){try{return Sr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Pn(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function In(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,In.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function Tn(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}Fn(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(In,Error),In.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=Tn("",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+" | "+Tn("",o.column-1," ")+Tn("",u,"^")}else e+="\n at "+a}return e},In.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 Mn=Number.MAX_VALUE,Nn=Number.MIN_VALUE,zn="string",Rn="integer",Bn="number",Un="boolean",Wn="color",Ln="url",Hn="datetime",qn="dict",Jn="array";function Gn(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=>{Gn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Gn(t.left,e),Gn(t.right,e);break;case"UnaryExpression":Gn(t.argument,e);break;case"ConditionalExpression":Gn(t.test,e),Gn(t.consequent,e),Gn(t.alternate,e);break;case"TryExpression":Gn(t.test,e),Gn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Gn(t,e)}))}}function Zn(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Yn(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Xn(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 Yn(t.value);if("color"===t.type)return io(oo(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 Qn(t){let e=Xn(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Kn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function to(t,e){if(Ar)return Sr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function eo(t,e){if(e<Dr||e>Vr)throw new Error("Integer overflow.");!Ar&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function ro(t){const e=[];return Gn(t,{Variable(t){e.push(t.id.name)}}),e}function no(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function oo(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function io(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 ao(t){return io(oo(t))}function so(t){return{type:Bn,value:Number(t.value)}}const lo=new Map,co=new Map;function uo(t,e,r){const n={args:e,cb:r},o=lo.get(t)||[];lo.has(t)||lo.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");co.set(i,n)}function po(t,e){let r=t.args.length,n=t.args.length,o=0;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,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!==Bn||e[r].type!==Rn){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){return{type:zn,value:Xn(e)}}function go(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:Bn,value:r}}function fo(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=ao(i)),{type:n,value:i}}function ho(t,e,r){return fo(t,e,r,r.type)}function mo(t,e,r){return fo(t,e,r,"color")}function yo(t,e,r){return fo(t,e,r,"url")}const bo=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Rn,value:Sr(n)}},_o=bo("getUTCFullYear"),wo=bo("getUTCMonth"),$o=bo("getUTCDate"),xo=bo("getUTCDay"),ko=bo("getUTCHours"),Eo=bo("getUTCMinutes"),Co=bo("getUTCSeconds"),jo=bo("getUTCMilliseconds");function Ao(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===zn?e.value:Xn(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 Fo(t,e,r,n){const o=Ao(t,e,r,n);return{type:zn,value:o+Xn(e)}}function Vo(t,e,r,n){const o=Ao(t,e,r,n);return{type:zn,value:Xn(e)+o}}function Do(t){return(e,r)=>{const n=oo(r.value);return{type:Bn,value:n[t]/255}}}function So(t){return(e,r,n)=>{const o=oo(r.value);return o[t]=255*n.value,{type:Wn,value:io(o)}}}const Oo=Do("a"),Po=Do("r"),Io=Do("g"),To=Do("b"),Mo=So("a"),No=So("r"),zo=So("g"),Ro=So("b");function Bo(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=Sr(e.value)/Sr(r);return eo(t,o),"number"==typeof o&&(o=Math.floor(o)),n&&(o=Sr(o)%Sr(n)),{type:Rn,value:o}}const Uo=36e5;function Wo(t,e){return(r,n,...o)=>{let i=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}(n.value,o.map((t=>t.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){eo(r,i);try{i=Sr(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=ao(i)),{type:e,value:i}}}function Lo(t,e){return(r,n,o,...i)=>{try{return t(r,o,...i)}catch(t){let r=n.value;return"color"===e&&(r=ao(r)),{type:e,value:r}}}}const Ho=Wo("string","string"),qo=Wo("number","number"),Jo=Wo("number","integer"),Go=Wo("boolean","boolean"),Zo=Wo("string","color"),Yo=Wo("string","url"),Xo=Wo("array","array"),Qo=Wo("object","dict"),Ko=Lo(Ho,"string"),ti=Lo(qo,"number"),ei=Lo(Jo,"integer"),ri=Lo(Go,"boolean"),ni=Lo(Zo,"color"),oi=Lo(Yo,"url");function ii(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){eo(r,i);try{i=Sr(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=ao(i)),{type:e,value:i}}}function ai(t,e){return(r,n,o,i)=>{try{return t(r,n,o)}catch(t){let r=i.value;return"color"===e&&(r=ao(r)),{type:e,value:r}}}}const si=ii("string","string"),li=ii("number","number"),ci=ii("number","integer"),ui=ii("boolean","boolean"),di=ii("string","color"),pi=ii("string","url"),vi=ii("array","array"),gi=ii("object","dict"),fi=ai(si,"string"),hi=ai(li,"number"),mi=ai(ci,"integer"),yi=ai(ui,"boolean"),bi=ai(di,"color"),_i=ai(pi,"url");function wi(t){return t.map(Qn).join(", ")}uo("toString",[Rn],vo),uo("toString",[Bn],vo),uo("toString",[Un],vo),uo("toString",[Wn],vo),uo("toString",[Ln],vo),uo("toNumber",[Rn],go),uo("toNumber",[zn],go),uo("toInteger",[Bn],(function(t,e){if(e.value>Vr||e.value<Dr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Rn,value:Sr(r)}})),uo("toInteger",[zn],(function(t,e){let r;try{r=Sr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:Rn,value:r}})),uo("toInteger",[Un],(function(t,e){return{type:Rn,value:Sr(e.value?1:0)}})),uo("toBoolean",[Rn],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Un,value:r}})),uo("toBoolean",[zn],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Un,value:"true"===e.value?1:0}})),uo("toColor",[zn],(function(t,e){return{type:Wn,value:ao(e.value)}})),uo("toUrl",[zn],(function(t,e){return{type:Ln,value:e.value}})),uo("encodeUri",[zn],(function(t,e){try{return{type:zn,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),uo("decodeUri",[zn],(function(t,e){try{return{type:zn,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),uo("getIntegerValue",[zn,Rn],ho),uo("getNumberValue",[zn,Bn],ho),uo("getBooleanValue",[zn,Un],ho),uo("getStringValue",[zn,zn],ho),uo("getColorValue",[zn,Wn],mo),uo("getColorValue",[zn,zn],mo),uo("getUrlValue",[zn,Ln],yo),uo("getUrlValue",[zn,zn],yo),uo("parseUnixTime",[Rn],(function(t,e){return{type:Hn,value:new Date(1e3*Number(e.value))}})),uo("nowLocal",[],(function(){return{type:Hn,value:new Date}})),uo("addMillis",[Hn,Rn],(function(t,e,r){return{type:Hn,value:new Date(e.value.getTime()+Number(r.value))}})),uo("setYear",[Hn,Rn],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Hn,value:n}})),uo("setMonth",[Hn,Rn],(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:Hn,value:o}})),uo("setDay",[Hn,Rn],(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 ${Xn(e)}.`);return n.setUTCDate(-1===o?0:o),{type:Hn,value:n}})),uo("setHours",[Hn,Rn],(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:Hn,value:o}})),uo("setMinutes",[Hn,Rn],(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:Hn,value:o}})),uo("setSeconds",[Hn,Rn],(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:Hn,value:o}})),uo("setMillis",[Hn,Rn],(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:Hn,value:o}})),uo("getYear",[Hn],_o),uo("getMonth",[Hn],wo),uo("getDay",[Hn],$o),uo("getDayOfWeek",[Hn],xo),uo("getHours",[Hn],ko),uo("getMinutes",[Hn],Eo),uo("getSeconds",[Hn],Co),uo("getMillis",[Hn],jo),uo("getIntervalSeconds",[Rn],(function(t,e){return Bo(t,e,1e3,60)})),uo("getIntervalTotalSeconds",[Rn],(function(t,e){return Bo(t,e,1e3)})),uo("getIntervalMinutes",[Rn],(function(t,e){return Bo(t,e,6e4,60)})),uo("getIntervalTotalMinutes",[Rn],(function(t,e){return Bo(t,e,6e4)})),uo("getIntervalHours",[Rn],(function(t,e){return Bo(t,e,Uo,24)})),uo("getIntervalTotalHours",[Rn],(function(t,e){return Bo(t,e,Uo)})),uo("getIntervalTotalDays",[Rn],(function(t,e){return Bo(t,e,864e5)})),uo("getIntervalTotalWeeks",[Rn],(function(t,e){return Bo(t,e,6048e5)})),uo("len",[zn],(function(t,e){return{type:Rn,value:Sr(e.value.length)}})),uo("contains",[zn,zn],(function(t,e,r){return{type:Un,value:e.value.includes(r.value)?1:0}})),uo("substring",[zn,Rn,Rn],(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:zn,value:e.value.substring(Number(r.value),Number(n.value))}})),uo("replaceAll",[zn,zn,zn],(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:zn,value:o}})),uo("index",[zn,zn],(function(t,e,r){return{type:Rn,value:Sr(e.value.indexOf(r.value))}})),uo("lastIndex",[zn,zn],(function(t,e,r){return{type:Rn,value:Sr(e.value.lastIndexOf(r.value))}})),uo("trim",[zn],(function(t,e){return{type:zn,value:e.value.trim()}})),uo("trimLeft",[zn],(function(t,e){return{type:zn,value:e.value.replace(/^\s+/,"")}})),uo("trimRight",[zn],(function(t,e){return{type:zn,value:e.value.replace(/\s+$/,"")}})),uo("toUpperCase",[zn],(function(t,e){return{type:zn,value:e.value.toUpperCase()}})),uo("toLowerCase",[zn],(function(t,e){return{type:zn,value:e.value.toLowerCase()}})),uo("padStart",[zn,Rn,zn],Fo),uo("padStart",[Rn,Rn,zn],Fo),uo("padEnd",[zn,Rn,zn],Vo),uo("padEnd",[Rn,Rn,zn],Vo),uo("testRegex",[zn,zn],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Un,value:n.test(e.value)?1:0}})),uo("div",[Rn,Rn],(function(t,e,r){if(r.value===Or)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=to(0,n),eo(t,n),{type:Rn,value:n}})),uo("div",[Bn,Bn],(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:Bn,value:n}})),uo("mod",[Rn,Rn],(function(t,e,r){if(r.value===Or)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=to(0,n),eo(t,n),{type:Rn,value:n}})),uo("mod",[Bn,Bn],(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:Bn,value:n}})),uo("mul",[{type:Rn,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Or;for(let n=1;n<e.length;++n)r*=e[n].value,r=to(0,r),eo(t,r);return{type:Rn,value:r}})),uo("mul",[{type:Bn,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:Bn,value:r}})),uo("sub",[{type:Rn,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Or;for(let n=1;n<e.length;++n)r-=e[n].value,r=to(0,r),eo(t,r);return{type:Rn,value:r}})),uo("sub",[{type:Bn,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:Bn,value:r}})),uo("sum",[{type:Rn,isVararg:!0}],(function(t,...e){let r=Or;for(let n=0;n<e.length;++n)r+=e[n].value,r=to(0,r),eo(t,r);return{type:Rn,value:r}})),uo("sum",[{type:Bn,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Bn,value:r}})),uo("abs",[Rn],(function(t,e){const r=Pr(e.value);return eo(t,r),{type:e.type,value:r}})),uo("abs",[Bn],(function(t,e){const r=Math.abs(e.value);return{type:Bn,value:r}})),uo("max",[{type:Rn,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:Rn,value:r}})),uo("max",[{type:Bn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Bn,value:Math.max(...e.map((t=>t.value)))}})),uo("min",[{type:Rn,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:Rn,value:r}})),uo("min",[{type:Bn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Bn,value:Math.min(...e.map((t=>t.value)))}})),uo("maxNumber",[],(function(){return{type:Bn,value:Mn}})),uo("minNumber",[],(function(){return{type:Bn,value:Nn}})),uo("maxInteger",[],(function(t){return eo(t,Vr),{type:Rn,value:Vr}})),uo("minInteger",[],(function(t){return eo(t,Dr),{type:Rn,value:Dr}})),uo("round",[Bn],(function(t,e){const r=Math.sign(e.value);return{type:Bn,value:r*Math.round(Math.abs(e.value))}})),uo("floor",[Bn],(function(t,e){return{type:Bn,value:Math.floor(e.value)}})),uo("ceil",[Bn],(function(t,e){return{type:Bn,value:Math.ceil(e.value)}})),uo("signum",[Rn],(function(t,e){return{type:Rn,value:Ir(e.value)}})),uo("signum",[Bn],(function(t,e){return{type:Bn,value:Math.sign(e.value)}})),uo("copySign",[Rn,Rn],(function(t,e,r){let n;if(r.value===Or)n=e.value;else if(e.value===Or)n=Sr(0);else{const t=Ir(r.value);n=Pr(e.value)*t}return eo(t,n),{type:Rn,value:n}})),uo("copySign",[Bn,Bn],(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:Bn,value:o}})),uo("getColorAlpha",[zn],Oo),uo("getColorAlpha",[Wn],Oo),uo("getColorRed",[zn],Po),uo("getColorRed",[Wn],Po),uo("getColorGreen",[zn],Io),uo("getColorGreen",[Wn],Io),uo("getColorBlue",[zn],To),uo("getColorBlue",[Wn],To),uo("setColorAlpha",[zn,Bn],Mo),uo("setColorAlpha",[Wn,Bn],Mo),uo("setColorRed",[zn,Bn],No),uo("setColorRed",[Wn,Bn],No),uo("setColorGreen",[zn,Bn],zo),uo("setColorGreen",[Wn,Bn],zo),uo("setColorBlue",[zn,Bn],Ro),uo("setColorBlue",[Wn,Bn],Ro),uo("rgb",[Bn,Bn,Bn],(function(t,e,r,n){const o={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Wn,value:io(o)}})),uo("argb",[Bn,Bn,Bn,Bn],(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:Wn,value:io(i)}})),uo("getDictString",[qn,{type:zn,isVararg:!0}],Ho),uo("getStringFromDict",[qn,{type:zn,isVararg:!0}],Ho),uo("getDictNumber",[qn,{type:zn,isVararg:!0}],qo),uo("getNumberFromDict",[qn,{type:zn,isVararg:!0}],qo),uo("getDictInteger",[qn,{type:zn,isVararg:!0}],Jo),uo("getIntegerFromDict",[qn,{type:zn,isVararg:!0}],Jo),uo("getDictBoolean",[qn,{type:zn,isVararg:!0}],Go),uo("getBooleanFromDict",[qn,{type:zn,isVararg:!0}],Go),uo("getDictColor",[qn,{type:zn,isVararg:!0}],Zo),uo("getColorFromDict",[qn,{type:zn,isVararg:!0}],Zo),uo("getDictUrl",[qn,{type:zn,isVararg:!0}],Yo),uo("getUrlFromDict",[qn,{type:zn,isVararg:!0}],Yo),uo("getDictOptString",[zn,qn,{type:zn,isVararg:!0}],Ko),uo("getOptStringFromDict",[zn,qn,{type:zn,isVararg:!0}],Ko),uo("getDictOptNumber",[Bn,qn,{type:zn,isVararg:!0}],ti),uo("getOptNumberFromDict",[Bn,qn,{type:zn,isVararg:!0}],ti),uo("getDictOptInteger",[Rn,qn,{type:zn,isVararg:!0}],ei),uo("getOptIntegerFromDict",[Rn,qn,{type:zn,isVararg:!0}],ei),uo("getDictOptBoolean",[Un,qn,{type:zn,isVararg:!0}],ri),uo("getOptBooleanFromDict",[Un,qn,{type:zn,isVararg:!0}],ri),uo("getDictOptColor",[Wn,qn,{type:zn,isVararg:!0}],ni),uo("getOptColorFromDict",[Wn,qn,{type:zn,isVararg:!0}],ni),uo("getDictOptColor",[zn,qn,{type:zn,isVararg:!0}],ni),uo("getOptColorFromDict",[zn,qn,{type:zn,isVararg:!0}],ni),uo("getDictOptUrl",[zn,qn,{type:zn,isVararg:!0}],oi),uo("getOptUrlFromDict",[zn,qn,{type:zn,isVararg:!0}],oi),uo("getDictOptUrl",[Ln,qn,{type:zn,isVararg:!0}],oi),uo("getOptUrlFromDict",[Ln,qn,{type:zn,isVararg:!0}],oi),uo("getDictFromDict",[qn,{type:zn,isVararg:!0}],Qo),uo("getArrayFromDict",[qn,{type:zn,isVararg:!0}],Xo),uo("getOptArrayFromDict",[qn,{type:zn,isVararg:!0}],(function(t,e,...r){try{return Xo(t,e,...r)}catch(t){return{type:Jn,value:[]}}})),uo("getOptDictFromDict",[qn,{type:zn,isVararg:!0}],(function(t,e,...r){try{return Qo(t,e,...r)}catch(t){return{type:qn,value:{}}}})),uo("getArrayString",[Jn,Rn],si),uo("getStringFromArray",[Jn,Rn],si),uo("getArrayNumber",[Jn,Rn],li),uo("getNumberFromArray",[Jn,Rn],li),uo("getArrayInteger",[Jn,Rn],ci),uo("getIntegerFromArray",[Jn,Rn],ci),uo("getArrayBoolean",[Jn,Rn],ui),uo("getBooleanFromArray",[Jn,Rn],ui),uo("getArrayColor",[Jn,Rn],di),uo("getColorFromArray",[Jn,Rn],di),uo("getArrayUrl",[Jn,Rn],pi),uo("getUrlFromArray",[Jn,Rn],pi),uo("getArrayFromArray",[Jn,Rn],vi),uo("getDictFromArray",[Jn,Rn],gi),uo("getArrayOptString",[Jn,Rn,zn],fi),uo("getOptStringFromArray",[Jn,Rn,zn],fi),uo("getArrayOptNumber",[Jn,Rn,Bn],hi),uo("getOptNumberFromArray",[Jn,Rn,Bn],hi),uo("getArrayOptInteger",[Jn,Rn,Rn],mi),uo("getOptIntegerFromArray",[Jn,Rn,Rn],mi),uo("getArrayOptBoolean",[Jn,Rn,Un],yi),uo("getOptBooleanFromArray",[Jn,Rn,Un],yi),uo("getArrayOptColor",[Jn,Rn,Wn],bi),uo("getOptColorFromArray",[Jn,Rn,Wn],bi),uo("getArrayOptColor",[Jn,Rn,zn],bi),uo("getOptColorFromArray",[Jn,Rn,zn],bi),uo("getArrayOptUrl",[Jn,Rn,Ln],_i),uo("getOptUrlFromArray",[Jn,Rn,Ln],_i),uo("getArrayOptUrl",[Jn,Rn,zn],_i),uo("getOptUrlFromArray",[Jn,Rn,zn],_i),uo("getOptArrayFromArray",[Jn,Rn],(function(t,e,r){try{return vi(t,e,r)}catch(t){return{type:Jn,value:[]}}})),uo("getOptDictFromArray",[Jn,Rn],(function(t,e,r){try{return gi(t,e,r)}catch(t){return{type:qn,value:{}}}})),uo("len",[Jn],(function(t,e){return{type:Rn,value:Sr(e.value.length)}}));const $i={StringLiteral:function(t,e){return{type:zn,value:e.value}},NumberLiteral:function(t,e){return{type:Bn,value:e.value}},IntegerLiteral:function(t,e){return eo(t,e.value),{type:Rn,value:e.value}},BooleanLiteral:function(t,e){return{type:Un,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Zn(xi(t,e.argument));switch(e.operator){case"!":if(r.type===Un)return{type:Un,value:r.value?0:1};no(`${e.operator}${Qn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Rn){const e=r.value*Sr(n);return eo(t,e),{type:Rn,value:e}}if(r.type===Bn)return{type:Bn,value:r.value*n};no(`${e.operator}${Qn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Zn(xi(t,e.test));if(r.type===Un)return r.value?xi(t,e.consequent):xi(t,e.alternate);no(`${Qn(r)} ? ${Qn(xi(t,e.consequent))} : ${Qn(xi(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return xi(t,e.test)}catch(r){return xi(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return xi(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Xn(xi(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:zn,value:r}},LogicalExpression:function(t,e){const r=Zn(xi(t,e.left));if(r.type!==Un&&no(`${Qn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Un,value:0};const n=Zn(xi(t,e.right));return n.type!==Un&&no(`${Qn(r)} ${e.operator} ${Qn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Kn(n.type)}.`),{type:Un,value:n.value}},BinaryExpression:function(t,e){const r=e.operator;let n=xi(t,e.left),o=xi(t,e.right);if(("number"===n.type&&"integer"===o.type||"integer"===n.type&&"number"===o.type)&&("integer"===n.type?n=so(n):"integer"===o.type&&(o=so(o))),n.type!==o.type&&no(`${Qn(n)} ${e.operator} ${Qn(o)}`,`Operator '${r}' cannot be applied to different types: ${Kn(n.type)} and ${Kn(o.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Hn&&r.type===Hn?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Un,value:n?1:0}}(r,n,o);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Bn&&e.type!==Rn&&e.type!==Hn&&no(`${Qn(e)} ${t} ${Qn(r)}`,`Operator '${t}' cannot be applied to ${Kn(e.type)} type.`);const o=e.type===Hn?e.value.getTime():e.value,i=r.type===Hn?r.value.getTime():r.value;return n=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:Un,value:n?1:0}}(r,n,o);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==zn&&r.type!==Bn&&r.type!==Rn&&no(`${Qn(r)} ${e} ${Qn(n)}`,`Operator '${e}' cannot be applied to ${Kn(r.type)} type.`),r.type===zn)return"-"===e&&no(`${Qn(r)} - ${Qn(n)}`,`Operator '${e}' cannot be applied to ${Kn(r.type)} type.`),{type:zn,value:r.value+n.value};let o="+"===e?r.value+n.value:r.value-n.value;if(r.type===Rn)try{o=to(0,o),eo(t,o)}catch(t){no(`${Qn(r)} ${e} ${Qn(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!==Rn&&r.type!==Bn&&no(`${Qn(r)} ${e} ${Qn(n)}`,`Operator '${e}' cannot be applied to ${Kn(r.type)} type.`),"*"===e)o=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&no(`${Qn(r)} ${e} ${Qn(n)}`,"Division by zero is not supported."),o="/"===e?r.value/n.value:r.value%n.value}if(r.type===Rn)try{o=to(0,o),eo(t,o)}catch(t){no(`${Qn(r)} ${e} ${Qn(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=>xi(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(co.has(i))n=co.get(i);else{const t=function(t,e){const r=lo.get(t);if(!r)return{type:"missing"};let n=null,o=null;for(let t=0;t<r.length;++t){const i=po(r[t],e);"match"!==i.type?n||(n=i):(!o||o.conversions>i.conversions)&&(o={func:r[t],conversions:i.conversions})}if(!o){if(n)return n;throw new Error("Missing function")}return o}(r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>Kn(t.type))).join(", "),n=`${r}(${wi(o)})`;"few"===t.type&&0===o.length?no(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?no(n,`Function '${r}' has no matching override for given argument types: ${e}.`):no(n,`Unknown function name: ${r}.`)}n=t.func,t.conversions&&(o=function(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===Bn&&e.type===Rn?so(e):e}))}(n,o))}if(!n)throw new Error("Function not found");try{return n.cb(t,...o)}catch(t){no(`${r}(${wi(o)})`,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 xi(t,e){if(e.type in $i)return $i[e.type](t,e);throw new Error("Unsupported expression")}class ki{constructor(t){this.ast=t}apply(t,e,r=!1){try{const n=function(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},n=xi(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);n.warnings.forEach(e);const o=n.result;if("error"===o.type)return void e(st(new Error("Expression execution error"),{additional:{message:o.value}}));const i=o.value;if(i instanceof Date)return Yn(i);if("boolean"===o.type)return Boolean(i);if("color"===o.type){const t=ft(String(i));if(t)return io(t);e(st(new Error("Expression execution error")))}if("integer"===o.type)return i>2147483647||i<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(i);if(!r&&("array"===o.type||"dict"===o.type))try{return JSON.stringify(i)}catch(t){return e(st(new Error(`Failed to stringify ${o.type}`))),`<${o.type}>`}return i}catch(t){return void e(st(new Error("Expression execution error")))}}}function Ei(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:Ve,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=De();r!==n;)e.push(r),r=De();return ye=t,Ot(e)}},a=Ve,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",j="!",A="(",F=")",V=",",D="'",S=".",O="e",P="E",I="true",T="false",M=/^[^}]/,N=/^[^'}]/,z=/^[0-9]/,R=/^[a-zA-Z_0-9.]/,B=/^[a-zA-Z_]/,U=/^[ \t\r\n]/,W=ke("@{",!1),L=ke("}",!1),H=ke("@{}",!1),q=ke("\\",!1),J={type:"any"},G=Ee(["}"],!0,!1),Z=ke("?",!1),Y=ke(":",!1),X=ke("!:",!1),Q=ke("||",!1),K=ke("&&",!1),tt=ke("==",!1),et=ke("!=",!1),rt=ke(">=",!1),nt=ke(">",!1),ot=ke("<=",!1),it=ke("<",!1),at=ke("+",!1),st=ke("-",!1),lt=ke("/",!1),ct=ke("*",!1),ut=ke("%",!1),dt=ke("!",!1),pt=ke("(",!1),vt=ke(")",!1),gt=ke(",",!1),ft=Ce("string"),ht=ke("'",!1),mt=Ee(["'","}"],!0,!1),yt=Ce("integer"),bt=Ee([["0","9"]],!1,!1),_t=Ce("number"),wt=ke(".",!1),$t=ke("e",!1),xt=ke("E",!1),kt=Ce("boolean"),Et=ke("true",!1),Ct=ke("false",!1),jt=Ee([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),At=Ce("identifier"),Ft=Ee([["a","z"],["A","Z"],"_"],!1,!1),Vt=Ce("whitespace"),Dt=Ee([" ","\t","\r","\n"],!1,!1),St=function(t){return t},Ot=function(t){return Sn(t)},Pt=function(t){return t},It=function(){return""},Tt=function(){return xe()},Mt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(t){return t},Rt=function(t){return Pn(t)},Bt=function(){throw new Error("Error tokenizing '"+t+"'.")},Ut=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Wt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Lt=function(t,e){return Dn(t,e)},Ht=function(t,e){return Dn(t,e)},qt=function(t,e){return Vn(t,e)},Jt=function(t,e){return Vn(t,e)},Gt=function(t,e){return Vn(t,e)},Zt=function(t,e){return Vn(t,e)},Yt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Xt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Qt=function(t){return{type:"Variable",id:t}},Kt=function(t,e){return[t,...e]},te=function(t){return t},ee=function(t){return t},re=function(t){return Sn(t)},ne=function(t){return t},oe=function(){return""},ie=function(){return xe()},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(t){return t},ce=function(t){return Pn(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:On(xe())}},pe=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ve=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ge=function(){return{type:"BooleanLiteral",value:!0}},fe=function(){return{type:"BooleanLiteral",value:!1}},he=function(){return{type:"Identifier",name:xe()}},me=0,ye=0,be=[{line:1,column:1}],_e=0,we=[],$e=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 xe(){return t.substring(ye,me)}function ke(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ee(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ce(t){return{type:"other",description:t}}function je(e){var r,n=be[e];if(n)return n;for(r=e-1;!be[r];)r--;for(n={line:(n=be[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return be[e]=n,n}function Ae(t,e,r){var n=je(t),i=je(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 Fe(t){me<_e||(me>_e&&(_e=me,we=[]),we.push(t))}function Ve(){var t,e;return t=me,He(),(e=Se())!==n?(He(),ye=t,t=St(e)):(me=t,t=n),t}function De(){var e,r,o,i,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n?(o=He(),(i=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(L)),a!==n?(ye=e,e=Pt(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=It()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(o=u,me++):(o=n,0===$e&&Fe(q)),o===n&&(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W))),$e--,o===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=Tt()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n){if(o=[],M.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(G)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(G));else o=n;o!==n?(125===t.charCodeAt(me)?(i=l,me++):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=Mt()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n&&(ye=e,r=Nt()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=zt(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=Rt(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=Bt()),e=r))))}return e}function Se(){var e,r,o,i,a,s;return e=me,(r=Oe())!==n?(He(),63===t.charCodeAt(me)?(o=d,me++):(o=n,0===$e&&Fe(Z)),o!==n?(He(),(i=Se())!==n?(He(),58===t.charCodeAt(me)?(a=p,me++):(a=n,0===$e&&Fe(Y)),a!==n?(He(),(s=Se())!==n?(ye=e,e=Ut(r,i,s)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Oe()),e}function Oe(){var e,r,o,i;return e=me,(r=Pe())!==n?(He(),t.substr(me,2)===v?(o=v,me+=2):(o=n,0===$e&&Fe(X)),o!==n?(He(),(i=Se())!==n?(ye=e,e=Wt(r,i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Pe()),e}function Pe(){var e,r,o,i,a,s,l,c;if(e=me,(r=Ie())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Lt(r,o)}else me=e,e=n;return e}function Ie(){var e,r,o,i,a,s,l,c;if(e=me,(r=Te())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Te())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Te())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Ht(r,o)}else me=e,e=n;return e}function Te(){var e,r,o,i,a,s,l,c;if(e=me,(r=Me())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Me())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Me())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=qt(r,o)}else me=e,e=n;return e}function Me(){var e,r,o,i,a,s,l,c;if(e=me,(r=Ne())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(ot)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(it))))),s!==n?(l=He(),(c=Ne())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(ot)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(it))))),s!==n?(l=He(),(c=Ne())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Jt(r,o)}else me=e,e=n;return e}function Ne(){var e,r,o,i,a,s,l,c;if(e=me,(r=ze())!==n){for(o=[],i=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Gt(r,o)}else me=e,e=n;return e}function ze(){var e,r,o,i,a,s,l,c;if(e=me,(r=Re())!==n){for(o=[],i=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Zt(r,o)}else me=e,e=n;return e}function Re(){var e,r,o;return(e=We())===n&&(e=Ue())===n&&(e=me,33===t.charCodeAt(me)?(r=j,me++):(r=n,0===$e&&Fe(dt)),r===n&&(43===t.charCodeAt(me)?(r=$,me++):(r=n,0===$e&&Fe(at)),r===n&&(45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)))),r!==n?(He(),(o=Re())!==n?(ye=e,e=Yt(r,o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=function(){var e,r,o,i,a;return e=me,(r=Le())!==n?(He(),40===t.charCodeAt(me)?(o=A,me++):(o=n,0===$e&&Fe(pt)),o!==n?(He(),i=function(){var e,r,o,i,a,s;if(e=me,(r=Se())!==n){for(o=[],i=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?i=s:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?i=s:(me=i,i=n)):(me=i,i=n);ye=e,e=Kt(r,o)}else me=e,e=n;return e===n&&(e=He()),e}(),i!==n?(He(),41===t.charCodeAt(me)?(a=F,me++):(a=n,0===$e&&Fe(vt)),a!==n?(ye=e,e=Xt(r,i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,(r=Le())!==n&&(ye=e,r=Qt(r)),(e=r)===n&&(e=function(){var e,r,o,i;return e=function(){var e,r,o,i;return $e++,e=me,39===t.charCodeAt(me)?(r=D,me++):(r=n,0===$e&&Fe(ht)),r!==n?(o=function(){var t,e,r;for(t=me,e=[],r=Be();r!==n;)e.push(r),r=Be();return ye=t,re(e)}(),39===t.charCodeAt(me)?(i=D,me++):(i=n,0===$e&&Fe(ht)),i!==n?(ye=e,e=ee(o)):(me=e,e=n)):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(ft)),e}(),e===n&&(e=We())===n&&(e=Ue())===n&&(e=function(){var e,r;return $e++,e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r!==n&&(ye=e,r=ge()),(e=r)===n&&(e=me,t.substr(me,5)===T?(r=T,me+=5):(r=n,0===$e&&Fe(Ct)),r!==n&&(ye=e,r=fe()),e=r),$e--,e===n&&(r=n,0===$e&&Fe(kt)),e}(),e===n&&(e=me,40===t.charCodeAt(me)?(r=A,me++):(r=n,0===$e&&Fe(pt)),r!==n?(He(),(o=Se())!==n?(He(),41===t.charCodeAt(me)?(i=F,me++):(i=n,0===$e&&Fe(vt)),i!==n?(ye=e,e=te(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n))),e}())),e}())),e}function Be(){var e,r,o,i,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n?(o=He(),(i=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(L)),a!==n?(ye=e,e=ne(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=oe()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(o=u,me++):(o=n,0===$e&&Fe(q)),o===n&&(39===t.charCodeAt(me)?(o=D,me++):(o=n,0===$e&&Fe(ht)),o===n&&(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W)))),$e--,o===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=ie()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n){if(o=[],N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(mt)),i!==n)for(;i!==n;)o.push(i),N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(mt));else o=n;o!==n?(125===t.charCodeAt(me)?(i=l,me++):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=ae()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n&&(ye=e,r=se()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=le(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=ce(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=ue()),e=r))))}return e}function Ue(){var e,r,o,i;if($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt)),i!==n)for(;i!==n;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));else o=n;return o!==n?(ye=e,e=de()):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(yt)),e}function We(){var e,r,o,i,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));i!==n;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));if(46===t.charCodeAt(me)?(i=S,me++):(i=n,0===$e&&Fe(wt)),i!==n){if(a=[],z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt)),s!==n)for(;s!==n;)a.push(s),z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt));else a=n;if(a!==n){if(s=me,101===t.charCodeAt(me)?(l=O,me++):(l=n,0===$e&&Fe($t)),l===n&&(69===t.charCodeAt(me)?(l=P,me++):(l=n,0===$e&&Fe(xt))),l!==n){if(43===t.charCodeAt(me)?(c=$,me++):(c=n,0===$e&&Fe(at)),c===n&&(45===t.charCodeAt(me)?(c=x,me++):(c=n,0===$e&&Fe(st))),c===n&&(c=null),u=[],z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt)),d!==n)for(;d!==n;)u.push(d),z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt));else u=n;u!==n?s=l=[l,c,u]:(me=s,s=n)}else me=s,s=n;s===n&&(s=null),ye=e,e=pe()}else me=e,e=n}else me=e,e=n;if(e===n){if(e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt)),i!==n)for(;i!==n;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));else o=n;if(o!==n)if(101===t.charCodeAt(me)?(i=O,me++):(i=n,0===$e&&Fe($t)),i===n&&(69===t.charCodeAt(me)?(i=P,me++):(i=n,0===$e&&Fe(xt))),i!==n){if(43===t.charCodeAt(me)?(a=$,me++):(a=n,0===$e&&Fe(at)),a===n&&(45===t.charCodeAt(me)?(a=x,me++):(a=n,0===$e&&Fe(st))),a===n&&(a=null),s=[],z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt)),l!==n)for(;l!==n;)s.push(l),z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt));else s=n;s!==n?(ye=e,e=ve()):(me=e,e=n)}else me=e,e=n;else me=e,e=n}return $e--,e===n&&(r=n,0===$e&&Fe(_t)),e}function Le(){var e,r,o,i,a;if($e++,e=me,r=me,$e++,o=function(){var e,r,o,i;return e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r===n&&(t.substr(me,5)===T?(r=T,me+=5):(r=n,0===$e&&Fe(Ct))),r!==n?(o=me,$e++,R.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(jt)),$e--,i===n?o=void 0:(me=o,o=n),o!==n?e=r=[r,o]:(me=e,e=n)):(me=e,e=n),e}(),$e--,o===n?r=void 0:(me=r,r=n),r!==n)if(B.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(Ft)),o!==n){for(i=[],R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));a!==n;)i.push(a),R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));ye=e,e=he()}else me=e,e=n;else me=e,e=n;return $e--,e===n&&(r=n,0===$e&&Fe(At)),e}function He(){var e,r;for($e++,e=[],U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));r!==n;)e.push(r),U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));return $e--,r=n,0===$e&&Fe(Vt),e}if((r=a())!==n&&me===t.length)return r;throw r!==n&&me<t.length&&Fe({type:"end"}),function(t,e,r){return new In(In.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Ae(_e,_e+1):Ae(_e,_e))}(t,{startRule:"JsonStringContents"}),n=ro(r);return e.vars.push(...n),new ki(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=>Ei(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Ei(t[o],e,r);return n}}var n;return t}function Ci(t,e,r,n=!1){if(t){if(t instanceof ki)return t.apply(e,r,n);if(Array.isArray(t))return t.map((t=>Ci(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Ci(t[o],e,r);return n}}return t}function ji(t,e){const r={vars:[],hasExpression:!1},n=Ei(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:(t,r)=>Ci(n,t,e,r)}}const Ai={pagers:function(){return Q(new Map)}},Fi=new Map,Vi=new Map;function Di(t){const e=Fi.get(t)||Q("");return Fi.has(t)||Fi.set(t,e),e}function Si(t){const e=Vi.get(t)||new Map;return Vi.has(t)||Vi.set(t,e),e}class Oi{setVariable(t){const e=t.getName(),r=Si(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Di(this).set(e)}getVariable(t){return Si(this).get(t)}list(){return Si(this).values()}}function Pi(){return new Oi}function Ii(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 Ti=new Set(["start","stop","pause","resume","cancel","reset"]);class Mi{constructor(t){Ii(this,"timers",new Map),Ii(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)&&Ti.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)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((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((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-o)%r,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))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Ni(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}}))}let zi=Q(!0),Ri=0;function Bi(){zi.set(!1)}function Ui(){zi.set(!0)}function Wi(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Li=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 Oi}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:j}=e,{onStat:A}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:T="ltr"}=e,M=Q("desktop"===b);if(s=l(M,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");M.set(!t.matches),t.addListener((()=>{M.set(!t.matches)}))}let N="light",z=null;const B=Q("rtl"===T?"rtl":"ltr");function U(t){_=t}function W(){return new Map}function H(){return new Map}function q(t){y=t}u=l(B,(t=>c=t));const J=new Set(E);let G=!1,Z=!1;m||(Z=!0,dt(st(new Error('"id" prop is required'))));const Y={stateChange:!1},X=Di(w),tt=Si(w),et=new Map,rt=new Map,ot=new Map;let it=null,lt=0,ct=[];function ut(t,e,r,n=!1){const o=ji(e,t);if(!o.hasExpression)return e;const i=Wi(rt,r);return o.applyVars(i,n)}function dt(t){j?j({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function pt(t,e){A&&A({type:t,action:e})}function vt(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}=jn(t,e,o,dt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let gt=0;function ft(t){return`${m}-${gt++}`}let ht={},yt={};function bt(t){_t(ut(dt,t))}function _t(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Wt(t))return;const i=(null==e?void 0:e.logError)||dt;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":!function(t){if(!t)throw new Error("Missing state id");let e=St,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;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=Ft(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=rt.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");it?it.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)||dt;if(t){const r=Ft(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)||dt;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=Ct.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 wt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Ct.get(t.id);e&&e.replaceWith(t.id,t.items)})),wt(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}})),wt(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)||dt;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=At.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&ct.some((e=>e.desc.id===t)))return;const a={internalId:++lt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};ct=[...ct,a];const s=null!==(n=i.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,ct=ct.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)||dt;t?ct=ct.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;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=rt.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}})):Ni(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)}}))}(rt,i,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:o}=r;"number"==typeof o?Ni(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}}))}(rt,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&&jt.get(n.element_id);t?t.focus():i(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}default:i(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function wt(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,J)){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?(_t(n,e.componentContext),await $()):n.log_id&&($t(n),await $())}else i&&_t(n,e.componentContext)}r.forEach((t=>{t.log_id&&pt("click",t)}))}function $t(t){null==F||F(t)}const Et=new Map,Ct=new Map,jt=new Map,At=new Map;function Ft(t){if(Et.has(t))return Et.get(t);dt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Dt=new Map;g(at,{logStat:pt,hasTemplate:function(t){return t in o},processTemplate:vt,genId:ft,genClass:function(t){return`divkit-${ft()}`},execAction:_t,execCustomAction:$t,isRunning:function(t){return Y[t]},setRunning:function(t,e){Y[t]=e},registerInstance:function(t,e){Et.has(t)?dt(st(new Error("Duplicate instance id"),{additional:{id:t}})):Et.set(t,e)},unregisterInstance:function(t){Et.delete(t)},registerParentOf:function(t,e){Ct.set(t,e)},unregisterParentOf:function(t){Ct.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(At.has(r)&&dt(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),At.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(At.delete(e),ct.some((t=>t.desc.id===e))&&(ct=ct.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){ct=ct.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){jt.set(t,e)},unregisterFocusable:function(t){jt.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(yt[r]=yt[r]||0,++yt[r],ht[r])return ht[r];const n=`${ft()}-svg-filter`;return ht=Object.assign(Object.assign({},ht),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;yt[r]&&0==--yt[r]&&(ht=Object.keys(ht).reduce(((t,e)=>(yt[e]&&(t[e]=ht[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Yr))throw new Error("Unsupported variable type");return new Yr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return Dt.has(t)||function(t){Dt.has(t)||Dt.set(t,Ai[t]())}(t),Dt.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return J},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:rt,logError:dt}},typefaceProvider:D,isDesktop:M,isPointerFocus:zi,customComponents:P,direction:B,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const St={setState(t){throw new Error("Not implemented")},getChild(t){if(Ot&&Ot.has(t))return Ot.get(t);dt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Ot=null;function Pt(t){if(t.type in Hr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&dt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=qr(t.name,t.type,t.value);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Ot||(Ot=new Map),Ot.has(t)?dt(st(new Error("Duplicate state with id"),{additional:{id:t}})):Ot.set(t,e)},unregisterInstance(t){null==Ot||Ot.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 It=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(It)&&It.forEach((t=>{if(t&&t.name){if(et.has(t.name))return void dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Pt(t)}}));const Tt=y.palette;Tt&&Tt[N].forEach((t=>{if(et.has(t.name))dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=qr(t.name,"color",t.color);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of tt)rt.has(t)||rt.set(t,e);X.subscribe((t=>{if(t&&!rt.has(t)){const e=tt.get(t);rt.set(t,e);const r=ot.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Mt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Mt&&"undefined"!=typeof document){const t=it=new Mi({logError:dt,applyVars:t=>ut(dt,t),hasVariableWithType:function(t,e){const r=rt.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=rt.get(t);r?r.setValue(e):dt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:wt});Mt.forEach((e=>t.createTimer(e)))}const Nt=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),dt(t)},execAnyActions:(t,e={})=>wt(t,{componentContext:r,processUrls:e.processUrls}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return Fn(e);const o=Wi(rt,r),i=ji(e,t);return i.vars.length?K(i.vars.map((t=>o.get(t)||function(t){const e=ot.get(t)||Q(void 0);return ot.has(t)||ot.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(o,n))):i.hasExpression?Fn(i.applyVars(o)):Fn(e)}(r.logError,t,Wi(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>ut(r.logError,t,Wi(r.variables,e),n),produceChildContext(e,n={}){const o=t(r);let i=e,a=r.templateContext;const{templateContext:s,json:l}=vt(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=Wi(r.variables,n.variables),n.tooltips&&(o.tooltips=n.tooltips),n.fake&&(o.fakeElement=!0),n.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const n=(r.variables||rt).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.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let zt;v((()=>{Ri--,Ri||(window.removeEventListener("keydown",Bi),window.removeEventListener("pointerdown",Ui)),it&&it.destroy(),ct.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),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!==j&&r.onError(j),void 0===e.onStat&&r.onStat&&void 0!==A&&r.onStat(A),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!==T&&r.direction(T),void 0===e.setTheme&&r.setTheme&&void 0!==U&&r.setTheme(U),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==W&&r.getDebugVariables(W),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==H&&r.getDebugAllVariables(H),void 0===e.setData&&r.setData&&void 0!==q&&r.setData(q),void 0===e.execAction&&r.execAction&&void 0!==bt&&r.execAction(bt),"light"===_||"dark"===_?N=_:"system"===_?"undefined"!=typeof matchMedia?(z||(z=matchMedia("(prefers-color-scheme: dark)"),z.addListener((function(){"system"===_&&z&&(N=z.matches?"dark":"light")}))),N=z.matches?"dark":"light"):N="light":dt(st(new Error("Unsupported theme"))),N&&Tt&&Tt[N].forEach((t=>{const e=rt.get(t.name);e&&e.setValue(t.color)}));{G=!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 kn)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&&(G=!0,dt(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!==It&&y.card.variables.forEach((t=>{t&&t.name&&!et.has(t.name)&&Pt(t)})),i=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,i&&!G&&!Z){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})))};zt=Nt.produceChildContext(t,{tooltips:ct,isRootState:!0})}return s(),u(),G||Z||!zt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${L("dir",c,0)}>${R(Cn,"RootSvgFilters").$$render(t,{svgFiltersMap:ht},{},{})} ${R(En,"Unknown").$$render(t,{componentContext:zt},{},{})}</div>`})),Hi=Li;function qi(t){return Hi.render(t).html}var Ji=exports;for(var Gi in e)Ji[Gi]=e[Gi];e.__esModule&&Object.defineProperty(Ji,"__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:()=>Pi,createVariable:()=>qr,render:()=>qi}),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),j(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 j(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),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:A.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 T(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function M(t){const e={};for(const r in t)e[r]=T(t[r]);return e}function N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let 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}: ${T(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 jt(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function At(t,e){e&&t.push(e)}function Ft(t,e,r){const n=[];At(n,e[t]);for(const o in r)if(r.hasOwnProperty(o)){const i=r[o];i&&At(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 Tt(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)||!Tt(t[o],e[o]))return!1}return!0}function Mt(t,e){return Tt(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)})),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))||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:T(x)},{target:T($)},{style:T(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?it:"",!0)},M(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:T(u)},{role:T(k?"button":null)},{tabindex:T(k?0:null)},M(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,j,A,F,V,D,S,O,P,I,T,M,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,At=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,je,Ae,Fe,Ve,De,Se,Oe,Pe,Ie,Te,Me,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 jr(){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 Ar(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((()=>{Ae=!1})).catch((t=>{throw Ae=!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)).subscribe((e=>{const r=e.filter(jt),a={};r.forEach((t=>{a[t.index]=t})),l();const c=[...new Set(r.map((t=>{const e="visibility"===i[t.index].type;return Ct(e,t.visibility_percentage,e?50:0)/100})))];c.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{r.forEach((e=>{const r=i[e.index],a="visibility"===r.type,s=Ct(a,e.visibility_percentage,a?50:0);let l;l=0===s?t.intersectionRatio>=1e-12:t.intersectionRatio>=s/100;const c=a?!r.visible&&l:r.visible&&!l,u=a?!l:l;c?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);const i=o.getJsonWithVars(r.action),s=i.url,l=i.typed;if(s){const t=xt(s);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(i):i.log_id&&n.execCustomAction(i))}else l&&n.execAction(i);n.logStat(a?"visible":"disappear",i)}),Et(e.visibility_duration,800))):u&&r.timer&&clearTimeout(r.timer),r.visible=l}))}))}),{threshold:c}),s.observe(t))}));return{destroy(){l(),c()}}}(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)})),jr()})),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,Te=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&&Ar(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),At(),At=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=>M=t)),C=Xt.getDerivedFromVars(Xt.json.visibility),it(),it=l(C,(t=>T=t)),j=Xt.getDerivedFromVars(Xt.json.transform),ot(),ot=l(j,(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=Mt(e,Be),Ue=Mt(r,Ue),We=n,Ge=o}Ze=Bt(rt&&!ae?rt:void 0,Ze),A=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=Mt(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=Mt(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={},je=!1,Array.isArray(Ee)&&(je=Ee.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!je)){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"}Ae=void 0,dr&&Xt.json.transition_in&&ge.isRunning("stateChange")&&(Ae=!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)}M&&(yr=Rt(M),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}(T,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&&!Tt(Xt.json.extensions,Me)){let t=Me=Xt.json.extensions;$().then((()=>{if(t===Me&&he&&(jr(),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":Ae||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}%`}`,Te=`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:A,margin:Ye,opacity:ke,transition:br,"transform-origin":Ie,transform:Te,"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(),At(),St(),It(),Ht(),qt(),tt(),Jt(),Zt(),Yt(),rr||lr?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Xt,id:Xt.json.id,use:Ar,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:()=>` ${je?`${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="",j=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="",j=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,j=(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":j?`inset 0 0 0 ${dt(j.width)} ${j.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,j,A,F,V,D,S,O,P,I,T,M,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="",jt="",At=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Tt=[],Mt=[];var Nt;v((()=>{Mt.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,jt="",At=!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=>M=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>T=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,jt=r,At=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(M)!==Boolean(S&&S[0]&&S[0].text_color);{let t="";z&&k&&E&&(t=gt(M||S&&S[0]&&S[0].text_color,1,St)),St=t}Ot=gt(T,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(Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Mt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Tt=[]);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),Mt.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)}),Tt=o}($t,S,D,V),j={singleline:x,multiline:At,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},A={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":jt,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,j)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${L("class",Ft("text__inner",lt,A),0)}${L("style",ut(F),0)}>${Tt.length?`${N(Tt,(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",je="divkit-f6e9a";function Ae(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),Ae(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)Ae(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),Ae(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(je))&&!(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",je,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,j,A,F,V,D,S,O,P,I,T,M,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=>M=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=>j=t)),y=ct.getDerivedFromVars(ct.json.height),L(),L=l(y,(t=>A=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=>T=t))}if(gt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(z,gt),_="wrap"===M,w="horizontal"!==gt&&!_&&T.some(we),$="vertical"!==gt&&!_&&T.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||$||A&&"wrap_content"!==A.type&&("match_parent"!==A.type||!(null==ut?void 0:ut.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!w&&("wrap_content"===(null==j?void 0:j.type)||"match_parent"===(null==j?void 0:j.type)&&(null==ut?void 0:ut.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===gt&&(t.parentContainerOrientation="horizontal"),"vertical"===gt&&(t.parentContainerOrientation="vertical"),_&&(t.parentContainerWrap=!0),_t=Mt(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(En,"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,Te={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Me(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=Me(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",Te,p),componentContext:f,layoutParams:h},{},{default:()=>s?`<span${L("class",Te.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,j,A,F,V,D,S,O,P,I,T,M,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,jt="",At="none",Vt="50% 50%",Dt="0",St="source_in",Ot="",Pt="",It=0,Tt=0,Mt=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&&(At="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=>M=t)),m=vt.getDerivedFromVars(vt.json.accessibility),tt(),tt=l(m,(t=>T=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),jt=B?`url("${Re(B)}")`:"",kt=gt(z,1,kt),At=wt(N)||At,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})}(M,V,Vt),C=(null==T?void 0:T.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,"-"),Mt=Et(t.duration,300),Tt=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 j={aspect:"0"!==Dt,"is-width-content":k,"is-height-content":E,loaded:!1,"before-appearance":Boolean(Pt)&&!0,"is-rtl-mirror":Bt},A={"background-image":jt,"background-color":jt?void 0:kt,"background-size":At,"clip-path":Rt||void 0,"object-fit":At,"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?`${Tt}ms`:void 0,"--divkit-appearance-duration":Pt?`${Mt}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,j),componentContext:vt,layoutParams:ft,customDescription:!0},{},{default:()=>j.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(A),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(A),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:j}=e;m=l(f(at).direction,(t=>h=t));let A,F,V=1,D=[],S=[],O=[],P=[],I=0,T=!1,M="start",z="start";void 0===e.componentContext&&r.componentContext&&void 0!==C&&r.componentContext(C),void 0===e.layoutParams&&r.layoutParams&&void 0!==j&&r.layoutParams(j),o=C.origJson,o&&(V=1,M="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}))})),A=K(t,(t=>[...t])),k(),k=l(A,(t=>_=t))}{const t={};let e=0,r=0;D=[],S=[],O=[],P=[],T=!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]?(T=!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 M=pe(b,M),z=de(y,h,z),p={valign:M,halign:z},v={"grid-template-columns":qe(D,O,V),"grid-template-rows":qe(S,P,I)},g=T,m(),$(),x(),k(),E(),g?"":`${R(oe,"Outer").$$render(t,{cls:Ft("grid",We,p),componentContext:C,style:v,layoutParams:j,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(En,"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,j,A,F,V,D,S,O,P,T,M,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;A=l(lt.direction,(t=>j=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,jt=1,At="horizontal",Vt="start",Dt=8,St="",Ot=[],It={},Tt=!1,Nt={},zt=0;W=l(lt.isDesktop,(t=>U=t));const Rt=er((function(){if(!ct)return;let t=ct.scrollLeft;"rtl"===j&&(t*=-1);const e=ct.scrollWidth,r=ct.offsetWidth;"ltr"===j?(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<jt;++e){const n=vt[e].children[r];n&&t.push(n)}return t}function Ut(t,e="smooth"){const r="horizontal"===At?"left":"top";ct.scroll({[r]:t,behavior:e})}function Wt(t,e,r="smooth"){const n="horizontal"===At,o=n?"offsetLeft":"offsetTop",i=t[e];if(i){let t;if("ltr"!==j&&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"===At?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"===At?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&&(jt=1,At="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=>M=t)),d=it.getDerivedFromVars(it.json.item_spacing),Q(),Q=l(d,(t=>T=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),jt=ae(B,jt),$=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}(_,jt),At=Me(z,At),Vt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(M,Vt),Dt=Et(T,Dt),$t=dt(Dt),kt=Et(P,Dt),xt=dt(kt),St=Pt(O,j,St),x="horizontal"===At?"grid-template-columns":"grid-template-rows";{let t=[];_.forEach((e=>{const r="horizontal"===At?"width":"height";t.push(it.getDerivedFromVars(e.json[r]))})),Ct=K(t,(t=>t)),Z(),Z=l(Ct,(t=>S=t))}Ot=[],jt>1?Ot.push("auto"):S.forEach((t=>{!t&&"horizontal"===At||"match_parent"===(null==t?void 0:t.type)?Ot.push("100%"):Ot.push("max-content")}));{const t={};let e={};Tt=!1,"horizontal"===At?e.parentVAlign=Vt:e.parentHAlign=Vt,"paging"===D&&(Tt=!0,e.scrollSnap="start",t["horizontal"===At?"scroll-padding-left":"scroll-padding-top"]=dt(Dt/2)),1===jt&&(e.parentLayoutOrientation=At),It=Mt(t,It),Nt=Mt(e,Nt)}return k={padding:St,"grid-gap":xt},E={"grid-gap":$t,[x]:tr(Ot)},C={orientation:At,"scroll-snap":Tt,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"===At,n="ltr"!==j&&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"===j||"horizontal"!==At?1e6:-1e6)},scrollBackward(t,e){const r="horizontal"===At,n="ltr"!==j&&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"===At,n="ltr"!==j&&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"===j||"horizontal"!==At?t:-t)}}))),A(),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(En,"Unknown").$$render(t,{componentContext:e,layoutParams:Nt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===At?`${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,j,A,F,V,D,S,O,P,T,M,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([]);A=l(ft,(t=>j=t));let ht,mt,yt,bt,_t,wt,$t,xt={},kt={},Ct=12,jt="",At="",Vt="",St="",It="",Tt="",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,jt="",St="",bt=void 0,It="",_t=void 0,Tt="",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=>M=t)),g=rt.getDerivedFromVars(rt.json.has_separator),Z(),Z=l(g,(t=>T=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==j?void 0:j.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=Mt(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||j.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=j[0])||void 0===tt?void 0:tt.index)||0),x=M||{},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};jt=Pt(e,D,jt)}{const t=x.line_height;void 0!==t&&Yt(t)&&(At=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),Tt=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),T&&(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(),A(),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":jt,"--divkit-tabs-line-height":At,"--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":Tt||"","--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(j,(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> ${T?`<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(j,(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(En,"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)}}function dr(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function pr(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...pr(t))})):e.push(t),e}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 vr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},gr=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 j,A,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===(A=null===(j=S.offset)||void 0===j?void 0:j.x)||void 0===A?void 0:A.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",vr,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${R(En,"Unknown").$$render(t,{componentContext:o},{},{})}</div>`}));function fr(t){return"change_bounds"===t.type?t:"set"===t.type?fr(t.items[0]):null}const hr=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,j=[],A=[],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}function O(t,e,r){let{json:n,parentComponentContext:o,transitions:i,node:a}=e;n=d.getJsonWithVars(n),i=d.getJsonWithVars(i);const s=pr(i),l=a.getBoundingClientRect(),c=Object.assign(Object.assign({},n),{margins:void 0,alpha:(u=s,u.some((t=>"fade"===t.type))?void 0:n.alpha)});var u;return{json:c,componentContextCopy:o.produceChildContext(c,{fake:!0}),elementBbox:l,rootBbox:t,transitions:s,alpha:n.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node}}async function P(t){if(_===t)return;h.setRunning("stateChange",!0);const e=new Set(E);j.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),j=[];let r=[];if(y){const t=y.getBoundingClientRect();r=F.map((e=>O(t,e,"out")))}V.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),A=[],F=[],V=[];const n=c.find((e=>e.state_id===t))||null;if(n?(_=t,null==s||s.setValue(_),S(n)):d.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!y)return;const o=y.getBoundingClientRect();let i=A.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>O(o,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||E.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const a=r.concat(i),l=a.reduce(((t,e)=>Math.max(t,dr(e.transitions))),0),u=V.filter((t=>k.has(t.id))).map((t=>{const e=Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}});return{json:e,componentContextCopy:t.parentComponentContext.produceChildContext(e,{fake:!0}),rootBbox:o,beforeBbox:k.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:d.getJsonWithVars(fr(t.transitions)),resolvePromise:t.resolvePromise}}));j=[...a.map((t=>Object.assign(Object.assign({},t),{maxDuration:l}))),...u],k.clear(),h.setRunning("stateChange",!1)}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){if(!y)return Promise.resolve();const i=O(y.getBoundingClientRect(),{json:t,parentComponentContext:e,transitions:r,node:n},o),a=dr(i.transitions),s=Object.assign(Object.assign({},i),{maxDuration:a});return j=[...j.filter((t=>t.node!==i.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return A.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:P,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=>{P(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(En,"Unknown").$$render(t,{componentContext:w},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",y,0)}>${N(j,(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(En,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${L("class",lr,0)}><div${L("class",cr,0)}>${R(En,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})} ${null!=d&&d.tooltips?`${N(d.tooltips,(e=>`${R(gr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:d},{},{})}`))}`:""}`})),mr=hr,yr={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"},br=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P=i,T=i,M=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");A=l(rt.isDesktop,(t=>j=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),T(),T=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),M(),M=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=Me(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,_=j&&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(),A(),T(),M(),z(),B(),U(),b?"":`${R(oe,"Outer").$$render(t,{cls:Ft("pager",yr,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(yr.pager__items,!0)+" "+I(O?ot:"",!0)}"${L("style",ut(m),0)}${L("this",vt,0)}>${N(g,(e=>`<div${L("class",yr.pager__item,0)}>${R(En,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${w&&_?` <div${L("class",it||`${yr.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",yr["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||`${yr.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",yr["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>`:""}`})}`})),_r=br,wr={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"},$r=["rounded_rectangle","circle"],xr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V=i,D=i,S=i,O=i,P=i,T=i,M=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),T(),T=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),M(),M=l(u,(t=>j=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=>A=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},$r,Q)),A&&(K=xe({type:"shape_drawable",shape:A},$r,K)),!F&&!A&&C){const t=ae(j,1.3);K=xe({type:"shape_drawable",shape:C,color:K.background},$r,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(),T(),M(),z(),B(),`${R(oe,"Outer").$$render(t,{cls:Ft("indicator",wr,m),componentContext:H,layoutParams:J},{},{default:()=>`<div${L("class",wr.indicator__scroller,0)}${L("this",Z,0)}><div${L("class",wr.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",wr,{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>`})}`})),kr=xr,Er={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 Cr(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 jr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Ar="function"==typeof BigInt;function Fr(t){return Ar?BigInt(t):Number(t)}const Vr=Fr("9223372036854775807"),Dr=Fr("-9223372036854775808");function Sr(t){const e=Fr(t);if(e>Vr||e<Dr)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 Or=Sr(0);function Pr(t){let e=t;return e<0&&(e=-e),e}function Ir(t){let e=0;return t>0?e=1:t<0&&(e=-1),Sr(e)}class Tr{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 Mr extends Tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Nr extends Tr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Sr(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Sr(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class zr extends Tr{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 Rr extends Tr{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 Br extends Tr{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 Ur extends Tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Wr extends Tr{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 Lr extends Tr{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 Hr={string:Mr,number:zr,integer:Nr,boolean:Rr,color:Br,url:Ur,dict:Wr,array:Lr};function qr(t,e,r){if(!(e in Hr))throw new Error("Unsupported variable type");return new Hr[e](t,r)}function Jr(){}function Gr(t){return t(this.value),Jr}function Zr(){throw new Error("Cannot change the value of this type of variable")}const Yr={string:class extends Mr{},number:class extends zr{},integer:class extends Nr{},boolean:class extends Rr{},color:class extends Br{},url:class extends Ur{},dict:class extends Wr{},array:class extends Lr{}};for(const t in Yr){const e=Yr[t];e.prototype.subscribe=Gr,e.prototype.set=Zr,e.prototype.setValue=Zr}const Xr={width:10,height:10,borderRadius:5,background:"#000"},Qr=["rounded_rectangle","circle"],Kr=["rounded_rectangle"];function tn(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 en=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,T,M,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,jt;P=l(kt.direction,(t=>O=t));let At,Vt,Dt,St=0,Pt=100,It=Xr,Tt=It,Mt=Xr,Nt=Xr,Rt=null,Bt=null,Ut=Dt,Wt="",Lt="",Ht=!1,Jt=jr(X||0,St,Pt),Gt=jr(Y||0,St,Pt),Zt=!1;function Yt(){if(!jt)return;const t=Pt-St,e=(null==Rt?void 0:Rt.width)||0,r=(null==Bt?void 0:Bt.width)||0;Math.max(e,r)*t>=(null==jt?void 0:jt.clientWidth)?Zt||($t.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Zt=!0):Zt=!1}er(Yt,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&&(It=Xr,Tt=It,Mt=Xr,Nt=Xr,Rt=null,Bt=null,Dt=void 0,Ut=void 0,Wt="",Lt=""),a=$t.json.thumb_value_variable,s=$t.json.thumb_secondary_value_variable,c=a&&$t.getVariable(a,"integer")||qr("temp","integer",0),ft(),ft=l(c,(t=>X=t)),u=s&&$t.getVariable(s,"integer")||qr("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=>M=t)),k=$t.getDerivedFromVars($t.json.secondary_value_accessibility),tt(),tt=l(k,(t=>T=t)),St=zt(K,St),Pt=zt(Q,Pt),Yt();{const t=jr(X||0,St,Pt);t!==Jt&&(Jt=t)}{const t=jr(Y||0,St,Pt);t!==Gt&&(Gt=t)}It=xe(Z,Qr,It),Tt=xe(G,Qr,It),Mt=xe(J,Kr,Mt),Nt=xe(H,Kr,Nt);{let t=xe(W,Qr,Xr);t!==Xr&&(Rt=t)}Rt?(At=s?tn(Math.min(Jt,Gt),Math.max(Jt,Gt)+1,St,Pt,!0):tn(St,Jt,St,Pt,!0),Yt()):At=[];{let t=xe(U,Qr,Xr);t!==Xr&&(Bt=t)}Bt?(Vt=s?tn(Math.min(Jt,Gt),Math.max(Jt,Gt)+1,St,Pt,!1):tn(Jt+1,Pt+1,St,Pt,!0),Yt()):Vt=[],Dt=Cr(B,Dt),Ut=Cr(z,Dt),(null==M?void 0:M.description)?Wt=M.description:$t.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==T?void 0:T.description)?Lt=T.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):It===Xr?($t.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===Xr?($t.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===Xr&&($t.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Ht&&(Ht=t)}return E=dt(Math.max(...[It.width,Tt.width,0].filter(Ot))),C=dt(Math.max(...[It.height,Tt.height,0].filter(Ot))),j=(Jt-St)/(Pt-St),A=s?(Gt-St)/(Pt-St):void 0,F=void 0!==A?Math.abs(A-j):j,V=void 0!==A?Math.min(A,j):0,D={"--divkit-slider-thumb-width":dt(It.width),"--divkit-slider-thumb-height":dt(It.height),"--divkit-slider-thumb-secondary-width":dt(Tt.width),"--divkit-slider-thumb-secondary-height":dt(Tt.height),"--divkit-slider-text-offset-x":(null===(yt=null==Dt?void 0:Dt.offset)||void 0===yt?void 0:yt.x)?pt(Dt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(bt=null==Dt?void 0:Dt.offset)||void 0===bt?void 0:bt.y)?pt(Dt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(_t=null==Ut?void 0:Ut.offset)||void 0===_t?void 0:_t.x)?pt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(wt=null==Ut?void 0:Ut.offset)||void 0===wt?void 0:wt.y)?pt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Rt?dt(Rt.width):void 0,"--divkit-slider-tick-active-height":Rt?dt(Rt.height):void 0,"--divkit-slider-tick-active-border-radius":Rt?dt(Rt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Rt?void 0:Rt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?dt(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?dt(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?dt(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":E,"--divkit-slider-max-thumb-height":C,"--divkit-slider-track-part":j,"--divkit-slider-track-secondary-part":A},S={direction:O},$t.json,P(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),ut(),vt(),gt(),ft(),ht(),mt()," "+(Ht?"":`${R(oe,"Outer").$$render(t,{cls:Ft("slider",Er,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",Er["slider__tracks-wrapper"],0)}><div${L("class",Er["slider__tracks-inner"],0)}${L("this",jt,0)}><div${L("class",Er.slider__track,0)}${q({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${L("class",Er["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(Nt.height),"border-radius":dt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div> ${N(At,(t=>`<div class="${I(Er.slider__tick,!0)+" "+I(Er.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(Vt,(t=>`<div class="${I(Er.slider__tick,!0)+" "+I(Er.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${L("class",Er.slider__thumb,0)}${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Dt?`<div${L("class",Er["slider__thumb-text"],0)}><div${L("class",Er["slider__thumb-text-inner"],0)}${q({"font-size":(null===(r=Dt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(n=Dt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Dt)||void 0===o?void 0:o.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div> ${s?`<div class="${I(Er.slider__thumb,!0)+" "+I(Er.slider__thumb_secondary,!0)}"${q({"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}>${Ut?`<div class="${I(Er["slider__thumb-text"],!0)+" "+I(Er["slider__thumb-text_secondary"],!0)}"><div${L("class",Er["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=Ut)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(a=Ut)||void 0===a?void 0:a.fontWeight)||"",color:(null===(l=Ut)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Gt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",Er.slider__input,0)}${L("min",St,0)}${L("max",Pt,0)} step="1"${L("value",Jt,0)}${L("aria-label",Wt,0)}${L("this",undefined,0)}> ${s?`<input type="range"${L("class",`${Er.slider__input} ${Er.slider__input_secondary}`,0)}${L("min",St,0)}${L("max",Pt,0)} step="1"${L("value",Gt,0)}${L("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),rn={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 nn(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=nn(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 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{constructor(t){this.char=t}}class sn{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class ln{constructor(t){on(this,"filters",new Map),on(this,"destructedValue",[]),on(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 an)t+=r.char;else if(r instanceof sn)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 sn&&!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 sn(null,this.filters.get(e.key),e.placeholder):new an(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=nn(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 sn&&++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 sn&&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 sn&&(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 sn);)++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 sn&&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 sn&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof sn);)++e;return e}}class cn extends ln{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function un(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 dn extends ln{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),un(this,"currencyFormatter",new Intl.NumberFormat),un(this,"decimalSeparator","."),un(this,"localeDigits",{}),un(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=nn(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 pn(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 vn(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=pn(n);if(e<=o)return void vn(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 gn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),fn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url",password:"password"},hn=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,T,M,N,z,B,U,W,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,ot,it,lt,ct,vt=i,ft=i,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Ct=i,jt=i,At=i,Vt=i,Ot=i,Pt=i,It=i,Tt=i;var Mt;let{componentContext:Nt}=e,{layoutParams:zt}=e;const Rt=f(at);let Ut,Wt;H=l(Rt.direction,(t=>W=t));let Lt,Ht,qt,Jt=null,Gt="",Zt="",Xt=!1,Qt="",Kt=12,te="",ee="",re="#000",ne="",ie="start",se="center",ce="multi_line_text",ue="text",ve="",ge=null,fe="",he="",me="";function ye(t){Wt instanceof HTMLInputElement?Wt.selectionStart=Wt.selectionEnd=t:vn(Wt,t)}async function be(){if(!Wt||!Jt)return;Jt.overrideRawValue(B),d.set(Jt.rawValue),c(u,z=Gt=Zt=Jt.value,z);const t=Jt.cursorPosition;await $(),document.activeElement===Wt&&ye(t)}var _e;v((()=>{Ut&&(Rt.unregisterFocusable(Ut),Ut=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Nt&&r.componentContext(Nt),void 0===e.layoutParams&&r.layoutParams&&void 0!==zt&&r.layoutParams(zt),o=Nt.origJson,o&&(Qt="",Kt=12,Lt=void 0,te="",Ht=void 0,re="#000",ne="",ie="left",se="center",ce="multi_line_text",ue="text",qt=void 0),a=Nt.json.text_variable,s=null===(Mt=Nt.json.mask)||void 0===Mt?void 0:Mt.raw_text_variable,u=a&&Nt.getVariable(a,"string")||qr("temp","string",""),vt(),vt=l(u,(t=>z=t)),d=s&&Nt.getVariable(s,"string")||qr("temp","string",""),ft(),ft=l(d,(t=>B=t)),p=Nt.getDerivedFromVars(Nt.json.hint_text),It(),It=l(p,(t=>lt=t)),g=Nt.getDerivedFromVars(Nt.json.hint_color),Pt(),Pt=l(g,(t=>it=t)),h=Nt.getDerivedFromVars(Nt.json.font_size),Ot(),Ot=l(h,(t=>ot=t)),m=Nt.getDerivedFromVars(Nt.json.font_weight),Vt(),Vt=l(m,(t=>nt=t)),y=Nt.getDerivedFromVars(Nt.json.font_family),At(),At=l(y,(t=>rt=t)),b=Nt.getDerivedFromVars(Nt.json.line_height),jt(),jt=l(b,(t=>et=t)),_=Nt.getDerivedFromVars(Nt.json.letter_spacing),Ct(),Ct=l(_,(t=>tt=t)),w=Nt.getDerivedFromVars(Nt.json.text_color),kt(),kt=l(w,(t=>K=t)),x=Nt.getDerivedFromVars(Nt.json.highlight_color),xt(),xt=l(x,(t=>Q=t)),k=Nt.getDerivedFromVars(Nt.json.text_alignment_horizontal),$t(),$t=l(k,(t=>X=t)),E=Nt.getDerivedFromVars(Nt.json.text_alignment_vertical),wt(),wt=l(E,(t=>Y=t)),C=Nt.getDerivedFromVars(Nt.json.keyboard_type),_t(),_t=l(C,(t=>Z=t)),j=Nt.getDerivedFromVars(Nt.json.mask),bt(),bt=l(j,(t=>G=t)),A=Nt.getDerivedFromVars(Nt.json.max_visible_lines),yt(),yt=l(A,(t=>J=t)),F=Nt.getDerivedFromVars(Nt.json.paddings),mt(),mt=l(F,(t=>q=t)),V=Nt.getDerivedFromVars(Nt.json.accessibility),ht(),ht=l(V,(t=>U=t)),D=Nt.getDerivedFromVars(Nt.json.select_all_on_focus),Tt(),Tt=l(D,(t=>ct=t)),a?Xt=!1:(Xt=!0,Nt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(_e=G)?void 0:_e.type)?Jt=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 cn(n,e)}return r||null}(_e,Nt.logError,Jt):"currency"===(null==_e?void 0:_e.type)&&(Jt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new dn(t.locale,e)}(_e,Nt.logError,Jt)),Jt&&be(),Jt||Gt===z||(Gt=Zt=z),Jt&&Jt.rawValue!==B&&be(),S=lt,Qt=gt(it,1,Qt),Kt=ae(ot,Kt),Lt=le(nt,Lt),te=rt&&"string"==typeof rt?Rt.typefaceProvider(rt,{fontWeight:Lt||400}):"";{const t=et;Yt(t)&&(Ht=t/Kt)}return St(tt)&&(ee=dt(tt)),re=gt(K,1,re),ne=gt(Q,1,ne),ie=de(X,W,ie),se=pe(Y,se),Z&&Z in fn&&(ue=fn[Z],ce=Z),"currency"===(null==G?void 0:G.type)&&(ue=gn?"text":"tel",qt="decimal"),O="multi_line_text"===ce,ve=Yt(J)?`calc(${J*(Ht||1.25)*(Kt/10)+"em"} + ${pt(Et(null==q?void 0:q.top,0)+Et(null==q?void 0:q.bottom,0))})`:"",ge=Bt(q||void 0,ge),fe=ge?Dt({top:(Number(ge.top)||0)/Kt*10,right:(Number("ltr"===W?ge.end:ge.start)||Number(ge.right)||0)/Kt*10,bottom:(Number(ge.bottom)||0)/Kt*10,left:(Number("ltr"===W?ge.start:ge.end)||Number(ge.left)||0)/Kt*10},W):"",he=ge?Dt({top:(Number(ge.top)||0)/Kt*10,bottom:(Number(ge.bottom)||0)/Kt*10},W):"",(null==U?void 0:U.description)?me=U.description:Nt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),P={"highlight-color":Boolean(ne),multiline:O,"alignment-horizontal":ie,"alignment-vertical":se},T={"--divkit-input-hint-color":Qt,"--divkit-input-highlight-color":ne,"--divkit-input-line-height":Ht,"font-weight":Lt,"font-family":te,"letter-spacing":ee,color:re,"max-height":ve},M={"font-size":dt(Kt),padding:fe},N={"font-size":dt(Kt),padding:he},Wt&&Nt.json&&(Ut&&(Rt.unregisterFocusable(Ut),Ut=void 0),Nt.json.id&&!Nt.fakeElement&&(Ut=Nt.json.id,Rt.registerFocusable(Ut,{focus(){Wt&&Wt.focus()}}))),vt(),ft(),ht(),H(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Ct(),jt(),At(),Vt(),Ot(),Pt(),It(),Tt(),Xt?"":`${R(oe,"Outer").$$render(t,{cls:Ft("input",rn,P),style:T,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Nt,layoutParams:zt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return O?`<span${L("class",rn["input__scroll-wrapper"],0)}>${!Zt&&S?`<div${L("class",rn.input__placeholder,0)} aria-hidden="true"${L("style",ut(M),0)}>${I(S)}</div>`:""} <span${L("class",rn.input__aligner,0)} aria-hidden="true"${L("style",ut(N),0)}>​</span> <span${L("class",Ft("input__input",rn,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",me,0)}${L("style",ut(M),0)}${L("this",Wt,0)}>${n=Zt,void 0===n?"":n}</span></span>`:`<input${L("type",ue,0)}${L("inputmode",qt,0)}${L("class",Ft("input__input",rn,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",me,0)}${L("style",ut(M),0)}${L("placeholder",S,0)}${L("value",Gt,0)}${L("this",Wt,0)}>`;var n}})}`})),mn={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"},yn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,T,M,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;M=l(nt.direction,(t=>T=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")||qr("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=>A=t)),$=et.getDerivedFromVars(et.json.accessibility),W(),W=l($,(t=>j=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"===T?vt.end:vt.start)||Number(vt.right)||0)/mt*10,bottom:(Number(vt.bottom)||0)/mt*10,left:(Number("ltr"===T?vt.start:vt.end)||Number(vt.left)||0)/mt*10},T):"",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(A,1,_t),(null==j?void 0:j.description)?wt=j.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(),M(),Q(),K(),tt(),ct?"":`${R(oe,"Outer").$$render(t,{cls:Ft("select",mn,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",mn["select__select-text"],0)}${L("style",ut(E),0)} aria-hidden="true"> ${I(pt||U||"​")}</span> <select${L("class",Ft("select__select",mn,{"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",mn.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),bn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},_n=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A=i,F=i,V=i,D=i,S=i,O=i,P=i,I=i,{componentContext:T}=e,{layoutParams:M}=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";function rt(){const t=null==U?void 0:U.play();t&&t.catch((t=>{T.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}var nt,ot;v((()=>{B&&(z.unregisterInstance(B),B=void 0),H&&(H(),H=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==T&&r.componentContext(T),void 0===e.layoutParams&&r.layoutParams&&void 0!==M&&r.layoutParams(M),T.json&&(Y=!1,X=!1,Q=!1,K=!1,W=void 0,tt="fit"),o=T.json.elapsed_time_variable,a=o&&T.getVariable(o,"integer")||qr("temp","integer",0),a&&(H&&H(),H=a.subscribe((function(t){G?G=!1:U&&(U.currentTime=Number(t)/1e3)}))),s=T.getDerivedFromVars(T.json.video_sources),I(),I=l(s,(t=>j=t)),c=T.getDerivedFromVars(T.json.repeatable),P(),P=l(c,(t=>C=t)),u=T.getDerivedFromVars(T.json.autostart),A(),A=l(u,(t=>_=t)),d=T.getDerivedFromVars(T.json.muted),O(),O=l(d,(t=>E=t)),p=T.getDerivedFromVars(T.json.preload_required),S(),S=l(p,(t=>k=t)),g=T.getDerivedFromVars(T.json.preview),D(),D=l(g,(t=>x=t)),h=T.getDerivedFromVars(T.json.scale),V(),V=l(h,(t=>$=t)),m=T.getDerivedFromVars(T.json.aspect),F(),F=l(m,(t=>w=t)),nt=j,ot=Z,Z=Array.isArray(nt)&&nt.length?nt.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})):ot,Z.length?J=!1:(J=!0,T.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 T.json&&(B&&(z.unregisterInstance(B),B=void 0),!T.json.id||J||T.fakeElement||(B=T.json.id,z.registerInstance(B,{pause:function(){null==U||U.pause()},start:rt}))),T.json&&_&&U&&rt(),y={aspect:"0"!==et},b={"object-fit":tt},A(),F(),V(),D(),S(),O(),P(),I(),J?"":`${R(oe,"Outer").$$render(t,{cls:Ft("video",bn,y),customActions:"video",componentContext:T,layoutParams:M},{},{default:()=>y.aspect?`<div${L("class",bn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${et}%`})}><video${L("class",bn.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",bn.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>`})}`})),wn=_n,$n=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([M(s.json.custom_props||{})],{})}${L("this",undefined,0)}>${V(e)?"":`${d?`<template${S([M(p)],{})}> ${d}</template>`:""} ${!v&&o?`${N(i,(e=>`${R(En,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),xn=$n,kn={};kn.text=he,kn.container=Ie,kn.separator=Ne,kn.image=Ue,kn.gif=Ue,kn.grid=Ge,kn.gallery=or,kn.tabs=sr,kn.state=mr,kn.pager=_r,kn.indicator=kr,kn.slider=en,kn.input=hn,kn.select=yn,kn.video=wn,kn.custom=xn;const En=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)&&kn[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},{},{})}`:""})),Cn=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 jn(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 An(){}function Fn(t){return{subscribe:e=>(e(t),An)}}function Vn(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Dn(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Sn(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 On(t){try{return Sr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Pn(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function In(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,In.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function Tn(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}Fn(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(In,Error),In.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=Tn("",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+" | "+Tn("",o.column-1," ")+Tn("",u,"^")}else e+="\n at "+a}return e},In.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 Mn=Number.MAX_VALUE,Nn=Number.MIN_VALUE,zn="string",Rn="integer",Bn="number",Un="boolean",Wn="color",Ln="url",Hn="datetime",qn="dict",Jn="array";function Gn(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=>{Gn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Gn(t.left,e),Gn(t.right,e);break;case"UnaryExpression":Gn(t.argument,e);break;case"ConditionalExpression":Gn(t.test,e),Gn(t.consequent,e),Gn(t.alternate,e);break;case"TryExpression":Gn(t.test,e),Gn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Gn(t,e)}))}}function Zn(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Yn(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Xn(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 Yn(t.value);if("color"===t.type)return io(oo(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 Qn(t){let e=Xn(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Kn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function to(t,e){if(Ar)return Sr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function eo(t,e){if(e<Dr||e>Vr)throw new Error("Integer overflow.");!Ar&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function ro(t){const e=[];return Gn(t,{Variable(t){e.push(t.id.name)}}),e}function no(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function oo(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function io(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 ao(t){return io(oo(t))}function so(t){return{type:Bn,value:Number(t.value)}}const lo=new Map,co=new Map;function uo(t,e,r){const n={args:e,cb:r},o=lo.get(t)||[];lo.has(t)||lo.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");co.set(i,n)}function po(t,e){let r=t.args.length,n=t.args.length,o=0;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,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!==Bn||e[r].type!==Rn){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){return{type:zn,value:Xn(e)}}function go(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:Bn,value:r}}function fo(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=ao(i)),{type:n,value:i}}function ho(t,e,r){return fo(t,e,r,r.type)}function mo(t,e,r){return fo(t,e,r,"color")}function yo(t,e,r){return fo(t,e,r,"url")}const bo=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Rn,value:Sr(n)}},_o=bo("getUTCFullYear"),wo=bo("getUTCMonth"),$o=bo("getUTCDate"),xo=bo("getUTCDay"),ko=bo("getUTCHours"),Eo=bo("getUTCMinutes"),Co=bo("getUTCSeconds"),jo=bo("getUTCMilliseconds");function Ao(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===zn?e.value:Xn(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 Fo(t,e,r,n){const o=Ao(t,e,r,n);return{type:zn,value:o+Xn(e)}}function Vo(t,e,r,n){const o=Ao(t,e,r,n);return{type:zn,value:Xn(e)+o}}function Do(t){return(e,r)=>{const n=oo(r.value);return{type:Bn,value:n[t]/255}}}function So(t){return(e,r,n)=>{const o=oo(r.value);return o[t]=255*n.value,{type:Wn,value:io(o)}}}const Oo=Do("a"),Po=Do("r"),Io=Do("g"),To=Do("b"),Mo=So("a"),No=So("r"),zo=So("g"),Ro=So("b");function Bo(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=Sr(e.value)/Sr(r);return eo(t,o),"number"==typeof o&&(o=Math.floor(o)),n&&(o=Sr(o)%Sr(n)),{type:Rn,value:o}}const Uo=36e5;function Wo(t,e){return(r,n,...o)=>{let i=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}(n.value,o.map((t=>t.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){eo(r,i);try{i=Sr(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=ao(i)),{type:e,value:i}}}function Lo(t,e){return(r,n,o,...i)=>{try{return t(r,o,...i)}catch(t){let r=n.value;return"color"===e&&(r=ao(r)),{type:e,value:r}}}}const Ho=Wo("string","string"),qo=Wo("number","number"),Jo=Wo("number","integer"),Go=Wo("boolean","boolean"),Zo=Wo("string","color"),Yo=Wo("string","url"),Xo=Wo("array","array"),Qo=Wo("object","dict"),Ko=Lo(Ho,"string"),ti=Lo(qo,"number"),ei=Lo(Jo,"integer"),ri=Lo(Go,"boolean"),ni=Lo(Zo,"color"),oi=Lo(Yo,"url");function ii(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){eo(r,i);try{i=Sr(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=ao(i)),{type:e,value:i}}}function ai(t,e){return(r,n,o,i)=>{try{return t(r,n,o)}catch(t){let r=i.value;return"color"===e&&(r=ao(r)),{type:e,value:r}}}}const si=ii("string","string"),li=ii("number","number"),ci=ii("number","integer"),ui=ii("boolean","boolean"),di=ii("string","color"),pi=ii("string","url"),vi=ii("array","array"),gi=ii("object","dict"),fi=ai(si,"string"),hi=ai(li,"number"),mi=ai(ci,"integer"),yi=ai(ui,"boolean"),bi=ai(di,"color"),_i=ai(pi,"url");function wi(t){return t.map(Qn).join(", ")}uo("toString",[Rn],vo),uo("toString",[Bn],vo),uo("toString",[Un],vo),uo("toString",[Wn],vo),uo("toString",[Ln],vo),uo("toNumber",[Rn],go),uo("toNumber",[zn],go),uo("toInteger",[Bn],(function(t,e){if(e.value>Vr||e.value<Dr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Rn,value:Sr(r)}})),uo("toInteger",[zn],(function(t,e){let r;try{r=Sr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:Rn,value:r}})),uo("toInteger",[Un],(function(t,e){return{type:Rn,value:Sr(e.value?1:0)}})),uo("toBoolean",[Rn],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Un,value:r}})),uo("toBoolean",[zn],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Un,value:"true"===e.value?1:0}})),uo("toColor",[zn],(function(t,e){return{type:Wn,value:ao(e.value)}})),uo("toUrl",[zn],(function(t,e){return{type:Ln,value:e.value}})),uo("encodeUri",[zn],(function(t,e){try{return{type:zn,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),uo("decodeUri",[zn],(function(t,e){try{return{type:zn,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),uo("getIntegerValue",[zn,Rn],ho),uo("getNumberValue",[zn,Bn],ho),uo("getBooleanValue",[zn,Un],ho),uo("getStringValue",[zn,zn],ho),uo("getColorValue",[zn,Wn],mo),uo("getColorValue",[zn,zn],mo),uo("getUrlValue",[zn,Ln],yo),uo("getUrlValue",[zn,zn],yo),uo("parseUnixTime",[Rn],(function(t,e){return{type:Hn,value:new Date(1e3*Number(e.value))}})),uo("nowLocal",[],(function(){return{type:Hn,value:new Date}})),uo("addMillis",[Hn,Rn],(function(t,e,r){return{type:Hn,value:new Date(e.value.getTime()+Number(r.value))}})),uo("setYear",[Hn,Rn],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Hn,value:n}})),uo("setMonth",[Hn,Rn],(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:Hn,value:o}})),uo("setDay",[Hn,Rn],(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 ${Xn(e)}.`);return n.setUTCDate(-1===o?0:o),{type:Hn,value:n}})),uo("setHours",[Hn,Rn],(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:Hn,value:o}})),uo("setMinutes",[Hn,Rn],(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:Hn,value:o}})),uo("setSeconds",[Hn,Rn],(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:Hn,value:o}})),uo("setMillis",[Hn,Rn],(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:Hn,value:o}})),uo("getYear",[Hn],_o),uo("getMonth",[Hn],wo),uo("getDay",[Hn],$o),uo("getDayOfWeek",[Hn],xo),uo("getHours",[Hn],ko),uo("getMinutes",[Hn],Eo),uo("getSeconds",[Hn],Co),uo("getMillis",[Hn],jo),uo("getIntervalSeconds",[Rn],(function(t,e){return Bo(t,e,1e3,60)})),uo("getIntervalTotalSeconds",[Rn],(function(t,e){return Bo(t,e,1e3)})),uo("getIntervalMinutes",[Rn],(function(t,e){return Bo(t,e,6e4,60)})),uo("getIntervalTotalMinutes",[Rn],(function(t,e){return Bo(t,e,6e4)})),uo("getIntervalHours",[Rn],(function(t,e){return Bo(t,e,Uo,24)})),uo("getIntervalTotalHours",[Rn],(function(t,e){return Bo(t,e,Uo)})),uo("getIntervalTotalDays",[Rn],(function(t,e){return Bo(t,e,864e5)})),uo("getIntervalTotalWeeks",[Rn],(function(t,e){return Bo(t,e,6048e5)})),uo("len",[zn],(function(t,e){return{type:Rn,value:Sr(e.value.length)}})),uo("contains",[zn,zn],(function(t,e,r){return{type:Un,value:e.value.includes(r.value)?1:0}})),uo("substring",[zn,Rn,Rn],(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:zn,value:e.value.substring(Number(r.value),Number(n.value))}})),uo("replaceAll",[zn,zn,zn],(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:zn,value:o}})),uo("index",[zn,zn],(function(t,e,r){return{type:Rn,value:Sr(e.value.indexOf(r.value))}})),uo("lastIndex",[zn,zn],(function(t,e,r){return{type:Rn,value:Sr(e.value.lastIndexOf(r.value))}})),uo("trim",[zn],(function(t,e){return{type:zn,value:e.value.trim()}})),uo("trimLeft",[zn],(function(t,e){return{type:zn,value:e.value.replace(/^\s+/,"")}})),uo("trimRight",[zn],(function(t,e){return{type:zn,value:e.value.replace(/\s+$/,"")}})),uo("toUpperCase",[zn],(function(t,e){return{type:zn,value:e.value.toUpperCase()}})),uo("toLowerCase",[zn],(function(t,e){return{type:zn,value:e.value.toLowerCase()}})),uo("padStart",[zn,Rn,zn],Fo),uo("padStart",[Rn,Rn,zn],Fo),uo("padEnd",[zn,Rn,zn],Vo),uo("padEnd",[Rn,Rn,zn],Vo),uo("testRegex",[zn,zn],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Un,value:n.test(e.value)?1:0}})),uo("div",[Rn,Rn],(function(t,e,r){if(r.value===Or)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=to(0,n),eo(t,n),{type:Rn,value:n}})),uo("div",[Bn,Bn],(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:Bn,value:n}})),uo("mod",[Rn,Rn],(function(t,e,r){if(r.value===Or)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=to(0,n),eo(t,n),{type:Rn,value:n}})),uo("mod",[Bn,Bn],(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:Bn,value:n}})),uo("mul",[{type:Rn,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Or;for(let n=1;n<e.length;++n)r*=e[n].value,r=to(0,r),eo(t,r);return{type:Rn,value:r}})),uo("mul",[{type:Bn,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:Bn,value:r}})),uo("sub",[{type:Rn,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Or;for(let n=1;n<e.length;++n)r-=e[n].value,r=to(0,r),eo(t,r);return{type:Rn,value:r}})),uo("sub",[{type:Bn,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:Bn,value:r}})),uo("sum",[{type:Rn,isVararg:!0}],(function(t,...e){let r=Or;for(let n=0;n<e.length;++n)r+=e[n].value,r=to(0,r),eo(t,r);return{type:Rn,value:r}})),uo("sum",[{type:Bn,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Bn,value:r}})),uo("abs",[Rn],(function(t,e){const r=Pr(e.value);return eo(t,r),{type:e.type,value:r}})),uo("abs",[Bn],(function(t,e){const r=Math.abs(e.value);return{type:Bn,value:r}})),uo("max",[{type:Rn,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:Rn,value:r}})),uo("max",[{type:Bn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Bn,value:Math.max(...e.map((t=>t.value)))}})),uo("min",[{type:Rn,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:Rn,value:r}})),uo("min",[{type:Bn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Bn,value:Math.min(...e.map((t=>t.value)))}})),uo("maxNumber",[],(function(){return{type:Bn,value:Mn}})),uo("minNumber",[],(function(){return{type:Bn,value:Nn}})),uo("maxInteger",[],(function(t){return eo(t,Vr),{type:Rn,value:Vr}})),uo("minInteger",[],(function(t){return eo(t,Dr),{type:Rn,value:Dr}})),uo("round",[Bn],(function(t,e){const r=Math.sign(e.value);return{type:Bn,value:r*Math.round(Math.abs(e.value))}})),uo("floor",[Bn],(function(t,e){return{type:Bn,value:Math.floor(e.value)}})),uo("ceil",[Bn],(function(t,e){return{type:Bn,value:Math.ceil(e.value)}})),uo("signum",[Rn],(function(t,e){return{type:Rn,value:Ir(e.value)}})),uo("signum",[Bn],(function(t,e){return{type:Bn,value:Math.sign(e.value)}})),uo("copySign",[Rn,Rn],(function(t,e,r){let n;if(r.value===Or)n=e.value;else if(e.value===Or)n=Sr(0);else{const t=Ir(r.value);n=Pr(e.value)*t}return eo(t,n),{type:Rn,value:n}})),uo("copySign",[Bn,Bn],(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:Bn,value:o}})),uo("getColorAlpha",[zn],Oo),uo("getColorAlpha",[Wn],Oo),uo("getColorRed",[zn],Po),uo("getColorRed",[Wn],Po),uo("getColorGreen",[zn],Io),uo("getColorGreen",[Wn],Io),uo("getColorBlue",[zn],To),uo("getColorBlue",[Wn],To),uo("setColorAlpha",[zn,Bn],Mo),uo("setColorAlpha",[Wn,Bn],Mo),uo("setColorRed",[zn,Bn],No),uo("setColorRed",[Wn,Bn],No),uo("setColorGreen",[zn,Bn],zo),uo("setColorGreen",[Wn,Bn],zo),uo("setColorBlue",[zn,Bn],Ro),uo("setColorBlue",[Wn,Bn],Ro),uo("rgb",[Bn,Bn,Bn],(function(t,e,r,n){const o={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Wn,value:io(o)}})),uo("argb",[Bn,Bn,Bn,Bn],(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:Wn,value:io(i)}})),uo("getDictString",[qn,{type:zn,isVararg:!0}],Ho),uo("getStringFromDict",[qn,{type:zn,isVararg:!0}],Ho),uo("getDictNumber",[qn,{type:zn,isVararg:!0}],qo),uo("getNumberFromDict",[qn,{type:zn,isVararg:!0}],qo),uo("getDictInteger",[qn,{type:zn,isVararg:!0}],Jo),uo("getIntegerFromDict",[qn,{type:zn,isVararg:!0}],Jo),uo("getDictBoolean",[qn,{type:zn,isVararg:!0}],Go),uo("getBooleanFromDict",[qn,{type:zn,isVararg:!0}],Go),uo("getDictColor",[qn,{type:zn,isVararg:!0}],Zo),uo("getColorFromDict",[qn,{type:zn,isVararg:!0}],Zo),uo("getDictUrl",[qn,{type:zn,isVararg:!0}],Yo),uo("getUrlFromDict",[qn,{type:zn,isVararg:!0}],Yo),uo("getDictOptString",[zn,qn,{type:zn,isVararg:!0}],Ko),uo("getOptStringFromDict",[zn,qn,{type:zn,isVararg:!0}],Ko),uo("getDictOptNumber",[Bn,qn,{type:zn,isVararg:!0}],ti),uo("getOptNumberFromDict",[Bn,qn,{type:zn,isVararg:!0}],ti),uo("getDictOptInteger",[Rn,qn,{type:zn,isVararg:!0}],ei),uo("getOptIntegerFromDict",[Rn,qn,{type:zn,isVararg:!0}],ei),uo("getDictOptBoolean",[Un,qn,{type:zn,isVararg:!0}],ri),uo("getOptBooleanFromDict",[Un,qn,{type:zn,isVararg:!0}],ri),uo("getDictOptColor",[Wn,qn,{type:zn,isVararg:!0}],ni),uo("getOptColorFromDict",[Wn,qn,{type:zn,isVararg:!0}],ni),uo("getDictOptColor",[zn,qn,{type:zn,isVararg:!0}],ni),uo("getOptColorFromDict",[zn,qn,{type:zn,isVararg:!0}],ni),uo("getDictOptUrl",[zn,qn,{type:zn,isVararg:!0}],oi),uo("getOptUrlFromDict",[zn,qn,{type:zn,isVararg:!0}],oi),uo("getDictOptUrl",[Ln,qn,{type:zn,isVararg:!0}],oi),uo("getOptUrlFromDict",[Ln,qn,{type:zn,isVararg:!0}],oi),uo("getDictFromDict",[qn,{type:zn,isVararg:!0}],Qo),uo("getArrayFromDict",[qn,{type:zn,isVararg:!0}],Xo),uo("getOptArrayFromDict",[qn,{type:zn,isVararg:!0}],(function(t,e,...r){try{return Xo(t,e,...r)}catch(t){return{type:Jn,value:[]}}})),uo("getOptDictFromDict",[qn,{type:zn,isVararg:!0}],(function(t,e,...r){try{return Qo(t,e,...r)}catch(t){return{type:qn,value:{}}}})),uo("getArrayString",[Jn,Rn],si),uo("getStringFromArray",[Jn,Rn],si),uo("getArrayNumber",[Jn,Rn],li),uo("getNumberFromArray",[Jn,Rn],li),uo("getArrayInteger",[Jn,Rn],ci),uo("getIntegerFromArray",[Jn,Rn],ci),uo("getArrayBoolean",[Jn,Rn],ui),uo("getBooleanFromArray",[Jn,Rn],ui),uo("getArrayColor",[Jn,Rn],di),uo("getColorFromArray",[Jn,Rn],di),uo("getArrayUrl",[Jn,Rn],pi),uo("getUrlFromArray",[Jn,Rn],pi),uo("getArrayFromArray",[Jn,Rn],vi),uo("getDictFromArray",[Jn,Rn],gi),uo("getArrayOptString",[Jn,Rn,zn],fi),uo("getOptStringFromArray",[Jn,Rn,zn],fi),uo("getArrayOptNumber",[Jn,Rn,Bn],hi),uo("getOptNumberFromArray",[Jn,Rn,Bn],hi),uo("getArrayOptInteger",[Jn,Rn,Rn],mi),uo("getOptIntegerFromArray",[Jn,Rn,Rn],mi),uo("getArrayOptBoolean",[Jn,Rn,Un],yi),uo("getOptBooleanFromArray",[Jn,Rn,Un],yi),uo("getArrayOptColor",[Jn,Rn,Wn],bi),uo("getOptColorFromArray",[Jn,Rn,Wn],bi),uo("getArrayOptColor",[Jn,Rn,zn],bi),uo("getOptColorFromArray",[Jn,Rn,zn],bi),uo("getArrayOptUrl",[Jn,Rn,Ln],_i),uo("getOptUrlFromArray",[Jn,Rn,Ln],_i),uo("getArrayOptUrl",[Jn,Rn,zn],_i),uo("getOptUrlFromArray",[Jn,Rn,zn],_i),uo("getOptArrayFromArray",[Jn,Rn],(function(t,e,r){try{return vi(t,e,r)}catch(t){return{type:Jn,value:[]}}})),uo("getOptDictFromArray",[Jn,Rn],(function(t,e,r){try{return gi(t,e,r)}catch(t){return{type:qn,value:{}}}})),uo("len",[Jn],(function(t,e){return{type:Rn,value:Sr(e.value.length)}}));const $i={StringLiteral:function(t,e){return{type:zn,value:e.value}},NumberLiteral:function(t,e){return{type:Bn,value:e.value}},IntegerLiteral:function(t,e){return eo(t,e.value),{type:Rn,value:e.value}},BooleanLiteral:function(t,e){return{type:Un,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Zn(xi(t,e.argument));switch(e.operator){case"!":if(r.type===Un)return{type:Un,value:r.value?0:1};no(`${e.operator}${Qn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Rn){const e=r.value*Sr(n);return eo(t,e),{type:Rn,value:e}}if(r.type===Bn)return{type:Bn,value:r.value*n};no(`${e.operator}${Qn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Zn(xi(t,e.test));if(r.type===Un)return r.value?xi(t,e.consequent):xi(t,e.alternate);no(`${Qn(r)} ? ${Qn(xi(t,e.consequent))} : ${Qn(xi(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return xi(t,e.test)}catch(r){return xi(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return xi(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Xn(xi(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:zn,value:r}},LogicalExpression:function(t,e){const r=Zn(xi(t,e.left));if(r.type!==Un&&no(`${Qn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Un,value:0};const n=Zn(xi(t,e.right));return n.type!==Un&&no(`${Qn(r)} ${e.operator} ${Qn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Kn(n.type)}.`),{type:Un,value:n.value}},BinaryExpression:function(t,e){const r=e.operator;let n=xi(t,e.left),o=xi(t,e.right);if(("number"===n.type&&"integer"===o.type||"integer"===n.type&&"number"===o.type)&&("integer"===n.type?n=so(n):"integer"===o.type&&(o=so(o))),n.type!==o.type&&no(`${Qn(n)} ${e.operator} ${Qn(o)}`,`Operator '${r}' cannot be applied to different types: ${Kn(n.type)} and ${Kn(o.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Hn&&r.type===Hn?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Un,value:n?1:0}}(r,n,o);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Bn&&e.type!==Rn&&e.type!==Hn&&no(`${Qn(e)} ${t} ${Qn(r)}`,`Operator '${t}' cannot be applied to ${Kn(e.type)} type.`);const o=e.type===Hn?e.value.getTime():e.value,i=r.type===Hn?r.value.getTime():r.value;return n=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:Un,value:n?1:0}}(r,n,o);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==zn&&r.type!==Bn&&r.type!==Rn&&no(`${Qn(r)} ${e} ${Qn(n)}`,`Operator '${e}' cannot be applied to ${Kn(r.type)} type.`),r.type===zn)return"-"===e&&no(`${Qn(r)} - ${Qn(n)}`,`Operator '${e}' cannot be applied to ${Kn(r.type)} type.`),{type:zn,value:r.value+n.value};let o="+"===e?r.value+n.value:r.value-n.value;if(r.type===Rn)try{o=to(0,o),eo(t,o)}catch(t){no(`${Qn(r)} ${e} ${Qn(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!==Rn&&r.type!==Bn&&no(`${Qn(r)} ${e} ${Qn(n)}`,`Operator '${e}' cannot be applied to ${Kn(r.type)} type.`),"*"===e)o=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&no(`${Qn(r)} ${e} ${Qn(n)}`,"Division by zero is not supported."),o="/"===e?r.value/n.value:r.value%n.value}if(r.type===Rn)try{o=to(0,o),eo(t,o)}catch(t){no(`${Qn(r)} ${e} ${Qn(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=>xi(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(co.has(i))n=co.get(i);else{const t=function(t,e){const r=lo.get(t);if(!r)return{type:"missing"};let n=null,o=null;for(let t=0;t<r.length;++t){const i=po(r[t],e);"match"!==i.type?n||(n=i):(!o||o.conversions>i.conversions)&&(o={func:r[t],conversions:i.conversions})}if(!o){if(n)return n;throw new Error("Missing function")}return o}(r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>Kn(t.type))).join(", "),n=`${r}(${wi(o)})`;"few"===t.type&&0===o.length?no(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?no(n,`Function '${r}' has no matching override for given argument types: ${e}.`):no(n,`Unknown function name: ${r}.`)}n=t.func,t.conversions&&(o=function(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===Bn&&e.type===Rn?so(e):e}))}(n,o))}if(!n)throw new Error("Function not found");try{return n.cb(t,...o)}catch(t){no(`${r}(${wi(o)})`,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 xi(t,e){if(e.type in $i)return $i[e.type](t,e);throw new Error("Unsupported expression")}class ki{constructor(t){this.ast=t}apply(t,e,r=!1){try{const n=function(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},n=xi(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);n.warnings.forEach(e);const o=n.result;if("error"===o.type)return void e(st(new Error("Expression execution error"),{additional:{message:o.value}}));const i=o.value;if(i instanceof Date)return Yn(i);if("boolean"===o.type)return Boolean(i);if("color"===o.type){const t=ft(String(i));if(t)return io(t);e(st(new Error("Expression execution error")))}if("integer"===o.type)return i>2147483647||i<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(i);if(!r&&("array"===o.type||"dict"===o.type))try{return JSON.stringify(i)}catch(t){return e(st(new Error(`Failed to stringify ${o.type}`))),`<${o.type}>`}return i}catch(t){return void e(st(new Error("Expression execution error")))}}}function Ei(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:Ve,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=De();r!==n;)e.push(r),r=De();return ye=t,Ot(e)}},a=Ve,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",j="!",A="(",F=")",V=",",D="'",S=".",O="e",P="E",I="true",T="false",M=/^[^}]/,N=/^[^'}]/,z=/^[0-9]/,R=/^[a-zA-Z_0-9.]/,B=/^[a-zA-Z_]/,U=/^[ \t\r\n]/,W=ke("@{",!1),L=ke("}",!1),H=ke("@{}",!1),q=ke("\\",!1),J={type:"any"},G=Ee(["}"],!0,!1),Z=ke("?",!1),Y=ke(":",!1),X=ke("!:",!1),Q=ke("||",!1),K=ke("&&",!1),tt=ke("==",!1),et=ke("!=",!1),rt=ke(">=",!1),nt=ke(">",!1),ot=ke("<=",!1),it=ke("<",!1),at=ke("+",!1),st=ke("-",!1),lt=ke("/",!1),ct=ke("*",!1),ut=ke("%",!1),dt=ke("!",!1),pt=ke("(",!1),vt=ke(")",!1),gt=ke(",",!1),ft=Ce("string"),ht=ke("'",!1),mt=Ee(["'","}"],!0,!1),yt=Ce("integer"),bt=Ee([["0","9"]],!1,!1),_t=Ce("number"),wt=ke(".",!1),$t=ke("e",!1),xt=ke("E",!1),kt=Ce("boolean"),Et=ke("true",!1),Ct=ke("false",!1),jt=Ee([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),At=Ce("identifier"),Ft=Ee([["a","z"],["A","Z"],"_"],!1,!1),Vt=Ce("whitespace"),Dt=Ee([" ","\t","\r","\n"],!1,!1),St=function(t){return t},Ot=function(t){return Sn(t)},Pt=function(t){return t},It=function(){return""},Tt=function(){return xe()},Mt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(t){return t},Rt=function(t){return Pn(t)},Bt=function(){throw new Error("Error tokenizing '"+t+"'.")},Ut=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Wt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Lt=function(t,e){return Dn(t,e)},Ht=function(t,e){return Dn(t,e)},qt=function(t,e){return Vn(t,e)},Jt=function(t,e){return Vn(t,e)},Gt=function(t,e){return Vn(t,e)},Zt=function(t,e){return Vn(t,e)},Yt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Xt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Qt=function(t){return{type:"Variable",id:t}},Kt=function(t,e){return[t,...e]},te=function(t){return t},ee=function(t){return t},re=function(t){return Sn(t)},ne=function(t){return t},oe=function(){return""},ie=function(){return xe()},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(t){return t},ce=function(t){return Pn(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:On(xe())}},pe=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ve=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ge=function(){return{type:"BooleanLiteral",value:!0}},fe=function(){return{type:"BooleanLiteral",value:!1}},he=function(){return{type:"Identifier",name:xe()}},me=0,ye=0,be=[{line:1,column:1}],_e=0,we=[],$e=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 xe(){return t.substring(ye,me)}function ke(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ee(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ce(t){return{type:"other",description:t}}function je(e){var r,n=be[e];if(n)return n;for(r=e-1;!be[r];)r--;for(n={line:(n=be[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return be[e]=n,n}function Ae(t,e,r){var n=je(t),i=je(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 Fe(t){me<_e||(me>_e&&(_e=me,we=[]),we.push(t))}function Ve(){var t,e;return t=me,He(),(e=Se())!==n?(He(),ye=t,t=St(e)):(me=t,t=n),t}function De(){var e,r,o,i,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n?(o=He(),(i=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(L)),a!==n?(ye=e,e=Pt(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=It()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(o=u,me++):(o=n,0===$e&&Fe(q)),o===n&&(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W))),$e--,o===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=Tt()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n){if(o=[],M.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(G)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(G));else o=n;o!==n?(125===t.charCodeAt(me)?(i=l,me++):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=Mt()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n&&(ye=e,r=Nt()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=zt(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=Rt(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=Bt()),e=r))))}return e}function Se(){var e,r,o,i,a,s;return e=me,(r=Oe())!==n?(He(),63===t.charCodeAt(me)?(o=d,me++):(o=n,0===$e&&Fe(Z)),o!==n?(He(),(i=Se())!==n?(He(),58===t.charCodeAt(me)?(a=p,me++):(a=n,0===$e&&Fe(Y)),a!==n?(He(),(s=Se())!==n?(ye=e,e=Ut(r,i,s)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Oe()),e}function Oe(){var e,r,o,i;return e=me,(r=Pe())!==n?(He(),t.substr(me,2)===v?(o=v,me+=2):(o=n,0===$e&&Fe(X)),o!==n?(He(),(i=Se())!==n?(ye=e,e=Wt(r,i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Pe()),e}function Pe(){var e,r,o,i,a,s,l,c;if(e=me,(r=Ie())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Lt(r,o)}else me=e,e=n;return e}function Ie(){var e,r,o,i,a,s,l,c;if(e=me,(r=Te())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Te())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Te())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Ht(r,o)}else me=e,e=n;return e}function Te(){var e,r,o,i,a,s,l,c;if(e=me,(r=Me())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Me())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Me())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=qt(r,o)}else me=e,e=n;return e}function Me(){var e,r,o,i,a,s,l,c;if(e=me,(r=Ne())!==n){for(o=[],i=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(ot)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(it))))),s!==n?(l=He(),(c=Ne())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(ot)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(it))))),s!==n?(l=He(),(c=Ne())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Jt(r,o)}else me=e,e=n;return e}function Ne(){var e,r,o,i,a,s,l,c;if(e=me,(r=ze())!==n){for(o=[],i=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Gt(r,o)}else me=e,e=n;return e}function ze(){var e,r,o,i,a,s,l,c;if(e=me,(r=Re())!==n){for(o=[],i=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?i=a=[a,s,l,c]:(me=i,i=n)):(me=i,i=n);ye=e,e=Zt(r,o)}else me=e,e=n;return e}function Re(){var e,r,o;return(e=We())===n&&(e=Ue())===n&&(e=me,33===t.charCodeAt(me)?(r=j,me++):(r=n,0===$e&&Fe(dt)),r===n&&(43===t.charCodeAt(me)?(r=$,me++):(r=n,0===$e&&Fe(at)),r===n&&(45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)))),r!==n?(He(),(o=Re())!==n?(ye=e,e=Yt(r,o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=function(){var e,r,o,i,a;return e=me,(r=Le())!==n?(He(),40===t.charCodeAt(me)?(o=A,me++):(o=n,0===$e&&Fe(pt)),o!==n?(He(),i=function(){var e,r,o,i,a,s;if(e=me,(r=Se())!==n){for(o=[],i=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?i=s:(me=i,i=n)):(me=i,i=n);i!==n;)o.push(i),i=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?i=s:(me=i,i=n)):(me=i,i=n);ye=e,e=Kt(r,o)}else me=e,e=n;return e===n&&(e=He()),e}(),i!==n?(He(),41===t.charCodeAt(me)?(a=F,me++):(a=n,0===$e&&Fe(vt)),a!==n?(ye=e,e=Xt(r,i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,(r=Le())!==n&&(ye=e,r=Qt(r)),(e=r)===n&&(e=function(){var e,r,o,i;return e=function(){var e,r,o,i;return $e++,e=me,39===t.charCodeAt(me)?(r=D,me++):(r=n,0===$e&&Fe(ht)),r!==n?(o=function(){var t,e,r;for(t=me,e=[],r=Be();r!==n;)e.push(r),r=Be();return ye=t,re(e)}(),39===t.charCodeAt(me)?(i=D,me++):(i=n,0===$e&&Fe(ht)),i!==n?(ye=e,e=ee(o)):(me=e,e=n)):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(ft)),e}(),e===n&&(e=We())===n&&(e=Ue())===n&&(e=function(){var e,r;return $e++,e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r!==n&&(ye=e,r=ge()),(e=r)===n&&(e=me,t.substr(me,5)===T?(r=T,me+=5):(r=n,0===$e&&Fe(Ct)),r!==n&&(ye=e,r=fe()),e=r),$e--,e===n&&(r=n,0===$e&&Fe(kt)),e}(),e===n&&(e=me,40===t.charCodeAt(me)?(r=A,me++):(r=n,0===$e&&Fe(pt)),r!==n?(He(),(o=Se())!==n?(He(),41===t.charCodeAt(me)?(i=F,me++):(i=n,0===$e&&Fe(vt)),i!==n?(ye=e,e=te(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n))),e}())),e}())),e}function Be(){var e,r,o,i,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n?(o=He(),(i=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(L)),a!==n?(ye=e,e=ne(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=oe()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(o=u,me++):(o=n,0===$e&&Fe(q)),o===n&&(39===t.charCodeAt(me)?(o=D,me++):(o=n,0===$e&&Fe(ht)),o===n&&(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W)))),$e--,o===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=ie()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n){if(o=[],N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(mt)),i!==n)for(;i!==n;)o.push(i),N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(mt));else o=n;o!==n?(125===t.charCodeAt(me)?(i=l,me++):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=ae()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(W)),r!==n&&(ye=e,r=se()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(o=s,me+=2):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=le(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(J)),o!==n?(ye=e,e=ce(o)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=ue()),e=r))))}return e}function Ue(){var e,r,o,i;if($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt)),i!==n)for(;i!==n;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));else o=n;return o!==n?(ye=e,e=de()):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(yt)),e}function We(){var e,r,o,i,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));i!==n;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));if(46===t.charCodeAt(me)?(i=S,me++):(i=n,0===$e&&Fe(wt)),i!==n){if(a=[],z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt)),s!==n)for(;s!==n;)a.push(s),z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt));else a=n;if(a!==n){if(s=me,101===t.charCodeAt(me)?(l=O,me++):(l=n,0===$e&&Fe($t)),l===n&&(69===t.charCodeAt(me)?(l=P,me++):(l=n,0===$e&&Fe(xt))),l!==n){if(43===t.charCodeAt(me)?(c=$,me++):(c=n,0===$e&&Fe(at)),c===n&&(45===t.charCodeAt(me)?(c=x,me++):(c=n,0===$e&&Fe(st))),c===n&&(c=null),u=[],z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt)),d!==n)for(;d!==n;)u.push(d),z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt));else u=n;u!==n?s=l=[l,c,u]:(me=s,s=n)}else me=s,s=n;s===n&&(s=null),ye=e,e=pe()}else me=e,e=n}else me=e,e=n;if(e===n){if(e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt)),i!==n)for(;i!==n;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(bt));else o=n;if(o!==n)if(101===t.charCodeAt(me)?(i=O,me++):(i=n,0===$e&&Fe($t)),i===n&&(69===t.charCodeAt(me)?(i=P,me++):(i=n,0===$e&&Fe(xt))),i!==n){if(43===t.charCodeAt(me)?(a=$,me++):(a=n,0===$e&&Fe(at)),a===n&&(45===t.charCodeAt(me)?(a=x,me++):(a=n,0===$e&&Fe(st))),a===n&&(a=null),s=[],z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt)),l!==n)for(;l!==n;)s.push(l),z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt));else s=n;s!==n?(ye=e,e=ve()):(me=e,e=n)}else me=e,e=n;else me=e,e=n}return $e--,e===n&&(r=n,0===$e&&Fe(_t)),e}function Le(){var e,r,o,i,a;if($e++,e=me,r=me,$e++,o=function(){var e,r,o,i;return e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r===n&&(t.substr(me,5)===T?(r=T,me+=5):(r=n,0===$e&&Fe(Ct))),r!==n?(o=me,$e++,R.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(jt)),$e--,i===n?o=void 0:(me=o,o=n),o!==n?e=r=[r,o]:(me=e,e=n)):(me=e,e=n),e}(),$e--,o===n?r=void 0:(me=r,r=n),r!==n)if(B.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(Ft)),o!==n){for(i=[],R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));a!==n;)i.push(a),R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));ye=e,e=he()}else me=e,e=n;else me=e,e=n;return $e--,e===n&&(r=n,0===$e&&Fe(At)),e}function He(){var e,r;for($e++,e=[],U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));r!==n;)e.push(r),U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));return $e--,r=n,0===$e&&Fe(Vt),e}if((r=a())!==n&&me===t.length)return r;throw r!==n&&me<t.length&&Fe({type:"end"}),function(t,e,r){return new In(In.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Ae(_e,_e+1):Ae(_e,_e))}(t,{startRule:"JsonStringContents"}),n=ro(r);return e.vars.push(...n),new ki(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=>Ei(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Ei(t[o],e,r);return n}}var n;return t}function Ci(t,e,r,n=!1){if(t){if(t instanceof ki)return t.apply(e,r,n);if(Array.isArray(t))return t.map((t=>Ci(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Ci(t[o],e,r);return n}}return t}function ji(t,e){const r={vars:[],hasExpression:!1},n=Ei(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:(t,r)=>Ci(n,t,e,r)}}const Ai={pagers:function(){return Q(new Map)}},Fi=new Map,Vi=new Map;function Di(t){const e=Fi.get(t)||Q("");return Fi.has(t)||Fi.set(t,e),e}function Si(t){const e=Vi.get(t)||new Map;return Vi.has(t)||Vi.set(t,e),e}class Oi{setVariable(t){const e=t.getName(),r=Si(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Di(this).set(e)}getVariable(t){return Si(this).get(t)}list(){return Si(this).values()}}function Pi(){return new Oi}function Ii(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 Ti=new Set(["start","stop","pause","resume","cancel","reset"]);class Mi{constructor(t){Ii(this,"timers",new Map),Ii(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)&&Ti.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 Ni(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}}))}let zi=Q(!0),Ri=0;function Bi(){zi.set(!1)}function Ui(){zi.set(!0)}function Wi(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Li=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 Oi}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:j}=e,{onStat:A}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:T="ltr"}=e,M=Q("desktop"===b);if(s=l(M,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");M.set(!t.matches),t.addListener((()=>{M.set(!t.matches)}))}let N="light",z=null;const B=Q("rtl"===T?"rtl":"ltr");function U(t){_=t}function W(){return new Map}function H(){return new Map}function q(t){y=t}u=l(B,(t=>c=t));const J=new Set(E);let G=!1,Z=!1;m||(Z=!0,dt(st(new Error('"id" prop is required'))));const Y={stateChange:!1},X=Di(w),tt=Si(w),et=new Map,rt=new Map,ot=new Map;let it=null,lt=0,ct=[];function ut(t,e,r,n=!1){const o=ji(e,t);if(!o.hasExpression)return e;const i=Wi(rt,r);return o.applyVars(i,n)}function dt(t){j?j({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function pt(t,e){A&&A({type:t,action:e})}function vt(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}=jn(t,e,o,dt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let gt=0;function ft(t){return`${m}-${gt++}`}let ht={},yt={};function bt(t){_t(ut(dt,t))}async function _t(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Wt(t))return;const i=(null==e?void 0:e.logError)||dt;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=St,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=Ft(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=rt.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");it?it.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)||dt;if(t){const r=Ft(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)||dt;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=Ct.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 wt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Ct.get(t.id);e&&e.replaceWith(t.id,t.items)})),wt(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}})),wt(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)||dt;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=At.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&ct.some((e=>e.desc.id===t)))return;const a={internalId:++lt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};ct=[...ct,a];const s=null!==(n=i.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,ct=ct.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)||dt;t?ct=ct.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;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=rt.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}})):Ni(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)}}))}(rt,i,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:o}=r;"number"==typeof o?Ni(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}}))}(rt,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&&jt.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 wt(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,J)){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 _t(n,e.componentContext),await $()):n.log_id&&($t(n),await $())}else i&&await _t(n,e.componentContext)}r.forEach((t=>{t.log_id&&pt("click",t)}))}function $t(t){null==F||F(t)}const Et=new Map,Ct=new Map,jt=new Map,At=new Map;function Ft(t){if(Et.has(t))return Et.get(t);dt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Dt=new Map;g(at,{logStat:pt,hasTemplate:function(t){return t in o},processTemplate:vt,genId:ft,genClass:function(t){return`divkit-${ft()}`},execAction:_t,execCustomAction:$t,isRunning:function(t){return Y[t]},setRunning:function(t,e){Y[t]=e},registerInstance:function(t,e){Et.has(t)?dt(st(new Error("Duplicate instance id"),{additional:{id:t}})):Et.set(t,e)},unregisterInstance:function(t){Et.delete(t)},registerParentOf:function(t,e){Ct.set(t,e)},unregisterParentOf:function(t){Ct.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(At.has(r)&&dt(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),At.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(At.delete(e),ct.some((t=>t.desc.id===e))&&(ct=ct.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){ct=ct.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){jt.set(t,e)},unregisterFocusable:function(t){jt.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(yt[r]=yt[r]||0,++yt[r],ht[r])return ht[r];const n=`${ft()}-svg-filter`;return ht=Object.assign(Object.assign({},ht),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;yt[r]&&0==--yt[r]&&(ht=Object.keys(ht).reduce(((t,e)=>(yt[e]&&(t[e]=ht[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Yr))throw new Error("Unsupported variable type");return new Yr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return Dt.has(t)||function(t){Dt.has(t)||Dt.set(t,Ai[t]())}(t),Dt.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return J},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:rt,logError:dt}},typefaceProvider:D,isDesktop:M,isPointerFocus:zi,customComponents:P,direction:B,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const St={setState(t){throw new Error("Not implemented")},getChild(t){if(Ot&&Ot.has(t))return Ot.get(t);dt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Ot=null;function Pt(t){if(t.type in Hr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&dt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=qr(t.name,t.type,t.value);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Ot||(Ot=new Map),Ot.has(t)?dt(st(new Error("Duplicate state with id"),{additional:{id:t}})):Ot.set(t,e)},unregisterInstance(t){null==Ot||Ot.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 It=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(It)&&It.forEach((t=>{if(t&&t.name){if(et.has(t.name))return void dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Pt(t)}}));const Tt=y.palette;Tt&&Tt[N].forEach((t=>{if(et.has(t.name))dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=qr(t.name,"color",t.color);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of tt)rt.has(t)||rt.set(t,e);X.subscribe((t=>{if(t&&!rt.has(t)){const e=tt.get(t);rt.set(t,e);const r=ot.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Mt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Mt&&"undefined"!=typeof document){const t=it=new Mi({logError:dt,applyVars:t=>ut(dt,t),hasVariableWithType:function(t,e){const r=rt.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=rt.get(t);r?r.setValue(e):dt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:wt});Mt.forEach((e=>t.createTimer(e)))}const Nt=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),dt(t)},execAnyActions:(t,e={})=>wt(t,{componentContext:r,processUrls:e.processUrls}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return Fn(e);const o=Wi(rt,r),i=ji(e,t);return i.vars.length?K(i.vars.map((t=>o.get(t)||function(t){const e=ot.get(t)||Q(void 0);return ot.has(t)||ot.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(o,n))):i.hasExpression?Fn(i.applyVars(o)):Fn(e)}(r.logError,t,Wi(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>ut(r.logError,t,Wi(r.variables,e),n),produceChildContext(e,n={}){const o=t(r);let i=e,a=r.templateContext;const{templateContext:s,json:l}=vt(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=Wi(r.variables,n.variables),n.tooltips&&(o.tooltips=n.tooltips),n.fake&&(o.fakeElement=!0),n.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const n=(r.variables||rt).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.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let zt;v((()=>{Ri--,Ri||(window.removeEventListener("keydown",Bi),window.removeEventListener("pointerdown",Ui)),it&&it.destroy(),ct.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),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!==j&&r.onError(j),void 0===e.onStat&&r.onStat&&void 0!==A&&r.onStat(A),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!==T&&r.direction(T),void 0===e.setTheme&&r.setTheme&&void 0!==U&&r.setTheme(U),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==W&&r.getDebugVariables(W),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==H&&r.getDebugAllVariables(H),void 0===e.setData&&r.setData&&void 0!==q&&r.setData(q),void 0===e.execAction&&r.execAction&&void 0!==bt&&r.execAction(bt),"light"===_||"dark"===_?N=_:"system"===_?"undefined"!=typeof matchMedia?(z||(z=matchMedia("(prefers-color-scheme: dark)"),z.addListener((function(){"system"===_&&z&&(N=z.matches?"dark":"light")}))),N=z.matches?"dark":"light"):N="light":dt(st(new Error("Unsupported theme"))),N&&Tt&&Tt[N].forEach((t=>{const e=rt.get(t.name);e&&e.setValue(t.color)}));{G=!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 kn)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&&(G=!0,dt(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!==It&&y.card.variables.forEach((t=>{t&&t.name&&!et.has(t.name)&&Pt(t)})),i=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,i&&!G&&!Z){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})))};zt=Nt.produceChildContext(t,{tooltips:ct,isRootState:!0})}return s(),u(),G||Z||!zt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${L("dir",c,0)}>${R(Cn,"RootSvgFilters").$$render(t,{svgFiltersMap:ht},{},{})} ${R(En,"Unknown").$$render(t,{componentContext:zt},{},{})}</div>`})),Hi=Li;function qi(t){return Hi.render(t).html}var Ji=exports;for(var Gi in e)Ji[Gi]=e[Gi];e.__esModule&&Object.defineProperty(Ji,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map