@zzalai/leafer-point-annotation 1.1.1 → 1.1.3

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={},n=[],r=()=>{},o=()=>!1,s=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),a=t=>t.startsWith("onUpdate:"),l=Object.assign,h=(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),f=t=>"[object Set]"===b(t),g=t=>"[object Date]"===b(t),v=t=>"function"==typeof t,_=t=>"string"==typeof t,m=t=>"symbol"==typeof t,y=t=>null!==t&&"object"==typeof t,x=t=>(y(t)||v(t))&&v(t.then)&&v(t.catch),w=Object.prototype.toString,b=t=>w.call(t),S=t=>"[object Object]"===b(t),k=t=>_(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,L=C(t=>t.replace(O,t=>t.slice(1).toUpperCase())),P=/\B([A-Z])/g,T=C(t=>t.replace(P,"-$1").toLowerCase()),B=C(t=>t.charAt(0).toUpperCase()+t.slice(1)),R=C(t=>t?`on${B(t)}`:""),A=(t,e)=>!Object.is(t,e),D=(t,...e)=>{for(let i=0;i<t.length;i++)t[i](...e)},M=(t,e,i,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},I=t=>{const e=parseFloat(t);return isNaN(e)?t:e},F=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function W(t){if(u(t)){const e={};for(let i=0;i<t.length;i++){const n=t[i],r=_(n)?V(n):W(n);if(r)for(const t in r)e[t]=r[t]}return e}if(_(t)||y(t))return t}var z=/;(?![^(]*\))/g,N=/:([^]+)/,j=/\/\*[^]*?\*\//g;function V(t){const e={};return t.replace(j,"").split(z).forEach(t=>{if(t){const i=t.split(N);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function H(t){let e="";if(_(t))e=t;else if(u(t))for(let i=0;i<t.length;i++){const n=H(t[i]);n&&(e+=n+" ")}else if(y(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}var U="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Y=t(U);function X(t){return!!t||""===t}function G(t,e){if(t===e)return!0;let i=g(t),n=g(e);if(i||n)return!(!i||!n)&&t.getTime()===e.getTime();if(i=m(t),n=m(e),i||n)return t===e;if(i=u(t),n=u(e),i||n)return!(!i||!n)&&function(t,e){if(t.length!==e.length)return!1;let i=!0;for(let n=0;i&&n<t.length;n++)i=G(t[n],e[n]);return i}(t,e);if(i=y(t),n=y(e),i||n){if(!i||!n)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t){const n=t.hasOwnProperty(i),r=e.hasOwnProperty(i);if(n&&!r||!n&&r||!G(t[i],e[i]))return!1}}return String(t)===String(e)}function K(t,e){return t.findIndex(t=>G(t,e))}var $,Z,q=t=>!(!t||!0!==t.__v_isRef),J=t=>_(t)?t:null==t?"":u(t)||y(t)&&(t.toString===w||!v(t.toString))?q(t)?J(t.value):JSON.stringify(t,Q,2):String(t),Q=(t,e)=>q(e)?Q(t,e.value):p(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,i],n)=>(t[tt(e,n)+" =>"]=i,t),{})}:f(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>tt(t))}:m(e)?tt(e):!y(e)||u(e)||S(e)?e:String(e),tt=(t,e="")=>{var i;return m(t)?`Symbol(${null!=(i=t.description)?i:e})`:t},et=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=$,!t&&$&&(this.index=($.scopes||($.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=$;try{return $=this,t()}finally{$=e}}}on(){1===++this._on&&(this.prevScope=$,$=this)}off(){if(this._on>0&&0===--this._on){if($===this)$=this.prevScope;else{let t=$;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 it,nt,rt=new WeakSet,ot=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,$&&$.active&&$.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,rt.has(this)&&(rt.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||at(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,xt(this),ct(this);const t=Z,e=vt;Z=this,vt=!0;try{return this.fn()}finally{dt(this),Z=t,vt=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)ft(t);this.deps=this.depsTail=void 0,xt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?rt.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ut(this)&&this.run()}get dirty(){return ut(this)}},st=0;function at(t,e=!1){if(t.flags|=8,e)return t.next=nt,void(nt=t);t.next=it,it=t}function lt(){st++}function ht(){if(--st>0)return;if(nt){let t=nt;for(nt=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let t;for(;it;){let i=it;for(it=void 0;i;){const n=i.next;if(i.next=void 0,i.flags&=-9,1&i.flags)try{i.trigger()}catch(e){t||(t=e)}i=n}}if(t)throw t}function ct(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function dt(t){let e,i=t.depsTail,n=i;for(;n;){const t=n.prevDep;-1===n.version?(n===i&&(i=t),ft(n),gt(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=t}t.deps=e,t.depsTail=i}function ut(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(pt(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function pt(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||!ut(t)))return;t.flags|=2;const e=t.dep,i=Z,n=vt;Z=t,vt=!0;try{ct(t);const i=t.fn(t._value);(0===e.version||A(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(r){throw e.version++,r}finally{Z=i,vt=n,dt(t),t.flags&=-3}}function ft(t,e=!1){const{dep:i,prevSub:n,nextSub:r}=t;if(n&&(n.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let t=i.computed.deps;t;t=t.nextDep)ft(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 vt=!0,_t=[];function mt(){_t.push(vt),vt=!1}function yt(){const t=_t.pop();vt=void 0===t||t}function xt(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,bt=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}},St=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||!vt||Z===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==Z)e=this.activeLink=new bt(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){lt();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 Et=new WeakMap,Ct=Symbol(""),Ot=Symbol(""),Lt=Symbol("");function Pt(t,e,i){if(vt&&Z){let e=Et.get(t);e||Et.set(t,e=new Map);let n=e.get(i);n||(e.set(i,n=new St),n.map=e,n.key=i),n.track()}}function Tt(t,e,i,n,r,o){const s=Et.get(t);if(!s)return void wt++;const a=t=>{t&&t.trigger()};if(lt(),"clear"===e)s.forEach(a);else{const r=u(t),o=r&&k(i);if(r&&"length"===i){const t=Number(n);s.forEach((e,i)=>{("length"===i||i===Lt||!m(i)&&i>=t)&&a(e)})}else switch((void 0!==i||s.has(void 0))&&a(s.get(i)),o&&a(s.get(Lt)),e){case"add":r?o&&a(s.get("length")):(a(s.get(Ct)),p(t)&&a(s.get(Ot)));break;case"delete":r||(a(s.get(Ct)),p(t)&&a(s.get(Ot)));break;case"set":p(t)&&a(s.get(Ct))}}ht()}function Bt(t){const e=ve(t);return e===t?e:(Pt(e,0,Lt),fe(t)?e:e.map(_e))}function Rt(t){return Pt(t=ve(t),0,Lt),t}function At(t,e){return pe(t)?me(ue(t)?_e(e):e):_e(e)}var Dt={__proto__:null,[Symbol.iterator](){return Mt(this,Symbol.iterator,t=>At(this,t))},concat(...t){return Bt(this).concat(...t.map(t=>u(t)?Bt(t):t))},entries(){return Mt(this,"entries",t=>(t[1]=At(this,t[1]),t))},every(t,e){return Ft(this,"every",t,e,void 0,arguments)},filter(t,e){return Ft(this,"filter",t,e,t=>t.map(t=>At(this,t)),arguments)},find(t,e){return Ft(this,"find",t,e,t=>At(this,t),arguments)},findIndex(t,e){return Ft(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Ft(this,"findLast",t,e,t=>At(this,t),arguments)},findLastIndex(t,e){return Ft(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Ft(this,"forEach",t,e,void 0,arguments)},includes(...t){return zt(this,"includes",t)},indexOf(...t){return zt(this,"indexOf",t)},join(t){return Bt(this).join(t)},lastIndexOf(...t){return zt(this,"lastIndexOf",t)},map(t,e){return Ft(this,"map",t,e,void 0,arguments)},pop(){return Nt(this,"pop")},push(...t){return Nt(this,"push",t)},reduce(t,...e){return Wt(this,"reduce",t,e)},reduceRight(t,...e){return Wt(this,"reduceRight",t,e)},shift(){return Nt(this,"shift")},some(t,e){return Ft(this,"some",t,e,void 0,arguments)},splice(...t){return Nt(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 Nt(this,"unshift",t)},values(){return Mt(this,"values",t=>At(this,t))}};function Mt(t,e,i){const n=Rt(t),r=n[e]();return n===t||fe(t)||(r._next=r.next,r.next=()=>{const t=r._next();return t.done||(t.value=i(t.value)),t}),r}var It=Array.prototype;function Ft(t,e,i,n,r,o){const s=Rt(t),a=s!==t&&!fe(t),l=s[e];if(l!==It[e]){const e=l.apply(t,o);return a?_e(e):e}let h=i;s!==t&&(a?h=function(e,n){return i.call(this,At(t,e),n,t)}:i.length>2&&(h=function(e,n){return i.call(this,e,n,t)}));const c=l.call(s,h,n);return a&&r?r(c):c}function Wt(t,e,i,n){const r=Rt(t);let o=i,s=!1;r!==t&&(r!==t&&!fe(t)?(s=0===n.length,o=function(e,n,r){return s&&(s=!1,e=At(t,e)),i.call(this,e,At(t,n),r,t)}):i.length>3&&(o=function(e,n,r){return i.call(this,e,n,r,t)}));const a=r[e](o,...n);return s?At(t,a):a}function zt(t,e,i){const n=ve(t);Pt(n,0,Lt);const r=n[e](...i);return-1!==r&&!1!==r||!ge(i[0])?r:(i[0]=ve(i[0]),n[e](...i))}function Nt(t,e,i=[]){mt(),lt();const n=ve(t)[e].apply(t,i);return ht(),yt(),n}var jt=t("__proto__,__v_isRef,__isVue"),Vt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(m));function Ht(t){m(t)||(t=String(t));const e=ve(this);return Pt(e,0,t),e.hasOwnProperty(t)}var Ut=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 n=this._isReadonly,r=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return r;if("__v_raw"===e)return i===(n?r?ae:se:r?oe:re).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=u(t);if(!n){let t;if(o&&(t=Dt[e]))return t;if("hasOwnProperty"===e)return Ht}const s=Reflect.get(t,e,ye(t)?t:i);if(m(e)?Vt.has(e):jt(e))return s;if(n||Pt(t,0,e),r)return s;if(ye(s)){const t=o&&k(e)?s:s.value;return n&&y(t)?ce(t):t}return y(s)?n?ce(s):he(s):s}},Yt=class extends Ut{constructor(t=!1){super(!1,t)}set(t,e,i,n){let r=t[e];const o=u(t)&&k(e);if(!this._isShallow){const t=pe(r);if(fe(i)||pe(i)||(r=ve(r),i=ve(i)),!o&&ye(r)&&!ye(i))return t||(r.value=i),!0}const s=o?Number(e)<t.length:d(t,e),a=Reflect.set(t,e,i,ye(t)?t:n);return t===ve(n)&&(s?A(i,r)&&Tt(t,"set",e,i):Tt(t,"add",e,i)),a}deleteProperty(t,e){const i=d(t,e),n=(t[e],Reflect.deleteProperty(t,e));return n&&i&&Tt(t,"delete",e,void 0),n}has(t,e){const i=Reflect.has(t,e);return m(e)&&Vt.has(e)||Pt(t,0,e),i}ownKeys(t){return Pt(t,0,u(t)?"length":Ct),Reflect.ownKeys(t)}},Xt=class extends Ut{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Gt=new Yt,Kt=new Xt,$t=new Yt(!0),Zt=t=>t,qt=t=>Reflect.getPrototypeOf(t);function Jt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Qt(t,e){const i={get(i){const n=this.__v_raw,r=ve(n),o=ve(i);t||(A(i,o)&&Pt(r,0,i),Pt(r,0,o));const{has:s}=qt(r),a=e?Zt:t?me:_e;return s.call(r,i)?a(n.get(i)):s.call(r,o)?a(n.get(o)):void(n!==r&&n.get(i))},get size(){const e=this.__v_raw;return!t&&Pt(ve(e),0,Ct),e.size},has(e){const i=this.__v_raw,n=ve(i),r=ve(e);return t||(A(e,r)&&Pt(n,0,e),Pt(n,0,r)),e===r?i.has(e):i.has(e)||i.has(r)},forEach(i,n){const r=this,o=r.__v_raw,s=e?Zt:t?me:_e;return!t&&Pt(ve(o),0,Ct),o.forEach((t,e)=>i.call(n,s(t),s(e),r))}};return l(i,t?{add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear")}:{add(t){const i=ve(this),n=qt(i),r=ve(t),o=e||fe(t)||pe(t)?t:r;return n.has.call(i,o)||A(t,o)&&n.has.call(i,t)||A(r,o)&&n.has.call(i,r)||(i.add(o),Tt(i,"add",o,o)),this},set(t,i){e||fe(i)||pe(i)||(i=ve(i));const n=ve(this),{has:r,get:o}=qt(n);let s=r.call(n,t);s||(t=ve(t),s=r.call(n,t));const a=o.call(n,t);return n.set(t,i),s?A(i,a)&&Tt(n,"set",t,i):Tt(n,"add",t,i),this},delete(t){const e=ve(this),{has:i,get:n}=qt(e);let r=i.call(e,t);r||(t=ve(t),r=i.call(e,t));n&&n.call(e,t);const o=e.delete(t);return r&&Tt(e,"delete",t,void 0),o},clear(){const t=ve(this),e=0!==t.size,i=t.clear();return e&&Tt(t,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=function(t,e,i){return function(...n){const r=this.__v_raw,o=ve(r),s=p(o),a="entries"===t||t===Symbol.iterator&&s,h="keys"===t&&s,c=r[t](...n),d=i?Zt:e?me:_e;return!e&&Pt(o,0,h?Ot:Ct),l(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}}})}}(n,t,e)}),i}function te(t,e){const i=Qt(t,e);return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(d(i,n)&&n in e?i:e,n,r)}var ee={get:te(!1,!1)},ie={get:te(!1,!0)},ne={get:te(!0,!1)},re=new WeakMap,oe=new WeakMap,se=new WeakMap,ae=new WeakMap;function le(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 pe(t)?t:de(t,!1,Gt,ee,re)}function ce(t){return de(t,!0,Kt,ne,se)}function de(t,e,i,n,r){if(!y(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const o=le(t);if(0===o)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,2===o?n:i);return r.set(t,a),a}function ue(t){return pe(t)?ue(t.__v_raw):!(!t||!t.__v_isReactive)}function pe(t){return!(!t||!t.__v_isReadonly)}function fe(t){return!(!t||!t.__v_isShallow)}function ge(t){return!!t&&!!t.__v_raw}function ve(t){const e=t&&t.__v_raw;return e?ve(e):t}var _e=t=>y(t)?he(t):t,me=t=>y(t)?ce(t):t;function ye(t){return!!t&&!0===t.__v_isRef}function xe(t){return i=!1,ye(e=t)?e:new we(e,i);var e,i}var we=class{constructor(t,e){this.dep=new St,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:ve(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||fe(t)||pe(t);A(t=i?t:ve(t),e)&&(this._rawValue=t,this._value=i?t:_e(t),this.dep.trigger())}};function be(t){return ye(t)?t.value:t}var Se={get:(t,e,i)=>"__v_raw"===e?t:be(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const r=t[e];return ye(r)&&!ye(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function ke(t){return ue(t)?t:new Proxy(t,Se)}var Ee=class{constructor(t,e,i){this.fn=t,this.setter=e,this._value=void 0,this.dep=new St(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 at(this,!0),!0}get value(){const t=this.dep.track();return pt(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};var Ce={},Oe=new WeakMap,Le=void 0;function Pe(t,e,n=i){const{immediate:o,deep:s,once:a,scheduler:l,augmentJob:c,call:d}=n,p=t=>s?t:fe(t)||!1===s||0===s?Te(t,1):Te(t);let f,g,_,m,y=!1,x=!1;if(ye(t)?(g=()=>t.value,y=fe(t)):ue(t)?(g=()=>p(t),y=!0):u(t)?(x=!0,y=t.some(t=>ue(t)||fe(t)),g=()=>t.map(t=>ye(t)?t.value:ue(t)?p(t):v(t)?d?d(t,2):t():void 0)):g=v(t)?e?d?()=>d(t,2):t:()=>{if(_){mt();try{_()}finally{yt()}}const e=Le;Le=f;try{return d?d(t,3,[m]):t(m)}finally{Le=e}}:r,e&&s){const t=g,e=!0===s?1/0:s;g=()=>Te(t(),e)}const w=$,b=()=>{f.stop(),w&&w.active&&h(w.effects,f)};if(a&&e){const t=e;e=(...e)=>{t(...e),b()}}let S=x?new Array(t.length).fill(Ce):Ce;const k=t=>{if(1&f.flags&&(f.dirty||t))if(e){const t=f.run();if(s||y||(x?t.some((t,e)=>A(t,S[e])):A(t,S))){_&&_();const i=Le;Le=f;try{const i=[t,S===Ce?void 0:x&&S[0]===Ce?[]:S,m];S=t,d?d(e,3,i):e(...i)}finally{Le=i}}}else f.run()};return c&&c(k),f=new ot(g),f.scheduler=l?()=>l(k,!1):k,m=t=>function(t,e=!1,i=Le){if(i){let e=Oe.get(i);e||Oe.set(i,e=[]),e.push(t)}}(t,!1,f),_=f.onStop=()=>{const t=Oe.get(f);if(t){if(d)d(t,4);else for(const e of t)e();Oe.delete(f)}},e?o?k(!0):S=f.run():l?l(k.bind(null,!0),!0):f.run(),b.pause=f.pause.bind(f),b.resume=f.resume.bind(f),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--,ye(t))Te(t.value,e,i);else if(u(t))for(let n=0;n<t.length;n++)Te(t[n],e,i);else if(f(t)||p(t))t.forEach(t=>{Te(t,e,i)});else if(S(t)){for(const n in t)Te(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Te(t[n],e,i)}return t}function Be(t,e,i,n){try{return n?t(...n):t()}catch(r){Ae(r,e,i)}}function Re(t,e,i,n){if(v(t)){const r=Be(t,e,i,n);return r&&x(r)&&r.catch(t=>{Ae(t,e,i)}),r}if(u(t)){const r=[];for(let o=0;o<t.length;o++)r.push(Re(t[o],e,i,n));return r}}function Ae(t,e,n,r=!0){e&&e.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||i;if(e){let i=e.parent;const r=e.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const e=i.ec;if(e)for(let i=0;i<e.length;i++)if(!1===e[i](t,r,s))return;i=i.parent}if(o)return mt(),Be(o,null,10,[t,r,s]),void yt()}!function(t,e,i,n=!0,r=!1){if(r)throw t}(t,0,0,r,s)}var De=[],Me=-1,Ie=[],Fe=null,We=0,ze=Promise.resolve(),Ne=null;function je(t){const e=Ne||ze;return t?e.then(this?t.bind(this):t):e}function Ve(t){if(!(1&t.flags)){const e=Xe(t),i=De[De.length-1];!i||!(2&t.flags)&&e>=Xe(i)?De.push(t):De.splice(function(t){let e=Me+1,i=De.length;for(;e<i;){const n=e+i>>>1,r=De[n],o=Xe(r);o<t||o===t&&2&r.flags?e=n+1:i=n}return e}(e),0,t),t.flags|=1,He()}}function He(){Ne||(Ne=ze.then(Ge))}function Ue(t,e,i=Me+1){for(;i<De.length;i++){const e=De[i];if(e&&2&e.flags){if(t&&e.id!==t.uid)continue;De.splice(i,1),i--,4&e.flags&&(e.flags&=-2),e(),4&e.flags||(e.flags&=-2)}}}function Ye(t){if(Ie.length){const t=[...new Set(Ie)].sort((t,e)=>Xe(t)-Xe(e));if(Ie.length=0,Fe)return void Fe.push(...t);for(Fe=t,We=0;We<Fe.length;We++){const t=Fe[We];4&t.flags&&(t.flags&=-2),8&t.flags||t(),t.flags&=-2}Fe=null,We=0}}var Xe=t=>null==t.id?2&t.flags?-1:1/0:t.id;function Ge(t){try{for(Me=0;Me<De.length;Me++){const t=De[Me];!t||8&t.flags||(4&t.flags&&(t.flags&=-2),Be(t,t.i,t.i?15:14),4&t.flags||(t.flags&=-2))}}finally{for(;Me<De.length;Me++){const t=De[Me];t&&(t.flags&=-2)}Me=-1,De.length=0,Ye(),Ne=null,(De.length||Ie.length)&&Ge(t)}}var Ke=null,$e=null;function Ze(t){const e=Ke;return Ke=t,$e=t&&t.type.__scopeId||null,e}function qe(t,e=Ke,i){if(!e)return t;if(t._n)return t;const n=(...i)=>{n._d&&vr(-1);const r=Ze(e);let o;try{o=t(...i)}finally{Ze(r),n._d&&vr(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Je(t,e){if(null===Ke)return t;const n=$r(Ke),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[t,s,a,l=i]=e[o];t&&(v(t)&&(t={mounted:t,updated:t}),t.deep&&Te(s),r.push({dir:t,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function Qe(t,e,i,n){const r=t.dirs,o=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];o&&(a.oldValue=o[s].value);let l=a.dir[n];l&&(mt(),Re(l,i,8,[t.el,a,t,e]),yt())}}function ti(t,e){if(Wr){let i=Wr.provides;const n=Wr.parent&&Wr.parent.provides;n===i&&(i=Wr.provides=Object.create(n)),i[t]=e}}function ei(t,e,i=!1){const n=zr();if(n||Ln){let r=Ln?Ln._context.provides:n?null==n.parent||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return i&&v(e)?e.call(n&&n.proxy):e}}var ii=Symbol.for("v-scx");function ni(t,e,i){return ri(t,e,i)}function ri(t,e,n=i){const{immediate:o,deep:s,flush:a,once:h}=n,c=l({},n),d=e&&o||!e&&"post"!==a;let u;if(Yr)if("sync"===a){const t=ei(ii);u=t.__watcherHandles||(t.__watcherHandles=[])}else if(!d){const t=()=>{};return t.stop=r,t.resume=r,t.pause=r,t}const p=Wr;c.call=(t,e,i)=>Re(t,p,e,i);let f=!1;"post"===a?c.scheduler=t=>{Qn(t,p&&p.suspense)}:"sync"!==a&&(f=!0,c.scheduler=(t,e)=>{e?t():Ve(t)}),c.augmentJob=t=>{e&&(t.flags|=4),f&&(t.flags|=2,p&&(t.id=p.uid,t.i=p))};const g=Pe(t,e,c);return Yr&&(u?u.push(g):d&&g()),g}function oi(t,e,i){const n=this.proxy,r=_(t)?t.includes(".")?si(n,t):()=>n[t]:t.bind(n,n);let o;v(e)?o=e:(o=e.handler,i=e);const s=Nr(this),a=ri(r,o.bind(n),i);return s(),a}function si(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 ai=new WeakMap,li=Symbol("_vte"),hi=t=>t.__isTeleport,ci=t=>t&&(t.disabled||""===t.disabled),di=t=>"undefined"!=typeof SVGElement&&t instanceof SVGElement,ui=t=>"function"==typeof MathMLElement&&t instanceof MathMLElement,pi=(t,e)=>{const i=t&&t.to;return _(i)?e?e(i):null:i},fi={name:"Teleport",__isTeleport:!0,process(t,e,i,n,r,o,s,a,l,h){const{mc:c,pc:d,pbc:u,o:{insert:p,querySelector:f,createText:g,createComment:v,parentNode:_}}=h,m=ci(e.props);let{dynamicChildren:y}=e;const x=(t,e,i)=>{16&t.shapeFlag&&c(t.children,e,i,r,o,s,a,l)},w=(t=e)=>{const i=ci(t.props),n=t.target=pi(t.props,f),o=mi(n,t,g,p);n&&("svg"!==s&&di(n)?s="svg":"mathml"!==s&&ui(n)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(n),i||(x(t,n,o),_i(t,!1)))},b=t=>{const e=()=>{ai.get(t)===e&&(ai.delete(t),ci(t.props)&&(x(t,_(t.el)||i,t.anchor),_i(t,!0)),w(t))};ai.set(t,e),Qn(e,o)};if(null==t){const t=e.el=g(""),r=e.anchor=g("");if(p(t,i,n),p(r,i,n),(S=e.props)&&(S.defer||""===S.defer)||o&&o.pendingBranch)return void b(e);m&&(x(e,i,r),_i(e,!0)),w()}else{e.el=t.el;const n=e.anchor=t.anchor,c=ai.get(t);if(c)return c.flags|=8,ai.delete(t),void b(e);e.targetStart=t.targetStart;const p=e.target=t.target,g=e.targetAnchor=t.targetAnchor,v=ci(t.props),_=v?i:p,x=v?n:g;if("svg"===s||di(p)?s="svg":("mathml"===s||ui(p))&&(s="mathml"),y?(u(t.dynamicChildren,y,_,r,o,s,a),nr(t,e,!0)):l||d(t,e,_,x,r,o,s,a,!1),m)v?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):gi(e,i,n,h,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const t=e.target=pi(e.props,f);t&&gi(e,t,null,h,0)}else v&&gi(e,p,g,h,1);_i(e,m)}var S},remove(t,e,i,{um:n,o:{remove:r}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:h,targetAnchor:c,target:d,props:u}=t;let p=o||!ci(u);const f=ai.get(t);if(f&&(f.flags|=8,ai.delete(t),p=!1),d&&(r(h),r(c)),o&&r(l),16&s)for(let g=0;g<a.length;g++){const t=a[g];n(t,e,i,p,!!t.dynamicChildren)}},move:gi,hydrate:function(t,e,i,n,r,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:h,createText:c}},d){function u(t,i){let n=i;for(;n;){if(n&&8===n.nodeType)if("teleport start anchor"===n.data)e.targetStart=n;else if("teleport anchor"===n.data){e.targetAnchor=n,t._lpa=e.targetAnchor&&s(e.targetAnchor);break}n=s(n)}}function p(t,e){e.anchor=d(s(t),e,a(t),i,n,r,o)}const f=e.target=pi(e.props,l),g=ci(e.props);if(f){const l=f._lpa||f.firstChild;16&e.shapeFlag&&(g?(p(t,e),u(f,l),e.targetAnchor||mi(f,e,c,h,a(t)===f?t:null)):(e.anchor=s(t),u(f,l),e.targetAnchor||mi(f,e,c,h),d(l&&s(l),e,f,i,n,r,o))),_i(e,g)}else g&&16&e.shapeFlag&&(p(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}};function gi(t,e,i,{o:{insert:n},m:r},o=2){0===o&&n(t.targetAnchor,e,i);const{el:s,anchor:a,shapeFlag:l,children:h,props:c}=t,d=2===o;if(d&&n(s,e,i),!ai.has(t)&&(!d||ci(c))&&16&l)for(let u=0;u<h.length;u++)r(h[u],e,i,2);d&&n(a,e,i)}var vi=fi;function _i(t,e){const i=t.ctx;if(i&&i.ut){let n,r;for(e?(n=t.el,r=t.anchor):(n=t.targetStart,r=t.targetAnchor);n&&n!==r;)1===n.nodeType&&n.setAttribute("data-v-owner",i.uid),n=n.nextSibling;i.ut()}}function mi(t,e,i,n,r=null){const o=e.targetStart=i(""),s=e.targetAnchor=i("");return o[li]=s,t&&(n(o,t,r),n(s,t,r)),s}var yi=Symbol("_leaveCb"),xi=Symbol("_enterCb");var wi=[Function,Array],bi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:wi,onEnter:wi,onAfterEnter:wi,onEnterCancelled:wi,onBeforeLeave:wi,onLeave:wi,onAfterLeave:wi,onLeaveCancelled:wi,onBeforeAppear:wi,onAppear:wi,onAfterAppear:wi,onAppearCancelled:wi},Si=t=>{const e=t.subTree;return e.component?Si(e.component):e};function ki(t){let e=t[0];if(t.length>1)for(const i of t)if(i.type!==cr){e=i;break}return e}var Ei={name:"BaseTransition",props:bi,setup(t,{slots:e}){const i=zr(),n=function(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Gi(()=>{t.isMounted=!0}),Zi(()=>{t.isUnmounting=!0}),t}();return()=>{const r=e.default&&Bi(e.default(),!0),o=r&&r.length?ki(r):i.subTree?Pr():void 0;if(!o)return;const s=ve(t),{mode:a}=s;if(n.isLeaving)return Li(o);const l=Pi(o);if(!l)return Li(o);let h=Oi(l,s,n,i,t=>h=t);l.type!==cr&&Ti(l,h);let c=i.subTree&&Pi(i.subTree);if(c&&c.type!==cr&&!wr(c,l)&&Si(i).type!==cr){let t=Oi(c,s,n,i);if(Ti(c,t),"out-in"===a&&l.type!==cr)return n.isLeaving=!0,t.afterLeave=()=>{n.isLeaving=!1,8&i.job.flags||i.update(),delete t.afterLeave,c=void 0},Li(o);"in-out"===a&&l.type!==cr?t.delayLeave=(t,e,i)=>{Ci(n,c)[String(c.key)]=c,t[yi]=()=>{e(),t[yi]=void 0,delete h.delayedLeave,c=void 0},h.delayedLeave=()=>{i(),delete h.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function Ci(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function Oi(t,e,i,n,r){const{appear:o,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:h,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:g,onLeaveCancelled:v,onBeforeAppear:_,onAppear:m,onAfterAppear:y,onAppearCancelled:x}=e,w=String(t.key),b=Ci(i,t),S=(t,e)=>{t&&Re(t,n,9,e)},k=(t,e)=>{const i=e[1];S(t,e),u(t)?t.every(t=>t.length<=1)&&i():t.length<=1&&i()},E={mode:s,persisted:a,beforeEnter(e){let n=l;if(!i.isMounted){if(!o)return;n=_||l}e[yi]&&e[yi](!0);const r=b[w];r&&wr(t,r)&&r.el[yi]&&r.el[yi](),S(n,[e])},enter(e){if(b[w]===t)return;let n=h,r=c,s=d;if(!i.isMounted){if(!o)return;n=m||h,r=y||c,s=x||d}let a=!1;e[xi]=t=>{a||(a=!0,S(t?s:r,[e]),E.delayedLeave&&E.delayedLeave(),e[xi]=void 0)};const l=e[xi].bind(null,!1);n?k(n,[e,l]):l()},leave(e,n){const r=String(t.key);if(e[xi]&&e[xi](!0),i.isUnmounting)return n();S(p,[e]);let o=!1;e[yi]=i=>{o||(o=!0,n(),S(i?v:g,[e]),e[yi]=void 0,b[r]===t&&delete b[r])};const s=e[yi].bind(null,!1);b[r]=t,f?k(f,[e,s]):s()},clone(t){const o=Oi(t,e,i,n,r);return r&&r(o),o}};return E}function Li(t){if(zi(t))return(t=Cr(t)).children=null,t}function Pi(t){if(!zi(t))return hi(t.type)&&t.children?ki(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:i}=t;if(i){if(16&e)return i[0];if(32&e&&v(i.default))return i.default()}}function Ti(t,e){6&t.shapeFlag&&t.component?(t.transition=e,Ti(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 Bi(t,e=!1,i){let n=[],r=0;for(let o=0;o<t.length;o++){let s=t[o];const a=null==i?s.key:String(i)+String(null!=s.key?s.key:o);s.type===lr?(128&s.patchFlag&&r++,n=n.concat(Bi(s.children,e,a))):(e||s.type!==cr)&&n.push(null!=a?Cr(s,{key:a}):s)}if(r>1)for(let o=0;o<n.length;o++)n[o].patchFlag=-2;return n}function Ri(t,e){return v(t)?l({name:t.name},e,{setup:t}):t}function Ai(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Di(t,e){let i;return!(!(i=Object.getOwnPropertyDescriptor(t,e))||i.configurable)}var Mi=new WeakMap;function Ii(t,e,n,r,s=!1){if(u(t))return void t.forEach((t,i)=>Ii(t,e&&(u(e)?e[i]:e),n,r,s));if(Wi(r)&&!s)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&Ii(t,e,n,r.component.subTree));const a=4&r.shapeFlag?$r(r.component):r.el,l=s?null:a,{i:c,r:p}=t,f=e&&e.r,g=c.refs===i?c.refs={}:c.refs,m=c.setupState,y=ve(m),x=m===i?o:t=>!Di(g,t)&&d(y,t),w=(t,e)=>!e||!Di(g,e);if(null!=f&&f!==p)if(Fi(e),_(f))g[f]=null,x(f)&&(m[f]=null);else if(ye(f)){const t=e;w(0,t.k)&&(f.value=null),t.k&&(g[t.k]=null)}if(v(p))Be(p,c,12,[l,g]);else{const e=_(p),i=ye(p);if(e||i){const r=()=>{if(t.f){const i=e?x(p)?m[p]:g[p]:w()||!t.k?p.value:g[t.k];if(s)u(i)&&h(i,a);else if(u(i))i.includes(a)||i.push(a);else if(e)g[p]=[a],x(p)&&(m[p]=g[p]);else{const e=[a];w(0,t.k)&&(p.value=e),t.k&&(g[t.k]=e)}}else e?(g[p]=l,x(p)&&(m[p]=l)):i&&(w(0,t.k)&&(p.value=l),t.k&&(g[t.k]=l))};if(l){const e=()=>{r(),Mi.delete(t)};e.id=-1,Mi.set(t,e),Qn(e,n)}else Fi(t),r()}}}function Fi(t){const e=Mi.get(t);e&&(e.flags|=8,Mi.delete(t))}F().requestIdleCallback,F().cancelIdleCallback;var Wi=t=>!!t.type.__asyncLoader,zi=t=>t.type.__isKeepAlive;function Ni(t,e){Vi(t,"a",e)}function ji(t,e){Vi(t,"da",e)}function Vi(t,e,i=Wr){const n=t.__wdc||(t.__wdc=()=>{let e=i;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(Ui(e,n,i),i){let t=i.parent;for(;t&&t.parent;)zi(t.parent.vnode)&&Hi(n,e,i,t),t=t.parent}}function Hi(t,e,i,n){const r=Ui(e,t,n,!0);qi(()=>{h(n[e],r)},i)}function Ui(t,e,i=Wr,n=!1){if(i){const r=i[t]||(i[t]=[]),o=e.__weh||(e.__weh=(...n)=>{mt();const r=Nr(i),o=Re(e,i,t,n);return r(),yt(),o});return n?r.unshift(o):r.push(o),o}}var Yi=t=>(e,i=Wr)=>{Yr&&"sp"!==t||Ui(t,(...t)=>e(...t),i)},Xi=Yi("bm"),Gi=Yi("m"),Ki=Yi("bu"),$i=Yi("u"),Zi=Yi("bum"),qi=Yi("um"),Ji=Yi("sp"),Qi=Yi("rtg"),tn=Yi("rtc");function en(t,e=Wr){Ui("ec",t,e)}var nn="components";function rn(t,e){return function(t,e,i=!0,n=!1){const r=Ke||Wr;if(r){const i=r.type;if(t===nn){const t=function(t,e=!0){return v(t)?t.displayName||t.name:t.name||e&&t.__name}(i,!1);if(t&&(t===e||t===L(e)||t===B(L(e))))return i}const o=sn(r[t]||i[t],e)||sn(r.appContext[t],e);return!o&&n?i:o}}(nn,t,!0,e)||t}var on=Symbol.for("v-ndc");function sn(t,e){return t&&(t[e]||t[L(e)]||t[B(L(e))])}function an(t,e,i,n){let r;const o=i&&i[n],s=u(t);if(s||_(t)){let i=!1,n=!1;s&&ue(t)&&(i=!fe(t),n=pe(t),t=Rt(t)),r=new Array(t.length);for(let s=0,a=t.length;s<a;s++)r[s]=e(i?n?me(_e(t[s])):_e(t[s]):t[s],s,void 0,o&&o[s])}else if("number"==typeof t){r=new Array(t);for(let i=0;i<t;i++)r[i]=e(i+1,i,void 0,o&&o[i])}else if(y(t))if(t[Symbol.iterator])r=Array.from(t,(t,i)=>e(t,i,void 0,o&&o[i]));else{const i=Object.keys(t);r=new Array(i.length);for(let n=0,s=i.length;n<s;n++){const s=i[n];r[n]=e(t[s],s,n,o&&o[n])}}else r=[];return i&&(i[n]=r),r}var ln=t=>t?Vr(t)?$r(t):ln(t.parent):null,hn=l(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=>ln(t.parent),$root:t=>ln(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>_n(t),$forceUpdate:t=>t.f||(t.f=()=>{Ve(t.update)}),$nextTick:t=>t.n||(t.n=je.bind(t.proxy)),$watch:t=>oi.bind(t)}),cn=(t,e)=>t!==i&&!t.__isScriptSetup&&d(t,e),dn={get({_:t},e){if("__v_skip"===e)return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:a,type:l,appContext:h}=t;if("$"!==e[0]){const t=a[e];if(void 0!==t)switch(t){case 1:return r[e];case 2:return o[e];case 4:return n[e];case 3:return s[e]}else{if(cn(r,e))return a[e]=1,r[e];if(o!==i&&d(o,e))return a[e]=2,o[e];if(d(s,e))return a[e]=3,s[e];if(n!==i&&d(n,e))return a[e]=4,n[e];pn&&(a[e]=0)}}const c=hn[e];let u,p;return c?("$attrs"===e&&Pt(t.attrs,0,""),c(t)):(u=l.__cssModules)&&(u=u[e])?u:n!==i&&d(n,e)?(a[e]=4,n[e]):(p=h.config.globalProperties,d(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:r,setupState:o,ctx:s}=t;return cn(o,e)?(o[e]=n,!0):r!==i&&d(r,e)?(r[e]=n,!0):!d(t.props,e)&&(("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0))},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,props:s,type:a}},l){let h;return!!(n[l]||t!==i&&"$"!==l[0]&&d(t,l)||cn(e,l)||d(s,l)||d(r,l)||d(hn,l)||d(o.config.globalProperties,l)||(h=a.__cssModules)&&h[l])},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 un(t){return u(t)?t.reduce((t,e)=>(t[e]=null,t),{}):t}var pn=!0;function fn(t){const e=_n(t),i=t.proxy,n=t.ctx;pn=!1,e.beforeCreate&&gn(e.beforeCreate,t,"bc");const{data:o,computed:s,methods:a,watch:l,provide:h,inject:c,created:d,beforeMount:p,mounted:f,beforeUpdate:g,updated:_,activated:m,deactivated:x,beforeDestroy:w,beforeUnmount:b,destroyed:S,unmounted:k,render:E,renderTracked:C,renderTriggered:O,errorCaptured:L,serverPrefetch:P,expose:T,inheritAttrs:B,components:R,directives:A,filters:D}=e;if(c&&function(t,e){u(t)&&(t=wn(t));for(const i in t){const n=t[i];let r;r=y(n)?"default"in n?ei(n.from||i,n.default,!0):ei(n.from||i):ei(n),ye(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:t=>r.value=t}):e[i]=r}}(c,n,null),a)for(const r in a){const t=a[r];v(t)&&(n[r]=t.bind(i))}if(o){const e=o.call(i,i);y(e)&&(t.data=he(e))}if(pn=!0,s)for(const u in s){const t=s[u],e=Zr({get:v(t)?t.bind(i,i):v(t.get)?t.get.bind(i,i):r,set:!v(t)&&v(t.set)?t.set.bind(i):r});Object.defineProperty(n,u,{enumerable:!0,configurable:!0,get:()=>e.value,set:t=>e.value=t})}if(l)for(const r in l)vn(l[r],n,i,r);if(h){const t=v(h)?h.call(i):h;Reflect.ownKeys(t).forEach(e=>{ti(e,t[e])})}function M(t,e){u(e)?e.forEach(e=>t(e.bind(i))):e&&t(e.bind(i))}if(d&&gn(d,t,"c"),M(Xi,p),M(Gi,f),M(Ki,g),M($i,_),M(Ni,m),M(ji,x),M(en,L),M(tn,C),M(Qi,O),M(Zi,b),M(qi,k),M(Ji,P),u(T))if(T.length){const e=t.exposed||(t.exposed={});T.forEach(t=>{Object.defineProperty(e,t,{get:()=>i[t],set:e=>i[t]=e,enumerable:!0})})}else t.exposed||(t.exposed={});E&&t.render===r&&(t.render=E),null!=B&&(t.inheritAttrs=B),R&&(t.components=R),A&&(t.directives=A),P&&Ai(t)}function gn(t,e,i){Re(u(t)?t.map(t=>t.bind(e.proxy)):t.bind(e.proxy),e,i)}function vn(t,e,i,n){let r=n.includes(".")?si(i,n):()=>i[n];if(_(t)){const i=e[t];v(i)&&ni(r,i)}else if(v(t))ni(r,t.bind(i));else if(y(t))if(u(t))t.forEach(t=>vn(t,e,i,n));else{const n=v(t.handler)?t.handler.bind(i):e[t.handler];v(n)&&ni(r,n,t)}}function _n(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,a=o.get(e);let l;return a?l=a:r.length||i||n?(l={},r.length&&r.forEach(t=>mn(l,t,s,!0)),mn(l,e,s)):l=e,y(e)&&o.set(e,l),l}function mn(t,e,i,n=!1){const{mixins:r,extends:o}=e;o&&mn(t,o,i,!0),r&&r.forEach(e=>mn(t,e,i,!0));for(const s in e)if(n&&"expose"===s);else{const n=yn[s]||i&&i[s];t[s]=n?n(t[s],e[s]):e[s]}return t}var yn={data:xn,props:kn,emits:kn,methods:Sn,computed:Sn,beforeCreate:bn,created:bn,beforeMount:bn,mounted:bn,beforeUpdate:bn,updated:bn,beforeDestroy:bn,beforeUnmount:bn,destroyed:bn,unmounted:bn,activated:bn,deactivated:bn,errorCaptured:bn,serverPrefetch:bn,components:Sn,directives:Sn,watch:function(t,e){if(!t)return e;if(!e)return t;const i=l(Object.create(null),t);for(const n in e)i[n]=bn(t[n],e[n]);return i},provide:xn,inject:function(t,e){return Sn(wn(t),wn(e))}};function xn(t,e){return e?t?function(){return l(v(t)?t.call(this,this):t,v(e)?e.call(this,this):e)}:e:t}function wn(t){if(u(t)){const e={};for(let i=0;i<t.length;i++)e[t[i]]=t[i];return e}return t}function bn(t,e){return t?[...new Set([].concat(t,e))]:e}function Sn(t,e){return t?l(Object.create(null),t,e):e}function kn(t,e){return t?u(t)&&u(e)?[...new Set([...t,...e])]:l(Object.create(null),un(t),un(null!=e?e:{})):e}function En(){return{app:null,config:{isNativeTag:o,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 Cn=0;function On(t,e){return function(i,n=null){v(i)||(i=l({},i)),null==n||y(n)||(n=null);const r=En(),o=new WeakSet,s=[];let a=!1;const h=r.app={_uid:Cn++,_component:i,_props:n,_container:null,_context:r,_instance:null,version:qr,get config(){return r.config},set config(t){},use:(t,...e)=>(o.has(t)||(t&&v(t.install)?(o.add(t),t.install(h,...e)):v(t)&&(o.add(t),t(h,...e))),h),mixin:t=>(r.mixins.includes(t)||r.mixins.push(t),h),component:(t,e)=>e?(r.components[t]=e,h):r.components[t],directive:(t,e)=>e?(r.directives[t]=e,h):r.directives[t],mount(o,s,l){if(!a){const c=h._ceVNode||Er(i,n);return c.appContext=r,!0===l?l="svg":!1===l&&(l=void 0),s&&e?e(c,o):t(c,o,l),a=!0,h._container=o,o.__vue_app__=h,$r(c.component)}},onUnmount(t){s.push(t)},unmount(){a&&(Re(s,h._instance,16),t(null,h._container),delete h._container.__vue_app__)},provide:(t,e)=>(r.provides[t]=e,h),runWithContext(t){const e=Ln;Ln=h;try{return t()}finally{Ln=e}}};return h}}var Ln=null;function Pn(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||i;let o=n;const s=e.startsWith("update:"),a=s&&((t,e)=>"modelValue"===e||"model-value"===e?t.modelModifiers:t[`${e}Modifiers`]||t[`${L(e)}Modifiers`]||t[`${T(e)}Modifiers`])(r,e.slice(7));let l;a&&(a.trim&&(o=n.map(t=>_(t)?t.trim():t)),a.number&&(o=n.map(I)));let h=r[l=R(e)]||r[l=R(L(e))];!h&&s&&(h=r[l=R(T(e))]),h&&Re(h,t,6,o);const c=r[l+"Once"];if(c){if(t.emitted){if(t.emitted[l])return}else t.emitted={};t.emitted[l]=!0,Re(c,t,6,o)}}var Tn=new WeakMap;function Bn(t,e,i=!1){const n=i?Tn:e.emitsCache,r=n.get(t);if(void 0!==r)return r;const o=t.emits;let s={},a=!1;if(!v(t)){const n=t=>{const i=Bn(t,e,!0);i&&(a=!0,l(s,i))};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}return o||a?(u(o)?o.forEach(t=>s[t]=null):l(s,o),y(t)&&n.set(t,s),s):(y(t)&&n.set(t,null),null)}function Rn(t,e){return!(!t||!s(e))&&(e=e.slice(2).replace(/Once$/,""),d(t,e[0].toLowerCase()+e.slice(1))||d(t,T(e))||d(t,e))}function An(t){const{type:e,vnode:i,proxy:n,withProxy:r,propsOptions:[o],slots:s,attrs:l,emit:h,render:c,renderCache:d,props:u,data:p,setupState:f,ctx:g,inheritAttrs:v}=t,_=Ze(t);let m,y;try{if(4&i.shapeFlag){const t=r||n,e=t;m=Tr(c.call(e,t,d,u,f,p,g)),y=l}else{const t=e;m=Tr(t.length>1?t(u,{attrs:l,slots:s,emit:h}):t(u,null)),y=e.props?l:Dn(l)}}catch(w){ur.length=0,Ae(w,t,1),m=Er(cr)}let x=m;if(y&&!1!==v){const t=Object.keys(y),{shapeFlag:e}=x;t.length&&7&e&&(o&&t.some(a)&&(y=Mn(y,o)),x=Cr(x,y,!1,!0))}return i.dirs&&(x=Cr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(i.dirs):i.dirs),i.transition&&Ti(x,i.transition),m=x,Ze(_),m}var Dn=t=>{let e;for(const i in t)("class"===i||"style"===i||s(i))&&((e||(e={}))[i]=t[i]);return e},Mn=(t,e)=>{const i={};for(const n in t)a(n)&&n.slice(9)in e||(i[n]=t[n]);return i};function In(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(Fn(e,t,o)&&!Rn(i,o))return!0}return!1}function Fn(t,e,i){const n=t[i],r=e[i];return"style"===i&&y(n)&&y(r)?!G(n,r):n!==r}var Wn={},zn=()=>Object.create(Wn),Nn=t=>Object.getPrototypeOf(t)===Wn;function jn(t,e,i,n=!1){const r={},o=zn();t.propsDefaults=Object.create(null),Vn(t,e,r,o);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);i?t.props=n?r:de(r,!1,$t,ie,oe):t.type.props?t.props=r:t.props=o,t.attrs=o}function Vn(t,e,n,r){const[o,s]=t.propsOptions;let a,l=!1;if(e)for(let i in e){if(E(i))continue;const h=e[i];let c;o&&d(o,c=L(i))?s&&s.includes(c)?(a||(a={}))[c]=h:n[c]=h:Rn(t.emitsOptions,i)||i in r&&h===r[i]||(r[i]=h,l=!0)}if(s){const e=ve(n),r=a||i;for(let i=0;i<s.length;i++){const a=s[i];n[a]=Hn(o,e,a,r[a],t,!d(r,a))}}return l}function Hn(t,e,i,n,r,o){const s=t[i];if(null!=s){const t=d(s,"default");if(t&&void 0===n){const t=s.default;if(s.type!==Function&&!s.skipFactory&&v(t)){const{propsDefaults:o}=r;if(i in o)n=o[i];else{const s=Nr(r);n=o[i]=t.call(null,e),s()}}else n=t;r.ce&&r.ce._setProp(i,n)}s[0]&&(o&&!t?n=!1:!s[1]||""!==n&&n!==T(i)||(n=!0))}return n}var Un=new WeakMap;function Yn(t,e,r=!1){const o=r?Un:e.propsCache,s=o.get(t);if(s)return s;const a=t.props,h={},c=[];let p=!1;if(!v(t)){const i=t=>{p=!0;const[i,n]=Yn(t,e,!0);l(h,i),n&&c.push(...n)};!r&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!a&&!p)return y(t)&&o.set(t,n),n;if(u(a))for(let n=0;n<a.length;n++){const t=L(a[n]);Xn(t)&&(h[t]=i)}else if(a)for(const i in a){const t=L(i);if(Xn(t)){const e=a[i],n=h[t]=u(e)||v(e)?{type:e}:l({},e),r=n.type;let o=!1,s=!0;if(u(r))for(let t=0;t<r.length;++t){const e=r[t],i=v(e)&&e.name;if("Boolean"===i){o=!0;break}"String"===i&&(s=!1)}else o=v(r)&&"Boolean"===r.name;n[0]=o,n[1]=s,(o||d(n,"default"))&&c.push(t)}}const f=[h,c];return y(t)&&o.set(t,f),f}function Xn(t){return"$"!==t[0]&&!E(t)}var Gn=t=>"_"===t||"_ctx"===t||"$stable"===t,Kn=t=>u(t)?t.map(Tr):[Tr(t)],$n=(t,e,i)=>{if(e._n)return e;const n=qe((...t)=>Kn(e(...t)),i);return n._c=!1,n},Zn=(t,e,i)=>{const n=t._ctx;for(const r in t){if(Gn(r))continue;const i=t[r];if(v(i))e[r]=$n(0,i,n);else if(null!=i){const t=Kn(i);e[r]=()=>t}}},qn=(t,e)=>{const i=Kn(e);t.slots.default=()=>i},Jn=(t,e,i)=>{for(const n in e)!i&&Gn(n)||(t[n]=e[n])};var Qn=function(t,e){e&&e.pendingBranch?u(t)?e.effects.push(...t):e.effects.push(t):(i=t,u(i)?Ie.push(...i):Fe&&-1===i.id?Fe.splice(We+1,0,i):1&i.flags||(Ie.push(i),i.flags|=1),He());var i};function tr(t){return function(t,e){F().__VUE__=!0;const{insert:o,remove:s,patchProp:a,createElement:l,createText:h,createComment:c,setText:u,setElementText:p,parentNode:f,nextSibling:g,setScopeId:v=r,insertStaticContent:_}=t,m=(t,e,i,n=null,r=null,o=null,s=void 0,a=null,l=!!e.dynamicChildren)=>{if(t===e)return;t&&!wr(t,e)&&(n=Q(t),K(t,r,o,!0),t=null),-2===e.patchFlag&&(l=!1,e.dynamicChildren=null);const{type:h,ref:c,shapeFlag:d}=e;switch(h){case hr:y(t,e,i,n);break;case cr:w(t,e,i,n);break;case dr:null==t&&b(e,i,n,s);break;case lr:W(t,e,i,n,r,o,s,a,l);break;default:1&d?C(t,e,i,n,r,o,s,a,l):6&d?z(t,e,i,n,r,o,s,a,l):(64&d||128&d)&&h.process(t,e,i,n,r,o,s,a,l,nt)}null!=c&&r?Ii(c,t&&t.ref,o,e||t,!e):null==c&&t&&null!=t.ref&&Ii(t.ref,null,o,t,!0)},y=(t,e,i,n)=>{if(null==t)o(e.el=h(e.children),i,n);else{const i=e.el=t.el;e.children!==t.children&&u(i,e.children)}},w=(t,e,i,n)=>{null==t?o(e.el=c(e.children||""),i,n):e.el=t.el},b=(t,e,i,n)=>{[t.el,t.anchor]=_(t.children,e,i,n,t.el,t.anchor)},S=({el:t,anchor:e},i,n)=>{let r;for(;t&&t!==e;)r=g(t),o(t,i,n),t=r;o(e,i,n)},k=({el:t,anchor:e})=>{let i;for(;t&&t!==e;)i=g(t),s(t),t=i;s(e)},C=(t,e,i,n,r,o,s,a,l)=>{if("svg"===e.type?s="svg":"math"===e.type&&(s="mathml"),null==t)O(e,i,n,r,o,s,a,l);else{const i=t.el&&t.el._isVueCE?t.el:null;try{i&&i._beginPatch(),R(t,e,r,o,s,a,l)}finally{i&&i._endPatch()}}},O=(t,e,i,n,r,s,h,c)=>{let d,u;const{props:f,shapeFlag:g,transition:v,dirs:_}=t;if(d=t.el=l(t.type,s,f&&f.is,f),8&g?p(d,t.children):16&g&&B(t.children,d,null,n,r,er(t,s),h,c),_&&Qe(t,null,n,"created"),P(d,t,t.scopeId,h,n),f){for(const t in f)"value"===t||E(t)||a(d,t,null,f[t],s,n);"value"in f&&a(d,"value",null,f.value,s),(u=f.onVnodeBeforeMount)&&Ar(u,n,t)}_&&Qe(t,null,n,"beforeMount");const m=function(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}(r,v);m&&v.beforeEnter(d),o(d,e,i),((u=f&&f.onVnodeMounted)||m||_)&&Qn(()=>{try{u&&Ar(u,n,t),m&&v.enter(d),_&&Qe(t,null,n,"mounted")}finally{}},r)},P=(t,e,i,n,r)=>{if(i&&v(t,i),n)for(let o=0;o<n.length;o++)v(t,n[o]);if(r){let i=r.subTree;if(e===i||ar(i.type)&&(i.ssContent===e||i.ssFallback===e)){const e=r.vnode;P(t,e,e.scopeId,e.slotScopeIds,r.parent)}}},B=(t,e,i,n,r,o,s,a,l=0)=>{for(let h=l;h<t.length;h++)m(null,t[h]=a?Br(t[h]):Tr(t[h]),e,i,n,r,o,s,a)},R=(t,e,n,r,o,s,l)=>{const h=e.el=t.el;let{patchFlag:c,dynamicChildren:d,dirs:u}=e;c|=16&t.patchFlag;const f=t.props||i,g=e.props||i;let v;if(n&&ir(n,!1),(v=g.onVnodeBeforeUpdate)&&Ar(v,n,e,t),u&&Qe(e,t,n,"beforeUpdate"),n&&ir(n,!0),(f.innerHTML&&null==g.innerHTML||f.textContent&&null==g.textContent)&&p(h,""),d?A(t.dynamicChildren,d,h,n,r,er(e,o),s):l||U(t,e,h,null,n,r,er(e,o),s,!1),c>0){if(16&c)I(h,f,g,n,o);else if(2&c&&f.class!==g.class&&a(h,"class",null,g.class,o),4&c&&a(h,"style",f.style,g.style,o),8&c){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e],r=f[i],s=g[i];s===r&&"value"!==i||a(h,i,r,s,o,n)}}1&c&&t.children!==e.children&&p(h,e.children)}else l||null!=d||I(h,f,g,n,o);((v=g.onVnodeUpdated)||u)&&Qn(()=>{v&&Ar(v,n,e,t),u&&Qe(e,t,n,"updated")},r)},A=(t,e,i,n,r,o,s)=>{for(let a=0;a<e.length;a++){const l=t[a],h=e[a];m(l,h,l.el&&(l.type===lr||!wr(l,h)||198&l.shapeFlag)?f(l.el):i,null,n,r,o,s,!0)}},I=(t,e,n,r,o)=>{if(e!==n){if(e!==i)for(const i in e)E(i)||i in n||a(t,i,e[i],null,o,r);for(const i in n){if(E(i))continue;const s=n[i],l=e[i];s!==l&&"value"!==i&&a(t,i,l,s,o,r)}"value"in n&&a(t,"value",e.value,n.value,o)}},W=(t,e,i,n,r,s,a,l,c)=>{const d=e.el=t?t.el:h(""),u=e.anchor=t?t.anchor:h("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:g}=e;g&&(l=l?l.concat(g):g),null==t?(o(d,i,n),o(u,i,n),B(e.children||[],i,u,r,s,a,l,c)):p>0&&64&p&&f&&t.dynamicChildren&&t.dynamicChildren.length===f.length?(A(t.dynamicChildren,f,i,r,s,a,l),(null!=e.key||r&&e===r.subTree)&&nr(t,e,!0)):U(t,e,i,u,r,s,a,l,c)},z=(t,e,i,n,r,o,s,a,l)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?r.ctx.activate(e,i,n,s,l):N(e,i,n,r,o,s,l):j(t,e,l)},N=(t,e,n,r,o,s,a)=>{const l=t.component=function(t,e,n){const r=t.type,o=(e?e.appContext:t.appContext)||Dr,s={uid:Mr++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new et(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Yn(r,o),emitsOptions:Bn(r,o),emit:null,emitted:null,propsDefaults:i,inheritAttrs:r.inheritAttrs,ctx:i,data:i,props:i,attrs:i,slots:i,refs:i,setupState:i,setupContext:null,suspense:n,suspenseId:n?n.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};s.ctx={_:s},s.root=e?e.root:s,s.emit=Pn.bind(null,s),t.ce&&t.ce(s);return s}(t,r,o);if(zi(t)&&(l.ctx.renderer=nt),function(t,e=!1,i=!1){e&&Fr(e);const{props:n,children:r}=t.vnode,o=Vr(t);jn(t,n,o,e),((t,e,i)=>{const n=t.slots=zn();if(32&t.vnode.shapeFlag){const t=e._;t?(Jn(n,e,i),i&&M(n,"_",t,!0)):Zn(e,n)}else e&&qn(t,e)})(t,r,i||e);const s=o?function(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,dn);const{setup:n}=i;if(n){mt();const i=t.setupContext=n.length>1?function(t){const e=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,Kr),slots:t.slots,emit:t.emit,expose:e}}(t):null,r=Nr(t),o=Be(n,t,0,[t.props,i]),s=x(o);if(yt(),r(),!s&&!t.sp||Wi(t)||Ai(t),s){if(o.then(jr,jr),e)return o.then(i=>{Xr(t,i,e)}).catch(e=>{Ae(e,t,0)});t.asyncDep=o}else Xr(t,o,e)}else Gr(t,e)}(t,e):void 0;e&&Fr(!1)}(l,!1,a),l.asyncDep){if(o&&o.registerDep(l,V,a),!t.el){const i=l.subTree=Er(cr);w(null,i,e,n),t.placeholder=i.el}}else V(l,t,e,n,o,s,a)},j=(t,e,i)=>{const n=e.component=t.component;if(function(t,e,i){const{props:n,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,h=o.emitsOptions;if(e.dirs||e.transition)return!0;if(!(i&&l>=0))return!(!r&&!a||a&&a.$stable)||n!==s&&(n?!s||In(n,s,h):!!s);if(1024&l)return!0;if(16&l)return n?In(n,s,h):!!s;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e];if(Fn(s,n,i)&&!Rn(h,i))return!0}}return!1}(t,e,i)){if(n.asyncDep&&!n.asyncResolved)return void H(n,e,i);n.next=e,n.update()}else e.el=t.el,n.vnode=e},V=(t,e,i,n,r,o,s)=>{const a=()=>{if(t.isMounted){let{next:e,bu:i,u:n,parent:a,vnode:l}=t;{const i=rr(t);if(i)return e&&(e.el=l.el,H(t,e,s)),void i.asyncDep.then(()=>{Qn(()=>{t.isUnmounted||h()},r)})}let c,d=e;ir(t,!1),e?(e.el=l.el,H(t,e,s)):e=l,i&&D(i),(c=e.props&&e.props.onVnodeBeforeUpdate)&&Ar(c,a,e,l),ir(t,!0);const u=An(t),p=t.subTree;t.subTree=u,m(p,u,f(p.el),Q(p),t,r,o),e.el=u.el,null===d&&function({vnode:t,parent:e,suspense:i},n){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===t&&(i.suspense.vnode.el=i.el=n,t=i),i!==t)break;(t=e.vnode).el=n,e=e.parent}i&&i.activeBranch===t&&(i.vnode.el=n)}(t,u.el),n&&Qn(n,r),(c=e.props&&e.props.onVnodeUpdated)&&Qn(()=>Ar(c,a,e,l),r)}else{let s;const{el:a,props:l}=e,{bm:h,m:c,parent:d,root:u,type:p}=t,f=Wi(e);if(ir(t,!1),h&&D(h),!f&&(s=l&&l.onVnodeBeforeMount)&&Ar(s,d,e),ir(t,!0),a&&st){const e=()=>{t.subTree=An(t),st(a,t.subTree,t,r,null)};f&&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 s=t.subTree=An(t);m(null,s,i,n,t,r,o),e.el=s.el}if(c&&Qn(c,r),!f&&(s=l&&l.onVnodeMounted)){const t=e;Qn(()=>Ar(s,d,t),r)}(256&e.shapeFlag||d&&Wi(d.vnode)&&256&d.vnode.shapeFlag)&&t.a&&Qn(t.a,r),t.isMounted=!0,e=i=n=null}};t.scope.on();const l=t.effect=new ot(a);t.scope.off();const h=t.update=l.run.bind(l),c=t.job=l.runIfDirty.bind(l);c.i=t,c.id=t.uid,l.scheduler=()=>Ve(c),ir(t,!0),h()},H=(t,e,n)=>{e.component=t;const r=t.vnode.props;t.vnode=e,t.next=null,function(t,e,i,n){const{props:r,attrs:o,vnode:{patchFlag:s}}=t,a=ve(r),[l]=t.propsOptions;let h=!1;if(!(n||s>0)||16&s){let n;Vn(t,e,r,o)&&(h=!0);for(const o in a)e&&(d(e,o)||(n=T(o))!==o&&d(e,n))||(l?!i||void 0===i[o]&&void 0===i[n]||(r[o]=Hn(l,a,o,void 0,t,!0)):delete r[o]);if(o!==a)for(const t in o)e&&d(e,t)||(delete o[t],h=!0)}else if(8&s){const i=t.vnode.dynamicProps;for(let n=0;n<i.length;n++){let s=i[n];if(Rn(t.emitsOptions,s))continue;const c=e[s];if(l)if(d(o,s))c!==o[s]&&(o[s]=c,h=!0);else{const e=L(s);r[e]=Hn(l,a,e,c,t,!1)}else c!==o[s]&&(o[s]=c,h=!0)}}h&&Tt(t.attrs,"set","")}(t,e.props,r,n),((t,e,n)=>{const{vnode:r,slots:o}=t;let s=!0,a=i;if(32&r.shapeFlag){const t=e._;t?n&&1===t?s=!1:Jn(o,e,n):(s=!e.$stable,Zn(e,o)),a=e}else e&&(qn(t,e),a={default:1});if(s)for(const i in o)Gn(i)||null!=a[i]||delete o[i]})(t,e.children,n),mt(),Ue(t),yt()},U=(t,e,i,n,r,o,s,a,l=!1)=>{const h=t&&t.children,c=t?t.shapeFlag:0,d=e.children,{patchFlag:u,shapeFlag:f}=e;if(u>0){if(128&u)return void X(h,d,i,n,r,o,s,a,l);if(256&u)return void Y(h,d,i,n,r,o,s,a,l)}8&f?(16&c&&J(h,r,o),d!==h&&p(i,d)):16&c?16&f?X(h,d,i,n,r,o,s,a,l):J(h,r,o,!0):(8&c&&p(i,""),16&f&&B(d,i,n,r,o,s,a,l))},Y=(t,e,i,r,o,s,a,l,h)=>{e=e||n;const c=(t=t||n).length,d=e.length,u=Math.min(c,d);let p;for(p=0;p<u;p++){const n=e[p]=h?Br(e[p]):Tr(e[p]);m(t[p],n,i,null,o,s,a,l,h)}c>d?J(t,o,s,!0,!1,u):B(e,i,r,o,s,a,l,h,u)},X=(t,e,i,r,o,s,a,l,h)=>{let c=0;const d=e.length;let u=t.length-1,p=d-1;for(;c<=u&&c<=p;){const n=t[c],r=e[c]=h?Br(e[c]):Tr(e[c]);if(!wr(n,r))break;m(n,r,i,null,o,s,a,l,h),c++}for(;c<=u&&c<=p;){const n=t[u],r=e[p]=h?Br(e[p]):Tr(e[p]);if(!wr(n,r))break;m(n,r,i,null,o,s,a,l,h),u--,p--}if(c>u){if(c<=p){const t=p+1,n=t<d?e[t].el:r;for(;c<=p;)m(null,e[c]=h?Br(e[c]):Tr(e[c]),i,n,o,s,a,l,h),c++}}else if(c>p)for(;c<=u;)K(t[c],o,s,!0),c++;else{const f=c,g=c,v=new Map;for(c=g;c<=p;c++){const t=e[c]=h?Br(e[c]):Tr(e[c]);null!=t.key&&v.set(t.key,c)}let _,y=0;const x=p-g+1;let w=!1,b=0;const S=new Array(x);for(c=0;c<x;c++)S[c]=0;for(c=f;c<=u;c++){const n=t[c];if(y>=x){K(n,o,s,!0);continue}let r;if(null!=n.key)r=v.get(n.key);else for(_=g;_<=p;_++)if(0===S[_-g]&&wr(n,e[_])){r=_;break}void 0===r?K(n,o,s,!0):(S[r-g]=c+1,r>=b?b=r:w=!0,m(n,e[r],i,null,o,s,a,l,h),y++)}const k=w?function(t){const e=t.slice(),i=[0];let n,r,o,s,a;const l=t.length;for(n=0;n<l;n++){const l=t[n];if(0!==l){if(r=i[i.length-1],t[r]<l){e[n]=r,i.push(n);continue}for(o=0,s=i.length-1;o<s;)a=o+s>>1,t[i[a]]<l?o=a+1:s=a;l<t[i[o]]&&(o>0&&(e[n]=i[o-1]),i[o]=n)}}o=i.length,s=i[o-1];for(;o-- >0;)i[o]=s,s=e[s];return i}(S):n;for(_=k.length-1,c=x-1;c>=0;c--){const t=g+c,n=e[t],u=e[t+1],p=t+1<d?u.el||sr(u):r;0===S[c]?m(null,n,i,p,o,s,a,l,h):w&&(_<0||c!==k[_]?G(n,i,p,2):_--)}}},G=(t,e,i,n,r=null)=>{const{el:a,type:l,transition:h,children:c,shapeFlag:d}=t;if(6&d)G(t.component.subTree,e,i,n);else if(128&d)t.suspense.move(e,i,n);else if(64&d)l.move(t,e,i,nt);else if(l!==lr)if(l!==dr)if(2!==n&&1&d&&h)if(0===n)h.beforeEnter(a),o(a,e,i),Qn(()=>h.enter(a),r);else{const{leave:n,delayLeave:r,afterLeave:l}=h,c=()=>{t.ctx.isUnmounted?s(a):o(a,e,i)},d=()=>{a._isLeaving&&a[yi](!0),n(a,()=>{c(),l&&l()})};r?r(a,c,d):d()}else o(a,e,i);else S(t,e,i);else{o(a,e,i);for(let t=0;t<c.length;t++)G(c[t],e,i,n);o(t.anchor,e,i)}},K=(t,e,i,n=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:h,shapeFlag:c,patchFlag:d,dirs:u,cacheIndex:p,memo:f}=t;if(-2===d&&(r=!1),null!=a&&(mt(),Ii(a,null,i,t,!0),yt()),null!=p&&(e.renderCache[p]=void 0),256&c)return void e.ctx.deactivate(t);const g=1&c&&u,v=!Wi(t);let _;if(v&&(_=s&&s.onVnodeBeforeUnmount)&&Ar(_,e,t),6&c)q(t.component,i,n);else{if(128&c)return void t.suspense.unmount(i,n);g&&Qe(t,null,e,"beforeUnmount"),64&c?t.type.remove(t,e,i,nt,n):h&&!h.hasOnce&&(o!==lr||d>0&&64&d)?J(h,e,i,!1,!0):(o===lr&&384&d||!r&&16&c)&&J(l,e,i),n&&$(t)}const m=null!=f&&null==p;(v&&(_=s&&s.onVnodeUnmounted)||g||m)&&Qn(()=>{_&&Ar(_,e,t),g&&Qe(t,null,e,"unmounted"),m&&(t.el=null)},i)},$=t=>{const{type:e,el:i,anchor:n,transition:r}=t;if(e===lr)return void Z(i,n);if(e===dr)return void k(t);const o=()=>{s(i),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&t.shapeFlag&&r&&!r.persisted){const{leave:e,delayLeave:n}=r,s=()=>e(i,o);n?n(t.el,o,s):s()}else o()},Z=(t,e)=>{let i;for(;t!==e;)i=g(t),s(t),t=i;s(e)},q=(t,e,i)=>{const{bum:n,scope:r,job:o,subTree:s,um:a,m:l,a:h}=t;or(l),or(h),n&&D(n),r.stop(),o&&(o.flags|=8,K(s,t,e,i)),a&&Qn(a,e),Qn(()=>{t.isUnmounted=!0},e)},J=(t,e,i,n=!1,r=!1,o=0)=>{for(let s=o;s<t.length;s++)K(t[s],e,i,n,r)},Q=t=>{if(6&t.shapeFlag)return Q(t.component.subTree);if(128&t.shapeFlag)return t.suspense.next();const e=g(t.anchor||t.el),i=e&&e[li];return i?g(i):e};let tt=!1;const it=(t,e,i)=>{let n;null==t?e._vnode&&(K(e._vnode,null,null,!0),n=e._vnode.component):m(e._vnode||null,t,e,null,null,null,i),e._vnode=t,tt||(tt=!0,Ue(n),Ye(),tt=!1)},nt={p:m,um:K,m:G,r:$,mt:N,mc:B,pc:U,pbc:A,n:Q,o:t};let rt,st;e&&([rt,st]=e(nt));return{render:it,hydrate:rt,createApp:On(it,rt)}}(t)}function er({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 ir({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function nr(t,e,i=!1){const n=t.children,r=e.children;if(u(n)&&u(r))for(let o=0;o<n.length;o++){const t=n[o];let e=r[o];1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e=r[o]=Br(r[o]),e.el=t.el),i||-2===e.patchFlag||nr(t,e)),e.type===hr&&(-1===e.patchFlag&&(e=r[o]=Br(e)),e.el=t.el),e.type!==cr||e.el||(e.el=t.el)}}function rr(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:rr(e)}function or(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function sr(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?sr(e.subTree):null}var ar=t=>t.__isSuspense;var lr=Symbol.for("v-fgt"),hr=Symbol.for("v-txt"),cr=Symbol.for("v-cmt"),dr=Symbol.for("v-stc"),ur=[],pr=null;function fr(t=!1){ur.push(pr=t?null:[])}var gr=1;function vr(t,e=!1){gr+=t,t<0&&pr&&e&&(pr.hasOnce=!0)}function _r(t){return t.dynamicChildren=gr>0?pr||n:null,ur.pop(),pr=ur[ur.length-1]||null,gr>0&&pr&&pr.push(t),t}function mr(t,e,i,n,r,o){return _r(kr(t,e,i,n,r,o,!0))}function yr(t,e,i,n,r){return _r(Er(t,e,i,n,r,!0))}function xr(t){return!!t&&!0===t.__v_isVNode}function wr(t,e){return t.type===e.type&&t.key===e.key}var br=({key:t})=>null!=t?t:null,Sr=({ref:t,ref_key:e,ref_for:i})=>("number"==typeof t&&(t=""+t),null!=t?_(t)||ye(t)||v(t)?{i:Ke,r:t,k:e,f:!!i}:t:null);function kr(t,e=null,i=null,n=0,r=null,o=(t===lr?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&br(e),ref:e&&Sr(e),scopeId:$e,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:o,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ke};return a?(Rr(l,i),128&o&&t.normalize(l)):i&&(l.shapeFlag|=_(i)?8:16),gr>0&&!s&&pr&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&pr.push(l),l}var Er=function(t,e=null,i=null,n=0,r=null,o=!1){t&&t!==on||(t=cr);if(xr(t)){const n=Cr(t,e,!0);return i&&Rr(n,i),gr>0&&!o&&pr&&(6&n.shapeFlag?pr[pr.indexOf(t)]=n:pr.push(n)),n.patchFlag=-2,n}s=t,v(s)&&"__vccOpts"in s&&(t=t.__vccOpts);var s;if(e){e=function(t){return t?ge(t)||Nn(t)?l({},t):t:null}(e);let{class:t,style:i}=e;t&&!_(t)&&(e.class=H(t)),y(i)&&(ge(i)&&!u(i)&&(i=l({},i)),e.style=W(i))}const a=_(t)?1:ar(t)?128:hi(t)?64:y(t)?4:v(t)?2:0;return kr(t,e,i,n,r,a,o,!0)};function Cr(t,e,i=!1,n=!1){const{props:r,ref:o,patchFlag:l,children:h,transition:c}=t,d=e?function(...t){const e={};for(let i=0;i<t.length;i++){const n=t[i];for(const t in n)if("class"===t)e.class!==n.class&&(e.class=H([e.class,n.class]));else if("style"===t)e.style=W([e.style,n.style]);else if(s(t)){const i=e[t],r=n[t];!r||i===r||u(i)&&i.includes(r)?null!=r||null!=i||a(t)||(e[t]=r):e[t]=i?[].concat(i,r):r}else""!==t&&(e[t]=n[t])}return e}(r||{},e):r,p={__v_isVNode:!0,__v_skip:!0,type:t.type,props:d,key:d&&br(d),ref:e&&e.ref?i&&o?u(o)?o.concat(Sr(e)):[o,Sr(e)]:Sr(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:h,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==lr?-1===l?16:16|l:l,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Cr(t.ssContent),ssFallback:t.ssFallback&&Cr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&n&&Ti(p,c.clone(p)),p}function Or(t=" ",e=0){return Er(hr,null,t,e)}function Lr(t,e){const i=Er(dr,null,t);return i.staticCount=e,i}function Pr(t="",e=!1){return e?(fr(),yr(cr,null,t)):Er(cr,null,t)}function Tr(t){return null==t||"boolean"==typeof t?Er(cr):u(t)?Er(lr,null,t.slice()):xr(t)?Br(t):Er(hr,null,String(t))}function Br(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:Cr(t)}function Rr(t,e){let i=0;const{shapeFlag:n}=t;if(null==e)e=null;else if(u(e))i=16;else if("object"==typeof e){if(65&n){const i=e.default;return void(i&&(i._c&&(i._d=!1),Rr(t,i()),i._c&&(i._d=!0)))}{i=32;const n=e._;n||Nn(e)?3===n&&Ke&&(1===Ke.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=Ke}}else v(e)?(e={default:e,_ctx:Ke},i=32):(e=String(e),64&n?(i=16,e=[Or(e)]):i=8);t.children=e,t.shapeFlag|=i}function Ar(t,e,i,n=null){Re(t,e,7,[i,n])}var Dr=En(),Mr=0;var Ir,Fr,Wr=null,zr=()=>Wr||Ke;{const t=F(),e=(e,i)=>{let n;return(n=t[e])||(n=t[e]=[]),n.push(i),t=>{n.length>1?n.forEach(e=>e(t)):n[0](t)}};Ir=e("__VUE_INSTANCE_SETTERS__",t=>Wr=t),Fr=e("__VUE_SSR_SETTERS__",t=>Yr=t)}var Nr=t=>{const e=Wr;return Ir(t),t.scope.on(),()=>{t.scope.off(),Ir(e)}},jr=()=>{Wr&&Wr.scope.off(),Ir(null)};function Vr(t){return 4&t.vnode.shapeFlag}var Hr,Ur,Yr=!1;function Xr(t,e,i){v(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:y(e)&&(t.setupState=ke(e)),Gr(t,i)}function Gr(t,e,i){const n=t.type;if(!t.render){if(!e&&Hr&&!n.render){const e=n.template||_n(t).template;if(e){const{isCustomElement:i,compilerOptions:r}=t.appContext.config,{delimiters:o,compilerOptions:s}=n,a=l(l({isCustomElement:i,delimiters:o},r),s);n.render=Hr(e,a)}}t.render=n.render||r,Ur&&Ur(t)}{const e=Nr(t);mt();try{fn(t)}finally{yt(),e()}}}var Kr={get:(t,e)=>(Pt(t,0,""),t[e])};function $r(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(ke((e=t.exposed,!d(e,"__v_skip")&&Object.isExtensible(e)&&M(e,"__v_skip",!0),e)),{get:(e,i)=>i in e?e[i]:i in hn?hn[i](t):void 0,has:(t,e)=>e in t||e in hn})):t.proxy;var e}var Zr=(t,e)=>function(t,e,i=!1){let n,r;return v(t)?n=t:(n=t.get,r=t.set),new Ee(n,r,i)}(t,0,Yr);var qr="3.5.33",Jr=void 0,Qr="undefined"!=typeof window&&window.trustedTypes;if(Qr)try{Jr=Qr.createPolicy("vue",{createHTML:t=>t})}catch(SS){}var to=Jr?t=>Jr.createHTML(t):t=>t,eo="undefined"!=typeof document?document:null,io=eo&&eo.createElement("template"),no={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r="svg"===e?eo.createElementNS("http://www.w3.org/2000/svg",t):"mathml"===e?eo.createElementNS("http://www.w3.org/1998/Math/MathML",t):i?eo.createElement(t,{is:i}):eo.createElement(t);return"select"===t&&n&&null!=n.multiple&&r.setAttribute("multiple",n.multiple),r},createText:t=>eo.createTextNode(t),createComment:t=>eo.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>eo.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,o){const s=i?i.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),r!==o&&(r=r.nextSibling););else{io.innerHTML=to("svg"===n?`<svg>${t}</svg>`:"mathml"===n?`<math>${t}</math>`:t);const r=io.content;if("svg"===n||"mathml"===n){const t=r.firstChild;for(;t.firstChild;)r.appendChild(t.firstChild);r.removeChild(t)}e.insertBefore(r,i)}return[s?s.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},ro="transition",oo="animation",so=Symbol("_vtc"),ao={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},lo=l({},bi,ao),ho=t=>(t.displayName="Transition",t.props=lo,t),co=ho((t,{slots:e})=>function(t,e,i){try{vr(-1);const n=arguments.length;return 2===n?y(e)&&!u(e)?xr(e)?Er(t,null,[e]):Er(t,e):Er(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):3===n&&xr(i)&&(i=[i]),Er(t,e,i))}finally{vr(1)}}(Ei,function(t){const e={};for(const l in t)l in ao||(e[l]=t[l]);if(!1===t.css)return e;const{name:i="v",type:n,duration:r,enterFromClass:o=`${i}-enter-from`,enterActiveClass:s=`${i}-enter-active`,enterToClass:a=`${i}-enter-to`,appearFromClass:h=o,appearActiveClass:c=s,appearToClass:d=a,leaveFromClass:u=`${i}-leave-from`,leaveActiveClass:p=`${i}-leave-active`,leaveToClass:f=`${i}-leave-to`}=t,g=function(t){if(null==t)return null;if(y(t))return[fo(t.enter),fo(t.leave)];{const e=fo(t);return[e,e]}}(r),v=g&&g[0],_=g&&g[1],{onBeforeEnter:m,onEnter:x,onEnterCancelled:w,onLeave:b,onLeaveCancelled:S,onBeforeAppear:k=m,onAppear:E=x,onAppearCancelled:C=w}=e,O=(t,e,i,n)=>{t._enterCancelled=n,vo(t,e?d:a),vo(t,e?c:s),i&&i()},L=(t,e)=>{t._isLeaving=!1,vo(t,u),vo(t,f),vo(t,p),e&&e()},P=t=>(e,i)=>{const r=t?E:x,s=()=>O(e,t,i);uo(r,[e,s]),_o(()=>{vo(e,t?h:o),go(e,t?d:a),po(r)||yo(e,n,v,s)})};return l(e,{onBeforeEnter(t){uo(m,[t]),go(t,o),go(t,s)},onBeforeAppear(t){uo(k,[t]),go(t,h),go(t,c)},onEnter:P(!1),onAppear:P(!0),onLeave(t,e){t._isLeaving=!0;const i=()=>L(t,e);go(t,u),t._enterCancelled?(go(t,p),bo(t)):(bo(t),go(t,p)),_o(()=>{t._isLeaving&&(vo(t,u),go(t,f),po(b)||yo(t,n,_,i))}),uo(b,[t,i])},onEnterCancelled(t){O(t,!1,void 0,!0),uo(w,[t])},onAppearCancelled(t){O(t,!0,void 0,!0),uo(C,[t])},onLeaveCancelled(t){L(t),uo(S,[t])}})}(t),e)),uo=(t,e=[])=>{u(t)?t.forEach(t=>t(...e)):t&&t(...e)},po=t=>!!t&&(u(t)?t.some(t=>t.length>1):t.length>1);function fo(t){return(t=>{const e=_(t)?Number(t):NaN;return isNaN(e)?t:e})(t)}function go(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.add(e)),(t[so]||(t[so]=new Set)).add(e)}function vo(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.remove(e));const i=t[so];i&&(i.delete(e),i.size||(t[so]=void 0))}function _o(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}var mo=0;function yo(t,e,i,n){const r=t._endId=++mo,o=()=>{r===t._endId&&n()};if(null!=i)return setTimeout(o,i);const{type:s,timeout:a,propCount:l}=function(t,e){const i=window.getComputedStyle(t),n=t=>(i[t]||"").split(", "),r=n(`${ro}Delay`),o=n(`${ro}Duration`),s=xo(r,o),a=n(`${oo}Delay`),l=n(`${oo}Duration`),h=xo(a,l);let c=null,d=0,u=0;e===ro?s>0&&(c=ro,d=s,u=o.length):e===oo?h>0&&(c=oo,d=h,u=l.length):(d=Math.max(s,h),c=d>0?s>h?ro:oo:null,u=c?c===ro?o.length:l.length:0);const p=c===ro&&/\b(?:transform|all)(?:,|$)/.test(n(`${ro}Property`).toString());return{type:c,timeout:d,propCount:u,hasTransform:p}}(t,e);if(!s)return n();const h=s+"end";let c=0;const d=()=>{t.removeEventListener(h,u),o()},u=e=>{e.target===t&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),t.addEventListener(h,u)}function xo(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((e,i)=>wo(e)+wo(t[i])))}function wo(t){return"auto"===t?0:1e3*Number(t.slice(0,-1).replace(",","."))}function bo(t){return(t?t.ownerDocument:document).body.offsetHeight}var So=Symbol("_vod"),ko=Symbol("_vsh"),Eo=Symbol(""),Co=/(?:^|;)\s*display\s*:/;var Oo=/\s*!important$/;function Lo(t,e,i){if(u(i))i.forEach(i=>Lo(t,e,i));else if(null==i&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=function(t,e){const i=To[e];if(i)return i;let n=L(e);if("filter"!==n&&n in t)return To[e]=n;n=B(n);for(let r=0;r<Po.length;r++){const i=Po[r]+n;if(i in t)return To[e]=i}return e}(t,e);Oo.test(i)?t.setProperty(T(n),i.replace(Oo,""),"important"):t[n]=i}}var Po=["Webkit","Moz","ms"],To={};function Bo(t,e,i,n){return"TEXTAREA"===t.tagName&&("width"===e||"height"===e)&&_(n)&&i===n}var Ro="http://www.w3.org/1999/xlink";function Ao(t,e,i,n,r,o=Y(e)){n&&e.startsWith("xlink:")?null==i?t.removeAttributeNS(Ro,e.slice(6,e.length)):t.setAttributeNS(Ro,e,i):null==i||o&&!X(i)?t.removeAttribute(e):t.setAttribute(e,o?"":m(i)?String(i):i)}function Do(t,e,i,n,r){if("innerHTML"===e||"textContent"===e)return void(null!=i&&(t[e]="innerHTML"===e?to(i):i));const o=t.tagName;if("value"===e&&"PROGRESS"!==o&&!o.includes("-")){const n="OPTION"===o?t.getAttribute("value")||"":t.value,r=null==i?"checkbox"===t.type?"on":"":String(i);return n===r&&"_value"in t||(t.value=r),null==i&&t.removeAttribute(e),void(t._value=i)}let s=!1;if(""===i||null==i){const n=typeof t[e];"boolean"===n?i=X(i):null==i&&"string"===n?(i="",s=!0):"number"===n&&(i=0,s=!0)}try{t[e]=i}catch(SS){}s&&t.removeAttribute(r||e)}function Mo(t,e,i,n){t.addEventListener(e,i,n)}var Io=Symbol("_vei");function Fo(t,e,i,n,r=null){const o=t[Io]||(t[Io]={}),s=o[e];if(n&&s)s.value=n;else{const[i,a]=function(t){let e;if(Wo.test(t)){let i;for(e={};i=t.match(Wo);)t=t.slice(0,t.length-i[0].length),e[i[0].toLowerCase()]=!0}return[":"===t[2]?t.slice(3):T(t.slice(2)),e]}(e);n?Mo(t,i,o[e]=function(t,e){const i=t=>{if(t._vts){if(t._vts<=i.attached)return}else t._vts=Date.now();Re(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=jo(),i}(n,r),a):s&&(!function(t,e,i,n){t.removeEventListener(e,i,n)}(t,i,s,a),o[e]=void 0)}}var Wo=/(?:Once|Passive|Capture)$/;var zo=0,No=Promise.resolve(),jo=()=>zo||(No.then(()=>zo=0),zo=Date.now());var Vo=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123;var Ho=t=>{const e=t.props["onUpdate:modelValue"]||!1;return u(e)?t=>D(e,t):e};function Uo(t){t.target.composing=!0}function Yo(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}var Xo=Symbol("_assign");function Go(t,e,i){return e&&(t=t.trim()),i&&(t=I(t)),t}var Ko={created(t,{modifiers:{lazy:e,trim:i,number:n}},r){t[Xo]=Ho(r);const o=n||r.props&&"number"===r.props.type;Mo(t,e?"change":"input",e=>{e.target.composing||t[Xo](Go(t.value,i,o))}),(i||o)&&Mo(t,"change",()=>{t.value=Go(t.value,i,o)}),e||(Mo(t,"compositionstart",Uo),Mo(t,"compositionend",Yo),Mo(t,"change",Yo))},mounted(t,{value:e}){t.value=null==e?"":e},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:n,trim:r,number:o}},s){if(t[Xo]=Ho(s),t.composing)return;const a=null==e?"":e;if((!o&&"number"!==t.type||/^0\d/.test(t.value)?t.value:I(t.value))===a)return;const l=t.getRootNode();if((l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===t&&"range"!==t.type){if(n&&e===i)return;if(r&&t.value.trim()===a)return}t.value=a}},$o={deep:!0,created(t,{value:e,modifiers:{number:i}},n){const r=f(e);Mo(t,"change",()=>{const e=Array.prototype.filter.call(t.options,t=>t.selected).map(t=>i?I(qo(t)):qo(t));t[Xo](t.multiple?r?new Set(e):e:e[0]),t._assigning=!0,je(()=>{t._assigning=!1})}),t[Xo]=Ho(n)},mounted(t,{value:e}){Zo(t,e)},beforeUpdate(t,e,i){t[Xo]=Ho(i)},updated(t,{value:e}){t._assigning||Zo(t,e)}};function Zo(t,e){const i=t.multiple,n=u(e);if(!i||n||f(e)){for(let r=0,o=t.options.length;r<o;r++){const o=t.options[r],s=qo(o);if(i)if(n){const t=typeof s;o.selected="string"===t||"number"===t?e.some(t=>String(t)===String(s)):K(e,s)>-1}else o.selected=e.has(s);else if(G(qo(o),e))return void(t.selectedIndex!==r&&(t.selectedIndex=r))}i||-1===t.selectedIndex||(t.selectedIndex=-1)}}function qo(t){return"_value"in t?t._value:t.value}var Jo,Qo=["ctrl","shift","alt","meta"],ts={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>Qo.some(i=>t[`${i}Key`]&&!e.includes(i))},es=(t,e)=>{if(!t)return t;const i=t._withMods||(t._withMods={}),n=e.join(".");return i[n]||(i[n]=(i,...n)=>{for(let t=0;t<e.length;t++){const n=ts[e[t]];if(n&&n(i,e))return}return t(i,...n)})},is={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ns=(t,e)=>{const i=t._withKeys||(t._withKeys={}),n=e.join(".");return i[n]||(i[n]=i=>{if(!("key"in i))return;const n=T(i.key);return e.some(t=>t===n||is[t]===n)?t(i):void 0})},rs=l({patchProp:(t,e,i,n,r,o)=>{const l="svg"===r;"class"===e?function(t,e,i){const n=t[so];n&&(e=(e?[e,...n]:[...n]).join(" ")),null==e?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}(t,n,l):"style"===e?function(t,e,i){const n=t.style,r=_(i);let o=!1;if(i&&!r){if(e)if(_(e))for(const t of e.split(";")){const e=t.slice(0,t.indexOf(":")).trim();null==i[e]&&Lo(n,e,"")}else for(const t in e)null==i[t]&&Lo(n,t,"");for(const r in i){"display"===r&&(o=!0);const s=i[r];null!=s?Bo(t,r,!_(e)&&e?e[r]:void 0,s)||Lo(n,r,s):Lo(n,r,"")}}else if(r){if(e!==i){const t=n[Eo];t&&(i+=";"+t),n.cssText=i,o=Co.test(i)}}else e&&t.removeAttribute("style");So in t&&(t[So]=o?n.display:"",t[ko]&&(n.display="none"))}(t,i,n):s(e)?a(e)||Fo(t,e,0,n,o):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,i,n){if(n)return"innerHTML"===e||"textContent"===e||!!(e in t&&Vo(e)&&v(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(!Vo(e)||!_(i))&&e in t}(t,e,n,l))?(Do(t,e,n),t.tagName.includes("-")||"value"!==e&&"checked"!==e&&"selected"!==e||Ao(t,e,n,l,0,"value"!==e)):t._isVueCE&&(function(t,e){const i=t._def.props;if(!i)return!1;const n=L(e);return Array.isArray(i)?i.some(t=>L(t)===n):Object.keys(i).some(t=>L(t)===n)}(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!_(n)))?Do(t,L(e),n,0,e):("true-value"===e?t._trueValue=n:"false-value"===e&&(t._falseValue=n),Ao(t,e,n,l))}},no);var os;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(os||(os={}));var ss={};function as(t){return void 0===t}function ls(t){return null==t}function hs(t){return"string"==typeof t}var{isFinite:cs}=Number;function ds(t){return"number"==typeof t}var{isArray:us}=Array;function ps(t){return t&&"object"==typeof t}var fs,gs,vs,_s={default:(t,e)=>(ms(e,t),ms(t,e),t),assign(t,e,i){let n;Object.keys(e).forEach(r=>{var o,s;if(n=e[r],(null==n?void 0:n.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return ms(t[r],e[r],i&&i[r]);i&&r in i?(null===(s=i[r])||void 0===s?void 0:s.constructor)===Object&&ms(t[r]={},e[r],i[r]):t[r]=e[r]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{as(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let i=0,n=t.length;i<n;i++)e[t[i]]=!0;return e},stintSet(t,e,i){i||(i=void 0),t[e]!==i&&(t[e]=i)}},{assign:ms}=_s,ys=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(!as(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let n in this)"_"!==n[0]&&(i=e?e[n]:void 0,t[n]=as(i)?this[n]: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(!as(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!as(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(us(t))for(let n of t)i[n]=this.__getInput(n);else for(let n in t)i[n]=this.__getInput(n);else{let t,e,{__input:n}=this;i.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],!as(t))){if("path"===r&&!this.__pathInputed)continue;e=n?n[r]:void 0,i[r]=as(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:n,d:r,e:o,f:s}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:n,d:r,e:o,f:s}}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()}},xs={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=ws;return e[t]?e[t]++:(e[t]=1,0)}},ws=xs,{max:bs}=Math,Ss=[0,0,0,0],ks={zero:[...Ss],tempFour:Ss,set:(t,e,i,n,r)=>(void 0===i&&(i=n=r=e),t[0]=e,t[1]=i,t[2]=n,t[3]=r,t),setTemp:(t,e,i,n)=>Es(Ss,t,e,i,n),toTempAB(t,e,i){vs=i?ds(t)?e:t:[],ds(t)?(fs=Os(t),gs=e):ds(e)?(fs=t,gs=Os(e)):(fs=t,gs=e),4!==fs.length&&(fs=Cs(fs)),4!==gs.length&&(gs=Cs(gs))},get(t,e){let i;if(!ds(t))switch(t.length){case 4:i=as(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]),!as(e))for(let n=0;n<4;n++)i[n]>e&&(i[n]=e);return i},max:(t,e,i)=>ds(t)&&ds(e)?bs(t,e):(Ls(t,e,i),Es(vs,bs(fs[0],gs[0]),bs(fs[1],gs[1]),bs(fs[2],gs[2]),bs(fs[3],gs[3]))),add:(t,e,i)=>ds(t)&&ds(e)?t+e:(Ls(t,e,i),Es(vs,fs[0]+gs[0],fs[1]+gs[1],fs[2]+gs[2],fs[3]+gs[3])),swapAndScale(t,e,i,n){if(ds(t))return e===i?t*e:[t*i,t*e];const r=n?t:[],[o,s,a,l]=4===t.length?t:Cs(t);return Es(r,a*i,l*e,o*i,s*e)}},{set:Es,get:Cs,setTemp:Os,toTempAB:Ls}=ks,{round:Ps,pow:Ts,max:Bs,floor:Rs,PI:As}=Math,Ds={},Ms={within:(t,e,i)=>(ps(e)&&(i=e.max,e=e.min),!as(e)&&t<e&&(t=e),!as(i)&&t>i&&(t=i),t),fourNumber:ks.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),Ms.float(t)),getGapRotation(t,e,i=0){let n=t+i;if(e>1){const t=Math.abs(n%e);(t<1||t>e-1)&&(n=Math.round(n/e)*e)}return n-i},float(t,e){const i=as(e)?1e12:Ts(10,e);return-0===(t=Ps(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,i,n){if(n||(n={}),e){const t=(ds(e)?e:e.width||0)/i.width,r=(ds(e)?e:e.height||0)/i.height;n.scaleX=t||r||1,n.scaleY=r||t||1}else t&&Ms.assignScale(n,t);return n},getScaleFixedData(t,e,i,n,r){let{scaleX:o,scaleY:s}=t;if((n||e)&&(o<0&&(o=-o),s<0&&(s=-s)),e)if(!0===e)o=s=i?1:1/o;else{let t;ds(e)?t=e:"zoom-in"===e&&(t=1),t&&(o=s=o>t||s>t?i?1:1/o:i?1:1/t)}return Ds.scaleX=o,Ds.scaleY=s,Ds},assignScale(t,e){ds(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>Bs(Rs(t),e)/t,randInt:Is,randColor:t=>`rgba(${Is(255)},${Is(255)},${Is(255)},${t||1})`};function Is(t){return Math.round(Math.random()*t)}var Fs=As/180,Ws=2*As,zs=As/2;function Ns(){return{a:1,b:0,c:0,d:1,e:0,f:0}}var{sin:js,cos:Vs,acos:Hs,sqrt:Us}=Math,{float:Ys}=Ms,Xs={};function Gs(){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 Ks,$s,Zs={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:Gs(),tempMatrix:{},set(t,e=1,i=0,n=0,r=1,o=0,s=0){t.a=e,t.b=i,t.c=n,t.d=r,t.e=o,t.f=s},get:Ns,getWorld:Gs,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,n){t.e+=t.a*e+t.c*i,t.f+=t.b*e+t.d*i,n&&(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,n){qs.toInnerPoint(t,e,Xs),qs.scaleOfInner(t,Xs,i,n)},scaleOfInner(t,e,i,n=i){qs.translateInner(t,e.x,e.y),qs.scale(t,i,n),qs.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:i,b:n,c:r,d:o}=t,s=Vs(e*=Fs),a=js(e);t.a=i*s-n*a,t.b=i*a+n*s,t.c=r*s-o*a,t.d=r*a+o*s},rotateOfOuter(t,e,i){qs.toInnerPoint(t,e,Xs),qs.rotateOfInner(t,Xs,i)},rotateOfInner(t,e,i){qs.translateInner(t,e.x,e.y),qs.rotate(t,i),qs.translateInner(t,-e.x,-e.y)},skew(t,e,i){const{a:n,b:r,c:o,d:s}=t;i&&(i*=Fs,t.a=n+o*i,t.b=r+s*i),e&&(e*=Fs,t.c=o+n*e,t.d=s+r*e)},skewOfOuter(t,e,i,n){qs.toInnerPoint(t,e,Xs),qs.skewOfInner(t,Xs,i,n)},skewOfInner(t,e,i,n=0){qs.translateInner(t,e.x,e.y),qs.skew(t,i,n),qs.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:i,b:n,c:r,d:o,e:s,f:a}=t;t.a=e.a*i+e.b*r,t.b=e.a*n+e.b*o,t.c=e.c*i+e.d*r,t.d=e.c*n+e.d*o,t.e=e.e*i+e.f*r+s,t.f=e.e*n+e.f*o+a},multiplyParent(t,e,i,n,r){const{e:o,f:s}=t;if(i||(i=t),as(n)&&(n=1!==t.a||t.b||t.c||1!==t.d),n){const{a:n,b:o,c:s,d:a}=t;i.a=n*e.a+o*e.c,i.b=n*e.b+o*e.d,i.c=s*e.a+a*e.c,i.d=s*e.b+a*e.d,r&&(i.scaleX=e.scaleX*r.scaleX,i.scaleY=e.scaleY*r.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,r&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=o*e.a+s*e.c+e.e,i.f=o*e.b+s*e.d+e.f},divide(t,e){qs.multiply(t,qs.tempInvert(e))},divideParent(t,e){qs.multiplyParent(t,qs.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=qs;return qs.copy(e,t),qs.invert(e),e},invert(t){const{a:e,b:i,c:n,d:r,e:o,f:s}=t;if(i||n){const a=1/(e*r-i*n);t.a=r*a,t.b=-i*a,t.c=-n*a,t.d=e*a,t.e=-(o*r-s*n)*a,t.f=-(s*e-o*i)*a}else if(1===e&&1===r)t.e=-o,t.f=-s;else{const i=1/(e*r);t.a=r*i,t.d=e*i,t.e=-o*r*i,t.f=-s*e*i}},toOuterPoint(t,e,i,n){const{x:r,y:o}=e;i||(i=e),i.x=r*t.a+o*t.c,i.y=r*t.b+o*t.d,n||(i.x+=t.e,i.y+=t.f)},toInnerPoint(t,e,i,n){const{a:r,b:o,c:s,d:a}=t,l=1/(r*a-o*s),{x:h,y:c}=e;if(i||(i=e),i.x=(h*a-c*s)*l,i.y=(c*r-h*o)*l,!n){const{e:e,f:n}=t;i.x-=(e*a-n*s)*l,i.y-=(n*r-e*o)*l}},setLayout(t,e,i,n,r){const{x:o,y:s,scaleX:a,scaleY:l}=e;if(as(r)&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:i,skewX:n,skewY:r}=e,o=i*Fs,s=Vs(o),h=js(o);if(n||r){const e=n*Fs,i=r*Fs;t.a=(s+i*-h)*a,t.b=(h+i*s)*a,t.c=(e*s-h)*l,t.d=(s+e*h)*l}else t.a=s*a,t.b=h*a,t.c=-h*l,t.d=s*l}else t.a=a,t.b=0,t.c=0,t.d=l;t.e=o,t.f=s,(i=i||n)&&qs.translateInner(t,-i.x,-i.y,!n)},getLayout(t,e,i,n){const{a:r,b:o,c:s,d:a,e:l,f:h}=t;let c,d,u,p,f,g=l,v=h;if(o||s){const t=r*a-o*s;if(s&&!n){c=Us(r*r+o*o),d=t/c;const e=r/c;u=o>0?Hs(e):-Hs(e)}else{d=Us(s*s+a*a),c=t/d;const e=s/d;u=zs-(a>0?Hs(-e):-Hs(e))}const e=Ys(Vs(u)),i=js(u);c=Ys(c),d=Ys(d),p=e?Ys((s/d+i)/e/Fs,9):0,f=e?Ys((o/c-i)/e/Fs,9):0,u=Ys(u/Fs)}else c=r,d=a,u=p=f=0;return(e=i||e)&&(g+=e.x*r+e.y*s,v+=e.x*o+e.y*a,i||(g-=e.x,v-=e.y)),{x:g,y:v,scaleX:c,scaleY:d,rotation:u,skewX:p,skewY:f}},withScale(t,e,i=e){const n=t;if(!e||!i){const{a:n,b:r,c:o,d:s}=t;r||o?i=(n*s-r*o)/(e=Us(n*n+r*r)):(e=n,i=s)}return n.scaleX=e,n.scaleY=i,n},reset(t){qs.set(t)}},qs=Zs,{float:Js}=Ms,{toInnerPoint:Qs,toOuterPoint:ta}=Zs,{sin:ea,cos:ia,abs:na,sqrt:ra,atan2:oa,min:sa,round:aa}=Math,la={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=as(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?aa(t.x-.5)+.5:aa(t.x),t.y=e?aa(t.y-.5)+.5:aa(t.y)},move(t,e,i){ps(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,n=i){t.x+=(t.x-e.x)*(i-1),t.y+=(t.y-e.y)*(n-1)},rotate(t,e,i){i||(i=ha.defaultPoint);const n=ia(e*=Fs),r=ea(e),o=t.x-i.x,s=t.y-i.y;t.x=i.x+o*n-s*r,t.y=i.y+o*r+s*n},tempToInnerOf(t,e){const{tempPoint:i}=ha;return da(i,t),Qs(e,i,i),i},tempToOuterOf(t,e){const{tempPoint:i}=ha;return da(i,t),ta(e,i,i),i},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:i}=ha;return da(i,t),ha.toInnerRadiusPointOf(t,e,i),i},copyRadiusPoint:(t,e,i,n)=>(da(t,e),ua(t,i,n),t),toInnerRadiusPointOf(t,e,i){i||(i=t),Qs(e,t,i),i.radiusX=Math.abs(t.radiusX/e.scaleX),i.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,i){Qs(e,t,i)},toOuterOf(t,e,i){ta(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)=>ca(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,i,n){const r=na(i-t),o=na(n-e);return ra(r*r+o*o)},getMinDistanceFrom:(t,e,i,n,r,o)=>sa(ca(t,e,i,n),ca(i,n,r,o)),getAngle:(t,e)=>pa(t,e)/Fs,getRotation:(t,e,i,n)=>(n||(n=e),ha.getRadianFrom(t.x,t.y,e.x,e.y,i.x,i.y,n.x,n.y)/Fs),getRadianFrom(t,e,i,n,r,o,s,a){as(s)&&(s=i,a=n);const l=t-i,h=e-n,c=r-s,d=o-a;return Math.atan2(l*d-h*c,l*c+h*d)},getAtan2:(t,e)=>oa(e.y-t.y,e.x-t.x),getDistancePoint(t,e,i,n,r){const o=pa(t,e);return r&&(t=e),n||(e={}),e.x=t.x+ia(o)*i,e.y=t.y+ea(o)*i,e},toNumberPoints(t){let e=t;return ps(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:Js(t.x)===Js(e.x)&&Js(t.y)===Js(e.y),reset(t){ha.reset(t)}},ha=la,{getDistanceFrom:ca,copy:da,setRadius:ua,getAtan2:pa}=ha,fa=class t{constructor(t,e){this.set(t,e)}set(t,e){return ps(t)?la.copy(this,t):la.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 la.move(this,t,e),this}scale(t,e){return la.scale(this,t,e),this}scaleOf(t,e,i){return la.scaleOf(this,t,e,i),this}rotate(t,e){return la.rotate(this,t,e),this}rotateOf(t,e){return la.rotate(this,e,t),this}getRotation(t,e,i){return la.getRotation(this,t,e,i)}toInnerOf(t,e){return la.toInnerOf(this,t,e),this}toOuterOf(t,e){return la.toOuterOf(this,t,e),this}getCenter(e){return new t(la.getCenter(this,e))}getDistance(t){return la.getDistance(this,t)}getDistancePoint(e,i,n,r){return new t(la.getDistancePoint(this,e,i,n,r))}getAngle(t){return la.getAngle(this,t)}getAtan2(t){return la.getAtan2(this,t)}isSame(t,e){return la.isSame(this,t,e)}reset(){return la.reset(this),this}},ga=(new fa,class t{constructor(t,e,i,n,r,o){this.set(t,e,i,n,r,o)}set(t,e,i,n,r,o){return ps(t)?Zs.copy(this,t):Zs.set(this,t,e,i,n,r,o),this}setWith(t){return Zs.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:i,d:n,e:r,f:o}=this;return{a:t,b:e,c:i,d:n,e:r,f:o}}clone(){return new t(this)}translate(t,e){return Zs.translate(this,t,e),this}translateInner(t,e){return Zs.translateInner(this,t,e),this}scale(t,e){return Zs.scale(this,t,e),this}scaleWith(t,e){return Zs.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Zs.pixelScale(this,t),this}scaleOfOuter(t,e,i){return Zs.scaleOfOuter(this,t,e,i),this}scaleOfInner(t,e,i){return Zs.scaleOfInner(this,t,e,i),this}rotate(t){return Zs.rotate(this,t),this}rotateOfOuter(t,e){return Zs.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Zs.rotateOfInner(this,t,e),this}skew(t,e){return Zs.skew(this,t,e),this}skewOfOuter(t,e,i){return Zs.skewOfOuter(this,t,e,i),this}skewOfInner(t,e,i){return Zs.skewOfInner(this,t,e,i),this}multiply(t){return Zs.multiply(this,t),this}multiplyParent(t){return Zs.multiplyParent(this,t),this}divide(t){return Zs.divide(this,t),this}divideParent(t){return Zs.divideParent(this,t),this}invert(){return Zs.invert(this),this}invertWith(){return Zs.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,i){Zs.toOuterPoint(this,t,e,i)}toInnerPoint(t,e,i){Zs.toInnerPoint(this,t,e,i)}setLayout(t,e,i){return Zs.setLayout(this,t,e,i),this}getLayout(t,e,i){return Zs.getLayout(this,t,e,i)}withScale(t,e){return Zs.withScale(this,t,e)}reset(){Zs.reset(this)}}),va=(new ga,{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,n,r){_a(t,e,i),_a(t,e+n,i+r)},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:_a}=va;(function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"})(Ks||(Ks={})),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"}($s||($s={}));var ma=[{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}];ma.forEach(t=>t.type="percent");var ya={directionData:ma,tempPoint:{},get:xa,toPoint(t,e,i,n,r,o){const s=xa(t);i.x=s.x,i.y=s.y,"percent"===s.type&&(i.x*=e.width,i.y*=e.height,r&&(o||(i.x-=r.x,i.y-=r.y),s.x&&(i.x-=1===s.x?r.width:.5===s.x?s.x*r.width:0),s.y&&(i.y-=1===s.y?r.height:.5===s.y?s.y*r.height:0))),n||(i.x+=e.x,i.y+=e.y)},getPoint:(t,e,i,n=!0)=>(i||(i={}),ya.toPoint(t,e,i,n),i)};function xa(t){return hs(t)?ma[$s[t]]:t}var wa,ba,Sa,ka,{toPoint:Ea}=ya,Ca={toPoint(t,e,i,n,r,o){Ea(t,i,n,r,e,o)}},{tempPointBounds:Oa,setPoint:La,addPoint:Pa,toBounds:Ta}=va,{toOuterPoint:Ba}=Zs,{float:Ra,fourNumber:Aa}=Ms,{floor:Da,ceil:Ma}=Math,Ia={},Fa={},Wa={},za={tempBounds:Wa,set(t,e=0,i=0,n=0,r=0){t.x=e,t.y=i,t.width=n,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,i,n,r){const{x:o,y:s,width:a,height:l}=e;if(us(i)){const e=Aa(i);n?Na.set(t,o+e[3],s+e[0],a-e[1]-e[3],l-e[2]-e[0]):Na.set(t,o-e[3],s-e[0],a+e[1]+e[3],l+e[2]+e[0])}else n&&(i=-i),Na.set(t,o-i,s-i,a+2*i,l+2*i);r&&("width"===r?(t.y=s,t.height=l):(t.x=o,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),Na.move(t,e,i),t),toOffsetOutBounds(t,e,i){e?Va(e,t):e=t,i||(i=t),e.offsetX=Na.maxX(i),e.offsetY=Na.maxY(i),Na.move(e,-e.offsetX,-e.offsetY)},scale(t,e,i=e,n){n||la.scale(t,e,i),t.width*=e,t.height*=i},scaleOf(t,e,i,n=i){la.scaleOf(t,e,i,n),t.width*=i,t.height*=n},tempToOuterOf:(t,e)=>(Na.copy(Wa,t),Na.toOuterOf(Wa,e),Wa),getOuterOf:(t,e)=>(t=Object.assign({},t),Na.toOuterOf(t,e),t),toOuterOf(t,e,i){if(i||(i=t),0===e.b&&0===e.c){const{a:n,d:r,e:o,f:s}=e;n>0?(i.width=t.width*n,i.x=o+t.x*n):(i.width=t.width*-n,i.x=o+t.x*n-i.width),r>0?(i.height=t.height*r,i.y=s+t.y*r):(i.height=t.height*-r,i.y=s+t.y*r-i.height)}else Ia.x=t.x,Ia.y=t.y,Ba(e,Ia,Fa),La(Oa,Fa.x,Fa.y),Ia.x=t.x+t.width,Ba(e,Ia,Fa),Pa(Oa,Fa.x,Fa.y),Ia.y=t.y+t.height,Ba(e,Ia,Fa),Pa(Oa,Fa.x,Fa.y),Ia.x=t.x,Ba(e,Ia,Fa),Pa(Oa,Fa.x,Fa.y),Ta(Oa,i)},toInnerOf(t,e,i){i||(i=t),Na.move(i,-e.e,-e.f),Na.scale(i,1/e.a,1/e.d)},getFitMatrix(t,e,i=1){const n=Math.min(i,Na.getFitScale(t,e));return new ga(n,0,0,n,-e.x*n,-e.y*n)},getFitScale(t,e,i){const n=t.width/e.width,r=t.height/e.height;return i?Math.max(n,r):Math.min(n,r)},put(t,e,i="center",n=1,r=!0,o){o||(o=e),hs(n)&&(n=Na.getFitScale(t,e,"cover"===n)),Wa.width=r?e.width*=n:e.width*n,Wa.height=r?e.height*=n:e.height*n,Ca.toPoint(i,Wa,t,o,!0,!0)},getSpread(t,e,i){const n={};return Na.copyAndSpread(n,t,e,!1,i),n},spread(t,e,i){Na.copyAndSpread(t,t,e,!1,i)},shrink(t,e,i){Na.copyAndSpread(t,t,e,!0,i)},ceil(t){const{x:e,y:i}=t;t.x=Da(t.x),t.y=Da(t.y),t.width=e>t.x?Ma(t.width+e-t.x):Ma(t.width),t.height=i>t.y?Ma(t.height+i-t.y):Ma(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=Ra(t.x,e),t.y=Ra(t.y,e),t.width=Ra(t.width,e),t.height=Ra(t.height,e)},add(t,e,i){wa=t.x+t.width,ba=t.y+t.height,Sa=e.x,ka=e.y,i||(Sa+=e.width,ka+=e.height),wa=wa>Sa?wa:Sa,ba=ba>ka?ba:ka,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=wa-t.x,t.height=ba-t.y},addList(t,e){Na.setListWithFn(t,e,void 0,!0)},setList(t,e,i=!1){Na.setListWithFn(t,e,void 0,i)},addListWithFn(t,e,i){Na.setListWithFn(t,e,i,!0)},setListWithFn(t,e,i,n=!1){let r,o=!0;for(let s=0,a=e.length;s<a;s++)r=i?i(e[s],s):e[s],r&&(r.width||r.height)&&(o?(o=!1,n||Va(t,r)):ja(t,r));o&&Na.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?La(Oa,t.x,t.y):Pa(Oa,t.x,t.y)),Ta(Oa,t)},setPoint(t,e){Na.set(t,e.x,e.y)},addPoint(t,e){ja(t,e,!0)},getPoints(t){const{x:e,y:i,width:n,height:r}=t;return[{x:e,y:i},{x:e+n,y:i},{x:e+n,y:i+r},{x:e,y:i+r}]},getPoint:(t,e,i=!1,n)=>ya.getPoint(e,t,n,i),hitRadiusPoint:(t,e,i)=>(i&&(e=la.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=la.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=Na.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=Na.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=Na.tempToOuterOf(e,i)),!Na.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:n,y:r,width:o,height:s}=e;return wa=n+o,ba=r+s,Sa=t.x+t.width,ka=t.y+t.height,n=n>t.x?n:t.x,r=r>t.y?r:t.y,o=(wa=wa<Sa?wa:Sa)-n,s=(ba=ba<ka?ba:ka)-r,{x:n,y:r,width:o,height:s}},intersect(t,e,i){Na.copy(t,Na.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){Na.set(t)}},Na=za,{add:ja,copy:Va}=Na,Ha=class t{get minX(){return za.minX(this)}get minY(){return za.minY(this)}get maxX(){return za.maxX(this)}get maxY(){return za.maxY(this)}constructor(t,e,i,n){this.set(t,e,i,n)}set(t,e,i,n){return ps(t)?za.copy(this,t):za.set(this,t,e,i,n),this}get(){const{x:t,y:e,width:i,height:n}=this;return{x:t,y:e,width:i,height:n}}clone(){return new t(this)}move(t,e){return za.move(this,t,e),this}scale(t,e,i){return za.scale(this,t,e,i),this}scaleOf(t,e,i){return za.scaleOf(this,t,e,i),this}toOuterOf(t,e){return za.toOuterOf(this,t,e),this}toInnerOf(t,e){return za.toInnerOf(this,t,e),this}getFitMatrix(t,e){return za.getFitMatrix(this,t,e)}put(t,e,i){za.put(this,t,e,i)}spread(t,e){return za.spread(this,t,e),this}shrink(t,e){return za.shrink(this,t,e),this}ceil(){return za.ceil(this),this}unsign(){return za.unsign(this),this}float(t){return za.float(this,t),this}add(t){return za.add(this,t),this}addList(t){return za.setList(this,t,!0),this}setList(t){return za.setList(this,t),this}addListWithFn(t,e){return za.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return za.setListWithFn(this,t,e),this}setPoint(t){return za.setPoint(this,t),this}setPoints(t){return za.setPoints(this,t),this}addPoint(t){return za.addPoint(this,t),this}getPoints(){return za.getPoints(this)}getPoint(t,e,i){return za.getPoint(this,t,e,i)}hitPoint(t,e){return za.hitPoint(this,t,e)}hitRadiusPoint(t,e){return za.hitRadiusPoint(this,t,e)}hit(t,e){return za.hit(this,t,e)}includes(t,e){return za.includes(this,t,e)}intersect(t,e){return za.intersect(this,t,e),this}getIntersect(e,i){return new t(za.getIntersectData(this,e,i))}isSame(t){return za.isSame(this,t)}isEmpty(){return za.isEmpty(this)}reset(){za.reset(this)}},Ua=new Ha,Ya=class{constructor(t,e,i,n,r,o){ps(t)?this.copy(t):this.set(t,e,i,n,r,o)}set(t=0,e=0,i=0,n=0,r=0,o=0){this.top=t,this.right=e,this.bottom=i,this.left=n,this.width=r,this.height=o}copy(t){const{top:e,right:i,bottom:n,left:r,width:o,height:s}=t;this.set(e,i,n,r,o,s)}getBoundsFrom(t){const{top:e,right:i,bottom:n,left:r,width:o,height:s}=this;return new Ha(r,e,o||t.width-r-i,s||t.height-e-n)}},Xa={number:(t,e)=>ps(t)?"percent"===t.type?t.value*e:t.value:t},Ga={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:Ka,max:$a}=Math,Za={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,n)=>t.width*t.height*(e?e*i:1)>(n||qa.maxCacheSize),isSuperLarge:(t,e,i)=>qa.isLarge(t,e,i,qa.maxPatternSize),getRealURL(t){const{prefix:e,suffix:i}=qa;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,i,n,r,o,s,a,l,h){const c=$a(Ka(e+(n||0)),1),d=$a(Ka(i+(r||0)),1);let u,p,f;h&&(f=Xa.number(h.offset,"x"===h.type?e:i))&&("x"===h.type?u=!0:p=!0);const g=Za.origin.createCanvas(p?2*c:c,u?2*d:d),v=g.getContext("2d");if(a&&(v.globalAlpha=a),v.imageSmoothingEnabled=!1!==s,qa.canUse(t)){if(o){const n=e/o.width,r=i/o.height;v.setTransform(n,0,0,r,-o.x*n,-o.y*r),v.drawImage(t,0,0,t.width,t.height)}else v.drawImage(t,0,0,e,i);f&&(v.drawImage(g,0,0,c,d,u?f-c:c,u?d:f-d,c,d),v.drawImage(g,0,0,c,d,u?f:c,u?d:f,c,d))}return g},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,i){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}i&&_s.stintSet(i,"transform",e)}}},{image:qa}=Za,{randColor:Ja}=Ms,Qa=class t{constructor(t){this.repeatMap={},this.name=t}static get(e){return new t(e)}static set filter(t){this.filterList=tl(t)}static set exclude(t){this.excludeList=tl(t)}static drawRepaint(t,e){const i=Ja();t.fillWorld(e,i.replace("1)",".1)")),t.strokeWorld(e,i)}static drawBounds(e,i,n){const r="hit"===t.showBounds,o=e.__nowWorld,s=Ja();r&&(i.setWorld(o),e.__drawHitPath(i),i.fillStyle=s.replace("1)",".2)"),i.fill()),i.resetTransform(),i.setStroke(s,2),r?i.stroke():i.strokeWorld(o,s)}log(...t){if(el.enable){if(el.filterList.length&&el.filterList.every(t=>t!==this.name))return;if(el.excludeList.length&&el.excludeList.some(t=>t===this.name))return}}tip(...t){el.enable&&this.warn(...t)}warn(...t){el.showWarn}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(SS){}}};function tl(t){return t?hs(t)&&(t=[t]):t=[],t}Qa.filterList=[],Qa.excludeList=[],Qa.showWarn=!0;var el=Qa,il=Qa.get("RunTime"),nl={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=xs.create(xs.RUNTIME);return rl.currentId=rl.idMap[i]=e?performance.now():Date.now(),rl.currentName=rl.nameMap[i]=t,rl.nameToIdMap[t]=i,i},end(t,e){const i=rl.idMap[t],n=rl.nameMap[t],r=e?(performance.now()-i)/1e3:Date.now()-i;rl.idMap[t]=rl.nameMap[t]=rl.nameToIdMap[n]=void 0,il.log(n,r,"ms")},endOfName(t,e){const i=rl.nameToIdMap[t];as(i)||rl.end(i,e)}},rl=nl,ol=[],sl={list:{},add(t,...e){this.list[t]=!0,ol.push(...e)},has(t,e){const i=this.list[t];return!i&&e&&this.need(t),i},need(t){}};setTimeout(()=>ol.forEach(t=>sl.has(t,!0)));var al={editor:t=>sl.need("editor")},ll=Qa.get("UICreator"),hl={list:{},register(t){const{__tag:e}=t.prototype;cl[e]&&ll.repeat(e),cl[e]=t},get(t,e,i,n,r,o){if(!cl[t])return void ll.warn("not register "+t);const s=new cl[t](e);return as(i)||(s.x=i,n&&(s.y=n),r&&(s.width=r),o&&(s.height=o)),s}},{list:cl}=hl,dl=Qa.get("EventCreator"),ul={nameList:{},register(t){let e;Object.keys(t).forEach(i=>{e=t[i],hs(e)&&(pl[e]&&dl.repeat(e),pl[e]=t)})},changeName(t,e){const i=pl[t];if(i){const n=Object.keys(i).find(e=>i[e]===t);n&&(i[n]=e,pl[e]=i)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new pl[t](...e)},{nameList:pl}=ul,fl=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:i}=this;for(let r=0,o=i.length;r<o;r++)if(e=i[r],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const n=al.canvas(t);return this.add(n),n}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let i=0,n=this.list.length;i<n;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 gl(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function vl(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,a)}l((n=n.apply(t,e||[])).next())})}function _l(t){return(e,i)=>{t||(t=i);const n={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===i&&(n.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,i,n)}}var ml=[];function yl(){return(t,e)=>{ml.push(e)}}var xl=[],wl=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||xl)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;ml.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,i,n,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,i,n,r,o){ps(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,i,n,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,i,n){}strokeRect(t,e,i,n){}clearRect(t,e,i,n){}drawImage(t,e,i,n,r,o,s,a,l){switch(arguments.length){case 9:if(e<0){const t=-e/n*a;n+=e,e=0,o+=t,a-=t}if(i<0){const t=-i/r*l;r+=i,i=0,s+=t,l-=t}this.context.drawImage(t,e,i,n,r,o,s,a,l);break;case 5:this.context.drawImage(t,e,i,n,r);break;case 3:this.context.drawImage(t,e,i)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,i,n,r,o){}quadraticCurveTo(t,e,i,n){}closePath(){}arc(t,e,i,n,r,o){}arcTo(t,e,i,n,r){}ellipse(t,e,i,n,r,o,s,a){}rect(t,e,i,n){}roundRect(t,e,i,n,r){}createConicGradient(t,e,i){}createLinearGradient(t,e,i,n){}createPattern(t,e){}createRadialGradient(t,e,i,n,r,o){}fillText(t,e,i,n){}measureText(t){}strokeText(t,e,i,n){}destroy(){this.context=null}};gl([_l("imageSmoothingEnabled")],wl.prototype,"smooth",void 0),gl([_l("imageSmoothingQuality")],wl.prototype,"smoothLevel",void 0),gl([_l("globalAlpha")],wl.prototype,"opacity",void 0),gl([_l()],wl.prototype,"fillStyle",void 0),gl([_l()],wl.prototype,"strokeStyle",void 0),gl([_l("lineWidth")],wl.prototype,"strokeWidth",void 0),gl([_l("lineCap")],wl.prototype,"strokeCap",void 0),gl([_l("lineJoin")],wl.prototype,"strokeJoin",void 0),gl([_l("lineDashOffset")],wl.prototype,"dashOffset",void 0),gl([_l()],wl.prototype,"miterLimit",void 0),gl([_l()],wl.prototype,"shadowBlur",void 0),gl([_l()],wl.prototype,"shadowColor",void 0),gl([_l()],wl.prototype,"shadowOffsetX",void 0),gl([_l()],wl.prototype,"shadowOffsetY",void 0),gl([_l()],wl.prototype,"filter",void 0),gl([_l()],wl.prototype,"font",void 0),gl([_l()],wl.prototype,"fontKerning",void 0),gl([_l()],wl.prototype,"fontStretch",void 0),gl([_l()],wl.prototype,"fontVariantCaps",void 0),gl([_l()],wl.prototype,"textAlign",void 0),gl([_l()],wl.prototype,"textBaseline",void 0),gl([_l()],wl.prototype,"textRendering",void 0),gl([_l()],wl.prototype,"wordSpacing",void 0),gl([_l()],wl.prototype,"letterSpacing",void 0),gl([_l()],wl.prototype,"direction",void 0),gl([yl()],wl.prototype,"setTransform",null),gl([yl()],wl.prototype,"resetTransform",null),gl([yl()],wl.prototype,"getTransform",null),gl([yl()],wl.prototype,"save",null),gl([yl()],wl.prototype,"restore",null),gl([yl()],wl.prototype,"translate",null),gl([yl()],wl.prototype,"scale",null),gl([yl()],wl.prototype,"rotate",null),gl([yl()],wl.prototype,"fill",null),gl([yl()],wl.prototype,"stroke",null),gl([yl()],wl.prototype,"clip",null),gl([yl()],wl.prototype,"fillRect",null),gl([yl()],wl.prototype,"strokeRect",null),gl([yl()],wl.prototype,"clearRect",null),gl([yl()],wl.prototype,"beginPath",null),gl([yl()],wl.prototype,"moveTo",null),gl([yl()],wl.prototype,"lineTo",null),gl([yl()],wl.prototype,"bezierCurveTo",null),gl([yl()],wl.prototype,"quadraticCurveTo",null),gl([yl()],wl.prototype,"closePath",null),gl([yl()],wl.prototype,"arc",null),gl([yl()],wl.prototype,"arcTo",null),gl([yl()],wl.prototype,"ellipse",null),gl([yl()],wl.prototype,"rect",null),gl([yl()],wl.prototype,"roundRect",null),gl([yl()],wl.prototype,"createConicGradient",null),gl([yl()],wl.prototype,"createLinearGradient",null),gl([yl()],wl.prototype,"createPattern",null),gl([yl()],wl.prototype,"createRadialGradient",null),gl([yl()],wl.prototype,"fillText",null),gl([yl()],wl.prototype,"measureText",null),gl([yl()],wl.prototype,"strokeText",null);var{copy:bl,multiplyParent:Sl,pixelScale:kl}=Zs,{round:El}=Math,Cl=new Ha,Ol=new Ha,Ll={width:1,height:1,pixelRatio:1},Pl=["width","height","pixelRatio"],Tl=class extends wl{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=Ll),this.manager=e,this.innerId=xs.create(xs.CNAVAS);const{width:i,height:n,pixelRatio:r}=t;this.autoLayout=!i||!n,this.size.pixelRatio=r||Za.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 n=this.size;_s.copyAttrs(n,t,Pl),Pl.forEach(t=>n[t]||(n[t]=1)),this.bounds=new Ha(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:n}=this,r=this.worldTransform;e&&Sl(t,e,r),kl(t,i,r),n&&!t.ignorePixelSnap&&(t.half&&t.half*i%2?(r.e=El(r.e-.5)+.5,r.f=El(r.f-.5)+.5):(r.e=El(r.e),r.f=El(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.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,n){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),i&&this.setStrokeOptions(i,n)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:n,dashPattern:r,dashOffset:o,miterLimit:s}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(n=e.strokeJoin),as(e.dashPattern)||(r=e.dashPattern),as(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(s=e.miterLimit)),this.strokeCap=i,this.strokeJoin=n,this.dashPattern=r,this.dashOffset=o,this.miterLimit=s}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,n){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=i*r,this.shadowColor=n||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,i,n,r){n&&(this.blendMode=n),e?(this.setTempPixelBounds(e,r),i?(this.setTempPixelBounds2(i,r),i=Ol):i=Cl,this.drawImage(t.view,Cl.x,Cl.y,Cl.width,Cl.height,i.x,i.y,i.width,i.height)):this.drawImage(t.view,0,0),n&&(this.blendMode="source-over")}copyWorldToInner(t,e,i,n,r){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,za.tempToOuterOf(i,e),n,r),this.restore()):(n&&(this.blendMode=n),this.setTempPixelBounds(e,r),this.drawImage(t.view,Cl.x,Cl.y,Cl.width,Cl.height,i.x,i.y,i.width,i.height),n&&(this.blendMode="source-over"))}copyWorldByReset(t,e,i,n,r,o){this.resetTransform(),this.copyWorld(t,e,i,n,o),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,i;this.setTempPixelBounds(t,!0,!0);const{context:n}=this,r=n.getImageData(Cl.x,Cl.y,Cl.width,Cl.height),{data:o}=r;for(let s=0,a=o.length;s<a;s+=4)i=.299*o[s]+.587*o[s+1]+.114*o[s+2],(e=o[s+3])&&(o[s+3]=255===e?i:e*(i/255));n.putImageData(r,Cl.x,Cl.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,n){i&&(this.blendMode=i),this.fillStyle=e,this.setTempPixelBounds(t,n),this.fillRect(Cl.x,Cl.y,Cl.width,Cl.height),i&&(this.blendMode="source-over")}strokeWorld(t,e,i,n){i&&(this.blendMode=i),this.strokeStyle=e,this.setTempPixelBounds(t,n),this.strokeRect(Cl.x,Cl.y,Cl.width,Cl.height),i&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Cl.x,Cl.y,Cl.width,Cl.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Cl.x,Cl.y,Cl.width,Cl.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,i){this.copyToPixelBounds(Cl,t,e,i)}setTempPixelBounds2(t,e,i){this.copyToPixelBounds(Ol,t,e,i)}copyToPixelBounds(t,e,i,n){t.set(e),n&&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:n}=this,r=this.manager?this.manager.get(i):al.canvas(Object.assign({},i));return r.save(),t&&(bl(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==n&&(r.pixelSnap=n),r}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}},Bl={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Rl={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Al=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},Rl),Dl={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},Ml={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},Il=Object.assign(Object.assign({},Ml),Rl),Fl=Al,Wl={};for(let _O in Fl)Wl[Fl[_O]]=_O;var zl={};for(let _O in Fl)zl[Fl[_O]]=Dl[_O];var Nl,jl,Vl,Hl={drawRoundRect(t,e,i,n,r,o){const s=Ms.fourNumber(o,Math.min(n/2,r/2)),a=e+n,l=i+r;s[0]?t.moveTo(e+s[0],i):t.moveTo(e,i),s[1]?t.arcTo(a,i,a,l,s[1]):t.lineTo(a,i),s[2]?t.arcTo(a,l,e,l,s[2]):t.lineTo(a,l),s[3]?t.arcTo(e,l,e,i,s[3]):t.lineTo(e,l),s[0]?t.arcTo(e,i,a,i,s[0]):t.lineTo(e,i)}},{sin:Ul,cos:Yl,hypot:Xl,atan2:Gl,ceil:Kl,abs:$l,PI:Zl,sqrt:ql,pow:Jl}=Math,{setPoint:Ql,addPoint:th}=va,{set:eh,toNumberPoints:ih}=la,{M:nh,L:rh,C:oh,Q:sh,Z:ah}=Al,lh={},hh={points(t,e,i,n){let r=ih(e);if(t.push(nh,r[0],r[1]),i&&r.length>5){let e,o,s,a,l,h,c,d,u,p,f,g,v,_,m,y=r.length;const x=!0===i?.5:i;n&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let i=2;i<y-2;i+=2)e=r[i-2],o=r[i-1],s=r[i],a=r[i+1],l=r[i+2],h=r[i+3],f=s-e,g=a-o,v=ql(Jl(f,2)+Jl(g,2)),_=ql(Jl(l-s,2)+Jl(h-a,2)),(v||_)&&(m=v+_,v=x*v/m,_=x*_/m,l-=e,h-=o,c=s-v*l,d=a-v*h,2===i?n||t.push(sh,c,d,s,a):(f||g)&&t.push(oh,u,p,c,d,s,a),u=s+_*l,p=a+_*h);n||t.push(sh,u,p,r[y-2],r[y-1])}else for(let o=2,s=r.length;o<s;o+=2)t.push(rh,r[o],r[o+1]);n&&t.push(ah)},rect(t,e,i,n,r){Bl.creator.path=t,Bl.creator.moveTo(e,i).lineTo(e+n,i).lineTo(e+n,i+r).lineTo(e,i+r).lineTo(e,i)},roundRect(t,e,i,n,r,o){Bl.creator.path=[],Hl.drawRoundRect(Bl.creator,e,i,n,r,o),t.push(...Bl.convertToCanvasData(Bl.creator.path,!0))},arcTo(t,e,i,n,r,o,s,a,l,h,c){const d=n-e,u=r-i,p=o-n,f=s-r;let g=Gl(u,d),v=Gl(f,p);const _=Xl(d,u),m=Xl(p,f);let y=v-g;if(y<0&&(y+=Ws),_<1e-12||m<1e-12||y<1e-12||$l(y-Zl)<1e-12)return t&&t.push(rh,n,r),l&&(Ql(l,e,i),th(l,n,r)),c&&eh(c,e,i),void(h&&eh(h,n,r));const x=d*f-p*u<0,w=x?-1:1,b=a/Yl(y/2),S=n+b*Yl(g+y/2+zs*w),k=r+b*Ul(g+y/2+zs*w);return g-=zs*w,v-=zs*w,uh(t,S,k,a,a,0,g/Fs,v/Fs,x,l,h,c)},arc:(t,e,i,n,r,o,s,a,l,h)=>uh(t,e,i,n,n,0,r,o,s,a,l,h),ellipse(t,e,i,n,r,o,s,a,l,h,c,d){const u=o*Fs,p=Ul(u),f=Yl(u);let g=s*Fs,v=a*Fs;g>Zl&&(g-=Ws),v<0&&(v+=Ws);let _=v-g;_<0?_+=Ws:_>Ws&&(_-=Ws),l&&(_-=Ws);const m=Kl($l(_/zs)),y=_/m,x=Ul(y/4),w=8/3*x*x/Ul(y/2);v=g+y;let b,S,k,E,C,O,L,P,T=Yl(g),B=Ul(g),R=k=f*n*T-p*r*B,A=E=p*n*T+f*r*B,D=e+k,M=i+E;t&&t.push(t.length?rh:nh,D,M),h&&Ql(h,D,M),d&&eh(d,D,M);for(let I=0;I<m;I++)b=Yl(v),S=Ul(v),k=f*n*b-p*r*S,E=p*n*b+f*r*S,C=e+R-w*(f*n*B+p*r*T),O=i+A-w*(p*n*B-f*r*T),L=e+k+w*(f*n*S+p*r*b),P=i+E+w*(p*n*S-f*r*b),t&&t.push(oh,C,O,L,P,e+k,i+E),h&&dh(e+R,i+A,C,O,L,P,e+k,i+E,h,!0),R=k,A=E,T=b,B=S,g=v,v+=y;c&&eh(c,e+k,i+E)},quadraticCurveTo(t,e,i,n,r,o,s){t.push(oh,(e+2*n)/3,(i+2*r)/3,(o+2*n)/3,(s+2*r)/3,o,s)},toTwoPointBoundsByQuadraticCurve(t,e,i,n,r,o,s,a){dh(t,e,(t+2*i)/3,(e+2*n)/3,(r+2*i)/3,(o+2*n)/3,r,o,s,a)},toTwoPointBounds(t,e,i,n,r,o,s,a,l,h){const c=[];let d,u,p,f,g,v,_,m,y=t,x=i,w=r,b=s;for(let S=0;S<2;++S)if(1==S&&(y=e,x=n,w=o,b=a),d=-3*y+9*x-9*w+3*b,u=6*y-12*x+6*w,p=3*x-3*y,Math.abs(d)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f)}else _=u*u-4*p*d,m=Math.sqrt(_),_<0||(g=(-u+m)/(2*d),0<g&&g<1&&c.push(g),v=(-u-m)/(2*d),0<v&&v<1&&c.push(v));h?th(l,t,e):Ql(l,t,e),th(l,s,a);for(let S=0,k=c.length;S<k;S++)ch(c[S],t,e,i,n,r,o,s,a,lh),th(l,lh.x,lh.y)},getPointAndSet(t,e,i,n,r,o,s,a,l,h){const c=1-t,d=c*c*c,u=3*c*c*t,p=3*c*t*t,f=t*t*t;h.x=d*e+u*n+p*o+f*a,h.y=d*i+u*r+p*s+f*l},getPoint(t,e,i,n,r,o,s,a,l){const h={};return ch(t,e,i,n,r,o,s,a,l,h),h},getDerivative(t,e,i,n,r){const o=1-t;return 3*o*o*(i-e)+6*o*t*(n-i)+3*t*t*(r-n)},cut(t,e,i,n,r,o,s,a,l){if(t<=0)return{left:null,right:[n,r,o,s,a,l]};if(t>=1)return{left:[n,r,o,s,a,l],right:null};const h=1-t,c=e*h+n*t,d=i*h+r*t,u=n*h+o*t,p=r*h+s*t,f=o*h+a*t,g=s*h+l*t,v=c*h+u*t,_=d*h+p*t,m=u*h+f*t,y=p*h+g*t;return{left:[c,d,v,_,v*h+m*t,_*h+y*t],right:[m,y,f,g,a,l]}}},{getPointAndSet:ch,toTwoPointBounds:dh,ellipse:uh}=hh,{sin:ph,cos:fh,sqrt:gh,atan2:vh}=Math,{ellipse:_h}=hh,mh={ellipticalArc(t,e,i,n,r,o,s,a,l,h,c){const d=(l-e)/2,u=(h-i)/2,p=o*Fs,f=ph(p),g=fh(p),v=-g*d-f*u,_=-g*u+f*d,m=n*n,y=r*r,x=_*_,w=v*v,b=m*y-m*x-y*w;let S=0;if(b<0){const t=gh(1-b/(m*y));n*=t,r*=t}else S=(s===a?-1:1)*gh(b/(m*x+y*w));const k=S*n*_/r,E=-S*r*v/n,C=vh((_-E)/r,(v-k)/n),O=vh((-_-E)/r,(-v-k)/n);let L=O-C;0===a&&L>0?L-=Ws:1===a&&L<0&&(L+=Ws);const P=e+d+g*k-f*E,T=i+u+f*k+g*E,B=L<0?1:0;c||Za.ellipseToCurve?_h(t,P,T,n,r,o,C/Fs,O/Fs,B):n!==r||o?t.push(Al.G,P,T,n,r,o,C/Fs,O/Fs,B):t.push(Al.O,P,T,n,C/Fs,O/Fs,B)}},yh=t=>[],{M:xh,m:wh,L:bh,l:Sh,H:kh,h:Eh,V:Ch,v:Oh,C:Lh,c:Ph,S:Th,s:Bh,Q:Rh,q:Ah,T:Dh,t:Mh,A:Ih,a:Fh,Z:Wh,z:zh,N:Nh,D:jh,X:Vh,G:Hh,F:Uh,O:Yh,P:Xh,U:Gh}=Al,{rect:Kh,roundRect:$h,arcTo:Zh,arc:qh,ellipse:Jh,quadraticCurveTo:Qh}=hh,{ellipticalArc:tc}=mh,ec=Qa.get("PathConvert"),ic={},nc={current:{dot:0},stringify(t,e){let i,n,r,o=0,s=t.length,a="";for(;o<s;){n=t[o],i=zl[n],a+=n===r?" ":Wl[n];for(let n=1;n<i;n++)a+=Ms.float(t[o+n],e),n===i-1||(a+=" ");r=n,o+=i}return a},parse(t,e){let i,n,r,o="";const s=[],a=e?Il:Ml;for(let l=0,h=t.length;l<h;l++)n=t[l],Ga[n]?("."===n&&(rc.dot&&(oc(s,o),o=""),rc.dot++),"0"===o&&"."!==n&&(oc(s,o),o=""),o+=n):Al[n]?(o&&(oc(s,o),o=""),rc.name=Al[n],rc.length=Dl[n],rc.index=0,oc(s,rc.name),!i&&a[n]&&(i=!0)):"-"===n||"+"===n?"e"===r||"E"===r?o+=n:(o&&oc(s,o),o=n):o&&(oc(s,o),o=""),r=n;return o&&oc(s,o),i?nc.toCanvasData(s,e):s},toCanvasData(t,e){let i,n,r,o,s,a=0,l=0,h=0,c=0,d=0,u=t.length;const p=[];for(;d<u;){switch(r=t[d],r){case wh:t[d+1]+=a,t[d+2]+=l;case xh:a=t[d+1],l=t[d+2],p.push(xh,a,l),d+=3;break;case Eh:t[d+1]+=a;case kh:a=t[d+1],p.push(bh,a,l),d+=2;break;case Oh:t[d+1]+=l;case Ch:l=t[d+1],p.push(bh,a,l),d+=2;break;case Sh:t[d+1]+=a,t[d+2]+=l;case bh:a=t[d+1],l=t[d+2],p.push(bh,a,l),d+=3;break;case Bh:t[d+1]+=a,t[d+2]+=l,t[d+3]+=a,t[d+4]+=l,r=Th;case Th:s=o===Lh||o===Th,h=s?2*a-i:t[d+1],c=s?2*l-n:t[d+2],i=t[d+1],n=t[d+2],a=t[d+3],l=t[d+4],p.push(Lh,h,c,i,n,a,l),d+=5;break;case Ph:t[d+1]+=a,t[d+2]+=l,t[d+3]+=a,t[d+4]+=l,t[d+5]+=a,t[d+6]+=l,r=Lh;case Lh:i=t[d+3],n=t[d+4],a=t[d+5],l=t[d+6],p.push(Lh,t[d+1],t[d+2],i,n,a,l),d+=7;break;case Mh:t[d+1]+=a,t[d+2]+=l,r=Dh;case Dh:s=o===Rh||o===Dh,i=s?2*a-i:t[d+1],n=s?2*l-n:t[d+2],e?Qh(p,a,l,i,n,t[d+1],t[d+2]):p.push(Rh,i,n,t[d+1],t[d+2]),a=t[d+1],l=t[d+2],d+=3;break;case Ah:t[d+1]+=a,t[d+2]+=l,t[d+3]+=a,t[d+4]+=l,r=Rh;case Rh:i=t[d+1],n=t[d+2],e?Qh(p,a,l,i,n,t[d+3],t[d+4]):p.push(Rh,i,n,t[d+3],t[d+4]),a=t[d+3],l=t[d+4],d+=5;break;case Fh:t[d+6]+=a,t[d+7]+=l;case Ih:tc(p,a,l,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],l=t[d+7],d+=8;break;case zh:case Wh:p.push(Wh),d++;break;case Nh:a=t[d+1],l=t[d+2],e?Kh(p,a,l,t[d+3],t[d+4]):sc(p,t,d,5),d+=5;break;case jh:a=t[d+1],l=t[d+2],e?$h(p,a,l,t[d+3],t[d+4],[t[d+5],t[d+6],t[d+7],t[d+8]]):sc(p,t,d,9),d+=9;break;case Vh:a=t[d+1],l=t[d+2],e?$h(p,a,l,t[d+3],t[d+4],t[d+5]):sc(p,t,d,6),d+=6;break;case Hh:Jh(e?p:sc(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,ic),a=ic.x,l=ic.y,d+=9;break;case Uh:e?Jh(p,t[d+1],t[d+2],t[d+3],t[d+4],0,0,360,!1):sc(p,t,d,5),a=t[d+1]+t[d+3],l=t[d+2],d+=5;break;case Yh:qh(e?p:sc(p,t,d,7),t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],null,ic),a=ic.x,l=ic.y,d+=7;break;case Xh:e?qh(p,t[d+1],t[d+2],t[d+3],0,360,!1):sc(p,t,d,4),a=t[d+1]+t[d+3],l=t[d+2],d+=4;break;case Gh:Zh(e?p:sc(p,t,d,6),a,l,t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],null,ic),a=ic.x,l=ic.y,d+=6;break;default:return ec.error(`command: ${r} [index:${d}]`,t),p}o=r}return p},objectToCanvasData(t){if(t[0].name.length>1)return yh(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(xh,t.x,t.y);break;case"L":e.push(bh,t.x,t.y);break;case"C":e.push(Lh,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(Wh)}}),e}},copyData(t,e,i,n){for(let r=i,o=i+n;r<o;r++)t.push(e[r])},pushData(t,e){rc.index===rc.length&&(rc.index=1,t.push(rc.name)),t.push(Number(e)),rc.index++,rc.dot=0}},{current:rc,pushData:oc,copyData:sc}=nc,{M:ac,L:lc,C:hc,Q:cc,Z:dc,N:uc,D:pc,X:fc,G:gc,F:vc,O:_c,P:mc,U:yc}=Al,{getMinDistanceFrom:xc,getRadianFrom:wc}=la,{tan:bc,min:Sc,abs:kc}=Math,Ec={},Cc={beginPath(t){t.length=0},moveTo(t,e,i){t.push(ac,e,i)},lineTo(t,e,i){t.push(lc,e,i)},bezierCurveTo(t,e,i,n,r,o,s){t.push(hc,e,i,n,r,o,s)},quadraticCurveTo(t,e,i,n,r){t.push(cc,e,i,n,r)},closePath(t){t.push(dc)},rect(t,e,i,n,r){t.push(uc,e,i,n,r)},roundRect(t,e,i,n,r,o){if(ds(o))t.push(fc,e,i,n,r,o);else{const s=Ms.fourNumber(o);s?t.push(pc,e,i,n,r,...s):t.push(uc,e,i,n,r)}},ellipse(t,e,i,n,r,o,s,a,l){if(n===r)return Lc(t,e,i,n,s,a,l);ls(o)?t.push(vc,e,i,n,r):(ls(s)&&(s=0),ls(a)&&(a=360),t.push(gc,e,i,n,r,o,s,a,l?1:0))},arc(t,e,i,n,r,o,s){ls(r)?t.push(mc,e,i,n):(ls(r)&&(r=0),ls(o)&&(o=360),t.push(_c,e,i,n,r,o,s?1:0))},arcTo(t,e,i,n,r,o,s,a,l){if(!as(s)){const t=xc(s,a,e,i,n,r)/(l?1:2);o=Sc(o,Sc(t,t*kc(bc(wc(s,a,e,i,n,r)/2))))}t.push(yc,e,i,n,r,o)},drawEllipse(t,e,i,n,r,o,s,a,l){hh.ellipse(null,e,i,n,r,ls(o)?0:o,ls(s)?0:s,ls(a)?360:a,l,null,null,Ec),t.push(ac,Ec.x,Ec.y),Oc(t,e,i,n,r,o,s,a,l)},drawArc(t,e,i,n,r,o,s){hh.arc(null,e,i,n,ls(r)?0:r,ls(o)?360:o,s,null,null,Ec),t.push(ac,Ec.x,Ec.y),Lc(t,e,i,n,r,o,s)},drawPoints(t,e,i,n){hh.points(t,e,i,n)}},{ellipse:Oc,arc:Lc}=Cc,{moveTo:Pc,lineTo:Tc,quadraticCurveTo:Bc,bezierCurveTo:Rc,closePath:Ac,beginPath:Dc,rect:Mc,roundRect:Ic,ellipse:Fc,arc:Wc,arcTo:zc,drawEllipse:Nc,drawArc:jc,drawPoints:Vc}=Cc,Hc=class{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?hs(t)?Bl.parse(t):t:[],this}beginPath(){return Dc(this.__path),this.paint(),this}moveTo(t,e){return Pc(this.__path,t,e),this.paint(),this}lineTo(t,e){return Tc(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,i,n,r,o){return Rc(this.__path,t,e,i,n,r,o),this.paint(),this}quadraticCurveTo(t,e,i,n){return Bc(this.__path,t,e,i,n),this.paint(),this}closePath(){return Ac(this.__path),this.paint(),this}rect(t,e,i,n){return Mc(this.__path,t,e,i,n),this.paint(),this}roundRect(t,e,i,n,r){return Ic(this.__path,t,e,i,n,r),this.paint(),this}ellipse(t,e,i,n,r,o,s,a){return Fc(this.__path,t,e,i,n,r,o,s,a),this.paint(),this}arc(t,e,i,n,r,o){return Wc(this.__path,t,e,i,n,r,o),this.paint(),this}arcTo(t,e,i,n,r){return zc(this.__path,t,e,i,n,r),this.paint(),this}drawEllipse(t,e,i,n,r,o,s,a){return Nc(this.__path,t,e,i,n,r,o,s,a),this.paint(),this}drawArc(t,e,i,n,r,o){return jc(this.__path,t,e,i,n,r,o),this.paint(),this}drawPoints(t,e,i){return Vc(this.__path,t,e,i),this.paint(),this}clearPath(){return this.beginPath()}paint(){}},{M:Uc,L:Yc,C:Xc,Q:Gc,Z:Kc,N:$c,D:Zc,X:qc,G:Jc,F:Qc,O:td,P:ed,U:id}=Al,nd=Qa.get("PathDrawer"),rd={drawPathByData(t,e){if(!e)return;let i,n=0,r=e.length;for(;n<r;)switch(i=e[n],i){case Uc:t.moveTo(e[n+1],e[n+2]),n+=3;break;case Yc:t.lineTo(e[n+1],e[n+2]),n+=3;break;case Xc:t.bezierCurveTo(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6]),n+=7;break;case Gc:t.quadraticCurveTo(e[n+1],e[n+2],e[n+3],e[n+4]),n+=5;break;case Kc:t.closePath(),n+=1;break;case $c:t.rect(e[n+1],e[n+2],e[n+3],e[n+4]),n+=5;break;case Zc:t.roundRect(e[n+1],e[n+2],e[n+3],e[n+4],[e[n+5],e[n+6],e[n+7],e[n+8]]),n+=9;break;case qc:t.roundRect(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]),n+=6;break;case Jc:t.ellipse(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]*Fs,e[n+6]*Fs,e[n+7]*Fs,e[n+8]),n+=9;break;case Qc:t.ellipse(e[n+1],e[n+2],e[n+3],e[n+4],0,0,Ws,!1),n+=5;break;case td:t.arc(e[n+1],e[n+2],e[n+3],e[n+4]*Fs,e[n+5]*Fs,e[n+6]),n+=7;break;case ed:t.arc(e[n+1],e[n+2],e[n+3],0,Ws,!1),n+=4;break;case id:t.arcTo(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]),n+=6;break;default:return void nd.error(`command: ${i} [index:${n}]`,e)}}},{M:od,L:sd,C:ad,Q:ld,Z:hd,N:cd,D:dd,X:ud,G:pd,F:fd,O:gd,P:vd,U:_d}=Al,{toTwoPointBounds:md,toTwoPointBoundsByQuadraticCurve:yd,arcTo:xd,arc:wd,ellipse:bd}=hh,{addPointBounds:Sd,copy:kd,addPoint:Ed,setPoint:Cd,addBounds:Od,toBounds:Ld}=va,Pd=Qa.get("PathBounds"),Td={},Bd={},Rd={},Ad={toBounds(t,e){Ad.toTwoPointBounds(t,Bd),Ld(Bd,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Cd(e,0,0);let i,n,r,o,s,a=0,l=0,h=0;const c=t.length;for(;a<c;)switch(s=t[a],0===a&&(s===hd||s===ad||s===ld?Cd(e,l,h):Cd(e,t[a+1],t[a+2])),s){case od:case sd:l=t[a+1],h=t[a+2],Ed(e,l,h),a+=3;break;case ad:r=t[a+5],o=t[a+6],md(l,h,t[a+1],t[a+2],t[a+3],t[a+4],r,o,Td),Sd(e,Td),l=r,h=o,a+=7;break;case ld:i=t[a+1],n=t[a+2],r=t[a+3],o=t[a+4],yd(l,h,i,n,r,o,Td),Sd(e,Td),l=r,h=o,a+=5;break;case hd:a+=1;break;case cd:l=t[a+1],h=t[a+2],Od(e,l,h,t[a+3],t[a+4]),a+=5;break;case dd:case ud:l=t[a+1],h=t[a+2],Od(e,l,h,t[a+3],t[a+4]),a+=s===dd?9:6;break;case pd:bd(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],Td,Rd),0===a?kd(e,Td):Sd(e,Td),l=Rd.x,h=Rd.y,a+=9;break;case fd:l=t[a+1],h=t[a+2],jl=t[a+3],Vl=t[a+4],Od(e,l-jl,h-Vl,2*jl,2*Vl),l+=jl,a+=5;break;case gd:wd(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Td,Rd),0===a?kd(e,Td):Sd(e,Td),l=Rd.x,h=Rd.y,a+=7;break;case vd:l=t[a+1],h=t[a+2],Nl=t[a+3],Od(e,l-Nl,h-Nl,2*Nl,2*Nl),l+=Nl,a+=4;break;case _d:xd(null,l,h,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Td,Rd),0===a?kd(e,Td):Sd(e,Td),l=Rd.x,h=Rd.y,a+=6;break;default:return void Pd.error(`command: ${s} [index:${a}]`,t)}}},{M:Dd,L:Md,Z:Id}=Al,{getCenterX:Fd,getCenterY:Wd}=la,{arcTo:zd}=Cc,Nd={smooth(t,e,i){let n,r,o,s=0,a=0,l=0,h=0,c=0,d=0,u=0,p=0,f=0;us(e)&&(e=e[0]||0);const g=t.length,v=9===g,_=[];for(;s<g;){switch(n=t[s],n){case Dd:h=p=t[s+1],c=f=t[s+2],s+=3,t[s]===Md?(d=t[s+1],u=t[s+2],v?_.push(Dd,h,c):_.push(Dd,Fd(h,d),Wd(c,u))):_.push(Dd,h,c);break;case Md:switch(a=t[s+1],l=t[s+2],s+=3,t[s]){case Md:zd(_,a,l,t[s+1],t[s+2],e,p,f,v);break;case Id:zd(_,a,l,h,c,e,p,f,v);break;default:_.push(Md,a,l)}p=a,f=l;break;case Id:r!==Id&&(zd(_,h,c,d,u,e,p,f,v),_.push(Id)),s+=1;break;default:o=zl[n];for(let e=0;e<o;e++)_.push(t[s+e]);s+=o}r=n}return n!==Id&&(_[1]=h,_[2]=c),_}};function jd(t){return new Hc(t)}var Vd=jd();Bl.creator=jd(),Bl.parse=nc.parse,Bl.convertToCanvasData=nc.toCanvasData;var{drawRoundRect:Hd}=Hl;function Ud(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,i,n,r){Hd(this,t,e,i,n,r)})}(t)}var Yd={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=Xd.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{}}}},Xd=Yd;Xd.mineType=Xd.mimeType,Xd.alphaPixelTypes.forEach(t=>Xd.upperCaseTypeMap[t]=t.toUpperCase());var Gd=Qa.get("TaskProcessor"),Kd=class{constructor(t){this.parallel=!0,this.time=1,this.id=xs.create(xs.TASK),this.task=t}run(){return vl(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(bS){Gd.error(bS)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}},$d=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 n=0;n<t;n++)n<=this.finishedIndex?(i+=this.list[n].time,n===this.finishedIndex&&(e=i)):e+=this.list[n].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&&_s.assign(this.config,t),this.empty()}add(t,e,i){let n,r,o,s;const a=new Kd(t);return a.parent=this,ds(e)?s=e:e&&(r=e.parallel,n=e.start,o=e.time,s=e.delay,i||(i=e.canUse)),o&&(a.time=o),!1===r&&(a.parallel=!1),i&&(a.canUse=i),as(s)?this.push(a,n):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,n))},s)),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:n}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=n+e.parallel;if(r>i.length&&(r=i.length),e.parallel>1)for(let o=n;o<r&&(t=i[o],t.parallel);o++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const i=e.length,n=this.finishedIndex+i;if(e.length){if(!this.running)return;n<this.total&&(t=this.list[n],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()}},Zd=Qa.get("Resource"),qd={tasker:new $d,queue:new $d({parallel:1}),map:{},get isComplete(){return Jd.tasker.isComplete},set(t,e){Jd.map[t]&&Zd.repeat(t),Jd.map[t]=e},get:t=>Jd.map[t],remove(t){const e=Jd.map[t];e&&(e.destroy&&e.destroy(),delete Jd.map[t])},loadImage(t,e){return new Promise((i,n)=>{const r=this.setImage(t,t,e);r.load(()=>i(r),t=>n(t))})},setImage(t,e,i){let n;return hs(e)?n={url:e}:e.url||(n={url:t,view:e}),n&&(i&&(n.format=i),e=al.image(n)),Jd.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){Jd.map={}}},Jd=qd,Qd={maxRecycled:10,recycledList:[],patternTasker:qd.queue,get(t,e){let i=qd.get(t.url);return i||qd.set(t.url,i="film"===e?al.film(t):al.image(t)),i.use++,i},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||(Za.image.isLarge(t)?t.url&&qd.remove(t.url):(t.clearLevels(),tu.recycledList.push(t)))})},recyclePaint(t){tu.recycle(t.image)},clearRecycled(t){const e=tu.recycledList;(e.length>tu.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&qd.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Yd.alphaPixelTypes.some(e=>tu.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:"+Yd.mimeType(t)))return!0}else{if(i.includes("."+t)||i.includes("."+Yd.upperCaseTypeMap[t]))return!0;if("png"===t&&!i.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},tu=Qd,{IMAGE:eu,create:iu}=xs,nu=class{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return as(t)?Za.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=iu(eu),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Qd.isFormat("svg",t)&&(this.isSVG=!0),Qd.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,i){return this.loading||(this.loading=!0,qd.tasker.add(()=>vl(this,void 0,void 0,function*(){return yield Za.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,n)=>{e=n%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,n,r,o,s,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 l=Za.image.resize(this.view,t,e,r,o,void 0,s,i,n,a);return this.cache=this.use>1?{data:l,params:arguments}:null,l}getPattern(t,e,i,n){const r=Za.canvas.createPattern(t,e);return Za.image.setPatternTransform(r,i,n),r}render(t,e,i,n,r,o,s,a,l){t.drawImage(this.view,e,i,n,r)}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 ru(t,e,i,n){n||(i.configurable=i.enumerable=!0),Object.defineProperty(t,e,i)}function ou(t,e){return Object.getOwnPropertyDescriptor(t,e)}function su(t,e){return(i,n)=>function(t,e,i,n){ru(t,e,Object.assign({get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}},n||{})),Eu(t,e,i)}(i,n,t,e&&e(n))}function au(t){return su(t)}function lu(t,e){return su(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function hu(t,e){return su(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function cu(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),fu(this))}}))}function du(t,e){return su(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function uu(t,e){return su(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function pu(t,e){return su(t,t=>({set(i){this.__setAttr(t,i,e)&&fu(this)}}))}function fu(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}var gu=pu;function vu(t,e){return su(t,t=>({set(i){this.__setAttr(t,i)&&(function(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&fu(t)}(this),e&&(this.__.__useStroke=!0))}}))}var _u=vu;function mu(t){return su(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function yu(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function xu(t){return su(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;_s.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function wu(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function bu(t,e,i,n){t.__setAttr(e,i)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==n&&0!==i||fu(t))}function Su(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function ku(t){return(e,i)=>{ru(e,"__DataProcessor",{get:()=>t})}}function Eu(t,e,i){const n=t.__DataProcessor.prototype,r="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),s=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(as(i))s.get=function(){return this[r]};else if("function"==typeof i)s.get=function(){const t=this[r];return null==t?i(this.__leaf):t};else if(ps(i)){const t=function(t){return"{}"===JSON.stringify(t)}(i);s.get=function(){const e=this[r];return null==e?this[r]=t?{}:_s.clone(i):e}}const a=t.isBranchLeaf;"width"===e?s.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalWidth,n=t.__leaf;return!i||n.pathInputed?n.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:a&&n.children.length?n.boxBounds.width:i}return t}:"height"===e&&(s.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalHeight,n=t.__leaf;return!i||n.pathInputed?n.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:a&&n.children.length?n.boxBounds.height:i}return t});let l,h=n;for(;!l&&h;)l=ou(h,e),h=h.__proto__;l&&l.set&&(s.set=l.set),n[o]&&(s.set=n[o],delete n[o]),ru(n,e,s)}var Cu=new Qa("rewrite"),Ou=[],Lu=["destroy","constructor"];function Pu(t){return(e,i)=>{Ou.push({name:e.constructor.name+"."+i,run:()=>{e[i]=t}})}}function Tu(){return t=>{Bu()}}function Bu(t){Ou.length&&(Ou.forEach(e=>{t&&Cu.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Ou.length=0)}function Ru(t,e){return i=>{var n;(t.prototype?(n=t.prototype,Object.getOwnPropertyNames(n)):Object.keys(t)).forEach(n=>{Lu.includes(n)||e&&e.includes(n)||(t.prototype?ou(t.prototype,n).writable&&(i.prototype[n]=t.prototype[n]):i.prototype[n]=t[n])})}}function Au(){return t=>{hl.register(t)}}function Du(){return t=>{ul.register(t)}}setTimeout(()=>Bu(!0));var{copy:Mu,toInnerPoint:Iu,toOuterPoint:Fu,scaleOfOuter:Wu,rotateOfOuter:zu,skewOfOuter:Nu,multiplyParent:ju,divideParent:Vu,getLayout:Hu}=Zs,Uu={},{round:Yu}=Math,Xu={updateAllMatrix(t,e,i){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(i=!0),$u(t,e,i),t.isBranch){const{children:n}=t;for(let t=0,r=n.length;t<r;t++)Ku(n[t],e,i)}},updateMatrix(t,e,i){const n=t.__layout;e?i&&(n.waitAutoLayout=!0,t.__hasAutoLayout&&(n.matrixChanged=!1)):n.waitAutoLayout&&(n.waitAutoLayout=!1),n.matrixChanged&&t.__updateLocalMatrix(),n.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++)Zu(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Zu(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&Gu.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(Ju(t),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)qu(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,n,r,o){n||(n=t.__nowWorld),t.__worldFlipped||Za.fullImageShadow?e.copyWorldByReset(i,n,t.__nowWorld,r,o):e.copyWorldToInner(i,n,t.__layout.renderBounds,r)},renderComplex(t,e,i){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,i=0,n,r){const o=ps(e)?Object.assign({},e):{x:e,y:i};n?Fu(t.localTransform,o,o,!0):t.parent&&Iu(t.parent.scrollWorldTransform,o,o,!0),Gu.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,i=0,n){ps(e)&&(i=e.y,e=e.x),e+=t.x,i+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Yu(e),i=Yu(i)),n?t.animate({x:e,y:i},n):(t.x=e,t.y=i)},zoomOfWorld(t,e,i,n,r,o){Gu.zoomOfLocal(t,Qu(t,e),i,n,r,o)},zoomOfLocal(t,e,i,n=i,r,o){const s=t.__localMatrix;if(ds(n)||(n&&(o=n),n=i),Mu(Uu,s),Wu(Uu,e,i,n),Gu.hasHighPosition(t))Gu.setTransform(t,Uu,r,o);else{const e=t.x+Uu.e-s.e,a=t.y+Uu.f-s.f;o&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*i,scaleY:t.scaleY*n},o):(t.x=e,t.y=a,t.scaleResize(i,n,!0!==r))}},rotateOfWorld(t,e,i,n){Gu.rotateOfLocal(t,Qu(t,e),i,n)},rotateOfLocal(t,e,i,n){const r=t.__localMatrix;Mu(Uu,r),zu(Uu,e,i),Gu.hasHighPosition(t)?Gu.setTransform(t,Uu,!1,n):t.set({x:t.x+Uu.e-r.e,y:t.y+Uu.f-r.f,rotation:Ms.formatRotation(t.rotation+i)},n)},skewOfWorld(t,e,i,n,r,o){Gu.skewOfLocal(t,Qu(t,e),i,n,r,o)},skewOfLocal(t,e,i,n=0,r,o){Mu(Uu,t.__localMatrix),Nu(Uu,e,i,n),Gu.setTransform(t,Uu,r,o)},transformWorld(t,e,i,n){Mu(Uu,t.worldTransform),ju(Uu,e),t.parent&&Vu(Uu,t.parent.scrollWorldTransform),Gu.setTransform(t,Uu,i,n)},transform(t,e,i,n){Mu(Uu,t.localTransform),ju(Uu,e),Gu.setTransform(t,Uu,i,n)},setTransform(t,e,i,n){const r=t.__,o=r.origin&&Gu.getInnerOrigin(t,r.origin),s=Hu(e,o,r.around&&Gu.getInnerOrigin(t,r.around));if(Gu.hasOffset(t)&&(s.x-=r.offsetX,s.y-=r.offsetY),i){const e=s.scaleX/t.scaleX,i=s.scaleY/t.scaleY;if(delete s.scaleX,delete s.scaleY,o){za.scale(t.boxBounds,Math.abs(e),Math.abs(i));const n=Gu.getInnerOrigin(t,r.origin);la.move(s,o.x-n.x,o.y-n.y)}t.set(s),t.scaleResize(e,i,!1)}else t.set(s,n)},getFlipTransform(t,e){const i={a:1,b:0,c:0,d:1,e:0,f:0},n="x"===e?1:-1;return Wu(i,Gu.getLocalOrigin(t,"center"),-1*n,1*n),i},getLocalOrigin:(t,e)=>la.tempToOuterOf(Gu.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const i={};return ya.toPoint(e,t.boxBounds,i),i},getRelativeWorld:(t,e,i)=>(Mu(Uu,t.worldTransform),Vu(Uu,e.scrollWorldTransform),i?Uu:Object.assign({},Uu)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,i,n){t.setTransform(Gu.getRelativeWorld(t,e,!0),n),e.add(t,i)},hasHighPosition:t=>t.origin||t.around||Gu.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 n=e.x*i,r=e.y*i;e.x-=n,e.y-=r,t.move(n,r),Za.requestRender(()=>Gu.animateMove(t,e,i))}}},Gu=Xu,{updateAllMatrix:Ku,updateMatrix:$u,updateAllWorldOpacity:Zu,updateAllChange:qu,updateChange:Ju}=Gu;function Qu(t,e){return t.updateLayout(),t.parent?la.tempToInnerOf(e,t.parent.scrollWorldTransform):e}var tp,ep={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)=>ip(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>ip(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:i}=t;return ip(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 ip(t,e){return e||(tp=0),t.__.mask&&(tp=1),tp<0?null:(tp&&(tp=-1),!0)}var{updateBounds:np}=Xu,rp={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 n=0,r=i.length;n<r;n++)(t=i[n]).isBranch&&(t.__tempNumber=1,e.add(t),op(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&as(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:n}=t;for(let r=0,o=n.length;r<o;r++)n[r].isBranch&&e.push(n[r]);for(let r=i,o=e.length;r<o;r++)sp(e[r],e)},updateBounds(t,e){const i=[t];sp(t,i),ap(i,e)},updateBoundsByBranchStack(t,e){let i,n;for(let r=t.length-1;r>-1;r--){i=t[r],n=i.children;for(let t=0,e=n.length;t<e;t++)np(n[t]);e&&e===i||np(i)}},move(t,e,i){let n;const{children:r}=t;for(let o=0,s=r.length;o<s;o++)n=(t=r[o]).__world,n.e+=e,n.f+=i,n.x+=e,n.y+=i,t.isBranch&&lp(t,e,i)},scale(t,e,i,n,r,o,s){let a;const{children:l}=t,h=n-1,c=r-1;for(let d=0,u=l.length;d<u;d++)a=(t=l[d]).__world,a.a*=n,a.d*=r,(a.b||a.c)&&(a.b*=n,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-o)*h+e,a.y=a.f+=(a.f-s)*c+i):(a.e+=(a.e-o)*h+e,a.f+=(a.f-s)*c+i,a.x+=(a.x-o)*h+e,a.y+=(a.y-s)*c+i),a.width*=n,a.height*=r,a.scaleX*=n,a.scaleY*=r,t.isBranch&&hp(t,e,i,n,r,o,s)}},{pushAllChildBranch:op,pushAllBranchStack:sp,updateBoundsByBranchStack:ap,move:lp,scale:hp}=rp,cp={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:dp,updateBounds:up}=Xu,{toOuterOf:pp,getPoints:fp,copy:gp}=za,vp="_localContentBounds",_p="_worldContentBounds",mp="_worldBoxBounds",yp="_worldStrokeBounds",xp=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 pp(this.contentBounds,this.leaf.__localMatrix,this[vp]||(this[vp]={})),this[vp]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return pp(this.contentBounds,this.leaf.__world,this[_p]||(this[_p]={})),this[_p]}get worldBoxBounds(){return pp(this.boxBounds,this.leaf.__world,this[mp]||(this[mp]={})),this[mp]}get worldStrokeBounds(){return pp(this.strokeBounds,this.leaf.__world,this[yp]||(this[yp]={})),this[yp]}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 up(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,Za.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 Zs.defaultMatrix;case"page":t=e.zoomLayer;default:return dp(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 Ha(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:n}=this;let r,o,s,a=this.getInnerBounds(t);switch(e){case"world":r=n.getWorldPoint(a),o=n.__world;break;case"local":const{scaleX:t,scaleY:i,rotation:l,skewX:h,skewY:c}=n.__;s={scaleX:t,scaleY:i,rotation:l,skewX:h,skewY:c},r=n.getLocalPointByInner(a);break;case"inner":r=a,o=Zs.defaultMatrix;break;case"page":e=n.zoomLayer;default:r=n.getWorldPoint(a,e),o=dp(n,e,!0)}if(s||(s=Zs.getLayout(o)),gp(s,a),la.copy(s,r),i){const{scaleX:t,scaleY:e}=s,i=Math.abs(t),n=Math.abs(e);1===i&&1===n||(s.scaleX/=i,s.scaleY/=n,s.width*=i,s.height*=n)}return s}getLayoutPoints(t,e="world"){const{leaf:i}=this,n=fp(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:r=e}return as(r)||n.forEach(t=>i.innerToWorld(t,null,!1,r)),n}shrinkContent(){const{x:t,y:e,width:i,height:n}=this.boxBounds;this._contentBounds={x:t,y:e,width:i,height:n}}spreadStroke(){const{x:t,y:e,width:i,height:n}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:i,height:n},this._localStrokeBounds={x:t,y:e,width:i,height:n},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:i,height:n}=this.renderBounds;this._renderBounds={x:t,y:e,width:i,height:n},this._localRenderBounds={x:t,y:e,width:i,height:n}}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(){}},wp=class{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&Za.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&Za.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&Za.event.stop(this.origin)}},bp=class extends wp{constructor(t,e,i){super(t,e),this.parent=i,this.child=e}};bp.ADD="child.add",bp.REMOVE="child.remove",bp.CREATED="created",bp.MOUNTED="mounted",bp.UNMOUNTED="unmounted",bp.DESTROY="destroy";var Sp="property.scroll",kp=class extends wp{constructor(t,e,i,n,r){super(t,e),this.attrName=i,this.oldValue=n,this.newValue=r}};kp.CHANGE="property.change",kp.LEAFER_CHANGE="property.leafer_change",kp.SCROLL=Sp;var Ep={scrollX:Sp,scrollY:Sp},Cp=class extends wp{constructor(t,e){super(t),Object.assign(this,e)}};Cp.LOAD="image.load",Cp.LOADED="image.loaded",Cp.ERROR="image.error";var Op=class extends wp{static checkHas(t,e,i){"on"===i?e===Bp?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Lp)||t.hasEvent(Pp)||t.hasEvent(Tp),t.__hasWorldEvent=t.hasEvent(Bp))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Lp,t),"inner"===e&&t.emit(Pp,t)),t.emit(Tp,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Bp,t)}};Op.RESIZE="bounds.resize",Op.INNER="bounds.inner",Op.LOCAL="bounds.local",Op.WORLD="bounds.world";var{RESIZE:Lp,INNER:Pp,LOCAL:Tp,WORLD:Bp}=Op,Rp={};[Lp,Pp,Tp,Bp].forEach(t=>Rp[t]=1);var Ap=class t extends wp{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){ps(e)?(super(t.RESIZE),Object.assign(this,e)):super(e),this.old=i}static isResizing(t){return this.resizingKeys&&!as(this.resizingKeys[t.innerId])}};Ap.RESIZE="resize";var Dp=class extends wp{constructor(t,e){super(t),this.data=e}};Dp.REQUEST="watch.request",Dp.DATA="watch.data";var Mp=class extends wp{constructor(t,e,i){super(t),e&&(this.data=e,this.times=i)}};Mp.REQUEST="layout.request",Mp.START="layout.start",Mp.BEFORE="layout.before",Mp.LAYOUT="layout",Mp.AFTER="layout.after",Mp.AGAIN="layout.again",Mp.END="layout.end";var Ip=class extends wp{constructor(t,e,i,n){super(t),e&&(this.times=e),i&&(this.renderBounds=i,this.renderOptions=n)}};Ip.REQUEST="render.request",Ip.CHILD_START="render.child_start",Ip.CHILD_END="render.child_end",Ip.START="render.start",Ip.BEFORE="render.before",Ip.RENDER="render",Ip.AFTER="render.after",Ip.AGAIN="render.again",Ip.END="render.end",Ip.NEXT="render.next";var Fp=class extends wp{};Fp.START="leafer.start",Fp.BEFORE_READY="leafer.before_ready",Fp.READY="leafer.ready",Fp.AFTER_READY="leafer.after_ready",Fp.VIEW_READY="leafer.view_ready",Fp.VIEW_COMPLETED="leafer.view_completed",Fp.STOP="leafer.stop",Fp.RESTART="leafer.restart",Fp.END="leafer.end",Fp.UPDATE_MODE="leafer.update_mode",Fp.TRANSFORM="leafer.transform",Fp.MOVE="leafer.move",Fp.SCALE="leafer.scale",Fp.ROTATE="leafer.rotate",Fp.SKEW="leafer.skew";var{MOVE:Wp,SCALE:zp,ROTATE:Np,SKEW:jp}=Fp,Vp={x:Wp,y:Wp,scaleX:zp,scaleY:zp,rotation:Np,skewX:jp,skewY:jp},Hp={};function Up(t,e,i){if(e){const{__captureMap:e}=t;return e||(i?t.__captureMap={}:Hp)}{const{__bubbleMap:e}=t;return e||(i?t.__bubbleMap={}:Hp)}}var{on:Yp,on_:Xp,off:Gp,off_:Kp,once:$p,emit:Zp,emitEvent:qp,hasEvent:Jp,destroy:Qp}=class{set event(t){this.on(t)}on(t,e,i){if(!e){let e;if(us(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let i in t)us(e=t[i])?this.on(i,e[0],e[1]):this.on(i,e);return}let n,r,o;i&&("once"===i?r=!0:"boolean"==typeof i?n=i:(n=i.capture,r=i.once));const s=Up(this,n,!0),a=hs(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};a.forEach(t=>{t&&(o=s[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(l):s[t]=[l],Rp[t]&&Op.checkHas(this,t,"on"))})}off(t,e,i){if(t){const n=hs(t)?t.split(" "):t;if(e){let t,r,o;i&&(t="boolean"==typeof i?i:"once"!==i&&i.capture);const s=Up(this,t);n.forEach(t=>{t&&(r=s[t],r&&(o=r.findIndex(t=>t.listener===e),o>-1&&r.splice(o,1),r.length||delete s[t],Rp[t]&&Op.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;n.forEach(i=>{t&&delete t[i],e&&delete e[i]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,i,n){return e?this.on(t,i?e=e.bind(i):e,n):us(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:n}}off_(t){if(!t)return;const e=us(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):us(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,i,n){if(!e)return us(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));ps(i)?e=e.bind(i):n=i,this.on(t,e,{once:!0,capture:n})}emit(t,e,i){!e&&ul.has(t)&&(e=ul.get(t,{type:t,target:this,current:this}));const n=Up(this,i)[t];if(n){let r;for(let o=0,s=n.length;o<s&&!((r=n[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,i),o--,s--),e&&e.isStopNow));o++);}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:n}=this,r=i&&i[t],o=n&&n[t];return!!(as(e)?r||o:e?o:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}.prototype,tf={on:Yp,on_:Xp,off:Gp,off_:Kp,once:$p,emit:Zp,emitEvent:qp,hasEvent:Jp,destroyEventer:Qp},ef=Qa.get("setAttr"),nf={__setAttr(t,e,i){if(this.leaferIsCreated){const n=this.__.__getInput(t);if(!i||cs(e)||as(e)||(ef.warn(this.innerName,t,e),e=void 0),ps(e)||n!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new kp(kp.LEAFER_CHANGE,this,t,n,e));const i=Vp[t];i&&(this.emitEvent(new Fp(i,this)),this.emitEvent(new Fp(Fp.TRANSFORM,this)))}this.emitPropertyEvent(kp.CHANGE,t,n,e);const i=Ep[t];return i&&this.emitPropertyEvent(i,t,n,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,i,n){const r=new kp(t,this,e,i,n);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||as(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:rf,multiplyParent:of,translateInner:sf,defaultWorld:af}=Zs,{toPoint:lf,tempPoint:hf}=ya,cf={__updateWorldMatrix(){const{parent:t,__layout:e,__world:i,__scrollWorld:n,__:r}=this;of(this.__local||e,t?t.__scrollWorld||t.__world:af,i,!!e.affectScaleOrRotation,r),n&&sf(Object.assign(n,i),r.scrollX,r.scrollY),e.scaleFixed&&Xu.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)&&(rf(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)&&(lf(i.around||i.origin,t.boxBounds,hf),sf(e,-hf.x,-hf.y,!i.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:df,updateAllMatrix:uf}=Xu,{updateBounds:pf}=rp,{toOuterOf:ff,copyAndSpread:gf,copy:vf}=za,{toBounds:_f}=Ad,mf={__updateWorldBounds(){const{__layout:t,__world:e}=this;ff(t.renderBounds,e,e),this.__hasComplex&&Xu.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Op.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Op.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&&Xu.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),ff(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){ff(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){ff(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const i=this.__layout.boxBounds,n=this.__;n.__usePathBox?_f(n.path,i):(i.x=0,i.y=0,i.width=n.width,i.height=n.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),uf(this),pf(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(uf(this),pf(this,this))):df(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;gf(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:i}=e;ds(i)&&i<=0?vf(e.renderBounds,e.strokeBounds):gf(e.renderBounds,e.boxBounds,i)}},yf={__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 n=t.getSameCanvas(!0,!0);this.__draw(n,e,t),Xu.copyCanvasByWorld(this,t,n,this.__nowWorld,i.__blendMode,!0),n.recycle(this.__nowWorld)}else this.__draw(t,e);Qa.showBounds&&Qa.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:xf}=ep,{hasSize:wf}=za,bf={__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&&wf(i)){const n=this.__;if(n.__useDim)if(n.dim)e.dimOpacity=!0===n.dim?.2:n.dim;else{if(n.bright&&!e.topRendering)return e.topList.add(this);n.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(n.__single&&!this.isBranchLeaf){if("path"===n.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?n.opacity*e.dimOpacity:n.opacity,t.copyWorldByReset(r,i,i,n.__blendMode,!0),r.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let i;const{children:n}=this;for(let r=0,o=n.length;r<o;r++)i=n[r],xf(i,e)||(i.__hasComplex?Xu.renderComplex(i,t,e):i.__render(t,e))}},__clip(t,e){if(this.__worldOpacity){const{children:i}=this;for(let n=0,r=i.length;n<r;n++)xf(i[n],e)||i[n].__clip(t,e)}}},{LEAF:Sf,create:kf}=xs,{stintSet:Ef}=_s,{toInnerPoint:Cf,toOuterPoint:Of,multiplyParent:Lf}=Zs,{toOuterOf:Pf}=za,{copy:Tf,move:Bf}=la,{getScaleFixedData:Rf}=Ms,{moveLocal:Af,zoomOfLocal:Df,rotateOfLocal:Mf,skewOfLocal:If,moveWorld:Ff,zoomOfWorld:Wf,rotateOfWorld:zf,skewOfWorld:Nf,transform:jf,transformWorld:Vf,setTransform:Hf,getFlipTransform:Uf,getLocalOrigin:Yf,getRelativeWorld:Xf,drop:Gf}=Xu,Kf=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 ys}get __LayoutProcessor(){return xp}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=kf(Sf),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(bp.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(bp.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(bp.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(bp.MOUNTED),t.cacheId&&Xu.cacheId(this)):this.__emitLifeEvent(bp.UNMOUNTED),this.isBranch){const{children:e}=this;for(let i=0,n=e.length;i<n;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){as(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=as(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 Lf(i,t.matrix,e,void 0,i),Pf(this.__layout.renderBounds,e,e),Ef(e,"half",i.half),Ef(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 Rf(Qd.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 n=e?Xf(this,e):this.worldTransform,r=i?t:{};return Pf(t,n,r),r}worldToLocal(t,e,i,n){this.parent?this.parent.worldToInner(t,e,i,n):e&&Tf(e,t)}localToWorld(t,e,i,n){this.parent?this.parent.innerToWorld(t,e,i,n):e&&Tf(e,t)}worldToInner(t,e,i,n){n&&(n.innerToWorld(t,e,i),t=e||t),Cf(this.worldTransform,t,e,i)}innerToWorld(t,e,i,n){Of(this.worldTransform,t,e,i),n&&n.worldToInner(e||t,null,i)}getBoxPoint(t,e,i,n){const r=this.getInnerPoint(t,e,i,n);return i?r:this.getBoxPointByInner(r,null,null,!0)}getBoxPointByInner(t,e,i,n){const r=n?t:Object.assign({},t),{x:o,y:s}=this.boxBounds;return Bf(r,-o,-s),r}getInnerPoint(t,e,i,n){const r=n?t:{};return this.worldToInner(t,r,i,e),r}getInnerPointByBox(t,e,i,n){const r=n?t:Object.assign({},t),{x:o,y:s}=this.boxBounds;return Bf(r,o,s),r}getInnerPointByLocal(t,e,i,n){return this.getInnerPoint(t,this.parent,i,n)}getLocalPoint(t,e,i,n){const r=n?t:{};return this.worldToLocal(t,r,i,e),r}getLocalPointByInner(t,e,i,n){return this.getWorldPoint(t,this.parent,i,n)}getPagePoint(t,e,i,n){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,i,n)}getWorldPoint(t,e,i,n){const r=n?t:{};return this.innerToWorld(t,r,i,e),r}getWorldPointByBox(t,e,i,n){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,n),e,i,!0)}getWorldPointByLocal(t,e,i,n){const r=n?t:{};return this.localToWorld(t,r,i,e),r}getWorldPointByPage(t,e,i,n){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,i,n)}setTransform(t,e,i){Hf(this,t,e,i)}transform(t,e,i){jf(this,t,e,i)}move(t,e,i){Af(this,t,e,i)}moveInner(t,e,i){Ff(this,t,e,!0,i)}scaleOf(t,e,i,n,r){Df(this,Yf(this,t),e,i,n,r)}rotateOf(t,e,i){Mf(this,Yf(this,t),e,i)}skewOf(t,e,i,n,r){If(this,Yf(this,t),e,i,n,r)}transformWorld(t,e,i){Vf(this,t,e,i)}moveWorld(t,e,i){Ff(this,t,e,!1,i)}scaleOfWorld(t,e,i,n,r){Wf(this,t,e,i,n,r)}rotateOfWorld(t,e){zf(this,t,e)}skewOfWorld(t,e,i,n,r){Nf(this,t,e,i,n,r)}flip(t,e){jf(this,Uf(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 sl.need("path")}getMotionPoint(t){return sl.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){Gf(this,t,e,i)}on(t,e,i){}off(t,e,i){}on_(t,e,i,n){}off_(t){}once(t,e,i,n){}emit(t,e,i){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,i){i?this.addAttr(t,e,i):Eu(this.prototype,t,e)}static addAttr(t,e,i,n){i||(i=pu),i(e,n)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new bp(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(bp.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Kf=gl([Ru(nf),Ru(cf),Ru(mf),Ru(tf),Ru(yf)],Kf);var{setListWithFn:$f}=za,{sort:Zf}=rp,{localBoxBounds:qf,localStrokeBounds:Jf,localRenderBounds:Qf,maskLocalBoxBounds:tg,maskLocalStrokeBounds:eg,maskLocalRenderBounds:ig}=ep,ng=new Qa("Branch"),rg=class extends Kf{__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,n=e.length;i<n;i++)if(t=e[i].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){$f(e||this.__layout.boxBounds,this.children,this.__hasMask?tg:qf)}__updateStrokeBounds(t){$f(t||this.__layout.strokeBounds,this.children,this.__hasMask?eg:Jf)}__updateRenderBounds(t){$f(t||this.__layout.renderBounds,this.children,this.__hasMask?ig:Qf)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let i=0,n=e.length;i<n;i++)e[i].__tempNumber=i,e[i].__.zIndex&&(t=!0);e.sort(Zf),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return ng.warn("add self or destroyed");const i=as(e);if(!t.__){if(us(t))return t.forEach(t=>{this.add(t,e),i||e++});if(!(t=hl.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 n=t.__layout;n.boxChanged||n.boxChange(),n.matrixChanged||n.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(bp.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(bp.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)):as(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(bp.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(bp.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const i=new bp(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),this.leafer.emitEvent(i)}};rg=gl([Ru(bf)],rg);var og=class t{get length(){return this.list.length}constructor(t){this.reset(),t&&(us(t)?this.addList(t):this.add(t))}has(t){return t&&!as(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return as(e)?-1:e}add(t){const{list:e,keys:i}=this;as(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(as(i[t.innerId])){const{list:n}=this;for(let t=e,r=n.length;t<r;t++)i[n[t].innerId]++;0===e?n.unshift(t):(e>n.length&&(e=n.length),n.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 n=0,r=e.length;n<r;n++)as(i)?e[n].innerId===t.innerId&&(i=n,delete this.keys[t.innerId]):this.keys[e[n].innerId]=n-1;as(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,n=t.length;i<n;i++)e[t[i].innerId]=i}reset(){this.list=[],this.keys={}}destroy(){this.reset()}},sg=class{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(us(t)?this.addList(t):this.add(t))}has(t){return!as(this.keys[t.innerId])}without(t){return as(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 n=0,r=e.length;n<r;n++)t(e[n])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}};function ag(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function lg(t){return su(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const i=this.__layout;i.renderChanged||i.renderChange(),i.surfaceChange()}}))}function hg(t){return su(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}var cg={},dg={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}},ug=Xa,pg={},fg={},gg={},vg={},_g={},mg={apply(){sl.need("filter")}},yg={},xg={setStyleName:()=>sl.need("state"),set:()=>sl.need("state")},{parse:wg,objectToCanvasData:bg}=nc,{stintSet:Sg}=_s,{hasTransparent:kg}=dg,Eg={originPaint:{}},Cg=Qa.get("UIData"),Og=class extends ys{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,Cg.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Cg.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),hs(t)||!t?(Sg(this,"__isTransparentFill",kg(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):ps(t)&&this.__setPaint("fill",t)}setStroke(t){hs(t)||!t?(Sg(this,"__isTransparentStroke",kg(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):ps(t)&&this.__setPaint("stroke",t)}setPath(t){const e=hs(t);e||t&&ps(t[0])?(this.__setInput("path",t),this._path=e?wg(t):bg(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Lg(this,"shadow",t)}setInnerShadow(t){Lg(this,"innerShadow",t)}setFilter(t){Lg(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&fg.compute("fill",this.__leaf),e&&fg.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),as(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;Sg(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(),us(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Eg)):(this.__isStrokes=!0,this._stroke||(this._stroke=Eg))}__removePaint(t,e){e&&this.__removeInput(t),gg.recycleImage(t,this),"fill"===t?(Sg(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(Sg(this,"__isAlphaPixelStroke",void 0),Sg(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}};function Lg(t,e,i){t.__setInput(e,i),us(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 Pg=class extends Og{},Tg=class extends Pg{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)}},Bg=class extends Og{get __usePathBox(){return this.points||this.__pathInputed}},Rg=class extends Og{get __boxStroke(){return!this.__pathInputed}},Ag={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900},{max:Dg,add:Mg}=ks,Ig={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:n,__maxStrokeWidth:r}=i,o=this.__box;if((i.stroke||"all"===i.hitStroke)&&r&&"inside"!==n&&(e=t="center"===n?r/2:r,!i.__boxStroke||i.__useArrow)){const e=i.__isLinePath?0:10*t,n="none"===i.strokeCap?0:r;t+=Math.max(e,n)}return i.__useArrow&&(t+=5*r),o&&(t=Dg(t,o.__layout.strokeSpread=o.__updateStrokeSpread()),e=Math.max(e,o.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:n,backgroundBlur:r,filter:o,renderSpread:s}=this.__,{strokeSpread:a}=this.__layout,l=this.__box;e&&(t=_g.getShadowRenderSpread(this,e)),n&&(t=Dg(t,n)),o&&(t=Mg(t,mg.getSpread(o))),s&&(t=Mg(t,s)),a&&(t=Mg(t,a));let h=t;return i&&(h=Dg(h,_g.getInnerShadowSpread(this,i))),r&&(h=Dg(h,r)),this.__layout.renderShapeSpread=h,l?Dg(l.__updateRenderSpread(),t):t}},{stintSet:Fg}=_s,Wg={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Fg(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Fg(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:n}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Fg(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!_g.isTransformShadow(e[0])&&i&&!t.__isTransparentFill&&!(us(i)&&i.length>1)&&(this.useFastShadow||!n||n&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),t.__checkComplex()},__drawFast(t,e){zg(this,t,e)},__draw(t,e,i){const n=this.__;if(n.__complex){n.__needComputePaint&&n.__computePaint();const{fill:r,stroke:o,__drawAfterFill:s,__fillAfterStroke:a,__isFastShadow:l}=n;if(this.__drawRenderPath(t),n.__useEffect&&!l){const l=fg.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:c,filter:d}=n;h&&_g.shadow(this,t,l),a&&(n.__isStrokes?fg.strokes(o,this,t,e):fg.stroke(o,this,t,e)),r&&(n.__isFills?fg.fills(r,this,t,e):fg.fill(r,this,t,e)),s&&this.__drawAfterFill(t,e),c&&_g.innerShadow(this,t,l),o&&!a&&(n.__isStrokes?fg.strokes(o,this,t,e):fg.stroke(o,this,t,e)),d&&mg.apply(d,this,this.__nowWorld,t,i,l),l.worldCanvas&&l.worldCanvas.recycle(),l.canvas.recycle()}else{if(a&&(n.__isStrokes?fg.strokes(o,this,t,e):fg.stroke(o,this,t,e)),l){const e=n.shadow[0],{scaleX:i,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*r,e.blur*i,dg.string(e.color))}r&&(n.__isFills?fg.fills(r,this,t,e):fg.fill(r,this,t,e)),l&&t.restore(),s&&this.__drawAfterFill(t,e),o&&!a&&(n.__isStrokes?fg.strokes(o,this,t,e):fg.stroke(o,this,t,e))}}else n.__pathForRender?zg(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:n,stroke:r}=i;n&&!e.ignoreFill&&(i.__isAlphaPixelFill?fg.fills(n,this,t,e):fg.fill("#000000",this,t,e)),i.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?fg.strokes(r,this,t,e):fg.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 zg(t,e,i){const{fill:n,stroke:r,__drawAfterFill:o,__fillAfterStroke:s}=t.__;t.__drawRenderPath(e),s&&fg.stroke(r,t,e,i),n&&fg.fill(n,t,e,i),o&&t.__drawAfterFill(e,i),r&&!s&&fg.stroke(r,t,e,i)}var Ng,jg={__drawFast(t,e){let{x:i,y:n,width:r,height:o}=this.__layout.boxBounds;const{fill:s,stroke:a,__drawAfterFill:l}=this.__;if(s&&(t.fillStyle=s,t.fillRect(i,n,r,o)),l&&this.__drawAfterFill(t,e),a){const{strokeAlign:s,__strokeWidth:l}=this.__;if(!l)return;t.setStroke(a,l,this.__);const h=l/2;switch(s){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=l,o-=l,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(i+h,n+h,r,o),t.restore()):t.strokeRect(i+h,n+h,r,o);break;case"outside":t.strokeRect(i-h,n-h,r+l,o+l)}}}},Vg=Ng=class extends Kf{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){Ms.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 Vd.set(this.path=t||[]),t||this.__drawPathByBox(Vd),Vd}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return hs(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}clearProxyData(){}find(t,e){return sl.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return sl.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(Vd.set(i=[]),this.__drawPathByBox(Vd,!e)),t?nc.toCanvasData(i,!0):i}getPathString(t,e,i){return nc.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||yg.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius||e.path.radius?Nd.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&pg.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&pg.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path,!0)}__drawPathByData(t,e,i){e?rd.drawPathByData(t,e):this.__drawPathByBox(t,i)}__drawPathByBox(t,e){const{x:i,y:n,width:r,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(i,n,r,o,ds(e)?[e]:e)}else t.rect(i,n,r,o);t.closePath()}drawImagePlaceholder(t,e,i){fg.fill(this.__.placeholderColor,this,e,i)}animate(t,e,i,n){return this.set(t),sl.need("animate")}killAnimate(t,e){}export(t,e){return sl.need("export")}syncExport(t,e){return sl.need("export")}clone(t){const e=_s.clone(this.toJSON());return t&&Object.assign(e,t),Ng.one(e)}static one(t,e,i,n,r){return hl.get(t.tag||this.prototype.__tag,t,e,i,n,r)}static registerUI(){Au()(this)}static registerData(t){ku(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()}};ag([ku(Og)],Vg.prototype,"__",void 0),ag([(t,e)=>{const i="_"+e;ru(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}})}],Vg.prototype,"zoomLayer",void 0),ag([au("")],Vg.prototype,"id",void 0),ag([au("")],Vg.prototype,"name",void 0),ag([au("")],Vg.prototype,"className",void 0),ag([yu("pass-through")],Vg.prototype,"blendMode",void 0),ag([function(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&wu(this)}}))}(1)],Vg.prototype,"opacity",void 0),ag([function(t){return su(t,t=>({set(e){const i=this.visible;if(!0===i&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>bu(this,t,e,i))}else 0===i&&!0===e&&this.animation&&this.__runAnimation("in");bu(this,t,e,i),this.mask&&wu(this)}}))}(!0)],Vg.prototype,"visible",void 0),ag([yu(!1)],Vg.prototype,"locked",void 0),ag([xu(!1)],Vg.prototype,"dim",void 0),ag([xu(!1)],Vg.prototype,"dimskip",void 0),ag([function(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__layout.childrenSortChange()})}}))}(0)],Vg.prototype,"zIndex",void 0),ag([function(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}(!1)],Vg.prototype,"mask",void 0),ag([function(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}(!1)],Vg.prototype,"eraser",void 0),ag([lu(0,!0)],Vg.prototype,"x",void 0),ag([lu(0,!0)],Vg.prototype,"y",void 0),ag([pu(100,!0)],Vg.prototype,"width",void 0),ag([pu(100,!0)],Vg.prototype,"height",void 0),ag([du(1,!0)],Vg.prototype,"scaleX",void 0),ag([du(1,!0)],Vg.prototype,"scaleY",void 0),ag([uu(0,!0)],Vg.prototype,"rotation",void 0),ag([uu(0,!0)],Vg.prototype,"skewX",void 0),ag([uu(0,!0)],Vg.prototype,"skewY",void 0),ag([lu(0,!0)],Vg.prototype,"offsetX",void 0),ag([lu(0,!0)],Vg.prototype,"offsetY",void 0),ag([hu(0,!0)],Vg.prototype,"scrollX",void 0),ag([hu(0,!0)],Vg.prototype,"scrollY",void 0),ag([cu()],Vg.prototype,"origin",void 0),ag([cu()],Vg.prototype,"around",void 0),ag([au(!1)],Vg.prototype,"lazy",void 0),ag([function(t){return su(t,t=>({set(e){this.__setAttr(t,e)&&(fu(this),this.__.__removeNaturalSize())}}))}(1)],Vg.prototype,"pixelRatio",void 0),ag([mu(0)],Vg.prototype,"renderSpread",void 0),ag([function(t){return su(t,t=>({set(e){const i=this.__;2!==i.__pathInputed&&(i.__pathInputed=e?1:0),e||(i.__pathForRender=void 0),this.__setAttr(t,e),fu(this)}}))}()],Vg.prototype,"path",void 0),ag([gu()],Vg.prototype,"windingRule",void 0),ag([gu(!0)],Vg.prototype,"closed",void 0),ag([pu(0)],Vg.prototype,"padding",void 0),ag([pu(!1)],Vg.prototype,"lockRatio",void 0),ag([pu()],Vg.prototype,"widthRange",void 0),ag([pu()],Vg.prototype,"heightRange",void 0),ag([au(!1)],Vg.prototype,"draggable",void 0),ag([au()],Vg.prototype,"dragBounds",void 0),ag([au("auto")],Vg.prototype,"dragBoundsType",void 0),ag([au(!1)],Vg.prototype,"editable",void 0),ag([Su(!0)],Vg.prototype,"hittable",void 0),ag([Su("path")],Vg.prototype,"hitFill",void 0),ag([_u("path")],Vg.prototype,"hitStroke",void 0),ag([Su(!1)],Vg.prototype,"hitBox",void 0),ag([Su(!0)],Vg.prototype,"hitChildren",void 0),ag([Su(!0)],Vg.prototype,"hitSelf",void 0),ag([Su()],Vg.prototype,"hitRadius",void 0),ag([function(t){return su(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}("")],Vg.prototype,"cursor",void 0),ag([yu()],Vg.prototype,"fill",void 0),ag([_u(void 0,!0)],Vg.prototype,"stroke",void 0),ag([_u("inside")],Vg.prototype,"strokeAlign",void 0),ag([_u(1,!0)],Vg.prototype,"strokeWidth",void 0),ag([_u(!1)],Vg.prototype,"strokeScaleFixed",void 0),ag([_u("none")],Vg.prototype,"strokeCap",void 0),ag([_u("miter")],Vg.prototype,"strokeJoin",void 0),ag([_u()],Vg.prototype,"dashPattern",void 0),ag([_u(0)],Vg.prototype,"dashOffset",void 0),ag([_u(10)],Vg.prototype,"miterLimit",void 0),ag([gu(0)],Vg.prototype,"cornerRadius",void 0),ag([gu()],Vg.prototype,"cornerSmoothing",void 0),ag([lg()],Vg.prototype,"shadow",void 0),ag([lg()],Vg.prototype,"innerShadow",void 0),ag([lg()],Vg.prototype,"blur",void 0),ag([lg()],Vg.prototype,"backgroundBlur",void 0),ag([lg()],Vg.prototype,"grayscale",void 0),ag([lg()],Vg.prototype,"filter",void 0),ag([yu()],Vg.prototype,"placeholderColor",void 0),ag([au(100)],Vg.prototype,"placeholderDelay",void 0),ag([au({})],Vg.prototype,"data",void 0),ag([Pu(Kf.prototype.reset)],Vg.prototype,"reset",null),Vg=Ng=ag([Ru(Ig),Ru(Wg),Tu()],Vg);var Hg,Ug=class extends Vg{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(){}};ag([ku(Pg)],Ug.prototype,"__",void 0),ag([pu(0)],Ug.prototype,"width",void 0),ag([pu(0)],Ug.prototype,"height",void 0),Ug=ag([Ru(rg),Au()],Ug);var Yg=Qa.get("Leafer"),Xg=Hg=class extends Ug{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&qd.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),Hg.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:n}=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,_s.assign(n,t));const r=this.canvas=al.canvas(n);this.__controllers.push(this.renderer=al.renderer(this,r,n),this.watcher=al.watcher(this,n),this.layouter=al.layouter(this,n)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=al.selector(this),this.interaction=al.interaction(this,r,this.selector,n),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=al.hitCanvasManager()),this.canvasManager=new fl,i=n.start),this.hittable=n.hittable,this.fill=n.fill,this.canvasManager.add(r),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),cp.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(Fp.RESTART):this.emitLeafer(Fp.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(Fp.STOP))}unlockLayout(t=!0){this.layouter.start(),t&&this.updateLayout()}lockLayout(t=!0){t&&this.updateLayout(),this.layouter.stop()}resize(t){const e=_s.copyAttrs({},t,Pl);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new Ha(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=_s.copyAttrs({},this.canvas,Pl);e.resize(t),this.updateLazyBounds(),this.__onResize(new Ap(t,i))}__onResize(t){this.emitEvent(t),_s.copyAttrs(this.__,t,Pl),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 Ya(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Pl.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(Fp.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Pl.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:i,canvas:n}=this,r=_s.copyAttrs({},n,Pl);r[t]=i[t]=e,i.width&&i.height?n.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__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(Fp.BEFORE_READY),this.emitLeafer(Fp.READY),this.emitLeafer(Fp.AFTER_READY),cp.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Fp.VIEW_READY),cp.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:n,height:r,pixelRatio:o}=this;const s="box"===t?this.worldBoxBounds:this.__world;e||(n=Math.max(1,s.x+s.width)),i||(r=Math.max(1,s.y+s.height)),this.__doResize({width:n,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){cp.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(Fp.VIEW_COMPLETED),cp.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 n=this.__nextRenderWait;if(i){for(let r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}}else n.push(t);this.requestRender()}zoom(t,e,i,n){return sl.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 Fp(t,this))}__listenEvents(){const t=nl.start("FirstCreate "+this.innerName);this.once([[Fp.START,()=>nl.end(t)],[Mp.START,this.updateLazyBounds,this],[Ip.START,this.__onCreated,this],[Ip.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Dp.DATA,this.__onWatchData,this],[Mp.END,this.__onLayoutEnd,this],[Ip.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Hg.list.remove(this);try{this.stop(),this.emitLeafer(Fp.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(()=>{Qd.clearRecycled()},100)}catch(t){Yg.error(t)}}};t?e():setTimeout(e)}};Xg.list=new og,ag([ku(class extends Pg{__getInputData(t,e){const i=super.__getInputData(t,e);return Pl.forEach(t=>delete i[t]),i}})],Xg.prototype,"__",void 0),ag([pu()],Xg.prototype,"pixelRatio",void 0),ag([au("normal")],Xg.prototype,"mode",void 0),Xg=Hg=ag([Au()],Xg);var Gg=class extends Vg{get __tag(){return"Rect"}};ag([ku(Rg)],Gg.prototype,"__",void 0),Gg=ag([Ru(jg),Tu(),Au()],Gg);var{add:Kg,includes:$g,scroll:Zg}=za,qg=Gg.prototype,Jg=Ug.prototype,Qg=class extends Ug{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.__,n=this.__layout,{renderBounds:r,boxBounds:o}=n,{overflow:s}=i,a=n.childrenRenderBounds||(n.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=s&&s.includes("scroll"))&&(Kg(a,o),Zg(a,i)),this.__updateRectRenderBounds(),t=!$g(o,a),t&&"show"===s&&Kg(r,a)}else this.__updateRectRenderBounds();_s.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))}};ag([ku(Tg)],Qg.prototype,"__",void 0),ag([pu(100)],Qg.prototype,"width",void 0),ag([pu(100)],Qg.prototype,"height",void 0),ag([au(!1)],Qg.prototype,"resizeChildren",void 0),ag([mu("show")],Qg.prototype,"overflow",void 0),ag([Pu(qg.__updateStrokeSpread)],Qg.prototype,"__updateStrokeSpread",null),ag([Pu(qg.__updateRenderSpread)],Qg.prototype,"__updateRectRenderSpread",null),ag([Pu(qg.__updateBoxBounds)],Qg.prototype,"__updateRectBoxBounds",null),ag([Pu(qg.__updateStrokeBounds)],Qg.prototype,"__updateStrokeBounds",null),ag([Pu(qg.__updateRenderBounds)],Qg.prototype,"__updateRectRenderBounds",null),ag([Pu(qg.__updateChange)],Qg.prototype,"__updateRectChange",null),ag([Pu(qg.__render)],Qg.prototype,"__renderRect",null),ag([Pu(Jg.__render)],Qg.prototype,"__renderGroup",null),Qg=ag([Tu(),Au()],Qg);var tv=class extends Qg{get __tag(){return"Frame"}get isFrame(){return!0}};ag([ku(class extends Tg{})],tv.prototype,"__",void 0),ag([yu("#FFFFFF")],tv.prototype,"fill",void 0),ag([mu("hide")],tv.prototype,"overflow",void 0),tv=ag([Au()],tv);var{moveTo:ev,closePath:iv,ellipse:nv}=Cc,rv=class extends Vg{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:i,innerRadius:n,startAngle:r,endAngle:o}=t,s=e/2,a=i/2,l=t.path=[];let h;n?r||o?(n<1?nv(l,s,a,s*n,a*n,0,r,o,!1):h=!0,nv(l,s,a,s,a,0,o,r,!0)):(n<1&&(nv(l,s,a,s*n,a*n),ev(l,e,a)),nv(l,s,a,s,a,0,360,0,!0)):r||o?(ev(l,s,a),nv(l,s,a,s,a,0,r,o,!1)):nv(l,s,a,s,a),h||iv(l),(Za.ellipseToCurve||t.__useArrow||t.cornerRadius)&&(t.path=this.getPath(!0))}};ag([ku(class extends Og{get __boxStroke(){return!this.__pathInputed}})],rv.prototype,"__",void 0),ag([gu(0)],rv.prototype,"innerRadius",void 0),ag([gu(0)],rv.prototype,"startAngle",void 0),ag([gu(0)],rv.prototype,"endAngle",void 0),rv=ag([Au()],rv);var{sin:ov,cos:sv,PI:av}=Math,{moveTo:lv,lineTo:hv,closePath:cv,drawPoints:dv}=Cc,uv=class extends Vg{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)dv(e,t.points,t.curve,t.closed);else{const{width:i,height:n,sides:r,startAngle:o}=t,s=i/2,a=n/2;let l,h=0;o?(h=o*Fs,lv(e,s+s*ov(h),a-a*sv(h))):lv(e,s,0);for(let t=1;t<r;t++)l=2*t*av/r+h,hv(e,s+s*ov(l),a-a*sv(l));cv(e)}}};ag([ku(class extends Bg{})],uv.prototype,"__",void 0),ag([gu(3)],uv.prototype,"sides",void 0),ag([gu(0)],uv.prototype,"startAngle",void 0),ag([gu()],uv.prototype,"points",void 0),ag([gu(0)],uv.prototype,"curve",void 0),uv=ag([Tu(),Au()],uv);var{sin:pv,cos:fv,PI:gv}=Math,{moveTo:vv,lineTo:_v,closePath:mv}=Cc,yv=class extends Vg{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:n,startAngle:r}=this.__,o=t/2,s=e/2,a=this.__.path=[];let l,h=0;r?(h=r*Fs,vv(a,o+o*pv(h),s-s*fv(h))):vv(a,o,0);for(let c=1;c<2*i;c++)l=c*gv/i+h,_v(a,o+(c%2==0?o:o*n)*pv(l),s-(c%2==0?s:s*n)*fv(l));mv(a)}};ag([ku(class extends Og{get __boxStroke(){return!this.__pathInputed}})],yv.prototype,"__",void 0),ag([gu(5)],yv.prototype,"corners",void 0),ag([gu(.382)],yv.prototype,"innerRadius",void 0),ag([gu(0)],yv.prototype,"startAngle",void 0),yv=ag([Au()],yv);var{moveTo:xv,lineTo:wv,drawPoints:bv}=Cc,{rotate:Sv,getAngle:kv,getDistance:Ev,defaultPoint:Cv}=la,Ov=class extends Vg{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i={x:0,y:0};return t&&(i.x=t),e&&Sv(i,e),i}set toPoint(t){this.width=Ev(Cv,t),this.rotation=kv(Cv,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?bv(e,t.points,t.curve,t.closed):(xv(e,0,0),wv(e,this.width,0))}};ag([ku(Bg)],Ov.prototype,"__",void 0),ag([vu("center")],Ov.prototype,"strokeAlign",void 0),ag([pu(0)],Ov.prototype,"height",void 0),ag([gu()],Ov.prototype,"points",void 0),ag([gu(0)],Ov.prototype,"curve",void 0),ag([gu(!1)],Ov.prototype,"closed",void 0),Ov=ag([Au()],Ov);var Lv=class extends Gg{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return us(t)&&t[0].image}};ag([ku(class extends Rg{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}})],Lv.prototype,"__",void 0),ag([pu("")],Lv.prototype,"url",void 0),Lv=ag([Au()],Lv);var Pv=class extends Gg{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=al.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new nu({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Cp(Cp.LOADED,{image:t}))})}draw(t,e,i,n){const r=new ga(t.worldTransform).invert(),o=new ga;e&&o.translate(e.x,e.y),i&&(ds(i)?o.scale(i):o.scale(i.x,i.y)),n&&o.rotate(n),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:n}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,i,n)}__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()}};ag([ku(class extends Rg{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}})],Pv.prototype,"__",void 0),ag([hg(100)],Pv.prototype,"width",void 0),ag([hg(100)],Pv.prototype,"height",void 0),ag([hg(1)],Pv.prototype,"pixelRatio",void 0),ag([hg(!0)],Pv.prototype,"smooth",void 0),ag([au(!1)],Pv.prototype,"safeResize",void 0),ag([hg()],Pv.prototype,"contextSettings",void 0),Pv=ag([Au()],Pv);var{copyAndSpread:Tv,includes:Bv,spread:Rv,setList:Av}=za,{stintSet:Dv}=_s,Mv=class extends Vg{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:n,fontSize:r,fontWeight:o,italic:s,textCase:a,textOverflow:l,padding:h,width:c,height:d}=t;t.__lineHeight=ug.number(e,r),t.__letterSpacing=ug.number(i,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${s?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==o?o+" ":""}${r||12}px ${n||"caption"}`,Dv(t,"__padding",h&&Ms.fourNumber(h)),Dv(t,"__clipText","show"!==l&&!t.__autoSize),Dv(t,"__isCharMode",c||d||t.__letterSpacing||"none"!==a),t.__textDrawData=cg.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:n,padding:r,__autoWidth:o,__autoHeight:s}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,l=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<i&&Rv(a,i/2),o||s){if(l.x=o?a.x:0,l.y=s?a.y:0,l.width=o?a.width:t.width,l.height=s?a.height:t.height,r){const[e,i,n,r]=t.__padding;o&&(l.x-=r,l.width+=i+r),s&&(l.y-=e,l.height+=n+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();n&&(l.width+=.16*i),_s.stintSet(this,"isOverflow",!Bv(l,a)),this.isOverflow?(Av(t.__textBoxBounds={},[l,a]),e.renderChanged=!0):t.__textBoxBounds=l}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Tv(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 n=this.__box;n&&(n.__nowWorld=this.__nowWorld,n.__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()}};ag([ku(class extends Og{get __useNaturalRatio(){return!1}setFontWeight(t){hs(t)?(this.__setInput("fontWeight",t),t=Ag[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:n}=this;if(i)for(let t in n)i[t]=void 0;else i=e.__box=hl.get("Rect",0);const r=e.__layout,o=i.__layout;n||(i.parent=e,i.__world=e.__world,o.boxBounds=r.boxBounds),i.set(t),o.strokeChanged&&r.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}})],Mv.prototype,"__",void 0),ag([pu(0)],Mv.prototype,"width",void 0),ag([pu(0)],Mv.prototype,"height",void 0),ag([yu()],Mv.prototype,"boxStyle",void 0),ag([au(!1)],Mv.prototype,"resizeFontSize",void 0),ag([yu("#000000")],Mv.prototype,"fill",void 0),ag([vu("outside")],Mv.prototype,"strokeAlign",void 0),ag([Su("all")],Mv.prototype,"hitFill",void 0),ag([pu("")],Mv.prototype,"text",void 0),ag([pu("")],Mv.prototype,"placeholder",void 0),ag([pu("caption")],Mv.prototype,"fontFamily",void 0),ag([pu(12)],Mv.prototype,"fontSize",void 0),ag([pu("normal")],Mv.prototype,"fontWeight",void 0),ag([pu(!1)],Mv.prototype,"italic",void 0),ag([pu("none")],Mv.prototype,"textCase",void 0),ag([pu("none")],Mv.prototype,"textDecoration",void 0),ag([pu(0)],Mv.prototype,"letterSpacing",void 0),ag([pu({type:"percent",value:1.5})],Mv.prototype,"lineHeight",void 0),ag([pu(0)],Mv.prototype,"paraIndent",void 0),ag([pu(0)],Mv.prototype,"paraSpacing",void 0),ag([pu("x")],Mv.prototype,"writingMode",void 0),ag([pu("left")],Mv.prototype,"textAlign",void 0),ag([pu("top")],Mv.prototype,"verticalAlign",void 0),ag([pu(!0)],Mv.prototype,"autoSizeAlign",void 0),ag([pu("normal")],Mv.prototype,"textWrap",void 0),ag([pu("show")],Mv.prototype,"textOverflow",void 0),ag([yu(!1)],Mv.prototype,"textEditing",void 0),Mv=ag([Au()],Mv);var Iv=class extends Vg{get __tag(){return"Path"}};ag([ku(class extends Og{get __pathInputed(){return 2}})],Iv.prototype,"__",void 0),ag([vu("center")],Iv.prototype,"strokeAlign",void 0),Iv=ag([Au()],Iv);var Fv=class extends Ug{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Iv(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,n,r,o){return this}quadraticCurveTo(t,e,i,n){return this}closePath(){return this}rect(t,e,i,n){return this}roundRect(t,e,i,n,r){return this}ellipse(t,e,i,n,r,o,s,a){return this}arc(t,e,i,n,r,o){return this}arcTo(t,e,i,n,r){return this}drawEllipse(t,e,i,n,r,o,s,a){return this}drawArc(t,e,i,n,r,o){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){const{pathElement:t}=this;t.__layout.boxChanged||t.forceUpdate("path")}};function Wv(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}ag([ku(class extends Pg{})],Fv.prototype,"__",void 0),ag([(t,e)=>{ru(t,e,{get(){return this.__path}})}],Fv.prototype,"path",void 0),Fv=ag([Ru(Hc,["set","path","paint"]),Au()],Fv);var zv=class extends Xg{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:n,editor:r}=t;e&&(this.ground=this.addLeafer(e)),(i||r)&&(this.tree=this.addLeafer(i||{type:t.type||"design"})),(n||r)&&(this.sky=this.addLeafer(n)),r&&al.editor(r,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 Xg(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),as(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&&_s.assign(e,t),this.autoLayout&&_s.copyAttrs(e,this,Pl),e.view=this.realCanvas?void 0:this.view,e.fill=void 0,e}__listenChildEvents(t){t.once([[Mp.END,this.__onReady,this],[Ip.START,this.__onCreated,this],[Ip.END,this.__onViewReady,this]]),this.realCanvas&&this.__eventIds.push(t.on_(Ip.END,this.__onChildRenderEnd,this))}};zv=Wv([Au()],zv);var Nv={},jv={isHoldSpaceKey:()=>jv.isHold("Space"),isHold:t=>Nv[t],isHoldKeys:(t,e)=>e?t(e):void 0,setDownCode(t){Nv[t]||(Nv[t]=!0)},setUpCode(t){Nv[t]=!1}},Vv={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},Hv=class extends wp{get spaceKey(){return jv.isHoldSpaceKey()}get left(){return Vv.left(this)}get right(){return Vv.right(this)}get middle(){return Vv.middle(this)}constructor(t){super(t.type),this.bubbles=!0,Object.assign(this,t)}isHoldKeys(t){return jv.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){ul.changeName(t,e)}},{min:Uv,max:Yv,abs:Xv}=Math,{float:Gv,sign:Kv}=Ms,{minX:$v,maxX:Zv,minY:qv,maxY:Jv}=za,Qv=new Ha,t_=new Ha,e_={limitMove(t,e){const{dragBounds:i,dragBoundsType:n}=t;i&&i_.getValidMove(t.__localBoxBounds,i_.getDragBounds(t),n,e,!0),i_.axisMove(t,e)},limitScaleOf(t,e,i,n){const{dragBounds:r,dragBoundsType:o}=t;r&&i_.getValidScaleOf(t.__localBoxBounds,i_.getDragBounds(t),o,t.getLocalPointByInner(t.getInnerPointByBox(e)),i,n,!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,n)=>"inner"===i||"auto"===i&&Gv(t[n])>Gv(e[n]),getValidMove(t,e,i,n,r){const o=t.x+n.x,s=t.y+n.y,a=o+t.width,l=s+t.height,h=e.x+e.width,c=e.y+e.height;return r||(n=Object.assign({},n)),i_.isInnerMode(t,e,i,"width")?o>e.x?n.x+=e.x-o:a<h&&(n.x+=h-a):o<e.x?n.x+=e.x-o:a>h&&(n.x+=h-a),i_.isInnerMode(t,e,i,"height")?s>e.y?n.y+=e.y-s:l<c&&(n.y+=c-l):s<e.y?n.y+=e.y-s:l>c&&(n.y+=c-l),n.x=Gv(n.x),n.y=Gv(n.y),n},getValidScaleOf(t,e,i,n,r,o,s){s||(r=Object.assign({},r)),t_.set(e),Qv.set(t).scaleOf(n,r.x,r.y);const a=(n.x-t.x)/t.width,l=1-a,h=(n.y-t.y)/t.height,c=1-h;let d,u,p,f,g=1,v=1;return i_.isInnerMode(t,e,i,"width")?(r.x<0&&Qv.scaleOf(n,g=1/r.x,1),p=Gv(Qv.minX-t_.minX),f=Gv(t_.maxX-Qv.maxX),d=a&&p>0?1+p/(a*Qv.width):1,u=l&&f>0?1+f/(l*Qv.width):1,g*=Yv(d,u)):(r.x<0&&((Gv($v(t)-$v(e))<=0||Gv(Zv(e)-Zv(t))<=0)&&Qv.scaleOf(n,g=1/r.x,1),Qv.unsign()),p=Gv(t_.minX-Qv.minX),f=Gv(Qv.maxX-t_.maxX),d=a&&p>0?1-p/(a*Qv.width):1,u=l&&f>0?1-f/(l*Qv.width):1,g*=Uv(d,u)),i_.isInnerMode(t,e,i,"height")?(r.y<0&&Qv.scaleOf(n,1,v=1/r.y),p=Gv(Qv.minY-t_.minY),f=Gv(t_.maxY-Qv.maxY),d=h&&p>0?1+p/(h*Qv.height):1,u=c&&f>0?1+f/(c*Qv.height):1,v*=Yv(d,u),o&&(d=Yv(Xv(g),Xv(v)),g=Kv(g)*d,v=Kv(v)*d)):(r.y<0&&((Gv(qv(t)-qv(e))<=0||Gv(Jv(e)-Jv(t))<=0)&&Qv.scaleOf(n,1,v=1/r.y),Qv.unsign()),p=Gv(t_.minY-Qv.minY),f=Gv(Qv.maxY-t_.maxY),d=h&&p>0?1-p/(h*Qv.height):1,u=c&&f>0?1-f/(c*Qv.height):1,v*=Uv(d,u)),r.x*=cs(g)?g:1,r.y*=cs(v)?v:1,r}},i_=e_,n_=class extends Hv{};n_.POINTER="pointer",n_.BEFORE_DOWN="pointer.before_down",n_.BEFORE_MOVE="pointer.before_move",n_.BEFORE_UP="pointer.before_up",n_.DOWN="pointer.down",n_.MOVE="pointer.move",n_.UP="pointer.up",n_.OVER="pointer.over",n_.OUT="pointer.out",n_.ENTER="pointer.enter",n_.LEAVE="pointer.leave",n_.TAP="tap",n_.DOUBLE_TAP="double_tap",n_.CLICK="click",n_.DOUBLE_CLICK="double_click",n_.LONG_PRESS="long_press",n_.LONG_TAP="long_tap",n_.MENU="pointer.menu",n_.MENU_TAP="pointer.menu_tap";n_=Wv([Du()],n_);var r_={},o_=class extends n_{static setList(t){this.list=t instanceof og?t:new og(t)}static setData(t){this.data=t}static getValidMove(t,e,i,n=!0){const r=t.getLocalPoint(i,null,!0);return la.move(r,e.x-t.x,e.y-t.y),n&&this.limitMove(t,r),e_.axisMove(t,r),r}static limitMove(t,e){e_.limitMove(t,e)}getPageMove(t){return this.assignMove(t),this.current.getPagePoint(r_,null,!0)}getInnerMove(t,e){return t||(t=this.current),this.assignMove(e),t.getInnerPoint(r_,null,!0)}getLocalMove(t,e){return t||(t=this.current),this.assignMove(e),t.getLocalPoint(r_,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 za.set(i,e.x-t.x,e.y-t.y,t.x,t.y),za.unsign(i),i}assignMove(t){r_.x=t?this.totalX:this.moveX,r_.y=t?this.totalY:this.moveY}};o_.BEFORE_DRAG="drag.before_drag",o_.START="drag.start",o_.DRAG="drag",o_.END="drag.end",o_.OVER="drag.over",o_.OUT="drag.out",o_.ENTER="drag.enter",o_.LEAVE="drag.leave",o_=Wv([Du()],o_);var s_=class extends n_{static setList(t){o_.setList(t)}static setData(t){o_.setData(t)}};s_.DROP="drop",s_=Wv([Du()],s_);var a_=class extends o_{};a_.BEFORE_MOVE="move.before_move",a_.START="move.start",a_.MOVE="move",a_.DRAG_ANIMATE="move.drag_animate",a_.END="move.end",a_.PULL_DOWN="move.pull_down",a_.REACH_BOTTOM="move.reach_bottom",a_=Wv([Du()],a_);var l_=class extends Hv{};l_=Wv([Du()],l_);var h_=class extends n_{};h_.BEFORE_ROTATE="rotate.before_rotate",h_.START="rotate.start",h_.ROTATE="rotate",h_.END="rotate.end",h_=Wv([Du()],h_);var c_=class extends o_{};c_.SWIPE="swipe",c_.LEFT="swipe.left",c_.RIGHT="swipe.right",c_.UP="swipe.up",c_.DOWN="swipe.down",c_=Wv([Du()],c_);var d_=class extends n_{};d_.BEFORE_ZOOM="zoom.before_zoom",d_.START="zoom.start",d_.ZOOM="zoom",d_.END="zoom.end",d_=Wv([Du()],d_);var u_=class extends Hv{};u_.BEFORE_DOWN="key.before_down",u_.BEFORE_UP="key.before_up",u_.DOWN="key.down",u_.HOLD="key.hold",u_.UP="key.up",u_=Wv([Du()],u_);var p_={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?c_.UP:t>45&&t<135?c_.DOWN:t<=45&&t>=-45?c_.RIGHT:c_.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:f_.getSwipeDirection(la.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:as(t.buttons)?1:0===t.buttons?e:t.buttons,origin:t}},pathHasEventType(t,e){const{list:i}=t;for(let n=0,r=i.length;n<r;n++)if(i[n].hasEvent(e))return!0;return!1},filterPathByEventType(t,e){const i=new og,{list:n}=t;for(let r=0,o=n.length;r<o;r++)n[r].hasEvent(e)&&i.add(n[r]);return i},pathCanDrag:t=>t&&t.list.some(t=>Xu.draggable(t)||!t.isLeafer&&t.hasEvent(o_.DRAG)),pathHasOutside:t=>t&&t.list.some(t=>t.isOutside)},f_=p_,g_=new og,{getDragEventData:v_,getDropEventData:__,getSwipeEventData:m_}=p_,y_=class{constructor(t){this.dragDataList=[],this.interaction=t}setDragData(t){this.animateWait&&this.dragEndReal(),this.downData=this.interaction.downData,this.dragData=v_(t,t,t),this.canAnimate=this.canDragOut=!0}getList(t,e){const{proxy:i}=this.interaction.selector,n=i&&i.list.length,r=o_.list||this.draggableList||g_;return this.dragging&&(n?t?g_:new og(e?[...i.list,...i.dragHoverExclude]:i.list):r)}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(a_.START,this.dragData)),this.moving||this.dragStart(t,e),this.drag(t)}dragStart(t,e){this.dragging||(this.dragging=e&&Vv.left(t),this.dragging&&(this.interaction.emit(o_.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,n=t.length;i<n;i++)if(e=t.list[i],Xu.draggable(e)){this.draggableList=new og(e);break}}drag(t){const{interaction:e,dragData:i,downData:n}=this,{path:r,throughPath:o}=n;this.dragData=v_(n,i,t),o&&(this.dragData.throughPath=o),this.dragData.path=r,this.dragDataList.push(this.dragData),this.moving?(t.moving=!0,this.dragData.moveType="drag",e.emit(a_.BEFORE_MOVE,this.dragData),e.emit(a_.MOVE,this.dragData)):this.dragging&&(t.dragging=!0,this.dragReal(),e.emit(o_.BEFORE_DRAG,this.dragData),e.emit(o_.DRAG,this.dragData))}dragReal(t){const{interaction:e}=this,{running:i}=e,n=this.realDraggableList;if(n.length&&i){const{totalX:i,totalY:r}=this.dragData,{dragLimitAnimate:o}=e.p,s=!o||!!t;n.forEach(e=>{if(e.draggable){const n=hs(e.draggable),a=o_.getValidMove(e,this.dragStartPoints[e.innerId],{x:i,y:r},s||n);o&&!n&&t?Xu.animateMove(e,a,ds(o)?o:.3):e.move(a)}})}}dragOverOrOut(t){const{interaction:e}=this,{dragOverPath:i}=this,{path:n}=t;this.dragOverPath=n,i?n.indexAt(0)!==i.indexAt(0)&&(e.emit(o_.OUT,t,i),e.emit(o_.OVER,t,n)):e.emit(o_.OVER,t,n)}dragEnterOrLeave(t){const{interaction:e}=this,{dragEnterPath:i}=this,{path:n}=t;e.emit(o_.LEAVE,t,i,n),e.emit(o_.ENTER,t,n,i),this.dragEnterPath=n}dragEnd(t){(this.dragging||this.moving)&&(this.checkDragEndAnimate(t)||this.dragEndReal(t))}dragEndReal(t){const{interaction:e,downData:i,dragData:n}=this;t||(t=n);const{path:r,throughPath:o}=i,s=v_(i,t,t);if(o&&(s.throughPath=o),s.path=r,this.moving&&(this.moving=!1,s.moveType="drag",e.emit(a_.END,s)),this.dragging){const r=this.getList();this.dragging=!1,e.p.dragLimitAnimate&&this.dragReal(!0),e.emit(o_.END,s),this.swipe(t,i,n,s),this.drop(t,r,this.dragEnterPath)}this.autoMoveCancel(),this.dragReset(),this.animate(null,"off")}swipe(t,e,i,n){const{interaction:r}=this;if(la.getDistance(e,t)>r.config.pointer.swipeDistance){const t=m_(e,i,n);this.interaction.emit(t.type,t)}}drop(t,e,i){const n=__(t,e,o_.data);n.path=i,this.interaction.emit(s_.DROP,n),this.interaction.emit(o_.LEAVE,t,i)}dragReset(){o_.list=o_.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()}},x_=Qa.get("emit"),w_=["move","zoom","rotate","key"];function b_(t,e,i,n,r){if(w_.some(t=>e.startsWith(t))&&t.__.hitChildren&&!k_(t,r)){let o;for(let s=0,a=t.children.length;s<a;s++)o=t.children[s],!i.path.has(o)&&o.__.hittable&&S_(o,e,i,n,r)}}function S_(t,e,i,n,r){if(t.destroyed)return!1;if(t.__.hitSelf&&!k_(t,r)&&(xg.updateEventStyle&&!n&&xg.updateEventStyle(t,e),t.hasEvent(e,n))){i.phase=n?1:t===i.target?2:3;const r=ul.get(e,i);if(t.emitEvent(r,n),r.isStop)return!0}return!1}function k_(t,e){return e&&e.has(t)}var E_={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:C_,pathCanDrag:O_,pathHasOutside:L_}=p_,P_=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&&Vv.middle(this.downData)}get isHoldRightKey(){return this.m.holdRightKey&&this.downData&&Vv.right(this.downData)}get isHoldSpaceKey(){return this.m.holdSpaceKey&&jv.isHoldSpaceKey()}get m(){return this.config.move}get p(){return this.config.pointer}get hitRadius(){return this.p.hitRadius}constructor(t,e,i,n){this.config=_s.clone(E_),this.tapCount=0,this.downKeyMap={},this.target=t,this.canvas=e,this.selector=i,this.defaultPath=new og(t),this.createTransformer(),this.dragger=new y_(this),n&&(this.config=_s.default(n,this.config)),this.__listenEvents()}start(){this.running=!0}stop(){this.running=!1}receive(t){}pointerDown(t,e){t||(t=this.hoverData),t&&(Vv.defaultLeft(t),this.updateDownData(t),this.checkPath(t,e),this.downTime=Date.now(),this.emit(n_.BEFORE_DOWN,t),t.path.needUpdate&&this.updateDownData(t),this.emit(n_.DOWN,t),Vv.left(t)&&(this.tapWait(),this.longPressWait(t)),this.waitRightTap=Vv.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&&Vv.defaultLeft(t),(this.canvas.bounds.hitPoint(t)||e)&&(this.pointerMoveReal(t),e&&this.dragger.checkDragOut(t))}pointerMoveReal(t){if(this.emit(n_.BEFORE_MOVE,t,this.defaultPath),this.downData){const e=la.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(n_.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;Vv.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(n_.BEFORE_UP,t),this.emit(n_.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(n_.MENU,t),this.waitMenuTap=!0,!this.downData&&this.waitRightTap&&this.menuTap(t)}menuTap(t){this.waitRightTap&&this.waitMenuTap&&(this.emit(n_.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(u_.BEFORE_DOWN,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]||(this.downKeyMap[e]=!0,jv.setDownCode(e),this.emit(u_.HOLD,t,this.defaultPath),this.moveMode&&(this.cancelHover(),this.updateCursor())),this.emit(u_.DOWN,t,this.defaultPath)}keyUp(t){if(!this.config.keyEvent)return;this.emit(u_.BEFORE_UP,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]=!1,jv.setUpCode(e),this.emit(u_.UP,t,this.defaultPath),"grab"===this.cursor&&this.updateCursor()}pointerHover(t){!this.canHover||this.dragging&&!this.p.dragHover||(t.path||(t.path=new og),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(n_.OUT,t,i),this.emit(n_.OVER,t,e)):this.emit(n_.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(n_.LEAVE,t,i,e),this.emit(n_.ENTER,t,e,i)}touchLeave(t){"touch"===t.pointerType&&this.enterPath&&(this.emit(n_.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 n=Date.now()-this.downTime,r=[n_.DOUBLE_TAP,n_.DOUBLE_CLICK].some(e=>C_(t.path,e));n<e.tapTime+50&&r?(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:n}=this.p,{bottomList:r,target:o}=this;Za.backgrounder||t.origin||o&&o.updateLayout();const s=this.selector.getByPoint(t,i,Object.assign({bottomList:r,name:t.type},e||{through:n}));return s.throughPath&&(t.throughPath=s.throughPath),t.path=s.path,s.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&&!L_(t.path))&&(t.path=this.defaultPath)}canMove(t){return t&&(this.moveMode||"auto"===this.m.drag&&!O_(t.path))&&!L_(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:n}=this;!t&&n&&(t=n),t&&(this.findPath(t,e),i&&n&&t.path.addList(n.path.list),this.downData=t)}updateHoverData(t){t||(t=this.hoverData),t&&(this.findPath(t,{exclude:this.dragger.getList(!1,!0),name:n_.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:n}=t;for(let r=0,o=n.length;r<o&&(e=n.list[r],i=e.syncEventer&&e.syncEventer.cursor||e.cursor,!i);r++);this.setCursor(i)}setCursor(t){this.cursor=t}getLocal(t,e){const i=this.canvas.getClientBounds(e),n={x:t.clientX-i.x,y:t.clientY-i.y},{bounds:r}=this.canvas;return n.x*=r.width/i.width,n.y*=r.height/i.height,this.p.snap&&la.round(n),n}emitTap(t){this.emit(n_.TAP,t),this.emit(n_.CLICK,t)}emitDoubleTap(t){this.emit(n_.DOUBLE_TAP,t),this.emit(n_.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(n_.LONG_PRESS,t)},this.p.longPressTime)}longTap(t){let e;return this.longPressed&&(this.emit(n_.LONG_TAP,t),(C_(t.path,n_.LONG_TAP)||C_(t.path,n_.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 Ha(this.canvas.bounds),this.shrinkCanvasBounds.spread(-(ds(t)?t:2))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(Ap.RESIZE,this.__onResize,this)],t.once(Fp.READY,()=>this.__onResize())}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}emit(t,e,i,n){this.running&&function(t,e,i,n){if(!i&&!e.path)return;let r;e.type=t,i?e=Object.assign(Object.assign({},e),{path:i}):i=e.path,e.target=i.indexAt(0);try{for(let o=i.length-1;o>-1;o--){if(r=i.list[o],S_(r,t,e,!0,n))return;r.isApp&&b_(r,t,e,!0,n)}for(let o=0,s=i.length;o<s;o++)if(r=i.list[o],r.isApp&&b_(r,t,e,!1,n),S_(r,t,e,!1,n))return}catch(t){x_.error(t)}}(t,e,i,n)}destroy(){this.__eventIds.length&&(this.stop(),this.__removeListenEvents(),this.dragger.destroy(),this.transformer&&this.transformer.destroy(),this.downData=this.overPath=this.enterPath=null)}},T_=class{static set(t,e){this.custom[t]=e}static get(t){return this.custom[t]}};T_.custom={};var B_=class extends fl{constructor(){super(...arguments),this.maxTotal=1e3,this.pathList=new og,this.pixelList=new og}getPixelType(t,e){return this.__autoClear(),this.pixelList.add(t),al.hitCanvas(e)}getPathType(t){return this.__autoClear(),this.pathList.add(t),al.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()}};Za.getSelector=function(t){return t.leafer?t.leafer.selector:Za.selector||(Za.selector=al.selector())};var{toInnerRadiusPointOf:R_,copyRadiusPoint:A_}=la,{hitRadiusPoint:D_,hitPoint:M_}=za,I_={},F_={},W_=Kf.prototype;W_.hit=function(t,e=0){this.updateLayout(),A_(F_,t,e);const i=this.__world;return!!(e?D_(i,F_):M_(i,F_))&&(this.isBranch?Za.getSelector(this).hitPoint(Object.assign({},F_),e,{target:this}):this.__hitWorld(F_))},W_.__hitWorld=function(t,e){const i=this.__;if(!i.hitSelf)return!1;const n=this.__world,r=this.__layout,o=n.width<10&&n.height<10;if(i.hitRadius&&(A_(I_,t,i.hitRadius),t=I_),R_(t,n,I_),i.hitBox||o){if(za.hitRadiusPoint(r.boxBounds,I_))return!0;if(o)return!1}return!r.hitCanvasChanged&&this.__hitCanvas||(this.__updateHitCanvas(),r.boundsChanged||(r.hitCanvasChanged=!1)),this.__hit(I_,e)},W_.__hitFill=function(t){const e=this.__hitCanvas;return e&&e.hitFill(t,this.__.windingRule)},W_.__hitStroke=function(t,e){const i=this.__hitCanvas;return i&&i.hitStroke(t,e)},W_.__hitPixel=function(t){const e=this.__hitCanvas;return e&&e.hitPixel(t,this.__layout.renderBounds,e.hitScale)},W_.__drawHitPath=function(t){t&&this.__drawRenderPath(t)};var z_=new ga,N_=Vg.prototype;N_.__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,n=e.__isAlphaPixelStroke&&"pixel"===e.hitStroke,r=i||n;this.__hitCanvas||(this.__hitCanvas=r?t.getPixelType(this,{contextSettings:{willReadFrequently:!0}}):t.getPathType(this));const o=this.__hitCanvas;if(r){const{renderBounds:t}=this.__layout,r=Za.image.hitCanvasSize,s=o.hitScale=Ua.set(0,0,r,r).getFitMatrix(t).a,{x:a,y:l,width:h,height:c}=Ua.set(t).scale(s);o.resize({width:h,height:c,pixelRatio:1}),o.clear(),Qd.patternLocked=!0,this.__renderShape(o,{matrix:z_.setWith(this.__world).scaleWith(1/s).invertWith().translate(-a,-l),snapshot:!0,ignoreFill:!i,ignoreStroke:!n}),Qd.patternLocked=!1,o.resetTransform(),e.__isHitPixel=!0}else e.__isHitPixel&&(e.__isHitPixel=!1);this.__drawHitPath(o),o.setStrokeOptions(e)},N_.__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:n}=i,r=(i.fill||i.__isCanvas)&&("path"===n||"pixel"===n&&!(i.__isAlphaPixelFill||i.__isCanvas))||"all"===n||e;if(r&&this.__hitFill(t))return!0;const{hitStroke:o,__maxStrokeWidth:s}=i,a=i.stroke&&("path"===o||"pixel"===o&&!i.__isAlphaPixelStroke)||"all"===o;if(!r&&!a)return!1;const l=2*t.radiusX;let h=l;if(a)switch(i.strokeAlign){case"inside":if(h+=2*s,!r&&this.__hitFill(t)&&this.__hitStroke(t,h))return!0;h=l;break;case"center":h+=s;break;case"outside":if(h+=2*s,!r){if(!this.__hitFill(t)&&this.__hitStroke(t,h))return!0;h=l}}return!!h&&this.__hitStroke(t,h)};var j_=Vg.prototype,V_=Gg.prototype,H_=Qg.prototype;V_.__updateHitCanvas=H_.__updateHitCanvas=function(){this.stroke||this.cornerRadius||(this.fill||this.__.__isCanvas)&&"pixel"===this.hitFill||"all"===this.hitStroke?j_.__updateHitCanvas.call(this):this.__hitCanvas&&(this.__hitCanvas=null)},V_.__hitFill=H_.__hitFill=function(t){return this.__hitCanvas?j_.__hitFill.call(this,t):za.hitRadiusPoint(this.__layout.boxBounds,t)},Mv.prototype.__drawHitPath=function(t){const{__lineHeight:e,fontSize:i,__baseLine:n,__letterSpacing:r,__textDrawData:o}=this.__;t.beginPath(),r<0?this.__drawPathByBox(t):o.rows.forEach(r=>t.rect(r.x,r.y-n,r.width,e<i?i:e))},Ug.prototype.pick=function(t,e){return e||(e=ss),this.updateLayout(),Za.getSelector(this).getByPoint(t,e.hitRadius||0,Object.assign(Object.assign({},e),{target:this}))};var U_,Y_=Tl.prototype;function X_(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,a)}l((n=n.apply(t,e||[])).next())})}Y_.hitFill=function(t,e){return e?this.context.isPointInPath(t.x,t.y,e):this.context.isPointInPath(t.x,t.y)},Y_.hitStroke=function(t,e){return this.strokeWidth=e,this.context.isPointInStroke(t.x,t.y)},Y_.hitPixel=function(t,e,i=1){let{x:n,y:r,radiusX:o,radiusY:s}=t;e&&(n-=e.x,r-=e.y),Ua.set(n-o,r-s,2*o,2*s).scale(i).ceil();const{data:a}=this.context.getImageData(Ua.x,Ua.y,Ua.width||1,Ua.height||1);for(let l=0,h=a.length;l<h;l+=4)if(a[l+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"}(U_||(U_={}));var G_=Qa.get("LeaferCanvas"),K_=class extends Tl{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 n=i.children[t];n?(this.setAbsolute(n),i.insertBefore(e,n)):i.appendChild(n)}}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")}Za.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=hs(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 G_.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:n}=this.view;n.width=t+"px",n.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),G_.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()),Za.requestRender(this.imitateResizeObserver.bind(this)))}listenPixelRatio(){this.windowListener||window.addEventListener("resize",this.windowListener=()=>{const t=Za.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:n,width:r,height:o}=this.autoBounds.getBoundsFrom(t),s={width:r,height:o,pixelRatio:this.config.pixelRatio?this.pixelRatio:Za.devicePixelRatio};if(!this.isSameSize(s)){const{style:t}=e;t.marginLeft=i+"px",t.marginTop=n+"px",this.emitResize(s)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};_s.copyAttrs(e,this,Pl),this.resize(t),this.resizeListener&&!as(this.width)&&this.resizeListener(new Ap(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())}};Ud(CanvasRenderingContext2D.prototype),Ud(Path2D.prototype),Object.assign(al,{canvas:(t,e)=>new K_(t,e),image:t=>new nu(t)}),Za.name="web",Za.isMobile="ontouchstart"in window,Za.requestRender=function(t){window.requestAnimationFrame(t)},ru(Za,"devicePixelRatio",{get:()=>devicePixelRatio});var{userAgent:$_}=navigator;$_.indexOf("Firefox")>-1?(Za.intWheelDeltaY=!0,Za.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(Za.fullImageShadow=!0),$_.indexOf("Windows")>-1?(Za.os="Windows",Za.intWheelDeltaY=!0):$_.indexOf("Mac")>-1?Za.os="Mac":$_.indexOf("Linux")>-1&&(Za.os="Linux");var Z_=class{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new og;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 og,this.target=t,e&&(this.config=_s.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(Ip.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===bp.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,n=e.length;i<n;i++)this.__pushChild(e[i])}__onRquestData(){this.target.emitEvent(new Dp(Dp.DATA,{updatedList:this.updatedList})),this.__updatedList=new og,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[kp.CHANGE,this.__onAttrChange,this],[[bp.ADD,bp.REMOVE],this.__onChildEvent,this],[Dp.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}},{updateAllMatrix:q_,updateBounds:J_,updateChange:Q_}=Xu,{pushAllChildBranch:tm,pushAllParent:em}=rp,{worldBounds:im}=ep,nm=class{constructor(t){this.updatedBounds=new Ha,this.beforeBounds=new Ha,this.afterBounds=new Ha,us(t)&&(t=new og(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,im)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,im),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:rm,updateAllChange:om}=Xu,sm=Qa.get("Layouter"),am=class t{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new sg,this.target=t,e&&(this.config=_s.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(Mp.START),this.layoutOnce(),t.emitEvent(new Mp(Mp.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(Dp.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=nl.start("PartLayout"),{target:i,__updatedList:n}=this,{BEFORE:r,LAYOUT:o,AFTER:s}=Mp,a=this.getBlocks(n);a.forEach(t=>t.setBefore()),i.emitEvent(new Mp(r,a,this.times)),this.extraBlock=null,n.sort(),function(t,e){let i;t.list.forEach(t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(q_(t,!0),e.add(t),t.isBranch&&tm(t,e),em(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),em(t,e)))})}(n,this.__levelList),function(t){let e,i,n;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,o=e.length;t<o;t++){if(i=e[t],i.isBranch&&i.__tempNumber){n=i.children;for(let t=0,e=n.length;t<e;t++)n[t].isBranch||J_(n[t])}J_(i)}})}(this.__levelList),function(t){t.list.forEach(Q_)}(n),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),i.emitEvent(new Mp(o,a,this.times)),i.emitEvent(new Mp(s,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,nl.end(e)}fullLayout(){const e=nl.start("FullLayout"),{target:i}=this,{BEFORE:n,LAYOUT:r,AFTER:o}=Mp,s=this.getBlocks(new og(i));i.emitEvent(new Mp(n,s,this.times)),t.fullLayout(i),s.forEach(t=>{t.setAfter()}),i.emitEvent(new Mp(r,s,this.times)),i.emitEvent(new Mp(o,s,this.times)),this.addBlocks(s),nl.end(e)}static fullLayout(t){rm(t,!0),t.isBranch?rp.updateBounds(t):Xu.updateBounds(t),om(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new nm([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new nm(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_([[Mp.REQUEST,this.layout,this],[Mp.AGAIN,this.layoutAgain,this],[Dp.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}},lm=Qa.get("Renderer"),hm=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=_s.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(Mp.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Ip.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Ip.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Ip.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Ha,lm.log(e.innerName,"---\x3e");try{this.emitRender(Ip.START),this.renderOnce(t),this.emitRender(Ip.END,this.totalBounds),Qd.clearRecycled()}catch(t){this.rendering=!1,lm.error(t)}lm.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return lm.warn("rendering");if(this.times>3)return lm.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Ha,this.renderOptions={},t)this.emitRender(Ip.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Ip.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Ip.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Ip.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=nl.start("PartRender"),{canvas:n}=this,r=e.getIntersect(n.bounds),o=new Ha(r);n.save(),r.spread(t.clipSpread).ceil();const{ceilPartPixel:s}=this.config;n.clipWorld(r,s),n.clearWorld(r,s),this.__render(r,o),n.restore(),nl.end(i)}fullRender(){const t=nl.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),nl.end(t)}__render(t,e){const{canvas:i,target:n}=this,r=t.includes(n.__world),o=r?{includes:r}:{bounds:t,includes:r};this.needFill&&i.fillWorld(t,this.config.fill),Qa.showRepaint&&Qa.drawRepaint(i,t),this.config.useCellRender&&(o.cellList=this.getCellList()),Za.render(n,i,o),this.renderBounds=e=e||t,this.renderOptions=o,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 Ha;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 Za.requestRender(e);const{frames:n}=this;n.length>30&&n.shift(),n.push(t),this.FPS=Math.round(n.reduce((t,e)=>t+e,0)/n.length),this.requestTime=0,this.checkRender()};Za.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new Ha(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 Ha(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||lm.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 Ip(t,this.times,e,i))}__listenEvents(){this.__eventIds=[this.target.on_([[Ip.REQUEST,this.update,this],[Mp.END,this.__onLayoutEnd,this],[Ip.AGAIN,this.renderAgain,this],[Ap.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}};hm.clipSpread=10;var cm={},{copyRadiusPoint:dm}=la,{hitRadiusPoint:um}=za,pm=class{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const n=i.through||!1,r=i.ignoreHittable||!1,o=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new og(i.findList),i.findList||this.hitBranch(o.isBranchLeaf?{children:[o]}:o);const{list:s}=this.findList,a=this.getBestMatchLeaf(s,i.bottomList,r,!!i.findList),l=r?this.getPath(a):this.getHitablePath(a);return this.clear(),n?{path:l,target:a,throughPath:s.length?this.getThroughPath(s):l}:{path:l,target:a}}hitPoint(t,e,i){return!!this.getByPoint(t,e,i).target}getBestMatchLeaf(t,e,i,n){const r=this.findList=new og;if(t.length){let e;const{x:n,y:o}=this.point,s={x:n,y:o,radiusX:0,radiusY:0};for(let a=0,l=t.length;a<l;a++)if(e=t[a],(i||Xu.worldHittable(e))&&(this.hitChild(e,s),r.length)){if(e.isBranchLeaf&&t.some(t=>t!==e&&Xu.hasParent(t,e))){r.reset();break}return r.list[0]}}if(e)for(let o=0,s=e.length;o<s;o++)if(this.hitChild(e[o].target,this.point,e[o].proxy),r.length)return r.list[0];return n?null:i?t[0]:t.find(t=>Xu.worldHittable(t))}getPath(t){const e=new og,i=[],{target:n}=this;for(;t&&(t.syncEventer&&i.push(t.syncEventer),e.add(t),(t=t.parent)!==n););return i.length&&i.forEach(t=>{for(;t&&(t.__.hittable&&e.add(t),(t=t.parent)!==n););}),n&&e.add(n),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,n=new og;for(let r=e.list.length-1;r>-1&&(i=e.list[r],i.__.hittable)&&(n.addAt(i,0),i.__.hitChildren&&(!i.isLeafer||"draw"!==i.mode));r--);return n}getThroughPath(t){const e=new og,i=[];for(let s=t.length-1;s>-1;s--)i.push(this.getPath(t[s]));let n,r,o;for(let s=0,a=i.length;s<a;s++){n=i[s],r=i[s+1];for(let t=0,i=n.length;t<i&&(o=n.list[t],!r||!r.has(o));t++)e.add(o)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,n,r;const{point:o}=this;for(let s=t.length-1;s>-1;s--)if(i=t[s],r=i.__,r.visible&&(!e||r.mask))if(n=um(i.__world,r.hitRadius?dm(cm,o,r.hitRadius):o),i.isBranch){if(n||i.__ignoreHitWorld){if(i.isBranchLeaf&&r.__clipAfterFill&&!i.__hitWorld(o,!0))continue;i.topChildren&&this.eachFind(i.topChildren,!1),this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&this.hitChild(i,o)}}else n&&this.hitChild(i,o)}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:n}=t;if(n&&n.__hasMask&&!t.__.mask){let i,r=[];const{children:o}=n;for(let n=0,s=o.length;n<s;n++)if(i=o[n],i.__.mask&&r.push(i),i===t){if(r&&!r.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()}},fm=class{constructor(t,e){this.config={},e&&(this.config=_s.default(e,this.config)),this.picker=new pm(this.target=t,this),this.finder=al.finder&&al.finder(t,this.config)}getByPoint(t,e,i){const{target:n,picker:r}=this;return Za.backgrounder&&n&&n.updateLayout(),r.getByPoint(t,e,i)}hitPoint(t,e,i){return this.picker.hitPoint(t,e,i)}getBy(t,e,i,n){return this.finder?this.finder.getBy(t,e,i,n):sl.need("find")}destroy(){this.picker.destroy(),this.finder&&this.finder.destroy()}};Object.assign(al,{watcher:(t,e)=>new Z_(t,e),layouter:(t,e)=>new am(t,e),renderer:(t,e,i)=>new hm(t,e,i),selector:(t,e)=>new fm(t,e)}),Za.layout=am.fullLayout,Za.render=function(t,e,i){const n=Object.assign(Object.assign({},i),{topRendering:!0});i.topList=new og,t.__render(e,i),i.topList.length&&i.topList.forEach(t=>t.__render(e,n))};var gm={convert(t,e){const i=p_.getBase(t),{x:n,y:r}=e,o=Object.assign(Object.assign({},i),{x:n,y:r,width:t.width,height:t.height,pointerType:t.pointerType,pressure:t.pressure});return"pen"===o.pointerType&&(o.tangentialPressure=t.tangentialPressure,o.tiltX=t.tiltX,o.tiltY=t.tiltY,o.twist=t.twist),o},convertMouse(t,e){const i=p_.getBase(t),{x:n,y:r}=e;return Object.assign(Object.assign({},i),{x:n,y:r,width:1,height:1,pointerType:"mouse",pressure:.5})},convertTouch(t,e){const i=gm.getTouch(t),n=p_.getBase(t),{x:r,y:o}=e;return Object.assign(Object.assign({},n),{x:r,y:o,width:1,height:1,pointerType:"touch",multiTouch:t.touches.length>1,pressure:i.force})},getTouch:t=>t.targetTouches[0]||t.changedTouches[0]},vm={convert(t){const e=p_.getBase(t);return Object.assign(Object.assign({},e),{code:t.code,key:t.key})}},{pathCanDrag:_m}=p_,mm=class extends P_{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 n in e)e[n]=e[n].bind(this),t.addEventListener(n,e[n]);for(let n in i)i[n]=i[n].bind(this),this.windowTarget.addEventListener(n,i[n])}__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,n=t.length;i<n;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(vm.convert(t))}onKeyUp(t){this.keyUp(vm.convert(t))}onContextMenu(t){this.config.pointer.preventDefaultMenu&&t.preventDefault(),this.menu(gm.convert(t,this.getLocal(t)))}onScroll(){this.canvas.updateClientBounds()}onPointerDown(t){this.preventDefaultPointer(t),this.notPointer||(this.usePointer||(this.usePointer=!0),this.pointerDown(gm.convert(t,this.getLocal(t))))}onPointerMove(t,e){if(this.notPointer||this.preventWindowPointer(t))return;this.usePointer||(this.usePointer=!0);const i=gm.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(gm.convert(t,this.getLocal(t)))}onPointerCancel(){this.useMultiTouch||this.pointerCancel()}onMouseDown(t){this.preventDefaultPointer(t),this.notMouse||this.pointerDown(gm.convertMouse(t,this.getLocal(t)))}onMouseMove(t){this.notMouse||this.preventWindowPointer(t)||this.pointerMove(gm.convertMouse(t,this.getLocal(t,!0)))}onMouseUp(t){this.downData&&this.preventDefaultPointer(t),this.notMouse||this.preventWindowPointer(t)||this.pointerUp(gm.convertMouse(t,this.getLocal(t)))}onMouseCancel(){this.notMouse||this.pointerCancel()}onTouchStart(t){const e=gm.getTouch(t),i=this.getLocal(e,!0),{preventDefault:n}=this.config.touch;(!0===n||"auto"===n&&_m(this.findPath(i)))&&t.preventDefault(),this.multiTouchStart(t),this.notTouch||(this.touchTimer&&(window.clearTimeout(this.touchTimer),this.touchTimer=0),this.useTouch=!0,this.pointerDown(gm.convertTouch(t,i)))}onTouchMove(t){if(this.multiTouchMove(t),this.notTouch||this.preventWindowPointer(t))return;const e=gm.getTouch(t);this.pointerMove(gm.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=gm.getTouch(t);this.pointerUp(gm.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(p_.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const n=[];return t.forEach(t=>{i=e.find(e=>e.identifier===t.identifier),i&&n.push({from:this.getLocal(t),to:this.getLocal(i)})}),n}getLocalTouchs(t){return t.map(t=>this.getLocal(t))}onWheel(t){this.preventDefaultWheel(t),this.wheel(Object.assign(Object.assign(Object.assign({},p_.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=p_.getBase(t);Object.assign(e,this.getLocal(t));const i=t.scale/this.lastGestureScale,n=(t.rotation-this.lastGestureRotation)/Math.PI*180*(Ms.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:n})),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),ps(e[e.length-1])&&e.push("default"),this.canvas.view.style.cursor=e.map(t=>ps(t)?`url(${t.url}) ${t.x||0} ${t.y||0}`:t).join(",")}eachCursor(t,e,i=0){if(i++,us(t))t.forEach(t=>this.eachCursor(t,e,i));else{const n=hs(t)&&T_.get(t);n&&i<2?this.eachCursor(n,e,i):e.push(t)}}destroy(){this.view&&(super.destroy(),this.view=null,this.touches=null)}};function ym(t,e,i){t.__.__font?fg.fillText(t,e,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function xm(t,e,i,n,r){const o=i.__;ps(t)?fg.drawStrokesStyle(t,e,!1,i,n,r):(n.setStroke(t,o.__strokeWidth*e,o),n.stroke()),o.__useArrow&&fg.strokeArrow(t,i,n,r)}function wm(t,e,i,n,r){const o=i.__;ps(t)?fg.drawStrokesStyle(t,e,!0,i,n,r):(n.setStroke(t,o.__strokeWidth*e,o),fg.drawTextStroke(i,n,r))}function bm(t,e,i,n,r){const o=n.getSameCanvas(!0,!0);o.font=i.__.__font,wm(t,2,i,o,r),o.blendMode="outside"===e?"destination-out":"destination-in",fg.fillText(i,o,r),o.blendMode="normal",Xu.copyCanvasByWorld(i,n,o),o.recycle(i.__nowWorld)}var Sm,{getSpread:km,copyAndSpread:Em,toOuterOf:Cm,getOuterOf:Om,getByMove:Lm,move:Pm,getIntersectData:Tm}=za,Bm={},{stintSet:Rm}=_s,{hasTransparent:Am}=dg;function Dm(t,e,i){if(!ps(e)||!1===e.visible||0===e.opacity)return;let n;const{boxBounds:r}=i.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;n=gg.image(i,t,e,r,!Sm||!Sm[e.url]),"image"!==o&&gg[o](n);break;case"linear":n=vg.linearGradient(e,r);break;case"radial":n=vg.radialGradient(e,r);break;case"angular":n=vg.conicGradient(e,r);break;case"solid":const{color:s,opacity:a}=e;n={type:o,style:dg.string(s,a)};break;default:as(e.r)||(n={type:"solid",style:dg.string(e)})}if(n&&(n.originPaint=e,hs(n.style)&&Am(n.style)&&(n.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;n.strokeStyle=e.style}return n}var Mm,Im={compute:function(t,e){const i=e.__,n=[];let r,o,s,a=i.__input[t];us(a)||(a=[a]),Sm=gg.recycleImage(t,i);for(let l,h=0,c=a.length;h<c;h++)(l=Dm(t,a[h],e))&&(n.push(l),l.strokeStyle&&(s||(s=1),l.strokeStyle.strokeWidth&&(s=Math.max(s,l.strokeStyle.strokeWidth))));i["_"+t]=n.length?n:void 0,n.length?(n.every(t=>t.isTransparent)&&(n.some(t=>t.image)&&(r=!0),o=!0),"fill"===t?(Rm(i,"__isAlphaPixelFill",r),Rm(i,"__isTransparentFill",o)):(Rm(i,"__isAlphaPixelStroke",r),Rm(i,"__isTransparentStroke",o),Rm(i,"__hasMultiStrokeStyle",s))):i.__removePaint(t,!1)},fill:function(t,e,i,n){i.fillStyle=t,ym(e,i,n)},fills:function(t,e,i,n){let r,o,s;for(let a=0,l=t.length;a<l;a++){if(r=t[a],o=r.originPaint,r.image){if(s?s++:s=1,gg.checkImage(r,!e.__.__font,e,i,n))continue;if(!r.style){1===s&&r.image.isPlacehold&&e.drawImagePlaceholder(r,i,n);continue}}if(i.fillStyle=r.style,r.transform||o.scaleFixed){if(i.save(),r.transform&&i.transform(r.transform),o.scaleFixed){const{scaleX:t,scaleY:n}=e.getRenderScaleData(!0,o.scaleFixed,!1);1!==t&&i.scale(t,n)}o.blendMode&&(i.blendMode=o.blendMode),ym(e,i,n),i.restore()}else o.blendMode?(i.saveBlendMode(o.blendMode),ym(e,i,n),i.restoreBlendMode()):ym(e,i,n)}},fillPathOrText:ym,fillText:function(t,e,i){const n=t.__,{rows:r,decorationY:o}=n.__textDrawData;let s;n.__isPlacehold&&n.placeholderColor&&(e.fillStyle=n.placeholderColor);for(let a=0,l=r.length;a<l;a++)s=r[a],s.text?e.fillText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.fillText(t.char,t.x,s.y)});if(o){const{decorationColor:t,decorationHeight:i}=n.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>o.forEach(n=>e.fillRect(t.x,t.y+n,t.width,i)))}},stroke:function(t,e,i,n){const r=e.__;if(r.__strokeWidth)if(r.__font)fg.strokeText(t,e,i,n);else if(r.__pathForStroke)fg.fillStroke(t,e,i,n);else switch(r.strokeAlign){case"center":xm(t,1,e,i,n);break;case"inside":!function(t,e,i,n){i.save(),i.clipUI(e),xm(t,2,e,i,n),i.restore()}(t,e,i,n);break;case"outside":!function(t,e,i,n){const r=e.__;if(r.__fillAfterStroke)xm(t,2,e,i,n);else{const{renderBounds:o}=e.__layout,s=i.getSameCanvas(!0,!0);e.__drawRenderPath(s),xm(t,2,e,s,n),s.clipUI(r),s.clearWorld(o),Xu.copyCanvasByWorld(e,i,s),s.recycle(e.__nowWorld)}}(t,e,i,n)}},strokes:function(t,e,i,n){fg.stroke(t,e,i,n)},strokeText:function(t,e,i,n){switch(e.__.strokeAlign){case"center":wm(t,1,e,i,n);break;case"inside":bm(t,"inside",e,i,n);break;case"outside":e.__.__fillAfterStroke?wm(t,2,e,i,n):bm(t,"outside",e,i,n)}},drawTextStroke:function(t,e,i){let n,r=t.__.__textDrawData;const{rows:o,decorationY:s}=r;for(let a=0,l=o.length;a<l;a++)n=o[a],n.text?e.strokeText(n.text,n.x,n.y):n.data&&n.data.forEach(t=>{e.strokeText(t.char,t.x,n.y)});if(s){const{decorationHeight:t}=r;o.forEach(i=>s.forEach(n=>e.strokeRect(i.x,i.y+n,i.width,t)))}},drawStrokesStyle:function(t,e,i,n,r,o){let s;const a=n.__,{__hasMultiStrokeStyle:l}=a;l||r.setStroke(void 0,a.__strokeWidth*e,a);for(let h=0,c=t.length;h<c;h++)if(s=t[h],(!s.image||!gg.checkImage(s,!1,n,r,o))&&s.style){if(l){const{strokeStyle:t}=s;t?r.setStroke(s.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(s.style,a.__strokeWidth*e,a)}else r.strokeStyle=s.style;s.originPaint.blendMode?(r.saveBlendMode(s.originPaint.blendMode),i?fg.drawTextStroke(n,r,o):r.stroke(),r.restoreBlendMode()):i?fg.drawTextStroke(n,r,o):r.stroke()}},shape:function(t,e,i){const n=e.getSameCanvas(),r=e.bounds,o=t.__nowWorld,s=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let l,h,c,d,u,p;Cm(s.strokeSpread?(Em(Bm,s.boxBounds,s.strokeSpread),Bm):s.boxBounds,o,a);let{scaleX:f,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))p=n,l=u=a,h=o;else{let n;n=Za.fullImageShadow?a:Tm(s.renderShapeSpread?km(r,ks.swapAndScale(s.renderShapeSpread,f,g)):r,a),d=r.getFitMatrix(n);let{a:v,d:_}=d;d.a<1&&(p=e.getSameCanvas(),t.__renderShape(p,i),f*=v,g*=_),u=Om(a,d),l=Lm(u,-d.e,-d.f),h=Om(o,d),Pm(h,-d.e,-d.f);const m=i.matrix;m?(c=new ga(d),c.multiply(m),v*=m.scaleX,_*=m.scaleY):c=d,c.withScale(v,_),i=Object.assign(Object.assign({},i),{matrix:c})}return t.__renderShape(n,i),{canvas:n,matrix:c,fitMatrix:d,bounds:l,renderBounds:h,worldCanvas:p,shapeBounds:u,scaleX:f,scaleY:g}}},Fm=new Ha,{isSame:Wm}=za;function zm(t,e,i,n,r,o){let s=!0;const a=t.__;if("fill"!==e||a.__naturalWidth||(a.__naturalWidth=n.width/a.pixelRatio,a.__naturalHeight=n.height/a.pixelRatio,a.__autoSide&&(t.forceUpdate("width"),Xu.updateBounds(t),t.__proxyData&&(t.setProxyAttr("width",a.width),t.setProxyAttr("height",a.height)),s=!1)),!r.data){gg.createData(r,n,i,o);const{transform:t}=r.data,{opacity:e,blendMode:s}=i,l=t&&!t.onlyScale||a.path||a.cornerRadius;(l||e&&e<1||s)&&(r.complex=!l||2)}return i.filter&&gg.applyFilter(r,n,i.filter,t),s}function Nm(t,e){Hm(t,Cp.LOAD,e)}function jm(t,e){Hm(t,Cp.LOADED,e)}function Vm(t,e,i){e.error=i,t.forceUpdate("surface"),Hm(t,Cp.ERROR,e)}function Hm(t,e,i){t.hasEvent(e)&&t.emitEvent(new Cp(e,i))}function Um(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}var{get:Ym,translate:Xm}=Zs,Gm=new Ha,Km={},$m={};function Zm(t,e,i,n){const r=hs(t)||n?(n?i-n*e:i%e)/((n||Math.floor(i/e))-1):t;return"auto"===t&&r<0?0:r}var qm={},Jm={a:1,b:0,c:0,d:1,e:0,f:0},{get:Qm,set:ty,rotateOfOuter:ey,translate:iy,scaleOfOuter:ny,multiplyParent:ry,scale:oy,rotate:sy,skew:ay}=Zs;function ly(t,e,i,n,r,o,s,a){s&&sy(t,s),a&&ay(t,a.x,a.y),r&&oy(t,r,o),iy(t,e.x+i,e.y+n)}var{get:hy,scale:cy,copy:dy}=Zs,{getFloorScale:uy}=Ms,{abs:py}=Math,fy={image:function(t,e,i,n,r){let o,s;const a=Qd.get(i,i.type);return Mm&&i===Mm.paint&&Wm(n,Mm.boxBounds)?o=Mm.leafPaint:(o={type:i.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),Mm=a.use>1?{leafPaint:o,paint:i,boxBounds:Fm.set(n)}:null),(r||a.loading)&&(s={image:a,attrName:e,attrValue:i}),a.ready?(zm(t,e,i,a,o,n),r&&(Nm(t,s),jm(t,s))):a.error?r&&Vm(t,s,a.error):(r&&(Um(t,!0),Nm(t,s)),o.loadId=a.load(()=>{Um(t,!1),t.destroyed||(zm(t,e,i,a,o,n)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),jm(t,s)),o.loadId=void 0},e=>{Um(t,!1),Vm(t,s,e),o.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)),o},checkImage:function(t,e,i,n,r){const{scaleX:o,scaleY:s}=gg.getImageRenderScaleData(t,i,n,r),a=t.film?t.nowIndex:o+"-"+s,{image:l,data:h,originPaint:c}=t,{exporting:d,snapshot:u}=r;return!(!h||t.patternId===a&&!d||u||(e&&(h.repeat?e=!1:c.changeful||t.film||"miniapp"===Za.name||d||(e=Za.image.isLarge(l,o,s)||l.width*o>8096||l.height*s>8096)),e?(i.__.__isFastShadow&&(n.fillStyle=t.style||"#000",n.fill()),gg.drawImage(t,o,s,i,n,r),0):(!t.style||c.sync||d?gg.createPattern(t,i,n,r):gg.createPatternTask(t,i,n,r),1)))},drawImage:function(t,e,i,n,r,o){const{data:s,image:a,complex:l}=t;let{width:h,height:c}=a;if(l){const{blendMode:o,opacity:d}=t.originPaint,{transform:u}=s;r.save(),2===l&&r.clipUI(n),o&&(r.blendMode=o),d&&(r.opacity*=d),u&&r.transform(u),a.render(r,0,0,h,c,n,t,e,i),r.restore()}else s.scaleX&&(h*=s.scaleX,c*=s.scaleY),a.render(r,0,0,h,c,n,t,e,i)},getImageRenderScaleData:function(t,e,i,n){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:o}=t;if(i){const{pixelRatio:t}=i;r.scaleX*=t,r.scaleY*=t}return o&&o.scaleX&&(r.scaleX*=Math.abs(o.scaleX),r.scaleY*=Math.abs(o.scaleY)),r},recycleImage:function(t,e){const i=e["_"+t];if(us(i)){let n,r,o,s,a;for(let l=0,h=i.length;l<h;l++)n=i[l],r=n.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,Qd.recyclePaint(n),e.__willDestroy&&r.parent&&gg.recycleFilter(r,e.__leaf),r.loading&&(s||(s=e.__input&&e.__input[t]||[],us(s)||(s=[s])),r.unload(i[l].loadId,!s.some(t=>t.url===a))));return o}return null},createPatternTask:function(t,e,i,n){t.patternTask||(t.patternTask=Qd.patternTasker.add(()=>X_(this,void 0,void 0,function*(){gg.createPattern(t,e,i,n),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,i.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,i,n){let{scaleX:r,scaleY:o}=gg.getImageRenderScaleData(t,e,i,n),s=t.film?t.nowIndex:r+"-"+o;if(t.patternId!==s&&!e.destroyed&&(!Za.image.isLarge(t.image,r,o)||t.data.repeat)){const{image:i,data:n}=t,{opacity:a}=t.originPaint,{transform:l,gap:h}=n,c=gg.getPatternFixScale(t,r,o);let d,u,p,{width:f,height:g}=i;c&&(r*=c,o*=c),f*=r,g*=o,h&&(u=h.x*r/py(n.scaleX||1),p=h.y*o/py(n.scaleY||1)),(l||1!==r||1!==o)&&(r*=uy(f+(u||0)),o*=uy(g+(p||0)),d=hy(),l&&dy(d,l),cy(d,1/r,1/o));const v=i.getCanvas(f,g,a,void 0,u,p,e.leafer&&e.leafer.config.smooth,n.interlace);t.style=i.getPattern(v,n.repeat||Za.origin.noRepeat||"no-repeat",d,t),t.patternId=s}},getPatternFixScale:function(t,e,i){const{image:n}=t;let r,o=Za.image.maxPatternSize,s=n.width*n.height;return n.isSVG?e>1&&(r=Math.ceil(e)/e):o>s&&(o=s),(s*=e*i)>o&&(r=Math.sqrt(o/s)),r},createData:function(t,e,i,n){t.data=gg.getPatternData(i,n,e)},getPatternData:function(t,e,i){t.padding&&(e=Gm.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:n,height:r}=i,{mode:o,align:s,offset:a,scale:l,size:h,rotation:c,skew:d,clipSize:u,repeat:p,gap:f,interlace:g}=t,v=e.width===n&&e.height===r,_={mode:o},m="center"!==s&&(c||0)%180==90;let y,x;switch(za.set($m,0,0,m?r:n,m?n:r),o&&"cover"!==o&&"fit"!==o?((l||h)&&(Ms.getScaleData(l,h,i,Km),y=Km.scaleX,x=Km.scaleY),(s||f||p)&&(y&&za.scale($m,y,x,!0),s&&Ca.toPoint(s,$m,e,$m,!0,!0))):v&&!c||(y=x=za.getFitScale(e,$m,"fit"!==o),za.put(e,i,s,y,!1,$m),za.scale($m,y,x,!0)),a&&la.move($m,a),o){case"stretch":v?y&&(y=x=void 0):(y=e.width/n,x=e.height/r,gg.stretchMode(_,e,y,x));break;case"normal":case"clip":if($m.x||$m.y||y||u||c||d){let t,i;u&&(t=e.width/u.width,i=e.height/u.height),gg.clipMode(_,e,$m.x,$m.y,y,x,c,d,t,i),t&&(y=y?y*t:t,x=x?x*i:i)}break;case"repeat":(!v||y||c||d)&&gg.repeatMode(_,e,n,r,$m.x,$m.y,y,x,c,d,s,t.freeTransform),p||(_.repeat="repeat");const i=ps(p);(f||i)&&(_.gap=function(t,e,i,n,r){let o,s;return ps(t)?(o=t.x,s=t.y):o=s=t,{x:Zm(o,i,r.width,e&&e.x),y:Zm(s,n,r.height,e&&e.y)}}(f,i&&p,$m.width,$m.height,e));break;default:y&&gg.fillOrFitMode(_,e,$m.x,$m.y,y,x,c)}return _.transform||(e.x||e.y)&&Xm(_.transform=Ym(),e.x,e.y),y&&(_.scaleX=y,_.scaleY=x),p&&(_.repeat=hs(p)?"x"===p?"repeat-x":"repeat-y":"repeat"),g&&(_.interlace=ds(g)||"percent"===g.type?{type:"x",offset:g}:g),_},stretchMode:function(t,e,i,n){const r=Qm(),{x:o,y:s}=e;o||s?iy(r,o,s):i>0&&n>0&&(r.onlyScale=!0),oy(r,i,n),t.transform=r},fillOrFitMode:function(t,e,i,n,r,o,s){const a=Qm();iy(a,e.x+i,e.y+n),oy(a,r,o),s&&ey(a,{x:e.x+e.width/2,y:e.y+e.height/2},s),t.transform=a},clipMode:function(t,e,i,n,r,o,s,a,l,h){const c=Qm();ly(c,e,i,n,r,o,s,a),l&&(s||a?(ty(Jm),ny(Jm,e,l,h),ry(c,Jm)):ny(c,e,l,h)),t.transform=c},repeatMode:function(t,e,i,n,r,o,s,a,l,h,c,d){const u=Qm();if(d)ly(u,e,r,o,s,a,l,h);else{if(l)if("center"===c)ey(u,{x:i/2,y:n/2},l);else switch(sy(u,l),l){case 90:iy(u,n,0);break;case 180:iy(u,i,n);break;case 270:iy(u,0,i)}qm.x=e.x+r,qm.y=e.y+o,iy(u,qm.x,qm.y),s&&ny(u,qm,s,a)}t.transform=u}},{toPoint:gy}=ya,{hasTransparent:vy}=dg,_y={},my={};function yy(t,e,i,n){if(i){let r,o,s,a;for(let t=0,l=i.length;t<l;t++)r=i[t],hs(r)?(s=t/(l-1),o=dg.string(r,n)):(s=r.offset,o=dg.string(r.color,n)),e.addColorStop(s,o),!a&&vy(o)&&(a=!0);a&&(t.isTransparent=!0)}}var{getAngle:xy,getDistance:wy}=la,{get:by,rotateOfOuter:Sy,scaleOfOuter:ky}=Zs,{toPoint:Ey}=ya,Cy={},Oy={};function Ly(t,e,i,n,r){let o;const{width:s,height:a}=t;if(s!==a||n){const t=xy(e,i);o=by(),r?(ky(o,e,s/a*(n||1),1),Sy(o,e,t+90)):(ky(o,e,1,s/a*(n||1)),Sy(o,e,t))}return o}var{getDistance:Py}=la,{toPoint:Ty}=ya,By={},Ry={},Ay={linearGradient:function(t,e){let{from:i,to:n,type:r,opacity:o}=t;gy(i||"top",e,_y),gy(n||"bottom",e,my);const s=Za.canvas.createLinearGradient(_y.x,_y.y,my.x,my.y),a={type:r,style:s};return yy(a,s,t.stops,o),a},radialGradient:function(t,e){let{from:i,to:n,type:r,opacity:o,stretch:s}=t;Ey(i||"center",e,Cy),Ey(n||"bottom",e,Oy);const a=Za.canvas.createRadialGradient(Cy.x,Cy.y,0,Cy.x,Cy.y,wy(Cy,Oy)),l={type:r,style:a};yy(l,a,t.stops,o);const h=Ly(e,Cy,Oy,s,!0);return h&&(l.transform=h),l},conicGradient:function(t,e){let{from:i,to:n,type:r,opacity:o,rotation:s,stretch:a}=t;Ty(i||"center",e,By),Ty(n||"bottom",e,Ry);const l=Za.conicGradientSupport?Za.canvas.createConicGradient(s?s*Fs:0,By.x,By.y):Za.canvas.createRadialGradient(By.x,By.y,0,By.x,By.y,Py(By,Ry)),h={type:r,style:l};yy(h,l,t.stops,o);const c=Ly(e,By,Ry,a||1,Za.conicGradientRotate90);return c&&(h.transform=c),h},getTransform:Ly},{copy:Dy,move:My,toOffsetOutBounds:Iy}=za,{max:Fy,abs:Wy}=Math,zy={},Ny=new ga,jy={};function Vy(t,e){let i,n,r,o,s=0,a=0,l=0,h=0;return e.forEach(t=>{i=t.x||0,n=t.y||0,o=1.5*(t.blur||0),r=Wy(t.spread||0),s=Fy(s,r+o-n),a=Fy(a,r+o+i),l=Fy(l,r+o+n),h=Fy(h,r+o-i)}),s===a&&a===l&&l===h?s:[s,a,l,h]}function Hy(t,e,i){const{shapeBounds:n}=i;let r,o;Za.fullImageShadow?(Dy(zy,t.bounds),My(zy,e.x-n.x,e.y-n.y),r=t.bounds,o=zy):(r=n,o=e),t.copyWorld(i.canvas,r,o)}var Uy,{toOffsetOutBounds:Yy}=za,Xy={},Gy={shadow:function(t,e,i){let n,r;const{__nowWorld:o}=t,{shadow:s}=t.__,{worldCanvas:a,bounds:l,renderBounds:h,shapeBounds:c,scaleX:d,scaleY:u}=i,p=e.getSameCanvas(),f=s.length-1;Iy(l,jy,h),s.forEach((s,g)=>{let v=1;if(s.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(v=1/t)}p.setWorldShadow(jy.offsetX+(s.x||0)*d*v,jy.offsetY+(s.y||0)*u*v,(s.blur||0)*d*v,dg.string(s.color)),r=_g.getShadowTransform(t,p,i,s,jy,v),r&&p.setTransform(r),Hy(p,jy,i),r&&p.resetTransform(),n=h,s.box&&(p.restore(),p.save(),a&&(p.copyWorld(p,h,o,"copy"),n=o),a?p.copyWorld(a,o,o,"destination-out"):p.copyWorld(i.canvas,c,l,"destination-out")),Xu.copyCanvasByWorld(t,e,p,n,s.blendMode),f&&g<f&&p.clearWorld(n)}),p.recycle(n)},innerShadow:function(t,e,i){let n,r;const{__nowWorld:o}=t,{innerShadow:s}=t.__,{worldCanvas:a,bounds:l,renderBounds:h,shapeBounds:c,scaleX:d,scaleY:u}=i,p=e.getSameCanvas(),f=s.length-1;Yy(l,Xy,h),s.forEach((s,g)=>{let v=1;if(s.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(v=1/t)}p.save(),p.setWorldShadow(Xy.offsetX+(s.x||0)*d*v,Xy.offsetY+(s.y||0)*u*v,(s.blur||0)*d*v),r=_g.getShadowTransform(t,p,i,s,Xy,v,!0),r&&p.setTransform(r),Hy(p,Xy,i),p.restore(),a?(p.copyWorld(p,h,o,"copy"),p.copyWorld(a,o,o,"source-out"),n=o):(p.copyWorld(i.canvas,c,l,"source-out"),n=h),p.fillWorld(n,dg.string(s.color),"source-in"),Xu.copyCanvasByWorld(t,e,p,n,s.blendMode),f&&g<f&&p.clearWorld(n)}),p.recycle(n)},blur:function(t,e,i){const{blur:n}=t.__;i.setWorldBlur(n*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){},getShadowRenderSpread:Vy,getShadowTransform:function(t,e,i,n,r,o,s){if(n.spread){const i=2*n.spread*o*(s?-1:1),{width:a,height:l}=t.__layout.strokeBounds;return Ny.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+i/a,1+i/l),Ny}},isTransformShadow(t){},getInnerShadowSpread:Vy},{excludeRenderBounds:Ky}=ep;function $y(t,e,i,n,r,o,s,a){switch(e){case"grayscale":Uy||(Uy=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,i,n,r,o){const s=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(n,s),o&&n.recycle(s),qy(t,e,i,1,r,o)}(t,i,n,r,s,a);break;case"opacity-path":qy(t,i,n,o,s,a);break;case"path":a&&i.restore()}}function Zy(t){return t.getSameCanvas(!1,!0)}function qy(t,e,i,n,r,o){const s=t.__nowWorld;e.resetTransform(),e.opacity=n,e.copyWorld(i,s,void 0,r),o?i.recycle(s):i.clearWorld(s)}Ug.prototype.__renderMask=function(t,e){let i,n,r,o,s,a;const{children:l}=this;for(let h=0,c=l.length;h<c;h++){if(i=l[h],a=i.__.mask,a){s&&($y(this,s,t,r,n,o,void 0,!0),n=r=null),"clipping"!==a&&"clipping-path"!==a||Ky(i,e)||i.__render(t,e),o=i.__.opacity,Uy=!1,"path"===a||"clipping-path"===a?(o<1?(s="opacity-path",r||(r=Zy(t))):(s="path",t.save()),i.__clip(r||t,e)):(s="grayscale"===a?"grayscale":"alpha",n||(n=Zy(t)),r||(r=Zy(t)),i.__render(n,e));continue}const c=1===o&&i.__.__blendMode;c&&$y(this,s,t,r,n,o,void 0,!1),Ky(i,e)||i.__render(r||t,e),c&&$y(this,s,t,r,n,o,c,!1)}$y(this,s,t,r,n,o,void 0,!0)};var Jy=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Qy=Jy+"_#~&*+\\=|≮≯≈≠=…",tx=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 ex(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}var ix,nx=ex("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),rx=ex("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),ox=ex(Jy),sx=ex(Qy),ax=ex("- —/~|┆·");!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"}(ix||(ix={}));var{Letter:lx,Single:hx,Before:cx,After:dx,Symbol:ux,Break:px}=ix;function fx(t){return nx[t]?lx:ax[t]?px:rx[t]?cx:ox[t]?dx:sx[t]?ux:tx.test(t)?hx:lx}var gx={trimRight(t){const{words:e}=t;let i,n=0,r=e.length;for(let o=r-1;o>-1&&(i=e[o].data[0]," "===i.char);o--)n++,t.width-=i.width;n&&e.splice(r-n,n)}};function vx(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 _x,mx,yx,xx,wx,bx,Sx,kx,Ex,Cx,Ox,Lx,Px,Tx,Bx,Rx,Ax,{trimRight:Dx}=gx,{Letter:Mx,Single:Ix,Before:Fx,After:Wx,Symbol:zx,Break:Nx}=ix,jx=[];function Vx(t,e){Ex&&!kx&&(kx=Ex),_x.data.push({char:t,width:e}),yx+=e}function Hx(){xx+=yx,_x.width=yx,mx.words.push(_x),_x={data:[]},yx=0}function Ux(){Tx&&(Bx.paraNumber++,mx.paraStart=!0,Tx=!1),Ex&&(mx.startCharSize=kx,mx.endCharSize=Ex,kx=0),mx.width=xx,Rx.width?Dx(mx):Ax&&Yx(),jx.push(mx),mx={words:[]},xx=0}function Yx(){xx>(Bx.maxWidth||0)&&(Bx.maxWidth=xx)}var{top:Xx,right:Gx,bottom:Kx,left:$x}=Ks;function Zx(t,e,i){const{bounds:n,rows:r}=t;n[e]+=i;for(let o=0;o<r.length;o++)r[o][e]+=i}Object.assign(cg,{getDrawData:function(t,e){hs(t)||(t=String(t));let i=0,n=0,r=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:s}=e;s&&(r?(i=s[$x],r-=s[Gx]+s[$x],!r&&(r=.01)):e.autoSizeAlign||(i=s[$x]),o?(n=s[Xx],o-=s[Xx]+s[Kx],!o&&(o=.01)):e.autoSizeAlign||(n=s[Xx]));const a={bounds:{x:i,y:n,width:r,height:o},rows:[],paraNumber:0,font:Za.canvas.font=e.__font};return function(t,e,i){Bx=t,jx=t.rows,Ax=!(Rx=t.bounds).width&&!i.autoSizeAlign;const{__letterSpacing:n,paraIndent:r,textCase:o}=i,{canvas:s}=Za,{width:a}=Rx;if(i.__isCharMode){const t="none"!==i.textWrap,l="break"===i.textWrap;Tx=!0,Ox=null,kx=Sx=Ex=yx=xx=0,_x={data:[]},mx={words:[]};for(let i=0,h=(e=[...e]).length;i<h;i++)"\n"===(bx=e[i])?(yx&&Hx(),mx.paraEnd=!0,Ux(),Tx=!0):((Cx=fx(bx))===Mx&&"none"!==o&&(bx=vx(bx,o,!yx)),Sx=s.measureText(bx).width,n&&(n<0&&(Ex=Sx),Sx+=n),Lx=Cx===Ix&&(Ox===Ix||Ox===Mx)||Ox===Ix&&Cx!==Wx,Px=!(Cx!==Fx&&Cx!==Ix||Ox!==zx&&Ox!==Wx),wx=Tx&&r?a-r:a,t&&a&&xx+yx+Sx>wx&&(l?(yx&&Hx(),xx&&Ux()):(Px||(Px=Cx===Mx&&Ox==Wx),Lx||Px||Cx===Nx||Cx===Fx||Cx===Ix||yx+Sx>wx?(yx&&Hx(),xx&&Ux()):xx&&Ux()))," "===bx&&!0!==Tx&&xx+yx===0||(Cx===Nx?(" "===bx&&yx&&Hx(),Vx(bx,Sx),Hx()):Lx||Px?(yx&&Hx(),Vx(bx,Sx)):Vx(bx,Sx)),Ox=Cx);yx&&Hx(),xx&&Ux(),jx.length>0&&(jx[jx.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Bx.paraNumber++,xx=s.measureText(t).width,jx.push({x:r||0,text:t,width:xx,paraStart:!0}),Ax&&Yx()})}(a,t,e),s&&function(t,e,i,n,r){if(!n&&i.autoSizeAlign)switch(i.textAlign){case"left":Zx(e,"x",t[$x]);break;case"right":Zx(e,"x",-t[Gx])}if(!r&&i.autoSizeAlign)switch(i.verticalAlign){case"top":Zx(e,"y",t[Xx]);break;case"bottom":Zx(e,"y",-t[Kx])}}(s,a,e,r,o),function(t,e){const{rows:i,bounds:n}=t,r=i.length,{__lineHeight:o,__baseLine:s,__letterSpacing:a,__clipText:l,textAlign:h,verticalAlign:c,paraSpacing:d,autoSizeAlign:u}=e;let{x:p,y:f,width:g,height:v}=n,_=o*r+(d?d*(t.paraNumber-1):0),m=s;if(l&&_>v)_=Math.max(e.__autoHeight?_:v,o),r>1&&(t.overflow=r);else if(v||u)switch(c){case"middle":f+=(v-_)/2;break;case"bottom":f+=v-_}m+=f;let y,x,w,b=g||u?g:t.maxWidth;for(let S=0,k=r;S<k;S++){if(y=i[S],y.x=p,y.width<g||y.width>g&&!l)switch(h){case"center":y.x+=(b-y.width)/2;break;case"right":y.x+=b-y.width}y.paraStart&&d&&S>0&&(m+=d),y.y=m,m+=o,t.overflow>S&&m>_&&(y.isOverflow=!0,t.overflow=S+1),x=y.x,w=y.width,a<0&&(y.width<0?(w=-y.width+e.fontSize+a,x-=w,w+=e.fontSize):w-=a),x<n.x&&(n.x=x),w>n.width&&(n.width=w),l&&g&&g<w&&(y.isOverflow=!0,t.overflow||(t.overflow=i.length))}n.y=f,n.height=_}(a,e),e.__isCharMode&&function(t,e,i){const{rows:n}=t,{textAlign:r,paraIndent:o,__letterSpacing:s}=e,a=i&&r.includes("both"),l=a||i&&r.includes("justify"),h=l&&r.includes("letter");let c,d,u,p,f,g,v,_,m,y;n.forEach(t=>{t.words&&(f=o&&t.paraStart?o:0,_=t.words.length,l&&(y=!t.paraEnd||a,d=i-t.width-f,h?p=d/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=_>1?d/(_-1):0),g=s||t.isOverflow||h?0:u?1:2,t.isOverflow&&!s&&(t.textMode=!0),2===g?(t.x+=f,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=f,c=t.x,t.data=[],t.words.forEach((e,i)=>{1===g?(v={char:"",x:c},c=function(t,e,i){return t.forEach(t=>{i.char+=t.char,e+=t.width}),e}(e.data,c,v),(t.isOverflow||" "!==v.char)&&t.data.push(v)):c=function(t,e,i,n,r){return t.forEach(t=>{(n||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,c,t.data,t.isOverflow,y&&p),y&&(m=i===_-1,u?m||(c+=u,t.width+=u):p&&(t.width+=p*(e.data.length-(m?1:0))))})),t.words=null)})}(a,e,r),a.overflow&&function(t,e,i,n){const{rows:r,overflow:o}=t;let{textOverflow:s}=e;if(o&&r.splice(o),n&&s&&"show"!==s){let t,a;"hide"===s?s="":"ellipsis"===s&&(s="...");const l=s?Za.canvas.measureText(s).width:0,h=i+n-l;("none"===e.textWrap?r:[r[o-1]]).forEach(e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let n=i;n>-1&&(t=e.data[n],a=t.x+t.width,!(n===i&&a<h));n--){if(a<h&&" "!==t.char||!n){e.data.splice(n+1),e.width-=t.width;break}e.width-=t.width}e.width+=l,e.data.push({char:s,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(a,e,i,r),"none"!==e.textDecoration&&function(t,e){let i,n=0;const{fontSize:r,textDecoration:o}=e;switch(t.decorationHeight=r/11,ps(o)?(i=o.type,o.color&&(t.decorationColor=dg.string(o.color)),o.offset&&(n=Math.min(.3*r,Math.max(o.offset,.15*-r)))):i=o,i){case"under":t.decorationY=[.15*r+n];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+n,.35*-r]}}(a,e),a}}),Object.assign(dg,{string:function(t,e){if(!t)return"#000";const i=ds(e)&&e<1;if(hs(t)){if(!i||!dg.object)return t;t=dg.object(t)}let n=as(t.a)?1:t.a;i&&(n*=e);const r=t.r+","+t.g+","+t.b;return 1===n?"rgb("+r+")":"rgba("+r+","+n+")"}}),Object.assign(fg,Im),Object.assign(gg,fy),Object.assign(vg,Ay),Object.assign(_g,Gy),Object.assign(al,{interaction:(t,e,i,n)=>new mm(t,e,i,n),hitCanvas:(t,e)=>new K_(t,e),hitCanvasManager:()=>new B_}),Za.origin={createCanvas(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,i},canvasToDataURL:(t,e,i)=>{const n=Yd.mimeType(e),r=t.toDataURL(n,i);return"image/bmp"===n?r.replace("image/png;","image/bmp;"):r},canvasToBolb:(t,e,i)=>new Promise(n=>t.toBlob(n,Yd.mimeType(e),i)),canvasSaveAs:(t,e,i)=>{const n=t.toDataURL(Yd.mimeType(Yd.fileType(e)),i);return Za.origin.download(n,e)},download(t,e){return X_(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,n)=>{const r=new Za.origin.Image;e&&(r.setAttribute("crossOrigin",e),r.crossOrigin=e),r.onload=()=>{i(r)},r.onerror=t=>{n(t)},r.src=Za.image.getRealURL(t)}),loadContent(t){return X_(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},Za.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},Za.canvas=al.canvas(),Za.conicGradientSupport=!!Za.canvas.context.createConicGradient;var{M:qx,L:Jx,C:Qx,Q:tw,Z:ew,N:iw,D:nw,X:rw,G:ow,F:sw,O:aw,P:lw,U:hw}=Al,cw={scale(t,e,i){if(!t)return;let n,r=0,o=t.length;for(;r<o;)switch(n=t[r],n){case qx:case Jx:dw(t,e,i,r,1),r+=3;break;case Qx:dw(t,e,i,r,3),r+=7;break;case tw:dw(t,e,i,r,2),r+=5;break;case ew:r+=1;break;case iw:dw(t,e,i,r,2),r+=5;break;case nw:dw(t,e,i,r,2),r+=9;break;case rw:dw(t,e,i,r,2),r+=6;break;case ow:dw(t,e,i,r,2),r+=9;break;case sw:dw(t,e,i,r,2),r+=5;break;case aw:t[r]=ow,t.splice(r+4,0,t[r+3],0),dw(t,e,i,r,2),r+=9,o+=2;break;case lw:t[r]=sw,t.splice(r+4,0,t[r+3]),dw(t,e,i,r,2),r+=5,o+=1;break;case hw:dw(t,e,i,r,2),r+=6}},scalePoints(t,e,i,n,r){for(let o=r?n+1:0,s=r?o+2*r:t.length;o<s;o+=2)t[o]*=e,t[o+1]*=i}},{scalePoints:dw}=cw,uw=Zs.get(),{topLeft:pw,top:fw,topRight:gw,right:vw,bottom:_w,left:mw}=$s;function yw(t,e,i){t.pathInputed?ww(t,e,i):(1!==e&&(t.width*=e),1!==i&&(t.height*=i))}function xw(t,e,i,n){let r=e;if(!as(n)){const o=t.__layout;let{width:s,height:a}=o.boxBounds;switch(s*=i-e,a*=e-i,n){case fw:case _w:r=i,o.affectScaleOrRotation?t.moveInner(-s/2,0):t.x-=s/2;break;case mw:case vw:o.affectScaleOrRotation?t.moveInner(0,-a/2):t.y-=a/2;break;case pw:case gw:o.affectScaleOrRotation?t.moveInner(0,-a):t.y-=a}}t.fontSize*=r;const o=t.__,{padding:s,lineHeight:a,letterSpacing:l}=o;s&&(t.padding=us(s)?s.map(t=>t*r):s*r),o.__autoWidth||(t.width*=r),o.__autoHeight||(t.height*=r),ps(a)?"px"===a.type&&(o.lineHeight={type:"px",value:a.value*r}):a&&(o.lineHeight=a*r),ps(l)?"px"===l.type&&(o.letterSpacing={type:"px",value:l.value*r}):l&&(o.letterSpacing=l*r)}function ww(t,e,i){cw.scale(t.__.path,e,i),t.path=t.__.path}function bw(t,e,i){const{points:n}=t;ps(n[0])?n.forEach(t=>{t.x*=e,t.y*=i}):cw.scalePoints(n,e,i),t.points=n}function Sw(t,e,i){const{children:n}=t;for(let r=0;r<n.length;r++)uw.a=e,uw.d=i,n[r].transform(uw,!0)}var kw=Kf.prototype;function Ew(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function Cw(t){return t?us(t)?t:[t]:[]}kw.scaleResize=function(t,e=t,i){const n=this;i||n.editConfig&&"scale"===n.editConfig.editSize?(n.scaleX*=t,n.scaleY*=e):(t<0&&(n.scaleX*=-1,t=-t),e<0&&(n.scaleY*=-1,e=-e),this.__scaleResize(t,e))},kw.__scaleResize=function(t,e){yw(this,t,e)},kw.resizeWidth=function(t){const e=t/this.getBounds("box","local").width||1;this.scaleOf(this.__layout.boxBounds,e,this.__.lockRatio?e:1,!0)},kw.resizeHeight=function(t){const e=t/this.getBounds("box","local").height||1;this.scaleOf(this.__layout.boxBounds,this.__.lockRatio?e:1,e,!0)},Mv.prototype.__scaleResize=function(t,e){const{app:i,editConfig:n}=this,r=i&&i.editor,o=r&&r.dragPoint;if(this.__.resizeFontSize||n&&"font-size"===n.editSize||o&&"font-size"===r.mergedConfig.editSize)xw(this,t,e,o&&o.direction);else{const{__autoWidth:i,__autoHeight:n,textAlign:r,verticalAlign:o}=this.__,{boxBounds:s}=this.__layout;i&&"left"!==r&&1!==t&&(this.x+=s.x),n&&"top"!==o&&1!==e&&(this.y+=s.y),yw(this,t,e)}},Iv.prototype.__scaleResize=function(t,e){ww(this,t,e)},Ov.prototype.__scaleResize=function(t,e){this.pathInputed?ww(this,t,e):this.points?bw(this,t,e):this.width*=t},uv.prototype.__scaleResize=function(t,e){this.pathInputed?ww(this,t,e):this.points?bw(this,t,e):yw(this,t,e)},Ug.prototype.__scaleResize=function(t,e){Sw(this,t,e)},Qg.prototype.__scaleResize=function(t,e){const{resizeChildren:i,__autoSize:n}=this.__;n&&i||yw(this,t,e),i&&Sw(this,t,e)},sl.add("resize");var Ow=class extends wp{get list(){return Cw(this.value)}get oldList(){return Cw(this.oldValue)}constructor(t,e){super(t),e&&Object.assign(this,e)}};function Lw(t){return(e,i)=>{const n="_"+i;ru(e,i,{get(){return this[n]},set(e){const r=this[n];if(r!==e){const o=this;if(o.config){const t="target"===i;if(t){const{beforeSelect:t}=o.config;if(t){const i=t({target:e});if(ps(i))e=i;else if(!1===i)return}o.hasDimOthers&&o.cancelDimOthers(),us(e)&&e.length>1&&e[0].locked&&e.splice(0,1),o.single&&(delete o.element.syncEventer,delete o.element.__world.ignorePixelSnap)}const n=t?Ow.BEFORE_SELECT:Ow.BEFORE_HOVER;this.hasEvent(n)&&this.emitEvent(new Ow(n,{editor:o,value:e,oldValue:r}))}this[n]=e,t(this,r)}}})}}Ow.BEFORE_SELECT="editor.before_select",Ow.SELECT="editor.select",Ow.AFTER_SELECT="editor.after_select",Ow.BEFORE_HOVER="editor.before_hover",Ow.HOVER="editor.hover";var{abs:Pw}=Math,{copy:Tw}=Zs,{setListWithFn:Bw}=za,{worldBounds:Rw}=ep,Aw={a:1,b:0,c:0,d:1,e:0,f:0},Dw={x:0,y:0,width:0,height:0},Mw=class extends Vg{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?(Bw(Dw,e,Rw),t&&this.set(t),this.set(Dw),this.visible=!0):this.visible=0}__draw(t,e){const{list:i}=this;if(i.length){let n;const r=this.__,{stroke:o,strokeWidth:s,fill:a}=r,{bounds:l}=e;for(let h=0;h<i.length;h++){n=i[h];const{worldTransform:c,worldRenderBounds:d}=n;if(d.width&&d.height&&(!l||l.hit(d,e.matrix))){const i=Pw(c.scaleX),l=Pw(c.scaleY);if(Tw(Aw,c),Aw.half=s%2,t.setWorld(Aw,e.matrix),t.beginPath(),"path"===this.strokePathType||n.__.__useArrow?n.__drawPath(t):n.__.__pathForRender?n.__drawRenderPath(t):n.__drawPathByBox(t),r.strokeWidth=s/Math.max(i,l),r.shadow){const e=r.shadow[0],{scaleX:i,scaleY:n}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*n,e.blur*i,dg.string(e.color))}o&&(hs(o)?fg.stroke(o,this,t,e):fg.strokes(o,this,t,e)),a&&(hs(a)?fg.fill(a,this,t,e):fg.fills(a,this,t,e)),r.shadow&&t.restore()}}r.strokeWidth=s}}destroy(){this.target=null,super.destroy()}};Ew([Lw(function(t){const e=t.target;t.list=e?us(e)?e:[e]:[]})],Mw.prototype,"target",void 0),Ew([yu("render-path")],Mw.prototype,"strokePathType",void 0);var Iw=class extends Ug{constructor(t){super(t),this.strokeArea=new Gg({strokeAlign:"center"}),this.fillArea=new Gg,this.visible=0,this.hittable=!1,this.addMany(this.fillArea,this.strokeArea)}setStyle(t,e){const{visible:i,stroke:n,strokeWidth:r}=t;this.visible=i,this.strokeArea.reset(Object.assign({stroke:n,strokeWidth:r},e||{})),this.fillArea.reset({visible:!e,fill:n,opacity:.2})}setBounds(t){this.strokeArea.set(t),this.fillArea.set(t)}},Fw={findOne:t=>t.list.find(t=>t.editable),findByBounds(t,e){const i=[];return Ww([t],i,e),i}};function Ww(t,e,i){let n,r;for(let o=0,s=t.length;o<s;o++)if(n=t[o],r=n.__,r.hittable&&r.visible&&!r.locked&&i.hit(n.__world)){if(r.editable){if(n.isBranch&&!r.hitChildren){r.hitSelf&&e.push(n);continue}if(n.isFrame){if(i.includes(n.__layout.boxBounds,n.__world)){e.push(n);continue}}else i.hit(n.__layout.boxBounds,n.__world)&&r.hitSelf&&e.push(n)}n.isBranch&&Ww(n.children,e,i)}}var{findOne:zw,findByBounds:Nw}=Fw,jw=class extends Ug{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 Mw,this.targetStroker=new Mw,this.bounds=new Ha,this.selectArea=new Iw,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,n=Object.assign({},i);e&&e.editConfig&&Object.assign(n,e.editConfig);const{stroke:r,strokeWidth:o,hover:s,hoverStyle:a}=n;this.hoverStroker.setTarget(s?e:null,Object.assign({stroke:r,strokeWidth:o},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:n}=this.editor.mergedConfig;this.targetStroker.update(Object.assign({stroke:t,strokeWidth:e&&Math.max(1,e/2),strokePathType:i},n||{}))}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:n}=e.mergeConfig;"tap"===i?this.checkAndSelect(t):this.waitSelect&&this.waitSelect(),this.needRemoveItem?e.removeItem(this.needRemoveItem):this.isMoveMode&&(n||(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:n}=e.mergeConfig,{x:r,y:o}=t.getInnerPoint(this);this.bounds.set(r,o),this.selectArea.setStyle({visible:!0,stroke:i,x:r,y:o},n),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),n=this.bounds.clone().unsign(),r=new og(Nw(e.app,n));if(this.bounds.width=i.x,this.bounds.height=i.y,this.selectArea.setBounds(n.get()),r.length){const t=[];this.originList.forEach(e=>{r.has(e)||t.push(e)}),r.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)&&!zw(t.path))}allowSelect(t){return this.running&&!this.isMoveMode&&!t.middle}findDeepOne(t){const e={exclude:new og(this.editor.editBox.rect)};return zw(t.target.leafer.interaction.findPath(t,e))}findUI(t){return this.isMultipleSelect(t)?this.findDeepOne(t):zw(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_([[Ow.HOVER,this.onHover,this],[Ow.SELECT,this.onSelect,this]]),e.on_([[n_.MOVE,this.onPointerMove,this],[n_.BEFORE_DOWN,this.onBeforeDown,this],[n_.TAP,this.onTap,this],[o_.START,this.onDragStart,this,!0],[o_.DRAG,this.onDrag,this],[o_.END,this.onDragEnd,this],[a_.MOVE,this.onAutoMove,this],[[d_.ZOOM,a_.MOVE],()=>{this.editor.hoverTarget=null}]])]})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=this.originList=this.needRemoveItem=null,this.__removeListenEvents(),super.destroy()}},{topLeft:Vw,top:Hw,topRight:Uw,right:Yw,bottomRight:Xw,bottom:Gw,bottomLeft:Kw,left:$w}=$s,{toPoint:Zw}=ya,{within:qw,sign:Jw}=Ms,{abs:Qw}=Math,tb={getScaleData(t,e,i,n,r,o,s,a){let l,h,c={},d=1,u=1;const{boxBounds:p,widthRange:f,heightRange:g,dragBounds:v,worldBoxBounds:_}=t,{width:m,height:y}=e,x=t.scaleX/e.scaleX,w=t.scaleY/e.scaleY,b=Jw(x),S=Jw(w),k=a?x:b*p.width/m,E=a?w:S*p.height/y;if(ds(n))d=u=Math.sqrt(n);else{o&&(n.x*=2,n.y*=2),n.x*=a?x:b,n.y*=a?w:S;const t=(-n.y+y)/y,e=(n.x+m)/m,s=(n.y+y)/y,c=(-n.x+m)/m;switch(i){case Hw:u=t,l="bottom";break;case Yw:d=e,l="left";break;case Gw:u=s,l="top";break;case $w:d=c,l="right";break;case Vw:u=t,d=c,l="bottom-right";break;case Uw:u=t,d=e,l="bottom-left";break;case Xw:u=s,d=e,l="top-left";break;case Kw:u=s,d=c,l="top-right"}if(r)if("corner"===r&&i%2)r=!1;else switch(i){case Hw:case Gw:d=u;break;case $w:case Yw:u=d;break;default:h=Math.sqrt(Qw(d*u)),d=Jw(d)*h,u=Jw(u)*h}}const C=1!==d,O=1!==u;if(C&&(d/=k),O&&(u/=E),!s){const{worldTransform:e}=t;d<0&&(d=1/p.width/e.scaleX),u<0&&(u=1/p.height/e.scaleY)}if(Zw(o||l,p,c,!0),v){const e={x:d,y:u};e_.limitScaleOf(t,c,e,r),d=e.x,u=e.y}if(C&&f){const e=p.width*t.scaleX;d=qw(e*d,f)/e}if(O&&g){const e=p.height*t.scaleY;u=qw(e*u,g)/e}return C&&Qw(d*_.width)<1&&(d=Jw(d)/_.width),O&&Qw(u*_.height)<1&&(u=Jw(u)/_.height),r&&d!==u&&(h=Math.min(Qw(d),Qw(u)),d=Jw(d)*h,u=Jw(u)*h),isFinite(d)||(d=1),isFinite(u)||(u=1),{origin:c,scaleX:d,scaleY:u,direction:i,lockRatio:r,around:o}},getRotateData(t,e,i,n,r){let o,s={};switch(e){case Vw:o="bottom-right";break;case Uw:o="bottom-left";break;case Xw:o="top-left";break;case Kw:o="top-right";break;default:o="center"}return Zw(r||o,t.boxBounds,s,!0),{origin:s,rotation:la.getRotation(n,t.getWorldPointByBox(s),i)}},getSkewData(t,e,i,n){let r,o,s={},a=0,l=0;switch(e){case Hw:case Vw:o={x:.5,y:0},r="bottom",a=1;break;case Gw:case Xw:o={x:.5,y:1},r="top",a=1;break;case $w:case Kw:o={x:0,y:.5},r="right",l=1;break;case Yw:case Uw:o={x:1,y:.5},r="left",l=1}const{width:h,height:c}=t;o.x=o.x*h,o.y=o.y*c,Zw(n||r,t,s,!0);const d=la.getRotation(o,s,{x:o.x+(a?i.x:0),y:o.y+(l?i.y:0)});return a?a=-d:l=d,{origin:s,skewX:a,skewY:l}},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 $w:t=Yw;break;case Vw:t=Uw;break;case Kw:t=Xw;break;case Yw:t=$w;break;case Uw:t=Vw;break;case Xw:t=Kw}if(i)switch(t){case Hw:t=Gw;break;case Vw:t=Kw;break;case Uw:t=Xw;break;case Gw:t=Hw;break;case Kw:t=Vw;break;case Xw:t=Uw}return t}},eb={};function ib(t,e){const{enterPoint:i,dragging:n,skewing:r,resizing:o,flippedX:s,flippedY:a}=t;if(!i||!t.editor.editing||!t.canUse)return;if("rect"===i.name)return nb(t);if("circle"===i.name)return;let{rotation:l}=t;const{pointType:h}=i,{moveCursor:c,resizeCursor:d,rotateCursor:u,skewCursor:p,moveable:f,resizeable:g,rotateable:v,skewable:_}=t.mergeConfig;if("move"===h)return i.cursor=c,void(f||(i.visible=!1));if("button"===h)return void(i.cursor||(i.cursor="pointer"));let m=h.includes("resize");m&&v&&(t.isHoldRotateKey(e)||!g)&&(m=!1);const y=_&&!m&&("resize-line"===i.name||"skew"===h),x=n?r?p:o?d:u:y?p:m?d:u;l+=45*(tb.getFlipDirection(i.direction,s,a)+1),l=2*Math.round(Ms.formatRotation(l,!0)/2);const{url:w,x:b,y:S}=x,k=w+l;eb[k]?i.cursor=eb[k]:eb[k]=i.cursor={url:rb(w,l),x:b,y:S}}function nb(t){const{moveCursor:e,moveable:i}=t.mergeConfig;t.canUse&&(t.rect.cursor=i?e:void 0)}function rb(t,e){return'"data:image/svg+xml,'+encodeURIComponent(t.replace("{{rotation}}",e.toString()))+'"'}var ob=class extends Qg{constructor(t){super(t),this.useFastShadow=!0}},sb=["top","right","bottom","left"],ab=void 0,lb=class extends Ug{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 hs(t)||hs(e)||hs(i)}get canDragLimitAnimate(){return this.moving&&this.mergeConfig.dragLimitAnimate&&this.target.dragBounds}constructor(t){super(),this.view=new Ug,this.rect=new ob({name:"rect",hitFill:"all",hitStroke:"none",strokeAlign:"center",hitRadius:5}),this.circle=new ob({name:"circle",strokeAlign:"center",around:"center",cursor:"crosshair",hitRadius:5}),this.buttons=new Ug({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:n,resizePoints:r,rotatePoints:o,resizeLines:s,rect:a,circle:l,buttons:h}=this,c=["bottom-right","bottom","bottom-left","left","top-left","top","top-right","right"];for(let d=0;d<8;d++)t=new ob({name:"rotate-point",around:c[d],width:15,height:15,hitFill:"all"}),o.push(t),this.listenPointEvents(t,"rotate",d),d%2&&(e=new ob({name:"resize-line",around:"center",width:10,height:10,hitFill:"all"}),s.push(e),this.listenPointEvents(e,"resize",d)),i=new ob({name:"resize-point",hitRadius:5}),r.push(i),this.listenPointEvents(i,"resize",d);this.listenPointEvents(l,"rotate",2),this.listenPointEvents(a,"move",8),n.addMany(...o,a,l,h,...s,...r),this.add(n)}load(){const{target:t,mergeConfig:e,single:i,rect:n,circle:r,resizePoints:o,resizeLines:s}=this,{stroke:a,strokeWidth:l,ignorePixelSnap:h}=e,c=this.getPointsStyle(),d=this.getMiddlePointsStyle(),u=this.getResizeLinesStyle();let p;this.visible=!t.locked;for(let g=0;g<8;g++)p=o[g],p.set(this.getPointStyle(g%2?d[(g-1)/2%d.length]:c[g/2%c.length])),p.rotation=(g-(g%2?1:0))/2*90,g%2&&s[(g-1)/2].set(Object.assign({pointType:"resize",rotation:(g-1)/2*90},u[(g-1)/2%u.length]||{}));r.set(this.getPointStyle(e.circle||e.rotatePoint||c[0])),n.set(Object.assign({stroke:a,strokeWidth:l,opacity:1,editConfig:ab},e.rect||{}));const f=ls(e.rectThrough)?i:e.rectThrough;n.hittable=!f,f&&(t.syncEventer=n,this.app.interaction.bottomList=[{target:n,proxy:t}]),i&&_s.stintSet(t.__world,"ignorePixelSnap",h),nb(this)}update(){const{editor:t}=this,{x:e,y:i,scaleX:n,scaleY:r,rotation:o,skewX:s,skewY:a,width:l,height:h}=this.target.getLayoutBounds("box",t,!0);this.visible=!this.target.locked,this.set({x:e,y:i,scaleX:n,scaleY:r,rotation:o,skewX:s,skewY:a}),this.updateBounds({x:0,y:0,width:l,height:h})}unload(){this.visible=!1,this.app&&(this.rect.syncEventer=this.app.interaction.bottomList=null)}updateBounds(t){const{editor:e,mergeConfig:i,single:n,rect:r,circle:o,buttons:s,resizePoints:a,rotatePoints:l,resizeLines:h}=this,{editMask:c}=e,{middlePoint:d,resizeable:u,rotateable:p,hideOnSmall:f,editBox:g,mask:v,dimOthers:_,bright:m,spread:y,hideRotatePoints:x,hideResizeLines:w}=i;if(c.visible=!!v||0,as(_)&&as(m)?e.hasDimOthers&&e.cancelDimOthers():(e.setDimOthers(_),e.setBright(!!_||m),e.hasDimOthers=!0),y&&za.spread(t,y),this.view.worldOpacity){const{width:e,height:c}=t,v=ds(f)?f:10,_=g&&!(f&&e<v&&c<v);let m,y,b,S={};for(let i=0;i<8;i++)ya.toPoint(ya.directionData[i],t,S),y=a[i],m=l[i],y.set(S),m.set(S),y.visible=_&&!(!u&&!p),m.visible=_&&p&&u&&!x,i%2&&(b=h[(i-1)/2],b.set(S),b.visible=y.visible&&!w,y.visible&&(y.visible=!!d),m.visible&&(m.visible=!!d),(i+1)/2%2?(b.width=e+b.height,f&&2*y.width>e&&(y.visible=!1)):(b.width=c+b.height,f&&2*y.width>c&&(y.visible=!1)));o.visible=_&&p&&!(!i.circle&&!i.rotatePoint),o.visible&&this.layoutCircle(),r.path&&(r.path=null),r.set(Object.assign(Object.assign({},t),{visible:!n||g})),s.visible=_&&s.children.length>0||0,s.visible&&this.layoutButtons()}else r.set(t)}layoutCircle(){const{circleDirection:t,circleMargin:e,buttonsMargin:i,buttonsDirection:n,middlePoint:r}=this.mergedConfig,o=sb.indexOf(t||(this.buttons.children.length&&"bottom"===n?"top":"bottom"));this.setButtonPosition(this.circle,o,e||i,!!r)}layoutButtons(){const{buttons:t}=this,{buttonsDirection:e,buttonsFixed:i,buttonsMargin:n,middlePoint:r}=this.mergedConfig,{flippedX:o,flippedY:s}=this;let a=sb.indexOf(e);(a%2&&o||(a+1)%2&&s)&&i&&(a=(a+2)%4);const l=i?tb.getRotateDirection(a,this.flippedOne?this.rotation:-this.rotation,4):a;this.setButtonPosition(t,l,n,!!r),i&&(t.rotation=90*(l-a)),t.scaleX=o?-1:1,t.scaleY=s?-1:1}setButtonPosition(t,e,i,n){const r=this.resizePoints[2*e+1],o=e%2,s=e&&3!==e?1:-1,a=(i+(e%2?(n?r.width:0)+t.boxBounds.width:(n?r.height:0)+t.boxBounds.height)/2)*s;o?(t.x=r.x+a,t.y=r.y):(t.x=r.x,t.y=r.y+a)}getPointStyle(t){const{stroke:e,strokeWidth:i,pointFill:n,pointSize:r,pointRadius:o}=this.mergedConfig,s={fill:n,stroke:e,strokeWidth:i,around:"center",strokeAlign:"center",opacity:1,width:r,height:r,cornerRadius:o,offsetX:0,offsetY:0,editConfig:ab};return t?Object.assign(s,t):s}getPointsStyle(){const{point:t}=this.mergedConfig;return us(t)?t:[t]}getMiddlePointsStyle(){const{middlePoint:t}=this.mergedConfig;return us(t)?t:t?[t]:this.getPointsStyle()}getResizeLinesStyle(){const{resizeLine:t}=this.mergedConfig;return us(t)?t:[t]}onDragStart(t){this.dragging=!0;const e=this.dragPoint=t.current,{pointType:i}=e,{moveable:n,resizeable:r,rotateable:o,skewable:s,onCopy:a}=this.mergeConfig;"move"===i?(t.altKey&&a&&a()&&this.editor.single&&this.app.interaction.replaceDownTarget(this.target),n&&(this.moving=!0)):(i.includes("rotate")||this.isHoldRotateKey(t)||!r?(o&&(this.rotating=!0),"resize-rotate"===i?r&&(this.resizing=!0):"resize-line"===e.name&&(s&&(this.skewing=!0),this.rotating=!1)):"resize"===i&&r&&(this.resizing=!0),"skew"===i&&s&&(this.skewing=!0)),this.onTransformStart(t)}onDrag(t){const{transformTool:e,moving:i,resizing:n,rotating:r,skewing:o}=this;if(i)e.onMove(t);else if(n||r||o){const i=t.current;i.pointType&&(this.enterPoint=i),r&&e.onRotate(t),n&&e.onScale(t),o&&e.onSkew(t)}ib(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&&(Ap.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 o_||t instanceof a_)&&this.transformTool.onMove(t),this.resizing&&(Ap.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(),hs(this.mergedConfig.moveable)))switch(this.gesturing=this.moving=!0,t.type){case a_.START:this.onTransformStart(t);break;case a_.END:this.onTransformEnd(t);break;default:this.transformTool.onMove(t)}}onScale(t){if(this.canGesture&&(t.stop(),hs(this.mergedConfig.resizeable)))switch(this.gesturing=this.resizing=!0,t.type){case d_.START:this.onTransformStart(t);break;case d_.END:this.onTransformEnd(t);break;default:this.transformTool.onScale(t)}}onRotate(t){if(this.canGesture&&(t.stop(),hs(this.mergedConfig.rotateable)))switch(this.gesturing=this.rotating=!0,t.type){case d_.START:this.onTransformStart(t);break;case d_.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){ib(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:n,arrowStep:r,arrowFastStep:o}=this.mergeConfig;if(n){const n=t.shiftKey?o:r;this.transformTool.move(e*n,i*n)}}}}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,n=t.find(t=>t.editable&&t instanceof Mv)||t.find(t=>t instanceof Mv);if(n)return e.openInnerEditor(n)}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_([[o_.START,this.onDragStart,this],[o_.DRAG,this.onDrag,this],[o_.END,this.onDragEnd,this],[n_.ENTER,e=>{this.enterPoint=t,ib(this,e)}],[n_.LEAVE,()=>{this.enterPoint=null}]]))}__listenEvents(){const{rect:t,editor:e,__eventIds:i}=this;i.push(t.on_([[n_.DOUBLE_TAP,this.onDoubleTap,this],[n_.LONG_PRESS,this.onLongPress,this]])),this.waitLeafer(()=>{i.push(e.app.on_([[[u_.HOLD,u_.UP],this.onKey,this],[u_.DOWN,this.onArrow,this],[[a_.START,a_.BEFORE_MOVE,a_.END],this.onMove,this,!0],[[d_.START,d_.BEFORE_ZOOM,d_.END],this.onScale,this,!0],[[h_.START,h_.BEFORE_ROTATE,h_.END],this.onRotate,this,!0]]))})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=null,this.__removeListenEvents(),super.destroy()}},hb={x:0,y:0,width:1e5,height:1e5},cb=class extends Vg{constructor(t){super(),this.editor=t,this.hittable=!1,this.visible=0}__updateWorldBounds(){Object.assign(this.__local,hb),Object.assign(this.__world,hb)}__draw(t,e){const{editor:i}=this,{mask:n}=i.mergedConfig;if(n&&i.editing){if(t.fillWorld(t.bounds,!0===n?"rgba(0,0,0,0.8)":n),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:n}=i;n&&n.textBox&&n.__renderShape(t,e)}),t.restoreBlendMode()}}destroy(){this.editor=null,super.destroy()}},db='\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"/>',ub={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${db}\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${db}\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${db}\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},pb=new Ha;function fb(t){const{simulateTarget:e,list:i}=t,{zoomLayer:n}=i[0].leafer;e.safeChange(()=>{pb.setListWithFn(i,t=>t.getBounds("box","page")),0===pb.width&&(pb.width=.1),0===pb.height&&(pb.height=.1),e.reset(pb.get())}),n.add(e)}var gb=(t,e)=>t.parent.children.indexOf(t)-e.parent.children.indexOf(e),vb=(t,e)=>e.parent.children.indexOf(e)-t.parent.children.indexOf(t),_b={group(t,e,i){t.sort(vb);const{app:n,parent:r}=t[0];let o;o=i&&i.add?i:new Ug(i),r.addAt(o,r.children.indexOf(t[0])),t.sort(gb);const s=new ga(e.worldTransform);return s.divideParent(r.scrollWorldTransform),o.setTransform(s),o.editable=!0,o.hitChildren=!1,n.lockLayout(),t.forEach(t=>t.dropTo(o)),n.unlockLayout(),o},ungroup(t){const{app:e}=t[0],i=[];return e.lockLayout(),t.forEach(t=>{if(t.isBranch){const{parent:e,children:n}=t;for(;n.length;)i.push(n[0]),n[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(gb),t.forEach(t=>{t.parent&&t.parent.add(t)})},toBottom(t){t.sort(vb),t.forEach(t=>{t.parent&&t.parent.addAt(t,0)})}},mb=Qa.get("EditToolCreator");function yb(){return t=>{wb.register(t)}}var xb=yb,wb={list:{},register(t){const{tag:e}=t.prototype;bb[e]&&mb.repeat(e),bb[e]=t},get:(t,e)=>new bb[t](e)},{list:bb}=wb,Sb=class extends Ow{constructor(t,e){super(t,e)}};Sb.BEFORE_OPEN="innerEditor.before_open",Sb.OPEN="innerEditor.open",Sb.BEFORE_CLOSE="innerEditor.before_close",Sb.CLOSE="innerEditor.close";var kb=class extends Ow{constructor(t,e){super(t,e)}};kb.BEFORE_GROUP="editor.before_group",kb.GROUP="editor.group",kb.BEFORE_UNGROUP="editor.before_ungroup",kb.UNGROUP="editor.ungroup",kb.BEFORE_OPEN="editor.before_open_group",kb.OPEN="editor.open_group",kb.BEFORE_CLOSE="editor.before_close_group",kb.CLOSE="editor.close_group";var{updateMatrix:Eb}=Xu,Cb={x:1,y:1,scaleX:1,scaleY:1,rotation:1,skewX:1,skewY:1},Ob="top-left",Lb=class extends Gg{get __tag(){return"SimulateElement"}constructor(t){super(),this.checkChange=!0,this.canChange=!0,this.visible=this.hittable=!1,this.skipJSON=!0,this.on(kp.CHANGE,e=>{if(this.checkChange&&Cb[e.attrName]){const{attrName:i,newValue:n,oldValue:r}=e,o="s"===i[0]?(n||1)/(r||1):(n||0)-(r||0);this.canChange=!1;const s=this.__;s[i]=r,Eb(this.parent),Eb(this);const a=new ga(this.__world);switch(s[i]=n,this.__layout.rotationChange(),Eb(this),this.changedTransform=new ga(this.__world).divide(a),i){case"x":t.move(o,0);break;case"y":t.move(0,o);break;case"rotation":t.rotateOf(Ob,o);break;case"scaleX":t.scaleOf(Ob,o,1);break;case"scaleY":t.scaleOf(Ob,1,o);break;case"skewX":t.skewOf(Ob,o,0);break;case"skewY":t.skewOf(Ob,0,o)}this.canChange=!0}})}safeChange(t){this.canChange&&(this.checkChange=!1,t(),this.checkChange=!0)}},Pb=class extends Ow{constructor(t,e){super(t,e)}};Pb.BEFORE_MOVE="editor.before_move",Pb.MOVE="editor.move";var Tb=class extends Ow{constructor(t,e){super(t,e)}};Tb.BEFORE_SCALE="editor.before_scale",Tb.SCALE="editor.scale";var Bb=class extends Ow{constructor(t,e){super(t,e)}};Bb.BEFORE_ROTATE="editor.before_rotate",Bb.ROTATE="editor.rotate";var Rb=class extends Ow{constructor(t,e){super(t,e)}};Rb.BEFORE_SKEW="editor.before_skew",Rb.SKEW="editor.skew";var Ab=class extends Ug{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 og,this.openedGroupList=new og,this.simulateTarget=new Lb(this),this.editBox=new lb(this),this.editToolList={},this.selector=new jw(this),this.editMask=new cb(this),this.targetEventIds=[];let i=_s.clone(ub);t&&(i=_s.default(t,i)),this.mergedConfig=this.config=i,this.addMany(this.editMask,this.selector,this.editBox),sl.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?us(t)?t:[t]:[e]}i[0]&&i[0][e]!==(t||!1)&&i.forEach(i=>_s.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&&fb(this),this.update()}getEditTool(t){return this.editToolList[t]=this.editToolList[t]||wb.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 n=i({target:t,name:e});if(hs(n))e=n;else if(!1===n)return}if(wb.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,n){}flip(t){}rotateOf(t,e){}skewOf(t,e,i=0,n){}checkTransform(t){}getWorldOrigin(t){}getChangedTransform(t){}group(t){return this.multiple&&(this.emitGroupEvent(kb.BEFORE_GROUP),this.target=_b.group(this.list,this.element,t),this.emitGroupEvent(kb.GROUP,this.target)),this.target}ungroup(){const{list:t}=this;return t.length&&(t.forEach(t=>t.isBranch&&this.emitGroupEvent(kb.BEFORE_UNGROUP,t)),this.target=_b.ungroup(t),t.forEach(t=>t.isBranch&&this.emitGroupEvent(kb.UNGROUP,t))),this.list}openGroup(t){this.emitGroupEvent(kb.BEFORE_OPEN,t),this.openedGroupList.add(t),t.hitChildren=!0,this.emitGroupEvent(kb.OPEN,t)}closeGroup(t){this.emitGroupEvent(kb.BEFORE_CLOSE,t),this.openedGroupList.remove(t),t.hitChildren=!1,this.emitGroupEvent(kb.CLOSE,t)}checkOpenedGroups(){const t=this.openedGroupList;if(t.length){let{list:e}=t;this.editing&&(e=[],t.forEach(t=>this.list.every(e=>!Xu.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 kb(t,{editTarget:e});this.emitEvent(i),e&&e.emitEvent(i)}getInnerEditor(t){return this.editToolList[t]=this.editToolList[t]||wb.get(t,this)}openInnerEditor(t,e,i){let n;if(hs(e)?n=e:i||(i=e),t&&i&&(this.target=t),this.single){t||(t=this.element),n||(n=t.editInner);const{beforeEditInner:e}=this.mergeConfig;if(e){const i=e({target:t,name:n});if(hs(i))n=i;else if(!1===i)return}wb.list[n]&&(this.editTool.unload(),this.innerEditing=!0,this.innerEditor=this.getInnerEditor(n),this.innerEditor.editTarget=t,this.emitInnerEvent(Sb.BEFORE_OPEN),this.innerEditor.load(),this.emitInnerEvent(Sb.OPEN))}}closeInnerEditor(t){this.innerEditing&&(this.innerEditing=!1,this.emitInnerEvent(Sb.BEFORE_CLOSE),this.innerEditor.unload(),this.emitInnerEvent(Sb.CLOSE),t||this.updateEditTool(),this.innerEditor=null)}emitInnerEvent(t){const{innerEditor:e}=this,{editTarget:i}=e,n=new Sb(t,{editTarget:i,innerEditor:e});this.emitEvent(n),i.emitEvent(n)}lock(){this.list.forEach(t=>t.locked=!0),this.update()}unlock(){this.list.forEach(t=>t.locked=!1),this.update()}toTop(){this.list.length&&(_b.toTop(this.list),this.leafList.update())}toBottom(){this.list.length&&(_b.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:n}=this;this.targetEventIds=[e.on_(Ip.START,this.onRenderStart,this),i&&i.on_(kp.SCROLL,this.onChildScroll,this),t.on_(Ip.CHILD_START,this.onAppRenderStart,this),t.on_(Fp.UPDATE_MODE,t=>{t.mode&&"normal"!==t.mode&&this.cancel()})],n.visible&&n.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())}};Ew([(t,e)=>{ru(t,e,{get(){const{config:t,element:e,dragPoint:i,editBox:n,editTool:r,innerEditor:o,app:s}=this,a=Object.assign({},t);if(o?o.editConfig&&Object.assign(a,o.editConfig):r&&r.editConfig&&Object.assign(a,r.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 n.config&&Object.assign(a,n.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"),ls(a.lockRatio)&&(a.lockRatio=!0))),as(a.dragLimitAnimate)&&(a.dragLimitAnimate=s&&s.config.pointer.dragLimitAnimate),this.mergedConfig=a}})}],Ab.prototype,"mergeConfig",void 0),Ew([Lw(function(t,e){const{target:i}=t;i?(t.leafList=i instanceof og?i:new og(i),t.multiple&&fb(t)):(t.simulateTarget.remove(),t.leafList.reset()),t.closeInnerEditor(!0),t.unloadEditTool();const n={editor:t,value:i,oldValue:e};t.emitEvent(new Ow(Ow.SELECT,n)),t.checkOpenedGroups(),t.editing?t.waitLeafer(()=>{t.updateEditTool(),t.listenTargetEvents()}):(t.updateEditTool(),t.removeTargetEvents()),t.emitEvent(new Ow(Ow.AFTER_SELECT,n))})],Ab.prototype,"target",void 0),Ew([Lw(function(t,e){t.emitEvent(new Ow(Ow.HOVER,{editor:t,value:t.hoverTarget,oldValue:e}))})],Ab.prototype,"hoverTarget",void 0),Ab=Ew([Ru(class{onMove(t){const{target:e,mergeConfig:i,dragStartData:n}=this.editBox;let r,{dragLimitAnimate:o}=i;const s=t.type===a_.END||t.type===o_.END,a=hs(e.draggable),l=!o||s||a,h={x:t.totalX,y:t.totalY};t instanceof a_&&la.move(h,e.getWorldPointByLocal(n.totalOffset,null,!0)),t.shiftKey&&(Math.abs(h.x)>Math.abs(h.y)?h.y=0:h.x=0),r=o_.getValidMove(e,n.point,h,l),(r.x||r.y)&&(o&&!a&&s?Xu.animateMove(this,r,ds(o)?o:.3):this.move(r))}onScale(t){const{target:e,mergeConfig:i,single:n,dragStartData:r}=this.editBox;let o,{around:s,lockRatio:a,flipable:l,editSize:h}=i;t instanceof d_?(s||(s=e.getBoxPoint(t)),o=t.totalScale):o=t.getInnerTotal(e);const{direction:c}=t.current;(t.shiftKey||e.lockRatio)&&(a=!0);const d=tb.getScaleData(e,r.bounds,c,o,a,tb.getAround(s,t.altKey),l,!n||"scale"===h),u=e.x,p=e.y;t instanceof o_&&this.editTool&&this.editTool.onScaleWithDrag?(d.drag=t,this.scaleWithDrag(d)):this.scaleOf(d.origin,d.scaleX,d.scaleY),la.move(r.totalOffset,e.x-u,e.y-p)}onRotate(t){const{target:e,mergeConfig:i,dragStartData:n}=this.editBox,{around:r,rotateAround:o,rotateGap:s,diagonalRotateKey:a}=i,{direction:l}=t.current;let h,c;if(t instanceof h_)c=t.rotation,h=o?ya.getPoint(o,e.boxBounds):e.getBoxPoint(t);else{const i=a?t.isHoldKeys(a):t.shiftKey,s=tb.getRotateData(e,l,t,n,i?null:o||e.around||e.origin||r||"center");c=n.rotation+s.rotation-e.rotation,h=s.origin}if(c=Ms.float(Ms.getGapRotation(c,s,e.rotation),2),!c)return;const d=e.x,u=e.y;this.rotateOf(h,c),la.move(n.totalOffset,e.x-d,e.y-u)}onSkew(t){const{target:e,mergeConfig:i}=this.editBox,{around:n}=i,{origin:r,skewX:o,skewY:s}=tb.getSkewData(e.boxBounds,t.current.direction,t.getInnerMove(e),tb.getAround(n,t.altKey));(o||s)&&this.skewOf(r,o,s)}move(t,e=0){if(!this.checkTransform("moveable"))return;ps(t)&&(e=t.y,t=t.x);const{target:i,mergeConfig:n,single:r,editor:o}=this.editBox,{beforeMove:s}=n;if(s){const n=s({target:i,x:t,y:e});if(ps(n))t=n.x,e=n.y;else if(!1===n)return}const a=i.getWorldPointByLocal({x:t,y:e},null,!0);r||i.safeChange(()=>i.move(t,e));const l={target:i,editor:o,moveX:a.x,moveY:a.y};this.emitEvent(new Pb(Pb.BEFORE_MOVE,l));const h=new Pb(Pb.MOVE,l);this.doMove(h),this.emitEvent(h)}scaleWithDrag(t){if(!this.checkTransform("resizeable"))return;const{target:e,mergeConfig:i,editor:n}=this.editBox,{beforeScale:r}=i;if(r){const{origin:i,scaleX:n,scaleY:o,drag:s}=t;if(!1===r({target:e,drag:s,origin:i,scaleX:n,scaleY:o}))return}t=Object.assign(Object.assign({},t),{target:e,editor:n,worldOrigin:e.getWorldPoint(t.origin)}),this.emitEvent(new Tb(Tb.BEFORE_SCALE,t));const o=new Tb(Tb.SCALE,t);this.editTool.onScaleWithDrag(o),this.emitEvent(o)}scaleOf(t,e,i=e,n){if(!this.checkTransform("resizeable"))return;const{target:r,mergeConfig:o,single:s,editor:a}=this.editBox,{beforeScale:l}=o;if(l){const n=l({target:r,origin:t,scaleX:e,scaleY:i});if(ps(n))e=n.scaleX,i=n.scaleY;else if(!1===n)return}const h=this.getWorldOrigin(t),c=!s&&this.getChangedTransform(()=>r.safeChange(()=>r.scaleOf(t,e,i))),d={target:r,editor:a,worldOrigin:h,scaleX:e,scaleY:i,transform:c};this.emitEvent(new Tb(Tb.BEFORE_SCALE,d));const u=new Tb(Tb.SCALE,d);this.doScale(u),this.emitEvent(u)}flip(t){if(!this.checkTransform("resizeable"))return;const{target:e,single:i,editor:n}=this.editBox,r=this.getWorldOrigin("center"),o=i?new ga(Xu.getFlipTransform(e,t)):this.getChangedTransform(()=>e.safeChange(()=>e.flip(t))),s={target:e,editor:n,worldOrigin:r,scaleX:"x"===t?-1:1,scaleY:"y"===t?-1:1,transform:o};this.emitEvent(new Tb(Tb.BEFORE_SCALE,s));const a=new Tb(Tb.SCALE,s);this.doScale(a),this.emitEvent(a)}rotateOf(t,e){if(!this.checkTransform("rotateable"))return;const{target:i,mergeConfig:n,single:r,editor:o}=this.editBox,{beforeRotate:s}=n;if(s){const n=s({target:i,origin:t,rotation:e});if(ds(n))e=n;else if(!1===n)return}const a=this.getWorldOrigin(t),l=!r&&this.getChangedTransform(()=>i.safeChange(()=>i.rotateOf(t,e))),h={target:i,editor:o,worldOrigin:a,rotation:e,transform:l};this.emitEvent(new Bb(Bb.BEFORE_ROTATE,h));const c=new Bb(Bb.ROTATE,h);this.doRotate(c),this.emitEvent(c)}skewOf(t,e,i=0,n){if(!this.checkTransform("skewable"))return;const{target:r,mergeConfig:o,single:s,editor:a}=this.editBox,{beforeSkew:l}=o;if(l){const n=l({target:r,origin:t,skewX:e,skewY:i});if(ps(n))e=n.skewX,i=n.skewY;else if(!1===n)return}const h=this.getWorldOrigin(t),c=!s&&this.getChangedTransform(()=>r.safeChange(()=>r.skewOf(t,e,i))),d={target:r,editor:a,worldOrigin:h,skewX:e,skewY:i,transform:c};this.emitEvent(new Rb(Rb.BEFORE_SKEW,d));const u=new Rb(Rb.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(Xu.getInnerOrigin(e,t))}getChangedTransform(t){const{target:e,single:i}=this.editBox;if(!i&&!e.canChange)return e.changedTransform;const n=new ga(e.worldTransform);return t(),new ga(e.worldTransform).divide(n)}emitEvent(t,e){this.editBox.editor.emitEvent(t,e)}},["editBox","editTool","emitEvent"])],Ab);var Db=class{static registerInnerEditor(){wb.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 Ug,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)}},Mb=class extends Db{static registerEditTool(){wb.register(this)}get tag(){return"EditTool"}onMove(t){const{moveX:e,moveY:i,editor:n}=t,{app:r,list:o}=n;r.lockLayout(),o.forEach(t=>{t.moveWorld(e,i)}),r.unlockLayout()}onScale(t){const{scaleX:e,scaleY:i,transform:n,worldOrigin:r,editor:o}=t,{app:s,list:a}=o;s.lockLayout(),a.forEach(t=>{const s="scale"!==o.getEditSize(t);n?t.transformWorld(n,s):t.scaleOfWorld(r,e,i,s)}),s.unlockLayout()}onRotate(t){const{rotation:e,transform:i,worldOrigin:n,editor:r}=t,{app:o,list:s}=r;o.lockLayout(),s.forEach(t=>{const o="scale"!==r.getEditSize(t);i?t.transformWorld(i,o):t.rotateOfWorld(n,e)}),o.unlockLayout()}onSkew(t){const{skewX:e,skewY:i,transform:n,worldOrigin:r,editor:o}=t,{app:s,list:a}=o;s.lockLayout(),a.forEach(t=>{const s="scale"!==o.getEditSize(t);n?t.transformWorld(n,s):t.skewOfWorld(r,e,i,s)}),s.unlockLayout()}load(){this.editBox.view.visible=!0,this.onLoad()}update(){this.editBox.update(),this.onUpdate()}unload(){this.editBox.view.visible=!1,this.onUnload()}};Mb=Ew([yb()],Mb);var{left:Ib,right:Fb}=$s,{move:Wb,copy:zb,toNumberPoints:Nb}=la,jb=class extends Mb{constructor(){super(...arguments),this.scaleOfEvent=!0}get tag(){return"LineEditTool"}onScaleWithDrag(t){const{drag:e,direction:i,lockRatio:n,around:r}=t,o=t.target,s=i===Ib;if(o.pathInputed){const{path:t}=o.__,{from:i,to:a}=this.getFromToByPath(t);this.dragPoint(i,a,s,r,this.getInnerMove(o,e,n)),t[1]=i.x,t[2]=i.y,t[4]=a.x,t[5]=a.y,o.path=t}else if(o.points){const{points:t}=o,{from:i,to:a}=this.getFromToByPoints(t);this.dragPoint(i,a,s,r,this.getInnerMove(o,e,n)),t[0]=i.x,t[1]=i.y,t[2]=a.x,t[3]=a.y,o.points=t}else{const t={x:0,y:0},{toPoint:i}=o;o.rotation=0,this.dragPoint(t,i,s,r,this.getInnerMove(o,e,n)),o.getLocalPointByInner(t,null,null,!0),o.getLocalPointByInner(i,null,null,!0),o.x=t.x,o.y=t.y,o.getInnerPointByLocal(i,null,null,!0),o.toPoint=i}}getInnerMove(t,e,i){const n=e.getInnerMove(t);return i&&(Math.abs(n.x)>Math.abs(n.y)?n.y=0:n.x=0),n}getFromToByPath(t){return{from:{x:t[1],y:t[2]},to:{x:t[4],y:t[5]}}}getFromToByPoints(t){const e=Nb(t);return{from:{x:e[0],y:e[1]},to:{x:e[2],y:e[3]}}}dragPoint(t,e,i,n,r){const{x:o,y:s}=r;i?(Wb(t,o,s),n&&Wb(e,-o,-s)):(n&&Wb(t,-o,-s),Wb(e,o,s))}onSkew(t){}onUpdate(){const{editBox:t}=this,{rotatePoints:e,resizeLines:i,resizePoints:n,rect:r}=t,o=t.target;let s,a;if(o.pathInputed?s=this.getFromToByPath(o.__.path):o.points&&(s=this.getFromToByPoints(o.__.points)),s){const{from:i,to:a}=s;o.innerToWorld(i,i,!1,t),o.innerToWorld(a,a,!1,t),r.pen.clearPath().moveTo(i.x,i.y).lineTo(a.x,a.y),zb(n[7],i),zb(e[7],i),zb(n[3],a),zb(e[3],a)}for(let l=0;l<8;l++)l<4&&(i[l].visible=!1),a=l===Ib||l===Fb,n[l].visible=a,e[l].visible=!s&&a}};function Vb(t){const{scroll:e,disabled:i}=t.app.config.move;return!e||i?"":!0===e?"free":e}function Hb(t,e,i){(function(t,e){const i={wheel:{preventDefault:!0},touch:{preventDefault:!0},pointer:{preventDefaultMenu:!0}};e&&_s.assign(i,e),_s.assign(t.config,i,t.userConfig)})(t.parentApp?t.parentApp:t,e),t.isApp||i||t.__eventIds.push(t.on_(a_.BEFORE_MOVE,e=>{const i=t.getValidMove(e.moveX,e.moveY,!1);if(Vb(t).includes("limit")){const n=t.getValidMove(0,0);if(n.x||n.y){const t=100,r=200,o="drag"===e.moveType?.3:.05;Math.abs(n.x)>t?i.x=0:i.x*=o,Math.abs(n.y)>r?i.y=0:i.y*=o}}t.zoomLayer.move(i)}),t.on_(a_.DRAG_ANIMATE,()=>{const e=t.getValidMove(0,0);(e.x||e.y)&&t.interaction.stopDragAnimate()}),t.on_(a_.END,e=>{Xu.animateMove(t.zoomLayer,t.getValidMove(e.moveX,e.moveY))}),t.on_(d_.BEFORE_ZOOM,e=>{const{zoomLayer:i,layouter:n}=t,r=t.getValidScale(e.scale);1!==r&&(n.stop(),Xu.updateMatrix(t),i.scaleOfWorld(e,r),n.start())}))}jb=Ew([yb()],jb),sl.add("editor","resize"),al.editor=function(t,e){const i=new Ab(t);return e&&e.sky.add(e.editor=i),i},Qg.addAttr("textBox",!1,au),Vg.addAttr("editConfig",void 0,au),Vg.addAttr("editOuter",t=>(t.updateLayout(),t.__.__isLinePath?"LineEditTool":"EditTool"),au),Vg.addAttr("editInner","PathEditor",au),Ug.addAttr("editInner","",au),Mv.addAttr("editInner","TextEditor",au),Vg.setEditConfig=function(t){this.changeAttr("editConfig",t)},Vg.setEditOuter=function(t){this.changeAttr("editOuter",t)},Vg.setEditInner=function(t){this.changeAttr("editInner",t)};var Ub=Qa.get("LeaferTypeCreator"),Yb={list:{},register(t,e){Xb[t]&&Ub.repeat(t),Xb[t]=e},run(t,e){const i=Xb[t];i&&i(e)}},{list:Xb,register:Gb}=Yb;Gb("viewport",Hb),Gb("custom",function(t){Hb(t,null,!0)}),Gb("design",function(t){Hb(t,{zoom:{min:.01,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0}})}),Gb("document",function(t){Hb(t,{zoom:{min:1},move:{scroll:"limit"}})});var Kb,$b,Zb,qb,Jb={state:{type:"none",typeCount:0,startTime:0,totalData:null,center:{}},getData(t){const e=t[0],i=t[1],n=la.getCenter(e.from,i.from),r=la.getCenter(e.to,i.to),o={x:r.x-n.x,y:r.y-n.y},s=la.getDistance(e.from,i.from);return{move:o,scale:la.getDistance(e.to,i.to)/s,rotation:la.getRotation(e.from,i.from,e.to,i.to),center:r}},getType(t,e){const i=Math.hypot(t.move.x,t.move.y)/(e.move||5),n=Math.abs(t.scale-1)/(e.scale||.03),r=Math.abs(t.rotation)/(e.rotation||2);return i<1&&n<1&&r<1?"none":i>=n&&i>=r?"move":n>=r?"zoom":"rotate"},detect(t,e){const{state:i}=Qb,n=Qb.getType(t,e);if(i.totalData||(i.startTime=Date.now(),i.center=t.center),Qb.add(t,i.totalData),i.totalData=t,n===i.type){if(i.typeCount++,i.typeCount>=(e.count||3)&&"none"!==n)return n}else i.type=n,i.typeCount=1;return Date.now()-i.startTime>=(e.time||160)?Qb.getType(i.totalData,e):"none"},add(t,e){e&&(la.move(t.move,e.move),t.scale*=e.scale,t.rotation+=e.rotation,t.center=e.center)},reset(){const{state:t}=Qb;t.type="none",t.typeCount=0,t.startTime=0,t.totalData=null}},Qb=Jb,{abs:tS,max:eS}=Math,{sign:iS,within:nS}=Ms,rS={getMove(t,e){let{moveSpeed:i}=e,{deltaX:n,deltaY:r}=t;t.shiftKey&&!n&&(n=r,r=0);const o=tS(n),s=tS(r);return o>50&&(n=eS(50,o/3)*iS(n)),s>50&&(r=eS(50,s/3)*iS(r)),{x:-n*i*2,y:-r*i*2}},getScale(t,e){let i,n=1,{zoomMode:r,zoomSpeed:o}=e;const s=t.deltaY||t.deltaX;if(r?(i="mouse"===r||!t.deltaX&&(Za.intWheelDeltaY?Math.abs(s)>17:Math.ceil(s)!==s),(t.shiftKey||t.metaKey||t.ctrlKey)&&(i=!0)):i=!t.shiftKey&&(t.metaKey||t.ctrlKey),i){o=nS(o,0,1);const i=t.deltaY?e.delta.y:e.delta.x,r=nS(1-tS(s)/(4*i)*o,.5,2);n=s>0?r:1/r}return n}},oS=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),Kb=0,$b=0,this.moveData=Object.assign(Object.assign({},t),{moveX:0,moveY:0,totalX:Kb,totalY:$b}),e.emit(a_.START,this.moveData)),t.path=this.moveData.path,t.totalX=Kb+=t.moveX,t.totalY=$b+=t.moveY,e.emit(a_.BEFORE_MOVE,t),e.emit(a_.MOVE,t),this.transformEndWait()}zoom(t){const{interaction:e}=this;this.zoomData||(this.setPath(t),Zb=1,this.zoomData=Object.assign(Object.assign({},t),{scale:1,totalScale:Zb}),e.emit(d_.START,this.zoomData)),t.path=this.zoomData.path,t.totalScale=Zb*=t.scale,e.emit(d_.BEFORE_ZOOM,t),e.emit(d_.ZOOM,t),this.transformEndWait()}rotate(t){const{interaction:e}=this;this.rotateData||(this.setPath(t),qb=0,this.rotateData=Object.assign(Object.assign({},t),{rotation:0,totalRotation:qb}),e.emit(h_.START,this.rotateData)),t.path=this.rotateData.path,t.totalRotation=qb+=t.rotation,e.emit(h_.BEFORE_ROTATE,t),e.emit(h_.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:n}=this;e&&t.emit(a_.END,Object.assign(Object.assign({},e),{totalX:Kb,totalY:$b})),i&&t.emit(d_.END,Object.assign(Object.assign({},i),{totalScale:Zb})),n&&t.emit(h_.END,Object.assign(Object.assign({},n),{totalRotation:qb})),this.reset()}reset(){this.zoomData=this.moveData=this.rotateData=null}destroy(){this.reset()}},sS=Xg.prototype,aS=new Ha,lS=new fa;function hS(t,e){return Object.assign(Object.assign({},e),{moveX:t.x,moveY:t.y})}function cS(t,e){return Object.assign(Object.assign({},e),{scale:t})}sS.initType=function(t){Yb.run(t,this)},sS.getValidMove=function(t,e,i=!0){const{disabled:n,scrollSpread:r}=this.app.config.move;lS.set(t,e);const o=Vb(this);return o&&(o.includes("x")?lS.y=0:o.includes("y")?lS.x=0:Math.abs(lS.x)>Math.abs(lS.y)?lS.y=0:lS.x=0,i&&o.includes("limit")&&(aS.set(this.__world).addPoint(this.zoomLayer),r&&aS.spread(r),e_.getValidMove(aS,this.canvas.bounds,"auto",lS,!0),o.includes("x")?lS.y=0:o.includes("y")&&(lS.x=0))),{x:n?0:lS.x,y:n?0:lS.y}},sS.getValidScale=function(t){const{scaleX:e}=this.zoomLayer.__,{min:i,max:n,disabled:r}=this.app.config.zoom,o=Math.abs(e*t);return i&&o<i?t=i/e:n&&o>n&&(t=n/e),r?1:t};var dS=P_.prototype;dS.createTransformer=function(){this.transformer=new oS(this)},dS.move=function(t){this.transformer.move(t)},dS.zoom=function(t){this.transformer.zoom(t)},dS.rotate=function(t){this.transformer.rotate(t)},dS.transformEnd=function(){this.transformer.transformEnd()},dS.wheel=function(t){const{wheel:e,pointer:i}=this.config,{posDeltaSpeed:n,negDeltaSpeed:r}=e;if(e.disabled)return;t.deltaX>0?n&&(t.deltaX*=n):r&&(t.deltaX*=r),t.deltaY>0?n&&(t.deltaY*=n):r&&(t.deltaY*=r);const o=e.getScale?e.getScale(t,e):rS.getScale(t,e);if(1!==o)this.zoom(cS(o,t));else{const n=e.getMove?e.getMove(t,e):rS.getMove(t,e);i.snap&&la.round(n),this.move(hS(n,t))}},dS.multiTouch=function(t,e){const{disabled:i,singleGesture:n}=this.config.multiTouch;if(i)return;this.pointerWaitCancel();let r=Jb.getData(e),{moving:o,zooming:s,rotating:a}=this.transformer;if(n){if(!this.transformer.transforming){switch(Jb.detect(r,ps(n)?n:{})){case"move":o=!0;break;case"zoom":s=!0;break;case"rotate":a=!0;break;default:return}Jb.reset()}o||(r.center=Jb.state.center)}else o=s=a=!0;var l,h;Object.assign(t,r.center),t.multiTouch=!0,a&&this.rotate((l=r.rotation,h=t,Object.assign(Object.assign({},h),{rotation:l}))),s&&this.zoom(cS(r.scale,t)),o&&this.move(hS(r.move,t))};var uS=y_.prototype,{abs:pS,min:fS,max:gS,hypot:vS}=Math;function _S(t,e){let i=1;const n="out"===e,r=Math.abs(t);if(r>1){for(;n?i<r:i<=r;)i*=2;n&&(i/=2)}else{for(;n?i>=r:i>r;)i/=2;n||(i*=2)}return i/t}uS.checkDragEndAnimate=function(t){const{interaction:e}=this,i=this.canAnimate&&this.moving&&e.m.dragAnimate;if(i){const n=ds(i)?i:.95,r=.15,o=150;let s,a,l,h=0,c=0,d=0,u=0,p=3;const{dragDataList:f}=this,g=f.length;for(let t=g-1;t>=gS(g-3,0)&&(l=f[t],!(l.time&&Date.now()-l.time>100));t--)s=p--,h+=l.moveX*s,c+=l.moveY*s,u+=s,a=vS(l.moveX,l.moveY),a>d&&(d=a);if(u&&(h/=u,c/=u),d>8){const t=1.15+.4500000000000002*fS((d-8)/17,1);h*=t,c*=t}const v=gS(pS(h),pS(c));v>o&&(a=o/v,h*=a,c*=a);const _=()=>{if(h*=n,c*=n,t=Object.assign({},t),pS(h)<r&&pS(c)<r)return this.dragEndReal(t);la.move(t,h,c),this.drag(t),this.animate(_),e.emit(a_.DRAG_ANIMATE,t)};this.animate(_)}return i},uS.animate=function(t,e){const i=t||this.animateWait;i&&this.interaction.target.nextRender(i,null,e),this.animateWait=t},uS.stopAnimate=function(){this.animate(null,"off"),this.interaction.target.nextRender(()=>{this.dragData&&this.dragEndReal(this.dragData)})},uS.checkDragOut=function(t){const{interaction:e}=this;this.autoMoveCancel(),this.dragging&&!e.shrinkCanvasBounds.hitPoint(t)&&this.autoMoveOnDragOut(t)},uS.autoMoveOnDragOut=function(t){const{interaction:e,downData:i,canDragOut:n}=this,{autoDistance:r,dragOut:o}=e.m;if(!o||!n||!r)return;const s=e.shrinkCanvasBounds,{x:a,y:l}=s,h=za.maxX(s),c=za.maxY(s),d=t.x<a?r:h<t.x?-r:0,u=t.y<l?r:c<t.y?-r:0;let p=0,f=0;this.autoMoveTimer=setInterval(()=>{p+=d,f+=u,la.move(i,d,u),la.move(this.dragData,d,u),e.move(Object.assign(Object.assign({},t),{moveX:d,moveY:u,totalX:p,totalY:f,moveType:"drag"})),e.pointerMoveReal(t)},10)},uS.autoMoveCancel=function(){this.autoMoveTimer&&(clearInterval(this.autoMoveTimer),this.autoMoveTimer=0)},sl.add("viewport"),sl.add("view"),Xg.prototype.zoom=function(t,e,i,n){let r;!function(t){return ps(t)&&!us(t)}(e)?r=e:(r=e.padding,i=e.scroll,n=e.transition);const{zoomLayer:o}=this,s=this.canvas.bounds.clone().shrink(ls(r)?30:r),a=new Ha,l={x:s.x+s.width/2,y:s.y+s.height/2};let h;o.killAnimate();const{x:c,y:d,scaleX:u,scaleY:p}=o.__,{boxBounds:f}=o;if(hs(t))switch(t){case"in":h=_S(u,"in");break;case"out":h=_S(u,"out");break;case"fit":t=f;break;case"fit-width":(t=new Ha(f)).height=0;break;case"fit-height":(t=new Ha(f)).width=0}else ds(t)&&(h=t/u);if(h)h=this.getValidScale(h),o.scaleOfWorld(l,h,h,!1,n);else if(ps(t)){const e={x:c,y:d,scaleX:u,scaleY:p},r=us(t);if(r||t.tag){const e=r?t:[t];a.setListWithFn(e,ep.worldBounds)}else{const e=function(t,e){let i,{x:n,y:r,width:o,height:s}=t;return s||(s=o*(e.height/e.width),i=!0),o||(o=s*(e.width/e.height),i=!0),i?{x:n,y:r,width:o,height:s}:t}(t,s);a.set(o.getWorldBounds(e))}const{width:l,height:f}=a;let g=s.x-a.x,v=s.y-a.y;return i?(g+=Math.max((s.width-l)/2,0),v+=Math.max((s.height-f)/2,0)):(h=this.getValidScale(Math.min(s.width/l,s.height/f)),g+=(s.width-l*h)/2,v+=(s.height-f*h)/2,la.scaleOf(e,a,h),a.scaleOf(a,h),e.scaleX*=h,e.scaleY*=h),"x"===i?v=0:"y"===i&&(g=0),la.move(e,g,v),a.move(g,v),o.set(e,n),a}return o.worldBoxBounds};var mS=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=[]}},yS=class{container;element;dataArray;pointData;constructor(t,e,i,n){this.container=t,this.element=e,this.dataArray=i,this.pointData=n}execute(){this.container.add(this.element),this.dataArray.push(this.pointData)}undo(){this.container.remove(this.element);const t=this.dataArray.findIndex(t=>t.id===this.pointData.id);t>-1&&this.dataArray.splice(t,1)}},xS=class{container;element;dataArray;insertIndex;constructor(t,e,i){this.container=t,this.element=e,this.dataArray=i,this.insertIndex=i.findIndex(t=>t.id===e.data.id)}execute(){this.container.remove(this.element);const t=this.dataArray.findIndex(t=>t.id===this.element.data.id);t>-1&&this.dataArray.splice(t,1)}undo(){this.container.add(this.element),this.insertIndex>-1&&this.insertIndex<=this.dataArray.length?this.dataArray.splice(this.insertIndex,0,this.element.data):this.dataArray.push(this.element.data)}},wS=class{canvasBrush;beforeSnapshot;afterSnapshot;isFirstExecute;isClearOperation;constructor(t,e,i=!1){this.canvasBrush=t,this.beforeSnapshot=e,this.afterSnapshot="",this.isFirstExecute=!0,this.isClearOperation=i}execute(){this.isFirstExecute?(this.isClearOperation?this.afterSnapshot="":this.afterSnapshot=this.canvasBrush.getImageData(),this.isFirstExecute=!1):this.afterSnapshot?this.canvasBrush.restoreImageData(this.afterSnapshot):this.canvasBrush.clear()}undo(){this.canvasBrush.restoreImageData(this.beforeSnapshot)}redo(){this.afterSnapshot?this.canvasBrush.restoreImageData(this.afterSnapshot):this.canvasBrush.clear()}};var bS=["Shift","Meta","Alt","Control"],SS="object"==typeof navigator?navigator.platform:"",kS=/Mac|iPod|iPhone|iPad/.test(SS),ES=kS?"Meta":"Control",CS="Win32"===SS?["Control","Alt"]:kS?["Alt"]:[];function OS(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||CS.includes(e)&&t.getModifierState("AltGraph"))}function LS(t){return t.trim().split(" ").map(function(t){var e=t.split(/\b\+/),i=e.pop(),n=i.match(/^\((.+)\)$/);return n&&(i=new RegExp("^"+n[1]+"$")),[e=e.map(function(t){return"$mod"===t?ES:t}),i]})}function PS(t,e){var i=e[0],n=e[1];return!((n instanceof RegExp?!n.test(t.key)&&!n.test(t.code):n.toUpperCase()!==t.key.toUpperCase()&&n!==t.code)||i.find(function(e){return!OS(t,e)})||bS.find(function(e){return!i.includes(e)&&n!==e&&OS(t,e)}))}function TS(t,e){var i;void 0===e&&(e={});var n=null!=(i=e.timeout)?i:1e3,r=Object.keys(t).map(function(e){return[LS(e),t[e]]}),o=new Map,s=null;return function(t){t instanceof KeyboardEvent&&(r.forEach(function(e){var i=e[0],n=e[1],r=o.get(i)||i;PS(t,r[0])?r.length>1?o.set(i,r.slice(1)):(o.delete(i),n(t)):OS(t,t.key)||o.delete(i)}),s&&clearTimeout(s),s=setTimeout(o.clear.bind(o),n))}}var BS={circleRadius:12,circleFill:"#ff4d4f",circleStroke:"#ffffff",circleStrokeWidth:2,hoverCircleFill:"#ff7875",hoverCircleStroke:"#ffffff",selectedCircleFill:"#1890ff",selectedCircleStroke:"#ffffff",selectedCircleScale:1.2,labelBackgroundColor:"#ffffff",labelTextColor:"#333333",labelFontSize:12,labelPadding:[2,4],fixedSizeOnZoom:!1,fixedSizeScale:1},RS={color:"rgba(255,0,0,1)",opacity:.55,size:100,minSize:50,maxSize:150,continuity:28};function AS(t,e){return su(t,t=>({set(i){this.__setAttr(t,i),this.leaferIsReady?e?xg.setStyleName(this,e,i):xg.set(this,i):this.__layout.stateStyleChanged=!0}}))}function DS(t){return su(t,t=>({set(e){this.__setAttr(t,e),this.__layout.stateStyleChanged=!0}}))}function MS(t,e){if(e&&!0!==e)return e;if(!t.button){let{parent:e}=t;for(let t=0;t<2;t++)if(e){if(e.button)return e;e=e.parent}}return null}function IS(t,e){ps(e)||(e=void 0),zS(t,e,"in")}function FS(t,e){const{normalStyle:i}=t;ps(e)||(e=void 0),i&&(e||(e=i),zS(t,e,"out"))}var WS={};function zS(t,e,i){const{normalStyle:n}=t;e||(e=WS),e.scale&&(Ms.assignScale(e,e.scale),delete e.scale),e!==WS&&xg.canAnimate||(i=null);let r=!!i&&function(t,e,i){let n="in"===t?"transition":"transitionOut";return"out"===t&&ls(i[n])&&ls(e[n])&&(n="transition"),ls(e[n])?i[n]:e[n]}(i,e,t);const o=r?function(t,e){const i=VS(e,t),n=t.animate();return n&&VS(i,t,n.fromStyle),i}(t,e):void 0;xg.canAnimate&&NS(t)&&t.killAnimate("transition"),n&&t.set(n,"temp");const s=NS(t);if(s){const{animation:n}=s;if(n){const o=t.animate(n,void 0,"animation",!0);Object.assign(s,o.endingStyle),"in"!==i||e.animation!==n?o.kill():r=!1,delete s.animation}t.normalStyle=jS(s,t),t.set(s,"temp")}else t.normalStyle=void 0;if(r){const e=jS(o,t);t.set(o,"temp"),t.animate([o,e],r,"transition",!0)}t.__layout.stateStyleChanged=!1}function NS(t){let e;const i={},n=MS(t),r=n?t.state||n.state:t.state,o=r&&t.states[r];o&&xg.isState(r,t,n)&&(e=HS(i,o));const s=i.selectedStyle||t.selectedStyle;s&&xg.isSelected(t,n)&&(e=HS(i,s));const a=i.placeholderStyle||t.placeholderStyle;if(a&&xg.isPlacehold(t,n)&&(e=HS(i,a)),xg.isDisabled(t,n)){const n=i.disabledStyle||t.disabledStyle;n&&(e=HS(i,n))}else{const r=i.focusStyle||t.focusStyle;r&&xg.isFocus(t,n)&&(e=HS(i,r));const o=i.hoverStyle||t.hoverStyle;o&&xg.isHover(t,n)&&(e=HS(i,o));const s=i.pressStyle||t.pressStyle;s&&xg.isPress(t,n)&&(e=HS(i,s))}return e?i:void 0}function jS(t,e,i,n){const r=i?t:{},o=i||t;for(let s in o)n&&xg.animateExcludes[s]||(r[s]=e[s]);return r}function VS(t,e,i){return jS(t,e,i,!0)}function HS(t,e){return Object.assign(t,e),!0}function US(t,e){const i=t[e];i&&IS(t,i),t.button&&XS(t.children,e)}function YS(t,e,i){i||(i=t.states[e]),IS(t,i),t.button&&XS(t.children,null,e)}function XS(t,e,i){if(!t)return;let n,r;for(let o=0,s=t.length;o<s;o++){if(n=t[o],e){switch(r=!0,e){case"hoverStyle":xg.isHover(n)&&(r=!1);break;case"pressStyle":xg.isPress(n)&&(r=!1);break;case"focusStyle":xg.isFocus(n)&&(r=!1)}r&&US(n,e)}else as(i)||YS(n,i);n.isBranch&&XS(n.children,e,i)}}function GS(t,e){const i=t[e];i&&FS(t,i),t.button&&$S(t.children,e)}function KS(t,e,i){FS(t,i),t.button&&$S(t.children,null,e)}function $S(t,e,i){if(!t)return;let n;for(let r=0,o=t.length;r<o;r++)n=t[r],e?GS(n,e):as(i)||KS(n,i),n.isBranch&&$S(n.children,e,i)}function ZS(t,e,i){let n;const r=e.leafer?e.leafer.interaction:null;if(r&&(n=r[t](e),!n&&i)){const o=MS(e,i);o&&(n=r[t](o))}return n}function qS(t,e,i){let n=e[t];if(!n&&i){const r=MS(e,i);r&&(n=r[t])}return n}sl.add("state"),xg.animateExcludes={animation:1,animationOut:1,transition:1,transitionOut:1,states:1,state:1,placeholder:1,normalStyle:1,hoverStyle:1,pressStyle:1,focusStyle:1,selectedStyle:1,disabledStyle:1,placeholderStyle:1},xg.isState=function(t,e,i){return function(t,e,i){let n=e.states[t];if(!n&&i){const r=MS(e,i);r&&(n=r.states[t])}return!!n}(t,e,i)},xg.isSelected=function(t,e){return qS("selected",t,e)},xg.isDisabled=function(t,e){return qS("disabled",t,e)},xg.isFocus=function(t,e){return ZS("isFocus",t,e)},xg.isHover=function(t,e){return ZS("isHover",t,e)},xg.isPress=function(t,e){return ZS("isPress",t,e)},xg.isPlacehold=function(t,e){return t.__.__isPlacehold},xg.isDrag=function(t,e){return ZS("isDrag",t,e)},xg.setStyleName=function(t,e,i){i?YS(t,e,t[e]):KS(t,e,t[e])},xg.set=function(t,e){const i=t.states[e];i?YS(t,e,i):KS(t,e,i)},xg.getStyle=NS,xg.updateStyle=zS,xg.updateEventStyle=function(t,e){switch(e){case n_.ENTER:US(t,"hoverStyle");break;case n_.LEAVE:GS(t,"hoverStyle");break;case n_.DOWN:US(t,"pressStyle");break;case n_.UP:GS(t,"pressStyle")}};var JS=Vg.prototype;Vg.addAttr("selected",!1,AS,"selectedStyle"),Vg.addAttr("disabled",!1,AS,"disabledStyle"),Vg.addAttr("states",{},DS),Vg.addAttr("state","",AS),Vg.addAttr("normalStyle",void 0,au),Vg.addAttr("hoverStyle",void 0,DS),Vg.addAttr("pressStyle",void 0,DS),Vg.addAttr("focusStyle",void 0,DS),Vg.addAttr("selectedStyle",void 0,DS),Vg.addAttr("disabledStyle",void 0,DS),Vg.addAttr("placeholderStyle",void 0,DS),Vg.addAttr("button",!1,au),JS.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},JS.focus=function(t=!0){this.waitLeafer(()=>{let{focusData:e}=this.app.interaction;t?(e&&e.focus(!1),e=this):e=null,this.app.interaction.focusData=e,t?US(this,"focusStyle"):GS(this,"focusStyle")})},JS.updateState=function(){xg.updateStyle(this,void 0,"in")};var QS=Mv.prototype,tk="text";ru(QS,tk,Object.assign(Object.assign({},ou(QS,tk)),{set(t){const e=this,i=e.text;e.__setAttr(tk,t)&&(fu(e),e.placeholderStyle&&e.placeholder&&(""===i||""===t)&&(e.__layout.stateStyleChanged=!0))}}));var ek={none:"none",title:"capitalize",upper:"uppercase",lower:"lowercase","small-caps":"small-caps"},ik={top:"flex-start",middle:"center",bottom:"flex-end"},nk={none:"none",under:"underline",delete:"line-through","under-delete":"underline line-through"};function rk(t,e,i){const{style:n}=t,{fill:r,padding:o,textWrap:s,textOverflow:a,textDecoration:l}=e;let h;n.fontFamily=e.fontFamily,n.fontSize=e.fontSize*i+"px",function(t,e){let i="black";if(us(e)&&(e=e[0]),ps(e))switch(e.type){case"solid":i=dg.string(e.color);break;case"image":case"film":case"video":break;case"linear":case"radial":case"angular":const t=e.stops[0];i=dg.string(hs(t)?t:t.color);break;default:as(e.r)||(i=dg.string(e))}else i=e;t.color=i}(n,r),n.fontStyle=e.italic?"italic":"normal",n.fontWeight=e.fontWeight,ps(l)?(h=l.type,l.color&&(n.textDecorationColor=dg.string(l.color))):h=l,n.textDecoration=nk[h],n.textTransform=ek[e.textCase],n.textAlign="both"===e.textAlign?"justify":e.textAlign,n.display="flex",n.flexDirection="column",n.justifyContent=ik[e.verticalAlign],n.lineHeight=(e.__.__lineHeight||0)*i+"px",n.letterSpacing=(e.__.__letterSpacing||0)*i+"px",n.whiteSpace="none"===s||e.__.__autoWidth?"nowrap":"normal",n.wordBreak="break"===s?"break-all":"normal",n.textIndent=(e.paraIndent||0)*i+"px",n.padding=us(o)?o.map(t=>t*i+"px").join(" "):(o||0)*i+"px",n.textOverflow="show"===a?"":"hide"===a?"clip":a}var ok=class extends Db{constructor(){super(...arguments),this.config={selectAll:!0},this.eventIds=[]}get tag(){return"TextEditor"}onLoad(){const{editor:t}=this,{config:e}=t.app,i=this.editTarget;i.textEditing=!0,this.isHTMLText=!(i instanceof Mv),this._keyEvent=e.keyEvent,e.keyEvent=!1;const n=this.editDom=document.createElement("div");n.classList.add("leafer-text-editor");const{style:r}=n;n.contentEditable="true",r.position="fixed",r.transformOrigin="left top",r.boxSizing="border-box",this.isHTMLText?n.innerHTML=String(i.text):n.innerText=String(i.text);const{view:o}=t.app;(this.inBody=o instanceof HTMLCanvasElement)?document.body.appendChild(n):o.appendChild(n),this.eventIds=[t.app.on_(n_.DOWN,e=>{let i,{target:r}=e.origin;for(;r;)r===n&&(i=!0),r=r.parentElement;i||t.closeInnerEditor()})],this.onFocus=this.onFocus.bind(this),this.onInput=this.onInput.bind(this),this.onPaste=this.onPaste.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onKeydown=this.onKeydown.bind(this),n.addEventListener("focus",this.onFocus),n.addEventListener("input",this.onInput),n.addEventListener("paste",this.onPaste),window.addEventListener("keydown",this.onKeydown),window.addEventListener("scroll",this.onUpdate);const s=window.getSelection(),a=document.createRange();if(this.config.selectAll)a.selectNodeContents(n);else{const t=n.childNodes[0];t&&(a.setStartAfter(t),a.setEndAfter(t)),a.collapse(!0)}s.removeAllRanges(),s.addRange(a)}onInput(){const{editDom:t}=this;this.editTarget.text=this.isHTMLText?t.innerHTML:t.innerText}onFocus(){this.editDom.style.outline="none"}onKeydown(t){if("Escape"===t.code&&this.editor.closeInnerEditor(),"Enter"===t.key){t.preventDefault();const e=document.createElement("br"),i=document.createTextNode("​"),n=window.getSelection().getRangeAt(0);n.deleteContents(),n.insertNode(i),n.insertNode(e),n.setStartAfter(e),n.setEndAfter(e),this.onInput()}}onPaste(t){if(this.isHTMLText)return;t.preventDefault();const e=t.clipboardData;if(!e)return;let i=e.getData("text/plain").replace(/\r\n?/g,"\n");const n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const o=i.split("\n"),s=document.createDocumentFragment();o.forEach((t,e)=>{e>0&&s.appendChild(document.createElement("br")),s.appendChild(document.createTextNode(t))}),r.insertNode(s),r.collapse(!1),n.removeAllRanges(),n.addRange(r),this.onInput()}onUpdate(){const{editTarget:t}=this;let e=1;if(!this.isHTMLText){const{scaleX:i,scaleY:n}=t.worldTransform;e=Math.max(Math.abs(i),Math.abs(n)),t.fontSize*e<12&&(e*=12/t.fontSize)}this.textScale=e;let{width:i,height:n}=t,r=0,o=0;i*=e,n*=e;const s=t.__;if(s.__autoWidth)switch(i+=20,s.textAlign){case"center":r=s.autoSizeAlign?-i/2:-10;break;case"right":r=s.autoSizeAlign?-i:-20}if(s.__autoHeight)switch(n+=20,s.verticalAlign){case"middle":o=s.autoSizeAlign?-n/2:-10;break;case"bottom":o=s.autoSizeAlign?-n:-20}const{x:a,y:l}=this.inBody?t.app.clientBounds:t.app.tree.clientBounds,{a:h,b:c,c:d,d:u,e:p,f:f}=new ga(t.worldTransform).scale(1/e).translateInner(r,o),{style:g}=this.editDom;g.transform=`matrix(${h},${c},${d},${u},${p},${f})`,g.left=a+"px",g.top=l+"px",g.width=i+"px",g.height=n+"px",this.isHTMLText||rk(this.editDom,t,e)}onUnload(){const{editTarget:t,editor:e,editDom:i}=this;t&&(this.onInput(),"\n"===t.text&&(t.text=""),t.textEditing=void 0,e.app&&(e.app.config.keyEvent=this._keyEvent),e.off_(this.eventIds),i.removeEventListener("focus",this.onFocus),i.removeEventListener("input",this.onInput),i.removeEventListener("paste",this.onPaste),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("scroll",this.onUpdate),i.remove(),this.editDom=this.eventIds=void 0)}};ok=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}([xb()],ok),sl.add("text-editor","editor");var sk=class extends Ug{circle;label;data;style;_element_tag;_lastValidLabel;constructor(t,e){super(),this.data=t,this.style={...BS,...e},this._lastValidLabel=t.label,this.circle=new rv({x:0,y:0,width:this.style.circleRadius,height:this.style.circleRadius,fill:this.style.circleFill,stroke:this.style.circleStroke,strokeWidth:this.style.circleStrokeWidth,draggable:!1,editable:!1,around:"center",hoverStyle:{fill:this.style.hoverCircleFill?this.style.hoverCircleFill:this.style.circleFill}}),this.label=new Mv({x:this.style.circleRadius/2-2,y:-this.style.circleRadius/2+2,text:t.label,fontSize:this.style.labelFontSize,fill:this.style.labelTextColor,padding:this.style.labelPadding,editable:!0,editConfig:{strokeWidth:0,moveable:!1,resizeable:!1},around:"bottom-left",boxStyle:{fill:this.style.labelBackgroundColor,cornerRadius:4,whiteSpace:"nowrap",shadow:{x:1,y:1,blur:2,color:"rgba(0,0,0, .2)"}}}),this.add(this.circle),this.add(this.label),this.x=t.pixel.x,this.y=t.pixel.y,this.draggable=!0,this.editable=!0,this.editConfig={strokeWidth:0,resizeable:!1},this._element_tag="point-annotation",this.bindEvents()}bindEvents(){this.label.on("property.change",t=>{const e=t.data||t;"text"===e.attrName&&this.handleLabelChange(e.newValue)})}handlePointAnnotationSelected(t){const e=t?this.style.selectedCircleFill:this.style.circleFill,i=t?this.style.selectedCircleStroke:this.style.circleStroke,n=t?this.style.selectedCircleScale:1;this.circle.set({fill:e,stroke:i,scale:n})}handleLabelChange(t){const e=t.trim();e?(this._lastValidLabel=e,this.data.label=e,this.data.updatedAt=Date.now()):this.label.text=this._lastValidLabel}updatePosition(t,e){this.x=t,this.y=e,this.data.pixel={x:t,y:e},this.data.updatedAt=Date.now()}updateLabel(t){this.label.text=t,this._lastValidLabel=t,this.data.label=t,this.data.updatedAt=Date.now()}getLabel(){return this.data.label}getLastValidLabel(){return this._lastValidLabel}},ak=class{canvas;group;width;height;lastPoint=null;constructor(t,e,i){this.width=t,this.height=e,this.canvas=new Pv({width:t,height:e}),this.canvas.set({pointerEvents:!1}),this.group=new Ug({opacity:i.opacity}),this.group.add(this.canvas)}getCanvas(){return this.canvas}getGroup(){return this.group}setOpacity(t){this.group.set({opacity:t})}setPointerEvents(t){this.canvas.set({pointerEvents:t})}resetLastPoint(){this.lastPoint=null}draw(t,e,i,n,r,o){const{context:s}=this.canvas;if(s.save(),s.fillStyle=n,s.globalAlpha=1,this.lastPoint){const n=t-this.lastPoint.x,r=e-this.lastPoint.y,a=Math.sqrt(n*n+r*r);if(a>o){const t=Math.ceil(a/(i/2));for(let e=1;e<=t;e++){const o=e/t,a=this.lastPoint.x+n*o,l=this.lastPoint.y+r*o;s.beginPath(),s.arc(a,l,i/2,0,2*Math.PI),s.fill()}}}s.beginPath(),s.arc(t,e,i/2,0,2*Math.PI),s.fill(),s.restore(),this.lastPoint={x:t,y:e}}erase(t,e,i,n){const{context:r}=this.canvas;if(r.save(),r.globalCompositeOperation="destination-out",this.lastPoint){const o=t-this.lastPoint.x,s=e-this.lastPoint.y,a=Math.sqrt(o*o+s*s);if(a>n){const t=Math.ceil(a/(i/2));for(let e=1;e<=t;e++){const n=e/t,a=this.lastPoint.x+o*n,l=this.lastPoint.y+s*n;r.beginPath(),r.arc(a,l,i/2,0,2*Math.PI),r.fill()}}}r.beginPath(),r.arc(t,e,i/2,0,2*Math.PI),r.fill(),r.restore(),this.lastPoint={x:t,y:e}}clear(){const{context:t}=this.canvas;t.clearRect(0,0,this.width,this.height),this.resetLastPoint(),this.canvas.paint(),this.group.set({dirty:!0})}getImageData(){return this.canvas.context.canvas.toDataURL("image/png")}restoreImageData(t,e){const i=new Image;i.onload=()=>{const{context:t}=this.canvas;t.clearRect(0,0,this.width,this.height),t.drawImage(i,0,0),this.canvas.paint(),this.group.set({dirty:!0}),e&&e()},i.src=t}hasContent(){if(0===this.width||0===this.height)return!1;const t=this.canvas.context.getImageData(0,0,this.width,this.height).data;for(let e=3;e<t.length;e+=4)if(t[e]>0)return!0;return!1}},lk="bottom",hk="right",ck="left",dk=["top",lk,hk,ck],uk="start",pk="popper",fk=dk.reduce(function(t,e){return t.concat([e+"-"+uk,e+"-end"])},[]),gk=[].concat(dk,["auto"]).reduce(function(t,e){return t.concat([e,e+"-"+uk,e+"-end"])},[]),vk=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function _k(t){return t?(t.nodeName||"").toLowerCase():null}function mk(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function yk(t){return t instanceof mk(t).Element||t instanceof Element}function xk(t){return t instanceof mk(t).HTMLElement||t instanceof HTMLElement}function wk(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mk(t).ShadowRoot||t instanceof ShadowRoot)}var bk={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];xk(r)&&_k(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});xk(n)&&_k(n)&&(Object.assign(n.style,o),Object.keys(r).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function Sk(t){return t.split("-")[0]}var kk=Math.max,Ek=Math.min,Ck=Math.round;function Ok(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Lk(){return!/^((?!chrome|android).)*safari/i.test(Ok())}function Pk(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,o=1;e&&xk(t)&&(r=t.offsetWidth>0&&Ck(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Ck(n.height)/t.offsetHeight||1);var s=(yk(t)?mk(t):window).visualViewport,a=!Lk()&&i,l=(n.left+(a&&s?s.offsetLeft:0))/r,h=(n.top+(a&&s?s.offsetTop:0))/o,c=n.width/r,d=n.height/o;return{width:c,height:d,top:h,right:l+c,bottom:h+d,left:l,x:l,y:h}}function Tk(t){var e=Pk(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Bk(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&wk(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Rk(t){return mk(t).getComputedStyle(t)}function Ak(t){return["table","td","th"].indexOf(_k(t))>=0}function Dk(t){return((yk(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mk(t){return"html"===_k(t)?t:t.assignedSlot||t.parentNode||(wk(t)?t.host:null)||Dk(t)}function Ik(t){return xk(t)&&"fixed"!==Rk(t).position?t.offsetParent:null}function Fk(t){for(var e=mk(t),i=Ik(t);i&&Ak(i)&&"static"===Rk(i).position;)i=Ik(i);return i&&("html"===_k(i)||"body"===_k(i)&&"static"===Rk(i).position)?e:i||function(t){var e=/firefox/i.test(Ok());if(/Trident/i.test(Ok())&&xk(t)&&"fixed"===Rk(t).position)return null;var i=Mk(t);for(wk(i)&&(i=i.host);xk(i)&&["html","body"].indexOf(_k(i))<0;){var n=Rk(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Wk(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function zk(t,e,i){return kk(t,Ek(e,i))}function Nk(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function jk(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}var Vk={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,s=i.modifiersData.popperOffsets,a=Sk(i.placement),l=Wk(a),h=["left","right"].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(t,e){return Nk("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:jk(t,dk))}(r.padding,i),d=Tk(o),u="y"===l?"top":ck,p="y"===l?lk:hk,f=i.rects.reference[h]+i.rects.reference[l]-s[l]-i.rects.popper[h],g=s[l]-i.rects.reference[l],v=Fk(o),_=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,m=f/2-g/2,y=c[u],x=_-d[h]-c[p],w=_/2-d[h]/2+m,b=zk(y,w,x),S=l;i.modifiersData[n]=((e={})[S]=b,e.centerOffset=b-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Bk(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Hk(t){return t.split("-")[1]}var Uk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Yk(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,h=t.adaptive,c=t.roundOffsets,d=t.isFixed,u=s.x,p=void 0===u?0:u,f=s.y,g=void 0===f?0:f,v="function"==typeof c?c({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var _=s.hasOwnProperty("x"),m=s.hasOwnProperty("y"),y=ck,x="top",w=window;if(h){var b=Fk(i),S="clientHeight",k="clientWidth";if(b===mk(i)&&"static"!==Rk(b=Dk(i)).position&&"absolute"===a&&(S="scrollHeight",k="scrollWidth"),"top"===r||("left"===r||"right"===r)&&"end"===o)x=lk,g-=(d&&b===w&&w.visualViewport?w.visualViewport.height:b[S])-n.height,g*=l?1:-1;if("left"===r||("top"===r||"bottom"===r)&&"end"===o)y=hk,p-=(d&&b===w&&w.visualViewport?w.visualViewport.width:b[k])-n.width,p*=l?1:-1}var E,C=Object.assign({position:a},h&&Uk),O=!0===c?function(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Ck(i*r)/r||0,y:Ck(n*r)/r||0}}({x:p,y:g},mk(i)):{x:p,y:g};return p=O.x,g=O.y,l?Object.assign({},C,((E={})[x]=m?"0":"",E[y]=_?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",E)):Object.assign({},C,((e={})[x]=m?g+"px":"",e[y]=_?p+"px":"",e.transform="",e))}var Xk={passive:!0};var Gk={left:"right",right:"left",bottom:"top",top:"bottom"};function Kk(t){return t.replace(/left|right|bottom|top/g,function(t){return Gk[t]})}var $k={start:"end",end:"start"};function Zk(t){return t.replace(/start|end/g,function(t){return $k[t]})}function qk(t){var e=mk(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Jk(t){return Pk(Dk(t)).left+qk(t).scrollLeft}function Qk(t){var e=Rk(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function tE(t){return["html","body","#document"].indexOf(_k(t))>=0?t.ownerDocument.body:xk(t)&&Qk(t)?t:tE(Mk(t))}function eE(t,e){var i;void 0===e&&(e=[]);var n=tE(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=mk(n),s=r?[o].concat(o.visualViewport||[],Qk(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(eE(Mk(s)))}function iE(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function nE(t,e,i){return"viewport"===e?iE(function(t,e){var i=mk(t),n=Dk(t),r=i.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var h=Lk();(h||!h&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Jk(t),y:l}}(t,i)):yk(e)?function(t,e){var i=Pk(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):iE(function(t){var e,i=Dk(t),n=qk(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=kk(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=kk(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+Jk(t),l=-n.scrollTop;return"rtl"===Rk(r||i).direction&&(a+=kk(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Dk(t)))}function rE(t,e,i,n){var r="clippingParents"===e?function(t){var e=eE(Mk(t)),i=["absolute","fixed"].indexOf(Rk(t).position)>=0&&xk(t)?Fk(t):t;return yk(i)?e.filter(function(t){return yk(t)&&Bk(t,i)&&"body"!==_k(t)}):[]}(t):[].concat(e),o=[].concat(r,[i]),s=o[0],a=o.reduce(function(e,i){var r=nE(t,i,n);return e.top=kk(r.top,e.top),e.right=Ek(r.right,e.right),e.bottom=Ek(r.bottom,e.bottom),e.left=kk(r.left,e.left),e},nE(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function oE(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?Sk(r):null,s=r?Hk(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case"top":e={x:a,y:i.y-n.height};break;case lk:e={x:a,y:i.y+i.height};break;case hk:e={x:i.x+i.width,y:l};break;case ck:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var h=o?Wk(o):null;if(null!=h){var c="y"===h?"height":"width";switch(s){case uk:e[h]=e[h]-(i[c]/2-n[c]/2);break;case"end":e[h]=e[h]+(i[c]/2-n[c]/2)}}return e}function sE(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.strategy,s=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,h=i.rootBoundary,c=void 0===h?"viewport":h,d=i.elementContext,u=void 0===d?pk:d,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,v=void 0===g?0:g,_=Nk("number"!=typeof v?v:jk(v,dk)),m="popper"===u?"reference":pk,y=t.rects.popper,x=t.elements[f?m:u],w=rE(yk(x)?x:x.contextElement||Dk(t.elements.popper),l,c,s),b=Pk(t.elements.reference),S=oE({reference:b,element:y,strategy:"absolute",placement:r}),k=iE(Object.assign({},y,S)),E="popper"===u?k:b,C={top:w.top-E.top+_.top,bottom:E.bottom-w.bottom+_.bottom,left:w.left-E.left+_.left,right:E.right-w.right+_.right},O=t.modifiersData.offset;if("popper"===u&&O){var L=O[r];Object.keys(C).forEach(function(t){var e=["right","bottom"].indexOf(t)>=0?1:-1,i=["top","bottom"].indexOf(t)>=0?"y":"x";C[t]+=L[i]*e})}return C}function aE(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,h=void 0===l?gk:l,c=Hk(n),d=c?a?fk:fk.filter(function(t){return Hk(t)===c}):dk,u=d.filter(function(t){return h.indexOf(t)>=0});0===u.length&&(u=d);var p=u.reduce(function(e,i){return e[i]=sE(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[Sk(i)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}var lE={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,h=i.padding,c=i.boundary,d=i.rootBoundary,u=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,v=e.options.placement,_=Sk(v)===v,m=l||(_||!f?[Kk(v)]:function(t){if("auto"===Sk(t))return[];var e=Kk(t);return[Zk(t),e,Zk(e)]}(v)),y=[v].concat(m).reduce(function(t,i){return t.concat("auto"===Sk(i)?aE(e,{placement:i,boundary:c,rootBoundary:d,padding:h,flipVariations:f,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,w=e.rects.popper,b=new Map,S=!0,k=y[0],E=0;E<y.length;E++){var C=y[E],O=Sk(C),L=Hk(C)===uk,P=["top",lk].indexOf(O)>=0,T=P?"width":"height",B=sE(e,{placement:C,boundary:c,rootBoundary:d,altBoundary:u,padding:h}),R=P?L?hk:ck:L?lk:"top";x[T]>w[T]&&(R=Kk(R));var A=Kk(R),D=[];if(o&&D.push(B[O]<=0),a&&D.push(B[R]<=0,B[A]<=0),D.every(function(t){return t})){k=C,S=!1;break}b.set(C,D)}if(S)for(var M=function(t){var e=y.find(function(e){var i=b.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return k=e,"break"},I=f?3:1;I>0&&"break"!==M(I);I--);e.placement!==k&&(e.modifiersData[n]._skip=!0,e.placement=k,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function hE(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function cE(t){return["top",hk,lk,ck].some(function(e){return t[e]>=0})}var dE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,s=gk.reduce(function(t,i){return t[i]=function(t,e,i){var n=Sk(t),r=["left","top"].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,["left","right"].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}(i,e.rects,o),t},{}),a=s[e.placement],l=a.x,h=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=h),e.modifiersData[n]=s}};var uE={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,h=i.rootBoundary,c=i.altBoundary,d=i.padding,u=i.tether,p=void 0===u||u,f=i.tetherOffset,g=void 0===f?0:f,v=sE(e,{boundary:l,rootBoundary:h,padding:d,altBoundary:c}),_=Sk(e.placement),m=Hk(e.placement),y=!m,x=Wk(_),w="x"===x?"y":"x",b=e.modifiersData.popperOffsets,S=e.rects.reference,k=e.rects.popper,E="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(b){if(o){var P,T="y"===x?"top":ck,B="y"===x?lk:hk,R="y"===x?"height":"width",A=b[x],D=A+v[T],M=A-v[B],I=p?-k[R]/2:0,F="start"===m?S[R]:k[R],W="start"===m?-k[R]:-S[R],z=e.elements.arrow,N=p&&z?Tk(z):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=j[T],H=j[B],U=zk(0,S[R],N[R]),Y=y?S[R]/2-I-U-V-C.mainAxis:F-U-V-C.mainAxis,X=y?-S[R]/2+I+U+H+C.mainAxis:W+U+H+C.mainAxis,G=e.elements.arrow&&Fk(e.elements.arrow),K=G?"y"===x?G.clientTop||0:G.clientLeft||0:0,$=null!=(P=null==O?void 0:O[x])?P:0,Z=A+X-$,q=zk(p?Ek(D,A+Y-$-K):D,A,p?kk(M,Z):M);b[x]=q,L[x]=q-A}if(a){var J,Q="x"===x?"top":ck,tt="x"===x?lk:hk,et=b[w],it="y"===w?"height":"width",nt=et+v[Q],rt=et-v[tt],ot=-1!==["top",ck].indexOf(_),st=null!=(J=null==O?void 0:O[w])?J:0,at=ot?nt:et-S[it]-k[it]-st+C.altAxis,lt=ot?et+S[it]+k[it]-st-C.altAxis:rt,ht=p&&ot?function(t,e,i){var n=zk(t,e,i);return n>i?i:n}(at,et,lt):zk(p?at:nt,et,p?lt:rt);b[w]=ht,L[w]=ht-et}e.modifiersData[n]=L}},requiresIfExists:["offset"]};function pE(t,e,i){void 0===i&&(i=!1);var n,r,o=xk(e),s=xk(e)&&function(t){var e=t.getBoundingClientRect(),i=Ck(e.width)/t.offsetWidth||1,n=Ck(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=Dk(e),l=Pk(t,s,i),h={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!i)&&(("body"!==_k(e)||Qk(a))&&(h=(n=e)!==mk(n)&&xk(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:qk(n)),xk(e)?((c=Pk(e,!0)).x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=Jk(a))),{x:l.left+h.scrollLeft-c.x,y:l.top+h.scrollTop-c.y,width:l.width,height:l.height}}function fE(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||r(t)}),n}function gE(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}var vE={placement:"bottom",modifiers:[],strategy:"absolute"};function _E(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function mE(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?vE:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},vE,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(i){var a="function"==typeof i?i(r.options):i;h(),r.options=Object.assign({},o,r.options,a),r.scrollParents={reference:yk(t)?eE(t):t.contextElement?eE(t.contextElement):[],popper:eE(e)};var c,d,u=function(t){var e=fE(t);return vk.reduce(function(t,i){return t.concat(e.filter(function(t){return t.phase===i}))},[])}((c=[].concat(n,r.options.modifiers),d=c.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),Object.keys(d).map(function(t){return d[t]})));return r.orderedModifiers=u.filter(function(t){return t.enabled}),r.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,o=t.effect;if("function"==typeof o){var a=o({state:r,name:e,instance:l,options:n});s.push(a||function(){})}}),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(_E(e,i)){r.rects={reference:pE(e,Fk(i),"fixed"===r.options.strategy),popper:Tk(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(t){return r.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var o=r.orderedModifiers[n],s=o.fn,h=o.options,c=void 0===h?{}:h,d=o.name;"function"==typeof s&&(r=s({state:r,options:c,name:d,instance:l})||r)}else r.reset=!1,n=-1}}},update:gE(function(){return new Promise(function(t){l.forceUpdate(),t(r)})}),destroy:function(){h(),a=!0}};if(!_E(t,e))return l;function h(){s.forEach(function(t){return t()}),s=[]}return l.setOptions(i).then(function(t){!a&&i.onFirstUpdate&&i.onFirstUpdate(t)}),l}}var yE=mE({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=mk(e.elements.popper),h=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&h.forEach(function(t){t.addEventListener("scroll",i.update,Xk)}),a&&l.addEventListener("resize",i.update,Xk),function(){o&&h.forEach(function(t){t.removeEventListener("scroll",i.update,Xk)}),a&&l.removeEventListener("resize",i.update,Xk)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=oE({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,h={placement:Sk(e.placement),variation:Hk(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Yk(Object.assign({},h,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Yk(Object.assign({},h,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},bk,dE,lE,uE,Vk,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=sE(e,{elementContext:"reference"}),a=sE(e,{altBoundary:!0}),l=hE(s,n),h=hE(a,r,o),c=cE(l),d=cE(h);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:h,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]});function xE(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function wE(t,e){if(t){if("string"==typeof t)return xE(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?xE(t,e):void 0}}function bE(t){return function(t){if(Array.isArray(t))return xE(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||wE(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SE(t){return SE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},SE(t)}function kE(t,e,i,n,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(n,r)}function EE(t){return function(){var e=this,i=arguments;return new Promise(function(n,r){var o=t.apply(e,i);function s(t){kE(o,n,r,s,a,"next",t)}function a(t){kE(o,n,r,s,a,"throw",t)}s(void 0)})}}var CE={exports:{}},OE={exports:{}};(function(t){function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(OE),function(t){var e=OE.exports.default;function i(){t.exports=i=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var n,r={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},h=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(n){u=function(t,e,i){return t[e]=i}}function p(t,e,i,n){var r=e&&e.prototype instanceof x?e:x,o=Object.create(r.prototype);return a(o,"_invoke",{value:P(t,i,new A(n||[]))}),o}function f(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var g="suspendedStart",v="suspendedYield",_="executing",m="completed",y={};function x(){}function w(){}function b(){}var S={};u(S,h,function(){return this});var k=Object.getPrototypeOf,E=k&&k(k(D([])));E&&E!==o&&s.call(E,h)&&(S=E);var C=b.prototype=x.prototype=Object.create(S);function O(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function L(t,i){function n(r,o,a,l){var h=f(t[r],t,o);if("throw"!==h.type){var c=h.arg,d=c.value;return d&&"object"==e(d)&&s.call(d,"__await")?i.resolve(d.__await).then(function(t){n("next",t,a,l)},function(t){n("throw",t,a,l)}):i.resolve(d).then(function(t){c.value=t,a(c)},function(t){return n("throw",t,a,l)})}l(h.arg)}var r;a(this,"_invoke",{value:function(t,e){function o(){return new i(function(i,r){n(t,e,i,r)})}return r=r?r.then(o,o):o()}})}function P(t,e,i){var r=g;return function(o,s){if(r===_)throw Error("Generator is already running");if(r===m){if("throw"===o)throw s;return{value:n,done:!0}}for(i.method=o,i.arg=s;;){var a=i.delegate;if(a){var l=T(a,i);if(l){if(l===y)continue;return l}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===g)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=_;var h=f(t,e,i);if("normal"===h.type){if(r=i.done?m:v,h.arg===y)continue;return{value:h.arg,done:i.done}}"throw"===h.type&&(r=m,i.method="throw",i.arg=h.arg)}}}function T(t,e){var i=e.method,r=t.iterator[i];if(r===n)return e.delegate=null,"throw"===i&&t.iterator.return&&(e.method="return",e.arg=n,T(t,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var s=o.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,y):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function D(t){if(t||""===t){var i=t[h];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=b,a(C,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=u(b,d,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,d,"GeneratorFunction")),t.prototype=Object.create(C),t},r.awrap=function(t){return{__await:t}},O(L.prototype),u(L.prototype,c,function(){return this}),r.AsyncIterator=L,r.async=function(t,e,i,n,o){void 0===o&&(o=Promise);var s=new L(p(t,e,i,n),o);return r.isGeneratorFunction(e)?s:s.next().then(function(t){return t.done?t.value:s.next()})},O(C),u(C,d,"Generator"),u(C,h,function(){return this}),u(C,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=D,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,r){return a.type="throw",a.arg=t,e.next=i,r&&(e.method="next",e.arg=n),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=s.call(o,"catchLoc"),h=s.call(o,"finallyLoc");if(l&&h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),R(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;R(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:D(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=n),y}},r}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}(CE);var LE=CE.exports(),PE=LE;try{regeneratorRuntime=LE}catch(SS){"object"==typeof globalThis?globalThis.regeneratorRuntime=LE:Function("r","regeneratorRuntime = r")(LE)}function TE(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,h=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){h=!0,r=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(h)throw r}}return a}}(t,e)||wE(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BE(t,e,i){return(e=function(t){var e=function(t){if("object"!=SE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=SE(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==SE(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var RE=Ri({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(t,e){var i=e.emit;return{saturationStyle:Zr(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),background:"hsl(".concat(t.hue,", 100%, 50%)")}}),sliderStyle:Zr(function(){return{top:"".concat((100-t.value)/100*t.size-5,"px"),left:"".concat(t.saturation*t.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(e){var n=e.target.getBoundingClientRect(),r=n.left,o=n.top,s=function(e){var n,s;e instanceof MouseEvent?(n=e.clientX,s=e.clientY):e instanceof TouchEvent&&(n=e.touches[0].clientX,s=e.touches[0].clientY);var a=n-r,l=s-o;a<0&&(a=0),l<0&&(l=0),a>t.size&&(a=t.size),l>t.size&&(l=t.size),i("change",a/t.size*100,100-l/t.size*100)};s(e);var a=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a)};s(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a))}}}});function AE(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}AE(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),RE.render=function(t,e,i,n,r,o){return fr(),mr("div",{class:"saturation",style:W(t.saturationStyle),onMousedown:e[0]||(e[0]=es(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=es(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[e[2]||(e[2]=kr("div",{class:"saturation-white"},null,-1)),e[3]||(e[3]=kr("div",{class:"saturation-black"},null,-1)),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],36)},RE.__scopeId="data-v-24517fec",RE.__file="src/picker/Saturation.vue";var DE=Ri({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(t,e){var i=e.emit,n=Zr(function(){return{top:"".concat((1-t.hue/360)*t.height-2,"px"),height:"".concat(4,"px")}}),r=xe();return Gi(function(){!function(){if(r.value){r.value.width=t.width,r.value.height=t.height;var e=r.value.getContext("2d");if(e){var i=e.createLinearGradient(0,0,0,t.height);i.addColorStop(0,"#FF0000"),i.addColorStop(.17,"#FF00FF"),i.addColorStop(.34,"#0000FF"),i.addColorStop(.51,"#00FFFF"),i.addColorStop(.68,"#00FF00"),i.addColorStop(.17*5,"#FFFF00"),i.addColorStop(1,"#FF0000"),e.fillStyle=i,e.fillRect(0,0,t.width,t.height)}}}()}),{canvas:r,sliderStyle:n,onSelect:function(e){var n=e.target.getBoundingClientRect().top,r=function(e){var r;e instanceof MouseEvent?r=e.clientY:e instanceof TouchEvent&&(r=e.touches[0].clientY);var o=r-n;o<0&&(o=0),o>t.height&&(o=t.height),i("change",360*(-100*o/t.height+100)/100)},o=function(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o)};r(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",o))}}}}),ME={ref:"canvas"};AE(".hue[data-v-78b9f4f0]{position:relative;touch-action:none}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),DE.render=function(t,e,i,n,r,o){return fr(),mr("div",{class:"hue",onMousedown:e[0]||(e[0]=es(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=es(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[kr("canvas",ME,null,512),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],32)},DE.__scopeId="data-v-78b9f4f0",DE.__file="src/picker/Hue.vue";var IE=Ri({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(t,e){var i=e.emit,n=Zr(function(){return{top:"".concat(t.alpha*t.height-2,"px"),height:"".concat(4,"px")}}),r=xe(),o=function(){var e=r.value.getContext("2d");r.value.width=t.width,r.value.height=t.height;var i=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=10,t.height=10,e.fillStyle="#ffffff",e.fillRect(0,0,10,10),e.fillStyle="#ccd5db",e.fillRect(0,0,5,5),e.fillRect(5,5,5,5),t}();e.fillStyle=e.createPattern(i,"repeat"),e.fillRect(0,0,t.width,t.height);var n=e.createLinearGradient(0,0,0,t.height);n.addColorStop(.01,"rgba(255,255,255,0)"),n.addColorStop(.99,t.color),e.fillStyle=n,e.fillRect(0,0,t.width,t.height)};return ni(function(){return t.color},function(){o()}),Gi(function(){o()}),{canvas:r,sliderStyle:n,onSelect:function(e){var n=e.target.getBoundingClientRect().top,r=function(e){var r;e instanceof MouseEvent?r=e.clientY:e instanceof TouchEvent&&(r=e.touches[0].clientY);var o=r-n;o<0&&(o=0),o>t.height&&(o=t.height),i("change",parseFloat((o/t.height).toFixed(2)))},o=function(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o)};r(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",o))}}}}),FE={ref:"canvas"};AE(".alpha[data-v-24dc9656]{position:relative;touch-action:none}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),IE.render=function(t,e,i,n,r,o){return fr(),mr("div",{class:"alpha",onMousedown:e[0]||(e[0]=es(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=es(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[kr("canvas",FE,null,512),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],32)},IE.__scopeId="data-v-24dc9656",IE.__file="src/picker/Alpha.vue";var WE={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},zE={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},NE={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function jE(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function VE(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?jE(Object(i),!0).forEach(function(e){BE(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):jE(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var HE=null,UE=function(t,e,i){var n=xe({}),r=i||{},o=r.placement,s=r.defaultStyle,a={strategy:r.strategy||"absolute",placement:o||"auto",onFirstUpdate:function(){HE.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(t){var e=t.state,i=e.styles,r=e.placement,o=i.popper;n.value=VE(VE(VE({},o),s),{},{transformOrigin:"top"===r?"center bottom":"center top"})}}]};return ni(function(){return[be(t),be(e)]},function(t,e){var i,n=TE(t,2),r=n[0],o=n[1],s=TE(e,2),l=s[0],h=s[1];if(r&&o&&(l!==r||h!==l)){null===(i=HE)||void 0===i||i.destroy();var c=r.$el||r,d=o.$el||o;je(function(){HE=yE(c,d,a)})}}),Zi(function(){var t;HE&&(null===(t=HE)||void 0===t||t.destroy(),HE=null)}),{instance:HE,style:n}},YE=Ri({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(t,e){var i=e.emit,n=xe(null),r=xe(null),o=xe(!1),s=UE(n,r,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,a=Zr(function(){return Array.isArray(t.options)&&t.options.length>1}),l=Zr(function(){var e=t.options,i=t.showAlpha,n=t.value;return Array.isArray(e)?i?e.map(function(t){return WE[t]}).filter(function(t){return!t.includes(n)}):e.map(function(t){return zE[t]}).filter(function(t){return!t.includes(n)}):[]}),h=function(t){var e,i,r=t.target;(null===(e=be(n))||void 0===e||!e.isEqualNode(r))&&null!==(i=be(n))&&void 0!==i&&i.contains(r)||(o.value=!1)};return Gi(function(){document.addEventListener("mouseup",h,!1)}),qi(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:r,selectorStyle:s,isShowSelector:o,isNeedSelect:a,formatOptions:l,onShow:function(){a.value&&(o.value=!0)},onFormatChange:function(t){i("change",NE[t])}}}}),XE={class:"format"},GE={key:0,class:"arrow"},KE=["onClick"];AE(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),YE.render=function(t,e,i,n,r,o){return fr(),mr("div",XE,[kr("div",{class:"label",ref:"targetRef",onClick:e[0]||(e[0]=function(){return t.onShow&&t.onShow.apply(t,arguments)})},[kr("span",null,J(t.value),1),t.isNeedSelect?(fr(),mr("div",GE)):Pr("v-if",!0)],512),Er(co,null,{default:qe(function(){return[t.isShowSelector?(fr(),mr("div",{key:0,class:"selector",ref:"selectorRef",style:W(t.selectorStyle)},[(fr(!0),mr(lr,null,an(t.formatOptions,function(e){return fr(),mr("div",{class:"selector-item",key:e,onClick:function(i){return t.onFormatChange(e)}},J(e),9,KE)}),128))],4)):Pr("v-if",!0)]}),_:1})])},YE.__scopeId="data-v-5f6e8f5e",YE.__file="src/picker/input-value/FormatValue.vue";var $E=Ri({name:"Input",components:{FormatValue:YE},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(t,e){var i=e.emit;return{onInput:function(t){var e;i("change",null===(e=t.target)||void 0===e?void 0:e.value)},valueStyle:Zr(function(){return{minWidth:"".concat(t.width,"px"),maxWidth:"".concat(t.width,"px"),width:"".concat(t.width,"px")}}),onFocus:function(){i("focus")},onBlur:function(){i("blur")},onEnter:function(){i("enter")},onFormatChange:function(t){i("formatChange",t)}}}}),ZE={class:"input"},qE=[".value"];function JE(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function QE(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?JE(Object(i),!0).forEach(function(e){BE(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):JE(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}AE(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),$E.render=function(t,e,i,n,r,o){var s=rn("FormatValue");return fr(),mr("div",ZE,[Er(s,{value:t.format,showAlpha:t.showAlpha,options:t.formatOptions,onChange:t.onFormatChange},null,8,["value","showAlpha","options","onChange"]),kr("input",{class:"value",style:W(t.valueStyle),".value":t.value,onFocus:e[0]||(e[0]=function(){return t.onFocus&&t.onFocus.apply(t,arguments)}),onInput:e[1]||(e[1]=function(){return t.onInput&&t.onInput.apply(t,arguments)}),onBlur:e[2]||(e[2]=function(){return t.onBlur&&t.onBlur.apply(t,arguments)}),onKeydown:e[3]||(e[3]=ns(function(){return t.onEnter&&t.onEnter.apply(t,arguments)},["enter"]))},null,44,qE)])},$E.__scopeId="data-v-2c454c00",$E.__file="src/picker/input-value/InputValue.vue";var tC=function(t,e,i){return[t,e*i/((t=(2-e)*i)<1?t:2-t)||0,t/2]},eC={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},iC=function(t){t=Math.min(Math.round(t),255);var e=Math.floor(t/16),i=t%16;return"".concat(eC[e]||e).concat(eC[i]||i)},nC=function(t){var e=t.r,i=t.g,n=t.b;return isNaN(e)||isNaN(i)||isNaN(n)?"":"#".concat(iC(e)).concat(iC(i)).concat(iC(n))},rC=function(t,e){var i;"string"==typeof(i=t)&&-1!==i.indexOf(".")&&1===parseFloat(i)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat("".concat(t)))),n&&(t=parseInt("".concat(t*e),10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)},oC=function(t,e,i){t=6*rC(t,360),e=rC(e,100),i=rC(i,100);var n=Math.floor(t),r=t-n,o=i*(1-e),s=i*(1-r*e),a=i*(1-(1-r)*e),l=n%6,h=[i,s,o,o,a,i][l],c=[a,i,i,s,o,o][l],d=[o,o,a,i,i,s][l];return{r:Math.round(255*h),g:Math.round(255*c),b:Math.round(255*d)}},sC=function(t,e,i){var n,r,o=t.h,s=t.s,a=t.v,l=t.a;if(i)switch(["hsl","hsv","rga"].includes(e)&&(l=(r=(n=l).toString().match(/\.(\d{1,2})(\d*)/))&&r[2].length>0?parseFloat(n.toFixed(2)):n),e){case"hsl":var h=tC(o,s/100,a/100);return"hsla(".concat(o.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(l,")");case"hsv":return"hsva(".concat(o.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(a),"%, ").concat(l,")");case"rgb":var c=oC(o,s,a),d=c.r,u=c.g,p=c.b;return"rgba(".concat(d,", ").concat(u,", ").concat(p,", ").concat(l,")");default:return"".concat(nC(oC(o,s,a))).concat(iC(255*l))}else switch(e){case"hsl":var f=tC(o,s/100,a/100);return"hsl(".concat(o.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(o.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(a),"%)");case"rgb":var g=oC(o,s,a),v=g.r,_=g.g,m=g.b;return"rgb(".concat(v,", ").concat(_,", ").concat(m,")");default:return nC(oC(o,s,a))}},aC=function(t){var e=t.r,i=t.g,n=t.b;e=rC(e,255),i=rC(i,255),n=rC(n,255);var r,o=Math.max(e,i,n),s=Math.min(e,i,n),a=o,l=o-s,h=0===o?0:l/o;if(o===s)r=0;else{switch(o){case e:r=(i-n)/l+(i<n?6:0);break;case i:r=(n-e)/l+2;break;case n:r=(e-i)/l+4}r/=6}return{h:360*r,s:100*h,v:100*a}},lC=function(t){var e=t.h,i=t.s,n=t.l;n/=100;var r=i/=100,o=Math.max(n,.01);return i*=(n*=2)<=1?n:2-n,r*=o<=1?o:2-o,{h:+e,s:100*(0===n?2*r/(o+r):2*i/(n+i)),v:(n+i)/2*100}},hC=function(t){var e=[];if(t.match(/^#([0-9a-fA-f]{3,4})$/g))for(var i=1;i<t.length;i++)e.push(parseInt("0x"+t[i].repeat(2)));else if(t.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<t.length;n+=2)e.push(parseInt("0x"+t.slice(n,n+2)));return{r:e[0],g:e[1],b:e[2],a:e[3]}},cC=function(t,e,i){if("string"==typeof t&&""!==t){var n=vC(fC(t,gC(t),i));return null==n?"":sC(n,e,i)}return""},dC=function(t){var e=TE(t.match(/(\d(\.\d+)?)+/g),4);return{r:e[0],g:e[1],b:e[2],a:e[3]}},uC=function(t){var e=TE(t.match(/(\d(\.\d+)?)+/g),4),i=e[0],n=e[1],r=e[2],o=e[3];return{h:i,s:parseFloat(n),l:parseFloat(r),a:o}},pC=function(t){var e=TE(t.match(/(\d(\.\d+)?)+/g),4),i=e[0],n=e[1],r=e[2],o=e[3];return{h:parseFloat(i),s:parseFloat(n),v:parseFloat(r),a:parseFloat(o)}},fC=function(t,e){if(arguments.length>2&&void 0!==arguments[2]&&!arguments[2])switch(e){case"rgb":return QE(QE({},aC(dC(t))),{},{a:1});case"hsv":var i=pC(t);return{h:i.h,s:i.s,v:i.v,a:1};case"hsl":return QE(QE({},lC(uC(t))),{},{a:1});default:return QE(QE({},aC(hC(t))),{},{a:1})}else switch(e){case"rgb":var n=dC(t),r=n.r,o=n.g,s=n.b,a=n.a;return QE(QE({},aC({r:r,g:o,b:s})),{},{a:+a});case"hsv":var l=pC(t);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var h=uC(t),c=h.h,d=h.s,u=h.l,p=h.a;return QE(QE({},lC({h:c,s:d,l:u})),{},{a:+p});default:var f=hC(t),g=f.r,v=f.g,_=f.b,m=f.a;return QE(QE({},aC({r:g,g:v,b:_})),{},{a:m/255})}},gC=function(t){return t.match(/^#/)?"hex":t.match(/^rgb/)?"rgb":t.match(/^hsl/)?"hsl":t.match(/^hsv/)?"hsv":"hex"},vC=function(t){var e=t.h,i=t.s,n=t.v,r=t.a;return isNaN(e)&&isNaN(i)&&isNaN(n)?null:(isNaN(e)&&(e=0),isNaN(i)&&(i=0),isNaN(n)&&(n=0),isNaN(r)&&(r=1),{h:e,s:i,v:n,a:r})},_C=Ri({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(t){var e=xe(),i=ei("theme",{theme:"light"}).theme,n=Zr(function(){return parseFloat((t.width||t.size)+"")}),r=Zr(function(){return parseFloat((t.height||t.size)+"")}),o=Zr(function(){return{width:"".concat(be(n),"px"),height:"".concat(be(r),"px"),border:t.border?"1px solid ".concat("dark"===be(i)?"#434345":"#d9d9d9"):"",borderRadius:"".concat(t.borderRadius,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat("dark"===be(i)?"#2681ff":"#1890ff"):""}}),s=function(){var i=e.value.getContext("2d");e.value.width=be(n),e.value.height=be(r);var o=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=10,t.height=10,e.fillStyle="#ffffff",e.fillRect(0,0,10,10),e.fillStyle="#ccd5db",e.fillRect(0,0,5,5),e.fillRect(5,5,5,5),t}();i.fillStyle=i.createPattern(o,"repeat"),i.fillRect(0,0,be(n),be(r)),i.fillStyle=t.value,i.fillRect(0,0,be(n),be(r))};return ni(function(){return t.value},function(){s()}),Gi(function(){s()}),{canvas:e,colorItemStyle:o}}}),mC=["draggable"];AE(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),_C.render=function(t,e,i,n,r,o){return fr(),mr("canvas",{class:"color-item",style:W(t.colorItemStyle),ref:"canvas",draggable:t.draggable},null,12,mC)},_C.__scopeId="data-v-02da71fd",_C.__file="src/color-item/ColorItem.vue";var yC=Ri({name:"Colors",components:{ColorItem:_C},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(t,e){var i=e.emit;return{onSelectColor:function(t,e){i("change",t,e)},useColors:Zr(function(){return t.colors.map(function(t){return cC(t,"hex",!0)})})}}}),xC={class:"colors"};function wC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function bC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?wC(Object(i),!0).forEach(function(e){BE(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):wC(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}AE(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),yC.render=function(t,e,i,n,r,o){var s=rn("color-item");return fr(),mr("div",xC,[(fr(!0),mr(lr,null,an(t.useColors,function(e,i){return fr(),yr(s,{key:i,class:"color-item",size:16,value:e,border:!1,"border-radius":3,selected:t.selectedIndex===i,onClick:es(function(n){return t.onSelectColor(e,+i)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},yC.__scopeId="data-v-0f8b52a8",yC.__file="src/picker/Colors.vue";var SC=Ri({name:"Picker",components:{Colors:yC,Saturation:RE,Hue:DE,Alpha:IE,InputValue:$E},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(t,e){var i=e.emit,n=Zr(function(){return bC(bC({},t.style),{},{width:t.showAlpha?"230px":"205px"})}),r=xe(),o=xe(),s=xe(),a=function(){var e,i=null===(e=t.value)||void 0===e?void 0:e.trim();return null!=i&&""!==i?vC(fC(i,gC(i),t.showAlpha)):null};ni(function(){return t.value},function(){t.value!==be(s)&&(r.value=a())},{immediate:!0}),ni(function(){return[be(r),t.format]},function(e){var n=TE(e,2),r=n[0],l=n[1],h="";null!=r?(h=sC(bC({},r),t.format,t.showAlpha),o.value=bC({},r)):o.value=null,s.value=h;var c=a();JSON.stringify(r)!==JSON.stringify(c)&&JSON.stringify(r)!==JSON.stringify(l)&&i("change",h)},{immediate:!0});var l=Zr(function(){var t;return(null===(t=be(r))||void 0===t?void 0:t.h)||0}),h=Zr(function(){var t;return(null===(t=be(r))||void 0===t?void 0:t.s)||0}),c=Zr(function(){var t;return(null===(t=be(r))||void 0===t?void 0:t.v)||0}),d=Zr(function(){var t,e;return null!=(null===(t=be(r))||void 0===t?void 0:t.a)?null===(e=be(r))||void 0===e?void 0:e.a:1}),u=Zr(function(){return oC(be(l),be(h),be(c))}),p=Zr(function(){return"rgb(".concat(be(u).r,", ").concat(be(u).g,", ").concat(be(u).b,")")}),f=xe(-1);return{h:l,s:h,v:c,a:d,rgbStr:p,onSelectSaturation:function(t,e){f.value=-1,null==be(r)?r.value={h:be(l),s:t,v:e,a:be(d)}:r.value=bC(bC({},be(r)),{},{s:t,v:e})},onSelectHue:function(t){f.value=-1,be(r)??(r.value={h:t,s:be(h),v:be(c),a:be(d)}),r.value=bC(bC({},be(r)),{},{h:t})},onSelectAlpha:function(t){f.value=-1,null==be(r)?r.value={h:be(l),s:be(h),v:be(c),a:t}:r.value=bC(bC({},be(r)),{},{a:t})},handleInputFormat:function(e){return t.showAlpha?WE[e]:zE[e]},colorValue:s,pickerStyle:n,onInputChange:function(t){f.value=-1,s.value=t},handleChange:function(){var e,i=null===(e=be(s))||void 0===e?void 0:e.trim();if(""!==i){var n=t.showAlpha,a=vC(fC(i,gC(i),n));!function(t){if(!t)return!1;var e=t.h,i=t.s,n=t.v,r=t.a;return!(isNaN(e)||isNaN(i)||isNaN(n)||isNaN(r))}(a)?null!=be(o)?r.value=be(o):s.value="":r.value=a}else r.value=null},selectColorIndex:f,onSelectColor:function(t,e){if(f.value=e,""===(t=t.trim()))r.value=null;else{var i=gC(t);i?function(t,e){if(0!==t.length){var i=fC(t,e,!0),n=i.h,o=i.s,s=i.v;if(!(isNaN(n)||isNaN(o)||isNaN(s))){var a=1,l=i.a;isNaN(l)||(a=l),r.value={h:n,s:o,v:s,a:a}}}}(t,i):r.value=null}},onFormatChange:function(t){i("formatChange",t)}}}}),kC={class:"picker-inner"},EC={class:"picker-header"};AE(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),SC.render=function(t,e,i,n,r,o){var s=rn("saturation"),a=rn("hue"),l=rn("alpha"),h=rn("input-value"),c=rn("Colors");return fr(),mr("div",{class:"picker",style:W(t.pickerStyle)},[kr("div",kC,[kr("div",EC,[Er(s,{class:"saturation",hue:t.h,saturation:t.s,value:t.v,onChange:t.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),Er(a,{class:"hue",hue:t.h,onChange:t.onSelectHue},null,8,["hue","onChange"]),t.showAlpha?(fr(),yr(l,{key:0,class:"alpha",alpha:t.a,color:t.rgbStr,onChange:t.onSelectAlpha},null,8,["alpha","color","onChange"])):Pr("v-if",!0)]),Er(h,{format:t.handleInputFormat(t.format),value:t.colorValue,showAlpha:t.showAlpha,width:t.showAlpha?150:125,formatOptions:t.formatOptions,onChange:t.onInputChange,onBlur:t.handleChange,onEnter:t.handleChange,onFormatChange:t.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),t.colors.length>0?(fr(),yr(c,{key:0,class:"colors",colors:t.colors,"selected-index":t.selectColorIndex,onChange:t.onSelectColor},null,8,["colors","selected-index","onChange"])):Pr("v-if",!0)])],4)},SC.__scopeId="data-v-6ceadec6",SC.__file="src/picker/Picker.vue";var CC=Ri({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(t){var e=ei("theme",{theme:"light"}).theme;return{addColorItemStyle:Zr(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),lineHeight:"".concat(t.size,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat("dark"===be(e)?"#2681ff":"#1890ff"):""}})}}});AE(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),CC.render=function(t,e,i,n,r,o){return fr(),mr("svg",{class:"add-color-item",style:W(t.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},e[0]||(e[0]=[kr("g",{class:"container"},[kr("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},CC.__scopeId="data-v-ceb1719c",CC.__file="src/add-color-item/AddColorItem.vue";var OC=Ri({name:"ColorPicker",components:{ColorItem:_C,Picker:SC,AddColorItem:CC},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(t,e){var i=e.emit,n=xe([]),r=Zr(function(){return be(n).map(function(e){return cC(e,"hex",t.showAlpha)})}),o=xe("hex");ni(function(){return t.format},function(){o.value=t.format},{immediate:!0}),ni(function(){return t.value},function(){var e=t.value||"";n.value=(Array.isArray(e)?e:[e]).map(function(e){return cC(e,be(o),t.showAlpha)})},{immediate:!0});var s=xe(void 0),a=Zr(function(){return be(n)[be(s)]}),l=xe(!1);ni(function(){return t.showPicker},function(){l.value=t.showPicker},{immediate:!0});var h,c,d=xe(null),u=xe(null),p=UE(d,u,{defaultStyle:{zIndex:t.zIndex},strategy:t.position,placement:t.placement}).style,f=function(){be(d)??(d.value=be(k)[0]),be(s)??(s.value=0),void 0===t.showPicker?l.value=!0:i("update:showPicker",!0)},g=function(){s.value=void 0,void 0===t.showPicker?l.value=!1:i("update:showPicker",!1),i("closePicker",ve(Array.isArray(t.value)||t.addColor?be(n):be(n)[0]))},v=xe(),_=function(){var t=EE(PE.mark(function t(e){var i,n,r,o;return PE.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.target,null!=(r=null===(i=n.dataset)||void 0===i?void 0:i.index)&&""!==r){t.next=4;break}return t.abrupt("return");case 4:if(o=+r,be(s)!==o){t.next=7;break}return t.abrupt("return");case 7:null!=be(s)&&be(s)!==o?(g(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=o,d.value=n;case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=EE(PE.mark(function t(e){var i,n,r,o,s;return PE.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.target,null!==(i=be(v))&&void 0!==i&&i.isEqualNode(o)||!(null===(n=be(v))||void 0===n?void 0:n.contains(o))){t.next=4;break}return t.abrupt("return");case 4:if(!(null==(s=null===(r=be(u))||void 0===r?void 0:r.$el)?void 0:s.contains(o))){t.next=8;break}return t.abrupt("return");case 8:c&&clearTimeout(c),c=setTimeout(function(){be(l)&&g()},0);case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();ni(l,function(){be(l)&&(f(),clearTimeout(c))});var y,x=xe(t.max>be(n).length),w=Zr(function(){return"string"==typeof t.popupContainer||"object"===SE(t.popupContainer)&&null!=t.popupContainer?t.popupContainer:"body"}),b=Zr(function(){return"boolean"==typeof t.popupContainer&&!1===t.popupContainer}),S=Zr(function(){return t.theme});ni(function(){return[t.theme,be(u)]},function(){je(function(){var t,e;null===(t=be(v))||void 0===t||t.setAttribute("pick-colors-theme",be(S)),null===(e=be(u))||void 0===e||null===(e=e.$el)||void 0===e||e.setAttribute("pick-colors-theme",be(S))})},{immediate:!0}),ti("theme",{theme:S});var k=xe([]);return Gi(function(){document.addEventListener("mouseup",m,!1),t.showPicker&&f()}),qi(function(){document.removeEventListener("mouseup",m,!1),h&&(clearTimeout(h),h=null),c&&(clearTimeout(c),c=null)}),{valueList:n,colorItemSelected:function(e){return(t.addColor?be(n).length>0:be(n).length>1)&&be(s)===e},selectedColor:a,selectedIndex:s,isShowPicker:l,addColorItemShow:x,onPickerChange:function(e){var r=be(s),o=be(n).slice(),a=be(n).length;if(null!=r){r>=0?o[r]=e:(s.value=a,o.push(e));var l;l=Array.isArray(t.value)||t.addColor?o:e,n.value=Array.isArray(l)?l:[l],i("update:value",l),i("change",l,e,r),t.addColor&&a>=t.max&&(x.value=!1,i("overflowMax"))}},colorPicker:v,onColorClick:_,pickerRef:u,onColorItemDragStart:function(t){t.dataTransfer.effectAllowed="move",y=+t.target.dataset.index},onColorItemDragOver:function(t){},onColorItemDrop:function(t){var e=+t.target.dataset.index,r=bE(be(n)),o=r[y];r.splice(y,1);var s=r.slice(0,e),a=r.splice(e),l=s.concat([o]).concat(a);i("update:value",l),i("change",l,l[y],y)},colorItemsRef:k,pickerStyle:p,values:r,teleportDisabled:b,toPopupContainer:w,formatValue:o,onFormatChange:function(t){o.value=t,i("formatChange",t)}}}});AE(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),OC.render=function(t,e,i,n,r,o){var s=rn("color-item"),a=rn("add-color-item"),l=rn("picker");return fr(),mr("div",{class:"color-picker",ref:"colorPicker",onDragstart:e[0]||(e[0]=es(function(){return t.onColorItemDragStart&&t.onColorItemDragStart.apply(t,arguments)},["stop"])),onDragover:e[1]||(e[1]=es(function(){return t.onColorItemDragOver&&t.onColorItemDragOver.apply(t,arguments)},["prevent","stop"])),onDrop:e[2]||(e[2]=es(function(){return t.onColorItemDrop&&t.onColorItemDrop.apply(t,arguments)},["prevent","stop"])),onClick:e[3]||(e[3]=es(function(){return t.onColorClick&&t.onColorClick.apply(t,arguments)},["stop"]))},[(fr(!0),mr(lr,null,an(t.values,function(e,i){return fr(),yr(s,{class:"color-item",key:i,ref_for:!0,ref:function(e){return t.colorItemsRef[i]=e},size:t.size,width:t.width,height:t.height,value:e,selected:t.colorItemSelected(i),"data-index":i,draggable:t.valueList.length>1,format:t.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),t.addColor&&t.addColorItemShow?(fr(),yr(a,{key:0,class:"add-color-item",ref:"addColorItem",selected:t.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):Pr("v-if",!0),(fr(),yr(vi,{to:t.toPopupContainer,disabled:t.teleportDisabled},[Er(co,null,{default:qe(function(){return[t.isShowPicker?(fr(),yr(l,{key:0,class:"picker",style:W(t.pickerStyle),ref:"pickerRef",value:t.selectedColor,format:t.formatValue,"show-alpha":t.showAlpha,colors:t.colors,formatOptions:t.formatOptions,onChange:t.onPickerChange,onFormatChange:t.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):Pr("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},OC.__scopeId="data-v-3c43ade8",OC.__file="src/ColorPicker.vue";var LC={class:"panel-header"},PC={class:"panel-content"},TC={class:"config-item"},BC={class:"color-picker-wrapper"},RC={class:"config-item"},AC={class:"config-value"},DC={class:"config-item"},MC=["min","max"],IC={class:"config-value"},FC={class:"config-item"},WC={class:"config-value"},zC=Ri({__name:"BrushStylePanel",props:{visible:{type:Boolean},brushStyle:{},buttonRect:{}},emits:["close","update"],setup(t,{emit:e}){const i=t,n=e,r=["#FF4D4F","#FF7875","#FFA940","#FFC53D","#A0D911","#52C41A","#34D399","#10B981","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899","#000000","#666666","#999999","#CCCCCC"],o=xe(i.brushStyle.color),s=xe(i.brushStyle.opacity),a=xe(i.brushStyle.size),l=xe(i.brushStyle.continuity);ni(()=>i.brushStyle,t=>{o.value=t.color,s.value=t.opacity,a.value=t.size,l.value=t.continuity},{deep:!0,immediate:!0});ni([o,s,a,l],()=>{(()=>{let t=o.value;if(t.startsWith("rgba")){const e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);e&&(t="#"+parseInt(e[1]).toString(16).padStart(2,"0")+parseInt(e[2]).toString(16).padStart(2,"0")+parseInt(e[3]).toString(16).padStart(2,"0"))}else if(t.startsWith("rgb")){const e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);e&&(t="#"+parseInt(e[1]).toString(16).padStart(2,"0")+parseInt(e[2]).toString(16).padStart(2,"0")+parseInt(e[3]).toString(16).padStart(2,"0"))}n("update",{color:t,opacity:s.value,size:a.value,continuity:l.value})})()});const h=Zr(()=>{if(!i.buttonRect)return{left:"50%",top:"50%",transform:"translate(-50%, -50%)"};return{left:`${i.buttonRect.left+i.buttonRect.width/2}px`,bottom:`calc(100vh - ${i.buttonRect.top-10}px)`,transform:"translateX(-50%)"}});return(e,i)=>(fr(),yr(vi,{to:"body"},[t.visible?(fr(),mr("div",{key:0,class:"brush-panel-overlay",onClick:i[0]||(i[0]=t=>e.$emit("close"))})):Pr("",!0),t.visible?(fr(),mr("div",{key:1,class:"brush-style-panel",style:W(h.value),onClick:i[6]||(i[6]=es(()=>{},["stop"]))},[kr("div",LC,[i[7]||(i[7]=kr("span",null,"笔刷配置",-1)),kr("button",{class:"close-btn",onClick:i[1]||(i[1]=t=>e.$emit("close"))},"×")]),kr("div",PC,[kr("div",TC,[i[8]||(i[8]=kr("label",{class:"config-label"},"颜色: ",-1)),kr("div",BC,[Er(be(OC),{value:o.value,"onUpdate:value":i[2]||(i[2]=t=>o.value=t),"predefine-colors":r,placement:"right","z-index":2001,popupContainer:!1},null,8,["value"])])]),kr("div",RC,[i[9]||(i[9]=kr("label",{class:"config-label"},"透明度: ",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":i[3]||(i[3]=t=>s.value=t),min:"0.1",max:"1",step:"0.01"},null,512),[[Ko,s.value,void 0,{number:!0}]]),kr("span",AC,J(Math.round(100*s.value))+"%",1)]),kr("div",DC,[i[10]||(i[10]=kr("label",{class:"config-label"},"大小:",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":i[4]||(i[4]=t=>a.value=t),min:t.brushStyle.minSize,max:t.brushStyle.maxSize},null,8,MC),[[Ko,a.value,void 0,{number:!0}]]),kr("span",IC,J(a.value),1)]),kr("div",FC,[i[11]||(i[11]=kr("label",{class:"config-label"},"连续性: ",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":i[5]||(i[5]=t=>l.value=t),min:"5",max:"50"},null,512),[[Ko,l.value,void 0,{number:!0}]]),kr("span",WC,J(l.value),1)])])],4)):Pr("",!0)]))}}),NC=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},jC=NC(zC,[["__scopeId","data-v-10bc9982"]]),VC={key:0,class:"loading-overlay"},HC={key:2,class:"error-overlay"},UC={key:3,class:"zoom-controller"},YC={key:0,class:"hotkey-hint"},XC={key:0,class:"hotkey-hint"},GC={key:0,class:"hotkey-hint"},KC={key:0,class:"toolbar"},$C={key:0,class:"hotkey-hint"},ZC={key:0,class:"hotkey-hint"},qC={key:0,class:"hotkey-hint"},JC={key:0,class:"hotkey-hint"},QC={key:0,class:"hotkey-hint"},tO={key:0,class:"hotkey-hint"},eO={key:0,class:"hotkey-hint"},iO=Ri({__name:"PointAnnotation",props:{imageSource:{type:Object,required:!1,default:null},options:{type:Object,default:()=>({})}},emits:["pointChange","loadStart","loadSuccess","loadError","undoStateChange","redoStateChange"],setup(t,{expose:e,emit:i}){const n=t,r=i,o=xe(void 0),s=xe(null),a=xe("idle"),l=xe(null),h=xe(null),c=xe(!1),d=xe(""),u=xe(!1);let p=null,f=null;const g=new Ug({name:"contentLayer"}),v=new Ug({name:"pointLayer"}),_=xe({x:0,y:0}),m=xe(!1),y=xe(!1),x=xe(!1),w=xe("select"),b=xe(100),S=xe(void 0),k=xe(!1),E=xe(null),C=xe([]),O=xe(1),L=Zr(()=>"success"===a.value),P=Zr(()=>({...BS,...n.options?.pointStyle})),T=Zr(()=>({...RS,...n.options?.brushStyle})),B=xe({...RS,...n.options?.brushStyle});ni(T,t=>{B.value={...t}},{immediate:!0}),ni(()=>B.value.opacity,t=>{R&&R.setOpacity(t)}),ni(()=>n.imageSource?.url,(t,e)=>{t?(c.value=!1,d.value="",I(t)):e&&!t&&(c.value=!1,d.value="",ct(),f&&(g.clear(),f.destroy(),f=null),a.value="idle")},{immediate:!0});let R=null;const A=xe(!1);let D=null;const M=t=>{if(P.value.fixedSizeOnZoom&&t&&t.children&&t.children.length){const e=p?.tree.scaleX||1,i=P.value.fixedSizeScale||1;t.children.forEach(t=>{t.scale=i/e})}},I=async t=>{const e=t||(c.value?d.value:n.imageSource?.url||"");if(p&&e){f&&(g.clear(),f.destroy()),a.value="loading",r("loadStart"),l.value=null,h.value=null;try{const t=await(i=e,new Promise((t,e)=>{const n=new window.Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=e,n.src=i}));l.value=t.width,h.value=t.height,f=new Lv({url:e,draggable:!1,editable:!1,lazy:!0,zIndex:-1,placeholderColor:"transparent"}),f.on(Cp.LOADED,function(){a.value="success",r("loadSuccess"),U(),et()}),f.on(Cp.ERROR,function(t){a.value="error",r("loadError",t)}),g.add(f)}catch(o){a.value="error",r("loadError",o)}var i}else a.value="idle"},F=t=>{const e=t.target,i=e.files?.[0];if(i&&i.type.startsWith("image/")){const t=new FileReader;t.onload=t=>{const e=t.target?.result;d.value=e,c.value=!0,I(e)},t.readAsDataURL(i)}e.value=""},W=()=>{s.value?.click()},z=t=>{t.preventDefault(),t.stopPropagation(),u.value=!0},N=t=>{t.preventDefault(),t.stopPropagation(),u.value=!1},j=t=>{t.preventDefault(),t.stopPropagation(),u.value=!1;const e=t.dataTransfer?.files;if(e&&e.length>0){const t=e[0];if(t.type.startsWith("image/")){const e=new FileReader;e.onload=t=>{const e=t.target?.result;d.value=e,c.value=!0,I(e)},e.readAsDataURL(t)}}};Gi(()=>{je(()=>{p=new zv({view:o.value,width:o.value?.clientWidth||800,height:o.value?.clientHeight||600,fill:"#e3e3e3",zoom:{min:.2,max:4},editor:{rotateable:!1,middlePoint:{}},tree:{type:"design"}}),p?.tree.add(g),p?.tree.add(v),v.zIndex=1e4,p&&(p.on(d_.ZOOM,()=>{_t()}),p.on(n_.TAP,st),p.editor.on(Ow.SELECT,at),p.on(n_.DOWN,nt),p.on(n_.MOVE,rt),p.on(n_.UP,ot)),I(),D=new mS(100),window.addEventListener("keydown",Y),window.addEventListener("mousemove",V),window.addEventListener("focusout",X);const t=function(t,e,i){var n=void 0===i?{}:i,r=n.event,o=void 0===r?"keydown":r,s=n.capture,a=TS(e,{timeout:n.timeout});return t.addEventListener(o,a,s),function(){t.removeEventListener(o,a,s)}}(window,{v:t=>{(m.value||y.value)&&(t.preventDefault(),K())},p:t=>{(m.value||y.value)&&(t.preventDefault(),$())},b:t=>{(m.value||y.value)&&(t.preventDefault(),Z())},e:t=>{(m.value||y.value)&&(t.preventDefault(),tt())},"$mod+KeyZ":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),ut())},"$mod+KeyY":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),pt())},Delete:t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),ht())},"$mod+Equal":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),gt())},"$mod+Minus":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),ft())},"$mod+0":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),vt())},Alt:t=>{(m.value||y.value)&&(t.preventDefault(),x.value=!x.value)}});window.__pointAnnotationHotkeysUnsubscribe=t})});const V=t=>{_.value={x:t.clientX,y:t.clientY}},U=()=>{if(!(p&&f&&l.value&&h.value))return;const t=p.width,e=p.height,i=l.value,n=h.value,r=t/i,o=e/n,s=Math.min(r,o,1),a=(t-i*Number(s.toFixed(2)))/2,c=(e-n*Number(s.toFixed(2)))/2;p.tree.scale=Number(s.toFixed(2)),p.tree.x=a,p.tree.y=c,_t()},Y=t=>{if("Space"===t.code&&(()=>{if(!o.value)return!1;const t=o.value.getBoundingClientRect();return _.value.x>=t.left&&_.value.x<=t.right&&_.value.y>=t.top&&_.value.y<=t.bottom})())return t.preventDefault(),!1},X=t=>{const e=t.target;e instanceof HTMLElement&&"leafer-text-editor"===e.classList[0]&&p?.editor.cancel()},G=t=>{v&&v.children&&v.children.forEach(e=>{"point-annotation"===e._element_tag&&e.label&&(e.label.editable=t)})};qi(()=>{f&&(p?.tree.remove(f),f=null),p?.destroy(),p=null,window.removeEventListener("keydown",Y),window.removeEventListener("mousemove",V),window.removeEventListener("focusout",X),window.__pointAnnotationHotkeysUnsubscribe&&(window.__pointAnnotationHotkeysUnsubscribe(),delete window.__pointAnnotationHotkeysUnsubscribe)});const K=()=>{w.value="select",k.value=!1,p&&(p.editor.config.moveable=!1,p.editor.config.resizeable=!1,p.editor.config.multipleSelect=!0,R?.setPointerEvents(!1),G(!0))},$=()=>{w.value="point",k.value=!1,p&&(p.editor.config.moveable=!0,p.editor.config.multipleSelect=!1,R?.setPointerEvents(!1),G(!0))},Z=()=>{w.value="brush",p&&(p.editor.config.moveable=!1,p.editor.config.resizeable=!1,p.editor.config.multipleSelect=!1,R?.setPointerEvents(!0),G(!1),k.value=!k.value,k.value&&je(()=>{S.value&&(E.value=S.value.getBoundingClientRect())}))},q=()=>{k.value=!1},Q=t=>{Object.assign(B.value,t)},tt=()=>{w.value="eraser",k.value=!1,p&&(p.editor.config.moveable=!1,p.editor.config.resizeable=!1,p.editor.config.multipleSelect=!1,R?.setPointerEvents(!0),G(!1))},et=()=>{l.value&&h.value&&p&&(R&&R.getGroup().remove(),R=new ak(l.value,h.value,B.value),g.add(R.getGroup()))};let it=null;const nt=t=>{if("brush"!==w.value&&"eraser"!==w.value)return;if(!p||!f||!R)return;A.value=!0,D&&(it=R.getImageData());const e=g.getBoxPoint({x:t.x,y:t.y});"eraser"===w.value?R.erase(e.x,e.y,B.value.size,B.value.continuity):R.draw(e.x,e.y,B.value.size,B.value.color,B.value.opacity,B.value.continuity),R.getCanvas().paint()},rt=t=>{if(!A.value||!R||!f)return;const e=g.getBoxPoint({x:t.x,y:t.y});"eraser"===w.value?R.erase(e.x,e.y,B.value.size,B.value.continuity):R.draw(e.x,e.y,B.value.size,B.value.color,B.value.opacity,B.value.continuity),R.getCanvas().paint()},ot=()=>{if(A.value=!1,D&&R&&it){const t=new wS(R,it);D.executeCommand(t),it=null}R?.resetLastPoint()},st=t=>{if("point"!==w.value||!p||!f)return;if(p.editor&&p.editor.list&&p.editor.list.length>0)return;let e=t.target;for(;e;){if("point-annotation"===e._element_tag)return;e=e.parent}const i=g.getBoxPoint({x:t.x,y:t.y});i.x<0||i.x>(l.value||0)||i.y<0||i.y>(h.value||0)||lt(i.x,i.y)},at=t=>{if("brush"!==w.value&&"eraser"!==w.value&&p&&f){if(t.value)if(Array.isArray(t.value))t.value.forEach(t=>{t.circle&&t.circle.set({fill:P.value.selectedCircleFill,stroke:P.value.selectedCircleStroke})});else{const e=t.value.circle||t.value.parent.circle;if(!e)return;e.set({fill:P.value.selectedCircleFill,stroke:P.value.selectedCircleStroke})}if(t.oldValue&&(!Array.isArray(t.oldValue)||!t.value))if(Array.isArray(t.oldValue))t.oldValue.forEach(t=>{t.circle&&t.circle.set({fill:P.value.circleFill,stroke:P.value.circleStroke})});else{const e=t.oldValue.circle||t.oldValue.parent.circle;if(!e||t.oldValue===t.value?.parent)return;e.set({fill:P.value.circleFill,stroke:P.value.circleStroke})}}},lt=(t,e)=>{if(!l.value||!h.value)return null;const i=`point_${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}`,n=`#${O.value}`,o={id:i,pixel:{x:t,y:e},normalized:{x:t/l.value,y:e/h.value},label:n,createdAt:Date.now(),updatedAt:Date.now()},s=new sk(o,P.value);if("brush"!==w.value&&"eraser"!==w.value||(s.label.editable=!1),D){const t=new yS(v,s,C.value,o);D.executeCommand(t)}else v.add(s),C.value.push(o);return M(v),O.value++,r("pointChange",[...C.value]),p?.editor&&p.editor.select(s),i},ht=()=>{if("brush"===w.value||"eraser"===w.value)return void dt();if("select"===w.value&&0===(p?.editor?.list||[]).length&&(C.value.length>0||R?.hasContent()))return void(confirm("确定清除所有标注和笔刷绘制区域吗?")&&ct());if(!p?.editor)return;const t=p.editor.list;0!==t.length&&(t.forEach(t=>{if("point-annotation"===t._element_tag)if(D){const e=new xS(v,t,C.value);D.executeCommand(e)}else{v.remove(t),t.destroy();const e=C.value.findIndex(e=>e.id===t.data.id);e>-1&&C.value.splice(e,1)}}),p.editor.cancel(),r("pointChange",[...C.value]))},ct=()=>{C.value.forEach(t=>{const e=v.children.find(e=>e.data?.id===t.id);e&&(v.remove(e),e.destroy())}),C.value=[],R?.clear(),r("pointChange",[])},dt=()=>{if(R){if(D){const t=R.getImageData(),e=new wS(R,t,!0);D.executeCommand(e)}R.clear(),R.getCanvas().paint()}},ut=()=>{D?.canUndo()&&D.undo()},pt=()=>{D?.canRedo()&&D.redo()},ft=()=>{p&&(p.tree.zoom("out"),_t())},gt=()=>{p&&(p.tree.zoom("in"),_t())},vt=()=>{p&&(p.tree.zoom(1),_t())},_t=()=>{p&&p.tree&&void 0!==p.tree.scaleX&&(b.value=Math.round(100*p.tree.scaleX),M(v))};return e({getPointAnnotations:()=>[...C.value],getImageInfo:()=>({id:c.value?"local-image":n.imageSource?.id||"",url:c.value?d.value:n.imageSource?.url||"",width:l.value,height:h.value}),exportCanvasJSON:()=>{const t={version:"1.0",imageUrl:c.value?d.value:n.imageSource?.url||"",imageWidth:l.value,imageHeight:h.value,pointAnnotations:[...C.value],brushMask:R?.getImageData()||null,exportTime:Date.now()};return JSON.stringify(t,null,2)},exportMaskImage:(t,e)=>new Promise(i=>{if(!R)return void i(null);const r=t||n.options?.maskExportFormat||"png",o=e||n.options?.maskExportForeground||"black",s=R.getImageData();if(!s)return void i(null);const a=document.createElement("img");a.onload=()=>{const t=document.createElement("canvas");t.width=l.value||0,t.height=h.value||0;const e=t.getContext("2d");if(!e)return void i(null);e.drawImage(a,0,0);const n="white"===o,s=e.getImageData(0,0,t.width,t.height),c=s.data;for(let i=0;i<c.length;i+=4)c[i+3]>0?(c[i]=n?255:0,c[i+1]=n?255:0,c[i+2]=n?255:0,c[i+3]=255):"png"!==r&&(c[i]=n?0:255,c[i+1]=n?0:255,c[i+2]=n?0:255,c[i+3]=255);e.putImageData(s,0,0),i("png"===r?t.toDataURL("image/png"):t.toDataURL("image/jpeg",.95))},a.onerror=()=>{i(null)},a.src=s}),exportCOCO:()=>{const t=function(t,e,i,n,r){const o=r?.imageId||1,s=r?.categoryName||"point";return{info:{year:(new Date).getFullYear(),version:"1.0",contributor:"leafer-point-annotation",date_created:(new Date).toISOString().split("T")[0]},images:[{id:o,file_name:(t=>{try{return new URL(t).pathname.split("/").pop()||"image.jpg"}catch{return"image.jpg"}})(e),width:i,height:n}],annotations:t.map((t,e)=>({id:e+1,image_id:o,category_id:1,keypoints:[t.pixel.x,t.pixel.y,2],num_keypoints:1,iscrowd:0})),categories:[{id:1,name:s,supercategory:"annotation",keypoints:["point"],skeleton:[]}]}}(C.value,c.value?d.value:n.imageSource?.url||"",l.value||0,h.value||0);return JSON.stringify(t,null,2)},exportYOLO:()=>{const t=function(t,e,i,n){const r=n?.className||"point",o=n?.pointSize||20;return{annotations:t.map(t=>{const n=t.normalized.x,r=t.normalized.y,s=o/e,a=o/i;return`0 ${n.toFixed(6)} ${r.toFixed(6)} ${s.toFixed(6)} ${a.toFixed(6)}`}).join("\n"),classNames:r,imageWidth:e,imageHeight:i}}(C.value,l.value||0,h.value||0);return{annotations:t.annotations,classNames:t.classNames}},importCanvasJSON:async(t,e)=>{try{const i=JSON.parse(t);if(e?.resetZoom&&(vt(),U()),C.value.forEach(t=>{const e=v.findOne(`#${t.id}`);e&&(v.remove(e),e.destroy())}),C.value=[],R?.clear(),i.imageUrl&&i.imageUrl!==n.imageSource.url&&await I(i.imageUrl),i.pointAnnotations&&Array.isArray(i.pointAnnotations))for(const t of i.pointAnnotations){const e=new sk(t,P.value);"brush"!==w.value&&"eraser"!==w.value||(e.label.editable=!1),v.add(e),C.value.push(t)}return i.brushMask&&R&&R.restoreImageData(i.brushMask),M(v),!0}catch(i){return!1}},loadImage:I,clearBrush:dt,zoomIn:gt,zoomOut:ft,resetZoom:vt,undo:ut,redo:pt,getCurrentTool:()=>w.value,setTool:t=>{w.value=t},createPointAnnotation:lt,removePointAnnotation:t=>{const e=C.value.findIndex(e=>e.id===t);if(-1===e)return!1;const i=v.children[e];if(!i)return!1;if(D){const t=new xS(v,i,C.value);D.executeCommand(t)}else v.remove(i),i.destroy(),C.value.splice(e,1);return r("pointChange",[...C.value]),!0}}),(t,e)=>(fr(),mr(lr,null,[kr("div",{class:H(["point-annotation",{"has-image":L.value}]),onFocus:e[1]||(e[1]=t=>m.value=!0),onBlur:e[2]||(e[2]=t=>m.value=!1),onMouseenter:e[3]||(e[3]=t=>y.value=!0),onMouseleave:e[4]||(e[4]=t=>y.value=!1)},[kr("div",{ref_key:"canvasContainer",ref:o,class:"canvas-container",tabindex:"0",onDragover:z,onDragleave:N,onDrop:j},["loading"===a.value?(fr(),mr("div",VC,[...e[5]||(e[5]=[kr("div",{class:"gradient-animation"},null,-1),kr("div",{class:"loading-text"},"图片加载中",-1)])])):Pr("",!0),"idle"===a.value?(fr(),mr("div",{key:1,class:H(["upload-overlay",{"drag-over":u.value}])},[kr("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:"image/*",style:{display:"none"},onChange:F},null,544),e[6]||(e[6]=Lr('<div class="upload-icon" data-v-f02f10ad><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-f02f10ad><rect x="3" y="3" width="18" height="18" rx="2" ry="2" data-v-f02f10ad></rect><circle cx="8.5" cy="8.5" r="1.5" data-v-f02f10ad></circle><polyline points="21 15 16 10 5 21" data-v-f02f10ad></polyline></svg></div><p class="upload-text" data-v-f02f10ad>点击选择本地图片</p><p class="upload-hint" data-v-f02f10ad>或拖拽图片到此处</p>',3)),kr("button",{class:"upload-button",onClick:W},"选择图片")],2)):Pr("",!0),"error"===a.value?(fr(),mr("div",HC,[e[7]||(e[7]=kr("p",null,"加载失败",-1)),kr("button",{onClick:e[0]||(e[0]=t=>I())},"重试")])):Pr("",!0),L.value?(fr(),mr("div",UC,[kr("button",{class:"zoom-button",title:"缩小 (Ctrl+-)",onClick:ft},[e[8]||(e[8]=kr("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"},[kr("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),x.value?(fr(),mr("span",YC,"Ctrl+-")):Pr("",!0)]),kr("div",{class:"zoom-value",onClick:vt,title:"点击重置为100% (Ctrl+0)"},[Or(J(b.value)+"% ",1),x.value?(fr(),mr("span",XC,"Ctrl+0")):Pr("",!0)]),kr("button",{class:"zoom-button",title:"放大 (Ctrl++)",onClick:gt},[e[9]||(e[9]=kr("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"},[kr("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),kr("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),x.value?(fr(),mr("span",GC,"Ctrl++")):Pr("",!0)])])):Pr("",!0)],544),L.value?(fr(),mr("div",KC,[kr("button",{class:H(["tool-button",{active:"select"===w.value}]),title:"选择工具 (V)",onClick:K},[e[10]||(e[10]=kr("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",class:"lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2"},[kr("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)),x.value?(fr(),mr("span",$C,"V")):Pr("",!0)],2),kr("button",{class:H(["tool-button",{active:"point"===w.value}]),title:"点标注工具 (P)",onClick:$},[e[11]||(e[11]=kr("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"},[kr("circle",{cx:"12",cy:"12",r:"10"}),kr("circle",{cx:"12",cy:"12",r:"3"})],-1)),x.value?(fr(),mr("span",ZC,"P")):Pr("",!0)],2),kr("button",{class:H(["tool-button",{active:"brush"===w.value}]),title:"笔刷工具 (B)",onClick:Z,ref_key:"brushButtonRef",ref:S},[e[12]||(e[12]=kr("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"},[kr("path",{d:"M9.06 11.9l8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08"}),kr("path",{d:"M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z"})],-1)),x.value?(fr(),mr("span",qC,"B")):Pr("",!0)],2),kr("button",{class:H(["tool-button",{active:"eraser"===w.value}]),title:"橡皮擦工具 (E)",onClick:tt},[e[13]||(e[13]=kr("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"},[kr("path",{d:"M20 20H7L3 16C2.4 15.4 2.4 14.4 3 13.8L13.8 3C14.4 2.4 15.4 2.4 16 3L21 8C21.6 8.6 21.6 9.6 21 10.2L10.2 21C9.6 21.6 8.6 21.6 8 21L3 16"})],-1)),x.value?(fr(),mr("span",JC,"E")):Pr("",!0)],2),kr("button",{class:"tool-button",title:"撤销 (Ctrl+Z)",onClick:ut},[e[14]||(e[14]=kr("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"},[kr("path",{d:"M3 7v6h6"}),kr("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)),x.value?(fr(),mr("span",QC,"Ctrl+Z")):Pr("",!0)]),kr("button",{class:"tool-button",title:"重做 (Ctrl+Y)",onClick:pt},[e[15]||(e[15]=kr("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"},[kr("path",{d:"M21 7v6h-6"}),kr("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"})],-1)),x.value?(fr(),mr("span",tO,"Ctrl+Y")):Pr("",!0)]),kr("button",{class:"tool-button",title:"删除 (Delete)",onClick:ht},[e[16]||(e[16]=kr("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"},[kr("path",{d:"M3 6h18"}),kr("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),kr("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})],-1)),x.value?(fr(),mr("span",eO,"Del")):Pr("",!0)])])):Pr("",!0)],34),Er(jC,{visible:k.value,"brush-style":B.value,"button-rect":E.value,onClose:q,onUpdate:Q},null,8,["visible","brush-style","button-rect"])],64))}}),nO=NC(iO,[["__scopeId","data-v-f02f10ad"]]),rO={class:"app"},oO={class:"editor-container"},sO={class:"controls"},aO={class:"control-group"},lO={class:"control-group"},hO={class:"control-group"},cO={class:"mask-options"},dO={class:"control-group"},uO={class:"api-row"},pO={class:"api-row"},fO={class:"output"},gO={class:"status"},vO=Ri({__name:"App",setup(t){const e=xe(""),i=Zr(()=>{if(e.value)return{id:"test-image",url:e.value}}),n=xe({pointStyle:{fill:"#f00",stroke:"#fff",strokeWidth:2,width:16,height:16,radius:8},selectedPointStyle:{fill:"#00f",stroke:"#fff",strokeWidth:2,radius:10}}),r=xe("idle"),o=xe(""),s=xe(null),a=xe("png"),l=xe("black"),h=xe("select"),c=xe("select"),d=xe(null),u=t=>{o.value=JSON.stringify(t,null,2)},p=()=>{r.value="loading"},f=()=>{r.value="success"},g=t=>{r.value="error"},v=()=>{s.value&&s.value.loadImage()},_=()=>{if(s.value){const t=s.value.getPointAnnotations(),e=JSON.stringify(t,null,2),i=new Blob([e],{type:"application/json"}),n=URL.createObjectURL(i),r=document.createElement("a");r.href=n,r.download="point-data.json",r.click(),URL.revokeObjectURL(n)}},m=()=>{if(s.value){const t=s.value.getPointAnnotations();o.value=JSON.stringify(t,null,2)}},y=()=>{if(s.value){const t=s.value.exportCanvasJSON(),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="canvas-data.json",n.click(),URL.revokeObjectURL(i)}},x=xe(null),w=()=>{x.value?.click()},b=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;s.value&&(await s.value.importCanvasJSON(e,{resetZoom:!0})?alert("Canvas imported successfully!"):alert("Failed to import canvas."))},t.readAsText(i)}e.value=""},S=async()=>{if(s.value){const t=await s.value.exportMaskImage(a.value,l.value);if(t){const e="png"===a.value?"png":"jpg",i=document.createElement("a");i.href=t,i.download=`brush-mask.${e}`,i.click()}else alert("No brush data to export.")}},k=()=>{if(s.value){const t=s.value.exportCOCO(),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="annotation-coco.json",n.click(),URL.revokeObjectURL(i)}},E=()=>{if(s.value){const t=s.value.exportYOLO(),e=new Blob([t.annotations],{type:"text/plain"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="annotation-yolo.txt",n.click(),URL.revokeObjectURL(i);const r=new Blob([t.classNames],{type:"text/plain"}),o=URL.createObjectURL(r),a=document.createElement("a");a.href=o,a.download="class-names.txt",a.click(),URL.revokeObjectURL(o)}},C=()=>{s.value&&(s.value.clearBrush?.(),alert("Brush cleared!"))},O=()=>{s.value&&s.value.undo()},L=()=>{s.value&&s.value.redo()},P=()=>{s.value&&(s.value.setTool(h.value),c.value=h.value)},T=()=>{if(s.value){const t=s.value.createPointAnnotation(100,100);t&&(d.value=t,alert(`Point added with id: ${t}`))}},B=()=>{if(s.value&&d.value)s.value.removePointAnnotation(d.value)&&(d.value=null,alert("Point removed"));else{const t=s.value?.getPointAnnotations();if(t&&t.length>0){const e=t[t.length-1];s.value?.removePointAnnotation(e.id)&&alert("Last point removed")}else alert("No points to remove")}};return(t,d)=>(fr(),mr("div",rO,[d[18]||(d[18]=kr("h1",null,"LeaferJS Point Annotation Test",-1)),kr("div",oO,[Er(nO,{ref_key:"pointAnnotation",ref:s,imageSource:i.value,options:n.value,onPointChange:u,onLoadStart:p,onLoadSuccess:f,onLoadError:g},null,8,["imageSource","options"])]),kr("div",sO,[d[15]||(d[15]=kr("h2",null,"Controls",-1)),kr("div",aO,[d[4]||(d[4]=kr("label",{for:"imageUrl"},"Image URL:",-1)),Je(kr("input",{type:"text",id:"imageUrl","onUpdate:modelValue":d[0]||(d[0]=t=>e.value=t),placeholder:"Enter image URL"},null,512),[[Ko,e.value]])]),kr("div",{class:"control-group"},[kr("button",{onClick:m},"Get Point Data"),kr("button",{onClick:_},"Export Point Data"),kr("button",{onClick:v},"Refresh Image")]),kr("div",lO,[d[5]||(d[5]=kr("h3",null,"Canvas Export/Import",-1)),kr("button",{onClick:y},"Export Canvas JSON"),kr("input",{type:"file",ref_key:"fileInput",ref:x,style:{display:"none"},accept:".json",onChange:b},null,544),kr("button",{onClick:w},"Import Canvas JSON")]),kr("div",hO,[d[10]||(d[10]=kr("h3",null,"Brush Mask Export",-1)),kr("div",cO,[kr("label",null,[d[7]||(d[7]=Or(" Format: ",-1)),Je(kr("select",{"onUpdate:modelValue":d[1]||(d[1]=t=>a.value=t)},[...d[6]||(d[6]=[kr("option",{value:"png"},"PNG",-1),kr("option",{value:"jpeg"},"JPEG",-1)])],512),[[$o,a.value]])]),kr("label",null,[d[9]||(d[9]=Or(" Foreground: ",-1)),Je(kr("select",{"onUpdate:modelValue":d[2]||(d[2]=t=>l.value=t)},[...d[8]||(d[8]=[kr("option",{value:"black"},"Black",-1),kr("option",{value:"white"},"White",-1)])],512),[[$o,l.value]])])]),kr("button",{onClick:S},"Export Mask Image"),kr("button",{onClick:C},"Clear Brush")]),kr("div",{class:"control-group"},[d[11]||(d[11]=kr("h3",null,"Annotation Format Export",-1)),kr("button",{onClick:k},"Export COCO JSON"),kr("button",{onClick:E},"Export YOLO")]),kr("div",dO,[d[14]||(d[14]=kr("h3",null,"API Methods",-1)),kr("div",{class:"api-row"},[kr("button",{onClick:O},"Undo"),kr("button",{onClick:L},"Redo")]),kr("div",uO,[d[13]||(d[13]=kr("label",null,"Tool:",-1)),Je(kr("select",{"onUpdate:modelValue":d[3]||(d[3]=t=>h.value=t)},[...d[12]||(d[12]=[kr("option",{value:"select"},"Select",-1),kr("option",{value:"point"},"Point",-1),kr("option",{value:"brush"},"Brush",-1),kr("option",{value:"eraser"},"Eraser",-1)])],512),[[$o,h.value]]),kr("button",{onClick:P},"Set Tool")]),kr("div",{class:"api-row"},[kr("button",{onClick:T},"Add Point (100,100)"),kr("button",{onClick:B},"Remove Last Point")]),kr("div",pO,[kr("span",null,"Current Tool: "+J(c.value),1)])])]),kr("div",fO,[d[16]||(d[16]=kr("h2",null,"Point Data",-1)),kr("pre",null,J(o.value),1)]),kr("div",gO,[d[17]||(d[17]=kr("h2",null,"Status",-1)),kr("p",null,"Image Load Status: "+J(r.value),1)])]))}});((...t)=>{const e=(Jo||(Jo=tr(rs))).createApp(...t),{mount:i}=e;return e.mount=t=>{const n=function(t){return _(t)?document.querySelector(t):t}(t);if(!n)return;const r=e._component;v(r)||r.render||r.template||(r.template=n.innerHTML),1===n.nodeType&&(n.textContent="");const o=i(n,!1,function(t){if(t instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&t instanceof MathMLElement)return"mathml"}(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e})(NC(vO,[["__scopeId","data-v-4ddc095b"]])).mount("#app");