@divkitframework/divkit 24.0.0 → 24.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/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:()=>zn,createVariable:()=>tr,render:()=>Un}),new Set,new Map;const g=[],p=[],h=[],f=[],m=Promise.resolve();let b=!1;function y(){return b||(b=!0,m.then(x)),m}function _(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()();b=!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(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function F(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=J(n):r.style=J(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function S(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function D(t){const e={};for(const r in t)e[r]=S(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 T={$$render:()=>""};function z(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 M,I;function O(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:M,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}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(M),{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 J(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=J(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=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 R(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 L(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:R(n,c).subscribe};var c}const W="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Y="divkit-f0cba",Z=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980"};function tt(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function et(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function it(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=ot(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ot(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,i,o]=e,a=2===n.length?n:n+n,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 at(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const st=Boolean;function lt(t){if(1===t.length&&"solid"===t[0].type)return{color:it(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=it(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(st);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>it(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:dt(t.bg.scale),pos:vt(t.bg),image:'url("'+at(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(st);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=rt(n.value):"relative"===n.type&&(i=ut[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ct(t.bg.center_x)} ${ct(t.bg.center_y)},`+r.map((t=>it(t))).join(",")+")"}}({bg:t}):void 0)).filter(st).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ct(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function dt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function gt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function pt(t,e){return e.has(t)}function ht(t,e){e&&t.push(e)}function ft(t,e,r){const n=[];ht(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ht(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const mt=Symbol("state");function bt(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function yt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function _t(t){return yt(t)&&t>=0}function wt(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]&&!_t(r[t]))return e;return bt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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(!xt.call(e,i)||!kt(t[i],e[i]))return!1}return!0}function Et(t,e){return kt(t,e)?e:t}function Ct(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}function At(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...At(t))})):e.push(t),e}function Vt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!_t(t[r[n]]))return e;return t}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function St(){}const Dt=Symbol("action"),Pt=O(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=St}=e,{customAction:g=null}=e,{isNativeActionAnimation:p=!0}=e;const h=v(Z),f=v(Dt);d(Dt,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,b="";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){b=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(b="",h.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let y=Boolean(g);return b&&!pt(gt(b),h.getBuiltinProtocols())&&(b="",y=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==g&&r.customAction(g),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),b?`<a${F([{href:S(b)},{target:S(m)},{style:S(l)},{class:j(s,!0)+" "+j(p?W:q,!0)+" "+j(null!=a&&a.length?Y:"",!0)},D(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(y?` ${p?W:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Y:"",!0)},{style:S(l)},{role:S(y?"button":null)},{tabindex:S(y?0:null)},D(u)],{})}>${n.default?n.default({}):""}</span>`})),Tt=Pt,zt="divkit-b921d";function Mt(t){return yt(t)&&t>0}function It(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Mt(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=O(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(Z);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),i=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const n=lt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=It(t.filters,s.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${U({"border-radius":a})}>${P(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",zt,0)}${N("style",tt(t.style),0)}>`:`<span${N("class",zt,0)}${N("style",tt(t.style),0)}></span>`))}</span>`})),Nt=Ot,Jt=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,x,k,E,C,F,A,V,j,S,D,P,T,M,I,O,J,U,B,R,L,W,q,H,G,Y,K,nt=r,ot=r,at=r,st=r,ut=r,ct=r,dt=r,vt=r,ht=r,yt=r,xt=r,kt=r,St=r,Dt=r,Pt=r,zt=r,Mt=r;var It,Ot,Jt,Ut,Bt,Rt;let{json:Lt={}}=e,{origJson:Wt}=e,{templateContext:qt}=e,{cls:Ht=""}=e,{style:Gt}=e,{layoutParams:Yt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Xt=!1}=e,{customActions:Kt=""}=e,{additionalPaddings:Qt=null}=e;const te={left:"start",center:"center",right:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},re=v(Z),ne=v(mt);let ie,oe,ae,se,le,ue,ce,de,ve,ge,pe,he={},fe={},me=!1,be=1,ye="transparent",_e=0,we={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},$e="",xe=null,ke="",Ee={},Ce=0,Fe=0,Ae=0,Ve=!1,je=!1,Se={},De=0,Pe=0,Te=0,ze=!1,Me=!1,Ie=1;const Oe=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Ne=-1!==Oe.indexOf("state_change")&&Lt.id,Je=-1!==Oe.indexOf("visibility_change")&&Lt.id;let Ue,Be,Re,Le,We,qe,He,Ge,Ye,Ze=[],Xe=[],Ke=[],Qe=[],tr="",er=!1,rr="visible",nr=0,ir=0;void 0===e.json&&n.json&&void 0!==Lt&&n.json(Lt),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==qt&&n.templateContext(qt),void 0===e.cls&&n.cls&&void 0!==Ht&&n.cls(Ht),void 0===e.style&&n.style&&void 0!==Gt&&n.style(Gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Yt&&n.layoutParams(Yt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Xt&&n.customPaddings(Xt),void 0===e.customActions&&n.customActions&&void 0!==Kt&&n.customActions(Kt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==Qt&&n.additionalPaddings(Qt),o=re.getDerivedFromVars(Lt.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,n="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Ut=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Ut?void 0:Ut.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+it(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,be=$t(K.stroke.width,be),ye=it(K.stroke.color,1,ye),e.border=`${et(be)} solid ${ye}`),K.corners_radius?(we=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!_t(r[t]))return e;return t}(K.corners_radius,we),e["border-radius"]=t["border-radius"]=jt(we)):K.corner_radius&&(_e=$t(K.corner_radius,_e),we={"top-left":_e,"top-right":_e,"bottom-right":_e,"bottom-left":_e},e["border-radius"]=t["border-radius"]=et(_e)),r&&be&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},we);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+be/2})),n=jt(t)}}he=Et(t,he),fe=Et(e,fe),me=r,$e=n}s=re.getDerivedFromVars(Lt.paddings),zt(),zt=a(s,(t=>Y=t)),xe=Vt(Y&&!Xt?Y:void 0,xe),l=bt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(xe,Qt)),u=re.getDerivedFromVars(Lt.margins),Dt(),Dt=a(u,(t=>H=t)),ke=wt(H,ke),c=re.getDerivedFromVars(Lt.width),kt(),kt=a(c,(t=>W=t)),d=re.getDerivedFromVars(Lt.alignment_horizontal),Pt(),Pt=a(d,(t=>G=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if("fixed"===u)Ce=$t(null==W?void 0:W.value,Ce),e=et(Ce);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=W&&"weight"in W&&W.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=W;t.min_size&&_t(t.min_size.value)&&(r=et(t.min_size.value)),t.max_size&&_t(t.max_size.value)&&(n=et(t.max_size.value))}"match_parent"!==u&&u||re.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)i["halign-self"]="stretch";else{const t=G;i["halign-self"]="left"===t||"center"===t||"right"===t?te[t]:Yt.parentHAlign||"start"}t&&(i.width=t),ae=e,se=r,le=n,Fe=o,Ae=a,Ee=Et(i,Ee),Ve=s,je=l}g=re.getDerivedFromVars(Lt.height),xt(),xt=a(g,(t=>L=t)),p=re.getDerivedFromVars(Lt.alignment_vertical),St(),St=a(p,(t=>q=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)De=$t(null==L?void 0:L.value,De),e=et(De);else if("match_parent"!==u||!Yt.overlapParent&&Yt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||"match_parent"===u&&Yt.parentVerticalWrapContent)&&(i["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&_t(t.min_size.value)&&(r=et(t.min_size.value)),(null==t?void 0:t.max_size)&&_t(t.max_size.value)&&(n=et(t.max_size.value))}"match_parent"===u&&re.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?i["valign-self"]=ee[t]:i["valign-self"]=Yt.parentVAlign||"start"}t&&(i.height=t),ue=e,ce=r,de=n,Pe=o,Te=a,Se=Et(i,Se),ze=s,Me=l}var or,ar,sr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!W||"match_parent"===W.type)&&"match_parent"===(null==L?void 0:L.type),m=Yt.gridArea?`${Yt.gridArea.y+1}/${Yt.gridArea.x+1}/span ${Yt.gridArea.rowSpan}/span ${Yt.gridArea.colSpan}`:void 0,b=re.getDerivedFromVars(Lt.alpha),yt(),yt=a(b,(t=>R=t)),ar=Ie,Ie=!_t(or=R)||void 0===or||or>1?ar:Number(or),ve=1===Ie?void 0:Ie,_=re.getDerivedFromVars(Lt.accessibility),ht(),ht=a(_,(t=>B=t)),oe=void 0,B&&!Zt&&B.description&&(oe={},oe["aria-label"]=B.description),w=re.getDerivedFromVars(Lt.background),vt(),vt=a(w,(t=>U=t)),ge={},pe=!1,U&&(pe=U.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean($e),!pe)){const t=lt(U);ge["background-color"]=t.color,ge["background-image"]=t.image,ge["background-size"]=t.size,ge["background-position"]=t.position,ge["background-repeat"]="no-repeat"}Ue=void 0,Ne&&Lt.transition_in&&re.isRunning("stateChange")&&(Ue=!0),Re=void 0,Ne&&Lt.transition_change&&re.isRunning("stateChange")&&ne.hasTransitionChange(Lt.id)&&(Re=!0),$=re.getDerivedFromVars(Lt.action),ct(),ct=a($,(t=>O=t)),x=re.getDerivedFromVars(Lt.actions),dt(),dt=a(x,(t=>J=t)),k=re.getDerivedFromVars(Lt.doubletap_actions),ut(),ut=a(k,(t=>I=t)),E=re.getDerivedFromVars(Lt.longtap_actions),st(),st=a(E,(t=>M=t));{let t=J||O&&[O]||[],e=I||[],r=M||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],re.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],re.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],re.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Kt&&(t=[],e=[],r=[],re.logError(X(new Error(`Cannot use action on component "${Kt}"`)))),Ze=t,Xe=e,Ke=r}C=re.getDerivedFromVars(Lt.action_animation),at(),at=a(C,(t=>T=t)),T&&(Qe=At(T),tr=Qe.map((function(t){const e=Ft(t.start_value,1),r=Ft(t.end_value,1),n=$t(t.start_delay,0),i=$t(t.duration,300),o=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Le=e,We=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return qe=e,He=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return re.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=re.getDerivedFromVars(Lt.visibility),ot(),ot=a(F,(t=>P=t));{const t=rr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,rr);t!==e&&(!er||"visible"!==rr&&"visible"!==e?rr=e:async function(t){rr=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Je&&r&&(await y(),"in"===e&&(Be=!0),ne.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,ie,e).then((()=>{"in"===e&&(Be=!1)})).catch((t=>{throw"in"===e&&(Be=!1),t})))}(e)),er||(er=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ee),Se),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":Ue||Be||Re,visibility:rr,"has-action-animation":Boolean(tr),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=re.getDerivedFromVars(Lt.transform),nt(),nt=a(V,(t=>D=t)),D&&void 0!==D.rotation){const t=D.pivot_x||{type:"pivot-percentage",value:50};nr=Ft(t.value,nr);const e="pivot-fixed"===t.type?et(nr):`${nr}%`,r=D.pivot_y||{type:"pivot-percentage",value:50};ir=Ft(r.value,ir),Ge=`${e} ${"pivot-fixed"===r.type?et(ir):`${ir}%`}`,Ye=`rotate(${D.rotation}deg)`}return j=Ve||ze?"100%":Fe||Pe?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Gt),ge),he),{width:ae,"min-width":se,"max-width":le,height:ue,"min-height":ce,"max-height":de||(null==Gt?void 0:Gt["max-height"]),"grid-area":m,padding:l,margin:ke,opacity:ve,transition:tr,"transform-origin":Ge,transform:Ye,"flex-grow":Fe||Pe||void 0,"flex-shrink":Ae||Te?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Le,"--divkit-animation-opacity-end":We,"--divkit-animation-scale-start":qe,"--divkit-animation-scale-end":He}),nt(),ot(),at(),st(),ut(),ct(),dt(),vt(),ht(),yt(),xt(),kt(),St(),Dt(),Pt(),zt(),Mt(),je||Me?"":`${z(Tt,"Actionable").$$render(t,{use:function(t){ie=t,Ne&&Lt.transition_in&&ne.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{Ue=!1})).catch((t=>{throw Ue=!1,t})),Ne&&Lt.transition_out&&ne.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Ne&&Lt.transition_change&&ne.registerChildWithTransitionChange(Lt,qt,Lt.transition_change,t).then((()=>{Re=!1})).catch((t=>{throw Re=!1,t}));const e=Yt.fakeElement?[]:Lt.visibility_actions||Lt.visibility_action&&[Lt.visibility_action];Array.isArray(e)&&e.length&&function(t,{visibilityActions:e,rootCtx:r}){const n=e.map(((t,e)=>({index:e,action:t,visible:!1,count:0,finished:!1}))),i=e.map((t=>r.getJsonWithVars({visibility_percentage:t.visibility_percentage,visibility_duration:t.visibility_duration,log_limit:t.log_limit}))),o=[...new Set([...e.map(((t,e)=>(i[e].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=i[e.index],n=0===t.log_limit?1/0:t.log_limit||1;++e.count>=n&&(e.finished=!0);const o=r.getJsonWithVars(e.action),a=o.url;if(a){const t=gt(a);t&&!pt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(o):o.log_id&&r.execCustomAction(o))}r.logStat("visible",o)}),i[e.index].visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:o}).observe(t)}(t,{visibilityActions:e,rootCtx:re});const r=Lt.id;r&&ne.registerChild(r);let n=null;return{destroy(){r&&ne.unregisterChild(r),n&&n.destroy()}}},cls:Ht+" "+ft("outer",Q,A),style:tt(S),actions:Ze,doubleTapActions:Xe,longTapActions:Ke,attrs:oe,isNativeActionAnimation:!Qe.length||(sr=Qe,sr.some((t=>"native"===t.name)))},{},{default:()=>`${pe?`${z(Nt,"OuterBackground").$$render(t,{background:U,radius:$e},{},{})}`:""}${i.default?i.default({}):""}${me?`<span${N("class",Q.outer__border,0)}${N("style",tt(fe),0)}></span>`:""}`})}`})),Ut=Jt,Bt={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function Rt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Lt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Wt(t,e){return Lt(t)||e}const qt=O(((t,e,r,n)=>{let i,o,a,s,l;var u,c;let d,{text:v}=e,{rootFontSize:g}=e,{textStyles:p={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",b=12,y=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==p&&r.textStyles(p),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(p.underline||p.strike)&&("single"===p.underline&&"single"===p.strike?t="both":"single"===p.underline?t="underline":"single"===p.strike&&(t="strike")),m=t}return b=Rt(p.font_size,b),Mt(p.line_height)&&(y=Number(p.line_height)/b),_t(p.letter_spacing)&&(_=et(p.letter_spacing)),d=Wt(p.font_weight,d),w=it(p.text_color,1,w),i=p.top_offset?et(p.top_offset):"",o=p.background?lt([p.background]):null,$=(null===(u=p.border)||void 0===u?void 0:u.stroke)&&"transparent"!==it(p.border.stroke.color)&&Mt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Rt(null===(c=p.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":et(10*b/g),"line-height":y,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${i?`<span${N("class",Bt["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${z(Tt,"Actionable").$$render(t,{cls:ft("text-range",Bt,s),actions:f,style:tt(l)},{},{default:()=>`${j(v)}`})}`})),Ht=qt;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Yt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Zt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,j,S,D,T,M,I,O,J,U,B,R,L=r,W=r,q=r,G=r,Y=r,Q=r,rt=r,nt=r,ot=r,at=r,st=r,ut=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ht=v(Z);let mt=!1,bt="",yt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,jt=[],St=[];var Dt,Pt;c((()=>{St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==gt&&n.origJson(gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==pt&&n.layoutParams(pt),o=ht.getDerivedFromVars(dt.text),ct(),ct=a(o,(t=>R=t)),Dt=R,Pt=bt,bt=String(null!=Dt?Dt:"")||Pt,bt?mt=!1:(mt=!0,ht.logError(X(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(dt.ranges),W(),W=a(s,(t=>V=t)),l=ht.getDerivedFromVars(dt.images),L(),L=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),q(),q=a(u,(t=>j=t)),d=ht.getDerivedFromVars(dt.font_size),ut(),ut=a(d,(t=>B=t)),yt=Rt(B,yt),g=ht.getDerivedFromVars(dt.line_height),st(),st=a(g,(t=>U=t));{const t=U;Mt(t)?(_t=Number(t)/yt,wt=!0):wt=!1}p=ht.getDerivedFromVars(dt.max_lines),nt(),nt=a(p,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*_t+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}f=ht.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(f,(t=>J=t)),Et=Gt(J,Et),m=ht.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Ct=Yt(O,Ct),b=!V||bt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=bt.length,y=ht.getDerivedFromVars(dt.text_color),rt(),rt=a(y,(t=>M=t)),_=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&b&&_&&(t=it(M||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(dt.truncate),Q(),Q=a(w,(t=>T=t)),$="none"===T?"none":"",x=ht.getDerivedFromVars(dt.text_gradient),Y(),Y=a(x,(t=>D=t));{let t="";if(D){const e=lt([D]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>S=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(S,Vt),function(t,e,r){let n=[];if(St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),St=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],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({},j),...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({},j),...l),r=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/yt)};let a="";const s=t.image.tint_color,u=Zt(t.image.tint_mode,"source_in");if(s){const e=it(t.image.tint_color);a=ht.addSvgFilter(e,u),St.push([e,u])}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({},j)}),jt=n}(bt,V,A),E={singleline:h,multiline:kt,halign:Et,valign:Ct,truncate:$},C={gradient:Boolean(At)},F={"font-size":et(yt),"line-height":_t,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},L(),W(),q(),G(),Y(),Q(),rt(),nt(),ot(),at(),st(),ut(),ct(),mt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("text",K,E)+" "+(Vt?"":H),json:dt,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${N("class",ft("text__inner",K,C),0)}${N("style",tt(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${z(Ht,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",tt(e.image.wrapperStyle),0)}><img${N("class",K.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",tt({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(Ht,"TextRangeView").$$render(t,{text:bt,rootFontSize:yt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Kt=Xt,Qt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)i=t.shape,n={width:Number((null===(o=i.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=i.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=i.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*Number((null===(e=t.radius)||void 0===e?void 0:e.value)||10);return{width:r,height:r,radius:r}}(t.shape)}var i,o,a,s,l;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?it(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=it(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${et(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let n;return n="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],n.map(et).join(" ")}let ne;function ie(){if(void 0!==ne)return ne;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),ne=1===t.scrollHeight,document.body.removeChild(t),ne}const oe="divkit-a7719",ae="divkit-f6e9a";function se(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function le(t,e,r,n){const i={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if((null==e?void 0:e.show_at_start)&&se(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)se(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];se(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const ue=O(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,s=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<s)break}else if(n.left<a)break;a=Math.max(a,n.right),s=Math.max(s,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&le(d,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};n.push(r)})),s&&le(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,g=null,p=null;return c((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),i=null,(v&&i||g||p)&&(g&&(g.disconnect(),g=null),p&&(p.disconnect(),p=null),v&&i&&("undefined"!=typeof MutationObserver&&(g=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(ae))&&!(null==r?void 0:r.contains(oe))}))&&l()})),g.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(l),p.observe(i)))),v&&i&&l(),`\n\n<div${N("class",oe,0)}${N("this",u,0)}>${P(d,(t=>`<div${N("class","divkit-c770e",0)}${U({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class",ae,0)}${U({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div>\n </div>`))}</div>`})),ce=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,j,S=r,D=r,T=r,M=r,I=r,O=r,N=r,J=r,U=r;var B,R,L,W,q,H;let{json:G={}}=e,{templateContext:Y}=e,{origJson:K}=e,{layoutParams:Q}=e;const tt={left:"start",center:"center",right:"end"},et={top:"start",center:"center",bottom:"end",baseline:"baseline"},rt=["rounded_rectangle","circle"],nt=v(Z);let it,ot=!1,at="vertical",st="top",lt="left",ut=null,ct=null,dt={};if(void 0===e.json&&n.json&&void 0!==G&&n.json(G),void 0===e.templateContext&&n.templateContext&&void 0!==Y&&n.templateContext(Y),void 0===e.origJson&&n.origJson&&void 0!==K&&n.origJson(K),void 0===e.layoutParams&&n.layoutParams&&void 0!==Q&&n.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,nt.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Y;return({templateContext:r,json:e}=nt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=nt.getDerivedFromVars(G.orientation),U(),U=a(l,(t=>j=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(j,at),u=nt.getDerivedFromVars(G.content_alignment_vertical),J(),J=a(u,(t=>V=t)),st=Yt(V,st),c=nt.getDerivedFromVars(G.content_alignment_horizontal),N(),N=a(c,(t=>A=t)),lt=Gt(A,lt),d=nt.getDerivedFromVars(G.layout_mode),O(),O=a(d,(t=>F=t)),g="wrap"===F,p=nt.getDerivedFromVars(G.separator),I(),I=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&ie()){const t=te(C.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(B=C.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(R=C.show_at_end)&&void 0!==R&&R),show_between:Boolean(null===(L=C.show_between)||void 0===L||L),style:t}:null}else ut=null;if(h=nt.getDerivedFromVars(G.line_separator),M(),M=a(h,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&ie()){const t=te(E.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(W=E.show_at_start)&&void 0!==W&&W),show_at_end:Boolean(null!==(q=E.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(H=E.show_between)||void 0===H||H),style:t}:null}else ct=null;f=ut||ct?function(t,e,r){const n={};return ee(n,e,"vertical"===t),ee(n,r,"horizontal"===t),n}(at,ut,ct):null,m=nt.getDerivedFromVars(G.aspect),T(),T=a(m,(t=>k=t));{const t=null==k?void 0:k.ratio;it=t&&Mt(t)?t:void 0}b=nt.getDerivedFromVars(G.width),S(),S=a(b,(t=>$=t)),y=nt.getDerivedFromVars(G.height),D(),D=a(y,(t=>x=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],(!x||"wrap_content"===x.type||"match_parent"===x.type&&(null==Q?void 0:Q.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=et[st],("wrap_content"===(null==$?void 0:$.type)||"match_parent"===(null==$?void 0:$.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),g&&(t.parentContainerWrap=!0),dt=Et(t,dt)}return _={orientation:at,valign:st,halign:lt,wrap:g},w={gap:ut||ct?re(at,ut,ct):void 0,"aspect-ratio":it},S(),D(),T(),M(),I(),O(),N(),J(),U(),ot?"":`${z(Ut,"Outer").$$render(t,{cls:ft("container",Qt,_),style:w,json:G,origJson:K,templateContext:Y,layoutParams:Q,additionalPaddings:f},{},{default:()=>`${P(s,(e=>`${z(or,"Unknown").$$render(t,{layoutParams:dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||ct?`${z(ue,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:ct,orientation:at},{},{})}`:""}`})}`})),de=ce,ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ge(t,e){return"vertical"===t||"horizontal"===t?t:e}const pe=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:b}=e;const y=v(Z);let _="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!==b&&n.layoutParams(b),o=y.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>g=t)),_=ge(null==g?void 0:g.orientation,_),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=it(null==g?void 0:g.color,1,w),l="horizontal"===_?"100%":et(1),u="horizontal"===_?et(1):"100%",c={background:w,width:l,height:u},d={orientation:_},p(),`${z(Ut,"Outer").$$render(t,{cls:ft("separator",ve,d),json:h,origJson:m,templateContext:f,layoutParams:b},{},{default:()=>s?`<span${N("class",ve.separator__inner,0)}${N("style",tt(c),0)}></span>`:""})}`})),he={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},fe=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,j,S,D,P,T,M,I,O,J,B,R,L,W=r,q=r,H=r,G=r,Y=r,K=r,Q=r,et=r,rt=r,nt=r,ot=r,st=r,lt=r,ut=r,{json:ct={}}=e,{templateContext:gt}=e,{origJson:pt}=e,{layoutParams:ht}=e;const mt=v(Z);let bt,yt=0,_t="rgba(0,0,0,0.08)",wt=!1,xt="",kt="none",Et="50% 50%",Ft="0",At="source_in",Vt="",jt="",St=0,Dt=0,Pt=0,Tt="",zt="";c((()=>{mt.removeSvgFilter(bt,At)})),void 0===e.json&&n.json&&void 0!==ct&&n.json(ct),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==ht&&n.layoutParams(ht),o=mt.getDerivedFromVars(ct.image_url),ut(),ut=a(o,(t=>L=t)),s=mt.getDerivedFromVars(ct.gif_url),lt(),lt=a(s,(t=>R=t)),l=L||R,yt=0,l?wt=!1:(wt=!0,mt.logError(X(new Error('Missing "image_url" for "image"')))),u=mt.getDerivedFromVars(ct.width),st(),st=a(u,(t=>B=t)),d="wrap_content"===(null==B?void 0:B.type),g=mt.getDerivedFromVars(ct.height),ot(),ot=a(g,(t=>J=t)),p="wrap_content"===(null==J?void 0:J.type),h=mt.getDerivedFromVars(ct.preview),nt(),nt=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}f=mt.getDerivedFromVars(ct.placeholder_color),rt(),rt=a(f,(t=>I=t)),_t=it(I,1,_t),m=mt.getDerivedFromVars(ct.scale),et(),et=a(m,(t=>M=t)),kt=dt(M)||kt,b=mt.getDerivedFromVars({content_alignment_horizontal:ct.content_alignment_horizontal,content_alignment_vertical:ct.content_alignment_vertical}),Q(),Q=a(b,(t=>T=t)),Et=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:vt(t)}(T,Et),y=mt.getDerivedFromVars(ct.accessibility),K(),K=a(y,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=mt.getDerivedFromVars(ct.aspect),Y(),Y=a(w,(t=>D=t));{const t=null==D?void 0:D.ratio;Ft=t&&Mt(t)?(100/Number(t)).toFixed(2):"0"}$=mt.getDerivedFromVars(ct.tint_color),G(),G=a($,(t=>S=t)),x=mt.getDerivedFromVars(ct.tint_mode),H(),H=a(x,(t=>j=t));{const t=S,e=t?it(t):void 0,r=Zt(j,At);e===bt&&r===At||(mt.removeSvgFilter(bt,At),Vt=e?mt.addSvgFilter(e,r):"",bt=e,At=r)}if(k=mt.getDerivedFromVars(ct.appearance_animation),q(),q=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;jt=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=$t(t.duration,300),Dt=$t(t.start_delay,0),St=$t(t.alpha,0)}E=mt.getDerivedFromVars(ct.filters),W(),W=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=It(A,mt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Tt=t,zt=e}return C={aspect:"0"!==Ft,"is-width-content":d,"is-height-content":p,loaded:!1,"before-appearance":Boolean(jt)&&!0},F={"background-image":xt,"background-color":xt?void 0:_t,"background-size":kt,"clip-path":zt||void 0,"object-fit":kt,"object-position":Et,filter:["",Tt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":jt||void 0,"--divkit-appearance-fade-start":jt?St:void 0,"--divkit-appearance-delay":jt?`${Dt}ms`:void 0,"--divkit-appearance-duration":jt?`${Pt}ms`:void 0},W(),q(),H(),G(),Y(),K(),Q(),et(),rt(),nt(),ot(),st(),lt(),ut(),wt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("image",he,C),json:ct,origJson:pt,templateContext:gt,layoutParams:ht,customDescription:!0},{},{default:()=>C.aspect?`<span${N("class",he["image__aspect-wrapper"],0)}${U({"padding-bottom":`${Ft}%`})}><img${N("class",he.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",tt(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}></span>`:`<img${N("class",he.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",tt(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}>`})}`})),me={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function be(t){return t>0&&t<1}function ye(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(be)){const e=Math.max(...t.filter(be).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${et(n*t[e]/i)},${ye(t[e])}fr)`:t[e]?o[e]=`${ye(t[e])}fr`:o[e]="auto";return o.join(" ")}const we=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(Z);let A,V,j=!1,S=1,D=[],T=[],M=[],I=[],O=0,N=!1,J="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!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>b=t)),S=Rt(b,S),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;D=[],T=[],M=[],I=[],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,(!D[n]||D[n]<g)&&(D[n]=g),(!T[e]||T[e]<p)&&(T[e]=p),(!M[n]||M[n]<h)&&(M[n]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=S&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(u,(t=>f=t)),J=Yt(f,J),c=F.getDerivedFromVars(x.content_alignment_horizontal),y(),y=a(c,(t=>h=t)),U=Gt(h,U),d={valign:J,halign:U},g={"grid-template-columns":_e(D,M,S),"grid-template-rows":_e(T,I,O)},p=j||N,y(),_(),w(),$(),p?"":`${z(Ut,"Outer").$$render(t,{cls:ft("grid",me,d),json:x,origJson:E,templateContext:k,style:g,layoutParams:C},{},{default:()=>`${P(V,(e=>`${z(or,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),$e=we,xe={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function ke(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function Ee(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ce=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,S,D,T,M,I,O,J,U=r,B=r,R=r,W=r,q=r,H=r,Y=r,K=r,Q=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Z);let lt,ut,ct=[],dt=null,vt=!1;st.getCustomization("galleryLeftClass"),st.getCustomization("galleryRightClass");let gt=!1;O=a(st.isDesktop,(t=>I=t));let pt,ht,mt,bt,yt=1,_t="horizontal",xt="start",kt=8,Ct="",Ft=[],At={},Vt=!1,jt={},St=0;const Dt=Ee((function(){}),50);function Pt(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<yt;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Tt(t,e,r="smooth"){const n="horizontal"===_t,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";lt.scroll({[o]:Math.max(0,t[e][i]-kt/2),behavior:r})}function zt(t){const e=Pt(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===_t?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"===_t?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!nt.id||gt||(null==at?void 0:at.fakeElement)||st.registerInstance(nt.id,{setCurrentItem(t){const e=Pt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Tt(e,t)},setPreviousItem(t){const e=zt("prev"),r=Pt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Tt(r,n)},setNextItem(t){const e="horizontal"===_t?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Pt();if(e&&"ring"===t)return void Tt(r,0);const n=zt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Tt(r,i)}}),c((()=>{vt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?gt=!1:(gt=!0,st.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!gt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&vt&&!gt,l?"undefined"!=typeof ResizeObserver&&(dt=new ResizeObserver((()=>{Dt()})),dt.observe(ut)):dt&&(dt.disconnect(),dt=null),u=st.getDerivedFromVars(nt.column_count),Q(),Q=a(u,(t=>M=t)),yt=Rt(M,yt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,yt),g=st.getDerivedFromVars(nt.orientation),K(),K=a(g,(t=>T=t)),_t=ge(T,_t),p=st.getDerivedFromVars(nt.cross_content_alignment),Y(),Y=a(p,(t=>D=t)),xt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(D,xt),h=st.getDerivedFromVars(nt.item_spacing),H(),H=a(h,(t=>S=t)),kt=$t(S,kt),pt=et(kt),f=st.getDerivedFromVars(nt.cross_spacing),q(),q=a(f,(t=>V=t)),mt=$t(V,kt),ht=et(mt),m=st.getDerivedFromVars(nt.paddings),W(),W=a(m,(t=>A=t)),Ct=wt(A,Ct),b="horizontal"===_t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===_t?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),bt=L(t,(t=>t)),R(),R=a(bt,(t=>F=t))}Ft=[],yt>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===_t||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),y=st.getDerivedFromVars(nt.scroll_mode),B(),B=a(y,(t=>C=t));{const t={};let e={};Vt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===_t?e.parentVAlign=xt:e.parentHAlign=xt,"paging"===C&&(Vt=!0,e.scrollSnap="start",t["horizontal"===_t?"scroll-padding-left":"scroll-padding-top"]=et(kt/2)),1===yt&&(e.parentLayoutOrientation=_t),At=Et(t,At),jt=Et(e,jt)}return _=st.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(_,(t=>J=t)),w={padding:Ct,"grid-gap":ht},$={"grid-gap":pt,[b]:ke(Ft)},x={orientation:_t,"scroll-snap":Vt},k=st.getDerivedFromVars(nt.default_item),U(),U=a(k,(t=>E=t)),St=$t(E,St),U(),B(),R(),W(),q(),H(),Y(),K(),Q(),O(),rt(),"\n\n"+(gt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("gallery",xe,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(xe.gallery__scroller,!0)+" "+j(J?G:"",!0)}"${N("style",tt(At),0)}${N("this",lt,0)}><div${N("class",xe["gallery__items-grid"],0)}${N("style",tt(w),0)}${N("this",ut,0)}>${P(d,((e,r)=>`<div${N("class",xe.gallery__items,0)}${N("style",tt($),0)}${N("this",ct[r],0)}>${P(e,(e=>`${z(or,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===_t?"\n ":""}`})}`)})),Fe=Ce,Ae={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Ve=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,_,w,$,x,k,E,C,F,A,V,S,D=r,T=r,M=r,I=r,O=r,J=r,B=r,R=r,L=r;var W;let{json:q={}}=e,{templateContext:H}=e,{origJson:Y}=e,{layoutParams:K}=e;const Q=v(Z),nt=Q.genId("tabs");let ot,at,st,lt=!1,ut={};const ct=Q.getJsonWithVars(q.selected_tab);let dt,vt,gt=ct&&Number(ct)||0,pt=12,ht="",mt="",yt="",xt="",kt="",Ct="",Ft="",At="",St=0,Dt="",Pt="",zt=null,It=!1,Ot=!1,Nt=gt,Jt=[],Bt=[];async function Lt(t,e=!1){if(Nt=gt,gt=t,It||(It=!0,at.style.height=et(at.clientHeight),st.style.transform=`translate3d(${100*-Nt}%,0,0)`),Ot=!0,async function(t){await y(),st.style.transform=`translate3d(${t}%,0,0)`}(100*-gt),function(t=!1){const e=t?Math.max(0,gt-1):Math.min(gt,Nt),r=t?Math.min(o.length-1,gt+1):Math.max(gt,Nt);Jt=Jt.map(((t,n)=>t||n>=e&&n<=r)),Bt=Bt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await y();const t=document.getElementById(`${nt}-panel-${gt}`);t&&(at.style.height=et(t.offsetHeight))}(),Ht&&clearTimeout(Ht),Ht=window.setTimeout((()=>{Bt=o.map(((t,e)=>e===gt))}),400),qt=-gt*at.clientWidth,e){await y();const t=ot.querySelector(`.${Ae.tabs__item_selected}`);t&&t.focus()}}let qt,Ht=null;!q.id||lt||(null==K?void 0:K.fakeElement)||Q.registerInstance(q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Lt(t)},setPreviousItem(t){let e=gt-1;e<0&&(e="ring"===t?o.length-1:gt),Lt(e)},setNextItem(t){let e=gt+1;e>o.length-1&&(e="ring"===t?0:gt),Lt(e)}}),c((()=>{q.id&&!(null==K?void 0:K.fakeElement)&&Q.unregisterInstance(q.id)})),void 0===e.json&&n.json&&void 0!==q&&n.json(q),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==Y&&n.origJson(Y),void 0===e.layoutParams&&n.layoutParams&&void 0!==K&&n.layoutParams(K),o=q.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?lt=!1:(lt=!0,Q.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=Q.getDerivedFromVars(q.width),R(),R=a(s,(t=>V=t)),l=Q.getDerivedFromVars(q.height),B(),B=a(l,(t=>A=t));{let t={};(null==K?void 0:K.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==V?void 0:V.type)&&(t.parentHorizontalWrapContent=!0),A&&"wrap_content"!==A.type||(t.parentVerticalWrapContent=!0),ut=Et(t,ut)}if(!lt&&(gt<0||gt>=o.length)&&(Q.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:q.selected_tab,length:o.length}})),gt=gt<0?0:o.length-1),u=Q.getDerivedFromVars(q.tab_title_style),J(),J=a(u,(t=>F=t)),d=F||{},pt=Rt(d.font_size,pt),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/pt*10,right:(Number(t.right)||0)/pt*10,bottom:(Number(t.bottom)||0)/pt*10,left:(Number(t.left)||0)/pt*10};ht=wt(e,ht)}{const t=d.line_height;void 0!==t&&Mt(t)&&(mt=et(t/pt*10))}{const t=d.letter_spacing;void 0!==t&&_t(t)&&(yt=et(t/pt*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(W=d.corner_radius)&&void 0!==W?W:1e3;d.corners_radius?xt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!_t(i[t]))return n;return jt(t,e,r)}(d.corners_radius,t,pt,xt):_t(t)&&(xt=et(t/pt*10))}return dt=Wt(d.active_font_weight||d.font_weight,dt),vt=Wt(d.inactive_font_weight||d.font_weight,vt),kt=it(d.active_text_color,1,kt),Ct=it(d.inactive_text_color,1,Ct),Ft=it(d.active_background_color,1,Ft),At=it(d.inactive_background_color,1,At),St=$t(d.item_spacing,St),g=Q.getDerivedFromVars(q.has_separator),O(),O=a(g,(t=>C=t)),p=Q.getDerivedFromVars(q.separator_color),I(),I=a(p,(t=>E=t)),h=Q.getDerivedFromVars(q.separator_paddings),M(),M=a(h,(t=>k=t)),C&&(E&&(Dt=it(E,1,Dt)),k&&(Pt=wt(k,Pt))),f={background:Dt,margin:Pt},m=Q.getDerivedFromVars(q.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>x=t)),b=void 0===x||Boolean(x),_=Q.getDerivedFromVars(q.restrict_parent_scroll),L(),L=a(_,(t=>S=t)),w=Q.getDerivedFromVars(q.title_paddings),D(),D=a(w,(t=>$=t)),zt=Vt($||void 0,zt),lt||(Jt=o.map(((t,e)=>e===gt)),Bt=o.map(((t,e)=>e===gt))),D(),T(),M(),I(),O(),J(),B(),R(),L(),lt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("tabs",Ae,{}),json:q,origJson:Y,templateContext:H,layoutParams:K,customActions:"tabs"},{},{default:()=>`<div class="${j(Ae.tabs__list,!0)+" "+j(S?G:"",!0)}" role="tablist"${U({"--divkit-tabs-title-padding":zt?bt(zt):"","--divkit-tabs-font-size":et(pt),"--divkit-tabs-paddings":ht,"--divkit-tabs-line-height":mt,"--divkit-tabs-letter-spacing":yt,"--divkit-tabs-active-font-weight":dt||"","--divkit-tabs-inactive-font-weight":vt||"","--divkit-tabs-active-text-color":kt,"--divkit-tabs-inactive-text-color":Ct,"--divkit-tabs-active-background-color":Ft,"--divkit-tabs-inactive-background-color":At,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":St?rt(St):""})}${N("this",ot,0)}>${P(o,((e,r)=>{let n=r===gt;return`\n\n ${z(Tt,"Actionable").$$render(t,{cls:ft("tabs__item",Ae,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=K&&K.fakeElement?[]:[e.title_click_action],attrs:{id:`${nt}-tab-${r}`,"aria-controls":`${nt}-panel-${r}`,role:"tab",tabindex:!n||null!=K&&K.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=K&&K.fakeElement?null:t=>function(t,e){return gt===e||(Lt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${C?`<div${N("class",Ae.tabs__separator,0)}${N("style",tt(f),0)}></div>`:""}\n <div class="${j(Ae.tabs__panels,!0)+" "+j(S?G:"",!0)}"${N("this",at,0)}><div${N("class",ft("tabs__swiper",Ae,{inited:It,animated:Ot}),0)}${N("this",st,0)}>${P(o,((e,r)=>`<div${N("class",ft("tabs__panel",Ae,{visible:Bt[r]}),0)} role="tabpanel" id="${j(nt,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(nt,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Jt[r]?`${z(or,"Unknown").$$render(t,{div:e.div,templateContext:H,layoutParams:ut},{},{})}`:""}\n </div>`))}</div></div>`})}`})),je=Ve,Se="divkit-eb860",De="divkit-e08c6";function Pe(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)}}Pe([.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]),Pe([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 Te=O(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(Z),g=v(mt);let p=new Map,h=new Set,f=!1,m=null,b=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(g.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[],$.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await y()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return _.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{x&&!(null==l?void 0:l.fakeElement)&&g.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),f?"":`${z(Ut,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${z(or,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${P(b,(e=>"direction"in e?`<div${N("class",Se,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${N("class",De,0)}>${z(or,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class",Se,0)}><div${N("class",De,0)}>${z(or,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ze={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E=r,C=r,F=r,A=r,V=r,S=r;var D,T,M,I,O,J,U;let{json:B={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:W}=e;const q=v(Z),H=q.genId("pager");let Y,K=!1,Q=!1,nt=0,it=0,ot=!1,at="horizontal",st="",lt="",ut="";function ct(t,e="smooth"){const r="horizontal"===at,n=Y.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:n[i],behavior:e}),nt=t}Ee((function(){if(!K)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===at?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:nt}();t!==nt&&(nt=t)}),50),B.id&&!(null==W?void 0:W.fakeElement)&&q.registerInstance(B.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ct(t)},setPreviousItem(t){let e=nt-1;e<0&&(e="ring"===t?o.length-1:nt),ct(e)},setNextItem(t){let e=nt+1;e>o.length-1&&(e="ring"===t?0:nt),ct(e)}}),c((()=>{K=!1,B.id&&!(null==W?void 0:W.fakeElement)&&q.unregisterInstance(B.id)})),void 0===e.json&&n.json&&void 0!==B&&n.json(B),void 0===e.templateContext&&n.templateContext&&void 0!==R&&n.templateContext(R),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==W&&n.layoutParams(W),(null===(D=B.items)||void 0===D?void 0:D.length)&&Array.isArray(B.items)?Q=!1:(Q=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!Q&&B.items||[]).map((t=>{let e=t,r=R;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(B.layout_mode),C(),C=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(ot=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ot=!1:(ot=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(B.orientation),V(),V=a(l,(t=>x=t)),at=ge(x,at),u=q.getDerivedFromVars(B.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&_t(t)&&(st=et(t||0))}if(d=q.getDerivedFromVars(B.paddings),F(),F=a(d,(t=>w=t)),lt=wt(w,lt),g=q.getDerivedFromVars(B.restrict_parent_scroll),S(),S=a(g,(t=>k=t)),p="horizontal"===at?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=rt("horizontal"===at?((null===(T=B.paddings)||void 0===T?void 0:T.left)||0)+((null===(M=B.paddings)||void 0===M?void 0:M.right)||0):((null===(I=B.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=B.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(J=_.neighbour_page_width)||void 0===J?void 0:J.value;ut=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${st})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(U=_.page_width)||void 0===U?void 0:U.value;ut=`${Number(t)}%`}return h={"grid-gap":st,padding:lt,[p]:ut},f={orientation:at},m=Q||ot,b=q.getStore("pagers"),E(),E=a(b,(t=>y=t)),function(t,e){const r=B.id;if(r){const o=new Map(y);n=b,y=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:ct}),i=y,n.set(i)}var n,i}(o.length,nt),function(t){var e;if(t===it)return;it=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(nt),E(),C(),F(),A(),V(),S(),m?"":`${z(Ut,"Outer").$$render(t,{cls:ft("pager",ze,f),json:B,origJson:L,templateContext:R,layoutParams:W,customPaddings:!0},{},{default:()=>`<div class="${j(ze.pager__items,!0)+" "+j(k?G:"",!0)}"${N("style",tt(h),0)}${N("this",Y,0)}>${P(o,(e=>`<div${N("class",ze.pager__item,0)}>${z(or,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=W&&W.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ie=Me,Oe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},Ne=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,x,k,E,C,F=r,A=r,V=r,S=r,D=r,T=r,M=r,I=r,O=r;var J,B;let{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(Z);let X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},tt="default",rt=15,nt=10,ot=5;if(void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),o=Y.getDerivedFromVars(R.shape),T(),T=a(o,(t=>x=t)),s=Y.getDerivedFromVars(R.active_item_color),S(),S=a(s,(t=>w=t)),l=Y.getDerivedFromVars(R.inactive_item_color),D(),D=a(l,(t=>$=t)),u=Y.getDerivedFromVars(R.active_item_size),M(),M=a(u,(t=>k=t)),c=Y.getDerivedFromVars(R.active_shape),O(),O=a(c,(t=>C=t)),d=Y.getDerivedFromVars(R.inactive_shape),I(),I=a(d,(t=>E=t)),C&&(K=te({type:"shape_drawable",shape:C},G,K)),E&&(Q=te({type:"shape_drawable",shape:E},G,Q)),!C&&!E&&x){const t=Rt(k,1.3);Q=te({type:"shape_drawable",shape:x,color:Q.background},G,Q),Q.background=it($,1,Q.background),K=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:K.background}),K.background=it(w,1,K.background)}if(g=Y.getDerivedFromVars(R.space_between_centers),A(),A=a(g,(t=>b=t)),p=Y.getDerivedFromVars(R.items_placement),V(),V=a(p,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)tt="default",b&&(rt=$t(b.value,rt));else if(tt=_.type,"default"===tt)rt=$t(null===(J=_.space_between_centers)||void 0===J?void 0:J.value,rt);else if("stretch"===tt){const t=_;nt=Rt(t.max_visible_items,nt),ot=$t(null===(B=t.item_spacing)||void 0===B?void 0:B.value,ot)}return h=Y.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await y())}(m),f={placement:tt},F(),A(),V(),S(),D(),T(),M(),I(),O(),`${z(Ut,"Outer").$$render(t,{cls:ft("indicator",Oe,f),json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${N("class",Oe.indicator__scroller,0)}${N("this",undefined,0)}><div${N("class",Oe.indicator__items,0)} role="tablist"${U({margin:"default"===tt?`0 ${et(Math.max(0,K.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":et(Q.width),"--divkit-indicator-inactive-height":et(Q.height),"--divkit-indicator-inactive-border-radius":et(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":et(K.width),"--divkit-indicator-active-height":et(K.height),"--divkit-indicator-active-border-radius":et(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/Q.width,"--divkit-indicator-default-margin":"default"===tt?`0 ${et((rt-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===tt?et(ot):"","--divkit-indicator-stretch-max-count":"stretch"===tt?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===tt?et((nt-1)*ot):""})}${N("this",undefined,0)}>${X?`${P(Array(X.size),((t,e)=>{let r=e===X.currentItem;return`\n <div class="${j(ft("indicator__item",Oe,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(X.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(X.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Je=Ne,Ue={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&it(t.text_color)||"#000",i=Lt(t.font_weight);if(Mt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:et(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Re(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Le="function"==typeof BigInt;function We(t){return Le?BigInt(t):Number(t)}const qe=We("9223372036854775807"),He=We("-9223372036854775808");function Ge(t){const e=We(t);if(e>qe||e<He)throw new Error("Integer overflow.");return e}const Ye=Ge(0);function Ze(t){let e=t;return e<0&&(e=-e),e}function Xe(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ge(e)}class Ke{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=R(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 Qe={string:class extends Ke{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Ke{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 Ke{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>qe||t<He)throw new Error("Incorrect variable value");return Ge(t)}fromString(t){const e=Ge(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Ke{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 Ke{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Ke{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function tr(t,e,r){if(!(e in Qe))throw new Error("Unsupported variable type");return new Qe[e](t,r)}function er(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 rr=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,S,D,T,M,I,O,J,B,R,L,W,q,H,G=r,Y=r,K=r,Q=r,tt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,dt,vt,gt;let{json:pt={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:bt}=e;const yt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Z),kt=v(Dt);let Et=0,Ct=100;const At=xt.getJsonWithVars(pt.thumb_value_variable),Vt=xt.getJsonWithVars(pt.thumb_secondary_value_variable);W=a(At&&xt.getVariable(At,"integer")||tr("temp","integer",0),(t=>L=t)),R=a(Vt&&xt.getVariable(Vt,"integer")||tr("temp","integer",0),(t=>B=t));let jt,St,Pt,Tt=Re(L||0,Et,Ct),zt=Re(B||0,Et,Ct),Mt=yt,It=Mt,Ot=yt,Nt=yt,Jt=null,Bt=null,Rt=Pt,Lt="",Wt="",qt=!1;Ee((function(){}),50),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==ht&&n.templateContext(ht),void 0===e.origJson&&n.origJson&&void 0!==mt&&n.origJson(mt),void 0===e.layoutParams&&n.layoutParams&&void 0!==bt&&n.layoutParams(bt),o=xt.getDerivedFromVars(pt.min_value),ut(),ut=a(o,(t=>H=t)),s=xt.getDerivedFromVars(pt.max_value),lt(),lt=a(s,(t=>q=t)),Et=Ft(H,Et),Ct=Ft(q,Ct);{const t=Re(L||0,Et,Ct);t!==Tt&&(Tt=t)}{const t=Re(B||0,Et,Ct);t!==zt&&(zt=t)}l=xt.getDerivedFromVars(pt.thumb_style),st(),st=a(l,(t=>J=t)),Mt=te(J,wt,Mt),u=xt.getDerivedFromVars(pt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),It=te(O,wt,Mt),c=xt.getDerivedFromVars(pt.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Ot=te(I,$t,Ot),d=xt.getDerivedFromVars(pt.track_active_style),it(),it=a(d,(t=>M=t)),Nt=te(M,$t,Nt),g=xt.getDerivedFromVars(pt.tick_mark_active_style),nt(),nt=a(g,(t=>T=t));{let t=te(T,wt,yt);t!==yt&&(Jt=t)}jt=Jt?Vt?er(Math.min(Tt,zt),Math.max(Tt,zt)+1,Et,Ct,!0):er(Et,Tt,Et,Ct,!0):[],p=xt.getDerivedFromVars(pt.tick_mark_inactive_style),tt(),tt=a(p,(t=>D=t));{let t=te(D,wt,yt);t!==yt&&(Bt=t)}St=Bt?Vt?er(Math.min(Tt,zt),Math.max(Tt,zt)+1,Et,Ct,!1):er(Tt+1,Ct+1,Et,Ct,!0):[],h=xt.getDerivedFromVars(pt.thumb_text_style),Q(),Q=a(h,(t=>S=t)),Pt=Be(S,Pt),f=xt.getDerivedFromVars(pt.thumb_secondary_text_style),K(),K=a(f,(t=>V=t)),Rt=Be(V,Pt),m=xt.getDerivedFromVars(pt.accessibility),Y(),Y=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),b=xt.getDerivedFromVars(pt.secondary_value_accessibility),G(),G=a(b,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):Mt===yt?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===yt?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===yt&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return y=et(Math.max(...[Mt.width,It.width,0].filter(_t))),_=et(Math.max(...[Mt.height,It.height,0].filter(_t))),w=(Tt-Et)/(Ct-Et),$=Vt?(zt-Et)/(Ct-Et):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":et(Mt.width),"--divkit-slider-thumb-height":et(Mt.height),"--divkit-slider-thumb-secondary-width":et(It.width),"--divkit-slider-thumb-secondary-height":et(It.height),"--divkit-slider-text-offset-x":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.x)?rt(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==Pt?void 0:Pt.offset)||void 0===dt?void 0:dt.y)?rt(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Rt?void 0:Rt.offset)||void 0===vt?void 0:vt.x)?rt(Rt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Rt?void 0:Rt.offset)||void 0===gt?void 0:gt.y)?rt(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":Jt?et(Jt.width):void 0,"--divkit-slider-tick-active-height":Jt?et(Jt.height):void 0,"--divkit-slider-tick-active-border-radius":Jt?et(Jt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Jt?void 0:Jt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Jt?void 0:Jt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?et(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?et(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?et(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":y,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Y(),K(),Q(),tt(),nt(),it(),ot(),at(),st(),R(),W(),lt(),ut(),"\n\n"+(qt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("slider",Ue,C),style:E,customDescription:!0,customActions:"slider",json:pt,origJson:mt,templateContext:ht,layoutParams:bt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",Ue["slider__tracks-wrapper"],0)}><div${N("class",Ue["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",Ue.slider__track,0)}${U({height:et(Ot.height),"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${N("class",Ue["slider__active-track"],0)}${U({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Nt.height),"border-radius":et(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n ${P(jt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(St,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",Ue.slider__thumb,0)}${U({"border-radius":et(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Pt?`<div${N("class",Ue["slider__thumb-text"],0)}><div${N("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Pt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Pt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Pt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Tt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ue.slider__thumb,!0)+" "+j(Ue.slider__thumb_secondary,!0)}"${U({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Rt?`<div class="${j(Ue["slider__thumb-text"],!0)+" "+j(Ue["slider__thumb-text_secondary"],!0)}"><div${N("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Rt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Rt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Rt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",Ue.slider__input,0)}${N("min",Et,0)}${N("max",Ct,0)} step="1"${N("value",Tt,0)}${N("aria-label",Lt,0)}>\n ${Vt?`<input type="range"${N("class",`${Ue.slider__input} ${Ue.slider__input_secondary}`,0)}${N("min",Et,0)}${N("max",Ct,0)} step="1"${N("value",zt,0)}${N("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),nr={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},ir={text:Kt,container:de,separator:pe,image:fe,gif:fe,grid:$e,gallery:Fe,tabs:je,state:Te,pager:Ie,indicator:Je,slider:rr,input:O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,S,D,P,T,M,I,O,J,U,B=r,R=r,{json:L={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Z);let Y;const K=G.getJsonWithVars(L.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),O=a(K&&G.getVariable(K,"string")||tr("temp","string",""),(t=>I=t));let tt="";M=a(G.getDerivedFromVars(L.hint_text),(t=>T=t)),P=a(G.getDerivedFromVars(L.hint_color),(t=>D=t));let nt="";S=a(G.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(G.getDerivedFromVars(L.line_height),(t=>E=t)),k=a(G.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(G.getDerivedFromVars(L.highlight_color),(t=>y=t));let ct="";b=a(G.getDerivedFromVars(L.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";f=a(G.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let pt="",ht="";U=a(G.getDerivedFromVars(L.select_all_on_focus),(t=>J=t)),void 0===e.json&&n.json&&void 0!==L&&n.json(L),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!==H&&n.layoutParams(H),tt=I,o=T,nt=it(D,1,nt),st=Rt(V,st),ot=Wt(F,ot);{const t=E;Mt(t)&&(at=t/st)}return yt(x)&&(lt=et(x/st*10)),ut=it(w,1,ut),ct=it(y,1,ct),m&&m in dt&&(gt=dt[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(L.paddings),R(),R=a(l,(t=>p=t)),Mt(h)&&(pt=`calc(${h*(at||1.25)+"em"} + ${rt($t(null==p?void 0:p.top,0)+$t(null==p?void 0:p.bottom,0))})`),u=G.getDerivedFromVars(L.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?ht=g.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ct,"font-size":et(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":pt},B(),R(),f(),b(),_(),$(),k(),C(),A(),S(),P(),M(),O(),U(),Q?"":`${z(Ut,"Outer").$$render(t,{cls:ft("input",nr,c),style:d,customDescription:!0,customActions:"input",json:L,origJson:q,templateContext:W,layoutParams:H},{},{default:()=>`<span${N("class",nr.input__wrapper,0)}><span${N("class",nr.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"":""}</span>\n ${s?`<textarea${N("class",nr.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ht,0)}${N("placeholder",o,0)}${N("this",Y,0)}>${j(tt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",nr.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ht,0)}${N("placeholder",o,0)}${N("value",tt,0)}${N("this",Y,0)}>`}</span>`})}`}))},or=O(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Z);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&&ir[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&ir[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${z(d||T,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),ar=O(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function sr(t,e,r,n){const i=r[t.type];if(!i)return n(X(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function lr(){}function ur(t){return{subscribe:e=>(e(t),lr)}}function cr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function dr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function vr(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 gr(t){try{return Ge(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function pr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function hr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,hr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function fr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function mr(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",c="\\",d="||",v="&&",g="==",p="!=",h=">=",f="<=",m="+",b="-",y="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),S={type:"any"},D=kt(["}"],!0,!1),P=xt("?",!1),T=xt(":",!1),z=xt("||",!1),M=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),N=xt(">=",!1),J=xt(">",!1),U=xt("<=",!1),B=xt("<",!1),R=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Y=xt("(",!1),Z=xt(")",!1),X=xt(",",!1),K=Et("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Et("integer"),rt=kt([["0","9"]],!1,!1),nt=Et("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Et("boolean"),lt=xt("true",!1),ut=xt("false",!1),ct=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),gt=Et("whitespace"),pt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return vr(t)},ft=0,mt=0,bt=[{line:1,column:1}],yt=0,_t=[],wt=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=bt[e];if(n)return n;for(r=e-1;!bt[r];)r--;for(n={line:(n=bt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return bt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<yt||(ft>yt&&(yt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Rt(),(e=St())!==n?(Rt(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=St())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(D)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(D));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=pr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function St(){var e,r,i,o,a,s;return e=ft,(r=Dt())!==n?(Rt(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(P)),i!==n?(Rt(),(o=St())!==n?(Rt(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(T)),a!==n?(Rt(),(s=St())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=Dt()),e}function Dt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Pt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=dr(r,i)}else ft=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=dr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function It(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i;return(e=Ut())===n&&(e=Jt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(R)),r===n&&(45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)))),r!==n?(Rt(),(i=Ot())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Bt())!==n?(Rt(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Y)),i!==n?(Rt(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=St())!==n){for(i=[],o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=St())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=St())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Rt()),e}(),o!==n?(Rt(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Bt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=vr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Ut())===n&&(e=Jt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Y)),r!==n&&(i=St())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=St())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=pr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Jt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:gr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Ut(){var e,r,i,o,a,s,l,u,c,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=n,0===wt&&At(R)),u===n&&(45===t.charCodeAt(ft)?(u=b,ft++):(u=n,0===wt&&At(L))),u===n&&(u=null),c=[],x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else c=n;c!==n?s=l=[l,u,c]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(R)),a===n&&(45===t.charCodeAt(ft)?(a=b,ft++):(a=n,0===wt&&At(L))),a===n&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Bt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Rt(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));return wt--,r=n,0===wt&&At(gt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new hr(hr.buildMessage(t,e),t,e,r)}(_t,yt<t.length?t.charAt(yt):null,yt<t.length?Ft(yt,yt+1):Ft(yt,yt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(hr,Error),hr.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=fr("",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+" | "+fr("",i.column-1," ")+fr("",u,"^")}else e+="\n at "+o}return e},hr.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const br=new Map,yr=new Map;function _r(t,e,r){const n={args:e,cb:r},i=br.get(t)||[];br.has(t)||br.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");yr.set(o,n)}function wr(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 $r(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=>{$r(t,e)}));break;case"BinaryExpression":case"LogicalExpression":$r(t.left,e),$r(t.right,e);break;case"UnaryExpression":$r(t.argument,e);break;case"ConditionalExpression":$r(t.test,e),$r(t.consequent,e),$r(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{$r(t,e)}))}}function xr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function kr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Er(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 kr(t.value);if("color"===t.type)return Pr(Dr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Cr(t){let e=Er(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Fr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Ar(t,e){if(Le)return Ge(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Vr(t,e){if(e<He||e>qe)throw new Error("Integer overflow.");!Le&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function jr(t){const e=[];return $r(t,{Variable(t){e.push(t.id.name)}}),e}function Sr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Dr(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Pr(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Tr(t){return Pr(Dr(t))}const zr=Number.MAX_VALUE,Mr=Number.MIN_VALUE,Ir="string",Or="integer",Nr="number",Jr="boolean",Ur="color",Br="url",Rr="datetime";function Lr(t,e){return{type:Ir,value:Er(e)}}function Wr(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Nr,value:r}}function qr(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=Tr(o)),{type:n,value:o}}function Hr(t,e,r){return qr(t,e,r,r.type)}function Gr(t,e,r){return qr(t,e,r,"color")}function Yr(t,e,r){return qr(t,e,r,"url")}const Zr=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Or,value:n}},Xr=Zr("getUTCFullYear"),Kr=Zr("getUTCMonth"),Qr=Zr("getUTCDate"),tn=Zr("getUTCDay"),en=Zr("getUTCHours"),rn=Zr("getUTCMinutes"),nn=Zr("getUTCSeconds"),on=Zr("getUTCMilliseconds");function an(t,e,r,n){if(!n.value.length)return t.warnings.push(X(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===Ir?e.value:Er(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function sn(t,e,r,n){const i=an(t,e,r,n);return{type:Ir,value:i+Er(e)}}function ln(t,e,r,n){const i=an(t,e,r,n);return{type:Ir,value:Er(e)+i}}function un(t){return(e,r)=>{const n=Dr(r.value);return{type:Nr,value:n[t]/255}}}function cn(t){return(e,r,n)=>{const i=Dr(r.value);return i[t]=255*n.value,{type:Ur,value:Pr(i)}}}const dn=un("a"),vn=un("r"),gn=un("g"),pn=un("b"),hn=cn("a"),fn=cn("r"),mn=cn("g"),bn=cn("b");function yn(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Ge(e.value)/Ge(r);return Vr(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Ge(i)%Ge(n)),{type:Or,value:i}}const _n=36e5;function wn(t){return t.map(Cr).join(", ")}_r("toString",[Or],Lr),_r("toString",[Nr],Lr),_r("toString",[Jr],Lr),_r("toString",[Ur],Lr),_r("toString",[Br],Lr),_r("toNumber",[Or],Wr),_r("toNumber",[Ir],Wr),_r("toInteger",[Nr],(function(t,e){if(e.value>qe||e.value<He)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Or,value:Ge(r)}})),_r("toInteger",[Ir],(function(t,e){let r;try{r=Ge(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>qe||r<He)throw new Error("Unable to convert value to Integer.");return{type:Or,value:r}})),_r("toInteger",[Jr],(function(t,e){return{type:Or,value:Ge(e.value?1:0)}})),_r("toBoolean",[Or],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Jr,value:r}})),_r("toBoolean",[Ir],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Jr,value:"true"===e.value?1:0}})),_r("toColor",[Ir],(function(t,e){return{type:Ur,value:Tr(e.value)}})),_r("toUrl",[Ir],(function(t,e){return{type:Br,value:e.value}})),_r("encodeUri",[Ir],(function(t,e){try{return{type:Ir,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),_r("decodeUri",[Ir],(function(t,e){try{return{type:Ir,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),_r("getIntegerValue",[Ir,Or],Hr),_r("getNumberValue",[Ir,Nr],Hr),_r("getBooleanValue",[Ir,Jr],Hr),_r("getStringValue",[Ir,Ir],Hr),_r("getColorValue",[Ir,Ur],Gr),_r("getColorValue",[Ir,Ir],Gr),_r("getUrlValue",[Ir,Br],Yr),_r("getUrlValue",[Ir,Ir],Yr),_r("parseUnixTime",[Or],(function(t,e){return{type:Rr,value:new Date(1e3*Number(e.value))}})),_r("nowLocal",[],(function(){return{type:Rr,value:new Date}})),_r("addMillis",[Rr,Or],(function(t,e,r){return{type:Rr,value:new Date(e.value.getTime()+Number(r.value))}})),_r("setYear",[Rr,Or],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Rr,value:n}})),_r("setMonth",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMonth(n-1),{type:Rr,value:i}})),_r("setDay",[Rr,Or],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${i} for date ${Er(e)}.`);return n.setUTCDate(-1===i?0:i),{type:Rr,value:n}})),_r("setHours",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(e.value);return i.setUTCHours(n),{type:Rr,value:i}})),_r("setMinutes",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMinutes(n),{type:Rr,value:i}})),_r("setSeconds",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCSeconds(n),{type:Rr,value:i}})),_r("setMillis",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMilliseconds(n),{type:Rr,value:i}})),_r("getYear",[Rr],Xr),_r("getMonth",[Rr],Kr),_r("getDay",[Rr],Qr),_r("getDayOfWeek",[Rr],tn),_r("getHours",[Rr],en),_r("getMinutes",[Rr],rn),_r("getSeconds",[Rr],nn),_r("getMillis",[Rr],on),_r("getIntervalSeconds",[Or],(function(t,e){return yn(t,e,1e3,60)})),_r("getIntervalTotalSeconds",[Or],(function(t,e){return yn(t,e,1e3)})),_r("getIntervalMinutes",[Or],(function(t,e){return yn(t,e,6e4,60)})),_r("getIntervalTotalMinutes",[Or],(function(t,e){return yn(t,e,6e4)})),_r("getIntervalHours",[Or],(function(t,e){return yn(t,e,_n,24)})),_r("getIntervalTotalHours",[Or],(function(t,e){return yn(t,e,_n)})),_r("getIntervalTotalDays",[Or],(function(t,e){return yn(t,e,864e5)})),_r("getIntervalTotalWeeks",[Or],(function(t,e){return yn(t,e,6048e5)})),_r("len",[Ir],(function(t,e){return{type:Or,value:e.value.length}})),_r("contains",[Ir,Ir],(function(t,e,r){return{type:Jr,value:e.value.includes(r.value)?1:0}})),_r("substring",[Ir,Or,Or],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Ir,value:e.value.substring(Number(r.value),Number(n.value))}})),_r("replaceAll",[Ir,Ir,Ir],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:Ir,value:i}})),_r("index",[Ir,Ir],(function(t,e,r){return{type:Or,value:e.value.indexOf(r.value)}})),_r("lastIndex",[Ir,Ir],(function(t,e,r){return{type:Or,value:e.value.lastIndexOf(r.value)}})),_r("trim",[Ir],(function(t,e){return{type:Ir,value:e.value.trim()}})),_r("trimLeft",[Ir],(function(t,e){return{type:Ir,value:e.value.replace(/^\s+/,"")}})),_r("trimRight",[Ir],(function(t,e){return{type:Ir,value:e.value.replace(/\s+$/,"")}})),_r("toUpperCase",[Ir],(function(t,e){return{type:Ir,value:e.value.toUpperCase()}})),_r("toLowerCase",[Ir],(function(t,e){return{type:Ir,value:e.value.toLowerCase()}})),_r("padStart",[Ir,Or,Ir],sn),_r("padStart",[Or,Or,Ir],sn),_r("padEnd",[Ir,Or,Ir],ln),_r("padEnd",[Or,Or,Ir],ln),_r("div",[Or,Or],(function(t,e,r){if(r.value===Ye)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Ar(0,n),Vr(t,n),{type:Or,value:n}})),_r("div",[Nr,Nr],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:Nr,value:n}})),_r("mod",[Or,Or],(function(t,e,r){if(r.value===Ye)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Ar(0,n),Vr(t,n),{type:Or,value:n}})),_r("mod",[Nr,Nr],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:Nr,value:n}})),_r("mul",[{type:Or,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ye;for(let n=1;n<e.length;++n)r*=e[n].value,r=Ar(0,r),Vr(t,r);return{type:Or,value:r}})),_r("mul",[{type:Nr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Nr,value:r}})),_r("sub",[{type:Or,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ye;for(let n=1;n<e.length;++n)r-=e[n].value,r=Ar(0,r),Vr(t,r);return{type:Or,value:r}})),_r("sub",[{type:Nr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Nr,value:r}})),_r("sum",[{type:Or,isVararg:!0}],(function(t,...e){let r=Ye;for(let n=0;n<e.length;++n)r+=e[n].value,r=Ar(0,r),Vr(t,r);return{type:Or,value:r}})),_r("sum",[{type:Nr,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Nr,value:r}})),_r("abs",[Or],(function(t,e){const r=Ze(e.value);return Vr(t,r),{type:e.type,value:r}})),_r("abs",[Nr],(function(t,e){const r=Math.abs(e.value);return{type:Nr,value:r}})),_r("max",[{type:Or,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:Or,value:r}})),_r("max",[{type:Nr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Nr,value:Math.max(...e.map((t=>t.value)))}})),_r("min",[{type:Or,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:Or,value:r}})),_r("min",[{type:Nr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Nr,value:Math.min(...e.map((t=>t.value)))}})),_r("maxNumber",[],(function(){return{type:Nr,value:zr}})),_r("minNumber",[],(function(){return{type:Nr,value:Mr}})),_r("maxInteger",[],(function(t){return Vr(t,qe),{type:Or,value:qe}})),_r("minInteger",[],(function(t){return Vr(t,He),{type:Or,value:He}})),_r("round",[Nr],(function(t,e){const r=Math.sign(e.value);return{type:Nr,value:r*Math.round(Math.abs(e.value))}})),_r("floor",[Nr],(function(t,e){return{type:Nr,value:Math.floor(e.value)}})),_r("ceil",[Nr],(function(t,e){return{type:Nr,value:Math.ceil(e.value)}})),_r("signum",[Or],(function(t,e){return{type:Or,value:Xe(e.value)}})),_r("signum",[Nr],(function(t,e){return{type:Nr,value:Math.sign(e.value)}})),_r("copySign",[Or,Or],(function(t,e,r){let n;if(r.value===Ye)n=e.value;else if(e.value===Ye)n=0;else{const t=Xe(r.value);n=Ze(e.value)*t}return Vr(t,n),{type:Or,value:n}})),_r("copySign",[Nr,Nr],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:Nr,value:i}})),_r("getColorAlpha",[Ir],dn),_r("getColorAlpha",[Ur],dn),_r("getColorRed",[Ir],vn),_r("getColorRed",[Ur],vn),_r("getColorGreen",[Ir],gn),_r("getColorGreen",[Ur],gn),_r("getColorBlue",[Ir],pn),_r("getColorBlue",[Ur],pn),_r("setColorAlpha",[Ir,Nr],hn),_r("setColorAlpha",[Ur,Nr],hn),_r("setColorRed",[Ir,Nr],fn),_r("setColorRed",[Ur,Nr],fn),_r("setColorGreen",[Ir,Nr],mn),_r("setColorGreen",[Ur,Nr],mn),_r("setColorBlue",[Ir,Nr],bn),_r("setColorBlue",[Ur,Nr],bn),_r("rgb",[Nr,Nr,Nr],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Ur,value:Pr(i)}})),_r("argb",[Nr,Nr,Nr,Nr],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:Ur,value:Pr(o)}}));const $n={StringLiteral:function(t,e){return{type:Ir,value:e.value}},NumberLiteral:function(t,e){return{type:Nr,value:e.value}},IntegerLiteral:function(t,e){return Vr(t,e.value),{type:Or,value:e.value}},BooleanLiteral:function(t,e){return{type:Jr,value:e.value?1:0}},UnaryExpression:function(t,e){const r=xr(xn(t,e.argument));switch(e.operator){case"!":if(r.type===Jr)return{type:Jr,value:r.value?0:1};Sr(`${e.operator}${Cr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Or){const e=r.value*Ge(n);return Vr(t,e),{type:Or,value:e}}if(r.type===Nr)return{type:Nr,value:r.value*n};Sr(`${e.operator}${Cr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=xr(xn(t,e.test));if(r.type===Jr)return r.value?xn(t,e.consequent):xn(t,e.alternate);Sr(`${Cr(r)} ? ${Cr(xn(t,e.consequent))} : ${Cr(xn(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 xn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Er(xn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Ir,value:r}},LogicalExpression:function(t,e){const r=xr(xn(t,e.left));if(r.type!==Jr&&Sr(`${Cr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Jr,value:0};const n=xr(xn(t,e.right));return n.type!==Jr&&Sr(`${Cr(r)} ${e.operator} ${Cr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Fr(n.type)}.`),{type:Jr,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=xn(t,e.left),i=xn(t,e.right);if(n.type!==i.type&&Sr(`${Cr(n)} ${e.operator} ${Cr(i)}`,`Operator '${r}' cannot be applied to different types: ${Fr(n.type)} and ${Fr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Rr&&r.type===Rr?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Jr,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Nr&&e.type!==Or&&e.type!==Rr&&Sr(`${Cr(e)} ${t} ${Cr(r)}`,`Operator '${t}' cannot be applied to ${Fr(e.type)} type.`);const i=e.type===Rr?e.value.getTime():e.value,o=r.type===Rr?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Jr,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Ir&&r.type!==Nr&&r.type!==Or&&Sr(`${Cr(r)} ${e} ${Cr(n)}`,`Operator '${e}' cannot be applied to ${Fr(r.type)} type.`),r.type===Ir)return"-"===e&&Sr(`${Cr(r)} - ${Cr(n)}`,`Operator '${e}' cannot be applied to ${Fr(r.type)} type.`),{type:Ir,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===Or)try{i=Ar(0,i),Vr(t,i)}catch(t){Sr(`${Cr(r)} ${e} ${Cr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==Or&&r.type!==Nr&&Sr(`${Cr(r)} ${e} ${Cr(n)}`,`Operator '${e}' cannot be applied to ${Fr(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Sr(`${Cr(r)} ${e} ${Cr(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===Or)try{i=Ar(0,i),Vr(t,i)}catch(t){Sr(`${Cr(r)} ${e} ${Cr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>xn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(yr.has(o))n=yr.get(o);else{const t=function(t,e){const r=br.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=wr(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||"type"in t&&"missing"===t.type){const e=i.map((t=>Fr(t.type))).join(", "),n=`${r}(${wn(i)})`;"few"===t.type&&0===i.length?Sr(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Sr(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Sr(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){Sr(`${r}(${wn(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function xn(t,e){if(e.type in $n)return $n[e.type](t,e);throw new Error("Unsupported expression")}function kn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if($r(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const n=xn(r,e);return r.safeIntegerOverflow&&r.warnings.push(X(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class En{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return $r(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=kn(t,this.ast);r.warnings.forEach(e);const n=r.result;if("error"===n.type)return void e(X(new Error("Expression execution error"),{additional:{message:n.value}}));const i=n.value;if(i instanceof Date)return kr(i);if("boolean"===n.type)return Boolean(i);if("color"===n.type){const t=ot(String(i));if(t)return Pr(t);e(X(new Error("Expression execution error")))}return"integer"===n.type?i>2147483647||i<-2147483648?void e(X(new Error("Expression result is out of 32-bit int range"))):Number(i):i}catch(t){return void e(X(new Error("Expression execution error")))}}}function Cn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=mr(t,{startRule:"JsonStringContents"}),n=jr(r);return e.vars.push(...n),new En(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Cn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Cn(t[i],e,r);return n}}var n;return t}function Fn(t,e,r){if(t){if(t instanceof En)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Fn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Fn(t[i],e,r);return n}}return t}function An(t,e){const r={vars:[],hasExpression:!1},n=Cn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Fn(n,t,e)}}const Vn={pagers:function(){return R(new Map)}},jn=new Map,Sn=new Map;function Dn(t){const e=jn.get(t)||R("");return jn.has(t)||jn.set(t,e),e}function Pn(t){const e=Sn.get(t)||new Map;return Sn.has(t)||Sn.set(t,e),e}class Tn{setVariable(t){const e=t.getName(),r=Pn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Dn(this).set(e)}getVariable(t){return Pn(this).get(t)}}function zn(){return new Tn}function Mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const In=new Set(["start","stop","pause","resume","cancel","reset"]);class On{constructor(t){Mn(this,"timers",new Map),Mn(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(X(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(X(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&In.has(e)))return void this.logError(X(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};e()}}start(t){if("running"===t.state)return void this.logError(X(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(X(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(X(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(X(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(X(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(X(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(X(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(X(new Error("The timer is already running"))):this.logError(X(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}const Nn=O(((t,e,r,n)=>{let i,o;var s,l,u,v;let{id:g}=e,{json:p={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new Tn}=e,{mix:b=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:E}=e,C=R("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function S(){}const D=new Set(w);let P=!1;p||(P=!0,H(X(new Error('"json" prop is required')))),g||(P=!0,H(X(new Error('"id" prop is required'))));let T=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in ir)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const M=p.templates||{};T&&(P=!0,H(T));const I={stateChange:!1},O=Dn(m),N=Pn(m),J=new Map,U=new Map,B=new Map;let W=null;function q(t){const e=An(t,H);return e.vars.length?e.applyVars(U):t}function H(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function G(t,e){x&&x({type:t,action:e})}let Y=0;function K(t){return`${g}-${Y++}`}let Q={},tt={};function et(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=ut,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=ot(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=ot(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=ot(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=U.get(r);t?t.set(i):H(X(new Error("Cannot find variable"),{additional:{name:r}}))}else H(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");W?W.execTimerAction(a,o):H(X(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:H(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){H(X(t,{additional:{url:e}}))}}async function rt(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=gt(i);if(t)if(pt(t,D)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(et(n),await y()):n.log_id&&(nt(n),await y())}}t.forEach((t=>{t.log_id&&G("click",t)}))}}function nt(t){null==k||k(t)}const it=new Map;function ot(t){if(it.has(t))return it.get(t);H(X(new Error("Missing instance with id"),{additional:{id:t}}))}const at=new Map;function lt(t){for(const e of t)U.has(e)&&t.delete(e);return t}d(Z,{logError:H,logStat:G,hasTemplate:function(t){return t in M},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in M;){if(({json:t,templateContext:e}=sr(t,e,M,H)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:K,genClass:function(t){return`divkit-${K()}`},execAction:et,execAnyActions:rt,execCustomAction:nt,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){it.has(t)?H(X(new Error("Duplicate instance id"),{additional:{id:t}})):it.set(t,e)},unregisterInstance:function(t){it.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(tt[r]=tt[r]||0,++tt[r],Q[r])return Q[r];const n=`${K()}-svg-filter`;return Q=Object.assign(Object.assign({},Q),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;tt[r]&&0==--tt[r]&&(Q=Object.keys(Q).reduce(((t,e)=>(tt[e]&&(t[e]=Q[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return ur(t);const e=An(t,H);return e.vars.length?L(e.vars.map((t=>U.get(t)||function(t){const e=B.get(t)||R(void 0);return B.has(t)||B.set(t,e),e}(t))).filter(st),(()=>e.applyVars(U))):e.hasExpression?ur(e.applyVars(U)):ur(t)},getJsonWithVars:q,getStore:function(t){return at.has(t)||function(t){at.has(t)||at.set(t,Vn[t]())}(t),at.get(t)},getVariable:function(t,e){const r=U.get(t);if(r){const n=r.getType();if(n!==e)return void H(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return D},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(Dt,{hasAction:()=>!1});const ut={setState(t){throw new Error("Not implemented")},getChild(t){if(ct&&ct.has(t))return ct.get(t);H(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let ct=null;d(mt,{registerInstance(t,e){ct||(ct=new Map),ct.has(t)?H(X(new Error("Duplicate state with id"),{additional:{id:t}})):ct.set(t,e)},unregisterInstance(t){null==ct||ct.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const dt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(dt)&&dt.forEach((t=>{if(t&&t.type in Qe&&t.name){if(J.has(t.name))return void H(X(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&H(X(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=tr(t.name,t.type,t.value);J.set(t.name,e),U.set(t.name,e)}catch(e){H(X(e,{additional:{name:t.name}}))}}}));const vt=p.palette;vt&&vt[F].forEach((t=>{if(J.has(t.name))H(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=tr(t.name,"color",t.color);J.set(t.name,e),U.set(t.name,e)}catch(e){H(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of N)U.has(t)||U.set(t,e);O.subscribe((t=>{if(t&&!U.has(t)){const e=N.get(t);U.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ht=null===(l=null==p?void 0:p.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(ht)&&ht.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void H(X(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const n=mr(t.condition,{startRule:"JsonStringContents"}),i=jr(n);if(!i.length)return void H(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return lt(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{lt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>U.get(t))).filter(st),(()=>{const t=kn(U,n);return t.warnings.forEach(H),t.result})).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=q(t);e.log_id&&et(e)})),e=Boolean(n.value)):H(X(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){H(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else H(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const ft=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.timers;if(ft){const t=W=new On({logError:H,applyVars:q,hasVariableWithType:function(t,e){const r=U.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=U.get(t);r?r.setValue(e):H(X(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:rt});ft.forEach((e=>t.createTimer(e)))}const bt=null===(v=null==p?void 0:p.card)||void 0===v?void 0:v.states,yt=bt&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:bt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return c((()=>{W&&W.destroy()})),void 0===e.id&&r.id&&void 0!==g&&r.id(g),void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==b&&r.mix(b),void 0===e.customization&&r.customization&&void 0!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==S&&r.getDebugVariables(S),void 0===e.execAction&&r.execAction&&void 0!==et&&r.execAction(et),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":H(X(new Error("Unsupported theme"))),F&&(vt&&vt[F].forEach((t=>{const e=U.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&yt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(b?` ${b}`:"",!0)}">${z(ar,"RootSvgFilters").$$render(t,{svgFiltersMap:Q},{},{})}\n ${z(or,"Unknown").$$render(t,{div:yt,templateContext:{}},{},{})}</div>`:""})),Jn=Nn;function Un(t){return Jn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var Bn=exports;for(var Rn in e)Bn[Rn]=e[Rn];e.__esModule&&Object.defineProperty(Bn,"__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:()=>zn,createVariable:()=>tr,render:()=>Un}),new Set,new Map;const g=[],p=[],h=[],f=[],m=Promise.resolve();let b=!1;function y(){return b||(b=!0,m.then(x)),m}function _(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()();b=!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(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function F(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=J(n):r.style=J(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function S(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function D(t){const e={};for(const r in t)e[r]=S(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 T={$$render:()=>""};function z(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 M,I;function O(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:M,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}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(M),{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 J(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=J(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=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 R(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 L(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:R(n,c).subscribe};var c}const W="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Y="divkit-f0cba",Z=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980"};function tt(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function et(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function it(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=ot(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ot(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,i,o]=e,a=2===n.length?n:n+n,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 at(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const st=Boolean;function lt(t){if(1===t.length&&"solid"===t[0].type)return{color:it(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=it(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(st);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>it(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:dt(t.bg.scale),pos:vt(t.bg),image:'url("'+at(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(st);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=rt(n.value):"relative"===n.type&&(i=ut[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ct(t.bg.center_x)} ${ct(t.bg.center_y)},`+r.map((t=>it(t))).join(",")+")"}}({bg:t}):void 0)).filter(st).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ct(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function dt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function gt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function pt(t,e){return e.has(t)}function ht(t,e){e&&t.push(e)}function ft(t,e,r){const n=[];ht(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ht(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const mt=Symbol("state");function bt(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function yt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function _t(t){return yt(t)&&t>=0}function wt(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]&&!_t(r[t]))return e;return bt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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(!xt.call(e,i)||!kt(t[i],e[i]))return!1}return!0}function Et(t,e){return kt(t,e)?e:t}function Ct(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}function At(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...At(t))})):e.push(t),e}function Vt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!_t(t[r[n]]))return e;return t}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function St(){}const Dt=Symbol("action"),Pt=O(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=St}=e,{customAction:g=null}=e,{isNativeActionAnimation:p=!0}=e;const h=v(Z),f=v(Dt);d(Dt,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,b="";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){b=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(b="",h.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let y=Boolean(g);return b&&!pt(gt(b),h.getBuiltinProtocols())&&(b="",y=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==g&&r.customAction(g),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),b?`<a${F([{href:S(b)},{target:S(m)},{style:S(l)},{class:j(s,!0)+" "+j(p?W:q,!0)+" "+j(null!=a&&a.length?Y:"",!0)},D(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(y?` ${p?W:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Y:"",!0)},{style:S(l)},{role:S(y?"button":null)},{tabindex:S(y?0:null)},D(u)],{})}>${n.default?n.default({}):""}</span>`})),Tt=Pt,zt="divkit-b921d";function Mt(t){return yt(t)&&t>0}function It(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Mt(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=O(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(Z);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),i=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const n=lt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=It(t.filters,s.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${U({"border-radius":a})}>${P(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",zt,0)}${N("style",tt(t.style),0)}>`:`<span${N("class",zt,0)}${N("style",tt(t.style),0)}></span>`))}</span>`})),Nt=Ot,Jt=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,x,k,E,C,F,A,V,j,S,D,P,T,M,I,O,J,U,B,R,L,W,q,H,G,Y,K,nt=r,ot=r,at=r,st=r,ut=r,ct=r,dt=r,vt=r,ht=r,yt=r,xt=r,kt=r,St=r,Dt=r,Pt=r,zt=r,Mt=r;var It,Ot,Jt,Ut,Bt,Rt;let{json:Lt={}}=e,{origJson:Wt}=e,{templateContext:qt}=e,{cls:Ht=""}=e,{style:Gt}=e,{layoutParams:Yt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Xt=!1}=e,{customActions:Kt=""}=e,{additionalPaddings:Qt=null}=e,{heightByAspect:te=!1}=e;const ee={left:"start",center:"center",right:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=v(Z),ie=v(mt);let oe,ae,se,le,ue,ce,de,ve,ge,pe,he,fe={},me={},be=!1,ye=1,_e="transparent",we=0,$e={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},xe="",ke=null,Ee="",Ce={},Fe=0,Ae=0,Ve=0,je=!1,Se=!1,De={},Pe=0,Te=0,ze=0,Me=!1,Ie=!1,Oe=1;const Ne=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Je=-1!==Ne.indexOf("state_change")&&Lt.id,Ue=-1!==Ne.indexOf("visibility_change")&&Lt.id;let Be,Re,Le,We,qe,He,Ge,Ye,Ze,Xe=[],Ke=[],Qe=[],tr=[],er="",rr=!1,nr="visible",ir=0,or=0;void 0===e.json&&n.json&&void 0!==Lt&&n.json(Lt),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==qt&&n.templateContext(qt),void 0===e.cls&&n.cls&&void 0!==Ht&&n.cls(Ht),void 0===e.style&&n.style&&void 0!==Gt&&n.style(Gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Yt&&n.layoutParams(Yt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Xt&&n.customPaddings(Xt),void 0===e.customActions&&n.customActions&&void 0!==Kt&&n.customActions(Kt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==Qt&&n.additionalPaddings(Qt),void 0===e.heightByAspect&&n.heightByAspect&&void 0!==te&&n.heightByAspect(te),o=ne.getDerivedFromVars(Lt.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,n="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Ut=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Ut?void 0:Ut.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+it(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,ye=$t(K.stroke.width,ye),_e=it(K.stroke.color,1,_e),e.border=`${et(ye)} solid ${_e}`),K.corners_radius?($e=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!_t(r[t]))return e;return t}(K.corners_radius,$e),e["border-radius"]=t["border-radius"]=jt($e)):K.corner_radius&&(we=$t(K.corner_radius,we),$e={"top-left":we,"top-right":we,"bottom-right":we,"bottom-left":we},e["border-radius"]=t["border-radius"]=et(we)),r&&ye&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},$e);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+ye/2})),n=jt(t)}}fe=Et(t,fe),me=Et(e,me),be=r,xe=n}s=ne.getDerivedFromVars(Lt.paddings),zt(),zt=a(s,(t=>Y=t)),ke=Vt(Y&&!Xt?Y:void 0,ke),l=bt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(ke,Qt)),u=ne.getDerivedFromVars(Lt.margins),Dt(),Dt=a(u,(t=>H=t)),Ee=wt(H,Ee),c=ne.getDerivedFromVars(Lt.width),kt(),kt=a(c,(t=>W=t)),d=ne.getDerivedFromVars(Lt.alignment_horizontal),Pt(),Pt=a(d,(t=>G=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if("fixed"===u)Fe=$t(null==W?void 0:W.value,Fe),e=et(Fe);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=W&&"weight"in W&&W.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=W;t.min_size&&_t(t.min_size.value)&&(r=et(t.min_size.value)),t.max_size&&_t(t.max_size.value)&&(n=et(t.max_size.value))}"match_parent"!==u&&u||ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)i["halign-self"]="stretch";else{const t=G;i["halign-self"]="left"===t||"center"===t||"right"===t?ee[t]:Yt.parentHAlign||"start"}t&&(i.width=t),se=e,le=r,ue=n,Ae=o,Ve=a,Ce=Et(i,Ce),je=s,Se=l}g=ne.getDerivedFromVars(Lt.height),xt(),xt=a(g,(t=>L=t)),p=ne.getDerivedFromVars(Lt.alignment_vertical),St(),St=a(p,(t=>q=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if(te);else if("fixed"===u)Pe=$t(null==L?void 0:L.value,Pe),e=et(Pe);else if("match_parent"!==u||!Yt.overlapParent&&Yt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||"match_parent"===u&&Yt.parentVerticalWrapContent)&&(i["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&_t(t.min_size.value)&&(r=et(t.min_size.value)),(null==t?void 0:t.max_size)&&_t(t.max_size.value)&&(n=et(t.max_size.value))}"match_parent"===u&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?i["valign-self"]=re[t]:i["valign-self"]=Yt.parentVAlign||"start"}t&&(i.height=t),ce=e,de=r,ve=n,Te=o,ze=a,De=Et(i,De),Me=s,Ie=l}var ar,sr,lr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!W||"match_parent"===W.type)&&"match_parent"===(null==L?void 0:L.type),m=Yt.gridArea?`${Yt.gridArea.y+1}/${Yt.gridArea.x+1}/span ${Yt.gridArea.rowSpan}/span ${Yt.gridArea.colSpan}`:void 0,b=ne.getDerivedFromVars(Lt.alpha),yt(),yt=a(b,(t=>R=t)),sr=Oe,Oe=!_t(ar=R)||void 0===ar||ar>1?sr:Number(ar),ge=1===Oe?void 0:Oe,_=ne.getDerivedFromVars(Lt.accessibility),ht(),ht=a(_,(t=>B=t)),ae=void 0,B&&!Zt&&B.description&&(ae={},ae["aria-label"]=B.description),w=ne.getDerivedFromVars(Lt.background),vt(),vt=a(w,(t=>U=t)),pe={},he=!1,U&&(he=U.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(xe),!he)){const t=lt(U);pe["background-color"]=t.color,pe["background-image"]=t.image,pe["background-size"]=t.size,pe["background-position"]=t.position,pe["background-repeat"]="no-repeat"}Be=void 0,Je&&Lt.transition_in&&ne.isRunning("stateChange")&&(Be=!0),Le=void 0,Je&&Lt.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Lt.id)&&(Le=!0),$=ne.getDerivedFromVars(Lt.action),ct(),ct=a($,(t=>O=t)),x=ne.getDerivedFromVars(Lt.actions),dt(),dt=a(x,(t=>J=t)),k=ne.getDerivedFromVars(Lt.doubletap_actions),ut(),ut=a(k,(t=>I=t)),E=ne.getDerivedFromVars(Lt.longtap_actions),st(),st=a(E,(t=>M=t));{let t=J||O&&[O]||[],e=I||[],r=M||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Kt&&(t=[],e=[],r=[],ne.logError(X(new Error(`Cannot use action on component "${Kt}"`)))),Xe=t,Ke=e,Qe=r}C=ne.getDerivedFromVars(Lt.action_animation),at(),at=a(C,(t=>T=t)),T&&(tr=At(T),er=tr.map((function(t){const e=Ft(t.start_value,1),r=Ft(t.end_value,1),n=$t(t.start_delay,0),i=$t(t.duration,300),o=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return We=e,qe=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return He=e,Ge=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ne.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Lt.visibility),ot(),ot=a(F,(t=>P=t));{const t=nr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,nr);t!==e&&(!rr||"visible"!==nr&&"visible"!==e?nr=e:async function(t){nr=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Ue&&r&&(await y(),"in"===e&&(Re=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,oe,e).then((()=>{"in"===e&&(Re=!1)})).catch((t=>{throw"in"===e&&(Re=!1),t})))}(e)),rr||(rr=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ce),De),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":Be||Re||Le,visibility:nr,"has-action-animation":Boolean(er),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=ne.getDerivedFromVars(Lt.transform),nt(),nt=a(V,(t=>D=t)),D&&void 0!==D.rotation){const t=D.pivot_x||{type:"pivot-percentage",value:50};ir=Ft(t.value,ir);const e="pivot-fixed"===t.type?et(ir):`${ir}%`,r=D.pivot_y||{type:"pivot-percentage",value:50};or=Ft(r.value,or),Ye=`${e} ${"pivot-fixed"===r.type?et(or):`${or}%`}`,Ze=`rotate(${D.rotation}deg)`}return j=je||Me?"100%":Ae||Te?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Gt),pe),fe),{width:se,"min-width":le,"max-width":ue,height:ce,"min-height":de,"max-height":ve||(null==Gt?void 0:Gt["max-height"]),"grid-area":m,padding:l,margin:Ee,opacity:ge,transition:er,"transform-origin":Ye,transform:Ze,"flex-grow":Ae||Te||void 0,"flex-shrink":Ve||ze?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":We,"--divkit-animation-opacity-end":qe,"--divkit-animation-scale-start":He,"--divkit-animation-scale-end":Ge}),nt(),ot(),at(),st(),ut(),ct(),dt(),vt(),ht(),yt(),xt(),kt(),St(),Dt(),Pt(),zt(),Mt(),Se||Ie?"":`${z(Tt,"Actionable").$$render(t,{use:function(t){oe=t,Je&&Lt.transition_in&&ie.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{Be=!1})).catch((t=>{throw Be=!1,t})),Je&&Lt.transition_out&&ie.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Je&&Lt.transition_change&&ie.registerChildWithTransitionChange(Lt,qt,Lt.transition_change,t).then((()=>{Le=!1})).catch((t=>{throw Le=!1,t}));const e=Yt.fakeElement?[]:Lt.visibility_actions||Lt.visibility_action&&[Lt.visibility_action];Array.isArray(e)&&e.length&&function(t,{visibilityActions:e,rootCtx:r}){const n=e.map(((t,e)=>({index:e,action:t,visible:!1,count:0,finished:!1}))),i=e.map((t=>r.getJsonWithVars({visibility_percentage:t.visibility_percentage,visibility_duration:t.visibility_duration,log_limit:t.log_limit}))),o=[...new Set([...e.map(((t,e)=>(i[e].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=i[e.index],n=0===t.log_limit?1/0:t.log_limit||1;++e.count>=n&&(e.finished=!0);const o=r.getJsonWithVars(e.action),a=o.url;if(a){const t=gt(a);t&&!pt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(o):o.log_id&&r.execCustomAction(o))}r.logStat("visible",o)}),i[e.index].visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:o}).observe(t)}(t,{visibilityActions:e,rootCtx:ne});const r=Lt.id;r&&ie.registerChild(r);let n=null;return{destroy(){r&&ie.unregisterChild(r),n&&n.destroy()}}},cls:Ht+" "+ft("outer",Q,A),style:tt(S),actions:Xe,doubleTapActions:Ke,longTapActions:Qe,attrs:ae,isNativeActionAnimation:!tr.length||(lr=tr,lr.some((t=>"native"===t.name)))},{},{default:()=>`${he?`${z(Nt,"OuterBackground").$$render(t,{background:U,radius:xe},{},{})}`:""}${i.default?i.default({}):""}${be?`<span${N("class",Q.outer__border,0)}${N("style",tt(me),0)}></span>`:""}`})}`})),Ut=Jt,Bt={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function Rt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Lt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Wt(t,e){return Lt(t)||e}const qt=O(((t,e,r,n)=>{let i,o,a,s,l;var u,c;let d,{text:v}=e,{rootFontSize:g}=e,{textStyles:p={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",b=12,y=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==p&&r.textStyles(p),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(p.underline||p.strike)&&("single"===p.underline&&"single"===p.strike?t="both":"single"===p.underline?t="underline":"single"===p.strike&&(t="strike")),m=t}return b=Rt(p.font_size,b),Mt(p.line_height)&&(y=Number(p.line_height)/b),_t(p.letter_spacing)&&(_=et(p.letter_spacing)),d=Wt(p.font_weight,d),w=it(p.text_color,1,w),i=p.top_offset?et(p.top_offset):"",o=p.background?lt([p.background]):null,$=(null===(u=p.border)||void 0===u?void 0:u.stroke)&&"transparent"!==it(p.border.stroke.color)&&Mt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Rt(null===(c=p.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":et(10*b/g),"line-height":y,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${i?`<span${N("class",Bt["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${z(Tt,"Actionable").$$render(t,{cls:ft("text-range",Bt,s),actions:f,style:tt(l)},{},{default:()=>`${j(v)}`})}`})),Ht=qt;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Yt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Zt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,j,S,D,T,M,I,O,J,U,B,R,L=r,W=r,q=r,G=r,Y=r,Q=r,rt=r,nt=r,ot=r,at=r,st=r,ut=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ht=v(Z);let mt=!1,bt="",yt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,jt=[],St=[];var Dt,Pt;c((()=>{St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==gt&&n.origJson(gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==pt&&n.layoutParams(pt),o=ht.getDerivedFromVars(dt.text),ct(),ct=a(o,(t=>R=t)),Dt=R,Pt=bt,bt=String(null!=Dt?Dt:"")||Pt,bt?mt=!1:(mt=!0,ht.logError(X(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(dt.ranges),W(),W=a(s,(t=>V=t)),l=ht.getDerivedFromVars(dt.images),L(),L=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),q(),q=a(u,(t=>j=t)),d=ht.getDerivedFromVars(dt.font_size),ut(),ut=a(d,(t=>B=t)),yt=Rt(B,yt),g=ht.getDerivedFromVars(dt.line_height),st(),st=a(g,(t=>U=t));{const t=U;Mt(t)?(_t=Number(t)/yt,wt=!0):wt=!1}p=ht.getDerivedFromVars(dt.max_lines),nt(),nt=a(p,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*_t+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}f=ht.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(f,(t=>J=t)),Et=Gt(J,Et),m=ht.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Ct=Yt(O,Ct),b=!V||bt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=bt.length,y=ht.getDerivedFromVars(dt.text_color),rt(),rt=a(y,(t=>M=t)),_=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&b&&_&&(t=it(M||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(dt.truncate),Q(),Q=a(w,(t=>T=t)),$="none"===T?"none":"",x=ht.getDerivedFromVars(dt.text_gradient),Y(),Y=a(x,(t=>D=t));{let t="";if(D){const e=lt([D]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>S=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(S,Vt),function(t,e,r){let n=[];if(St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),St=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],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({},j),...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({},j),...l),r=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/yt)};let a="";const s=t.image.tint_color,u=Zt(t.image.tint_mode,"source_in");if(s){const e=it(t.image.tint_color);a=ht.addSvgFilter(e,u),St.push([e,u])}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({},j)}),jt=n}(bt,V,A),E={singleline:h,multiline:kt,halign:Et,valign:Ct,truncate:$},C={gradient:Boolean(At)},F={"font-size":et(yt),"line-height":_t,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},L(),W(),q(),G(),Y(),Q(),rt(),nt(),ot(),at(),st(),ut(),ct(),mt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("text",K,E)+" "+(Vt?"":H),json:dt,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${N("class",ft("text__inner",K,C),0)}${N("style",tt(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${z(Ht,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",tt(e.image.wrapperStyle),0)}><img${N("class",K.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",tt({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(Ht,"TextRangeView").$$render(t,{text:bt,rootFontSize:yt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Kt=Xt,Qt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)i=t.shape,n={width:Number((null===(o=i.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=i.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=i.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*Number((null===(e=t.radius)||void 0===e?void 0:e.value)||10);return{width:r,height:r,radius:r}}(t.shape)}var i,o,a,s,l;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?it(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=it(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${et(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let n;return n="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],n.map(et).join(" ")}let ne;function ie(){if(void 0!==ne)return ne;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),ne=1===t.scrollHeight,document.body.removeChild(t),ne}const oe="divkit-a7719",ae="divkit-f6e9a";function se(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function le(t,e,r,n){const i={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if((null==e?void 0:e.show_at_start)&&se(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)se(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];se(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const ue=O(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,s=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<s)break}else if(n.left<a)break;a=Math.max(a,n.right),s=Math.max(s,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&le(d,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};n.push(r)})),s&&le(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,g=null,p=null;return c((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),i=null,(v&&i||g||p)&&(g&&(g.disconnect(),g=null),p&&(p.disconnect(),p=null),v&&i&&("undefined"!=typeof MutationObserver&&(g=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(ae))&&!(null==r?void 0:r.contains(oe))}))&&l()})),g.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(l),p.observe(i)))),v&&i&&l(),`\n\n<div${N("class",oe,0)}${N("this",u,0)}>${P(d,(t=>`<div${N("class","divkit-c770e",0)}${U({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class",ae,0)}${U({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div>\n </div>`))}</div>`})),ce=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,j,S=r,D=r,T=r,M=r,I=r,O=r,N=r,J=r,U=r;var B,R,L,W,q,H;let{json:G={}}=e,{templateContext:Y}=e,{origJson:K}=e,{layoutParams:Q}=e;const tt={left:"start",center:"center",right:"end"},et={top:"start",center:"center",bottom:"end",baseline:"baseline"},rt=["rounded_rectangle","circle"],nt=v(Z);let it,ot=!1,at="vertical",st="top",lt="left",ut=null,ct=null,dt={};if(void 0===e.json&&n.json&&void 0!==G&&n.json(G),void 0===e.templateContext&&n.templateContext&&void 0!==Y&&n.templateContext(Y),void 0===e.origJson&&n.origJson&&void 0!==K&&n.origJson(K),void 0===e.layoutParams&&n.layoutParams&&void 0!==Q&&n.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,nt.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Y;return({templateContext:r,json:e}=nt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=nt.getDerivedFromVars(G.orientation),U(),U=a(l,(t=>j=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(j,at),u=nt.getDerivedFromVars(G.content_alignment_vertical),J(),J=a(u,(t=>V=t)),st=Yt(V,st),c=nt.getDerivedFromVars(G.content_alignment_horizontal),N(),N=a(c,(t=>A=t)),lt=Gt(A,lt),d=nt.getDerivedFromVars(G.layout_mode),O(),O=a(d,(t=>F=t)),g="wrap"===F,p=nt.getDerivedFromVars(G.separator),I(),I=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&ie()){const t=te(C.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(B=C.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(R=C.show_at_end)&&void 0!==R&&R),show_between:Boolean(null===(L=C.show_between)||void 0===L||L),style:t}:null}else ut=null;if(h=nt.getDerivedFromVars(G.line_separator),M(),M=a(h,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&ie()){const t=te(E.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(W=E.show_at_start)&&void 0!==W&&W),show_at_end:Boolean(null!==(q=E.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(H=E.show_between)||void 0===H||H),style:t}:null}else ct=null;f=ut||ct?function(t,e,r){const n={};return ee(n,e,"vertical"===t),ee(n,r,"horizontal"===t),n}(at,ut,ct):null,m=nt.getDerivedFromVars(G.aspect),T(),T=a(m,(t=>k=t));{const t=null==k?void 0:k.ratio;it=t&&Mt(t)?t:void 0}b=nt.getDerivedFromVars(G.width),S(),S=a(b,(t=>$=t)),y=nt.getDerivedFromVars(G.height),D(),D=a(y,(t=>x=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],it||x&&"wrap_content"!==x.type&&("match_parent"!==x.type||!(null==Q?void 0:Q.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=et[st],("wrap_content"===(null==$?void 0:$.type)||"match_parent"===(null==$?void 0:$.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),g&&(t.parentContainerWrap=!0),dt=Et(t,dt)}return _={orientation:at,valign:st,halign:lt,wrap:g},w={gap:ut||ct?re(at,ut,ct):void 0,"aspect-ratio":it},S(),D(),T(),M(),I(),O(),N(),J(),U(),ot?"":`${z(Ut,"Outer").$$render(t,{cls:ft("container",Qt,_),style:w,json:G,origJson:K,templateContext:Y,layoutParams:Q,additionalPaddings:f,heightByAspect:Boolean(it)},{},{default:()=>`${P(s,(e=>`${z(or,"Unknown").$$render(t,{layoutParams:dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||ct?`${z(ue,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:ct,orientation:at},{},{})}`:""}`})}`})),de=ce,ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ge(t,e){return"vertical"===t||"horizontal"===t?t:e}const pe=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:b}=e;const y=v(Z);let _="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!==b&&n.layoutParams(b),o=y.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>g=t)),_=ge(null==g?void 0:g.orientation,_),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=it(null==g?void 0:g.color,1,w),l="horizontal"===_?"100%":et(1),u="horizontal"===_?et(1):"100%",c={background:w,width:l,height:u},d={orientation:_},p(),`${z(Ut,"Outer").$$render(t,{cls:ft("separator",ve,d),json:h,origJson:m,templateContext:f,layoutParams:b},{},{default:()=>s?`<span${N("class",ve.separator__inner,0)}${N("style",tt(c),0)}></span>`:""})}`})),he={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},fe=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,j,S,D,P,T,M,I,O,J,B,R,L,W=r,q=r,H=r,G=r,Y=r,K=r,Q=r,et=r,rt=r,nt=r,ot=r,st=r,lt=r,ut=r,{json:ct={}}=e,{templateContext:gt}=e,{origJson:pt}=e,{layoutParams:ht}=e;const mt=v(Z);let bt,yt=0,_t="rgba(0,0,0,0.08)",wt=!1,xt="",kt="none",Et="50% 50%",Ft="0",At="source_in",Vt="",jt="",St=0,Dt=0,Pt=0,Tt="",zt="";c((()=>{mt.removeSvgFilter(bt,At)})),void 0===e.json&&n.json&&void 0!==ct&&n.json(ct),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==ht&&n.layoutParams(ht),o=mt.getDerivedFromVars(ct.image_url),ut(),ut=a(o,(t=>L=t)),s=mt.getDerivedFromVars(ct.gif_url),lt(),lt=a(s,(t=>R=t)),l=L||R,yt=0,l?wt=!1:(wt=!0,mt.logError(X(new Error('Missing "image_url" for "image"')))),u=mt.getDerivedFromVars(ct.width),st(),st=a(u,(t=>B=t)),d="wrap_content"===(null==B?void 0:B.type),g=mt.getDerivedFromVars(ct.height),ot(),ot=a(g,(t=>J=t)),p="wrap_content"===(null==J?void 0:J.type),h=mt.getDerivedFromVars(ct.preview),nt(),nt=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}f=mt.getDerivedFromVars(ct.placeholder_color),rt(),rt=a(f,(t=>I=t)),_t=it(I,1,_t),m=mt.getDerivedFromVars(ct.scale),et(),et=a(m,(t=>M=t)),kt=dt(M)||kt,b=mt.getDerivedFromVars({content_alignment_horizontal:ct.content_alignment_horizontal,content_alignment_vertical:ct.content_alignment_vertical}),Q(),Q=a(b,(t=>T=t)),Et=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:vt(t)}(T,Et),y=mt.getDerivedFromVars(ct.accessibility),K(),K=a(y,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=mt.getDerivedFromVars(ct.aspect),Y(),Y=a(w,(t=>D=t));{const t=null==D?void 0:D.ratio;Ft=t&&Mt(t)?(100/Number(t)).toFixed(2):"0"}$=mt.getDerivedFromVars(ct.tint_color),G(),G=a($,(t=>S=t)),x=mt.getDerivedFromVars(ct.tint_mode),H(),H=a(x,(t=>j=t));{const t=S,e=t?it(t):void 0,r=Zt(j,At);e===bt&&r===At||(mt.removeSvgFilter(bt,At),Vt=e?mt.addSvgFilter(e,r):"",bt=e,At=r)}if(k=mt.getDerivedFromVars(ct.appearance_animation),q(),q=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;jt=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=$t(t.duration,300),Dt=$t(t.start_delay,0),St=$t(t.alpha,0)}E=mt.getDerivedFromVars(ct.filters),W(),W=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=It(A,mt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Tt=t,zt=e}return C={aspect:"0"!==Ft,"is-width-content":d,"is-height-content":p,loaded:!1,"before-appearance":Boolean(jt)&&!0},F={"background-image":xt,"background-color":xt?void 0:_t,"background-size":kt,"clip-path":zt||void 0,"object-fit":kt,"object-position":Et,filter:["",Tt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":jt||void 0,"--divkit-appearance-fade-start":jt?St:void 0,"--divkit-appearance-delay":jt?`${Dt}ms`:void 0,"--divkit-appearance-duration":jt?`${Pt}ms`:void 0},W(),q(),H(),G(),Y(),K(),Q(),et(),rt(),nt(),ot(),st(),lt(),ut(),wt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("image",he,C),json:ct,origJson:pt,templateContext:gt,layoutParams:ht,customDescription:!0},{},{default:()=>C.aspect?`<span${N("class",he["image__aspect-wrapper"],0)}${U({"padding-bottom":`${Ft}%`})}><img${N("class",he.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",tt(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}></span>`:`<img${N("class",he.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",tt(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}>`})}`})),me={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function be(t){return t>0&&t<1}function ye(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(be)){const e=Math.max(...t.filter(be).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${et(n*t[e]/i)},${ye(t[e])}fr)`:t[e]?o[e]=`${ye(t[e])}fr`:o[e]="auto";return o.join(" ")}const we=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(Z);let A,V,j=!1,S=1,D=[],T=[],M=[],I=[],O=0,N=!1,J="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!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>b=t)),S=Rt(b,S),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;D=[],T=[],M=[],I=[],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,(!D[n]||D[n]<g)&&(D[n]=g),(!T[e]||T[e]<p)&&(T[e]=p),(!M[n]||M[n]<h)&&(M[n]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=S&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(u,(t=>f=t)),J=Yt(f,J),c=F.getDerivedFromVars(x.content_alignment_horizontal),y(),y=a(c,(t=>h=t)),U=Gt(h,U),d={valign:J,halign:U},g={"grid-template-columns":_e(D,M,S),"grid-template-rows":_e(T,I,O)},p=j||N,y(),_(),w(),$(),p?"":`${z(Ut,"Outer").$$render(t,{cls:ft("grid",me,d),json:x,origJson:E,templateContext:k,style:g,layoutParams:C},{},{default:()=>`${P(V,(e=>`${z(or,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),$e=we,xe={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function ke(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function Ee(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ce=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,S,D,T,M,I,O,J,U=r,B=r,R=r,W=r,q=r,H=r,Y=r,K=r,Q=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Z);let lt,ut,ct=[],dt=null,vt=!1;st.getCustomization("galleryLeftClass"),st.getCustomization("galleryRightClass");let gt=!1;O=a(st.isDesktop,(t=>I=t));let pt,ht,mt,bt,yt=1,_t="horizontal",xt="start",kt=8,Ct="",Ft=[],At={},Vt=!1,jt={},St=0;const Dt=Ee((function(){}),50);function Pt(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<yt;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Tt(t,e,r="smooth"){const n="horizontal"===_t,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";lt.scroll({[o]:Math.max(0,t[e][i]-kt/2),behavior:r})}function zt(t){const e=Pt(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===_t?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"===_t?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!nt.id||gt||(null==at?void 0:at.fakeElement)||st.registerInstance(nt.id,{setCurrentItem(t){const e=Pt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Tt(e,t)},setPreviousItem(t){const e=zt("prev"),r=Pt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Tt(r,n)},setNextItem(t){const e="horizontal"===_t?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Pt();if(e&&"ring"===t)return void Tt(r,0);const n=zt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Tt(r,i)}}),c((()=>{vt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?gt=!1:(gt=!0,st.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!gt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&vt&&!gt,l?"undefined"!=typeof ResizeObserver&&(dt=new ResizeObserver((()=>{Dt()})),dt.observe(ut)):dt&&(dt.disconnect(),dt=null),u=st.getDerivedFromVars(nt.column_count),Q(),Q=a(u,(t=>M=t)),yt=Rt(M,yt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,yt),g=st.getDerivedFromVars(nt.orientation),K(),K=a(g,(t=>T=t)),_t=ge(T,_t),p=st.getDerivedFromVars(nt.cross_content_alignment),Y(),Y=a(p,(t=>D=t)),xt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(D,xt),h=st.getDerivedFromVars(nt.item_spacing),H(),H=a(h,(t=>S=t)),kt=$t(S,kt),pt=et(kt),f=st.getDerivedFromVars(nt.cross_spacing),q(),q=a(f,(t=>V=t)),mt=$t(V,kt),ht=et(mt),m=st.getDerivedFromVars(nt.paddings),W(),W=a(m,(t=>A=t)),Ct=wt(A,Ct),b="horizontal"===_t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===_t?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),bt=L(t,(t=>t)),R(),R=a(bt,(t=>F=t))}Ft=[],yt>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===_t||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),y=st.getDerivedFromVars(nt.scroll_mode),B(),B=a(y,(t=>C=t));{const t={};let e={};Vt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===_t?e.parentVAlign=xt:e.parentHAlign=xt,"paging"===C&&(Vt=!0,e.scrollSnap="start",t["horizontal"===_t?"scroll-padding-left":"scroll-padding-top"]=et(kt/2)),1===yt&&(e.parentLayoutOrientation=_t),At=Et(t,At),jt=Et(e,jt)}return _=st.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(_,(t=>J=t)),w={padding:Ct,"grid-gap":ht},$={"grid-gap":pt,[b]:ke(Ft)},x={orientation:_t,"scroll-snap":Vt},k=st.getDerivedFromVars(nt.default_item),U(),U=a(k,(t=>E=t)),St=$t(E,St),U(),B(),R(),W(),q(),H(),Y(),K(),Q(),O(),rt(),"\n\n"+(gt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("gallery",xe,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(xe.gallery__scroller,!0)+" "+j(J?G:"",!0)}"${N("style",tt(At),0)}${N("this",lt,0)}><div${N("class",xe["gallery__items-grid"],0)}${N("style",tt(w),0)}${N("this",ut,0)}>${P(d,((e,r)=>`<div${N("class",xe.gallery__items,0)}${N("style",tt($),0)}${N("this",ct[r],0)}>${P(e,(e=>`${z(or,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===_t?"\n ":""}`})}`)})),Fe=Ce,Ae={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Ve=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,_,w,$,x,k,E,C,F,A,V,S,D=r,T=r,M=r,I=r,O=r,J=r,B=r,R=r,L=r;var W;let{json:q={}}=e,{templateContext:H}=e,{origJson:Y}=e,{layoutParams:K}=e;const Q=v(Z),nt=Q.genId("tabs");let ot,at,st,lt=!1,ut={};const ct=Q.getJsonWithVars(q.selected_tab);let dt,vt,gt=ct&&Number(ct)||0,pt=12,ht="",mt="",yt="",xt="",kt="",Ct="",Ft="",At="",St=0,Dt="",Pt="",zt=null,It=!1,Ot=!1,Nt=gt,Jt=[],Bt=[];async function Lt(t,e=!1){if(Nt=gt,gt=t,It||(It=!0,at.style.height=et(at.clientHeight),st.style.transform=`translate3d(${100*-Nt}%,0,0)`),Ot=!0,async function(t){await y(),st.style.transform=`translate3d(${t}%,0,0)`}(100*-gt),function(t=!1){const e=t?Math.max(0,gt-1):Math.min(gt,Nt),r=t?Math.min(o.length-1,gt+1):Math.max(gt,Nt);Jt=Jt.map(((t,n)=>t||n>=e&&n<=r)),Bt=Bt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await y();const t=document.getElementById(`${nt}-panel-${gt}`);t&&(at.style.height=et(t.offsetHeight))}(),Ht&&clearTimeout(Ht),Ht=window.setTimeout((()=>{Bt=o.map(((t,e)=>e===gt))}),400),qt=-gt*at.clientWidth,e){await y();const t=ot.querySelector(`.${Ae.tabs__item_selected}`);t&&t.focus()}}let qt,Ht=null;!q.id||lt||(null==K?void 0:K.fakeElement)||Q.registerInstance(q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Lt(t)},setPreviousItem(t){let e=gt-1;e<0&&(e="ring"===t?o.length-1:gt),Lt(e)},setNextItem(t){let e=gt+1;e>o.length-1&&(e="ring"===t?0:gt),Lt(e)}}),c((()=>{q.id&&!(null==K?void 0:K.fakeElement)&&Q.unregisterInstance(q.id)})),void 0===e.json&&n.json&&void 0!==q&&n.json(q),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==Y&&n.origJson(Y),void 0===e.layoutParams&&n.layoutParams&&void 0!==K&&n.layoutParams(K),o=q.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?lt=!1:(lt=!0,Q.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=Q.getDerivedFromVars(q.width),R(),R=a(s,(t=>V=t)),l=Q.getDerivedFromVars(q.height),B(),B=a(l,(t=>A=t));{let t={};(null==K?void 0:K.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==V?void 0:V.type)&&(t.parentHorizontalWrapContent=!0),A&&"wrap_content"!==A.type||(t.parentVerticalWrapContent=!0),ut=Et(t,ut)}if(!lt&&(gt<0||gt>=o.length)&&(Q.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:q.selected_tab,length:o.length}})),gt=gt<0?0:o.length-1),u=Q.getDerivedFromVars(q.tab_title_style),J(),J=a(u,(t=>F=t)),d=F||{},pt=Rt(d.font_size,pt),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/pt*10,right:(Number(t.right)||0)/pt*10,bottom:(Number(t.bottom)||0)/pt*10,left:(Number(t.left)||0)/pt*10};ht=wt(e,ht)}{const t=d.line_height;void 0!==t&&Mt(t)&&(mt=et(t/pt*10))}{const t=d.letter_spacing;void 0!==t&&_t(t)&&(yt=et(t/pt*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(W=d.corner_radius)&&void 0!==W?W:1e3;d.corners_radius?xt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!_t(i[t]))return n;return jt(t,e,r)}(d.corners_radius,t,pt,xt):_t(t)&&(xt=et(t/pt*10))}return dt=Wt(d.active_font_weight||d.font_weight,dt),vt=Wt(d.inactive_font_weight||d.font_weight,vt),kt=it(d.active_text_color,1,kt),Ct=it(d.inactive_text_color,1,Ct),Ft=it(d.active_background_color,1,Ft),At=it(d.inactive_background_color,1,At),St=$t(d.item_spacing,St),g=Q.getDerivedFromVars(q.has_separator),O(),O=a(g,(t=>C=t)),p=Q.getDerivedFromVars(q.separator_color),I(),I=a(p,(t=>E=t)),h=Q.getDerivedFromVars(q.separator_paddings),M(),M=a(h,(t=>k=t)),C&&(E&&(Dt=it(E,1,Dt)),k&&(Pt=wt(k,Pt))),f={background:Dt,margin:Pt},m=Q.getDerivedFromVars(q.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>x=t)),b=void 0===x||Boolean(x),_=Q.getDerivedFromVars(q.restrict_parent_scroll),L(),L=a(_,(t=>S=t)),w=Q.getDerivedFromVars(q.title_paddings),D(),D=a(w,(t=>$=t)),zt=Vt($||void 0,zt),lt||(Jt=o.map(((t,e)=>e===gt)),Bt=o.map(((t,e)=>e===gt))),D(),T(),M(),I(),O(),J(),B(),R(),L(),lt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("tabs",Ae,{}),json:q,origJson:Y,templateContext:H,layoutParams:K,customActions:"tabs"},{},{default:()=>`<div class="${j(Ae.tabs__list,!0)+" "+j(S?G:"",!0)}" role="tablist"${U({"--divkit-tabs-title-padding":zt?bt(zt):"","--divkit-tabs-font-size":et(pt),"--divkit-tabs-paddings":ht,"--divkit-tabs-line-height":mt,"--divkit-tabs-letter-spacing":yt,"--divkit-tabs-active-font-weight":dt||"","--divkit-tabs-inactive-font-weight":vt||"","--divkit-tabs-active-text-color":kt,"--divkit-tabs-inactive-text-color":Ct,"--divkit-tabs-active-background-color":Ft,"--divkit-tabs-inactive-background-color":At,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":St?rt(St):""})}${N("this",ot,0)}>${P(o,((e,r)=>{let n=r===gt;return`\n\n ${z(Tt,"Actionable").$$render(t,{cls:ft("tabs__item",Ae,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=K&&K.fakeElement?[]:[e.title_click_action],attrs:{id:`${nt}-tab-${r}`,"aria-controls":`${nt}-panel-${r}`,role:"tab",tabindex:!n||null!=K&&K.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=K&&K.fakeElement?null:t=>function(t,e){return gt===e||(Lt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${C?`<div${N("class",Ae.tabs__separator,0)}${N("style",tt(f),0)}></div>`:""}\n <div class="${j(Ae.tabs__panels,!0)+" "+j(S?G:"",!0)}"${N("this",at,0)}><div${N("class",ft("tabs__swiper",Ae,{inited:It,animated:Ot}),0)}${N("this",st,0)}>${P(o,((e,r)=>`<div${N("class",ft("tabs__panel",Ae,{visible:Bt[r]}),0)} role="tabpanel" id="${j(nt,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(nt,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Jt[r]?`${z(or,"Unknown").$$render(t,{div:e.div,templateContext:H,layoutParams:ut},{},{})}`:""}\n </div>`))}</div></div>`})}`})),je=Ve,Se="divkit-eb860",De="divkit-e08c6";function Pe(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)}}Pe([.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]),Pe([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 Te=O(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(Z),g=v(mt);let p=new Map,h=new Set,f=!1,m=null,b=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(g.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[],$.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await y()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return _.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{x&&!(null==l?void 0:l.fakeElement)&&g.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),f?"":`${z(Ut,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${z(or,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${P(b,(e=>"direction"in e?`<div${N("class",Se,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${N("class",De,0)}>${z(or,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class",Se,0)}><div${N("class",De,0)}>${z(or,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ze={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,x,k,E=r,C=r,F=r,A=r,V=r,S=r;var D,T,M,I,O,J,U;let{json:B={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:W}=e;const q=v(Z),H=q.genId("pager");let Y,K=!1,Q=!1,nt=0,it=0,ot=!1,at="horizontal",st="",lt="",ut="";function ct(t,e="smooth"){const r="horizontal"===at,n=Y.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:n[i],behavior:e}),nt=t}Ee((function(){if(!K)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===at?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:nt}();t!==nt&&(nt=t)}),50),B.id&&!(null==W?void 0:W.fakeElement)&&q.registerInstance(B.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ct(t)},setPreviousItem(t){let e=nt-1;e<0&&(e="ring"===t?o.length-1:nt),ct(e)},setNextItem(t){let e=nt+1;e>o.length-1&&(e="ring"===t?0:nt),ct(e)}}),c((()=>{K=!1,B.id&&!(null==W?void 0:W.fakeElement)&&q.unregisterInstance(B.id)})),void 0===e.json&&n.json&&void 0!==B&&n.json(B),void 0===e.templateContext&&n.templateContext&&void 0!==R&&n.templateContext(R),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==W&&n.layoutParams(W),(null===(D=B.items)||void 0===D?void 0:D.length)&&Array.isArray(B.items)?Q=!1:(Q=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!Q&&B.items||[]).map((t=>{let e=t,r=R;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(B.layout_mode),C(),C=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(ot=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ot=!1:(ot=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(B.orientation),V(),V=a(l,(t=>x=t)),at=ge(x,at),u=q.getDerivedFromVars(B.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&_t(t)&&(st=et(t||0))}if(d=q.getDerivedFromVars(B.paddings),F(),F=a(d,(t=>w=t)),lt=wt(w,lt),g=q.getDerivedFromVars(B.restrict_parent_scroll),S(),S=a(g,(t=>k=t)),p="horizontal"===at?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=rt("horizontal"===at?((null===(T=B.paddings)||void 0===T?void 0:T.left)||0)+((null===(M=B.paddings)||void 0===M?void 0:M.right)||0):((null===(I=B.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=B.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(J=_.neighbour_page_width)||void 0===J?void 0:J.value;ut=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${st})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(U=_.page_width)||void 0===U?void 0:U.value;ut=`${Number(t)}%`}return h={"grid-gap":st,padding:lt,[p]:ut},f={orientation:at},m=Q||ot,b=q.getStore("pagers"),E(),E=a(b,(t=>y=t)),function(t,e){const r=B.id;if(r){const o=new Map(y);n=b,y=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:ct}),i=y,n.set(i)}var n,i}(o.length,nt),function(t){var e;if(t===it)return;it=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(nt),E(),C(),F(),A(),V(),S(),m?"":`${z(Ut,"Outer").$$render(t,{cls:ft("pager",ze,f),json:B,origJson:L,templateContext:R,layoutParams:W,customPaddings:!0},{},{default:()=>`<div class="${j(ze.pager__items,!0)+" "+j(k?G:"",!0)}"${N("style",tt(h),0)}${N("this",Y,0)}>${P(o,(e=>`<div${N("class",ze.pager__item,0)}>${z(or,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=W&&W.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ie=Me,Oe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},Ne=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,x,k,E,C,F=r,A=r,V=r,S=r,D=r,T=r,M=r,I=r,O=r;var J,B;let{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(Z);let X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},tt="default",rt=15,nt=10,ot=5;if(void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),o=Y.getDerivedFromVars(R.shape),T(),T=a(o,(t=>x=t)),s=Y.getDerivedFromVars(R.active_item_color),S(),S=a(s,(t=>w=t)),l=Y.getDerivedFromVars(R.inactive_item_color),D(),D=a(l,(t=>$=t)),u=Y.getDerivedFromVars(R.active_item_size),M(),M=a(u,(t=>k=t)),c=Y.getDerivedFromVars(R.active_shape),O(),O=a(c,(t=>C=t)),d=Y.getDerivedFromVars(R.inactive_shape),I(),I=a(d,(t=>E=t)),C&&(K=te({type:"shape_drawable",shape:C},G,K)),E&&(Q=te({type:"shape_drawable",shape:E},G,Q)),!C&&!E&&x){const t=Rt(k,1.3);Q=te({type:"shape_drawable",shape:x,color:Q.background},G,Q),Q.background=it($,1,Q.background),K=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:K.background}),K.background=it(w,1,K.background)}if(g=Y.getDerivedFromVars(R.space_between_centers),A(),A=a(g,(t=>b=t)),p=Y.getDerivedFromVars(R.items_placement),V(),V=a(p,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)tt="default",b&&(rt=$t(b.value,rt));else if(tt=_.type,"default"===tt)rt=$t(null===(J=_.space_between_centers)||void 0===J?void 0:J.value,rt);else if("stretch"===tt){const t=_;nt=Rt(t.max_visible_items,nt),ot=$t(null===(B=t.item_spacing)||void 0===B?void 0:B.value,ot)}return h=Y.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await y())}(m),f={placement:tt},F(),A(),V(),S(),D(),T(),M(),I(),O(),`${z(Ut,"Outer").$$render(t,{cls:ft("indicator",Oe,f),json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${N("class",Oe.indicator__scroller,0)}${N("this",undefined,0)}><div${N("class",Oe.indicator__items,0)} role="tablist"${U({margin:"default"===tt?`0 ${et(Math.max(0,K.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":et(Q.width),"--divkit-indicator-inactive-height":et(Q.height),"--divkit-indicator-inactive-border-radius":et(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":et(K.width),"--divkit-indicator-active-height":et(K.height),"--divkit-indicator-active-border-radius":et(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/Q.width,"--divkit-indicator-default-margin":"default"===tt?`0 ${et((rt-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===tt?et(ot):"","--divkit-indicator-stretch-max-count":"stretch"===tt?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===tt?et((nt-1)*ot):""})}${N("this",undefined,0)}>${X?`${P(Array(X.size),((t,e)=>{let r=e===X.currentItem;return`\n <div class="${j(ft("indicator__item",Oe,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(X.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(X.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Je=Ne,Ue={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&it(t.text_color)||"#000",i=Lt(t.font_weight);if(Mt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:et(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Re(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Le="function"==typeof BigInt;function We(t){return Le?BigInt(t):Number(t)}const qe=We("9223372036854775807"),He=We("-9223372036854775808");function Ge(t){const e=We(t);if(e>qe||e<He)throw new Error("Integer overflow.");return e}const Ye=Ge(0);function Ze(t){let e=t;return e<0&&(e=-e),e}function Xe(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ge(e)}class Ke{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=R(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 Qe={string:class extends Ke{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Ke{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 Ke{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>qe||t<He)throw new Error("Incorrect variable value");return Ge(t)}fromString(t){const e=Ge(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Ke{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 Ke{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Ke{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function tr(t,e,r){if(!(e in Qe))throw new Error("Unsupported variable type");return new Qe[e](t,r)}function er(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 rr=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,S,D,T,M,I,O,J,B,R,L,W,q,H,G=r,Y=r,K=r,Q=r,tt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,dt,vt,gt;let{json:pt={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:bt}=e;const yt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Z),kt=v(Dt);let Et=0,Ct=100;const At=xt.getJsonWithVars(pt.thumb_value_variable),Vt=xt.getJsonWithVars(pt.thumb_secondary_value_variable);W=a(At&&xt.getVariable(At,"integer")||tr("temp","integer",0),(t=>L=t)),R=a(Vt&&xt.getVariable(Vt,"integer")||tr("temp","integer",0),(t=>B=t));let jt,St,Pt,Tt=Re(L||0,Et,Ct),zt=Re(B||0,Et,Ct),Mt=yt,It=Mt,Ot=yt,Nt=yt,Jt=null,Bt=null,Rt=Pt,Lt="",Wt="",qt=!1;Ee((function(){}),50),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==ht&&n.templateContext(ht),void 0===e.origJson&&n.origJson&&void 0!==mt&&n.origJson(mt),void 0===e.layoutParams&&n.layoutParams&&void 0!==bt&&n.layoutParams(bt),o=xt.getDerivedFromVars(pt.min_value),ut(),ut=a(o,(t=>H=t)),s=xt.getDerivedFromVars(pt.max_value),lt(),lt=a(s,(t=>q=t)),Et=Ft(H,Et),Ct=Ft(q,Ct);{const t=Re(L||0,Et,Ct);t!==Tt&&(Tt=t)}{const t=Re(B||0,Et,Ct);t!==zt&&(zt=t)}l=xt.getDerivedFromVars(pt.thumb_style),st(),st=a(l,(t=>J=t)),Mt=te(J,wt,Mt),u=xt.getDerivedFromVars(pt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),It=te(O,wt,Mt),c=xt.getDerivedFromVars(pt.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Ot=te(I,$t,Ot),d=xt.getDerivedFromVars(pt.track_active_style),it(),it=a(d,(t=>M=t)),Nt=te(M,$t,Nt),g=xt.getDerivedFromVars(pt.tick_mark_active_style),nt(),nt=a(g,(t=>T=t));{let t=te(T,wt,yt);t!==yt&&(Jt=t)}jt=Jt?Vt?er(Math.min(Tt,zt),Math.max(Tt,zt)+1,Et,Ct,!0):er(Et,Tt,Et,Ct,!0):[],p=xt.getDerivedFromVars(pt.tick_mark_inactive_style),tt(),tt=a(p,(t=>D=t));{let t=te(D,wt,yt);t!==yt&&(Bt=t)}St=Bt?Vt?er(Math.min(Tt,zt),Math.max(Tt,zt)+1,Et,Ct,!1):er(Tt+1,Ct+1,Et,Ct,!0):[],h=xt.getDerivedFromVars(pt.thumb_text_style),Q(),Q=a(h,(t=>S=t)),Pt=Be(S,Pt),f=xt.getDerivedFromVars(pt.thumb_secondary_text_style),K(),K=a(f,(t=>V=t)),Rt=Be(V,Pt),m=xt.getDerivedFromVars(pt.accessibility),Y(),Y=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),b=xt.getDerivedFromVars(pt.secondary_value_accessibility),G(),G=a(b,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):Mt===yt?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===yt?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===yt&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return y=et(Math.max(...[Mt.width,It.width,0].filter(_t))),_=et(Math.max(...[Mt.height,It.height,0].filter(_t))),w=(Tt-Et)/(Ct-Et),$=Vt?(zt-Et)/(Ct-Et):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":et(Mt.width),"--divkit-slider-thumb-height":et(Mt.height),"--divkit-slider-thumb-secondary-width":et(It.width),"--divkit-slider-thumb-secondary-height":et(It.height),"--divkit-slider-text-offset-x":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.x)?rt(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==Pt?void 0:Pt.offset)||void 0===dt?void 0:dt.y)?rt(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Rt?void 0:Rt.offset)||void 0===vt?void 0:vt.x)?rt(Rt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Rt?void 0:Rt.offset)||void 0===gt?void 0:gt.y)?rt(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":Jt?et(Jt.width):void 0,"--divkit-slider-tick-active-height":Jt?et(Jt.height):void 0,"--divkit-slider-tick-active-border-radius":Jt?et(Jt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Jt?void 0:Jt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Jt?void 0:Jt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?et(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?et(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?et(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":y,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Y(),K(),Q(),tt(),nt(),it(),ot(),at(),st(),R(),W(),lt(),ut(),"\n\n"+(qt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("slider",Ue,C),style:E,customDescription:!0,customActions:"slider",json:pt,origJson:mt,templateContext:ht,layoutParams:bt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",Ue["slider__tracks-wrapper"],0)}><div${N("class",Ue["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",Ue.slider__track,0)}${U({height:et(Ot.height),"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${N("class",Ue["slider__active-track"],0)}${U({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Nt.height),"border-radius":et(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n ${P(jt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(St,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",Ue.slider__thumb,0)}${U({"border-radius":et(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Pt?`<div${N("class",Ue["slider__thumb-text"],0)}><div${N("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Pt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Pt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Pt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Tt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ue.slider__thumb,!0)+" "+j(Ue.slider__thumb_secondary,!0)}"${U({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Rt?`<div class="${j(Ue["slider__thumb-text"],!0)+" "+j(Ue["slider__thumb-text_secondary"],!0)}"><div${N("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Rt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Rt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Rt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",Ue.slider__input,0)}${N("min",Et,0)}${N("max",Ct,0)} step="1"${N("value",Tt,0)}${N("aria-label",Lt,0)}>\n ${Vt?`<input type="range"${N("class",`${Ue.slider__input} ${Ue.slider__input_secondary}`,0)}${N("min",Et,0)}${N("max",Ct,0)} step="1"${N("value",zt,0)}${N("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),nr={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},ir={text:Kt,container:de,separator:pe,image:fe,gif:fe,grid:$e,gallery:Fe,tabs:je,state:Te,pager:Ie,indicator:Je,slider:rr,input:O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,x,k,E,C,F,A,V,S,D,P,T,M,I,O,J,U,B=r,R=r,{json:L={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Z);let Y;const K=G.getJsonWithVars(L.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),O=a(K&&G.getVariable(K,"string")||tr("temp","string",""),(t=>I=t));let tt="";M=a(G.getDerivedFromVars(L.hint_text),(t=>T=t)),P=a(G.getDerivedFromVars(L.hint_color),(t=>D=t));let nt="";S=a(G.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(G.getDerivedFromVars(L.line_height),(t=>E=t)),k=a(G.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(G.getDerivedFromVars(L.highlight_color),(t=>y=t));let ct="";b=a(G.getDerivedFromVars(L.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";f=a(G.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let pt="",ht="";U=a(G.getDerivedFromVars(L.select_all_on_focus),(t=>J=t)),void 0===e.json&&n.json&&void 0!==L&&n.json(L),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!==H&&n.layoutParams(H),tt=I,o=T,nt=it(D,1,nt),st=Rt(V,st),ot=Wt(F,ot);{const t=E;Mt(t)&&(at=t/st)}return yt(x)&&(lt=et(x/st*10)),ut=it(w,1,ut),ct=it(y,1,ct),m&&m in dt&&(gt=dt[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(L.paddings),R(),R=a(l,(t=>p=t)),Mt(h)&&(pt=`calc(${h*(at||1.25)+"em"} + ${rt($t(null==p?void 0:p.top,0)+$t(null==p?void 0:p.bottom,0))})`),u=G.getDerivedFromVars(L.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?ht=g.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ct,"font-size":et(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":pt},B(),R(),f(),b(),_(),$(),k(),C(),A(),S(),P(),M(),O(),U(),Q?"":`${z(Ut,"Outer").$$render(t,{cls:ft("input",nr,c),style:d,customDescription:!0,customActions:"input",json:L,origJson:q,templateContext:W,layoutParams:H},{},{default:()=>`<span${N("class",nr.input__wrapper,0)}><span${N("class",nr.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"":""}</span>\n ${s?`<textarea${N("class",nr.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ht,0)}${N("placeholder",o,0)}${N("this",Y,0)}>${j(tt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",nr.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ht,0)}${N("placeholder",o,0)}${N("value",tt,0)}${N("this",Y,0)}>`}</span>`})}`}))},or=O(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Z);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&&ir[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&ir[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${z(d||T,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),ar=O(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function sr(t,e,r,n){const i=r[t.type];if(!i)return n(X(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function lr(){}function ur(t){return{subscribe:e=>(e(t),lr)}}function cr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function dr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function vr(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 gr(t){try{return Ge(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function pr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function hr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,hr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function fr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function mr(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",c="\\",d="||",v="&&",g="==",p="!=",h=">=",f="<=",m="+",b="-",y="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),S={type:"any"},D=kt(["}"],!0,!1),P=xt("?",!1),T=xt(":",!1),z=xt("||",!1),M=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),N=xt(">=",!1),J=xt(">",!1),U=xt("<=",!1),B=xt("<",!1),R=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Y=xt("(",!1),Z=xt(")",!1),X=xt(",",!1),K=Et("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Et("integer"),rt=kt([["0","9"]],!1,!1),nt=Et("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Et("boolean"),lt=xt("true",!1),ut=xt("false",!1),ct=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),gt=Et("whitespace"),pt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return vr(t)},ft=0,mt=0,bt=[{line:1,column:1}],yt=0,_t=[],wt=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=bt[e];if(n)return n;for(r=e-1;!bt[r];)r--;for(n={line:(n=bt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return bt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<yt||(ft>yt&&(yt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Rt(),(e=St())!==n?(Rt(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=St())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(D)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(D));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=pr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function St(){var e,r,i,o,a,s;return e=ft,(r=Dt())!==n?(Rt(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(P)),i!==n?(Rt(),(o=St())!==n?(Rt(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(T)),a!==n?(Rt(),(s=St())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=Dt()),e}function Dt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Pt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=dr(r,i)}else ft=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=dr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function It(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=cr(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i;return(e=Ut())===n&&(e=Jt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(R)),r===n&&(45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)))),r!==n?(Rt(),(i=Ot())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Bt())!==n?(Rt(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Y)),i!==n?(Rt(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=St())!==n){for(i=[],o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=St())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=St())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Rt()),e}(),o!==n?(Rt(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Bt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=vr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Ut())===n&&(e=Jt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Y)),r!==n&&(i=St())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=St())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=pr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Jt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:gr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Ut(){var e,r,i,o,a,s,l,u,c,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=n,0===wt&&At(R)),u===n&&(45===t.charCodeAt(ft)?(u=b,ft++):(u=n,0===wt&&At(L))),u===n&&(u=null),c=[],x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else c=n;c!==n?s=l=[l,u,c]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(R)),a===n&&(45===t.charCodeAt(ft)?(a=b,ft++):(a=n,0===wt&&At(L))),a===n&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Bt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Rt(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));return wt--,r=n,0===wt&&At(gt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new hr(hr.buildMessage(t,e),t,e,r)}(_t,yt<t.length?t.charAt(yt):null,yt<t.length?Ft(yt,yt+1):Ft(yt,yt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(hr,Error),hr.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=fr("",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+" | "+fr("",i.column-1," ")+fr("",u,"^")}else e+="\n at "+o}return e},hr.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const br=new Map,yr=new Map;function _r(t,e,r){const n={args:e,cb:r},i=br.get(t)||[];br.has(t)||br.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");yr.set(o,n)}function wr(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 $r(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=>{$r(t,e)}));break;case"BinaryExpression":case"LogicalExpression":$r(t.left,e),$r(t.right,e);break;case"UnaryExpression":$r(t.argument,e);break;case"ConditionalExpression":$r(t.test,e),$r(t.consequent,e),$r(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{$r(t,e)}))}}function xr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function kr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Er(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 kr(t.value);if("color"===t.type)return Pr(Dr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Cr(t){let e=Er(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Fr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Ar(t,e){if(Le)return Ge(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Vr(t,e){if(e<He||e>qe)throw new Error("Integer overflow.");!Le&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function jr(t){const e=[];return $r(t,{Variable(t){e.push(t.id.name)}}),e}function Sr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Dr(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Pr(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Tr(t){return Pr(Dr(t))}const zr=Number.MAX_VALUE,Mr=Number.MIN_VALUE,Ir="string",Or="integer",Nr="number",Jr="boolean",Ur="color",Br="url",Rr="datetime";function Lr(t,e){return{type:Ir,value:Er(e)}}function Wr(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Nr,value:r}}function qr(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=Tr(o)),{type:n,value:o}}function Hr(t,e,r){return qr(t,e,r,r.type)}function Gr(t,e,r){return qr(t,e,r,"color")}function Yr(t,e,r){return qr(t,e,r,"url")}const Zr=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Or,value:n}},Xr=Zr("getUTCFullYear"),Kr=Zr("getUTCMonth"),Qr=Zr("getUTCDate"),tn=Zr("getUTCDay"),en=Zr("getUTCHours"),rn=Zr("getUTCMinutes"),nn=Zr("getUTCSeconds"),on=Zr("getUTCMilliseconds");function an(t,e,r,n){if(!n.value.length)return t.warnings.push(X(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===Ir?e.value:Er(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function sn(t,e,r,n){const i=an(t,e,r,n);return{type:Ir,value:i+Er(e)}}function ln(t,e,r,n){const i=an(t,e,r,n);return{type:Ir,value:Er(e)+i}}function un(t){return(e,r)=>{const n=Dr(r.value);return{type:Nr,value:n[t]/255}}}function cn(t){return(e,r,n)=>{const i=Dr(r.value);return i[t]=255*n.value,{type:Ur,value:Pr(i)}}}const dn=un("a"),vn=un("r"),gn=un("g"),pn=un("b"),hn=cn("a"),fn=cn("r"),mn=cn("g"),bn=cn("b");function yn(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Ge(e.value)/Ge(r);return Vr(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Ge(i)%Ge(n)),{type:Or,value:i}}const _n=36e5;function wn(t){return t.map(Cr).join(", ")}_r("toString",[Or],Lr),_r("toString",[Nr],Lr),_r("toString",[Jr],Lr),_r("toString",[Ur],Lr),_r("toString",[Br],Lr),_r("toNumber",[Or],Wr),_r("toNumber",[Ir],Wr),_r("toInteger",[Nr],(function(t,e){if(e.value>qe||e.value<He)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Or,value:Ge(r)}})),_r("toInteger",[Ir],(function(t,e){let r;try{r=Ge(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>qe||r<He)throw new Error("Unable to convert value to Integer.");return{type:Or,value:r}})),_r("toInteger",[Jr],(function(t,e){return{type:Or,value:Ge(e.value?1:0)}})),_r("toBoolean",[Or],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Jr,value:r}})),_r("toBoolean",[Ir],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Jr,value:"true"===e.value?1:0}})),_r("toColor",[Ir],(function(t,e){return{type:Ur,value:Tr(e.value)}})),_r("toUrl",[Ir],(function(t,e){return{type:Br,value:e.value}})),_r("encodeUri",[Ir],(function(t,e){try{return{type:Ir,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),_r("decodeUri",[Ir],(function(t,e){try{return{type:Ir,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),_r("getIntegerValue",[Ir,Or],Hr),_r("getNumberValue",[Ir,Nr],Hr),_r("getBooleanValue",[Ir,Jr],Hr),_r("getStringValue",[Ir,Ir],Hr),_r("getColorValue",[Ir,Ur],Gr),_r("getColorValue",[Ir,Ir],Gr),_r("getUrlValue",[Ir,Br],Yr),_r("getUrlValue",[Ir,Ir],Yr),_r("parseUnixTime",[Or],(function(t,e){return{type:Rr,value:new Date(1e3*Number(e.value))}})),_r("nowLocal",[],(function(){return{type:Rr,value:new Date}})),_r("addMillis",[Rr,Or],(function(t,e,r){return{type:Rr,value:new Date(e.value.getTime()+Number(r.value))}})),_r("setYear",[Rr,Or],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Rr,value:n}})),_r("setMonth",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMonth(n-1),{type:Rr,value:i}})),_r("setDay",[Rr,Or],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${i} for date ${Er(e)}.`);return n.setUTCDate(-1===i?0:i),{type:Rr,value:n}})),_r("setHours",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(e.value);return i.setUTCHours(n),{type:Rr,value:i}})),_r("setMinutes",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMinutes(n),{type:Rr,value:i}})),_r("setSeconds",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCSeconds(n),{type:Rr,value:i}})),_r("setMillis",[Rr,Or],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMilliseconds(n),{type:Rr,value:i}})),_r("getYear",[Rr],Xr),_r("getMonth",[Rr],Kr),_r("getDay",[Rr],Qr),_r("getDayOfWeek",[Rr],tn),_r("getHours",[Rr],en),_r("getMinutes",[Rr],rn),_r("getSeconds",[Rr],nn),_r("getMillis",[Rr],on),_r("getIntervalSeconds",[Or],(function(t,e){return yn(t,e,1e3,60)})),_r("getIntervalTotalSeconds",[Or],(function(t,e){return yn(t,e,1e3)})),_r("getIntervalMinutes",[Or],(function(t,e){return yn(t,e,6e4,60)})),_r("getIntervalTotalMinutes",[Or],(function(t,e){return yn(t,e,6e4)})),_r("getIntervalHours",[Or],(function(t,e){return yn(t,e,_n,24)})),_r("getIntervalTotalHours",[Or],(function(t,e){return yn(t,e,_n)})),_r("getIntervalTotalDays",[Or],(function(t,e){return yn(t,e,864e5)})),_r("getIntervalTotalWeeks",[Or],(function(t,e){return yn(t,e,6048e5)})),_r("len",[Ir],(function(t,e){return{type:Or,value:e.value.length}})),_r("contains",[Ir,Ir],(function(t,e,r){return{type:Jr,value:e.value.includes(r.value)?1:0}})),_r("substring",[Ir,Or,Or],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Ir,value:e.value.substring(Number(r.value),Number(n.value))}})),_r("replaceAll",[Ir,Ir,Ir],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:Ir,value:i}})),_r("index",[Ir,Ir],(function(t,e,r){return{type:Or,value:e.value.indexOf(r.value)}})),_r("lastIndex",[Ir,Ir],(function(t,e,r){return{type:Or,value:e.value.lastIndexOf(r.value)}})),_r("trim",[Ir],(function(t,e){return{type:Ir,value:e.value.trim()}})),_r("trimLeft",[Ir],(function(t,e){return{type:Ir,value:e.value.replace(/^\s+/,"")}})),_r("trimRight",[Ir],(function(t,e){return{type:Ir,value:e.value.replace(/\s+$/,"")}})),_r("toUpperCase",[Ir],(function(t,e){return{type:Ir,value:e.value.toUpperCase()}})),_r("toLowerCase",[Ir],(function(t,e){return{type:Ir,value:e.value.toLowerCase()}})),_r("padStart",[Ir,Or,Ir],sn),_r("padStart",[Or,Or,Ir],sn),_r("padEnd",[Ir,Or,Ir],ln),_r("padEnd",[Or,Or,Ir],ln),_r("div",[Or,Or],(function(t,e,r){if(r.value===Ye)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Ar(0,n),Vr(t,n),{type:Or,value:n}})),_r("div",[Nr,Nr],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:Nr,value:n}})),_r("mod",[Or,Or],(function(t,e,r){if(r.value===Ye)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Ar(0,n),Vr(t,n),{type:Or,value:n}})),_r("mod",[Nr,Nr],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:Nr,value:n}})),_r("mul",[{type:Or,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ye;for(let n=1;n<e.length;++n)r*=e[n].value,r=Ar(0,r),Vr(t,r);return{type:Or,value:r}})),_r("mul",[{type:Nr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Nr,value:r}})),_r("sub",[{type:Or,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ye;for(let n=1;n<e.length;++n)r-=e[n].value,r=Ar(0,r),Vr(t,r);return{type:Or,value:r}})),_r("sub",[{type:Nr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Nr,value:r}})),_r("sum",[{type:Or,isVararg:!0}],(function(t,...e){let r=Ye;for(let n=0;n<e.length;++n)r+=e[n].value,r=Ar(0,r),Vr(t,r);return{type:Or,value:r}})),_r("sum",[{type:Nr,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Nr,value:r}})),_r("abs",[Or],(function(t,e){const r=Ze(e.value);return Vr(t,r),{type:e.type,value:r}})),_r("abs",[Nr],(function(t,e){const r=Math.abs(e.value);return{type:Nr,value:r}})),_r("max",[{type:Or,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:Or,value:r}})),_r("max",[{type:Nr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Nr,value:Math.max(...e.map((t=>t.value)))}})),_r("min",[{type:Or,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:Or,value:r}})),_r("min",[{type:Nr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Nr,value:Math.min(...e.map((t=>t.value)))}})),_r("maxNumber",[],(function(){return{type:Nr,value:zr}})),_r("minNumber",[],(function(){return{type:Nr,value:Mr}})),_r("maxInteger",[],(function(t){return Vr(t,qe),{type:Or,value:qe}})),_r("minInteger",[],(function(t){return Vr(t,He),{type:Or,value:He}})),_r("round",[Nr],(function(t,e){const r=Math.sign(e.value);return{type:Nr,value:r*Math.round(Math.abs(e.value))}})),_r("floor",[Nr],(function(t,e){return{type:Nr,value:Math.floor(e.value)}})),_r("ceil",[Nr],(function(t,e){return{type:Nr,value:Math.ceil(e.value)}})),_r("signum",[Or],(function(t,e){return{type:Or,value:Xe(e.value)}})),_r("signum",[Nr],(function(t,e){return{type:Nr,value:Math.sign(e.value)}})),_r("copySign",[Or,Or],(function(t,e,r){let n;if(r.value===Ye)n=e.value;else if(e.value===Ye)n=0;else{const t=Xe(r.value);n=Ze(e.value)*t}return Vr(t,n),{type:Or,value:n}})),_r("copySign",[Nr,Nr],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:Nr,value:i}})),_r("getColorAlpha",[Ir],dn),_r("getColorAlpha",[Ur],dn),_r("getColorRed",[Ir],vn),_r("getColorRed",[Ur],vn),_r("getColorGreen",[Ir],gn),_r("getColorGreen",[Ur],gn),_r("getColorBlue",[Ir],pn),_r("getColorBlue",[Ur],pn),_r("setColorAlpha",[Ir,Nr],hn),_r("setColorAlpha",[Ur,Nr],hn),_r("setColorRed",[Ir,Nr],fn),_r("setColorRed",[Ur,Nr],fn),_r("setColorGreen",[Ir,Nr],mn),_r("setColorGreen",[Ur,Nr],mn),_r("setColorBlue",[Ir,Nr],bn),_r("setColorBlue",[Ur,Nr],bn),_r("rgb",[Nr,Nr,Nr],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Ur,value:Pr(i)}})),_r("argb",[Nr,Nr,Nr,Nr],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:Ur,value:Pr(o)}}));const $n={StringLiteral:function(t,e){return{type:Ir,value:e.value}},NumberLiteral:function(t,e){return{type:Nr,value:e.value}},IntegerLiteral:function(t,e){return Vr(t,e.value),{type:Or,value:e.value}},BooleanLiteral:function(t,e){return{type:Jr,value:e.value?1:0}},UnaryExpression:function(t,e){const r=xr(xn(t,e.argument));switch(e.operator){case"!":if(r.type===Jr)return{type:Jr,value:r.value?0:1};Sr(`${e.operator}${Cr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Or){const e=r.value*Ge(n);return Vr(t,e),{type:Or,value:e}}if(r.type===Nr)return{type:Nr,value:r.value*n};Sr(`${e.operator}${Cr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=xr(xn(t,e.test));if(r.type===Jr)return r.value?xn(t,e.consequent):xn(t,e.alternate);Sr(`${Cr(r)} ? ${Cr(xn(t,e.consequent))} : ${Cr(xn(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 xn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Er(xn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Ir,value:r}},LogicalExpression:function(t,e){const r=xr(xn(t,e.left));if(r.type!==Jr&&Sr(`${Cr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Jr,value:0};const n=xr(xn(t,e.right));return n.type!==Jr&&Sr(`${Cr(r)} ${e.operator} ${Cr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Fr(n.type)}.`),{type:Jr,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=xn(t,e.left),i=xn(t,e.right);if(n.type!==i.type&&Sr(`${Cr(n)} ${e.operator} ${Cr(i)}`,`Operator '${r}' cannot be applied to different types: ${Fr(n.type)} and ${Fr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Rr&&r.type===Rr?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Jr,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Nr&&e.type!==Or&&e.type!==Rr&&Sr(`${Cr(e)} ${t} ${Cr(r)}`,`Operator '${t}' cannot be applied to ${Fr(e.type)} type.`);const i=e.type===Rr?e.value.getTime():e.value,o=r.type===Rr?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Jr,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Ir&&r.type!==Nr&&r.type!==Or&&Sr(`${Cr(r)} ${e} ${Cr(n)}`,`Operator '${e}' cannot be applied to ${Fr(r.type)} type.`),r.type===Ir)return"-"===e&&Sr(`${Cr(r)} - ${Cr(n)}`,`Operator '${e}' cannot be applied to ${Fr(r.type)} type.`),{type:Ir,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===Or)try{i=Ar(0,i),Vr(t,i)}catch(t){Sr(`${Cr(r)} ${e} ${Cr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==Or&&r.type!==Nr&&Sr(`${Cr(r)} ${e} ${Cr(n)}`,`Operator '${e}' cannot be applied to ${Fr(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Sr(`${Cr(r)} ${e} ${Cr(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===Or)try{i=Ar(0,i),Vr(t,i)}catch(t){Sr(`${Cr(r)} ${e} ${Cr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>xn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(yr.has(o))n=yr.get(o);else{const t=function(t,e){const r=br.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=wr(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||"type"in t&&"missing"===t.type){const e=i.map((t=>Fr(t.type))).join(", "),n=`${r}(${wn(i)})`;"few"===t.type&&0===i.length?Sr(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Sr(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Sr(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){Sr(`${r}(${wn(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function xn(t,e){if(e.type in $n)return $n[e.type](t,e);throw new Error("Unsupported expression")}function kn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if($r(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const n=xn(r,e);return r.safeIntegerOverflow&&r.warnings.push(X(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class En{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return $r(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=kn(t,this.ast);r.warnings.forEach(e);const n=r.result;if("error"===n.type)return void e(X(new Error("Expression execution error"),{additional:{message:n.value}}));const i=n.value;if(i instanceof Date)return kr(i);if("boolean"===n.type)return Boolean(i);if("color"===n.type){const t=ot(String(i));if(t)return Pr(t);e(X(new Error("Expression execution error")))}return"integer"===n.type?i>2147483647||i<-2147483648?void e(X(new Error("Expression result is out of 32-bit int range"))):Number(i):i}catch(t){return void e(X(new Error("Expression execution error")))}}}function Cn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=mr(t,{startRule:"JsonStringContents"}),n=jr(r);return e.vars.push(...n),new En(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Cn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Cn(t[i],e,r);return n}}var n;return t}function Fn(t,e,r){if(t){if(t instanceof En)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Fn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Fn(t[i],e,r);return n}}return t}function An(t,e){const r={vars:[],hasExpression:!1},n=Cn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Fn(n,t,e)}}const Vn={pagers:function(){return R(new Map)}},jn=new Map,Sn=new Map;function Dn(t){const e=jn.get(t)||R("");return jn.has(t)||jn.set(t,e),e}function Pn(t){const e=Sn.get(t)||new Map;return Sn.has(t)||Sn.set(t,e),e}class Tn{setVariable(t){const e=t.getName(),r=Pn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Dn(this).set(e)}getVariable(t){return Pn(this).get(t)}}function zn(){return new Tn}function Mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const In=new Set(["start","stop","pause","resume","cancel","reset"]);class On{constructor(t){Mn(this,"timers",new Map),Mn(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(X(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(X(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&In.has(e)))return void this.logError(X(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};e()}}start(t){if("running"===t.state)return void this.logError(X(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(X(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(X(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(X(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(X(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(X(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(X(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(X(new Error("The timer is already running"))):this.logError(X(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}const Nn=O(((t,e,r,n)=>{let i,o;var s,l,u,v;let{id:g}=e,{json:p={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new Tn}=e,{mix:b=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:E}=e,C=R("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function S(){}const D=new Set(w);let P=!1;p||(P=!0,H(X(new Error('"json" prop is required')))),g||(P=!0,H(X(new Error('"id" prop is required'))));let T=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in ir)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const M=p.templates||{};T&&(P=!0,H(T));const I={stateChange:!1},O=Dn(m),N=Pn(m),J=new Map,U=new Map,B=new Map;let W=null;function q(t){const e=An(t,H);return e.vars.length?e.applyVars(U):t}function H(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function G(t,e){x&&x({type:t,action:e})}let Y=0;function K(t){return`${g}-${Y++}`}let Q={},tt={};function et(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=ut,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=ot(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=ot(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=ot(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=U.get(r);t?t.set(i):H(X(new Error("Cannot find variable"),{additional:{name:r}}))}else H(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");W?W.execTimerAction(a,o):H(X(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:H(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){H(X(t,{additional:{url:e}}))}}async function rt(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=gt(i);if(t)if(pt(t,D)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(et(n),await y()):n.log_id&&(nt(n),await y())}}t.forEach((t=>{t.log_id&&G("click",t)}))}}function nt(t){null==k||k(t)}const it=new Map;function ot(t){if(it.has(t))return it.get(t);H(X(new Error("Missing instance with id"),{additional:{id:t}}))}const at=new Map;function lt(t){for(const e of t)U.has(e)&&t.delete(e);return t}d(Z,{logError:H,logStat:G,hasTemplate:function(t){return t in M},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in M;){if(({json:t,templateContext:e}=sr(t,e,M,H)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:K,genClass:function(t){return`divkit-${K()}`},execAction:et,execAnyActions:rt,execCustomAction:nt,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){it.has(t)?H(X(new Error("Duplicate instance id"),{additional:{id:t}})):it.set(t,e)},unregisterInstance:function(t){it.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(tt[r]=tt[r]||0,++tt[r],Q[r])return Q[r];const n=`${K()}-svg-filter`;return Q=Object.assign(Object.assign({},Q),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;tt[r]&&0==--tt[r]&&(Q=Object.keys(Q).reduce(((t,e)=>(tt[e]&&(t[e]=Q[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return ur(t);const e=An(t,H);return e.vars.length?L(e.vars.map((t=>U.get(t)||function(t){const e=B.get(t)||R(void 0);return B.has(t)||B.set(t,e),e}(t))).filter(st),(()=>e.applyVars(U))):e.hasExpression?ur(e.applyVars(U)):ur(t)},getJsonWithVars:q,getStore:function(t){return at.has(t)||function(t){at.has(t)||at.set(t,Vn[t]())}(t),at.get(t)},getVariable:function(t,e){const r=U.get(t);if(r){const n=r.getType();if(n!==e)return void H(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return D},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(Dt,{hasAction:()=>!1});const ut={setState(t){throw new Error("Not implemented")},getChild(t){if(ct&&ct.has(t))return ct.get(t);H(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let ct=null;d(mt,{registerInstance(t,e){ct||(ct=new Map),ct.has(t)?H(X(new Error("Duplicate state with id"),{additional:{id:t}})):ct.set(t,e)},unregisterInstance(t){null==ct||ct.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const dt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(dt)&&dt.forEach((t=>{if(t&&t.type in Qe&&t.name){if(J.has(t.name))return void H(X(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&H(X(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=tr(t.name,t.type,t.value);J.set(t.name,e),U.set(t.name,e)}catch(e){H(X(e,{additional:{name:t.name}}))}}}));const vt=p.palette;vt&&vt[F].forEach((t=>{if(J.has(t.name))H(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=tr(t.name,"color",t.color);J.set(t.name,e),U.set(t.name,e)}catch(e){H(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of N)U.has(t)||U.set(t,e);O.subscribe((t=>{if(t&&!U.has(t)){const e=N.get(t);U.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ht=null===(l=null==p?void 0:p.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(ht)&&ht.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void H(X(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const n=mr(t.condition,{startRule:"JsonStringContents"}),i=jr(n);if(!i.length)return void H(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return lt(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{lt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>U.get(t))).filter(st),(()=>{const t=kn(U,n);return t.warnings.forEach(H),t.result})).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=q(t);e.log_id&&et(e)})),e=Boolean(n.value)):H(X(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){H(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else H(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const ft=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.timers;if(ft){const t=W=new On({logError:H,applyVars:q,hasVariableWithType:function(t,e){const r=U.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=U.get(t);r?r.setValue(e):H(X(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:rt});ft.forEach((e=>t.createTimer(e)))}const bt=null===(v=null==p?void 0:p.card)||void 0===v?void 0:v.states,yt=bt&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:bt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return c((()=>{W&&W.destroy()})),void 0===e.id&&r.id&&void 0!==g&&r.id(g),void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==b&&r.mix(b),void 0===e.customization&&r.customization&&void 0!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==S&&r.getDebugVariables(S),void 0===e.execAction&&r.execAction&&void 0!==et&&r.execAction(et),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":H(X(new Error("Unsupported theme"))),F&&(vt&&vt[F].forEach((t=>{const e=U.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&yt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(b?` ${b}`:"",!0)}">${z(ar,"RootSvgFilters").$$render(t,{svgFiltersMap:Q},{},{})}\n ${z(or,"Unknown").$$render(t,{div:yt,templateContext:{}},{},{})}</div>`:""})),Jn=Nn;function Un(t){return Jn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var Bn=exports;for(var Rn in e)Bn[Rn]=e[Rn];e.__esModule&&Object.defineProperty(Bn,"__esModule",{value:!0})})();
|
|
2
2
|
//# sourceMappingURL=server.js.map
|