@zzalai/leafer-multi-roi 1.0.3 → 1.0.5

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.
@@ -1 +0,0 @@
1
- function t(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return t=>t in e}!function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver(t=>{for(const i of t)if("childList"===i.type)for(const t of i.addedNodes)"LINK"===t.tagName&&"modulepreload"===t.rel&&e(t)}).observe(document,{childList:!0,subtree:!0})}function e(t){if(t.ep)return;t.ep=!0;const e=function(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),"use-credentials"===t.crossOrigin?e.credentials="include":"anonymous"===t.crossOrigin?e.credentials="omit":e.credentials="same-origin",e}(t);fetch(t.href,e)}}();var e,i={},s=[],n=()=>{},r=()=>!1,o=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),a=t=>t.startsWith("onUpdate:"),h=Object.assign,l=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},c=Object.prototype.hasOwnProperty,d=(t,e)=>c.call(t,e),u=Array.isArray,p=t=>"[object Map]"===b(t),g=t=>"[object Set]"===b(t),f=t=>"[object Date]"===b(t),_=t=>"function"==typeof t,m=t=>"string"==typeof t,v=t=>"symbol"==typeof t,y=t=>null!==t&&"object"==typeof t,w=t=>(y(t)||_(t))&&_(t.then)&&_(t.catch),x=Object.prototype.toString,b=t=>x.call(t),k=t=>"[object Object]"===b(t),S=t=>m(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,E=t(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),C=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},O=/-\w/g,T=C(t=>t.replace(O,t=>t.slice(1).toUpperCase())),R=/\B([A-Z])/g,B=C(t=>t.replace(R,"-$1").toLowerCase()),P=C(t=>t.charAt(0).toUpperCase()+t.slice(1)),L=C(t=>t?`on${P(t)}`:""),M=(t,e)=>!Object.is(t,e),D=(t,...e)=>{for(let i=0;i<t.length;i++)t[i](...e)},A=(t,e,i,s=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:i})},I=t=>{const e=parseFloat(t);return isNaN(e)?t:e},W=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function F(t){if(u(t)){const e={};for(let i=0;i<t.length;i++){const s=t[i],n=m(s)?H(s):F(s);if(n)for(const t in n)e[t]=n[t]}return e}if(m(t)||y(t))return t}var z=/;(?![^(]*\))/g,N=/:([^]+)/,V=/\/\*[^]*?\*\//g;function H(t){const e={};return t.replace(V,"").split(z).forEach(t=>{if(t){const i=t.split(N);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Y(t){let e="";if(m(t))e=t;else if(u(t))for(let i=0;i<t.length;i++){const s=Y(t[i]);s&&(e+=s+" ")}else if(y(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}var X="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",j=t(X);function U(t){return!!t||""===t}function G(t,e){if(t===e)return!0;let i=f(t),s=f(e);if(i||s)return!(!i||!s)&&t.getTime()===e.getTime();if(i=v(t),s=v(e),i||s)return t===e;if(i=u(t),s=u(e),i||s)return!(!i||!s)&&function(t,e){if(t.length!==e.length)return!1;let i=!0;for(let s=0;i&&s<t.length;s++)i=G(t[s],e[s]);return i}(t,e);if(i=y(t),s=y(e),i||s){if(!i||!s)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t){const s=t.hasOwnProperty(i),n=e.hasOwnProperty(i);if(s&&!n||!s&&n||!G(t[i],e[i]))return!1}}return String(t)===String(e)}var K,Z,$=t=>!(!t||!0!==t.__v_isRef),q=t=>m(t)?t:null==t?"":u(t)||y(t)&&(t.toString===x||!_(t.toString))?$(t)?q(t.value):JSON.stringify(t,J,2):String(t),J=(t,e)=>$(e)?J(t,e.value):p(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,i],s)=>(t[Q(e,s)+" =>"]=i,t),{})}:g(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Q(t))}:v(e)?Q(e):!y(e)||u(e)||k(e)?e:String(e),Q=(t,e="")=>{var i;return v(t)?`Symbol(${null!=(i=t.description)?i:e})`:t},tt=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=K,!t&&K&&(this.index=(K.scopes||(K.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let t,e;if(this._isPaused=!0,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].pause();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){let t,e;if(this._isPaused=!1,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].resume();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].resume()}}run(t){if(this._active){const e=K;try{return K=this,t()}finally{K=e}}}on(){1===++this._on&&(this.prevScope=K,K=this)}off(){if(this._on>0&&0===--this._on){if(K===this)K=this.prevScope;else{let t=K;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){let e,i;for(this._active=!1,e=0,i=this.effects.length;e<i;e++)this.effects[e].stop();for(this.effects.length=0,e=0,i=this.cleanups.length;e<i;e++)this.cleanups[e]();if(this.cleanups.length=0,this.scopes){for(e=0,i=this.scopes.length;e<i;e++)this.scopes[e].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0}}};var et,it,st=new WeakSet,nt=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,K&&K.active&&K.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,st.has(this)&&(st.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||ot(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,yt(this),lt(this);const t=Z,e=ft;Z=this,ft=!0;try{return this.fn()}finally{ct(this),Z=t,ft=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)pt(t);this.deps=this.depsTail=void 0,yt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?st.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){dt(this)&&this.run()}get dirty(){return dt(this)}},rt=0;function ot(t,e=!1){if(t.flags|=8,e)return t.next=it,void(it=t);t.next=et,et=t}function at(){rt++}function ht(){if(--rt>0)return;if(it){let t=it;for(it=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let t;for(;et;){let i=et;for(et=void 0;i;){const s=i.next;if(i.next=void 0,i.flags&=-9,1&i.flags)try{i.trigger()}catch(e){t||(t=e)}i=s}}if(t)throw t}function lt(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ct(t){let e,i=t.depsTail,s=i;for(;s;){const t=s.prevDep;-1===s.version?(s===i&&(i=t),pt(s),gt(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=t}t.deps=e,t.depsTail=i}function dt(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(ut(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function ut(t){if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===wt)return;if(t.globalVersion=wt,!t.isSSR&&128&t.flags&&(!t.deps&&!t._dirty||!dt(t)))return;t.flags|=2;const e=t.dep,i=Z,s=ft;Z=t,ft=!0;try{lt(t);const i=t.fn(t._value);(0===e.version||M(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(n){throw e.version++,n}finally{Z=i,ft=s,ct(t),t.flags&=-3}}function pt(t,e=!1){const{dep:i,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),i.subs===t&&(i.subs=s,!s&&i.computed)){i.computed.flags&=-5;for(let t=i.computed.deps;t;t=t.nextDep)pt(t,!0)}e||--i.sc||!i.map||i.map.delete(i.key)}function gt(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}var ft=!0,_t=[];function mt(){_t.push(ft),ft=!1}function vt(){const t=_t.pop();ft=void 0===t||t}function yt(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=Z;Z=void 0;try{e()}finally{Z=t}}}var wt=0,xt=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},bt=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Z||!ft||Z===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==Z)e=this.activeLink=new xt(Z,this),Z.deps?(e.prevDep=Z.depsTail,Z.depsTail.nextDep=e,Z.depsTail=e):Z.deps=Z.depsTail=e,kt(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=Z.depsTail,e.nextDep=void 0,Z.depsTail.nextDep=e,Z.depsTail=e,Z.deps===e&&(Z.deps=t)}return e}trigger(t){this.version++,wt++,this.notify(t)}notify(t){at();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{ht()}}};function kt(t){if(t.dep.sc++,4&t.sub.flags){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)kt(t)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}var St=new WeakMap,Et=Symbol(""),Ct=Symbol(""),Ot=Symbol("");function Tt(t,e,i){if(ft&&Z){let e=St.get(t);e||St.set(t,e=new Map);let s=e.get(i);s||(e.set(i,s=new bt),s.map=e,s.key=i),s.track()}}function Rt(t,e,i,s,n,r){const o=St.get(t);if(!o)return void wt++;const a=t=>{t&&t.trigger()};if(at(),"clear"===e)o.forEach(a);else{const n=u(t),r=n&&S(i);if(n&&"length"===i){const t=Number(s);o.forEach((e,i)=>{("length"===i||i===Ot||!v(i)&&i>=t)&&a(e)})}else switch((void 0!==i||o.has(void 0))&&a(o.get(i)),r&&a(o.get(Ot)),e){case"add":n?r&&a(o.get("length")):(a(o.get(Et)),p(t)&&a(o.get(Ct)));break;case"delete":n||(a(o.get(Et)),p(t)&&a(o.get(Ct)));break;case"set":p(t)&&a(o.get(Et))}}ht()}function Bt(t){const e=fe(t);return e===t?e:(Tt(e,0,Ot),pe(t)?e:e.map(_e))}function Pt(t){return Tt(t=fe(t),0,Ot),t}function Lt(t,e){return ue(t)?me(de(t)?_e(e):e):_e(e)}var Mt={__proto__:null,[Symbol.iterator](){return Dt(this,Symbol.iterator,t=>Lt(this,t))},concat(...t){return Bt(this).concat(...t.map(t=>u(t)?Bt(t):t))},entries(){return Dt(this,"entries",t=>(t[1]=Lt(this,t[1]),t))},every(t,e){return It(this,"every",t,e,void 0,arguments)},filter(t,e){return It(this,"filter",t,e,t=>t.map(t=>Lt(this,t)),arguments)},find(t,e){return It(this,"find",t,e,t=>Lt(this,t),arguments)},findIndex(t,e){return It(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return It(this,"findLast",t,e,t=>Lt(this,t),arguments)},findLastIndex(t,e){return It(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return It(this,"forEach",t,e,void 0,arguments)},includes(...t){return Ft(this,"includes",t)},indexOf(...t){return Ft(this,"indexOf",t)},join(t){return Bt(this).join(t)},lastIndexOf(...t){return Ft(this,"lastIndexOf",t)},map(t,e){return It(this,"map",t,e,void 0,arguments)},pop(){return zt(this,"pop")},push(...t){return zt(this,"push",t)},reduce(t,...e){return Wt(this,"reduce",t,e)},reduceRight(t,...e){return Wt(this,"reduceRight",t,e)},shift(){return zt(this,"shift")},some(t,e){return It(this,"some",t,e,void 0,arguments)},splice(...t){return zt(this,"splice",t)},toReversed(){return Bt(this).toReversed()},toSorted(t){return Bt(this).toSorted(t)},toSpliced(...t){return Bt(this).toSpliced(...t)},unshift(...t){return zt(this,"unshift",t)},values(){return Dt(this,"values",t=>Lt(this,t))}};function Dt(t,e,i){const s=Pt(t),n=s[e]();return s===t||pe(t)||(n._next=n.next,n.next=()=>{const t=n._next();return t.done||(t.value=i(t.value)),t}),n}var At=Array.prototype;function It(t,e,i,s,n,r){const o=Pt(t),a=o!==t&&!pe(t),h=o[e];if(h!==At[e]){const e=h.apply(t,r);return a?_e(e):e}let l=i;o!==t&&(a?l=function(e,s){return i.call(this,Lt(t,e),s,t)}:i.length>2&&(l=function(e,s){return i.call(this,e,s,t)}));const c=h.call(o,l,s);return a&&n?n(c):c}function Wt(t,e,i,s){const n=Pt(t);let r=i,o=!1;n!==t&&(n!==t&&!pe(t)?(o=0===s.length,r=function(e,s,n){return o&&(o=!1,e=Lt(t,e)),i.call(this,e,Lt(t,s),n,t)}):i.length>3&&(r=function(e,s,n){return i.call(this,e,s,n,t)}));const a=n[e](r,...s);return o?Lt(t,a):a}function Ft(t,e,i){const s=fe(t);Tt(s,0,Ot);const n=s[e](...i);return-1!==n&&!1!==n||!ge(i[0])?n:(i[0]=fe(i[0]),s[e](...i))}function zt(t,e,i=[]){mt(),at();const s=fe(t)[e].apply(t,i);return ht(),vt(),s}var Nt=t("__proto__,__v_isRef,__isVue"),Vt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(v));function Ht(t){v(t)||(t=String(t));const e=fe(this);return Tt(e,0,t),e.hasOwnProperty(t)}var Yt=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,i){if("__v_skip"===e)return t.__v_skip;const s=this._isReadonly,n=this._isShallow;if("__v_isReactive"===e)return!s;if("__v_isReadonly"===e)return s;if("__v_isShallow"===e)return n;if("__v_raw"===e)return i===(s?n?oe:re:n?ne:se).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const r=u(t);if(!s){let t;if(r&&(t=Mt[e]))return t;if("hasOwnProperty"===e)return Ht}const o=Reflect.get(t,e,ve(t)?t:i);if(v(e)?Vt.has(e):Nt(e))return o;if(s||Tt(t,0,e),n)return o;if(ve(o)){const t=r&&S(e)?o:o.value;return s&&y(t)?le(t):t}return y(o)?s?le(o):he(o):o}},Xt=class extends Yt{constructor(t=!1){super(!1,t)}set(t,e,i,s){let n=t[e];const r=u(t)&&S(e);if(!this._isShallow){const t=ue(n);if(pe(i)||ue(i)||(n=fe(n),i=fe(i)),!r&&ve(n)&&!ve(i))return t||(n.value=i),!0}const o=r?Number(e)<t.length:d(t,e),a=Reflect.set(t,e,i,ve(t)?t:s);return t===fe(s)&&(o?M(i,n)&&Rt(t,"set",e,i):Rt(t,"add",e,i)),a}deleteProperty(t,e){const i=d(t,e),s=(t[e],Reflect.deleteProperty(t,e));return s&&i&&Rt(t,"delete",e,void 0),s}has(t,e){const i=Reflect.has(t,e);return v(e)&&Vt.has(e)||Tt(t,0,e),i}ownKeys(t){return Tt(t,0,u(t)?"length":Et),Reflect.ownKeys(t)}},jt=class extends Yt{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Ut=new Xt,Gt=new jt,Kt=new Xt(!0),Zt=t=>t,$t=t=>Reflect.getPrototypeOf(t);function qt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Jt(t,e){const i={get(i){const s=this.__v_raw,n=fe(s),r=fe(i);t||(M(i,r)&&Tt(n,0,i),Tt(n,0,r));const{has:o}=$t(n),a=e?Zt:t?me:_e;return o.call(n,i)?a(s.get(i)):o.call(n,r)?a(s.get(r)):void(s!==n&&s.get(i))},get size(){const e=this.__v_raw;return!t&&Tt(fe(e),0,Et),e.size},has(e){const i=this.__v_raw,s=fe(i),n=fe(e);return t||(M(e,n)&&Tt(s,0,e),Tt(s,0,n)),e===n?i.has(e):i.has(e)||i.has(n)},forEach(i,s){const n=this,r=n.__v_raw,o=e?Zt:t?me:_e;return!t&&Tt(fe(r),0,Et),r.forEach((t,e)=>i.call(s,o(t),o(e),n))}};return h(i,t?{add:qt("add"),set:qt("set"),delete:qt("delete"),clear:qt("clear")}:{add(t){const i=fe(this),s=$t(i),n=fe(t),r=e||pe(t)||ue(t)?t:n;return s.has.call(i,r)||M(t,r)&&s.has.call(i,t)||M(n,r)&&s.has.call(i,n)||(i.add(r),Rt(i,"add",r,r)),this},set(t,i){e||pe(i)||ue(i)||(i=fe(i));const s=fe(this),{has:n,get:r}=$t(s);let o=n.call(s,t);o||(t=fe(t),o=n.call(s,t));const a=r.call(s,t);return s.set(t,i),o?M(i,a)&&Rt(s,"set",t,i):Rt(s,"add",t,i),this},delete(t){const e=fe(this),{has:i,get:s}=$t(e);let n=i.call(e,t);n||(t=fe(t),n=i.call(e,t));s&&s.call(e,t);const r=e.delete(t);return n&&Rt(e,"delete",t,void 0),r},clear(){const t=fe(this),e=0!==t.size,i=t.clear();return e&&Rt(t,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=function(t,e,i){return function(...s){const n=this.__v_raw,r=fe(n),o=p(r),a="entries"===t||t===Symbol.iterator&&o,l="keys"===t&&o,c=n[t](...s),d=i?Zt:e?me:_e;return!e&&Tt(r,0,l?Ct:Et),h(Object.create(c),{next(){const{value:t,done:e}=c.next();return e?{value:t,done:e}:{value:a?[d(t[0]),d(t[1])]:d(t),done:e}}})}}(s,t,e)}),i}function Qt(t,e){const i=Jt(t,e);return(e,s,n)=>"__v_isReactive"===s?!t:"__v_isReadonly"===s?t:"__v_raw"===s?e:Reflect.get(d(i,s)&&s in e?i:e,s,n)}var te={get:Qt(!1,!1)},ee={get:Qt(!1,!0)},ie={get:Qt(!0,!1)},se=new WeakMap,ne=new WeakMap,re=new WeakMap,oe=new WeakMap;function ae(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>b(t).slice(8,-1))(t))}function he(t){return ue(t)?t:ce(t,!1,Ut,te,se)}function le(t){return ce(t,!0,Gt,ie,re)}function ce(t,e,i,s,n){if(!y(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=ae(t);if(0===r)return t;const o=n.get(t);if(o)return o;const a=new Proxy(t,2===r?s:i);return n.set(t,a),a}function de(t){return ue(t)?de(t.__v_raw):!(!t||!t.__v_isReactive)}function ue(t){return!(!t||!t.__v_isReadonly)}function pe(t){return!(!t||!t.__v_isShallow)}function ge(t){return!!t&&!!t.__v_raw}function fe(t){const e=t&&t.__v_raw;return e?fe(e):t}var _e=t=>y(t)?he(t):t,me=t=>y(t)?le(t):t;function ve(t){return!!t&&!0===t.__v_isRef}function ye(t){return i=!1,ve(e=t)?e:new we(e,i);var e,i}var we=class{constructor(t,e){this.dep=new bt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:fe(t),this._value=e?t:_e(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,i=this.__v_isShallow||pe(t)||ue(t);M(t=i?t:fe(t),e)&&(this._rawValue=t,this._value=i?t:_e(t),this.dep.trigger())}};var xe={get:(t,e,i)=>{return"__v_raw"===e?t:ve(s=Reflect.get(t,e,i))?s.value:s;var s},set:(t,e,i,s)=>{const n=t[e];return ve(n)&&!ve(i)?(n.value=i,!0):Reflect.set(t,e,i,s)}};function be(t){return de(t)?t:new Proxy(t,xe)}var ke=class{constructor(t,e,i){this.fn=t,this.setter=e,this._value=void 0,this.dep=new bt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=wt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=i}notify(){if(this.flags|=16,!(8&this.flags)&&Z!==this)return ot(this,!0),!0}get value(){const t=this.dep.track();return ut(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};var Se={},Ee=new WeakMap,Ce=void 0;function Oe(t,e,s=i){const{immediate:r,deep:o,once:a,scheduler:h,augmentJob:c,call:d}=s,p=t=>o?t:pe(t)||!1===o||0===o?Te(t,1):Te(t);let g,f,m,v,y=!1,w=!1;if(ve(t)?(f=()=>t.value,y=pe(t)):de(t)?(f=()=>p(t),y=!0):u(t)?(w=!0,y=t.some(t=>de(t)||pe(t)),f=()=>t.map(t=>ve(t)?t.value:de(t)?p(t):_(t)?d?d(t,2):t():void 0)):f=_(t)?e?d?()=>d(t,2):t:()=>{if(m){mt();try{m()}finally{vt()}}const e=Ce;Ce=g;try{return d?d(t,3,[v]):t(v)}finally{Ce=e}}:n,e&&o){const t=f,e=!0===o?1/0:o;f=()=>Te(t(),e)}const x=K,b=()=>{g.stop(),x&&x.active&&l(x.effects,g)};if(a&&e){const t=e;e=(...e)=>{t(...e),b()}}let k=w?new Array(t.length).fill(Se):Se;const S=t=>{if(1&g.flags&&(g.dirty||t))if(e){const t=g.run();if(o||y||(w?t.some((t,e)=>M(t,k[e])):M(t,k))){m&&m();const i=Ce;Ce=g;try{const i=[t,k===Se?void 0:w&&k[0]===Se?[]:k,v];k=t,d?d(e,3,i):e(...i)}finally{Ce=i}}}else g.run()};return c&&c(S),g=new nt(f),g.scheduler=h?()=>h(S,!1):S,v=t=>function(t,e=!1,i=Ce){if(i){let e=Ee.get(i);e||Ee.set(i,e=[]),e.push(t)}}(t,!1,g),m=g.onStop=()=>{const t=Ee.get(g);if(t){if(d)d(t,4);else for(const e of t)e();Ee.delete(g)}},e?r?S(!0):k=g.run():h?h(S.bind(null,!0),!0):g.run(),b.pause=g.pause.bind(g),b.resume=g.resume.bind(g),b.stop=b,b}function Te(t,e=1/0,i){if(e<=0||!y(t)||t.__v_skip)return t;if(((i=i||new Map).get(t)||0)>=e)return t;if(i.set(t,e),e--,ve(t))Te(t.value,e,i);else if(u(t))for(let s=0;s<t.length;s++)Te(t[s],e,i);else if(g(t)||p(t))t.forEach(t=>{Te(t,e,i)});else if(k(t)){for(const s in t)Te(t[s],e,i);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Te(t[s],e,i)}return t}function Re(t,e,i,s){try{return s?t(...s):t()}catch(n){Pe(n,e,i)}}function Be(t,e,i,s){if(_(t)){const n=Re(t,e,i,s);return n&&w(n)&&n.catch(t=>{Pe(t,e,i)}),n}if(u(t)){const n=[];for(let r=0;r<t.length;r++)n.push(Be(t[r],e,i,s));return n}}function Pe(t,e,s,n=!0){e&&e.vnode;const{errorHandler:r,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||i;if(e){let i=e.parent;const n=e.proxy,o=`https://vuejs.org/error-reference/#runtime-${s}`;for(;i;){const e=i.ec;if(e)for(let i=0;i<e.length;i++)if(!1===e[i](t,n,o))return;i=i.parent}if(r)return mt(),Re(r,null,10,[t,n,o]),void vt()}!function(t,e,i,s=!0,n=!1){if(n)throw t}(t,0,0,n,o)}var Le=[],Me=-1,De=[],Ae=null,Ie=0,We=Promise.resolve(),Fe=null;function ze(t){const e=Fe||We;return t?e.then(this?t.bind(this):t):e}function Ne(t){if(!(1&t.flags)){const e=Xe(t),i=Le[Le.length-1];!i||!(2&t.flags)&&e>=Xe(i)?Le.push(t):Le.splice(function(t){let e=Me+1,i=Le.length;for(;e<i;){const s=e+i>>>1,n=Le[s],r=Xe(n);r<t||r===t&&2&n.flags?e=s+1:i=s}return e}(e),0,t),t.flags|=1,Ve()}}function Ve(){Fe||(Fe=We.then(je))}function He(t,e,i=Me+1){for(;i<Le.length;i++){const e=Le[i];if(e&&2&e.flags){if(t&&e.id!==t.uid)continue;Le.splice(i,1),i--,4&e.flags&&(e.flags&=-2),e(),4&e.flags||(e.flags&=-2)}}}function Ye(t){if(De.length){const t=[...new Set(De)].sort((t,e)=>Xe(t)-Xe(e));if(De.length=0,Ae)return void Ae.push(...t);for(Ae=t,Ie=0;Ie<Ae.length;Ie++){const t=Ae[Ie];4&t.flags&&(t.flags&=-2),8&t.flags||t(),t.flags&=-2}Ae=null,Ie=0}}var Xe=t=>null==t.id?2&t.flags?-1:1/0:t.id;function je(t){try{for(Me=0;Me<Le.length;Me++){const t=Le[Me];!t||8&t.flags||(4&t.flags&&(t.flags&=-2),Re(t,t.i,t.i?15:14),4&t.flags||(t.flags&=-2))}}finally{for(;Me<Le.length;Me++){const t=Le[Me];t&&(t.flags&=-2)}Me=-1,Le.length=0,Ye(),Fe=null,(Le.length||De.length)&&je(t)}}var Ue=null,Ge=null;function Ke(t){const e=Ue;return Ue=t,Ge=t&&t.type.__scopeId||null,e}function Ze(t,e){if(null===Ue)return t;const s=mn(Ue),n=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[t,o,a,h=i]=e[r];t&&(_(t)&&(t={mounted:t,updated:t}),t.deep&&Te(o),n.push({dir:t,instance:s,value:o,oldValue:void 0,arg:a,modifiers:h}))}return t}function $e(t,e,i,s){const n=t.dirs,r=e&&e.dirs;for(let o=0;o<n.length;o++){const a=n[o];r&&(a.oldValue=r[o].value);let h=a.dir[s];h&&(mt(),Be(h,i,8,[t.el,a,t,e]),vt())}}function qe(t,e,i=!1){const s=an();if(s||qi){let n=qi?qi._context.provides:s?null==s.parent||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(n&&t in n)return n[t];if(arguments.length>1)return i&&_(e)?e.call(s&&s.proxy):e}}var Je=Symbol.for("v-scx");function Qe(t,e,i){return ti(t,e,i)}function ti(t,e,s=i){const{immediate:r,deep:o,flush:a,once:l}=s,c=h({},s),d=e&&r||!e&&"post"!==a;let u;if(pn)if("sync"===a){const t=qe(Je);u=t.__watcherHandles||(t.__watcherHandles=[])}else if(!d){const t=()=>{};return t.stop=n,t.resume=n,t.pause=n,t}const p=on;c.call=(t,e,i)=>Be(t,p,e,i);let g=!1;"post"===a?c.scheduler=t=>{bs(t,p&&p.suspense)}:"sync"!==a&&(g=!0,c.scheduler=(t,e)=>{e?t():Ne(t)}),c.augmentJob=t=>{e&&(t.flags|=4),g&&(t.flags|=2,p&&(t.id=p.uid,t.i=p))};const f=Oe(t,e,c);return pn&&(u?u.push(f):d&&f()),f}function ei(t,e,i){const s=this.proxy,n=m(t)?t.includes(".")?ii(s,t):()=>s[t]:t.bind(s,s);let r;_(e)?r=e:(r=e.handler,i=e);const o=hn(this),a=ti(n,r.bind(s),i);return o(),a}function ii(t,e){const i=e.split(".");return()=>{let e=t;for(let t=0;t<i.length&&e;t++)e=e[i[t]];return e}}var si=Symbol("_vte"),ni=Symbol("_leaveCb");function ri(t,e){6&t.shapeFlag&&t.component?(t.transition=e,ri(t.component.subTree,e)):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function oi(t,e){return _(t)?h({name:t.name},e,{setup:t}):t}function ai(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function hi(t,e){let i;return!(!(i=Object.getOwnPropertyDescriptor(t,e))||i.configurable)}var li=new WeakMap;function ci(t,e,s,n,o=!1){if(u(t))return void t.forEach((t,i)=>ci(t,e&&(u(e)?e[i]:e),s,n,o));if(ui(n)&&!o)return void(512&n.shapeFlag&&n.type.__asyncResolved&&n.component.subTree.component&&ci(t,e,s,n.component.subTree));const a=4&n.shapeFlag?mn(n.component):n.el,h=o?null:a,{i:c,r:p}=t,g=e&&e.r,f=c.refs===i?c.refs={}:c.refs,v=c.setupState,y=fe(v),w=v===i?r:t=>!hi(f,t)&&d(y,t),x=(t,e)=>!e||!hi(f,e);if(null!=g&&g!==p)if(di(e),m(g))f[g]=null,w(g)&&(v[g]=null);else if(ve(g)){const t=e;x(0,t.k)&&(g.value=null),t.k&&(f[t.k]=null)}if(_(p))Re(p,c,12,[h,f]);else{const e=m(p),i=ve(p);if(e||i){const n=()=>{if(t.f){const i=e?w(p)?v[p]:f[p]:x()||!t.k?p.value:f[t.k];if(o)u(i)&&l(i,a);else if(u(i))i.includes(a)||i.push(a);else if(e)f[p]=[a],w(p)&&(v[p]=f[p]);else{const e=[a];x(0,t.k)&&(p.value=e),t.k&&(f[t.k]=e)}}else e?(f[p]=h,w(p)&&(v[p]=h)):i&&(x(0,t.k)&&(p.value=h),t.k&&(f[t.k]=h))};if(h){const e=()=>{n(),li.delete(t)};e.id=-1,li.set(t,e),bs(e,s)}else di(t),n()}}}function di(t){const e=li.get(t);e&&(e.flags|=8,li.delete(t))}W().requestIdleCallback,W().cancelIdleCallback;var ui=t=>!!t.type.__asyncLoader,pi=t=>t.type.__isKeepAlive;function gi(t,e){_i(t,"a",e)}function fi(t,e){_i(t,"da",e)}function _i(t,e,i=on){const s=t.__wdc||(t.__wdc=()=>{let e=i;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(vi(e,s,i),i){let t=i.parent;for(;t&&t.parent;)pi(t.parent.vnode)&&mi(s,e,i,t),t=t.parent}}function mi(t,e,i,s){const n=vi(e,t,s,!0);Ei(()=>{l(s[e],n)},i)}function vi(t,e,i=on,s=!1){if(i){const n=i[t]||(i[t]=[]),r=e.__weh||(e.__weh=(...s)=>{mt();const n=hn(i),r=Be(e,i,t,s);return n(),vt(),r});return s?n.unshift(r):n.push(r),r}}var yi=t=>(e,i=on)=>{pn&&"sp"!==t||vi(t,(...t)=>e(...t),i)},wi=yi("bm"),xi=yi("m"),bi=yi("bu"),ki=yi("u"),Si=yi("bum"),Ei=yi("um"),Ci=yi("sp"),Oi=yi("rtg"),Ti=yi("rtc");function Ri(t,e=on){vi("ec",t,e)}var Bi=Symbol.for("v-ndc"),Pi=t=>t?cn(t)?mn(t):Pi(t.parent):null,Li=h(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Pi(t.parent),$root:t=>Pi(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Ni(t),$forceUpdate:t=>t.f||(t.f=()=>{Ne(t.update)}),$nextTick:t=>t.n||(t.n=ze.bind(t.proxy)),$watch:t=>ei.bind(t)}),Mi=(t,e)=>t!==i&&!t.__isScriptSetup&&d(t,e),Di={get({_:t},e){if("__v_skip"===e)return!0;const{ctx:s,setupState:n,data:r,props:o,accessCache:a,type:h,appContext:l}=t;if("$"!==e[0]){const t=a[e];if(void 0!==t)switch(t){case 1:return n[e];case 2:return r[e];case 4:return s[e];case 3:return o[e]}else{if(Mi(n,e))return a[e]=1,n[e];if(r!==i&&d(r,e))return a[e]=2,r[e];if(d(o,e))return a[e]=3,o[e];if(s!==i&&d(s,e))return a[e]=4,s[e];Ii&&(a[e]=0)}}const c=Li[e];let u,p;return c?("$attrs"===e&&Tt(t.attrs,0,""),c(t)):(u=h.__cssModules)&&(u=u[e])?u:s!==i&&d(s,e)?(a[e]=4,s[e]):(p=l.config.globalProperties,d(p,e)?p[e]:void 0)},set({_:t},e,s){const{data:n,setupState:r,ctx:o}=t;return Mi(r,e)?(r[e]=s,!0):n!==i&&d(n,e)?(n[e]=s,!0):!d(t.props,e)&&(("$"!==e[0]||!(e.slice(1)in t))&&(o[e]=s,!0))},has({_:{data:t,setupState:e,accessCache:s,ctx:n,appContext:r,props:o,type:a}},h){let l;return!!(s[h]||t!==i&&"$"!==h[0]&&d(t,h)||Mi(e,h)||d(o,h)||d(n,h)||d(Li,h)||d(r.config.globalProperties,h)||(l=a.__cssModules)&&l[h])},defineProperty(t,e,i){return null!=i.get?t._.accessCache[e]=0:d(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function Ai(t){return u(t)?t.reduce((t,e)=>(t[e]=null,t),{}):t}var Ii=!0;function Wi(t){const e=Ni(t),i=t.proxy,s=t.ctx;Ii=!1,e.beforeCreate&&Fi(e.beforeCreate,t,"bc");const{data:r,computed:o,methods:a,watch:h,provide:l,inject:c,created:d,beforeMount:p,mounted:g,beforeUpdate:f,updated:m,activated:v,deactivated:w,beforeDestroy:x,beforeUnmount:b,destroyed:k,unmounted:S,render:E,renderTracked:C,renderTriggered:O,errorCaptured:T,serverPrefetch:R,expose:B,inheritAttrs:P,components:L,directives:M,filters:D}=e;if(c&&function(t,e){u(t)&&(t=Xi(t));for(const i in t){const s=t[i];let n;n=y(s)?"default"in s?qe(s.from||i,s.default,!0):qe(s.from||i):qe(s),ve(n)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>n.value,set:t=>n.value=t}):e[i]=n}}(c,s,null),a)for(const n in a){const t=a[n];_(t)&&(s[n]=t.bind(i))}if(r){const e=r.call(i,i);y(e)&&(t.data=he(e))}if(Ii=!0,o)for(const u in o){const t=o[u],e=vn({get:_(t)?t.bind(i,i):_(t.get)?t.get.bind(i,i):n,set:!_(t)&&_(t.set)?t.set.bind(i):n});Object.defineProperty(s,u,{enumerable:!0,configurable:!0,get:()=>e.value,set:t=>e.value=t})}if(h)for(const n in h)zi(h[n],s,i,n);if(l){const t=_(l)?l.call(i):l;Reflect.ownKeys(t).forEach(e=>{!function(t,e){if(on){let i=on.provides;const s=on.parent&&on.parent.provides;s===i&&(i=on.provides=Object.create(s)),i[t]=e}}(e,t[e])})}function A(t,e){u(e)?e.forEach(e=>t(e.bind(i))):e&&t(e.bind(i))}if(d&&Fi(d,t,"c"),A(wi,p),A(xi,g),A(bi,f),A(ki,m),A(gi,v),A(fi,w),A(Ri,T),A(Ti,C),A(Oi,O),A(Si,b),A(Ei,S),A(Ci,R),u(B))if(B.length){const e=t.exposed||(t.exposed={});B.forEach(t=>{Object.defineProperty(e,t,{get:()=>i[t],set:e=>i[t]=e,enumerable:!0})})}else t.exposed||(t.exposed={});E&&t.render===n&&(t.render=E),null!=P&&(t.inheritAttrs=P),L&&(t.components=L),M&&(t.directives=M),R&&ai(t)}function Fi(t,e,i){Be(u(t)?t.map(t=>t.bind(e.proxy)):t.bind(e.proxy),e,i)}function zi(t,e,i,s){let n=s.includes(".")?ii(i,s):()=>i[s];if(m(t)){const i=e[t];_(i)&&Qe(n,i)}else if(_(t))Qe(n,t.bind(i));else if(y(t))if(u(t))t.forEach(t=>zi(t,e,i,s));else{const s=_(t.handler)?t.handler.bind(i):e[t.handler];_(s)&&Qe(n,s,t)}}function Ni(t){const e=t.type,{mixins:i,extends:s}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,a=r.get(e);let h;return a?h=a:n.length||i||s?(h={},n.length&&n.forEach(t=>Vi(h,t,o,!0)),Vi(h,e,o)):h=e,y(e)&&r.set(e,h),h}function Vi(t,e,i,s=!1){const{mixins:n,extends:r}=e;r&&Vi(t,r,i,!0),n&&n.forEach(e=>Vi(t,e,i,!0));for(const o in e)if(s&&"expose"===o);else{const s=Hi[o]||i&&i[o];t[o]=s?s(t[o],e[o]):e[o]}return t}var Hi={data:Yi,props:Gi,emits:Gi,methods:Ui,computed:Ui,beforeCreate:ji,created:ji,beforeMount:ji,mounted:ji,beforeUpdate:ji,updated:ji,beforeDestroy:ji,beforeUnmount:ji,destroyed:ji,unmounted:ji,activated:ji,deactivated:ji,errorCaptured:ji,serverPrefetch:ji,components:Ui,directives:Ui,watch:function(t,e){if(!t)return e;if(!e)return t;const i=h(Object.create(null),t);for(const s in e)i[s]=ji(t[s],e[s]);return i},provide:Yi,inject:function(t,e){return Ui(Xi(t),Xi(e))}};function Yi(t,e){return e?t?function(){return h(_(t)?t.call(this,this):t,_(e)?e.call(this,this):e)}:e:t}function Xi(t){if(u(t)){const e={};for(let i=0;i<t.length;i++)e[t[i]]=t[i];return e}return t}function ji(t,e){return t?[...new Set([].concat(t,e))]:e}function Ui(t,e){return t?h(Object.create(null),t,e):e}function Gi(t,e){return t?u(t)&&u(e)?[...new Set([...t,...e])]:h(Object.create(null),Ai(t),Ai(null!=e?e:{})):e}function Ki(){return{app:null,config:{isNativeTag:r,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Zi=0;function $i(t,e){return function(i,s=null){_(i)||(i=h({},i)),null==s||y(s)||(s=null);const n=Ki(),r=new WeakSet,o=[];let a=!1;const l=n.app={_uid:Zi++,_component:i,_props:s,_container:null,_context:n,_instance:null,version:yn,get config(){return n.config},set config(t){},use:(t,...e)=>(r.has(t)||(t&&_(t.install)?(r.add(t),t.install(l,...e)):_(t)&&(r.add(t),t(l,...e))),l),mixin:t=>(n.mixins.includes(t)||n.mixins.push(t),l),component:(t,e)=>e?(n.components[t]=e,l):n.components[t],directive:(t,e)=>e?(n.directives[t]=e,l):n.directives[t],mount(r,o,h){if(!a){const c=l._ceVNode||Gs(i,s);return c.appContext=n,!0===h?h="svg":!1===h&&(h=void 0),o&&e?e(c,r):t(c,r,h),a=!0,l._container=r,r.__vue_app__=l,mn(c.component)}},onUnmount(t){o.push(t)},unmount(){a&&(Be(o,l._instance,16),t(null,l._container),delete l._container.__vue_app__)},provide:(t,e)=>(n.provides[t]=e,l),runWithContext(t){const e=qi;qi=l;try{return t()}finally{qi=e}}};return l}}var qi=null;function Ji(t,e,...s){if(t.isUnmounted)return;const n=t.vnode.props||i;let r=s;const o=e.startsWith("update:"),a=o&&((t,e)=>"modelValue"===e||"model-value"===e?t.modelModifiers:t[`${e}Modifiers`]||t[`${T(e)}Modifiers`]||t[`${B(e)}Modifiers`])(n,e.slice(7));let h;a&&(a.trim&&(r=s.map(t=>m(t)?t.trim():t)),a.number&&(r=s.map(I)));let l=n[h=L(e)]||n[h=L(T(e))];!l&&o&&(l=n[h=L(B(e))]),l&&Be(l,t,6,r);const c=n[h+"Once"];if(c){if(t.emitted){if(t.emitted[h])return}else t.emitted={};t.emitted[h]=!0,Be(c,t,6,r)}}var Qi=new WeakMap;function ts(t,e,i=!1){const s=i?Qi:e.emitsCache,n=s.get(t);if(void 0!==n)return n;const r=t.emits;let o={},a=!1;if(!_(t)){const s=t=>{const i=ts(t,e,!0);i&&(a=!0,h(o,i))};!i&&e.mixins.length&&e.mixins.forEach(s),t.extends&&s(t.extends),t.mixins&&t.mixins.forEach(s)}return r||a?(u(r)?r.forEach(t=>o[t]=null):h(o,r),y(t)&&s.set(t,o),o):(y(t)&&s.set(t,null),null)}function es(t,e){return!(!t||!o(e))&&(e=e.slice(2).replace(/Once$/,""),d(t,e[0].toLowerCase()+e.slice(1))||d(t,B(e))||d(t,e))}function is(t){const{type:e,vnode:i,proxy:s,withProxy:n,propsOptions:[r],slots:o,attrs:h,emit:l,render:c,renderCache:d,props:u,data:p,setupState:g,ctx:f,inheritAttrs:_}=t,m=Ke(t);let v,y;try{if(4&i.shapeFlag){const t=n||s,e=t;v=qs(c.call(e,t,d,u,g,p,f)),y=h}else{const t=e;v=qs(t.length>1?t(u,{attrs:h,slots:o,emit:l}):t(u,null)),y=e.props?h:ss(h)}}catch(x){As.length=0,Pe(x,t,1),v=Gs(Ms)}let w=v;if(y&&!1!==_){const t=Object.keys(y),{shapeFlag:e}=w;t.length&&7&e&&(r&&t.some(a)&&(y=ns(y,r)),w=Ks(w,y,!1,!0))}return i.dirs&&(w=Ks(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(i.dirs):i.dirs),i.transition&&ri(w,i.transition),v=w,Ke(m),v}var ss=t=>{let e;for(const i in t)("class"===i||"style"===i||o(i))&&((e||(e={}))[i]=t[i]);return e},ns=(t,e)=>{const i={};for(const s in t)a(s)&&s.slice(9)in e||(i[s]=t[s]);return i};function rs(t,e,i){const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!0;for(let n=0;n<s.length;n++){const r=s[n];if(os(e,t,r)&&!es(i,r))return!0}return!1}function os(t,e,i){const s=t[i],n=e[i];return"style"===i&&y(s)&&y(n)?!G(s,n):s!==n}var as={},hs=()=>Object.create(as),ls=t=>Object.getPrototypeOf(t)===as;function cs(t,e,i,s=!1){const n={},r=hs();t.propsDefaults=Object.create(null),ds(t,e,n,r);for(const o in t.propsOptions[0])o in n||(n[o]=void 0);i?t.props=s?n:ce(n,!1,Kt,ee,ne):t.type.props?t.props=n:t.props=r,t.attrs=r}function ds(t,e,s,n){const[r,o]=t.propsOptions;let a,h=!1;if(e)for(let i in e){if(E(i))continue;const l=e[i];let c;r&&d(r,c=T(i))?o&&o.includes(c)?(a||(a={}))[c]=l:s[c]=l:es(t.emitsOptions,i)||i in n&&l===n[i]||(n[i]=l,h=!0)}if(o){const e=fe(s),n=a||i;for(let i=0;i<o.length;i++){const a=o[i];s[a]=us(r,e,a,n[a],t,!d(n,a))}}return h}function us(t,e,i,s,n,r){const o=t[i];if(null!=o){const t=d(o,"default");if(t&&void 0===s){const t=o.default;if(o.type!==Function&&!o.skipFactory&&_(t)){const{propsDefaults:r}=n;if(i in r)s=r[i];else{const o=hn(n);s=r[i]=t.call(null,e),o()}}else s=t;n.ce&&n.ce._setProp(i,s)}o[0]&&(r&&!t?s=!1:!o[1]||""!==s&&s!==B(i)||(s=!0))}return s}var ps=new WeakMap;function gs(t,e,n=!1){const r=n?ps:e.propsCache,o=r.get(t);if(o)return o;const a=t.props,l={},c=[];let p=!1;if(!_(t)){const i=t=>{p=!0;const[i,s]=gs(t,e,!0);h(l,i),s&&c.push(...s)};!n&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!a&&!p)return y(t)&&r.set(t,s),s;if(u(a))for(let s=0;s<a.length;s++){const t=T(a[s]);fs(t)&&(l[t]=i)}else if(a)for(const i in a){const t=T(i);if(fs(t)){const e=a[i],s=l[t]=u(e)||_(e)?{type:e}:h({},e),n=s.type;let r=!1,o=!0;if(u(n))for(let t=0;t<n.length;++t){const e=n[t],i=_(e)&&e.name;if("Boolean"===i){r=!0;break}"String"===i&&(o=!1)}else r=_(n)&&"Boolean"===n.name;s[0]=r,s[1]=o,(r||d(s,"default"))&&c.push(t)}}const g=[l,c];return y(t)&&r.set(t,g),g}function fs(t){return"$"!==t[0]&&!E(t)}var _s=t=>"_"===t||"_ctx"===t||"$stable"===t,ms=t=>u(t)?t.map(qs):[qs(t)],vs=(t,e,i)=>{if(e._n)return e;const s=function(t,e=Ue){if(!e)return t;if(t._n)return t;const i=(...s)=>{i._d&&zs(-1);const n=Ke(e);let r;try{r=t(...s)}finally{Ke(n),i._d&&zs(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}((...t)=>ms(e(...t)),i);return s._c=!1,s},ys=(t,e,i)=>{const s=t._ctx;for(const n in t){if(_s(n))continue;const i=t[n];if(_(i))e[n]=vs(0,i,s);else if(null!=i){const t=ms(i);e[n]=()=>t}}},ws=(t,e)=>{const i=ms(e);t.slots.default=()=>i},xs=(t,e,i)=>{for(const s in e)!i&&_s(s)||(t[s]=e[s])};var bs=function(t,e){e&&e.pendingBranch?u(t)?e.effects.push(...t):e.effects.push(t):(i=t,u(i)?De.push(...i):Ae&&-1===i.id?Ae.splice(Ie+1,0,i):1&i.flags||(De.push(i),i.flags|=1),Ve());var i};function ks(t){return function(t,e){W().__VUE__=!0;const{insert:r,remove:o,patchProp:a,createElement:h,createText:l,createComment:c,setText:u,setElementText:p,parentNode:g,nextSibling:f,setScopeId:_=n,insertStaticContent:m}=t,v=(t,e,i,s=null,n=null,r=null,o=void 0,a=null,h=!!e.dynamicChildren)=>{if(t===e)return;t&&!Ys(t,e)&&(s=Q(t),K(t,n,r,!0),t=null),-2===e.patchFlag&&(h=!1,e.dynamicChildren=null);const{type:l,ref:c,shapeFlag:d}=e;switch(l){case Ls:y(t,e,i,s);break;case Ms:x(t,e,i,s);break;case Ds:null==t&&b(e,i,s,o);break;case Ps:F(t,e,i,s,n,r,o,a,h);break;default:1&d?C(t,e,i,s,n,r,o,a,h):6&d?z(t,e,i,s,n,r,o,a,h):(64&d||128&d)&&l.process(t,e,i,s,n,r,o,a,h,st)}null!=c&&n?ci(c,t&&t.ref,r,e||t,!e):null==c&&t&&null!=t.ref&&ci(t.ref,null,r,t,!0)},y=(t,e,i,s)=>{if(null==t)r(e.el=l(e.children),i,s);else{const i=e.el=t.el;e.children!==t.children&&u(i,e.children)}},x=(t,e,i,s)=>{null==t?r(e.el=c(e.children||""),i,s):e.el=t.el},b=(t,e,i,s)=>{[t.el,t.anchor]=m(t.children,e,i,s,t.el,t.anchor)},k=({el:t,anchor:e},i,s)=>{let n;for(;t&&t!==e;)n=f(t),r(t,i,s),t=n;r(e,i,s)},S=({el:t,anchor:e})=>{let i;for(;t&&t!==e;)i=f(t),o(t),t=i;o(e)},C=(t,e,i,s,n,r,o,a,h)=>{if("svg"===e.type?o="svg":"math"===e.type&&(o="mathml"),null==t)O(e,i,s,n,r,o,a,h);else{const i=t.el&&t.el._isVueCE?t.el:null;try{i&&i._beginPatch(),L(t,e,n,r,o,a,h)}finally{i&&i._endPatch()}}},O=(t,e,i,s,n,o,l,c)=>{let d,u;const{props:g,shapeFlag:f,transition:_,dirs:m}=t;if(d=t.el=h(t.type,o,g&&g.is,g),8&f?p(d,t.children):16&f&&P(t.children,d,null,s,n,Ss(t,o),l,c),m&&$e(t,null,s,"created"),R(d,t,t.scopeId,l,s),g){for(const t in g)"value"===t||E(t)||a(d,t,null,g[t],o,s);"value"in g&&a(d,"value",null,g.value,o),(u=g.onVnodeBeforeMount)&&tn(u,s,t)}m&&$e(t,null,s,"beforeMount");const v=function(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}(n,_);v&&_.beforeEnter(d),r(d,e,i),((u=g&&g.onVnodeMounted)||v||m)&&bs(()=>{try{u&&tn(u,s,t),v&&_.enter(d),m&&$e(t,null,s,"mounted")}finally{}},n)},R=(t,e,i,s,n)=>{if(i&&_(t,i),s)for(let r=0;r<s.length;r++)_(t,s[r]);if(n){let i=n.subTree;if(e===i||Bs(i.type)&&(i.ssContent===e||i.ssFallback===e)){const e=n.vnode;R(t,e,e.scopeId,e.slotScopeIds,n.parent)}}},P=(t,e,i,s,n,r,o,a,h=0)=>{for(let l=h;l<t.length;l++)v(null,t[l]=a?Js(t[l]):qs(t[l]),e,i,s,n,r,o,a)},L=(t,e,s,n,r,o,h)=>{const l=e.el=t.el;let{patchFlag:c,dynamicChildren:d,dirs:u}=e;c|=16&t.patchFlag;const g=t.props||i,f=e.props||i;let _;if(s&&Es(s,!1),(_=f.onVnodeBeforeUpdate)&&tn(_,s,e,t),u&&$e(e,t,s,"beforeUpdate"),s&&Es(s,!0),(g.innerHTML&&null==f.innerHTML||g.textContent&&null==f.textContent)&&p(l,""),d?M(t.dynamicChildren,d,l,s,n,Ss(e,r),o):h||X(t,e,l,null,s,n,Ss(e,r),o,!1),c>0){if(16&c)I(l,g,f,s,r);else if(2&c&&g.class!==f.class&&a(l,"class",null,f.class,r),4&c&&a(l,"style",g.style,f.style,r),8&c){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e],n=g[i],o=f[i];o===n&&"value"!==i||a(l,i,n,o,r,s)}}1&c&&t.children!==e.children&&p(l,e.children)}else h||null!=d||I(l,g,f,s,r);((_=f.onVnodeUpdated)||u)&&bs(()=>{_&&tn(_,s,e,t),u&&$e(e,t,s,"updated")},n)},M=(t,e,i,s,n,r,o)=>{for(let a=0;a<e.length;a++){const h=t[a],l=e[a];v(h,l,h.el&&(h.type===Ps||!Ys(h,l)||198&h.shapeFlag)?g(h.el):i,null,s,n,r,o,!0)}},I=(t,e,s,n,r)=>{if(e!==s){if(e!==i)for(const i in e)E(i)||i in s||a(t,i,e[i],null,r,n);for(const i in s){if(E(i))continue;const o=s[i],h=e[i];o!==h&&"value"!==i&&a(t,i,h,o,r,n)}"value"in s&&a(t,"value",e.value,s.value,r)}},F=(t,e,i,s,n,o,a,h,c)=>{const d=e.el=t?t.el:l(""),u=e.anchor=t?t.anchor:l("");let{patchFlag:p,dynamicChildren:g,slotScopeIds:f}=e;f&&(h=h?h.concat(f):f),null==t?(r(d,i,s),r(u,i,s),P(e.children||[],i,u,n,o,a,h,c)):p>0&&64&p&&g&&t.dynamicChildren&&t.dynamicChildren.length===g.length?(M(t.dynamicChildren,g,i,n,o,a,h),(null!=e.key||n&&e===n.subTree)&&Cs(t,e,!0)):X(t,e,i,u,n,o,a,h,c)},z=(t,e,i,s,n,r,o,a,h)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?n.ctx.activate(e,i,s,o,h):N(e,i,s,n,r,o,h):V(t,e,h)},N=(t,e,s,n,r,o,a)=>{const h=t.component=function(t,e,s){const n=t.type,r=(e?e.appContext:t.appContext)||en,o={uid:sn++,vnode:t,type:n,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new tt(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:gs(n,r),emitsOptions:ts(n,r),emit:null,emitted:null,propsDefaults:i,inheritAttrs:n.inheritAttrs,ctx:i,data:i,props:i,attrs:i,slots:i,refs:i,setupState:i,setupContext:null,suspense:s,suspenseId:s?s.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};o.ctx={_:o},o.root=e?e.root:o,o.emit=Ji.bind(null,o),t.ce&&t.ce(o);return o}(t,n,r);if(pi(t)&&(h.ctx.renderer=st),function(t,e=!1,i=!1){e&&rn(e);const{props:s,children:n}=t.vnode,r=cn(t);cs(t,s,r,e),((t,e,i)=>{const s=t.slots=hs();if(32&t.vnode.shapeFlag){const t=e._;t?(xs(s,e,i),i&&A(s,"_",t,!0)):ys(e,s)}else e&&ws(t,e)})(t,n,i||e);const o=r?function(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Di);const{setup:s}=i;if(s){mt();const i=t.setupContext=s.length>1?function(t){const e=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,_n),slots:t.slots,emit:t.emit,expose:e}}(t):null,n=hn(t),r=Re(s,t,0,[t.props,i]),o=w(r);if(vt(),n(),!o&&!t.sp||ui(t)||ai(t),o){if(r.then(ln,ln),e)return r.then(i=>{gn(t,i,e)}).catch(e=>{Pe(e,t,0)});t.asyncDep=r}else gn(t,r,e)}else fn(t,e)}(t,e):void 0;e&&rn(!1)}(h,!1,a),h.asyncDep){if(r&&r.registerDep(h,H,a),!t.el){const i=h.subTree=Gs(Ms);x(null,i,e,s),t.placeholder=i.el}}else H(h,t,e,s,r,o,a)},V=(t,e,i)=>{const s=e.component=t.component;if(function(t,e,i){const{props:s,children:n,component:r}=t,{props:o,children:a,patchFlag:h}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(!(i&&h>=0))return!(!n&&!a||a&&a.$stable)||s!==o&&(s?!o||rs(s,o,l):!!o);if(1024&h)return!0;if(16&h)return s?rs(s,o,l):!!o;if(8&h){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e];if(os(o,s,i)&&!es(l,i))return!0}}return!1}(t,e,i)){if(s.asyncDep&&!s.asyncResolved)return void Y(s,e,i);s.next=e,s.update()}else e.el=t.el,s.vnode=e},H=(t,e,i,s,n,r,o)=>{const a=()=>{if(t.isMounted){let{next:e,bu:i,u:s,parent:a,vnode:h}=t;{const i=Os(t);if(i)return e&&(e.el=h.el,Y(t,e,o)),void i.asyncDep.then(()=>{bs(()=>{t.isUnmounted||l()},n)})}let c,d=e;Es(t,!1),e?(e.el=h.el,Y(t,e,o)):e=h,i&&D(i),(c=e.props&&e.props.onVnodeBeforeUpdate)&&tn(c,a,e,h),Es(t,!0);const u=is(t),p=t.subTree;t.subTree=u,v(p,u,g(p.el),Q(p),t,n,r),e.el=u.el,null===d&&function({vnode:t,parent:e,suspense:i},s){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===t&&(i.suspense.vnode.el=i.el=s,t=i),i!==t)break;(t=e.vnode).el=s,e=e.parent}i&&i.activeBranch===t&&(i.vnode.el=s)}(t,u.el),s&&bs(s,n),(c=e.props&&e.props.onVnodeUpdated)&&bs(()=>tn(c,a,e,h),n)}else{let o;const{el:a,props:h}=e,{bm:l,m:c,parent:d,root:u,type:p}=t,g=ui(e);if(Es(t,!1),l&&D(l),!g&&(o=h&&h.onVnodeBeforeMount)&&tn(o,d,e),Es(t,!0),a&&ot){const e=()=>{t.subTree=is(t),ot(a,t.subTree,t,n,null)};g&&p.__asyncHydrate?p.__asyncHydrate(a,t,e):e()}else{u.ce&&u.ce._hasShadowRoot()&&u.ce._injectChildStyle(p,t.parent?t.parent.type:void 0);const o=t.subTree=is(t);v(null,o,i,s,t,n,r),e.el=o.el}if(c&&bs(c,n),!g&&(o=h&&h.onVnodeMounted)){const t=e;bs(()=>tn(o,d,t),n)}(256&e.shapeFlag||d&&ui(d.vnode)&&256&d.vnode.shapeFlag)&&t.a&&bs(t.a,n),t.isMounted=!0,e=i=s=null}};t.scope.on();const h=t.effect=new nt(a);t.scope.off();const l=t.update=h.run.bind(h),c=t.job=h.runIfDirty.bind(h);c.i=t,c.id=t.uid,h.scheduler=()=>Ne(c),Es(t,!0),l()},Y=(t,e,s)=>{e.component=t;const n=t.vnode.props;t.vnode=e,t.next=null,function(t,e,i,s){const{props:n,attrs:r,vnode:{patchFlag:o}}=t,a=fe(n),[h]=t.propsOptions;let l=!1;if(!(s||o>0)||16&o){let s;ds(t,e,n,r)&&(l=!0);for(const r in a)e&&(d(e,r)||(s=B(r))!==r&&d(e,s))||(h?!i||void 0===i[r]&&void 0===i[s]||(n[r]=us(h,a,r,void 0,t,!0)):delete n[r]);if(r!==a)for(const t in r)e&&d(e,t)||(delete r[t],l=!0)}else if(8&o){const i=t.vnode.dynamicProps;for(let s=0;s<i.length;s++){let o=i[s];if(es(t.emitsOptions,o))continue;const c=e[o];if(h)if(d(r,o))c!==r[o]&&(r[o]=c,l=!0);else{const e=T(o);n[e]=us(h,a,e,c,t,!1)}else c!==r[o]&&(r[o]=c,l=!0)}}l&&Rt(t.attrs,"set","")}(t,e.props,n,s),((t,e,s)=>{const{vnode:n,slots:r}=t;let o=!0,a=i;if(32&n.shapeFlag){const t=e._;t?s&&1===t?o=!1:xs(r,e,s):(o=!e.$stable,ys(e,r)),a=e}else e&&(ws(t,e),a={default:1});if(o)for(const i in r)_s(i)||null!=a[i]||delete r[i]})(t,e.children,s),mt(),He(t),vt()},X=(t,e,i,s,n,r,o,a,h=!1)=>{const l=t&&t.children,c=t?t.shapeFlag:0,d=e.children,{patchFlag:u,shapeFlag:g}=e;if(u>0){if(128&u)return void U(l,d,i,s,n,r,o,a,h);if(256&u)return void j(l,d,i,s,n,r,o,a,h)}8&g?(16&c&&J(l,n,r),d!==l&&p(i,d)):16&c?16&g?U(l,d,i,s,n,r,o,a,h):J(l,n,r,!0):(8&c&&p(i,""),16&g&&P(d,i,s,n,r,o,a,h))},j=(t,e,i,n,r,o,a,h,l)=>{e=e||s;const c=(t=t||s).length,d=e.length,u=Math.min(c,d);let p;for(p=0;p<u;p++){const s=e[p]=l?Js(e[p]):qs(e[p]);v(t[p],s,i,null,r,o,a,h,l)}c>d?J(t,r,o,!0,!1,u):P(e,i,n,r,o,a,h,l,u)},U=(t,e,i,n,r,o,a,h,l)=>{let c=0;const d=e.length;let u=t.length-1,p=d-1;for(;c<=u&&c<=p;){const s=t[c],n=e[c]=l?Js(e[c]):qs(e[c]);if(!Ys(s,n))break;v(s,n,i,null,r,o,a,h,l),c++}for(;c<=u&&c<=p;){const s=t[u],n=e[p]=l?Js(e[p]):qs(e[p]);if(!Ys(s,n))break;v(s,n,i,null,r,o,a,h,l),u--,p--}if(c>u){if(c<=p){const t=p+1,s=t<d?e[t].el:n;for(;c<=p;)v(null,e[c]=l?Js(e[c]):qs(e[c]),i,s,r,o,a,h,l),c++}}else if(c>p)for(;c<=u;)K(t[c],r,o,!0),c++;else{const g=c,f=c,_=new Map;for(c=f;c<=p;c++){const t=e[c]=l?Js(e[c]):qs(e[c]);null!=t.key&&_.set(t.key,c)}let m,y=0;const w=p-f+1;let x=!1,b=0;const k=new Array(w);for(c=0;c<w;c++)k[c]=0;for(c=g;c<=u;c++){const s=t[c];if(y>=w){K(s,r,o,!0);continue}let n;if(null!=s.key)n=_.get(s.key);else for(m=f;m<=p;m++)if(0===k[m-f]&&Ys(s,e[m])){n=m;break}void 0===n?K(s,r,o,!0):(k[n-f]=c+1,n>=b?b=n:x=!0,v(s,e[n],i,null,r,o,a,h,l),y++)}const S=x?function(t){const e=t.slice(),i=[0];let s,n,r,o,a;const h=t.length;for(s=0;s<h;s++){const h=t[s];if(0!==h){if(n=i[i.length-1],t[n]<h){e[s]=n,i.push(s);continue}for(r=0,o=i.length-1;r<o;)a=r+o>>1,t[i[a]]<h?r=a+1:o=a;h<t[i[r]]&&(r>0&&(e[s]=i[r-1]),i[r]=s)}}r=i.length,o=i[r-1];for(;r-- >0;)i[r]=o,o=e[o];return i}(k):s;for(m=S.length-1,c=w-1;c>=0;c--){const t=f+c,s=e[t],u=e[t+1],p=t+1<d?u.el||Rs(u):n;0===k[c]?v(null,s,i,p,r,o,a,h,l):x&&(m<0||c!==S[m]?G(s,i,p,2):m--)}}},G=(t,e,i,s,n=null)=>{const{el:a,type:h,transition:l,children:c,shapeFlag:d}=t;if(6&d)G(t.component.subTree,e,i,s);else if(128&d)t.suspense.move(e,i,s);else if(64&d)h.move(t,e,i,st);else if(h!==Ps)if(h!==Ds)if(2!==s&&1&d&&l)if(0===s)l.beforeEnter(a),r(a,e,i),bs(()=>l.enter(a),n);else{const{leave:s,delayLeave:n,afterLeave:h}=l,c=()=>{t.ctx.isUnmounted?o(a):r(a,e,i)},d=()=>{a._isLeaving&&a[ni](!0),s(a,()=>{c(),h&&h()})};n?n(a,c,d):d()}else r(a,e,i);else k(t,e,i);else{r(a,e,i);for(let t=0;t<c.length;t++)G(c[t],e,i,s);r(t.anchor,e,i)}},K=(t,e,i,s=!1,n=!1)=>{const{type:r,props:o,ref:a,children:h,dynamicChildren:l,shapeFlag:c,patchFlag:d,dirs:u,cacheIndex:p,memo:g}=t;if(-2===d&&(n=!1),null!=a&&(mt(),ci(a,null,i,t,!0),vt()),null!=p&&(e.renderCache[p]=void 0),256&c)return void e.ctx.deactivate(t);const f=1&c&&u,_=!ui(t);let m;if(_&&(m=o&&o.onVnodeBeforeUnmount)&&tn(m,e,t),6&c)q(t.component,i,s);else{if(128&c)return void t.suspense.unmount(i,s);f&&$e(t,null,e,"beforeUnmount"),64&c?t.type.remove(t,e,i,st,s):l&&!l.hasOnce&&(r!==Ps||d>0&&64&d)?J(l,e,i,!1,!0):(r===Ps&&384&d||!n&&16&c)&&J(h,e,i),s&&Z(t)}const v=null!=g&&null==p;(_&&(m=o&&o.onVnodeUnmounted)||f||v)&&bs(()=>{m&&tn(m,e,t),f&&$e(t,null,e,"unmounted"),v&&(t.el=null)},i)},Z=t=>{const{type:e,el:i,anchor:s,transition:n}=t;if(e===Ps)return void $(i,s);if(e===Ds)return void S(t);const r=()=>{o(i),n&&!n.persisted&&n.afterLeave&&n.afterLeave()};if(1&t.shapeFlag&&n&&!n.persisted){const{leave:e,delayLeave:s}=n,o=()=>e(i,r);s?s(t.el,r,o):o()}else r()},$=(t,e)=>{let i;for(;t!==e;)i=f(t),o(t),t=i;o(e)},q=(t,e,i)=>{const{bum:s,scope:n,job:r,subTree:o,um:a,m:h,a:l}=t;Ts(h),Ts(l),s&&D(s),n.stop(),r&&(r.flags|=8,K(o,t,e,i)),a&&bs(a,e),bs(()=>{t.isUnmounted=!0},e)},J=(t,e,i,s=!1,n=!1,r=0)=>{for(let o=r;o<t.length;o++)K(t[o],e,i,s,n)},Q=t=>{if(6&t.shapeFlag)return Q(t.component.subTree);if(128&t.shapeFlag)return t.suspense.next();const e=f(t.anchor||t.el),i=e&&e[si];return i?f(i):e};let et=!1;const it=(t,e,i)=>{let s;null==t?e._vnode&&(K(e._vnode,null,null,!0),s=e._vnode.component):v(e._vnode||null,t,e,null,null,null,i),e._vnode=t,et||(et=!0,He(s),Ye(),et=!1)},st={p:v,um:K,m:G,r:Z,mt:N,mc:P,pc:X,pbc:M,n:Q,o:t};let rt,ot;e&&([rt,ot]=e(st));return{render:it,hydrate:rt,createApp:$i(it,rt)}}(t)}function Ss({type:t,props:e},i){return"svg"===i&&"foreignObject"===t||"mathml"===i&&"annotation-xml"===t&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function Es({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Cs(t,e,i=!1){const s=t.children,n=e.children;if(u(s)&&u(n))for(let r=0;r<s.length;r++){const t=s[r];let e=n[r];1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e=n[r]=Js(n[r]),e.el=t.el),i||-2===e.patchFlag||Cs(t,e)),e.type===Ls&&(-1===e.patchFlag&&(e=n[r]=Js(e)),e.el=t.el),e.type!==Ms||e.el||(e.el=t.el)}}function Os(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Os(e)}function Ts(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function Rs(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?Rs(e.subTree):null}var Bs=t=>t.__isSuspense;var Ps=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),Ms=Symbol.for("v-cmt"),Ds=Symbol.for("v-stc"),As=[],Is=null;function Ws(t=!1){As.push(Is=t?null:[])}var Fs=1;function zs(t,e=!1){Fs+=t,t<0&&Is&&e&&(Is.hasOnce=!0)}function Ns(t){return t.dynamicChildren=Fs>0?Is||s:null,As.pop(),Is=As[As.length-1]||null,Fs>0&&Is&&Is.push(t),t}function Vs(t,e,i,s,n,r){return Ns(Us(t,e,i,s,n,r,!0))}function Hs(t){return!!t&&!0===t.__v_isVNode}function Ys(t,e){return t.type===e.type&&t.key===e.key}var Xs=({key:t})=>null!=t?t:null,js=({ref:t,ref_key:e,ref_for:i})=>("number"==typeof t&&(t=""+t),null!=t?m(t)||ve(t)||_(t)?{i:Ue,r:t,k:e,f:!!i}:t:null);function Us(t,e=null,i=null,s=0,n=null,r=(t===Ps?0:1),o=!1,a=!1){const h={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Xs(e),ref:e&&js(e),scopeId:Ge,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ue};return a?(Qs(h,i),128&r&&t.normalize(h)):i&&(h.shapeFlag|=m(i)?8:16),Fs>0&&!o&&Is&&(h.patchFlag>0||6&r)&&32!==h.patchFlag&&Is.push(h),h}var Gs=function(t,e=null,i=null,s=0,n=null,r=!1){t&&t!==Bi||(t=Ms);if(Hs(t)){const s=Ks(t,e,!0);return i&&Qs(s,i),Fs>0&&!r&&Is&&(6&s.shapeFlag?Is[Is.indexOf(t)]=s:Is.push(s)),s.patchFlag=-2,s}o=t,_(o)&&"__vccOpts"in o&&(t=t.__vccOpts);var o;if(e){e=function(t){return t?ge(t)||ls(t)?h({},t):t:null}(e);let{class:t,style:i}=e;t&&!m(t)&&(e.class=Y(t)),y(i)&&(ge(i)&&!u(i)&&(i=h({},i)),e.style=F(i))}const a=m(t)?1:Bs(t)?128:(t=>t.__isTeleport)(t)?64:y(t)?4:_(t)?2:0;return Us(t,e,i,s,n,a,r,!0)};function Ks(t,e,i=!1,s=!1){const{props:n,ref:r,patchFlag:h,children:l,transition:c}=t,d=e?function(...t){const e={};for(let i=0;i<t.length;i++){const s=t[i];for(const t in s)if("class"===t)e.class!==s.class&&(e.class=Y([e.class,s.class]));else if("style"===t)e.style=F([e.style,s.style]);else if(o(t)){const i=e[t],n=s[t];!n||i===n||u(i)&&i.includes(n)?null!=n||null!=i||a(t)||(e[t]=n):e[t]=i?[].concat(i,n):n}else""!==t&&(e[t]=s[t])}return e}(n||{},e):n,p={__v_isVNode:!0,__v_skip:!0,type:t.type,props:d,key:d&&Xs(d),ref:e&&e.ref?i&&r?u(r)?r.concat(js(e)):[r,js(e)]:js(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Ps?-1===h?16:16|h:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ks(t.ssContent),ssFallback:t.ssFallback&&Ks(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&s&&ri(p,c.clone(p)),p}function Zs(t=" ",e=0){return Gs(Ls,null,t,e)}function $s(t="",e=!1){return e?(Ws(),Ns(Gs(Ms,null,t,i,s,!0))):Gs(Ms,null,t);var i,s}function qs(t){return null==t||"boolean"==typeof t?Gs(Ms):u(t)?Gs(Ps,null,t.slice()):Hs(t)?Js(t):Gs(Ls,null,String(t))}function Js(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:Ks(t)}function Qs(t,e){let i=0;const{shapeFlag:s}=t;if(null==e)e=null;else if(u(e))i=16;else if("object"==typeof e){if(65&s){const i=e.default;return void(i&&(i._c&&(i._d=!1),Qs(t,i()),i._c&&(i._d=!0)))}{i=32;const s=e._;s||ls(e)?3===s&&Ue&&(1===Ue.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=Ue}}else _(e)?(e={default:e,_ctx:Ue},i=32):(e=String(e),64&s?(i=16,e=[Zs(e)]):i=8);t.children=e,t.shapeFlag|=i}function tn(t,e,i,s=null){Be(t,e,7,[i,s])}var en=Ki(),sn=0;var nn,rn,on=null,an=()=>on||Ue;{const t=W(),e=(e,i)=>{let s;return(s=t[e])||(s=t[e]=[]),s.push(i),t=>{s.length>1?s.forEach(e=>e(t)):s[0](t)}};nn=e("__VUE_INSTANCE_SETTERS__",t=>on=t),rn=e("__VUE_SSR_SETTERS__",t=>pn=t)}var hn=t=>{const e=on;return nn(t),t.scope.on(),()=>{t.scope.off(),nn(e)}},ln=()=>{on&&on.scope.off(),nn(null)};function cn(t){return 4&t.vnode.shapeFlag}var dn,un,pn=!1;function gn(t,e,i){_(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:y(e)&&(t.setupState=be(e)),fn(t,i)}function fn(t,e,i){const s=t.type;if(!t.render){if(!e&&dn&&!s.render){const e=s.template||Ni(t).template;if(e){const{isCustomElement:i,compilerOptions:n}=t.appContext.config,{delimiters:r,compilerOptions:o}=s,a=h(h({isCustomElement:i,delimiters:r},n),o);s.render=dn(e,a)}}t.render=s.render||n,un&&un(t)}{const e=hn(t);mt();try{Wi(t)}finally{vt(),e()}}}var _n={get:(t,e)=>(Tt(t,0,""),t[e])};function mn(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(be((e=t.exposed,!d(e,"__v_skip")&&Object.isExtensible(e)&&A(e,"__v_skip",!0),e)),{get:(e,i)=>i in e?e[i]:i in Li?Li[i](t):void 0,has:(t,e)=>e in t||e in Li})):t.proxy;var e}var vn=(t,e)=>function(t,e,i=!1){let s,n;return _(t)?s=t:(s=t.get,n=t.set),new ke(s,n,i)}(t,0,pn),yn="3.5.33",wn=void 0,xn="undefined"!=typeof window&&window.trustedTypes;if(xn)try{wn=xn.createPolicy("vue",{createHTML:t=>t})}catch(xb){}var bn=wn?t=>wn.createHTML(t):t=>t,kn="undefined"!=typeof document?document:null,Sn=kn&&kn.createElement("template"),En={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,s)=>{const n="svg"===e?kn.createElementNS("http://www.w3.org/2000/svg",t):"mathml"===e?kn.createElementNS("http://www.w3.org/1998/Math/MathML",t):i?kn.createElement(t,{is:i}):kn.createElement(t);return"select"===t&&s&&null!=s.multiple&&n.setAttribute("multiple",s.multiple),n},createText:t=>kn.createTextNode(t),createComment:t=>kn.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>kn.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,s,n,r){const o=i?i.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),n!==r&&(n=n.nextSibling););else{Sn.innerHTML=bn("svg"===s?`<svg>${t}</svg>`:"mathml"===s?`<math>${t}</math>`:t);const n=Sn.content;if("svg"===s||"mathml"===s){const t=n.firstChild;for(;t.firstChild;)n.appendChild(t.firstChild);n.removeChild(t)}e.insertBefore(n,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Cn=Symbol("_vtc");var On=Symbol("_vod"),Tn=Symbol("_vsh"),Rn=Symbol(""),Bn=/(?:^|;)\s*display\s*:/;var Pn=/\s*!important$/;function Ln(t,e,i){if(u(i))i.forEach(i=>Ln(t,e,i));else if(null==i&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const s=function(t,e){const i=Dn[e];if(i)return i;let s=T(e);if("filter"!==s&&s in t)return Dn[e]=s;s=P(s);for(let n=0;n<Mn.length;n++){const i=Mn[n]+s;if(i in t)return Dn[e]=i}return e}(t,e);Pn.test(i)?t.setProperty(B(s),i.replace(Pn,""),"important"):t[s]=i}}var Mn=["Webkit","Moz","ms"],Dn={};function An(t,e,i,s){return"TEXTAREA"===t.tagName&&("width"===e||"height"===e)&&m(s)&&i===s}var In="http://www.w3.org/1999/xlink";function Wn(t,e,i,s,n,r=j(e)){s&&e.startsWith("xlink:")?null==i?t.removeAttributeNS(In,e.slice(6,e.length)):t.setAttributeNS(In,e,i):null==i||r&&!U(i)?t.removeAttribute(e):t.setAttribute(e,r?"":v(i)?String(i):i)}function Fn(t,e,i,s,n){if("innerHTML"===e||"textContent"===e)return void(null!=i&&(t[e]="innerHTML"===e?bn(i):i));const r=t.tagName;if("value"===e&&"PROGRESS"!==r&&!r.includes("-")){const s="OPTION"===r?t.getAttribute("value")||"":t.value,n=null==i?"checkbox"===t.type?"on":"":String(i);return s===n&&"_value"in t||(t.value=n),null==i&&t.removeAttribute(e),void(t._value=i)}let o=!1;if(""===i||null==i){const s=typeof t[e];"boolean"===s?i=U(i):null==i&&"string"===s?(i="",o=!0):"number"===s&&(i=0,o=!0)}try{t[e]=i}catch(xb){}o&&t.removeAttribute(n||e)}function zn(t,e,i,s){t.addEventListener(e,i,s)}var Nn=Symbol("_vei");function Vn(t,e,i,s,n=null){const r=t[Nn]||(t[Nn]={}),o=r[e];if(s&&o)o.value=s;else{const[i,a]=function(t){let e;if(Hn.test(t)){let i;for(e={};i=t.match(Hn);)t=t.slice(0,t.length-i[0].length),e[i[0].toLowerCase()]=!0}return[":"===t[2]?t.slice(3):B(t.slice(2)),e]}(e);s?zn(t,i,r[e]=function(t,e){const i=t=>{if(t._vts){if(t._vts<=i.attached)return}else t._vts=Date.now();Be(function(t,e){if(u(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(t=>e=>!e._stopped&&t&&t(e))}return e}(t,i.value),e,5,[t])};return i.value=t,i.attached=jn(),i}(s,n),a):o&&(!function(t,e,i,s){t.removeEventListener(e,i,s)}(t,i,o,a),r[e]=void 0)}}var Hn=/(?:Once|Passive|Capture)$/;var Yn=0,Xn=Promise.resolve(),jn=()=>Yn||(Xn.then(()=>Yn=0),Yn=Date.now());var Un=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123;var Gn=t=>{const e=t.props["onUpdate:modelValue"]||!1;return u(e)?t=>D(e,t):e};function Kn(t){t.target.composing=!0}function Zn(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}var $n=Symbol("_assign");function qn(t,e,i){return e&&(t=t.trim()),i&&(t=I(t)),t}var Jn,Qn={created(t,{modifiers:{lazy:e,trim:i,number:s}},n){t[$n]=Gn(n);const r=s||n.props&&"number"===n.props.type;zn(t,e?"change":"input",e=>{e.target.composing||t[$n](qn(t.value,i,r))}),(i||r)&&zn(t,"change",()=>{t.value=qn(t.value,i,r)}),e||(zn(t,"compositionstart",Kn),zn(t,"compositionend",Zn),zn(t,"change",Zn))},mounted(t,{value:e}){t.value=null==e?"":e},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:s,trim:n,number:r}},o){if(t[$n]=Gn(o),t.composing)return;const a=null==e?"":e;if((!r&&"number"!==t.type||/^0\d/.test(t.value)?t.value:I(t.value))===a)return;const h=t.getRootNode();if((h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===t&&"range"!==t.type){if(s&&e===i)return;if(n&&t.value.trim()===a)return}t.value=a}},tr=h({patchProp:(t,e,i,s,n,r)=>{const h="svg"===n;"class"===e?function(t,e,i){const s=t[Cn];s&&(e=(e?[e,...s]:[...s]).join(" ")),null==e?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}(t,s,h):"style"===e?function(t,e,i){const s=t.style,n=m(i);let r=!1;if(i&&!n){if(e)if(m(e))for(const t of e.split(";")){const e=t.slice(0,t.indexOf(":")).trim();null==i[e]&&Ln(s,e,"")}else for(const t in e)null==i[t]&&Ln(s,t,"");for(const n in i){"display"===n&&(r=!0);const o=i[n];null!=o?An(t,n,!m(e)&&e?e[n]:void 0,o)||Ln(s,n,o):Ln(s,n,"")}}else if(n){if(e!==i){const t=s[Rn];t&&(i+=";"+t),s.cssText=i,r=Bn.test(i)}}else e&&t.removeAttribute("style");On in t&&(t[On]=r?s.display:"",t[Tn]&&(s.display="none"))}(t,i,s):o(e)?a(e)||Vn(t,e,0,s,r):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,i,s){if(s)return"innerHTML"===e||"textContent"===e||!!(e in t&&Un(e)&&_(i));if("spellcheck"===e||"draggable"===e||"translate"===e||"autocorrect"===e)return!1;if("sandbox"===e&&"IFRAME"===t.tagName)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if("width"===e||"height"===e){const e=t.tagName;if("IMG"===e||"VIDEO"===e||"CANVAS"===e||"SOURCE"===e)return!1}return(!Un(e)||!m(i))&&e in t}(t,e,s,h))?(Fn(t,e,s),t.tagName.includes("-")||"value"!==e&&"checked"!==e&&"selected"!==e||Wn(t,e,s,h,0,"value"!==e)):t._isVueCE&&(function(t,e){const i=t._def.props;if(!i)return!1;const s=T(e);return Array.isArray(i)?i.some(t=>T(t)===s):Object.keys(i).some(t=>T(t)===s)}(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!m(s)))?Fn(t,T(e),s,0,e):("true-value"===e?t._trueValue=s:"false-value"===e&&(t._falseValue=s),Wn(t,e,s,h))}},En);var er;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(er||(er={}));var ir={};function sr(t){return void 0===t}function nr(t){return null==t}function rr(t){return"string"==typeof t}var{isFinite:or}=Number;function ar(t){return"number"==typeof t}var{isArray:hr}=Array;function lr(t){return t&&"object"==typeof t}var cr,dr,ur,pr={default:(t,e)=>(gr(e,t),gr(t,e),t),assign(t,e,i){let s;Object.keys(e).forEach(n=>{var r,o;if(s=e[n],(null==s?void 0:s.constructor)===Object&&(null===(r=t[n])||void 0===r?void 0:r.constructor)===Object)return gr(t[n],e[n],i&&i[n]);i&&n in i?(null===(o=i[n])||void 0===o?void 0:o.constructor)===Object&&gr(t[n]={},e[n],i[n]):t[n]=e[n]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{sr(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let i=0,s=t.length;i<s;i++)e[t[i]]=!0;return e},stintSet(t,e,i){i||(i=void 0),t[e]!==i&&(t[e]=i)}},{assign:gr}=pr,fr=class{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!sr(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let s in this)"_"!==s[0]&&(i=e?e[s]:void 0,t[s]=sr(i)?this[s]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!sr(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!sr(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(hr(t))for(let s of t)i[s]=this.__getInput(s);else for(let s in t)i[s]=this.__getInput(s);else{let t,e,{__input:s}=this;i.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!sr(t))){if("path"===n&&!this.__pathInputed)continue;e=s?s[n]:void 0,i[n]=sr(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:n,e:r,f:o}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:n,e:r,f:o}}return i}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null,this.__complexData&&this.__complexData.destroy()}},_r={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=mr;return e[t]?e[t]++:(e[t]=1,0)}},mr=_r,{max:vr}=Math,yr=[0,0,0,0],wr={zero:[...yr],tempFour:yr,set:(t,e,i,s,n)=>(void 0===i&&(i=s=n=e),t[0]=e,t[1]=i,t[2]=s,t[3]=n,t),setTemp:(t,e,i,s)=>xr(yr,t,e,i,s),toTempAB(t,e,i){ur=i?ar(t)?e:t:[],ar(t)?(cr=kr(t),dr=e):ar(e)?(cr=t,dr=kr(e)):(cr=t,dr=e),4!==cr.length&&(cr=br(cr)),4!==dr.length&&(dr=br(dr))},get(t,e){let i;if(!ar(t))switch(t.length){case 4:i=sr(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!sr(e))for(let s=0;s<4;s++)i[s]>e&&(i[s]=e);return i},max:(t,e,i)=>ar(t)&&ar(e)?vr(t,e):(Sr(t,e,i),xr(ur,vr(cr[0],dr[0]),vr(cr[1],dr[1]),vr(cr[2],dr[2]),vr(cr[3],dr[3]))),add:(t,e,i)=>ar(t)&&ar(e)?t+e:(Sr(t,e,i),xr(ur,cr[0]+dr[0],cr[1]+dr[1],cr[2]+dr[2],cr[3]+dr[3])),swapAndScale(t,e,i,s){if(ar(t))return e===i?t*e:[t*i,t*e];const n=s?t:[],[r,o,a,h]=4===t.length?t:br(t);return xr(n,a*i,h*e,r*i,o*e)}},{set:xr,get:br,setTemp:kr,toTempAB:Sr}=wr,{round:Er,pow:Cr,max:Or,floor:Tr,PI:Rr}=Math,Br={},Pr={within:(t,e,i)=>(lr(e)&&(i=e.max,e=e.min),!sr(e)&&t<e&&(t=e),!sr(i)&&t>i&&(t=i),t),fourNumber:wr.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),Pr.float(t)),getGapRotation(t,e,i=0){let s=t+i;if(e>1){const t=Math.abs(s%e);(t<1||t>e-1)&&(s=Math.round(s/e)*e)}return s-i},float(t,e){const i=sr(e)?1e12:Cr(10,e);return-0===(t=Er(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,i,s){if(s||(s={}),e){const t=(ar(e)?e:e.width||0)/i.width,n=(ar(e)?e:e.height||0)/i.height;s.scaleX=t||n||1,s.scaleY=n||t||1}else t&&Pr.assignScale(s,t);return s},getScaleFixedData(t,e,i,s,n){let{scaleX:r,scaleY:o}=t;if((s||e)&&(r<0&&(r=-r),o<0&&(o=-o)),e)if(!0===e)r=o=i?1:1/r;else{let t;ar(e)?t=e:"zoom-in"===e&&(t=1),t&&(r=o=r>t||o>t?i?1:1/r:i?1:1/t)}return Br.scaleX=r,Br.scaleY=o,Br},assignScale(t,e){ar(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>Or(Tr(t),e)/t,randInt:Lr,randColor:t=>`rgba(${Lr(255)},${Lr(255)},${Lr(255)},${t||1})`};function Lr(t){return Math.round(Math.random()*t)}var Mr=Rr/180,Dr=2*Rr,Ar=Rr/2;function Ir(){return{a:1,b:0,c:0,d:1,e:0,f:0}}var{sin:Wr,cos:Fr,acos:zr,sqrt:Nr}=Math,{float:Vr}=Pr,Hr={};function Yr(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}var Xr,jr,Ur={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:Yr(),tempMatrix:{},set(t,e=1,i=0,s=0,n=1,r=0,o=0){t.a=e,t.b=i,t.c=s,t.d=n,t.e=r,t.f=o},get:Ir,getWorld:Yr,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,i){t.e+=e,t.f+=i},translateInner(t,e,i,s){t.e+=t.a*e+t.c*i,t.f+=t.b*e+t.d*i,s&&(t.e-=e,t.f-=i)},scale(t,e,i=e){t.a*=e,t.b*=e,t.c*=i,t.d*=i},pixelScale(t,e,i){i||(i=t),i.a=t.a*e,i.b=t.b*e,i.c=t.c*e,i.d=t.d*e,i.e=t.e*e,i.f=t.f*e},scaleOfOuter(t,e,i,s){Gr.toInnerPoint(t,e,Hr),Gr.scaleOfInner(t,Hr,i,s)},scaleOfInner(t,e,i,s=i){Gr.translateInner(t,e.x,e.y),Gr.scale(t,i,s),Gr.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:i,b:s,c:n,d:r}=t,o=Fr(e*=Mr),a=Wr(e);t.a=i*o-s*a,t.b=i*a+s*o,t.c=n*o-r*a,t.d=n*a+r*o},rotateOfOuter(t,e,i){Gr.toInnerPoint(t,e,Hr),Gr.rotateOfInner(t,Hr,i)},rotateOfInner(t,e,i){Gr.translateInner(t,e.x,e.y),Gr.rotate(t,i),Gr.translateInner(t,-e.x,-e.y)},skew(t,e,i){const{a:s,b:n,c:r,d:o}=t;i&&(i*=Mr,t.a=s+r*i,t.b=n+o*i),e&&(e*=Mr,t.c=r+s*e,t.d=o+n*e)},skewOfOuter(t,e,i,s){Gr.toInnerPoint(t,e,Hr),Gr.skewOfInner(t,Hr,i,s)},skewOfInner(t,e,i,s=0){Gr.translateInner(t,e.x,e.y),Gr.skew(t,i,s),Gr.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:i,b:s,c:n,d:r,e:o,f:a}=t;t.a=e.a*i+e.b*n,t.b=e.a*s+e.b*r,t.c=e.c*i+e.d*n,t.d=e.c*s+e.d*r,t.e=e.e*i+e.f*n+o,t.f=e.e*s+e.f*r+a},multiplyParent(t,e,i,s,n){const{e:r,f:o}=t;if(i||(i=t),sr(s)&&(s=1!==t.a||t.b||t.c||1!==t.d),s){const{a:s,b:r,c:o,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=o*e.a+a*e.c,i.d=o*e.b+a*e.d,n&&(i.scaleX=e.scaleX*n.scaleX,i.scaleY=e.scaleY*n.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,n&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=r*e.a+o*e.c+e.e,i.f=r*e.b+o*e.d+e.f},divide(t,e){Gr.multiply(t,Gr.tempInvert(e))},divideParent(t,e){Gr.multiplyParent(t,Gr.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=Gr;return Gr.copy(e,t),Gr.invert(e),e},invert(t){const{a:e,b:i,c:s,d:n,e:r,f:o}=t;if(i||s){const a=1/(e*n-i*s);t.a=n*a,t.b=-i*a,t.c=-s*a,t.d=e*a,t.e=-(r*n-o*s)*a,t.f=-(o*e-r*i)*a}else if(1===e&&1===n)t.e=-r,t.f=-o;else{const i=1/(e*n);t.a=n*i,t.d=e*i,t.e=-r*n*i,t.f=-o*e*i}},toOuterPoint(t,e,i,s){const{x:n,y:r}=e;i||(i=e),i.x=n*t.a+r*t.c,i.y=n*t.b+r*t.d,s||(i.x+=t.e,i.y+=t.f)},toInnerPoint(t,e,i,s){const{a:n,b:r,c:o,d:a}=t,h=1/(n*a-r*o),{x:l,y:c}=e;if(i||(i=e),i.x=(l*a-c*o)*h,i.y=(c*n-l*r)*h,!s){const{e:e,f:s}=t;i.x-=(e*a-s*o)*h,i.y-=(s*n-e*r)*h}},setLayout(t,e,i,s,n){const{x:r,y:o,scaleX:a,scaleY:h}=e;if(sr(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:i,skewX:s,skewY:n}=e,r=i*Mr,o=Fr(r),l=Wr(r);if(s||n){const e=s*Mr,i=n*Mr;t.a=(o+i*-l)*a,t.b=(l+i*o)*a,t.c=(e*o-l)*h,t.d=(o+e*l)*h}else t.a=o*a,t.b=l*a,t.c=-l*h,t.d=o*h}else t.a=a,t.b=0,t.c=0,t.d=h;t.e=r,t.f=o,(i=i||s)&&Gr.translateInner(t,-i.x,-i.y,!s)},getLayout(t,e,i,s){const{a:n,b:r,c:o,d:a,e:h,f:l}=t;let c,d,u,p,g,f=h,_=l;if(r||o){const t=n*a-r*o;if(o&&!s){c=Nr(n*n+r*r),d=t/c;const e=n/c;u=r>0?zr(e):-zr(e)}else{d=Nr(o*o+a*a),c=t/d;const e=o/d;u=Ar-(a>0?zr(-e):-zr(e))}const e=Vr(Fr(u)),i=Wr(u);c=Vr(c),d=Vr(d),p=e?Vr((o/d+i)/e/Mr,9):0,g=e?Vr((r/c-i)/e/Mr,9):0,u=Vr(u/Mr)}else c=n,d=a,u=p=g=0;return(e=i||e)&&(f+=e.x*n+e.y*o,_+=e.x*r+e.y*a,i||(f-=e.x,_-=e.y)),{x:f,y:_,scaleX:c,scaleY:d,rotation:u,skewX:p,skewY:g}},withScale(t,e,i=e){const s=t;if(!e||!i){const{a:s,b:n,c:r,d:o}=t;n||r?i=(s*o-n*r)/(e=Nr(s*s+n*n)):(e=s,i=o)}return s.scaleX=e,s.scaleY=i,s},reset(t){Gr.set(t)}},Gr=Ur,{float:Kr}=Pr,{toInnerPoint:Zr,toOuterPoint:$r}=Ur,{sin:qr,cos:Jr,abs:Qr,sqrt:to,atan2:eo,min:io,round:so}=Math,no={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,i=0){t.x=e,t.y=i},setRadius(t,e,i){t.radiusX=e,t.radiusY=sr(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,i){t.x=e,t.y=i},round(t,e){t.x=e?so(t.x-.5)+.5:so(t.x),t.y=e?so(t.y-.5)+.5:so(t.y)},move(t,e,i){lr(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=i)},scale(t,e,i=e){t.x&&(t.x*=e),t.y&&(t.y*=i)},scaleOf(t,e,i,s=i){t.x+=(t.x-e.x)*(i-1),t.y+=(t.y-e.y)*(s-1)},rotate(t,e,i){i||(i=ro.defaultPoint);const s=Jr(e*=Mr),n=qr(e),r=t.x-i.x,o=t.y-i.y;t.x=i.x+r*s-o*n,t.y=i.y+r*n+o*s},tempToInnerOf(t,e){const{tempPoint:i}=ro;return ao(i,t),Zr(e,i,i),i},tempToOuterOf(t,e){const{tempPoint:i}=ro;return ao(i,t),$r(e,i,i),i},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:i}=ro;return ao(i,t),ro.toInnerRadiusPointOf(t,e,i),i},copyRadiusPoint:(t,e,i,s)=>(ao(t,e),ho(t,i,s),t),toInnerRadiusPointOf(t,e,i){i||(i=t),Zr(e,t,i),i.radiusX=Math.abs(t.radiusX/e.scaleX),i.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,i){Zr(e,t,i)},toOuterOf(t,e,i){$r(e,t,i)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>oo(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,i,s){const n=Qr(i-t),r=Qr(s-e);return to(n*n+r*r)},getMinDistanceFrom:(t,e,i,s,n,r)=>io(oo(t,e,i,s),oo(i,s,n,r)),getAngle:(t,e)=>lo(t,e)/Mr,getRotation:(t,e,i,s)=>(s||(s=e),ro.getRadianFrom(t.x,t.y,e.x,e.y,i.x,i.y,s.x,s.y)/Mr),getRadianFrom(t,e,i,s,n,r,o,a){sr(o)&&(o=i,a=s);const h=t-i,l=e-s,c=n-o,d=r-a;return Math.atan2(h*d-l*c,h*c+l*d)},getAtan2:(t,e)=>eo(e.y-t.y,e.x-t.x),getDistancePoint(t,e,i,s,n){const r=lo(t,e);return n&&(t=e),s||(e={}),e.x=t.x+Jr(r)*i,e.y=t.y+qr(r)*i,e},toNumberPoints(t){let e=t;return lr(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e,i)=>i?t.x===e.x&&t.y===e.y:Kr(t.x)===Kr(e.x)&&Kr(t.y)===Kr(e.y),reset(t){ro.reset(t)}},ro=no,{getDistanceFrom:oo,copy:ao,setRadius:ho,getAtan2:lo}=ro,co=class t{constructor(t,e){this.set(t,e)}set(t,e){return lr(t)?no.copy(this,t):no.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new t(this)}move(t,e){return no.move(this,t,e),this}scale(t,e){return no.scale(this,t,e),this}scaleOf(t,e,i){return no.scaleOf(this,t,e,i),this}rotate(t,e){return no.rotate(this,t,e),this}rotateOf(t,e){return no.rotate(this,e,t),this}getRotation(t,e,i){return no.getRotation(this,t,e,i)}toInnerOf(t,e){return no.toInnerOf(this,t,e),this}toOuterOf(t,e){return no.toOuterOf(this,t,e),this}getCenter(e){return new t(no.getCenter(this,e))}getDistance(t){return no.getDistance(this,t)}getDistancePoint(e,i,s,n){return new t(no.getDistancePoint(this,e,i,s,n))}getAngle(t){return no.getAngle(this,t)}getAtan2(t){return no.getAtan2(this,t)}isSame(t,e){return no.isSame(this,t,e)}reset(){return no.reset(this),this}},uo=(new co,class t{constructor(t,e,i,s,n,r){this.set(t,e,i,s,n,r)}set(t,e,i,s,n,r){return lr(t)?Ur.copy(this,t):Ur.set(this,t,e,i,s,n,r),this}setWith(t){return Ur.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return{a:t,b:e,c:i,d:s,e:n,f:r}}clone(){return new t(this)}translate(t,e){return Ur.translate(this,t,e),this}translateInner(t,e){return Ur.translateInner(this,t,e),this}scale(t,e){return Ur.scale(this,t,e),this}scaleWith(t,e){return Ur.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Ur.pixelScale(this,t),this}scaleOfOuter(t,e,i){return Ur.scaleOfOuter(this,t,e,i),this}scaleOfInner(t,e,i){return Ur.scaleOfInner(this,t,e,i),this}rotate(t){return Ur.rotate(this,t),this}rotateOfOuter(t,e){return Ur.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Ur.rotateOfInner(this,t,e),this}skew(t,e){return Ur.skew(this,t,e),this}skewOfOuter(t,e,i){return Ur.skewOfOuter(this,t,e,i),this}skewOfInner(t,e,i){return Ur.skewOfInner(this,t,e,i),this}multiply(t){return Ur.multiply(this,t),this}multiplyParent(t){return Ur.multiplyParent(this,t),this}divide(t){return Ur.divide(this,t),this}divideParent(t){return Ur.divideParent(this,t),this}invert(){return Ur.invert(this),this}invertWith(){return Ur.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,i){Ur.toOuterPoint(this,t,e,i)}toInnerPoint(t,e,i){Ur.toInnerPoint(this,t,e,i)}setLayout(t,e,i){return Ur.setLayout(this,t,e,i),this}getLayout(t,e,i){return Ur.getLayout(this,t,e,i)}withScale(t,e){return Ur.withScale(this,t,e)}reset(){Ur.reset(this)}}),po=(new uo,{tempPointBounds:{},setPoint(t,e,i){t.minX=t.maxX=e,t.minY=t.maxY=i},addPoint(t,e,i){t.minX=e<t.minX?e:t.minX,t.minY=i<t.minY?i:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=i>t.maxY?i:t.maxY},addBounds(t,e,i,s,n){go(t,e,i),go(t,e+s,i+n)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}}),{addPoint:go}=po;(function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"})(Xr||(Xr={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(jr||(jr={}));var fo=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];fo.forEach(t=>t.type="percent");var _o={directionData:fo,tempPoint:{},get:mo,toPoint(t,e,i,s,n,r){const o=mo(t);i.x=o.x,i.y=o.y,"percent"===o.type&&(i.x*=e.width,i.y*=e.height,n&&(r||(i.x-=n.x,i.y-=n.y),o.x&&(i.x-=1===o.x?n.width:.5===o.x?o.x*n.width:0),o.y&&(i.y-=1===o.y?n.height:.5===o.y?o.y*n.height:0))),s||(i.x+=e.x,i.y+=e.y)},getPoint:(t,e,i,s=!0)=>(i||(i={}),_o.toPoint(t,e,i,s),i)};function mo(t){return rr(t)?fo[jr[t]]:t}var vo,yo,wo,xo,{toPoint:bo}=_o,ko={toPoint(t,e,i,s,n,r){bo(t,i,s,n,e,r)}},{tempPointBounds:So,setPoint:Eo,addPoint:Co,toBounds:Oo}=po,{toOuterPoint:To}=Ur,{float:Ro,fourNumber:Bo}=Pr,{floor:Po,ceil:Lo}=Math,Mo={},Do={},Ao={},Io={tempBounds:Ao,set(t,e=0,i=0,s=0,n=0){t.x=e,t.y=i,t.width=s,t.height=n},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,i,s,n){const{x:r,y:o,width:a,height:h}=e;if(hr(i)){const e=Bo(i);s?Wo.set(t,r+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Wo.set(t,r-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else s&&(i=-i),Wo.set(t,r-i,o-i,a+2*i,h+2*i);n&&("width"===n?(t.y=o,t.height=h):(t.x=r,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,i){t.x+=e,t.y+=i},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,i)=>(t=Object.assign({},t),Wo.move(t,e,i),t),toOffsetOutBounds(t,e,i){e?zo(e,t):e=t,i||(i=t),e.offsetX=Wo.maxX(i),e.offsetY=Wo.maxY(i),Wo.move(e,-e.offsetX,-e.offsetY)},scale(t,e,i=e,s){s||no.scale(t,e,i),t.width*=e,t.height*=i},scaleOf(t,e,i,s=i){no.scaleOf(t,e,i,s),t.width*=i,t.height*=s},tempToOuterOf:(t,e)=>(Wo.copy(Ao,t),Wo.toOuterOf(Ao,e),Ao),getOuterOf:(t,e)=>(t=Object.assign({},t),Wo.toOuterOf(t,e),t),toOuterOf(t,e,i){if(i||(i=t),0===e.b&&0===e.c){const{a:s,d:n,e:r,f:o}=e;s>0?(i.width=t.width*s,i.x=r+t.x*s):(i.width=t.width*-s,i.x=r+t.x*s-i.width),n>0?(i.height=t.height*n,i.y=o+t.y*n):(i.height=t.height*-n,i.y=o+t.y*n-i.height)}else Mo.x=t.x,Mo.y=t.y,To(e,Mo,Do),Eo(So,Do.x,Do.y),Mo.x=t.x+t.width,To(e,Mo,Do),Co(So,Do.x,Do.y),Mo.y=t.y+t.height,To(e,Mo,Do),Co(So,Do.x,Do.y),Mo.x=t.x,To(e,Mo,Do),Co(So,Do.x,Do.y),Oo(So,i)},toInnerOf(t,e,i){i||(i=t),Wo.move(i,-e.e,-e.f),Wo.scale(i,1/e.a,1/e.d)},getFitMatrix(t,e,i=1){const s=Math.min(i,Wo.getFitScale(t,e));return new uo(s,0,0,s,-e.x*s,-e.y*s)},getFitScale(t,e,i){const s=t.width/e.width,n=t.height/e.height;return i?Math.max(s,n):Math.min(s,n)},put(t,e,i="center",s=1,n=!0,r){r||(r=e),rr(s)&&(s=Wo.getFitScale(t,e,"cover"===s)),Ao.width=n?e.width*=s:e.width*s,Ao.height=n?e.height*=s:e.height*s,ko.toPoint(i,Ao,t,r,!0,!0)},getSpread(t,e,i){const s={};return Wo.copyAndSpread(s,t,e,!1,i),s},spread(t,e,i){Wo.copyAndSpread(t,t,e,!1,i)},shrink(t,e,i){Wo.copyAndSpread(t,t,e,!0,i)},ceil(t){const{x:e,y:i}=t;t.x=Po(t.x),t.y=Po(t.y),t.width=e>t.x?Lo(t.width+e-t.x):Lo(t.width),t.height=i>t.y?Lo(t.height+i-t.y):Lo(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Ro(t.x,e),t.y=Ro(t.y,e),t.width=Ro(t.width,e),t.height=Ro(t.height,e)},add(t,e,i){vo=t.x+t.width,yo=t.y+t.height,wo=e.x,xo=e.y,i||(wo+=e.width,xo+=e.height),vo=vo>wo?vo:wo,yo=yo>xo?yo:xo,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=vo-t.x,t.height=yo-t.y},addList(t,e){Wo.setListWithFn(t,e,void 0,!0)},setList(t,e,i=!1){Wo.setListWithFn(t,e,void 0,i)},addListWithFn(t,e,i){Wo.setListWithFn(t,e,i,!0)},setListWithFn(t,e,i,s=!1){let n,r=!0;for(let o=0,a=e.length;o<a;o++)n=i?i(e[o],o):e[o],n&&(n.width||n.height)&&(r?(r=!1,s||zo(t,n)):Fo(t,n));r&&Wo.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Eo(So,t.x,t.y):Co(So,t.x,t.y)),Oo(So,t)},setPoint(t,e){Wo.set(t,e.x,e.y)},addPoint(t,e){Fo(t,e,!0)},getPoints(t){const{x:e,y:i,width:s,height:n}=t;return[{x:e,y:i},{x:e+s,y:i},{x:e+s,y:i+n},{x:e,y:i+n}]},getPoint:(t,e,i=!1,s)=>_o.getPoint(e,t,s,i),hitRadiusPoint:(t,e,i)=>(i&&(e=no.tempToInnerRadiusPointOf(e,i)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,i)=>(i&&(e=no.tempToInnerOf(e,i)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,i)=>(i&&(e=Wo.tempToOuterOf(e,i)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,i)=>(i&&(e=Wo.tempToOuterOf(e,i)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,i){if(i&&(e=Wo.tempToOuterOf(e,i)),!Wo.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:s,y:n,width:r,height:o}=e;return vo=s+r,yo=n+o,wo=t.x+t.width,xo=t.y+t.height,s=s>t.x?s:t.x,n=n>t.y?n:t.y,r=(vo=vo<wo?vo:wo)-s,o=(yo=yo<xo?yo:xo)-n,{x:s,y:n,width:r,height:o}},intersect(t,e,i){Wo.copy(t,Wo.getIntersectData(t,e,i))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,hasSize:t=>t.width&&t.height,reset(t){Wo.set(t)}},Wo=Io,{add:Fo,copy:zo}=Wo,No=class t{get minX(){return Io.minX(this)}get minY(){return Io.minY(this)}get maxX(){return Io.maxX(this)}get maxY(){return Io.maxY(this)}constructor(t,e,i,s){this.set(t,e,i,s)}set(t,e,i,s){return lr(t)?Io.copy(this,t):Io.set(this,t,e,i,s),this}get(){const{x:t,y:e,width:i,height:s}=this;return{x:t,y:e,width:i,height:s}}clone(){return new t(this)}move(t,e){return Io.move(this,t,e),this}scale(t,e,i){return Io.scale(this,t,e,i),this}scaleOf(t,e,i){return Io.scaleOf(this,t,e,i),this}toOuterOf(t,e){return Io.toOuterOf(this,t,e),this}toInnerOf(t,e){return Io.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Io.getFitMatrix(this,t,e)}put(t,e,i){Io.put(this,t,e,i)}spread(t,e){return Io.spread(this,t,e),this}shrink(t,e){return Io.shrink(this,t,e),this}ceil(){return Io.ceil(this),this}unsign(){return Io.unsign(this),this}float(t){return Io.float(this,t),this}add(t){return Io.add(this,t),this}addList(t){return Io.setList(this,t,!0),this}setList(t){return Io.setList(this,t),this}addListWithFn(t,e){return Io.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Io.setListWithFn(this,t,e),this}setPoint(t){return Io.setPoint(this,t),this}setPoints(t){return Io.setPoints(this,t),this}addPoint(t){return Io.addPoint(this,t),this}getPoints(){return Io.getPoints(this)}getPoint(t,e,i){return Io.getPoint(this,t,e,i)}hitPoint(t,e){return Io.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Io.hitRadiusPoint(this,t,e)}hit(t,e){return Io.hit(this,t,e)}includes(t,e){return Io.includes(this,t,e)}intersect(t,e){return Io.intersect(this,t,e),this}getIntersect(e,i){return new t(Io.getIntersectData(this,e,i))}isSame(t){return Io.isSame(this,t)}isEmpty(){return Io.isEmpty(this)}reset(){Io.reset(this)}},Vo=new No,Ho=class{constructor(t,e,i,s,n,r){lr(t)?this.copy(t):this.set(t,e,i,s,n,r)}set(t=0,e=0,i=0,s=0,n=0,r=0){this.top=t,this.right=e,this.bottom=i,this.left=s,this.width=n,this.height=r}copy(t){const{top:e,right:i,bottom:s,left:n,width:r,height:o}=t;this.set(e,i,s,n,r,o)}getBoundsFrom(t){const{top:e,right:i,bottom:s,left:n,width:r,height:o}=this;return new No(n,e,r||t.width-n-i,o||t.height-e-s)}},Yo={number:(t,e)=>lr(t)?"percent"===t.type?t.value*e:t.value:t},Xo={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{floor:jo,max:Uo}=Math,Go={toURL(t,e){let i=encodeURIComponent(t);return"text"===e?i="data:text/plain;charset=utf-8,"+i:"svg"===e&&(i="data:image/svg+xml,"+i),i},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,i,s)=>t.width*t.height*(e?e*i:1)>(s||Ko.maxCacheSize),isSuperLarge:(t,e,i)=>Ko.isLarge(t,e,i,Ko.maxPatternSize),getRealURL(t){const{prefix:e,suffix:i}=Ko;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,i,s,n,r,o,a,h,l){const c=Uo(jo(e+(s||0)),1),d=Uo(jo(i+(n||0)),1);let u,p,g;l&&(g=Yo.number(l.offset,"x"===l.type?e:i))&&("x"===l.type?u=!0:p=!0);const f=Go.origin.createCanvas(p?2*c:c,u?2*d:d),_=f.getContext("2d");if(a&&(_.globalAlpha=a),_.imageSmoothingEnabled=!1!==o,Ko.canUse(t)){if(r){const s=e/r.width,n=i/r.height;_.setTransform(s,0,0,n,-r.x*s,-r.y*n),_.drawImage(t,0,0,t.width,t.height)}else _.drawImage(t,0,0,e,i);g&&(_.drawImage(f,0,0,c,d,u?g-c:c,u?d:g-d,c,d),_.drawImage(f,0,0,c,d,u?g:c,u?d:g,c,d))}return f},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,i){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}i&&pr.stintSet(i,"transform",e)}}},{image:Ko}=Go,{randColor:Zo}=Pr,$o=class t{constructor(t){this.repeatMap={},this.name=t}static get(e){return new t(e)}static set filter(t){this.filterList=qo(t)}static set exclude(t){this.excludeList=qo(t)}static drawRepaint(t,e){const i=Zo();t.fillWorld(e,i.replace("1)",".1)")),t.strokeWorld(e,i)}static drawBounds(e,i,s){const n="hit"===t.showBounds,r=e.__nowWorld,o=Zo();n&&(i.setWorld(r),e.__drawHitPath(i),i.fillStyle=o.replace("1)",".2)"),i.fill()),i.resetTransform(),i.setStroke(o,2),n?i.stroke():i.strokeWorld(r,o)}log(...t){if(Jo.enable){if(Jo.filterList.length&&Jo.filterList.every(t=>t!==this.name))return;if(Jo.excludeList.length&&Jo.excludeList.some(t=>t===this.name))return}}tip(...t){Jo.enable&&this.warn(...t)}warn(...t){Jo.showWarn}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(xb){}}};function qo(t){return t?rr(t)&&(t=[t]):t=[],t}$o.filterList=[],$o.excludeList=[],$o.showWarn=!0;var Jo=$o,Qo=$o.get("RunTime"),ta={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=_r.create(_r.RUNTIME);return ea.currentId=ea.idMap[i]=e?performance.now():Date.now(),ea.currentName=ea.nameMap[i]=t,ea.nameToIdMap[t]=i,i},end(t,e){const i=ea.idMap[t],s=ea.nameMap[t],n=e?(performance.now()-i)/1e3:Date.now()-i;ea.idMap[t]=ea.nameMap[t]=ea.nameToIdMap[s]=void 0,Qo.log(s,n,"ms")},endOfName(t,e){const i=ea.nameToIdMap[t];sr(i)||ea.end(i,e)}},ea=ta,ia=[],sa={list:{},add(t,...e){this.list[t]=!0,ia.push(...e)},has(t,e){const i=this.list[t];return!i&&e&&this.need(t),i},need(t){}};setTimeout(()=>ia.forEach(t=>sa.has(t,!0)));var na={editor:t=>sa.need("editor")},ra=$o.get("UICreator"),oa={list:{},register(t){const{__tag:e}=t.prototype;aa[e]&&ra.repeat(e),aa[e]=t},get(t,e,i,s,n,r){if(!aa[t])return void ra.warn("not register "+t);const o=new aa[t](e);return sr(i)||(o.x=i,s&&(o.y=s),n&&(o.width=n),r&&(o.height=r)),o}},{list:aa}=oa,ha=$o.get("EventCreator"),la={nameList:{},register(t){let e;Object.keys(t).forEach(i=>{e=t[i],rr(e)&&(ca[e]&&ha.repeat(e),ca[e]=t)})},changeName(t,e){const i=ca[t];if(i){const s=Object.keys(i).find(e=>i[e]===t);s&&(i[s]=e,ca[e]=i)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new ca[t](...e)},{nameList:ca}=la,da=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:i}=this;for(let n=0,r=i.length;n<r;n++)if(e=i[n],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const s=na.canvas(t);return this.add(s),s}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let i=0,s=this.list.length;i<s;i++)t=this.list[i],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}};function ua(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o}function pa(t,e,i,s){return new(i||(i=Promise))(function(n,r){function o(t){try{h(s.next(t))}catch(t){r(t)}}function a(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,a)}h((s=s.apply(t,e||[])).next())})}function ga(t){return(e,i)=>{t||(t=i);const s={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===i&&(s.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,i,s)}}var fa=[];function _a(){return(t,e)=>{fa.push(e)}}var ma=[],va=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||ma)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;fa.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,i,s,n,r){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,i,s,n,r){lr(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,i,s,n,r)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,i,s){}strokeRect(t,e,i,s){}clearRect(t,e,i,s){}drawImage(t,e,i,s,n,r,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/s*a;s+=e,e=0,r+=t,a-=t}if(i<0){const t=-i/n*h;n+=i,i=0,o+=t,h-=t}this.context.drawImage(t,e,i,s,n,r,o,a,h);break;case 5:this.context.drawImage(t,e,i,s,n);break;case 3:this.context.drawImage(t,e,i)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,i,s,n,r){}quadraticCurveTo(t,e,i,s){}closePath(){}arc(t,e,i,s,n,r){}arcTo(t,e,i,s,n){}ellipse(t,e,i,s,n,r,o,a){}rect(t,e,i,s){}roundRect(t,e,i,s,n){}createConicGradient(t,e,i){}createLinearGradient(t,e,i,s){}createPattern(t,e){}createRadialGradient(t,e,i,s,n,r){}fillText(t,e,i,s){}measureText(t){}strokeText(t,e,i,s){}destroy(){this.context=null}};ua([ga("imageSmoothingEnabled")],va.prototype,"smooth",void 0),ua([ga("imageSmoothingQuality")],va.prototype,"smoothLevel",void 0),ua([ga("globalAlpha")],va.prototype,"opacity",void 0),ua([ga()],va.prototype,"fillStyle",void 0),ua([ga()],va.prototype,"strokeStyle",void 0),ua([ga("lineWidth")],va.prototype,"strokeWidth",void 0),ua([ga("lineCap")],va.prototype,"strokeCap",void 0),ua([ga("lineJoin")],va.prototype,"strokeJoin",void 0),ua([ga("lineDashOffset")],va.prototype,"dashOffset",void 0),ua([ga()],va.prototype,"miterLimit",void 0),ua([ga()],va.prototype,"shadowBlur",void 0),ua([ga()],va.prototype,"shadowColor",void 0),ua([ga()],va.prototype,"shadowOffsetX",void 0),ua([ga()],va.prototype,"shadowOffsetY",void 0),ua([ga()],va.prototype,"filter",void 0),ua([ga()],va.prototype,"font",void 0),ua([ga()],va.prototype,"fontKerning",void 0),ua([ga()],va.prototype,"fontStretch",void 0),ua([ga()],va.prototype,"fontVariantCaps",void 0),ua([ga()],va.prototype,"textAlign",void 0),ua([ga()],va.prototype,"textBaseline",void 0),ua([ga()],va.prototype,"textRendering",void 0),ua([ga()],va.prototype,"wordSpacing",void 0),ua([ga()],va.prototype,"letterSpacing",void 0),ua([ga()],va.prototype,"direction",void 0),ua([_a()],va.prototype,"setTransform",null),ua([_a()],va.prototype,"resetTransform",null),ua([_a()],va.prototype,"getTransform",null),ua([_a()],va.prototype,"save",null),ua([_a()],va.prototype,"restore",null),ua([_a()],va.prototype,"translate",null),ua([_a()],va.prototype,"scale",null),ua([_a()],va.prototype,"rotate",null),ua([_a()],va.prototype,"fill",null),ua([_a()],va.prototype,"stroke",null),ua([_a()],va.prototype,"clip",null),ua([_a()],va.prototype,"fillRect",null),ua([_a()],va.prototype,"strokeRect",null),ua([_a()],va.prototype,"clearRect",null),ua([_a()],va.prototype,"beginPath",null),ua([_a()],va.prototype,"moveTo",null),ua([_a()],va.prototype,"lineTo",null),ua([_a()],va.prototype,"bezierCurveTo",null),ua([_a()],va.prototype,"quadraticCurveTo",null),ua([_a()],va.prototype,"closePath",null),ua([_a()],va.prototype,"arc",null),ua([_a()],va.prototype,"arcTo",null),ua([_a()],va.prototype,"ellipse",null),ua([_a()],va.prototype,"rect",null),ua([_a()],va.prototype,"roundRect",null),ua([_a()],va.prototype,"createConicGradient",null),ua([_a()],va.prototype,"createLinearGradient",null),ua([_a()],va.prototype,"createPattern",null),ua([_a()],va.prototype,"createRadialGradient",null),ua([_a()],va.prototype,"fillText",null),ua([_a()],va.prototype,"measureText",null),ua([_a()],va.prototype,"strokeText",null);var{copy:ya,multiplyParent:wa,pixelScale:xa}=Ur,{round:ba}=Math,ka=new No,Sa=new No,Ea={width:1,height:1,pixelRatio:1},Ca=["width","height","pixelRatio"],Oa=class extends va{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Ea),this.manager=e,this.innerId=_r.create(_r.CNAVAS);const{width:i,height:s,pixelRatio:n}=t;this.autoLayout=!i||!s,this.size.pixelRatio=n||Go.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let i;this.context&&!this.unreal&&e&&this.width&&(i=this.getSameCanvas(),i.copyWorld(this));const s=this.size;pr.copyAttrs(s,t,Ca),Ca.forEach(t=>s[t]||(s[t]=1)),this.bounds=new No(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&i&&(this.clearWorld(i.bounds),this.copyWorld(i),i.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:i,pixelSnap:s}=this,n=this.worldTransform;e&&wa(t,e,n),xa(t,i,n),s&&!t.ignorePixelSnap&&(t.half&&t.half*i%2?(n.e=ba(n.e-.5)+.5,n.f=ba(n.f-.5)+.5):(n.e=ba(n.e),n.f=ba(n.f))),this.setTransform(n.a,n.b,n.c,n.d,n.e,n.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,i,s){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),i&&this.setStrokeOptions(i,s)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:s,dashPattern:n,dashOffset:r,miterLimit:o}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(s=e.strokeJoin),sr(e.dashPattern)||(n=e.dashPattern),sr(e.dashOffset)||(r=e.dashOffset),e.miterLimit&&(o=e.miterLimit)),this.strokeCap=i,this.strokeJoin=s,this.dashPattern=n,this.dashOffset=r,this.miterLimit=o}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,i=1){return!0}setWorldShadow(t,e,i,s){const{pixelRatio:n}=this;this.shadowOffsetX=t*n,this.shadowOffsetY=e*n,this.shadowBlur=i*n,this.shadowColor=s||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,i,s,n){s&&(this.blendMode=s),e?(this.setTempPixelBounds(e,n),i?(this.setTempPixelBounds2(i,n),i=Sa):i=ka,this.drawImage(t.view,ka.x,ka.y,ka.width,ka.height,i.x,i.y,i.width,i.height)):this.drawImage(t.view,0,0),s&&(this.blendMode="source-over")}copyWorldToInner(t,e,i,s,n){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Io.tempToOuterOf(i,e),s,n),this.restore()):(s&&(this.blendMode=s),this.setTempPixelBounds(e,n),this.drawImage(t.view,ka.x,ka.y,ka.width,ka.height,i.x,i.y,i.width,i.height),s&&(this.blendMode="source-over"))}copyWorldByReset(t,e,i,s,n,r){this.resetTransform(),this.copyWorld(t,e,i,s,r),n||this.useWorldTransform()}useGrayscaleAlpha(t){let e,i;this.setTempPixelBounds(t,!0,!0);const{context:s}=this,n=s.getImageData(ka.x,ka.y,ka.width,ka.height),{data:r}=n;for(let o=0,a=r.length;o<a;o+=4)i=.299*r[o]+.587*r[o+1]+.114*r[o+2],(e=r[o+3])&&(r[o+3]=255===e?i:e*(i/255));s.putImageData(n,ka.x,ka.y)}useMask(t,e,i){this.copyWorld(t,e,i,"destination-in")}useEraser(t,e,i){this.copyWorld(t,e,i,"destination-out")}fillWorld(t,e,i,s){i&&(this.blendMode=i),this.fillStyle=e,this.setTempPixelBounds(t,s),this.fillRect(ka.x,ka.y,ka.width,ka.height),i&&(this.blendMode="source-over")}strokeWorld(t,e,i,s){i&&(this.blendMode=i),this.strokeStyle=e,this.setTempPixelBounds(t,s),this.strokeRect(ka.x,ka.y,ka.width,ka.height),i&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(ka.x,ka.y,ka.width,ka.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(ka.x,ka.y,ka.width,ka.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,i){this.copyToPixelBounds(ka,t,e,i)}setTempPixelBounds2(t,e,i){this.copyToPixelBounds(Sa,t,e,i)}copyToPixelBounds(t,e,i,s){t.set(e),s&&t.intersect(this.bounds),t.scale(this.pixelRatio),i&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:i,pixelSnap:s}=this,n=this.manager?this.manager.get(i):na.canvas(Object.assign({},i));return n.save(),t&&(ya(n.worldTransform,this.worldTransform),n.useWorldTransform()),e&&(n.smooth=this.smooth),n.pixelSnap!==s&&(n.pixelSnap=s),n}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},Ta={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Ra={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Ba=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},Ra),Pa={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},La={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},Ma=Object.assign(Object.assign({},La),Ra),Da=Ba,Aa={};for(let Jb in Da)Aa[Da[Jb]]=Jb;var Ia={};for(let Jb in Da)Ia[Da[Jb]]=Pa[Jb];var Wa,Fa,za,Na={drawRoundRect(t,e,i,s,n,r){const o=Pr.fourNumber(r,Math.min(s/2,n/2)),a=e+s,h=i+n;o[0]?t.moveTo(e+o[0],i):t.moveTo(e,i),o[1]?t.arcTo(a,i,a,h,o[1]):t.lineTo(a,i),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,i,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,i,a,i,o[0]):t.lineTo(e,i)}},{sin:Va,cos:Ha,hypot:Ya,atan2:Xa,ceil:ja,abs:Ua,PI:Ga,sqrt:Ka,pow:Za}=Math,{setPoint:$a,addPoint:qa}=po,{set:Ja,toNumberPoints:Qa}=no,{M:th,L:eh,C:ih,Q:sh,Z:nh}=Ba,rh={},oh={points(t,e,i,s){let n=Qa(e);if(t.push(th,n[0],n[1]),i&&n.length>5){let e,r,o,a,h,l,c,d,u,p,g,f,_,m,v,y=n.length;const w=!0===i?.5:i;s&&(n=[n[y-2],n[y-1],...n,n[0],n[1],n[2],n[3]],y=n.length);for(let i=2;i<y-2;i+=2)e=n[i-2],r=n[i-1],o=n[i],a=n[i+1],h=n[i+2],l=n[i+3],g=o-e,f=a-r,_=Ka(Za(g,2)+Za(f,2)),m=Ka(Za(h-o,2)+Za(l-a,2)),(_||m)&&(v=_+m,_=w*_/v,m=w*m/v,h-=e,l-=r,c=o-_*h,d=a-_*l,2===i?s||t.push(sh,c,d,o,a):(g||f)&&t.push(ih,u,p,c,d,o,a),u=o+m*h,p=a+m*l);s||t.push(sh,u,p,n[y-2],n[y-1])}else for(let r=2,o=n.length;r<o;r+=2)t.push(eh,n[r],n[r+1]);s&&t.push(nh)},rect(t,e,i,s,n){Ta.creator.path=t,Ta.creator.moveTo(e,i).lineTo(e+s,i).lineTo(e+s,i+n).lineTo(e,i+n).lineTo(e,i)},roundRect(t,e,i,s,n,r){Ta.creator.path=[],Na.drawRoundRect(Ta.creator,e,i,s,n,r),t.push(...Ta.convertToCanvasData(Ta.creator.path,!0))},arcTo(t,e,i,s,n,r,o,a,h,l,c){const d=s-e,u=n-i,p=r-s,g=o-n;let f=Xa(u,d),_=Xa(g,p);const m=Ya(d,u),v=Ya(p,g);let y=_-f;if(y<0&&(y+=Dr),m<1e-12||v<1e-12||y<1e-12||Ua(y-Ga)<1e-12)return t&&t.push(eh,s,n),h&&($a(h,e,i),qa(h,s,n)),c&&Ja(c,e,i),void(l&&Ja(l,s,n));const w=d*g-p*u<0,x=w?-1:1,b=a/Ha(y/2),k=s+b*Ha(f+y/2+Ar*x),S=n+b*Va(f+y/2+Ar*x);return f-=Ar*x,_-=Ar*x,lh(t,k,S,a,a,0,f/Mr,_/Mr,w,h,l,c)},arc:(t,e,i,s,n,r,o,a,h,l)=>lh(t,e,i,s,s,0,n,r,o,a,h,l),ellipse(t,e,i,s,n,r,o,a,h,l,c,d){const u=r*Mr,p=Va(u),g=Ha(u);let f=o*Mr,_=a*Mr;f>Ga&&(f-=Dr),_<0&&(_+=Dr);let m=_-f;m<0?m+=Dr:m>Dr&&(m-=Dr),h&&(m-=Dr);const v=ja(Ua(m/Ar)),y=m/v,w=Va(y/4),x=8/3*w*w/Va(y/2);_=f+y;let b,k,S,E,C,O,T,R,B=Ha(f),P=Va(f),L=S=g*s*B-p*n*P,M=E=p*s*B+g*n*P,D=e+S,A=i+E;t&&t.push(t.length?eh:th,D,A),l&&$a(l,D,A),d&&Ja(d,D,A);for(let I=0;I<v;I++)b=Ha(_),k=Va(_),S=g*s*b-p*n*k,E=p*s*b+g*n*k,C=e+L-x*(g*s*P+p*n*B),O=i+M-x*(p*s*P-g*n*B),T=e+S+x*(g*s*k+p*n*b),R=i+E+x*(p*s*k-g*n*b),t&&t.push(ih,C,O,T,R,e+S,i+E),l&&hh(e+L,i+M,C,O,T,R,e+S,i+E,l,!0),L=S,M=E,B=b,P=k,f=_,_+=y;c&&Ja(c,e+S,i+E)},quadraticCurveTo(t,e,i,s,n,r,o){t.push(ih,(e+2*s)/3,(i+2*n)/3,(r+2*s)/3,(o+2*n)/3,r,o)},toTwoPointBoundsByQuadraticCurve(t,e,i,s,n,r,o,a){hh(t,e,(t+2*i)/3,(e+2*s)/3,(n+2*i)/3,(r+2*s)/3,n,r,o,a)},toTwoPointBounds(t,e,i,s,n,r,o,a,h,l){const c=[];let d,u,p,g,f,_,m,v,y=t,w=i,x=n,b=o;for(let k=0;k<2;++k)if(1==k&&(y=e,w=s,x=r,b=a),d=-3*y+9*w-9*x+3*b,u=6*y-12*w+6*x,p=3*w-3*y,Math.abs(d)<1e-12){if(Math.abs(u)<1e-12)continue;g=-p/u,0<g&&g<1&&c.push(g)}else m=u*u-4*p*d,v=Math.sqrt(m),m<0||(f=(-u+v)/(2*d),0<f&&f<1&&c.push(f),_=(-u-v)/(2*d),0<_&&_<1&&c.push(_));l?qa(h,t,e):$a(h,t,e),qa(h,o,a);for(let k=0,S=c.length;k<S;k++)ah(c[k],t,e,i,s,n,r,o,a,rh),qa(h,rh.x,rh.y)},getPointAndSet(t,e,i,s,n,r,o,a,h,l){const c=1-t,d=c*c*c,u=3*c*c*t,p=3*c*t*t,g=t*t*t;l.x=d*e+u*s+p*r+g*a,l.y=d*i+u*n+p*o+g*h},getPoint(t,e,i,s,n,r,o,a,h){const l={};return ah(t,e,i,s,n,r,o,a,h,l),l},getDerivative(t,e,i,s,n){const r=1-t;return 3*r*r*(i-e)+6*r*t*(s-i)+3*t*t*(n-s)},cut(t,e,i,s,n,r,o,a,h){if(t<=0)return{left:null,right:[s,n,r,o,a,h]};if(t>=1)return{left:[s,n,r,o,a,h],right:null};const l=1-t,c=e*l+s*t,d=i*l+n*t,u=s*l+r*t,p=n*l+o*t,g=r*l+a*t,f=o*l+h*t,_=c*l+u*t,m=d*l+p*t,v=u*l+g*t,y=p*l+f*t;return{left:[c,d,_,m,_*l+v*t,m*l+y*t],right:[v,y,g,f,a,h]}}},{getPointAndSet:ah,toTwoPointBounds:hh,ellipse:lh}=oh,{sin:ch,cos:dh,sqrt:uh,atan2:ph}=Math,{ellipse:gh}=oh,fh={ellipticalArc(t,e,i,s,n,r,o,a,h,l,c){const d=(h-e)/2,u=(l-i)/2,p=r*Mr,g=ch(p),f=dh(p),_=-f*d-g*u,m=-f*u+g*d,v=s*s,y=n*n,w=m*m,x=_*_,b=v*y-v*w-y*x;let k=0;if(b<0){const t=uh(1-b/(v*y));s*=t,n*=t}else k=(o===a?-1:1)*uh(b/(v*w+y*x));const S=k*s*m/n,E=-k*n*_/s,C=ph((m-E)/n,(_-S)/s),O=ph((-m-E)/n,(-_-S)/s);let T=O-C;0===a&&T>0?T-=Dr:1===a&&T<0&&(T+=Dr);const R=e+d+f*S-g*E,B=i+u+g*S+f*E,P=T<0?1:0;c||Go.ellipseToCurve?gh(t,R,B,s,n,r,C/Mr,O/Mr,P):s!==n||r?t.push(Ba.G,R,B,s,n,r,C/Mr,O/Mr,P):t.push(Ba.O,R,B,s,C/Mr,O/Mr,P)}},_h=t=>[],{M:mh,m:vh,L:yh,l:wh,H:xh,h:bh,V:kh,v:Sh,C:Eh,c:Ch,S:Oh,s:Th,Q:Rh,q:Bh,T:Ph,t:Lh,A:Mh,a:Dh,Z:Ah,z:Ih,N:Wh,D:Fh,X:zh,G:Nh,F:Vh,O:Hh,P:Yh,U:Xh}=Ba,{rect:jh,roundRect:Uh,arcTo:Gh,arc:Kh,ellipse:Zh,quadraticCurveTo:$h}=oh,{ellipticalArc:qh}=fh,Jh=$o.get("PathConvert"),Qh={},tl={current:{dot:0},stringify(t,e){let i,s,n,r=0,o=t.length,a="";for(;r<o;){s=t[r],i=Ia[s],a+=s===n?" ":Aa[s];for(let s=1;s<i;s++)a+=Pr.float(t[r+s],e),s===i-1||(a+=" ");n=s,r+=i}return a},parse(t,e){let i,s,n,r="";const o=[],a=e?Ma:La;for(let h=0,l=t.length;h<l;h++)s=t[h],Xo[s]?("."===s&&(el.dot&&(il(o,r),r=""),el.dot++),"0"===r&&"."!==s&&(il(o,r),r=""),r+=s):Ba[s]?(r&&(il(o,r),r=""),el.name=Ba[s],el.length=Pa[s],el.index=0,il(o,el.name),!i&&a[s]&&(i=!0)):"-"===s||"+"===s?"e"===n||"E"===n?r+=s:(r&&il(o,r),r=s):r&&(il(o,r),r=""),n=s;return r&&il(o,r),i?tl.toCanvasData(o,e):o},toCanvasData(t,e){let i,s,n,r,o,a=0,h=0,l=0,c=0,d=0,u=t.length;const p=[];for(;d<u;){switch(n=t[d],n){case vh:t[d+1]+=a,t[d+2]+=h;case mh:a=t[d+1],h=t[d+2],p.push(mh,a,h),d+=3;break;case bh:t[d+1]+=a;case xh:a=t[d+1],p.push(yh,a,h),d+=2;break;case Sh:t[d+1]+=h;case kh:h=t[d+1],p.push(yh,a,h),d+=2;break;case wh:t[d+1]+=a,t[d+2]+=h;case yh:a=t[d+1],h=t[d+2],p.push(yh,a,h),d+=3;break;case Th:t[d+1]+=a,t[d+2]+=h,t[d+3]+=a,t[d+4]+=h,n=Oh;case Oh:o=r===Eh||r===Oh,l=o?2*a-i:t[d+1],c=o?2*h-s:t[d+2],i=t[d+1],s=t[d+2],a=t[d+3],h=t[d+4],p.push(Eh,l,c,i,s,a,h),d+=5;break;case Ch:t[d+1]+=a,t[d+2]+=h,t[d+3]+=a,t[d+4]+=h,t[d+5]+=a,t[d+6]+=h,n=Eh;case Eh:i=t[d+3],s=t[d+4],a=t[d+5],h=t[d+6],p.push(Eh,t[d+1],t[d+2],i,s,a,h),d+=7;break;case Lh:t[d+1]+=a,t[d+2]+=h,n=Ph;case Ph:o=r===Rh||r===Ph,i=o?2*a-i:t[d+1],s=o?2*h-s:t[d+2],e?$h(p,a,h,i,s,t[d+1],t[d+2]):p.push(Rh,i,s,t[d+1],t[d+2]),a=t[d+1],h=t[d+2],d+=3;break;case Bh:t[d+1]+=a,t[d+2]+=h,t[d+3]+=a,t[d+4]+=h,n=Rh;case Rh:i=t[d+1],s=t[d+2],e?$h(p,a,h,i,s,t[d+3],t[d+4]):p.push(Rh,i,s,t[d+3],t[d+4]),a=t[d+3],h=t[d+4],d+=5;break;case Dh:t[d+6]+=a,t[d+7]+=h;case Mh:qh(p,a,h,t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],t[d+7],e),a=t[d+6],h=t[d+7],d+=8;break;case Ih:case Ah:p.push(Ah),d++;break;case Wh:a=t[d+1],h=t[d+2],e?jh(p,a,h,t[d+3],t[d+4]):sl(p,t,d,5),d+=5;break;case Fh:a=t[d+1],h=t[d+2],e?Uh(p,a,h,t[d+3],t[d+4],[t[d+5],t[d+6],t[d+7],t[d+8]]):sl(p,t,d,9),d+=9;break;case zh:a=t[d+1],h=t[d+2],e?Uh(p,a,h,t[d+3],t[d+4],t[d+5]):sl(p,t,d,6),d+=6;break;case Nh:Zh(e?p:sl(p,t,d,9),t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],t[d+7],t[d+8],null,Qh),a=Qh.x,h=Qh.y,d+=9;break;case Vh:e?Zh(p,t[d+1],t[d+2],t[d+3],t[d+4],0,0,360,!1):sl(p,t,d,5),a=t[d+1]+t[d+3],h=t[d+2],d+=5;break;case Hh:Kh(e?p:sl(p,t,d,7),t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],null,Qh),a=Qh.x,h=Qh.y,d+=7;break;case Yh:e?Kh(p,t[d+1],t[d+2],t[d+3],0,360,!1):sl(p,t,d,4),a=t[d+1]+t[d+3],h=t[d+2],d+=4;break;case Xh:Gh(e?p:sl(p,t,d,6),a,h,t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],null,Qh),a=Qh.x,h=Qh.y,d+=6;break;default:return Jh.error(`command: ${n} [index:${d}]`,t),p}r=n}return p},objectToCanvasData(t){if(t[0].name.length>1)return _h(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(mh,t.x,t.y);break;case"L":e.push(yh,t.x,t.y);break;case"C":e.push(Eh,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Rh,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Ah)}}),e}},copyData(t,e,i,s){for(let n=i,r=i+s;n<r;n++)t.push(e[n])},pushData(t,e){el.index===el.length&&(el.index=1,t.push(el.name)),t.push(Number(e)),el.index++,el.dot=0}},{current:el,pushData:il,copyData:sl}=tl,{M:nl,L:rl,C:ol,Q:al,Z:hl,N:ll,D:cl,X:dl,G:ul,F:pl,O:gl,P:fl,U:_l}=Ba,{getMinDistanceFrom:ml,getRadianFrom:vl}=no,{tan:yl,min:wl,abs:xl}=Math,bl={},kl={beginPath(t){t.length=0},moveTo(t,e,i){t.push(nl,e,i)},lineTo(t,e,i){t.push(rl,e,i)},bezierCurveTo(t,e,i,s,n,r,o){t.push(ol,e,i,s,n,r,o)},quadraticCurveTo(t,e,i,s,n){t.push(al,e,i,s,n)},closePath(t){t.push(hl)},rect(t,e,i,s,n){t.push(ll,e,i,s,n)},roundRect(t,e,i,s,n,r){if(ar(r))t.push(dl,e,i,s,n,r);else{const o=Pr.fourNumber(r);o?t.push(cl,e,i,s,n,...o):t.push(ll,e,i,s,n)}},ellipse(t,e,i,s,n,r,o,a,h){if(s===n)return El(t,e,i,s,o,a,h);nr(r)?t.push(pl,e,i,s,n):(nr(o)&&(o=0),nr(a)&&(a=360),t.push(ul,e,i,s,n,r,o,a,h?1:0))},arc(t,e,i,s,n,r,o){nr(n)?t.push(fl,e,i,s):(nr(n)&&(n=0),nr(r)&&(r=360),t.push(gl,e,i,s,n,r,o?1:0))},arcTo(t,e,i,s,n,r,o,a,h){if(!sr(o)){const t=ml(o,a,e,i,s,n)/(h?1:2);r=wl(r,wl(t,t*xl(yl(vl(o,a,e,i,s,n)/2))))}t.push(_l,e,i,s,n,r)},drawEllipse(t,e,i,s,n,r,o,a,h){oh.ellipse(null,e,i,s,n,nr(r)?0:r,nr(o)?0:o,nr(a)?360:a,h,null,null,bl),t.push(nl,bl.x,bl.y),Sl(t,e,i,s,n,r,o,a,h)},drawArc(t,e,i,s,n,r,o){oh.arc(null,e,i,s,nr(n)?0:n,nr(r)?360:r,o,null,null,bl),t.push(nl,bl.x,bl.y),El(t,e,i,s,n,r,o)},drawPoints(t,e,i,s){oh.points(t,e,i,s)}},{ellipse:Sl,arc:El}=kl,{moveTo:Cl,lineTo:Ol,quadraticCurveTo:Tl,bezierCurveTo:Rl,closePath:Bl,beginPath:Pl,rect:Ll,roundRect:Ml,ellipse:Dl,arc:Al,arcTo:Il,drawEllipse:Wl,drawArc:Fl,drawPoints:zl}=kl,Nl=class{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?rr(t)?Ta.parse(t):t:[],this}beginPath(){return Pl(this.__path),this.paint(),this}moveTo(t,e){return Cl(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ol(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,i,s,n,r){return Rl(this.__path,t,e,i,s,n,r),this.paint(),this}quadraticCurveTo(t,e,i,s){return Tl(this.__path,t,e,i,s),this.paint(),this}closePath(){return Bl(this.__path),this.paint(),this}rect(t,e,i,s){return Ll(this.__path,t,e,i,s),this.paint(),this}roundRect(t,e,i,s,n){return Ml(this.__path,t,e,i,s,n),this.paint(),this}ellipse(t,e,i,s,n,r,o,a){return Dl(this.__path,t,e,i,s,n,r,o,a),this.paint(),this}arc(t,e,i,s,n,r){return Al(this.__path,t,e,i,s,n,r),this.paint(),this}arcTo(t,e,i,s,n){return Il(this.__path,t,e,i,s,n),this.paint(),this}drawEllipse(t,e,i,s,n,r,o,a){return Wl(this.__path,t,e,i,s,n,r,o,a),this.paint(),this}drawArc(t,e,i,s,n,r){return Fl(this.__path,t,e,i,s,n,r),this.paint(),this}drawPoints(t,e,i){return zl(this.__path,t,e,i),this.paint(),this}clearPath(){return this.beginPath()}paint(){}},{M:Vl,L:Hl,C:Yl,Q:Xl,Z:jl,N:Ul,D:Gl,X:Kl,G:Zl,F:$l,O:ql,P:Jl,U:Ql}=Ba,tc=$o.get("PathDrawer"),ec={drawPathByData(t,e){if(!e)return;let i,s=0,n=e.length;for(;s<n;)switch(i=e[s],i){case Vl:t.moveTo(e[s+1],e[s+2]),s+=3;break;case Hl:t.lineTo(e[s+1],e[s+2]),s+=3;break;case Yl:t.bezierCurveTo(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5],e[s+6]),s+=7;break;case Xl:t.quadraticCurveTo(e[s+1],e[s+2],e[s+3],e[s+4]),s+=5;break;case jl:t.closePath(),s+=1;break;case Ul:t.rect(e[s+1],e[s+2],e[s+3],e[s+4]),s+=5;break;case Gl:t.roundRect(e[s+1],e[s+2],e[s+3],e[s+4],[e[s+5],e[s+6],e[s+7],e[s+8]]),s+=9;break;case Kl:t.roundRect(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]),s+=6;break;case Zl:t.ellipse(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]*Mr,e[s+6]*Mr,e[s+7]*Mr,e[s+8]),s+=9;break;case $l:t.ellipse(e[s+1],e[s+2],e[s+3],e[s+4],0,0,Dr,!1),s+=5;break;case ql:t.arc(e[s+1],e[s+2],e[s+3],e[s+4]*Mr,e[s+5]*Mr,e[s+6]),s+=7;break;case Jl:t.arc(e[s+1],e[s+2],e[s+3],0,Dr,!1),s+=4;break;case Ql:t.arcTo(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]),s+=6;break;default:return void tc.error(`command: ${i} [index:${s}]`,e)}}},{M:ic,L:sc,C:nc,Q:rc,Z:oc,N:ac,D:hc,X:lc,G:cc,F:dc,O:uc,P:pc,U:gc}=Ba,{toTwoPointBounds:fc,toTwoPointBoundsByQuadraticCurve:_c,arcTo:mc,arc:vc,ellipse:yc}=oh,{addPointBounds:wc,copy:xc,addPoint:bc,setPoint:kc,addBounds:Sc,toBounds:Ec}=po,Cc=$o.get("PathBounds"),Oc={},Tc={},Rc={},Bc={toBounds(t,e){Bc.toTwoPointBounds(t,Tc),Ec(Tc,e)},toTwoPointBounds(t,e){if(!t||!t.length)return kc(e,0,0);let i,s,n,r,o,a=0,h=0,l=0;const c=t.length;for(;a<c;)switch(o=t[a],0===a&&(o===oc||o===nc||o===rc?kc(e,h,l):kc(e,t[a+1],t[a+2])),o){case ic:case sc:h=t[a+1],l=t[a+2],bc(e,h,l),a+=3;break;case nc:n=t[a+5],r=t[a+6],fc(h,l,t[a+1],t[a+2],t[a+3],t[a+4],n,r,Oc),wc(e,Oc),h=n,l=r,a+=7;break;case rc:i=t[a+1],s=t[a+2],n=t[a+3],r=t[a+4],_c(h,l,i,s,n,r,Oc),wc(e,Oc),h=n,l=r,a+=5;break;case oc:a+=1;break;case ac:h=t[a+1],l=t[a+2],Sc(e,h,l,t[a+3],t[a+4]),a+=5;break;case hc:case lc:h=t[a+1],l=t[a+2],Sc(e,h,l,t[a+3],t[a+4]),a+=o===hc?9:6;break;case cc:yc(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Oc,Rc),0===a?xc(e,Oc):wc(e,Oc),h=Rc.x,l=Rc.y,a+=9;break;case dc:h=t[a+1],l=t[a+2],Fa=t[a+3],za=t[a+4],Sc(e,h-Fa,l-za,2*Fa,2*za),h+=Fa,a+=5;break;case uc:vc(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Oc,Rc),0===a?xc(e,Oc):wc(e,Oc),h=Rc.x,l=Rc.y,a+=7;break;case pc:h=t[a+1],l=t[a+2],Wa=t[a+3],Sc(e,h-Wa,l-Wa,2*Wa,2*Wa),h+=Wa,a+=4;break;case gc:mc(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Oc,Rc),0===a?xc(e,Oc):wc(e,Oc),h=Rc.x,l=Rc.y,a+=6;break;default:return void Cc.error(`command: ${o} [index:${a}]`,t)}}},{M:Pc,L:Lc,Z:Mc}=Ba,{getCenterX:Dc,getCenterY:Ac}=no,{arcTo:Ic}=kl,Wc={smooth(t,e,i){let s,n,r,o=0,a=0,h=0,l=0,c=0,d=0,u=0,p=0,g=0;hr(e)&&(e=e[0]||0);const f=t.length,_=9===f,m=[];for(;o<f;){switch(s=t[o],s){case Pc:l=p=t[o+1],c=g=t[o+2],o+=3,t[o]===Lc?(d=t[o+1],u=t[o+2],_?m.push(Pc,l,c):m.push(Pc,Dc(l,d),Ac(c,u))):m.push(Pc,l,c);break;case Lc:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case Lc:Ic(m,a,h,t[o+1],t[o+2],e,p,g,_);break;case Mc:Ic(m,a,h,l,c,e,p,g,_);break;default:m.push(Lc,a,h)}p=a,g=h;break;case Mc:n!==Mc&&(Ic(m,l,c,d,u,e,p,g,_),m.push(Mc)),o+=1;break;default:r=Ia[s];for(let e=0;e<r;e++)m.push(t[o+e]);o+=r}n=s}return s!==Mc&&(m[1]=l,m[2]=c),m}};function Fc(t){return new Nl(t)}var zc=Fc();Ta.creator=Fc(),Ta.parse=tl.parse,Ta.convertToCanvasData=tl.toCanvasData;var{drawRoundRect:Nc}=Na;function Vc(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,i,s,n){Nc(this,t,e,i,s,n)})}(t)}var Hc={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mimeType:(t,e="image")=>!t||t.startsWith(e)?t:("jpg"===t&&(t="jpeg"),e+"/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=Yc.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},Yc=Hc;Yc.mineType=Yc.mimeType,Yc.alphaPixelTypes.forEach(t=>Yc.upperCaseTypeMap[t]=t.toUpperCase());var Xc=$o.get("TaskProcessor"),jc=class{constructor(t){this.parallel=!0,this.time=1,this.id=_r.create(_r.TASK),this.task=t}run(){return pa(this,void 0,void 0,function*(){try{if(this.isComplete||this.runing)return;if(this.runing=!0,this.canUse&&!this.canUse())return this.cancel();this.task&&(yield this.task())}catch(wb){Xc.error(wb)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}},Uc=class{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,i=0;for(let s=0;s<t;s++)s<=this.finishedIndex?(i+=this.list[s].time,s===this.finishedIndex&&(e=i)):e+=this.list[s].time;return this.isComplete?1:i/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&pr.assign(this.config,t),this.empty()}add(t,e,i){let s,n,r,o;const a=new jc(t);return a.parent=this,ar(e)?o=e:e&&(n=e.parallel,s=e.start,r=e.time,o=e.delay,i||(i=e.canUse)),r&&(a.time=r),!1===n&&(a.parallel=!1),i&&(a.canUse=i),sr(o)?this.push(a,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,s))},o)),this.isComplete=!1,a}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.run()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:i,index:s}=this;this.parallelList=[],this.parallelSuccessNumber=0;let n=s+e.parallel;if(n>i.length&&(n=i.length),e.parallel>1)for(let r=s;r<n&&(t=i[r],t.parallel);r++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const i=e.length,s=this.finishedIndex+i;if(e.length){if(!this.running)return;s<this.total&&(t=this.list[s],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}},Gc=$o.get("Resource"),Kc={tasker:new Uc,queue:new Uc({parallel:1}),map:{},get isComplete(){return Zc.tasker.isComplete},set(t,e){Zc.map[t]&&Gc.repeat(t),Zc.map[t]=e},get:t=>Zc.map[t],remove(t){const e=Zc.map[t];e&&(e.destroy&&e.destroy(),delete Zc.map[t])},loadImage(t,e){return new Promise((i,s)=>{const n=this.setImage(t,t,e);n.load(()=>i(n),t=>s(t))})},setImage(t,e,i){let s;return rr(e)?s={url:e}:e.url||(s={url:t,view:e}),s&&(i&&(s.format=i),e=na.image(s)),Zc.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){Zc.map={}}},Zc=Kc,$c={maxRecycled:10,recycledList:[],patternTasker:Kc.queue,get(t,e){let i=Kc.get(t.url);return i||Kc.set(t.url,i="film"===e?na.film(t):na.image(t)),i.use++,i},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||(Go.image.isLarge(t)?t.url&&Kc.remove(t.url):(t.clearLevels(),qc.recycledList.push(t)))})},recyclePaint(t){qc.recycle(t.image)},clearRecycled(t){const e=qc.recycledList;(e.length>qc.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&Kc.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Hc.alphaPixelTypes.some(e=>qc.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:i}=e;if(i.startsWith("data:")){if(i.startsWith("data:"+Hc.mimeType(t)))return!0}else{if(i.includes("."+t)||i.includes("."+Hc.upperCaseTypeMap[t]))return!0;if("png"===t&&!i.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},qc=$c,{IMAGE:Jc,create:Qc}=_r,td=class{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return sr(t)?Go.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=Qc(Jc),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}$c.isFormat("svg",t)&&(this.isSVG=!0),$c.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,i){return this.loading||(this.loading=!0,Kc.tasker.add(()=>pa(this,void 0,void 0,function*(){return yield Go.origin["load"+this.tag](this.getLoadUrl(i),this.crossOrigin,this).then(t=>{i&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const i=this.waitComplete;if(e){const e=i[t+1];e&&e({type:"stop"})}i[t]=i[t+1]=void 0}setView(t){this.ready=!0,this.width||(this.width=t.width,this.height=t.height,this.view=t),this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((i,s)=>{e=s%2,i&&(t?e||i(this):e&&i(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,i,s,n,r,o,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let i in t)if(t[i]!==arguments[i]){e=null;break}if(e)return e}const h=Go.image.resize(this.view,t,e,n,r,void 0,o,i,s,a);return this.cache=this.use>1?{data:h,params:arguments}:null,h}getPattern(t,e,i,s){const n=Go.canvas.createPattern(t,e);return Go.image.setPatternTransform(n,i,s),n}render(t,e,i,s,n,r,o,a,h){t.drawImage(this.view,e,i,s,n)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,i){}clearLevels(t){}destroyFilter(){}destroy(){this.clearLevels(),this.destroyFilter();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}};function ed(t,e,i,s){s||(i.configurable=i.enumerable=!0),Object.defineProperty(t,e,i)}function id(t,e){return Object.getOwnPropertyDescriptor(t,e)}function sd(t,e){return(i,s)=>function(t,e,i,s){ed(t,e,Object.assign({get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}},s||{})),bd(t,e,i)}(i,s,t,e&&e(s))}function nd(t){return sd(t)}function rd(t,e){return sd(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function od(t,e){return sd(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function ad(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),dd(this))}}))}function hd(t,e){return sd(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function ld(t,e){return sd(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function cd(t,e){return sd(t,t=>({set(i){this.__setAttr(t,i,e)&&dd(this)}}))}function dd(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}var ud=cd;function pd(t,e){return sd(t,t=>({set(i){this.__setAttr(t,i)&&(function(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&dd(t)}(this),e&&(this.__.__useStroke=!0))}}))}var gd=pd;function fd(t){return sd(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function _d(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function md(t){return sd(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;pr.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function vd(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function yd(t,e,i,s){t.__setAttr(e,i)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==s&&0!==i||dd(t))}function wd(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function xd(t){return(e,i)=>{ed(e,"__DataProcessor",{get:()=>t})}}function bd(t,e,i){const s=t.__DataProcessor.prototype,n="_"+e,r=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),o=function(t,e){const i="_"+t;return{get(){const t=this[i];return null==t?e:t},set(t){this[i]=t}}}(e,i);if(sr(i))o.get=function(){return this[n]};else if("function"==typeof i)o.get=function(){const t=this[n];return null==t?i(this.__leaf):t};else if(lr(i)){const t=function(t){return"{}"===JSON.stringify(t)}(i);o.get=function(){const e=this[n];return null==e?this[n]=t?{}:pr.clone(i):e}}const a=t.isBranchLeaf;"width"===e?o.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:a&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(o.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:a&&s.children.length?s.boxBounds.height:i}return t});let h,l=s;for(;!h&&l;)h=id(l,e),l=l.__proto__;h&&h.set&&(o.set=h.set),s[r]&&(o.set=s[r],delete s[r]),ed(s,e,o)}var kd=new $o("rewrite"),Sd=[],Ed=["destroy","constructor"];function Cd(t){return(e,i)=>{Sd.push({name:e.constructor.name+"."+i,run:()=>{e[i]=t}})}}function Od(){return t=>{Td()}}function Td(t){Sd.length&&(Sd.forEach(e=>{t&&kd.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Sd.length=0)}function Rd(t,e){return i=>{var s;(t.prototype?(s=t.prototype,Object.getOwnPropertyNames(s)):Object.keys(t)).forEach(s=>{Ed.includes(s)||e&&e.includes(s)||(t.prototype?id(t.prototype,s).writable&&(i.prototype[s]=t.prototype[s]):i.prototype[s]=t[s])})}}function Bd(){return t=>{oa.register(t)}}function Pd(){return t=>{la.register(t)}}setTimeout(()=>Td(!0));var{copy:Ld,toInnerPoint:Md,toOuterPoint:Dd,scaleOfOuter:Ad,rotateOfOuter:Id,skewOfOuter:Wd,multiplyParent:Fd,divideParent:zd,getLayout:Nd}=Ur,Vd={},{round:Hd}=Math,Yd={updateAllMatrix(t,e,i){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(i=!0),Ud(t,e,i),t.isBranch){const{children:s}=t;for(let t=0,n=s.length;t<n;t++)jd(s[t],e,i)}},updateMatrix(t,e,i){const s=t.__layout;e?i&&(s.waitAutoLayout=!0,t.__hasAutoLayout&&(s.matrixChanged=!1)):s.waitAutoLayout&&(s.waitAutoLayout=!1),s.matrixChanged&&t.__updateLocalMatrix(),s.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)Gd(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Gd(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&Xd.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(Zd(t),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)Kd(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,i,s,n,r){s||(s=t.__nowWorld),t.__worldFlipped||Go.fullImageShadow?e.copyWorldByReset(i,s,t.__nowWorld,n,r):e.copyWorldToInner(i,s,t.__layout.renderBounds,n)},renderComplex(t,e,i){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,i=0,s,n){const r=lr(e)?Object.assign({},e):{x:e,y:i};s?Dd(t.localTransform,r,r,!0):t.parent&&Md(t.parent.scrollWorldTransform,r,r,!0),Xd.moveLocal(t,r.x,r.y,n)},moveLocal(t,e,i=0,s){lr(e)&&(i=e.y,e=e.x),e+=t.x,i+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Hd(e),i=Hd(i)),s?t.animate({x:e,y:i},s):(t.x=e,t.y=i)},zoomOfWorld(t,e,i,s,n,r){Xd.zoomOfLocal(t,$d(t,e),i,s,n,r)},zoomOfLocal(t,e,i,s=i,n,r){const o=t.__localMatrix;if(ar(s)||(s&&(r=s),s=i),Ld(Vd,o),Ad(Vd,e,i,s),Xd.hasHighPosition(t))Xd.setTransform(t,Vd,n,r);else{const e=t.x+Vd.e-o.e,a=t.y+Vd.f-o.f;r&&!n?t.animate({x:e,y:a,scaleX:t.scaleX*i,scaleY:t.scaleY*s},r):(t.x=e,t.y=a,t.scaleResize(i,s,!0!==n))}},rotateOfWorld(t,e,i,s){Xd.rotateOfLocal(t,$d(t,e),i,s)},rotateOfLocal(t,e,i,s){const n=t.__localMatrix;Ld(Vd,n),Id(Vd,e,i),Xd.hasHighPosition(t)?Xd.setTransform(t,Vd,!1,s):t.set({x:t.x+Vd.e-n.e,y:t.y+Vd.f-n.f,rotation:Pr.formatRotation(t.rotation+i)},s)},skewOfWorld(t,e,i,s,n,r){Xd.skewOfLocal(t,$d(t,e),i,s,n,r)},skewOfLocal(t,e,i,s=0,n,r){Ld(Vd,t.__localMatrix),Wd(Vd,e,i,s),Xd.setTransform(t,Vd,n,r)},transformWorld(t,e,i,s){Ld(Vd,t.worldTransform),Fd(Vd,e),t.parent&&zd(Vd,t.parent.scrollWorldTransform),Xd.setTransform(t,Vd,i,s)},transform(t,e,i,s){Ld(Vd,t.localTransform),Fd(Vd,e),Xd.setTransform(t,Vd,i,s)},setTransform(t,e,i,s){const n=t.__,r=n.origin&&Xd.getInnerOrigin(t,n.origin),o=Nd(e,r,n.around&&Xd.getInnerOrigin(t,n.around));if(Xd.hasOffset(t)&&(o.x-=n.offsetX,o.y-=n.offsetY),i){const e=o.scaleX/t.scaleX,i=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,r){Io.scale(t.boxBounds,Math.abs(e),Math.abs(i));const s=Xd.getInnerOrigin(t,n.origin);no.move(o,r.x-s.x,r.y-s.y)}t.set(o),t.scaleResize(e,i,!1)}else t.set(o,s)},getFlipTransform(t,e){const i={a:1,b:0,c:0,d:1,e:0,f:0},s="x"===e?1:-1;return Ad(i,Xd.getLocalOrigin(t,"center"),-1*s,1*s),i},getLocalOrigin:(t,e)=>no.tempToOuterOf(Xd.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const i={};return _o.toPoint(e,t.boxBounds,i),i},getRelativeWorld:(t,e,i)=>(Ld(Vd,t.worldTransform),zd(Vd,e.scrollWorldTransform),i?Vd:Object.assign({},Vd)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,i,s){t.setTransform(Xd.getRelativeWorld(t,e,!0),s),e.add(t,i)},hasHighPosition:t=>t.origin||t.around||Xd.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,i=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const s=e.x*i,n=e.y*i;e.x-=s,e.y-=n,t.move(s,n),Go.requestRender(()=>Xd.animateMove(t,e,i))}}},Xd=Yd,{updateAllMatrix:jd,updateMatrix:Ud,updateAllWorldOpacity:Gd,updateAllChange:Kd,updateChange:Zd}=Xd;function $d(t,e){return t.updateLayout(),t.parent?no.tempToInnerOf(e,t.parent.scrollWorldTransform):e}var qd,Jd={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds(t){const{__:e,__layout:i}=t;return e.eraser||0===e.visible?null:i.localOuterBounds||i.localRenderBounds},maskLocalBoxBounds:(t,e)=>Qd(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>Qd(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:i}=t;return Qd(t,e)&&(i.localOuterBounds||i.localRenderBounds)},excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};function Qd(t,e){return e||(qd=0),t.__.mask&&(qd=1),qd<0?null:(qd&&(qd=-1),!0)}var{updateBounds:tu}=Yd,eu={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:i}=t;for(let s=0,n=i.length;s<n;s++)(t=i[s]).isBranch&&(t.__tempNumber=1,e.add(t),iu(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&sr(i[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let i=e.length;const{children:s}=t;for(let n=0,r=s.length;n<r;n++)s[n].isBranch&&e.push(s[n]);for(let n=i,r=e.length;n<r;n++)su(e[n],e)},updateBounds(t,e){const i=[t];su(t,i),nu(i,e)},updateBoundsByBranchStack(t,e){let i,s;for(let n=t.length-1;n>-1;n--){i=t[n],s=i.children;for(let t=0,e=s.length;t<e;t++)tu(s[t]);e&&e===i||tu(i)}},move(t,e,i){let s;const{children:n}=t;for(let r=0,o=n.length;r<o;r++)s=(t=n[r]).__world,s.e+=e,s.f+=i,s.x+=e,s.y+=i,t.isBranch&&ru(t,e,i)},scale(t,e,i,s,n,r,o){let a;const{children:h}=t,l=s-1,c=n-1;for(let d=0,u=h.length;d<u;d++)a=(t=h[d]).__world,a.a*=s,a.d*=n,(a.b||a.c)&&(a.b*=s,a.c*=n),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-r)*l+e,a.y=a.f+=(a.f-o)*c+i):(a.e+=(a.e-r)*l+e,a.f+=(a.f-o)*c+i,a.x+=(a.x-r)*l+e,a.y+=(a.y-o)*c+i),a.width*=s,a.height*=n,a.scaleX*=s,a.scaleY*=n,t.isBranch&&ou(t,e,i,s,n,r,o)}},{pushAllChildBranch:iu,pushAllBranchStack:su,updateBoundsByBranchStack:nu,move:ru,scale:ou}=eu,au={run(t){if(t&&t.length){const e=t.length;for(let i=0;i<e;i++)t[i]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:hu,updateBounds:lu}=Yd,{toOuterOf:cu,getPoints:du,copy:uu}=Io,pu="_localContentBounds",gu="_worldContentBounds",fu="_worldBoxBounds",_u="_worldStrokeBounds",mu=class{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return cu(this.contentBounds,this.leaf.__localMatrix,this[pu]||(this[pu]={})),this[pu]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return cu(this.contentBounds,this.leaf.__world,this[gu]||(this[gu]={})),this[gu]}get worldBoxBounds(){return cu(this.boxBounds,this.leaf.__world,this[fu]||(this[fu]={})),this[fu]}get worldStrokeBounds(){return cu(this.strokeBounds,this.leaf.__world,this[_u]||(this[_u]={})),this[_u]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return lu(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const i=e;if(i.__fullLayouting)return;i.__fullLayouting=!0,Go.layout(i),delete i.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return Ur.defaultMatrix;case"page":t=e.zoomLayer;default:return hu(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new No(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",i){const{leaf:s}=this;let n,r,o,a=this.getInnerBounds(t);switch(e){case"world":n=s.getWorldPoint(a),r=s.__world;break;case"local":const{scaleX:t,scaleY:i,rotation:h,skewX:l,skewY:c}=s.__;o={scaleX:t,scaleY:i,rotation:h,skewX:l,skewY:c},n=s.getLocalPointByInner(a);break;case"inner":n=a,r=Ur.defaultMatrix;break;case"page":e=s.zoomLayer;default:n=s.getWorldPoint(a,e),r=hu(s,e,!0)}if(o||(o=Ur.getLayout(r)),uu(o,a),no.copy(o,n),i){const{scaleX:t,scaleY:e}=o,i=Math.abs(t),s=Math.abs(e);1===i&&1===s||(o.scaleX/=i,o.scaleY/=s,o.width*=i,o.height*=s)}return o}getLayoutPoints(t,e="world"){const{leaf:i}=this,s=du(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:n=e}return sr(n)||s.forEach(t=>i.innerToWorld(t,null,!1,n)),s}shrinkContent(){const{x:t,y:e,width:i,height:s}=this.boxBounds;this._contentBounds={x:t,y:e,width:i,height:s}}spreadStroke(){const{x:t,y:e,width:i,height:s}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:i,height:s},this._localStrokeBounds={x:t,y:e,width:i,height:s},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:i,height:s}=this.renderBounds;this._renderBounds={x:t,y:e,width:i,height:s},this._localRenderBounds={x:t,y:e,width:i,height:s}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}},vu=class{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&Go.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&Go.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&Go.event.stop(this.origin)}},yu=class extends vu{constructor(t,e,i){super(t,e),this.parent=i,this.child=e}};yu.ADD="child.add",yu.REMOVE="child.remove",yu.CREATED="created",yu.MOUNTED="mounted",yu.UNMOUNTED="unmounted",yu.DESTROY="destroy";var wu="property.scroll",xu=class extends vu{constructor(t,e,i,s,n){super(t,e),this.attrName=i,this.oldValue=s,this.newValue=n}};xu.CHANGE="property.change",xu.LEAFER_CHANGE="property.leafer_change",xu.SCROLL=wu;var bu={scrollX:wu,scrollY:wu},ku=class extends vu{constructor(t,e){super(t),Object.assign(this,e)}};ku.LOAD="image.load",ku.LOADED="image.loaded",ku.ERROR="image.error";var Su=class extends vu{static checkHas(t,e,i){"on"===i?e===Tu?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Eu)||t.hasEvent(Cu)||t.hasEvent(Ou),t.__hasWorldEvent=t.hasEvent(Tu))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Eu,t),"inner"===e&&t.emit(Cu,t)),t.emit(Ou,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Tu,t)}};Su.RESIZE="bounds.resize",Su.INNER="bounds.inner",Su.LOCAL="bounds.local",Su.WORLD="bounds.world";var{RESIZE:Eu,INNER:Cu,LOCAL:Ou,WORLD:Tu}=Su,Ru={};[Eu,Cu,Ou,Tu].forEach(t=>Ru[t]=1);var Bu=class t extends vu{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(e,i){lr(e)?(super(t.RESIZE),Object.assign(this,e)):super(e),this.old=i}static isResizing(t){return this.resizingKeys&&!sr(this.resizingKeys[t.innerId])}};Bu.RESIZE="resize";var Pu=class extends vu{constructor(t,e){super(t),this.data=e}};Pu.REQUEST="watch.request",Pu.DATA="watch.data";var Lu=class extends vu{constructor(t,e,i){super(t),e&&(this.data=e,this.times=i)}};Lu.REQUEST="layout.request",Lu.START="layout.start",Lu.BEFORE="layout.before",Lu.LAYOUT="layout",Lu.AFTER="layout.after",Lu.AGAIN="layout.again",Lu.END="layout.end";var Mu=class extends vu{constructor(t,e,i,s){super(t),e&&(this.times=e),i&&(this.renderBounds=i,this.renderOptions=s)}};Mu.REQUEST="render.request",Mu.CHILD_START="render.child_start",Mu.CHILD_END="render.child_end",Mu.START="render.start",Mu.BEFORE="render.before",Mu.RENDER="render",Mu.AFTER="render.after",Mu.AGAIN="render.again",Mu.END="render.end",Mu.NEXT="render.next";var Du=class extends vu{};Du.START="leafer.start",Du.BEFORE_READY="leafer.before_ready",Du.READY="leafer.ready",Du.AFTER_READY="leafer.after_ready",Du.VIEW_READY="leafer.view_ready",Du.VIEW_COMPLETED="leafer.view_completed",Du.STOP="leafer.stop",Du.RESTART="leafer.restart",Du.END="leafer.end",Du.UPDATE_MODE="leafer.update_mode",Du.TRANSFORM="leafer.transform",Du.MOVE="leafer.move",Du.SCALE="leafer.scale",Du.ROTATE="leafer.rotate",Du.SKEW="leafer.skew";var{MOVE:Au,SCALE:Iu,ROTATE:Wu,SKEW:Fu}=Du,zu={x:Au,y:Au,scaleX:Iu,scaleY:Iu,rotation:Wu,skewX:Fu,skewY:Fu},Nu={};function Vu(t,e,i){if(e){const{__captureMap:e}=t;return e||(i?t.__captureMap={}:Nu)}{const{__bubbleMap:e}=t;return e||(i?t.__bubbleMap={}:Nu)}}var{on:Hu,on_:Yu,off:Xu,off_:ju,once:Uu,emit:Gu,emitEvent:Ku,hasEvent:Zu,destroy:$u}=class{set event(t){this.on(t)}on(t,e,i){if(!e){let e;if(hr(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let i in t)hr(e=t[i])?this.on(i,e[0],e[1]):this.on(i,e);return}let s,n,r;i&&("once"===i?n=!0:"boolean"==typeof i?s=i:(s=i.capture,n=i.once));const o=Vu(this,s,!0),a=rr(t)?t.split(" "):t,h=n?{listener:e,once:n}:{listener:e};a.forEach(t=>{t&&(r=o[t],r?-1===r.findIndex(t=>t.listener===e)&&r.push(h):o[t]=[h],Ru[t]&&Su.checkHas(this,t,"on"))})}off(t,e,i){if(t){const s=rr(t)?t.split(" "):t;if(e){let t,n,r;i&&(t="boolean"==typeof i?i:"once"!==i&&i.capture);const o=Vu(this,t);s.forEach(t=>{t&&(n=o[t],n&&(r=n.findIndex(t=>t.listener===e),r>-1&&n.splice(r,1),n.length||delete o[t],Ru[t]&&Su.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;s.forEach(i=>{t&&delete t[i],e&&delete e[i]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,i,s){return e?this.on(t,i?e=e.bind(i):e,s):hr(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:s}}off_(t){if(!t)return;const e=hr(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):hr(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,i,s){if(!e)return hr(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));lr(i)?e=e.bind(i):s=i,this.on(t,e,{once:!0,capture:s})}emit(t,e,i){!e&&la.has(t)&&(e=la.get(t,{type:t,target:this,current:this}));const s=Vu(this,i)[t];if(s){let n;for(let r=0,o=s.length;r<o&&!((n=s[r])&&(n.listener(e),n.once&&(this.off(t,n.listener,i),r--,o--),e&&e.isStopNow));r++);}this.syncEventer&&this.syncEventer.emitEvent(e,i)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:i,__captureMap:s}=this,n=i&&i[t],r=s&&s[t];return!!(sr(e)?n||r:e?r:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}.prototype,qu={on:Hu,on_:Yu,off:Xu,off_:ju,once:Uu,emit:Gu,emitEvent:Ku,hasEvent:Zu,destroyEventer:$u},Ju=$o.get("setAttr"),Qu={__setAttr(t,e,i){if(this.leaferIsCreated){const s=this.__.__getInput(t);if(!i||or(e)||sr(e)||(Ju.warn(this.innerName,t,e),e=void 0),lr(e)||s!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new xu(xu.LEAFER_CHANGE,this,t,s,e));const i=zu[t];i&&(this.emitEvent(new Du(i,this)),this.emitEvent(new Du(Du.TRANSFORM,this)))}this.emitPropertyEvent(xu.CHANGE,t,s,e);const i=bu[t];return i&&this.emitPropertyEvent(i,t,s,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,i,s){const n=new xu(t,this,e,i,s);this.isLeafer||this.hasEvent(t)&&this.emitEvent(n),this.leafer.emitEvent(n)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||sr(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:tp,multiplyParent:ep,translateInner:ip,defaultWorld:sp}=Ur,{toPoint:np,tempPoint:rp}=_o,op={__updateWorldMatrix(){const{parent:t,__layout:e,__world:i,__scrollWorld:s,__:n}=this;ep(this.__local||e,t?t.__scrollWorld||t.__world:sp,i,!!e.affectScaleOrRotation,n),s&&ip(Object.assign(s,i),n.scrollX,n.scrollY),e.scaleFixed&&Yd.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,i=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(tp(e,i,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=i.x+i.offsetX,e.f=i.y+i.offsetY,(i.around||i.origin)&&(np(i.around||i.origin,t.boxBounds,rp),ip(e,-rp.x,-rp.y,!i.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:ap,updateAllMatrix:hp}=Yd,{updateBounds:lp}=eu,{toOuterOf:cp,copyAndSpread:dp,copy:up}=Io,{toBounds:pp}=Bc,gp={__updateWorldBounds(){const{__layout:t,__world:e}=this;cp(t.renderBounds,e,e),this.__hasComplex&&Yd.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Su.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Su.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.outerScale&&Yd.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),cp(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){cp(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){cp(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const i=this.__layout.boxBounds,s=this.__;s.__usePathBox?pp(s.path,i):(i.x=0,i.y=0,i.width=s.width,i.height=s.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),hp(this),lp(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(hp(this),lp(this,this))):ap(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;dp(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:i}=e;ar(i)&&i<=0?up(e.renderBounds,e.strokeBounds):dp(e.renderBounds,e.boxBounds,i)}},fp={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const i=this.__;if(i.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.ignoreOpacity?1:e.dimOpacity&&!i.dimskip?i.opacity*e.dimOpacity:i.opacity,this.__.__single){if("path"===i.eraser)return this.__renderEraser(t,e);const s=t.getSameCanvas(!0,!0);this.__draw(s,e,t),Yd.copyCanvasByWorld(this,t,s,this.__nowWorld,i.__blendMode,!0),s.recycle(this.__nowWorld)}else this.__draw(t,e);$o.showBounds&&$o.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:_p}=Jd,{hasSize:mp}=Io,vp={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){const i=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&mp(i)){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const n=t.getSameCanvas(!1,!0);this.__renderBranch(n,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(n,i,i,s.__blendMode,!0),n.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let i;const{children:s}=this;for(let n=0,r=s.length;n<r;n++)i=s[n],_p(i,e)||(i.__hasComplex?Yd.renderComplex(i,t,e):i.__render(t,e))}},__clip(t,e){if(this.__worldOpacity){const{children:i}=this;for(let s=0,n=i.length;s<n;s++)_p(i[s],e)||i[s].__clip(t,e)}}},{LEAF:yp,create:wp}=_r,{stintSet:xp}=pr,{toInnerPoint:bp,toOuterPoint:kp,multiplyParent:Sp}=Ur,{toOuterOf:Ep}=Io,{copy:Cp,move:Op}=no,{getScaleFixedData:Tp}=Pr,{moveLocal:Rp,zoomOfLocal:Bp,rotateOfLocal:Pp,skewOfLocal:Lp,moveWorld:Mp,zoomOfWorld:Dp,rotateOfWorld:Ap,skewOfWorld:Ip,transform:Wp,transformWorld:Fp,setTransform:zp,getFlipTransform:Np,getLocalOrigin:Vp,getRelativeWorld:Hp,drop:Yp}=Yd,Xp=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return fr}get __LayoutProcessor(){return mu}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=wp(yp),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(yu.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(yu.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(yu.MOUNTED,t,"once")}nextRender(t,e,i){this.leafer?this.leafer.nextRender(t,e,i):this.waitLeafer(()=>this.leafer.nextRender(t,e,i))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(yu.MOUNTED),t.cacheId&&Yd.cacheId(this)):this.__emitLifeEvent(yu.UNMOUNTED),this.isBranch){const{children:e}=this;for(let i=0,s=e.length;i<s;i++)e[i].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){sr(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=sr(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:i}=this.__layout;t.clearRect(i.x,i.y,i.width,i.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,i=this.__world;return Sp(i,t.matrix,e,void 0,i),Ep(this.__layout.renderBounds,e,e),xp(e,"half",i.half),xp(e,"ignorePixelSnap",i.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e,i=!0){return Tp($c.patternLocked?this.__world:this.__nowWorld||this.__world,e,i,t)}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,i){return this.__layout.getLayoutBounds(t,e,i)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,i){const s=e?Hp(this,e):this.worldTransform,n=i?t:{};return Ep(t,s,n),n}worldToLocal(t,e,i,s){this.parent?this.parent.worldToInner(t,e,i,s):e&&Cp(e,t)}localToWorld(t,e,i,s){this.parent?this.parent.innerToWorld(t,e,i,s):e&&Cp(e,t)}worldToInner(t,e,i,s){s&&(s.innerToWorld(t,e,i),t=e||t),bp(this.worldTransform,t,e,i)}innerToWorld(t,e,i,s){kp(this.worldTransform,t,e,i),s&&s.worldToInner(e||t,null,i)}getBoxPoint(t,e,i,s){const n=this.getInnerPoint(t,e,i,s);return i?n:this.getBoxPointByInner(n,null,null,!0)}getBoxPointByInner(t,e,i,s){const n=s?t:Object.assign({},t),{x:r,y:o}=this.boxBounds;return Op(n,-r,-o),n}getInnerPoint(t,e,i,s){const n=s?t:{};return this.worldToInner(t,n,i,e),n}getInnerPointByBox(t,e,i,s){const n=s?t:Object.assign({},t),{x:r,y:o}=this.boxBounds;return Op(n,r,o),n}getInnerPointByLocal(t,e,i,s){return this.getInnerPoint(t,this.parent,i,s)}getLocalPoint(t,e,i,s){const n=s?t:{};return this.worldToLocal(t,n,i,e),n}getLocalPointByInner(t,e,i,s){return this.getWorldPoint(t,this.parent,i,s)}getPagePoint(t,e,i,s){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,i,s)}getWorldPoint(t,e,i,s){const n=s?t:{};return this.innerToWorld(t,n,i,e),n}getWorldPointByBox(t,e,i,s){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,s),e,i,!0)}getWorldPointByLocal(t,e,i,s){const n=s?t:{};return this.localToWorld(t,n,i,e),n}getWorldPointByPage(t,e,i,s){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,i,s)}setTransform(t,e,i){zp(this,t,e,i)}transform(t,e,i){Wp(this,t,e,i)}move(t,e,i){Rp(this,t,e,i)}moveInner(t,e,i){Mp(this,t,e,!0,i)}scaleOf(t,e,i,s,n){Bp(this,Vp(this,t),e,i,s,n)}rotateOf(t,e,i){Pp(this,Vp(this,t),e,i)}skewOf(t,e,i,s,n){Lp(this,Vp(this,t),e,i,s,n)}transformWorld(t,e,i){Fp(this,t,e,i)}moveWorld(t,e,i){Mp(this,t,e,!1,i)}scaleOfWorld(t,e,i,s,n){Dp(this,t,e,i,s,n)}rotateOfWorld(t,e){Ap(this,t,e)}skewOfWorld(t,e,i,s,n){Ip(this,t,e,i,s,n)}flip(t,e){Wp(this,Np(this,t),!1,e)}scaleResize(t,e=t,i){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t,e){return!0}__hit(t,e){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,i){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(t){}getMotionPathData(){return sa.need("path")}getMotionPoint(t){return sa.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,i){Yp(this,t,e,i)}on(t,e,i){}off(t,e,i){}on_(t,e,i,s){}off_(t){}once(t,e,i,s){}emit(t,e,i){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,i){i?this.addAttr(t,e,i):bd(this.prototype,t,e)}static addAttr(t,e,i,s){i||(i=cd),i(e,s)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new yu(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(yu.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Xp=ua([Rd(Qu),Rd(op),Rd(gp),Rd(qu),Rd(fp)],Xp);var{setListWithFn:jp}=Io,{sort:Up}=eu,{localBoxBounds:Gp,localStrokeBounds:Kp,localRenderBounds:Zp,maskLocalBoxBounds:$p,maskLocalStrokeBounds:qp,maskLocalRenderBounds:Jp}=Jd,Qp=new $o("Branch"),tg=class extends Xp{__updateStrokeSpread(){const{children:t}=this;for(let e=0,i=t.length;e<i;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let t;const{children:e}=this;for(let i=0,s=e.length;i<s;i++)if(t=e[i].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){jp(e||this.__layout.boxBounds,this.children,this.__hasMask?$p:Gp)}__updateStrokeBounds(t){jp(t||this.__layout.strokeBounds,this.children,this.__hasMask?qp:Kp)}__updateRenderBounds(t){jp(t||this.__layout.renderBounds,this.children,this.__hasMask?Jp:Zp)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let i=0,s=e.length;i<s;i++)e[i].__tempNumber=i,e[i].__.zIndex&&(t=!0);e.sort(Up),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return Qp.warn("add self or destroyed");const i=sr(e);if(!t.__){if(hr(t))return t.forEach(t=>{this.add(t,e),i||e++});if(!(t=oa.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,i?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const s=t.__layout;s.boxChanged||s.boxChange(),s.matrixChanged||s.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(yu.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(yu.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):sr(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const i=this.children.indexOf(t);i>-1&&(this.children.splice(i,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(yu.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(yu.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const i=new yu(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),this.leafer.emitEvent(i)}};tg=ua([Rd(vp)],tg);var eg=class t{get length(){return this.list.length}constructor(t){this.reset(),t&&(hr(t)?this.addList(t):this.add(t))}has(t){return t&&!sr(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return sr(e)?-1:e}add(t){const{list:e,keys:i}=this;sr(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(sr(i[t.innerId])){const{list:s}=this;for(let t=e,n=s.length;t<n;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let s=0,n=e.length;s<n;s++)sr(i)?e[s].innerId===t.innerId&&(i=s,delete this.keys[t.innerId]):this.keys[e[s].innerId]=s-1;sr(i)||e.splice(i,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const e=new t;return e.list=[...this.list],e.keys=Object.assign({},this.keys),e}update(){this.keys={};const{list:t,keys:e}=this;for(let i=0,s=t.length;i<s;i++)e[t[i].innerId]=i}reset(){this.list=[],this.keys={}}destroy(){this.reset()}},ig=class{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(hr(t)?this.addList(t):this.add(t))}has(t){return!sr(this.keys[t.innerId])}without(t){return sr(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:i}=this;e[t.innerId]||(e[t.innerId]=1,i[t.__level]?i[t.__level].push(t):(i[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(i=>{e=this.levelMap[i];for(let s=0,n=e.length;s<n;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}};function sg(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o}function ng(t){return sd(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const i=this.__layout;i.renderChanged||i.renderChange(),i.surfaceChange()}}))}function rg(t){return sd(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}var og={},ag={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},hg=Yo,lg={},cg={},dg={},ug={},pg={},gg={apply(){sa.need("filter")}},fg={},_g={setStyleName:()=>sa.need("state"),set:()=>sa.need("state")},{parse:mg,objectToCanvasData:vg}=tl,{stintSet:yg}=pr,{hasTransparent:wg}=ag,xg={originPaint:{}},bg=$o.get("UIData"),kg=class extends fr{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this,e=t.__hasStrokeSides||t.strokeWidth;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,e):e}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return null==this._width}get __autoHeight(){return null==this._height}get __autoSide(){return null==this._width||null==this._height}get __autoSize(){return null==this._width&&null==this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,bg.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,bg.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),rr(t)||!t?(yg(this,"__isTransparentFill",wg(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):lr(t)&&this.__setPaint("fill",t)}setStroke(t){rr(t)||!t?(yg(this,"__isTransparentStroke",wg(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):lr(t)&&this.__setPaint("stroke",t)}setPath(t){const e=rr(t);e||t&&lr(t[0])?(this.__setInput("path",t),this._path=e?mg(t):vg(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Sg(this,"shadow",t)}setInnerShadow(t){Sg(this,"innerShadow",t)}setFilter(t){Sg(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&cg.compute("fill",this.__leaf),e&&cg.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),sr(t.strokeScaleFixed)||(i=t.strokeScaleFixed)),i){const{scaleX:t}=this.__leaf.getRenderScaleData(!0,i,!1);if(1!==t)return e*t}return e}__checkComplex(){const t=this;yg(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),hr(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=xg)):(this.__isStrokes=!0,this._stroke||(this._stroke=xg))}__removePaint(t,e){e&&this.__removeInput(t),dg.recycleImage(t,this),"fill"===t?(yg(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(yg(this,"__isAlphaPixelStroke",void 0),yg(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}};function Sg(t,e,i){t.__setInput(e,i),hr(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}var Eg=class extends kg{},Cg=class extends Eg{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}},Og=class extends kg{get __usePathBox(){return this.points||this.__pathInputed}},Tg=class extends kg{get __boxStroke(){return!this.__pathInputed}},Rg={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900},{max:Bg,add:Pg}=wr,Lg={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:n}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&n&&"inside"!==s&&(e=t="center"===s?n/2:n,!i.__boxStroke||i.__useArrow)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:n;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*n),r&&(t=Bg(t,r.__layout.strokeSpread=r.__updateStrokeSpread()),e=Math.max(e,r.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:n,filter:r,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=pg.getShadowRenderSpread(this,e)),s&&(t=Bg(t,s)),r&&(t=Pg(t,gg.getSpread(r))),o&&(t=Pg(t,o)),a&&(t=Pg(t,a));let l=t;return i&&(l=Bg(l,pg.getInnerShadowSpread(this,i))),n&&(l=Bg(l,n)),this.__layout.renderShapeSpread=l,h?Bg(h.__updateRenderSpread(),t):t}},{stintSet:Mg}=pr,Dg={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Mg(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Mg(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,n=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Mg(t,"__isFastShadow",e&&!n&&e.length<2&&!e[0].spread&&!pg.isTransformShadow(e[0])&&i&&!t.__isTransparentFill&&!(hr(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!n)}t.__checkSingle(),t.__checkComplex()},__drawFast(t,e){Ag(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:n,stroke:r,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=s;if(this.__drawRenderPath(t),s.__useEffect&&!h){const h=cg.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:c,filter:d}=s;l&&pg.shadow(this,t,h),a&&(s.__isStrokes?cg.strokes(r,this,t,e):cg.stroke(r,this,t,e)),n&&(s.__isFills?cg.fills(n,this,t,e):cg.fill(n,this,t,e)),o&&this.__drawAfterFill(t,e),c&&pg.innerShadow(this,t,h),r&&!a&&(s.__isStrokes?cg.strokes(r,this,t,e):cg.stroke(r,this,t,e)),d&&gg.apply(d,this,this.__nowWorld,t,i,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(s.__isStrokes?cg.strokes(r,this,t,e):cg.stroke(r,this,t,e)),h){const e=s.shadow[0],{scaleX:i,scaleY:n}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*n,e.blur*i,ag.string(e.color))}n&&(s.__isFills?cg.fills(n,this,t,e):cg.fill(n,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),r&&!a&&(s.__isStrokes?cg.strokes(r,this,t,e):cg.stroke(r,this,t,e))}}else s.__pathForRender?Ag(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:n}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?cg.fills(s,this,t,e):cg.fill("#000000",this,t,e)),i.__isCanvas&&this.__drawAfterFill(t,e),n&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?cg.strokes(n,this,t,e):cg.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Ag(t,e,i){const{fill:s,stroke:n,__drawAfterFill:r,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&cg.stroke(n,t,e,i),s&&cg.fill(s,t,e,i),r&&t.__drawAfterFill(e,i),n&&!o&&cg.stroke(n,t,e,i)}var Ig,Wg={__drawFast(t,e){let{x:i,y:s,width:n,height:r}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(i,s,n,r)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,n,r);break;case"inside":n-=h,r-=h,n<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+l,s+l,n,r),t.restore()):t.strokeRect(i+l,s+l,n,r);break;case"outside":t.strokeRect(i-l,s-l,n+h,r+h)}}}},Fg=Ig=class extends Xp{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set strokeWidthFixed(t){this.strokeScaleFixed=t}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(t){Pr.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return zc.set(this.path=t||[]),t||this.__drawPathByBox(zc),zc}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return rr(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}clearProxyData(){}find(t,e){return sa.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return sa.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(zc.set(i=[]),this.__drawPathByBox(zc,!e)),t?tl.toCanvasData(i,!0):i}getPathString(t,e,i){return tl.stringify(this.getPath(t,e),i)}asPath(t,e){this.path=this.getPath(t,e)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||fg.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius||e.path.radius?Wc.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&lg.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&lg.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path,!0)}__drawPathByData(t,e,i){e?ec.drawPathByData(t,e):this.__drawPathByBox(t,i)}__drawPathByBox(t,e){const{x:i,y:s,width:n,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(i,s,n,r,ar(e)?[e]:e)}else t.rect(i,s,n,r);t.closePath()}drawImagePlaceholder(t,e,i){cg.fill(this.__.placeholderColor,this,e,i)}animate(t,e,i,s){return this.set(t),sa.need("animate")}killAnimate(t,e){}export(t,e){return sa.need("export")}syncExport(t,e){return sa.need("export")}clone(t){const e=pr.clone(this.toJSON());return t&&Object.assign(e,t),Ig.one(e)}static one(t,e,i,s,n){return oa.get(t.tag||this.prototype.__tag,t,e,i,s,n)}static registerUI(){Bd()(this)}static registerData(t){xd(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.__.__willDestroy=!0,this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};sg([xd(kg)],Fg.prototype,"__",void 0),sg([(t,e)=>{const i="_"+e;ed(t,e,{set(t){this.isLeafer&&(this[i]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[i]||this:this.leafer&&this.leafer.zoomLayer}})}],Fg.prototype,"zoomLayer",void 0),sg([nd("")],Fg.prototype,"id",void 0),sg([nd("")],Fg.prototype,"name",void 0),sg([nd("")],Fg.prototype,"className",void 0),sg([_d("pass-through")],Fg.prototype,"blendMode",void 0),sg([function(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&vd(this)}}))}(1)],Fg.prototype,"opacity",void 0),sg([function(t){return sd(t,t=>({set(e){const i=this.visible;if(!0===i&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>yd(this,t,e,i))}else 0===i&&!0===e&&this.animation&&this.__runAnimation("in");yd(this,t,e,i),this.mask&&vd(this)}}))}(!0)],Fg.prototype,"visible",void 0),sg([_d(!1)],Fg.prototype,"locked",void 0),sg([md(!1)],Fg.prototype,"dim",void 0),sg([md(!1)],Fg.prototype,"dimskip",void 0),sg([function(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__layout.childrenSortChange()})}}))}(0)],Fg.prototype,"zIndex",void 0),sg([function(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}(!1)],Fg.prototype,"mask",void 0),sg([function(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}(!1)],Fg.prototype,"eraser",void 0),sg([rd(0,!0)],Fg.prototype,"x",void 0),sg([rd(0,!0)],Fg.prototype,"y",void 0),sg([cd(100,!0)],Fg.prototype,"width",void 0),sg([cd(100,!0)],Fg.prototype,"height",void 0),sg([hd(1,!0)],Fg.prototype,"scaleX",void 0),sg([hd(1,!0)],Fg.prototype,"scaleY",void 0),sg([ld(0,!0)],Fg.prototype,"rotation",void 0),sg([ld(0,!0)],Fg.prototype,"skewX",void 0),sg([ld(0,!0)],Fg.prototype,"skewY",void 0),sg([rd(0,!0)],Fg.prototype,"offsetX",void 0),sg([rd(0,!0)],Fg.prototype,"offsetY",void 0),sg([od(0,!0)],Fg.prototype,"scrollX",void 0),sg([od(0,!0)],Fg.prototype,"scrollY",void 0),sg([ad()],Fg.prototype,"origin",void 0),sg([ad()],Fg.prototype,"around",void 0),sg([nd(!1)],Fg.prototype,"lazy",void 0),sg([function(t){return sd(t,t=>({set(e){this.__setAttr(t,e)&&(dd(this),this.__.__removeNaturalSize())}}))}(1)],Fg.prototype,"pixelRatio",void 0),sg([fd(0)],Fg.prototype,"renderSpread",void 0),sg([function(t){return sd(t,t=>({set(e){const i=this.__;2!==i.__pathInputed&&(i.__pathInputed=e?1:0),e||(i.__pathForRender=void 0),this.__setAttr(t,e),dd(this)}}))}()],Fg.prototype,"path",void 0),sg([ud()],Fg.prototype,"windingRule",void 0),sg([ud(!0)],Fg.prototype,"closed",void 0),sg([cd(0)],Fg.prototype,"padding",void 0),sg([cd(!1)],Fg.prototype,"lockRatio",void 0),sg([cd()],Fg.prototype,"widthRange",void 0),sg([cd()],Fg.prototype,"heightRange",void 0),sg([nd(!1)],Fg.prototype,"draggable",void 0),sg([nd()],Fg.prototype,"dragBounds",void 0),sg([nd("auto")],Fg.prototype,"dragBoundsType",void 0),sg([nd(!1)],Fg.prototype,"editable",void 0),sg([wd(!0)],Fg.prototype,"hittable",void 0),sg([wd("path")],Fg.prototype,"hitFill",void 0),sg([gd("path")],Fg.prototype,"hitStroke",void 0),sg([wd(!1)],Fg.prototype,"hitBox",void 0),sg([wd(!0)],Fg.prototype,"hitChildren",void 0),sg([wd(!0)],Fg.prototype,"hitSelf",void 0),sg([wd()],Fg.prototype,"hitRadius",void 0),sg([function(t){return sd(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}("")],Fg.prototype,"cursor",void 0),sg([_d()],Fg.prototype,"fill",void 0),sg([gd(void 0,!0)],Fg.prototype,"stroke",void 0),sg([gd("inside")],Fg.prototype,"strokeAlign",void 0),sg([gd(1,!0)],Fg.prototype,"strokeWidth",void 0),sg([gd(!1)],Fg.prototype,"strokeScaleFixed",void 0),sg([gd("none")],Fg.prototype,"strokeCap",void 0),sg([gd("miter")],Fg.prototype,"strokeJoin",void 0),sg([gd()],Fg.prototype,"dashPattern",void 0),sg([gd(0)],Fg.prototype,"dashOffset",void 0),sg([gd(10)],Fg.prototype,"miterLimit",void 0),sg([ud(0)],Fg.prototype,"cornerRadius",void 0),sg([ud()],Fg.prototype,"cornerSmoothing",void 0),sg([ng()],Fg.prototype,"shadow",void 0),sg([ng()],Fg.prototype,"innerShadow",void 0),sg([ng()],Fg.prototype,"blur",void 0),sg([ng()],Fg.prototype,"backgroundBlur",void 0),sg([ng()],Fg.prototype,"grayscale",void 0),sg([ng()],Fg.prototype,"filter",void 0),sg([_d()],Fg.prototype,"placeholderColor",void 0),sg([nd(100)],Fg.prototype,"placeholderDelay",void 0),sg([nd({})],Fg.prototype,"data",void 0),sg([Cd(Xp.prototype.reset)],Fg.prototype,"reset",null),Fg=Ig=sg([Rd(Lg),Rd(Dg),Od()],Fg);var zg,Ng=class extends Fg{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const i=e.children=[];this.children.forEach(e=>e.skipJSON||i.push(e.toJSON(t)))}return e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};sg([xd(Eg)],Ng.prototype,"__",void 0),sg([cd(0)],Ng.prototype,"width",void 0),sg([cd(0)],Ng.prototype,"height",void 0),Ng=sg([Rd(tg),Bd()],Ng);var Vg=$o.get("Leafer"),Hg=zg=class extends Ng{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Kc.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),zg.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,pr.assign(s,t));const n=this.canvas=na.canvas(s);this.__controllers.push(this.renderer=na.renderer(this,n,s),this.watcher=na.watcher(this,s),this.layouter=na.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=na.selector(this),this.interaction=na.interaction(this,n,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=na.hitCanvasManager()),this.canvasManager=new da,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(n),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),au.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Du.RESTART):this.emitLeafer(Du.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Du.STOP))}unlockLayout(t=!0){this.layouter.start(),t&&this.updateLayout()}lockLayout(t=!0){t&&this.updateLayout(),this.layouter.stop()}resize(t){const e=pr.copyAttrs({},t,Ca);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new No(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const i=pr.copyAttrs({},this.canvas,Ca);e.resize(t),this.updateLazyBounds(),this.__onResize(new Bu(t,i))}__onResize(t){this.emitEvent(t),pr.copyAttrs(this.__,t,Ca),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new Ho(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Ca.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(Du.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Ca.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:i,canvas:s}=this,n=pr.copyAttrs({},s,Ca);n[t]=i[t]=e,i.width&&i.height?s.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(n)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Du.BEFORE_READY),this.emitLeafer(Du.READY),this.emitLeafer(Du.AFTER_READY),au.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Du.VIEW_READY),au.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:n,pixelRatio:r}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,o.x+o.width)),i||(n=Math.max(1,o.y+o.height)),this.__doResize({width:s,height:n,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){au.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Du.VIEW_COMPLETED),au.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let n=0;n<s.length;n++)if(s[n]===t){s.splice(n,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return sa.need("view")}getValidMove(t,e,i){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Du(t,this))}__listenEvents(){const t=ta.start("FirstCreate "+this.innerName);this.once([[Du.START,()=>ta.end(t)],[Lu.START,this.updateLazyBounds,this],[Mu.START,this.__onCreated,this],[Mu.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Pu.DATA,this.__onWatchData,this],[Lu.END,this.__onLayoutEnd,this],[Mu.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){zg.list.remove(this);try{this.stop(),this.emitLeafer(Du.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{$c.clearRecycled()},100)}catch(t){Vg.error(t)}}};t?e():setTimeout(e)}};Hg.list=new eg,sg([xd(class extends Eg{__getInputData(t,e){const i=super.__getInputData(t,e);return Ca.forEach(t=>delete i[t]),i}})],Hg.prototype,"__",void 0),sg([cd()],Hg.prototype,"pixelRatio",void 0),sg([nd("normal")],Hg.prototype,"mode",void 0),Hg=zg=sg([Bd()],Hg);var Yg=class extends Fg{get __tag(){return"Rect"}};sg([xd(Tg)],Yg.prototype,"__",void 0),Yg=sg([Rd(Wg),Od(),Bd()],Yg);var{add:Xg,includes:jg,scroll:Ug}=Io,Gg=Yg.prototype,Kg=Ng.prototype,Zg=class extends Ng{get __tag(){return"Box"}get isBranchLeaf(){return!0}get __useSelfBox(){return this.pathInputed}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.__useSelfBox){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const i=this.__,s=this.__layout,{renderBounds:n,boxBounds:r}=s,{overflow:o}=i,a=s.childrenRenderBounds||(s.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&(Xg(a,r),Ug(a,i)),this.__updateRectRenderBounds(),t=!jg(r,a),t&&"show"===o&&Xg(n,a)}else this.__updateRectRenderBounds();pr.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};sg([xd(Cg)],Zg.prototype,"__",void 0),sg([cd(100)],Zg.prototype,"width",void 0),sg([cd(100)],Zg.prototype,"height",void 0),sg([nd(!1)],Zg.prototype,"resizeChildren",void 0),sg([fd("show")],Zg.prototype,"overflow",void 0),sg([Cd(Gg.__updateStrokeSpread)],Zg.prototype,"__updateStrokeSpread",null),sg([Cd(Gg.__updateRenderSpread)],Zg.prototype,"__updateRectRenderSpread",null),sg([Cd(Gg.__updateBoxBounds)],Zg.prototype,"__updateRectBoxBounds",null),sg([Cd(Gg.__updateStrokeBounds)],Zg.prototype,"__updateStrokeBounds",null),sg([Cd(Gg.__updateRenderBounds)],Zg.prototype,"__updateRectRenderBounds",null),sg([Cd(Gg.__updateChange)],Zg.prototype,"__updateRectChange",null),sg([Cd(Gg.__render)],Zg.prototype,"__renderRect",null),sg([Cd(Kg.__render)],Zg.prototype,"__renderGroup",null),Zg=sg([Od(),Bd()],Zg);var $g=class extends Zg{get __tag(){return"Frame"}get isFrame(){return!0}};sg([xd(class extends Cg{})],$g.prototype,"__",void 0),sg([_d("#FFFFFF")],$g.prototype,"fill",void 0),sg([fd("hide")],$g.prototype,"overflow",void 0),$g=sg([Bd()],$g);var{moveTo:qg,closePath:Jg,ellipse:Qg}=kl,tf=class extends Fg{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:i,innerRadius:s,startAngle:n,endAngle:r}=t,o=e/2,a=i/2,h=t.path=[];let l;s?n||r?(s<1?Qg(h,o,a,o*s,a*s,0,n,r,!1):l=!0,Qg(h,o,a,o,a,0,r,n,!0)):(s<1&&(Qg(h,o,a,o*s,a*s),qg(h,e,a)),Qg(h,o,a,o,a,0,360,0,!0)):n||r?(qg(h,o,a),Qg(h,o,a,o,a,0,n,r,!1)):Qg(h,o,a,o,a),l||Jg(h),(Go.ellipseToCurve||t.__useArrow||t.cornerRadius)&&(t.path=this.getPath(!0))}};sg([xd(class extends kg{get __boxStroke(){return!this.__pathInputed}})],tf.prototype,"__",void 0),sg([ud(0)],tf.prototype,"innerRadius",void 0),sg([ud(0)],tf.prototype,"startAngle",void 0),sg([ud(0)],tf.prototype,"endAngle",void 0),tf=sg([Bd()],tf);var{sin:ef,cos:sf,PI:nf}=Math,{moveTo:rf,lineTo:of,closePath:af,drawPoints:hf}=kl,lf=class extends Fg{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)hf(e,t.points,t.curve,t.closed);else{const{width:i,height:s,sides:n,startAngle:r}=t,o=i/2,a=s/2;let h,l=0;r?(l=r*Mr,rf(e,o+o*ef(l),a-a*sf(l))):rf(e,o,0);for(let t=1;t<n;t++)h=2*t*nf/n+l,of(e,o+o*ef(h),a-a*sf(h));af(e)}}};sg([xd(class extends Og{})],lf.prototype,"__",void 0),sg([ud(3)],lf.prototype,"sides",void 0),sg([ud(0)],lf.prototype,"startAngle",void 0),sg([ud()],lf.prototype,"points",void 0),sg([ud(0)],lf.prototype,"curve",void 0),lf=sg([Od(),Bd()],lf);var{sin:cf,cos:df,PI:uf}=Math,{moveTo:pf,lineTo:gf,closePath:ff}=kl,_f=class extends Fg{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s,startAngle:n}=this.__,r=t/2,o=e/2,a=this.__.path=[];let h,l=0;n?(l=n*Mr,pf(a,r+r*cf(l),o-o*df(l))):pf(a,r,0);for(let c=1;c<2*i;c++)h=c*uf/i+l,gf(a,r+(c%2==0?r:r*s)*cf(h),o-(c%2==0?o:o*s)*df(h));ff(a)}};sg([xd(class extends kg{get __boxStroke(){return!this.__pathInputed}})],_f.prototype,"__",void 0),sg([ud(5)],_f.prototype,"corners",void 0),sg([ud(.382)],_f.prototype,"innerRadius",void 0),sg([ud(0)],_f.prototype,"startAngle",void 0),_f=sg([Bd()],_f);var{moveTo:mf,lineTo:vf,drawPoints:yf}=kl,{rotate:wf,getAngle:xf,getDistance:bf,defaultPoint:kf}=no,Sf=class extends Fg{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i={x:0,y:0};return t&&(i.x=t),e&&wf(i,e),i}set toPoint(t){this.width=bf(kf,t),this.rotation=xf(kf,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?yf(e,t.points,t.curve,t.closed):(mf(e,0,0),vf(e,this.width,0))}};sg([xd(Og)],Sf.prototype,"__",void 0),sg([pd("center")],Sf.prototype,"strokeAlign",void 0),sg([cd(0)],Sf.prototype,"height",void 0),sg([ud()],Sf.prototype,"points",void 0),sg([ud(0)],Sf.prototype,"curve",void 0),sg([ud(!1)],Sf.prototype,"closed",void 0),Sf=sg([Bd()],Sf);var Ef=class extends Yg{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return hr(t)&&t[0].image}};sg([xd(class extends Tg{get __urlType(){return"image"}setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:this.__urlType,mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url&&delete i.fill,i}})],Ef.prototype,"__",void 0),sg([cd("")],Ef.prototype,"url",void 0),Ef=sg([Bd()],Ef);var Cf=class extends Yg{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=na.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new td({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new ku(ku.LOADED,{image:t}))})}draw(t,e,i,s){const n=new uo(t.worldTransform).invert(),r=new uo;e&&r.translate(e.x,e.y),i&&(ar(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),n.multiplyParent(r),t.__render(this.canvas,{matrix:n.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:n}=this.canvas;t.drawImage(n,0,0,n.width,n.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};sg([xd(class extends Tg{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}})],Cf.prototype,"__",void 0),sg([rg(100)],Cf.prototype,"width",void 0),sg([rg(100)],Cf.prototype,"height",void 0),sg([rg(1)],Cf.prototype,"pixelRatio",void 0),sg([rg(!0)],Cf.prototype,"smooth",void 0),sg([nd(!1)],Cf.prototype,"safeResize",void 0),sg([rg()],Cf.prototype,"contextSettings",void 0),Cf=sg([Bd()],Cf);var{copyAndSpread:Of,includes:Tf,spread:Rf,setList:Bf}=Io,{stintSet:Pf}=pr,Lf=class extends Fg{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:n,fontWeight:r,italic:o,textCase:a,textOverflow:h,padding:l,width:c,height:d}=t;t.__lineHeight=hg.number(e,n),t.__letterSpacing=hg.number(i,n),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*n)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==r?r+" ":""}${n||12}px ${s||"caption"}`,Pf(t,"__padding",l&&Pr.fourNumber(l)),Pf(t,"__clipText","show"!==h&&!t.__autoSize),Pf(t,"__isCharMode",c||d||t.__letterSpacing||"none"!==a),t.__textDrawData=og.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:n,__autoWidth:r,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<i&&Rf(a,i/2),r||o){if(h.x=r?a.x:0,h.y=o?a.y:0,h.width=r?a.width:t.width,h.height=o?a.height:t.height,n){const[e,i,s,n]=t.__padding;r&&(h.x-=n,h.width+=i+n),o&&(h.y-=e,h.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(h.width+=.16*i),pr.stintSet(this,"isOverflow",!Tf(h,a)),this.isOverflow?(Bf(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Of(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};sg([xd(class extends kg{get __useNaturalRatio(){return!1}setFontWeight(t){rr(t)?(this.__setInput("fontWeight",t),t=Rg[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=oa.get("Rect",0);const n=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=n.boxBounds),i.set(t),r.strokeChanged&&n.strokeChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}__getInputData(t,e){const i=super.__getInputData(t,e);return i.textEditing&&delete i.textEditing,i}})],Lf.prototype,"__",void 0),sg([cd(0)],Lf.prototype,"width",void 0),sg([cd(0)],Lf.prototype,"height",void 0),sg([_d()],Lf.prototype,"boxStyle",void 0),sg([nd(!1)],Lf.prototype,"resizeFontSize",void 0),sg([_d("#000000")],Lf.prototype,"fill",void 0),sg([pd("outside")],Lf.prototype,"strokeAlign",void 0),sg([wd("all")],Lf.prototype,"hitFill",void 0),sg([cd("")],Lf.prototype,"text",void 0),sg([cd("")],Lf.prototype,"placeholder",void 0),sg([cd("caption")],Lf.prototype,"fontFamily",void 0),sg([cd(12)],Lf.prototype,"fontSize",void 0),sg([cd("normal")],Lf.prototype,"fontWeight",void 0),sg([cd(!1)],Lf.prototype,"italic",void 0),sg([cd("none")],Lf.prototype,"textCase",void 0),sg([cd("none")],Lf.prototype,"textDecoration",void 0),sg([cd(0)],Lf.prototype,"letterSpacing",void 0),sg([cd({type:"percent",value:1.5})],Lf.prototype,"lineHeight",void 0),sg([cd(0)],Lf.prototype,"paraIndent",void 0),sg([cd(0)],Lf.prototype,"paraSpacing",void 0),sg([cd("x")],Lf.prototype,"writingMode",void 0),sg([cd("left")],Lf.prototype,"textAlign",void 0),sg([cd("top")],Lf.prototype,"verticalAlign",void 0),sg([cd(!0)],Lf.prototype,"autoSizeAlign",void 0),sg([cd("normal")],Lf.prototype,"textWrap",void 0),sg([cd("show")],Lf.prototype,"textOverflow",void 0),sg([_d(!1)],Lf.prototype,"textEditing",void 0),Lf=sg([Bd()],Lf);var Mf=class extends Fg{get __tag(){return"Path"}};sg([xd(class extends kg{get __pathInputed(){return 2}})],Mf.prototype,"__",void 0),sg([pd("center")],Mf.prototype,"strokeAlign",void 0),Mf=sg([Bd()],Mf);var Df=class extends Ng{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Mf(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,n,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,n){return this}ellipse(t,e,i,s,n,r,o,a){return this}arc(t,e,i,s,n,r){return this}arcTo(t,e,i,s,n){return this}drawEllipse(t,e,i,s,n,r,o,a){return this}drawArc(t,e,i,s,n,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){const{pathElement:t}=this;t.__layout.boxChanged||t.forceUpdate("path")}};function Af(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o}sg([xd(class extends Eg{})],Df.prototype,"__",void 0),sg([(t,e)=>{ed(t,e,{get(){return this.__path}})}],Df.prototype,"path",void 0),Df=sg([Rd(Nl,["set","path","paint"]),Bd()],Df);var If=class extends Hg{get __tag(){return"App"}get isApp(){return!0}constructor(t,e){super(t,e)}init(t,e){if(super.init(t,e),t){const{ground:e,tree:i,sky:s,editor:n}=t;e&&(this.ground=this.addLeafer(e)),(i||n)&&(this.tree=this.addLeafer(i||{type:t.type||"design"})),(s||n)&&(this.sky=this.addLeafer(s)),n&&na.editor(n,this)}}__setApp(){const{canvas:t}=this,{realCanvas:e,view:i}=this.config;e||i===this.canvas.view||!t.parentView?this.realCanvas=!0:t.unrealCanvas(),this.leafer=this,this.watcher.disable(),this.layouter.disable()}__updateLocalBounds(){this.forEach(t=>t.updateLayout()),super.__updateLocalBounds()}start(){super.start(),this.forEach(t=>t.start())}stop(){this.forEach(t=>t.stop()),super.stop()}unlockLayout(){super.unlockLayout(),this.forEach(t=>t.unlockLayout())}lockLayout(){super.lockLayout(),this.forEach(t=>t.lockLayout())}forceRender(t,e){this.forEach(i=>i.forceRender(t,e))}addLeafer(t){const e=new Hg(t);return this.add(e),e}add(t,e){if(!t.view){if(this.realCanvas&&!this.canvas.bounds)return void setTimeout(()=>this.add(t,e),10);t.init(this.__getChildConfig(t.userConfig),this)}super.add(t,e),sr(e)||(t.canvas.childIndex=e),this.__listenChildEvents(t)}forEach(t){this.children.forEach(t)}__onCreated(){this.created=this.children.every(t=>t.created)}__onReady(){this.children.every(t=>t.ready)&&super.__onReady()}__onViewReady(){this.children.every(t=>t.viewReady)&&super.__onViewReady()}__onChildRenderEnd(t){this.renderer.addBlock(t.renderBounds),this.viewReady&&this.renderer.update()}__render(t,e){t.context&&this.forEach(i=>e.matrix?i.__render(t,e):t.copyWorld(i.canvas,e.bounds,void 0,void 0,!0))}__onResize(t){this.forEach(e=>e.resize(t)),super.__onResize(t)}updateLayout(){this.forEach(t=>t.updateLayout())}__getChildConfig(t){const e=Object.assign({},this.config);return e.hittable=e.realCanvas=void 0,t&&pr.assign(e,t),this.autoLayout&&pr.copyAttrs(e,this,Ca),e.view=this.realCanvas?void 0:this.view,e.fill=void 0,e}__listenChildEvents(t){t.once([[Lu.END,this.__onReady,this],[Mu.START,this.__onCreated,this],[Mu.END,this.__onViewReady,this]]),this.realCanvas&&this.__eventIds.push(t.on_(Mu.END,this.__onChildRenderEnd,this))}};If=Af([Bd()],If);var Wf={},Ff={isHoldSpaceKey:()=>Ff.isHold("Space"),isHold:t=>Wf[t],isHoldKeys:(t,e)=>e?t(e):void 0,setDownCode(t){Wf[t]||(Wf[t]=!0)},setUpCode(t){Wf[t]=!1}},zf={LEFT:1,RIGHT:2,MIDDLE:4,defaultLeft(t){t.buttons||(t.buttons=1)},left:t=>1===t.buttons,right:t=>2===t.buttons,middle:t=>4===t.buttons},Nf=class extends vu{get spaceKey(){return Ff.isHoldSpaceKey()}get left(){return zf.left(this)}get right(){return zf.right(this)}get middle(){return zf.middle(this)}constructor(t){super(t.type),this.bubbles=!0,Object.assign(this,t)}isHoldKeys(t){return Ff.isHoldKeys(t,this)}getBoxPoint(t){return(t||this.current).getBoxPoint(this)}getInnerPoint(t){return(t||this.current).getInnerPoint(this)}getLocalPoint(t){return(t||this.current).getLocalPoint(this)}getPagePoint(){return this.current.getPagePoint(this)}getInner(t){return this.getInnerPoint(t)}getLocal(t){return this.getLocalPoint(t)}getPage(){return this.getPagePoint()}static changeName(t,e){la.changeName(t,e)}},{min:Vf,max:Hf,abs:Yf}=Math,{float:Xf,sign:jf}=Pr,{minX:Uf,maxX:Gf,minY:Kf,maxY:Zf}=Io,$f=new No,qf=new No,Jf={limitMove(t,e){const{dragBounds:i,dragBoundsType:s}=t;i&&Qf.getValidMove(t.__localBoxBounds,Qf.getDragBounds(t),s,e,!0),Qf.axisMove(t,e)},limitScaleOf(t,e,i,s){const{dragBounds:n,dragBoundsType:r}=t;n&&Qf.getValidScaleOf(t.__localBoxBounds,Qf.getDragBounds(t),r,t.getLocalPointByInner(t.getInnerPointByBox(e)),i,s,!0)},axisMove(t,e){const{draggable:i}=t;"x"===i&&(e.y=0),"y"===i&&(e.x=0)},getDragBounds(t){const{dragBounds:e}=t;return"parent"===e?t.parent.boxBounds:e},isInnerMode:(t,e,i,s)=>"inner"===i||"auto"===i&&Xf(t[s])>Xf(e[s]),getValidMove(t,e,i,s,n){const r=t.x+s.x,o=t.y+s.y,a=r+t.width,h=o+t.height,l=e.x+e.width,c=e.y+e.height;return n||(s=Object.assign({},s)),Qf.isInnerMode(t,e,i,"width")?r>e.x?s.x+=e.x-r:a<l&&(s.x+=l-a):r<e.x?s.x+=e.x-r:a>l&&(s.x+=l-a),Qf.isInnerMode(t,e,i,"height")?o>e.y?s.y+=e.y-o:h<c&&(s.y+=c-h):o<e.y?s.y+=e.y-o:h>c&&(s.y+=c-h),s.x=Xf(s.x),s.y=Xf(s.y),s},getValidScaleOf(t,e,i,s,n,r,o){o||(n=Object.assign({},n)),qf.set(e),$f.set(t).scaleOf(s,n.x,n.y);const a=(s.x-t.x)/t.width,h=1-a,l=(s.y-t.y)/t.height,c=1-l;let d,u,p,g,f=1,_=1;return Qf.isInnerMode(t,e,i,"width")?(n.x<0&&$f.scaleOf(s,f=1/n.x,1),p=Xf($f.minX-qf.minX),g=Xf(qf.maxX-$f.maxX),d=a&&p>0?1+p/(a*$f.width):1,u=h&&g>0?1+g/(h*$f.width):1,f*=Hf(d,u)):(n.x<0&&((Xf(Uf(t)-Uf(e))<=0||Xf(Gf(e)-Gf(t))<=0)&&$f.scaleOf(s,f=1/n.x,1),$f.unsign()),p=Xf(qf.minX-$f.minX),g=Xf($f.maxX-qf.maxX),d=a&&p>0?1-p/(a*$f.width):1,u=h&&g>0?1-g/(h*$f.width):1,f*=Vf(d,u)),Qf.isInnerMode(t,e,i,"height")?(n.y<0&&$f.scaleOf(s,1,_=1/n.y),p=Xf($f.minY-qf.minY),g=Xf(qf.maxY-$f.maxY),d=l&&p>0?1+p/(l*$f.height):1,u=c&&g>0?1+g/(c*$f.height):1,_*=Hf(d,u),r&&(d=Hf(Yf(f),Yf(_)),f=jf(f)*d,_=jf(_)*d)):(n.y<0&&((Xf(Kf(t)-Kf(e))<=0||Xf(Zf(e)-Zf(t))<=0)&&$f.scaleOf(s,1,_=1/n.y),$f.unsign()),p=Xf(qf.minY-$f.minY),g=Xf($f.maxY-qf.maxY),d=l&&p>0?1-p/(l*$f.height):1,u=c&&g>0?1-g/(c*$f.height):1,_*=Vf(d,u)),n.x*=or(f)?f:1,n.y*=or(_)?_:1,n}},Qf=Jf,t_=class extends Nf{};t_.POINTER="pointer",t_.BEFORE_DOWN="pointer.before_down",t_.BEFORE_MOVE="pointer.before_move",t_.BEFORE_UP="pointer.before_up",t_.DOWN="pointer.down",t_.MOVE="pointer.move",t_.UP="pointer.up",t_.OVER="pointer.over",t_.OUT="pointer.out",t_.ENTER="pointer.enter",t_.LEAVE="pointer.leave",t_.TAP="tap",t_.DOUBLE_TAP="double_tap",t_.CLICK="click",t_.DOUBLE_CLICK="double_click",t_.LONG_PRESS="long_press",t_.LONG_TAP="long_tap",t_.MENU="pointer.menu",t_.MENU_TAP="pointer.menu_tap";t_=Af([Pd()],t_);var e_={},i_=class extends t_{static setList(t){this.list=t instanceof eg?t:new eg(t)}static setData(t){this.data=t}static getValidMove(t,e,i,s=!0){const n=t.getLocalPoint(i,null,!0);return no.move(n,e.x-t.x,e.y-t.y),s&&this.limitMove(t,n),Jf.axisMove(t,n),n}static limitMove(t,e){Jf.limitMove(t,e)}getPageMove(t){return this.assignMove(t),this.current.getPagePoint(e_,null,!0)}getInnerMove(t,e){return t||(t=this.current),this.assignMove(e),t.getInnerPoint(e_,null,!0)}getLocalMove(t,e){return t||(t=this.current),this.assignMove(e),t.getLocalPoint(e_,null,!0)}getPageTotal(){return this.getPageMove(!0)}getInnerTotal(t){return this.getInnerMove(t,!0)}getLocalTotal(t){return this.getLocalMove(t,!0)}getPageBounds(){const t=this.getPageTotal(),e=this.getPagePoint(),i={};return Io.set(i,e.x-t.x,e.y-t.y,t.x,t.y),Io.unsign(i),i}assignMove(t){e_.x=t?this.totalX:this.moveX,e_.y=t?this.totalY:this.moveY}};i_.BEFORE_DRAG="drag.before_drag",i_.START="drag.start",i_.DRAG="drag",i_.END="drag.end",i_.OVER="drag.over",i_.OUT="drag.out",i_.ENTER="drag.enter",i_.LEAVE="drag.leave",i_=Af([Pd()],i_);var s_=class extends t_{static setList(t){i_.setList(t)}static setData(t){i_.setData(t)}};s_.DROP="drop",s_=Af([Pd()],s_);var n_=class extends i_{};n_.BEFORE_MOVE="move.before_move",n_.START="move.start",n_.MOVE="move",n_.DRAG_ANIMATE="move.drag_animate",n_.END="move.end",n_.PULL_DOWN="move.pull_down",n_.REACH_BOTTOM="move.reach_bottom",n_=Af([Pd()],n_);var r_=class extends Nf{};r_=Af([Pd()],r_);var o_=class extends t_{};o_.BEFORE_ROTATE="rotate.before_rotate",o_.START="rotate.start",o_.ROTATE="rotate",o_.END="rotate.end",o_=Af([Pd()],o_);var a_=class extends i_{};a_.SWIPE="swipe",a_.LEFT="swipe.left",a_.RIGHT="swipe.right",a_.UP="swipe.up",a_.DOWN="swipe.down",a_=Af([Pd()],a_);var h_=class extends t_{};h_.BEFORE_ZOOM="zoom.before_zoom",h_.START="zoom.start",h_.ZOOM="zoom",h_.END="zoom.end",h_=Af([Pd()],h_);var l_=class extends Nf{};l_.BEFORE_DOWN="key.before_down",l_.BEFORE_UP="key.before_up",l_.DOWN="key.down",l_.HOLD="key.hold",l_.UP="key.up",l_=Af([Pd()],l_);var c_={getDragEventData:(t,e,i)=>Object.assign(Object.assign({},i),{x:i.x,y:i.y,moveX:i.x-e.x,moveY:i.y-e.y,totalX:i.x-t.x,totalY:i.y-t.y}),getDropEventData:(t,e,i)=>Object.assign(Object.assign({},t),{list:e,data:i}),getSwipeDirection:t=>t<-45&&t>-135?a_.UP:t>45&&t<135?a_.DOWN:t<=45&&t>=-45?a_.RIGHT:a_.LEFT,getSwipeEventData:(t,e,i)=>Object.assign(Object.assign({},i),{moveX:e.moveX,moveY:e.moveY,totalX:i.x-t.x,totalY:i.y-t.y,type:d_.getSwipeDirection(no.getAngle(t,i))}),getBase(t){const e=1===t.button?4:t.button;return{altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,time:Date.now(),buttons:sr(t.buttons)?1:0===t.buttons?e:t.buttons,origin:t}},pathHasEventType(t,e){const{list:i}=t;for(let s=0,n=i.length;s<n;s++)if(i[s].hasEvent(e))return!0;return!1},filterPathByEventType(t,e){const i=new eg,{list:s}=t;for(let n=0,r=s.length;n<r;n++)s[n].hasEvent(e)&&i.add(s[n]);return i},pathCanDrag:t=>t&&t.list.some(t=>Yd.draggable(t)||!t.isLeafer&&t.hasEvent(i_.DRAG)),pathHasOutside:t=>t&&t.list.some(t=>t.isOutside)},d_=c_,u_=new eg,{getDragEventData:p_,getDropEventData:g_,getSwipeEventData:f_}=c_,__=class{constructor(t){this.dragDataList=[],this.interaction=t}setDragData(t){this.animateWait&&this.dragEndReal(),this.downData=this.interaction.downData,this.dragData=p_(t,t,t),this.canAnimate=this.canDragOut=!0}getList(t,e){const{proxy:i}=this.interaction.selector,s=i&&i.list.length,n=i_.list||this.draggableList||u_;return this.dragging&&(s?t?u_:new eg(e?[...i.list,...i.dragHoverExclude]:i.list):n)}checkDrag(t,e){const{interaction:i}=this;if(this.moving&&t.buttons<1)return this.canAnimate=!1,void i.pointerCancel();!this.moving&&e&&(this.moving=i.canMove(this.downData)||i.isHoldRightKey||i.isMobileDragEmpty)&&(this.dragData.moveType="drag",i.emit(n_.START,this.dragData)),this.moving||this.dragStart(t,e),this.drag(t)}dragStart(t,e){this.dragging||(this.dragging=e&&zf.left(t),this.dragging&&(this.interaction.emit(i_.START,this.dragData),this.getDraggableList(this.dragData.path),this.setDragStartPoints(this.realDraggableList=this.getList(!0))))}setDragStartPoints(t){this.dragStartPoints={},t.forEach(t=>this.dragStartPoints[t.innerId]={x:t.x,y:t.y})}getDraggableList(t){let e;for(let i=0,s=t.length;i<s;i++)if(e=t.list[i],Yd.draggable(e)){this.draggableList=new eg(e);break}}drag(t){const{interaction:e,dragData:i,downData:s}=this,{path:n,throughPath:r}=s;this.dragData=p_(s,i,t),r&&(this.dragData.throughPath=r),this.dragData.path=n,this.dragDataList.push(this.dragData),this.moving?(t.moving=!0,this.dragData.moveType="drag",e.emit(n_.BEFORE_MOVE,this.dragData),e.emit(n_.MOVE,this.dragData)):this.dragging&&(t.dragging=!0,this.dragReal(),e.emit(i_.BEFORE_DRAG,this.dragData),e.emit(i_.DRAG,this.dragData))}dragReal(t){const{interaction:e}=this,{running:i}=e,s=this.realDraggableList;if(s.length&&i){const{totalX:i,totalY:n}=this.dragData,{dragLimitAnimate:r}=e.p,o=!r||!!t;s.forEach(e=>{if(e.draggable){const s=rr(e.draggable),a=i_.getValidMove(e,this.dragStartPoints[e.innerId],{x:i,y:n},o||s);r&&!s&&t?Yd.animateMove(e,a,ar(r)?r:.3):e.move(a)}})}}dragOverOrOut(t){const{interaction:e}=this,{dragOverPath:i}=this,{path:s}=t;this.dragOverPath=s,i?s.indexAt(0)!==i.indexAt(0)&&(e.emit(i_.OUT,t,i),e.emit(i_.OVER,t,s)):e.emit(i_.OVER,t,s)}dragEnterOrLeave(t){const{interaction:e}=this,{dragEnterPath:i}=this,{path:s}=t;e.emit(i_.LEAVE,t,i,s),e.emit(i_.ENTER,t,s,i),this.dragEnterPath=s}dragEnd(t){(this.dragging||this.moving)&&(this.checkDragEndAnimate(t)||this.dragEndReal(t))}dragEndReal(t){const{interaction:e,downData:i,dragData:s}=this;t||(t=s);const{path:n,throughPath:r}=i,o=p_(i,t,t);if(r&&(o.throughPath=r),o.path=n,this.moving&&(this.moving=!1,o.moveType="drag",e.emit(n_.END,o)),this.dragging){const n=this.getList();this.dragging=!1,e.p.dragLimitAnimate&&this.dragReal(!0),e.emit(i_.END,o),this.swipe(t,i,s,o),this.drop(t,n,this.dragEnterPath)}this.autoMoveCancel(),this.dragReset(),this.animate(null,"off")}swipe(t,e,i,s){const{interaction:n}=this;if(no.getDistance(e,t)>n.config.pointer.swipeDistance){const t=f_(e,i,s);this.interaction.emit(t.type,t)}}drop(t,e,i){const s=g_(t,e,i_.data);s.path=i,this.interaction.emit(s_.DROP,s),this.interaction.emit(i_.LEAVE,t,i)}dragReset(){i_.list=i_.data=this.draggableList=this.dragData=this.downData=this.dragOverPath=this.dragEnterPath=null,this.dragDataList=[]}checkDragEndAnimate(t,e){return!1}animate(t,e){}stopAnimate(){}checkDragOut(t){}autoMoveOnDragOut(t){}autoMoveCancel(){}destroy(){this.dragReset()}},m_=$o.get("emit"),v_=["move","zoom","rotate","key"];function y_(t,e,i,s,n){if(v_.some(t=>e.startsWith(t))&&t.__.hitChildren&&!x_(t,n)){let r;for(let o=0,a=t.children.length;o<a;o++)r=t.children[o],!i.path.has(r)&&r.__.hittable&&w_(r,e,i,s,n)}}function w_(t,e,i,s,n){if(t.destroyed)return!1;if(t.__.hitSelf&&!x_(t,n)&&(_g.updateEventStyle&&!s&&_g.updateEventStyle(t,e),t.hasEvent(e,s))){i.phase=s?1:t===i.target?2:3;const n=la.get(e,i);if(t.emitEvent(n,s),n.isStop)return!0}return!1}function x_(t,e){return e&&e.has(t)}var b_={wheel:{zoomSpeed:.5,moveSpeed:.5,rotateSpeed:.5,delta:{x:20,y:8}},pointer:{type:"pointer",snap:!0,hitRadius:5,tapTime:120,longPressTime:800,transformTime:500,hover:!0,dragHover:!0,dragDistance:2,swipeDistance:20},touch:{preventDefault:"auto"},multiTouch:{},move:{autoDistance:2},zoom:{},cursor:!0,keyEvent:!0},{pathHasEventType:k_,pathCanDrag:S_,pathHasOutside:E_}=c_,C_=class{get dragging(){return this.dragger.dragging}get transforming(){return this.transformer.transforming}get moveMode(){return!0===this.m.drag||this.isHoldSpaceKey||this.isHoldMiddleKey||this.isHoldRightKey&&this.dragger.moving||this.isDragEmpty}get canHover(){return this.p.hover&&!this.config.mobile}get isDragEmpty(){return this.m.dragEmpty&&this.isRootPath(this.hoverData)&&(!this.downData||this.isRootPath(this.downData))}get isMobileDragEmpty(){return this.m.dragEmpty&&!this.canHover&&this.downData&&this.isTreePath(this.downData)}get isHoldMiddleKey(){return this.m.holdMiddleKey&&this.downData&&zf.middle(this.downData)}get isHoldRightKey(){return this.m.holdRightKey&&this.downData&&zf.right(this.downData)}get isHoldSpaceKey(){return this.m.holdSpaceKey&&Ff.isHoldSpaceKey()}get m(){return this.config.move}get p(){return this.config.pointer}get hitRadius(){return this.p.hitRadius}constructor(t,e,i,s){this.config=pr.clone(b_),this.tapCount=0,this.downKeyMap={},this.target=t,this.canvas=e,this.selector=i,this.defaultPath=new eg(t),this.createTransformer(),this.dragger=new __(this),s&&(this.config=pr.default(s,this.config)),this.__listenEvents()}start(){this.running=!0}stop(){this.running=!1}receive(t){}pointerDown(t,e){t||(t=this.hoverData),t&&(zf.defaultLeft(t),this.updateDownData(t),this.checkPath(t,e),this.downTime=Date.now(),this.emit(t_.BEFORE_DOWN,t),t.path.needUpdate&&this.updateDownData(t),this.emit(t_.DOWN,t),zf.left(t)&&(this.tapWait(),this.longPressWait(t)),this.waitRightTap=zf.right(t),this.dragger.setDragData(t),this.isHoldRightKey||this.updateCursor(t))}pointerMove(t){if(t||(t=this.hoverData),!t)return;const{downData:e}=this;e&&zf.defaultLeft(t),(this.canvas.bounds.hitPoint(t)||e)&&(this.pointerMoveReal(t),e&&this.dragger.checkDragOut(t))}pointerMoveReal(t){if(this.emit(t_.BEFORE_MOVE,t,this.defaultPath),this.downData){const e=no.getDistance(this.downData,t)>this.p.dragDistance;e&&(this.pointerWaitCancel(),this.waitRightTap=!1),this.dragger.checkDrag(t,e)}this.dragger.moving||(this.updateHoverData(t),this.checkPath(t),this.emit(t_.MOVE,t),this.pointerHover(t),this.dragging&&(this.dragger.dragOverOrOut(t),this.dragger.dragEnterOrLeave(t))),this.updateCursor(this.downData||t)}pointerUp(t){const{downData:e}=this;if(t||(t=e),!e)return;zf.defaultLeft(t),t.multiTouch=e.multiTouch,this.findPath(t);const i=Object.assign(Object.assign({},t),{path:t.path.clone()});t.path.addList(e.path.list),this.checkPath(t),this.downData=null,this.emit(t_.BEFORE_UP,t),this.emit(t_.UP,t),this.touchLeave(t),t.isCancel||(this.tap(t),this.menuTap(t)),this.dragger.dragEnd(t),this.updateCursor(i)}pointerCancel(){const t=Object.assign({},this.dragger.dragData);t.isCancel=!0,this.pointerUp(t)}menu(t){this.findPath(t),this.emit(t_.MENU,t),this.waitMenuTap=!0,!this.downData&&this.waitRightTap&&this.menuTap(t)}menuTap(t){this.waitRightTap&&this.waitMenuTap&&(this.emit(t_.MENU_TAP,t),this.waitRightTap=this.waitMenuTap=!1)}createTransformer(){}move(t){}zoom(t){}rotate(t){}transformEnd(){}wheel(t){}multiTouch(t,e){}keyDown(t){if(!this.config.keyEvent)return;this.emit(l_.BEFORE_DOWN,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]||(this.downKeyMap[e]=!0,Ff.setDownCode(e),this.emit(l_.HOLD,t,this.defaultPath),this.moveMode&&(this.cancelHover(),this.updateCursor())),this.emit(l_.DOWN,t,this.defaultPath)}keyUp(t){if(!this.config.keyEvent)return;this.emit(l_.BEFORE_UP,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]=!1,Ff.setUpCode(e),this.emit(l_.UP,t,this.defaultPath),"grab"===this.cursor&&this.updateCursor()}pointerHover(t){!this.canHover||this.dragging&&!this.p.dragHover||(t.path||(t.path=new eg),this.pointerOverOrOut(t),this.pointerEnterOrLeave(t))}pointerOverOrOut(t){const{path:e}=t,{overPath:i}=this;this.overPath=e,i?e.indexAt(0)!==i.indexAt(0)&&(this.emit(t_.OUT,t,i),this.emit(t_.OVER,t,e)):this.emit(t_.OVER,t,e)}pointerEnterOrLeave(t){let{path:e}=t;this.downData&&!this.moveMode&&(e=e.clone(),this.downData.path.forEach(t=>e.add(t)));const{enterPath:i}=this;this.enterPath=e,this.emit(t_.LEAVE,t,i,e),this.emit(t_.ENTER,t,e,i)}touchLeave(t){"touch"===t.pointerType&&this.enterPath&&(this.emit(t_.LEAVE,t),this.dragger.dragging&&this.emit(s_.LEAVE,t))}tap(t){const{pointer:e}=this.config,i=this.longTap(t);if(!e.tapMore&&i)return;if(!this.waitTap)return;e.tapMore&&this.emitTap(t);const s=Date.now()-this.downTime,n=[t_.DOUBLE_TAP,t_.DOUBLE_CLICK].some(e=>k_(t.path,e));s<e.tapTime+50&&n?(this.tapCount++,2===this.tapCount?(this.tapWaitCancel(),this.emitDoubleTap(t)):(clearTimeout(this.tapTimer),this.tapTimer=setTimeout(()=>{e.tapMore||(this.tapWaitCancel(),this.emitTap(t))},e.tapTime))):e.tapMore||(this.tapWaitCancel(),this.emitTap(t))}findPath(t,e){const{hitRadius:i,through:s}=this.p,{bottomList:n,target:r}=this;Go.backgrounder||t.origin||r&&r.updateLayout();const o=this.selector.getByPoint(t,i,Object.assign({bottomList:n,name:t.type},e||{through:s}));return o.throughPath&&(t.throughPath=o.throughPath),t.path=o.path,o.path}isRootPath(t){return t&&t.path.list[0].isLeafer}isTreePath(t){const e=this.target.app;return!(!e||!e.isApp)&&e.editor&&!t.path.has(e.editor)&&t.path.has(e.tree)&&!t.target.syncEventer}checkPath(t,e){(e||this.moveMode&&!E_(t.path))&&(t.path=this.defaultPath)}canMove(t){return t&&(this.moveMode||"auto"===this.m.drag&&!S_(t.path))&&!E_(t.path)}isDrag(t){return this.dragger.getList().has(t)}isPress(t){return this.downData&&this.downData.path.has(t)}isHover(t){return this.enterPath&&this.enterPath.has(t)}isFocus(t){return this.focusData===t}cancelHover(){const{hoverData:t}=this;t&&(t.path=this.defaultPath,this.pointerHover(t))}stopDragAnimate(){this.dragger.stopAnimate()}replaceDownTarget(t){const{downData:e}=this;if(e&&t){const{path:i}=e;i.remove(i.list[0]),i.addAt(t,0)}}updateDownData(t,e,i){const{downData:s}=this;!t&&s&&(t=s),t&&(this.findPath(t,e),i&&s&&t.path.addList(s.path.list),this.downData=t)}updateHoverData(t){t||(t=this.hoverData),t&&(this.findPath(t,{exclude:this.dragger.getList(!1,!0),name:t_.MOVE}),this.hoverData=t)}updateCursor(t){if(!this.config.cursor||!this.canHover)return;if(t||(this.updateHoverData(),t=this.downData||this.hoverData),this.dragger.moving)return this.setCursor("grabbing");if(this.canMove(t))return this.setCursor(this.downData?"grabbing":"grab");if(!t)return;let e,i;const{path:s}=t;for(let n=0,r=s.length;n<r&&(e=s.list[n],i=e.syncEventer&&e.syncEventer.cursor||e.cursor,!i);n++);this.setCursor(i)}setCursor(t){this.cursor=t}getLocal(t,e){const i=this.canvas.getClientBounds(e),s={x:t.clientX-i.x,y:t.clientY-i.y},{bounds:n}=this.canvas;return s.x*=n.width/i.width,s.y*=n.height/i.height,this.p.snap&&no.round(s),s}emitTap(t){this.emit(t_.TAP,t),this.emit(t_.CLICK,t)}emitDoubleTap(t){this.emit(t_.DOUBLE_TAP,t),this.emit(t_.DOUBLE_CLICK,t)}pointerWaitCancel(){this.tapWaitCancel(),this.longPressWaitCancel()}tapWait(){clearTimeout(this.tapTimer),this.waitTap=!0}tapWaitCancel(){this.waitTap&&(clearTimeout(this.tapTimer),this.waitTap=!1,this.tapCount=0)}longPressWait(t){clearTimeout(this.longPressTimer),this.longPressTimer=setTimeout(()=>{this.longPressed=!0,this.emit(t_.LONG_PRESS,t)},this.p.longPressTime)}longTap(t){let e;return this.longPressed&&(this.emit(t_.LONG_TAP,t),(k_(t.path,t_.LONG_TAP)||k_(t.path,t_.LONG_PRESS))&&(e=!0)),this.longPressWaitCancel(),e}longPressWaitCancel(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressed=!1)}__onResize(){const{dragOut:t}=this.m;this.shrinkCanvasBounds=new No(this.canvas.bounds),this.shrinkCanvasBounds.spread(-(ar(t)?t:2))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(Bu.RESIZE,this.__onResize,this)],t.once(Du.READY,()=>this.__onResize())}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}emit(t,e,i,s){this.running&&function(t,e,i,s){if(!i&&!e.path)return;let n;e.type=t,i?e=Object.assign(Object.assign({},e),{path:i}):i=e.path,e.target=i.indexAt(0);try{for(let r=i.length-1;r>-1;r--){if(n=i.list[r],w_(n,t,e,!0,s))return;n.isApp&&y_(n,t,e,!0,s)}for(let r=0,o=i.length;r<o;r++)if(n=i.list[r],n.isApp&&y_(n,t,e,!1,s),w_(n,t,e,!1,s))return}catch(t){m_.error(t)}}(t,e,i,s)}destroy(){this.__eventIds.length&&(this.stop(),this.__removeListenEvents(),this.dragger.destroy(),this.transformer&&this.transformer.destroy(),this.downData=this.overPath=this.enterPath=null)}},O_=class{static set(t,e){this.custom[t]=e}static get(t){return this.custom[t]}};O_.custom={};var T_=class extends da{constructor(){super(...arguments),this.maxTotal=1e3,this.pathList=new eg,this.pixelList=new eg}getPixelType(t,e){return this.__autoClear(),this.pixelList.add(t),na.hitCanvas(e)}getPathType(t){return this.__autoClear(),this.pathList.add(t),na.hitCanvas()}clearImageType(){this.__clearLeafList(this.pixelList)}clearPathType(){this.__clearLeafList(this.pathList)}__clearLeafList(t){t.length&&(t.forEach(t=>{t.__hitCanvas&&(t.__hitCanvas.destroy(),t.__hitCanvas=null)}),t.reset())}__autoClear(){this.pathList.length+this.pixelList.length>this.maxTotal&&this.clear()}clear(){this.clearPathType(),this.clearImageType()}};Go.getSelector=function(t){return t.leafer?t.leafer.selector:Go.selector||(Go.selector=na.selector())};var{toInnerRadiusPointOf:R_,copyRadiusPoint:B_}=no,{hitRadiusPoint:P_,hitPoint:L_}=Io,M_={},D_={},A_=Xp.prototype;A_.hit=function(t,e=0){this.updateLayout(),B_(D_,t,e);const i=this.__world;return!!(e?P_(i,D_):L_(i,D_))&&(this.isBranch?Go.getSelector(this).hitPoint(Object.assign({},D_),e,{target:this}):this.__hitWorld(D_))},A_.__hitWorld=function(t,e){const i=this.__;if(!i.hitSelf)return!1;const s=this.__world,n=this.__layout,r=s.width<10&&s.height<10;if(i.hitRadius&&(B_(M_,t,i.hitRadius),t=M_),R_(t,s,M_),i.hitBox||r){if(Io.hitRadiusPoint(n.boxBounds,M_))return!0;if(r)return!1}return!n.hitCanvasChanged&&this.__hitCanvas||(this.__updateHitCanvas(),n.boundsChanged||(n.hitCanvasChanged=!1)),this.__hit(M_,e)},A_.__hitFill=function(t){const e=this.__hitCanvas;return e&&e.hitFill(t,this.__.windingRule)},A_.__hitStroke=function(t,e){const i=this.__hitCanvas;return i&&i.hitStroke(t,e)},A_.__hitPixel=function(t){const e=this.__hitCanvas;return e&&e.hitPixel(t,this.__layout.renderBounds,e.hitScale)},A_.__drawHitPath=function(t){t&&this.__drawRenderPath(t)};var I_=new uo,W_=Fg.prototype;W_.__updateHitCanvas=function(){this.__box&&this.__box.__updateHitCanvas();const{hitCanvasManager:t}=this.leafer||this.parent&&this.parent.leafer||{};if(!t)return;const e=this.__,i=(e.__isAlphaPixelFill||e.__isCanvas)&&"pixel"===e.hitFill,s=e.__isAlphaPixelStroke&&"pixel"===e.hitStroke,n=i||s;this.__hitCanvas||(this.__hitCanvas=n?t.getPixelType(this,{contextSettings:{willReadFrequently:!0}}):t.getPathType(this));const r=this.__hitCanvas;if(n){const{renderBounds:t}=this.__layout,n=Go.image.hitCanvasSize,o=r.hitScale=Vo.set(0,0,n,n).getFitMatrix(t).a,{x:a,y:h,width:l,height:c}=Vo.set(t).scale(o);r.resize({width:l,height:c,pixelRatio:1}),r.clear(),$c.patternLocked=!0,this.__renderShape(r,{matrix:I_.setWith(this.__world).scaleWith(1/o).invertWith().translate(-a,-h),snapshot:!0,ignoreFill:!i,ignoreStroke:!s}),$c.patternLocked=!1,r.resetTransform(),e.__isHitPixel=!0}else e.__isHitPixel&&(e.__isHitPixel=!1);this.__drawHitPath(r),r.setStrokeOptions(e)},W_.__hit=function(t,e){if(this.__box&&this.__box.__hit(t))return!0;const i=this.__;if(i.__isHitPixel&&this.__hitPixel(t))return!0;const{hitFill:s}=i,n=(i.fill||i.__isCanvas)&&("path"===s||"pixel"===s&&!(i.__isAlphaPixelFill||i.__isCanvas))||"all"===s||e;if(n&&this.__hitFill(t))return!0;const{hitStroke:r,__maxStrokeWidth:o}=i,a=i.stroke&&("path"===r||"pixel"===r&&!i.__isAlphaPixelStroke)||"all"===r;if(!n&&!a)return!1;const h=2*t.radiusX;let l=h;if(a)switch(i.strokeAlign){case"inside":if(l+=2*o,!n&&this.__hitFill(t)&&this.__hitStroke(t,l))return!0;l=h;break;case"center":l+=o;break;case"outside":if(l+=2*o,!n){if(!this.__hitFill(t)&&this.__hitStroke(t,l))return!0;l=h}}return!!l&&this.__hitStroke(t,l)};var F_=Fg.prototype,z_=Yg.prototype,N_=Zg.prototype;z_.__updateHitCanvas=N_.__updateHitCanvas=function(){this.stroke||this.cornerRadius||(this.fill||this.__.__isCanvas)&&"pixel"===this.hitFill||"all"===this.hitStroke?F_.__updateHitCanvas.call(this):this.__hitCanvas&&(this.__hitCanvas=null)},z_.__hitFill=N_.__hitFill=function(t){return this.__hitCanvas?F_.__hitFill.call(this,t):Io.hitRadiusPoint(this.__layout.boxBounds,t)},Lf.prototype.__drawHitPath=function(t){const{__lineHeight:e,fontSize:i,__baseLine:s,__letterSpacing:n,__textDrawData:r}=this.__;t.beginPath(),n<0?this.__drawPathByBox(t):r.rows.forEach(n=>t.rect(n.x,n.y-s,n.width,e<i?i:e))},Ng.prototype.pick=function(t,e){return e||(e=ir),this.updateLayout(),Go.getSelector(this).getByPoint(t,e.hitRadius||0,Object.assign(Object.assign({},e),{target:this}))};var V_,H_=Oa.prototype;function Y_(t,e,i,s){return new(i||(i=Promise))(function(n,r){function o(t){try{h(s.next(t))}catch(t){r(t)}}function a(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,a)}h((s=s.apply(t,e||[])).next())})}H_.hitFill=function(t,e){return e?this.context.isPointInPath(t.x,t.y,e):this.context.isPointInPath(t.x,t.y)},H_.hitStroke=function(t,e){return this.strokeWidth=e,this.context.isPointInStroke(t.x,t.y)},H_.hitPixel=function(t,e,i=1){let{x:s,y:n,radiusX:r,radiusY:o}=t;e&&(s-=e.x,n-=e.y),Vo.set(s-r,n-o,2*r,2*o).scale(i).ceil();const{data:a}=this.context.getImageData(Vo.x,Vo.y,Vo.width||1,Vo.height||1);for(let h=0,l=a.length;h<l;h+=4)if(a[h+3]>0)return!0;return a[3]>0},function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(V_||(V_={}));var X_=$o.get("LeaferCanvas"),j_=class extends Oa{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:i}=this;if(e&&i){const s=i.children[t];s?(this.setAbsolute(s),i.insertBefore(e,s)):i.appendChild(s)}}init(){const{config:t}=this,e=t.view||t.canvas;e?this.__createViewFrom(e):this.__createView();const{style:i}=this.view;if(i.display||(i.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none",this.view.classList.add("leafer-canvas-view")}Go.syncDomFont&&!this.parentView&&(i.display="none",document.body&&document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e=rr(t)?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:i}=e;i.position="absolute",i.top=i.bottom=i.left=i.right="0px",document.body.appendChild(e),t=e}this.__createView();const i=this.view;t.hasChildNodes()&&(this.setAbsolute(i),t.style.position||(t.style.position="relative")),t.appendChild(i)}else X_.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:i}=this,{style:s}=this.view;s.width=t+"px",s.height=e+"px",this.unreal||(this.view.width=Math.ceil(t*i),this.view.height=Math.ceil(e*i))}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,e){if(this.resizeListener=e,t){if(this.autoBounds=t,this.resizeObserver)return;try{this.resizeObserver=new ResizeObserver(t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)});const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),X_.warn("no parent"))}catch(t){this.imitateResizeObserver()}this.stopListenPixelRatio()}else this.listenPixelRatio(),this.unreal&&this.updateViewSize()}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),Go.requestRender(this.imitateResizeObserver.bind(this)))}listenPixelRatio(){this.windowListener||window.addEventListener("resize",this.windowListener=()=>{const t=Go.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:i}=this;this.emitResize({width:e,height:i,pixelRatio:t})}})}stopListenPixelRatio(){this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null)}checkAutoBounds(t){const e=this.view,{x:i,y:s,width:n,height:r}=this.autoBounds.getBoundsFrom(t),o={width:n,height:r,pixelRatio:this.config.pixelRatio?this.pixelRatio:Go.devicePixelRatio};if(!this.isSameSize(o)){const{style:t}=e;t.marginLeft=i+"px",t.marginTop=s+"px",this.emitResize(o)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};pr.copyAttrs(e,this,Ca),this.resize(t),this.resizeListener&&!sr(this.width)&&this.resizeListener(new Bu(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){let t=this.view;t&&t.remove(),t=this.view=document.createElement("div"),this.parentView.appendChild(this.view),t.classList.add("leafer-app-view"),this.unreal=!0}}destroy(){const{view:t}=this;t&&(this.stopAutoLayout(),this.stopListenPixelRatio(),t.parentElement&&t.remove(),super.destroy())}};Vc(CanvasRenderingContext2D.prototype),Vc(Path2D.prototype),Object.assign(na,{canvas:(t,e)=>new j_(t,e),image:t=>new td(t)}),Go.name="web",Go.isMobile="ontouchstart"in window,Go.requestRender=function(t){window.requestAnimationFrame(t)},ed(Go,"devicePixelRatio",{get:()=>devicePixelRatio});var{userAgent:U_}=navigator;U_.indexOf("Firefox")>-1?(Go.intWheelDeltaY=!0,Go.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(Go.fullImageShadow=!0),U_.indexOf("Windows")>-1?(Go.os="Windows",Go.intWheelDeltaY=!0):U_.indexOf("Mac")>-1?Go.os="Mac":U_.indexOf("Linux")>-1&&(Go.os="Linux");var G_=class{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new eg;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new eg,this.target=t,e&&(this.config=pr.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Mu.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===yu.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent))),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let i=0,s=e.length;i<s;i++)this.__pushChild(e[i])}__onRquestData(){this.target.emitEvent(new Pu(Pu.DATA,{updatedList:this.updatedList})),this.__updatedList=new eg,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[xu.CHANGE,this.__onAttrChange,this],[[yu.ADD,yu.REMOVE],this.__onChildEvent,this],[Pu.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}},{updateAllMatrix:K_,updateBounds:Z_,updateChange:$_}=Yd,{pushAllChildBranch:q_,pushAllParent:J_}=eu,{worldBounds:Q_}=Jd,tm=class{constructor(t){this.updatedBounds=new No,this.beforeBounds=new No,this.afterBounds=new No,hr(t)&&(t=new eg(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Q_)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Q_),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}},{updateAllMatrix:em,updateAllChange:im}=Yd,sm=$o.get("Layouter"),nm=class t{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new ig,this.target=t,e&&(this.config=pr.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Lu.START),this.layoutOnce(),t.emitEvent(new Lu(Lu.END,this.layoutedBlocks,this.times))}catch(t){sm.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?sm.warn("layouting"):this.times>3?sm.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Pu.REQUEST),this.totalTimes>1&&this.config.usePartLayout?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=ta.start("PartLayout"),{target:i,__updatedList:s}=this,{BEFORE:n,LAYOUT:r,AFTER:o}=Lu,a=this.getBlocks(s);a.forEach(t=>t.setBefore()),i.emitEvent(new Lu(n,a,this.times)),this.extraBlock=null,s.sort(),function(t,e){let i;t.list.forEach(t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(K_(t,!0),e.add(t),t.isBranch&&q_(t,e),J_(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),J_(t,e)))})}(s,this.__levelList),function(t){let e,i,s;t.sort(!0),t.levels.forEach(n=>{e=t.levelMap[n];for(let t=0,r=e.length;t<r;t++){if(i=e[t],i.isBranch&&i.__tempNumber){s=i.children;for(let t=0,e=s.length;t<e;t++)s[t].isBranch||Z_(s[t])}Z_(i)}})}(this.__levelList),function(t){t.list.forEach($_)}(s),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),i.emitEvent(new Lu(r,a,this.times)),i.emitEvent(new Lu(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,ta.end(e)}fullLayout(){const e=ta.start("FullLayout"),{target:i}=this,{BEFORE:s,LAYOUT:n,AFTER:r}=Lu,o=this.getBlocks(new eg(i));i.emitEvent(new Lu(s,o,this.times)),t.fullLayout(i),o.forEach(t=>{t.setAfter()}),i.emitEvent(new Lu(n,o,this.times)),i.emitEvent(new Lu(r,o,this.times)),this.addBlocks(o),ta.end(e)}static fullLayout(t){em(t,!0),t.isBranch?eu.updateBounds(t):Yd.updateBounds(t),im(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new tm([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new tm(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Lu.REQUEST,this.layout,this],[Lu.AGAIN,this.layoutAgain,this],[Pu.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}},rm=$o.get("Renderer"),om=class t{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,i){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,ceilPartPixel:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,i&&(this.config=pr.default(i,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(Lu.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Mu.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Mu.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Mu.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new No,rm.log(e.innerName,"---\x3e");try{this.emitRender(Mu.START),this.renderOnce(t),this.emitRender(Mu.END,this.totalBounds),$c.clearRecycled()}catch(t){this.rendering=!1,rm.error(t)}rm.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return rm.warn("rendering");if(this.times>3)return rm.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new No,this.renderOptions={},t)this.emitRender(Mu.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Mu.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Mu.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Mu.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(e){const i=ta.start("PartRender"),{canvas:s}=this,n=e.getIntersect(s.bounds),r=new No(n);s.save(),n.spread(t.clipSpread).ceil();const{ceilPartPixel:o}=this.config;s.clipWorld(n,o),s.clearWorld(n,o),this.__render(n,r),s.restore(),ta.end(i)}fullRender(){const t=ta.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),ta.end(t)}__render(t,e){const{canvas:i,target:s}=this,n=t.includes(s.__world),r=n?{includes:n}:{bounds:t,includes:n};this.needFill&&i.fillWorld(t,this.config.fill),$o.showRepaint&&$o.drawRepaint(i,t),this.config.useCellRender&&(r.cellList=this.getCellList()),Go.render(s,i,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),i.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new No;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:i}=this.config;if(i&&t>i)return Go.requestRender(e);const{frames:s}=this;s.length>30&&s.shift(),s.push(t),this.FPS=Math.round(s.reduce((t,e)=>t+e,0)/s.length),this.requestTime=0,this.checkRender()};Go.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new No(0,0,e,i).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new No(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:i}=t;i&&i.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||rm.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,i)})}emitRender(t,e,i){this.target.emitEvent(new Mu(t,this.times,e,i))}__listenEvents(){this.__eventIds=[this.target.on_([[Mu.REQUEST,this.update,this],[Lu.END,this.__onLayoutEnd,this],[Mu.AGAIN,this.renderAgain,this],[Bu.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}};om.clipSpread=10;var am={},{copyRadiusPoint:hm}=no,{hitRadiusPoint:lm}=Io,cm=class{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const s=i.through||!1,n=i.ignoreHittable||!1,r=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new eg(i.findList),i.findList||this.hitBranch(r.isBranchLeaf?{children:[r]}:r);const{list:o}=this.findList,a=this.getBestMatchLeaf(o,i.bottomList,n,!!i.findList),h=n?this.getPath(a):this.getHitablePath(a);return this.clear(),s?{path:h,target:a,throughPath:o.length?this.getThroughPath(o):h}:{path:h,target:a}}hitPoint(t,e,i){return!!this.getByPoint(t,e,i).target}getBestMatchLeaf(t,e,i,s){const n=this.findList=new eg;if(t.length){let e;const{x:s,y:r}=this.point,o={x:s,y:r,radiusX:0,radiusY:0};for(let a=0,h=t.length;a<h;a++)if(e=t[a],(i||Yd.worldHittable(e))&&(this.hitChild(e,o),n.length)){if(e.isBranchLeaf&&t.some(t=>t!==e&&Yd.hasParent(t,e))){n.reset();break}return n.list[0]}}if(e)for(let r=0,o=e.length;r<o;r++)if(this.hitChild(e[r].target,this.point,e[r].proxy),n.length)return n.list[0];return s?null:i?t[0]:t.find(t=>Yd.worldHittable(t))}getPath(t){const e=new eg,i=[],{target:s}=this;for(;t&&(t.syncEventer&&i.push(t.syncEventer),e.add(t),(t=t.parent)!==s););return i.length&&i.forEach(t=>{for(;t&&(t.__.hittable&&e.add(t),(t=t.parent)!==s););}),s&&e.add(s),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,s=new eg;for(let n=e.list.length-1;n>-1&&(i=e.list[n],i.__.hittable)&&(s.addAt(i,0),i.__.hitChildren&&(!i.isLeafer||"draw"!==i.mode));n--);return s}getThroughPath(t){const e=new eg,i=[];for(let o=t.length-1;o>-1;o--)i.push(this.getPath(t[o]));let s,n,r;for(let o=0,a=i.length;o<a;o++){s=i[o],n=i[o+1];for(let t=0,i=s.length;t<i&&(r=s.list[t],!n||!n.has(r));t++)e.add(r)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,s,n;const{point:r}=this;for(let o=t.length-1;o>-1;o--)if(i=t[o],n=i.__,n.visible&&(!e||n.mask))if(s=lm(i.__world,n.hitRadius?hm(am,r,n.hitRadius):r),i.isBranch){if(s||i.__ignoreHitWorld){if(i.isBranchLeaf&&n.__clipAfterFill&&!i.__hitWorld(r,!0))continue;i.topChildren&&this.eachFind(i.topChildren,!1),this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&this.hitChild(i,r)}}else s&&this.hitChild(i,r)}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:s}=t;if(s&&s.__hasMask&&!t.__.mask){let i,n=[];const{children:r}=s;for(let s=0,o=r.length;s<o;s++)if(i=r[s],i.__.mask&&n.push(i),i===t){if(n&&!n.every(t=>t.__hitWorld(e)))return;break}}this.findList.add(i||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}},dm=class{constructor(t,e){this.config={},e&&(this.config=pr.default(e,this.config)),this.picker=new cm(this.target=t,this),this.finder=na.finder&&na.finder(t,this.config)}getByPoint(t,e,i){const{target:s,picker:n}=this;return Go.backgrounder&&s&&s.updateLayout(),n.getByPoint(t,e,i)}hitPoint(t,e,i){return this.picker.hitPoint(t,e,i)}getBy(t,e,i,s){return this.finder?this.finder.getBy(t,e,i,s):sa.need("find")}destroy(){this.picker.destroy(),this.finder&&this.finder.destroy()}};Object.assign(na,{watcher:(t,e)=>new G_(t,e),layouter:(t,e)=>new nm(t,e),renderer:(t,e,i)=>new om(t,e,i),selector:(t,e)=>new dm(t,e)}),Go.layout=nm.fullLayout,Go.render=function(t,e,i){const s=Object.assign(Object.assign({},i),{topRendering:!0});i.topList=new eg,t.__render(e,i),i.topList.length&&i.topList.forEach(t=>t.__render(e,s))};var um={convert(t,e){const i=c_.getBase(t),{x:s,y:n}=e,r=Object.assign(Object.assign({},i),{x:s,y:n,width:t.width,height:t.height,pointerType:t.pointerType,pressure:t.pressure});return"pen"===r.pointerType&&(r.tangentialPressure=t.tangentialPressure,r.tiltX=t.tiltX,r.tiltY=t.tiltY,r.twist=t.twist),r},convertMouse(t,e){const i=c_.getBase(t),{x:s,y:n}=e;return Object.assign(Object.assign({},i),{x:s,y:n,width:1,height:1,pointerType:"mouse",pressure:.5})},convertTouch(t,e){const i=um.getTouch(t),s=c_.getBase(t),{x:n,y:r}=e;return Object.assign(Object.assign({},s),{x:n,y:r,width:1,height:1,pointerType:"touch",multiTouch:t.touches.length>1,pressure:i.force})},getTouch:t=>t.targetTouches[0]||t.changedTouches[0]},pm={convert(t){const e=c_.getBase(t);return Object.assign(Object.assign({},e),{code:t.code,key:t.key})}},{pathCanDrag:gm}=c_,fm=class extends C_{get windowTarget(){const{view:t}=this;return t&&t.ownerDocument||window}get notPointer(){const{p:t}=this;return"pointer"!==t.type||t.touch||this.useMultiTouch}get notTouch(){const{p:t}=this;return"mouse"===t.type||this.usePointer}get notMouse(){return this.usePointer||this.useTouch}__listenEvents(){super.__listenEvents();const t=this.view=this.canvas.view;this.viewEvents={pointerdown:this.onPointerDown,mousedown:this.onMouseDown,touchstart:this.onTouchStart,pointerleave:this.onPointerLeave,contextmenu:this.onContextMenu,wheel:this.onWheel,gesturestart:this.onGesturestart,gesturechange:this.onGesturechange,gestureend:this.onGestureend},this.windowEvents={pointermove:this.onPointerMove,pointerup:this.onPointerUp,pointercancel:this.onPointerCancel,mousemove:this.onMouseMove,mouseup:this.onMouseUp,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchCancel,keydown:this.onKeyDown,keyup:this.onKeyUp,scroll:this.onScroll};const{viewEvents:e,windowEvents:i}=this;for(let s in e)e[s]=e[s].bind(this),t.addEventListener(s,e[s]);for(let s in i)i[s]=i[s].bind(this),this.windowTarget.addEventListener(s,i[s])}__removeListenEvents(){super.__removeListenEvents();const{viewEvents:t,windowEvents:e}=this;for(let i in t)this.view.removeEventListener(i,t[i]),this.viewEvents={};for(let i in e)this.windowTarget.removeEventListener(i,e[i]),this.windowEvents={}}getTouches(t){const e=[];for(let i=0,s=t.length;i<s;i++)e.push(t[i]);return e}preventDefaultPointer(t){const{pointer:e}=this.config;e.preventDefault&&t.preventDefault()}preventDefaultWheel(t){const{wheel:e}=this.config;e.preventDefault&&t.preventDefault()}preventWindowPointer(t){return!(this.downData||t.target===this.view||this.config.shadowDOM&&t.composedPath&&t.composedPath().includes(this.view))}onKeyDown(t){this.keyDown(pm.convert(t))}onKeyUp(t){this.keyUp(pm.convert(t))}onContextMenu(t){this.config.pointer.preventDefaultMenu&&t.preventDefault(),this.menu(um.convert(t,this.getLocal(t)))}onScroll(){this.canvas.updateClientBounds()}onPointerDown(t){this.preventDefaultPointer(t),this.notPointer||(this.usePointer||(this.usePointer=!0),this.pointerDown(um.convert(t,this.getLocal(t))))}onPointerMove(t,e){if(this.notPointer||this.preventWindowPointer(t))return;this.usePointer||(this.usePointer=!0);const i=um.convert(t,this.getLocal(t,!0));e?this.pointerHover(i):this.pointerMove(i)}onPointerLeave(t){this.onPointerMove(t,!0)}onPointerUp(t){this.downData&&this.preventDefaultPointer(t),this.notPointer||this.preventWindowPointer(t)||this.pointerUp(um.convert(t,this.getLocal(t)))}onPointerCancel(){this.useMultiTouch||this.pointerCancel()}onMouseDown(t){this.preventDefaultPointer(t),this.notMouse||this.pointerDown(um.convertMouse(t,this.getLocal(t)))}onMouseMove(t){this.notMouse||this.preventWindowPointer(t)||this.pointerMove(um.convertMouse(t,this.getLocal(t,!0)))}onMouseUp(t){this.downData&&this.preventDefaultPointer(t),this.notMouse||this.preventWindowPointer(t)||this.pointerUp(um.convertMouse(t,this.getLocal(t)))}onMouseCancel(){this.notMouse||this.pointerCancel()}onTouchStart(t){const e=um.getTouch(t),i=this.getLocal(e,!0),{preventDefault:s}=this.config.touch;(!0===s||"auto"===s&&gm(this.findPath(i)))&&t.preventDefault(),this.multiTouchStart(t),this.notTouch||(this.touchTimer&&(window.clearTimeout(this.touchTimer),this.touchTimer=0),this.useTouch=!0,this.pointerDown(um.convertTouch(t,i)))}onTouchMove(t){if(this.multiTouchMove(t),this.notTouch||this.preventWindowPointer(t))return;const e=um.getTouch(t);this.pointerMove(um.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){if(this.multiTouchEnd(),this.notTouch||this.preventWindowPointer(t))return;this.touchTimer&&clearTimeout(this.touchTimer),this.touchTimer=setTimeout(()=>{this.useTouch=!1},500);const e=um.getTouch(t);this.pointerUp(um.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.notTouch||this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>1,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),i=this.getKeepTouchList(this.touches,e);i.length>1&&(this.multiTouch(c_.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const s=[];return t.forEach(t=>{i=e.find(e=>e.identifier===t.identifier),i&&s.push({from:this.getLocal(t),to:this.getLocal(i)})}),s}getLocalTouchs(t){return t.map(t=>this.getLocal(t))}onWheel(t){this.preventDefaultWheel(t),this.wheel(Object.assign(Object.assign(Object.assign({},c_.getBase(t)),this.getLocal(t)),{deltaX:t.deltaX,deltaY:t.deltaY}))}onGesturestart(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.lastGestureScale=1,this.lastGestureRotation=0)}onGesturechange(t){if(this.useMultiTouch)return;this.preventDefaultWheel(t);const e=c_.getBase(t);Object.assign(e,this.getLocal(t));const i=t.scale/this.lastGestureScale,s=(t.rotation-this.lastGestureRotation)/Math.PI*180*(Pr.within(this.config.wheel.rotateSpeed,0,1)/4+.1);this.zoom(Object.assign(Object.assign({},e),{scale:i*i})),this.rotate(Object.assign(Object.assign({},e),{rotation:s})),this.lastGestureScale=t.scale,this.lastGestureRotation=t.rotation}onGestureend(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.transformEnd())}setCursor(t){super.setCursor(t);const e=[];this.eachCursor(t,e),lr(e[e.length-1])&&e.push("default"),this.canvas.view.style.cursor=e.map(t=>lr(t)?`url(${t.url}) ${t.x||0} ${t.y||0}`:t).join(",")}eachCursor(t,e,i=0){if(i++,hr(t))t.forEach(t=>this.eachCursor(t,e,i));else{const s=rr(t)&&O_.get(t);s&&i<2?this.eachCursor(s,e,i):e.push(t)}}destroy(){this.view&&(super.destroy(),this.view=null,this.touches=null)}};function _m(t,e,i){t.__.__font?cg.fillText(t,e,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function mm(t,e,i,s,n){const r=i.__;lr(t)?cg.drawStrokesStyle(t,e,!1,i,s,n):(s.setStroke(t,r.__strokeWidth*e,r),s.stroke()),r.__useArrow&&cg.strokeArrow(t,i,s,n)}function vm(t,e,i,s,n){const r=i.__;lr(t)?cg.drawStrokesStyle(t,e,!0,i,s,n):(s.setStroke(t,r.__strokeWidth*e,r),cg.drawTextStroke(i,s,n))}function ym(t,e,i,s,n){const r=s.getSameCanvas(!0,!0);r.font=i.__.__font,vm(t,2,i,r,n),r.blendMode="outside"===e?"destination-out":"destination-in",cg.fillText(i,r,n),r.blendMode="normal",Yd.copyCanvasByWorld(i,s,r),r.recycle(i.__nowWorld)}var wm,{getSpread:xm,copyAndSpread:bm,toOuterOf:km,getOuterOf:Sm,getByMove:Em,move:Cm,getIntersectData:Om}=Io,Tm={},{stintSet:Rm}=pr,{hasTransparent:Bm}=ag;function Pm(t,e,i){if(!lr(e)||!1===e.visible||0===e.opacity)return;let s;const{boxBounds:n}=i.__layout,{type:r}=e;switch(r){case"image":case"film":case"video":if(!e.url)return;s=dg.image(i,t,e,n,!wm||!wm[e.url]),"image"!==r&&dg[r](s);break;case"linear":s=ug.linearGradient(e,n);break;case"radial":s=ug.radialGradient(e,n);break;case"angular":s=ug.conicGradient(e,n);break;case"solid":const{color:o,opacity:a}=e;s={type:r,style:ag.string(o,a)};break;default:sr(e.r)||(s={type:"solid",style:ag.string(e)})}if(s&&(s.originPaint=e,rr(s.style)&&Bm(s.style)&&(s.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;s.strokeStyle=e.style}return s}var Lm,Mm={compute:function(t,e){const i=e.__,s=[];let n,r,o,a=i.__input[t];hr(a)||(a=[a]),wm=dg.recycleImage(t,i);for(let h,l=0,c=a.length;l<c;l++)(h=Pm(t,a[l],e))&&(s.push(h),h.strokeStyle&&(o||(o=1),h.strokeStyle.strokeWidth&&(o=Math.max(o,h.strokeStyle.strokeWidth))));i["_"+t]=s.length?s:void 0,s.length?(s.every(t=>t.isTransparent)&&(s.some(t=>t.image)&&(n=!0),r=!0),"fill"===t?(Rm(i,"__isAlphaPixelFill",n),Rm(i,"__isTransparentFill",r)):(Rm(i,"__isAlphaPixelStroke",n),Rm(i,"__isTransparentStroke",r),Rm(i,"__hasMultiStrokeStyle",o))):i.__removePaint(t,!1)},fill:function(t,e,i,s){i.fillStyle=t,_m(e,i,s)},fills:function(t,e,i,s){let n,r,o;for(let a=0,h=t.length;a<h;a++){if(n=t[a],r=n.originPaint,n.image){if(o?o++:o=1,dg.checkImage(n,!e.__.__font,e,i,s))continue;if(!n.style){1===o&&n.image.isPlacehold&&e.drawImagePlaceholder(n,i,s);continue}}if(i.fillStyle=n.style,n.transform||r.scaleFixed){if(i.save(),n.transform&&i.transform(n.transform),r.scaleFixed){const{scaleX:t,scaleY:s}=e.getRenderScaleData(!0,r.scaleFixed,!1);1!==t&&i.scale(t,s)}r.blendMode&&(i.blendMode=r.blendMode),_m(e,i,s),i.restore()}else r.blendMode?(i.saveBlendMode(r.blendMode),_m(e,i,s),i.restoreBlendMode()):_m(e,i,s)}},fillPathOrText:_m,fillText:function(t,e,i){const s=t.__,{rows:n,decorationY:r}=s.__textDrawData;let o;s.__isPlacehold&&s.placeholderColor&&(e.fillStyle=s.placeholderColor);for(let a=0,h=n.length;a<h;a++)o=n[a],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(r){const{decorationColor:t,decorationHeight:i}=s.__textDrawData;t&&(e.fillStyle=t),n.forEach(t=>r.forEach(s=>e.fillRect(t.x,t.y+s,t.width,i)))}},stroke:function(t,e,i,s){const n=e.__;if(n.__strokeWidth)if(n.__font)cg.strokeText(t,e,i,s);else if(n.__pathForStroke)cg.fillStroke(t,e,i,s);else switch(n.strokeAlign){case"center":mm(t,1,e,i,s);break;case"inside":!function(t,e,i,s){i.save(),i.clipUI(e),mm(t,2,e,i,s),i.restore()}(t,e,i,s);break;case"outside":!function(t,e,i,s){const n=e.__;if(n.__fillAfterStroke)mm(t,2,e,i,s);else{const{renderBounds:r}=e.__layout,o=i.getSameCanvas(!0,!0);e.__drawRenderPath(o),mm(t,2,e,o,s),o.clipUI(n),o.clearWorld(r),Yd.copyCanvasByWorld(e,i,o),o.recycle(e.__nowWorld)}}(t,e,i,s)}},strokes:function(t,e,i,s){cg.stroke(t,e,i,s)},strokeText:function(t,e,i,s){switch(e.__.strokeAlign){case"center":vm(t,1,e,i,s);break;case"inside":ym(t,"inside",e,i,s);break;case"outside":e.__.__fillAfterStroke?vm(t,2,e,i,s):ym(t,"outside",e,i,s)}},drawTextStroke:function(t,e,i){let s,n=t.__.__textDrawData;const{rows:r,decorationY:o}=n;for(let a=0,h=r.length;a<h;a++)s=r[a],s.text?e.strokeText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.strokeText(t.char,t.x,s.y)});if(o){const{decorationHeight:t}=n;r.forEach(i=>o.forEach(s=>e.strokeRect(i.x,i.y+s,i.width,t)))}},drawStrokesStyle:function(t,e,i,s,n,r){let o;const a=s.__,{__hasMultiStrokeStyle:h}=a;h||n.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,c=t.length;l<c;l++)if(o=t[l],(!o.image||!dg.checkImage(o,!1,s,n,r))&&o.style){if(h){const{strokeStyle:t}=o;t?n.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):n.setStroke(o.style,a.__strokeWidth*e,a)}else n.strokeStyle=o.style;o.originPaint.blendMode?(n.saveBlendMode(o.originPaint.blendMode),i?cg.drawTextStroke(s,n,r):n.stroke(),n.restoreBlendMode()):i?cg.drawTextStroke(s,n,r):n.stroke()}},shape:function(t,e,i){const s=e.getSameCanvas(),n=e.bounds,r=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,c,d,u,p;km(o.strokeSpread?(bm(Tm,o.boxBounds,o.strokeSpread),Tm):o.boxBounds,r,a);let{scaleX:g,scaleY:f}=t.getRenderScaleData(!0);if(n.includes(a))p=s,h=u=a,l=r;else{let s;s=Go.fullImageShadow?a:Om(o.renderShapeSpread?xm(n,wr.swapAndScale(o.renderShapeSpread,g,f)):n,a),d=n.getFitMatrix(s);let{a:_,d:m}=d;d.a<1&&(p=e.getSameCanvas(),t.__renderShape(p,i),g*=_,f*=m),u=Sm(a,d),h=Em(u,-d.e,-d.f),l=Sm(r,d),Cm(l,-d.e,-d.f);const v=i.matrix;v?(c=new uo(d),c.multiply(v),_*=v.scaleX,m*=v.scaleY):c=d,c.withScale(_,m),i=Object.assign(Object.assign({},i),{matrix:c})}return t.__renderShape(s,i),{canvas:s,matrix:c,fitMatrix:d,bounds:h,renderBounds:l,worldCanvas:p,shapeBounds:u,scaleX:g,scaleY:f}}},Dm=new No,{isSame:Am}=Io;function Im(t,e,i,s,n,r){let o=!0;const a=t.__;if("fill"!==e||a.__naturalWidth||(a.__naturalWidth=s.width/a.pixelRatio,a.__naturalHeight=s.height/a.pixelRatio,a.__autoSide&&(t.forceUpdate("width"),Yd.updateBounds(t),t.__proxyData&&(t.setProxyAttr("width",a.width),t.setProxyAttr("height",a.height)),o=!1)),!n.data){dg.createData(n,s,i,r);const{transform:t}=n.data,{opacity:e,blendMode:o}=i,h=t&&!t.onlyScale||a.path||a.cornerRadius;(h||e&&e<1||o)&&(n.complex=!h||2)}return i.filter&&dg.applyFilter(n,s,i.filter,t),o}function Wm(t,e){Nm(t,ku.LOAD,e)}function Fm(t,e){Nm(t,ku.LOADED,e)}function zm(t,e,i){e.error=i,t.forceUpdate("surface"),Nm(t,ku.ERROR,e)}function Nm(t,e,i){t.hasEvent(e)&&t.emitEvent(new ku(e,i))}function Vm(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}var{get:Hm,translate:Ym}=Ur,Xm=new No,jm={},Um={};function Gm(t,e,i,s){const n=rr(t)||s?(s?i-s*e:i%e)/((s||Math.floor(i/e))-1):t;return"auto"===t&&n<0?0:n}var Km={},Zm={a:1,b:0,c:0,d:1,e:0,f:0},{get:$m,set:qm,rotateOfOuter:Jm,translate:Qm,scaleOfOuter:tv,multiplyParent:ev,scale:iv,rotate:sv,skew:nv}=Ur;function rv(t,e,i,s,n,r,o,a){o&&sv(t,o),a&&nv(t,a.x,a.y),n&&iv(t,n,r),Qm(t,e.x+i,e.y+s)}var{get:ov,scale:av,copy:hv}=Ur,{getFloorScale:lv}=Pr,{abs:cv}=Math,dv={image:function(t,e,i,s,n){let r,o;const a=$c.get(i,i.type);return Lm&&i===Lm.paint&&Am(s,Lm.boxBounds)?r=Lm.leafPaint:(r={type:i.type,image:a},a.hasAlphaPixel&&(r.isTransparent=!0),Lm=a.use>1?{leafPaint:r,paint:i,boxBounds:Dm.set(s)}:null),(n||a.loading)&&(o={image:a,attrName:e,attrValue:i}),a.ready?(Im(t,e,i,a,r,s),n&&(Wm(t,o),Fm(t,o))):a.error?n&&zm(t,o,a.error):(n&&(Vm(t,!0),Wm(t,o)),r.loadId=a.load(()=>{Vm(t,!1),t.destroyed||(Im(t,e,i,a,r,s)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Fm(t,o)),r.loadId=void 0},e=>{Vm(t,!1),zm(t,o,e),r.loadId=void 0},i.lod&&a.getThumbSize(i.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),r},checkImage:function(t,e,i,s,n){const{scaleX:r,scaleY:o}=dg.getImageRenderScaleData(t,i,s,n),a=t.film?t.nowIndex:r+"-"+o,{image:h,data:l,originPaint:c}=t,{exporting:d,snapshot:u}=n;return!(!l||t.patternId===a&&!d||u||(e&&(l.repeat?e=!1:c.changeful||t.film||"miniapp"===Go.name||d||(e=Go.image.isLarge(h,r,o)||h.width*r>8096||h.height*o>8096)),e?(i.__.__isFastShadow&&(s.fillStyle=t.style||"#000",s.fill()),dg.drawImage(t,r,o,i,s,n),0):(!t.style||c.sync||d?dg.createPattern(t,i,s,n):dg.createPatternTask(t,i,s,n),1)))},drawImage:function(t,e,i,s,n,r){const{data:o,image:a,complex:h}=t;let{width:l,height:c}=a;if(h){const{blendMode:r,opacity:d}=t.originPaint,{transform:u}=o;n.save(),2===h&&n.clipUI(s),r&&(n.blendMode=r),d&&(n.opacity*=d),u&&n.transform(u),a.render(n,0,0,l,c,s,t,e,i),n.restore()}else o.scaleX&&(l*=o.scaleX,c*=o.scaleY),a.render(n,0,0,l,c,s,t,e,i)},getImageRenderScaleData:function(t,e,i,s){const n=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:r}=t;if(i){const{pixelRatio:t}=i;n.scaleX*=t,n.scaleY*=t}return r&&r.scaleX&&(n.scaleX*=Math.abs(r.scaleX),n.scaleY*=Math.abs(r.scaleY)),n},recycleImage:function(t,e){const i=e["_"+t];if(hr(i)){let s,n,r,o,a;for(let h=0,l=i.length;h<l;h++)s=i[h],n=s.image,a=n&&n.url,a&&(r||(r={}),r[a]=!0,$c.recyclePaint(s),e.__willDestroy&&n.parent&&dg.recycleFilter(n,e.__leaf),n.loading&&(o||(o=e.__input&&e.__input[t]||[],hr(o)||(o=[o])),n.unload(i[h].loadId,!o.some(t=>t.url===a))));return r}return null},createPatternTask:function(t,e,i,s){t.patternTask||(t.patternTask=$c.patternTasker.add(()=>Y_(this,void 0,void 0,function*(){dg.createPattern(t,e,i,s),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,i.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,i,s){let{scaleX:n,scaleY:r}=dg.getImageRenderScaleData(t,e,i,s),o=t.film?t.nowIndex:n+"-"+r;if(t.patternId!==o&&!e.destroyed&&(!Go.image.isLarge(t.image,n,r)||t.data.repeat)){const{image:i,data:s}=t,{opacity:a}=t.originPaint,{transform:h,gap:l}=s,c=dg.getPatternFixScale(t,n,r);let d,u,p,{width:g,height:f}=i;c&&(n*=c,r*=c),g*=n,f*=r,l&&(u=l.x*n/cv(s.scaleX||1),p=l.y*r/cv(s.scaleY||1)),(h||1!==n||1!==r)&&(n*=lv(g+(u||0)),r*=lv(f+(p||0)),d=ov(),h&&hv(d,h),av(d,1/n,1/r));const _=i.getCanvas(g,f,a,void 0,u,p,e.leafer&&e.leafer.config.smooth,s.interlace);t.style=i.getPattern(_,s.repeat||Go.origin.noRepeat||"no-repeat",d,t),t.patternId=o}},getPatternFixScale:function(t,e,i){const{image:s}=t;let n,r=Go.image.maxPatternSize,o=s.width*s.height;return s.isSVG?e>1&&(n=Math.ceil(e)/e):r>o&&(r=o),(o*=e*i)>r&&(n=Math.sqrt(r/o)),n},createData:function(t,e,i,s){t.data=dg.getPatternData(i,s,e)},getPatternData:function(t,e,i){t.padding&&(e=Xm.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:s,height:n}=i,{mode:r,align:o,offset:a,scale:h,size:l,rotation:c,skew:d,clipSize:u,repeat:p,gap:g,interlace:f}=t,_=e.width===s&&e.height===n,m={mode:r},v="center"!==o&&(c||0)%180==90;let y,w;switch(Io.set(Um,0,0,v?n:s,v?s:n),r&&"cover"!==r&&"fit"!==r?((h||l)&&(Pr.getScaleData(h,l,i,jm),y=jm.scaleX,w=jm.scaleY),(o||g||p)&&(y&&Io.scale(Um,y,w,!0),o&&ko.toPoint(o,Um,e,Um,!0,!0))):_&&!c||(y=w=Io.getFitScale(e,Um,"fit"!==r),Io.put(e,i,o,y,!1,Um),Io.scale(Um,y,w,!0)),a&&no.move(Um,a),r){case"stretch":_?y&&(y=w=void 0):(y=e.width/s,w=e.height/n,dg.stretchMode(m,e,y,w));break;case"normal":case"clip":if(Um.x||Um.y||y||u||c||d){let t,i;u&&(t=e.width/u.width,i=e.height/u.height),dg.clipMode(m,e,Um.x,Um.y,y,w,c,d,t,i),t&&(y=y?y*t:t,w=w?w*i:i)}break;case"repeat":(!_||y||c||d)&&dg.repeatMode(m,e,s,n,Um.x,Um.y,y,w,c,d,o,t.freeTransform),p||(m.repeat="repeat");const i=lr(p);(g||i)&&(m.gap=function(t,e,i,s,n){let r,o;return lr(t)?(r=t.x,o=t.y):r=o=t,{x:Gm(r,i,n.width,e&&e.x),y:Gm(o,s,n.height,e&&e.y)}}(g,i&&p,Um.width,Um.height,e));break;default:y&&dg.fillOrFitMode(m,e,Um.x,Um.y,y,w,c)}return m.transform||(e.x||e.y)&&Ym(m.transform=Hm(),e.x,e.y),y&&(m.scaleX=y,m.scaleY=w),p&&(m.repeat=rr(p)?"x"===p?"repeat-x":"repeat-y":"repeat"),f&&(m.interlace=ar(f)||"percent"===f.type?{type:"x",offset:f}:f),m},stretchMode:function(t,e,i,s){const n=$m(),{x:r,y:o}=e;r||o?Qm(n,r,o):i>0&&s>0&&(n.onlyScale=!0),iv(n,i,s),t.transform=n},fillOrFitMode:function(t,e,i,s,n,r,o){const a=$m();Qm(a,e.x+i,e.y+s),iv(a,n,r),o&&Jm(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,i,s,n,r,o,a,h,l){const c=$m();rv(c,e,i,s,n,r,o,a),h&&(o||a?(qm(Zm),tv(Zm,e,h,l),ev(c,Zm)):tv(c,e,h,l)),t.transform=c},repeatMode:function(t,e,i,s,n,r,o,a,h,l,c,d){const u=$m();if(d)rv(u,e,n,r,o,a,h,l);else{if(h)if("center"===c)Jm(u,{x:i/2,y:s/2},h);else switch(sv(u,h),h){case 90:Qm(u,s,0);break;case 180:Qm(u,i,s);break;case 270:Qm(u,0,i)}Km.x=e.x+n,Km.y=e.y+r,Qm(u,Km.x,Km.y),o&&tv(u,Km,o,a)}t.transform=u}},{toPoint:uv}=_o,{hasTransparent:pv}=ag,gv={},fv={};function _v(t,e,i,s){if(i){let n,r,o,a;for(let t=0,h=i.length;t<h;t++)n=i[t],rr(n)?(o=t/(h-1),r=ag.string(n,s)):(o=n.offset,r=ag.string(n.color,s)),e.addColorStop(o,r),!a&&pv(r)&&(a=!0);a&&(t.isTransparent=!0)}}var{getAngle:mv,getDistance:vv}=no,{get:yv,rotateOfOuter:wv,scaleOfOuter:xv}=Ur,{toPoint:bv}=_o,kv={},Sv={};function Ev(t,e,i,s,n){let r;const{width:o,height:a}=t;if(o!==a||s){const t=mv(e,i);r=yv(),n?(xv(r,e,o/a*(s||1),1),wv(r,e,t+90)):(xv(r,e,1,o/a*(s||1)),wv(r,e,t))}return r}var{getDistance:Cv}=no,{toPoint:Ov}=_o,Tv={},Rv={},Bv={linearGradient:function(t,e){let{from:i,to:s,type:n,opacity:r}=t;uv(i||"top",e,gv),uv(s||"bottom",e,fv);const o=Go.canvas.createLinearGradient(gv.x,gv.y,fv.x,fv.y),a={type:n,style:o};return _v(a,o,t.stops,r),a},radialGradient:function(t,e){let{from:i,to:s,type:n,opacity:r,stretch:o}=t;bv(i||"center",e,kv),bv(s||"bottom",e,Sv);const a=Go.canvas.createRadialGradient(kv.x,kv.y,0,kv.x,kv.y,vv(kv,Sv)),h={type:n,style:a};_v(h,a,t.stops,r);const l=Ev(e,kv,Sv,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:i,to:s,type:n,opacity:r,rotation:o,stretch:a}=t;Ov(i||"center",e,Tv),Ov(s||"bottom",e,Rv);const h=Go.conicGradientSupport?Go.canvas.createConicGradient(o?o*Mr:0,Tv.x,Tv.y):Go.canvas.createRadialGradient(Tv.x,Tv.y,0,Tv.x,Tv.y,Cv(Tv,Rv)),l={type:n,style:h};_v(l,h,t.stops,r);const c=Ev(e,Tv,Rv,a||1,Go.conicGradientRotate90);return c&&(l.transform=c),l},getTransform:Ev},{copy:Pv,move:Lv,toOffsetOutBounds:Mv}=Io,{max:Dv,abs:Av}=Math,Iv={},Wv=new uo,Fv={};function zv(t,e){let i,s,n,r,o=0,a=0,h=0,l=0;return e.forEach(t=>{i=t.x||0,s=t.y||0,r=1.5*(t.blur||0),n=Av(t.spread||0),o=Dv(o,n+r-s),a=Dv(a,n+r+i),h=Dv(h,n+r+s),l=Dv(l,n+r-i)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function Nv(t,e,i){const{shapeBounds:s}=i;let n,r;Go.fullImageShadow?(Pv(Iv,t.bounds),Lv(Iv,e.x-s.x,e.y-s.y),n=t.bounds,r=Iv):(n=s,r=e),t.copyWorld(i.canvas,n,r)}var Vv,{toOffsetOutBounds:Hv}=Io,Yv={},Xv={shadow:function(t,e,i){let s,n;const{__nowWorld:r}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:c,scaleX:d,scaleY:u}=i,p=e.getSameCanvas(),g=o.length-1;Mv(h,Fv,l),o.forEach((o,f)=>{let _=1;if(o.scaleFixed){const t=Math.abs(r.scaleX);t>1&&(_=1/t)}p.setWorldShadow(Fv.offsetX+(o.x||0)*d*_,Fv.offsetY+(o.y||0)*u*_,(o.blur||0)*d*_,ag.string(o.color)),n=pg.getShadowTransform(t,p,i,o,Fv,_),n&&p.setTransform(n),Nv(p,Fv,i),n&&p.resetTransform(),s=l,o.box&&(p.restore(),p.save(),a&&(p.copyWorld(p,l,r,"copy"),s=r),a?p.copyWorld(a,r,r,"destination-out"):p.copyWorld(i.canvas,c,h,"destination-out")),Yd.copyCanvasByWorld(t,e,p,s,o.blendMode),g&&f<g&&p.clearWorld(s)}),p.recycle(s)},innerShadow:function(t,e,i){let s,n;const{__nowWorld:r}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:c,scaleX:d,scaleY:u}=i,p=e.getSameCanvas(),g=o.length-1;Hv(h,Yv,l),o.forEach((o,f)=>{let _=1;if(o.scaleFixed){const t=Math.abs(r.scaleX);t>1&&(_=1/t)}p.save(),p.setWorldShadow(Yv.offsetX+(o.x||0)*d*_,Yv.offsetY+(o.y||0)*u*_,(o.blur||0)*d*_),n=pg.getShadowTransform(t,p,i,o,Yv,_,!0),n&&p.setTransform(n),Nv(p,Yv,i),p.restore(),a?(p.copyWorld(p,l,r,"copy"),p.copyWorld(a,r,r,"source-out"),s=r):(p.copyWorld(i.canvas,c,h,"source-out"),s=l),p.fillWorld(s,ag.string(o.color),"source-in"),Yd.copyCanvasByWorld(t,e,p,s,o.blendMode),g&&f<g&&p.clearWorld(s)}),p.recycle(s)},blur:function(t,e,i){const{blur:s}=t.__;i.setWorldBlur(s*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){},getShadowRenderSpread:zv,getShadowTransform:function(t,e,i,s,n,r,o){if(s.spread){const i=2*s.spread*r*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return Wv.set().scaleOfOuter({x:(n.x+n.width/2)*e.pixelRatio,y:(n.y+n.height/2)*e.pixelRatio},1+i/a,1+i/h),Wv}},isTransformShadow(t){},getInnerShadowSpread:zv},{excludeRenderBounds:jv}=Jd;function Uv(t,e,i,s,n,r,o,a){switch(e){case"grayscale":Vv||(Vv=!0,n.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,i,s,n,r){const o=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(s,o),r&&s.recycle(o),Kv(t,e,i,1,n,r)}(t,i,s,n,o,a);break;case"opacity-path":Kv(t,i,s,r,o,a);break;case"path":a&&i.restore()}}function Gv(t){return t.getSameCanvas(!1,!0)}function Kv(t,e,i,s,n,r){const o=t.__nowWorld;e.resetTransform(),e.opacity=s,e.copyWorld(i,o,void 0,n),r?i.recycle(o):i.clearWorld(o)}Ng.prototype.__renderMask=function(t,e){let i,s,n,r,o,a;const{children:h}=this;for(let l=0,c=h.length;l<c;l++){if(i=h[l],a=i.__.mask,a){o&&(Uv(this,o,t,n,s,r,void 0,!0),s=n=null),"clipping"!==a&&"clipping-path"!==a||jv(i,e)||i.__render(t,e),r=i.__.opacity,Vv=!1,"path"===a||"clipping-path"===a?(r<1?(o="opacity-path",n||(n=Gv(t))):(o="path",t.save()),i.__clip(n||t,e)):(o="grayscale"===a?"grayscale":"alpha",s||(s=Gv(t)),n||(n=Gv(t)),i.__render(s,e));continue}const c=1===r&&i.__.__blendMode;c&&Uv(this,o,t,n,s,r,void 0,!1),jv(i,e)||i.__render(n||t,e),c&&Uv(this,o,t,n,s,r,c,!1)}Uv(this,o,t,n,s,r,void 0,!0)};var Zv=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",$v=Zv+"_#~&*+\\=|≮≯≈≠=…",qv=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function Jv(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}var Qv,ty=Jv("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),ey=Jv("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),iy=Jv(Zv),sy=Jv($v),ny=Jv("- —/~|┆·");!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(Qv||(Qv={}));var{Letter:ry,Single:oy,Before:ay,After:hy,Symbol:ly,Break:cy}=Qv;function dy(t){return ty[t]?ry:ny[t]?cy:ey[t]?ay:iy[t]?hy:sy[t]?ly:qv.test(t)?oy:ry}var uy={trimRight(t){const{words:e}=t;let i,s=0,n=e.length;for(let r=n-1;r>-1&&(i=e[r].data[0]," "===i.char);r--)s++,t.width-=i.width;s&&e.splice(n-s,s)}};function py(t,e,i){switch(e){case"title":return i?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}var gy,fy,_y,my,vy,yy,wy,xy,by,ky,Sy,Ey,Cy,Oy,Ty,Ry,By,{trimRight:Py}=uy,{Letter:Ly,Single:My,Before:Dy,After:Ay,Symbol:Iy,Break:Wy}=Qv,Fy=[];function zy(t,e){by&&!xy&&(xy=by),gy.data.push({char:t,width:e}),_y+=e}function Ny(){my+=_y,gy.width=_y,fy.words.push(gy),gy={data:[]},_y=0}function Vy(){Oy&&(Ty.paraNumber++,fy.paraStart=!0,Oy=!1),by&&(fy.startCharSize=xy,fy.endCharSize=by,xy=0),fy.width=my,Ry.width?Py(fy):By&&Hy(),Fy.push(fy),fy={words:[]},my=0}function Hy(){my>(Ty.maxWidth||0)&&(Ty.maxWidth=my)}var{top:Yy,right:Xy,bottom:jy,left:Uy}=Xr;function Gy(t,e,i){const{bounds:s,rows:n}=t;s[e]+=i;for(let r=0;r<n.length;r++)n[r][e]+=i}Object.assign(og,{getDrawData:function(t,e){rr(t)||(t=String(t));let i=0,s=0,n=e.__getInput("width")||0,r=e.__getInput("height")||0;const{__padding:o}=e;o&&(n?(i=o[Uy],n-=o[Xy]+o[Uy],!n&&(n=.01)):e.autoSizeAlign||(i=o[Uy]),r?(s=o[Yy],r-=o[Yy]+o[jy],!r&&(r=.01)):e.autoSizeAlign||(s=o[Yy]));const a={bounds:{x:i,y:s,width:n,height:r},rows:[],paraNumber:0,font:Go.canvas.font=e.__font};return function(t,e,i){Ty=t,Fy=t.rows,By=!(Ry=t.bounds).width&&!i.autoSizeAlign;const{__letterSpacing:s,paraIndent:n,textCase:r}=i,{canvas:o}=Go,{width:a}=Ry;if(i.__isCharMode){const t="none"!==i.textWrap,h="break"===i.textWrap;Oy=!0,Sy=null,xy=wy=by=_y=my=0,gy={data:[]},fy={words:[]};for(let i=0,l=(e=[...e]).length;i<l;i++)"\n"===(yy=e[i])?(_y&&Ny(),fy.paraEnd=!0,Vy(),Oy=!0):((ky=dy(yy))===Ly&&"none"!==r&&(yy=py(yy,r,!_y)),wy=o.measureText(yy).width,s&&(s<0&&(by=wy),wy+=s),Ey=ky===My&&(Sy===My||Sy===Ly)||Sy===My&&ky!==Ay,Cy=!(ky!==Dy&&ky!==My||Sy!==Iy&&Sy!==Ay),vy=Oy&&n?a-n:a,t&&a&&my+_y+wy>vy&&(h?(_y&&Ny(),my&&Vy()):(Cy||(Cy=ky===Ly&&Sy==Ay),Ey||Cy||ky===Wy||ky===Dy||ky===My||_y+wy>vy?(_y&&Ny(),my&&Vy()):my&&Vy()))," "===yy&&!0!==Oy&&my+_y===0||(ky===Wy?(" "===yy&&_y&&Ny(),zy(yy,wy),Ny()):Ey||Cy?(_y&&Ny(),zy(yy,wy)):zy(yy,wy)),Sy=ky);_y&&Ny(),my&&Vy(),Fy.length>0&&(Fy[Fy.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Ty.paraNumber++,my=o.measureText(t).width,Fy.push({x:n||0,text:t,width:my,paraStart:!0}),By&&Hy()})}(a,t,e),o&&function(t,e,i,s,n){if(!s&&i.autoSizeAlign)switch(i.textAlign){case"left":Gy(e,"x",t[Uy]);break;case"right":Gy(e,"x",-t[Xy])}if(!n&&i.autoSizeAlign)switch(i.verticalAlign){case"top":Gy(e,"y",t[Yy]);break;case"bottom":Gy(e,"y",-t[jy])}}(o,a,e,n,r),function(t,e){const{rows:i,bounds:s}=t,n=i.length,{__lineHeight:r,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:c,paraSpacing:d,autoSizeAlign:u}=e;let{x:p,y:g,width:f,height:_}=s,m=r*n+(d?d*(t.paraNumber-1):0),v=o;if(h&&m>_)m=Math.max(e.__autoHeight?m:_,r),n>1&&(t.overflow=n);else if(_||u)switch(c){case"middle":g+=(_-m)/2;break;case"bottom":g+=_-m}v+=g;let y,w,x,b=f||u?f:t.maxWidth;for(let k=0,S=n;k<S;k++){if(y=i[k],y.x=p,y.width<f||y.width>f&&!h)switch(l){case"center":y.x+=(b-y.width)/2;break;case"right":y.x+=b-y.width}y.paraStart&&d&&k>0&&(v+=d),y.y=v,v+=r,t.overflow>k&&v>m&&(y.isOverflow=!0,t.overflow=k+1),w=y.x,x=y.width,a<0&&(y.width<0?(x=-y.width+e.fontSize+a,w-=x,x+=e.fontSize):x-=a),w<s.x&&(s.x=w),x>s.width&&(s.width=x),h&&f&&f<x&&(y.isOverflow=!0,t.overflow||(t.overflow=i.length))}s.y=g,s.height=m}(a,e),e.__isCharMode&&function(t,e,i){const{rows:s}=t,{textAlign:n,paraIndent:r,__letterSpacing:o}=e,a=i&&n.includes("both"),h=a||i&&n.includes("justify"),l=h&&n.includes("letter");let c,d,u,p,g,f,_,m,v,y;s.forEach(t=>{t.words&&(g=r&&t.paraStart?r:0,m=t.words.length,h&&(y=!t.paraEnd||a,d=i-t.width-g,l?p=d/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=m>1?d/(m-1):0),f=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===f?(t.x+=g,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=g,c=t.x,t.data=[],t.words.forEach((e,i)=>{1===f?(_={char:"",x:c},c=function(t,e,i){return t.forEach(t=>{i.char+=t.char,e+=t.width}),e}(e.data,c,_),(t.isOverflow||" "!==_.char)&&t.data.push(_)):c=function(t,e,i,s,n){return t.forEach(t=>{(s||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width,n&&(e+=n)}),e}(e.data,c,t.data,t.isOverflow,y&&p),y&&(v=i===m-1,u?v||(c+=u,t.width+=u):p&&(t.width+=p*(e.data.length-(v?1:0))))})),t.words=null)})}(a,e,n),a.overflow&&function(t,e,i,s){const{rows:n,overflow:r}=t;let{textOverflow:o}=e;if(r&&n.splice(r),s&&o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?Go.canvas.measureText(o).width:0,l=i+s-h;("none"===e.textWrap?n:[n[r-1]]).forEach(e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let s=i;s>-1&&(t=e.data[s],a=t.x+t.width,!(s===i&&a<l));s--){if(a<l&&" "!==t.char||!s){e.data.splice(s+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(a,e,i,n),"none"!==e.textDecoration&&function(t,e){let i,s=0;const{fontSize:n,textDecoration:r}=e;switch(t.decorationHeight=n/11,lr(r)?(i=r.type,r.color&&(t.decorationColor=ag.string(r.color)),r.offset&&(s=Math.min(.3*n,Math.max(r.offset,.15*-n)))):i=r,i){case"under":t.decorationY=[.15*n+s];break;case"delete":t.decorationY=[.35*-n];break;case"under-delete":t.decorationY=[.15*n+s,.35*-n]}}(a,e),a}}),Object.assign(ag,{string:function(t,e){if(!t)return"#000";const i=ar(e)&&e<1;if(rr(t)){if(!i||!ag.object)return t;t=ag.object(t)}let s=sr(t.a)?1:t.a;i&&(s*=e);const n=t.r+","+t.g+","+t.b;return 1===s?"rgb("+n+")":"rgba("+n+","+s+")"}}),Object.assign(cg,Mm),Object.assign(dg,dv),Object.assign(ug,Bv),Object.assign(pg,Xv),Object.assign(na,{interaction:(t,e,i,s)=>new fm(t,e,i,s),hitCanvas:(t,e)=>new j_(t,e),hitCanvasManager:()=>new T_}),Go.origin={createCanvas(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,i},canvasToDataURL:(t,e,i)=>{const s=Hc.mimeType(e),n=t.toDataURL(s,i);return"image/bmp"===s?n.replace("image/png;","image/bmp;"):n},canvasToBolb:(t,e,i)=>new Promise(s=>t.toBlob(s,Hc.mimeType(e),i)),canvasSaveAs:(t,e,i)=>{const s=t.toDataURL(Hc.mimeType(Hc.fileType(e)),i);return Go.origin.download(s,e)},download(t,e){return Y_(this,void 0,void 0,function*(){let i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)})},loadImage:(t,e,i)=>new Promise((i,s)=>{const n=new Go.origin.Image;e&&(n.setAttribute("crossOrigin",e),n.crossOrigin=e),n.onload=()=>{i(n)},n.onerror=t=>{s(t)},n.src=Go.image.getRealURL(t)}),loadContent(t){return Y_(this,arguments,void 0,function*(t,e="text"){const i=yield fetch(t);if(!i.ok)throw new Error(`${i.status}`);return yield i[e]()})},Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},Go.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},Go.canvas=na.canvas(),Go.conicGradientSupport=!!Go.canvas.context.createConicGradient;var{M:Ky,L:Zy,C:$y,Q:qy,Z:Jy,N:Qy,D:tw,X:ew,G:iw,F:sw,O:nw,P:rw,U:ow}=Ba,aw={scale(t,e,i){if(!t)return;let s,n=0,r=t.length;for(;n<r;)switch(s=t[n],s){case Ky:case Zy:hw(t,e,i,n,1),n+=3;break;case $y:hw(t,e,i,n,3),n+=7;break;case qy:hw(t,e,i,n,2),n+=5;break;case Jy:n+=1;break;case Qy:hw(t,e,i,n,2),n+=5;break;case tw:hw(t,e,i,n,2),n+=9;break;case ew:hw(t,e,i,n,2),n+=6;break;case iw:hw(t,e,i,n,2),n+=9;break;case sw:hw(t,e,i,n,2),n+=5;break;case nw:t[n]=iw,t.splice(n+4,0,t[n+3],0),hw(t,e,i,n,2),n+=9,r+=2;break;case rw:t[n]=sw,t.splice(n+4,0,t[n+3]),hw(t,e,i,n,2),n+=5,r+=1;break;case ow:hw(t,e,i,n,2),n+=6}},scalePoints(t,e,i,s,n){for(let r=n?s+1:0,o=n?r+2*n:t.length;r<o;r+=2)t[r]*=e,t[r+1]*=i}},{scalePoints:hw}=aw,lw=Ur.get(),{topLeft:cw,top:dw,topRight:uw,right:pw,bottom:gw,left:fw}=jr;function _w(t,e,i){t.pathInputed?vw(t,e,i):(1!==e&&(t.width*=e),1!==i&&(t.height*=i))}function mw(t,e,i,s){let n=e;if(!sr(s)){const r=t.__layout;let{width:o,height:a}=r.boxBounds;switch(o*=i-e,a*=e-i,s){case dw:case gw:n=i,r.affectScaleOrRotation?t.moveInner(-o/2,0):t.x-=o/2;break;case fw:case pw:r.affectScaleOrRotation?t.moveInner(0,-a/2):t.y-=a/2;break;case cw:case uw:r.affectScaleOrRotation?t.moveInner(0,-a):t.y-=a}}t.fontSize*=n;const r=t.__,{padding:o,lineHeight:a,letterSpacing:h}=r;o&&(t.padding=hr(o)?o.map(t=>t*n):o*n),r.__autoWidth||(t.width*=n),r.__autoHeight||(t.height*=n),lr(a)?"px"===a.type&&(r.lineHeight={type:"px",value:a.value*n}):a&&(r.lineHeight=a*n),lr(h)?"px"===h.type&&(r.letterSpacing={type:"px",value:h.value*n}):h&&(r.letterSpacing=h*n)}function vw(t,e,i){aw.scale(t.__.path,e,i),t.path=t.__.path}function yw(t,e,i){const{points:s}=t;lr(s[0])?s.forEach(t=>{t.x*=e,t.y*=i}):aw.scalePoints(s,e,i),t.points=s}function ww(t,e,i){const{children:s}=t;for(let n=0;n<s.length;n++)lw.a=e,lw.d=i,s[n].transform(lw,!0)}var xw=Xp.prototype;function bw(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o}function kw(t){return t?hr(t)?t:[t]:[]}xw.scaleResize=function(t,e=t,i){const s=this;i||s.editConfig&&"scale"===s.editConfig.editSize?(s.scaleX*=t,s.scaleY*=e):(t<0&&(s.scaleX*=-1,t=-t),e<0&&(s.scaleY*=-1,e=-e),this.__scaleResize(t,e))},xw.__scaleResize=function(t,e){_w(this,t,e)},xw.resizeWidth=function(t){const e=t/this.getBounds("box","local").width||1;this.scaleOf(this.__layout.boxBounds,e,this.__.lockRatio?e:1,!0)},xw.resizeHeight=function(t){const e=t/this.getBounds("box","local").height||1;this.scaleOf(this.__layout.boxBounds,this.__.lockRatio?e:1,e,!0)},Lf.prototype.__scaleResize=function(t,e){const{app:i,editConfig:s}=this,n=i&&i.editor,r=n&&n.dragPoint;if(this.__.resizeFontSize||s&&"font-size"===s.editSize||r&&"font-size"===n.mergedConfig.editSize)mw(this,t,e,r&&r.direction);else{const{__autoWidth:i,__autoHeight:s,textAlign:n,verticalAlign:r}=this.__,{boxBounds:o}=this.__layout;i&&"left"!==n&&1!==t&&(this.x+=o.x),s&&"top"!==r&&1!==e&&(this.y+=o.y),_w(this,t,e)}},Mf.prototype.__scaleResize=function(t,e){vw(this,t,e)},Sf.prototype.__scaleResize=function(t,e){this.pathInputed?vw(this,t,e):this.points?yw(this,t,e):this.width*=t},lf.prototype.__scaleResize=function(t,e){this.pathInputed?vw(this,t,e):this.points?yw(this,t,e):_w(this,t,e)},Ng.prototype.__scaleResize=function(t,e){ww(this,t,e)},Zg.prototype.__scaleResize=function(t,e){const{resizeChildren:i,__autoSize:s}=this.__;s&&i||_w(this,t,e),i&&ww(this,t,e)},sa.add("resize");var Sw=class extends vu{get list(){return kw(this.value)}get oldList(){return kw(this.oldValue)}constructor(t,e){super(t),e&&Object.assign(this,e)}};function Ew(t){return(e,i)=>{const s="_"+i;ed(e,i,{get(){return this[s]},set(e){const n=this[s];if(n!==e){const r=this;if(r.config){const t="target"===i;if(t){const{beforeSelect:t}=r.config;if(t){const i=t({target:e});if(lr(i))e=i;else if(!1===i)return}r.hasDimOthers&&r.cancelDimOthers(),hr(e)&&e.length>1&&e[0].locked&&e.splice(0,1),r.single&&(delete r.element.syncEventer,delete r.element.__world.ignorePixelSnap)}const s=t?Sw.BEFORE_SELECT:Sw.BEFORE_HOVER;this.hasEvent(s)&&this.emitEvent(new Sw(s,{editor:r,value:e,oldValue:n}))}this[s]=e,t(this,n)}}})}}Sw.BEFORE_SELECT="editor.before_select",Sw.SELECT="editor.select",Sw.AFTER_SELECT="editor.after_select",Sw.BEFORE_HOVER="editor.before_hover",Sw.HOVER="editor.hover";var{abs:Cw}=Math,{copy:Ow}=Ur,{setListWithFn:Tw}=Io,{worldBounds:Rw}=Jd,Bw={a:1,b:0,c:0,d:1,e:0,f:0},Pw={x:0,y:0,width:0,height:0},Lw=class extends Fg{constructor(){super(),this.list=[],this.visible=0,this.hittable=!1,this.strokeAlign="center"}setTarget(t,e){e&&this.set(e),this.target=t,this.update()}update(t){const{list:e}=this;e.length?(Tw(Pw,e,Rw),t&&this.set(t),this.set(Pw),this.visible=!0):this.visible=0}__draw(t,e){const{list:i}=this;if(i.length){let s;const n=this.__,{stroke:r,strokeWidth:o,fill:a}=n,{bounds:h}=e;for(let l=0;l<i.length;l++){s=i[l];const{worldTransform:c,worldRenderBounds:d}=s;if(d.width&&d.height&&(!h||h.hit(d,e.matrix))){const i=Cw(c.scaleX),h=Cw(c.scaleY);if(Ow(Bw,c),Bw.half=o%2,t.setWorld(Bw,e.matrix),t.beginPath(),"path"===this.strokePathType||s.__.__useArrow?s.__drawPath(t):s.__.__pathForRender?s.__drawRenderPath(t):s.__drawPathByBox(t),n.strokeWidth=o/Math.max(i,h),n.shadow){const e=n.shadow[0],{scaleX:i,scaleY:s}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*s,e.blur*i,ag.string(e.color))}r&&(rr(r)?cg.stroke(r,this,t,e):cg.strokes(r,this,t,e)),a&&(rr(a)?cg.fill(a,this,t,e):cg.fills(a,this,t,e)),n.shadow&&t.restore()}}n.strokeWidth=o}}destroy(){this.target=null,super.destroy()}};bw([Ew(function(t){const e=t.target;t.list=e?hr(e)?e:[e]:[]})],Lw.prototype,"target",void 0),bw([_d("render-path")],Lw.prototype,"strokePathType",void 0);var Mw=class extends Ng{constructor(t){super(t),this.strokeArea=new Yg({strokeAlign:"center"}),this.fillArea=new Yg,this.visible=0,this.hittable=!1,this.addMany(this.fillArea,this.strokeArea)}setStyle(t,e){const{visible:i,stroke:s,strokeWidth:n}=t;this.visible=i,this.strokeArea.reset(Object.assign({stroke:s,strokeWidth:n},e||{})),this.fillArea.reset({visible:!e,fill:s,opacity:.2})}setBounds(t){this.strokeArea.set(t),this.fillArea.set(t)}},Dw={findOne:t=>t.list.find(t=>t.editable),findByBounds(t,e){const i=[];return Aw([t],i,e),i}};function Aw(t,e,i){let s,n;for(let r=0,o=t.length;r<o;r++)if(s=t[r],n=s.__,n.hittable&&n.visible&&!n.locked&&i.hit(s.__world)){if(n.editable){if(s.isBranch&&!n.hitChildren){n.hitSelf&&e.push(s);continue}if(s.isFrame){if(i.includes(s.__layout.boxBounds,s.__world)){e.push(s);continue}}else i.hit(s.__layout.boxBounds,s.__world)&&n.hitSelf&&e.push(s)}s.isBranch&&Aw(s.children,e,i)}}var{findOne:Iw,findByBounds:Ww}=Dw,Fw=class extends Ng{get dragging(){return!!this.originList}get running(){const{editor:t,app:e}=this;return this.hittable&&t.visible&&t.hittable&&t.mergeConfig.selector&&e&&"normal"===e.mode}get isMoveMode(){const{app:t}=this;return t&&t.interaction.moveMode}constructor(t){super(),this.hoverStroker=new Lw,this.targetStroker=new Lw,this.bounds=new No,this.selectArea=new Mw,this.__eventIds=[],this.editor=t,this.addMany(this.targetStroker,this.hoverStroker,this.selectArea),this.__listenEvents()}onHover(){const{editor:t}=this;if(!this.running||this.dragging||t.dragging)this.hoverStroker.target=null;else{const{hoverTarget:e,mergeConfig:i}=t,s=Object.assign({},i);e&&e.editConfig&&Object.assign(s,e.editConfig);const{stroke:n,strokeWidth:r,hover:o,hoverStyle:a}=s;this.hoverStroker.setTarget(o?e:null,Object.assign({stroke:n,strokeWidth:r},a||{}))}}onSelect(){this.running&&(this.targetStroker.setTarget(this.editor.list),this.hoverStroker.target=null)}update(){this.hoverStroker.update();const{stroke:t,strokeWidth:e,selectedPathType:i,selectedStyle:s}=this.editor.mergedConfig;this.targetStroker.update(Object.assign({stroke:t,strokeWidth:e&&Math.max(1,e/2),strokePathType:i},s||{}))}onPointerMove(t){const{app:e,editor:i}=this;if(this.running&&!this.isMoveMode&&e.interaction.canHover&&!e.interaction.dragging){const e=this.findUI(t);i.hoverTarget=i.hasItem(e)?null:e}this.isMoveMode&&(i.hoverTarget=null)}onBeforeDown(t){if(t.multiTouch)return;const{select:e}=this.editor.mergeConfig;"press"===e&&(this.app.config.mobile?this.waitSelect=()=>this.checkAndSelect(t):this.checkAndSelect(t))}onTap(t){if(t.multiTouch)return;const{editor:e}=this,{select:i,selectKeep:s}=e.mergeConfig;"tap"===i?this.checkAndSelect(t):this.waitSelect&&this.waitSelect(),this.needRemoveItem?e.removeItem(this.needRemoveItem):this.isMoveMode&&(s||(e.target=null))}checkAndSelect(t){if(this.needRemoveItem=null,this.allowSelect(t)){const{editor:e}=this,i=this.findUI(t);i?(this.isMultipleSelect(t)?e.hasItem(i)?this.needRemoveItem=i:e.addItem(i):e.target=i,t.path.needUpdate=!0):this.allow(t.target)&&(this.isHoldMultipleSelectKey(t)||this.editor.mergedConfig.selectKeep||(e.target=null))}}onDragStart(t){if(!t.multiTouch&&(this.waitSelect&&this.waitSelect(),this.allowDrag(t))){const{editor:e}=this,{stroke:i,area:s}=e.mergeConfig,{x:n,y:r}=t.getInnerPoint(this);this.bounds.set(n,r),this.selectArea.setStyle({visible:!0,stroke:i,x:n,y:r},s),this.selectArea.setBounds(this.bounds.get()),this.originList=e.leafList.clone()}}onDrag(t){if(!t.multiTouch){if(this.editor.dragging)return this.onDragEnd(t);if(this.dragging){const{editor:e}=this,i=t.getInnerTotal(this),s=this.bounds.clone().unsign(),n=new eg(Ww(e.app,s));if(this.bounds.width=i.x,this.bounds.height=i.y,this.selectArea.setBounds(s.get()),n.length){const t=[];this.originList.forEach(e=>{n.has(e)||t.push(e)}),n.forEach(e=>{this.originList.has(e)||t.push(e)}),(t.length!==e.list.length||e.list.some((e,i)=>e!==t[i]))&&(e.target=t)}else e.target=this.originList.list}}}onDragEnd(t){t.multiTouch||this.dragging&&(this.originList=null,this.selectArea.visible=0)}onAutoMove(t){if(this.dragging){const{x:e,y:i}=t.getLocalMove(this);this.bounds.x+=e,this.bounds.y+=i}}allow(t){return t.leafer!==this.editor.leafer}allowDrag(t){const{boxSelect:e,multipleSelect:i}=this.editor.mergeConfig;return!(!(this.running&&i&&e)||t.target.draggable)&&(!this.editor.editing&&this.allow(t.target)||this.isHoldMultipleSelectKey(t)&&!Iw(t.path))}allowSelect(t){return this.running&&!this.isMoveMode&&!t.middle}findDeepOne(t){const e={exclude:new eg(this.editor.editBox.rect)};return Iw(t.target.leafer.interaction.findPath(t,e))}findUI(t){return this.isMultipleSelect(t)?this.findDeepOne(t):Iw(t.path)}isMultipleSelect(t){const{multipleSelect:e,continuousSelect:i}=this.editor.mergeConfig;return e&&(this.isHoldMultipleSelectKey(t)||i)}isHoldMultipleSelectKey(t){const{multipleSelectKey:e}=this.editor.mergedConfig;return e?t.isHoldKeys(e):t.shiftKey}__listenEvents(){const{editor:t}=this;t.waitLeafer(()=>{const{app:e}=t;e.selector.proxy=t,this.__eventIds=[t.on_([[Sw.HOVER,this.onHover,this],[Sw.SELECT,this.onSelect,this]]),e.on_([[t_.MOVE,this.onPointerMove,this],[t_.BEFORE_DOWN,this.onBeforeDown,this],[t_.TAP,this.onTap,this],[i_.START,this.onDragStart,this,!0],[i_.DRAG,this.onDrag,this],[i_.END,this.onDragEnd,this],[n_.MOVE,this.onAutoMove,this],[[h_.ZOOM,n_.MOVE],()=>{this.editor.hoverTarget=null}]])]})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=this.originList=this.needRemoveItem=null,this.__removeListenEvents(),super.destroy()}},{topLeft:zw,top:Nw,topRight:Vw,right:Hw,bottomRight:Yw,bottom:Xw,bottomLeft:jw,left:Uw}=jr,{toPoint:Gw}=_o,{within:Kw,sign:Zw}=Pr,{abs:$w}=Math,qw={getScaleData(t,e,i,s,n,r,o,a){let h,l,c={},d=1,u=1;const{boxBounds:p,widthRange:g,heightRange:f,dragBounds:_,worldBoxBounds:m}=t,{width:v,height:y}=e,w=t.scaleX/e.scaleX,x=t.scaleY/e.scaleY,b=Zw(w),k=Zw(x),S=a?w:b*p.width/v,E=a?x:k*p.height/y;if(ar(s))d=u=Math.sqrt(s);else{r&&(s.x*=2,s.y*=2),s.x*=a?w:b,s.y*=a?x:k;const t=(-s.y+y)/y,e=(s.x+v)/v,o=(s.y+y)/y,c=(-s.x+v)/v;switch(i){case Nw:u=t,h="bottom";break;case Hw:d=e,h="left";break;case Xw:u=o,h="top";break;case Uw:d=c,h="right";break;case zw:u=t,d=c,h="bottom-right";break;case Vw:u=t,d=e,h="bottom-left";break;case Yw:u=o,d=e,h="top-left";break;case jw:u=o,d=c,h="top-right"}if(n)if("corner"===n&&i%2)n=!1;else switch(i){case Nw:case Xw:d=u;break;case Uw:case Hw:u=d;break;default:l=Math.sqrt($w(d*u)),d=Zw(d)*l,u=Zw(u)*l}}const C=1!==d,O=1!==u;if(C&&(d/=S),O&&(u/=E),!o){const{worldTransform:e}=t;d<0&&(d=1/p.width/e.scaleX),u<0&&(u=1/p.height/e.scaleY)}if(Gw(r||h,p,c,!0),_){const e={x:d,y:u};Jf.limitScaleOf(t,c,e,n),d=e.x,u=e.y}if(C&&g){const e=p.width*t.scaleX;d=Kw(e*d,g)/e}if(O&&f){const e=p.height*t.scaleY;u=Kw(e*u,f)/e}return C&&$w(d*m.width)<1&&(d=Zw(d)/m.width),O&&$w(u*m.height)<1&&(u=Zw(u)/m.height),n&&d!==u&&(l=Math.min($w(d),$w(u)),d=Zw(d)*l,u=Zw(u)*l),isFinite(d)||(d=1),isFinite(u)||(u=1),{origin:c,scaleX:d,scaleY:u,direction:i,lockRatio:n,around:r}},getRotateData(t,e,i,s,n){let r,o={};switch(e){case zw:r="bottom-right";break;case Vw:r="bottom-left";break;case Yw:r="top-left";break;case jw:r="top-right";break;default:r="center"}return Gw(n||r,t.boxBounds,o,!0),{origin:o,rotation:no.getRotation(s,t.getWorldPointByBox(o),i)}},getSkewData(t,e,i,s){let n,r,o={},a=0,h=0;switch(e){case Nw:case zw:r={x:.5,y:0},n="bottom",a=1;break;case Xw:case Yw:r={x:.5,y:1},n="top",a=1;break;case Uw:case jw:r={x:0,y:.5},n="right",h=1;break;case Hw:case Vw:r={x:1,y:.5},n="left",h=1}const{width:l,height:c}=t;r.x=r.x*l,r.y=r.y*c,Gw(s||n,t,o,!0);const d=no.getRotation(r,o,{x:r.x+(a?i.x:0),y:r.y+(h?i.y:0)});return a?a=-d:h=d,{origin:o,skewX:a,skewY:h}},getAround:(t,e)=>e&&!t?"center":t,getRotateDirection:(t,e,i=8)=>((t=(t+Math.round(e/(360/i)))%i)<0&&(t+=i),t),getFlipDirection(t,e,i){if(e)switch(t){case Uw:t=Hw;break;case zw:t=Vw;break;case jw:t=Yw;break;case Hw:t=Uw;break;case Vw:t=zw;break;case Yw:t=jw}if(i)switch(t){case Nw:t=Xw;break;case zw:t=jw;break;case Vw:t=Yw;break;case Xw:t=Nw;break;case jw:t=zw;break;case Yw:t=Vw}return t}},Jw={};function Qw(t,e){const{enterPoint:i,dragging:s,skewing:n,resizing:r,flippedX:o,flippedY:a}=t;if(!i||!t.editor.editing||!t.canUse)return;if("rect"===i.name)return tx(t);if("circle"===i.name)return;let{rotation:h}=t;const{pointType:l}=i,{moveCursor:c,resizeCursor:d,rotateCursor:u,skewCursor:p,moveable:g,resizeable:f,rotateable:_,skewable:m}=t.mergeConfig;if("move"===l)return i.cursor=c,void(g||(i.visible=!1));if("button"===l)return void(i.cursor||(i.cursor="pointer"));let v=l.includes("resize");v&&_&&(t.isHoldRotateKey(e)||!f)&&(v=!1);const y=m&&!v&&("resize-line"===i.name||"skew"===l),w=s?n?p:r?d:u:y?p:v?d:u;h+=45*(qw.getFlipDirection(i.direction,o,a)+1),h=2*Math.round(Pr.formatRotation(h,!0)/2);const{url:x,x:b,y:k}=w,S=x+h;Jw[S]?i.cursor=Jw[S]:Jw[S]=i.cursor={url:ex(x,h),x:b,y:k}}function tx(t){const{moveCursor:e,moveable:i}=t.mergeConfig;t.canUse&&(t.rect.cursor=i?e:void 0)}function ex(t,e){return'"data:image/svg+xml,'+encodeURIComponent(t.replace("{{rotation}}",e.toString()))+'"'}var ix=class extends Zg{constructor(t){super(t),this.useFastShadow=!0}},sx=["top","right","bottom","left"],nx=void 0,rx=class extends Ng{get mergeConfig(){const{config:t}=this,{mergeConfig:e,editBox:i}=this.editor;return this.mergedConfig=t&&i!==this?Object.assign(Object.assign({},e),t):e}get target(){return this._target||this.editor.element}set target(t){this._target=t}get single(){return!!this._target||this.editor.single}get transformTool(){return this._transformTool||this.editor}set transformTool(t){this._transformTool=t}get flipped(){return this.flippedX||this.flippedY}get flippedX(){return this.scaleX<0}get flippedY(){return this.scaleY<0}get flippedOne(){return this.scaleX*this.scaleY<0}get canUse(){return this.app&&this.editor.editing}get canGesture(){if(!this.canUse)return!1;const{moveable:t,resizeable:e,rotateable:i}=this.mergeConfig;return rr(t)||rr(e)||rr(i)}get canDragLimitAnimate(){return this.moving&&this.mergeConfig.dragLimitAnimate&&this.target.dragBounds}constructor(t){super(),this.view=new Ng,this.rect=new ix({name:"rect",hitFill:"all",hitStroke:"none",strokeAlign:"center",hitRadius:5}),this.circle=new ix({name:"circle",strokeAlign:"center",around:"center",cursor:"crosshair",hitRadius:5}),this.buttons=new Ng({around:"center",hitSelf:!1,visible:0}),this.resizePoints=[],this.rotatePoints=[],this.resizeLines=[],this.dragStartData={},this.__eventIds=[],this.editor=t,this.visible=!1,this.create(),this.__listenEvents()}create(){let t,e,i;const{view:s,resizePoints:n,rotatePoints:r,resizeLines:o,rect:a,circle:h,buttons:l}=this,c=["bottom-right","bottom","bottom-left","left","top-left","top","top-right","right"];for(let d=0;d<8;d++)t=new ix({name:"rotate-point",around:c[d],width:15,height:15,hitFill:"all"}),r.push(t),this.listenPointEvents(t,"rotate",d),d%2&&(e=new ix({name:"resize-line",around:"center",width:10,height:10,hitFill:"all"}),o.push(e),this.listenPointEvents(e,"resize",d)),i=new ix({name:"resize-point",hitRadius:5}),n.push(i),this.listenPointEvents(i,"resize",d);this.listenPointEvents(h,"rotate",2),this.listenPointEvents(a,"move",8),s.addMany(...r,a,h,l,...o,...n),this.add(s)}load(){const{target:t,mergeConfig:e,single:i,rect:s,circle:n,resizePoints:r,resizeLines:o}=this,{stroke:a,strokeWidth:h,ignorePixelSnap:l}=e,c=this.getPointsStyle(),d=this.getMiddlePointsStyle(),u=this.getResizeLinesStyle();let p;this.visible=!t.locked;for(let f=0;f<8;f++)p=r[f],p.set(this.getPointStyle(f%2?d[(f-1)/2%d.length]:c[f/2%c.length])),p.rotation=(f-(f%2?1:0))/2*90,f%2&&o[(f-1)/2].set(Object.assign({pointType:"resize",rotation:(f-1)/2*90},u[(f-1)/2%u.length]||{}));n.set(this.getPointStyle(e.circle||e.rotatePoint||c[0])),s.set(Object.assign({stroke:a,strokeWidth:h,opacity:1,editConfig:nx},e.rect||{}));const g=nr(e.rectThrough)?i:e.rectThrough;s.hittable=!g,g&&(t.syncEventer=s,this.app.interaction.bottomList=[{target:s,proxy:t}]),i&&pr.stintSet(t.__world,"ignorePixelSnap",l),tx(this)}update(){const{editor:t}=this,{x:e,y:i,scaleX:s,scaleY:n,rotation:r,skewX:o,skewY:a,width:h,height:l}=this.target.getLayoutBounds("box",t,!0);this.visible=!this.target.locked,this.set({x:e,y:i,scaleX:s,scaleY:n,rotation:r,skewX:o,skewY:a}),this.updateBounds({x:0,y:0,width:h,height:l})}unload(){this.visible=!1,this.app&&(this.rect.syncEventer=this.app.interaction.bottomList=null)}updateBounds(t){const{editor:e,mergeConfig:i,single:s,rect:n,circle:r,buttons:o,resizePoints:a,rotatePoints:h,resizeLines:l}=this,{editMask:c}=e,{middlePoint:d,resizeable:u,rotateable:p,hideOnSmall:g,editBox:f,mask:_,dimOthers:m,bright:v,spread:y,hideRotatePoints:w,hideResizeLines:x}=i;if(c.visible=!!_||0,sr(m)&&sr(v)?e.hasDimOthers&&e.cancelDimOthers():(e.setDimOthers(m),e.setBright(!!m||v),e.hasDimOthers=!0),y&&Io.spread(t,y),this.view.worldOpacity){const{width:e,height:c}=t,_=ar(g)?g:10,m=f&&!(g&&e<_&&c<_);let v,y,b,k={};for(let i=0;i<8;i++)_o.toPoint(_o.directionData[i],t,k),y=a[i],v=h[i],y.set(k),v.set(k),y.visible=m&&!(!u&&!p),v.visible=m&&p&&u&&!w,i%2&&(b=l[(i-1)/2],b.set(k),b.visible=y.visible&&!x,y.visible&&(y.visible=!!d),v.visible&&(v.visible=!!d),(i+1)/2%2?(b.width=e+b.height,g&&2*y.width>e&&(y.visible=!1)):(b.width=c+b.height,g&&2*y.width>c&&(y.visible=!1)));r.visible=m&&p&&!(!i.circle&&!i.rotatePoint),r.visible&&this.layoutCircle(),n.path&&(n.path=null),n.set(Object.assign(Object.assign({},t),{visible:!s||f})),o.visible=m&&o.children.length>0||0,o.visible&&this.layoutButtons()}else n.set(t)}layoutCircle(){const{circleDirection:t,circleMargin:e,buttonsMargin:i,buttonsDirection:s,middlePoint:n}=this.mergedConfig,r=sx.indexOf(t||(this.buttons.children.length&&"bottom"===s?"top":"bottom"));this.setButtonPosition(this.circle,r,e||i,!!n)}layoutButtons(){const{buttons:t}=this,{buttonsDirection:e,buttonsFixed:i,buttonsMargin:s,middlePoint:n}=this.mergedConfig,{flippedX:r,flippedY:o}=this;let a=sx.indexOf(e);(a%2&&r||(a+1)%2&&o)&&i&&(a=(a+2)%4);const h=i?qw.getRotateDirection(a,this.flippedOne?this.rotation:-this.rotation,4):a;this.setButtonPosition(t,h,s,!!n),i&&(t.rotation=90*(h-a)),t.scaleX=r?-1:1,t.scaleY=o?-1:1}setButtonPosition(t,e,i,s){const n=this.resizePoints[2*e+1],r=e%2,o=e&&3!==e?1:-1,a=(i+(e%2?(s?n.width:0)+t.boxBounds.width:(s?n.height:0)+t.boxBounds.height)/2)*o;r?(t.x=n.x+a,t.y=n.y):(t.x=n.x,t.y=n.y+a)}getPointStyle(t){const{stroke:e,strokeWidth:i,pointFill:s,pointSize:n,pointRadius:r}=this.mergedConfig,o={fill:s,stroke:e,strokeWidth:i,around:"center",strokeAlign:"center",opacity:1,width:n,height:n,cornerRadius:r,offsetX:0,offsetY:0,editConfig:nx};return t?Object.assign(o,t):o}getPointsStyle(){const{point:t}=this.mergedConfig;return hr(t)?t:[t]}getMiddlePointsStyle(){const{middlePoint:t}=this.mergedConfig;return hr(t)?t:t?[t]:this.getPointsStyle()}getResizeLinesStyle(){const{resizeLine:t}=this.mergedConfig;return hr(t)?t:[t]}onDragStart(t){this.dragging=!0;const e=this.dragPoint=t.current,{pointType:i}=e,{moveable:s,resizeable:n,rotateable:r,skewable:o,onCopy:a}=this.mergeConfig;"move"===i?(t.altKey&&a&&a()&&this.editor.single&&this.app.interaction.replaceDownTarget(this.target),s&&(this.moving=!0)):(i.includes("rotate")||this.isHoldRotateKey(t)||!n?(r&&(this.rotating=!0),"resize-rotate"===i?n&&(this.resizing=!0):"resize-line"===e.name&&(o&&(this.skewing=!0),this.rotating=!1)):"resize"===i&&n&&(this.resizing=!0),"skew"===i&&o&&(this.skewing=!0)),this.onTransformStart(t)}onDrag(t){const{transformTool:e,moving:i,resizing:s,rotating:n,skewing:r}=this;if(i)e.onMove(t);else if(s||n||r){const i=t.current;i.pointType&&(this.enterPoint=i),n&&e.onRotate(t),s&&e.onScale(t),r&&e.onSkew(t)}Qw(this,t)}onDragEnd(t){this.onTransformEnd(t),this.dragPoint=null}onTransformStart(t){(this.moving||this.gesturing)&&(this.editor.opacity=this.mergedConfig.hideOnMove?0:1),this.resizing&&(Bu.resizingKeys=this.editor.leafList.keys);const{dragStartData:e,target:i}=this;e.x=t.x,e.y=t.y,e.totalOffset={x:0,y:0},e.point={x:i.x,y:i.y},e.bounds=Object.assign({},i.getLayoutBounds("box","local")),e.rotation=i.rotation}onTransformEnd(t){this.canDragLimitAnimate&&(t instanceof i_||t instanceof n_)&&this.transformTool.onMove(t),this.resizing&&(Bu.resizingKeys=null),this.dragging=this.gesturing=this.moving=this.resizing=this.rotating=this.skewing=!1,this.editor.opacity=1,this.editor.update()}onMove(t){if(this.canGesture&&"drag"!==t.moveType&&(t.stop(),rr(this.mergedConfig.moveable)))switch(this.gesturing=this.moving=!0,t.type){case n_.START:this.onTransformStart(t);break;case n_.END:this.onTransformEnd(t);break;default:this.transformTool.onMove(t)}}onScale(t){if(this.canGesture&&(t.stop(),rr(this.mergedConfig.resizeable)))switch(this.gesturing=this.resizing=!0,t.type){case h_.START:this.onTransformStart(t);break;case h_.END:this.onTransformEnd(t);break;default:this.transformTool.onScale(t)}}onRotate(t){if(this.canGesture&&(t.stop(),rr(this.mergedConfig.rotateable)))switch(this.gesturing=this.rotating=!0,t.type){case h_.START:this.onTransformStart(t);break;case h_.END:this.onTransformEnd(t);break;default:this.transformTool.onRotate(t)}}isHoldRotateKey(t){const{rotateKey:e}=this.mergedConfig;return e?t.isHoldKeys(e):t.metaKey||t.ctrlKey}onKey(t){Qw(this,t)}onArrow(t){if(this.canUse){let e=0,i=0;switch(t.code){case"ArrowDown":i=1;break;case"ArrowUp":i=-1;break;case"ArrowLeft":e=-1;break;case"ArrowRight":e=1}if(e||i){const{keyEvent:s,arrowStep:n,arrowFastStep:r}=this.mergeConfig;if(s){const s=t.shiftKey?r:n;this.transformTool.move(e*s,i*s)}}}}onDoubleTap(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"double"!==e||i||this.openInner(t)}onLongPress(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"long"===e&&i&&this.openInner(t)}openInner(t){const{editor:e,target:i}=this;if(this.single){if(i.locked)return;if(i.isBranch&&!i.editInner){if(i.textBox){const{children:t}=i,s=t.find(t=>t.editable&&t instanceof Lf)||t.find(t=>t instanceof Lf);if(s)return e.openInnerEditor(s)}e.openGroup(i),e.target=e.selector.findDeepOne(t)}else e.openInnerEditor()}}listenPointEvents(t,e,i){t.direction=i,t.pointType=e,this.__eventIds.push(t.on_([[i_.START,this.onDragStart,this],[i_.DRAG,this.onDrag,this],[i_.END,this.onDragEnd,this],[t_.ENTER,e=>{this.enterPoint=t,Qw(this,e)}],[t_.LEAVE,()=>{this.enterPoint=null}]]))}__listenEvents(){const{rect:t,editor:e,__eventIds:i}=this;i.push(t.on_([[t_.DOUBLE_TAP,this.onDoubleTap,this],[t_.LONG_PRESS,this.onLongPress,this]])),this.waitLeafer(()=>{i.push(e.app.on_([[[l_.HOLD,l_.UP],this.onKey,this],[l_.DOWN,this.onArrow,this],[[n_.START,n_.BEFORE_MOVE,n_.END],this.onMove,this,!0],[[h_.START,h_.BEFORE_ZOOM,h_.END],this.onScale,this,!0],[[o_.START,o_.BEFORE_ROTATE,o_.END],this.onRotate,this,!0]]))})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=null,this.__removeListenEvents(),super.destroy()}},ox={x:0,y:0,width:1e5,height:1e5},ax=class extends Fg{constructor(t){super(),this.editor=t,this.hittable=!1,this.visible=0}__updateWorldBounds(){Object.assign(this.__local,ox),Object.assign(this.__world,ox)}__draw(t,e){const{editor:i}=this,{mask:s}=i.mergedConfig;if(s&&i.editing){if(t.fillWorld(t.bounds,!0===s?"rgba(0,0,0,0.8)":s),e.bounds&&!e.bounds.hit(i.editBox.rect.__world,e.matrix))return;t.saveBlendMode("destination-out"),e=Object.assign(Object.assign({},e),{shape:!0}),i.list.forEach(i=>{i.__render(t,e);const{parent:s}=i;s&&s.textBox&&s.__renderShape(t,e)}),t.restoreBlendMode()}}destroy(){this.editor=null,super.destroy()}},hx='\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1.5"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>\n<feBlend mode="normal" in="SourceGraphic" result="shape"/>',lx={editSize:"size",keyEvent:!0,stroke:"#836DFF",strokeWidth:2,pointFill:"#FFFFFF",pointSize:10,pointRadius:16,rotateGap:45,arrowStep:1,arrowFastStep:10,buttonsDirection:"bottom",buttonsMargin:12,hideOnSmall:!0,moveCursor:"move",resizeCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate({{rotation}},12,12)">\n<path d="M7.5 8.0H8.5V5.9L6.8 7.2L7.5 8.0ZM3 11.4L2.3 10.6L1.3 11.4L2.3 12.2L3 11.4ZM7.5 10.4H6.5V11.4H7.5V10.4ZM16.5 10.4V11.4H17.5V10.4H16.5ZM16.5 8.0L17.1 7.2L15.5 5.9V8.0H16.5ZM21 11.4L21.6 12.2L22.6 11.4L21.6 10.6L21 11.4ZM16.5 14.9H15.5V16.9L17.1 15.7L16.5 14.9ZM16.5 12.4H17.5V11.4H16.5V12.4ZM7.5 12.4V11.4H6.5V12.4H7.5ZM7.5 14.9L6.8 15.7L8.5 16.9V14.9H7.5ZM6.8 7.2L2.3 10.6L3.6 12.2L8.1 8.7L6.8 7.2ZM8.5 10.4V8.0H6.5V10.4H8.5ZM16.5 9.4H7.5V11.4H16.5V9.4ZM17.5 10.4V8.0H15.5V10.4H17.5ZM15.8 8.7L20.3 12.2L21.6 10.6L17.1 7.2L15.8 8.7ZM20.3 10.6L15.8 14.1L17.1 15.7L21.6 12.2L20.3 10.6ZM17.5 14.9V12.4H15.5V14.9H17.5ZM7.5 13.4H16.5V11.4H7.5V13.4ZM8.5 14.9V12.4H6.5V14.9H8.5ZM2.3 12.2L6.8 15.7L8.1 14.1L3.6 10.6L2.3 12.2Z" fill="white"/>\n<path fill-rule="evenodd" d="M3 11.4L7.5 8.0V10.4H16.5V8.0L21 11.4L16.5 14.9V12.4H7.5V14.9L3 11.4Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="3.9" width="27.2" height="16.9" filterUnits="userSpaceOnUse">\n${hx}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},rotateCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(135,12,12),rotate({{rotation}},12,12)">\n<path d="M20.4 8H21.4L20.8 7.1L17.3 2.6L17 2.1L16.6 2.6L13.1 7.1L12.5 8H13.5H15.4C14.9 11.8 11.8 14.9 8 15.4V13.5V12.5L7.1 13.1L2.6 16.6L2.1 17L2.6 17.3L7.1 20.8L8 21.4V20.4V18.4C13.5 17.9 17.9 13.5 18.4 8H20.4Z" stroke="white"/>\n<path fill-rule="evenodd" d="M17 3L20.4 7.5H17.9C17.7 13.1 13.1 17.7 7.5 17.9V20.4L3 17L7.5 13.5V15.9C12.0 15.7 15.7 12.0 15.9 7.5H13.5L17 3Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="-0.6" width="27.1" height="27.1" filterUnits="userSpaceOnUse">\n${hx}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},skewCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(90,12,12),rotate({{rotation}},12,12)">\n<path d="M21 10.4L21 11.4L23.8 11.4L21.6 9.6L21 10.4ZM17 10.4V11.4L17 11.4L17 10.4ZM15.5 6L16.1 5.2L14.5 3.9V6H15.5ZM15.5 8.4V9.4H16.5V8.4H15.5ZM6 8.4V7.4H5V8.4H6ZM6 10.4H5V11.4H6V10.4ZM7 14.4V13.4L7 13.4L7 14.4ZM3 14.4L3 13.4L0.1 13.4L2.3 15.2L3 14.4ZM8.5 18.9L7.8 19.7L9.5 21.0V18.9H8.5ZM8.5 16.4V15.4H7.5V16.4H8.5ZM19 16.4V17.4H20V16.4H19ZM19 14.4H20V13.4H19V14.4ZM21 9.4L17 9.4L17 11.4L21 11.4L21 9.4ZM14.8 6.7L20.3 11.2L21.6 9.6L16.1 5.2L14.8 6.7ZM16.5 8.4V6H14.5V8.4H16.5ZM6 9.4H15.5V7.4H6V9.4ZM7 10.4V8.4H5V10.4H7ZM15.5 9.4H6V11.4H15.5V9.4ZM17 9.4H15.5V11.4H17V9.4ZM7 15.4H8.5V13.4H7V15.4ZM3 15.4L7 15.4L7 13.4L3 13.4L3 15.4ZM9.1 18.1L3.6 13.6L2.3 15.2L7.8 19.7L9.1 18.1ZM7.5 16.4V18.9H9.5V16.4H7.5ZM19 15.4H8.5V17.4H19V15.4ZM18 14.4V16.4H20V14.4H18ZM8.5 15.4H19V13.4H8.5V15.4Z" fill="white"/>\n<path fill-rule="evenodd" d="M17 10.4L21 10.4L15.5 6V8.4H6V10.4H15.5H17ZM8.5 14.4H7L3 14.4L8.5 18.9V16.4H19V14.4H8.5Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter x="-2.8" y="1.9" width="29.6" height="23.1" filterUnits="userSpaceOnUse" >\n${hx}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},selector:!0,editBox:!0,hover:!0,select:"press",openInner:"double",multipleSelect:!0,boxSelect:!0,moveable:!0,resizeable:!0,flipable:!0,rotateable:!0,skewable:!0},cx=new No;function dx(t){const{simulateTarget:e,list:i}=t,{zoomLayer:s}=i[0].leafer;e.safeChange(()=>{cx.setListWithFn(i,t=>t.getBounds("box","page")),0===cx.width&&(cx.width=.1),0===cx.height&&(cx.height=.1),e.reset(cx.get())}),s.add(e)}var ux=(t,e)=>t.parent.children.indexOf(t)-e.parent.children.indexOf(e),px=(t,e)=>e.parent.children.indexOf(e)-t.parent.children.indexOf(t),gx={group(t,e,i){t.sort(px);const{app:s,parent:n}=t[0];let r;r=i&&i.add?i:new Ng(i),n.addAt(r,n.children.indexOf(t[0])),t.sort(ux);const o=new uo(e.worldTransform);return o.divideParent(n.scrollWorldTransform),r.setTransform(o),r.editable=!0,r.hitChildren=!1,s.lockLayout(),t.forEach(t=>t.dropTo(r)),s.unlockLayout(),r},ungroup(t){const{app:e}=t[0],i=[];return e.lockLayout(),t.forEach(t=>{if(t.isBranch){const{parent:e,children:s}=t;for(;s.length;)i.push(s[0]),s[0].dropTo(e,e.children.indexOf(t));t.isBranchLeaf?i.push(t):t.remove()}else i.push(t)}),e.unlockLayout(),i},toTop(t){t.sort(ux),t.forEach(t=>{t.parent&&t.parent.add(t)})},toBottom(t){t.sort(px),t.forEach(t=>{t.parent&&t.parent.addAt(t,0)})}},fx=$o.get("EditToolCreator");function _x(){return t=>{mx.register(t)}}var mx={list:{},register(t){const{tag:e}=t.prototype;vx[e]&&fx.repeat(e),vx[e]=t},get:(t,e)=>new vx[t](e)},{list:vx}=mx,yx=class extends Sw{constructor(t,e){super(t,e)}};yx.BEFORE_OPEN="innerEditor.before_open",yx.OPEN="innerEditor.open",yx.BEFORE_CLOSE="innerEditor.before_close",yx.CLOSE="innerEditor.close";var wx=class extends Sw{constructor(t,e){super(t,e)}};wx.BEFORE_GROUP="editor.before_group",wx.GROUP="editor.group",wx.BEFORE_UNGROUP="editor.before_ungroup",wx.UNGROUP="editor.ungroup",wx.BEFORE_OPEN="editor.before_open_group",wx.OPEN="editor.open_group",wx.BEFORE_CLOSE="editor.before_close_group",wx.CLOSE="editor.close_group";var{updateMatrix:xx}=Yd,bx={x:1,y:1,scaleX:1,scaleY:1,rotation:1,skewX:1,skewY:1},kx="top-left",Sx=class extends Yg{get __tag(){return"SimulateElement"}constructor(t){super(),this.checkChange=!0,this.canChange=!0,this.visible=this.hittable=!1,this.skipJSON=!0,this.on(xu.CHANGE,e=>{if(this.checkChange&&bx[e.attrName]){const{attrName:i,newValue:s,oldValue:n}=e,r="s"===i[0]?(s||1)/(n||1):(s||0)-(n||0);this.canChange=!1;const o=this.__;o[i]=n,xx(this.parent),xx(this);const a=new uo(this.__world);switch(o[i]=s,this.__layout.rotationChange(),xx(this),this.changedTransform=new uo(this.__world).divide(a),i){case"x":t.move(r,0);break;case"y":t.move(0,r);break;case"rotation":t.rotateOf(kx,r);break;case"scaleX":t.scaleOf(kx,r,1);break;case"scaleY":t.scaleOf(kx,1,r);break;case"skewX":t.skewOf(kx,r,0);break;case"skewY":t.skewOf(kx,0,r)}this.canChange=!0}})}safeChange(t){this.canChange&&(this.checkChange=!1,t(),this.checkChange=!0)}},Ex=class extends Sw{constructor(t,e){super(t,e)}};Ex.BEFORE_MOVE="editor.before_move",Ex.MOVE="editor.move";var Cx=class extends Sw{constructor(t,e){super(t,e)}};Cx.BEFORE_SCALE="editor.before_scale",Cx.SCALE="editor.scale";var Ox=class extends Sw{constructor(t,e){super(t,e)}};Ox.BEFORE_ROTATE="editor.before_rotate",Ox.ROTATE="editor.rotate";var Tx=class extends Sw{constructor(t,e){super(t,e)}};Tx.BEFORE_SKEW="editor.before_skew",Tx.SKEW="editor.skew";var Rx=class extends Ng{get list(){return this.leafList.list}get dragHoverExclude(){return[this.editBox.rect]}get editing(){return!!this.list.length}get groupOpening(){return!!this.openedGroupList.length}get multiple(){return this.list.length>1}get single(){return 1===this.list.length}get dragPoint(){return this.editBox.dragPoint}get dragging(){return this.editBox.dragging}get gesturing(){return this.editBox.gesturing}get moving(){return this.editBox.moving}get resizing(){return this.editBox.resizing}get rotating(){return this.editBox.rotating}get skewing(){return this.editBox.skewing}get element(){return this.multiple?this.simulateTarget:this.list[0]}get buttons(){return this.editBox.buttons}get targetLeafer(){const t=this.list[0];return t&&t.leafer}constructor(t,e){super(e),this.leafList=new eg,this.openedGroupList=new eg,this.simulateTarget=new Sx(this),this.editBox=new rx(this),this.editToolList={},this.selector=new Fw(this),this.editMask=new ax(this),this.targetEventIds=[];let i=pr.clone(lx);t&&(i=pr.default(t,i)),this.mergedConfig=this.config=i,this.addMany(this.editMask,this.selector,this.editBox),sa.has("resize")||(this.config.editSize="scale")}select(t){this.target=t}cancel(){this.target=null}hasItem(t){return this.leafList.has(t)}getItem(t){return this.list[t||0]}addItem(t){this.hasItem(t)||t.locked||(this.leafList.add(t),this.target=this.leafList.list)}removeItem(t){this.hasItem(t)&&(this.leafList.remove(t),this.target=this.leafList.list)}shiftItem(t){this.hasItem(t)?this.removeItem(t):this.addItem(t)}setDimOthers(t,e="dim",i){if(!i){const{dimTarget:t,targetLeafer:e}=this;i=t?hr(t)?t:[t]:[e]}i[0]&&i[0][e]!==(t||!1)&&i.forEach(i=>pr.stintSet(i,e,t))}setBright(t){this.setDimOthers(t,"bright",this.list)}cancelDimOthers(){this.setDimOthers(!1),this.setBright(!1),this.hasDimOthers=void 0}update(){if(this.editing){if(!this.element.parent)return this.cancel();this.innerEditing&&this.innerEditor.update(),this.editTool.update(),this.selector.update()}}updateEditBox(){this.multiple&&dx(this),this.update()}getEditTool(t){return this.editToolList[t]=this.editToolList[t]||mx.get(t,this)}updateEditTool(){if(this.unloadEditTool(),this.editing){const t=this.element;let e=t.editOuter||"EditTool";const{beforeEditOuter:i}=this.mergeConfig;if(i){const s=i({target:t,name:e});if(rr(s))e=s;else if(!1===s)return}if(mx.list[e]){const t=this.editTool=this.getEditTool(e);this.editBox.load(),t.load(),this.update()}}}unloadEditTool(){let t=this.editTool;t&&(this.editBox.unload(),t.unload(),this.editTool=null)}getEditSize(t){return this.mergeConfig.editSize}onMove(t){}onScale(t){}onRotate(t){}onSkew(t){}move(t,e=0){}scaleWithDrag(t){}scaleOf(t,e,i=e,s){}flip(t){}rotateOf(t,e){}skewOf(t,e,i=0,s){}checkTransform(t){}getWorldOrigin(t){}getChangedTransform(t){}group(t){return this.multiple&&(this.emitGroupEvent(wx.BEFORE_GROUP),this.target=gx.group(this.list,this.element,t),this.emitGroupEvent(wx.GROUP,this.target)),this.target}ungroup(){const{list:t}=this;return t.length&&(t.forEach(t=>t.isBranch&&this.emitGroupEvent(wx.BEFORE_UNGROUP,t)),this.target=gx.ungroup(t),t.forEach(t=>t.isBranch&&this.emitGroupEvent(wx.UNGROUP,t))),this.list}openGroup(t){this.emitGroupEvent(wx.BEFORE_OPEN,t),this.openedGroupList.add(t),t.hitChildren=!0,this.emitGroupEvent(wx.OPEN,t)}closeGroup(t){this.emitGroupEvent(wx.BEFORE_CLOSE,t),this.openedGroupList.remove(t),t.hitChildren=!1,this.emitGroupEvent(wx.CLOSE,t)}checkOpenedGroups(){const t=this.openedGroupList;if(t.length){let{list:e}=t;this.editing&&(e=[],t.forEach(t=>this.list.every(e=>!Yd.hasParent(e,t))&&e.push(t))),e.forEach(t=>this.closeGroup(t))}this.editing&&!this.selector.dragging&&this.checkDeepSelect()}checkDeepSelect(){let t,{list:e}=this;for(let i=0;i<e.length;i++)for(t=e[i].parent;t&&!t.hitChildren;)this.openGroup(t),t=t.parent}emitGroupEvent(t,e){const i=new wx(t,{editTarget:e});this.emitEvent(i),e&&e.emitEvent(i)}getInnerEditor(t){return this.editToolList[t]=this.editToolList[t]||mx.get(t,this)}openInnerEditor(t,e,i){let s;if(rr(e)?s=e:i||(i=e),t&&i&&(this.target=t),this.single){t||(t=this.element),s||(s=t.editInner);const{beforeEditInner:e}=this.mergeConfig;if(e){const i=e({target:t,name:s});if(rr(i))s=i;else if(!1===i)return}mx.list[s]&&(this.editTool.unload(),this.innerEditing=!0,this.innerEditor=this.getInnerEditor(s),this.innerEditor.editTarget=t,this.emitInnerEvent(yx.BEFORE_OPEN),this.innerEditor.load(),this.emitInnerEvent(yx.OPEN))}}closeInnerEditor(t){this.innerEditing&&(this.innerEditing=!1,this.emitInnerEvent(yx.BEFORE_CLOSE),this.innerEditor.unload(),this.emitInnerEvent(yx.CLOSE),t||this.updateEditTool(),this.innerEditor=null)}emitInnerEvent(t){const{innerEditor:e}=this,{editTarget:i}=e,s=new yx(t,{editTarget:i,innerEditor:e});this.emitEvent(s),i.emitEvent(s)}lock(){this.list.forEach(t=>t.locked=!0),this.update()}unlock(){this.list.forEach(t=>t.locked=!1),this.update()}toTop(){this.list.length&&(gx.toTop(this.list),this.leafList.update())}toBottom(){this.list.length&&(gx.toBottom(this.list),this.leafList.update())}onAppRenderStart(t){(this.targetChanged=t.children.some(t=>t!==this.leafer&&t.renderer.changed))&&this.editBox.forceRender()}onRenderStart(){this.targetChanged&&this.update()}onChildScroll(){this.multiple&&this.updateEditBox()}listenTargetEvents(){if(!this.targetEventIds.length){const{app:t,leafer:e,targetLeafer:i,editMask:s}=this;this.targetEventIds=[e.on_(Mu.START,this.onRenderStart,this),i&&i.on_(xu.SCROLL,this.onChildScroll,this),t.on_(Mu.CHILD_START,this.onAppRenderStart,this),t.on_(Du.UPDATE_MODE,t=>{t.mode&&"normal"!==t.mode&&this.cancel()})],s.visible&&s.forceRender()}}removeTargetEvents(){const{targetEventIds:t,editMask:e}=this;t.length&&(this.off_(t),e.visible&&e.forceRender())}destroy(){this.destroyed||(this.target=this.hoverTarget=null,Object.values(this.editToolList).forEach(t=>t.destroy()),this.simulateTarget.destroy(),this.editToolList={},this.simulateTarget=this.editTool=this.innerEditor=null,super.destroy())}};bw([(t,e)=>{ed(t,e,{get(){const{config:t,element:e,dragPoint:i,editBox:s,editTool:n,innerEditor:r,app:o}=this,a=Object.assign({},t);if(r?r.editConfig&&Object.assign(a,r.editConfig):n&&n.editConfig&&Object.assign(a,n.editConfig),e&&e.editConfig){let{editConfig:t}=e;(t.hover||t.hoverStyle)&&(t=Object.assign({},t),delete t.hover,delete t.hoverStyle),Object.assign(a,t)}return s.config&&Object.assign(a,s.config),i&&(i.editConfig&&Object.assign(a,i.editConfig),"font-size"===a.editSize&&(a.lockRatio=!0),"resize-rotate"===i.pointType&&(a.around||(a.around="center"),nr(a.lockRatio)&&(a.lockRatio=!0))),sr(a.dragLimitAnimate)&&(a.dragLimitAnimate=o&&o.config.pointer.dragLimitAnimate),this.mergedConfig=a}})}],Rx.prototype,"mergeConfig",void 0),bw([Ew(function(t,e){const{target:i}=t;i?(t.leafList=i instanceof eg?i:new eg(i),t.multiple&&dx(t)):(t.simulateTarget.remove(),t.leafList.reset()),t.closeInnerEditor(!0),t.unloadEditTool();const s={editor:t,value:i,oldValue:e};t.emitEvent(new Sw(Sw.SELECT,s)),t.checkOpenedGroups(),t.editing?t.waitLeafer(()=>{t.updateEditTool(),t.listenTargetEvents()}):(t.updateEditTool(),t.removeTargetEvents()),t.emitEvent(new Sw(Sw.AFTER_SELECT,s))})],Rx.prototype,"target",void 0),bw([Ew(function(t,e){t.emitEvent(new Sw(Sw.HOVER,{editor:t,value:t.hoverTarget,oldValue:e}))})],Rx.prototype,"hoverTarget",void 0),Rx=bw([Rd(class{onMove(t){const{target:e,mergeConfig:i,dragStartData:s}=this.editBox;let n,{dragLimitAnimate:r}=i;const o=t.type===n_.END||t.type===i_.END,a=rr(e.draggable),h=!r||o||a,l={x:t.totalX,y:t.totalY};t instanceof n_&&no.move(l,e.getWorldPointByLocal(s.totalOffset,null,!0)),t.shiftKey&&(Math.abs(l.x)>Math.abs(l.y)?l.y=0:l.x=0),n=i_.getValidMove(e,s.point,l,h),(n.x||n.y)&&(r&&!a&&o?Yd.animateMove(this,n,ar(r)?r:.3):this.move(n))}onScale(t){const{target:e,mergeConfig:i,single:s,dragStartData:n}=this.editBox;let r,{around:o,lockRatio:a,flipable:h,editSize:l}=i;t instanceof h_?(o||(o=e.getBoxPoint(t)),r=t.totalScale):r=t.getInnerTotal(e);const{direction:c}=t.current;(t.shiftKey||e.lockRatio)&&(a=!0);const d=qw.getScaleData(e,n.bounds,c,r,a,qw.getAround(o,t.altKey),h,!s||"scale"===l),u=e.x,p=e.y;t instanceof i_&&this.editTool&&this.editTool.onScaleWithDrag?(d.drag=t,this.scaleWithDrag(d)):this.scaleOf(d.origin,d.scaleX,d.scaleY),no.move(n.totalOffset,e.x-u,e.y-p)}onRotate(t){const{target:e,mergeConfig:i,dragStartData:s}=this.editBox,{around:n,rotateAround:r,rotateGap:o,diagonalRotateKey:a}=i,{direction:h}=t.current;let l,c;if(t instanceof o_)c=t.rotation,l=r?_o.getPoint(r,e.boxBounds):e.getBoxPoint(t);else{const i=a?t.isHoldKeys(a):t.shiftKey,o=qw.getRotateData(e,h,t,s,i?null:r||e.around||e.origin||n||"center");c=s.rotation+o.rotation-e.rotation,l=o.origin}if(c=Pr.float(Pr.getGapRotation(c,o,e.rotation),2),!c)return;const d=e.x,u=e.y;this.rotateOf(l,c),no.move(s.totalOffset,e.x-d,e.y-u)}onSkew(t){const{target:e,mergeConfig:i}=this.editBox,{around:s}=i,{origin:n,skewX:r,skewY:o}=qw.getSkewData(e.boxBounds,t.current.direction,t.getInnerMove(e),qw.getAround(s,t.altKey));(r||o)&&this.skewOf(n,r,o)}move(t,e=0){if(!this.checkTransform("moveable"))return;lr(t)&&(e=t.y,t=t.x);const{target:i,mergeConfig:s,single:n,editor:r}=this.editBox,{beforeMove:o}=s;if(o){const s=o({target:i,x:t,y:e});if(lr(s))t=s.x,e=s.y;else if(!1===s)return}const a=i.getWorldPointByLocal({x:t,y:e},null,!0);n||i.safeChange(()=>i.move(t,e));const h={target:i,editor:r,moveX:a.x,moveY:a.y};this.emitEvent(new Ex(Ex.BEFORE_MOVE,h));const l=new Ex(Ex.MOVE,h);this.doMove(l),this.emitEvent(l)}scaleWithDrag(t){if(!this.checkTransform("resizeable"))return;const{target:e,mergeConfig:i,editor:s}=this.editBox,{beforeScale:n}=i;if(n){const{origin:i,scaleX:s,scaleY:r,drag:o}=t;if(!1===n({target:e,drag:o,origin:i,scaleX:s,scaleY:r}))return}t=Object.assign(Object.assign({},t),{target:e,editor:s,worldOrigin:e.getWorldPoint(t.origin)}),this.emitEvent(new Cx(Cx.BEFORE_SCALE,t));const r=new Cx(Cx.SCALE,t);this.editTool.onScaleWithDrag(r),this.emitEvent(r)}scaleOf(t,e,i=e,s){if(!this.checkTransform("resizeable"))return;const{target:n,mergeConfig:r,single:o,editor:a}=this.editBox,{beforeScale:h}=r;if(h){const s=h({target:n,origin:t,scaleX:e,scaleY:i});if(lr(s))e=s.scaleX,i=s.scaleY;else if(!1===s)return}const l=this.getWorldOrigin(t),c=!o&&this.getChangedTransform(()=>n.safeChange(()=>n.scaleOf(t,e,i))),d={target:n,editor:a,worldOrigin:l,scaleX:e,scaleY:i,transform:c};this.emitEvent(new Cx(Cx.BEFORE_SCALE,d));const u=new Cx(Cx.SCALE,d);this.doScale(u),this.emitEvent(u)}flip(t){if(!this.checkTransform("resizeable"))return;const{target:e,single:i,editor:s}=this.editBox,n=this.getWorldOrigin("center"),r=i?new uo(Yd.getFlipTransform(e,t)):this.getChangedTransform(()=>e.safeChange(()=>e.flip(t))),o={target:e,editor:s,worldOrigin:n,scaleX:"x"===t?-1:1,scaleY:"y"===t?-1:1,transform:r};this.emitEvent(new Cx(Cx.BEFORE_SCALE,o));const a=new Cx(Cx.SCALE,o);this.doScale(a),this.emitEvent(a)}rotateOf(t,e){if(!this.checkTransform("rotateable"))return;const{target:i,mergeConfig:s,single:n,editor:r}=this.editBox,{beforeRotate:o}=s;if(o){const s=o({target:i,origin:t,rotation:e});if(ar(s))e=s;else if(!1===s)return}const a=this.getWorldOrigin(t),h=!n&&this.getChangedTransform(()=>i.safeChange(()=>i.rotateOf(t,e))),l={target:i,editor:r,worldOrigin:a,rotation:e,transform:h};this.emitEvent(new Ox(Ox.BEFORE_ROTATE,l));const c=new Ox(Ox.ROTATE,l);this.doRotate(c),this.emitEvent(c)}skewOf(t,e,i=0,s){if(!this.checkTransform("skewable"))return;const{target:n,mergeConfig:r,single:o,editor:a}=this.editBox,{beforeSkew:h}=r;if(h){const s=h({target:n,origin:t,skewX:e,skewY:i});if(lr(s))e=s.skewX,i=s.skewY;else if(!1===s)return}const l=this.getWorldOrigin(t),c=!o&&this.getChangedTransform(()=>n.safeChange(()=>n.skewOf(t,e,i))),d={target:n,editor:a,worldOrigin:l,skewX:e,skewY:i,transform:c};this.emitEvent(new Tx(Tx.BEFORE_SKEW,d));const u=new Tx(Tx.SKEW,d);this.doSkew(u),this.emitEvent(u)}doMove(t){this.editTool.onMove(t)}doScale(t){this.editTool.onScale(t)}doRotate(t){this.editTool.onRotate(t)}doSkew(t){this.editTool.onSkew(t)}checkTransform(t){const{target:e,mergeConfig:i}=this.editBox;return e&&!e.locked&&i[t]}getWorldOrigin(t){const{target:e}=this.editBox;return e.getWorldPoint(Yd.getInnerOrigin(e,t))}getChangedTransform(t){const{target:e,single:i}=this.editBox;if(!i&&!e.canChange)return e.changedTransform;const s=new uo(e.worldTransform);return t(),new uo(e.worldTransform).divide(s)}emitEvent(t,e){this.editBox.editor.emitEvent(t,e)}},["editBox","editTool","emitEvent"])],Rx);var Bx=class{static registerInnerEditor(){mx.register(this)}get tag(){return"InnerEditor"}get mode(){return"focus"}get editBox(){return this._editBox||this.editor.editBox}set editBox(t){this._editBox=t}constructor(t){this.eventIds=[],this.editor=t,this.create()}onCreate(){}create(){this.view=new Ng,this.onCreate()}onLoad(){}load(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!1),this.onLoad())}onUpdate(){}update(){this.onUpdate()}onUnload(){}unload(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!0),this.onUnload())}onDestroy(){}destroy(){this.onDestroy(),this.editor&&(this.view&&this.view.destroy(),this.eventIds&&this.editor.off_(this.eventIds),this.editor=this.view=this.eventIds=null)}},Px=class extends Bx{static registerEditTool(){mx.register(this)}get tag(){return"EditTool"}onMove(t){const{moveX:e,moveY:i,editor:s}=t,{app:n,list:r}=s;n.lockLayout(),r.forEach(t=>{t.moveWorld(e,i)}),n.unlockLayout()}onScale(t){const{scaleX:e,scaleY:i,transform:s,worldOrigin:n,editor:r}=t,{app:o,list:a}=r;o.lockLayout(),a.forEach(t=>{const o="scale"!==r.getEditSize(t);s?t.transformWorld(s,o):t.scaleOfWorld(n,e,i,o)}),o.unlockLayout()}onRotate(t){const{rotation:e,transform:i,worldOrigin:s,editor:n}=t,{app:r,list:o}=n;r.lockLayout(),o.forEach(t=>{const r="scale"!==n.getEditSize(t);i?t.transformWorld(i,r):t.rotateOfWorld(s,e)}),r.unlockLayout()}onSkew(t){const{skewX:e,skewY:i,transform:s,worldOrigin:n,editor:r}=t,{app:o,list:a}=r;o.lockLayout(),a.forEach(t=>{const o="scale"!==r.getEditSize(t);s?t.transformWorld(s,o):t.skewOfWorld(n,e,i,o)}),o.unlockLayout()}load(){this.editBox.view.visible=!0,this.onLoad()}update(){this.editBox.update(),this.onUpdate()}unload(){this.editBox.view.visible=!1,this.onUnload()}};Px=bw([_x()],Px);var{left:Lx,right:Mx}=jr,{move:Dx,copy:Ax,toNumberPoints:Ix}=no,Wx=class extends Px{constructor(){super(...arguments),this.scaleOfEvent=!0}get tag(){return"LineEditTool"}onScaleWithDrag(t){const{drag:e,direction:i,lockRatio:s,around:n}=t,r=t.target,o=i===Lx;if(r.pathInputed){const{path:t}=r.__,{from:i,to:a}=this.getFromToByPath(t);this.dragPoint(i,a,o,n,this.getInnerMove(r,e,s)),t[1]=i.x,t[2]=i.y,t[4]=a.x,t[5]=a.y,r.path=t}else if(r.points){const{points:t}=r,{from:i,to:a}=this.getFromToByPoints(t);this.dragPoint(i,a,o,n,this.getInnerMove(r,e,s)),t[0]=i.x,t[1]=i.y,t[2]=a.x,t[3]=a.y,r.points=t}else{const t={x:0,y:0},{toPoint:i}=r;r.rotation=0,this.dragPoint(t,i,o,n,this.getInnerMove(r,e,s)),r.getLocalPointByInner(t,null,null,!0),r.getLocalPointByInner(i,null,null,!0),r.x=t.x,r.y=t.y,r.getInnerPointByLocal(i,null,null,!0),r.toPoint=i}}getInnerMove(t,e,i){const s=e.getInnerMove(t);return i&&(Math.abs(s.x)>Math.abs(s.y)?s.y=0:s.x=0),s}getFromToByPath(t){return{from:{x:t[1],y:t[2]},to:{x:t[4],y:t[5]}}}getFromToByPoints(t){const e=Ix(t);return{from:{x:e[0],y:e[1]},to:{x:e[2],y:e[3]}}}dragPoint(t,e,i,s,n){const{x:r,y:o}=n;i?(Dx(t,r,o),s&&Dx(e,-r,-o)):(s&&Dx(t,-r,-o),Dx(e,r,o))}onSkew(t){}onUpdate(){const{editBox:t}=this,{rotatePoints:e,resizeLines:i,resizePoints:s,rect:n}=t,r=t.target;let o,a;if(r.pathInputed?o=this.getFromToByPath(r.__.path):r.points&&(o=this.getFromToByPoints(r.__.points)),o){const{from:i,to:a}=o;r.innerToWorld(i,i,!1,t),r.innerToWorld(a,a,!1,t),n.pen.clearPath().moveTo(i.x,i.y).lineTo(a.x,a.y),Ax(s[7],i),Ax(e[7],i),Ax(s[3],a),Ax(e[3],a)}for(let h=0;h<8;h++)h<4&&(i[h].visible=!1),a=h===Lx||h===Mx,s[h].visible=a,e[h].visible=!o&&a}};function Fx(t){const{scroll:e,disabled:i}=t.app.config.move;return!e||i?"":!0===e?"free":e}function zx(t,e,i){(function(t,e){const i={wheel:{preventDefault:!0},touch:{preventDefault:!0},pointer:{preventDefaultMenu:!0}};e&&pr.assign(i,e),pr.assign(t.config,i,t.userConfig)})(t.parentApp?t.parentApp:t,e),t.isApp||i||t.__eventIds.push(t.on_(n_.BEFORE_MOVE,e=>{const i=t.getValidMove(e.moveX,e.moveY,!1);if(Fx(t).includes("limit")){const s=t.getValidMove(0,0);if(s.x||s.y){const t=100,n=200,r="drag"===e.moveType?.3:.05;Math.abs(s.x)>t?i.x=0:i.x*=r,Math.abs(s.y)>n?i.y=0:i.y*=r}}t.zoomLayer.move(i)}),t.on_(n_.DRAG_ANIMATE,()=>{const e=t.getValidMove(0,0);(e.x||e.y)&&t.interaction.stopDragAnimate()}),t.on_(n_.END,e=>{Yd.animateMove(t.zoomLayer,t.getValidMove(e.moveX,e.moveY))}),t.on_(h_.BEFORE_ZOOM,e=>{const{zoomLayer:i,layouter:s}=t,n=t.getValidScale(e.scale);1!==n&&(s.stop(),Yd.updateMatrix(t),i.scaleOfWorld(e,n),s.start())}))}Wx=bw([_x()],Wx),sa.add("editor","resize"),na.editor=function(t,e){const i=new Rx(t);return e&&e.sky.add(e.editor=i),i},Zg.addAttr("textBox",!1,nd),Fg.addAttr("editConfig",void 0,nd),Fg.addAttr("editOuter",t=>(t.updateLayout(),t.__.__isLinePath?"LineEditTool":"EditTool"),nd),Fg.addAttr("editInner","PathEditor",nd),Ng.addAttr("editInner","",nd),Lf.addAttr("editInner","TextEditor",nd),Fg.setEditConfig=function(t){this.changeAttr("editConfig",t)},Fg.setEditOuter=function(t){this.changeAttr("editOuter",t)},Fg.setEditInner=function(t){this.changeAttr("editInner",t)};var Nx=$o.get("LeaferTypeCreator"),Vx={list:{},register(t,e){Hx[t]&&Nx.repeat(t),Hx[t]=e},run(t,e){const i=Hx[t];i&&i(e)}},{list:Hx,register:Yx}=Vx;Yx("viewport",zx),Yx("custom",function(t){zx(t,null,!0)}),Yx("design",function(t){zx(t,{zoom:{min:.01,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0}})}),Yx("document",function(t){zx(t,{zoom:{min:1},move:{scroll:"limit"}})});var Xx,jx,Ux,Gx,Kx={state:{type:"none",typeCount:0,startTime:0,totalData:null,center:{}},getData(t){const e=t[0],i=t[1],s=no.getCenter(e.from,i.from),n=no.getCenter(e.to,i.to),r={x:n.x-s.x,y:n.y-s.y},o=no.getDistance(e.from,i.from);return{move:r,scale:no.getDistance(e.to,i.to)/o,rotation:no.getRotation(e.from,i.from,e.to,i.to),center:n}},getType(t,e){const i=Math.hypot(t.move.x,t.move.y)/(e.move||5),s=Math.abs(t.scale-1)/(e.scale||.03),n=Math.abs(t.rotation)/(e.rotation||2);return i<1&&s<1&&n<1?"none":i>=s&&i>=n?"move":s>=n?"zoom":"rotate"},detect(t,e){const{state:i}=Zx,s=Zx.getType(t,e);if(i.totalData||(i.startTime=Date.now(),i.center=t.center),Zx.add(t,i.totalData),i.totalData=t,s===i.type){if(i.typeCount++,i.typeCount>=(e.count||3)&&"none"!==s)return s}else i.type=s,i.typeCount=1;return Date.now()-i.startTime>=(e.time||160)?Zx.getType(i.totalData,e):"none"},add(t,e){e&&(no.move(t.move,e.move),t.scale*=e.scale,t.rotation+=e.rotation,t.center=e.center)},reset(){const{state:t}=Zx;t.type="none",t.typeCount=0,t.startTime=0,t.totalData=null}},Zx=Kx,{abs:$x,max:qx}=Math,{sign:Jx,within:Qx}=Pr,tb={getMove(t,e){let{moveSpeed:i}=e,{deltaX:s,deltaY:n}=t;t.shiftKey&&!s&&(s=n,n=0);const r=$x(s),o=$x(n);return r>50&&(s=qx(50,r/3)*Jx(s)),o>50&&(n=qx(50,o/3)*Jx(n)),{x:-s*i*2,y:-n*i*2}},getScale(t,e){let i,s=1,{zoomMode:n,zoomSpeed:r}=e;const o=t.deltaY||t.deltaX;if(n?(i="mouse"===n||!t.deltaX&&(Go.intWheelDeltaY?Math.abs(o)>17:Math.ceil(o)!==o),(t.shiftKey||t.metaKey||t.ctrlKey)&&(i=!0)):i=!t.shiftKey&&(t.metaKey||t.ctrlKey),i){r=Qx(r,0,1);const i=t.deltaY?e.delta.y:e.delta.x,n=Qx(1-$x(o)/(4*i)*r,.5,2);s=o>0?n:1/n}return s}},eb=class{get transforming(){return this.moving||this.zooming||this.rotating}get moving(){return!!this.moveData}get zooming(){return!!this.zoomData}get rotating(){return!!this.rotateData}constructor(t){this.interaction=t}move(t){const{interaction:e}=this;t.moveType||(t.moveType="move"),this.moveData||(this.setPath(t),Xx=0,jx=0,this.moveData=Object.assign(Object.assign({},t),{moveX:0,moveY:0,totalX:Xx,totalY:jx}),e.emit(n_.START,this.moveData)),t.path=this.moveData.path,t.totalX=Xx+=t.moveX,t.totalY=jx+=t.moveY,e.emit(n_.BEFORE_MOVE,t),e.emit(n_.MOVE,t),this.transformEndWait()}zoom(t){const{interaction:e}=this;this.zoomData||(this.setPath(t),Ux=1,this.zoomData=Object.assign(Object.assign({},t),{scale:1,totalScale:Ux}),e.emit(h_.START,this.zoomData)),t.path=this.zoomData.path,t.totalScale=Ux*=t.scale,e.emit(h_.BEFORE_ZOOM,t),e.emit(h_.ZOOM,t),this.transformEndWait()}rotate(t){const{interaction:e}=this;this.rotateData||(this.setPath(t),Gx=0,this.rotateData=Object.assign(Object.assign({},t),{rotation:0,totalRotation:Gx}),e.emit(o_.START,this.rotateData)),t.path=this.rotateData.path,t.totalRotation=Gx+=t.rotation,e.emit(o_.BEFORE_ROTATE,t),e.emit(o_.ROTATE,t),this.transformEndWait()}setPath(t){const{interaction:e}=this,{path:i}=e.selector.getByPoint(t,e.hitRadius);t.path=i,e.cancelHover()}transformEndWait(){clearTimeout(this.transformTimer),this.transformTimer=setTimeout(()=>{this.transformEnd()},this.interaction.p.transformTime)}transformEnd(){const{interaction:t,moveData:e,zoomData:i,rotateData:s}=this;e&&t.emit(n_.END,Object.assign(Object.assign({},e),{totalX:Xx,totalY:jx})),i&&t.emit(h_.END,Object.assign(Object.assign({},i),{totalScale:Ux})),s&&t.emit(o_.END,Object.assign(Object.assign({},s),{totalRotation:Gx})),this.reset()}reset(){this.zoomData=this.moveData=this.rotateData=null}destroy(){this.reset()}},ib=Hg.prototype,sb=new No,nb=new co;function rb(t,e){return Object.assign(Object.assign({},e),{moveX:t.x,moveY:t.y})}function ob(t,e){return Object.assign(Object.assign({},e),{scale:t})}ib.initType=function(t){Vx.run(t,this)},ib.getValidMove=function(t,e,i=!0){const{disabled:s,scrollSpread:n}=this.app.config.move;nb.set(t,e);const r=Fx(this);return r&&(r.includes("x")?nb.y=0:r.includes("y")?nb.x=0:Math.abs(nb.x)>Math.abs(nb.y)?nb.y=0:nb.x=0,i&&r.includes("limit")&&(sb.set(this.__world).addPoint(this.zoomLayer),n&&sb.spread(n),Jf.getValidMove(sb,this.canvas.bounds,"auto",nb,!0),r.includes("x")?nb.y=0:r.includes("y")&&(nb.x=0))),{x:s?0:nb.x,y:s?0:nb.y}},ib.getValidScale=function(t){const{scaleX:e}=this.zoomLayer.__,{min:i,max:s,disabled:n}=this.app.config.zoom,r=Math.abs(e*t);return i&&r<i?t=i/e:s&&r>s&&(t=s/e),n?1:t};var ab=C_.prototype;ab.createTransformer=function(){this.transformer=new eb(this)},ab.move=function(t){this.transformer.move(t)},ab.zoom=function(t){this.transformer.zoom(t)},ab.rotate=function(t){this.transformer.rotate(t)},ab.transformEnd=function(){this.transformer.transformEnd()},ab.wheel=function(t){const{wheel:e,pointer:i}=this.config,{posDeltaSpeed:s,negDeltaSpeed:n}=e;if(e.disabled)return;t.deltaX>0?s&&(t.deltaX*=s):n&&(t.deltaX*=n),t.deltaY>0?s&&(t.deltaY*=s):n&&(t.deltaY*=n);const r=e.getScale?e.getScale(t,e):tb.getScale(t,e);if(1!==r)this.zoom(ob(r,t));else{const s=e.getMove?e.getMove(t,e):tb.getMove(t,e);i.snap&&no.round(s),this.move(rb(s,t))}},ab.multiTouch=function(t,e){const{disabled:i,singleGesture:s}=this.config.multiTouch;if(i)return;this.pointerWaitCancel();let n=Kx.getData(e),{moving:r,zooming:o,rotating:a}=this.transformer;if(s){if(!this.transformer.transforming){switch(Kx.detect(n,lr(s)?s:{})){case"move":r=!0;break;case"zoom":o=!0;break;case"rotate":a=!0;break;default:return}Kx.reset()}r||(n.center=Kx.state.center)}else r=o=a=!0;var h,l;Object.assign(t,n.center),t.multiTouch=!0,a&&this.rotate((h=n.rotation,l=t,Object.assign(Object.assign({},l),{rotation:h}))),o&&this.zoom(ob(n.scale,t)),r&&this.move(rb(n.move,t))};var hb=__.prototype,{abs:lb,min:cb,max:db,hypot:ub}=Math;function pb(t,e){let i=1;const s="out"===e,n=Math.abs(t);if(n>1){for(;s?i<n:i<=n;)i*=2;s&&(i/=2)}else{for(;s?i>=n:i>n;)i/=2;s||(i*=2)}return i/t}hb.checkDragEndAnimate=function(t){const{interaction:e}=this,i=this.canAnimate&&this.moving&&e.m.dragAnimate;if(i){const s=ar(i)?i:.95,n=.15,r=150;let o,a,h,l=0,c=0,d=0,u=0,p=3;const{dragDataList:g}=this,f=g.length;for(let t=f-1;t>=db(f-3,0)&&(h=g[t],!(h.time&&Date.now()-h.time>100));t--)o=p--,l+=h.moveX*o,c+=h.moveY*o,u+=o,a=ub(h.moveX,h.moveY),a>d&&(d=a);if(u&&(l/=u,c/=u),d>8){const t=1.15+.4500000000000002*cb((d-8)/17,1);l*=t,c*=t}const _=db(lb(l),lb(c));_>r&&(a=r/_,l*=a,c*=a);const m=()=>{if(l*=s,c*=s,t=Object.assign({},t),lb(l)<n&&lb(c)<n)return this.dragEndReal(t);no.move(t,l,c),this.drag(t),this.animate(m),e.emit(n_.DRAG_ANIMATE,t)};this.animate(m)}return i},hb.animate=function(t,e){const i=t||this.animateWait;i&&this.interaction.target.nextRender(i,null,e),this.animateWait=t},hb.stopAnimate=function(){this.animate(null,"off"),this.interaction.target.nextRender(()=>{this.dragData&&this.dragEndReal(this.dragData)})},hb.checkDragOut=function(t){const{interaction:e}=this;this.autoMoveCancel(),this.dragging&&!e.shrinkCanvasBounds.hitPoint(t)&&this.autoMoveOnDragOut(t)},hb.autoMoveOnDragOut=function(t){const{interaction:e,downData:i,canDragOut:s}=this,{autoDistance:n,dragOut:r}=e.m;if(!r||!s||!n)return;const o=e.shrinkCanvasBounds,{x:a,y:h}=o,l=Io.maxX(o),c=Io.maxY(o),d=t.x<a?n:l<t.x?-n:0,u=t.y<h?n:c<t.y?-n:0;let p=0,g=0;this.autoMoveTimer=setInterval(()=>{p+=d,g+=u,no.move(i,d,u),no.move(this.dragData,d,u),e.move(Object.assign(Object.assign({},t),{moveX:d,moveY:u,totalX:p,totalY:g,moveType:"drag"})),e.pointerMoveReal(t)},10)},hb.autoMoveCancel=function(){this.autoMoveTimer&&(clearInterval(this.autoMoveTimer),this.autoMoveTimer=0)},sa.add("viewport"),sa.add("view"),Hg.prototype.zoom=function(t,e,i,s){let n;!function(t){return lr(t)&&!hr(t)}(e)?n=e:(n=e.padding,i=e.scroll,s=e.transition);const{zoomLayer:r}=this,o=this.canvas.bounds.clone().shrink(nr(n)?30:n),a=new No,h={x:o.x+o.width/2,y:o.y+o.height/2};let l;r.killAnimate();const{x:c,y:d,scaleX:u,scaleY:p}=r.__,{boxBounds:g}=r;if(rr(t))switch(t){case"in":l=pb(u,"in");break;case"out":l=pb(u,"out");break;case"fit":t=g;break;case"fit-width":(t=new No(g)).height=0;break;case"fit-height":(t=new No(g)).width=0}else ar(t)&&(l=t/u);if(l)l=this.getValidScale(l),r.scaleOfWorld(h,l,l,!1,s);else if(lr(t)){const e={x:c,y:d,scaleX:u,scaleY:p},n=hr(t);if(n||t.tag){const e=n?t:[t];a.setListWithFn(e,Jd.worldBounds)}else{const e=function(t,e){let i,{x:s,y:n,width:r,height:o}=t;return o||(o=r*(e.height/e.width),i=!0),r||(r=o*(e.width/e.height),i=!0),i?{x:s,y:n,width:r,height:o}:t}(t,o);a.set(r.getWorldBounds(e))}const{width:h,height:g}=a;let f=o.x-a.x,_=o.y-a.y;return i?(f+=Math.max((o.width-h)/2,0),_+=Math.max((o.height-g)/2,0)):(l=this.getValidScale(Math.min(o.width/h,o.height/g)),f+=(o.width-h*l)/2,_+=(o.height-g*l)/2,no.scaleOf(e,a,l),a.scaleOf(a,l),e.scaleX*=l,e.scaleY*=l),"x"===i?_=0:"y"===i&&(f=0),no.move(e,f,_),a.move(f,_),r.set(e,s),a}return r.worldBoxBounds};var gb=class{constructor(t){this.undoStack=[],this.redoStack=[],this.limit=50,void 0!==t&&t>0&&(this.limit=t)}executeCommand(t){t.execute(),this.undoStack.push(t),this.redoStack=[],this.undoStack.length>this.limit&&this.undoStack.shift()}undo(){if(this.canUndo()){const t=this.undoStack.pop();t&&(t.undo(),this.redoStack.push(t))}}redo(){if(this.canRedo()){const t=this.redoStack.pop();t&&(t.execute(),this.undoStack.push(t))}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}},fb=class{constructor(t,e,i,s,n){this.target=t,this.fromX=e,this.fromY=i,this.toX=s,this.toY=n}execute(){this.target.x=this.toX,this.target.y=this.toY}undo(){this.target.x=this.fromX,this.target.y=this.fromY}},_b=class{constructor(t,e,i,s,n){this.target=t,this.fromWidth=e,this.fromHeight=i,this.toWidth=s,this.toHeight=n}execute(){this.target.width=this.toWidth,this.target.height=this.toHeight}undo(){this.target.width=this.fromWidth,this.target.height=this.fromHeight}},mb=class{constructor(t,e){this.parent=t,this.element=e}execute(){this.parent.add(this.element)}undo(){this.parent.remove(this.element)}},vb=class{constructor(t,e,i){this.parent=t,this.element=e,this.index=i}execute(){this.parent.remove(this.element)}undo(){this.parent.add(this.element)}},yb=class{constructor(t){this.commands=t}execute(){this.commands.forEach(t=>t.execute())}undo(){for(let t=this.commands.length-1;t>=0;t--)this.commands[t].undo()}},wb=["Shift","Meta","Alt","Control"],xb="object"==typeof navigator?navigator.platform:"",bb=/Mac|iPod|iPhone|iPad/.test(xb),kb=bb?"Meta":"Control",Sb="Win32"===xb?["Control","Alt"]:bb?["Alt"]:[];function Eb(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||Sb.includes(e)&&t.getModifierState("AltGraph"))}function Cb(t){return t.trim().split(" ").map(function(t){var e=t.split(/\b\+/),i=e.pop(),s=i.match(/^\((.+)\)$/);return s&&(i=new RegExp("^"+s[1]+"$")),[e=e.map(function(t){return"$mod"===t?kb:t}),i]})}function Ob(t,e){var i=e[0],s=e[1];return!((s instanceof RegExp?!s.test(t.key)&&!s.test(t.code):s.toUpperCase()!==t.key.toUpperCase()&&s!==t.code)||i.find(function(e){return!Eb(t,e)})||wb.find(function(e){return!i.includes(e)&&s!==e&&Eb(t,e)}))}function Tb(t,e){var i;void 0===e&&(e={});var s=null!=(i=e.timeout)?i:1e3,n=Object.keys(t).map(function(e){return[Cb(e),t[e]]}),r=new Map,o=null;return function(t){t instanceof KeyboardEvent&&(n.forEach(function(e){var i=e[0],s=e[1],n=r.get(i)||i;Ob(t,n[0])?n.length>1?r.set(i,n.slice(1)):(r.delete(i),s(t)):Eb(t,t.key)||r.delete(i)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),s))}}var Rb={key:0,class:"loading-overlay",style:{}},Bb={key:1,class:"error-overlay"},Pb={class:"zoom-controller"},Lb={key:0,class:"hotkey-hint"},Mb={key:0,class:"hotkey-hint"},Db={key:0,class:"hotkey-hint"},Ab={class:"toolbar"},Ib={key:0,class:"hotkey-hint"},Wb={key:0,class:"hotkey-hint"},Fb={key:0,class:"hotkey-hint"},zb={key:0,class:"hotkey-hint"},Nb={key:0,class:"hotkey-hint"},Vb=oi({__name:"RoiEditor",props:{imageSource:{type:Object,required:!0},options:{type:Object,default:()=>({})}},emits:["roiChange","loadStart","loadSuccess","loadError","undoStateChange","redoStateChange"],setup(t,{expose:e,emit:i}){const s=t,n=i,r=ye(void 0),o=ye("idle"),a=ye(null),h=ye(null);let l=null,c=null;const d=new Ng({name:"contentLayer"}),u=ye({x:0,y:0}),p=ye(!1),g=ye(!1),f=ye(!1),_=ye("rectangle"),m=ye(100),v=ye(!1),y=ye(0),w=ye(0);let x,b=null,k=null,S=null;const E=t=>{x.executeCommand(t)},C=()=>{x=new gb(s.options.maxUndoSteps??100),l=new If({view:r.value,width:r.value?.clientWidth||800,height:r.value?.clientHeight||600,fill:"#e3e3e3",zoom:{min:.2,max:4},editor:{rotateable:!1,middlePoint:{},selectedStyle:{...s.options.selectedRegionStyle}},tree:{type:"design"}}),l?.tree.add(d),l&&(l.on(t_.DOWN,L),l.on(t_.MOVE,M),l.on(t_.UP,D),l.on(i_.START,t=>{const e=t.target;e instanceof Yg&&e.parent===d&&(k={target:e,fromX:e.x||0,fromY:e.y||0,toX:e.x||0,toY:e.y||0})}),l.on(i_.DRAG,t=>{k&&(k.toX=t.target.x||0,k.toY=t.target.y||0)}),l.on(i_.END,()=>{if(k){const t=k.target;k.fromX===k.toX&&k.fromY===k.toY||(E(new fb(t,k.fromX,k.fromY,k.toX,k.toY)),n("roiChange",T())),k=null}}),l.on(h_.ZOOM,t=>{U()}),l.editor?.on(Cx.BEFORE_SCALE,t=>{const e=t.target;e instanceof Yg&&e.parent===d&&(S||(S={target:e,fromWidth:e.width||0,fromHeight:e.height||0,toWidth:e.width||0,toHeight:e.height||0}))}),l.editor?.on(Cx.SCALE,t=>{S&&(S.toWidth=t.target.width||0,S.toHeight=t.target.height||0)}),l.on(t_.UP,()=>{S&&function(){if(S){const t=S.target;S.fromWidth===S.toWidth&&S.fromHeight===S.toHeight||(E(new _b(t,S.fromWidth,S.fromHeight,S.toWidth,S.toHeight)),n("roiChange",T())),S=null}}()}))};const O=async t=>{const e=t||s.imageSource.url;if(l&&e){c&&(d.clear(),c.destroy()),o.value="loading",n("loadStart"),a.value=null,h.value=null;try{const t=await(i=e,new Promise((t,e)=>{const s=new window.Image;s.onload=()=>{t({width:s.width,height:s.height})},s.onerror=e,s.src=i}));a.value=t.width,h.value=t.height,c=new Ef({url:e,draggable:!1,editable:!1,lazy:!0,zIndex:-1,placeholderColor:"transparent"}),c.on(ku.LOADED,function(){o.value="success",n("loadSuccess"),P()}),c.on(ku.ERROR,function(t){o.value="error",n("loadError",t)}),d.add(c)}catch(r){o.value="error",n("loadError",r)}var i}},T=()=>{if(!d||!a.value||!h.value)return[];const t=[],e=a.value,i=h.value;return Array.from(d.children).forEach(s=>{if(!s.url){const n=s,r=n.id||`roi-${t.length}`,o=n.x||0,a=n.y||0,h=n.width||0,l=n.height||0,c=[{x:o,y:a},{x:o+h,y:a},{x:o+h,y:a+l},{x:o,y:a+l}],d=c.map(t=>({x:e>0?t.x/e:0,y:i>0?t.y/i:0}));t.push({id:r,x:o,y:a,width:h,height:l,points:c,normalized:{x:e>0?o/e:0,y:i>0?a/i:0,width:e>0?h/e:0,height:i>0?l/i:0,points:d}})}}),t},R=()=>({id:s.imageSource.id,url:s.imageSource.url,width:a.value,height:h.value});xi(()=>{ze(()=>{C(),O(),window.addEventListener("keydown",I),window.addEventListener("mousemove",B);const t=function(t,e,i){var s=void 0===i?{}:i,n=s.event,r=void 0===n?"keydown":n,o=s.capture,a=Tb(e,{timeout:s.timeout});return t.addEventListener(r,a,o),function(){t.removeEventListener(r,a,o)}}(window,{v:t=>{(p.value||g.value)&&(t.preventDefault(),F())},m:t=>{(p.value||g.value)&&(t.preventDefault(),z())},"$mod+KeyZ":t=>{(p.value||g.value)&&(t.preventDefault(),t.stopPropagation(),N())},"$mod+KeyY":t=>{(p.value||g.value)&&(t.preventDefault(),t.stopPropagation(),V())},Delete:t=>{(p.value||g.value)&&(t.preventDefault(),t.stopPropagation(),G())},"$mod+Equal":t=>{(p.value||g.value)&&(t.preventDefault(),t.stopPropagation(),X())},"$mod+Minus":t=>{(p.value||g.value)&&(t.preventDefault(),t.stopPropagation(),H())},"$mod+0":t=>{(p.value||g.value)&&(t.preventDefault(),t.stopPropagation(),j())},Alt:t=>{(p.value||g.value)&&(t.preventDefault(),f.value=!f.value)}});window.__roiEditorHotkeysUnsubscribe=t})});const B=t=>{u.value={x:t.clientX,y:t.clientY}},P=()=>{if(!(l&&c&&a.value&&h.value))return;const t=l.width,e=l.height,i=a.value,s=h.value,n=t/i,r=e/s,o=Math.min(n,r,1),d=(t-i*Number(o.toFixed(2)))/2,u=(e-s*Number(o.toFixed(2)))/2;l.tree.scale=Number(o.toFixed(2)),l.tree.x=d,l.tree.y=u,U()},L=t=>{if("rectangle"!==_.value)return;if(t.ctrlKey||t.metaKey)return;if(t.target){if(t.target.parent===d&&!t.target.url)return;if(t.target.parent&&t.target.parent.parent===d&&!t.target.parent.url)return;if("resize"===t.target.pointType)return;if("rotate"===t.target.pointType)return}const e=d.getBoxPoint({x:t.x,y:t.y});A(e.x,e.y)&&(v.value=!0,y.value=e.x,w.value=e.y)},M=t=>{if(!v.value)return;const e=d.getBoxPoint({x:t.x,y:t.y}),i=e.x,n=e.y,r=Math.max(0,Math.min(i,a.value||0)),o=Math.max(0,Math.min(n,h.value||0)),l=Math.min(y.value,r),c=Math.min(w.value,o),u=Math.abs(r-y.value),p=Math.abs(o-w.value);b?(b.x=l,b.y=c,b.width=u,b.height=p):(b=new Yg({id:crypto.randomUUID(),x:l,y:c,width:u,height:p,stroke:"rgba(100, 149, 237, 0.8)",fill:"rgba(100, 149, 237, 0.3)",strokeWidth:2,draggable:!1,editable:!1,...s.options.regionStyle}),d.add(b))},D=()=>{if(v.value&&(v.value=!1,b)){const t=b.width||0,e=b.height||0;if(t<5||e<5)b.remove(),b=null;else{const t=s.options.maxRegions??20;if(T().length>=t)return alert(`已达到最大区域数量限制(${t}个)`),b.remove(),void(b=null);b.draggable=!0,b.editable=!0,b.dragBounds={x:0,y:0,width:a.value||0,height:h.value||0},E(new mb(d,b)),n("roiChange",T()),b=null}}},A=(t,e)=>t>=0&&t<=(a.value||0)&&e>=0&&e<=(h.value||0),I=t=>{if("Space"===t.code&&W())return t.preventDefault(),!1},W=()=>{if(!r.value)return!1;const t=r.value.getBoundingClientRect();return u.value.x>=t.left&&u.value.x<=t.right&&u.value.y>=t.top&&u.value.y<=t.bottom};Ei(()=>{c&&(l?.tree.remove(c),c=null),l?.destroy(),l=null,window.removeEventListener("keydown",I),window.removeEventListener("mousemove",B),window.__roiEditorHotkeysUnsubscribe&&(window.__roiEditorHotkeysUnsubscribe(),delete window.__roiEditorHotkeysUnsubscribe)});const F=()=>{_.value="select"},z=()=>{_.value="rectangle"},N=()=>{x.undo(),n("roiChange",T())},V=()=>{x.redo(),n("roiChange",T())},H=()=>{l&&(l.tree.zoom("out"),U())},X=()=>{l&&(l.tree.zoom("in"),U())},j=()=>{l&&(l.tree.zoom(1),U())},U=()=>{l&&l.tree&&void 0!==l.tree.scaleX&&(m.value=Math.round(100*l.tree.scaleX))},G=()=>{if(!l)return;const t=l.editor?.list||[];if(0===t.length)return;const e=t.filter(t=>t instanceof Yg&&t.parent===d);if(0===e.length)return;const i=[];e.forEach(t=>{const e=t.parent?.children.indexOf(t)??-1;t.remove();const s=new vb(d,t,e);i.push(s)}),i.length>0&&E(new yb(i)),l&&l.editor&&l.editor.cancel(),n("roiChange",T())};return e({getROIAnnotations:T,getImageInfo:R,exportCanvasJSON:()=>{const t={version:"1.0",canvas:{width:a.value,height:h.value,zoom:m.value/100},image:R(),leaferJSON:l?.tree?.toJSON?.()||null,annotations:T(),exportedAt:(new Date).toISOString()};return JSON.stringify(t,null,2)},importCanvasJSON:async(t,e)=>{try{const s=JSON.parse(t);if(!s.leaferJSON)return!1;if(d){for(;d.children.length>0;)d.children[0].remove();if(s.leaferJSON&&s.leaferJSON.children){let t=null;const e=i=>{for(const s of i){if(s.url)return t=s,!0;if(s.children&&s.children.length>0&&e(s.children))return!0}return!1};if(e(s.leaferJSON.children),t)try{await O(t.url)}catch(i){a.value=t.width||s.canvas?.width||0,h.value=t.height||s.canvas?.height||0}const n=t=>{for(const e of t){if(e.url)continue;const t=JSON.parse(JSON.stringify(e));d.add(t),e.children&&e.children.length>0&&n(e.children)}};n(s.leaferJSON.children[0].children)}l?.tree.forceUpdate()}return e?.resetZoom&&s.canvas?.zoom&&(m.value=100*s.canvas.zoom,U()),n("roiChange",T()),!0}catch(i){return!1}},loadImage:O}),(t,e)=>(Ws(),Vs("div",{class:"roi-editor",onFocus:e[1]||(e[1]=t=>p.value=!0),onBlur:e[2]||(e[2]=t=>p.value=!1),onMouseenter:e[3]||(e[3]=t=>g.value=!0),onMouseleave:e[4]||(e[4]=t=>g.value=!1)},[Us("div",{ref_key:"canvasContainer",ref:r,class:"canvas-container",tabindex:"0"},["loading"===o.value?(Ws(),Vs("div",Rb,[...e[5]||(e[5]=[Us("div",{class:"gradient-animation"},null,-1),Us("div",{class:"loading-text"},"图片加载中",-1)])])):$s("",!0),"error"===o.value?(Ws(),Vs("div",Bb,[e[6]||(e[6]=Us("p",null,"加载失败",-1)),Us("button",{onClick:e[0]||(e[0]=t=>O())},"重试")])):$s("",!0),Us("div",Pb,[Us("button",{class:"zoom-button",title:"缩小 (Ctrl+-)",onClick:H},[e[7]||(e[7]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Us("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),f.value?(Ws(),Vs("span",Lb,"Ctrl+-")):$s("",!0)]),Us("div",{class:"zoom-value",onClick:j,title:"点击重置为100% (Ctrl+0)"},[Zs(q(m.value)+"% ",1),f.value?(Ws(),Vs("span",Mb,"Ctrl+0")):$s("",!0)]),Us("button",{class:"zoom-button",title:"放大 (Ctrl++)",onClick:X},[e[8]||(e[8]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Us("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Us("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),f.value?(Ws(),Vs("span",Db,"Ctrl++")):$s("",!0)])])],512),Us("div",Ab,[Us("button",{class:Y(["tool-button",{active:"select"===_.value}]),title:"选择工具 (V)",onClick:F},[e[9]||(e[9]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2"},[Us("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"})],-1)),f.value?(Ws(),Vs("span",Ib,"V")):$s("",!0)],2),Us("button",{class:Y(["tool-button",{active:"rectangle"===_.value}]),title:"框选工具 (M)",onClick:z},[e[10]||(e[10]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Us("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"})],-1)),f.value?(Ws(),Vs("span",Wb,"M")):$s("",!0)],2),Us("button",{class:"tool-button",title:"撤销 (Ctrl+Z)",onClick:N},[e[11]||(e[11]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Us("path",{d:"M3 7v6h6"}),Us("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)),f.value?(Ws(),Vs("span",Fb,"Ctrl+Z")):$s("",!0)]),Us("button",{class:"tool-button",title:"重做 (Ctrl+Y)",onClick:V},[e[12]||(e[12]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Us("path",{d:"M21 7v6h-6"}),Us("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"})],-1)),f.value?(Ws(),Vs("span",zb,"Ctrl+Y")):$s("",!0)]),Us("button",{class:"tool-button",title:"删除 (Delete)",onClick:G},[e[13]||(e[13]=Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Us("path",{d:"M3 6h18"}),Us("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),Us("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})],-1)),f.value?(Ws(),Vs("span",Nb,"Del")):$s("",!0)])])],32))}}),Hb=(t,e)=>{const i=t.__vccOpts||t;for(const[s,n]of e)i[s]=n;return i},Yb=Hb(Vb,[["__scopeId","data-v-9c4af5f9"]]),Xb={class:"app"},jb={class:"editor-container"},Ub={class:"controls"},Gb={class:"control-group"},Kb={class:"control-group"},Zb={class:"output"},$b={class:"status"},qb=oi({__name:"App",setup(t){const e=ye("https://picsum.photos/1280/1080"),i=vn(()=>({id:"test-image",url:e.value})),s=ye({regionStyle:{fill:"#fcc",stroke:"#c63",strokeWidth:10},selectedRegionStyle:{fill:"#f6c",stroke:"#a9d",strokeWidth:10}}),n=ye("idle"),r=ye(""),o=ye(null),a=t=>{r.value=JSON.stringify(t,null,2)},h=()=>{n.value="loading"},l=()=>{n.value="success"},c=t=>{n.value="error"},d=()=>{o.value&&o.value.loadImage()},u=()=>{if(o.value){const t=o.value.getROIAnnotations(),e=JSON.stringify(t,null,2),i=new Blob([e],{type:"application/json"}),s=URL.createObjectURL(i),n=document.createElement("a");n.href=s,n.download="roi-data.json",n.click(),URL.revokeObjectURL(s)}},p=()=>{if(o.value){const t=o.value.getROIAnnotations();r.value=JSON.stringify(t,null,2)}},g=()=>{if(o.value){const t=o.value.exportCanvasJSON(),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download="canvas-data.json",s.click(),URL.revokeObjectURL(i)}},f=ye(null),_=()=>{f.value?.click()},m=async t=>{const e=t.target,i=e.files?.[0];if(i){const t=new FileReader;t.onload=async t=>{const e=t.target?.result;o.value&&(await o.value.importCanvasJSON(e,{resetZoom:!0})?alert("Canvas imported successfully!"):alert("Failed to import canvas."))},t.readAsText(i)}e.value=""};return(t,v)=>(Ws(),Vs("div",Xb,[v[6]||(v[6]=Us("h1",null,"LeaferJS Multi ROI Test",-1)),Us("div",jb,[Gs(Yb,{ref_key:"roiEditor",ref:o,imageSource:i.value,options:s.value,onRoiChange:a,onLoadStart:h,onLoadSuccess:l,onLoadError:c},null,8,["imageSource","options"])]),Us("div",Ub,[v[3]||(v[3]=Us("h2",null,"Controls",-1)),Us("div",Gb,[v[1]||(v[1]=Us("label",{for:"imageUrl"},"Image URL:",-1)),Ze(Us("input",{type:"text",id:"imageUrl","onUpdate:modelValue":v[0]||(v[0]=t=>e.value=t),placeholder:"Enter image URL"},null,512),[[Qn,e.value]])]),Us("div",{class:"control-group"},[Us("button",{onClick:p},"Get ROI Data"),Us("button",{onClick:u},"Export ROI Data"),Us("button",{onClick:d},"Refresh Image")]),Us("div",Kb,[v[2]||(v[2]=Us("h3",null,"Canvas Export/Import",-1)),Us("button",{onClick:g},"Export Canvas JSON"),Us("input",{type:"file",ref_key:"fileInput",ref:f,style:{display:"none"},accept:".json",onChange:m},null,544),Us("button",{onClick:_},"Import Canvas JSON")])]),Us("div",Zb,[v[4]||(v[4]=Us("h2",null,"ROI Data",-1)),Us("pre",null,q(r.value),1)]),Us("div",$b,[v[5]||(v[5]=Us("h2",null,"Status",-1)),Us("p",null,"Image Load Status: "+q(n.value),1)])]))}});((...t)=>{const e=(Jn||(Jn=ks(tr))).createApp(...t),{mount:i}=e;return e.mount=t=>{const s=function(t){return m(t)?document.querySelector(t):t}(t);if(!s)return;const n=e._component;_(n)||n.render||n.template||(n.template=s.innerHTML),1===s.nodeType&&(s.textContent="");const r=i(s,!1,function(t){if(t instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&t instanceof MathMLElement)return"mathml"}(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},e})(Hb(qb,[["__scopeId","data-v-4b675dba"]])).mount("#app");