@divkitframework/visual-editor
Version:
Visual editor for DivKit
1 lines • 1.33 MB
JavaScript
var GV=Object.defineProperty;var XV=(t,e,n)=>e in t?GV(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var on=(t,e,n)=>(XV(t,typeof e!="symbol"?e+"":e,n),n),vd=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var Gi=(t,e,n)=>(vd(t,e,"read from private field"),n?n.call(t):e.get(t)),er=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Qs=(t,e,n,i)=>(vd(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var Nl=(t,e,n,i)=>({set _(o){Qs(t,e,o,n)},get _(){return Gi(t,e,i)}}),up=(t,e,n)=>(vd(t,e,"access private method"),n);function tn(){}const ku=t=>t;function _s(t,e){for(const n in e)t[n]=e[n];return t}function r1(t){return t()}function pp(){return Object.create(null)}function Rn(t){t.forEach(r1)}function Yo(t){return typeof t=="function"}function Rt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ja;function dc(t,e){return t===e?!0:(ja||(ja=document.createElement("a")),ja.href=e,t===ja.href)}function Jc(t,e){return t!=t?e==e:t!==e}function ZV(t){return Object.keys(t).length===0}function ju(t,...e){if(t==null){for(const i of e)i(void 0);return tn}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function wn(t){let e;return ju(t,(n=>e=n))(),e}function De(t,e,n){t.$$.on_destroy.push(ju(e,n))}function qs(t,e,n,i){if(t){const o=s1(t,e,n,i);return t[0](o)}}function s1(t,e,n,i){return t[1]&&i?_s(n.ctx.slice(),t[1](i(e))):n.ctx}function Rs(t,e,n,i){if(t[2]&&i){const o=t[2](i(n));if(e.dirty===void 0)return o;if(typeof o=="object"){const r=[],s=Math.max(e.dirty.length,o.length);for(let l=0;l<s;l+=1)r[l]=e.dirty[l]|o[l];return r}return e.dirty|o}return e.dirty}function Bs(t,e,n,i,o,r){if(o){const s=s1(e,n,i,r);t.p(s,o)}}function Hs(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let i=0;i<n;i++)e[i]=-1;return e}return-1}function Mi(t,e,n){return t.set(n),e}function l1(t){return t&&Yo(t.destroy)?t.destroy:tn}function _p(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const xV=["",!0,1,"true","contenteditable"],a1=typeof window<"u";let c1=a1?()=>window.performance.now():()=>Date.now(),Su=a1?t=>requestAnimationFrame(t):tn;const ul=new Set;function d1(t){ul.forEach((e=>{e.c(t)||(ul.delete(e),e.f())})),ul.size!==0&&Su(d1)}function u1(t){let e;return ul.size===0&&Su(d1),{promise:new Promise((n=>{ul.add(e={c:t,f:n})})),abort(){ul.delete(e)}}}const va=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function $(t,e){t.appendChild(e)}function p1(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function QV(t){const e=S("style");return e.textContent="/* empty */",eL(p1(t),e),e.sheet}function eL(t,e){return $(t.head||t,e),e.sheet}function F(t,e,n){t.insertBefore(e,n||null)}function V(t){t.parentNode&&t.parentNode.removeChild(t)}function Bi(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function S(t){return document.createElement(t)}function Vr(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function xe(t){return document.createTextNode(t)}function G(){return xe(" ")}function Vn(){return xe("")}function te(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function zi(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Eo(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function h(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const tL=["width","height"];function fs(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const i in e)e[i]==null?t.removeAttribute(i):i==="style"?t.style.cssText=e[i]:i==="__value"?t.value=t[i]=e[i]:n[i]&&n[i].set&&tL.indexOf(i)===-1?t[i]=e[i]:h(t,i,e[i])}function nL(t,e){Object.keys(e).forEach((n=>{iL(t,n,e[n])}))}function iL(t,e,n){const i=e.toLowerCase();i in t?t[i]=typeof t[i]=="boolean"&&n===""?!0:n:e in t?t[e]=typeof t[e]=="boolean"&&n===""?!0:n:h(t,e,n)}function uc(t){return/-/.test(t)?nL:fs}function _1(t){let e;return{p(...n){e=n,e.forEach((i=>t.push(i)))},r(){e.forEach((n=>t.splice(t.indexOf(n),1)))}}}function Ui(t){return t===""?null:+t}function oL(t){return Array.from(t.childNodes)}function at(t,e){e=""+e,t.data!==e&&(t.data=e)}function f1(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function rL(t,e,n){~xV.indexOf(n)?f1(t,e):at(t,e)}function Hn(t,e){t.value=e??""}function ke(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,"")}function pc(t,e,n){for(let i=0;i<t.options.length;i+=1){const o=t.options[i];if(o.__value===e){o.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function m1(t){const e=t.querySelector(":checked");return e&&e.__value}let Sa;function sL(){if(Sa===void 0){Sa=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{Sa=!0}}return Sa}function Tu(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const i=S("iframe");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),i.setAttribute("aria-hidden","true"),i.tabIndex=-1;const o=sL();let r;return o?(i.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=te(window,"message",(s=>{s.source===i.contentWindow&&e()}))):(i.src="about:blank",i.onload=()=>{r=te(i.contentWindow,"resize",e),e()}),$(t,i),()=>{(o||r&&i.contentWindow)&&r(),V(i)}}function ne(t,e,n){t.classList.toggle(e,!!n)}function g1(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}class Cu{constructor(e=!1){on(this,"is_svg",!1);on(this,"e");on(this,"n");on(this,"t");on(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=Vr(n.nodeName):this.e=S(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n<this.n.length;n+=1)F(this.t,this.n[n],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(V)}}function bl(t,e){return new t(e)}const _c=new Map;let fc=0;function lL(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function aL(t,e){const n={stylesheet:QV(e),rules:{}};return _c.set(t,n),n}function Jd(t,e,n,i,o,r,s,l=0){const a=16.666/i;let c=`{\n`;for(let g=0;g<=1;g+=a){const v=e+(n-e)*r(g);c+=g*100+`%{${s(v,1-v)}}\n`}const d=c+`100% {${s(n,1-n)}}\n}`,u=`__svelte_${lL(d)}_${l}`,p=p1(t),{stylesheet:_,rules:f}=_c.get(p)||aL(p,t);f[u]||(f[u]=!0,_.insertRule(`@keyframes ${u} ${d}`,_.cssRules.length));const m=t.style.animation||"";return t.style.animation=`${m?`${m}, `:""}${u} ${i}ms linear ${o}ms 1 both`,fc+=1,u}function h1(t,e){const n=(t.style.animation||"").split(", "),i=n.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),o=n.length-i.length;o&&(t.style.animation=i.join(", "),fc-=o,fc||cL())}function cL(){Su((()=>{fc||(_c.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&V(e)})),_c.clear())}))}function dL(t,e,n,i){if(!e)return tn;const o=t.getBoundingClientRect();if(e.left===o.left&&e.right===o.right&&e.top===o.top&&e.bottom===o.bottom)return tn;const{delay:r=0,duration:s=300,easing:l=ku,start:a=c1()+r,end:c=a+s,tick:d=tn,css:u}=n(t,{from:e,to:o},i);let p=!0,_=!1,f;function m(){u&&(f=Jd(t,0,1,s,r,l,u)),r||(_=!0)}function g(){u&&h1(t,f),p=!1}return u1((v=>{if(!_&&v>=a&&(_=!0),_&&v>=c&&(d(1,0),g()),!p)return!1;if(_){const y=v-a,b=0+1*l(y/s);d(b,1-b)}return!0})),m(),d(0,1),g}function uL(t){const e=getComputedStyle(t);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:n,height:i}=e,o=t.getBoundingClientRect();t.style.position="absolute",t.style.width=n,t.style.height=i,v1(t,o)}}function v1(t,e){const n=t.getBoundingClientRect();if(e.left!==n.left||e.top!==n.top){const i=getComputedStyle(t),o=i.transform==="none"?"":i.transform;t.style.transform=`${o} translate(${e.left-n.left}px, ${e.top-n.top}px)`}}let Ql;function Wl(t){Ql=t}function Cl(){if(!Ql)throw new Error("Function called outside component initialization");return Ql}function Uc(t){Cl().$$.on_mount.push(t)}function gs(t){Cl().$$.after_update.push(t)}function Js(t){Cl().$$.on_destroy.push(t)}function _i(){const t=Cl();return(e,n,{cancelable:i=!1}={})=>{const o=t.$$.callbacks[e];if(o){const r=g1(e,n,{cancelable:i});return o.slice().forEach((s=>{s.call(t,r)})),!r.defaultPrevented}return!0}}function mc(t,e){return Cl().$$.context.set(t,e),e}function yt(t){return Cl().$$.context.get(t)}function mn(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((i=>i.call(this,e)))}const rl=[],pt=[];let pl=[];const Ud=[],b1=Promise.resolve();let Wd=!1;function y1(){Wd||(Wd=!0,b1.then(w1))}function ur(){return y1(),b1}function _o(t){pl.push(t)}function Xn(t){Ud.push(t)}const bd=new Set;let el=0;function w1(){if(el!==0)return;const t=Ql;do{try{for(;el<rl.length;){const e=rl[el];el++,Wl(e),pL(e.$$)}}catch(e){throw rl.length=0,el=0,e}for(Wl(null),rl.length=0,el=0;pt.length;)pt.pop()();for(let e=0;e<pl.length;e+=1){const n=pl[e];bd.has(n)||(bd.add(n),n())}pl.length=0}while(rl.length);for(;Ud.length;)Ud.pop()();Wd=!1,bd.clear(),Wl(t)}function pL(t){if(t.fragment!==null){t.update(),Rn(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_o)}}function _L(t){const e=[],n=[];pl.forEach((i=>t.indexOf(i)===-1?e.push(i):n.push(i))),n.forEach((i=>i())),pl=e}let ql;function fL(){return ql||(ql=Promise.resolve(),ql.then((()=>{ql=null}))),ql}function yd(t,e,n){t.dispatchEvent(g1(`${e?"intro":"outro"}${n}`))}const Ba=new Set;let es;function Dt(){es={r:0,c:[],p:es}}function Vt(){es.r||Rn(es.c),es=es.p}function I(t,e){t&&t.i&&(Ba.delete(t),t.i(e))}function H(t,e,n,i){if(t&&t.o){if(Ba.has(t))return;Ba.add(t),es.c.push((()=>{Ba.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}else i&&i()}const mL={duration:0};function Zi(t,e,n,i){let r=e(t,n,{direction:"both"}),s=i?0:1,l=null,a=null,c=null,d;function u(){c&&h1(t,c)}function p(f,m){const g=f.b-s;return m*=Math.abs(g),{a:s,b:f.b,d:g,duration:m,start:f.start,end:f.start+m,group:f.group}}function _(f){const{delay:m=0,duration:g=300,easing:v=ku,tick:y=tn,css:b}=r||mL,w={start:c1()+m,b:f};f||(w.group=es,es.r+=1),"inert"in t&&(f?d!==void 0&&(t.inert=d):(d=t.inert,t.inert=!0)),l||a?a=w:(b&&(u(),c=Jd(t,s,f,g,m,v,b)),f&&y(0,1),l=p(w,g),_o((()=>yd(t,f,"start"))),u1((k=>{if(a&&k>a.start&&(l=p(a,g),a=null,yd(t,l.b,"start"),b&&(u(),c=Jd(t,s,l.b,l.duration,0,v,r.css))),l){if(k>=l.end)y(s=l.b,1-s),yd(t,l.b,"end"),a||(l.b?u():--l.group.r||Rn(l.group.c)),l=null;else if(k>=l.start){const A=k-l.start;s=l.a+l.d*v(A/l.duration),y(s,1-s)}}return!!(l||a)})))}return{run(f){Yo(r)?fL().then((()=>{r=r({direction:f?"in":"out"}),_(f)})):_(f)},end(){u(),l=a=null}}}function ln(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function gL(t,e){t.d(1),e.delete(t.key)}function zl(t,e){H(t,1,1,(()=>{e.delete(t.key)}))}function hL(t,e){t.f(),zl(t,e)}function Us(t,e,n,i,o,r,s,l,a,c,d,u){let p=t.length,_=r.length,f=p;const m={};for(;f--;)m[t[f].key]=f;const g=[],v=new Map,y=new Map,b=[];for(f=_;f--;){const j=u(o,r,f),T=n(j);let E=s.get(T);E?b.push((()=>E.p(j,e))):(E=c(T,j),E.c()),v.set(T,g[f]=E),T in m&&y.set(T,Math.abs(f-m[T]))}const w=new Set,k=new Set;function A(j){I(j,1),j.m(l,d),s.set(j.key,j),d=j.first,_--}for(;p&&_;){const j=g[_-1],T=t[p-1],E=j.key,O=T.key;j===T?(d=j.first,p--,_--):v.has(O)?!s.has(E)||w.has(E)?A(j):k.has(O)?p--:y.get(E)>y.get(O)?(k.add(E),A(j)):(w.add(O),p--):(a(T,s),p--)}for(;p--;){const j=t[p];v.has(j.key)||a(j,s)}for(;_;)A(g[_-1]);return Rn(b),g}function yl(t,e){const n={},i={},o={$$scope:1};let r=t.length;for(;r--;){const s=t[r],l=e[r];if(l){for(const a in s)a in l||(i[a]=1);for(const a in l)o[a]||(n[a]=l[a],o[a]=1);t[r]=l}else for(const a in s)o[a]=1}for(const s in i)s in n||(n[s]=void 0);return n}function fp(t){return typeof t=="object"&&t!==null?t:{}}function Gn(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function Pe(t){t&&t.c()}function Ee(t,e,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,n),_o((()=>{const r=t.$$.on_mount.map(r1).filter(Yo);t.$$.on_destroy?t.$$.on_destroy.push(...r):Rn(r),t.$$.on_mount=[]})),o.forEach(_o)}function Ae(t,e){const n=t.$$;n.fragment!==null&&(_L(n.after_update),Rn(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function vL(t,e){t.$$.dirty[0]===-1&&(rl.push(t),y1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Yt(t,e,n,i,o,r,s=null,l=[-1]){const a=Ql;Wl(t);const c=t.$$={fragment:null,ctx:[],props:r,update:tn,not_equal:o,bound:pp(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:pp(),dirty:l,skip_bound:!1,root:e.target||a.$$.root};s&&s(c.root);let d=!1;if(c.ctx=n?n(t,e.props||{},((u,p,..._)=>{const f=_.length?_[0]:p;return c.ctx&&o(c.ctx[u],c.ctx[u]=f)&&(!c.skip_bound&&c.bound[u]&&c.bound[u](f),d&&vL(t,u)),p})):[],c.update(),d=!0,Rn(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){const u=oL(e.target);c.fragment&&c.fragment.l(u),u.forEach(V)}else c.fragment&&c.fragment.c();e.intro&&I(t.$$.fragment),Ee(t,e.target,e.anchor),w1()}Wl(a)}class Gt{constructor(){on(this,"$$");on(this,"$$set")}$destroy(){Ae(this,1),this.$destroy=tn}$on(e,n){if(!Yo(n))return tn;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!ZV(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const bL="4",tl=[];function yL(t,e){return{subscribe:Si(t,e).subscribe}}function Si(t,e=tn){let n;const i=new Set;function o(l){if(Rt(t,l)&&(t=l,n)){const a=!tl.length;for(const c of i)c[1](),tl.push(c,t);if(a){for(let c=0;c<tl.length;c+=2)tl[c][0](tl[c+1]);tl.length=0}}}function r(l){o(l(t))}function s(l,a=tn){const c=[l,a];return i.add(c),i.size===1&&(n=e(o,r)||tn),l(t),()=>{i.delete(c),i.size===0&&n&&(n(),n=null)}}return{set:o,update:r,subscribe:s}}function as(t,e,n){const i=!Array.isArray(t),o=i?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return yL(n,((s,l)=>{let a=!1;const c=[];let d=0,u=tn;const p=()=>{if(d)return;u();const f=e(i?c[0]:c,s,l);r?s(f):u=Yo(f)?f:tn},_=o.map(((f,m)=>ju(f,(g=>{c[m]=g,d&=~(1<<m),a&&p()}),(()=>{d|=1<<m}))));return a=!0,p(),function(){Rn(_),u(),a=!1}}))}typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(bL);function mp(t,e,n){const i=t.slice();return i[7]=e[n],i[8]=e,i[9]=n,i}function gp(t){let e,n,i;function o(...r){return t[5](t[9],...r)}return{c(){e=S("div"),h(e,"class","split-view__splitter svelte-1rid2da")},m(r,s){F(r,e,s),n||(i=[te(e,"pointerdown",zi(o)),te(e,"dblclick",zi(t[4]))],n=!0)},p(r,s){t=r},d(r){r&&V(e),n=!1,Rn(i)}}}function hp(t,e){let n,i,o,r,s,l=e[9],a,c=e[9]>0&&gp(e);const d=[e[7].props];var u=e[7].component;function p(m,g){let v={};for(let y=0;y<d.length;y+=1)v=_s(v,d[y]);return g!==void 0&&g&1&&(v=_s(v,yl(d,[fp(m[7].props)]))),{props:v}}u&&(r=bl(u,p(e)));const _=()=>e[6](o,l),f=()=>e[6](null,l);return{key:t,first:null,c(){n=Vn(),c&&c.c(),i=G(),o=S("div"),r&&Pe(r.$$.fragment),s=G(),h(o,"class","split-view__part svelte-1rid2da"),ke(o,"--grow",e[7].weight),ke(o,"min-width",e[1]==="horizontal"?`${e[7].minSize||al}px`:void 0),ke(o,"min-height",e[1]==="vertical"?`${e[7].minSize||al}px`:void 0),this.first=n},m(m,g){F(m,n,g),c&&c.m(m,g),F(m,i,g),F(m,o,g),r&&Ee(r,o,null),$(o,s),_(),a=!0},p(m,g){if(e=m,e[9]>0?c?c.p(e,g):(c=gp(e),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null),g&1&&u!==(u=e[7].component)){if(r){Dt();const v=r;H(v.$$.fragment,1,0,(()=>{Ae(v,1)})),Vt()}u?(r=bl(u,p(e,g)),Pe(r.$$.fragment),I(r.$$.fragment,1),Ee(r,o,s)):r=null}else if(u){const v=g&1?yl(d,[fp(e[7].props)]):{};r.$set(v)}l!==e[9]&&(f(),l=e[9],_()),g&1&&ke(o,"--grow",e[7].weight),g&3&&ke(o,"min-width",e[1]==="horizontal"?`${e[7].minSize||al}px`:void 0),g&3&&ke(o,"min-height",e[1]==="vertical"?`${e[7].minSize||al}px`:void 0)},i(m){a||(r&&I(r.$$.fragment,m),a=!0)},o(m){r&&H(r.$$.fragment,m),a=!1},d(m){m&&(V(n),V(i),V(o)),c&&c.d(m),r&&Ae(r),f()}}}function wL(t){let e,n=[],i=new Map,o,r=ln(t[0]);const s=l=>l[7].key||l[9];for(let l=0;l<r.length;l+=1){let a=mp(t,r,l),c=s(a);i.set(c,n[l]=hp(c,a))}return{c(){e=S("div");for(let l=0;l<n.length;l+=1)n[l].c();h(e,"class","split-view svelte-1rid2da"),ne(e,"split-view_vertical",t[1]==="vertical")},m(l,a){F(l,e,a);for(let c=0;c<n.length;c+=1)n[c]&&n[c].m(e,null);o=!0},p(l,[a]){a&31&&(r=ln(l[0]),Dt(),n=Us(n,a,s,1,l,r,i,e,zl,hp,null,mp),Vt()),(!o||a&2)&&ne(e,"split-view_vertical",l[1]==="vertical")},i(l){if(!o){for(let a=0;a<r.length;a+=1)I(n[a]);o=!0}},o(l){for(let a=0;a<n.length;a+=1)H(n[a]);o=!1},d(l){l&&V(e);for(let a=0;a<n.length;a+=1)n[a].d()}}}const al=300;function $L(t,e,n){let{components:i}=e,{orientation:o="horizontal"}=e,r=[];function s(d,u){if(d.button!==0)return;const p=o==="horizontal"?"pageX":"pageY",_=o==="horizontal"?"offsetWidth":"offsetHeight",f=d[p],m=r.map((w=>w[_])),g=i[u].minSize??al,v=i[u+1].minSize??al,y=w=>{w.preventDefault();let k=w[p]-f;m[u]+k<g&&(k=g-m[u]),m[u+1]-k<v&&(k=m[u+1]-v),r.forEach(((A,j)=>{let T;j===u?T=m[j]+k:j===u+1&&(T=m[j]-k),T?A.style.flexBasis=`${T}px`:A.style.flexBasis=`${m[j]}px`}))},b=()=>{window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b)};window.addEventListener("pointermove",y),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b)}function l(){r.forEach((d=>{d.style.flexBasis=""}))}const a=(d,u)=>s(u,d-1);function c(d,u){pt[d?"unshift":"push"]((()=>{r[u]=d,n(2,r)}))}return t.$$set=d=>{"components"in d&&n(0,i=d.components),"orientation"in d&&n(1,o=d.orientation)},[i,o,r,s,l,a,c]}class $1 extends Gt{constructor(e){super(),Yt(this,e,$L,wL,Rt,{components:0,orientation:1})}}const oi=Symbol("language"),kL={collapse:"Свернуть",expand:"Развернуть",treeMenu:"Меню","treeItem.warnings":"Предупреждения","treeItem.errors":"Ошибки",addComponent:"Добавить компонент",removeComponent:"Удалить",cloneComponent:"Дублировать компонент",copyComponent:"Копировать компонент",pasteComponent:"Вставить компонент",newComponentTitle:"Новый компонент",components:"Дерево компонентов",basicComponents:"Базовые компоненты",additionalComponents:"Дополнительные компоненты",lightTheme:"Светлая тема",darkTheme:"Тёмная тема",componentProperties:"Свойства",complexComponentProperties:"Сложные свойства",code:"Исходный код",chooseComponent:"Выберите элемент",inset_top:"сверху",inset_right:"справа",inset_bottom:"снизу",inset_left:"слева",inset_content:"содержимое","props.width":"Ширина","props.height":"Высота","props.size_fixed":"Точное","props.size_match_parent":"Растянуть","props.size_wrap_content":"Содержимое","props.size_constrained":"Сжимается","props.alignment":"Выравнивание","props.alignment_horizontal":"Своё горизонтальное выравнивание","props.alignment_vertical":"Своё вертикальное выравнивание","props.align_left":"Слева","props.align_center":"По центру","props.align_right":"Справа","props.align_top":"Сверху","props.align_bottom":"Снизу","props.align_start":"В начале","props.align_end":"В конце","props.alpha":"Непрозрачность","props.rotation":"Поворот","props.insets":"Отступы","props.paddings":"Внутренние","props.margins":"Внешние","props.text":"Текст","props.font_size":"Размер текста","props.font_size_small":"Маленький","props.font_size_medium":"Средний","props.font_size_large":"Большой","props.font_weight":"Насыщенность","props.font_weight_light":"300 — Лёгкий","props.font_weight_normal":"400 — Обычный","props.font_weight_medium":"500 — Полужирный","props.font_weight_bold":"700 — Жирный","props.font_family":"Шрифт","props.text_color":"Цвет текста","props.text_alignment_horizontal":"Выравнивание","props.underline":"Подчёркивание","props.strike":"Зачёркивание","props.image_url":"Картинка","props.preview":"Предпросмотр","props.image_scale":"Масштабирование","props.scale_fit":"Поместить","props.scale_fill":"Заполнить","props.scale_no_scale":"Оригинал","props.scale_stretch":"Растянуть","props.image_alignment":"Выравнивание картинки","props.image_alignment_horizontal":"Выравнивание картинки по горизонтали","props.image_alignment_vertical":"Выравнивание картинки по вертикали","props.lottie_url":"Анимация","props.background":"Фон","props.background_solid":"Цвет","props.background_gradient":"Градиент","props.background_gradient_angle":"Угол наклона","props.background_gradient_count":"Кол-во цветов","props.background_image":"Картинка","props.corners":"Скругление углов","props.actions":"Действия","props.orientation":"Ориентация","props.orientation_horizontal":"Горзонтальная","props.orientation_vertical":"Вертикальная","props.orientation_overlap":"Наложение","props.content_alignment":"Выравнивание содержимого","props.cross_content_alignment":"Выравнивание содержимого по поперечной оси","props.content_alignment_horizontal":"Горизонтальное выравнивание содержимого","props.content_alignment_vertical":"Вертикальное выравнивание содержимого","props.orientation_start":"Начало","props.orientation_center":"По центру","props.orientation_end":"Конец","props.separator_color":"Цвет","props.line_height":"Высота линии","props.spacing":"Отступ между элементами","props.video_repeatable":"Повторять с начала","props.video_autostart":"Автостарт","props.video_muted":"Без звука","props.video_sources":"Источник видео","props.column_count":"Количество колонок","props.column_span":"Растянуть по колонкам","props.row_span":"Растянуть по строкам","props.text_variable":"Связанная переменная","props.keyboard_type":"Тип поля","props.keyboard_single_line_text":"Однострочное","props.keyboard_multi_line_text":"Многострочное","props.keyboard_phone":"Телефон","props.keyboard_number":"Число","props.keyboard_email":"Электронная почта","props.keyboard_uri":"Ссылка","props.keyboard_password":"Пароль","props.max_length":"Максимальное число символов","props.hint_text":"Текст подсказки","props.a11y_description":"Описание","props.select_options":"Список опций","props.is_enabled":"Включён","props.on_color":"Цвет включённого состояния","props.high_priority_preview_show":"Ускоренный предпросмотр",actions_count:["%s действие","%s действия","%s действий","Нет действий"],actions_no_url:"<нет ссылки>","actions-url":"Ссылка","actions-unknown":"Неизвестно","actions-log-id":"ID для логирования","actions-log-url":"Url для логирования","actions.focus_element":"Установить фокус","actions.clear_focus":"Убрать фокус","actions.set_variable":"Установить переменную","actions.array_insert_value":"Вставить значение в массив","actions.array_remove_value":"Удалить значение из массива","actions.copy_to_clipboard":"Копировать","actions.dict_set_value":"Установить значение в объекте","actions.array_set_value":"Установить значение в массиве","actions.show_tooltip":"Показать тултип","actions.hide_tooltip":"Скрыть тултип","video-url":"Url источника","video-mime-type":"Mime type источника","select.text":"Текст опции","select.value":"Значение опции",cancel:"Отмена",save:"Сохранить",close:"Закрыть",color:"Цвет",image:"Картинка",animation:"Анимация",delete:"Удалить",add_color:"Добавить цвет",add_background:"Добавить слой",add_action:"Добавить действие",add_video:"Добавить источник",add_select_option:"Добавить опцию",no_background:"Нет фона",multiple_backgrounds:"Несколько слоёв",unknown_background:"Неизвестный фон",background_solid:"Цвет: %s",background_gradient:"Градиент",background_image:"Картинка: %s",background_image_no_url:"<нет ссылки>",errors:"Ошибки",no_errors:"Нет ошибок",undo:"Отменить",redo:"Вернуть",previewSize:"Размер окна предварительного просмотра",previewLang:"Выбранный язык для отображения",previewDirection:"Направление ввода текст","components.image":"Картинка","components.gif":"Gif-картинка","components.text":"Текст","components.separator":"Разделитель","components.container":"Контейнер","components.grid":"Сетка","components.gallery":"Галерея","components.pager":"Пейджер","components.tabs":"Табы","components.state":"Набор состояний","components.custom":"Кастом","components.indicator":"Индикатор","components.slider":"Слайдер","components.input":"Поле ввода","components.select":"Выпадающий список","components.video":"Видео","components.switch":"Переключатель","templates.lottie":"Lottie-анимация","templates.button":"Кнопка","templates.close":"Крестик","templates.list_item":"Элемент списка",rootComponent:"Корневой компонент",palette:"Палитра",localPalette:"Локальная палитра",missingPaletteColor:"Отсутствует цвет из палитры '%s'",addColor:"Добавить цвет","baseProps.title":"Базовые свойства и выравнивание","textProps.title":"Свойства текста","imageProps.title":"Свойства картинки","videoProps.title":"Свойства видео","containerProps.title":"Свойства контейнера","gridProps.title":"Свойства сетки","galleryProps.title":"Свойства галереи","separatorProps.title":"Свойства разделителя","lottieProps.title":"Свойства Lottie","buttonProps.title":"Свойства кнопки","closeProps.title":"Свойства крестика","listItemProps.title":"Свойства элемента списка","inputProps.title":"Свойства поля ввода","selectProps.title":"Свойства выпадающего списка","switchProps.title":"Свойства переключателя","a11yProps.title":"Свойства доступности",default:"По умолчанию","background.image":"Картинка","background.gradient":"Линейный градиент","background.solid_first_title":"Цвет","background.solid_second_title":"Непрозрачность","background.gradient_second_title":"Угол градиента","background.image_second_title":"Непрозрачность","file.image_placeholder":"Ссылка на изображение","file.gif_placeholder":"Ссылка на Gif-анимацию","file.lottie_placeholder":"Ссылка на lottie-анимацию","file.video_placeholder":"Ссылка на видео","file.image_label":"Перетащите сюда изображение","file.gif_label":"Перетащите сюда Gif-анимацию","file.lottie_label":"Перетащите сюда lottie-анимацию","file.video_label":"Перетащите сюда видео-файл","file.image_error":"Не удалось загрузить изображение","file.gif_error":"Не удалось загрузить Gif-анимацию","file.lottie_error":"Не удалось загрузить lottie-анимацию","file.video_error":"Не удалось загрузить видео","file.image_upload":"Загрузить изображение","file.gif_upload":"Загрузить Gif","file.lottie_upload":"Загрузить Lottie","file.video_upload":"Загрузить видео","file.select":"Выбрать файл","file.insert_image":"Вставить изображение","file.too_big":"Слишком большой файл","file.generate_from_video":"Сгенерировать из видео","file.generate_from_lottie":"Сгенерировать из анимации","link.placeholder":"Введите адрес ссылки",textStyle:"Стилизация","commands.add_component":"Добавление компонента","commands.move_component":"Перемещение компонента","commands.remove_component":"Удаление компонента","commands.set_json":"Изменение json","commands.set_property":"Изменение свойств","commands.add_palette_item":"Добавление цвета в палитру","commands.delete_palette_item":"Удаление цвета из палитры","commands.reorder_palette_item":"Изменение порядка цветов в палитре","commands.rename_palette_item":"Изменение названия цвета в палитре","commands.change_palette_item":"Изменение цвета в палитре","commands.change_custom_variables":"Изменение переменных","commands.change_timers":"Изменение таймеров",tankerTitle:"Танкер",perThemeProps:"Тема",tankerEnterValue:"Введите ключ",tankerKey:"Ключ:",tankerDialogTitle:"Введите ключ из танкера",tankerPlaceholder:"Ключ от танкера",tankerMissing:"Ключ не найден",tankerOverview:"Подключенные ключи танкера",tankerOverviewEmpty:"Нет использованных ключей из танкера",tankerUpdate:"Обновить ключи",expressionTitle:"Выражение",sourcesTitle:"Источники данных",sourcesEmpty:"Отсутствуют источники интеграции данных",sourcesName:"Название",sourcesUrl:"Источник",inplaceEditorDisabled:"Текст из танкера и выражений можно отредактировать только через соответствующий интерфейс",customVariablesTitle:"Переменные",customVariablesAdd:"Добавить переменную",customVariablesEmptyName:"Пустое название переменной",customVariablesName:"Название",customVariablesType:"Типа",customVariablesValue:"Значение",customVariablesTypeString:"строка",customVariablesTypeNumber:"число с плавающей точкой",customVariablesTypeInteger:"целое число",customVariablesTypeBoolean:"булево",customVariablesTypeUrl:"url",customVariablesTypeColor:"цвет",customVariablesTypeDict:"объект",customVariablesTypeArray:"массив",customVariablesBooleanValidation:'Должно быть значение "true" или "false"',customVariablesJsonValidation:"Не удалось разобрать значение",canvasCustomSize:"Своё","props.add":"добавить","props.remove":"удалить","props.supports":"Поддержано только на ","props.not_supported":"Не поддержано","props.deprecated":"Устарело","errors.selectedTitle":"Показаны события только от одного компонента","errors.clear":"Показать все","errors.noDetails":"Нет деталей","errors.select":"Выбрать компонент",userDefinedComponents:"Пользовательские компоненты",timersTitle:"Таймеры",timersAdd:"Добавить таймер",timersEmptyId:"Пустой идентифекатор переменной",timersId:"Идентификатор",timersDuration:"Длительность",timersTickInterval:"Периодический интервал",timersValueVariable:"Переменная",timersTickActions:"Периодические действия",timersEndActions:"Действия при окончании","rtl.switchToRtl":"Включить написание справа-налево","rtl.switchToLTR":"Включить написание слева-направо"},jL={collapse:"Collapse",expand:"Expand",treeMenu:"Menu","treeItem.warnings":"Warnings","treeItem.errors":"Errors",addComponent:"Add component",removeComponent:"Remove",cloneComponent:"Duplicate component",copyComponent:"Copy component",pasteComponent:"Paste component",newComponentTitle:"New component",components:"Components tree",basicComponents:"Basic components",additionalComponents:"Additional components",lightTheme:"Light theme",darkTheme:"Dark theme",componentProperties:"Properties",complexComponentProperties:"Complex properties",code:"Code",chooseComponent:"Choose the element",inset_top:"top",inset_right:"right",inset_bottom:"bottom",inset_left:"left",inset_content:"content","props.width":"Width","props.height":"Height","props.size_fixed":"Fixed","props.size_match_parent":"Fill","props.size_wrap_content":"Content","props.size_constrained":"Constrained","props.alignment":"Alignment","props.alignment_horizontal":"Self horizontal align","props.alignment_vertical":"Self vertical align","props.align_left":"Left","props.align_center":"Center","props.align_right":"Right","props.align_top":"Top","props.align_bottom":"Bottom","props.align_start":"Start","props.align_end":"End","props.alpha":"Alpha","props.rotation":"Rotation","props.insets":"Margins and paddings","props.paddings":"Paddings","props.margins":"Margins","props.text":"Text","props.font_size":"Text size","props.font_size_small":"Small","props.font_size_medium":"Medium","props.font_size_large":"Large","props.font_weight":"Weight","props.font_weight_light":"300 — Light","props.font_weight_normal":"400 — Normal","props.font_weight_medium":"500 — Medium","props.font_weight_bold":"700 — Bold","props.font_family":"Font family","props.text_color":"Text color","props.text_alignment_horizontal":"Alignment","props.underline":"Underline","props.strike":"Strikethrough","props.image_url":"Image","props.preview":"Preview","props.image_scale":"Scale","props.scale_fit":"Fit","props.scale_fill":"Fill","props.scale_no_scale":"No scale","props.scale_stretch":"Stretch","props.image_alignment":"Image align","props.image_alignment_horizontal":"Image horizontal align","props.image_alignment_vertical":"Image vertical align","props.lottie_url":"Animation","props.background":"Background","props.background_solid":"Color","props.background_gradient":"Gradient","props.background_gradient_angle":"Angle","props.background_gradient_count":"Stops count","props.background_image":"Image","props.corners":"Corners radius","props.actions":"Actions","props.orientation":"Orientation","props.orientation_horizontal":"Horizontal","props.orientation_vertical":"Vertical","props.orientation_overlap":"Overlap","props.content_alignment":"Content align","props.cross_content_alignment":"Cross content align","props.content_alignment_horizontal":"Content horizontal align","props.content_alignment_vertical":"Content vertical align","props.orientation_start":"Start","props.orientation_center":"Center","props.orientation_end":"End","props.separator_color":"Color","props.line_height":"Line height","props.spacing":"Item spacing","props.video_repeatable":"Repeat","props.video_autostart":"Autostart","props.video_muted":"Mute","props.video_sources":"Video source","props.column_count":"Column count","props.column_span":"Column span","props.row_span":"Row span","props.text_variable":"Bound variable","props.keyboard_type":"Input type","props.keyboard_single_line_text":"Single line","props.keyboard_multi_line_text":"Multi line","props.keyboard_phone":"Phone","props.keyboard_number":"Number","props.keyboard_email":"Email","props.keyboard_uri":"Uri","props.keyboard_password":"Password","props.max_length":"Max length","props.hint_text":"Hint text","props.a11y_description":"Description","props.select_options":"Select options","props.is_enabled":"Is enabled","props.on_color":"Color of the enabled state","props.high_priority_preview_show":"Faster preview",actions_count:["%s action","%s actions","%s actions","No actions"],actions_no_url:"<no url>","actions-url":"Url","actions-unknown":"Unknown","actions-log-id":"Log ID","actions-log-url":"Log url","actions.focus_element":"Focus element","actions.clear_focus":"Clear focus","actions.set_variable":"Set variable","actions.array_insert_value":"Insert value into array","actions.array_remove_value":"Remove value from array","actions.copy_to_clipboard":"Copy to clipboard","actions.dict_set_value":"Set value in dict","actions.array_set_value":"Set value in array","actions.show_tooltip":"Show tooltip","actions.hide_tooltip":"Hide tooltip","video-url":"Source url","video-mime-type":"Source mime type","select.text":"Select text","select.value":"Select value",cancel:"Cancel",save:"Save",close:"Close",color:"Color",image:"Image",animation:"Animation",delete:"Delete",add_color:"Add color",add_background:"Add layer",add_action:"Add action",add_video:"Add source",add_select_option:"Add option",no_background:"No background",multiple_backgrounds:"Multiple layers",unknown_background:"Unknown background",background_solid:"Color: %s",background_gradient:"Gradient",background_image:"Image: %s",background_image_no_url:"<no url>",errors:"Errors",no_errors:"No errors",undo:"Undo",redo:"Redo",previewSize:"Preview size",previewLang:"Preview language",previewDirection:"Text direction","components.image":"Image","components.gif":"Gif-image","components.text":"Text","components.separator":"Separator","components.container":"Container","components.grid":"Grid","components.gallery":"Gallery","components.pager":"Pager","components.tabs":"Tabs","components.state":"State","components.custom":"Custom","components.indicator":"Indicator","components.slider":"Slider","components.input":"Input","components.select":"Select","components.video":"Video","components.switch":"Switch","templates.lottie":"Lottie","templates.button":"Button","templates.close":"Cross button","templates.list_item":"List item",rootComponent:"Root component",palette:"Palette",localPalette:"Local palette",missingPaletteColor:"Missing palette color '%s'",addColor:"Add color","baseProps.title":"Basic properties and alignment","textProps.title":"Text properties","imageProps.title":"Image properties","videoProps.title":"Video properties","containerProps.title":"Container properties","gridProps.title":"Grid properties","galleryProps.title":"Gallery properties","separatorProps.title":"Separator properties","lottieProps.title":"Lottie properties","buttonProps.title":"Button properties","closeProps.title":"Cross button properties","listItemProps.title":"List item properties","inputProps.title":"Input properties","selectProps.title":"Select properties","switchProps.title":"Switch properties","a11yProps.title":"Accessibility properties",default:"Default","background.image":"Image","background.gradient":"Linear gradient","background.solid_first_title":"Color","background.solid_second_title":"Alpha","background.gradient_second_title":"Gradient angle","background.image_second_title":"Alpha","file.image_placeholder":"Image link","file.gif_placeholder":"Gif-animation link","file.lottie_placeholder":"Lottie-animation link","file.video_placeholder":"Video link","file.image_label":"Drop image here","file.gif_label":"Drop Gif animation here","file.lottie_label":"Drop Lottie animation here","file.video_label":"Drop video here","file.image_error":"Unable to load an image","file.gif_error":"Unable to load a Gif-animation","file.lottie_error":"Unable to load a Lottie-animation","file.video_error":"Unable to load a video","file.image_upload":"Upload an image","file.gif_upload":"Upload Gif","file.lottie_upload":"Upload Lottie","file.video_upload":"Upload video","file.select":"Select file","file.insert_image":"Insert image","file.too_big":"The file is too large","file.generate_from_video":"Generate from video","file.generate_from_lottie":"Generate from animation","link.placeholder":"Input link address",textStyle:"Styles","commands.add_component":"Component addition","commands.move_component":"Component move","commands.remove_component":"Component removal","commands.set_json":"Json change","commands.set_property":"Property change","commands.add_palette_item":"Palette color addition","commands.delete_palette_item":"Palette color removal","commands.reorder_palette_item":"Reorder palette list","commands.rename_palette_item":"Rename palette item","commands.change_palette_item":"Change palette item","commands.change_custom_variables":"Change variables","commands.change_timers":"Change timers",tankerTitle:"Tanker",perThemeProps:"Theme",tankerEnterValue:"Input a key",tankerKey:"Key:",tankerDialogTitle:"Enter tanker key",tankerPlaceholder:"Tanker key",tankerMissing:"Key is not found",tankerOverview:"Tanker keys",tankerOverviewEmpty:"No used tanker keys",tankerUpdate:"Update keys",expressionTitle:"Expression",sourcesTitle:"External sources",sourcesEmpty:"No external sources integrated",sourcesName:"Name",sourcesUrl:"Source",inplaceEditorDisabled:"Text from tanker or expressions can be edited only through a suitable interface",customVariablesTitle:"Variables",customVariablesAdd:"Add variable",customVariablesEmptyName:"Empty variable name",customVariablesName:"Name",customVariablesType:"Type",customVariablesValue:"Value",customVariablesTypeString:"string",customVariablesTypeNumber:"number",customVariablesTypeInteger:"integer",customVariablesTypeBoolean:"boolean",customVariablesTypeUrl:"url",customVariablesTypeColor:"color",customVariablesTypeDict:"dict",customVariablesTypeArray:"array",customVariablesBooleanValidation:'Should be "true" or "false"',customVariablesJsonValidation:"Failed to parse",canvasCustomSize:"Custom","props.add":"add","props.remove":"remove","props.supports":"Supported only on ","props.not_supported":"Not supported","props.deprecated":"Deprecated","errors.selectedTitle":"Displaying only events from the one leaf","errors.clear":"Show all","errors.noDetails":"No details","errors.select":"Select component",userDefinedComponents:"User components",timersTitle:"Timers",timersAdd:"Add timer",timersEmptyId:"Empty timer id",timersId:"Id",timersDuration:"Duration",timersTickInterval:"Tick interval",timersValueVariable:"Value variable",timersTickActions:"Tick actions",timersEndActions:"End actions","rtl.switchToRTL":"Turn on RTL layout","rtl.switchToLTR":"Turn on LTR layout"},SL={ru:kL,en:jL};function zu(t){const e=t-1;return e*e*e+1}function vp(t,{delay:e=0,duration:n=400,easing:i=ku}={}){const o=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:i,css:r=>`opacity: ${r*o}`}}function fr(t,{delay:e=0,duration:n=400,easing:i=zu,x:o=0,y:r=0,opacity:s=0}={}){const l=getComputedStyle(t),a=+l.opacity,c=l.transform==="none"?"":l.transform,d=a*(1-s),[u,p]=_p(o),[_,f]=_p(r);return{delay:e,duration:n,easing:i,css:(m,g)=>`\n\t\t\ttransform: ${c} translate(${(1-m)*u}${p}, ${(1-m)*_}${f});\n\t\t\topacity: ${a-d*g}`}}function Go(t,{delay:e=0,duration:n=400,easing:i=zu,axis:o="y"}={}){const r=getComputedStyle(t),s=+r.opacity,l=o==="y"?"height":"width",a=parseFloat(r[l]),c=o==="y"?["top","bottom"]:["left","right"],d=c.map((v=>`${v[0].toUpperCase()}${v.slice(1)}`)),u=parseFloat(r[`padding${d[0]}`]),p=parseFloat(r[`padding${d[1]}`]),_=parseFloat(r[`margin${d[0]}`]),f=parseFloat(r[`margin${d[1]}`]),m=parseFloat(r[`border${d[0]}Width`]),g=parseFloat(r[`border${d[1]}Width`]);return{delay:e,duration:n,easing:i,css:v=>`overflow: hidden;opacity: ${Math.min(v*20,1)*s};${l}: ${v*a}px;padding-${c[0]}: ${v*u}px;padding-${c[1]}: ${v*p}px;margin-${c[0]}: ${v*_}px;margin-${c[1]}: ${v*f}px;border-${c[0]}-width: ${v*m}px;border-${c[1]}-width: ${v*g}px;`}}const Kd=new Set;function TL(t){if(t.defaultPrevented)return;const e=[];for(const{shortcut:n,handler:i,prio:o}of Kd)n.isPressed(t)&&e.push({handler:i,prio:o});e.sort(((n,i)=>{if(n.prio){if(!i.prio)return-1}else return 1;return i.prio-n.prio})),e.length&&setTimeout((()=>{}));for(let n=0;n<e.length;++n){const{handler:i}=e[n];if(i(t)!==!1){t.preventDefault();break}}}function CL(t,e,n){const i={shortcut:t,handler:e,prio:n};return Kd.add(i),{unbind:()=>{Kd.delete(i)}}}function k1(t,e){const n=e.map((i=>CL(i[0],(o=>{const r=!!t.closest("dialog"),s=!!document.querySelector("dialog");if(r===s)i[1](o);else return!1}),i[2]).unbind));return{destroy(){for(const i of n)i()}}}function wl(t){return t.charAt(0).toUpperCase()+t.substring(1)}const bp=/Mac OS/i.test(navigator.userAgent),Xr={SHIFT:{val:4,field:"shiftKey",str:"⇧"},CTRL:{val:1,field:"ctrlKey",str:"⌃"},ALT:{val:2,field:"altKey",str:"⌥"},CMD:{val:8,field:"metaKey",str:"⌘"}},gc={BACKSPACE:8,TAB:9,ENTER:13,ESC:27,SPACE:32,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,S:83,T:84,U:85,V:86,X:88,Y:89,Z:90,1:49,2:50,3:51,"/":191},zL=Object.keys(gc).reduce(((t,e)=>(t[gc[e]]=e,t)),{}),ds=class ds{constructor(e){on(this,"_parts");on(this,"_strParts");on(this,"_str");e.includes(ds.MAC_SPLITTER)&&(e=e.split(ds.MAC_SPLITTER)[bp?1:0].trim()),this._parts=[],this._strParts=[];for(const n of e.split(ds.SEVERAL_SPLITTER)){const i=n.trim();this._parts.push(this._parse(i)),this._strParts.push(i.split("+"))}bp?this._str=this._genMacStr():this._str=e}_parse(e){const n=e.split("+");let i=0,o;for(const r of n){const s=r.toUpperCase();if(!(s in Xr)&&!(s in gc))throw new Error(`Unknown key ${e}`);s in Xr?i+=Xr[s].val:o=gc[s]}if(!o)throw new Error(`Incorrect shortcut ${e}`);return{which:o,modifiers:i}}_genMacStr(){return this._parts.map((e=>{let n="";const i=e.modifiers;for(const o in Xr)i&Xr[o].val&&(n+=Xr[o].str);return n+=wl(zL[e.which].toLowerCase()),n})).join(ds.SEVERAL_SPLITTER)}toString(){return this._str}isPressed(e){for(const n of this._parts){if(e.which!==n.which)continue;let i=0;for(const o in Xr)e[Xr[o].field]&&(i+=Xr[o].val);if(i===n.modifiers)return!0}return!1}getList(){return this._strParts}};on(ds,"MAC_SPLITTER",":"),on(ds,"SEVERAL_SPLITTER"," / ");let di=ds;const j1=new di("Esc"),Eu=new di("Esc"),Wc=new di("Enter"),EL=new di("Ctrl+Enter : Cmd+Enter"),yp=new di("Up"),AL=new di("Down"),OL=new di("Left"),ML=new di("Right"),PL=new di("Up"),IL=new di("Down"),DL=new di("Left"),VL=new di("Right"),wp=new di("Shift+Up"),$p=new di("Shift+Down"),kp=new di("Shift+Left"),jp=new di("Shift+Right"),LL=new di("Ctrl+Up"),FL=new di("Ctrl+Down"),NL=new di("Ctrl+Left"),qL=new di("Ctrl+Right"),Sp=new di("Ctrl+Shift+Up"),Tp=new di("Ctrl+Shift+Down"),Cp=new di("Ctrl+Shift+Left"),zp=new di("Ctrl+Shift+Right"),S1=new di("Delete / Backspace"),T1=new di("Ctrl+Z : Cmd+Z"),C1=new di("Ctrl+Y / Ctrl+Shift+Z : Cmd+Y / Cmd+Shift+Z"),z1=new di("Ctrl+C : Cmd+C"),E1=new di("Ctrl+V : Cmd+V"),RL=new di("Up"),BL=new di("Down"),HL=new di("Left"),JL=new di("Right"),UL=new di("Up"),WL=new di("Down"),KL=new di("Left"),YL=new di("Right"),A1=new di("Up"),O1=new di("Down"),GL=new di("Home"),XL=new di("End"),ZL=new di("Delete / Backspace"),Cn=Symbol("app");function po(t){return t.replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")}function Ep(t){let e,n=`url(${po(t[0].icon)})`;return{c(){e=S("span"),h(e,"class","menu-item__icon svelte-1o1lgms"),ke(e,"background-image",n)},m(i,o){F(i,e,o)},p(i,o){o&1&&n!==(n=`url(${po(i[0].icon)})`)&&ke(e,"background-image",n)},d(i){i&&V(e)}}}function Ap(t){let e;return{c(){e=S("span"),h(e,"class","menu-item__submenu-icon svelte-1o1lgms")},m(n,i){F(n,e,i)},d(n){n&&V(e)}}}function xL(t){let e,n,i=t[0].text+"",o,r,s,l,a=t[0].icon&&Ep(t),c=t[0].submenu&&Ap();return{c(){e=S("li"),a&&a.c(),n=G(),o=xe(i),r=G(),c&&c.c(),h(e,"class","menu-item svelte-1o1lgms"),ne(e,"menu-item_icon",t[0].icon),ne(e,"menu-item_enabled",t[0].enabled!==!1),ne(e,"menu-item_selected",t[1])},m(d,u){F(d,e,u),a&&a.m(e,null),$(e,n),$(e,o),$(e,r),c&&c.m(e,null),t[5](e),s||(l=[te(e,"click",Eo(zi(t[6]))),te(e,"mouseenter",(function(){Yo(t[0].submenu?t[7]:null)&&(t[0].submenu?t[7]:null).apply(this,arguments)})),te(e,"mouseleave",(function(){Yo(t[0].submenu?t[8]:null)&&(t[0].submenu?t[8]:null).apply(this,arguments)}))],s=!0)},p(d,[u]){t=d,t[0].icon?a?a.p(t,u):(a=Ep(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null),u&1&&i!==(i=t[0].text+"")&&at(o,i),t[0].submenu?c||(c=Ap(),c.c(),c.m(e,null)):c&&(c.d(1),c=null),u&1&&ne(e,"menu-item_icon",t[0].icon),u&1&&ne(e,"menu-item_enabled",t[0].enabled!==!1),u&2&&ne(e,"menu-item_selected",t[1])},i:tn,o:tn,d(d){d&&V(e),a&&a.d(),c&&c.d(),t[5](null),s=!1,Rn(l)}}}function QL(t,e,n){let{item:i}=e,{selected:o=!1}=e;const{contextMenu:r}=yt(Cn);let s;const l=_i();function a(p){pt[p?"unshift":"push"]((()=>{s=p,n(2,s)}))}const c=()=>{var p;i.enabled!==!1&&((p=i.callback)==null?void 0:p.call(i))!==!1&&r().hide()},d=()=>{l("showsubmenu",{elem:s})},u=()=>{l("hidesubmenu")};return t.$$set=p=>{"item"in p&&n(0,i=p.item),"selected"in p&&n(1,o=p.selected)},[i,o,s,r,l,a,c,d,u]}class M1 extends Gt{constructor(e){super(),Yt(this,e,QL,xL,Rt,{item:0,selected:1})}}const{window:eF}=va;function Op(t,e,n){const i=t.slice();return i[27]=e[n],i}function Mp(t,e,n){const i=t.slice();return i[27]=e[n],i}function Pp(t){var p;let e,n,i,o,r,s,l,a=ln(t[1].items),c=[];for(let _=0;_<a.length;_+=1)c[_]=Ip(Mp(t,a,_));const d=_=>H(c[_],1,1,(()=>{c[_]=null}));let u=((p=t[5])==null?void 0:p.submenu)&&Dp(t);return{c(){e=S("div"),n=S("ul");for(let _=0;_<c.length;_+=1)c[_].c();o=G(),u&&u.c(),h(n,"class","menu svelte-1306v9l"),ke(n,"left",t[2].left),ke(n,"top",t[2].top),ke(n,"width",t[2].width),ke(n,"height",t[2].height),h(e,"class","menu-controller svelte-1306v9l")},m(_,f){F(_,e,f),$(e,n);for(let m=0;m<c.length;m+=1)c[m]&&c[m].m(n,null);t[14](n),$(e,o),u&&u.m(e,null),t[16](e),r=!0,s||(l=l1(k1.call(null,e,t[12])),s=!0)},p(_,f){var m;if(f[0]&1570){a=ln(_[1].items);let g;for(g=0;g<a.length;g+=1){const v=Mp(_,a,g);c[g]?(c[g].p(v,f),I(c[g],1)):(c[g]=Ip(v),c[g].c(),I(c[g],1),c[g].m(n,null))}for(Dt(),g=a.length;g<c.length;g+=1)d(g);Vt()}f[0]&4&&ke(n,"left",_[2].left),f[0]&4&&ke(n,"top",_[2].top),f[0]&4&&ke(n,"width",_[2].width),f[0]&4&&ke(n,"height",_[2].height),(m=_[5])!=null&&m.submenu?u?(u.p(_,f),f[0]&32&&I(u,1)):(u=Dp(_),u.c(),I(u,1),u.m(e,null)):u&&(Dt(),H(u,1,1,(()=>{u=null})),Vt())},i(_){if(!r){for(let f=0;f<a.length;f+=1)I(c[f]);_&&_o((()=>{r&&(i||(i=Zi(n,fr,{y:10,duration:150},!0)),i.run(1))})),I(u),r=!0}},o(_){c=c.filter(Boolean);for(let f=0;f<c.length;f+=1)H(c[f]);_&&(i||(i=Zi(n,fr,{y:10,duration:150},!1)),i.run(0)),H(u),r=!1},d(_){_&&V(e),Bi(c,_),t[14](null),_&&i&&i.end(),u&&u.d(),t[16](null),s=!1,l()}}}function Ip(t){let e,n;function i(...o){return t[13](t[27],...o)}return e=new M1({props:{item:t[27],selected:t[27]===t[5]}}),e.$on("showsubmenu",i),e.$on("hidesubmenu",t[10]),{c(){Pe(e.$$.fragment)},m(o,r){Ee(e,o,r),n=!0},p(o,r){t=o;const s={};r[0]&2&&(s.item=t[27]),r[0]&34&&(s.selected=t[27]===t[5]),e.$set(s)},i(o){n||(I(e.$$.fragment,o),n=!0)},o(o){H(e.$$.fragment,o),n=!1},d(o){Ae(e,o)}}}function Dp(t){let e,n,i,o,r,s=ln(t[5].submenu),l=[];for(let c=0;c<s.length;c+=1)l[c]=Vp(Op(t,s,c));const a=c=>H(l[c],1,1,(()=>{l[c]=null}));return{c(){e=S("ul");for(let c=0;c<l.length;c+=1)l[c].c();h(e,"class","menu menu_submenu svelte-1306v9l"),ke(e,"left",t[6].left),ke(e,"top",t[6].top),ke(e,"width",t[6].width),ke(e,"height",t[6].height)},m(c,d){F(c,e,d);for(let u=0;u<l.length;u+=1)l[u]&&l[u].m(e,null);t[15](e),i=!0,o||(r=[te(e,"mouseenter",t[11]),te(e,"mouseleave",t[10])],o=!0)},p(c,d){if(d[0]&32){s=ln(c[5].submenu);let u;for(u=0;u<s.length;u+=1){const p=Op(c,s,u);l[u]?(l[u].p(p,d),I(l[u],1)):(l[u]=Vp(p),l[u].c(),I(l[u],1),l[u].m(e,null))}for(Dt(),u=s.length;u<l.length;u+=1)a(u);Vt()}d[0]&64&&ke(e,"left",c[6].left),d[0]&64&&ke(e,"top",c[6].top),d[0]&64&&ke(e,"width",c[6].width),d[0]&64&&ke(e,"height",c[6].height)},i(c){if(!i){for(let d=0;d<s.length;d+=1)I(l[d]);c&&_o((()=>{i&&(n||(n=Zi(e,fr,{y:10,duration:150},!0)),n.run(1))})),i=!0}},o(c){l=l.filter(Boolean);for(let d=0;d<l.length;d+=1)H(l[d]);c&&(n||(n=Zi(e,fr,{y:10,duration:150},!1)),n.run(0)),i=!1},d(c){c&&V(e),Bi(l,c),t[15](null),c&&n&&n.end(),o=!1,Rn(r)}}}function Vp(t){let e,n;return e=new M1({props:{item:t[27]}}),{c(){Pe(e.$$.fragment)},m(i,o){Ee(e,i,o),n=!0},p(i,o){const r={};o[0]&32&&(r.item=i[27]),e.$set(r)},i(i){n||(I(e.$$.fragment,i),n=!0)},o(i){H(e.$$.fragment,i),n=!1},d(i){Ae(e,i)}}}function tF(t){let e,n,i,o,r=t[0]&&t[1]&&Pp(t);return{c(){r&&r.c(),e=Vn()},m(s,l){r&&r.m(s,l),F(s,e,l),n=!0,i||(o=te(eF,"click",t[8]),i=!0)},p(s,l){s[0]&&s[1]?r?(r.p(s,l),l[0]&3&&I(r,1)):(r=Pp(s),r.c(),I(r,1),r.m(e.parentNode,e)):r&&(Dt(),H(r,1,1,(()=>{r=null})),Vt())},i(s){n||(I(r),n=!0)},o(s){H(r),