@divkitframework/divkit 8.0.0 → 9.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/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 s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}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:()=>Xr,createVariable:()=>Se,render:()=>tn}),new Set,new Map;const g=[],p=[],h=[],f=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),k(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(g.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(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"]),F=/[\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 E(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(F.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?"&amp;":'"'===e?"&quot;":"&lt;"),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 P(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$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=s;l({$$:{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 l(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 U(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 B=[];function L(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=!B.length;for(const e of i)e[1](),B.push(e,t);if(e){for(let t=0;t<B.length;t+=2)B[t][0](B[t+1]);B.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function R(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return c=t=>{let n=!1;const c=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}},{subscribe:L(n,c).subscribe};var c}const W="divkit-bd25",q="divkit-c016",H=Symbol("root");function G(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const Z={text:"divkit-d9b0",text_halign_left:"divkit-a4cb",text_halign_center:"divkit-e165",text_halign_right:"divkit-ea28",text_valign_top:"divkit-d8ce",text_valign_center:"divkit-ef58",text_valign_bottom:"divkit-fe8e",text_width_content:"divkit-f41f",text_height_content:"divkit-ea52",text__inner:"divkit-b852",text_singleline:"divkit-ef11",text_truncate_none:"divkit-c6ea",text_multiline:"divkit-ee8e",text__inner_gradient:"divkit-cb8e",text__image:"divkit-bf6e",text__image_hidden:"divkit-f100"},Y={outer:"divkit-d65a","outer_hide-on-transition-in":"divkit-a6d1","outer_halign-self_start":"divkit-cc45","outer_halign-self_center":"divkit-b833","outer_halign-self_end":"divkit-c573","outer_halign-self_stretch":"divkit-dcc7","outer_valign-self_start":"divkit-e807","outer_valign-self_center":"divkit-d40a","outer_valign-self_end":"divkit-e9f8","outer_valign-self_stretch":"divkit-b7aa","outer_parent-flex_vertical":"divkit-c143","outer_parent-flex_horizontal":"divkit-ef30","outer_width-constrained":"divkit-d321","outer_height-constrained":"divkit-a525","outer_parent-overlap":"divkit-dab2","outer_parent-overlap-absolute":"divkit-d43f","outer_scroll-snap_center":"divkit-d9e3","outer_scroll-snap_start":"divkit-efd1",outer__border:"divkit-d405",outer_visibility_invisible:"divkit-f018",outer_visibility_gone:"divkit-e784","outer_has-action-animation":"divkit-f498"};function X(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 K(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 Q(t){let e=K(t);return"0"===e&&(e+="em"),e}function tt(t,e){for(;t.length<e;)t="0"+t;return t}function et(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=rt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>tt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function rt(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,s=2===i.length?i:i+i,l=2===o.length?o:o+o,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function nt(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const it=Boolean;function ot(t){if(1===t.length&&"solid"===t[0].type)return{color:et(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=et(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(it);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>et(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:at(t.bg.scale),pos:st(t.bg),image:'url("'+nt(r)+'")'}}({bg:t}):void 0)).filter(it).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(",")}}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(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 lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const ut=new Set(["http","https","tel","mailto","intent"]);function ct(t){return ut.has(t)}function dt(t,e){e&&t.push(e)}function vt(t,e,r){const n=[];dt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&dt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const gt=Symbol("state");function pt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return pt(t)&&t>=0}function ft(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]&&!ht(i[t]))return n;return function(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>K((t||e)/r*10))).join(" ")}(t,e,r)}function mt(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]&&!ht(r[t]))return e;return function(t){return K(t.top||0)+" "+K(t.right||0)+" "+K(t.bottom||0)+" "+K(t.left||0)}(t)}function yt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const _t=Object.prototype.hasOwnProperty;function bt(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(!_t.call(e,i)||!bt(t[i],e[i]))return!1}return!0}function wt(t,e){return bt(t,e)?e:t}function $t(){}const xt=Symbol("action"),kt=J(((t,e,r,n)=>{let{actions:i}=e,{cls:o=""}=e,{style:a=null}=e,{attrs:s}=e,{use:l=$t}=e,{customAction:u=null}=e,{hasActionAnimation:c=!1}=e;const g=v(H),p=v(xt);d(xt,{hasAction:()=>Boolean(p.hasAction()||(null==i?void 0:i.length))});let h,f="";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){f=e,h=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&p.hasAction()&&(f="",g.logError(G(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let m=Boolean(u);return f&&!ct(lt(f))&&(f="",m=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.cls&&r.cls&&void 0!==o&&r.cls(o),void 0===e.style&&r.style&&void 0!==a&&r.style(a),void 0===e.attrs&&r.attrs&&void 0!==s&&r.attrs(s),void 0===e.use&&r.use&&void 0!==l&&r.use(l),void 0===e.customAction&&r.customAction&&void 0!==u&&r.customAction(u),void 0===e.hasActionAnimation&&r.hasActionAnimation&&void 0!==c&&r.hasActionAnimation(c),f?`<a${E([{href:D(f)},{target:D(h)},{style:D(a)},{class:j(o,!0)+" "+j(c?"":W,!0)},S(s)],{})}>${n.default?n.default({}):""}</a>`:`<span${E([{class:j(o,!0)+j(m?` ${c?"":W} divkit-c016`:"",!0)},{style:D(a)},{role:D(m?"button":null)},S(s)],{})}>${n.default?n.default({}):""}</span>`})),Ct=kt,Ft="divkit-b921",Et=J(((t,e,r,n)=>{let{background:i=[]}=e;const o=i.map((t=>{const e={},r=ot([t]),n={style:e};return"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position),n}));return void 0===e.background&&r.background&&void 0!==i&&r.background(i),`<span${N("class","divkit-bf25",0)}>${P(o,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",Ft,0)}${N("style",X(t.style),0)}>`:`<span${N("class",Ft,0)}${N("style",X(t.style),0)}></span>`))}</span>`}));function At(t,e){const r=Number(t);return isNaN(r)?e:r}const Vt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J,T,U,B,L,R,W=r,q=r,Z=r,tt=r,rt=r,nt=r,it=r,at=r,st=r,ut=r,dt=r,pt=r,_t=r,bt=r,$t=r;var xt,kt,Ft,Vt,jt,Dt;let{json:St={}}=e,{origJson:Pt}=e,{templateContext:zt}=e,{cls:Mt=""}=e,{style:It}=e,{layoutParams:Ot={}}=e,{customDescription:Jt=!1}=e,{customPaddings:Nt=!1}=e,{customActions:Tt=""}=e,{forceWidth:Ut=!1}=e,{forceHeight:Bt=!1}=e;const Lt={left:"start",center:"center",right:"end"},Rt={top:"start",center:"center",bottom:"end"},Wt=v(H),qt=v(gt);let Ht,Gt,Zt,Yt,Xt,Kt,Qt,te={},ee={},re=!1,ne=1,ie="transparent",oe=0,ae="",se="",le="",ue={},ce=0,de=0,ve=0,ge={},pe=0,he=0,fe=0,me=1;const ye=St.transition_triggers||["state_change","visibility_change"],_e=-1!==ye.indexOf("state_change")&&St.id,be=-1!==ye.indexOf("visibility_change")&&St.id;let we,$e,xe,ke,Ce,Fe,Ee,Ae,Ve,je=[],De="",Se=!1,Pe="visible",ze=0,Me=0;void 0===e.json&&n.json&&void 0!==St&&n.json(St),void 0===e.origJson&&n.origJson&&void 0!==Pt&&n.origJson(Pt),void 0===e.templateContext&&n.templateContext&&void 0!==zt&&n.templateContext(zt),void 0===e.cls&&n.cls&&void 0!==Mt&&n.cls(Mt),void 0===e.style&&n.style&&void 0!==It&&n.style(It),void 0===e.layoutParams&&n.layoutParams&&void 0!==Ot&&n.layoutParams(Ot),void 0===e.customDescription&&n.customDescription&&void 0!==Jt&&n.customDescription(Jt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Nt&&n.customPaddings(Nt),void 0===e.customActions&&n.customActions&&void 0!==Tt&&n.customActions(Tt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Ut&&n.forceWidth(Ut),void 0===e.forceHeight&&n.forceHeight&&void 0!==Bt&&n.forceHeight(Bt),o=Wt.getDerivedFromVars(St.border),$t(),$t=a(o,(t=>R=t));{let t={},e={},r=!1;if(R){if(R.has_shadow){const e=R.shadow;t["box-shadow"]=e?K((null===(kt=null===(xt=e.offset)||void 0===xt?void 0:xt.x)||void 0===kt?void 0:kt.value)||0)+" "+K((null===(Vt=null===(Ft=e.offset)||void 0===Ft?void 0:Ft.y)||void 0===Vt?void 0:Vt.value)||0)+" "+K(null!==(jt=e.blur)&&void 0!==jt?jt:2)+" "+et(e.color||"#000000",null!==(Dt=e.alpha)&&void 0!==Dt?Dt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}R.stroke&&(r=!0,ne=yt(R.stroke.width,ne),ie=et(R.stroke.color,1,ie),e.border=`${K(ne)} solid ${ie}`),R.corners_radius?(ae=ft(R.corners_radius,0,10,ae),e["border-radius"]=t["border-radius"]=ae):R.corner_radius&&(oe=yt(R.corner_radius,oe),e["border-radius"]=t["border-radius"]=K(oe))}te=wt(t,te),ee=wt(e,ee),re=r}s=Wt.getDerivedFromVars(St.paddings),bt(),bt=a(s,(t=>L=t)),se=mt(L&&!Nt?L:void 0,se),l=Wt.getDerivedFromVars(St.margins),pt(),pt=a(l,(t=>U=t)),le=mt(U,le),u=Wt.getDerivedFromVars(St.width),ut(),ut=a(u,(t=>J=t)),c=Wt.getDerivedFromVars(St.alignment_horizontal),_t(),_t=a(c,(t=>B=t));{let t,e,r={},n=0,i=0;const o=null==J?void 0:J.type;if("fixed"===o?(ce=yt(null==J?void 0:J.value,ce),e=K(ce)):"wrap_content"===o||!Ot.overlapParent&&"match_parent"===o&&Ot.parentHorizontalWrapContent?(t="content",("wrap_content"===o&&(null==J?void 0:J.constrained)||"match_parent"===o&&Ot.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(G(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Ot.parentLayoutOrientation?e=`calc(100% - ${Q(((null==U?void 0:U.left)||0)+((null==U?void 0:U.right)||0))})`:"horizontal"===Ot.parentContainerOrientation&&(n=J&&"weight"in J&&J.weight||1)),"content"===t&&Ut&&(t="parent",Wt.logError(G(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=B;r["halign-self"]="left"===t||"center"===t||"right"===t?Lt[t]:Ot.parentHAlign||"start"}t&&(r.width=t),Zt=e,de=n,ve=i,ue=wt(r,ue)}d=Wt.getDerivedFromVars(St.height),st(),st=a(d,(t=>O=t)),g=Wt.getDerivedFromVars(St.alignment_vertical),dt(),dt=a(g,(t=>T=t));{let t,e,r={},n=0,i=0;const o=null==O?void 0:O.type;if("fixed"===o?(pe=yt(null==O?void 0:O.value,pe),e=K(pe)):"match_parent"!==o||!Ot.overlapParent&&Ot.parentVerticalWrapContent?(t="content",("wrap_content"===o&&(null==O?void 0:O.constrained)||"match_parent"===o&&Ot.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(G(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Ot.parentLayoutOrientation?e=`calc(100% - ${Q(((null==U?void 0:U.top)||0)+((null==U?void 0:U.bottom)||0))})`:"vertical"===Ot.parentContainerOrientation&&(n=(null==O?void 0:O.weight)||1)),"content"===t&&Bt&&(t="parent",Wt.logError(G(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=T;r["valign-self"]="top"===t||"center"===t||"bottom"===t?Rt[t]:Ot.parentVAlign||"start"}t&&(r.height=t),Yt=e,he=n,fe=i,ge=wt(r,ge)}var Ie,Oe;if(p=!!Ot.overlapParent||void 0,h=Ot.overlapParent&&(!J||"match_parent"===J.type)&&"match_parent"===(null==O?void 0:O.type),f=Ot.gridArea?`${Ot.gridArea.y+1}/${Ot.gridArea.x+1}/span ${Ot.gridArea.rowSpan}/span ${Ot.gridArea.colSpan}`:void 0,m=Wt.getDerivedFromVars(St.alpha),at(),at=a(m,(t=>I=t)),Oe=me,me=!ht(Ie=I)||void 0===Ie||Ie>1?Oe:Number(Ie),Xt=1===me?void 0:me,y=Wt.getDerivedFromVars(St.accessibility),it(),it=a(y,(t=>z=t)),Gt=void 0,z&&!Jt&&z.description&&(Gt={},Gt["aria-label"]=z.description),b=Wt.getDerivedFromVars(St.background),nt(),nt=a(b,(t=>P=t)),Kt={},Qt=!1,P&&(Qt=P.some((t=>"image"===t.type)),!Qt)){const t=ot(P);Kt["background-color"]=t.color,Kt["background-image"]=t.image,Kt["background-size"]=t.size,Kt["background-position"]=t.position,Kt["background-repeat"]="no-repeat"}we=void 0,_e&&St.transition_in&&Wt.isRunning("stateChange")&&(we=!0),xe=void 0,_e&&St.transition_change&&Wt.isRunning("stateChange")&&qt.hasTransitionChange(St.id)&&(xe=!0),w=Wt.getDerivedFromVars(St.action),tt(),tt=a(w,(t=>D=t)),$=Wt.getDerivedFromVars(St.actions),rt(),rt=a($,(t=>S=t));{let t=S||D&&[D]||[];Array.isArray(t)?t.length&&Tt&&(t=[],Wt.logError(G(new Error(`Cannot use action on component "${Tt}"`)))):(t=[],Wt.logError(G(new Error("Actions should be array")))),je=t}x=Wt.getDerivedFromVars(St.action_animation),Z(),Z=a(x,(t=>j=t)),j&&(De=function t(e){var r;const n=At(e.start_value,1),i=At(e.end_value,1),o=yt(e.start_delay,0),a=yt(e.duration,300),s=function(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:"ease_in_out"}(e.interpolator).replace(/_/g,"-");switch(e.name){case"fade":return ke=n,Ce=i,`opacity ${a}ms ${s} ${o}ms`;case"scale":return Fe=n,Ee=i,`transform ${a}ms ${s} ${o}ms`;case"set":return(null===(r=e.items)||void 0===r?void 0:r.length)?e.items.map(t).join(", "):(Wt.logError(G(new Error("Empty items value for action_animation with name='set'"))),"");default:return Wt.logError(G(new Error("Unknown action_animation name"),{additional:{animation:e.name}})),""}}(j)),k=Wt.getDerivedFromVars(St.visibility),q(),q=a(k,(t=>V=t));{const t=Pe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(V,Pe);t!==e&&(!Se||"visible"!==Pe&&"visible"!==e?Pe=e:async function(t){Pe=t;const e="visible"===t?"in":"out",r="in"===e?St.transition_in:St.transition_out;be&&r&&(await _(),"in"===e&&($e=!0),qt.runVisibilityTransition(Object.assign(Object.assign({},St),{visibility:"visible"}),zt,r,Ht,e).then((()=>{"in"===e&&($e=!1)})).catch((t=>{throw"in"===e&&($e=!1),t})))}(e)),Se||(Se=!0)}if(C=Object.assign(Object.assign(Object.assign({},ue),ge),{"parent-overlap":p,"parent-overlap-absolute":h,"scroll-snap":Ot.scrollSnap,"hide-on-transition-in":we||$e||xe,visibility:Pe,"has-action-animation":Boolean(De),"parent-flex":Ot.parentContainerOrientation||void 0}),F=Wt.getDerivedFromVars(St.transform),W(),W=a(F,(t=>A=t)),A&&void 0!==A.rotation){const t=A.pivot_x||{type:"pivot-percentage",value:50};ze=At(t.value,ze);const e="pivot-fixed"===t.type?K(ze):`${ze}%`,r=A.pivot_y||{type:"pivot-percentage",value:50};Me=At(r.value,Me),Ae=`${e} ${"pivot-fixed"===r.type?K(Me):`${Me}%`}`,Ve=`rotate(${A.rotation}deg)`}return E=Object.assign(Object.assign(Object.assign(Object.assign({},It),Kt),te),{width:Zt,height:Yt,"grid-area":f,padding:se,margin:le,opacity:Xt,transition:De,"transform-origin":Ae,transform:Ve,"flex-grow":de||he||void 0,"flex-shrink":ve||fe?1:void 0,"flex-basis":de||he?0:void 0,"--divkit-animation-opacity-start":ke,"--divkit-animation-opacity-end":Ce,"--divkit-animation-scale-start":Fe,"--divkit-animation-scale-end":Ee}),W(),q(),Z(),tt(),rt(),nt(),it(),at(),st(),ut(),dt(),pt(),_t(),bt(),$t(),`${M(Ct,"Actionable").$$render(t,{use:function(t){Ht=t,_e&&St.transition_in&&qt.registerChildWithTransitionIn(St,zt,St.transition_in,t).then((()=>{we=!1})).catch((t=>{throw we=!1,t})),_e&&St.transition_out&&qt.registerChildWithTransitionOut(St,zt,St.transition_out,t),_e&&St.transition_change&&qt.registerChildWithTransitionChange(St,zt,St.transition_change,t).then((()=>{xe=!1})).catch((t=>{throw xe=!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=lt(n);t&&!ct(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:Wt.getJsonWithVars(St.visibility_actions||St.visibility_action&&[St.visibility_action]),rootCtx:Wt});const e=St.id;e&&qt.registerChild(e);let r=null;return{destroy(){e&&qt.unregisterChild(e),r&&r.destroy()}}},cls:Mt+" "+vt("outer",Y,C),style:X(E),actions:je,attrs:Gt,hasActionAnimation:Boolean(De)},{},{default:()=>`${Qt?`${M(Et,"OuterBackground").$$render(t,{background:P},{},{})}`:""}${i.default?i.default({}):""}${re?`<span${N("class",Y.outer__border,0)}${N("style",X(ee),0)}></span>`:""}`})}`})),jt={"text-range":"divkit-faf0","text-range_singleline":"divkit-ccb6","text-range__top-offset":"divkit-d923","text-range_decoration_both":"divkit-d7e0","text-range_decoration_underline":"divkit-f3dd","text-range_decoration_strike":"divkit-d27b","text-range_decoration_none":"divkit-c6b0"};function Dt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function St(t){return pt(t)&&t>0}function Pt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function zt(t,e){return Pt(t)||e}const Mt=J(((t,e,r,n)=>{let i,o,a,s,{text:l}=e,{rootFontSize:u}=e,{textStyles:c={}}=e,{singleline:d=!1}=e,{actions:v}=e,g="none",p=12,h=1.25,f="",m="";void 0===e.text&&r.text&&void 0!==l&&r.text(l),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==u&&r.rootFontSize(u),void 0===e.textStyles&&r.textStyles&&void 0!==c&&r.textStyles(c),void 0===e.singleline&&r.singleline&&void 0!==d&&r.singleline(d),void 0===e.actions&&r.actions&&void 0!==v&&r.actions(v);{let t="none";(c.underline||c.strike)&&("single"===c.underline&&"single"===c.strike?t="both":"single"===c.underline?t="underline":"single"===c.strike&&(t="strike")),g=t}return p=Dt(c.font_size,p),St(c.line_height)&&(h=Number(c.line_height)/p),ht(c.letter_spacing)&&(f=K(c.letter_spacing)),s=zt(c.font_weight,s),m=et(c.text_color,1,m),i=c.top_offset?K(c.top_offset):"",o={singleline:d,decoration:g},a={"font-size":K(10*p/u),"line-height":h,"letter-spacing":f,"font-weight":s,color:m},`${i?`<span${N("class",jt["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${M(Ct,"Actionable").$$render(t,{cls:vt("text-range",jt,o),actions:v,style:X(a)},{},{default:()=>`${j(l)}`})}`}));function It(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Ot(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const Jt=J(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,z,I,O,J,T,U,B,L,R,W,Y,Q,tt=r,rt=r,nt=r,it=r,at=r,st=r,lt=r,ut=r,ct=r,dt=r,gt=r,pt=r,ht=r,ft=r,mt=r,{json:yt={}}=e,{templateContext:_t}=e,{origJson:bt}=e,{layoutParams:wt}=e;const $t=v(H);let xt=!1,kt="",Ct=12,Ft=1.25,Et=!1,At="",jt="",Pt=!1,zt="left",Jt="top",Nt="",Tt="",Ut=!1,Bt=[],Lt=[];var Rt,Wt;c((()=>{Lt.forEach((t=>{$t.removeSvgFilter(t)}))})),void 0===e.json&&n.json&&void 0!==yt&&n.json(yt),void 0===e.templateContext&&n.templateContext&&void 0!==_t&&n.templateContext(_t),void 0===e.origJson&&n.origJson&&void 0!==bt&&n.origJson(bt),void 0===e.layoutParams&&n.layoutParams&&void 0!==wt&&n.layoutParams(wt),o=$t.getDerivedFromVars(yt.text),mt(),mt=a(o,(t=>Q=t)),Rt=Q,Wt=kt,kt=String(null!=Rt?Rt:"")||Wt,kt?xt=!1:(xt=!0,$t.logError(G(new Error('Missing "text" prop for div "text"')))),s=$t.getDerivedFromVars(yt.ranges),it(),it=a(s,(t=>z=t)),l=$t.getDerivedFromVars(yt.images),nt(),nt=a(l,(t=>S=t)),u=$t.getDerivedFromVars({font_size:yt.font_size,letter_spacing:yt.letter_spacing,font_weight:yt.font_weight,text_color:yt.text_color,underline:yt.underline,strike:yt.strike,line_height:yt.line_height}),at(),at=a(u,(t=>I=t)),d=$t.getDerivedFromVars(yt.font_size),ft(),ft=a(d,(t=>Y=t)),Ct=Dt(Y,Ct),g=$t.getDerivedFromVars(yt.line_height),ht(),ht=a(g,(t=>W=t));{const t=W;St(t)?(Ft=Number(t)/Ct,Et=!0):Et=!1}p=$t.getDerivedFromVars(yt.max_lines),dt(),dt=a(p,(t=>B=t)),h=1===B;{let t="",e="",r=!1;if(B&&B>1){let n=Number(B);t=n*Ft+"em",z||S||(e=n,r=!0)}At=t,jt=e,Pt=r}f=$t.getDerivedFromVars(yt.text_alignment_horizontal),pt(),pt=a(f,(t=>R=t)),zt=It(R,zt),m=$t.getDerivedFromVars(yt.text_alignment_vertical),gt(),gt=a(m,(t=>L=t)),Jt=Ot(L,Jt),y=!z||kt&&1===z.length&&z[0]&&0===z[0].start&&"number"==typeof z[0].end&&z[0].end>=kt.length,_=$t.getDerivedFromVars(yt.text_color),ct(),ct=a(_,(t=>U=t)),b=Boolean(U)!==Boolean(z&&z[0]&&z[0].text_color);{let t="";B&&y&&b&&(t=et(U||z&&z[0]&&z[0].text_color,1,Nt)),Nt=t}w=$t.getDerivedFromVars(yt.truncate),ut(),ut=a(w,(t=>T=t)),$="none"===T?"none":"",x=$t.getDerivedFromVars(yt.text_gradient),lt(),lt=a(x,(t=>J=t));{let t="";if(J){const e=ot([J]);e.image&&(t=e.image)}Tt=t}return k=$t.getDerivedFromVars(yt.selectable),st(),st=a(k,(t=>O=t)),Ut=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(O,Ut),C=$t.getDerivedFromVars(yt.width),rt(),rt=a(C,(t=>D=t)),F=$t.getDerivedFromVars(yt.height),tt(),tt=a(F,(t=>j=t)),function(t,e,r){let n=[];if(Lt.forEach((t=>{$t.removeSvgFilter(t)})),Lt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Bt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],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>s){let r=Object.assign(Object.assign({},I),...l);n.push({text:i.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},I),...l),r=K(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=K(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":K(10*(Number(e.font_size)||12)/Ct)};let a="";if(t.image.tint_color){const e=et(t.image.tint_color);a=$t.addSvgFilter(e),Lt.push(e)}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},I)}),Bt=n}(kt,z,S),E={singleline:h,multiline:Pt,halign:zt,valign:Jt,truncate:$,width:"wrap_content"!==(null==D?void 0:D.type)||D.constrained?"":"content",height:!j||"wrap_content"===j.type&&!j.constrained?"content":""},A={gradient:Boolean(Tt)},V={"font-size":K(Ct),"line-height":Ft,"max-height":At,"-webkit-line-clamp":jt,color:Nt,"background-image":Tt},tt(),rt(),nt(),it(),at(),st(),lt(),ut(),ct(),dt(),gt(),pt(),ht(),ft(),mt(),xt?"":`${M(Vt,"Outer").$$render(t,{cls:vt("text",Z,E)+" "+(Ut?"":q),json:yt,origJson:bt,templateContext:_t,layoutParams:wt},{},{default:()=>`<span${N("class",vt("text__inner",Z,A),0)}${N("style",X(V),0)}>${Bt.length?`${P(Bt,((e,r)=>"text"in e?e.text?`${M(Mt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:Ct,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",X(e.image.wrapperStyle),0)}><img${N("class",Z.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",X({width:e.image.width,height:e.image.height,"margin-top":Et?`-${e.image.height}`:void 0,"margin-bottom":Et?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Mt,"TextRangeView").$$render(t,{text:kt,rootFontSize:Ct,textStyles:I,singleline:h},{},{})}`}</span>`})}`})),Nt=Jt,Tt={container:"divkit-d37d",container_orientation_vertical:"divkit-ddc3",container_valign_top:"divkit-a331",container_valign_center:"divkit-aae6",container_valign_bottom:"divkit-c222",container_orientation_horizontal:"divkit-fe45",container_halign_left:"divkit-a309",container_halign_center:"divkit-bac9",container_halign_right:"divkit-f423",container_orientation_overlap:"divkit-a644"},Ut=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,_,b=r,w=r,$=r,x=r,k=r,{json:C={}}=e,{templateContext:F}=e,{origJson:E}=e,{layoutParams:A}=e;const V={left:"start",center:"center",right:"end"},j={top:"start",center:"center",bottom:"end"},D=v(H);let S=!1,z="vertical",I="top",O="left",J={};void 0===e.json&&n.json&&void 0!==C&&n.json(C),void 0===e.templateContext&&n.templateContext&&void 0!==F&&n.templateContext(F),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==A&&n.layoutParams(A),o=C.items,(null==o?void 0:o.length)&&Array.isArray(o)?S=!1:(S=!0,D.logError(G(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!S&&o||[]).map((t=>{let e=t,r=F;return({templateContext:r,json:e}=D.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=D.getDerivedFromVars(C.orientation),k(),k=a(l,(t=>_=t)),z=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(_,z),u=D.getDerivedFromVars(C.content_alignment_vertical),x(),x=a(u,(t=>y=t)),I=Ot(y,I),c=D.getDerivedFromVars(C.content_alignment_horizontal),$(),$=a(c,(t=>m=t)),O=It(m,O),d=D.getDerivedFromVars(C.width),b(),b=a(d,(t=>h=t)),g=D.getDerivedFromVars(C.height),w(),w=a(g,(t=>f=t));{let t={};"overlap"===z&&(t.overlapParent=!0),"horizontal"!==z&&(t.parentHAlign=V[O],(!f||"wrap_content"===f.type||"match_parent"===f.type&&(null==A?void 0:A.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==z&&(t.parentVAlign=j[I],("wrap_content"===(null==h?void 0:h.type)||"match_parent"===(null==h?void 0:h.type)&&(null==A?void 0:A.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===z&&(t.parentContainerOrientation="horizontal"),"vertical"===z&&(t.parentContainerOrientation="vertical"),J=wt(t,J)}return p={orientation:z,valign:I,halign:O},b(),w(),$(),x(),k(),S?"":`${M(Vt,"Outer").$$render(t,{cls:vt("container",Tt,p),json:C,origJson:E,templateContext:F,layoutParams:A},{},{default:()=>`${P(s,(e=>`${M(Je,"Unknown").$$render(t,{layoutParams:J,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Bt={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Lt(t,e){return"vertical"===t||"horizontal"===t?t:e}const Rt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(H);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),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(h.delimiter_style),p(),p=a(o,(t=>g=t)),b=Lt(null==g?void 0:g.orientation,b),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=et(null==g?void 0:g.color,1,w),l="horizontal"===b?"100%":K(1),u="horizontal"===b?K(1):"100%",c={background:w,width:l,height:u},d={orientation:b},p(),`${M(Vt,"Outer").$$render(t,{cls:vt("separator",Bt,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${N("class",Bt.separator__inner,0)}${N("style",X(c),0)}></span>`:""})}`})),Wt={image:"divkit-a448","image_is-width-content":"divkit-fe14","image_is-height-content":"divkit-f4d9",image__image:"divkit-ce04",image_error:"divkit-f10d","image__aspect-wrapper":"divkit-dc80",image_aspect:"divkit-ae78"},qt=J(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J=r,T=r,B=r,L=r,R=r,W=r,q=r,Z=r,Y=r,K=r,Q=r,{json:tt={}}=e,{templateContext:rt}=e,{origJson:it}=e,{layoutParams:ot}=e;const lt=v(H);let ut,ct=!1,dt=!0,gt="rgba(0,0,0,0.08)",pt=!1,ht="",ft="none",mt="50% 50%",yt="0",_t="";c((()=>{lt.removeSvgFilter(ut)})),void 0===e.json&&n.json&&void 0!==tt&&n.json(tt),void 0===e.templateContext&&n.templateContext&&void 0!==rt&&n.templateContext(rt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=lt.getDerivedFromVars(tt.image_url),Q(),Q=a(o,(t=>O=t)),s=lt.getDerivedFromVars(tt.gif_url),K(),K=a(s,(t=>I=t)),l=O||I,dt=!0,ct=!1,l?pt=!1:(pt=!0,lt.logError(G(new Error('Missing "image_url" for "image"')))),u=lt.getDerivedFromVars(tt.width),Y(),Y=a(u,(t=>z=t)),d="wrap_content"===(null==z?void 0:z.type),g=lt.getDerivedFromVars(tt.height),Z(),Z=a(g,(t=>P=t)),p="wrap_content"===(null==P?void 0:P.type),h=lt.getDerivedFromVars(tt.preview),q(),q=a(h,(t=>S=t));{const t=S;ht=t?t.startsWith("data:")?`url("${nt(t)}")`:`url("data:image/jpg;base64,${nt(t)}")`:""}f=lt.getDerivedFromVars(tt.placeholder_color),W(),W=a(f,(t=>D=t)),gt=et(D,1,gt),m=lt.getDerivedFromVars(tt.scale),R(),R=a(m,(t=>j=t)),ft=at(j)||ft,y=lt.getDerivedFromVars({content_alignment_horizontal:tt.content_alignment_horizontal,content_alignment_vertical:tt.content_alignment_vertical}),L(),L=a(y,(t=>V=t)),mt=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:st(t)}(V,mt),_=lt.getDerivedFromVars(tt.accessibility),B(),B=a(_,(t=>A=t)),b=(null==A?void 0:A.description)||"",w=lt.getDerivedFromVars(tt.aspect),T(),T=a(w,(t=>E=t));{const t=null==E?void 0:E.ratio;yt=t&&St(t)?(100/Number(t)).toFixed(2):"0"}$=lt.getDerivedFromVars(tt.tint_color),J(),J=a($,(t=>F=t));{const t=F,e=t?et(t):void 0;e!==ut&&(lt.removeSvgFilter(ut),_t=e?lt.addSvgFilter(e):"",ut=e)}return x={aspect:"0"!==yt,"is-width-content":d,"is-height-content":p},k={"background-image":ht,"background-color":gt,"object-fit":ft,"object-position":mt,filter:""},C=X(k),J(),T(),B(),L(),R(),W(),q(),Z(),Y(),K(),Q(),pt?"":`${M(Vt,"Outer").$$render(t,{cls:vt("image",Wt,x),json:tt,origJson:it,templateContext:rt,layoutParams:ot,customDescription:!0},{},{default:()=>x.aspect?`<span${N("class",Wt["image__aspect-wrapper"],0)}${U({"padding-bottom":`${yt}%`})}><img${N("class",Wt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",C,0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",Wt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",X(k),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),Ht={grid:"divkit-d908",grid_halign_left:"divkit-f63b",grid_halign_center:"divkit-a14a",grid_halign_right:"divkit-b071",grid_valign_top:"divkit-fbca",grid_valign_center:"divkit-d431",grid_valign_bottom:"divkit-e420"};function Gt(t){return t>0&&t<1}function Zt(t){return String(Math.ceil(1e3*t)/1e3)}function Yt(t,e,r){if(t.some(Gt)){const e=Math.max(...t.filter(Gt).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(${K(n*t[e]/i)},${Zt(t[e])}fr)`:t[e]?o[e]=`${Zt(t[e])}fr`:o[e]="auto";return o.join(" ")}const Xt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:F}=e;const E=v(H);let A,V,j=!1,D=1,S=[],z=[],I=[],O=[],J=0,N=!1,T="top",U="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!==F&&n.layoutParams(F),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,E.logError(G(new Error('Incorrect or empty "items" prop for div "grid"')))),s=E.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Dt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=E.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=R(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],I=[],O=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},g="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,p="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,h=1===c&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,f=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.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]<g)&&(S[n]=g),(!z[e]||z[e]<p)&&(z[e]=p),(!I[n]||I[n]<h)&&(I[n]=h),(!O[e]||O[e]<f)&&(O[e]=f));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v}})})),0!==e&&(N=!0),N&&E.logError(G(new Error('Mismatching "grid" rows/columns'))),J=r}return u=E.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(u,(t=>f=t)),T=Ot(f,T),c=E.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(c,(t=>h=t)),U=It(h,U),d={valign:T,halign:U},g={"grid-template-columns":Yt(S,I,D),"grid-template-rows":Yt(z,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${M(Vt,"Outer").$$render(t,{cls:vt("grid",Ht,d),json:x,origJson:C,templateContext:k,style:g,layoutParams:F},{},{default:()=>`${P(V,(e=>`${M(Je,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Kt=Xt,Qt={gallery:"divkit-cbb0",gallery_orientation_horizontal:"divkit-c9be",gallery_orientation_vertical:"divkit-a72d",gallery__scroller:"divkit-a4e3","gallery_scroll-snap":"divkit-f606","gallery__items-grid":"divkit-eb4a",gallery__items:"divkit-af27",gallery__arrow:"divkit-b72d","gallery__arrow-icon":"divkit-d100",gallery__arrow_left:"divkit-a0a5",gallery__arrow_right:"divkit-f0f5","gallery__arrow-icon-path":"divkit-b417"};function te(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(" ")}const ee=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V=r,j=r,D=r,S=r,z=r,I=r,O=r,J=r,{json:T={}}=e,{templateContext:U}=e,{origJson:B}=e,{layoutParams:L}=e;const W=v(H);let q,Z,Y,Q=[],tt=!1,et=1,rt="horizontal",nt="start",it=8,ot="",at=[],st={},lt=!1,ut={},ct=0;function dt(){let t=[],e=Q[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<et;++e){const n=Q[e].children[r];n&&t.push(n)}return t}function gt(t,e,r="smooth"){const n="horizontal"===rt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";q.scroll({[o]:Math.max(0,t[e][i]-it/2),behavior:r})}function pt(t){const e=dt(),r=q.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===rt?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"===rt?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}T.id&&!tt&&W.registerInstance(T.id,{setCurrentItem(t){const e=dt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');gt(e,t)},setPreviousItem(t){const e=pt("prev"),r=dt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),gt(r,n)},setNextItem(t){const e="horizontal"===rt?q.scrollLeft+q.offsetWidth===q.scrollWidth:q.scrollTop+q.offsetHeight===q.scrollHeight,r=dt();if(e&&"ring"===t)return void gt(r,0);const n=pt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),gt(r,i)}}),void 0===e.json&&n.json&&void 0!==T&&n.json(T),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==B&&n.origJson(B),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),o=T.items,(null==o?void 0:o.length)&&Array.isArray(o)?tt=!1:(tt=!0,W.logError(G(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!tt&&o||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=W.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=W.getDerivedFromVars(T.column_count),J(),J=a(l,(t=>A=t)),et=Dt(A,et),u=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}(s,et),c=W.getDerivedFromVars(T.orientation),O(),O=a(c,(t=>E=t)),rt=Lt(E,rt),d=W.getDerivedFromVars(T.cross_content_alignment),I(),I=a(d,(t=>F=t)),nt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(F,nt),g=W.getDerivedFromVars(T.item_spacing),z(),z=a(g,(t=>C=t)),it=yt(C,it),Z=K(it),p=W.getDerivedFromVars(T.paddings),S(),S=a(p,(t=>k=t)),ot=mt(k,ot),h="horizontal"===rt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===rt?"width":"height";t.push(W.getDerivedFromVars(e.json[r]))})),Y=R(t,(t=>t)),D(),D=a(Y,(t=>x=t))}at=[],et>1?at.push("auto"):x.forEach((t=>{!t&&"horizontal"===rt||"match_parent"===(null==t?void 0:t.type)?at.push("100%"):at.push("max-content")})),f=W.getDerivedFromVars(T.scroll_mode),j(),j=a(f,(t=>$=t));{const t={};let e={};lt=!1,"horizontal"===rt?e.parentVAlign=nt:e.parentHAlign=nt,"paging"===$&&(lt=!0,e.scrollSnap="start",t["horizontal"===rt?"scroll-padding-left":"scroll-padding-top"]=K(it/2)),1===et&&(e.parentLayoutOrientation=rt),st=wt(t,st),ut=wt(e,ut)}return m={padding:ot,"grid-gap":Z},y={"grid-gap":Z,[h]:te(at)},_={orientation:rt,"scroll-snap":lt},b=W.getDerivedFromVars(T.default_item),V(),V=a(b,(t=>w=t)),ct=yt(w,ct),V(),j(),D(),S(),z(),I(),O(),J(),tt?"":`${M(Vt,"Outer").$$render(t,{cls:vt("gallery",Qt,_),json:T,origJson:B,templateContext:U,layoutParams:L,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===rt,forceWidth:"horizontal"===rt},{},{default:()=>`<div${N("class",Qt.gallery__scroller,0)}${N("style",X(st),0)}${N("this",q,0)}><div${N("class",Qt["gallery__items-grid"],0)}${N("style",X(m),0)}>${P(u,((e,r)=>`<div${N("class",Qt.gallery__items,0)}${N("style",X(y),0)}${N("this",Q[r],0)}>${P(e,(e=>`${M(Je,"Unknown").$$render(t,{layoutParams:ut,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===rt?"\n ":""}`})}`})),re=ee,ne={tabs:"divkit-e0df",tabs__list:"divkit-ea19",tabs__item:"divkit-c25c",tabs__item_selected:"divkit-d560",tabs__item_actionable:"divkit-dfda",tabs__panels:"divkit-f5dc",tabs__swiper:"divkit-eb42",tabs__swiper_animated:"divkit-b9f1",tabs__swiper_inited:"divkit-fa57",tabs__panel:"divkit-cc9f",tabs__panel_visible:"divkit-e730",tabs__separator:"divkit-b85b"},ie=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,b,w,$,x,k,C,F=r,E=r,A=r,V=r,D=r,S=r,z=r;var I;let{json:O={}}=e,{templateContext:J}=e,{origJson:T}=e,{layoutParams:B}=e;const L=v(H),R=L.genId("tabs");let W,q,Z,Y=!1,Q={};const tt=L.getJsonWithVars(O.selected_tab);let rt,nt,it=tt&&Number(tt)||0,ot=12,at="",st="",lt="",ut="",ct="",dt="",gt="",pt="",yt="",_t="",bt=!1,$t=!1,xt=it,kt=[],Ft=[];async function Et(t,e=!1){if(xt=it,it=t,bt||(bt=!0,q.style.height=K(q.clientHeight),Z.style.transform=`translate3d(${100*-xt}%,0,0)`),$t=!0,async function(t){await _(),Z.style.transform=`translate3d(${t}%,0,0)`}(100*-it),function(t=!1){const e=t?Math.max(0,it-1):Math.min(it,xt),r=t?Math.min(o.length-1,it+1):Math.max(it,xt);kt=kt.map(((t,n)=>t||n>=e&&n<=r)),Ft=Ft.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${R}-panel-${it}`);t&&(q.style.height=K(t.offsetHeight))}(),jt&&clearTimeout(jt),jt=window.setTimeout((()=>{Ft=o.map(((t,e)=>e===it))}),400),At=-it*q.clientWidth,e){await _();const t=W.querySelector(`.${ne.tabs__item_selected}`);t&&t.focus()}}let At,jt=null;O.id&&!Y&&L.registerInstance(O.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Et(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),Et(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),Et(e)}}),void 0===e.json&&n.json&&void 0!==O&&n.json(O),void 0===e.templateContext&&n.templateContext&&void 0!==J&&n.templateContext(J),void 0===e.origJson&&n.origJson&&void 0!==T&&n.origJson(T),void 0===e.layoutParams&&n.layoutParams&&void 0!==B&&n.layoutParams(B),o=O.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?Y=!1:(Y=!0,L.logError(G(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=L.getDerivedFromVars(O.width),z(),z=a(s,(t=>C=t)),l=L.getDerivedFromVars(O.height),S(),S=a(l,(t=>k=t));{let t={};"wrap_content"===(null==C?void 0:C.type)&&(t.parentHorizontalWrapContent=!0),k&&"wrap_content"!==k.type||(t.parentVerticalWrapContent=!0),Q=wt(t,Q)}if(!Y&&(it<0||it>=o.length)&&(L.logError(G(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:O.selected_tab,length:o.length}})),it=it<0?0:o.length-1),u=L.getDerivedFromVars(O.tab_title_style),D(),D=a(u,(t=>x=t)),c=x||{},ot=Dt(c.font_size,ot),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ot*10,right:(Number(t.right)||0)/ot*10,bottom:(Number(t.bottom)||0)/ot*10,left:(Number(t.left)||0)/ot*10};at=mt(e,at)}{const t=c.line_height;void 0!==t&&St(t)&&(st=K(t/ot*10))}{const t=c.letter_spacing;void 0!==t&&ht(t)&&(lt=K(t/ot*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(I=c.corner_radius)&&void 0!==I?I:1e3;c.corners_radius?ut=ft(c.corners_radius,t,ot,ut):ht(t)&&(ut=K(t/ot*10))}return rt=zt(c.active_font_weight||c.font_weight,rt),nt=zt(c.inactive_font_weight||c.font_weight,nt),ct=et(c.active_text_color,1,ct),dt=et(c.inactive_text_color,1,dt),gt=et(c.active_background_color,1,gt),pt=et(c.inactive_background_color,1,pt),d=L.getDerivedFromVars(O.has_separator),V(),V=a(d,(t=>$=t)),g=L.getDerivedFromVars(O.separator_color),A(),A=a(g,(t=>w=t)),p=L.getDerivedFromVars(O.separator_paddings),E(),E=a(p,(t=>b=t)),$&&(w&&(yt=et(w,1,yt)),b&&(_t=mt(b,_t))),h={background:yt,margin:_t},f=L.getDerivedFromVars(O.switch_tabs_by_content_swipe_enabled),F(),F=a(f,(t=>y=t)),m=void 0===y||Boolean(y),Y||(kt=o.map(((t,e)=>e===it)),Ft=o.map(((t,e)=>e===it))),F(),E(),A(),V(),D(),S(),z(),Y?"":`${M(Vt,"Outer").$$render(t,{cls:vt("tabs",ne,{}),json:O,origJson:T,templateContext:J,layoutParams:B,customActions:"tabs"},{},{default:()=>`<div${N("class",ne.tabs__list,0)} role="tablist"${U({"--divkit-tabs-font-size":K(ot),"--divkit-tabs-paddings":at,"--divkit-tabs-line-height":st,"--divkit-tabs-letter-spacing":lt,"--divkit-tabs-active-font-weight":rt||"","--divkit-tabs-inactive-font-weight":nt||"","--divkit-tabs-active-text-color":ct,"--divkit-tabs-inactive-text-color":dt,"--divkit-tabs-active-background-color":gt,"--divkit-tabs-inactive-background-color":pt,"--divkit-tabs-border-radius":ut})}${N("this",W,0)}>${P(o,((e,r)=>{let n=r===it;return`\n\n ${M(Ct,"Actionable").$$render(t,{cls:vt("tabs__item",ne,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action?[e.title_click_action]:[],attrs:{id:`${R}-tab-${r}`,"aria-controls":`${R}-panel-${r}`,role:"tab",tabindex:n?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:t=>function(t,e){return it===e||(Et(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${$?`<div${N("class",ne.tabs__separator,0)}${N("style",X(h),0)}></div>`:""}\n <div${N("class",ne.tabs__panels,0)}${N("this",q,0)}><div${N("class",vt("tabs__swiper",ne,{inited:bt,animated:$t}),0)}${N("this",Z,0)}>${P(o,((e,r)=>`<div${N("class",vt("tabs__panel",ne,{visible:Ft[r]}),0)} role="tabpanel" id="${j(R,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(R,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${kt[r]?`${M(Je,"Unknown").$$render(t,{div:e.div,templateContext:J,layoutParams:Q},{},{})}`:""}\n </div>`))}</div></div>`})}`})),oe=ie,ae="divkit-eb86",se="divkit-e08c";function le(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)}}le([.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]),le([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 ue=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(H);let c=new Map,g=new Set,p=!1,h=null,f=[],m=[],y=[],b=[];const w=o.div_id||o.id;w?(v(gt).registerInstance(w,{async setState(t){if($===t)return;u.setRunning("stateChange",!0),new Set(g),f.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),f=[],b.forEach((t=>{c.set(t.id,t.node.getBoundingClientRect())})),m=[],y=[],b=[];const e=i.find((e=>e.state_id===t))||null;e?($=t,x=e):u.logError(G(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(h&&h.has(t))return h.get(t);u.logError(G(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(gt,{registerInstance(t,e){h||(h=new Map),h.has(t)?u.logError(G(new Error("Duplicate state with id"),{additional:{id:t}})):h.set(t,e)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return m.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return y.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 b.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&c.has(t),registerChild(t){g.add(t)},unregisterChild(t){g.delete(t)}})):(p=!0,u.logError(G(new Error('Missing "id" prop for div "state"'))));let $,x=null;const k=u.getJsonWithVars(o.default_state_id);let C=!1;return void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(g=new Set),i=o.states||[],(null==i?void 0:i.length)?p=!1:(p=!0,u.logError(G(new Error('Empty "states" prop for div "state"')))),function(t){C||(C=!0,t.length&&(k?($=k,x=t.find((t=>t.state_id===$))||null,x||u.logError(G(new Error("Cannot find state for default_state_id"),{additional:{selectedId:$}}))):(x=t[0],$=x.state_id)))}(i),p?"":`${M(Vt,"Outer").$$render(t,{cls:"divkit-b8ef",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=x)&&void 0!==e&&e.div?`${M(Je,"Unknown").$$render(t,{div:x.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaa",0)}${N("this",undefined,0)}>${P(f,(e=>"direction"in e?`<div${N("class",ae,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(Je,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`:`<div${N("class",ae,0)}><div${N("class",se,0)}>${M(Je,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`))}</div>`}})}`})),ce={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},de=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,_,b,w,$=r,x=r,k=r,C=r,F=r;var E,A,V,j,D,S,z;let{json:I={}}=e,{templateContext:O}=e,{origJson:J}=e,{layoutParams:T}=e;const U=v(H),B=U.genId("pager");let L,R=!1,W=0,q=!1,Z="horizontal",Y="",tt="",et="";function rt(t,e="smooth"){const r="horizontal"===Z,n=L.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";L.scroll({[o]:n[i],behavior:e}),W=t}I.id&&U.registerInstance(I.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');rt(t)},setPreviousItem(t){let e=W-1;e<0&&(e="ring"===t?o.length-1:W),rt(e)},setNextItem(t){let e=W+1;e>o.length-1&&(e="ring"===t?0:W),rt(e)}}),void 0===e.json&&n.json&&void 0!==I&&n.json(I),void 0===e.templateContext&&n.templateContext&&void 0!==O&&n.templateContext(O),void 0===e.origJson&&n.origJson&&void 0!==J&&n.origJson(J),void 0===e.layoutParams&&n.layoutParams&&void 0!==T&&n.layoutParams(T),(null===(E=I.items)||void 0===E?void 0:E.length)&&Array.isArray(I.items)?R=!1:(R=!0,U.logError(G(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!R&&I.items||[]).map((t=>{let e=t,r=O;return({templateContext:r,json:e}=U.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=U.getDerivedFromVars(I.layout_mode),x(),x=a(s,(t=>y=t)),y?"percentage"!==y.type&&"fixed"!==y.type?(q=!0,U.logError(G(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):q=!1:(q=!0,U.logError(G(new Error('Empty "layout_mode" prop for div "pager"')))),l=U.getDerivedFromVars(I.orientation),F(),F=a(l,(t=>w=t)),Z=Lt(w,Z),u=U.getDerivedFromVars(I.item_spacing),C(),C=a(u,(t=>b=t));{const t=null==b?void 0:b.value;t&&ht(t)&&(Y=K(t||0))}if(c=U.getDerivedFromVars(I.paddings),k(),k=a(c,(t=>_=t)),tt=mt(_,tt),d="horizontal"===Z?"grid-auto-columns":"grid-auto-rows","fixed"===(null==y?void 0:y.type)){const t=Q("horizontal"===Z?((null===(A=I.paddings)||void 0===A?void 0:A.left)||0)+((null===(V=I.paddings)||void 0===V?void 0:V.right)||0):((null===(j=I.paddings)||void 0===j?void 0:j.top)||0)+((null===(D=I.paddings)||void 0===D?void 0:D.bottom)||0)),e=null===(S=y.neighbour_page_width)||void 0===S?void 0:S.value;et=e?`calc(100% + ${t} - 2 * ${Q(e)} - 2 * ${Y})`:"100%"}else if("percentage"===(null==y?void 0:y.type)){const t=null===(z=y.page_width)||void 0===z?void 0:z.value;et=`${Number(t)}%`}return g={"grid-gap":Y,padding:tt,[d]:et},p={orientation:Z},h=R||q,f=U.getStore("pagers"),$(),$=a(f,(t=>m=t)),function(t,e){const r=I.id;if(r){const o=new Map(m);n=f,m=o.set(r,{instId:B,size:t,currentItem:e,scrollToPagerItem:rt}),i=m,n.set(i)}var n,i}(o.length,W),$(),x(),k(),C(),F(),h?"":`${M(Vt,"Outer").$$render(t,{cls:vt("pager",ce,p),json:I,origJson:J,templateContext:O,layoutParams:T,customPaddings:!0},{},{default:()=>`<div${N("class",ce.pager__items,0)}${N("style",X(g),0)}${N("this",L,0)}>${P(o,(e=>`<div${N("class",ce.pager__item,0)}>${M(Je,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}\n </div>`))}</div>`})}`})),ve=de,ge={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},pe=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,b=r,w=r,$=r,x=r,k=r,C=r,{json:F={}}=e,{templateContext:E}=e,{origJson:A}=e,{layoutParams:V}=e;const D=v(H);let S,z,I,O=10,J=10,T=5,B="#ffdc60",L=et("#33919cb5"),R=15,q=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==E&&n.templateContext(E),void 0===e.origJson&&n.origJson&&void 0!==A&&n.origJson(A),void 0===e.layoutParams&&n.layoutParams&&void 0!==V&&n.layoutParams(V),o=D.getDerivedFromVars(F.shape),C(),C=a(o,(t=>y=t)),y&&(y.item_width&&(O=yt(y.item_width.value,O)),y.item_height&&(J=yt(y.item_height.value,J)),y.corner_radius&&(T=yt(y.corner_radius.value,T))),s=D.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),B=et(m,1,B),l=D.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>f=t)),L=et(f,1,L),u=D.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>h=t)),h&&(R=yt(h.value,R)),c=D.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>p=t)),q=Dt(p,q),d=D.getStore("pagers"),b(),b=a(d,(t=>g=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){I=t.get(F.pager_id),await _();const e=z.children[I.currentItem].offsetLeft;S.scroll({left:e-S.clientWidth/2,behavior:"smooth"})}}(g),b(),w(),$(),x(),k(),C(),`${M(Vt,"Outer").$$render(t,{cls:vt("indicator",ge,{}),json:F,origJson:A,templateContext:E,layoutParams:V},{},{default:()=>`<div${N("class",ge.indicator__scroller,0)}${N("this",S,0)}><div${N("class",ge.indicator__items,0)} role="tablist"${U({margin:`0 ${K((q-1)*O/2)}`,"--divkit-indicator-width":K(O),"--divkit-indicator-height":K(J),"--divkit-indicator-border-radius":K(T),"--divkit-indicator-active-color":B,"--divkit-indicator-inactive-color":L,"--divkit-indicator-active-scale":q,"--divkit-indicator-margin":`0 ${K((R-O)/2)}`})}${N("this",z,0)}>${I?`${P(Array(I.size),((t,e)=>{let r=e===I.currentItem;return`\n <div class="${j(vt("indicator__item",ge,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(I.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(I.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),he=pe,fe={slider:"divkit-ef4f",slider__input:"divkit-d1d6",slider__input_secondary:"divkit-c798",slider__thumb:"divkit-f345",slider__thumb_secondary:"divkit-e198","slider__tracks-wrapper":"divkit-f733","slider__tracks-inner":"divkit-ac90",slider__track:"divkit-e956","slider__active-track":"divkit-ec5b","slider__thumb-text-wrapper":"divkit-ee57","slider__thumb-text":"divkit-c4af","slider__thumb-text_secondary":"divkit-d882",slider__tick:"divkit-bd9b",slider__tick_active:"divkit-d8ce",slider__tick_inactive:"divkit-e71e"};function me(t,e){var r,n,i;if(!t||!t.shape||!t.color)return e;const o=et(t.color),a=Number((null===(r=t.shape.item_width)||void 0===r?void 0:r.value)||10),s=Number((null===(n=t.shape.item_height)||void 0===n?void 0:n.value)||10),l=Number((null===(i=t.shape.corner_radius)||void 0===i?void 0:i.value)||5);if("shape_drawable"===t.type&&"transparent"!==o&&"rounded_rectangle"===t.shape.type){var u,c;const e={},r=null!==(u=t.stroke)&&void 0!==u&&u.color?et(t.stroke.color):"",n=null!==(c=t.stroke)&&void 0!==c&&c.width?Number(t.stroke.width||1):"";return e.width=a,e.height=s,e.borderRadius=l,e.background=o,r&&n&&(e.boxShadow=`inset 0 0 0 ${K(n)} ${r}`),e}return e}function ye(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&et(t.text_color)||"#000",i=Pt(t.font_weight);if(St(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:K(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 _e(t,e,r){return Math.max(e,Math.min(r,t))}const be=2147483647,we=-2147483648,$e=Number.MAX_VALUE,xe=Number.MIN_VALUE,ke="string",Ce="integer",Fe="number",Ee="boolean",Ae="color",Ve="datetime";class je{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=L(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 De={string:class extends je{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends je{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 je{convertValue(t){if("number"!=typeof t||isNaN(t)||t>be||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 je{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 je{convertValue(t){if("string"!=typeof t||!rt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends je{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Se(t,e,r){if(!(e in De))throw new Error("Unsupported variable type");return new De[e](t,r)}function Pe(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 ze=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,z,I,O,J,T,B,L,R,W,q,Z,Y,X,tt,et,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r,ct=r,dt=r,gt=r,pt=r;var ft,mt,yt,_t,bt,wt,$t,kt;let{json:Ct={}}=e,{templateContext:Ft}=e,{origJson:Et}=e,{layoutParams:jt}=e;const Dt={width:10,height:10,borderRadius:5,background:"#000"},St=v(H),Pt=v(xt);let zt=0,Mt=100;const It=St.getJsonWithVars(Ct.thumb_value_variable),Ot=St.getJsonWithVars(Ct.thumb_secondary_value_variable);X=a(It&&St.getVariable(It,"integer")||Se("temp","integer",0),(t=>Y=t)),Z=a(Ot&&St.getVariable(Ot,"integer")||Se("temp","integer",0),(t=>q=t));let Jt,Nt,Tt,Ut=_e(Y||0,zt,Mt),Bt=_e(q||0,zt,Mt),Lt=Dt,Rt=Lt,Wt=Dt,qt=Dt,Ht=null,Gt=null,Zt=Tt,Yt="",Xt="",Kt=!1;void 0===e.json&&n.json&&void 0!==Ct&&n.json(Ct),void 0===e.templateContext&&n.templateContext&&void 0!==Ft&&n.templateContext(Ft),void 0===e.origJson&&n.origJson&&void 0!==Et&&n.origJson(Et),void 0===e.layoutParams&&n.layoutParams&&void 0!==jt&&n.layoutParams(jt),o=St.getDerivedFromVars(Ct.min_value),pt(),pt=a(o,(t=>et=t)),s=St.getDerivedFromVars(Ct.max_value),gt(),gt=a(s,(t=>tt=t)),zt=At(et,zt),Mt=At(tt,Mt);{const t=_e(Y||0,zt,Mt);t!==Ut&&(Ut=t)}{const t=_e(q||0,zt,Mt);t!==Bt&&(Bt=t)}if(l=St.getDerivedFromVars(Ct.thumb_style),dt(),dt=a(l,(t=>W=t)),Lt=me(W,Lt),u=St.getDerivedFromVars(Ct.thumb_secondary_style),ct(),ct=a(u,(t=>R=t)),Rt=me(R,Lt),c=St.getDerivedFromVars(Ct.track_inactive_style),ut(),ut=a(c,(t=>L=t)),Wt=me(L,Wt),d=St.getDerivedFromVars(Ct.track_active_style),lt(),lt=a(d,(t=>B=t)),qt=me(B,qt),g=Mt-zt+1<=20,p=St.getDerivedFromVars(Ct.tick_mark_active_style),st(),st=a(p,(t=>T=t)),g){let t=me(T,Dt);t!==Dt&&(Ht=t)}else Ht=null;if(Jt=Ht?Ot?Pe(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!0):Pe(zt,Ut,zt,Mt,!0):[],h=St.getDerivedFromVars(Ct.tick_mark_inactive_style),at(),at=a(h,(t=>J=t)),g){let t=me(J,Dt);t!==Dt&&(Gt=t)}else Gt=null;Nt=Gt?Ot?Pe(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!1):Pe(Ut+1,Mt+1,zt,Mt,!0):[],f=St.getDerivedFromVars(Ct.thumb_text_style),ot(),ot=a(f,(t=>O=t)),Tt=ye(O,Tt),m=St.getDerivedFromVars(Ct.thumb_secondary_text_style),it(),it=a(m,(t=>I=t)),Zt=ye(I,Tt),y=St.getDerivedFromVars(Ct.accessibility),nt(),nt=a(y,(t=>z=t)),(null==z?void 0:z.description)?Yt=z.description:St.logError(G(new Error('Missing accessibility "description" for slider'),{level:"warn"})),_=St.getDerivedFromVars(Ct.secondary_value_accessibility),rt(),rt=a(_,(t=>S=t)),(null==S?void 0:S.description)?Xt=S.description:Ot&&St.logError(G(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Pt.hasAction()?(St.logError(G(new Error('Cannot show "slider" inside component with action'))),t=!0):Lt===Dt?(St.logError(G(new Error('Missing "thumb_style" in slider'))),t=!0):qt===Dt?(St.logError(G(new Error('Missing "track_active_style" in slider'))),t=!0):Wt===Dt&&(St.logError(G(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Kt&&(Kt=t)}return b=Math.max(...[Lt.height,Rt.height,Wt.height,qt.height,0].filter(ht)),w=K(Math.max(...[Lt.width,Rt.width,0].filter(ht))),$=K(Math.max(...[Lt.height,Rt.height,0].filter(ht))),x=(Ut-zt)/(Mt-zt),k=Ot?(Bt-zt)/(Mt-zt):void 0,C=void 0!==k?Math.abs(k-x):x,F=void 0!==k?Math.min(k,x):0,E=-Math.min(...[(b-Lt.height)/2+((null===(ft=null==Tt?void 0:Tt.offset)||void 0===ft?void 0:ft.y)||0),Ot?(b-Rt.height)/2+((null===(mt=null==Zt?void 0:Zt.offset)||void 0===mt?void 0:mt.y)||0):0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),A=Math.max(...[((null===(yt=null==Tt?void 0:Tt.offset)||void 0===yt?void 0:yt.y)||0)-(b-Lt.height)/2,Ot?((null===(_t=null==Zt?void 0:Zt.offset)||void 0===_t?void 0:_t.y)||0)-(b-Rt.height)/2:0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),V={"--divkit-slider-thumb-width":K(Lt.width),"--divkit-slider-thumb-height":K(Lt.height),"--divkit-slider-thumb-secondary-width":K(Rt.width),"--divkit-slider-thumb-secondary-height":K(Rt.height),"--divkit-slider-text-offset-x":(null===(bt=null==Tt?void 0:Tt.offset)||void 0===bt?void 0:bt.x)?Q(Tt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(wt=null==Tt?void 0:Tt.offset)||void 0===wt?void 0:wt.y)?Q(Tt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===($t=null==Zt?void 0:Zt.offset)||void 0===$t?void 0:$t.x)?Q(Zt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(kt=null==Zt?void 0:Zt.offset)||void 0===kt?void 0:kt.y)?Q(Zt.offset.y):void 0,"--divkit-slider-tick-active-width":Ht?K(Ht.width):void 0,"--divkit-slider-tick-active-height":Ht?K(Ht.height):void 0,"--divkit-slider-tick-active-border-radius":Ht?K(Ht.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Ht?void 0:Ht.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Ht?void 0:Ht.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Gt?K(Gt.width):void 0,"--divkit-slider-tick-inactive-height":Gt?K(Gt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Gt?K(Gt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Gt?void 0:Gt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Gt?void 0:Gt.boxShadow)||void 0,"--divkit-slider-max-height":K(b),"--divkit-slider-max-thumb-width":w,"--divkit-slider-max-thumb-height":$,"--divkit-slider-track-part":x,"--divkit-slider-track-secondary-part":k,"--divkit-slider-offset-top":Q(E),"--divkit-slider-offset-bottom":Q(A)},D={},rt(),nt(),it(),ot(),at(),st(),lt(),ut(),ct(),dt(),Z(),X(),gt(),pt(),Kt?"":`${M(Vt,"Outer").$$render(t,{cls:vt("slider",fe,D),style:V,customDescription:!0,customActions:"slider",json:Ct,origJson:Et,templateContext:Ft,layoutParams:jt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",fe["slider__tracks-wrapper"],0)}>${Tt||Ot&&Zt?`<div${N("class",fe["slider__thumb-text-wrapper"],0)} aria-hidden="true">${Tt?`<div${N("class",fe["slider__thumb-text"],0)}><div${N("class",fe["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Tt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Tt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Tt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Ut)}</div></div>`:""}\n ${Ot?`<div class="${j(fe["slider__thumb-text"],!0)+" "+j(fe["slider__thumb-text_secondary"],!0)}"><div${N("class",fe["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Zt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Zt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Zt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Bt)}</div></div>`:""}</div>`:""}\n <div${N("class",fe["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",fe.slider__track,0)}${U({height:K(Wt.height),"border-radius":K(Wt.borderRadius),background:Wt.background,"box-shadow":Wt.boxShadow||""})}></div>\n <div${N("class",fe["slider__active-track"],0)}${U({left:(100*F).toFixed(2)+"%",width:(100*C).toFixed(2)+"%",height:K(qt.height),"border-radius":K(qt.borderRadius),background:qt.background,"box-shadow":qt.boxShadow||""})}></div>\n ${P(Jt,(t=>`<div class="${j(fe.slider__tick,!0)+" "+j(fe.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Nt,(t=>`<div class="${j(fe.slider__tick,!0)+" "+j(fe.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",fe.slider__thumb,0)}${U({"border-radius":K(Lt.borderRadius),background:Lt.background,"box-shadow":Lt.boxShadow||""})}></div>\n ${Ot?`<div class="${j(fe.slider__thumb,!0)+" "+j(fe.slider__thumb_secondary,!0)}"${U({"border-radius":K(Rt.borderRadius),background:Rt.background,"box-shadow":Rt.boxShadow||""})}></div>`:""}\n <input type="range"${N("class",fe.slider__input,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Ut,0)}${N("aria-label",Yt,0)}>\n ${Ot?`<input type="range"${N("class",`${fe.slider__input} ${fe.slider__input_secondary}`,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Bt,0)}${N("aria-label",Xt,0)}>`:""}</div></div>`}})}`})),Me={input:"divkit-c3a4",input__wrapper:"divkit-ef7e",input__holder:"divkit-bb3d",input_multiline:"divkit-e48a",input__input:"divkit-f11e","input_highlight-color":"divkit-cc00","input_vertical-overflow":"divkit-b707"},Ie={text:Nt,container:Ut,separator:Rt,image:qt,gif:qt,grid:Kt,gallery:re,tabs:oe,state:ue,pager:ve,indicator:he,slider:ze,input:J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,P,z,I,O,J,T,U,B=r,L=r,{json:R={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:Z}=e;const Y=v(H);let X;const tt=Y.getJsonWithVars(R.text_variable);let rt=!1;tt||(rt=!0,Y.logError(G(new Error('Missing "text_variable" in "input"')))),J=a(tt&&Y.getVariable(tt,"string")||Se("temp","string",""),(t=>O=t));let nt="";I=a(Y.getDerivedFromVars(R.hint_text),(t=>z=t)),P=a(Y.getDerivedFromVars(R.hint_color),(t=>S=t));let it="";D=a(Y.getDerivedFromVars(R.font_size),(t=>V=t));let ot,at,st=12;A=a(Y.getDerivedFromVars(R.font_weight),(t=>E=t)),F=a(Y.getDerivedFromVars(R.line_height),(t=>C=t)),k=a(Y.getDerivedFromVars(R.letter_spacing),(t=>x=t));let lt="";$=a(Y.getDerivedFromVars(R.text_color),(t=>w=t));let ut="#000";b=a(Y.getDerivedFromVars(R.highlight_color),(t=>_=t));let ct="";y=a(Y.getDerivedFromVars(R.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let gt="multi_line_text",ht="text";f=a(Y.getDerivedFromVars(R.max_visible_lines),(t=>h=t));let ft="",mt="";U=a(Y.getDerivedFromVars(R.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==Z&&n.layoutParams(Z),nt=O,o=z,it=et(S,1,it),st=Dt(V,st),ot=zt(E,ot);{const t=C;St(t)&&(at=t/st)}return pt(x)&&(lt=K(x/st*10)),ut=et(w,1,ut),ct=et(_,1,ct),m&&m in dt&&(ht=dt[m],gt=m),s="multi_line_text"===gt,l=Y.getDerivedFromVars(R.paddings),L(),L=a(l,(t=>p=t)),St(h)&&(ft=`calc(${h*(at||1.25)+"em"} + ${Q(yt(null==p?void 0:p.top,0)+yt(null==p?void 0:p.bottom,0))})`),u=Y.getDerivedFromVars(R.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?mt=g.description:Y.logError(G(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ct,"font-size":K(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":ft},B(),L(),f(),y(),b(),$(),k(),F(),A(),D(),P(),I(),J(),U(),rt?"":`${M(Vt,"Outer").$$render(t,{cls:vt("input",Me,c),style:d,customDescription:!0,customActions:"input",json:R,origJson:q,templateContext:W,layoutParams:Z},{},{default:()=>`<span${N("class",Me.input__wrapper,0)}><span${N("class",Me.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",Me.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",X,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",ht,0)}${N("class",Me.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",X,0)}>`}</span>`})}`}))},Oe=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(H);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!==s&&r.layoutParams(s),u=i,c=o,d=u&&Ie[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&Ie[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(G(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),Je=Oe,Ne=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-dc22",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>`<filter${N("id",i[t],0)}><feFlood${N("flood-color",t,0)}></feFlood><feComposite in2="SourceGraphic" operator="in"></feComposite></filter>`))}</defs></svg>`:""}));function Te(t,e,r,n){const i=r[t.type];if(!i)return n(G(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),l.forEach((e=>{const o=i[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else n(G(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)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Ue(){}function Be(t){return{subscribe:e=>(e(t),Ue)}}function Le(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Re(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function We(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 qe(t){var e=parseInt(t,10);if(e>be||e<we)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function He(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Ge(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Ge.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Ze(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Ye(t,e){var r,n,i,o,a={},s=(e=void 0!==e?e:{}).grammarSource,l={start:St,JsonStringContents:function(){var t,e,r;for(t=_t,e=[],r=Pt();r!==a;)e.push(r),r=Pt();return bt=t,e=yt(e)}},u=St,c="@{",d="}",v="@{}",g="\\",p="||",h="&&",f="==",m="!=",y=">=",_="<=",b="+",w="-",$="true",x="false",k=/^[^}]/,C=/^[^'}]/,F=/^[0-9]/,E=/^[a-zA-Z_0-9.]/,A=/^[a-zA-Z_]/,V=/^[ \t\r\n]/,j=Ft("@{",!1),D=Ft("}",!1),S=Ft("@{}",!1),P=Ft("\\",!1),z={type:"any"},M=Et(["}"],!0,!1),I=Ft("?",!1),O=Ft(":",!1),J=Ft("||",!1),N=Ft("&&",!1),T=Ft("==",!1),U=Ft("!=",!1),B=Ft(">=",!1),L=Ft(">",!1),R=Ft("<=",!1),W=Ft("<",!1),q=Ft("+",!1),H=Ft("-",!1),G=Ft("/",!1),Z=Ft("*",!1),Y=Ft("%",!1),X=Ft("!",!1),K=Ft("(",!1),Q=Ft(")",!1),tt=Ft(",",!1),et=At("string"),rt=Ft("'",!1),nt=Et(["'","}"],!0,!1),it=At("integer"),ot=Et([["0","9"]],!1,!1),at=At("number"),st=Ft(".",!1),lt=Ft("e",!1),ut=Ft("E",!1),ct=At("boolean"),dt=Ft("true",!1),vt=Ft("false",!1),gt=Et([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),pt=At("identifier"),ht=Et([["a","z"],["A","Z"],"_"],!1,!1),ft=At("whitespace"),mt=Et([" ","\t","\r","\n"],!1,!1),yt=function(t){return We(t)},_t=0,bt=0,wt=[{line:1,column:1}],$t=0,xt=[],kt=0;if("startRule"in e){if(!(e.startRule in l))throw new Error("Can't start parsing from rule \""+e.startRule+'".');u=l[e.startRule]}function Ct(){return t.substring(bt,_t)}function Ft(t,e){return{type:"literal",text:t,ignoreCase:e}}function Et(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){return{type:"other",description:t}}function Vt(e){var r,n=wt[e];if(n)return n;for(r=e-1;!wt[r];)r--;for(n={line:(n=wt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return wt[e]=n,n}function jt(t,e){var r=Vt(t),n=Vt(e);return{source:s,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Dt(t){_t<$t||(_t>$t&&($t=_t,xt=[]),xt.push(t))}function St(){var t,e;return t=_t,qt(),(e=zt())!==a?(qt(),bt=t,t=e):(_t=t,t=a),t}function Pt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M)),i!==a)for(;i!==a;)n.push(i),k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=He(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function zt(){var e,r,n,i,o,s;return e=_t,(r=Mt())!==a?(qt(),63===t.charCodeAt(_t)?(n="?",_t++):(n=a,0===kt&&Dt(I)),n!==a?(qt(),(i=zt())!==a?(qt(),58===t.charCodeAt(_t)?(o=":",_t++):(o=a,0===kt&&Dt(O)),o!==a?(qt(),(s=zt())!==a?(bt=e,e={type:"ConditionalExpression",test:r,consequent:i,alternate:s}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=Mt()),e}function Mt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=It())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(u=It())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(u=It())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Re(r,n)}else _t=e,e=a;return e}function It(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Ot())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(u=Ot())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(u=Ot())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Re(r,n)}else _t=e,e=a;return e}function Ot(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Jt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(u=Jt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(u=Jt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Le(r,n)}else _t=e,e=a;return e}function Jt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Nt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(u=Nt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(u=Nt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Le(r,n)}else _t=e,e=a;return e}function Nt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Tt())!==a){for(n=[],i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(u=Tt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(u=Tt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Le(r,n)}else _t=e,e=a;return e}function Tt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Ut())!==a){for(n=[],i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(u=Ut())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(u=Ut())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Le(r,n)}else _t=e,e=a;return e}function Ut(){var e,r,n;return(e=Rt())===a&&(e=Lt())===a&&(e=_t,33===t.charCodeAt(_t)?(r="!",_t++):(r=a,0===kt&&Dt(X)),r===a&&(43===t.charCodeAt(_t)?(r=b,_t++):(r=a,0===kt&&Dt(q)),r===a&&(45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)))),r!==a?(qt(),(n=Ut())!==a?(bt=e,e={type:"UnaryExpression",operator:r,argument:n}):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=function(){var e,r,n,i,o;return e=_t,(r=Wt())!==a?(qt(),40===t.charCodeAt(_t)?(n="(",_t++):(n=a,0===kt&&Dt(K)),n!==a?(qt(),i=function(){var e,r,n,i,o,s,l;if(e=_t,(r=zt())!==a){for(n=[],i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);bt=e,l=n,e=[r,...l]}else _t=e,e=a;return e===a&&(e=qt()),e}(),i!==a?(qt(),41===t.charCodeAt(_t)?(o=")",_t++):(o=a,0===kt&&Dt(Q)),o!==a?(bt=e,e={type:"CallExpression",callee:r,arguments:i}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,(r=Wt())!==a&&(bt=e,r={type:"Variable",id:r}),(e=r)===a&&(e=function(){var e,r,n,i;return e=function(){var e,r,n,i;return kt++,e=_t,39===t.charCodeAt(_t)?(r="'",_t++):(r=a,0===kt&&Dt(rt)),r!==a?(n=function(){var t,e,r;for(t=_t,e=[],r=Bt();r!==a;)e.push(r),r=Bt();return bt=t,e=We(e)}(),39===t.charCodeAt(_t)?(i="'",_t++):(i=a,0===kt&&Dt(rt)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(et)),e}(),e===a&&(e=Rt())===a&&(e=Lt())===a&&(e=function(){var e,r;return kt++,e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===a&&(e=_t,t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!1}),e=r),kt--,e===a&&(r=a,0===kt&&Dt(ct)),e}(),e===a&&(e=_t,40===t.charCodeAt(_t)?(r="(",_t++):(r=a,0===kt&&Dt(K)),r!==a&&(n=zt())!==a?(41===t.charCodeAt(_t)?(i=")",_t++):(i=a,0===kt&&Dt(Q)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a))),e}())),e}())),e}function Bt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(39===t.charCodeAt(_t)?(n="'",_t++):(n=a,0===kt&&Dt(rt)),n===a&&(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=He(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Lt(){var e,r,n,i;if(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;return n!==a?(bt=e,e={type:"IntegerLiteral",value:qe(Ct())}):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(it)),e}function Rt(){var e,r,n,i,o,s,l,u,c,d;for(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));if(46===t.charCodeAt(_t)?(i=".",_t++):(i=a,0===kt&&Dt(st)),i!==a){if(o=[],F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot)),s!==a)for(;s!==a;)o.push(s),F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot));else o=a;if(o!==a){if(s=_t,101===t.charCodeAt(_t)?(l="e",_t++):(l=a,0===kt&&Dt(lt)),l===a&&(69===t.charCodeAt(_t)?(l="E",_t++):(l=a,0===kt&&Dt(ut))),l!==a){if(43===t.charCodeAt(_t)?(u=b,_t++):(u=a,0===kt&&Dt(q)),u===a&&(45===t.charCodeAt(_t)?(u=w,_t++):(u=a,0===kt&&Dt(H))),u===a&&(u=null),c=[],F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot)),d!==a)for(;d!==a;)c.push(d),F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot));else c=a;c!==a?s=l=[l,u,c]:(_t=s,s=a)}else _t=s,s=a;s===a&&(s=null),bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}}else _t=e,e=a}else _t=e,e=a;if(e===a){if(e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;if(n!==a)if(101===t.charCodeAt(_t)?(i="e",_t++):(i=a,0===kt&&Dt(lt)),i===a&&(69===t.charCodeAt(_t)?(i="E",_t++):(i=a,0===kt&&Dt(ut))),i!==a){if(43===t.charCodeAt(_t)?(o=b,_t++):(o=a,0===kt&&Dt(q)),o===a&&(45===t.charCodeAt(_t)?(o=w,_t++):(o=a,0===kt&&Dt(H))),o===a&&(o=null),s=[],F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot)),l!==a)for(;l!==a;)s.push(l),F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot));else s=a;s!==a?(bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}):(_t=e,e=a)}else _t=e,e=a;else _t=e,e=a}return kt--,e===a&&(r=a,0===kt&&Dt(at)),e}function Wt(){var e,r,n,i,o;if(kt++,e=_t,r=_t,kt++,n=function(){var e,r,n,i;return e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r===a&&(t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt))),r!==a?(n=_t,kt++,E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(gt)),kt--,i===a?n=void 0:(_t=n,n=a),n!==a?e=r=[r,n]:(_t=e,e=a)):(_t=e,e=a),e}(),kt--,n===a?r=void 0:(_t=r,r=a),r!==a)if(A.test(t.charAt(_t))?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(ht)),n!==a){for(i=[],E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));o!==a;)i.push(o),E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));bt=e,e={type:"Identifier",name:Ct()}}else _t=e,e=a;else _t=e,e=a;return kt--,e===a&&(r=a,0===kt&&Dt(pt)),e}function qt(){var e,r;for(kt++,e=[],V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));r!==a;)e.push(r),V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));return kt--,r=a,0===kt&&Dt(ft),e}if((r=u())!==a&&_t===t.length)return r;throw r!==a&&_t<t.length&&Dt({type:"end"}),n=xt,i=$t<t.length?t.charAt($t):null,o=$t<t.length?jt($t,$t+1):jt($t,$t),new Ge(Ge.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Ge,Error),Ge.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,s=Ze("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+Ze("",i.column-1," ")+Ze("",u,"^")}else e+="\n at "+o}return e},Ge.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 Xe=new Map,Ke=new Map;function Qe(t,e,r){const n={args:e,cb:r},i=Xe.get(t)||[];Xe.has(t)||Xe.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Ke.set(o,n)}function tr(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 er(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=>{er(t,e)}));break;case"BinaryExpression":case"LogicalExpression":er(t.left,e),er(t.right,e);break;case"UnaryExpression":er(t.argument,e);break;case"ConditionalExpression":er(t.test,e),er(t.consequent,e),er(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{er(t,e)}))}}function rr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function nr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function ir(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 nr(t.value);if("color"===t.type)return gr(vr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function or(t){let e=ir(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function ar(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const sr=new Int32Array(1);function lr(t){return sr[0]=t,sr[0]}function ur(t){if(t<we||t>be)throw new Error("Integer overflow.")}function cr(t){const e=[];return er(t,{Variable(t){e.push(t.id.name)}}),e}function dr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function vr(t){const e=rt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function gr(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 tt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function pr(t){return{type:ke,value:ir(t)}}function hr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Fe,value:e}}function fr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ce&&(r=lr(r)),{type:t.type,value:r}}function mr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ce&&(r=lr(r)),{type:t.type,value:r}}function yr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Ce&&(e=lr(e));return{type:t[0].type,value:e}}function _r(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ce&&(e=lr(e));return{type:t.length?t[0].type:Ce,value:e}}function br(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ce&&(e=lr(e));return{type:t.length?t[0].type:Ce,value:e}}function wr(t){const e=Math.abs(t.value);return t.type===Ce&&ur(e),{type:t.type,value:e}}function $r(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function xr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function kr(t){return{type:t.type,value:Math.sign(t.value)}}function Cr(t,e){let r;if(0===e.value&&t.type===Ce)r=t.value;else if(0===t.value&&t.type===Ce)r=0;else{let n=Math.sign(e.value);t.type===Fe&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ce&&ur(r),{type:t.type,value:r}}function Fr(t){return e=>{const r=vr(e.value);return{type:Fe,value:r[t]/255}}}function Er(t){return(e,r)=>{const n=vr(e.value);return n[t]=255*r.value,{type:e.type,value:gr(n)}}}const Ar=Fr("a"),Vr=Fr("r"),jr=Fr("g"),Dr=Fr("b"),Sr=Er("a"),Pr=Er("r"),zr=Er("g"),Mr=Er("b");function Ir(t){return t.map(or).join(", ")}Qe("toString",[Ce],pr),Qe("toString",[Fe],pr),Qe("toString",[Ee],pr),Qe("toString",[Ae],pr),Qe("toString",["url"],pr),Qe("toNumber",[Ce],hr),Qe("toNumber",[ke],hr),Qe("toInteger",[Fe],(function(t){if(t.value>be||t.value<we)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ce,value:e}})),Qe("toInteger",[ke],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>be||e<we)throw new Error("Unable to convert value to Integer.");return{type:Ce,value:e}})),Qe("toInteger",[Ee],(function(t){return{type:Ce,value:t.value?1:0}})),Qe("toBoolean",[Ce],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ee,value:t.value}})),Qe("toBoolean",[ke],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ee,value:"true"===t.value?1:0}})),Qe("encodeUri",[ke],(function(t){try{return{type:ke,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Qe("decodeUri",[ke],(function(t){try{return{type:ke,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Qe("parseUnixTime",[Ce],(function(t){return{type:Ve,value:new Date(1e3*t.value)}})),Qe("nowLocal",[],(function(){return{type:Ve,value:new Date}})),Qe("addMillis",[Ve,Ce],(function(t,e){return{type:Ve,value:new Date(t.value.getTime()+e.value)}})),Qe("setYear",[Ve,Ce],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ve,value:r}})),Qe("setMonth",[Ve,Ce],(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:Ve,value:r}})),Qe("setDay",[Ve,Ce],(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 ${ir(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Ve,value:r}})),Qe("setHours",[Ve,Ce],(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:Ve,value:r}})),Qe("setMinutes",[Ve,Ce],(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:Ve,value:r}})),Qe("setSeconds",[Ve,Ce],(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:Ve,value:r}})),Qe("setMillis",[Ve,Ce],(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:Ve,value:r}})),Qe("len",[ke],(function(t){return{type:Ce,value:t.value.length}})),Qe("contains",[ke,ke],(function(t,e){return{type:Ee,value:t.value.includes(e.value)?1:0}})),Qe("substring",[ke,Ce,Ce],(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:ke,value:t.value.substring(e.value,r.value)}})),Qe("replaceAll",[ke,ke,ke],(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:ke,value:n}})),Qe("index",[ke,ke],(function(t,e){return{type:Ce,value:t.value.indexOf(e.value)}})),Qe("lastIndex",[ke,ke],(function(t,e){return{type:Ce,value:t.value.lastIndexOf(e.value)}})),Qe("trim",[ke],(function(t){return{type:ke,value:t.value.trim()}})),Qe("trimLeft",[ke],(function(t){return{type:ke,value:t.value.replace(/^\s+/,"")}})),Qe("trimRight",[ke],(function(t){return{type:ke,value:t.value.replace(/\s+$/,"")}})),Qe("toUpperCase",[ke],(function(t){return{type:ke,value:t.value.toUpperCase()}})),Qe("toLowerCase",[ke],(function(t){return{type:ke,value:t.value.toLowerCase()}})),Qe("div",[Ce,Ce],fr),Qe("div",[Fe,Fe],fr),Qe("mod",[Ce,Ce],mr),Qe("mod",[Fe,Fe],mr),Qe("mul",[{type:Ce,isVararg:!0}],yr),Qe("mul",[{type:Fe,isVararg:!0}],yr),Qe("sub",[{type:Ce,isVararg:!0}],_r),Qe("sub",[{type:Fe,isVararg:!0}],_r),Qe("sum",[{type:Ce,isVararg:!0}],br),Qe("sum",[{type:Fe,isVararg:!0}],br),Qe("abs",[Ce],wr),Qe("abs",[Fe],wr),Qe("max",[{type:Ce,isVararg:!0}],$r),Qe("max",[{type:Fe,isVararg:!0}],$r),Qe("min",[{type:Ce,isVararg:!0}],xr),Qe("min",[{type:Fe,isVararg:!0}],xr),Qe("maxNumber",[],(function(){return{type:Fe,value:$e}})),Qe("minNumber",[],(function(){return{type:Fe,value:xe}})),Qe("maxInteger",[],(function(){return{type:Ce,value:be}})),Qe("minInteger",[],(function(){return{type:Ce,value:we}})),Qe("round",[Fe],(function(t){const e=Math.sign(t.value);return{type:Fe,value:e*Math.round(Math.abs(t.value))}})),Qe("floor",[Fe],(function(t){return{type:Fe,value:Math.floor(t.value)}})),Qe("ceil",[Fe],(function(t){return{type:Fe,value:Math.ceil(t.value)}})),Qe("signum",[Fe],kr),Qe("signum",[Ce],kr),Qe("copySign",[Fe,Fe],Cr),Qe("copySign",[Ce,Ce],Cr),Qe("getColorAlpha",[ke],Ar),Qe("getColorAlpha",[Ae],Ar),Qe("getColorRed",[ke],Vr),Qe("getColorRed",[Ae],Vr),Qe("getColorGreen",[ke],jr),Qe("getColorGreen",[Ae],jr),Qe("getColorBlue",[ke],Dr),Qe("getColorBlue",[Ae],Dr),Qe("setColorAlpha",[ke,Fe],Sr),Qe("setColorAlpha",[Ae,Fe],Sr),Qe("setColorRed",[ke,Fe],Pr),Qe("setColorRed",[Ae,Fe],Pr),Qe("setColorGreen",[ke,Fe],zr),Qe("setColorGreen",[Ae,Fe],zr),Qe("setColorBlue",[ke,Fe],Mr),Qe("setColorBlue",[Ae,Fe],Mr),Qe("rgb",[Fe,Fe,Fe],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:ke,value:gr(n)}})),Qe("argb",[Fe,Fe,Fe,Fe],(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:gr(i)}}));const Or={StringLiteral:function(t,e){return{type:ke,value:e.value}},NumberLiteral:function(t,e){return{type:Fe,value:e.value}},IntegerLiteral:function(t,e){return{type:Ce,value:e.value}},BooleanLiteral:function(t,e){return{type:Ee,value:e.value?1:0}},UnaryExpression:function(t,e){const r=rr(Jr(t,e.argument));switch(e.operator){case"!":if(r.type===Ee)return{type:Ee,value:r.value?0:1};dr(`${e.operator}${or(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ce)return{type:Ce,value:r.value*t};if(r.type===Fe)return{type:Fe,value:r.value*t};dr(`${e.operator}${or(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=rr(Jr(t,e.test));if(r.type===Ee)return r.value?Jr(t,e.consequent):Jr(t,e.alternate);dr(`${or(r)} ? ${or(Jr(t,e.consequent))} : ${or(Jr(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 Jr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=ir(Jr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:ke,value:r}},LogicalExpression:function(t,e){const r=rr(Jr(t,e.left));if(r.type!==Ee&&dr(`${or(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ee,value:0};const n=rr(Jr(t,e.right));return n.type!==Ee&&dr(`${or(r)} ${e.operator} ${or(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${ar(n.type)}.`),{type:Ee,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Jr(t,e.left),i=Jr(t,e.right);if(n.type!==i.type&&dr(`${or(n)} ${e.operator} ${or(i)}`,`Operator '${r}' cannot be applied to different types: ${ar(n.type)} and ${ar(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ve&&r.type===Ve?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ee,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Fe&&e.type!==Ce&&e.type!==Ve&&dr(`${or(e)} ${t} ${or(r)}`,`Operator '${t}' cannot be applied to ${ar(e.type)} type.`);const i=e.type===Ve?e.value.getTime():e.value,o=r.type===Ve?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ee,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==ke&&e.type!==Fe&&e.type!==Ce&&dr(`${or(e)} ${t} ${or(r)}`,`Operator '${t}' cannot be applied to ${ar(e.type)} type.`),e.type===ke)return"-"===t&&dr(`${or(e)} - ${or(r)}`,`Operator '${t}' cannot be applied to ${ar(e.type)} type.`),{type:ke,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ce&&(n=lr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ce&&e.type!==Fe&&dr(`${or(e)} ${t} ${or(r)}`,`Operator '${t}' cannot be applied to ${ar(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&dr(`${or(e)} ${t} ${or(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ce&&(n=lr(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(!Xe.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Jr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(Ke.has(o))n=Ke.get(o);else{const t=function(t,e){const r=Xe.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=tr(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=>ar(t.type))).join(", "),n=`${r}(${Ir(i)})`;"few"===t.type&&0===i.length?dr(n,`Non empty argument list is required for function '${r}'.`):(t.type,dr(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){dr(`${r}(${Ir(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 Jr(t,e){if(e.type in Or)return Or[e.type](t,e);throw new Error("Unsupported expression")}function Nr(t,e){try{return Jr(t,e)}catch(t){return{type:"error",value:t.message}}}const Tr=/(?:[^\\]|^)@{.+}/i;class Ur{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return er(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Nr(t,this.ast);if("error"===r.type)return void e(G(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;return n instanceof Date?nr(n):n}catch(t){return void e(G(new Error("Expression execution error")))}}}function Br(t,e,r){if(t)if("string"==typeof t){if(n=t,Tr.test(n))try{const r=Ye(t,{startRule:"JsonStringContents"}),n=cr(r);return e.push(...n),new Ur(r)}catch(e){return void r(G(new Error("Unable to parse expression"),{additional:{expression:t}}))}}else{if(Array.isArray(t))return t.map((t=>Br(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Br(t[i],e,r);return n}}var n;return t}function Lr(t,e,r){if(t){if(t instanceof Ur)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Lr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Lr(t[i],e,r);return n}}return t}function Rr(t,e){let r=[];const n=Br(t,r,e);return r=[...new Set(r)],{vars:r,applyVars:t=>Lr(n,t,e)}}const Wr={pagers:function(){return L(new Map)}},qr=new Map,Hr=new Map;function Gr(t){const e=qr.get(t)||L("");return qr.has(t)||qr.set(t,e),e}function Zr(t){const e=Hr.get(t)||new Map;return Hr.has(t)||Hr.set(t,e),e}class Yr{setVariable(t){const e=t.getName(),r=Zr(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Gr(this).set(e)}getVariable(t){return Zr(this).get(t)}}function Xr(){return new Yr}const Kr=J(((t,e,r,n)=>{var i,o,a,s,l;let{id:u}=e,{json:c={}}=e,{platform:v="auto"}=e,{theme:g="system"}=e,{globalVariablesController:p=new Yr}=e,{onError:h}=e,{onStat:f}=e,{onCustomAction:m}=e,{onComponent:y}=e,_="desktop"===v;if("auto"===v&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");_=!t.matches,t.addListener((()=>{_=!t.matches}))}let b="light";if("light"===g||"dark"===g)b=g;else if("system"===g)if("undefined"!=typeof matchMedia){const t=matchMedia("(prefers-color-scheme: dark)");b=t.matches?"dark":"light",t.addListener((()=>{b=t.matches?"dark":"light",K&&K[b].forEach((t=>{const e=A.get(t.name);e&&e.setValue(t.color)}))}))}else b="light";else z(G(new Error("Unsupported theme")));let w=!1;c||(w=!0,z(G(new Error('"json" prop is required')))),u||(w=!0,z(G(new Error('"id" prop is required'))));let $=function(t){if(!t)return G(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return G(new Error("Missing card"));if(!e.states||!e.states.length)return G(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Ie)return G(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t)if(!e.states[t].div)return G(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});return null}(c);const x=c.templates||{};$&&(w=!0,z($));const k={stateChange:!1},C=Gr(p),F=Zr(p),E=new Map,A=new Map,V=new Map;function D(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=A.get(t);r&&r.setValue(e)}}function S(t){const e=A.get(t);return null==e?void 0:e.getValue()}function P(t){const e=Rr(t,z);return e.vars.length?e.applyVars(A):t}function z(t){h?h({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}let I=0;function O(t){return`${u}-${I++}`}let J={},N={};function T(t){const e=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=t.split("/");const r=e.shift()||"";if(e=[r,"root","0",...e],e.length<5||e.length%2!=1)throw new Error("Incorrect state id format");let n=Z;for(let t=1;t<e.length;t+=2){const r=e[t],i=e[t+1];let o=n.getChild(r);if(!o)return;o.setState(i),n=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=B(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=B(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=B(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=A.get(r);t?t.set(i):z(G(new Error("Cannot find variable"),{additional:{name:r}}))}else z(G(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:z(G(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){z(G(t,{additional:{url:e}}))}}const U=new Map;function B(t){if(U.has(t))return U.get(t);z(G(new Error("Missing instance with id"),{additional:{id:t}}))}const W=new Map;function q(t){for(const e of t)A.has(e)&&t.delete(e);return t}d(H,{logError:z,logStat:function(t,e){f&&f({type:t,action:e})},hasTemplate:function(t){return t in x},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in x;){if(({json:t,templateContext:e}=Te(t,e,x,z)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:O,genClass:function(t){return`divkit-${O()}`},execAction:T,execCustomAction:function(t){null==m||m(t)},isRunning:function(t){return k[t]},setRunning:function(t,e){k[t]=e},registerInstance:function(t,e){U.has(t)?z(G(new Error("Duplicate instance id"),{additional:{id:t}})):U.set(t,e)},addSvgFilter:function(t){if(N[t]=N[t]||0,++N[t],J[t])return J[t];const e=`${O()}-svg-filter`;return J=Object.assign(Object.assign({},J),{[t]:e}),e},removeSvgFilter:function(t){t&&N[t]&&0==--N[t]&&(J=Object.keys(J).reduce(((t,e)=>(N[e]&&(t[e]=J[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Be(t);const e=Rr(t,z);return e.vars.length?R(e.vars.map((t=>A.get(t)||function(t){const e=V.get(t)||L(void 0);return V.has(t)||V.set(t,e),e}(t))).filter(it),(()=>e.applyVars(A))):Be(t)},getJsonWithVars:P,getStore:function(t){return W.has(t)||function(t){W.has(t)||W.set(t,Wr[t]())}(t),W.get(t)},getVariable:function(t,e){const r=A.get(t);if(r){const n=r.getType();if(n!==e)return void z(G(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},registerComponent:void 0,unregisterComponent:void 0}),d(xt,{hasAction:()=>!1});const Z={setState(t){throw new Error("Not implemented")},getChild(t){if(Y&&Y.has(t))return Y.get(t);z(G(new Error("Missing state block with id"),{additional:{id:t}}))}};let Y=null;d(gt,{registerInstance(t,e){Y||(Y=new Map),Y.has(t)?z(G(new Error("Duplicate state with id"),{additional:{id:t}})):Y.set(t,e)},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 X=null===(i=null==c?void 0:c.card)||void 0===i?void 0:i.variables;Array.isArray(X)&&X.forEach((t=>{if(t&&t.type in De&&t.name){if(E.has(t.name))return void z(G(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Se(t.name,t.type,t.value);E.set(t.name,e),A.set(t.name,e)}catch(e){z(G(e,{additional:{name:t.name}}))}}}));const K=c.palette;K&&K[b].forEach((t=>{if(E.has(t.name))z(G(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Se(t.name,"color",t.color);E.set(t.name,e),A.set(t.name,e)}catch(e){z(G(e,{additional:{name:t.name}}))}}));for(const[t,e]of F)A.has(t)||A.set(t,e);C.subscribe((t=>{if(t&&!A.has(t)){const e=F.get(t);A.set(t,e);const r=V.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Q=null===(o=null==c?void 0:c.card)||void 0===o?void 0:o.variable_triggers;Array.isArray(Q)&&Q.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void z(G(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=Ye(t.condition,{startRule:"JsonStringContents"}),i=cr(n);if(!i.length)return void z(G(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return q(e),e.size?new Promise((t=>{const r=C.subscribe((()=>{q(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{R(i.map((t=>A.get(t))).filter(it),(()=>Nr(A,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=P(t);e.log_id&&T(e)})),e=Boolean(n.value)):z(G(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){z(G(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else z(G(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));let tt=null===(l=null===(s=null===(a=null==c?void 0:c.card)||void 0===a?void 0:a.states)||void 0===s?void 0:s[0])||void 0===l?void 0:l.div,et=tt&&{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:[{state_id:"0",div:tt}]};return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==c&&r.json(c),void 0===e.platform&&r.platform&&void 0!==v&&r.platform(v),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==p&&r.globalVariablesController(p),void 0===e.onError&&r.onError&&void 0!==h&&r.onError(h),void 0===e.onStat&&r.onStat&&void 0!==f&&r.onStat(f),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==m&&r.onCustomAction(m),void 0===e.onComponent&&r.onComponent&&void 0!==y&&r.onComponent(y),void 0===e.setVariable&&r.setVariable&&void 0!==D&&r.setVariable(D),void 0===e.getVariable&&r.getVariable&&void 0!==S&&r.getVariable(S),void 0===e.execAction&&r.execAction&&void 0!==T&&r.execAction(T),!w&&et?`<div class="${j("divkit-b023",!0)+j(_?" divkit-ee11":"",!0)}">${M(Ne,"RootSvgFilters").$$render(t,{svgFiltersMap:J},{},{})}\n ${M(Je,"Unknown").$$render(t,{div:et,templateContext:{}},{},{})}</div>`:""})),Qr=Kr;function tn(t){return Qr.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var en=exports;for(var rn in e)en[rn]=e[rn];e.__esModule&&Object.defineProperty(en,"__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 s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}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:()=>Qr,createVariable:()=>ze,render:()=>rn}),new Set,new Map;const g=[],p=[],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=s;do{for(;$<g.length;){const t=g[$];$++,l(t),k(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.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(g.length);for(;h.length;)h.pop()();y=!1,w.clear(),l(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"]),F=/[\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 E(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(F.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?"&amp;":'"'===e?"&quot;":"&lt;"),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 P(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$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=s;l({$$:{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 l(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 U(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 B=[];function L(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=!B.length;for(const e of i)e[1](),B.push(e,t);if(e){for(let t=0;t<B.length;t+=2)B[t][0](B[t+1]);B.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function R(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return c=t=>{let n=!1;const c=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}},{subscribe:L(n,c).subscribe};var c}const W="divkit-bd25",q="divkit-c016",H=Symbol("root");function G(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const Z={text:"divkit-d9b0",text_halign_left:"divkit-a4cb",text_halign_center:"divkit-e165",text_halign_right:"divkit-ea28",text_valign_top:"divkit-d8ce",text_valign_center:"divkit-ef58",text_valign_bottom:"divkit-fe8e",text_width_content:"divkit-f41f",text_height_content:"divkit-ea52",text__inner:"divkit-b852",text_singleline:"divkit-ef11",text_truncate_none:"divkit-c6ea",text_multiline:"divkit-ee8e",text__inner_gradient:"divkit-cb8e",text__image:"divkit-bf6e",text__image_hidden:"divkit-f100"},Y={outer:"divkit-d65a","outer_hide-on-transition-in":"divkit-a6d1","outer_halign-self_start":"divkit-cc45","outer_halign-self_center":"divkit-b833","outer_halign-self_end":"divkit-c573","outer_halign-self_stretch":"divkit-dcc7","outer_valign-self_start":"divkit-e807","outer_valign-self_center":"divkit-d40a","outer_valign-self_end":"divkit-e9f8","outer_valign-self_stretch":"divkit-b7aa","outer_parent-flex_vertical":"divkit-c143","outer_parent-flex_horizontal":"divkit-ef30","outer_width-constrained":"divkit-d321","outer_height-constrained":"divkit-a525","outer_parent-overlap":"divkit-dab2","outer_parent-overlap-absolute":"divkit-d43f","outer_scroll-snap_center":"divkit-d9e3","outer_scroll-snap_start":"divkit-efd1",outer__border:"divkit-d405",outer_visibility_invisible:"divkit-f018",outer_visibility_gone:"divkit-e784","outer_has-action-animation":"divkit-f498"};function X(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 K(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 Q(t){let e=K(t);return"0"===e&&(e+="em"),e}function tt(t,e){for(;t.length<e;)t="0"+t;return t}function et(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=rt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>tt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function rt(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,s=2===i.length?i:i+i,l=2===o.length?o:o+o,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function nt(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const it=Boolean;function ot(t){if(1===t.length&&"solid"===t[0].type)return{color:et(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=et(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(it);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>et(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:lt(t.bg.scale),pos:ut(t.bg),image:'url("'+nt(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(it);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=Q(n.value):"relative"===n.type&&(i=at[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${st(t.bg.center_x)} ${st(t.bg.center_y)},`+r.map((t=>et(t))).join(",")+")"}}({bg:t}):void 0)).filter(it).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 at={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function st(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return Q(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function lt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function ut(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 ct(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const dt=new Set(["http","https","tel","mailto","intent"]);function vt(t){return dt.has(t)}function gt(t,e){e&&t.push(e)}function pt(t,e,r){const n=[];gt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&gt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const ft=Symbol("state");function ht(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function mt(t){return ht(t)&&t>=0}function yt(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]&&!mt(i[t]))return n;return function(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>K((t||e)/r*10))).join(" ")}(t,e,r)}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]&&!mt(r[t]))return e;return function(t){return K(t.top||0)+" "+K(t.right||0)+" "+K(t.bottom||0)+" "+K(t.left||0)}(t)}function bt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const wt=Object.prototype.hasOwnProperty;function $t(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(!wt.call(e,i)||!$t(t[i],e[i]))return!1}return!0}function xt(t,e){return $t(t,e)?e:t}function kt(){}const Ct=Symbol("action"),Ft=J(((t,e,r,n)=>{let{actions:i}=e,{cls:o=""}=e,{style:a=null}=e,{attrs:s}=e,{use:l=kt}=e,{customAction:u=null}=e,{hasActionAnimation:c=!1}=e;const g=v(H),p=v(Ct);d(Ct,{hasAction:()=>Boolean(p.hasAction()||(null==i?void 0:i.length))});let f,h="";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){h=e,f=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&p.hasAction()&&(h="",g.logError(G(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let m=Boolean(u);return h&&!vt(ct(h))&&(h="",m=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.cls&&r.cls&&void 0!==o&&r.cls(o),void 0===e.style&&r.style&&void 0!==a&&r.style(a),void 0===e.attrs&&r.attrs&&void 0!==s&&r.attrs(s),void 0===e.use&&r.use&&void 0!==l&&r.use(l),void 0===e.customAction&&r.customAction&&void 0!==u&&r.customAction(u),void 0===e.hasActionAnimation&&r.hasActionAnimation&&void 0!==c&&r.hasActionAnimation(c),h?`<a${E([{href:D(h)},{target:D(f)},{style:D(a)},{class:j(o,!0)+" "+j(c?"":W,!0)},S(s)],{})}>${n.default?n.default({}):""}</a>`:`<span${E([{class:j(o,!0)+j(m?` ${c?"":W} divkit-c016`:"",!0)},{style:D(a)},{role:D(m?"button":null)},S(s)],{})}>${n.default?n.default({}):""}</span>`})),Et=Ft,At="divkit-b921",Vt=J(((t,e,r,n)=>{let{background:i=[]}=e;const o=i.map((t=>{const e={},r=ot([t]),n={style:e};return"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position),n}));return void 0===e.background&&r.background&&void 0!==i&&r.background(i),`<span${N("class","divkit-bf25",0)}>${P(o,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",At,0)}${N("style",X(t.style),0)}>`:`<span${N("class",At,0)}${N("style",X(t.style),0)}></span>`))}</span>`}));function jt(t,e){const r=Number(t);return isNaN(r)?e:r}const Dt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J,T,U,B,L,R,W=r,q=r,Z=r,tt=r,rt=r,nt=r,it=r,at=r,st=r,lt=r,ut=r,dt=r,gt=r,ht=r,wt=r;var $t,kt,Ct,Ft,At,Dt;let{json:St={}}=e,{origJson:Pt}=e,{templateContext:zt}=e,{cls:Mt=""}=e,{style:It}=e,{layoutParams:Ot={}}=e,{customDescription:Jt=!1}=e,{customPaddings:Nt=!1}=e,{customActions:Tt=""}=e,{forceWidth:Ut=!1}=e,{forceHeight:Bt=!1}=e;const Lt={left:"start",center:"center",right:"end"},Rt={top:"start",center:"center",bottom:"end"},Wt=v(H),qt=v(ft);let Ht,Gt,Zt,Yt,Xt,Kt,Qt,te={},ee={},re=!1,ne=1,ie="transparent",oe=0,ae="",se="",le="",ue={},ce=0,de=0,ve=0,ge={},pe=0,fe=0,he=0,me=1;const ye=St.transition_triggers||["state_change","visibility_change"],_e=-1!==ye.indexOf("state_change")&&St.id,be=-1!==ye.indexOf("visibility_change")&&St.id;let we,$e,xe,ke,Ce,Fe,Ee,Ae,Ve,je=[],De="",Se=!1,Pe="visible",ze=0,Me=0;void 0===e.json&&n.json&&void 0!==St&&n.json(St),void 0===e.origJson&&n.origJson&&void 0!==Pt&&n.origJson(Pt),void 0===e.templateContext&&n.templateContext&&void 0!==zt&&n.templateContext(zt),void 0===e.cls&&n.cls&&void 0!==Mt&&n.cls(Mt),void 0===e.style&&n.style&&void 0!==It&&n.style(It),void 0===e.layoutParams&&n.layoutParams&&void 0!==Ot&&n.layoutParams(Ot),void 0===e.customDescription&&n.customDescription&&void 0!==Jt&&n.customDescription(Jt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Nt&&n.customPaddings(Nt),void 0===e.customActions&&n.customActions&&void 0!==Tt&&n.customActions(Tt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Ut&&n.forceWidth(Ut),void 0===e.forceHeight&&n.forceHeight&&void 0!==Bt&&n.forceHeight(Bt),o=Wt.getDerivedFromVars(St.border),wt(),wt=a(o,(t=>R=t));{let t={},e={},r=!1;if(R){if(R.has_shadow){const e=R.shadow;t["box-shadow"]=e?K((null===(kt=null===($t=e.offset)||void 0===$t?void 0:$t.x)||void 0===kt?void 0:kt.value)||0)+" "+K((null===(Ft=null===(Ct=e.offset)||void 0===Ct?void 0:Ct.y)||void 0===Ft?void 0:Ft.value)||0)+" "+K(null!==(At=e.blur)&&void 0!==At?At:2)+" "+et(e.color||"#000000",null!==(Dt=e.alpha)&&void 0!==Dt?Dt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}R.stroke&&(r=!0,ne=bt(R.stroke.width,ne),ie=et(R.stroke.color,1,ie),e.border=`${K(ne)} solid ${ie}`),R.corners_radius?(ae=yt(R.corners_radius,0,10,ae),e["border-radius"]=t["border-radius"]=ae):R.corner_radius&&(oe=bt(R.corner_radius,oe),e["border-radius"]=t["border-radius"]=K(oe))}te=xt(t,te),ee=xt(e,ee),re=r}s=Wt.getDerivedFromVars(St.paddings),ht(),ht=a(s,(t=>L=t)),se=_t(L&&!Nt?L:void 0,se),l=Wt.getDerivedFromVars(St.margins),dt(),dt=a(l,(t=>U=t)),le=_t(U,le),u=Wt.getDerivedFromVars(St.width),lt(),lt=a(u,(t=>J=t)),c=Wt.getDerivedFromVars(St.alignment_horizontal),gt(),gt=a(c,(t=>B=t));{let t,e,r={},n=0,i=0;const o=null==J?void 0:J.type;if("fixed"===o?(ce=bt(null==J?void 0:J.value,ce),e=K(ce)):"wrap_content"===o||!Ot.overlapParent&&"match_parent"===o&&Ot.parentHorizontalWrapContent?(t="content",("wrap_content"===o&&(null==J?void 0:J.constrained)||"match_parent"===o&&Ot.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(G(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Ot.parentLayoutOrientation?e=`calc(100% - ${Q(((null==U?void 0:U.left)||0)+((null==U?void 0:U.right)||0))})`:"horizontal"===Ot.parentContainerOrientation&&(n=J&&"weight"in J&&J.weight||1)),"content"===t&&Ut&&(t="parent",Wt.logError(G(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=B;r["halign-self"]="left"===t||"center"===t||"right"===t?Lt[t]:Ot.parentHAlign||"start"}t&&(r.width=t),Zt=e,de=n,ve=i,ue=xt(r,ue)}d=Wt.getDerivedFromVars(St.height),st(),st=a(d,(t=>O=t)),g=Wt.getDerivedFromVars(St.alignment_vertical),ut(),ut=a(g,(t=>T=t));{let t,e,r={},n=0,i=0;const o=null==O?void 0:O.type;if("fixed"===o?(pe=bt(null==O?void 0:O.value,pe),e=K(pe)):"match_parent"!==o||!Ot.overlapParent&&Ot.parentVerticalWrapContent?(t="content",("wrap_content"===o&&(null==O?void 0:O.constrained)||"match_parent"===o&&Ot.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(G(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Ot.parentLayoutOrientation?e=`calc(100% - ${Q(((null==U?void 0:U.top)||0)+((null==U?void 0:U.bottom)||0))})`:"vertical"===Ot.parentContainerOrientation&&(n=(null==O?void 0:O.weight)||1)),"content"===t&&Bt&&(t="parent",Wt.logError(G(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=T;r["valign-self"]="top"===t||"center"===t||"bottom"===t?Rt[t]:Ot.parentVAlign||"start"}t&&(r.height=t),Yt=e,fe=n,he=i,ge=xt(r,ge)}var Ie,Oe;if(p=!!Ot.overlapParent||void 0,f=Ot.overlapParent&&(!J||"match_parent"===J.type)&&"match_parent"===(null==O?void 0:O.type),h=Ot.gridArea?`${Ot.gridArea.y+1}/${Ot.gridArea.x+1}/span ${Ot.gridArea.rowSpan}/span ${Ot.gridArea.colSpan}`:void 0,m=Wt.getDerivedFromVars(St.alpha),at(),at=a(m,(t=>I=t)),Oe=me,me=!mt(Ie=I)||void 0===Ie||Ie>1?Oe:Number(Ie),Xt=1===me?void 0:me,y=Wt.getDerivedFromVars(St.accessibility),it(),it=a(y,(t=>z=t)),Gt=void 0,z&&!Jt&&z.description&&(Gt={},Gt["aria-label"]=z.description),b=Wt.getDerivedFromVars(St.background),nt(),nt=a(b,(t=>P=t)),Kt={},Qt=!1,P&&(Qt=P.some((t=>"image"===t.type)),!Qt)){const t=ot(P);Kt["background-color"]=t.color,Kt["background-image"]=t.image,Kt["background-size"]=t.size,Kt["background-position"]=t.position,Kt["background-repeat"]="no-repeat"}we=void 0,_e&&St.transition_in&&Wt.isRunning("stateChange")&&(we=!0),xe=void 0,_e&&St.transition_change&&Wt.isRunning("stateChange")&&qt.hasTransitionChange(St.id)&&(xe=!0),w=Wt.getDerivedFromVars(St.action),tt(),tt=a(w,(t=>D=t)),$=Wt.getDerivedFromVars(St.actions),rt(),rt=a($,(t=>S=t));{let t=S||D&&[D]||[];Array.isArray(t)?t.length&&Tt&&(t=[],Wt.logError(G(new Error(`Cannot use action on component "${Tt}"`)))):(t=[],Wt.logError(G(new Error("Actions should be array")))),je=t}x=Wt.getDerivedFromVars(St.action_animation),Z(),Z=a(x,(t=>j=t)),j&&(De=function t(e){var r;const n=jt(e.start_value,1),i=jt(e.end_value,1),o=bt(e.start_delay,0),a=bt(e.duration,300),s=function(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:"ease_in_out"}(e.interpolator).replace(/_/g,"-");switch(e.name){case"fade":return ke=n,Ce=i,`opacity ${a}ms ${s} ${o}ms`;case"scale":return Fe=n,Ee=i,`transform ${a}ms ${s} ${o}ms`;case"set":return(null===(r=e.items)||void 0===r?void 0:r.length)?e.items.map(t).join(", "):(Wt.logError(G(new Error("Empty items value for action_animation with name='set'"))),"");default:return Wt.logError(G(new Error("Unknown action_animation name"),{additional:{animation:e.name}})),""}}(j)),k=Wt.getDerivedFromVars(St.visibility),q(),q=a(k,(t=>V=t));{const t=Pe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(V,Pe);t!==e&&(!Se||"visible"!==Pe&&"visible"!==e?Pe=e:async function(t){Pe=t;const e="visible"===t?"in":"out",r="in"===e?St.transition_in:St.transition_out;be&&r&&(await _(),"in"===e&&($e=!0),qt.runVisibilityTransition(Object.assign(Object.assign({},St),{visibility:"visible"}),zt,r,Ht,e).then((()=>{"in"===e&&($e=!1)})).catch((t=>{throw"in"===e&&($e=!1),t})))}(e)),Se||(Se=!0)}if(C=Object.assign(Object.assign(Object.assign({},ue),ge),{"parent-overlap":p,"parent-overlap-absolute":f,"scroll-snap":Ot.scrollSnap,"hide-on-transition-in":we||$e||xe,visibility:Pe,"has-action-animation":Boolean(De),"parent-flex":Ot.parentContainerOrientation||void 0}),F=Wt.getDerivedFromVars(St.transform),W(),W=a(F,(t=>A=t)),A&&void 0!==A.rotation){const t=A.pivot_x||{type:"pivot-percentage",value:50};ze=jt(t.value,ze);const e="pivot-fixed"===t.type?K(ze):`${ze}%`,r=A.pivot_y||{type:"pivot-percentage",value:50};Me=jt(r.value,Me),Ae=`${e} ${"pivot-fixed"===r.type?K(Me):`${Me}%`}`,Ve=`rotate(${A.rotation}deg)`}return E=Object.assign(Object.assign(Object.assign(Object.assign({},It),Kt),te),{width:Zt,height:Yt,"grid-area":h,padding:se,margin:le,opacity:Xt,transition:De,"transform-origin":Ae,transform:Ve,"flex-grow":de||fe||void 0,"flex-shrink":ve||he?1:void 0,"flex-basis":de||fe?0:void 0,"--divkit-animation-opacity-start":ke,"--divkit-animation-opacity-end":Ce,"--divkit-animation-scale-start":Fe,"--divkit-animation-scale-end":Ee}),W(),q(),Z(),tt(),rt(),nt(),it(),at(),st(),lt(),ut(),dt(),gt(),ht(),wt(),`${M(Et,"Actionable").$$render(t,{use:function(t){Ht=t,_e&&St.transition_in&&qt.registerChildWithTransitionIn(St,zt,St.transition_in,t).then((()=>{we=!1})).catch((t=>{throw we=!1,t})),_e&&St.transition_out&&qt.registerChildWithTransitionOut(St,zt,St.transition_out,t),_e&&St.transition_change&&qt.registerChildWithTransitionChange(St,zt,St.transition_change,t).then((()=>{xe=!1})).catch((t=>{throw xe=!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=ct(n);t&&!vt(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:Wt.getJsonWithVars(St.visibility_actions||St.visibility_action&&[St.visibility_action]),rootCtx:Wt});const e=St.id;e&&qt.registerChild(e);let r=null;return{destroy(){e&&qt.unregisterChild(e),r&&r.destroy()}}},cls:Mt+" "+pt("outer",Y,C),style:X(E),actions:je,attrs:Gt,hasActionAnimation:Boolean(De)},{},{default:()=>`${Qt?`${M(Vt,"OuterBackground").$$render(t,{background:P},{},{})}`:""}${i.default?i.default({}):""}${re?`<span${N("class",Y.outer__border,0)}${N("style",X(ee),0)}></span>`:""}`})}`})),St={"text-range":"divkit-faf0","text-range_singleline":"divkit-ccb6","text-range__top-offset":"divkit-d923","text-range_decoration_both":"divkit-d7e0","text-range_decoration_underline":"divkit-f3dd","text-range_decoration_strike":"divkit-d27b","text-range_decoration_none":"divkit-c6b0"};function Pt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function zt(t){return ht(t)&&t>0}function Mt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function It(t,e){return Mt(t)||e}const Ot=J(((t,e,r,n)=>{let i,o,a,s,{text:l}=e,{rootFontSize:u}=e,{textStyles:c={}}=e,{singleline:d=!1}=e,{actions:v}=e,g="none",p=12,f=1.25,h="",m="";void 0===e.text&&r.text&&void 0!==l&&r.text(l),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==u&&r.rootFontSize(u),void 0===e.textStyles&&r.textStyles&&void 0!==c&&r.textStyles(c),void 0===e.singleline&&r.singleline&&void 0!==d&&r.singleline(d),void 0===e.actions&&r.actions&&void 0!==v&&r.actions(v);{let t="none";(c.underline||c.strike)&&("single"===c.underline&&"single"===c.strike?t="both":"single"===c.underline?t="underline":"single"===c.strike&&(t="strike")),g=t}return p=Pt(c.font_size,p),zt(c.line_height)&&(f=Number(c.line_height)/p),mt(c.letter_spacing)&&(h=K(c.letter_spacing)),s=It(c.font_weight,s),m=et(c.text_color,1,m),i=c.top_offset?K(c.top_offset):"",o={singleline:d,decoration:g},a={"font-size":K(10*p/u),"line-height":f,"letter-spacing":h,"font-weight":s,color:m},`${i?`<span${N("class",St["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${M(Et,"Actionable").$$render(t,{cls:pt("text-range",St,o),actions:v,style:X(a)},{},{default:()=>`${j(l)}`})}`}));function Jt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Nt(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const Tt=J(((t,e,n,i)=>{let o,s,l,u,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,z,I,O,J,T,U,B,L,R,W,Y,Q,tt=r,rt=r,nt=r,it=r,at=r,st=r,lt=r,ut=r,ct=r,dt=r,vt=r,gt=r,ft=r,ht=r,mt=r,{json:yt={}}=e,{templateContext:_t}=e,{origJson:bt}=e,{layoutParams:wt}=e;const $t=v(H);let xt=!1,kt="",Ct=12,Ft=1.25,Et=!1,At="",Vt="",jt=!1,St="left",Mt="top",It="",Tt="",Ut=!1,Bt=[],Lt=[];var Rt,Wt;c((()=>{Lt.forEach((t=>{$t.removeSvgFilter(t)}))})),void 0===e.json&&n.json&&void 0!==yt&&n.json(yt),void 0===e.templateContext&&n.templateContext&&void 0!==_t&&n.templateContext(_t),void 0===e.origJson&&n.origJson&&void 0!==bt&&n.origJson(bt),void 0===e.layoutParams&&n.layoutParams&&void 0!==wt&&n.layoutParams(wt),o=$t.getDerivedFromVars(yt.text),mt(),mt=a(o,(t=>Q=t)),Rt=Q,Wt=kt,kt=String(null!=Rt?Rt:"")||Wt,kt?xt=!1:(xt=!0,$t.logError(G(new Error('Missing "text" prop for div "text"')))),s=$t.getDerivedFromVars(yt.ranges),it(),it=a(s,(t=>z=t)),l=$t.getDerivedFromVars(yt.images),nt(),nt=a(l,(t=>S=t)),u=$t.getDerivedFromVars({font_size:yt.font_size,letter_spacing:yt.letter_spacing,font_weight:yt.font_weight,text_color:yt.text_color,underline:yt.underline,strike:yt.strike,line_height:yt.line_height}),at(),at=a(u,(t=>I=t)),d=$t.getDerivedFromVars(yt.font_size),ht(),ht=a(d,(t=>Y=t)),Ct=Pt(Y,Ct),g=$t.getDerivedFromVars(yt.line_height),ft(),ft=a(g,(t=>W=t));{const t=W;zt(t)?(Ft=Number(t)/Ct,Et=!0):Et=!1}p=$t.getDerivedFromVars(yt.max_lines),dt(),dt=a(p,(t=>B=t)),f=1===B;{let t="",e="",r=!1;if(B&&B>1){let n=Number(B);t=n*Ft+"em",z||S||(e=n,r=!0)}At=t,Vt=e,jt=r}h=$t.getDerivedFromVars(yt.text_alignment_horizontal),gt(),gt=a(h,(t=>R=t)),St=Jt(R,St),m=$t.getDerivedFromVars(yt.text_alignment_vertical),vt(),vt=a(m,(t=>L=t)),Mt=Nt(L,Mt),y=!z||kt&&1===z.length&&z[0]&&0===z[0].start&&"number"==typeof z[0].end&&z[0].end>=kt.length,_=$t.getDerivedFromVars(yt.text_color),ct(),ct=a(_,(t=>U=t)),b=Boolean(U)!==Boolean(z&&z[0]&&z[0].text_color);{let t="";B&&y&&b&&(t=et(U||z&&z[0]&&z[0].text_color,1,It)),It=t}w=$t.getDerivedFromVars(yt.truncate),ut(),ut=a(w,(t=>T=t)),$="none"===T?"none":"",x=$t.getDerivedFromVars(yt.text_gradient),lt(),lt=a(x,(t=>J=t));{let t="";if(J){const e=ot([J]);e.image&&(t=e.image)}Tt=t}return k=$t.getDerivedFromVars(yt.selectable),st(),st=a(k,(t=>O=t)),Ut=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(O,Ut),C=$t.getDerivedFromVars(yt.width),rt(),rt=a(C,(t=>D=t)),F=$t.getDerivedFromVars(yt.height),tt(),tt=a(F,(t=>j=t)),function(t,e,r){let n=[];if(Lt.forEach((t=>{$t.removeSvgFilter(t)})),Lt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Bt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],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>s){let r=Object.assign(Object.assign({},I),...l);n.push({text:i.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},I),...l),r=K(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=K(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":K(10*(Number(e.font_size)||12)/Ct)};let a="";if(t.image.tint_color){const e=et(t.image.tint_color);a=$t.addSvgFilter(e),Lt.push(e)}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},I)}),Bt=n}(kt,z,S),E={singleline:f,multiline:jt,halign:St,valign:Mt,truncate:$,width:"wrap_content"!==(null==D?void 0:D.type)||D.constrained?"":"content",height:!j||"wrap_content"===j.type&&!j.constrained?"content":""},A={gradient:Boolean(Tt)},V={"font-size":K(Ct),"line-height":Ft,"max-height":At,"-webkit-line-clamp":Vt,color:It,"background-image":Tt},tt(),rt(),nt(),it(),at(),st(),lt(),ut(),ct(),dt(),vt(),gt(),ft(),ht(),mt(),xt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("text",Z,E)+" "+(Ut?"":q),json:yt,origJson:bt,templateContext:_t,layoutParams:wt},{},{default:()=>`<span${N("class",pt("text__inner",Z,A),0)}${N("style",X(V),0)}>${Bt.length?`${P(Bt,((e,r)=>"text"in e?e.text?`${M(Ot,"TextRangeView").$$render(t,{text:e.text,rootFontSize:Ct,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",X(e.image.wrapperStyle),0)}><img${N("class",Z.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",X({width:e.image.width,height:e.image.height,"margin-top":Et?`-${e.image.height}`:void 0,"margin-bottom":Et?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Ot,"TextRangeView").$$render(t,{text:kt,rootFontSize:Ct,textStyles:I,singleline:f},{},{})}`}</span>`})}`})),Ut=Tt,Bt={container:"divkit-d37d",container_orientation_vertical:"divkit-ddc3",container_valign_top:"divkit-a331",container_valign_center:"divkit-aae6",container_valign_bottom:"divkit-c222",container_orientation_horizontal:"divkit-fe45",container_halign_left:"divkit-a309",container_halign_center:"divkit-bac9",container_halign_right:"divkit-f423",container_orientation_overlap:"divkit-a644"},Lt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b=r,w=r,$=r,x=r,k=r,{json:C={}}=e,{templateContext:F}=e,{origJson:E}=e,{layoutParams:A}=e;const V={left:"start",center:"center",right:"end"},j={top:"start",center:"center",bottom:"end"},D=v(H);let S=!1,z="vertical",I="top",O="left",J={};void 0===e.json&&n.json&&void 0!==C&&n.json(C),void 0===e.templateContext&&n.templateContext&&void 0!==F&&n.templateContext(F),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==A&&n.layoutParams(A),o=C.items,(null==o?void 0:o.length)&&Array.isArray(o)?S=!1:(S=!0,D.logError(G(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!S&&o||[]).map((t=>{let e=t,r=F;return({templateContext:r,json:e}=D.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=D.getDerivedFromVars(C.orientation),k(),k=a(l,(t=>_=t)),z=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(_,z),u=D.getDerivedFromVars(C.content_alignment_vertical),x(),x=a(u,(t=>y=t)),I=Nt(y,I),c=D.getDerivedFromVars(C.content_alignment_horizontal),$(),$=a(c,(t=>m=t)),O=Jt(m,O),d=D.getDerivedFromVars(C.width),b(),b=a(d,(t=>f=t)),g=D.getDerivedFromVars(C.height),w(),w=a(g,(t=>h=t));{let t={};"overlap"===z&&(t.overlapParent=!0),"horizontal"!==z&&(t.parentHAlign=V[O],(!h||"wrap_content"===h.type||"match_parent"===h.type&&(null==A?void 0:A.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==z&&(t.parentVAlign=j[I],("wrap_content"===(null==f?void 0:f.type)||"match_parent"===(null==f?void 0:f.type)&&(null==A?void 0:A.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===z&&(t.parentContainerOrientation="horizontal"),"vertical"===z&&(t.parentContainerOrientation="vertical"),J=xt(t,J)}return p={orientation:z,valign:I,halign:O},b(),w(),$(),x(),k(),S?"":`${M(Dt,"Outer").$$render(t,{cls:pt("container",Bt,p),json:C,origJson:E,templateContext:F,layoutParams:A},{},{default:()=>`${P(s,(e=>`${M(Te,"Unknown").$$render(t,{layoutParams:J,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Rt={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Wt(t,e){return"vertical"===t||"horizontal"===t?t:e}const qt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(H);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),p(),p=a(o,(t=>g=t)),b=Wt(null==g?void 0:g.orientation,b),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=et(null==g?void 0:g.color,1,w),l="horizontal"===b?"100%":K(1),u="horizontal"===b?K(1):"100%",c={background:w,width:l,height:u},d={orientation:b},p(),`${M(Dt,"Outer").$$render(t,{cls:pt("separator",Rt,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${N("class",Rt.separator__inner,0)}${N("style",X(c),0)}></span>`:""})}`})),Ht={image:"divkit-a448","image_is-width-content":"divkit-fe14","image_is-height-content":"divkit-f4d9",image__image:"divkit-ce04",image_error:"divkit-f10d","image__aspect-wrapper":"divkit-dc80",image_aspect:"divkit-ae78"},Gt=J(((t,e,n,i)=>{let o,s,l,u,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J=r,T=r,B=r,L=r,R=r,W=r,q=r,Z=r,Y=r,K=r,Q=r,{json:tt={}}=e,{templateContext:rt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(H);let st,ct=!1,dt=!0,vt="rgba(0,0,0,0.08)",gt=!1,ft="",ht="none",mt="50% 50%",yt="0",_t="";c((()=>{at.removeSvgFilter(st)})),void 0===e.json&&n.json&&void 0!==tt&&n.json(tt),void 0===e.templateContext&&n.templateContext&&void 0!==rt&&n.templateContext(rt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=at.getDerivedFromVars(tt.image_url),Q(),Q=a(o,(t=>O=t)),s=at.getDerivedFromVars(tt.gif_url),K(),K=a(s,(t=>I=t)),l=O||I,dt=!0,ct=!1,l?gt=!1:(gt=!0,at.logError(G(new Error('Missing "image_url" for "image"')))),u=at.getDerivedFromVars(tt.width),Y(),Y=a(u,(t=>z=t)),d="wrap_content"===(null==z?void 0:z.type),g=at.getDerivedFromVars(tt.height),Z(),Z=a(g,(t=>P=t)),p="wrap_content"===(null==P?void 0:P.type),f=at.getDerivedFromVars(tt.preview),q(),q=a(f,(t=>S=t));{const t=S;ft=t?t.startsWith("data:")?`url("${nt(t)}")`:`url("data:image/jpg;base64,${nt(t)}")`:""}h=at.getDerivedFromVars(tt.placeholder_color),W(),W=a(h,(t=>D=t)),vt=et(D,1,vt),m=at.getDerivedFromVars(tt.scale),R(),R=a(m,(t=>j=t)),ht=lt(j)||ht,y=at.getDerivedFromVars({content_alignment_horizontal:tt.content_alignment_horizontal,content_alignment_vertical:tt.content_alignment_vertical}),L(),L=a(y,(t=>V=t)),mt=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:ut(t)}(V,mt),_=at.getDerivedFromVars(tt.accessibility),B(),B=a(_,(t=>A=t)),b=(null==A?void 0:A.description)||"",w=at.getDerivedFromVars(tt.aspect),T(),T=a(w,(t=>E=t));{const t=null==E?void 0:E.ratio;yt=t&&zt(t)?(100/Number(t)).toFixed(2):"0"}$=at.getDerivedFromVars(tt.tint_color),J(),J=a($,(t=>F=t));{const t=F,e=t?et(t):void 0;e!==st&&(at.removeSvgFilter(st),_t=e?at.addSvgFilter(e):"",st=e)}return x={aspect:"0"!==yt,"is-width-content":d,"is-height-content":p},k={"background-image":ft,"background-color":vt,"object-fit":ht,"object-position":mt,filter:""},C=X(k),J(),T(),B(),L(),R(),W(),q(),Z(),Y(),K(),Q(),gt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("image",Ht,x),json:tt,origJson:it,templateContext:rt,layoutParams:ot,customDescription:!0},{},{default:()=>x.aspect?`<span${N("class",Ht["image__aspect-wrapper"],0)}${U({"padding-bottom":`${yt}%`})}><img${N("class",Ht.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",C,0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",Ht.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",X(k),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),Zt={grid:"divkit-d908",grid_halign_left:"divkit-f63b",grid_halign_center:"divkit-a14a",grid_halign_right:"divkit-b071",grid_valign_top:"divkit-fbca",grid_valign_center:"divkit-d431",grid_valign_bottom:"divkit-e420"};function Yt(t){return t>0&&t<1}function Xt(t){return String(Math.ceil(1e3*t)/1e3)}function Kt(t,e,r){if(t.some(Yt)){const e=Math.max(...t.filter(Yt).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(${K(n*t[e]/i)},${Xt(t[e])}fr)`:t[e]?o[e]=`${Xt(t[e])}fr`:o[e]="auto";return o.join(" ")}const Qt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:F}=e;const E=v(H);let A,V,j=!1,D=1,S=[],z=[],I=[],O=[],J=0,N=!1,T="top",U="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!==F&&n.layoutParams(F),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,E.logError(G(new Error('Incorrect or empty "items" prop for div "grid"')))),s=E.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Pt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=E.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=R(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],I=[],O=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},g="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,p="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===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,h=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.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]<g)&&(S[n]=g),(!z[e]||z[e]<p)&&(z[e]=p),(!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}})})),0!==e&&(N=!0),N&&E.logError(G(new Error('Mismatching "grid" rows/columns'))),J=r}return u=E.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(u,(t=>h=t)),T=Nt(h,T),c=E.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(c,(t=>f=t)),U=Jt(f,U),d={valign:T,halign:U},g={"grid-template-columns":Kt(S,I,D),"grid-template-rows":Kt(z,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${M(Dt,"Outer").$$render(t,{cls:pt("grid",Zt,d),json:x,origJson:C,templateContext:k,style:g,layoutParams:F},{},{default:()=>`${P(V,(e=>`${M(Te,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),te=Qt,ee={gallery:"divkit-cbb0",gallery_orientation_horizontal:"divkit-c9be",gallery_orientation_vertical:"divkit-a72d",gallery__scroller:"divkit-a4e3","gallery_scroll-snap":"divkit-f606","gallery__items-grid":"divkit-eb4a",gallery__items:"divkit-af27",gallery__arrow:"divkit-b72d","gallery__arrow-icon":"divkit-d100",gallery__arrow_left:"divkit-a0a5",gallery__arrow_right:"divkit-f0f5","gallery__arrow-icon-path":"divkit-b417"};function re(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(" ")}const ne=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V=r,j=r,D=r,S=r,z=r,I=r,O=r,J=r,{json:T={}}=e,{templateContext:U}=e,{origJson:B}=e,{layoutParams:L}=e;const W=v(H);let q,Z,Y,Q=[],tt=!1,et=1,rt="horizontal",nt="start",it=8,ot="",at=[],st={},lt=!1,ut={},ct=0;function dt(){let t=[],e=Q[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<et;++e){const n=Q[e].children[r];n&&t.push(n)}return t}function vt(t,e,r="smooth"){const n="horizontal"===rt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";q.scroll({[o]:Math.max(0,t[e][i]-it/2),behavior:r})}function gt(t){const e=dt(),r=q.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===rt?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"===rt?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}T.id&&!tt&&W.registerInstance(T.id,{setCurrentItem(t){const e=dt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');vt(e,t)},setPreviousItem(t){const e=gt("prev"),r=dt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),vt(r,n)},setNextItem(t){const e="horizontal"===rt?q.scrollLeft+q.offsetWidth===q.scrollWidth:q.scrollTop+q.offsetHeight===q.scrollHeight,r=dt();if(e&&"ring"===t)return void vt(r,0);const n=gt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),vt(r,i)}}),void 0===e.json&&n.json&&void 0!==T&&n.json(T),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==B&&n.origJson(B),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),o=T.items,(null==o?void 0:o.length)&&Array.isArray(o)?tt=!1:(tt=!0,W.logError(G(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!tt&&o||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=W.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=W.getDerivedFromVars(T.column_count),J(),J=a(l,(t=>A=t)),et=Pt(A,et),u=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}(s,et),c=W.getDerivedFromVars(T.orientation),O(),O=a(c,(t=>E=t)),rt=Wt(E,rt),d=W.getDerivedFromVars(T.cross_content_alignment),I(),I=a(d,(t=>F=t)),nt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(F,nt),g=W.getDerivedFromVars(T.item_spacing),z(),z=a(g,(t=>C=t)),it=bt(C,it),Z=K(it),p=W.getDerivedFromVars(T.paddings),S(),S=a(p,(t=>k=t)),ot=_t(k,ot),f="horizontal"===rt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===rt?"width":"height";t.push(W.getDerivedFromVars(e.json[r]))})),Y=R(t,(t=>t)),D(),D=a(Y,(t=>x=t))}at=[],et>1?at.push("auto"):x.forEach((t=>{!t&&"horizontal"===rt||"match_parent"===(null==t?void 0:t.type)?at.push("100%"):at.push("max-content")})),h=W.getDerivedFromVars(T.scroll_mode),j(),j=a(h,(t=>$=t));{const t={};let e={};lt=!1,"horizontal"===rt?e.parentVAlign=nt:e.parentHAlign=nt,"paging"===$&&(lt=!0,e.scrollSnap="start",t["horizontal"===rt?"scroll-padding-left":"scroll-padding-top"]=K(it/2)),1===et&&(e.parentLayoutOrientation=rt),st=xt(t,st),ut=xt(e,ut)}return m={padding:ot,"grid-gap":Z},y={"grid-gap":Z,[f]:re(at)},_={orientation:rt,"scroll-snap":lt},b=W.getDerivedFromVars(T.default_item),V(),V=a(b,(t=>w=t)),ct=bt(w,ct),V(),j(),D(),S(),z(),I(),O(),J(),tt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("gallery",ee,_),json:T,origJson:B,templateContext:U,layoutParams:L,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===rt,forceWidth:"horizontal"===rt},{},{default:()=>`<div${N("class",ee.gallery__scroller,0)}${N("style",X(st),0)}${N("this",q,0)}><div${N("class",ee["gallery__items-grid"],0)}${N("style",X(m),0)}>${P(u,((e,r)=>`<div${N("class",ee.gallery__items,0)}${N("style",X(y),0)}${N("this",Q[r],0)}>${P(e,(e=>`${M(Te,"Unknown").$$render(t,{layoutParams:ut,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===rt?"\n ":""}`})}`})),ie=ne,oe={tabs:"divkit-e0df",tabs__list:"divkit-ea19",tabs__item:"divkit-c25c",tabs__item_selected:"divkit-d560",tabs__item_actionable:"divkit-dfda",tabs__panels:"divkit-f5dc",tabs__swiper:"divkit-eb42",tabs__swiper_animated:"divkit-b9f1",tabs__swiper_inited:"divkit-fa57",tabs__panel:"divkit-cc9f",tabs__panel_visible:"divkit-e730",tabs__separator:"divkit-b85b"},ae=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,b,w,$,x,k,C,F=r,E=r,A=r,V=r,D=r,S=r,z=r;var I;let{json:O={}}=e,{templateContext:J}=e,{origJson:T}=e,{layoutParams:B}=e;const L=v(H),R=L.genId("tabs");let W,q,Z,Y=!1,Q={};const tt=L.getJsonWithVars(O.selected_tab);let rt,nt,it=tt&&Number(tt)||0,ot=12,at="",st="",lt="",ut="",ct="",dt="",vt="",gt="",ft="",ht="",bt=!1,wt=!1,$t=it,kt=[],Ct=[];async function Ft(t,e=!1){if($t=it,it=t,bt||(bt=!0,q.style.height=K(q.clientHeight),Z.style.transform=`translate3d(${100*-$t}%,0,0)`),wt=!0,async function(t){await _(),Z.style.transform=`translate3d(${t}%,0,0)`}(100*-it),function(t=!1){const e=t?Math.max(0,it-1):Math.min(it,$t),r=t?Math.min(o.length-1,it+1):Math.max(it,$t);kt=kt.map(((t,n)=>t||n>=e&&n<=r)),Ct=Ct.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${R}-panel-${it}`);t&&(q.style.height=K(t.offsetHeight))}(),Vt&&clearTimeout(Vt),Vt=window.setTimeout((()=>{Ct=o.map(((t,e)=>e===it))}),400),At=-it*q.clientWidth,e){await _();const t=W.querySelector(`.${oe.tabs__item_selected}`);t&&t.focus()}}let At,Vt=null;O.id&&!Y&&L.registerInstance(O.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Ft(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),Ft(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),Ft(e)}}),void 0===e.json&&n.json&&void 0!==O&&n.json(O),void 0===e.templateContext&&n.templateContext&&void 0!==J&&n.templateContext(J),void 0===e.origJson&&n.origJson&&void 0!==T&&n.origJson(T),void 0===e.layoutParams&&n.layoutParams&&void 0!==B&&n.layoutParams(B),o=O.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?Y=!1:(Y=!0,L.logError(G(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=L.getDerivedFromVars(O.width),z(),z=a(s,(t=>C=t)),l=L.getDerivedFromVars(O.height),S(),S=a(l,(t=>k=t));{let t={};"wrap_content"===(null==C?void 0:C.type)&&(t.parentHorizontalWrapContent=!0),k&&"wrap_content"!==k.type||(t.parentVerticalWrapContent=!0),Q=xt(t,Q)}if(!Y&&(it<0||it>=o.length)&&(L.logError(G(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:O.selected_tab,length:o.length}})),it=it<0?0:o.length-1),u=L.getDerivedFromVars(O.tab_title_style),D(),D=a(u,(t=>x=t)),c=x||{},ot=Pt(c.font_size,ot),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ot*10,right:(Number(t.right)||0)/ot*10,bottom:(Number(t.bottom)||0)/ot*10,left:(Number(t.left)||0)/ot*10};at=_t(e,at)}{const t=c.line_height;void 0!==t&&zt(t)&&(st=K(t/ot*10))}{const t=c.letter_spacing;void 0!==t&&mt(t)&&(lt=K(t/ot*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(I=c.corner_radius)&&void 0!==I?I:1e3;c.corners_radius?ut=yt(c.corners_radius,t,ot,ut):mt(t)&&(ut=K(t/ot*10))}return rt=It(c.active_font_weight||c.font_weight,rt),nt=It(c.inactive_font_weight||c.font_weight,nt),ct=et(c.active_text_color,1,ct),dt=et(c.inactive_text_color,1,dt),vt=et(c.active_background_color,1,vt),gt=et(c.inactive_background_color,1,gt),d=L.getDerivedFromVars(O.has_separator),V(),V=a(d,(t=>$=t)),g=L.getDerivedFromVars(O.separator_color),A(),A=a(g,(t=>w=t)),p=L.getDerivedFromVars(O.separator_paddings),E(),E=a(p,(t=>b=t)),$&&(w&&(ft=et(w,1,ft)),b&&(ht=_t(b,ht))),f={background:ft,margin:ht},h=L.getDerivedFromVars(O.switch_tabs_by_content_swipe_enabled),F(),F=a(h,(t=>y=t)),m=void 0===y||Boolean(y),Y||(kt=o.map(((t,e)=>e===it)),Ct=o.map(((t,e)=>e===it))),F(),E(),A(),V(),D(),S(),z(),Y?"":`${M(Dt,"Outer").$$render(t,{cls:pt("tabs",oe,{}),json:O,origJson:T,templateContext:J,layoutParams:B,customActions:"tabs"},{},{default:()=>`<div${N("class",oe.tabs__list,0)} role="tablist"${U({"--divkit-tabs-font-size":K(ot),"--divkit-tabs-paddings":at,"--divkit-tabs-line-height":st,"--divkit-tabs-letter-spacing":lt,"--divkit-tabs-active-font-weight":rt||"","--divkit-tabs-inactive-font-weight":nt||"","--divkit-tabs-active-text-color":ct,"--divkit-tabs-inactive-text-color":dt,"--divkit-tabs-active-background-color":vt,"--divkit-tabs-inactive-background-color":gt,"--divkit-tabs-border-radius":ut})}${N("this",W,0)}>${P(o,((e,r)=>{let n=r===it;return`\n\n ${M(Et,"Actionable").$$render(t,{cls:pt("tabs__item",oe,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action?[e.title_click_action]:[],attrs:{id:`${R}-tab-${r}`,"aria-controls":`${R}-panel-${r}`,role:"tab",tabindex:n?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:t=>function(t,e){return it===e||(Ft(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${$?`<div${N("class",oe.tabs__separator,0)}${N("style",X(f),0)}></div>`:""}\n <div${N("class",oe.tabs__panels,0)}${N("this",q,0)}><div${N("class",pt("tabs__swiper",oe,{inited:bt,animated:wt}),0)}${N("this",Z,0)}>${P(o,((e,r)=>`<div${N("class",pt("tabs__panel",oe,{visible:Ct[r]}),0)} role="tabpanel" id="${j(R,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(R,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${kt[r]?`${M(Te,"Unknown").$$render(t,{div:e.div,templateContext:J,layoutParams:Q},{},{})}`:""}\n </div>`))}</div></div>`})}`})),se=ae,le="divkit-eb86",ue="divkit-e08c";function ce(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)}}ce([.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]),ce([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 de=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(H);let c=new Map,g=new Set,p=!1,f=null,h=[],m=[],y=[],b=[];const w=o.div_id||o.id;w?(v(ft).registerInstance(w,{async setState(t){if($===t)return;u.setRunning("stateChange",!0),new Set(g),h.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),h=[],b.forEach((t=>{c.set(t.id,t.node.getBoundingClientRect())})),m=[],y=[],b=[];const e=i.find((e=>e.state_id===t))||null;e?($=t,x=e):u.logError(G(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(f&&f.has(t))return f.get(t);u.logError(G(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(ft,{registerInstance(t,e){f||(f=new Map),f.has(t)?u.logError(G(new Error("Duplicate state with id"),{additional:{id:t}})):f.set(t,e)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return m.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return y.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 b.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&c.has(t),registerChild(t){g.add(t)},unregisterChild(t){g.delete(t)}})):(p=!0,u.logError(G(new Error('Missing "id" prop for div "state"'))));let $,x=null;const k=u.getJsonWithVars(o.default_state_id);let C=!1;return void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(g=new Set),i=o.states||[],(null==i?void 0:i.length)?p=!1:(p=!0,u.logError(G(new Error('Empty "states" prop for div "state"')))),function(t){C||(C=!0,t.length&&(k?($=k,x=t.find((t=>t.state_id===$))||null,x||u.logError(G(new Error("Cannot find state for default_state_id"),{additional:{selectedId:$}}))):(x=t[0],$=x.state_id)))}(i),p?"":`${M(Dt,"Outer").$$render(t,{cls:"divkit-b8ef",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=x)&&void 0!==e&&e.div?`${M(Te,"Unknown").$$render(t,{div:x.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaa",0)}${N("this",undefined,0)}>${P(h,(e=>"direction"in e?`<div${N("class",le,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",ue,0)}>${M(Te,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`:`<div${N("class",le,0)}><div${N("class",ue,0)}>${M(Te,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`))}</div>`}})}`})),ve={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},ge=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$=r,x=r,k=r,C=r,F=r;var E,A,V,j,D,S,z;let{json:I={}}=e,{templateContext:O}=e,{origJson:J}=e,{layoutParams:T}=e;const U=v(H),B=U.genId("pager");let L,R=!1,W=0,q=!1,Z="horizontal",Y="",tt="",et="";function rt(t,e="smooth"){const r="horizontal"===Z,n=L.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";L.scroll({[o]:n[i],behavior:e}),W=t}I.id&&U.registerInstance(I.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');rt(t)},setPreviousItem(t){let e=W-1;e<0&&(e="ring"===t?o.length-1:W),rt(e)},setNextItem(t){let e=W+1;e>o.length-1&&(e="ring"===t?0:W),rt(e)}}),void 0===e.json&&n.json&&void 0!==I&&n.json(I),void 0===e.templateContext&&n.templateContext&&void 0!==O&&n.templateContext(O),void 0===e.origJson&&n.origJson&&void 0!==J&&n.origJson(J),void 0===e.layoutParams&&n.layoutParams&&void 0!==T&&n.layoutParams(T),(null===(E=I.items)||void 0===E?void 0:E.length)&&Array.isArray(I.items)?R=!1:(R=!0,U.logError(G(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!R&&I.items||[]).map((t=>{let e=t,r=O;return({templateContext:r,json:e}=U.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=U.getDerivedFromVars(I.layout_mode),x(),x=a(s,(t=>y=t)),y?"percentage"!==y.type&&"fixed"!==y.type?(q=!0,U.logError(G(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):q=!1:(q=!0,U.logError(G(new Error('Empty "layout_mode" prop for div "pager"')))),l=U.getDerivedFromVars(I.orientation),F(),F=a(l,(t=>w=t)),Z=Wt(w,Z),u=U.getDerivedFromVars(I.item_spacing),C(),C=a(u,(t=>b=t));{const t=null==b?void 0:b.value;t&&mt(t)&&(Y=K(t||0))}if(c=U.getDerivedFromVars(I.paddings),k(),k=a(c,(t=>_=t)),tt=_t(_,tt),d="horizontal"===Z?"grid-auto-columns":"grid-auto-rows","fixed"===(null==y?void 0:y.type)){const t=Q("horizontal"===Z?((null===(A=I.paddings)||void 0===A?void 0:A.left)||0)+((null===(V=I.paddings)||void 0===V?void 0:V.right)||0):((null===(j=I.paddings)||void 0===j?void 0:j.top)||0)+((null===(D=I.paddings)||void 0===D?void 0:D.bottom)||0)),e=null===(S=y.neighbour_page_width)||void 0===S?void 0:S.value;et=e?`calc(100% + ${t} - 2 * ${Q(e)} - 2 * ${Y})`:"100%"}else if("percentage"===(null==y?void 0:y.type)){const t=null===(z=y.page_width)||void 0===z?void 0:z.value;et=`${Number(t)}%`}return g={"grid-gap":Y,padding:tt,[d]:et},p={orientation:Z},f=R||q,h=U.getStore("pagers"),$(),$=a(h,(t=>m=t)),function(t,e){const r=I.id;if(r){const o=new Map(m);n=h,m=o.set(r,{instId:B,size:t,currentItem:e,scrollToPagerItem:rt}),i=m,n.set(i)}var n,i}(o.length,W),$(),x(),k(),C(),F(),f?"":`${M(Dt,"Outer").$$render(t,{cls:pt("pager",ve,p),json:I,origJson:J,templateContext:O,layoutParams:T,customPaddings:!0},{},{default:()=>`<div${N("class",ve.pager__items,0)}${N("style",X(g),0)}${N("this",L,0)}>${P(o,(e=>`<div${N("class",ve.pager__item,0)}>${M(Te,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}\n </div>`))}</div>`})}`})),pe=ge,fe={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},he=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,b=r,w=r,$=r,x=r,k=r,C=r,{json:F={}}=e,{templateContext:E}=e,{origJson:A}=e,{layoutParams:V}=e;const D=v(H);let S,z,I,O=10,J=10,T=5,B="#ffdc60",L=et("#33919cb5"),R=15,q=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==E&&n.templateContext(E),void 0===e.origJson&&n.origJson&&void 0!==A&&n.origJson(A),void 0===e.layoutParams&&n.layoutParams&&void 0!==V&&n.layoutParams(V),o=D.getDerivedFromVars(F.shape),C(),C=a(o,(t=>y=t)),y&&(y.item_width&&(O=bt(y.item_width.value,O)),y.item_height&&(J=bt(y.item_height.value,J)),y.corner_radius&&(T=bt(y.corner_radius.value,T))),s=D.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),B=et(m,1,B),l=D.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>h=t)),L=et(h,1,L),u=D.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>f=t)),f&&(R=bt(f.value,R)),c=D.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>p=t)),q=Pt(p,q),d=D.getStore("pagers"),b(),b=a(d,(t=>g=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){I=t.get(F.pager_id),await _();const e=z.children[I.currentItem].offsetLeft;S.scroll({left:e-S.clientWidth/2,behavior:"smooth"})}}(g),b(),w(),$(),x(),k(),C(),`${M(Dt,"Outer").$$render(t,{cls:pt("indicator",fe,{}),json:F,origJson:A,templateContext:E,layoutParams:V},{},{default:()=>`<div${N("class",fe.indicator__scroller,0)}${N("this",S,0)}><div${N("class",fe.indicator__items,0)} role="tablist"${U({margin:`0 ${K((q-1)*O/2)}`,"--divkit-indicator-width":K(O),"--divkit-indicator-height":K(J),"--divkit-indicator-border-radius":K(T),"--divkit-indicator-active-color":B,"--divkit-indicator-inactive-color":L,"--divkit-indicator-active-scale":q,"--divkit-indicator-margin":`0 ${K((R-O)/2)}`})}${N("this",z,0)}>${I?`${P(Array(I.size),((t,e)=>{let r=e===I.currentItem;return`\n <div class="${j(pt("indicator__item",fe,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(I.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(I.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),me=he,ye={slider:"divkit-ef4f",slider__input:"divkit-d1d6",slider__input_secondary:"divkit-c798",slider__thumb:"divkit-f345",slider__thumb_secondary:"divkit-e198","slider__tracks-wrapper":"divkit-f733","slider__tracks-inner":"divkit-ac90",slider__track:"divkit-e956","slider__active-track":"divkit-ec5b","slider__thumb-text-wrapper":"divkit-ee57","slider__thumb-text":"divkit-c4af","slider__thumb-text_secondary":"divkit-d882",slider__tick:"divkit-bd9b",slider__tick_active:"divkit-d8ce",slider__tick_inactive:"divkit-e71e"};function _e(t,e){var r,n,i;if(!t||!t.shape||!t.color)return e;const o=et(t.color),a=Number((null===(r=t.shape.item_width)||void 0===r?void 0:r.value)||10),s=Number((null===(n=t.shape.item_height)||void 0===n?void 0:n.value)||10),l=Number((null===(i=t.shape.corner_radius)||void 0===i?void 0:i.value)||5);if("shape_drawable"===t.type&&"transparent"!==o&&"rounded_rectangle"===t.shape.type){var u,c;const e={},r=null!==(u=t.stroke)&&void 0!==u&&u.color?et(t.stroke.color):"",n=null!==(c=t.stroke)&&void 0!==c&&c.width?Number(t.stroke.width||1):"";return e.width=a,e.height=s,e.borderRadius=l,e.background=o,r&&n&&(e.boxShadow=`inset 0 0 0 ${K(n)} ${r}`),e}return e}function be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&et(t.text_color)||"#000",i=Mt(t.font_weight);if(zt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:K(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 we(t,e,r){return Math.max(e,Math.min(r,t))}const $e=2147483647,xe=-2147483648,ke=Number.MAX_VALUE,Ce=Number.MIN_VALUE,Fe="string",Ee="integer",Ae="number",Ve="boolean",je="color",De="datetime";class Se{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=L(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 Pe={string:class extends Se{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Se{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 Se{convertValue(t){if("number"!=typeof t||isNaN(t)||t>$e||t<xe||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 Se{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 Se{convertValue(t){if("string"!=typeof t||!rt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Se{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function ze(t,e,r){if(!(e in Pe))throw new Error("Unsupported variable type");return new Pe[e](t,r)}function Me(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 Ie=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,z,I,O,J,T,B,L,R,W,q,Z,Y,X,tt,et,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r,ct=r,dt=r,vt=r,gt=r;var ft,ht,yt,_t,bt,wt,$t,xt;let{json:kt={}}=e,{templateContext:Ft}=e,{origJson:Et}=e,{layoutParams:At}=e;const Vt={width:10,height:10,borderRadius:5,background:"#000"},St=v(H),Pt=v(Ct);let zt=0,Mt=100;const It=St.getJsonWithVars(kt.thumb_value_variable),Ot=St.getJsonWithVars(kt.thumb_secondary_value_variable);X=a(It&&St.getVariable(It,"integer")||ze("temp","integer",0),(t=>Y=t)),Z=a(Ot&&St.getVariable(Ot,"integer")||ze("temp","integer",0),(t=>q=t));let Jt,Nt,Tt,Ut=we(Y||0,zt,Mt),Bt=we(q||0,zt,Mt),Lt=Vt,Rt=Lt,Wt=Vt,qt=Vt,Ht=null,Gt=null,Zt=Tt,Yt="",Xt="",Kt=!1;void 0===e.json&&n.json&&void 0!==kt&&n.json(kt),void 0===e.templateContext&&n.templateContext&&void 0!==Ft&&n.templateContext(Ft),void 0===e.origJson&&n.origJson&&void 0!==Et&&n.origJson(Et),void 0===e.layoutParams&&n.layoutParams&&void 0!==At&&n.layoutParams(At),o=St.getDerivedFromVars(kt.min_value),gt(),gt=a(o,(t=>et=t)),s=St.getDerivedFromVars(kt.max_value),vt(),vt=a(s,(t=>tt=t)),zt=jt(et,zt),Mt=jt(tt,Mt);{const t=we(Y||0,zt,Mt);t!==Ut&&(Ut=t)}{const t=we(q||0,zt,Mt);t!==Bt&&(Bt=t)}if(l=St.getDerivedFromVars(kt.thumb_style),dt(),dt=a(l,(t=>W=t)),Lt=_e(W,Lt),u=St.getDerivedFromVars(kt.thumb_secondary_style),ct(),ct=a(u,(t=>R=t)),Rt=_e(R,Lt),c=St.getDerivedFromVars(kt.track_inactive_style),ut(),ut=a(c,(t=>L=t)),Wt=_e(L,Wt),d=St.getDerivedFromVars(kt.track_active_style),lt(),lt=a(d,(t=>B=t)),qt=_e(B,qt),g=Mt-zt+1<=20,p=St.getDerivedFromVars(kt.tick_mark_active_style),st(),st=a(p,(t=>T=t)),g){let t=_e(T,Vt);t!==Vt&&(Ht=t)}else Ht=null;if(Jt=Ht?Ot?Me(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!0):Me(zt,Ut,zt,Mt,!0):[],f=St.getDerivedFromVars(kt.tick_mark_inactive_style),at(),at=a(f,(t=>J=t)),g){let t=_e(J,Vt);t!==Vt&&(Gt=t)}else Gt=null;Nt=Gt?Ot?Me(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!1):Me(Ut+1,Mt+1,zt,Mt,!0):[],h=St.getDerivedFromVars(kt.thumb_text_style),ot(),ot=a(h,(t=>O=t)),Tt=be(O,Tt),m=St.getDerivedFromVars(kt.thumb_secondary_text_style),it(),it=a(m,(t=>I=t)),Zt=be(I,Tt),y=St.getDerivedFromVars(kt.accessibility),nt(),nt=a(y,(t=>z=t)),(null==z?void 0:z.description)?Yt=z.description:St.logError(G(new Error('Missing accessibility "description" for slider'),{level:"warn"})),_=St.getDerivedFromVars(kt.secondary_value_accessibility),rt(),rt=a(_,(t=>S=t)),(null==S?void 0:S.description)?Xt=S.description:Ot&&St.logError(G(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Pt.hasAction()?(St.logError(G(new Error('Cannot show "slider" inside component with action'))),t=!0):Lt===Vt?(St.logError(G(new Error('Missing "thumb_style" in slider'))),t=!0):qt===Vt?(St.logError(G(new Error('Missing "track_active_style" in slider'))),t=!0):Wt===Vt&&(St.logError(G(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Kt&&(Kt=t)}return b=Math.max(...[Lt.height,Rt.height,Wt.height,qt.height,0].filter(mt)),w=K(Math.max(...[Lt.width,Rt.width,0].filter(mt))),$=K(Math.max(...[Lt.height,Rt.height,0].filter(mt))),x=(Ut-zt)/(Mt-zt),k=Ot?(Bt-zt)/(Mt-zt):void 0,C=void 0!==k?Math.abs(k-x):x,F=void 0!==k?Math.min(k,x):0,E=-Math.min(...[(b-Lt.height)/2+((null===(ft=null==Tt?void 0:Tt.offset)||void 0===ft?void 0:ft.y)||0),Ot?(b-Rt.height)/2+((null===(ht=null==Zt?void 0:Zt.offset)||void 0===ht?void 0:ht.y)||0):0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),A=Math.max(...[((null===(yt=null==Tt?void 0:Tt.offset)||void 0===yt?void 0:yt.y)||0)-(b-Lt.height)/2,Ot?((null===(_t=null==Zt?void 0:Zt.offset)||void 0===_t?void 0:_t.y)||0)-(b-Rt.height)/2:0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),V={"--divkit-slider-thumb-width":K(Lt.width),"--divkit-slider-thumb-height":K(Lt.height),"--divkit-slider-thumb-secondary-width":K(Rt.width),"--divkit-slider-thumb-secondary-height":K(Rt.height),"--divkit-slider-text-offset-x":(null===(bt=null==Tt?void 0:Tt.offset)||void 0===bt?void 0:bt.x)?Q(Tt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(wt=null==Tt?void 0:Tt.offset)||void 0===wt?void 0:wt.y)?Q(Tt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===($t=null==Zt?void 0:Zt.offset)||void 0===$t?void 0:$t.x)?Q(Zt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(xt=null==Zt?void 0:Zt.offset)||void 0===xt?void 0:xt.y)?Q(Zt.offset.y):void 0,"--divkit-slider-tick-active-width":Ht?K(Ht.width):void 0,"--divkit-slider-tick-active-height":Ht?K(Ht.height):void 0,"--divkit-slider-tick-active-border-radius":Ht?K(Ht.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Ht?void 0:Ht.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Ht?void 0:Ht.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Gt?K(Gt.width):void 0,"--divkit-slider-tick-inactive-height":Gt?K(Gt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Gt?K(Gt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Gt?void 0:Gt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Gt?void 0:Gt.boxShadow)||void 0,"--divkit-slider-max-height":K(b),"--divkit-slider-max-thumb-width":w,"--divkit-slider-max-thumb-height":$,"--divkit-slider-track-part":x,"--divkit-slider-track-secondary-part":k,"--divkit-slider-offset-top":Q(E),"--divkit-slider-offset-bottom":Q(A)},D={},rt(),nt(),it(),ot(),at(),st(),lt(),ut(),ct(),dt(),Z(),X(),vt(),gt(),Kt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("slider",ye,D),style:V,customDescription:!0,customActions:"slider",json:kt,origJson:Et,templateContext:Ft,layoutParams:At},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",ye["slider__tracks-wrapper"],0)}>${Tt||Ot&&Zt?`<div${N("class",ye["slider__thumb-text-wrapper"],0)} aria-hidden="true">${Tt?`<div${N("class",ye["slider__thumb-text"],0)}><div${N("class",ye["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Tt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Tt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Tt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Ut)}</div></div>`:""}\n ${Ot?`<div class="${j(ye["slider__thumb-text"],!0)+" "+j(ye["slider__thumb-text_secondary"],!0)}"><div${N("class",ye["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Zt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Zt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Zt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Bt)}</div></div>`:""}</div>`:""}\n <div${N("class",ye["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",ye.slider__track,0)}${U({height:K(Wt.height),"border-radius":K(Wt.borderRadius),background:Wt.background,"box-shadow":Wt.boxShadow||""})}></div>\n <div${N("class",ye["slider__active-track"],0)}${U({left:(100*F).toFixed(2)+"%",width:(100*C).toFixed(2)+"%",height:K(qt.height),"border-radius":K(qt.borderRadius),background:qt.background,"box-shadow":qt.boxShadow||""})}></div>\n ${P(Jt,(t=>`<div class="${j(ye.slider__tick,!0)+" "+j(ye.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Nt,(t=>`<div class="${j(ye.slider__tick,!0)+" "+j(ye.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",ye.slider__thumb,0)}${U({"border-radius":K(Lt.borderRadius),background:Lt.background,"box-shadow":Lt.boxShadow||""})}></div>\n ${Ot?`<div class="${j(ye.slider__thumb,!0)+" "+j(ye.slider__thumb_secondary,!0)}"${U({"border-radius":K(Rt.borderRadius),background:Rt.background,"box-shadow":Rt.boxShadow||""})}></div>`:""}\n <input type="range"${N("class",ye.slider__input,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Ut,0)}${N("aria-label",Yt,0)}>\n ${Ot?`<input type="range"${N("class",`${ye.slider__input} ${ye.slider__input_secondary}`,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Bt,0)}${N("aria-label",Xt,0)}>`:""}</div></div>`}})}`})),Oe={input:"divkit-c3a4",input__wrapper:"divkit-ef7e",input__holder:"divkit-bb3d",input_multiline:"divkit-e48a",input__input:"divkit-f11e","input_highlight-color":"divkit-cc00","input_vertical-overflow":"divkit-b707"},Je={text:Ut,container:Lt,separator:qt,image:Gt,gif:Gt,grid:te,gallery:ie,tabs:se,state:de,pager:pe,indicator:me,slider:Ie,input:J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,P,z,I,O,J,T,U,B=r,L=r,{json:R={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:Z}=e;const Y=v(H);let X;const tt=Y.getJsonWithVars(R.text_variable);let rt=!1;tt||(rt=!0,Y.logError(G(new Error('Missing "text_variable" in "input"')))),J=a(tt&&Y.getVariable(tt,"string")||ze("temp","string",""),(t=>O=t));let nt="";I=a(Y.getDerivedFromVars(R.hint_text),(t=>z=t)),P=a(Y.getDerivedFromVars(R.hint_color),(t=>S=t));let it="";D=a(Y.getDerivedFromVars(R.font_size),(t=>V=t));let ot,at,st=12;A=a(Y.getDerivedFromVars(R.font_weight),(t=>E=t)),F=a(Y.getDerivedFromVars(R.line_height),(t=>C=t)),k=a(Y.getDerivedFromVars(R.letter_spacing),(t=>x=t));let lt="";$=a(Y.getDerivedFromVars(R.text_color),(t=>w=t));let ut="#000";b=a(Y.getDerivedFromVars(R.highlight_color),(t=>_=t));let ct="";y=a(Y.getDerivedFromVars(R.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",gt="text";h=a(Y.getDerivedFromVars(R.max_visible_lines),(t=>f=t));let ft="",mt="";U=a(Y.getDerivedFromVars(R.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==Z&&n.layoutParams(Z),nt=O,o=z,it=et(S,1,it),st=Pt(V,st),ot=It(E,ot);{const t=C;zt(t)&&(at=t/st)}return ht(x)&&(lt=K(x/st*10)),ut=et(w,1,ut),ct=et(_,1,ct),m&&m in dt&&(gt=dt[m],vt=m),s="multi_line_text"===vt,l=Y.getDerivedFromVars(R.paddings),L(),L=a(l,(t=>p=t)),zt(f)&&(ft=`calc(${f*(at||1.25)+"em"} + ${Q(bt(null==p?void 0:p.top,0)+bt(null==p?void 0:p.bottom,0))})`),u=Y.getDerivedFromVars(R.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?mt=g.description:Y.logError(G(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ct,"font-size":K(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":ft},B(),L(),h(),y(),b(),$(),k(),F(),A(),D(),P(),I(),J(),U(),rt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("input",Oe,c),style:d,customDescription:!0,customActions:"input",json:R,origJson:q,templateContext:W,layoutParams:Z},{},{default:()=>`<span${N("class",Oe.input__wrapper,0)}><span${N("class",Oe.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",Oe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",X,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",Oe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",X,0)}>`}</span>`})}`}))},Ne=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(H);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!==s&&r.layoutParams(s),u=i,c=o,d=u&&Je[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&Je[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(G(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),Te=Ne,Ue=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-dc22",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>`<filter${N("id",i[t],0)}><feFlood${N("flood-color",t,0)}></feFlood><feComposite in2="SourceGraphic" operator="in"></feComposite></filter>`))}</defs></svg>`:""}));function Be(t,e,r,n){const i=r[t.type];if(!i)return n(G(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),l.forEach((e=>{const o=i[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else n(G(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)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Le(){}function Re(t){return{subscribe:e=>(e(t),Le)}}function We(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function qe(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function He(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 Ge(t){var e=parseInt(t,10);if(e>$e||e<xe)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function Ze(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Ye(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Ye.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Xe(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Ke(t,e){var r,n,i,o,a={},s=(e=void 0!==e?e:{}).grammarSource,l={start:St,JsonStringContents:function(){var t,e,r;for(t=_t,e=[],r=Pt();r!==a;)e.push(r),r=Pt();return bt=t,e=yt(e)}},u=St,c="@{",d="}",v="@{}",g="\\",p="||",f="&&",h="==",m="!=",y=">=",_="<=",b="+",w="-",$="true",x="false",k=/^[^}]/,C=/^[^'}]/,F=/^[0-9]/,E=/^[a-zA-Z_0-9.]/,A=/^[a-zA-Z_]/,V=/^[ \t\r\n]/,j=Ft("@{",!1),D=Ft("}",!1),S=Ft("@{}",!1),P=Ft("\\",!1),z={type:"any"},M=Et(["}"],!0,!1),I=Ft("?",!1),O=Ft(":",!1),J=Ft("||",!1),N=Ft("&&",!1),T=Ft("==",!1),U=Ft("!=",!1),B=Ft(">=",!1),L=Ft(">",!1),R=Ft("<=",!1),W=Ft("<",!1),q=Ft("+",!1),H=Ft("-",!1),G=Ft("/",!1),Z=Ft("*",!1),Y=Ft("%",!1),X=Ft("!",!1),K=Ft("(",!1),Q=Ft(")",!1),tt=Ft(",",!1),et=At("string"),rt=Ft("'",!1),nt=Et(["'","}"],!0,!1),it=At("integer"),ot=Et([["0","9"]],!1,!1),at=At("number"),st=Ft(".",!1),lt=Ft("e",!1),ut=Ft("E",!1),ct=At("boolean"),dt=Ft("true",!1),vt=Ft("false",!1),gt=Et([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),pt=At("identifier"),ft=Et([["a","z"],["A","Z"],"_"],!1,!1),ht=At("whitespace"),mt=Et([" ","\t","\r","\n"],!1,!1),yt=function(t){return He(t)},_t=0,bt=0,wt=[{line:1,column:1}],$t=0,xt=[],kt=0;if("startRule"in e){if(!(e.startRule in l))throw new Error("Can't start parsing from rule \""+e.startRule+'".');u=l[e.startRule]}function Ct(){return t.substring(bt,_t)}function Ft(t,e){return{type:"literal",text:t,ignoreCase:e}}function Et(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){return{type:"other",description:t}}function Vt(e){var r,n=wt[e];if(n)return n;for(r=e-1;!wt[r];)r--;for(n={line:(n=wt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return wt[e]=n,n}function jt(t,e){var r=Vt(t),n=Vt(e);return{source:s,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Dt(t){_t<$t||(_t>$t&&($t=_t,xt=[]),xt.push(t))}function St(){var t,e;return t=_t,qt(),(e=zt())!==a?(qt(),bt=t,t=e):(_t=t,t=a),t}function Pt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M)),i!==a)for(;i!==a;)n.push(i),k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ze(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function zt(){var e,r,n,i,o,s;return e=_t,(r=Mt())!==a?(qt(),63===t.charCodeAt(_t)?(n="?",_t++):(n=a,0===kt&&Dt(I)),n!==a?(qt(),(i=zt())!==a?(qt(),58===t.charCodeAt(_t)?(o=":",_t++):(o=a,0===kt&&Dt(O)),o!==a?(qt(),(s=zt())!==a?(bt=e,e={type:"ConditionalExpression",test:r,consequent:i,alternate:s}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=Mt()),e}function Mt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=It())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(u=It())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(u=It())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=qe(r,n)}else _t=e,e=a;return e}function It(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Ot())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(u=Ot())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(u=Ot())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=qe(r,n)}else _t=e,e=a;return e}function Ot(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Jt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(u=Jt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(u=Jt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Jt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Nt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(u=Nt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(u=Nt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Nt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Tt())!==a){for(n=[],i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(u=Tt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(u=Tt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Tt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Ut())!==a){for(n=[],i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(u=Ut())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(u=Ut())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Ut(){var e,r,n;return(e=Rt())===a&&(e=Lt())===a&&(e=_t,33===t.charCodeAt(_t)?(r="!",_t++):(r=a,0===kt&&Dt(X)),r===a&&(43===t.charCodeAt(_t)?(r=b,_t++):(r=a,0===kt&&Dt(q)),r===a&&(45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)))),r!==a?(qt(),(n=Ut())!==a?(bt=e,e={type:"UnaryExpression",operator:r,argument:n}):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=function(){var e,r,n,i,o;return e=_t,(r=Wt())!==a?(qt(),40===t.charCodeAt(_t)?(n="(",_t++):(n=a,0===kt&&Dt(K)),n!==a?(qt(),i=function(){var e,r,n,i,o,s,l;if(e=_t,(r=zt())!==a){for(n=[],i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);bt=e,l=n,e=[r,...l]}else _t=e,e=a;return e===a&&(e=qt()),e}(),i!==a?(qt(),41===t.charCodeAt(_t)?(o=")",_t++):(o=a,0===kt&&Dt(Q)),o!==a?(bt=e,e={type:"CallExpression",callee:r,arguments:i}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,(r=Wt())!==a&&(bt=e,r={type:"Variable",id:r}),(e=r)===a&&(e=function(){var e,r,n,i;return e=function(){var e,r,n,i;return kt++,e=_t,39===t.charCodeAt(_t)?(r="'",_t++):(r=a,0===kt&&Dt(rt)),r!==a?(n=function(){var t,e,r;for(t=_t,e=[],r=Bt();r!==a;)e.push(r),r=Bt();return bt=t,e=He(e)}(),39===t.charCodeAt(_t)?(i="'",_t++):(i=a,0===kt&&Dt(rt)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(et)),e}(),e===a&&(e=Rt())===a&&(e=Lt())===a&&(e=function(){var e,r;return kt++,e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===a&&(e=_t,t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!1}),e=r),kt--,e===a&&(r=a,0===kt&&Dt(ct)),e}(),e===a&&(e=_t,40===t.charCodeAt(_t)?(r="(",_t++):(r=a,0===kt&&Dt(K)),r!==a&&(n=zt())!==a?(41===t.charCodeAt(_t)?(i=")",_t++):(i=a,0===kt&&Dt(Q)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a))),e}())),e}())),e}function Bt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(39===t.charCodeAt(_t)?(n="'",_t++):(n=a,0===kt&&Dt(rt)),n===a&&(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ze(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Lt(){var e,r,n,i;if(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;return n!==a?(bt=e,e={type:"IntegerLiteral",value:Ge(Ct())}):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(it)),e}function Rt(){var e,r,n,i,o,s,l,u,c,d;for(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));if(46===t.charCodeAt(_t)?(i=".",_t++):(i=a,0===kt&&Dt(st)),i!==a){if(o=[],F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot)),s!==a)for(;s!==a;)o.push(s),F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot));else o=a;if(o!==a){if(s=_t,101===t.charCodeAt(_t)?(l="e",_t++):(l=a,0===kt&&Dt(lt)),l===a&&(69===t.charCodeAt(_t)?(l="E",_t++):(l=a,0===kt&&Dt(ut))),l!==a){if(43===t.charCodeAt(_t)?(u=b,_t++):(u=a,0===kt&&Dt(q)),u===a&&(45===t.charCodeAt(_t)?(u=w,_t++):(u=a,0===kt&&Dt(H))),u===a&&(u=null),c=[],F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot)),d!==a)for(;d!==a;)c.push(d),F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot));else c=a;c!==a?s=l=[l,u,c]:(_t=s,s=a)}else _t=s,s=a;s===a&&(s=null),bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}}else _t=e,e=a}else _t=e,e=a;if(e===a){if(e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;if(n!==a)if(101===t.charCodeAt(_t)?(i="e",_t++):(i=a,0===kt&&Dt(lt)),i===a&&(69===t.charCodeAt(_t)?(i="E",_t++):(i=a,0===kt&&Dt(ut))),i!==a){if(43===t.charCodeAt(_t)?(o=b,_t++):(o=a,0===kt&&Dt(q)),o===a&&(45===t.charCodeAt(_t)?(o=w,_t++):(o=a,0===kt&&Dt(H))),o===a&&(o=null),s=[],F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot)),l!==a)for(;l!==a;)s.push(l),F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot));else s=a;s!==a?(bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}):(_t=e,e=a)}else _t=e,e=a;else _t=e,e=a}return kt--,e===a&&(r=a,0===kt&&Dt(at)),e}function Wt(){var e,r,n,i,o;if(kt++,e=_t,r=_t,kt++,n=function(){var e,r,n,i;return e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r===a&&(t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt))),r!==a?(n=_t,kt++,E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(gt)),kt--,i===a?n=void 0:(_t=n,n=a),n!==a?e=r=[r,n]:(_t=e,e=a)):(_t=e,e=a),e}(),kt--,n===a?r=void 0:(_t=r,r=a),r!==a)if(A.test(t.charAt(_t))?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(ft)),n!==a){for(i=[],E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));o!==a;)i.push(o),E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));bt=e,e={type:"Identifier",name:Ct()}}else _t=e,e=a;else _t=e,e=a;return kt--,e===a&&(r=a,0===kt&&Dt(pt)),e}function qt(){var e,r;for(kt++,e=[],V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));r!==a;)e.push(r),V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));return kt--,r=a,0===kt&&Dt(ht),e}if((r=u())!==a&&_t===t.length)return r;throw r!==a&&_t<t.length&&Dt({type:"end"}),n=xt,i=$t<t.length?t.charAt($t):null,o=$t<t.length?jt($t,$t+1):jt($t,$t),new Ye(Ye.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Ye,Error),Ye.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,s=Xe("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+Xe("",i.column-1," ")+Xe("",u,"^")}else e+="\n at "+o}return e},Ye.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 Qe=new Map,tr=new Map;function er(t,e,r){const n={args:e,cb:r},i=Qe.get(t)||[];Qe.has(t)||Qe.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");tr.set(o,n)}function rr(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 nr(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=>{nr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":nr(t.left,e),nr(t.right,e);break;case"UnaryExpression":nr(t.argument,e);break;case"ConditionalExpression":nr(t.test,e),nr(t.consequent,e),nr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{nr(t,e)}))}}function ir(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function or(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 or(t.value);if("color"===t.type)return fr(pr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function sr(t){let e=ar(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function lr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const ur=new Int32Array(1);function cr(t){return ur[0]=t,ur[0]}function dr(t){if(t<xe||t>$e)throw new Error("Integer overflow.")}function vr(t){const e=[];return nr(t,{Variable(t){e.push(t.id.name)}}),e}function gr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function pr(t){const e=rt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function fr(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 tt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function hr(t){return{type:Fe,value:ar(t)}}function mr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ae,value:e}}function yr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ee&&(r=cr(r)),{type:t.type,value:r}}function _r(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ee&&(r=cr(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===Ee&&(e=cr(e));return{type:t[0].type,value:e}}function wr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ee&&(e=cr(e));return{type:t.length?t[0].type:Ee,value:e}}function $r(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ee&&(e=cr(e));return{type:t.length?t[0].type:Ee,value:e}}function xr(t){const e=Math.abs(t.value);return t.type===Ee&&dr(e),{type:t.type,value:e}}function kr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function Cr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function Fr(t){return{type:t.type,value:Math.sign(t.value)}}function Er(t,e){let r;if(0===e.value&&t.type===Ee)r=t.value;else if(0===t.value&&t.type===Ee)r=0;else{let n=Math.sign(e.value);t.type===Ae&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ee&&dr(r),{type:t.type,value:r}}function Ar(t){return e=>{const r=pr(e.value);return{type:Ae,value:r[t]/255}}}function Vr(t){return(e,r)=>{const n=pr(e.value);return n[t]=255*r.value,{type:e.type,value:fr(n)}}}const jr=Ar("a"),Dr=Ar("r"),Sr=Ar("g"),Pr=Ar("b"),zr=Vr("a"),Mr=Vr("r"),Ir=Vr("g"),Or=Vr("b");function Jr(t){return t.map(sr).join(", ")}er("toString",[Ee],hr),er("toString",[Ae],hr),er("toString",[Ve],hr),er("toString",[je],hr),er("toString",["url"],hr),er("toNumber",[Ee],mr),er("toNumber",[Fe],mr),er("toInteger",[Ae],(function(t){if(t.value>$e||t.value<xe)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ee,value:e}})),er("toInteger",[Fe],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>$e||e<xe)throw new Error("Unable to convert value to Integer.");return{type:Ee,value:e}})),er("toInteger",[Ve],(function(t){return{type:Ee,value:t.value?1:0}})),er("toBoolean",[Ee],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ve,value:t.value}})),er("toBoolean",[Fe],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ve,value:"true"===t.value?1:0}})),er("encodeUri",[Fe],(function(t){try{return{type:Fe,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),er("decodeUri",[Fe],(function(t){try{return{type:Fe,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),er("parseUnixTime",[Ee],(function(t){return{type:De,value:new Date(1e3*t.value)}})),er("nowLocal",[],(function(){return{type:De,value:new Date}})),er("addMillis",[De,Ee],(function(t,e){return{type:De,value:new Date(t.value.getTime()+e.value)}})),er("setYear",[De,Ee],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:De,value:r}})),er("setMonth",[De,Ee],(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:De,value:r}})),er("setDay",[De,Ee],(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:De,value:r}})),er("setHours",[De,Ee],(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:De,value:r}})),er("setMinutes",[De,Ee],(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:De,value:r}})),er("setSeconds",[De,Ee],(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:De,value:r}})),er("setMillis",[De,Ee],(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:De,value:r}})),er("len",[Fe],(function(t){return{type:Ee,value:t.value.length}})),er("contains",[Fe,Fe],(function(t,e){return{type:Ve,value:t.value.includes(e.value)?1:0}})),er("substring",[Fe,Ee,Ee],(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:Fe,value:t.value.substring(e.value,r.value)}})),er("replaceAll",[Fe,Fe,Fe],(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:Fe,value:n}})),er("index",[Fe,Fe],(function(t,e){return{type:Ee,value:t.value.indexOf(e.value)}})),er("lastIndex",[Fe,Fe],(function(t,e){return{type:Ee,value:t.value.lastIndexOf(e.value)}})),er("trim",[Fe],(function(t){return{type:Fe,value:t.value.trim()}})),er("trimLeft",[Fe],(function(t){return{type:Fe,value:t.value.replace(/^\s+/,"")}})),er("trimRight",[Fe],(function(t){return{type:Fe,value:t.value.replace(/\s+$/,"")}})),er("toUpperCase",[Fe],(function(t){return{type:Fe,value:t.value.toUpperCase()}})),er("toLowerCase",[Fe],(function(t){return{type:Fe,value:t.value.toLowerCase()}})),er("div",[Ee,Ee],yr),er("div",[Ae,Ae],yr),er("mod",[Ee,Ee],_r),er("mod",[Ae,Ae],_r),er("mul",[{type:Ee,isVararg:!0}],br),er("mul",[{type:Ae,isVararg:!0}],br),er("sub",[{type:Ee,isVararg:!0}],wr),er("sub",[{type:Ae,isVararg:!0}],wr),er("sum",[{type:Ee,isVararg:!0}],$r),er("sum",[{type:Ae,isVararg:!0}],$r),er("abs",[Ee],xr),er("abs",[Ae],xr),er("max",[{type:Ee,isVararg:!0}],kr),er("max",[{type:Ae,isVararg:!0}],kr),er("min",[{type:Ee,isVararg:!0}],Cr),er("min",[{type:Ae,isVararg:!0}],Cr),er("maxNumber",[],(function(){return{type:Ae,value:ke}})),er("minNumber",[],(function(){return{type:Ae,value:Ce}})),er("maxInteger",[],(function(){return{type:Ee,value:$e}})),er("minInteger",[],(function(){return{type:Ee,value:xe}})),er("round",[Ae],(function(t){const e=Math.sign(t.value);return{type:Ae,value:e*Math.round(Math.abs(t.value))}})),er("floor",[Ae],(function(t){return{type:Ae,value:Math.floor(t.value)}})),er("ceil",[Ae],(function(t){return{type:Ae,value:Math.ceil(t.value)}})),er("signum",[Ae],Fr),er("signum",[Ee],Fr),er("copySign",[Ae,Ae],Er),er("copySign",[Ee,Ee],Er),er("getColorAlpha",[Fe],jr),er("getColorAlpha",[je],jr),er("getColorRed",[Fe],Dr),er("getColorRed",[je],Dr),er("getColorGreen",[Fe],Sr),er("getColorGreen",[je],Sr),er("getColorBlue",[Fe],Pr),er("getColorBlue",[je],Pr),er("setColorAlpha",[Fe,Ae],zr),er("setColorAlpha",[je,Ae],zr),er("setColorRed",[Fe,Ae],Mr),er("setColorRed",[je,Ae],Mr),er("setColorGreen",[Fe,Ae],Ir),er("setColorGreen",[je,Ae],Ir),er("setColorBlue",[Fe,Ae],Or),er("setColorBlue",[je,Ae],Or),er("rgb",[Ae,Ae,Ae],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Fe,value:fr(n)}})),er("argb",[Ae,Ae,Ae,Ae],(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:Fe,value:fr(i)}}));const Nr={StringLiteral:function(t,e){return{type:Fe,value:e.value}},NumberLiteral:function(t,e){return{type:Ae,value:e.value}},IntegerLiteral:function(t,e){return{type:Ee,value:e.value}},BooleanLiteral:function(t,e){return{type:Ve,value:e.value?1:0}},UnaryExpression:function(t,e){const r=ir(Tr(t,e.argument));switch(e.operator){case"!":if(r.type===Ve)return{type:Ve,value:r.value?0:1};gr(`${e.operator}${sr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ee)return{type:Ee,value:r.value*t};if(r.type===Ae)return{type:Ae,value:r.value*t};gr(`${e.operator}${sr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=ir(Tr(t,e.test));if(r.type===Ve)return r.value?Tr(t,e.consequent):Tr(t,e.alternate);gr(`${sr(r)} ? ${sr(Tr(t,e.consequent))} : ${sr(Tr(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 Tr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=ar(Tr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Fe,value:r}},LogicalExpression:function(t,e){const r=ir(Tr(t,e.left));if(r.type!==Ve&&gr(`${sr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ve,value:0};const n=ir(Tr(t,e.right));return n.type!==Ve&&gr(`${sr(r)} ${e.operator} ${sr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${lr(n.type)}.`),{type:Ve,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Tr(t,e.left),i=Tr(t,e.right);if(n.type!==i.type&&gr(`${sr(n)} ${e.operator} ${sr(i)}`,`Operator '${r}' cannot be applied to different types: ${lr(n.type)} and ${lr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===De&&r.type===De?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ve,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ae&&e.type!==Ee&&e.type!==De&&gr(`${sr(e)} ${t} ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`);const i=e.type===De?e.value.getTime():e.value,o=r.type===De?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ve,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Fe&&e.type!==Ae&&e.type!==Ee&&gr(`${sr(e)} ${t} ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`),e.type===Fe)return"-"===t&&gr(`${sr(e)} - ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`),{type:Fe,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ee&&(n=cr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ee&&e.type!==Ae&&gr(`${sr(e)} ${t} ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&gr(`${sr(e)} ${t} ${sr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ee&&(n=cr(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(!Qe.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Tr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(tr.has(o))n=tr.get(o);else{const t=function(t,e){const r=Qe.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=rr(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=>lr(t.type))).join(", "),n=`${r}(${Jr(i)})`;"few"===t.type&&0===i.length?gr(n,`Non empty argument list is required for function '${r}'.`):(t.type,gr(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){gr(`${r}(${Jr(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 Tr(t,e){if(e.type in Nr)return Nr[e.type](t,e);throw new Error("Unsupported expression")}function Ur(t,e){try{return Tr(t,e)}catch(t){return{type:"error",value:t.message}}}const Br=/(?:[^\\]|^)@{.+}/i;class Lr{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return nr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Ur(t,this.ast);if("error"===r.type)return void e(G(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;return n instanceof Date?or(n):n}catch(t){return void e(G(new Error("Expression execution error")))}}}function Rr(t,e,r){if(t)if("string"==typeof t){if(n=t,Br.test(n))try{const r=Ke(t,{startRule:"JsonStringContents"}),n=vr(r);return e.push(...n),new Lr(r)}catch(e){return void r(G(new Error("Unable to parse expression"),{additional:{expression:t}}))}}else{if(Array.isArray(t))return t.map((t=>Rr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Rr(t[i],e,r);return n}}var n;return t}function Wr(t,e,r){if(t){if(t instanceof Lr)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Wr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Wr(t[i],e,r);return n}}return t}function qr(t,e){let r=[];const n=Rr(t,r,e);return r=[...new Set(r)],{vars:r,applyVars:t=>Wr(n,t,e)}}const Hr={pagers:function(){return L(new Map)}},Gr=new Map,Zr=new Map;function Yr(t){const e=Gr.get(t)||L("");return Gr.has(t)||Gr.set(t,e),e}function Xr(t){const e=Zr.get(t)||new Map;return Zr.has(t)||Zr.set(t,e),e}class Kr{setVariable(t){const e=t.getName(),r=Xr(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Yr(this).set(e)}getVariable(t){return Xr(this).get(t)}}function Qr(){return new Kr}const tn=J(((t,e,r,n)=>{var i,o,a,s,l;let{id:u}=e,{json:c={}}=e,{platform:v="auto"}=e,{theme:g="system"}=e,{globalVariablesController:p=new Kr}=e,{onError:f}=e,{onStat:h}=e,{onCustomAction:m}=e,{onComponent:y}=e,_="desktop"===v;if("auto"===v&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");_=!t.matches,t.addListener((()=>{_=!t.matches}))}let b="light";if("light"===g||"dark"===g)b=g;else if("system"===g)if("undefined"!=typeof matchMedia){const t=matchMedia("(prefers-color-scheme: dark)");b=t.matches?"dark":"light",t.addListener((()=>{b=t.matches?"dark":"light",K&&K[b].forEach((t=>{const e=A.get(t.name);e&&e.setValue(t.color)}))}))}else b="light";else z(G(new Error("Unsupported theme")));let w=!1;c||(w=!0,z(G(new Error('"json" prop is required')))),u||(w=!0,z(G(new Error('"id" prop is required'))));let $=function(t){if(!t)return G(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return G(new Error("Missing card"));if(!e.states||!e.states.length)return G(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Je)return G(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t)if(!e.states[t].div)return G(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});return null}(c);const x=c.templates||{};$&&(w=!0,z($));const k={stateChange:!1},C=Yr(p),F=Xr(p),E=new Map,A=new Map,V=new Map;function D(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=A.get(t);r&&r.setValue(e)}}function S(t){const e=A.get(t);return null==e?void 0:e.getValue()}function P(t){const e=qr(t,z);return e.vars.length?e.applyVars(A):t}function z(t){f?f({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}let I=0;function O(t){return`${u}-${I++}`}let J={},N={};function T(t){const e=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=t.split("/");const r=e.shift()||"";if(e=[r,"root","0",...e],e.length<5||e.length%2!=1)throw new Error("Incorrect state id format");let n=Z;for(let t=1;t<e.length;t+=2){const r=e[t],i=e[t+1];let o=n.getChild(r);if(!o)return;o.setState(i),n=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=B(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=B(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=B(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=A.get(r);t?t.set(i):z(G(new Error("Cannot find variable"),{additional:{name:r}}))}else z(G(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:z(G(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){z(G(t,{additional:{url:e}}))}}const U=new Map;function B(t){if(U.has(t))return U.get(t);z(G(new Error("Missing instance with id"),{additional:{id:t}}))}const W=new Map;function q(t){for(const e of t)A.has(e)&&t.delete(e);return t}d(H,{logError:z,logStat:function(t,e){h&&h({type:t,action:e})},hasTemplate:function(t){return t in x},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in x;){if(({json:t,templateContext:e}=Be(t,e,x,z)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:O,genClass:function(t){return`divkit-${O()}`},execAction:T,execCustomAction:function(t){null==m||m(t)},isRunning:function(t){return k[t]},setRunning:function(t,e){k[t]=e},registerInstance:function(t,e){U.has(t)?z(G(new Error("Duplicate instance id"),{additional:{id:t}})):U.set(t,e)},addSvgFilter:function(t){if(N[t]=N[t]||0,++N[t],J[t])return J[t];const e=`${O()}-svg-filter`;return J=Object.assign(Object.assign({},J),{[t]:e}),e},removeSvgFilter:function(t){t&&N[t]&&0==--N[t]&&(J=Object.keys(J).reduce(((t,e)=>(N[e]&&(t[e]=J[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Re(t);const e=qr(t,z);return e.vars.length?R(e.vars.map((t=>A.get(t)||function(t){const e=V.get(t)||L(void 0);return V.has(t)||V.set(t,e),e}(t))).filter(it),(()=>e.applyVars(A))):Re(t)},getJsonWithVars:P,getStore:function(t){return W.has(t)||function(t){W.has(t)||W.set(t,Hr[t]())}(t),W.get(t)},getVariable:function(t,e){const r=A.get(t);if(r){const n=r.getType();if(n!==e)return void z(G(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},registerComponent:void 0,unregisterComponent:void 0}),d(Ct,{hasAction:()=>!1});const Z={setState(t){throw new Error("Not implemented")},getChild(t){if(Y&&Y.has(t))return Y.get(t);z(G(new Error("Missing state block with id"),{additional:{id:t}}))}};let Y=null;d(ft,{registerInstance(t,e){Y||(Y=new Map),Y.has(t)?z(G(new Error("Duplicate state with id"),{additional:{id:t}})):Y.set(t,e)},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 X=null===(i=null==c?void 0:c.card)||void 0===i?void 0:i.variables;Array.isArray(X)&&X.forEach((t=>{if(t&&t.type in Pe&&t.name){if(E.has(t.name))return void z(G(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=ze(t.name,t.type,t.value);E.set(t.name,e),A.set(t.name,e)}catch(e){z(G(e,{additional:{name:t.name}}))}}}));const K=c.palette;K&&K[b].forEach((t=>{if(E.has(t.name))z(G(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=ze(t.name,"color",t.color);E.set(t.name,e),A.set(t.name,e)}catch(e){z(G(e,{additional:{name:t.name}}))}}));for(const[t,e]of F)A.has(t)||A.set(t,e);C.subscribe((t=>{if(t&&!A.has(t)){const e=F.get(t);A.set(t,e);const r=V.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Q=null===(o=null==c?void 0:c.card)||void 0===o?void 0:o.variable_triggers;Array.isArray(Q)&&Q.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void z(G(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=Ke(t.condition,{startRule:"JsonStringContents"}),i=vr(n);if(!i.length)return void z(G(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return q(e),e.size?new Promise((t=>{const r=C.subscribe((()=>{q(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{R(i.map((t=>A.get(t))).filter(it),(()=>Ur(A,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=P(t);e.log_id&&T(e)})),e=Boolean(n.value)):z(G(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){z(G(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else z(G(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));let tt=null===(l=null===(s=null===(a=null==c?void 0:c.card)||void 0===a?void 0:a.states)||void 0===s?void 0:s[0])||void 0===l?void 0:l.div,et=tt&&{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:[{state_id:"0",div:tt}]};return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==c&&r.json(c),void 0===e.platform&&r.platform&&void 0!==v&&r.platform(v),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==p&&r.globalVariablesController(p),void 0===e.onError&&r.onError&&void 0!==f&&r.onError(f),void 0===e.onStat&&r.onStat&&void 0!==h&&r.onStat(h),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==m&&r.onCustomAction(m),void 0===e.onComponent&&r.onComponent&&void 0!==y&&r.onComponent(y),void 0===e.setVariable&&r.setVariable&&void 0!==D&&r.setVariable(D),void 0===e.getVariable&&r.getVariable&&void 0!==S&&r.getVariable(S),void 0===e.execAction&&r.execAction&&void 0!==T&&r.execAction(T),!w&&et?`<div class="${j("divkit-b023",!0)+j(_?" divkit-ee11":"",!0)}">${M(Ue,"RootSvgFilters").$$render(t,{svgFiltersMap:J},{},{})}\n ${M(Te,"Unknown").$$render(t,{div:et,templateContext:{}},{},{})}</div>`:""})),en=tn;function rn(t){return en.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var nn=exports;for(var on in e)nn[on]=e[on];e.__esModule&&Object.defineProperty(nn,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map