@divkitframework/divkit 18.0.0 → 20.0.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/README.md +39 -6
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.css +1 -1
- package/dist/client.css.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/typings/client-devtool.d.ts +1 -0
- package/typings/client-hydratable.d.ts +4 -1
- package/typings/client.d.ts +4 -1
- package/typings/common.d.ts +5 -0
- package/typings/server.d.ts +9 -2
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={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let l;function s(t){l=t}function u(){if(!l)throw new Error("Function called outside component initialization");return l}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>bn,createVariable:()=>er,render:()=>xn}),new Set,new Map;const p=[],g=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.push(t)}const w=new Set;let $=0;function x(){const t=l;do{for(;$<p.length;){const t=p[$];$++,s(t),k(t.$$)}for(s(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(p.length);for(;h.length;)h.pop()();y=!1,w.clear(),s(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function F(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=T(n):r.style=T(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}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(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=D(t[r]);return e}function z(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const P={$$render:()=>""};function M(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`);return t}let I,O;function J(t){function e(e,r,n,i,o){const a=l;s({$$:{on_destroy:I,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,n,i);return s(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=T(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const R=[];function U(t,e=r){let n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!R.length;for(const e of i)e[1](),R.push(e,t);if(e){for(let t=0;t<R.length;t+=2)R[t][0](R[t+1]);R.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,l=r){const s=[a,l];return i.add(s),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(s),0===i.size&&(n(),n=null)}}}}function W(t,e,n){const l=!Array.isArray(t),s=l?[t]:t,u=e.length<2;return c=t=>{let n=!1;const c=[];let d=0,v=r;const p=()=>{if(d)return;v();const n=e(l?c[0]:c,t);u?t(n):v=o(n)?n:r},g=s.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&p()}),(()=>{d|=1<<e}))));return n=!0,p(),function(){i(g),v()}},{subscribe:U(n,c).subscribe};var c}const L="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Z="divkit-f0cba",Y=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={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_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"};function tt(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 et(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function it(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=ot(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ot(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,i,o]=e,a=2===n.length?n:n+n,l=2===i.length?i:i+i,s=2===o.length?o:o+o,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(l,16),b:parseInt(s,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,l=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(l,16)}}return null}function at(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const lt=Boolean;function st(t){if(1===t.length&&"solid"===t[0].type)return{color:it(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=it(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(lt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>it(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:dt(t.bg.scale),pos:vt(t.bg),image:'url("'+at(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(lt);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=rt(n.value):"relative"===n.type&&(i=ut[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ct(t.bg.center_x)} ${ct(t.bg.center_y)},`+r.map((t=>it(t))).join(",")+")"}}({bg:t}):void 0)).filter(lt).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 ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ct(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function dt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(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 pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const gt=new Set(["http","https","tel","mailto","intent"]);function ft(t){return gt.has(t)}function ht(t,e){e&&t.push(e)}function mt(t,e,r){const n=[];ht(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ht(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const yt=Symbol("state");function _t(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function bt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function wt(t){return bt(t)&&t>=0}function $t(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!wt(r[t]))return e;return _t(t)}function xt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const kt=Object.prototype.hasOwnProperty;function Et(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 i=r[n];if(!kt.call(e,i)||!Et(t[i],e[i]))return!1}return!0}function Ct(t,e){return Et(t,e)?e:t}function Ft(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function At(t,e){const r=Number(t);return isNaN(r)?e:r}function Vt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Vt(t))})):e.push(t),e}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function Dt(){}const St=Symbol("action"),zt=J(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:l=""}=e,{style:s=null}=e,{attrs:u}=e,{use:c=Dt}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const f=v(Y),h=v(St);d(St,{hasAction:()=>Boolean(h.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&h.hasAction()&&(y="",f.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(p);return y&&!ft(pt(y))&&(y="",_=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==l&&r.cls(l),void 0===e.style&&r.style&&void 0!==s&&r.style(s),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href:D(y)},{target:D(m)},{style:D(s)},{class:j(l,!0)+" "+j(g?L:q,!0)+" "+j(null!=a&&a.length?Z:"",!0)},S(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(l,!0)+j(_?` ${g?L:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Z:"",!0)},{style:D(s)},{role:D(_?"button":null)},{tabindex:D(_?0:null)},S(u)],{})}>${n.default?n.default({}):""}</span>`})),Pt=zt,Mt="divkit-b921d";function It(t){return bt(t)&&t>0}function Ot(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(It(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Jt=J(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const l=v(Y);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),i=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const n=st([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=Ot(t.filters,l.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${z(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",Mt,0)}${N("style",tt(t.style),0)}>`:`<span${N("class",Mt,0)}${N("style",tt(t.style),0)}></span>`))}</span>`})),Nt=Jt,Tt=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,b,w,$,x,k,E,C,F,A,V,j,D,S,z,P,I,O,J,T,B,R,U,W,L,q,H,G,Z,K,nt=r,ot=r,at=r,lt=r,ut=r,ct=r,dt=r,vt=r,gt=r,ht=r,bt=r,kt=r,Et=r,Dt=r,St=r,zt=r,Mt=r;var It,Ot,Jt,Tt,Bt,Rt;let{json:Ut={}}=e,{origJson:Wt}=e,{templateContext:Lt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Yt=!1}=e,{customActions:Xt=""}=e,{forceWidth:Kt=!1}=e,{forceHeight:Qt=!1}=e,{additionalPaddings:te=null}=e;const ee={left:"start",center:"center",right:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=v(Y),ie=v(yt);let oe,ae,le,se,ue,ce,de,ve={},pe={},ge=!1,fe=1,he="transparent",me=0,ye={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},_e="",be=null,we="",$e={},xe=0,ke=0,Ee=0,Ce=!1,Fe=!1,Ae={},Ve=0,je=0,De=0,Se=!1,ze=!1,Pe=1;const Me=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Ie=-1!==Me.indexOf("state_change")&&Ut.id,Oe=-1!==Me.indexOf("visibility_change")&&Ut.id;let Je,Ne,Te,Be,Re,Ue,We,Le,qe,He=[],Ge=[],Ze=[],Ye=[],Xe="",Ke=!1,Qe="visible",tr=0,er=0;void 0===e.json&&n.json&&void 0!==Ut&&n.json(Ut),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==Lt&&n.templateContext(Lt),void 0===e.cls&&n.cls&&void 0!==qt&&n.cls(qt),void 0===e.style&&n.style&&void 0!==Ht&&n.style(Ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==Gt&&n.layoutParams(Gt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Yt&&n.customPaddings(Yt),void 0===e.customActions&&n.customActions&&void 0!==Xt&&n.customActions(Xt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Kt&&n.forceWidth(Kt),void 0===e.forceHeight&&n.forceHeight&&void 0!==Qt&&n.forceHeight(Qt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==te&&n.additionalPaddings(te),o=ne.getDerivedFromVars(Ut.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,n="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Tt=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Tt?void 0:Tt.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+it(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,fe=xt(K.stroke.width,fe),he=it(K.stroke.color,1,he),e.border=`${et(fe)} solid ${he}`),K.corners_radius?(ye=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]&&!wt(r[t]))return e;return t}(K.corners_radius,ye),e["border-radius"]=t["border-radius"]=jt(ye)):K.corner_radius&&(me=xt(K.corner_radius,me),ye={"top-left":me,"top-right":me,"bottom-right":me,"bottom-left":me},e["border-radius"]=t["border-radius"]=et(me)),r&&fe&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},ye);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+fe/2})),n=jt(t)}}ve=Ct(t,ve),pe=Ct(e,pe),ge=r,_e=n}l=ne.getDerivedFromVars(Ut.paddings),zt(),zt=a(l,(t=>Z=t)),be=function(t,e){if(!t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!wt(t[r[n]]))return e;return t}(Z&&!Yt?Z:void 0,be),s=_t(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(be,te)),u=ne.getDerivedFromVars(Ut.margins),Dt(),Dt=a(u,(t=>H=t)),we=$t(H,we),c=ne.getDerivedFromVars(Ut.width),kt(),kt=a(c,(t=>L=t)),d=ne.getDerivedFromVars(Ut.alignment_horizontal),St(),St=a(d,(t=>G=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const l=null==L?void 0:L.type;if("fixed"===l?(xe=xt(null==L?void 0:L.value,xe),e=et(xe)):"wrap_content"===l||!Gt.overlapParent&&"match_parent"===l&&Gt.parentHorizontalWrapContent?(t="content",("wrap_content"===l&&(null==L?void 0:L.constrained)||"match_parent"===l&&Gt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===l&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(a=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Gt.parentContainerOrientation&&(n=L&&"weight"in L&&L.weight||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Kt&&(t="parent",ne.logError(X(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=G;r["halign-self"]="left"===t||"center"===t||"right"===t?ee[t]:Gt.parentHAlign||"start"}t&&(r.width=t),le=e,ke=n,Ee=i,$e=Ct(r,$e),Ce=o,Fe=a}p=ne.getDerivedFromVars(Ut.height),bt(),bt=a(p,(t=>W=t)),g=ne.getDerivedFromVars(Ut.alignment_vertical),Et(),Et=a(g,(t=>q=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const l=null==W?void 0:W.type;if("fixed"===l?(Ve=xt(null==W?void 0:W.value,Ve),e=et(Ve)):"match_parent"!==l||!Gt.overlapParent&&Gt.parentVerticalWrapContent?(t="content",("wrap_content"===l&&(null==W?void 0:W.constrained)||"match_parent"===l&&Gt.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===l&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(a=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Gt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Qt&&(t="parent",ne.logError(X(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Gt.parentContainerOrientation?r["valign-self"]=re[t]:r["valign-self"]=Gt.parentVAlign||"start"}t&&(r.height=t),se=e,je=n,De=i,Ae=Ct(r,Ae),Se=o,ze=a}var rr,nr,ir;if(f=!!Gt.overlapParent||void 0,h=Gt.overlapParent&&(!L||"match_parent"===L.type)&&"match_parent"===(null==W?void 0:W.type),m=Gt.gridArea?`${Gt.gridArea.y+1}/${Gt.gridArea.x+1}/span ${Gt.gridArea.rowSpan}/span ${Gt.gridArea.colSpan}`:void 0,y=ne.getDerivedFromVars(Ut.alpha),ht(),ht=a(y,(t=>U=t)),nr=Pe,Pe=!wt(rr=U)||void 0===rr||rr>1?nr:Number(rr),ue=1===Pe?void 0:Pe,b=ne.getDerivedFromVars(Ut.accessibility),gt(),gt=a(b,(t=>R=t)),ae=void 0,R&&!Zt&&R.description&&(ae={},ae["aria-label"]=R.description),w=ne.getDerivedFromVars(Ut.background),vt(),vt=a(w,(t=>B=t)),ce={},de=!1,B&&(de=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(_e),!de)){const t=st(B);ce["background-color"]=t.color,ce["background-image"]=t.image,ce["background-size"]=t.size,ce["background-position"]=t.position,ce["background-repeat"]="no-repeat"}Je=void 0,Ie&&Ut.transition_in&&ne.isRunning("stateChange")&&(Je=!0),Te=void 0,Ie&&Ut.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Ut.id)&&(Te=!0),$=ne.getDerivedFromVars(Ut.action),ct(),ct=a($,(t=>J=t)),x=ne.getDerivedFromVars(Ut.actions),dt(),dt=a(x,(t=>T=t)),k=ne.getDerivedFromVars(Ut.doubletap_actions),ut(),ut=a(k,(t=>O=t)),E=ne.getDerivedFromVars(Ut.longtap_actions),lt(),lt=a(E,(t=>I=t));{let t=T||J&&[J]||[],e=O||[],r=I||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ne.logError(X(new Error(`Cannot use action on component "${Xt}"`)))),He=t,Ge=e,Ze=r}C=ne.getDerivedFromVars(Ut.action_animation),at(),at=a(C,(t=>P=t)),P&&(Ye=Vt(P),Xe=Ye.map((function(t){const e=At(t.start_value,1),r=At(t.end_value,1),n=xt(t.start_delay,0),i=xt(t.duration,300),o=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Be=e,Re=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Ue=e,We=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ne.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Ut.visibility),ot(),ot=a(F,(t=>z=t));{const t=Qe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(z,Qe);t!==e&&(!Ke||"visible"!==Qe&&"visible"!==e?Qe=e:async function(t){Qe=t;const e="visible"===t?"in":"out",r="in"===e?Ut.transition_in:Ut.transition_out;Oe&&r&&(await _(),"in"===e&&(Ne=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Lt,r,oe,e).then((()=>{"in"===e&&(Ne=!1)})).catch((t=>{throw"in"===e&&(Ne=!1),t})))}(e)),Ke||(Ke=!0)}if(A=Object.assign(Object.assign(Object.assign({},$e),Ae),{"parent-overlap":f,"parent-overlap-absolute":h,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Je||Ne||Te,visibility:Qe,"has-action-animation":Boolean(Xe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ne.getDerivedFromVars(Ut.transform),nt(),nt=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};tr=At(t.value,tr);const e="pivot-fixed"===t.type?et(tr):`${tr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};er=At(r.value,er),Le=`${e} ${"pivot-fixed"===r.type?et(er):`${er}%`}`,qe=`rotate(${S.rotation}deg)`}return j=Ce||Se?"100%":ke||je?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Ht),ce),ve),{width:le,height:se,"grid-area":m,padding:s,margin:we,opacity:ue,transition:Xe,"transform-origin":Le,transform:qe,"flex-grow":ke||je||void 0,"flex-shrink":Ee||De?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Be,"--divkit-animation-opacity-end":Re,"--divkit-animation-scale-start":Ue,"--divkit-animation-scale-end":We}),nt(),ot(),at(),lt(),ut(),ct(),dt(),vt(),gt(),ht(),bt(),kt(),Et(),Dt(),St(),zt(),Mt(),Fe||ze?"":`${M(Pt,"Actionable").$$render(t,{use:function(t){oe=t,Ie&&Ut.transition_in&&ie.registerChildWithTransitionIn(Ut,Lt,Ut.transition_in,t).then((()=>{Je=!1})).catch((t=>{throw Je=!1,t})),Ie&&Ut.transition_out&&ie.registerChildWithTransitionOut(Ut,Lt,Ut.transition_out,t),Ie&&Ut.transition_change&&ie.registerChildWithTransitionChange(Ut,Lt,Ut.transition_change,t).then((()=>{Te=!1})).catch((t=>{throw Te=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=pt(n);t&&!ft(t)&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Gt.fakeElement?[]:ne.getJsonWithVars(Ut.visibility_actions||Ut.visibility_action&&[Ut.visibility_action]),rootCtx:ne});const e=Ut.id;e&&ie.registerChild(e);let r=null;return{destroy(){e&&ie.unregisterChild(e),r&&r.destroy()}}},cls:qt+" "+mt("outer",Q,A),style:tt(D),actions:He,doubleTapActions:Ge,longTapActions:Ze,attrs:ae,isNativeActionAnimation:!Ye.length||(ir=Ye,ir.some((t=>"native"===t.name)))},{},{default:()=>`${de?`${M(Nt,"OuterBackground").$$render(t,{background:B,radius:_e},{},{})}`:""}${i.default?i.default({}):""}${ge?`<span${N("class",Q.outer__border,0)}${N("style",tt(pe),0)}></span>`:""}`})}`})),Bt=Tt,Rt={"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 Ut(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Wt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Lt(t,e){return Wt(t)||e}const qt=J(((t,e,r,n)=>{let i,o,a,l,s;var u,c;let d,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:f=!1}=e,{actions:h}=e,m="none",y=12,_=1.25,b="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==f&&r.singleline(f),void 0===e.actions&&r.actions&&void 0!==h&&r.actions(h);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Ut(g.font_size,y),It(g.line_height)&&(_=Number(g.line_height)/y),wt(g.letter_spacing)&&(b=et(g.letter_spacing)),d=Lt(g.font_weight,d),w=it(g.text_color,1,w),i=g.top_offset?et(g.top_offset):"",o=g.background?st([g.background]):null,$=(null===(u=g.border)||void 0===u?void 0:u.stroke)&&"transparent"!==it(g.border.stroke.color)&&It(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Ut(null===(c=g.border)||void 0===c?void 0:c.corner_radius,0),l={singleline:f,decoration:m},s={"font-size":et(10*y/p),"line-height":_,"letter-spacing":b,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${i?`<span${N("class",Rt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(Pt,"Actionable").$$render(t,{cls:mt("text-range",Rt,l),actions:h,style:tt(s)},{},{default:()=>`${j(v)}`})}`})),Ht=qt;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Zt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Yt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,P,I,O,J,T,B,R,U,W=r,L=r,q=r,G=r,Z=r,Q=r,rt=r,nt=r,ot=r,at=r,lt=r,ut=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ft=v(Y);let ht=!1,yt="",_t=12,bt=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,jt=[],Dt=[];var St,zt;c((()=>{Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==gt&&n.layoutParams(gt),o=ft.getDerivedFromVars(dt.text),ct(),ct=a(o,(t=>U=t)),St=U,zt=yt,yt=String(null!=St?St:"")||zt,yt?ht=!1:(ht=!0,ft.logError(X(new Error('Missing "text" prop for div "text"')))),l=ft.getDerivedFromVars(dt.ranges),L(),L=a(l,(t=>V=t)),s=ft.getDerivedFromVars(dt.images),W(),W=a(s,(t=>A=t)),u=ft.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),q(),q=a(u,(t=>j=t)),d=ft.getDerivedFromVars(dt.font_size),ut(),ut=a(d,(t=>R=t)),_t=Ut(R,_t),p=ft.getDerivedFromVars(dt.line_height),lt(),lt=a(p,(t=>B=t));{const t=B;It(t)?(bt=Number(t)/_t,wt=!0):wt=!1}g=ft.getDerivedFromVars(dt.max_lines),nt(),nt=a(g,(t=>O=t)),f=1===O;{let t="",e="",r=!1;if(O&&O>1){let n=Number(O);t=n*bt+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}h=ft.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(h,(t=>T=t)),Et=Gt(T,Et),m=ft.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>J=t)),Ct=Zt(J,Ct),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,_=ft.getDerivedFromVars(dt.text_color),rt(),rt=a(_,(t=>I=t)),b=Boolean(I)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&b&&(t=it(I||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ft.getDerivedFromVars(dt.truncate),Q(),Q=a(w,(t=>P=t)),$="none"===P?"none":"",x=ft.getDerivedFromVars(dt.text_gradient),Z(),Z=a(x,(t=>S=t));{let t="";if(S){const e=st([S]);e.image&&(t=e.image)}At=t}return k=ft.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let n=[];if(Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)})),Dt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],l=0,s=[],u=[];o.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"}))})),a.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;let r="image"===t.type?null:t.range,o=t.index;if(o>l){let r=Object.assign(Object.assign({},j),...s);n.push({text:i.substring(l,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)s.push(r);else if("rangeEnd"===t.type)s=s.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...s),r=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/_t)};let a="";const l=t.image.tint_color,u=Yt(t.image.tint_mode,"source_in");if(l){const e=it(t.image.tint_color);a=ft.addSvgFilter(e,u),Dt.push([e,u])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}l=o})),l<i.length&&n.push({text:i.substring(l),textStyles:Object.assign({},j)}),jt=n}(yt,V,A),E={singleline:f,multiline:kt,halign:Et,valign:Ct,truncate:$},C={gradient:Boolean(At)},F={"font-size":et(_t),"line-height":bt,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},W(),L(),q(),G(),Z(),Q(),rt(),nt(),ot(),at(),lt(),ut(),ct(),ht?"":`${M(Bt,"Outer").$$render(t,{cls:mt("text",K,E)+" "+(Vt?"":H),json:dt,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${N("class",mt("text__inner",K,C),0)}${N("style",tt(F),0)}>${jt.length?`${z(jt,((e,r)=>"text"in e?e.text?`${M(Ht,"TextRangeView").$$render(t,{text:e.text,rootFontSize:_t,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",tt(e.image.wrapperStyle),0)}><img${N("class",K.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",tt({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Ht,"TextRangeView").$$render(t,{text:yt,rootFontSize:_t,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),Kt=Xt,Qt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=it(t.color);let i,o,a;if("rounded_rectangle"===t.shape.type){var l,s,u,c;i=Number((null===(l=t.shape.item_width)||void 0===l?void 0:l.value)||10),o=Number((null===(s=t.shape.item_height)||void 0===s?void 0:s.value)||10),a=Number(null!==(u=null===(c=t.shape.corner_radius)||void 0===c?void 0:c.value)&&void 0!==u?u:5)}else{if("circle"!==t.shape.type)return r;var d;i=o=a=2*Number((null===(d=t.shape.radius)||void 0===d?void 0:d.value)||10)}if("shape_drawable"===t.type&&"transparent"!==n){var v,p,g;const e={},r=null!==(v=t.stroke)&&void 0!==v&&v.color?it(t.stroke.color):"",l=null!==(p=t.stroke)&&void 0!==p&&p.width?Number(null!==(g=t.stroke.width)&&void 0!==g?g:1):"";return e.width=i,e.height=o,e.borderRadius=a,e.background=n,r&&l&&(e.boxShadow=`inset 0 0 0 ${et(l)} ${r}`),e}return r}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let n;return n="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],n.map(et).join(" ")}const ne="divkit-f6e9a";function ie(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function oe(t,e,r,n){const i={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)&&ie(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)ie(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];ie(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const ae=J(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:l}=e;const s=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,l=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<l)break}else if(n.left<a)break;a=Math.max(a,n.right),l=Math.max(l,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&oe(d,a,e,"vertical"===o);const r={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)))};n.push(r)})),l&&oe(d,l,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,p=null,g=null;return c((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==l&&r.lineSeparator(l),i=null,(v&&i||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&i&&("undefined"!=typeof MutationObserver&&(p=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(ne))&&!(null==r?void 0:r.contains("divkit-a7719"))}))&&s()})),p.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(s),g.observe(i)))),v&&i&&s(),`\n\n<div${N("this",u,0)}>${z(d,(t=>`<div${N("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class",ne,0)}${B({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>\n </div>`))}</div>`}));let le;function se(){if(void 0!==le)return le;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),le=1===t.scrollHeight,document.body.removeChild(t),le}const ue=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V=r,j=r,D=r,S=r,P=r,I=r,O=r,J=r;var N,T,B,R,U,W;let{json:L={}}=e,{templateContext:q}=e,{origJson:H}=e,{layoutParams:G}=e;const Z={left:"start",center:"center",right:"end"},K={top:"start",center:"center",bottom:"end",baseline:"baseline"},Q=["rounded_rectangle","circle"],tt=v(Y);let et=!1,rt="vertical",nt="top",it="left",ot=null,at=null,lt={};if(void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==q&&n.templateContext(q),void 0===e.origJson&&n.origJson&&void 0!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=L.items,(null==o?void 0:o.length)&&Array.isArray(o)?et=!1:(et=!0,tt.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),l=(!et&&o||[]).map((t=>{let e=t,r=q;return({templateContext:r,json:e}=tt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=tt.getDerivedFromVars(L.orientation),J(),J=a(s,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),u=tt.getDerivedFromVars(L.content_alignment_vertical),O(),O=a(u,(t=>F=t)),nt=Zt(F,nt),c=tt.getDerivedFromVars(L.content_alignment_horizontal),I(),I=a(c,(t=>C=t)),it=Gt(C,it),d=tt.getDerivedFromVars(L.layout_mode),P(),P=a(d,(t=>E=t)),p="wrap"===E,g=tt.getDerivedFromVars(L.separator),S(),S=a(g,(t=>k=t)),(null==k?void 0:k.style)&&"overlap"!==rt&&se()){const t=te(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(N=k.show_at_start)&&void 0!==N&&N),show_at_end:Boolean(null!==(T=k.show_at_end)&&void 0!==T&&T),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(f=tt.getDerivedFromVars(L.line_separator),D(),D=a(f,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&se()){const t=te(x.style,Q,(null==at?void 0:at.style)||null);at=t?{show_at_start:Boolean(null!==(R=x.show_at_start)&&void 0!==R&&R),show_at_end:Boolean(null!==(U=x.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(W=x.show_between)||void 0===W||W),style:t}:null}else at=null;h=ot||at?function(t,e,r){const n={};return ee(n,e,"vertical"===t),ee(n,r,"horizontal"===t),n}(rt,ot,at):null,m=tt.getDerivedFromVars(L.width),V(),V=a(m,(t=>w=t)),y=tt.getDerivedFromVars(L.height),j(),j=a(y,(t=>$=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"overlap"===rt&&(t.overlapParent=!0),"horizontal"!==rt&&(t.parentHAlign=Z[it],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==G?void 0:G.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==rt&&(t.parentVAlign=K[nt],("wrap_content"===(null==w?void 0:w.type)||"match_parent"===(null==w?void 0:w.type)&&(null==G?void 0:G.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===rt&&(t.parentContainerOrientation="horizontal"),"vertical"===rt&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),lt=Ct(t,lt)}return _={orientation:rt,valign:nt,halign:it,wrap:p},b={gap:ot||at?re(rt,ot,at):void 0},V(),j(),D(),S(),P(),I(),O(),J(),et?"":`${M(Bt,"Outer").$$render(t,{cls:mt("container",Qt,_),style:b,json:L,origJson:H,templateContext:q,layoutParams:G,additionalPaddings:h},{},{default:()=>`${z(l,(e=>`${M(lr,"Unknown").$$render(t,{layoutParams:lt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(ae,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),ce=ue,de={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ve(t,e){return"vertical"===t||"horizontal"===t?t:e}const pe=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(Y);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(f.delimiter_style),g(),g=a(o,(t=>p=t)),b=ve(null==p?void 0:p.orientation,b),l=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=it(null==p?void 0:p.color,1,w),s="horizontal"===b?"100%":et(1),u="horizontal"===b?et(1):"100%",c={background:w,width:s,height:u},d={orientation:b},g(),`${M(Bt,"Outer").$$render(t,{cls:mt("separator",de,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>l?`<span${N("class",de.separator__inner,0)}${N("style",tt(c),0)}></span>`:""})}`})),ge={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},fe=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,z,P,I,O,J,T,R,U,W,L,q=r,H=r,G=r,Z=r,K=r,Q=r,et=r,rt=r,nt=r,ot=r,lt=r,st=r,ut=r,ct=r,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ft}=e,{layoutParams:ht}=e;const yt=v(Y);let _t,bt=0,wt="rgba(0,0,0,0.08)",$t=!1,kt="",Et="none",Ct="50% 50%",At="0",Vt="source_in",jt="",Dt="",St=0,zt=0,Pt=0,Mt="",Jt="";c((()=>{yt.removeSvgFilter(_t,Vt)})),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==ft&&n.origJson(ft),void 0===e.layoutParams&&n.layoutParams&&void 0!==ht&&n.layoutParams(ht),o=yt.getDerivedFromVars(pt.image_url),ct(),ct=a(o,(t=>L=t)),l=yt.getDerivedFromVars(pt.gif_url),ut(),ut=a(l,(t=>W=t)),s=L||W,bt=0,s?$t=!1:($t=!0,yt.logError(X(new Error('Missing "image_url" for "image"')))),u=yt.getDerivedFromVars(pt.width),st(),st=a(u,(t=>U=t)),d="wrap_content"===(null==U?void 0:U.type),p=yt.getDerivedFromVars(pt.height),lt(),lt=a(p,(t=>R=t)),g="wrap_content"===(null==R?void 0:R.type),f=yt.getDerivedFromVars(pt.preview),ot(),ot=a(f,(t=>T=t));{const t=T;kt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}h=yt.getDerivedFromVars(pt.placeholder_color),nt(),nt=a(h,(t=>J=t)),wt=it(J,1,wt),m=yt.getDerivedFromVars(pt.scale),rt(),rt=a(m,(t=>O=t)),Et=dt(O)||Et,y=yt.getDerivedFromVars({content_alignment_horizontal:pt.content_alignment_horizontal,content_alignment_vertical:pt.content_alignment_vertical}),et(),et=a(y,(t=>I=t)),Ct=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:vt(t)}(I,Ct),_=yt.getDerivedFromVars(pt.accessibility),Q(),Q=a(_,(t=>P=t)),b=(null==P?void 0:P.description)||"",w=yt.getDerivedFromVars(pt.aspect),K(),K=a(w,(t=>z=t));{const t=null==z?void 0:z.ratio;At=t&&It(t)?(100/Number(t)).toFixed(2):"0"}$=yt.getDerivedFromVars(pt.tint_color),Z(),Z=a($,(t=>S=t)),x=yt.getDerivedFromVars(pt.tint_mode),G(),G=a(x,(t=>D=t));{const t=S,e=t?it(t):void 0,r=Yt(D,Vt);e===_t&&r===Vt||(yt.removeSvgFilter(_t,Vt),jt=e?yt.addSvgFilter(e,r):"",_t=e,Vt=r)}if(k=yt.getDerivedFromVars(pt.appearance_animation),H(),H=a(k,(t=>j=t)),j&&"fade"===j.type){const t=j;Dt=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=xt(t.duration,300),zt=xt(t.start_delay,0),St=xt(t.alpha,0)}E=yt.getDerivedFromVars(pt.filters),q(),q=a(E,(t=>V=t));{let t="",e="";Array.isArray(V)&&V.length&&(t=Ot(V,yt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Mt=t,Jt=e}return C={aspect:"0"!==At,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(Dt)&&!0},F={"background-image":kt,"background-color":kt?void 0:wt,"background-size":Et},A={"object-fit":Et,"object-position":Ct,filter:["",Mt].filter(Boolean).join(" "),"clip-path":Jt||void 0,"--divkit-appearance-interpolator":Dt||void 0,"--divkit-appearance-fade-start":Dt?St:void 0,"--divkit-appearance-delay":Dt?`${zt}ms`:void 0,"--divkit-appearance-duration":Dt?`${Pt}ms`:void 0},q(),H(),G(),Z(),K(),Q(),et(),rt(),nt(),ot(),lt(),st(),ut(),ct(),$t?"":`${M(Bt,"Outer").$$render(t,{cls:mt("image",ge,C),json:pt,origJson:ft,templateContext:gt,layoutParams:ht,style:F,customDescription:!0},{},{default:()=>C.aspect?`<span${N("class",ge["image__aspect-wrapper"],0)}${B({"padding-bottom":`${At}%`})}><img${N("class",ge.image__image,0)}${N("src",s,0)} loading="lazy" decoding="async"${N("style",tt(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",ge.image__image,0)}${N("src",s,0)} loading="lazy" decoding="async"${N("style",tt(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),he={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function me(t){return t>0&&t<1}function ye(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(me)){const e=Math.max(...t.filter(me).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${et(n*t[e]/i)},${ye(t[e])}fr)`:t[e]?o[e]=`${ye(t[e])}fr`:o[e]="auto";return o.join(" ")}const be=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(Y);let A,V,j=!1,D=1,S=[],P=[],I=[],O=[],J=0,N=!1,T="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),l=F.getDerivedFromVars(x.column_count),$(),$=a(l,(t=>y=t)),D=Ut(y,D),s=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];s.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=W(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],P=[],I=[],O=[],N=!1,V=s.map(((n,i)=>{var o,a,l,s;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},p="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,g="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,f=1===c&&"fixed"===(null===(l=u.width)||void 0===l?void 0:l.type)&&u.width.value?Number(u.width.value)/c:0,h=1===d&&"fixed"===(null===(s=u.height)||void 0===s?void 0:s.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<p)&&(S[n]=p),(!P[e]||P[e]<g)&&(P[e]=g),(!I[n]||I[n]<f)&&(I[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),J=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(u,(t=>h=t)),T=Zt(h,T),c=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(c,(t=>f=t)),B=Gt(f,B),d={valign:T,halign:B},p={"grid-template-columns":_e(S,I,D),"grid-template-rows":_e(P,O,J)},g=j||N,_(),b(),w(),$(),g?"":`${M(Bt,"Outer").$$render(t,{cls:mt("grid",he,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C},{},{default:()=>`${z(V,(e=>`${M(lr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),we=be,$e={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function xe(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function ke(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ee=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,I,O,J,T,B=r,R=r,U=r,L=r,q=r,H=r,Z=r,K=r,Q=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const lt=v(Y);let st,ut,ct=[],dt=!1,vt=!1,pt=null,gt=!1,ft=!1;J=a(lt.isDesktop,(t=>O=t));let ht,yt,_t,bt,wt=1,kt="horizontal",Et="start",Ft=8,At="",Vt=[],jt={},Dt=!1,St={},zt=0;const Pt=ke((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function Mt(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<wt;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function It(t,e,r="smooth"){const n="horizontal"===kt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-Ft/2),behavior:r})}function Ot(t){const e=Mt(),r=st.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===kt?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 i=e.map((t=>function(t,e){return"horizontal"===kt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!nt.id||ft||(null==at?void 0:at.fakeElement)||lt.registerInstance(nt.id,{setCurrentItem(t){const e=Mt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');It(e,t)},setPreviousItem(t){const e=Ot("prev"),r=Mt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),It(r,n)},setNextItem(t){const e="horizontal"===kt?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Mt();if(e&&"ring"===t)return void It(r,0);const n=Ot("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),It(r,i)}}),c((()=>{gt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&<.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?ft=!1:(ft=!0,lt.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),l=(!ft&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=lt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=O&>&&!ft,s?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{Pt()})),pt.observe(ut)):pt&&(pt.disconnect(),pt=null),u=lt.getDerivedFromVars(nt.column_count),Q(),Q=a(u,(t=>I=t)),wt=Ut(I,wt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(l,wt),p=lt.getDerivedFromVars(nt.orientation),K(),K=a(p,(t=>P=t)),kt=ve(P,kt),g=lt.getDerivedFromVars(nt.cross_content_alignment),Z(),Z=a(g,(t=>S=t)),Et=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,Et),f=lt.getDerivedFromVars(nt.item_spacing),H(),H=a(f,(t=>D=t)),Ft=xt(D,Ft),ht=et(Ft),h=lt.getDerivedFromVars(nt.cross_spacing),q(),q=a(h,(t=>V=t)),_t=xt(V,Ft),yt=et(_t),m=lt.getDerivedFromVars(nt.paddings),L(),L=a(m,(t=>A=t)),At=$t(A,At),y="horizontal"===kt?"grid-template-columns":"grid-template-rows";{let t=[];l.forEach((e=>{const r="horizontal"===kt?"width":"height";t.push(lt.getDerivedFromVars(e.json[r]))})),bt=W(t,(t=>t)),U(),U=a(bt,(t=>F=t))}Vt=[],wt>1?Vt.push("auto"):F.forEach((t=>{!t&&"horizontal"===kt||"match_parent"===(null==t?void 0:t.type)?Vt.push("100%"):Vt.push("max-content")})),_=lt.getDerivedFromVars(nt.scroll_mode),R(),R=a(_,(t=>C=t));{const t={};let e={};Dt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===kt?e.parentVAlign=Et:e.parentHAlign=Et,"paging"===C&&(Dt=!0,e.scrollSnap="start",t["horizontal"===kt?"scroll-padding-left":"scroll-padding-top"]=et(Ft/2)),1===wt&&(e.parentLayoutOrientation=kt),jt=Ct(t,jt),St=Ct(e,St)}return b=lt.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(b,(t=>T=t)),w={padding:At,"grid-gap":yt},$={"grid-gap":ht,[y]:xe(Vt)},x={orientation:kt,"scroll-snap":Dt},k=lt.getDerivedFromVars(nt.default_item),B(),B=a(k,(t=>E=t)),zt=xt(E,zt),B(),R(),U(),L(),q(),H(),Z(),K(),Q(),J(),rt(),"\n\n"+(ft?"":`${M(Bt,"Outer").$$render(t,{cls:mt("gallery",$e,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===kt,forceWidth:"horizontal"===kt},{},{default:()=>`<div class="${j($e.gallery__scroller,!0)+" "+j(T?G:"",!0)}"${N("style",tt(jt),0)}${N("this",st,0)}><div${N("class",$e["gallery__items-grid"],0)}${N("style",tt(w),0)}${N("this",ut,0)}>${z(d,((e,r)=>`<div${N("class",$e.gallery__items,0)}${N("style",tt($),0)}${N("this",ct[r],0)}>${z(e,(e=>`${M(lr,"Unknown").$$render(t,{layoutParams:St,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===kt?`${dt&&s?`<div class="${j($e.gallery__arrow,!0)+" "+j($e.gallery__arrow_left,!0)}"><svg${N("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",$e["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>`:""}\n ${vt&&s?`<div class="${j($e.gallery__arrow,!0)+" "+j($e.gallery__arrow_right,!0)}"><svg${N("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",$e["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>`:""}`:""}`})}`)})),Ce=Ee,Fe={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Ae=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,b,w,$,x,k,E,C,F,A,V=r,D=r,S=r,P=r,I=r,O=r,J=r,T=r;var R;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:q}=e;const H=v(Y),Z=H.genId("tabs");let K,Q,rt,nt=!1,ot={};const at=H.getJsonWithVars(U.selected_tab);let lt,st,ut=at&&Number(at)||0,ct=12,dt="",vt="",pt="",gt="",ft="",ht="",yt="",_t="",bt="",xt="",kt=!1,Et=!1,Ft=ut,At=[],Vt=[];async function Dt(t,e=!1){if(Ft=ut,ut=t,kt||(kt=!0,Q.style.height=et(Q.clientHeight),rt.style.transform=`translate3d(${100*-Ft}%,0,0)`),Et=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-ut),function(t=!1){const e=t?Math.max(0,ut-1):Math.min(ut,Ft),r=t?Math.min(o.length-1,ut+1):Math.max(ut,Ft);At=At.map(((t,n)=>t||n>=e&&n<=r)),Vt=Vt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${Z}-panel-${ut}`);t&&(Q.style.height=et(t.offsetHeight))}(),zt&&clearTimeout(zt),zt=window.setTimeout((()=>{Vt=o.map(((t,e)=>e===ut))}),400),St=-ut*Q.clientWidth,e){await _();const t=K.querySelector(`.${Fe.tabs__item_selected}`);t&&t.focus()}}let St,zt=null;!U.id||nt||(null==q?void 0:q.fakeElement)||H.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Dt(t)},setPreviousItem(t){let e=ut-1;e<0&&(e="ring"===t?o.length-1:ut),Dt(e)},setNextItem(t){let e=ut+1;e>o.length-1&&(e="ring"===t?0:ut),Dt(e)}}),c((()=>{U.id&&!(null==q?void 0:q.fakeElement)&&H.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==q&&n.layoutParams(q),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,H.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),l=H.getDerivedFromVars(U.width),J(),J=a(l,(t=>F=t)),s=H.getDerivedFromVars(U.height),O(),O=a(s,(t=>C=t));{let t={};(null==q?void 0:q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),ot=Ct(t,ot)}if(!nt&&(ut<0||ut>=o.length)&&(H.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:U.selected_tab,length:o.length}})),ut=ut<0?0:o.length-1),u=H.getDerivedFromVars(U.tab_title_style),I(),I=a(u,(t=>E=t)),d=E||{},ct=Ut(d.font_size,ct),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ct*10,right:(Number(t.right)||0)/ct*10,bottom:(Number(t.bottom)||0)/ct*10,left:(Number(t.left)||0)/ct*10};dt=$t(e,dt)}{const t=d.line_height;void 0!==t&&It(t)&&(vt=et(t/ct*10))}{const t=d.letter_spacing;void 0!==t&&wt(t)&&(pt=et(t/ct*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(R=d.corner_radius)&&void 0!==R?R:1e3;d.corners_radius?gt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!wt(i[t]))return n;return jt(t,e,r)}(d.corners_radius,t,ct,gt):wt(t)&&(gt=et(t/ct*10))}return lt=Lt(d.active_font_weight||d.font_weight,lt),st=Lt(d.inactive_font_weight||d.font_weight,st),ft=it(d.active_text_color,1,ft),ht=it(d.inactive_text_color,1,ht),yt=it(d.active_background_color,1,yt),_t=it(d.inactive_background_color,1,_t),p=H.getDerivedFromVars(U.has_separator),P(),P=a(p,(t=>k=t)),g=H.getDerivedFromVars(U.separator_color),S(),S=a(g,(t=>x=t)),f=H.getDerivedFromVars(U.separator_paddings),D(),D=a(f,(t=>$=t)),k&&(x&&(bt=it(x,1,bt)),$&&(xt=$t($,xt))),h={background:bt,margin:xt},m=H.getDerivedFromVars(U.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=H.getDerivedFromVars(U.restrict_parent_scroll),T(),T=a(b,(t=>A=t)),nt||(At=o.map(((t,e)=>e===ut)),Vt=o.map(((t,e)=>e===ut))),V(),D(),S(),P(),I(),O(),J(),T(),nt?"":`${M(Bt,"Outer").$$render(t,{cls:mt("tabs",Fe,{}),json:U,origJson:L,templateContext:W,layoutParams:q,customActions:"tabs"},{},{default:()=>`<div class="${j(Fe.tabs__list,!0)+" "+j(A?G:"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":et(ct),"--divkit-tabs-paddings":dt,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":lt||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":ft,"--divkit-tabs-inactive-text-color":ht,"--divkit-tabs-active-background-color":yt,"--divkit-tabs-inactive-background-color":_t,"--divkit-tabs-border-radius":gt})}${N("this",K,0)}>${z(o,((e,r)=>{let n=r===ut;return`\n\n ${M(Pt,"Actionable").$$render(t,{cls:mt("tabs__item",Fe,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=q&&q.fakeElement?[]:[e.title_click_action],attrs:{id:`${Z}-tab-${r}`,"aria-controls":`${Z}-panel-${r}`,role:"tab",tabindex:!n||null!=q&&q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=q&&q.fakeElement?null:t=>function(t,e){return ut===e||(Dt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${N("class",Fe.tabs__separator,0)}${N("style",tt(h),0)}></div>`:""}\n <div class="${j(Fe.tabs__panels,!0)+" "+j(A?G:"",!0)}"${N("this",Q,0)}><div${N("class",mt("tabs__swiper",Fe,{inited:kt,animated:Et}),0)}${N("this",rt,0)}>${z(o,((e,r)=>`<div${N("class",mt("tabs__panel",Fe,{visible:Vt[r]}),0)} role="tabpanel" id="${j(Z,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(Z,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${At[r]?`${M(lr,"Unknown").$$render(t,{div:e.div,templateContext:W,layoutParams:ot},{},{})}`:""}\n </div>`))}</div></div>`})}`})),Ve=Ae,je="divkit-eb860",De="divkit-e08c6";function Se(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}Se([.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]),Se([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 ze=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:l}=e,{layoutParams:s}=e;const u=v(Y),p=v(yt);let g=new Map,f=new Set,h=!1,m=null,y=[],b=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==s?void 0:s.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(f),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(yt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return b.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){f.add(t)},unregisterChild(t){f.delete(t)}})):(h=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{x&&!(null==s?void 0:s.fakeElement)&&p.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==l&&r.origJson(l),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),o&&(f=new Set),i=o.states||[],(null==i?void 0:i.length)?h=!1:(h=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),h?"":`${M(Bt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:l,templateContext:a,layoutParams:s},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${M(lr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${z(y,(e=>"direction"in e?`<div${N("class",je,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${N("class",De,0)}>${M(lr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class",je,0)}><div${N("class",De,0)}>${M(lr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),Pe={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E=r,C=r,F=r,A=r,V=r,D=r;var S,P,I,O,J,T,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:L}=e;const q=v(Y),H=q.genId("pager");let Z,K=!1,Q=0,nt=0,it=!1,ot="horizontal",at="",lt="",st="";function ut(t,e="smooth"){const r="horizontal"===ot,n=Z.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:n[i],behavior:e}),Q=t}ke((function(){const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===ot?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:Q}();t!==Q&&(Q=t)}),50),R.id&&!(null==L?void 0:L.fakeElement)&&q.registerInstance(R.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ut(t)},setPreviousItem(t){let e=Q-1;e<0&&(e="ring"===t?o.length-1:Q),ut(e)},setNextItem(t){let e=Q+1;e>o.length-1&&(e="ring"===t?0:Q),ut(e)}}),c((()=>{R.id&&!(null==L?void 0:L.fakeElement)&&q.unregisterInstance(R.id)})),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==W&&n.origJson(W),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),(null===(S=R.items)||void 0===S?void 0:S.length)&&Array.isArray(R.items)?K=!1:(K=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!K&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=q.getDerivedFromVars(R.layout_mode),C(),C=a(l,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(it=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),s=q.getDerivedFromVars(R.orientation),V(),V=a(s,(t=>x=t)),ot=ve(x,ot),u=q.getDerivedFromVars(R.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&wt(t)&&(at=et(t||0))}if(d=q.getDerivedFromVars(R.paddings),F(),F=a(d,(t=>w=t)),lt=$t(w,lt),p=q.getDerivedFromVars(R.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===ot?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=rt("horizontal"===ot?((null===(P=R.paddings)||void 0===P?void 0:P.left)||0)+((null===(I=R.paddings)||void 0===I?void 0:I.right)||0):((null===(O=R.paddings)||void 0===O?void 0:O.top)||0)+((null===(J=R.paddings)||void 0===J?void 0:J.bottom)||0)),e=null===(T=b.neighbour_page_width)||void 0===T?void 0:T.value;st=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${at})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return f={"grid-gap":at,padding:lt,[g]:st},h={orientation:ot},m=K||it,y=q.getStore("pagers"),E(),E=a(y,(t=>_=t)),function(t,e){const r=R.id;if(r){const o=new Map(_);n=y,_=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:ut}),i=_,n.set(i)}var n,i}(o.length,Q),function(t){var e;if(t===nt)return;nt=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(Q),E(),C(),F(),A(),V(),D(),m?"":`${M(Bt,"Outer").$$render(t,{cls:mt("pager",Pe,h),json:R,origJson:W,templateContext:U,layoutParams:L,customPaddings:!0},{},{default:()=>`<div class="${j(Pe.pager__items,!0)+" "+j(k?G:"",!0)}"${N("style",tt(f),0)}${N("this",Z,0)}>${z(o,(e=>`<div${N("class",Pe.pager__item,0)}>${M(lr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=L&&L.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ie=Me,Oe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Je=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,b=r,w=r,$=r,x=r,k=r,E=r;var C;let{json:F={}}=e,{templateContext:A}=e,{origJson:V}=e,{layoutParams:D}=e;const S=v(Y);let P,I,O,J=5,T=10,R=10,U=5,W="#ffdc60",q=it("#33919cb5"),H=15,G=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==A&&n.templateContext(A),void 0===e.origJson&&n.origJson&&void 0!==V&&n.origJson(V),void 0===e.layoutParams&&n.layoutParams&&void 0!==D&&n.layoutParams(D),o=S.getDerivedFromVars(F.shape),E(),E=a(o,(t=>y=t)),y&&("rounded_rectangle"===y.type?(y.item_width&&(T=xt(y.item_width.value,T)),y.item_height&&(R=xt(y.item_height.value,R)),y.corner_radius&&(U=xt(y.corner_radius.value,U))):"circle"===y.type&&(J=xt(null===(C=y.radius)||void 0===C?void 0:C.value,J),T=R=U=2*J)),l=S.getDerivedFromVars(F.active_item_color),k(),k=a(l,(t=>m=t)),W=it(m,1,W),s=S.getDerivedFromVars(F.inactive_item_color),x(),x=a(s,(t=>h=t)),q=it(h,1,q),u=S.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>f=t)),f&&(H=xt(f.value,H)),c=S.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>g=t)),G=Ut(g,G),d=S.getStore("pagers"),b(),b=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){O=t.get(F.pager_id),await _();const e=I.children[O.currentItem].offsetLeft;P.scroll({left:e-P.clientWidth/2,behavior:"smooth"})}}(p),b(),w(),$(),x(),k(),E(),`${M(Bt,"Outer").$$render(t,{cls:mt("indicator",Oe,{}),json:F,origJson:V,templateContext:A,layoutParams:D},{},{default:()=>`<div${N("class",Oe.indicator__scroller,0)}${N("this",P,0)}><div${N("class",Oe.indicator__items,0)} role="tablist"${B({margin:`0 ${et((G-1)*T/2)}`,"--divkit-indicator-width":et(T),"--divkit-indicator-height":et(R),"--divkit-indicator-border-radius":et(U),"--divkit-indicator-active-color":W,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${et((H-T)/2)}`})}${N("this",I,0)}>${O?`${z(Array(O.size),((t,e)=>{let r=e===O.currentItem;return`\n <div class="${j(mt("indicator__item",Oe,{active:r}),!0)+" "+j(L,!0)}" role="tab" id="${j(O.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(O.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ne=Je,Te={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&it(t.text_color)||"#000",i=Wt(t.font_weight);if(It(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:et(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Re(t,e,r){return Math.max(e,Math.min(r,t))}const Ue=2147483647,We=-2147483648,Le=Number.MAX_VALUE,qe=Number.MIN_VALUE,He="string",Ge="integer",Ze="number",Ye="boolean",Xe="color",Ke="datetime";class Qe{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=U(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const tr={string:class extends Qe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Qe{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends Qe{convertValue(t){if("number"!=typeof t||isNaN(t)||t>Ue||t<We||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Qe{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends Qe{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Qe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function er(t,e,r){if(!(e in tr))throw new Error("Unsupported variable type");return new tr[e](t,r)}function rr(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const nr=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,I,O,J,T,R,U,W,L,q,H,G=r,Z=r,K=r,Q=r,tt=r,nt=r,it=r,ot=r,at=r,lt=r,st=r,ut=r;var ct,dt,vt,pt;let{json:gt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:yt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},bt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Y),kt=v(St);let Et=0,Ct=100;const Ft=xt.getJsonWithVars(gt.thumb_value_variable),Vt=xt.getJsonWithVars(gt.thumb_secondary_value_variable);L=a(Ft&&xt.getVariable(Ft,"integer")||er("temp","integer",0),(t=>W=t)),U=a(Vt&&xt.getVariable(Vt,"integer")||er("temp","integer",0),(t=>R=t));let jt,Dt,zt,Pt=Re(W||0,Et,Ct),Mt=Re(R||0,Et,Ct),It=_t,Ot=It,Jt=_t,Nt=_t,Tt=null,Rt=null,Ut=zt,Wt="",Lt="",qt=!1;ke((function(){}),50),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==ft&&n.templateContext(ft),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=xt.getDerivedFromVars(gt.min_value),ut(),ut=a(o,(t=>H=t)),l=xt.getDerivedFromVars(gt.max_value),st(),st=a(l,(t=>q=t)),Et=At(H,Et),Ct=At(q,Ct);{const t=Re(W||0,Et,Ct);t!==Pt&&(Pt=t)}{const t=Re(R||0,Et,Ct);t!==Mt&&(Mt=t)}s=xt.getDerivedFromVars(gt.thumb_style),lt(),lt=a(s,(t=>T=t)),It=te(T,bt,It),u=xt.getDerivedFromVars(gt.thumb_secondary_style),at(),at=a(u,(t=>J=t)),Ot=te(J,bt,It),c=xt.getDerivedFromVars(gt.track_inactive_style),ot(),ot=a(c,(t=>O=t)),Jt=te(O,$t,Jt),d=xt.getDerivedFromVars(gt.track_active_style),it(),it=a(d,(t=>I=t)),Nt=te(I,$t,Nt),p=xt.getDerivedFromVars(gt.tick_mark_active_style),nt(),nt=a(p,(t=>P=t));{let t=te(P,bt,_t);t!==_t&&(Tt=t)}jt=Tt?Vt?rr(Math.min(Pt,Mt),Math.max(Pt,Mt)+1,Et,Ct,!0):rr(Et,Pt,Et,Ct,!0):[],g=xt.getDerivedFromVars(gt.tick_mark_inactive_style),tt(),tt=a(g,(t=>S=t));{let t=te(S,bt,_t);t!==_t&&(Rt=t)}Dt=Rt?Vt?rr(Math.min(Pt,Mt),Math.max(Pt,Mt)+1,Et,Ct,!1):rr(Pt+1,Ct+1,Et,Ct,!0):[],f=xt.getDerivedFromVars(gt.thumb_text_style),Q(),Q=a(f,(t=>D=t)),zt=Be(D,zt),h=xt.getDerivedFromVars(gt.thumb_secondary_text_style),K(),K=a(h,(t=>V=t)),Ut=Be(V,zt),m=xt.getDerivedFromVars(gt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):It===_t?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===_t?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Jt===_t&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=et(Math.max(...[It.width,Ot.width,0].filter(wt))),b=et(Math.max(...[It.height,Ot.height,0].filter(wt))),w=(Pt-Et)/(Ct-Et),$=Vt?(Mt-Et)/(Ct-Et):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":et(It.width),"--divkit-slider-thumb-height":et(It.height),"--divkit-slider-thumb-secondary-width":et(Ot.width),"--divkit-slider-thumb-secondary-height":et(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==zt?void 0:zt.offset)||void 0===ct?void 0:ct.x)?rt(zt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==zt?void 0:zt.offset)||void 0===dt?void 0:dt.y)?rt(zt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.x)?rt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Ut?void 0:Ut.offset)||void 0===pt?void 0:pt.y)?rt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Tt?et(Tt.width):void 0,"--divkit-slider-tick-active-height":Tt?et(Tt.height):void 0,"--divkit-slider-tick-active-border-radius":Tt?et(Tt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Tt?void 0:Tt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Tt?void 0:Tt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?et(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?et(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?et(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":_,"--divkit-slider-max-thumb-height":b,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Z(),K(),Q(),tt(),nt(),it(),ot(),at(),lt(),U(),L(),st(),ut(),"\n\n"+(qt?"":`${M(Bt,"Outer").$$render(t,{cls:mt("slider",Te,C),style:E,customDescription:!0,customActions:"slider",json:gt,origJson:ht,templateContext:ft,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",Te["slider__tracks-wrapper"],0)}><div${N("class",Te["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",Te.slider__track,0)}${B({height:et(Jt.height),"border-radius":et(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n <div${N("class",Te["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Nt.height),"border-radius":et(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n ${z(jt,(t=>`<div class="${j(Te.slider__tick,!0)+" "+j(Te.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${z(Dt,(t=>`<div class="${j(Te.slider__tick,!0)+" "+j(Te.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",Te.slider__thumb,0)}${B({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${zt?`<div${N("class",Te["slider__thumb-text"],0)}><div${N("class",Te["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=zt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=zt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=zt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Pt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Te.slider__thumb,!0)+" "+j(Te.slider__thumb_secondary,!0)}"${B({"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Ut?`<div class="${j(Te["slider__thumb-text"],!0)+" "+j(Te["slider__thumb-text_secondary"],!0)}"><div${N("class",Te["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Ut)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Ut)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",Te.slider__input,0)}${N("min",Et,0)}${N("max",Ct,0)} step="1"${N("value",Pt,0)}${N("aria-label",Wt,0)}>\n ${Vt?`<input type="range"${N("class",`${Te.slider__input} ${Te.slider__input_secondary}`,0)}${N("min",Et,0)}${N("max",Ct,0)} step="1"${N("value",Mt,0)}${N("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),ir={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},or={text:Kt,container:ce,separator:pe,image:fe,gif:fe,grid:we,gallery:Ce,tabs:Ve,state:ze,pager:Ie,indicator:Ne,slider:nr,input:J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,z,P,I,O,J,T,B,R=r,U=r,{json:W={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Y);let Z;const K=G.getJsonWithVars(W.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),J=a(K&&G.getVariable(K,"string")||er("temp","string",""),(t=>O=t));let tt="";I=a(G.getDerivedFromVars(W.hint_text),(t=>P=t)),z=a(G.getDerivedFromVars(W.hint_color),(t=>S=t));let nt="";D=a(G.getDerivedFromVars(W.font_size),(t=>V=t));let ot,at,lt=12;A=a(G.getDerivedFromVars(W.font_weight),(t=>F=t)),C=a(G.getDerivedFromVars(W.line_height),(t=>E=t)),k=a(G.getDerivedFromVars(W.letter_spacing),(t=>x=t));let st="";$=a(G.getDerivedFromVars(W.text_color),(t=>w=t));let ut="#000";b=a(G.getDerivedFromVars(W.highlight_color),(t=>_=t));let ct="";y=a(G.getDerivedFromVars(W.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",pt="text";h=a(G.getDerivedFromVars(W.max_visible_lines),(t=>f=t));let gt="",ft="";B=a(G.getDerivedFromVars(W.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),tt=O,o=P,nt=it(S,1,nt),lt=Ut(V,lt),ot=Lt(F,ot);{const t=E;It(t)&&(at=t/lt)}return bt(x)&&(st=et(x/lt*10)),ut=it(w,1,ut),ct=it(_,1,ct),m&&m in dt&&(pt=dt[m],vt=m),l="multi_line_text"===vt,s=G.getDerivedFromVars(W.paddings),U(),U=a(s,(t=>g=t)),It(f)&&(gt=`calc(${f*(at||1.25)+"em"} + ${rt(xt(null==g?void 0:g.top,0)+xt(null==g?void 0:g.bottom,0))})`),u=G.getDerivedFromVars(W.accessibility),R(),R=a(u,(t=>p=t)),(null==p?void 0:p.description)?ft=p.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:l},d={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ct,"font-size":et(lt),"font-weight":ot,"line-height":at,"letter-spacing":st,color:ut,"max-height":gt},R(),U(),h(),y(),b(),$(),k(),C(),A(),D(),z(),I(),J(),B(),Q?"":`${M(Bt,"Outer").$$render(t,{cls:mt("input",ir,c),style:d,customDescription:!0,customActions:"input",json:W,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<span${N("class",ir.input__wrapper,0)}><span${N("class",ir.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"":""}</span>\n ${l?`<textarea${N("class",ir.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ft,0)}${N("placeholder",o,0)}${N("this",Z,0)}>${j(tt,!0)}</textarea>`:`<input${N("type",pt,0)}${N("class",ir.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ft,0)}${N("placeholder",o,0)}${N("value",tt,0)}${N("this",Z,0)}>`}</span>`})}`}))},ar=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:l}=e;const s=v(Y);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),u=i,c=o,d=u&&or[u.type]||void 0,!d&&(({templateContext:c,json:u}=s.processTemplate(u,c)),d=u&&or[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&s.hasTemplate(u.type)?"Recursive template":"Unknown component",s.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||P,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:l,origJson:a||i},{},{})}`:""})),lr=ar,sr=J(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${z([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("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"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function ur(t,e,r,n){const i=r[t.type];if(!i)return n(X(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const l=function e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),l=o.filter((t=>"$"!==t.charAt(0))),s=o.filter((t=>"$"===t.charAt(0)));return l.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),s.forEach((e=>{const o=i[e],l=a[o];if(void 0!==l){const t=e.substring(1);r[t]=l}else n(X(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(l[o]=t[o]);return{json:l,templateContext:a}}function cr(){}function dr(t){return{subscribe:e=>(e(t),cr)}}function vr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function pr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function gr(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 fr(t){var e=parseInt(t,10);if(e>Ue||e<We)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function hr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function mr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,mr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function yr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function _r(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ht,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ft(e)}},a=Vt,l="@{",s="}",u="@{}",c="\\",d="||",v="&&",p="==",g="!=",f=">=",h="<=",m="+",y="-",_="true",b="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},S=kt(["}"],!0,!1),z=xt("?",!1),P=xt(":",!1),M=xt("||",!1),I=xt("&&",!1),O=xt("==",!1),J=xt("!=",!1),N=xt(">=",!1),T=xt(">",!1),B=xt("<=",!1),R=xt("<",!1),U=xt("+",!1),W=xt("-",!1),L=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Z=xt("(",!1),Y=xt(")",!1),X=xt(",",!1),K=Et("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Et("integer"),rt=kt([["0","9"]],!1,!1),nt=Et("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),lt=Et("boolean"),st=xt("true",!1),ut=xt("false",!1),ct=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Et("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ft=function(t){return gr(t)},ht=0,mt=0,yt=[{line:1,column:1}],_t=0,bt=[],wt=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function $t(){return t.substring(mt,ht)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=yt[e];if(n)return n;for(r=e-1;!yt[r];)r--;for(n={line:(n=yt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return yt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ht<_t||(ht>_t&&(_t=ht,bt=[]),bt.push(t))}function Vt(){var t,e;return t=ht,Ut(),(e=Dt())!==n?(Ut(),mt=t,t=e):(ht=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=s,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===u?(r=u,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=c,ht++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=s,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=hr(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,l;return e=ht,(r=St())!==n?(Ut(),63===t.charCodeAt(ht)?(i="?",ht++):(i=n,0===wt&&At(z)),i!==n?(Ut(),(o=Dt())!==n?(Ut(),58===t.charCodeAt(ht)?(a=":",ht++):(a=n,0===wt&&At(P)),a!==n?(Ut(),(l=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:l}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,l,s,u;if(e=ht,(r=zt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===d?(l=d,ht+=2):(l=n,0===wt&&At(M)),l!==n?(s=Ut(),(u=zt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===d?(l=d,ht+=2):(l=n,0===wt&&At(M)),l!==n?(s=Ut(),(u=zt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=pr(r,i)}else ht=e,e=n;return e}function zt(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Pt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===v?(l=v,ht+=2):(l=n,0===wt&&At(I)),l!==n?(s=Ut(),(u=Pt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===v?(l=v,ht+=2):(l=n,0===wt&&At(I)),l!==n?(s=Ut(),(u=Pt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=pr(r,i)}else ht=e,e=n;return e}function Pt(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Mt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===p?(l=p,ht+=2):(l=n,0===wt&&At(O)),l===n&&(t.substr(ht,2)===g?(l=g,ht+=2):(l=n,0===wt&&At(J))),l!==n?(s=Ut(),(u=Mt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===p?(l=p,ht+=2):(l=n,0===wt&&At(O)),l===n&&(t.substr(ht,2)===g?(l=g,ht+=2):(l=n,0===wt&&At(J))),l!==n?(s=Ut(),(u=Mt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=vr(r,i)}else ht=e,e=n;return e}function Mt(){var e,r,i,o,a,l,s,u;if(e=ht,(r=It())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===f?(l=f,ht+=2):(l=n,0===wt&&At(N)),l===n&&(62===t.charCodeAt(ht)?(l=">",ht++):(l=n,0===wt&&At(T)),l===n&&(t.substr(ht,2)===h?(l=h,ht+=2):(l=n,0===wt&&At(B)),l===n&&(60===t.charCodeAt(ht)?(l="<",ht++):(l=n,0===wt&&At(R))))),l!==n?(s=Ut(),(u=It())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===f?(l=f,ht+=2):(l=n,0===wt&&At(N)),l===n&&(62===t.charCodeAt(ht)?(l=">",ht++):(l=n,0===wt&&At(T)),l===n&&(t.substr(ht,2)===h?(l=h,ht+=2):(l=n,0===wt&&At(B)),l===n&&(60===t.charCodeAt(ht)?(l="<",ht++):(l=n,0===wt&&At(R))))),l!==n?(s=Ut(),(u=It())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=vr(r,i)}else ht=e,e=n;return e}function It(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Ot())!==n){for(i=[],o=ht,a=Ut(),43===t.charCodeAt(ht)?(l=m,ht++):(l=n,0===wt&&At(U)),l===n&&(45===t.charCodeAt(ht)?(l=y,ht++):(l=n,0===wt&&At(W))),l!==n?(s=Ut(),(u=Ot())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),43===t.charCodeAt(ht)?(l=m,ht++):(l=n,0===wt&&At(U)),l===n&&(45===t.charCodeAt(ht)?(l=y,ht++):(l=n,0===wt&&At(W))),l!==n?(s=Ut(),(u=Ot())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=vr(r,i)}else ht=e,e=n;return e}function Ot(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Jt())!==n){for(i=[],o=ht,a=Ut(),47===t.charCodeAt(ht)?(l="/",ht++):(l=n,0===wt&&At(L)),l===n&&(42===t.charCodeAt(ht)?(l="*",ht++):(l=n,0===wt&&At(q)),l===n&&(37===t.charCodeAt(ht)?(l="%",ht++):(l=n,0===wt&&At(H)))),l!==n?(s=Ut(),(u=Jt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),47===t.charCodeAt(ht)?(l="/",ht++):(l=n,0===wt&&At(L)),l===n&&(42===t.charCodeAt(ht)?(l="*",ht++):(l=n,0===wt&&At(q)),l===n&&(37===t.charCodeAt(ht)?(l="%",ht++):(l=n,0===wt&&At(H)))),l!==n?(s=Ut(),(u=Jt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=vr(r,i)}else ht=e,e=n;return e}function Jt(){var e,r,i;return(e=Bt())===n&&(e=Tt())===n&&(e=ht,33===t.charCodeAt(ht)?(r="!",ht++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ht)?(r=m,ht++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)))),r!==n?(Ut(),(i=Jt())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ht,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ht)?(i="(",ht++):(i=n,0===wt&&At(Z)),i!==n?(Ut(),o=function(){var e,r,i,o,a,l,s;if(e=ht,(r=Dt())!==n){for(i=[],o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(l=Dt())!==n?o=l:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(l=Dt())!==n?o=l:(ht=o,o=n)):(ht=o,o=n);mt=e,s=i,e=[r,...s]}else ht=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ht)?(a=")",ht++):(a=n,0===wt&&At(Y)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,(r=Rt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ht,39===t.charCodeAt(ht)?(r="'",ht++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ht,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=gr(e)}(),39===t.charCodeAt(ht)?(o="'",ht++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Tt())===n&&(e=function(){var e,r;return wt++,e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(st)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ht,t.substr(ht,5)===b?(r=b,ht+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(lt)),e}(),e===n&&(e=ht,40===t.charCodeAt(ht)?(r="(",ht++):(r=n,0===wt&&At(Z)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ht)?(o=")",ht++):(o=n,0===wt&&At(Y)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=s,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===u?(r=u,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=c,ht++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ht)?(i="'",ht++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=s,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=hr(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Tt(){var e,r,i,o;if(wt++,e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:fr($t())}):(ht=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Bt(){var e,r,i,o,a,l,s,u,c,d;for(wt++,e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ht)?(o=".",ht++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)a.push(l),x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt));else a=n;if(a!==n){if(l=ht,101===t.charCodeAt(ht)?(s="e",ht++):(s=n,0===wt&&At(ot)),s===n&&(69===t.charCodeAt(ht)?(s="E",ht++):(s=n,0===wt&&At(at))),s!==n){if(43===t.charCodeAt(ht)?(u=m,ht++):(u=n,0===wt&&At(U)),u===n&&(45===t.charCodeAt(ht)?(u=y,ht++):(u=n,0===wt&&At(W))),u===n&&(u=null),c=[],x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt));else c=n;c!==n?l=s=[s,u,c]:(ht=l,l=n)}else ht=l,l=n;l===n&&(l=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ht=e,e=n}else ht=e,e=n;if(e===n){if(e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ht)?(o="e",ht++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ht)?(o="E",ht++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ht)?(a=m,ht++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ht)?(a=y,ht++):(a=n,0===wt&&At(W))),a===n&&(a=null),l=[],x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)l.push(s),x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt));else l=n;l!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ht=e,e=n)}else ht=e,e=n;else ht=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Rt(){var e,r,i,o,a;if(wt++,e=ht,r=ht,wt++,i=function(){var e,r,i,o;return e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(st)),r===n&&(t.substr(ht,5)===b?(r=b,ht+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ht,wt++,k.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ht=i,i=n),i!==n?e=r=[r,i]:(ht=e,e=n)):(ht=e,e=n),e}(),wt--,i===n?r=void 0:(ht=r,r=n),r!==n)if(E.test(t.charAt(ht))?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ht=e,e=n;else ht=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Ut(){var e,r;for(wt++,e=[],C.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),C.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ht===t.length)return r;throw r!==n&&ht<t.length&&At({type:"end"}),function(t,e,r){return new mr(mr.buildMessage(t,e),t,e,r)}(bt,_t<t.length?t.charAt(_t):null,_t<t.length?Ft(_t,_t+1):Ft(_t,_t))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(mr,Error),mr.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 i=this.location.start,o=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,l=yr("",i.line.toString().length," "),s=n[i.line-1],u=(i.line===a.line?a.column:s.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+l+" |\n"+i.line+" | "+s+"\n"+l+" | "+yr("",i.column-1," ")+yr("",u,"^")}else e+="\n at "+o}return e},mr.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(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 o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+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?'"'+i(t)+'"':"end of input"}(e)+" found."};const br=new Map,wr=new Map;function $r(t,e,r){const n={args:e,cb:r},i=br.get(t)||[];br.has(t)||br.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");wr.set(o,n)}function xr(t,e){let r=t.args.length,n=t.args.length;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!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function kr(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=>{kr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":kr(t.left,e),kr(t.right,e);break;case"UnaryExpression":kr(t.argument,e);break;case"ConditionalExpression":kr(t.test,e),kr(t.consequent,e),kr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{kr(t,e)}))}}function Er(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Cr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Fr(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 Cr(t.value);if("color"===t.type)return Ir(Mr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Ar(t){let e=Fr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Vr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const jr=new Int32Array(1);function Dr(t){return jr[0]=t,jr[0]}function Sr(t){if(t<We||t>Ue)throw new Error("Integer overflow.")}function zr(t){const e=[];return kr(t,{Variable(t){e.push(t.id.name)}}),e}function Pr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Mr(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Ir(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 nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Or(t){return{type:He,value:Fr(t)}}function Jr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ze,value:e}}function Nr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ge&&(r=Dr(r)),{type:t.type,value:r}}function Tr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ge&&(r=Dr(r)),{type:t.type,value:r}}function Br(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Ge&&(e=Dr(e));return{type:t[0].type,value:e}}function Rr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ge&&(e=Dr(e));return{type:t.length?t[0].type:Ge,value:e}}function Ur(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ge&&(e=Dr(e));return{type:t.length?t[0].type:Ge,value:e}}function Wr(t){const e=Math.abs(t.value);return t.type===Ge&&Sr(e),{type:t.type,value:e}}function Lr(...t){if(!t.length)throw new Error("Non empty argument list is required for max function.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function qr(...t){if(!t.length)throw new Error("Non empty argument list is required for min function.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function Hr(t){return{type:t.type,value:Math.sign(t.value)}}function Gr(t,e){let r;if(0===e.value&&t.type===Ge)r=t.value;else if(0===t.value&&t.type===Ge)r=0;else{let n=Math.sign(e.value);t.type===Ze&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ge&&Sr(r),{type:t.type,value:r}}function Zr(t){return e=>{const r=Mr(e.value);return{type:Ze,value:r[t]/255}}}function Yr(t){return(e,r)=>{const n=Mr(e.value);return n[t]=255*r.value,{type:Xe,value:Ir(n)}}}const Xr=Zr("a"),Kr=Zr("r"),Qr=Zr("g"),tn=Zr("b"),en=Yr("a"),rn=Yr("r"),nn=Yr("g"),on=Yr("b");function an(t){return t.map(Ar).join(", ")}$r("toString",[Ge],Or),$r("toString",[Ze],Or),$r("toString",[Ye],Or),$r("toString",[Xe],Or),$r("toString",["url"],Or),$r("toNumber",[Ge],Jr),$r("toNumber",[He],Jr),$r("toInteger",[Ze],(function(t){if(t.value>Ue||t.value<We)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ge,value:e}})),$r("toInteger",[He],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>Ue||e<We)throw new Error("Unable to convert value to Integer.");return{type:Ge,value:e}})),$r("toInteger",[Ye],(function(t){return{type:Ge,value:t.value?1:0}})),$r("toBoolean",[Ge],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ye,value:t.value}})),$r("toBoolean",[He],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ye,value:"true"===t.value?1:0}})),$r("encodeUri",[He],(function(t){try{return{type:He,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),$r("decodeUri",[He],(function(t){try{return{type:He,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),$r("parseUnixTime",[Ge],(function(t){return{type:Ke,value:new Date(1e3*t.value)}})),$r("nowLocal",[],(function(){return{type:Ke,value:new Date}})),$r("addMillis",[Ke,Ge],(function(t,e){return{type:Ke,value:new Date(t.value.getTime()+e.value)}})),$r("setYear",[Ke,Ge],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ke,value:r}})),$r("setMonth",[Ke,Ge],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:Ke,value:r}})),$r("setDay",[Ke,Ge],(function(t,e){const r=new Date(t.value);if(e.value<=0&&-1!==e.value||e.value>function(t){const e=new Date(t);return e.setMonth(e.getMonth()+1),e.setDate(0),e.getDate()}(r))throw new Error(`Unable to set day ${e.value} for date ${Fr(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Ke,value:r}})),$r("setHours",[Ke,Ge],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:Ke,value:r}})),$r("setMinutes",[Ke,Ge],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:Ke,value:r}})),$r("setSeconds",[Ke,Ge],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:Ke,value:r}})),$r("setMillis",[Ke,Ge],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:Ke,value:r}})),$r("len",[He],(function(t){return{type:Ge,value:t.value.length}})),$r("contains",[He,He],(function(t,e){return{type:Ye,value:t.value.includes(e.value)?1:0}})),$r("substring",[He,Ge,Ge],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:He,value:t.value.substring(e.value,r.value)}})),$r("replaceAll",[He,He,He],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:He,value:n}})),$r("index",[He,He],(function(t,e){return{type:Ge,value:t.value.indexOf(e.value)}})),$r("lastIndex",[He,He],(function(t,e){return{type:Ge,value:t.value.lastIndexOf(e.value)}})),$r("trim",[He],(function(t){return{type:He,value:t.value.trim()}})),$r("trimLeft",[He],(function(t){return{type:He,value:t.value.replace(/^\s+/,"")}})),$r("trimRight",[He],(function(t){return{type:He,value:t.value.replace(/\s+$/,"")}})),$r("toUpperCase",[He],(function(t){return{type:He,value:t.value.toUpperCase()}})),$r("toLowerCase",[He],(function(t){return{type:He,value:t.value.toLowerCase()}})),$r("div",[Ge,Ge],Nr),$r("div",[Ze,Ze],Nr),$r("mod",[Ge,Ge],Tr),$r("mod",[Ze,Ze],Tr),$r("mul",[{type:Ge,isVararg:!0}],Br),$r("mul",[{type:Ze,isVararg:!0}],Br),$r("sub",[{type:Ge,isVararg:!0}],Rr),$r("sub",[{type:Ze,isVararg:!0}],Rr),$r("sum",[{type:Ge,isVararg:!0}],Ur),$r("sum",[{type:Ze,isVararg:!0}],Ur),$r("abs",[Ge],Wr),$r("abs",[Ze],Wr),$r("max",[{type:Ge,isVararg:!0}],Lr),$r("max",[{type:Ze,isVararg:!0}],Lr),$r("min",[{type:Ge,isVararg:!0}],qr),$r("min",[{type:Ze,isVararg:!0}],qr),$r("maxNumber",[],(function(){return{type:Ze,value:Le}})),$r("minNumber",[],(function(){return{type:Ze,value:qe}})),$r("maxInteger",[],(function(){return{type:Ge,value:Ue}})),$r("minInteger",[],(function(){return{type:Ge,value:We}})),$r("round",[Ze],(function(t){const e=Math.sign(t.value);return{type:Ze,value:e*Math.round(Math.abs(t.value))}})),$r("floor",[Ze],(function(t){return{type:Ze,value:Math.floor(t.value)}})),$r("ceil",[Ze],(function(t){return{type:Ze,value:Math.ceil(t.value)}})),$r("signum",[Ze],Hr),$r("signum",[Ge],Hr),$r("copySign",[Ze,Ze],Gr),$r("copySign",[Ge,Ge],Gr),$r("getColorAlpha",[He],Xr),$r("getColorAlpha",[Xe],Xr),$r("getColorRed",[He],Kr),$r("getColorRed",[Xe],Kr),$r("getColorGreen",[He],Qr),$r("getColorGreen",[Xe],Qr),$r("getColorBlue",[He],tn),$r("getColorBlue",[Xe],tn),$r("setColorAlpha",[He,Ze],en),$r("setColorAlpha",[Xe,Ze],en),$r("setColorRed",[He,Ze],rn),$r("setColorRed",[Xe,Ze],rn),$r("setColorGreen",[He,Ze],nn),$r("setColorGreen",[Xe,Ze],nn),$r("setColorBlue",[He,Ze],on),$r("setColorBlue",[Xe,Ze],on),$r("rgb",[Ze,Ze,Ze],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Xe,value:Ir(n)}})),$r("argb",[Ze,Ze,Ze,Ze],(function(t,e,r,n){const i={a:255*t.value,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Xe,value:Ir(i)}}));const ln={StringLiteral:function(t,e){return{type:He,value:e.value}},NumberLiteral:function(t,e){return{type:Ze,value:e.value}},IntegerLiteral:function(t,e){return{type:Ge,value:e.value}},BooleanLiteral:function(t,e){return{type:Ye,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Er(sn(t,e.argument));switch(e.operator){case"!":if(r.type===Ye)return{type:Ye,value:r.value?0:1};Pr(`${e.operator}${Ar(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ge)return{type:Ge,value:r.value*t};if(r.type===Ze)return{type:Ze,value:r.value*t};Pr(`${e.operator}${Ar(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Er(sn(t,e.test));if(r.type===Ye)return r.value?sn(t,e.consequent):sn(t,e.alternate);Pr(`${Ar(r)} ? ${Ar(sn(t,e.consequent))} : ${Ar(sn(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return sn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Fr(sn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:He,value:r}},LogicalExpression:function(t,e){const r=Er(sn(t,e.left));if(r.type!==Ye&&Pr(`${Ar(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ye,value:0};const n=Er(sn(t,e.right));return n.type!==Ye&&Pr(`${Ar(r)} ${e.operator} ${Ar(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Vr(n.type)}.`),{type:Ye,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=sn(t,e.left),i=sn(t,e.right);if(n.type!==i.type&&Pr(`${Ar(n)} ${e.operator} ${Ar(i)}`,`Operator '${r}' cannot be applied to different types: ${Vr(n.type)} and ${Vr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ke&&r.type===Ke?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ye,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ze&&e.type!==Ge&&e.type!==Ke&&Pr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`);const i=e.type===Ke?e.value.getTime():e.value,o=r.type===Ke?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ye,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==He&&e.type!==Ze&&e.type!==Ge&&Pr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),e.type===He)return"-"===t&&Pr(`${Ar(e)} - ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),{type:He,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ge&&(n=Dr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ge&&e.type!==Ze&&Pr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&Pr(`${Ar(e)} ${t} ${Ar(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ge&&(n=Dr(n)),{type:e.type,value:n}}(r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!br.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>sn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(wr.has(o))n=wr.get(o);else{const t=function(t,e){const r=br.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=xr(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t){const e=i.map((t=>Vr(t.type))).join(", "),n=`${r}(${an(i)})`;"few"===t.type&&0===i.length?Pr(n,`Non empty argument list is required for function '${r}'.`):(t.type,Pr(n,`Function '${r}' has no matching override for given argument types: ${e}.`))}n=t}if(!n)throw new Error("Function not found");try{return n.cb(...i)}catch(t){Pr(`${r}(${an(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' has value null`)}};function sn(t,e){if(e.type in ln)return ln[e.type](t,e);throw new Error("Unsupported expression")}function un(t,e){try{return sn(t,e)}catch(t){return{type:"error",value:t.message}}}class cn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return kr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=un(t,this.ast);if("error"===r.type)return void e(X(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;if(n instanceof Date)return Cr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=ot(String(n));if(t)return Ir(t);e(X(new Error("Expression execution error")))}return n}catch(t){return void e(X(new Error("Expression execution error")))}}}function dn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=_r(t,{startRule:"JsonStringContents"}),n=zr(r);return e.vars.push(...n),new cn(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>dn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=dn(t[i],e,r);return n}}var n;return t}function vn(t,e,r){if(t){if(t instanceof cn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>vn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=vn(t[i],e,r);return n}}return t}function pn(t,e){const r={vars:[],hasExpression:!1},n=dn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>vn(n,t,e)}}const gn={pagers:function(){return U(new Map)}},fn=new Map,hn=new Map;function mn(t){const e=fn.get(t)||U("");return fn.has(t)||fn.set(t,e),e}function yn(t){const e=hn.get(t)||new Map;return hn.has(t)||hn.set(t,e),e}class _n{setVariable(t){const e=t.getName(),r=yn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),mn(this).set(e)}getVariable(t){return yn(this).get(t)}}function bn(){return new _n}const wn=J(((t,e,r,n)=>{let i,o;var l,s,u;let{id:c}=e,{json:v={}}=e,{platform:p="auto"}=e,{theme:g="system"}=e,{globalVariablesController:f=new _n}=e,{onError:h}=e,{onStat:m}=e,{onCustomAction:y}=e,{onComponent:b}=e,w=U("desktop"===p);if(o=a(w,(t=>i=t)),"auto"===p&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");w.set(!t.matches),t.addListener((()=>{w.set(!t.matches)}))}let $="light",x=null;function k(t){g=t}let E=!1;v||(E=!0,N(X(new Error('"json" prop is required')))),c||(E=!0,N(X(new Error('"id" prop is required'))));let C=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in or)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const F=v.templates||{};C&&(E=!0,N(C));const A={stateChange:!1},V=mn(f),D=yn(f),S=new Map,z=new Map,P=new Map;function I(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=z.get(t);r&&r.setValue(e)}}function O(t){const e=z.get(t);return null==e?void 0:e.getValue()}function J(t){const e=pn(t,N);return e.vars.length?e.applyVars(z):t}function N(t){h?h({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function T(t,e){m&&m({type:t,action:e})}let B=0;function R(t){return`${c}-${B++}`}let L={},q={};function H(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=et,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],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=K(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=K(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=K(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=z.get(r);t?t.set(i):N(X(new Error("Cannot find variable"),{additional:{name:r}}))}else N(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:N(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){N(X(t,{additional:{url:e}}))}}function G(t){null==y||y(t)}const Z=new Map;function K(t){if(Z.has(t))return Z.get(t);N(X(new Error("Missing instance with id"),{additional:{id:t}}))}const Q=new Map;function tt(t){for(const e of t)z.has(e)&&t.delete(e);return t}d(Y,{logError:N,logStat:T,hasTemplate:function(t){return t in F},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in F;){if(({json:t,templateContext:e}=ur(t,e,F,N)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:R,genClass:function(t){return`divkit-${R()}`},execAction:H,execAnyActions:async function(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=pt(i);if(t)if(ft(t)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(H(n),await _()):n.log_id&&(G(n),await _())}}t.forEach((t=>{t.log_id&&T("click",t)}))}},execCustomAction:G,isRunning:function(t){return A[t]},setRunning:function(t,e){A[t]=e},registerInstance:function(t,e){Z.has(t)?N(X(new Error("Duplicate instance id"),{additional:{id:t}})):Z.set(t,e)},unregisterInstance:function(t){Z.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(q[r]=q[r]||0,++q[r],L[r])return L[r];const n=`${R()}-svg-filter`;return L=Object.assign(Object.assign({},L),{[r]:n}),n},removeSvgFilter:function(t,e){t&&q[t]&&0==--q[`${t}:${e}`]&&(L=Object.keys(L).reduce(((t,e)=>(q[e]&&(t[e]=L[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return dr(t);const e=pn(t,N);return e.vars.length?W(e.vars.map((t=>z.get(t)||function(t){const e=P.get(t)||U(void 0);return P.has(t)||P.set(t,e),e}(t))).filter(lt),(()=>e.applyVars(z))):e.hasExpression?dr(e.applyVars(z)):dr(t)},getJsonWithVars:J,getStore:function(t){return Q.has(t)||function(t){Q.has(t)||Q.set(t,gn[t]())}(t),Q.get(t)},getVariable:function(t,e){const r=z.get(t);if(r){const n=r.getType();if(n!==e)return void N(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},isDesktop:w,registerComponent:void 0,unregisterComponent:void 0}),d(St,{hasAction:()=>!1});const et={setState(t){throw new Error("Not implemented")},getChild(t){if(rt&&rt.has(t))return rt.get(t);N(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let rt=null;d(yt,{registerInstance(t,e){rt||(rt=new Map),rt.has(t)?N(X(new Error("Duplicate state with id"),{additional:{id:t}})):rt.set(t,e)},unregisterInstance(t){null==rt||rt.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>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 nt=null===(l=null==v?void 0:v.card)||void 0===l?void 0:l.variables;Array.isArray(nt)&&nt.forEach((t=>{if(t&&t.type in tr&&t.name){if(S.has(t.name))return void N(X(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=er(t.name,t.type,t.value);S.set(t.name,e),z.set(t.name,e)}catch(e){N(X(e,{additional:{name:t.name}}))}}}));const it=v.palette;it&&it[$].forEach((t=>{if(S.has(t.name))N(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=er(t.name,"color",t.color);S.set(t.name,e),z.set(t.name,e)}catch(e){N(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of D)z.has(t)||z.set(t,e);V.subscribe((t=>{if(t&&!z.has(t)){const e=D.get(t);z.set(t,e);const r=P.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ot=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variable_triggers;Array.isArray(ot)&&ot.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void N(X(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const n=_r(t.condition,{startRule:"JsonStringContents"}),i=zr(n);if(!i.length)return void N(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return tt(e),e.size?new Promise((t=>{const r=V.subscribe((()=>{tt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{W(i.map((t=>z.get(t))).filter(lt),(()=>un(z,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=J(t);e.log_id&&H(e)})),e=Boolean(n.value)):N(X(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){N(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else N(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const at=null===(u=v.card)||void 0===u?void 0:u.states,st=at&&!E?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:at.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return void 0===e.id&&r.id&&void 0!==c&&r.id(c),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==p&&r.platform(p),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==f&&r.globalVariablesController(f),void 0===e.onError&&r.onError&&void 0!==h&&r.onError(h),void 0===e.onStat&&r.onStat&&void 0!==m&&r.onStat(m),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==y&&r.onCustomAction(y),void 0===e.onComponent&&r.onComponent&&void 0!==b&&r.onComponent(b),void 0===e.setTheme&&r.setTheme&&void 0!==k&&r.setTheme(k),void 0===e.setVariable&&r.setVariable&&void 0!==I&&r.setVariable(I),void 0===e.getVariable&&r.getVariable&&void 0!==O&&r.getVariable(O),void 0===e.execAction&&r.execAction&&void 0!==H&&r.execAction(H),"light"===g||"dark"===g?$=g:"system"===g?"undefined"!=typeof matchMedia?(x||(x=matchMedia("(prefers-color-scheme: dark)"),x.addListener((function(){"system"===g&&x&&($=x.matches?"dark":"light")}))),$=x.matches?"dark":"light"):$="light":N(X(new Error("Unsupported theme"))),$&&(it&&it[$].forEach((t=>{const e=z.get(t.name);e&&e.setValue(t.color)}))),o(),!E&&st?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)}">${M(sr,"RootSvgFilters").$$render(t,{svgFiltersMap:L},{},{})}\n ${M(lr,"Unknown").$$render(t,{div:st,templateContext:{}},{},{})}</div>`:""})),$n=wn;function xn(t){return $n.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var kn=exports;for(var En in e)kn[En]=e[En];e.__esModule&&Object.defineProperty(kn,"__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={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let l;function s(t){l=t}function u(){if(!l)throw new Error("Function called outside component initialization");return l}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>wn,createVariable:()=>rr,render:()=>kn}),new Set,new Map;const p=[],g=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.push(t)}const w=new Set;let $=0;function x(){const t=l;do{for(;$<p.length;){const t=p[$];$++,s(t),k(t.$$)}for(s(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(p.length);for(;h.length;)h.pop()();y=!1,w.clear(),s(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),E=/[\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 F(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=T(n):r.style=T(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}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(E.test(t))return;const e=r[t];!0===e?n+=" "+t:C.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=D(t[r]);return e}function z(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const P={$$render:()=>""};function M(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`);return t}let I,O;function J(t){function e(e,r,n,i,o){const a=l;s({$$:{on_destroy:I,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,n,i);return s(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=T(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const R=[];function U(t,e=r){let n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!R.length;for(const e of i)e[1](),R.push(e,t);if(e){for(let t=0;t<R.length;t+=2)R[t][0](R[t+1]);R.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,l=r){const s=[a,l];return i.add(s),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(s),0===i.size&&(n(),n=null)}}}}function W(t,e,n){const l=!Array.isArray(t),s=l?[t]:t,u=e.length<2;return c=t=>{let n=!1;const c=[];let d=0,v=r;const p=()=>{if(d)return;v();const n=e(l?c[0]:c,t);u?t(n):v=o(n)?n:r},g=s.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&p()}),(()=>{d|=1<<e}))));return n=!0,p(),function(){i(g),v()}},{subscribe:U(n,c).subscribe};var c}const L="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Z="divkit-f0cba",Y=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={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_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"};function tt(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 et(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function it(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=ot(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ot(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,i,o]=e,a=2===n.length?n:n+n,l=2===i.length?i:i+i,s=2===o.length?o:o+o,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(l,16),b:parseInt(s,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,l=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(l,16)}}return null}function at(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const lt=Boolean;function st(t){if(1===t.length&&"solid"===t[0].type)return{color:it(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=it(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(lt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>it(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:dt(t.bg.scale),pos:vt(t.bg),image:'url("'+at(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(lt);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=rt(n.value):"relative"===n.type&&(i=ut[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ct(t.bg.center_x)} ${ct(t.bg.center_y)},`+r.map((t=>it(t))).join(",")+")"}}({bg:t}):void 0)).filter(lt).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 ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ct(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function dt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(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 pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const gt=new Set(["http","https","tel","mailto","intent"]);function ft(t){return gt.has(t)}function ht(t,e){e&&t.push(e)}function mt(t,e,r){const n=[];ht(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ht(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const yt=Symbol("state");function _t(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function bt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function wt(t){return bt(t)&&t>=0}function $t(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!wt(r[t]))return e;return _t(t)}function xt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const kt=Object.prototype.hasOwnProperty;function Ct(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 i=r[n];if(!kt.call(e,i)||!Ct(t[i],e[i]))return!1}return!0}function Et(t,e){return Ct(t,e)?e:t}function Ft(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function At(t,e){const r=Number(t);return isNaN(r)?e:r}function Vt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Vt(t))})):e.push(t),e}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function Dt(){}const St=Symbol("action"),zt=J(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:l=""}=e,{style:s=null}=e,{attrs:u}=e,{use:c=Dt}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const f=v(Y),h=v(St);d(St,{hasAction:()=>Boolean(h.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&h.hasAction()&&(y="",f.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(p);return y&&!ft(pt(y))&&(y="",_=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==l&&r.cls(l),void 0===e.style&&r.style&&void 0!==s&&r.style(s),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href:D(y)},{target:D(m)},{style:D(s)},{class:j(l,!0)+" "+j(g?L:q,!0)+" "+j(null!=a&&a.length?Z:"",!0)},S(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(l,!0)+j(_?` ${g?L:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Z:"",!0)},{style:D(s)},{role:D(_?"button":null)},{tabindex:D(_?0:null)},S(u)],{})}>${n.default?n.default({}):""}</span>`})),Pt=zt,Mt="divkit-b921d";function It(t){return bt(t)&&t>0}function Ot(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(It(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Jt=J(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const l=v(Y);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),i=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const n=st([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=Ot(t.filters,l.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${z(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",Mt,0)}${N("style",tt(t.style),0)}>`:`<span${N("class",Mt,0)}${N("style",tt(t.style),0)}></span>`))}</span>`})),Nt=Jt,Tt=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,b,w,$,x,k,C,E,F,A,V,j,D,S,z,P,I,O,J,T,B,R,U,W,L,q,H,G,Z,K,nt=r,ot=r,at=r,lt=r,ut=r,ct=r,dt=r,vt=r,gt=r,ht=r,bt=r,kt=r,Ct=r,Dt=r,St=r,zt=r,Mt=r;var It,Ot,Jt,Tt,Bt,Rt;let{json:Ut={}}=e,{origJson:Wt}=e,{templateContext:Lt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Yt=!1}=e,{customActions:Xt=""}=e,{forceWidth:Kt=!1}=e,{forceHeight:Qt=!1}=e,{additionalPaddings:te=null}=e;const ee={left:"start",center:"center",right:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=v(Y),ie=v(yt);let oe,ae,le,se,ue,ce,de,ve={},pe={},ge=!1,fe=1,he="transparent",me=0,ye={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},_e="",be=null,we="",$e={},xe=0,ke=0,Ce=0,Ee=!1,Fe=!1,Ae={},Ve=0,je=0,De=0,Se=!1,ze=!1,Pe=1;const Me=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Ie=-1!==Me.indexOf("state_change")&&Ut.id,Oe=-1!==Me.indexOf("visibility_change")&&Ut.id;let Je,Ne,Te,Be,Re,Ue,We,Le,qe,He=[],Ge=[],Ze=[],Ye=[],Xe="",Ke=!1,Qe="visible",tr=0,er=0;void 0===e.json&&n.json&&void 0!==Ut&&n.json(Ut),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==Lt&&n.templateContext(Lt),void 0===e.cls&&n.cls&&void 0!==qt&&n.cls(qt),void 0===e.style&&n.style&&void 0!==Ht&&n.style(Ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==Gt&&n.layoutParams(Gt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Yt&&n.customPaddings(Yt),void 0===e.customActions&&n.customActions&&void 0!==Xt&&n.customActions(Xt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Kt&&n.forceWidth(Kt),void 0===e.forceHeight&&n.forceHeight&&void 0!==Qt&&n.forceHeight(Qt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==te&&n.additionalPaddings(te),o=ne.getDerivedFromVars(Ut.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,n="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Tt=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Tt?void 0:Tt.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+it(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,fe=xt(K.stroke.width,fe),he=it(K.stroke.color,1,he),e.border=`${et(fe)} solid ${he}`),K.corners_radius?(ye=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]&&!wt(r[t]))return e;return t}(K.corners_radius,ye),e["border-radius"]=t["border-radius"]=jt(ye)):K.corner_radius&&(me=xt(K.corner_radius,me),ye={"top-left":me,"top-right":me,"bottom-right":me,"bottom-left":me},e["border-radius"]=t["border-radius"]=et(me)),r&&fe&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},ye);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+fe/2})),n=jt(t)}}ve=Et(t,ve),pe=Et(e,pe),ge=r,_e=n}l=ne.getDerivedFromVars(Ut.paddings),zt(),zt=a(l,(t=>Z=t)),be=function(t,e){if(!t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!wt(t[r[n]]))return e;return t}(Z&&!Yt?Z:void 0,be),s=_t(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(be,te)),u=ne.getDerivedFromVars(Ut.margins),Dt(),Dt=a(u,(t=>H=t)),we=$t(H,we),c=ne.getDerivedFromVars(Ut.width),kt(),kt=a(c,(t=>L=t)),d=ne.getDerivedFromVars(Ut.alignment_horizontal),St(),St=a(d,(t=>G=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const l=null==L?void 0:L.type;if("fixed"===l?(xe=xt(null==L?void 0:L.value,xe),e=et(xe)):"wrap_content"===l||!Gt.overlapParent&&"match_parent"===l&&Gt.parentHorizontalWrapContent?(t="content",("wrap_content"===l&&(null==L?void 0:L.constrained)||"match_parent"===l&&Gt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===l&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(a=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Gt.parentContainerOrientation&&(n=L&&"weight"in L&&L.weight||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Kt&&(t="parent",ne.logError(X(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=G;r["halign-self"]="left"===t||"center"===t||"right"===t?ee[t]:Gt.parentHAlign||"start"}t&&(r.width=t),le=e,ke=n,Ce=i,$e=Et(r,$e),Ee=o,Fe=a}p=ne.getDerivedFromVars(Ut.height),bt(),bt=a(p,(t=>W=t)),g=ne.getDerivedFromVars(Ut.alignment_vertical),Ct(),Ct=a(g,(t=>q=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const l=null==W?void 0:W.type;if("fixed"===l?(Ve=xt(null==W?void 0:W.value,Ve),e=et(Ve)):"match_parent"!==l||!Gt.overlapParent&&Gt.parentVerticalWrapContent?(t="content",("wrap_content"===l&&(null==W?void 0:W.constrained)||"match_parent"===l&&Gt.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===l&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(a=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Gt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Qt&&(t="parent",ne.logError(X(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Gt.parentContainerOrientation?r["valign-self"]=re[t]:r["valign-self"]=Gt.parentVAlign||"start"}t&&(r.height=t),se=e,je=n,De=i,Ae=Et(r,Ae),Se=o,ze=a}var rr,nr,ir;if(f=!!Gt.overlapParent||void 0,h=Gt.overlapParent&&(!L||"match_parent"===L.type)&&"match_parent"===(null==W?void 0:W.type),m=Gt.gridArea?`${Gt.gridArea.y+1}/${Gt.gridArea.x+1}/span ${Gt.gridArea.rowSpan}/span ${Gt.gridArea.colSpan}`:void 0,y=ne.getDerivedFromVars(Ut.alpha),ht(),ht=a(y,(t=>U=t)),nr=Pe,Pe=!wt(rr=U)||void 0===rr||rr>1?nr:Number(rr),ue=1===Pe?void 0:Pe,b=ne.getDerivedFromVars(Ut.accessibility),gt(),gt=a(b,(t=>R=t)),ae=void 0,R&&!Zt&&R.description&&(ae={},ae["aria-label"]=R.description),w=ne.getDerivedFromVars(Ut.background),vt(),vt=a(w,(t=>B=t)),ce={},de=!1,B&&(de=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(_e),!de)){const t=st(B);ce["background-color"]=t.color,ce["background-image"]=t.image,ce["background-size"]=t.size,ce["background-position"]=t.position,ce["background-repeat"]="no-repeat"}Je=void 0,Ie&&Ut.transition_in&&ne.isRunning("stateChange")&&(Je=!0),Te=void 0,Ie&&Ut.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Ut.id)&&(Te=!0),$=ne.getDerivedFromVars(Ut.action),ct(),ct=a($,(t=>J=t)),x=ne.getDerivedFromVars(Ut.actions),dt(),dt=a(x,(t=>T=t)),k=ne.getDerivedFromVars(Ut.doubletap_actions),ut(),ut=a(k,(t=>O=t)),C=ne.getDerivedFromVars(Ut.longtap_actions),lt(),lt=a(C,(t=>I=t));{let t=T||J&&[J]||[],e=O||[],r=I||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ne.logError(X(new Error(`Cannot use action on component "${Xt}"`)))),He=t,Ge=e,Ze=r}E=ne.getDerivedFromVars(Ut.action_animation),at(),at=a(E,(t=>P=t)),P&&(Ye=Vt(P),Xe=Ye.map((function(t){const e=At(t.start_value,1),r=At(t.end_value,1),n=xt(t.start_delay,0),i=xt(t.duration,300),o=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Be=e,Re=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Ue=e,We=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ne.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Ut.visibility),ot(),ot=a(F,(t=>z=t));{const t=Qe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(z,Qe);t!==e&&(!Ke||"visible"!==Qe&&"visible"!==e?Qe=e:async function(t){Qe=t;const e="visible"===t?"in":"out",r="in"===e?Ut.transition_in:Ut.transition_out;Oe&&r&&(await _(),"in"===e&&(Ne=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Lt,r,oe,e).then((()=>{"in"===e&&(Ne=!1)})).catch((t=>{throw"in"===e&&(Ne=!1),t})))}(e)),Ke||(Ke=!0)}if(A=Object.assign(Object.assign(Object.assign({},$e),Ae),{"parent-overlap":f,"parent-overlap-absolute":h,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Je||Ne||Te,visibility:Qe,"has-action-animation":Boolean(Xe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ne.getDerivedFromVars(Ut.transform),nt(),nt=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};tr=At(t.value,tr);const e="pivot-fixed"===t.type?et(tr):`${tr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};er=At(r.value,er),Le=`${e} ${"pivot-fixed"===r.type?et(er):`${er}%`}`,qe=`rotate(${S.rotation}deg)`}return j=Ee||Se?"100%":ke||je?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Ht),ce),ve),{width:le,height:se,"grid-area":m,padding:s,margin:we,opacity:ue,transition:Xe,"transform-origin":Le,transform:qe,"flex-grow":ke||je||void 0,"flex-shrink":Ce||De?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Be,"--divkit-animation-opacity-end":Re,"--divkit-animation-scale-start":Ue,"--divkit-animation-scale-end":We}),nt(),ot(),at(),lt(),ut(),ct(),dt(),vt(),gt(),ht(),bt(),kt(),Ct(),Dt(),St(),zt(),Mt(),Fe||ze?"":`${M(Pt,"Actionable").$$render(t,{use:function(t){oe=t,Ie&&Ut.transition_in&&ie.registerChildWithTransitionIn(Ut,Lt,Ut.transition_in,t).then((()=>{Je=!1})).catch((t=>{throw Je=!1,t})),Ie&&Ut.transition_out&&ie.registerChildWithTransitionOut(Ut,Lt,Ut.transition_out,t),Ie&&Ut.transition_change&&ie.registerChildWithTransitionChange(Ut,Lt,Ut.transition_change,t).then((()=>{Te=!1})).catch((t=>{throw Te=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=pt(n);t&&!ft(t)&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Gt.fakeElement?[]:ne.getJsonWithVars(Ut.visibility_actions||Ut.visibility_action&&[Ut.visibility_action]),rootCtx:ne});const e=Ut.id;e&&ie.registerChild(e);let r=null;return{destroy(){e&&ie.unregisterChild(e),r&&r.destroy()}}},cls:qt+" "+mt("outer",Q,A),style:tt(D),actions:He,doubleTapActions:Ge,longTapActions:Ze,attrs:ae,isNativeActionAnimation:!Ye.length||(ir=Ye,ir.some((t=>"native"===t.name)))},{},{default:()=>`${de?`${M(Nt,"OuterBackground").$$render(t,{background:B,radius:_e},{},{})}`:""}${i.default?i.default({}):""}${ge?`<span${N("class",Q.outer__border,0)}${N("style",tt(pe),0)}></span>`:""}`})}`})),Bt=Tt,Rt={"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 Ut(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Wt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Lt(t,e){return Wt(t)||e}const qt=J(((t,e,r,n)=>{let i,o,a,l,s;var u,c;let d,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:f=!1}=e,{actions:h}=e,m="none",y=12,_=1.25,b="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==f&&r.singleline(f),void 0===e.actions&&r.actions&&void 0!==h&&r.actions(h);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Ut(g.font_size,y),It(g.line_height)&&(_=Number(g.line_height)/y),wt(g.letter_spacing)&&(b=et(g.letter_spacing)),d=Lt(g.font_weight,d),w=it(g.text_color,1,w),i=g.top_offset?et(g.top_offset):"",o=g.background?st([g.background]):null,$=(null===(u=g.border)||void 0===u?void 0:u.stroke)&&"transparent"!==it(g.border.stroke.color)&&It(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Ut(null===(c=g.border)||void 0===c?void 0:c.corner_radius,0),l={singleline:f,decoration:m},s={"font-size":et(10*y/p),"line-height":_,"letter-spacing":b,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${i?`<span${N("class",Rt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(Pt,"Actionable").$$render(t,{cls:mt("text-range",Rt,l),actions:h,style:tt(s)},{},{default:()=>`${j(v)}`})}`})),Ht=qt;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Zt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Yt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,j,D,S,P,I,O,J,T,B,R,U,W=r,L=r,q=r,G=r,Z=r,Q=r,rt=r,nt=r,ot=r,at=r,lt=r,ut=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ft=v(Y);let ht=!1,yt="",_t=12,bt=1.25,wt=!1,$t="",xt="",kt=!1,Ct="left",Et="top",Ft="",At="",Vt=!1,jt=[],Dt=[];var St,zt;c((()=>{Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==gt&&n.layoutParams(gt),o=ft.getDerivedFromVars(dt.text),ct(),ct=a(o,(t=>U=t)),St=U,zt=yt,yt=String(null!=St?St:"")||zt,yt?ht=!1:(ht=!0,ft.logError(X(new Error('Missing "text" prop for div "text"')))),l=ft.getDerivedFromVars(dt.ranges),L(),L=a(l,(t=>V=t)),s=ft.getDerivedFromVars(dt.images),W(),W=a(s,(t=>A=t)),u=ft.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),q(),q=a(u,(t=>j=t)),d=ft.getDerivedFromVars(dt.font_size),ut(),ut=a(d,(t=>R=t)),_t=Ut(R,_t),p=ft.getDerivedFromVars(dt.line_height),lt(),lt=a(p,(t=>B=t));{const t=B;It(t)?(bt=Number(t)/_t,wt=!0):wt=!1}g=ft.getDerivedFromVars(dt.max_lines),nt(),nt=a(g,(t=>O=t)),f=1===O;{let t="",e="",r=!1;if(O&&O>1){let n=Number(O);t=n*bt+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}h=ft.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(h,(t=>T=t)),Ct=Gt(T,Ct),m=ft.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>J=t)),Et=Zt(J,Et),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,_=ft.getDerivedFromVars(dt.text_color),rt(),rt=a(_,(t=>I=t)),b=Boolean(I)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&b&&(t=it(I||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ft.getDerivedFromVars(dt.truncate),Q(),Q=a(w,(t=>P=t)),$="none"===P?"none":"",x=ft.getDerivedFromVars(dt.text_gradient),Z(),Z=a(x,(t=>S=t));{let t="";if(S){const e=st([S]);e.image&&(t=e.image)}At=t}return k=ft.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let n=[];if(Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)})),Dt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],l=0,s=[],u=[];o.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"}))})),a.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;let r="image"===t.type?null:t.range,o=t.index;if(o>l){let r=Object.assign(Object.assign({},j),...s);n.push({text:i.substring(l,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)s.push(r);else if("rangeEnd"===t.type)s=s.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...s),r=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/_t)};let a="";const l=t.image.tint_color,u=Yt(t.image.tint_mode,"source_in");if(l){const e=it(t.image.tint_color);a=ft.addSvgFilter(e,u),Dt.push([e,u])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}l=o})),l<i.length&&n.push({text:i.substring(l),textStyles:Object.assign({},j)}),jt=n}(yt,V,A),C={singleline:f,multiline:kt,halign:Ct,valign:Et,truncate:$},E={gradient:Boolean(At)},F={"font-size":et(_t),"line-height":bt,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},W(),L(),q(),G(),Z(),Q(),rt(),nt(),ot(),at(),lt(),ut(),ct(),ht?"":`${M(Bt,"Outer").$$render(t,{cls:mt("text",K,C)+" "+(Vt?"":H),json:dt,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${N("class",mt("text__inner",K,E),0)}${N("style",tt(F),0)}>${jt.length?`${z(jt,((e,r)=>"text"in e?e.text?`${M(Ht,"TextRangeView").$$render(t,{text:e.text,rootFontSize:_t,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",tt(e.image.wrapperStyle),0)}><img${N("class",K.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",tt({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Ht,"TextRangeView").$$render(t,{text:yt,rootFontSize:_t,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),Kt=Xt,Qt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=it(t.color);let i,o,a;if("rounded_rectangle"===t.shape.type){var l,s,u,c;i=Number((null===(l=t.shape.item_width)||void 0===l?void 0:l.value)||10),o=Number((null===(s=t.shape.item_height)||void 0===s?void 0:s.value)||10),a=Number(null!==(u=null===(c=t.shape.corner_radius)||void 0===c?void 0:c.value)&&void 0!==u?u:5)}else{if("circle"!==t.shape.type)return r;var d;i=o=a=2*Number((null===(d=t.shape.radius)||void 0===d?void 0:d.value)||10)}if("shape_drawable"===t.type&&"transparent"!==n){var v,p,g;const e={},r=null!==(v=t.stroke)&&void 0!==v&&v.color?it(t.stroke.color):"",l=null!==(p=t.stroke)&&void 0!==p&&p.width?Number(null!==(g=t.stroke.width)&&void 0!==g?g:1):"";return e.width=i,e.height=o,e.borderRadius=a,e.background=n,r&&l&&(e.boxShadow=`inset 0 0 0 ${et(l)} ${r}`),e}return r}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let n;return n="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],n.map(et).join(" ")}const ne="divkit-a7719",ie="divkit-f6e9a";function oe(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function ae(t,e,r,n){const i={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)&&oe(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)oe(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];oe(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const le=J(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:l}=e;const s=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,l=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<l)break}else if(n.left<a)break;a=Math.max(a,n.right),l=Math.max(l,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&ae(d,a,e,"vertical"===o);const r={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)))};n.push(r)})),l&&ae(d,l,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,p=null,g=null;return c((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==l&&r.lineSeparator(l),i=null,(v&&i||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&i&&("undefined"!=typeof MutationObserver&&(p=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(ie))&&!(null==r?void 0:r.contains(ne))}))&&s()})),p.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(s),g.observe(i)))),v&&i&&s(),`\n\n<div${N("class",ne,0)}${N("this",u,0)}>${z(d,(t=>`<div${N("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class",ie,0)}${B({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>\n </div>`))}</div>`}));let se;function ue(){if(void 0!==se)return se;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),se=1===t.scrollHeight,document.body.removeChild(t),se}const ce=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V=r,j=r,D=r,S=r,P=r,I=r,O=r,J=r;var N,T,B,R,U,W;let{json:L={}}=e,{templateContext:q}=e,{origJson:H}=e,{layoutParams:G}=e;const Z={left:"start",center:"center",right:"end"},K={top:"start",center:"center",bottom:"end",baseline:"baseline"},Q=["rounded_rectangle","circle"],tt=v(Y);let et=!1,rt="vertical",nt="top",it="left",ot=null,at=null,lt={};if(void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==q&&n.templateContext(q),void 0===e.origJson&&n.origJson&&void 0!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=L.items,(null==o?void 0:o.length)&&Array.isArray(o)?et=!1:(et=!0,tt.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),l=(!et&&o||[]).map((t=>{let e=t,r=q;return({templateContext:r,json:e}=tt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=tt.getDerivedFromVars(L.orientation),J(),J=a(s,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),u=tt.getDerivedFromVars(L.content_alignment_vertical),O(),O=a(u,(t=>F=t)),nt=Zt(F,nt),c=tt.getDerivedFromVars(L.content_alignment_horizontal),I(),I=a(c,(t=>E=t)),it=Gt(E,it),d=tt.getDerivedFromVars(L.layout_mode),P(),P=a(d,(t=>C=t)),p="wrap"===C,g=tt.getDerivedFromVars(L.separator),S(),S=a(g,(t=>k=t)),(null==k?void 0:k.style)&&"overlap"!==rt&&ue()){const t=te(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(N=k.show_at_start)&&void 0!==N&&N),show_at_end:Boolean(null!==(T=k.show_at_end)&&void 0!==T&&T),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(f=tt.getDerivedFromVars(L.line_separator),D(),D=a(f,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&ue()){const t=te(x.style,Q,(null==at?void 0:at.style)||null);at=t?{show_at_start:Boolean(null!==(R=x.show_at_start)&&void 0!==R&&R),show_at_end:Boolean(null!==(U=x.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(W=x.show_between)||void 0===W||W),style:t}:null}else at=null;h=ot||at?function(t,e,r){const n={};return ee(n,e,"vertical"===t),ee(n,r,"horizontal"===t),n}(rt,ot,at):null,m=tt.getDerivedFromVars(L.width),V(),V=a(m,(t=>w=t)),y=tt.getDerivedFromVars(L.height),j(),j=a(y,(t=>$=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"overlap"===rt&&(t.overlapParent=!0),"horizontal"!==rt&&(t.parentHAlign=Z[it],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==G?void 0:G.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==rt&&(t.parentVAlign=K[nt],("wrap_content"===(null==w?void 0:w.type)||"match_parent"===(null==w?void 0:w.type)&&(null==G?void 0:G.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===rt&&(t.parentContainerOrientation="horizontal"),"vertical"===rt&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),lt=Et(t,lt)}return _={orientation:rt,valign:nt,halign:it,wrap:p},b={gap:ot||at?re(rt,ot,at):void 0},V(),j(),D(),S(),P(),I(),O(),J(),et?"":`${M(Bt,"Outer").$$render(t,{cls:mt("container",Qt,_),style:b,json:L,origJson:H,templateContext:q,layoutParams:G,additionalPaddings:h},{},{default:()=>`${z(l,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:lt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(le,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),de=ce,ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function pe(t,e){return"vertical"===t||"horizontal"===t?t:e}const ge=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(Y);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(f.delimiter_style),g(),g=a(o,(t=>p=t)),b=pe(null==p?void 0:p.orientation,b),l=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=it(null==p?void 0:p.color,1,w),s="horizontal"===b?"100%":et(1),u="horizontal"===b?et(1):"100%",c={background:w,width:s,height:u},d={orientation:b},g(),`${M(Bt,"Outer").$$render(t,{cls:mt("separator",ve,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>l?`<span${N("class",ve.separator__inner,0)}${N("style",tt(c),0)}></span>`:""})}`})),fe={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},he=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,j,D,S,z,P,I,O,J,T,R,U,W,L,q=r,H=r,G=r,Z=r,K=r,Q=r,et=r,rt=r,nt=r,ot=r,lt=r,st=r,ut=r,ct=r,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ft}=e,{layoutParams:ht}=e;const yt=v(Y);let _t,bt=0,wt="rgba(0,0,0,0.08)",$t=!1,kt="",Ct="none",Et="50% 50%",At="0",Vt="source_in",jt="",Dt="",St=0,zt=0,Pt=0,Mt="",Jt="";c((()=>{yt.removeSvgFilter(_t,Vt)})),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==ft&&n.origJson(ft),void 0===e.layoutParams&&n.layoutParams&&void 0!==ht&&n.layoutParams(ht),o=yt.getDerivedFromVars(pt.image_url),ct(),ct=a(o,(t=>L=t)),l=yt.getDerivedFromVars(pt.gif_url),ut(),ut=a(l,(t=>W=t)),s=L||W,bt=0,s?$t=!1:($t=!0,yt.logError(X(new Error('Missing "image_url" for "image"')))),u=yt.getDerivedFromVars(pt.width),st(),st=a(u,(t=>U=t)),d="wrap_content"===(null==U?void 0:U.type),p=yt.getDerivedFromVars(pt.height),lt(),lt=a(p,(t=>R=t)),g="wrap_content"===(null==R?void 0:R.type),f=yt.getDerivedFromVars(pt.preview),ot(),ot=a(f,(t=>T=t));{const t=T;kt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}h=yt.getDerivedFromVars(pt.placeholder_color),nt(),nt=a(h,(t=>J=t)),wt=it(J,1,wt),m=yt.getDerivedFromVars(pt.scale),rt(),rt=a(m,(t=>O=t)),Ct=dt(O)||Ct,y=yt.getDerivedFromVars({content_alignment_horizontal:pt.content_alignment_horizontal,content_alignment_vertical:pt.content_alignment_vertical}),et(),et=a(y,(t=>I=t)),Et=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:vt(t)}(I,Et),_=yt.getDerivedFromVars(pt.accessibility),Q(),Q=a(_,(t=>P=t)),b=(null==P?void 0:P.description)||"",w=yt.getDerivedFromVars(pt.aspect),K(),K=a(w,(t=>z=t));{const t=null==z?void 0:z.ratio;At=t&&It(t)?(100/Number(t)).toFixed(2):"0"}$=yt.getDerivedFromVars(pt.tint_color),Z(),Z=a($,(t=>S=t)),x=yt.getDerivedFromVars(pt.tint_mode),G(),G=a(x,(t=>D=t));{const t=S,e=t?it(t):void 0,r=Yt(D,Vt);e===_t&&r===Vt||(yt.removeSvgFilter(_t,Vt),jt=e?yt.addSvgFilter(e,r):"",_t=e,Vt=r)}if(k=yt.getDerivedFromVars(pt.appearance_animation),H(),H=a(k,(t=>j=t)),j&&"fade"===j.type){const t=j;Dt=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=xt(t.duration,300),zt=xt(t.start_delay,0),St=xt(t.alpha,0)}C=yt.getDerivedFromVars(pt.filters),q(),q=a(C,(t=>V=t));{let t="",e="";Array.isArray(V)&&V.length&&(t=Ot(V,yt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Mt=t,Jt=e}return E={aspect:"0"!==At,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(Dt)&&!0},F={"background-image":kt,"background-color":kt?void 0:wt,"background-size":Ct},A={"object-fit":Ct,"object-position":Et,filter:["",Mt].filter(Boolean).join(" "),"clip-path":Jt||void 0,"--divkit-appearance-interpolator":Dt||void 0,"--divkit-appearance-fade-start":Dt?St:void 0,"--divkit-appearance-delay":Dt?`${zt}ms`:void 0,"--divkit-appearance-duration":Dt?`${Pt}ms`:void 0},q(),H(),G(),Z(),K(),Q(),et(),rt(),nt(),ot(),lt(),st(),ut(),ct(),$t?"":`${M(Bt,"Outer").$$render(t,{cls:mt("image",fe,E),json:pt,origJson:ft,templateContext:gt,layoutParams:ht,style:F,customDescription:!0},{},{default:()=>E.aspect?`<span${N("class",fe["image__aspect-wrapper"],0)}${B({"padding-bottom":`${At}%`})}><img${N("class",fe.image__image,0)}${N("src",s,0)} loading="lazy" decoding="async"${N("style",tt(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",fe.image__image,0)}${N("src",s,0)} loading="lazy" decoding="async"${N("style",tt(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),me={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function ye(t){return t>0&&t<1}function _e(t){return String(Math.ceil(1e3*t)/1e3)}function be(t,e,r){if(t.some(ye)){const e=Math.max(...t.filter(ye).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${et(n*t[e]/i)},${_e(t[e])}fr)`:t[e]?o[e]=`${_e(t[e])}fr`:o[e]="auto";return o.join(" ")}const we=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:E}=e;const F=v(Y);let A,V,j=!1,D=1,S=[],P=[],I=[],O=[],J=0,N=!1,T="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==C&&n.origJson(C),void 0===e.layoutParams&&n.layoutParams&&void 0!==E&&n.layoutParams(E),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),l=F.getDerivedFromVars(x.column_count),$(),$=a(l,(t=>y=t)),D=Ut(y,D),s=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];s.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=W(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],P=[],I=[],O=[],N=!1,V=s.map(((n,i)=>{var o,a,l,s;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},p="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,g="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,f=1===c&&"fixed"===(null===(l=u.width)||void 0===l?void 0:l.type)&&u.width.value?Number(u.width.value)/c:0,h=1===d&&"fixed"===(null===(s=u.height)||void 0===s?void 0:s.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<p)&&(S[n]=p),(!P[e]||P[e]<g)&&(P[e]=g),(!I[n]||I[n]<f)&&(I[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==E?void 0:E.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),J=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(u,(t=>h=t)),T=Zt(h,T),c=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(c,(t=>f=t)),B=Gt(f,B),d={valign:T,halign:B},p={"grid-template-columns":be(S,I,D),"grid-template-rows":be(P,O,J)},g=j||N,_(),b(),w(),$(),g?"":`${M(Bt,"Outer").$$render(t,{cls:mt("grid",me,d),json:x,origJson:C,templateContext:k,style:p,layoutParams:E},{},{default:()=>`${z(V,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),$e=we,xe={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function ke(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function Ce(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ee=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,D,S,P,I,O,J,T,B=r,R=r,U=r,L=r,q=r,H=r,Z=r,K=r,Q=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const lt=v(Y);let st,ut,ct=[],dt=!1,vt=!1,pt=null,gt=!1;const ft=lt.getCustomization("galleryLeftClass"),ht=lt.getCustomization("galleryRightClass");let yt=!1;J=a(lt.isDesktop,(t=>O=t));let _t,bt,wt,kt,Ct=1,Ft="horizontal",At="start",Vt=8,jt="",Dt=[],St={},zt=!1,Pt={},Mt=0;const It=Ce((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function Ot(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Ct;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Jt(t,e,r="smooth"){const n="horizontal"===Ft,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-Vt/2),behavior:r})}function Nt(t){const e=Ot(),r=st.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Ft?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 i=e.map((t=>function(t,e){return"horizontal"===Ft?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!nt.id||yt||(null==at?void 0:at.fakeElement)||lt.registerInstance(nt.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Jt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Ot();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Jt(r,n)},setNextItem(t){const e="horizontal"===Ft?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Ot();if(e&&"ring"===t)return void Jt(r,0);const n=Nt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Jt(r,i)}}),c((()=>{gt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&<.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?yt=!1:(yt=!0,lt.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),l=(!yt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=lt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=O&>&&!yt,s?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{It()})),pt.observe(ut)):pt&&(pt.disconnect(),pt=null),u=lt.getDerivedFromVars(nt.column_count),Q(),Q=a(u,(t=>I=t)),Ct=Ut(I,Ct),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(l,Ct),p=lt.getDerivedFromVars(nt.orientation),K(),K=a(p,(t=>P=t)),Ft=pe(P,Ft),g=lt.getDerivedFromVars(nt.cross_content_alignment),Z(),Z=a(g,(t=>S=t)),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,At),f=lt.getDerivedFromVars(nt.item_spacing),H(),H=a(f,(t=>D=t)),Vt=xt(D,Vt),_t=et(Vt),h=lt.getDerivedFromVars(nt.cross_spacing),q(),q=a(h,(t=>V=t)),wt=xt(V,Vt),bt=et(wt),m=lt.getDerivedFromVars(nt.paddings),L(),L=a(m,(t=>A=t)),jt=$t(A,jt),y="horizontal"===Ft?"grid-template-columns":"grid-template-rows";{let t=[];l.forEach((e=>{const r="horizontal"===Ft?"width":"height";t.push(lt.getDerivedFromVars(e.json[r]))})),kt=W(t,(t=>t)),U(),U=a(kt,(t=>F=t))}Dt=[],Ct>1?Dt.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ft||"match_parent"===(null==t?void 0:t.type)?Dt.push("100%"):Dt.push("max-content")})),_=lt.getDerivedFromVars(nt.scroll_mode),R(),R=a(_,(t=>E=t));{const t={};let e={};zt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ft?e.parentVAlign=At:e.parentHAlign=At,"paging"===E&&(zt=!0,e.scrollSnap="start",t["horizontal"===Ft?"scroll-padding-left":"scroll-padding-top"]=et(Vt/2)),1===Ct&&(e.parentLayoutOrientation=Ft),St=Et(t,St),Pt=Et(e,Pt)}return b=lt.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(b,(t=>T=t)),w={padding:jt,"grid-gap":bt},$={"grid-gap":_t,[y]:ke(Dt)},x={orientation:Ft,"scroll-snap":zt},k=lt.getDerivedFromVars(nt.default_item),B(),B=a(k,(t=>C=t)),Mt=xt(C,Mt),B(),R(),U(),L(),q(),H(),Z(),K(),Q(),J(),rt(),"\n\n"+(yt?"":`${M(Bt,"Outer").$$render(t,{cls:mt("gallery",xe,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===Ft,forceWidth:"horizontal"===Ft},{},{default:()=>`<div class="${j(xe.gallery__scroller,!0)+" "+j(T?G:"",!0)}"${N("style",tt(St),0)}${N("this",st,0)}><div${N("class",xe["gallery__items-grid"],0)}${N("style",tt(w),0)}${N("this",ut,0)}>${z(d,((e,r)=>`<div${N("class",xe.gallery__items,0)}${N("style",tt($),0)}${N("this",ct[r],0)}>${z(e,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:Pt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ft?`${dt&&s?`<div${N("class",ft||`${xe.gallery__arrow} ${xe.gallery__arrow_left}`,0)}>${ft?"":`<svg${N("class",xe["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",xe["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>`:""}\n ${vt&&s?`<div${N("class",ht||`${xe.gallery__arrow} ${xe.gallery__arrow_right}`,0)}>${ht?"":`<svg${N("class",xe["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",xe["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>`:""}`:""}`})}`)})),Fe=Ee,Ae={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Ve=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,b,w,$,x,k,C,E,F,A,V=r,D=r,S=r,P=r,I=r,O=r,J=r,T=r;var R;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:q}=e;const H=v(Y),Z=H.genId("tabs");let K,Q,rt,nt=!1,ot={};const at=H.getJsonWithVars(U.selected_tab);let lt,st,ut=at&&Number(at)||0,ct=12,dt="",vt="",pt="",gt="",ft="",ht="",yt="",_t="",bt="",xt="",kt=!1,Ct=!1,Ft=ut,At=[],Vt=[];async function Dt(t,e=!1){if(Ft=ut,ut=t,kt||(kt=!0,Q.style.height=et(Q.clientHeight),rt.style.transform=`translate3d(${100*-Ft}%,0,0)`),Ct=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-ut),function(t=!1){const e=t?Math.max(0,ut-1):Math.min(ut,Ft),r=t?Math.min(o.length-1,ut+1):Math.max(ut,Ft);At=At.map(((t,n)=>t||n>=e&&n<=r)),Vt=Vt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${Z}-panel-${ut}`);t&&(Q.style.height=et(t.offsetHeight))}(),zt&&clearTimeout(zt),zt=window.setTimeout((()=>{Vt=o.map(((t,e)=>e===ut))}),400),St=-ut*Q.clientWidth,e){await _();const t=K.querySelector(`.${Ae.tabs__item_selected}`);t&&t.focus()}}let St,zt=null;!U.id||nt||(null==q?void 0:q.fakeElement)||H.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Dt(t)},setPreviousItem(t){let e=ut-1;e<0&&(e="ring"===t?o.length-1:ut),Dt(e)},setNextItem(t){let e=ut+1;e>o.length-1&&(e="ring"===t?0:ut),Dt(e)}}),c((()=>{U.id&&!(null==q?void 0:q.fakeElement)&&H.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==q&&n.layoutParams(q),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,H.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),l=H.getDerivedFromVars(U.width),J(),J=a(l,(t=>F=t)),s=H.getDerivedFromVars(U.height),O(),O=a(s,(t=>E=t));{let t={};(null==q?void 0:q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),E&&"wrap_content"!==E.type||(t.parentVerticalWrapContent=!0),ot=Et(t,ot)}if(!nt&&(ut<0||ut>=o.length)&&(H.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:U.selected_tab,length:o.length}})),ut=ut<0?0:o.length-1),u=H.getDerivedFromVars(U.tab_title_style),I(),I=a(u,(t=>C=t)),d=C||{},ct=Ut(d.font_size,ct),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ct*10,right:(Number(t.right)||0)/ct*10,bottom:(Number(t.bottom)||0)/ct*10,left:(Number(t.left)||0)/ct*10};dt=$t(e,dt)}{const t=d.line_height;void 0!==t&&It(t)&&(vt=et(t/ct*10))}{const t=d.letter_spacing;void 0!==t&&wt(t)&&(pt=et(t/ct*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(R=d.corner_radius)&&void 0!==R?R:1e3;d.corners_radius?gt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!wt(i[t]))return n;return jt(t,e,r)}(d.corners_radius,t,ct,gt):wt(t)&&(gt=et(t/ct*10))}return lt=Lt(d.active_font_weight||d.font_weight,lt),st=Lt(d.inactive_font_weight||d.font_weight,st),ft=it(d.active_text_color,1,ft),ht=it(d.inactive_text_color,1,ht),yt=it(d.active_background_color,1,yt),_t=it(d.inactive_background_color,1,_t),p=H.getDerivedFromVars(U.has_separator),P(),P=a(p,(t=>k=t)),g=H.getDerivedFromVars(U.separator_color),S(),S=a(g,(t=>x=t)),f=H.getDerivedFromVars(U.separator_paddings),D(),D=a(f,(t=>$=t)),k&&(x&&(bt=it(x,1,bt)),$&&(xt=$t($,xt))),h={background:bt,margin:xt},m=H.getDerivedFromVars(U.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=H.getDerivedFromVars(U.restrict_parent_scroll),T(),T=a(b,(t=>A=t)),nt||(At=o.map(((t,e)=>e===ut)),Vt=o.map(((t,e)=>e===ut))),V(),D(),S(),P(),I(),O(),J(),T(),nt?"":`${M(Bt,"Outer").$$render(t,{cls:mt("tabs",Ae,{}),json:U,origJson:L,templateContext:W,layoutParams:q,customActions:"tabs"},{},{default:()=>`<div class="${j(Ae.tabs__list,!0)+" "+j(A?G:"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":et(ct),"--divkit-tabs-paddings":dt,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":lt||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":ft,"--divkit-tabs-inactive-text-color":ht,"--divkit-tabs-active-background-color":yt,"--divkit-tabs-inactive-background-color":_t,"--divkit-tabs-border-radius":gt})}${N("this",K,0)}>${z(o,((e,r)=>{let n=r===ut;return`\n\n ${M(Pt,"Actionable").$$render(t,{cls:mt("tabs__item",Ae,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=q&&q.fakeElement?[]:[e.title_click_action],attrs:{id:`${Z}-tab-${r}`,"aria-controls":`${Z}-panel-${r}`,role:"tab",tabindex:!n||null!=q&&q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=q&&q.fakeElement?null:t=>function(t,e){return ut===e||(Dt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${N("class",Ae.tabs__separator,0)}${N("style",tt(h),0)}></div>`:""}\n <div class="${j(Ae.tabs__panels,!0)+" "+j(A?G:"",!0)}"${N("this",Q,0)}><div${N("class",mt("tabs__swiper",Ae,{inited:kt,animated:Ct}),0)}${N("this",rt,0)}>${z(o,((e,r)=>`<div${N("class",mt("tabs__panel",Ae,{visible:Vt[r]}),0)} role="tabpanel" id="${j(Z,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(Z,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${At[r]?`${M(sr,"Unknown").$$render(t,{div:e.div,templateContext:W,layoutParams:ot},{},{})}`:""}\n </div>`))}</div></div>`})}`})),je=Ve,De="divkit-eb860",Se="divkit-e08c6";function ze(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}ze([.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]),ze([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 Pe=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:l}=e,{layoutParams:s}=e;const u=v(Y),p=v(yt);let g=new Map,f=new Set,h=!1,m=null,y=[],b=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==s?void 0:s.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(f),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,C=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(yt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return b.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){f.add(t)},unregisterChild(t){f.delete(t)}})):(h=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let C=null;const E=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{x&&!(null==s?void 0:s.fakeElement)&&p.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==l&&r.origJson(l),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),o&&(f=new Set),i=o.states||[],(null==i?void 0:i.length)?h=!1:(h=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(E?(k=E,C=t.find((t=>t.state_id===k))||null,C||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(C=t[0],k=C.state_id)))}(i),h?"":`${M(Bt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:l,templateContext:a,layoutParams:s},{},{default:()=>{var e;return`${null!==(e=C)&&void 0!==e&&e.div?`${M(sr,"Unknown").$$render(t,{div:C.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${z(y,(e=>"direction"in e?`<div${N("class",De,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${N("class",Se,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class",De,0)}><div${N("class",Se,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),Me={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Ie=J(((t,e,n,i)=>{let o,l,s,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C=r,E=r,F=r,A=r,V=r,D=r;var S,P,I,O,J,T,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:L}=e;const q=v(Y),H=q.genId("pager");let Z,K=!1,Q=0,nt=0,it=!1,ot="horizontal",at="",lt="",st="";function ut(t,e="smooth"){const r="horizontal"===ot,n=Z.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:n[i],behavior:e}),Q=t}Ce((function(){const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===ot?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:Q}();t!==Q&&(Q=t)}),50),R.id&&!(null==L?void 0:L.fakeElement)&&q.registerInstance(R.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ut(t)},setPreviousItem(t){let e=Q-1;e<0&&(e="ring"===t?o.length-1:Q),ut(e)},setNextItem(t){let e=Q+1;e>o.length-1&&(e="ring"===t?0:Q),ut(e)}}),c((()=>{R.id&&!(null==L?void 0:L.fakeElement)&&q.unregisterInstance(R.id)})),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==W&&n.origJson(W),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),(null===(S=R.items)||void 0===S?void 0:S.length)&&Array.isArray(R.items)?K=!1:(K=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!K&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=q.getDerivedFromVars(R.layout_mode),E(),E=a(l,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(it=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),s=q.getDerivedFromVars(R.orientation),V(),V=a(s,(t=>x=t)),ot=pe(x,ot),u=q.getDerivedFromVars(R.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&wt(t)&&(at=et(t||0))}if(d=q.getDerivedFromVars(R.paddings),F(),F=a(d,(t=>w=t)),lt=$t(w,lt),p=q.getDerivedFromVars(R.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===ot?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=rt("horizontal"===ot?((null===(P=R.paddings)||void 0===P?void 0:P.left)||0)+((null===(I=R.paddings)||void 0===I?void 0:I.right)||0):((null===(O=R.paddings)||void 0===O?void 0:O.top)||0)+((null===(J=R.paddings)||void 0===J?void 0:J.bottom)||0)),e=null===(T=b.neighbour_page_width)||void 0===T?void 0:T.value;st=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${at})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return f={"grid-gap":at,padding:lt,[g]:st},h={orientation:ot},m=K||it,y=q.getStore("pagers"),C(),C=a(y,(t=>_=t)),function(t,e){const r=R.id;if(r){const o=new Map(_);n=y,_=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:ut}),i=_,n.set(i)}var n,i}(o.length,Q),function(t){var e;if(t===nt)return;nt=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(Q),C(),E(),F(),A(),V(),D(),m?"":`${M(Bt,"Outer").$$render(t,{cls:mt("pager",Me,h),json:R,origJson:W,templateContext:U,layoutParams:L,customPaddings:!0},{},{default:()=>`<div class="${j(Me.pager__items,!0)+" "+j(k?G:"",!0)}"${N("style",tt(f),0)}${N("this",Z,0)}>${z(o,(e=>`<div${N("class",Me.pager__item,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=L&&L.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Oe=Ie,Je={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Ne=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,b=r,w=r,$=r,x=r,k=r,C=r;var E;let{json:F={}}=e,{templateContext:A}=e,{origJson:V}=e,{layoutParams:D}=e;const S=v(Y);let P,I,O,J=5,T=10,R=10,U=5,W="#ffdc60",q=it("#33919cb5"),H=15,G=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==A&&n.templateContext(A),void 0===e.origJson&&n.origJson&&void 0!==V&&n.origJson(V),void 0===e.layoutParams&&n.layoutParams&&void 0!==D&&n.layoutParams(D),o=S.getDerivedFromVars(F.shape),C(),C=a(o,(t=>y=t)),y&&("rounded_rectangle"===y.type?(y.item_width&&(T=xt(y.item_width.value,T)),y.item_height&&(R=xt(y.item_height.value,R)),y.corner_radius&&(U=xt(y.corner_radius.value,U))):"circle"===y.type&&(J=xt(null===(E=y.radius)||void 0===E?void 0:E.value,J),T=R=U=2*J)),l=S.getDerivedFromVars(F.active_item_color),k(),k=a(l,(t=>m=t)),W=it(m,1,W),s=S.getDerivedFromVars(F.inactive_item_color),x(),x=a(s,(t=>h=t)),q=it(h,1,q),u=S.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>f=t)),f&&(H=xt(f.value,H)),c=S.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>g=t)),G=Ut(g,G),d=S.getStore("pagers"),b(),b=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){O=t.get(F.pager_id),await _();const e=I.children[O.currentItem].offsetLeft;P.scroll({left:e-P.clientWidth/2,behavior:"smooth"})}}(p),b(),w(),$(),x(),k(),C(),`${M(Bt,"Outer").$$render(t,{cls:mt("indicator",Je,{}),json:F,origJson:V,templateContext:A,layoutParams:D},{},{default:()=>`<div${N("class",Je.indicator__scroller,0)}${N("this",P,0)}><div${N("class",Je.indicator__items,0)} role="tablist"${B({margin:`0 ${et((G-1)*T/2)}`,"--divkit-indicator-width":et(T),"--divkit-indicator-height":et(R),"--divkit-indicator-border-radius":et(U),"--divkit-indicator-active-color":W,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${et((H-T)/2)}`})}${N("this",I,0)}>${O?`${z(Array(O.size),((t,e)=>{let r=e===O.currentItem;return`\n <div class="${j(mt("indicator__item",Je,{active:r}),!0)+" "+j(L,!0)}" role="tab" id="${j(O.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(O.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Te=Ne,Be={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Re(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&it(t.text_color)||"#000",i=Wt(t.font_weight);if(It(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:et(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Ue(t,e,r){return Math.max(e,Math.min(r,t))}const We=2147483647,Le=-2147483648,qe=Number.MAX_VALUE,He=Number.MIN_VALUE,Ge="string",Ze="integer",Ye="number",Xe="boolean",Ke="color",Qe="datetime";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=U(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const er={string:class extends tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends tr{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends tr{convertValue(t){if("number"!=typeof t||isNaN(t)||t>We||t<Le||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class 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"}},color:class extends tr{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function rr(t,e,r){if(!(e in er))throw new Error("Unsupported variable type");return new er[e](t,r)}function nr(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const ir=J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,D,S,P,I,O,J,T,R,U,W,L,q,H,G=r,Z=r,K=r,Q=r,tt=r,nt=r,it=r,ot=r,at=r,lt=r,st=r,ut=r;var ct,dt,vt,pt;let{json:gt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:yt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},bt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Y),kt=v(St);let Ct=0,Et=100;const Ft=xt.getJsonWithVars(gt.thumb_value_variable),Vt=xt.getJsonWithVars(gt.thumb_secondary_value_variable);L=a(Ft&&xt.getVariable(Ft,"integer")||rr("temp","integer",0),(t=>W=t)),U=a(Vt&&xt.getVariable(Vt,"integer")||rr("temp","integer",0),(t=>R=t));let jt,Dt,zt,Pt=Ue(W||0,Ct,Et),Mt=Ue(R||0,Ct,Et),It=_t,Ot=It,Jt=_t,Nt=_t,Tt=null,Rt=null,Ut=zt,Wt="",Lt="",qt=!1;Ce((function(){}),50),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==ft&&n.templateContext(ft),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=xt.getDerivedFromVars(gt.min_value),ut(),ut=a(o,(t=>H=t)),l=xt.getDerivedFromVars(gt.max_value),st(),st=a(l,(t=>q=t)),Ct=At(H,Ct),Et=At(q,Et);{const t=Ue(W||0,Ct,Et);t!==Pt&&(Pt=t)}{const t=Ue(R||0,Ct,Et);t!==Mt&&(Mt=t)}s=xt.getDerivedFromVars(gt.thumb_style),lt(),lt=a(s,(t=>T=t)),It=te(T,bt,It),u=xt.getDerivedFromVars(gt.thumb_secondary_style),at(),at=a(u,(t=>J=t)),Ot=te(J,bt,It),c=xt.getDerivedFromVars(gt.track_inactive_style),ot(),ot=a(c,(t=>O=t)),Jt=te(O,$t,Jt),d=xt.getDerivedFromVars(gt.track_active_style),it(),it=a(d,(t=>I=t)),Nt=te(I,$t,Nt),p=xt.getDerivedFromVars(gt.tick_mark_active_style),nt(),nt=a(p,(t=>P=t));{let t=te(P,bt,_t);t!==_t&&(Tt=t)}jt=Tt?Vt?nr(Math.min(Pt,Mt),Math.max(Pt,Mt)+1,Ct,Et,!0):nr(Ct,Pt,Ct,Et,!0):[],g=xt.getDerivedFromVars(gt.tick_mark_inactive_style),tt(),tt=a(g,(t=>S=t));{let t=te(S,bt,_t);t!==_t&&(Rt=t)}Dt=Rt?Vt?nr(Math.min(Pt,Mt),Math.max(Pt,Mt)+1,Ct,Et,!1):nr(Pt+1,Et+1,Ct,Et,!0):[],f=xt.getDerivedFromVars(gt.thumb_text_style),Q(),Q=a(f,(t=>D=t)),zt=Re(D,zt),h=xt.getDerivedFromVars(gt.thumb_secondary_text_style),K(),K=a(h,(t=>V=t)),Ut=Re(V,zt),m=xt.getDerivedFromVars(gt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):It===_t?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===_t?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Jt===_t&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=et(Math.max(...[It.width,Ot.width,0].filter(wt))),b=et(Math.max(...[It.height,Ot.height,0].filter(wt))),w=(Pt-Ct)/(Et-Ct),$=Vt?(Mt-Ct)/(Et-Ct):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,C={"--divkit-slider-thumb-width":et(It.width),"--divkit-slider-thumb-height":et(It.height),"--divkit-slider-thumb-secondary-width":et(Ot.width),"--divkit-slider-thumb-secondary-height":et(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==zt?void 0:zt.offset)||void 0===ct?void 0:ct.x)?rt(zt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==zt?void 0:zt.offset)||void 0===dt?void 0:dt.y)?rt(zt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.x)?rt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Ut?void 0:Ut.offset)||void 0===pt?void 0:pt.y)?rt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Tt?et(Tt.width):void 0,"--divkit-slider-tick-active-height":Tt?et(Tt.height):void 0,"--divkit-slider-tick-active-border-radius":Tt?et(Tt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Tt?void 0:Tt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Tt?void 0:Tt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?et(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?et(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?et(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":_,"--divkit-slider-max-thumb-height":b,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},E={},G(),Z(),K(),Q(),tt(),nt(),it(),ot(),at(),lt(),U(),L(),st(),ut(),"\n\n"+(qt?"":`${M(Bt,"Outer").$$render(t,{cls:mt("slider",Be,E),style:C,customDescription:!0,customActions:"slider",json:gt,origJson:ht,templateContext:ft,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",Be["slider__tracks-wrapper"],0)}><div${N("class",Be["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",Be.slider__track,0)}${B({height:et(Jt.height),"border-radius":et(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n <div${N("class",Be["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Nt.height),"border-radius":et(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n ${z(jt,(t=>`<div class="${j(Be.slider__tick,!0)+" "+j(Be.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${z(Dt,(t=>`<div class="${j(Be.slider__tick,!0)+" "+j(Be.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",Be.slider__thumb,0)}${B({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${zt?`<div${N("class",Be["slider__thumb-text"],0)}><div${N("class",Be["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=zt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=zt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=zt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Pt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Be.slider__thumb,!0)+" "+j(Be.slider__thumb_secondary,!0)}"${B({"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Ut?`<div class="${j(Be["slider__thumb-text"],!0)+" "+j(Be["slider__thumb-text_secondary"],!0)}"><div${N("class",Be["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Ut)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Ut)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",Be.slider__input,0)}${N("min",Ct,0)}${N("max",Et,0)} step="1"${N("value",Pt,0)}${N("aria-label",Wt,0)}>\n ${Vt?`<input type="range"${N("class",`${Be.slider__input} ${Be.slider__input_secondary}`,0)}${N("min",Ct,0)}${N("max",Et,0)} step="1"${N("value",Mt,0)}${N("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),or={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},ar={text:Kt,container:de,separator:ge,image:he,gif:he,grid:$e,gallery:Fe,tabs:je,state:Pe,pager:Oe,indicator:Te,slider:ir,input:J(((t,e,n,i)=>{let o,l,s,u,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,D,S,z,P,I,O,J,T,B,R=r,U=r,{json:W={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Y);let Z;const K=G.getJsonWithVars(W.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),J=a(K&&G.getVariable(K,"string")||rr("temp","string",""),(t=>O=t));let tt="";I=a(G.getDerivedFromVars(W.hint_text),(t=>P=t)),z=a(G.getDerivedFromVars(W.hint_color),(t=>S=t));let nt="";D=a(G.getDerivedFromVars(W.font_size),(t=>V=t));let ot,at,lt=12;A=a(G.getDerivedFromVars(W.font_weight),(t=>F=t)),E=a(G.getDerivedFromVars(W.line_height),(t=>C=t)),k=a(G.getDerivedFromVars(W.letter_spacing),(t=>x=t));let st="";$=a(G.getDerivedFromVars(W.text_color),(t=>w=t));let ut="#000";b=a(G.getDerivedFromVars(W.highlight_color),(t=>_=t));let ct="";y=a(G.getDerivedFromVars(W.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",pt="text";h=a(G.getDerivedFromVars(W.max_visible_lines),(t=>f=t));let gt="",ft="";B=a(G.getDerivedFromVars(W.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),tt=O,o=P,nt=it(S,1,nt),lt=Ut(V,lt),ot=Lt(F,ot);{const t=C;It(t)&&(at=t/lt)}return bt(x)&&(st=et(x/lt*10)),ut=it(w,1,ut),ct=it(_,1,ct),m&&m in dt&&(pt=dt[m],vt=m),l="multi_line_text"===vt,s=G.getDerivedFromVars(W.paddings),U(),U=a(s,(t=>g=t)),It(f)&&(gt=`calc(${f*(at||1.25)+"em"} + ${rt(xt(null==g?void 0:g.top,0)+xt(null==g?void 0:g.bottom,0))})`),u=G.getDerivedFromVars(W.accessibility),R(),R=a(u,(t=>p=t)),(null==p?void 0:p.description)?ft=p.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:l},d={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ct,"font-size":et(lt),"font-weight":ot,"line-height":at,"letter-spacing":st,color:ut,"max-height":gt},R(),U(),h(),y(),b(),$(),k(),E(),A(),D(),z(),I(),J(),B(),Q?"":`${M(Bt,"Outer").$$render(t,{cls:mt("input",or,c),style:d,customDescription:!0,customActions:"input",json:W,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<span${N("class",or.input__wrapper,0)}><span${N("class",or.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"":""}</span>\n ${l?`<textarea${N("class",or.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ft,0)}${N("placeholder",o,0)}${N("this",Z,0)}>${j(tt,!0)}</textarea>`:`<input${N("type",pt,0)}${N("class",or.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ft,0)}${N("placeholder",o,0)}${N("value",tt,0)}${N("this",Z,0)}>`}</span>`})}`}))},lr=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:l}=e;const s=v(Y);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),u=i,c=o,d=u&&ar[u.type]||void 0,!d&&(({templateContext:c,json:u}=s.processTemplate(u,c)),d=u&&ar[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&s.hasTemplate(u.type)?"Recursive template":"Unknown component",s.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||P,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:l,origJson:a||i},{},{})}`:""})),sr=lr,ur=J(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${z([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("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"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function cr(t,e,r,n){const i=r[t.type];if(!i)return n(X(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const l=function e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),l=o.filter((t=>"$"!==t.charAt(0))),s=o.filter((t=>"$"===t.charAt(0)));return l.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),s.forEach((e=>{const o=i[e],l=a[o];if(void 0!==l){const t=e.substring(1);r[t]=l}else n(X(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(l[o]=t[o]);return{json:l,templateContext:a}}function dr(){}function vr(t){return{subscribe:e=>(e(t),dr)}}function pr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function gr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function fr(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 hr(t){var e=parseInt(t,10);if(e>We||e<Le)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function mr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function yr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,yr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function _r(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function br(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ht,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ft(e)}},a=Vt,l="@{",s="}",u="@{}",c="\\",d="||",v="&&",p="==",g="!=",f=">=",h="<=",m="+",y="-",_="true",b="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,C=/^[a-zA-Z_]/,E=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},S=kt(["}"],!0,!1),z=xt("?",!1),P=xt(":",!1),M=xt("||",!1),I=xt("&&",!1),O=xt("==",!1),J=xt("!=",!1),N=xt(">=",!1),T=xt(">",!1),B=xt("<=",!1),R=xt("<",!1),U=xt("+",!1),W=xt("-",!1),L=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Z=xt("(",!1),Y=xt(")",!1),X=xt(",",!1),K=Ct("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Ct("integer"),rt=kt([["0","9"]],!1,!1),nt=Ct("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),lt=Ct("boolean"),st=xt("true",!1),ut=xt("false",!1),ct=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Ct("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Ct("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ft=function(t){return fr(t)},ht=0,mt=0,yt=[{line:1,column:1}],_t=0,bt=[],wt=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function $t(){return t.substring(mt,ht)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ct(t){return{type:"other",description:t}}function Et(e){var r,n=yt[e];if(n)return n;for(r=e-1;!yt[r];)r--;for(n={line:(n=yt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return yt[e]=n,n}function Ft(t,e){var r=Et(t),n=Et(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ht<_t||(ht>_t&&(_t=ht,bt=[]),bt.push(t))}function Vt(){var t,e;return t=ht,Ut(),(e=Dt())!==n?(Ut(),mt=t,t=e):(ht=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=s,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===u?(r=u,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=c,ht++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=s,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=mr(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,l;return e=ht,(r=St())!==n?(Ut(),63===t.charCodeAt(ht)?(i="?",ht++):(i=n,0===wt&&At(z)),i!==n?(Ut(),(o=Dt())!==n?(Ut(),58===t.charCodeAt(ht)?(a=":",ht++):(a=n,0===wt&&At(P)),a!==n?(Ut(),(l=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:l}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,l,s,u;if(e=ht,(r=zt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===d?(l=d,ht+=2):(l=n,0===wt&&At(M)),l!==n?(s=Ut(),(u=zt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===d?(l=d,ht+=2):(l=n,0===wt&&At(M)),l!==n?(s=Ut(),(u=zt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=gr(r,i)}else ht=e,e=n;return e}function zt(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Pt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===v?(l=v,ht+=2):(l=n,0===wt&&At(I)),l!==n?(s=Ut(),(u=Pt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===v?(l=v,ht+=2):(l=n,0===wt&&At(I)),l!==n?(s=Ut(),(u=Pt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=gr(r,i)}else ht=e,e=n;return e}function Pt(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Mt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===p?(l=p,ht+=2):(l=n,0===wt&&At(O)),l===n&&(t.substr(ht,2)===g?(l=g,ht+=2):(l=n,0===wt&&At(J))),l!==n?(s=Ut(),(u=Mt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===p?(l=p,ht+=2):(l=n,0===wt&&At(O)),l===n&&(t.substr(ht,2)===g?(l=g,ht+=2):(l=n,0===wt&&At(J))),l!==n?(s=Ut(),(u=Mt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=pr(r,i)}else ht=e,e=n;return e}function Mt(){var e,r,i,o,a,l,s,u;if(e=ht,(r=It())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===f?(l=f,ht+=2):(l=n,0===wt&&At(N)),l===n&&(62===t.charCodeAt(ht)?(l=">",ht++):(l=n,0===wt&&At(T)),l===n&&(t.substr(ht,2)===h?(l=h,ht+=2):(l=n,0===wt&&At(B)),l===n&&(60===t.charCodeAt(ht)?(l="<",ht++):(l=n,0===wt&&At(R))))),l!==n?(s=Ut(),(u=It())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===f?(l=f,ht+=2):(l=n,0===wt&&At(N)),l===n&&(62===t.charCodeAt(ht)?(l=">",ht++):(l=n,0===wt&&At(T)),l===n&&(t.substr(ht,2)===h?(l=h,ht+=2):(l=n,0===wt&&At(B)),l===n&&(60===t.charCodeAt(ht)?(l="<",ht++):(l=n,0===wt&&At(R))))),l!==n?(s=Ut(),(u=It())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=pr(r,i)}else ht=e,e=n;return e}function It(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Ot())!==n){for(i=[],o=ht,a=Ut(),43===t.charCodeAt(ht)?(l=m,ht++):(l=n,0===wt&&At(U)),l===n&&(45===t.charCodeAt(ht)?(l=y,ht++):(l=n,0===wt&&At(W))),l!==n?(s=Ut(),(u=Ot())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),43===t.charCodeAt(ht)?(l=m,ht++):(l=n,0===wt&&At(U)),l===n&&(45===t.charCodeAt(ht)?(l=y,ht++):(l=n,0===wt&&At(W))),l!==n?(s=Ut(),(u=Ot())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=pr(r,i)}else ht=e,e=n;return e}function Ot(){var e,r,i,o,a,l,s,u;if(e=ht,(r=Jt())!==n){for(i=[],o=ht,a=Ut(),47===t.charCodeAt(ht)?(l="/",ht++):(l=n,0===wt&&At(L)),l===n&&(42===t.charCodeAt(ht)?(l="*",ht++):(l=n,0===wt&&At(q)),l===n&&(37===t.charCodeAt(ht)?(l="%",ht++):(l=n,0===wt&&At(H)))),l!==n?(s=Ut(),(u=Jt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),47===t.charCodeAt(ht)?(l="/",ht++):(l=n,0===wt&&At(L)),l===n&&(42===t.charCodeAt(ht)?(l="*",ht++):(l=n,0===wt&&At(q)),l===n&&(37===t.charCodeAt(ht)?(l="%",ht++):(l=n,0===wt&&At(H)))),l!==n?(s=Ut(),(u=Jt())!==n?o=a=[a,l,s,u]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=pr(r,i)}else ht=e,e=n;return e}function Jt(){var e,r,i;return(e=Bt())===n&&(e=Tt())===n&&(e=ht,33===t.charCodeAt(ht)?(r="!",ht++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ht)?(r=m,ht++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)))),r!==n?(Ut(),(i=Jt())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ht,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ht)?(i="(",ht++):(i=n,0===wt&&At(Z)),i!==n?(Ut(),o=function(){var e,r,i,o,a,l,s;if(e=ht,(r=Dt())!==n){for(i=[],o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(l=Dt())!==n?o=l:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(l=Dt())!==n?o=l:(ht=o,o=n)):(ht=o,o=n);mt=e,s=i,e=[r,...s]}else ht=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ht)?(a=")",ht++):(a=n,0===wt&&At(Y)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,(r=Rt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ht,39===t.charCodeAt(ht)?(r="'",ht++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ht,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=fr(e)}(),39===t.charCodeAt(ht)?(o="'",ht++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Tt())===n&&(e=function(){var e,r;return wt++,e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(st)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ht,t.substr(ht,5)===b?(r=b,ht+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(lt)),e}(),e===n&&(e=ht,40===t.charCodeAt(ht)?(r="(",ht++):(r=n,0===wt&&At(Z)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ht)?(o=")",ht++):(o=n,0===wt&&At(Y)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=s,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===u?(r=u,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=c,ht++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ht)?(i="'",ht++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=s,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===l?(r=l,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===l?(i=l,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=mr(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=c,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Tt(){var e,r,i,o;if(wt++,e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:hr($t())}):(ht=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Bt(){var e,r,i,o,a,l,s,u,c,d;for(wt++,e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ht)?(o=".",ht++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)a.push(l),x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt));else a=n;if(a!==n){if(l=ht,101===t.charCodeAt(ht)?(s="e",ht++):(s=n,0===wt&&At(ot)),s===n&&(69===t.charCodeAt(ht)?(s="E",ht++):(s=n,0===wt&&At(at))),s!==n){if(43===t.charCodeAt(ht)?(u=m,ht++):(u=n,0===wt&&At(U)),u===n&&(45===t.charCodeAt(ht)?(u=y,ht++):(u=n,0===wt&&At(W))),u===n&&(u=null),c=[],x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt));else c=n;c!==n?l=s=[s,u,c]:(ht=l,l=n)}else ht=l,l=n;l===n&&(l=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ht=e,e=n}else ht=e,e=n;if(e===n){if(e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ht)?(o="e",ht++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ht)?(o="E",ht++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ht)?(a=m,ht++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ht)?(a=y,ht++):(a=n,0===wt&&At(W))),a===n&&(a=null),l=[],x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)l.push(s),x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt));else l=n;l!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ht=e,e=n)}else ht=e,e=n;else ht=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Rt(){var e,r,i,o,a;if(wt++,e=ht,r=ht,wt++,i=function(){var e,r,i,o;return e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(st)),r===n&&(t.substr(ht,5)===b?(r=b,ht+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ht,wt++,k.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ht=i,i=n),i!==n?e=r=[r,i]:(ht=e,e=n)):(ht=e,e=n),e}(),wt--,i===n?r=void 0:(ht=r,r=n),r!==n)if(C.test(t.charAt(ht))?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ht=e,e=n;else ht=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Ut(){var e,r;for(wt++,e=[],E.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),E.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ht===t.length)return r;throw r!==n&&ht<t.length&&At({type:"end"}),function(t,e,r){return new yr(yr.buildMessage(t,e),t,e,r)}(bt,_t<t.length?t.charAt(_t):null,_t<t.length?Ft(_t,_t+1):Ft(_t,_t))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(yr,Error),yr.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 i=this.location.start,o=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,l=_r("",i.line.toString().length," "),s=n[i.line-1],u=(i.line===a.line?a.column:s.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+l+" |\n"+i.line+" | "+s+"\n"+l+" | "+_r("",i.column-1," ")+_r("",u,"^")}else e+="\n at "+o}return e},yr.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(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 o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+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?'"'+i(t)+'"':"end of input"}(e)+" found."};const wr=new Map,$r=new Map;function xr(t,e,r){const n={args:e,cb:r},i=wr.get(t)||[];wr.has(t)||wr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");$r.set(o,n)}function kr(t,e){let r=t.args.length,n=t.args.length;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!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function Cr(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=>{Cr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Cr(t.left,e),Cr(t.right,e);break;case"UnaryExpression":Cr(t.argument,e);break;case"ConditionalExpression":Cr(t.test,e),Cr(t.consequent,e),Cr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Cr(t,e)}))}}function Er(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Fr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Ar(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 Fr(t.value);if("color"===t.type)return Or(Ir(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Vr(t){let e=Ar(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function jr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const Dr=new Int32Array(1);function Sr(t){return Dr[0]=t,Dr[0]}function zr(t){if(t<Le||t>We)throw new Error("Integer overflow.")}function Pr(t){const e=[];return Cr(t,{Variable(t){e.push(t.id.name)}}),e}function Mr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Ir(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Or(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 nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Jr(t){return{type:Ge,value:Ar(t)}}function Nr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ye,value:e}}function Tr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ze&&(r=Sr(r)),{type:t.type,value:r}}function Br(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ze&&(r=Sr(r)),{type:t.type,value:r}}function Rr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Ze&&(e=Sr(e));return{type:t[0].type,value:e}}function Ur(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ze&&(e=Sr(e));return{type:t.length?t[0].type:Ze,value:e}}function Wr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ze&&(e=Sr(e));return{type:t.length?t[0].type:Ze,value:e}}function Lr(t){const e=Math.abs(t.value);return t.type===Ze&&zr(e),{type:t.type,value:e}}function qr(...t){if(!t.length)throw new Error("Non empty argument list is required for max function.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function Hr(...t){if(!t.length)throw new Error("Non empty argument list is required for min function.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function Gr(t){return{type:t.type,value:Math.sign(t.value)}}function Zr(t,e){let r;if(0===e.value&&t.type===Ze)r=t.value;else if(0===t.value&&t.type===Ze)r=0;else{let n=Math.sign(e.value);t.type===Ye&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ze&&zr(r),{type:t.type,value:r}}function Yr(t){return e=>{const r=Ir(e.value);return{type:Ye,value:r[t]/255}}}function Xr(t){return(e,r)=>{const n=Ir(e.value);return n[t]=255*r.value,{type:Ke,value:Or(n)}}}const Kr=Yr("a"),Qr=Yr("r"),tn=Yr("g"),en=Yr("b"),rn=Xr("a"),nn=Xr("r"),on=Xr("g"),an=Xr("b");function ln(t){return t.map(Vr).join(", ")}xr("toString",[Ze],Jr),xr("toString",[Ye],Jr),xr("toString",[Xe],Jr),xr("toString",[Ke],Jr),xr("toString",["url"],Jr),xr("toNumber",[Ze],Nr),xr("toNumber",[Ge],Nr),xr("toInteger",[Ye],(function(t){if(t.value>We||t.value<Le)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ze,value:e}})),xr("toInteger",[Ge],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>We||e<Le)throw new Error("Unable to convert value to Integer.");return{type:Ze,value:e}})),xr("toInteger",[Xe],(function(t){return{type:Ze,value:t.value?1:0}})),xr("toBoolean",[Ze],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Xe,value:t.value}})),xr("toBoolean",[Ge],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Xe,value:"true"===t.value?1:0}})),xr("encodeUri",[Ge],(function(t){try{return{type:Ge,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),xr("decodeUri",[Ge],(function(t){try{return{type:Ge,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),xr("parseUnixTime",[Ze],(function(t){return{type:Qe,value:new Date(1e3*t.value)}})),xr("nowLocal",[],(function(){return{type:Qe,value:new Date}})),xr("addMillis",[Qe,Ze],(function(t,e){return{type:Qe,value:new Date(t.value.getTime()+e.value)}})),xr("setYear",[Qe,Ze],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Qe,value:r}})),xr("setMonth",[Qe,Ze],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:Qe,value:r}})),xr("setDay",[Qe,Ze],(function(t,e){const r=new Date(t.value);if(e.value<=0&&-1!==e.value||e.value>function(t){const e=new Date(t);return e.setMonth(e.getMonth()+1),e.setDate(0),e.getDate()}(r))throw new Error(`Unable to set day ${e.value} for date ${Ar(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Qe,value:r}})),xr("setHours",[Qe,Ze],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:Qe,value:r}})),xr("setMinutes",[Qe,Ze],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:Qe,value:r}})),xr("setSeconds",[Qe,Ze],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:Qe,value:r}})),xr("setMillis",[Qe,Ze],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:Qe,value:r}})),xr("len",[Ge],(function(t){return{type:Ze,value:t.value.length}})),xr("contains",[Ge,Ge],(function(t,e){return{type:Xe,value:t.value.includes(e.value)?1:0}})),xr("substring",[Ge,Ze,Ze],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:Ge,value:t.value.substring(e.value,r.value)}})),xr("replaceAll",[Ge,Ge,Ge],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:Ge,value:n}})),xr("index",[Ge,Ge],(function(t,e){return{type:Ze,value:t.value.indexOf(e.value)}})),xr("lastIndex",[Ge,Ge],(function(t,e){return{type:Ze,value:t.value.lastIndexOf(e.value)}})),xr("trim",[Ge],(function(t){return{type:Ge,value:t.value.trim()}})),xr("trimLeft",[Ge],(function(t){return{type:Ge,value:t.value.replace(/^\s+/,"")}})),xr("trimRight",[Ge],(function(t){return{type:Ge,value:t.value.replace(/\s+$/,"")}})),xr("toUpperCase",[Ge],(function(t){return{type:Ge,value:t.value.toUpperCase()}})),xr("toLowerCase",[Ge],(function(t){return{type:Ge,value:t.value.toLowerCase()}})),xr("div",[Ze,Ze],Tr),xr("div",[Ye,Ye],Tr),xr("mod",[Ze,Ze],Br),xr("mod",[Ye,Ye],Br),xr("mul",[{type:Ze,isVararg:!0}],Rr),xr("mul",[{type:Ye,isVararg:!0}],Rr),xr("sub",[{type:Ze,isVararg:!0}],Ur),xr("sub",[{type:Ye,isVararg:!0}],Ur),xr("sum",[{type:Ze,isVararg:!0}],Wr),xr("sum",[{type:Ye,isVararg:!0}],Wr),xr("abs",[Ze],Lr),xr("abs",[Ye],Lr),xr("max",[{type:Ze,isVararg:!0}],qr),xr("max",[{type:Ye,isVararg:!0}],qr),xr("min",[{type:Ze,isVararg:!0}],Hr),xr("min",[{type:Ye,isVararg:!0}],Hr),xr("maxNumber",[],(function(){return{type:Ye,value:qe}})),xr("minNumber",[],(function(){return{type:Ye,value:He}})),xr("maxInteger",[],(function(){return{type:Ze,value:We}})),xr("minInteger",[],(function(){return{type:Ze,value:Le}})),xr("round",[Ye],(function(t){const e=Math.sign(t.value);return{type:Ye,value:e*Math.round(Math.abs(t.value))}})),xr("floor",[Ye],(function(t){return{type:Ye,value:Math.floor(t.value)}})),xr("ceil",[Ye],(function(t){return{type:Ye,value:Math.ceil(t.value)}})),xr("signum",[Ye],Gr),xr("signum",[Ze],Gr),xr("copySign",[Ye,Ye],Zr),xr("copySign",[Ze,Ze],Zr),xr("getColorAlpha",[Ge],Kr),xr("getColorAlpha",[Ke],Kr),xr("getColorRed",[Ge],Qr),xr("getColorRed",[Ke],Qr),xr("getColorGreen",[Ge],tn),xr("getColorGreen",[Ke],tn),xr("getColorBlue",[Ge],en),xr("getColorBlue",[Ke],en),xr("setColorAlpha",[Ge,Ye],rn),xr("setColorAlpha",[Ke,Ye],rn),xr("setColorRed",[Ge,Ye],nn),xr("setColorRed",[Ke,Ye],nn),xr("setColorGreen",[Ge,Ye],on),xr("setColorGreen",[Ke,Ye],on),xr("setColorBlue",[Ge,Ye],an),xr("setColorBlue",[Ke,Ye],an),xr("rgb",[Ye,Ye,Ye],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Ke,value:Or(n)}})),xr("argb",[Ye,Ye,Ye,Ye],(function(t,e,r,n){const i={a:255*t.value,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Ke,value:Or(i)}}));const sn={StringLiteral:function(t,e){return{type:Ge,value:e.value}},NumberLiteral:function(t,e){return{type:Ye,value:e.value}},IntegerLiteral:function(t,e){return{type:Ze,value:e.value}},BooleanLiteral:function(t,e){return{type:Xe,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Er(un(t,e.argument));switch(e.operator){case"!":if(r.type===Xe)return{type:Xe,value:r.value?0:1};Mr(`${e.operator}${Vr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ze)return{type:Ze,value:r.value*t};if(r.type===Ye)return{type:Ye,value:r.value*t};Mr(`${e.operator}${Vr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Er(un(t,e.test));if(r.type===Xe)return r.value?un(t,e.consequent):un(t,e.alternate);Mr(`${Vr(r)} ? ${Vr(un(t,e.consequent))} : ${Vr(un(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return un(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Ar(un(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Ge,value:r}},LogicalExpression:function(t,e){const r=Er(un(t,e.left));if(r.type!==Xe&&Mr(`${Vr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Xe,value:0};const n=Er(un(t,e.right));return n.type!==Xe&&Mr(`${Vr(r)} ${e.operator} ${Vr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${jr(n.type)}.`),{type:Xe,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=un(t,e.left),i=un(t,e.right);if(n.type!==i.type&&Mr(`${Vr(n)} ${e.operator} ${Vr(i)}`,`Operator '${r}' cannot be applied to different types: ${jr(n.type)} and ${jr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Qe&&r.type===Qe?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Xe,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ye&&e.type!==Ze&&e.type!==Qe&&Mr(`${Vr(e)} ${t} ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`);const i=e.type===Qe?e.value.getTime():e.value,o=r.type===Qe?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Xe,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Ge&&e.type!==Ye&&e.type!==Ze&&Mr(`${Vr(e)} ${t} ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`),e.type===Ge)return"-"===t&&Mr(`${Vr(e)} - ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`),{type:Ge,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ze&&(n=Sr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ze&&e.type!==Ye&&Mr(`${Vr(e)} ${t} ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&Mr(`${Vr(e)} ${t} ${Vr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ze&&(n=Sr(n)),{type:e.type,value:n}}(r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!wr.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>un(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if($r.has(o))n=$r.get(o);else{const t=function(t,e){const r=wr.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=kr(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t){const e=i.map((t=>jr(t.type))).join(", "),n=`${r}(${ln(i)})`;"few"===t.type&&0===i.length?Mr(n,`Non empty argument list is required for function '${r}'.`):(t.type,Mr(n,`Function '${r}' has no matching override for given argument types: ${e}.`))}n=t}if(!n)throw new Error("Function not found");try{return n.cb(...i)}catch(t){Mr(`${r}(${ln(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' has value null`)}};function un(t,e){if(e.type in sn)return sn[e.type](t,e);throw new Error("Unsupported expression")}function cn(t,e){try{return un(t,e)}catch(t){return{type:"error",value:t.message}}}class dn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Cr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=cn(t,this.ast);if("error"===r.type)return void e(X(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;if(n instanceof Date)return Fr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=ot(String(n));if(t)return Or(t);e(X(new Error("Expression execution error")))}return n}catch(t){return void e(X(new Error("Expression execution error")))}}}function vn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=br(t,{startRule:"JsonStringContents"}),n=Pr(r);return e.vars.push(...n),new dn(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>vn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=vn(t[i],e,r);return n}}var n;return t}function pn(t,e,r){if(t){if(t instanceof dn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>pn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=pn(t[i],e,r);return n}}return t}function gn(t,e){const r={vars:[],hasExpression:!1},n=vn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>pn(n,t,e)}}const fn={pagers:function(){return U(new Map)}},hn=new Map,mn=new Map;function yn(t){const e=hn.get(t)||U("");return hn.has(t)||hn.set(t,e),e}function _n(t){const e=mn.get(t)||new Map;return mn.has(t)||mn.set(t,e),e}class bn{setVariable(t){const e=t.getName(),r=_n(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),yn(this).set(e)}getVariable(t){return _n(this).get(t)}}function wn(){return new bn}const $n=J(((t,e,r,n)=>{let i,o;var l,s,u;let{id:c}=e,{json:v={}}=e,{platform:p="auto"}=e,{theme:g="system"}=e,{globalVariablesController:f=new bn}=e,{mix:h=""}=e,{customization:m={}}=e,{onError:y}=e,{onStat:b}=e,{onCustomAction:w}=e,{onComponent:$}=e,x=U("desktop"===p);if(o=a(x,(t=>i=t)),"auto"===p&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");x.set(!t.matches),t.addListener((()=>{x.set(!t.matches)}))}let k="light",C=null;function E(t){g=t}let F=!1;v||(F=!0,B(X(new Error('"json" prop is required')))),c||(F=!0,B(X(new Error('"id" prop is required'))));let A=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in ar)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const V=v.templates||{};A&&(F=!0,B(A));const D={stateChange:!1},S=yn(f),z=_n(f),P=new Map,I=new Map,O=new Map;function J(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=I.get(t);r&&r.setValue(e)}}function N(t){const e=I.get(t);return null==e?void 0:e.getValue()}function T(t){const e=gn(t,B);return e.vars.length?e.applyVars(I):t}function B(t){y?y({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function R(t,e){b&&b({type:t,action:e})}let L=0;function q(t){return`${c}-${L++}`}let H={},G={};function Z(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=nt,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],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=tt(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=tt(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=tt(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=I.get(r);t?t.set(i):B(X(new Error("Cannot find variable"),{additional:{name:r}}))}else B(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:B(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){B(X(t,{additional:{url:e}}))}}function K(t){null==w||w(t)}const Q=new Map;function tt(t){if(Q.has(t))return Q.get(t);B(X(new Error("Missing instance with id"),{additional:{id:t}}))}const et=new Map;function rt(t){for(const e of t)I.has(e)&&t.delete(e);return t}d(Y,{logError:B,logStat:R,hasTemplate:function(t){return t in V},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in V;){if(({json:t,templateContext:e}=cr(t,e,V,B)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:q,genClass:function(t){return`divkit-${q()}`},execAction:Z,execAnyActions:async function(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=pt(i);if(t)if(ft(t)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(Z(n),await _()):n.log_id&&(K(n),await _())}}t.forEach((t=>{t.log_id&&R("click",t)}))}},execCustomAction:K,isRunning:function(t){return D[t]},setRunning:function(t,e){D[t]=e},registerInstance:function(t,e){Q.has(t)?B(X(new Error("Duplicate instance id"),{additional:{id:t}})):Q.set(t,e)},unregisterInstance:function(t){Q.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(G[r]=G[r]||0,++G[r],H[r])return H[r];const n=`${q()}-svg-filter`;return H=Object.assign(Object.assign({},H),{[r]:n}),n},removeSvgFilter:function(t,e){t&&G[t]&&0==--G[`${t}:${e}`]&&(H=Object.keys(H).reduce(((t,e)=>(G[e]&&(t[e]=H[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return vr(t);const e=gn(t,B);return e.vars.length?W(e.vars.map((t=>I.get(t)||function(t){const e=O.get(t)||U(void 0);return O.has(t)||O.set(t,e),e}(t))).filter(lt),(()=>e.applyVars(I))):e.hasExpression?vr(e.applyVars(I)):vr(t)},getJsonWithVars:T,getStore:function(t){return et.has(t)||function(t){et.has(t)||et.set(t,fn[t]())}(t),et.get(t)},getVariable:function(t,e){const r=I.get(t);if(r){const n=r.getType();if(n!==e)return void B(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==m?void 0:m[t]},isDesktop:x,registerComponent:void 0,unregisterComponent:void 0}),d(St,{hasAction:()=>!1});const nt={setState(t){throw new Error("Not implemented")},getChild(t){if(it&&it.has(t))return it.get(t);B(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let it=null;d(yt,{registerInstance(t,e){it||(it=new Map),it.has(t)?B(X(new Error("Duplicate state with id"),{additional:{id:t}})):it.set(t,e)},unregisterInstance(t){null==it||it.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>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 ot=null===(l=null==v?void 0:v.card)||void 0===l?void 0:l.variables;Array.isArray(ot)&&ot.forEach((t=>{if(t&&t.type in er&&t.name){if(P.has(t.name))return void B(X(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=rr(t.name,t.type,t.value);P.set(t.name,e),I.set(t.name,e)}catch(e){B(X(e,{additional:{name:t.name}}))}}}));const at=v.palette;at&&at[k].forEach((t=>{if(P.has(t.name))B(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=rr(t.name,"color",t.color);P.set(t.name,e),I.set(t.name,e)}catch(e){B(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of z)I.has(t)||I.set(t,e);S.subscribe((t=>{if(t&&!I.has(t)){const e=z.get(t);I.set(t,e);const r=O.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const st=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variable_triggers;Array.isArray(st)&&st.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void B(X(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const n=br(t.condition,{startRule:"JsonStringContents"}),i=Pr(n);if(!i.length)return void B(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return rt(e),e.size?new Promise((t=>{const r=S.subscribe((()=>{rt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{W(i.map((t=>I.get(t))).filter(lt),(()=>cn(I,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=T(t);e.log_id&&Z(e)})),e=Boolean(n.value)):B(X(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){B(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else B(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const ut=null===(u=v.card)||void 0===u?void 0:u.states,ct=ut&&!F?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:ut.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return void 0===e.id&&r.id&&void 0!==c&&r.id(c),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==p&&r.platform(p),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==f&&r.globalVariablesController(f),void 0===e.mix&&r.mix&&void 0!==h&&r.mix(h),void 0===e.customization&&r.customization&&void 0!==m&&r.customization(m),void 0===e.onError&&r.onError&&void 0!==y&&r.onError(y),void 0===e.onStat&&r.onStat&&void 0!==b&&r.onStat(b),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==w&&r.onCustomAction(w),void 0===e.onComponent&&r.onComponent&&void 0!==$&&r.onComponent($),void 0===e.setTheme&&r.setTheme&&void 0!==E&&r.setTheme(E),void 0===e.setVariable&&r.setVariable&&void 0!==J&&r.setVariable(J),void 0===e.getVariable&&r.getVariable&&void 0!==N&&r.getVariable(N),void 0===e.execAction&&r.execAction&&void 0!==Z&&r.execAction(Z),"light"===g||"dark"===g?k=g:"system"===g?"undefined"!=typeof matchMedia?(C||(C=matchMedia("(prefers-color-scheme: dark)"),C.addListener((function(){"system"===g&&C&&(k=C.matches?"dark":"light")}))),k=C.matches?"dark":"light"):k="light":B(X(new Error("Unsupported theme"))),k&&(at&&at[k].forEach((t=>{const e=I.get(t.name);e&&e.setValue(t.color)}))),o(),!F&&ct?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(h?` ${h}`:"",!0)}">${M(ur,"RootSvgFilters").$$render(t,{svgFiltersMap:H},{},{})}\n ${M(sr,"Unknown").$$render(t,{div:ct,templateContext:{}},{},{})}</div>`:""})),xn=$n;function kn(t){return xn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,onError:t.onError,platform:t.platform}).html}var Cn=exports;for(var En in e)Cn[En]=e[En];e.__esModule&&Object.defineProperty(Cn,"__esModule",{value:!0})})();
|
|
2
2
|
//# sourceMappingURL=server.js.map
|