@opentrainticketing/netex-deckplan-editor 1.0.9 → 1.0.11

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,19 +1,19 @@
1
- (function(Kt,dt){typeof exports=="object"&&typeof module<"u"?module.exports=dt():typeof define=="function"&&define.amd?define(dt):(Kt=typeof globalThis<"u"?globalThis:Kt||self,Kt["netex-deckplan-editor"]=dt())})(this,(function(){"use strict";function Kt(e){const t=Object.create(null);for(const i of e.split(","))t[i]=1;return i=>i in t}const dt=process.env.NODE_ENV!=="production"?Object.freeze({}):{},Mi=process.env.NODE_ENV!=="production"?Object.freeze([]):[],Lt=()=>{},Lo=()=>!1,en=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Jn=e=>e.startsWith("onUpdate:"),Ct=Object.assign,sr=(e,t)=>{const i=e.indexOf(t);i>-1&&e.splice(i,1)},yh=Object.prototype.hasOwnProperty,lt=(e,t)=>yh.call(e,t),Q=Array.isArray,ci=e=>nn(e)==="[object Map]",Li=e=>nn(e)==="[object Set]",Io=e=>nn(e)==="[object Date]",it=e=>typeof e=="function",Nt=e=>typeof e=="string",be=e=>typeof e=="symbol",pt=e=>e!==null&&typeof e=="object",rr=e=>(pt(e)||it(e))&&it(e.then)&&it(e.catch),Do=Object.prototype.toString,nn=e=>Do.call(e),or=e=>nn(e).slice(8,-1),Qn=e=>nn(e)==="[object Object]",ar=e=>Nt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,sn=Kt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sh=Kt("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Zn=e=>{const t=Object.create(null);return(i=>t[i]||(t[i]=e(i)))},wh=/-\w/g,Ft=Zn(e=>e.replace(wh,t=>t.slice(1).toUpperCase())),Eh=/\B([A-Z])/g,Jt=Zn(e=>e.replace(Eh,"-$1").toLowerCase()),hi=Zn(e=>e.charAt(0).toUpperCase()+e.slice(1)),di=Zn(e=>e?`on${hi(e)}`:""),ze=(e,t)=>!Object.is(e,t),Ii=(e,...t)=>{for(let i=0;i<e.length;i++)e[i](...t)},ts=(e,t,i,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:i})},es=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Vo=e=>{const t=Nt(e)?Number(e):NaN;return isNaN(t)?e:t};let Fo;const rn=()=>Fo||(Fo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function lr(e){if(Q(e)){const t={};for(let i=0;i<e.length;i++){const n=e[i],s=Nt(n)?Th(n):lr(n);if(s)for(const r in s)t[r]=s[r]}return t}else if(Nt(e)||pt(e))return e}const xh=/;(?![^(]*\))/g,Ch=/:([^]+)/,Nh=/\/\*[^]*?\*\//g;function Th(e){const t={};return e.replace(Nh,"").split(xh).forEach(i=>{if(i){const n=i.split(Ch);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ye(e){let t="";if(Nt(e))t=e;else if(Q(e))for(let i=0;i<e.length;i++){const n=ye(e[i]);n&&(t+=n+" ")}else if(pt(e))for(const i in e)e[i]&&(t+=i+" ");return t.trim()}const kh="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Oh="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Ph="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Ah=Kt(kh),Rh=Kt(Oh),Mh=Kt(Ph),Lh=Kt("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Go(e){return!!e||e===""}function Ih(e,t){if(e.length!==t.length)return!1;let i=!0;for(let n=0;i&&n<e.length;n++)i=ui(e[n],t[n]);return i}function ui(e,t){if(e===t)return!0;let i=Io(e),n=Io(t);if(i||n)return i&&n?e.getTime()===t.getTime():!1;if(i=be(e),n=be(t),i||n)return e===t;if(i=Q(e),n=Q(t),i||n)return i&&n?Ih(e,t):!1;if(i=pt(e),n=pt(t),i||n){if(!i||!n)return!1;const s=Object.keys(e).length,r=Object.keys(t).length;if(s!==r)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!ui(e[o],t[o]))return!1}}return String(e)===String(t)}function cr(e,t){return e.findIndex(i=>ui(i,t))}const Bo=e=>!!(e&&e.__v_isRef===!0),Le=e=>Nt(e)?e:e==null?"":Q(e)||pt(e)&&(e.toString===Do||!it(e.toString))?Bo(e)?Le(e.value):JSON.stringify(e,$o,2):String(e),$o=(e,t)=>Bo(t)?$o(e,t.value):ci(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((i,[n,s],r)=>(i[hr(n,r)+" =>"]=s,i),{})}:Li(t)?{[`Set(${t.size})`]:[...t.values()].map(i=>hr(i))}:be(t)?hr(t):pt(t)&&!Q(t)&&!Qn(t)?String(t):t,hr=(e,t="")=>{var i;return be(e)?`Symbol(${(i=e.description)!=null?i:t})`:e};function le(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let jt;class Dh{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=jt,!t&&jt&&(this.index=(jt.scopes||(jt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,i;if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].pause();for(t=0,i=this.effects.length;t<i;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,i;if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].resume();for(t=0,i=this.effects.length;t<i;t++)this.effects[t].resume()}}run(t){if(this._active){const i=jt;try{return jt=this,t()}finally{jt=i}}else process.env.NODE_ENV!=="production"&&le("cannot run an inactive effect scope.")}on(){++this._on===1&&(this.prevScope=jt,jt=this)}off(){this._on>0&&--this._on===0&&(jt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let i,n;for(i=0,n=this.effects.length;i<n;i++)this.effects[i].stop();for(this.effects.length=0,i=0,n=this.cleanups.length;i<n;i++)this.cleanups[i]();if(this.cleanups.length=0,this.scopes){for(i=0,n=this.scopes.length;i<n;i++)this.scopes[i].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Vh(){return jt}let _t;const dr=new WeakSet;class Ho{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,jt&&jt.active&&jt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,dr.has(this)&&(dr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Uo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qo(this),jo(this);const t=_t,i=ce;_t=this,ce=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&_t!==this&&le("Active effect was not restored correctly - this is likely a Vue internal bug."),Xo(this),_t=t,ce=i,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gr(t);this.deps=this.depsTail=void 0,qo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?dr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){pr(this)&&this.run()}get dirty(){return pr(this)}}let Wo=0,on,an;function Uo(e,t=!1){if(e.flags|=8,t){e.next=an,an=e;return}e.next=on,on=e}function ur(){Wo++}function fr(){if(--Wo>0)return;if(an){let t=an;for(an=void 0;t;){const i=t.next;t.next=void 0,t.flags&=-9,t=i}}let e;for(;on;){let t=on;for(on=void 0;t;){const i=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=i}}if(e)throw e}function jo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Xo(e){let t,i=e.depsTail,n=i;for(;n;){const s=n.prevDep;n.version===-1?(n===i&&(i=s),gr(n),Fh(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=s}e.deps=t,e.depsTail=i}function pr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(zo(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function zo(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ln)||(e.globalVersion=ln,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!pr(e))))return;e.flags|=2;const t=e.dep,i=_t,n=ce;_t=e,ce=!0;try{jo(e);const s=e.fn(e._value);(t.version===0||ze(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{_t=i,ce=n,Xo(e),e.flags&=-3}}function gr(e,t=!1){const{dep:i,prevSub:n,nextSub:s}=e;if(n&&(n.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=n,e.nextSub=void 0),process.env.NODE_ENV!=="production"&&i.subsHead===e&&(i.subsHead=s),i.subs===e&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let r=i.computed.deps;r;r=r.nextDep)gr(r,!0)}!t&&!--i.sc&&i.map&&i.map.delete(i.key)}function Fh(e){const{prevDep:t,nextDep:i}=e;t&&(t.nextDep=i,e.prevDep=void 0),i&&(i.prevDep=t,e.nextDep=void 0)}let ce=!0;const Yo=[];function he(){Yo.push(ce),ce=!1}function de(){const e=Yo.pop();ce=e===void 0?!0:e}function qo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const i=_t;_t=void 0;try{t()}finally{_t=i}}}let ln=0;class Gh{constructor(t,i){this.sub=t,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class mr{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,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!_t||!ce||_t===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==_t)i=this.activeLink=new Gh(_t,this),_t.deps?(i.prevDep=_t.depsTail,_t.depsTail.nextDep=i,_t.depsTail=i):_t.deps=_t.depsTail=i,Ko(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=_t.depsTail,i.nextDep=void 0,_t.depsTail.nextDep=i,_t.depsTail=i,_t.deps===i&&(_t.deps=n)}return process.env.NODE_ENV!=="production"&&_t.onTrack&&_t.onTrack(Ct({effect:_t},t)),i}trigger(t){this.version++,ln++,this.notify(t)}notify(t){ur();try{if(process.env.NODE_ENV!=="production")for(let i=this.subsHead;i;i=i.nextSub)i.sub.onTrigger&&!(i.sub.flags&8)&&i.sub.onTrigger(Ct({effect:i.sub},t));for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{fr()}}}function Ko(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Ko(n)}const i=e.dep.subs;i!==e&&(e.prevSub=i,i&&(i.nextSub=e)),process.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const _r=new WeakMap,fi=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),vr=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),cn=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function It(e,t,i){if(ce&&_t){let n=_r.get(e);n||_r.set(e,n=new Map);let s=n.get(i);s||(n.set(i,s=new mr),s.map=n,s.key=i),process.env.NODE_ENV!=="production"?s.track({target:e,type:t,key:i}):s.track()}}function Se(e,t,i,n,s,r){const o=_r.get(e);if(!o){ln++;return}const a=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:i,newValue:n,oldValue:s,oldTarget:r}):l.trigger())};if(ur(),t==="clear")o.forEach(a);else{const l=Q(e),c=l&&ar(i);if(l&&i==="length"){const h=Number(n);o.forEach((d,u)=>{(u==="length"||u===cn||!be(u)&&u>=h)&&a(d)})}else switch((i!==void 0||o.has(void 0))&&a(o.get(i)),c&&a(o.get(cn)),t){case"add":l?c&&a(o.get("length")):(a(o.get(fi)),ci(e)&&a(o.get(vr)));break;case"delete":l||(a(o.get(fi)),ci(e)&&a(o.get(vr)));break;case"set":ci(e)&&a(o.get(fi));break}}fr()}function Di(e){const t=rt(e);return t===e?t:(It(t,"iterate",cn),Bt(e)?t:t.map(fe))}function is(e){return It(e=rt(e),"iterate",cn),e}function Ye(e,t){return ue(e)?qe(e)?Vi(fe(t)):Vi(t):fe(t)}const Bh={__proto__:null,[Symbol.iterator](){return br(this,Symbol.iterator,e=>Ye(this,e))},concat(...e){return Di(this).concat(...e.map(t=>Q(t)?Di(t):t))},entries(){return br(this,"entries",e=>(e[1]=Ye(this,e[1]),e))},every(e,t){return Ie(this,"every",e,t,void 0,arguments)},filter(e,t){return Ie(this,"filter",e,t,i=>i.map(n=>Ye(this,n)),arguments)},find(e,t){return Ie(this,"find",e,t,i=>Ye(this,i),arguments)},findIndex(e,t){return Ie(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ie(this,"findLast",e,t,i=>Ye(this,i),arguments)},findLastIndex(e,t){return Ie(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ie(this,"forEach",e,t,void 0,arguments)},includes(...e){return yr(this,"includes",e)},indexOf(...e){return yr(this,"indexOf",e)},join(e){return Di(this).join(e)},lastIndexOf(...e){return yr(this,"lastIndexOf",e)},map(e,t){return Ie(this,"map",e,t,void 0,arguments)},pop(){return hn(this,"pop")},push(...e){return hn(this,"push",e)},reduce(e,...t){return Jo(this,"reduce",e,t)},reduceRight(e,...t){return Jo(this,"reduceRight",e,t)},shift(){return hn(this,"shift")},some(e,t){return Ie(this,"some",e,t,void 0,arguments)},splice(...e){return hn(this,"splice",e)},toReversed(){return Di(this).toReversed()},toSorted(e){return Di(this).toSorted(e)},toSpliced(...e){return Di(this).toSpliced(...e)},unshift(...e){return hn(this,"unshift",e)},values(){return br(this,"values",e=>Ye(this,e))}};function br(e,t,i){const n=is(e),s=n[t]();return n!==e&&!Bt(e)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=i(r.value)),r}),s}const $h=Array.prototype;function Ie(e,t,i,n,s,r){const o=is(e),a=o!==e&&!Bt(e),l=o[t];if(l!==$h[t]){const d=l.apply(e,r);return a?fe(d):d}let c=i;o!==e&&(a?c=function(d,u){return i.call(this,Ye(e,d),u,e)}:i.length>2&&(c=function(d,u){return i.call(this,d,u,e)}));const h=l.call(o,c,n);return a&&s?s(h):h}function Jo(e,t,i,n){const s=is(e);let r=i;return s!==e&&(Bt(e)?i.length>3&&(r=function(o,a,l){return i.call(this,o,a,l,e)}):r=function(o,a,l){return i.call(this,o,Ye(e,a),l,e)}),s[t](r,...n)}function yr(e,t,i){const n=rt(e);It(n,"iterate",cn);const s=n[t](...i);return(s===-1||s===!1)&&as(i[0])?(i[0]=rt(i[0]),n[t](...i)):s}function hn(e,t,i=[]){he(),ur();const n=rt(e)[t].apply(e,i);return fr(),de(),n}const Hh=Kt("__proto__,__v_isRef,__isVue"),Qo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(be));function Wh(e){be(e)||(e=String(e));const t=rt(this);return It(t,"has",e),t.hasOwnProperty(e)}class Zo{constructor(t=!1,i=!1){this._isReadonly=t,this._isShallow=i}get(t,i,n){if(i==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(i==="__v_isReactive")return!s;if(i==="__v_isReadonly")return s;if(i==="__v_isShallow")return r;if(i==="__v_raw")return n===(s?r?oa:ra:r?sa:na).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Q(t);if(!s){let l;if(o&&(l=Bh[i]))return l;if(i==="hasOwnProperty")return Wh}const a=Reflect.get(t,i,Rt(t)?t:n);if((be(i)?Qo.has(i):Hh(i))||(s||It(t,"get",i),r))return a;if(Rt(a)){const l=o&&ar(i)?a:a.value;return s&&pt(l)?wr(l):l}return pt(a)?s?wr(a):pi(a):a}}class ta extends Zo{constructor(t=!1){super(!1,t)}set(t,i,n,s){let r=t[i];const o=Q(t)&&ar(i);if(!this._isShallow){const c=ue(r);if(!Bt(n)&&!ue(n)&&(r=rt(r),n=rt(n)),!o&&Rt(r)&&!Rt(n))return c?(process.env.NODE_ENV!=="production"&&le(`Set operation on key "${String(i)}" failed: target is readonly.`,t[i]),!0):(r.value=n,!0)}const a=o?Number(i)<t.length:lt(t,i),l=Reflect.set(t,i,n,Rt(t)?t:s);return t===rt(s)&&(a?ze(n,r)&&Se(t,"set",i,n,r):Se(t,"add",i,n)),l}deleteProperty(t,i){const n=lt(t,i),s=t[i],r=Reflect.deleteProperty(t,i);return r&&n&&Se(t,"delete",i,void 0,s),r}has(t,i){const n=Reflect.has(t,i);return(!be(i)||!Qo.has(i))&&It(t,"has",i),n}ownKeys(t){return It(t,"iterate",Q(t)?"length":fi),Reflect.ownKeys(t)}}class ea extends Zo{constructor(t=!1){super(!0,t)}set(t,i){return process.env.NODE_ENV!=="production"&&le(`Set operation on key "${String(i)}" failed: target is readonly.`,t),!0}deleteProperty(t,i){return process.env.NODE_ENV!=="production"&&le(`Delete operation on key "${String(i)}" failed: target is readonly.`,t),!0}}const Uh=new ta,jh=new ea,Xh=new ta(!0),zh=new ea(!0),Sr=e=>e,ns=e=>Reflect.getPrototypeOf(e);function Yh(e,t,i){return function(...n){const s=this.__v_raw,r=rt(s),o=ci(r),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=s[e](...n),h=i?Sr:t?Vi:fe;return!t&&It(r,"iterate",l?vr:fi),{next(){const{value:d,done:u}=c.next();return u?{value:d,done:u}:{value:a?[h(d[0]),h(d[1])]:h(d),done:u}},[Symbol.iterator](){return this}}}}function ss(e){return function(...t){if(process.env.NODE_ENV!=="production"){const i=t[0]?`on key "${t[0]}" `:"";le(`${hi(e)} operation ${i}failed: target is readonly.`,rt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function qh(e,t){const i={get(s){const r=this.__v_raw,o=rt(r),a=rt(s);e||(ze(s,a)&&It(o,"get",s),It(o,"get",a));const{has:l}=ns(o),c=t?Sr:e?Vi:fe;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!e&&It(rt(s),"iterate",fi),s.size},has(s){const r=this.__v_raw,o=rt(r),a=rt(s);return e||(ze(s,a)&&It(o,"has",s),It(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=rt(a),c=t?Sr:e?Vi:fe;return!e&&It(l,"iterate",fi),a.forEach((h,d)=>s.call(r,c(h),c(d),o))}};return Ct(i,e?{add:ss("add"),set:ss("set"),delete:ss("delete"),clear:ss("clear")}:{add(s){!t&&!Bt(s)&&!ue(s)&&(s=rt(s));const r=rt(this);return ns(r).has.call(r,s)||(r.add(s),Se(r,"add",s,s)),this},set(s,r){!t&&!Bt(r)&&!ue(r)&&(r=rt(r));const o=rt(this),{has:a,get:l}=ns(o);let c=a.call(o,s);c?process.env.NODE_ENV!=="production"&&ia(o,a,s):(s=rt(s),c=a.call(o,s));const h=l.call(o,s);return o.set(s,r),c?ze(r,h)&&Se(o,"set",s,r,h):Se(o,"add",s,r),this},delete(s){const r=rt(this),{has:o,get:a}=ns(r);let l=o.call(r,s);l?process.env.NODE_ENV!=="production"&&ia(r,o,s):(s=rt(s),l=o.call(r,s));const c=a?a.call(r,s):void 0,h=r.delete(s);return l&&Se(r,"delete",s,void 0,c),h},clear(){const s=rt(this),r=s.size!==0,o=process.env.NODE_ENV!=="production"?ci(s)?new Map(s):new Set(s):void 0,a=s.clear();return r&&Se(s,"clear",void 0,void 0,o),a}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=Yh(s,e,t)}),i}function rs(e,t){const i=qh(e,t);return(n,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?n:Reflect.get(lt(i,s)&&s in n?i:n,s,r)}const Kh={get:rs(!1,!1)},Jh={get:rs(!1,!0)},Qh={get:rs(!0,!1)},Zh={get:rs(!0,!0)};function ia(e,t,i){const n=rt(i);if(n!==i&&t.call(e,n)){const s=or(e);le(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const na=new WeakMap,sa=new WeakMap,ra=new WeakMap,oa=new WeakMap;function td(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ed(e){return e.__v_skip||!Object.isExtensible(e)?0:td(or(e))}function pi(e){return ue(e)?e:os(e,!1,Uh,Kh,na)}function id(e){return os(e,!1,Xh,Jh,sa)}function wr(e){return os(e,!0,jh,Qh,ra)}function we(e){return os(e,!0,zh,Zh,oa)}function os(e,t,i,n,s){if(!pt(e))return process.env.NODE_ENV!=="production"&&le(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=ed(e);if(r===0)return e;const o=s.get(e);if(o)return o;const a=new Proxy(e,r===2?n:i);return s.set(e,a),a}function qe(e){return ue(e)?qe(e.__v_raw):!!(e&&e.__v_isReactive)}function ue(e){return!!(e&&e.__v_isReadonly)}function Bt(e){return!!(e&&e.__v_isShallow)}function as(e){return e?!!e.__v_raw:!1}function rt(e){const t=e&&e.__v_raw;return t?rt(t):e}function nd(e){return!lt(e,"__v_skip")&&Object.isExtensible(e)&&ts(e,"__v_skip",!0),e}const fe=e=>pt(e)?pi(e):e,Vi=e=>pt(e)?wr(e):e;function Rt(e){return e?e.__v_isRef===!0:!1}function Xt(e){return sd(e,!1)}function sd(e,t){return Rt(e)?e:new rd(e,t)}class rd{constructor(t,i){this.dep=new mr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?t:rt(t),this._value=i?t:fe(t),this.__v_isShallow=i}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const i=this._rawValue,n=this.__v_isShallow||Bt(t)||ue(t);t=n?t:rt(t),ze(t,i)&&(this._rawValue=t,this._value=n?t:fe(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:i}):this.dep.trigger())}}function aa(e){return Rt(e)?e.value:e}const od={get:(e,t,i)=>t==="__v_raw"?e:aa(Reflect.get(e,t,i)),set:(e,t,i,n)=>{const s=e[t];return Rt(s)&&!Rt(i)?(s.value=i,!0):Reflect.set(e,t,i,n)}};function la(e){return qe(e)?e:new Proxy(e,od)}class ad{constructor(t,i,n){this.fn=t,this.setter=i,this._value=void 0,this.dep=new mr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ln-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&_t!==this)return Uo(this,!0),!0;process.env.NODE_ENV}get value(){const t=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return zo(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):process.env.NODE_ENV!=="production"&&le("Write operation failed: computed value is readonly")}}function ld(e,t,i=!1){let n,s;it(e)?n=e:(n=e.get,s=e.set);const r=new ad(n,s,i);return process.env.NODE_ENV,r}const ls={},cs=new WeakMap;let gi;function cd(e,t=!1,i=gi){if(i){let n=cs.get(i);n||cs.set(i,n=[]),n.push(e)}else process.env.NODE_ENV!=="production"&&!t&&le("onWatcherCleanup() was called when there was no active watcher to associate with.")}function hd(e,t,i=dt){const{immediate:n,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=i,c=T=>{(i.onWarn||le)("Invalid watch source: ",T,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},h=T=>s?T:Bt(T)||s===!1||s===0?De(T,1):De(T);let d,u,f,p,_=!1,b=!1;if(Rt(e)?(u=()=>e.value,_=Bt(e)):qe(e)?(u=()=>h(e),_=!0):Q(e)?(b=!0,_=e.some(T=>qe(T)||Bt(T)),u=()=>e.map(T=>{if(Rt(T))return T.value;if(qe(T))return h(T);if(it(T))return l?l(T,2):T();process.env.NODE_ENV!=="production"&&c(T)})):it(e)?t?u=l?()=>l(e,2):e:u=()=>{if(f){he();try{f()}finally{de()}}const T=gi;gi=d;try{return l?l(e,3,[p]):e(p)}finally{gi=T}}:(u=Lt,process.env.NODE_ENV!=="production"&&c(e)),t&&s){const T=u,O=s===!0?1/0:s;u=()=>De(T(),O)}const w=Vh(),y=()=>{d.stop(),w&&w.active&&sr(w.effects,d)};if(r&&t){const T=t;t=(...O)=>{T(...O),y()}}let x=b?new Array(e.length).fill(ls):ls;const N=T=>{if(!(!(d.flags&1)||!d.dirty&&!T))if(t){const O=d.run();if(s||_||(b?O.some((E,C)=>ze(E,x[C])):ze(O,x))){f&&f();const E=gi;gi=d;try{const C=[O,x===ls?void 0:b&&x[0]===ls?[]:x,p];x=O,l?l(t,3,C):t(...C)}finally{gi=E}}}else d.run()};return a&&a(N),d=new Ho(u),d.scheduler=o?()=>o(N,!1):N,p=T=>cd(T,!1,d),f=d.onStop=()=>{const T=cs.get(d);if(T){if(l)l(T,4);else for(const O of T)O();cs.delete(d)}},process.env.NODE_ENV!=="production"&&(d.onTrack=i.onTrack,d.onTrigger=i.onTrigger),t?n?N(!0):x=d.run():o?o(N.bind(null,!0),!0):d.run(),y.pause=d.pause.bind(d),y.resume=d.resume.bind(d),y.stop=y,y}function De(e,t=1/0,i){if(t<=0||!pt(e)||e.__v_skip||(i=i||new Map,(i.get(e)||0)>=t))return e;if(i.set(e,t),t--,Rt(e))De(e.value,t,i);else if(Q(e))for(let n=0;n<e.length;n++)De(e[n],t,i);else if(Li(e)||ci(e))e.forEach(n=>{De(n,t,i)});else if(Qn(e)){for(const n in e)De(e[n],t,i);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&De(e[n],t,i)}return e}const mi=[];function hs(e){mi.push(e)}function ds(){mi.pop()}let Er=!1;function U(e,...t){if(Er)return;Er=!0,he();const i=mi.length?mi[mi.length-1].component:null,n=i&&i.appContext.config.warnHandler,s=dd();if(n)Fi(n,i,11,[e+t.map(r=>{var o,a;return(a=(o=r.toString)==null?void 0:o.call(r))!=null?a:JSON.stringify(r)}).join(""),i&&i.proxy,s.map(({vnode:r})=>`at <${Nn(i,r.type)}>`).join(`
1
+ (function(Jt,dt){typeof exports=="object"&&typeof module<"u"?module.exports=dt():typeof define=="function"&&define.amd?define(dt):(Jt=typeof globalThis<"u"?globalThis:Jt||self,Jt["netex-deckplan-editor"]=dt())})(this,(function(){"use strict";function Jt(e){const t=Object.create(null);for(const i of e.split(","))t[i]=1;return i=>i in t}const dt=process.env.NODE_ENV!=="production"?Object.freeze({}):{},Ri=process.env.NODE_ENV!=="production"?Object.freeze([]):[],Lt=()=>{},Fo=()=>!1,nn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qn=e=>e.startsWith("onUpdate:"),Ct=Object.assign,rr=(e,t)=>{const i=e.indexOf(t);i>-1&&e.splice(i,1)},Oh=Object.prototype.hasOwnProperty,lt=(e,t)=>Oh.call(e,t),Q=Array.isArray,hi=e=>sn(e)==="[object Map]",Li=e=>sn(e)==="[object Set]",Go=e=>sn(e)==="[object Date]",it=e=>typeof e=="function",Nt=e=>typeof e=="string",ve=e=>typeof e=="symbol",pt=e=>e!==null&&typeof e=="object",or=e=>(pt(e)||it(e))&&it(e.then)&&it(e.catch),$o=Object.prototype.toString,sn=e=>$o.call(e),ar=e=>sn(e).slice(8,-1),Zn=e=>sn(e)==="[object Object]",lr=e=>Nt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,rn=Jt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ah=Jt("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),ts=e=>{const t=Object.create(null);return(i=>t[i]||(t[i]=e(i)))},Mh=/-\w/g,Ft=ts(e=>e.replace(Mh,t=>t.slice(1).toUpperCase())),Rh=/\B([A-Z])/g,Qt=ts(e=>e.replace(Rh,"-$1").toLowerCase()),di=ts(e=>e.charAt(0).toUpperCase()+e.slice(1)),ui=ts(e=>e?`on${di(e)}`:""),ze=(e,t)=>!Object.is(e,t),Ii=(e,...t)=>{for(let i=0;i<e.length;i++)e[i](...t)},es=(e,t,i,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:i})},is=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Bo=e=>{const t=Nt(e)?Number(e):NaN;return isNaN(t)?e:t};let Ho;const on=()=>Ho||(Ho=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function cr(e){if(Q(e)){const t={};for(let i=0;i<e.length;i++){const n=e[i],s=Nt(n)?Vh(n):cr(n);if(s)for(const r in s)t[r]=s[r]}return t}else if(Nt(e)||pt(e))return e}const Lh=/;(?![^(]*\))/g,Ih=/:([^]+)/,Dh=/\/\*[^]*?\*\//g;function Vh(e){const t={};return e.replace(Dh,"").split(Lh).forEach(i=>{if(i){const n=i.split(Ih);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function we(e){let t="";if(Nt(e))t=e;else if(Q(e))for(let i=0;i<e.length;i++){const n=we(e[i]);n&&(t+=n+" ")}else if(pt(e))for(const i in e)e[i]&&(t+=i+" ");return t.trim()}const Fh="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Gh="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",$h="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Bh=Jt(Fh),Hh=Jt(Gh),Wh=Jt($h),Uh=Jt("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Wo(e){return!!e||e===""}function jh(e,t){if(e.length!==t.length)return!1;let i=!0;for(let n=0;i&&n<e.length;n++)i=fi(e[n],t[n]);return i}function fi(e,t){if(e===t)return!0;let i=Go(e),n=Go(t);if(i||n)return i&&n?e.getTime()===t.getTime():!1;if(i=ve(e),n=ve(t),i||n)return e===t;if(i=Q(e),n=Q(t),i||n)return i&&n?jh(e,t):!1;if(i=pt(e),n=pt(t),i||n){if(!i||!n)return!1;const s=Object.keys(e).length,r=Object.keys(t).length;if(s!==r)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!fi(e[o],t[o]))return!1}}return String(e)===String(t)}function hr(e,t){return e.findIndex(i=>fi(i,t))}const Uo=e=>!!(e&&e.__v_isRef===!0),Le=e=>Nt(e)?e:e==null?"":Q(e)||pt(e)&&(e.toString===$o||!it(e.toString))?Uo(e)?Le(e.value):JSON.stringify(e,jo,2):String(e),jo=(e,t)=>Uo(t)?jo(e,t.value):hi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((i,[n,s],r)=>(i[dr(n,r)+" =>"]=s,i),{})}:Li(t)?{[`Set(${t.size})`]:[...t.values()].map(i=>dr(i))}:ve(t)?dr(t):pt(t)&&!Q(t)&&!Zn(t)?String(t):t,dr=(e,t="")=>{var i;return ve(e)?`Symbol(${(i=e.description)!=null?i:t})`:e};function ce(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let jt;class Xh{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=jt,!t&&jt&&(this.index=(jt.scopes||(jt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,i;if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].pause();for(t=0,i=this.effects.length;t<i;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,i;if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].resume();for(t=0,i=this.effects.length;t<i;t++)this.effects[t].resume()}}run(t){if(this._active){const i=jt;try{return jt=this,t()}finally{jt=i}}else process.env.NODE_ENV!=="production"&&ce("cannot run an inactive effect scope.")}on(){++this._on===1&&(this.prevScope=jt,jt=this)}off(){this._on>0&&--this._on===0&&(jt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let i,n;for(i=0,n=this.effects.length;i<n;i++)this.effects[i].stop();for(this.effects.length=0,i=0,n=this.cleanups.length;i<n;i++)this.cleanups[i]();if(this.cleanups.length=0,this.scopes){for(i=0,n=this.scopes.length;i<n;i++)this.scopes[i].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function zh(){return jt}let _t;const ur=new WeakSet;class Xo{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,jt&&jt.active&&jt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ur.has(this)&&(ur.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Yo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Zo(this),qo(this);const t=_t,i=he;_t=this,he=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&_t!==this&&ce("Active effect was not restored correctly - this is likely a Vue internal bug."),Ko(this),_t=t,he=i,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)mr(t);this.deps=this.depsTail=void 0,Zo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ur.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){gr(this)&&this.run()}get dirty(){return gr(this)}}let zo=0,an,ln;function Yo(e,t=!1){if(e.flags|=8,t){e.next=ln,ln=e;return}e.next=an,an=e}function fr(){zo++}function pr(){if(--zo>0)return;if(ln){let t=ln;for(ln=void 0;t;){const i=t.next;t.next=void 0,t.flags&=-9,t=i}}let e;for(;an;){let t=an;for(an=void 0;t;){const i=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=i}}if(e)throw e}function qo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ko(e){let t,i=e.depsTail,n=i;for(;n;){const s=n.prevDep;n.version===-1?(n===i&&(i=s),mr(n),Yh(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=s}e.deps=t,e.depsTail=i}function gr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Jo(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Jo(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===cn)||(e.globalVersion=cn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!gr(e))))return;e.flags|=2;const t=e.dep,i=_t,n=he;_t=e,he=!0;try{qo(e);const s=e.fn(e._value);(t.version===0||ze(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{_t=i,he=n,Ko(e),e.flags&=-3}}function mr(e,t=!1){const{dep:i,prevSub:n,nextSub:s}=e;if(n&&(n.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=n,e.nextSub=void 0),process.env.NODE_ENV!=="production"&&i.subsHead===e&&(i.subsHead=s),i.subs===e&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let r=i.computed.deps;r;r=r.nextDep)mr(r,!0)}!t&&!--i.sc&&i.map&&i.map.delete(i.key)}function Yh(e){const{prevDep:t,nextDep:i}=e;t&&(t.nextDep=i,e.prevDep=void 0),i&&(i.prevDep=t,e.nextDep=void 0)}let he=!0;const Qo=[];function de(){Qo.push(he),he=!1}function ue(){const e=Qo.pop();he=e===void 0?!0:e}function Zo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const i=_t;_t=void 0;try{t()}finally{_t=i}}}let cn=0;class qh{constructor(t,i){this.sub=t,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class _r{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,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!_t||!he||_t===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==_t)i=this.activeLink=new qh(_t,this),_t.deps?(i.prevDep=_t.depsTail,_t.depsTail.nextDep=i,_t.depsTail=i):_t.deps=_t.depsTail=i,ta(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=_t.depsTail,i.nextDep=void 0,_t.depsTail.nextDep=i,_t.depsTail=i,_t.deps===i&&(_t.deps=n)}return process.env.NODE_ENV!=="production"&&_t.onTrack&&_t.onTrack(Ct({effect:_t},t)),i}trigger(t){this.version++,cn++,this.notify(t)}notify(t){fr();try{if(process.env.NODE_ENV!=="production")for(let i=this.subsHead;i;i=i.nextSub)i.sub.onTrigger&&!(i.sub.flags&8)&&i.sub.onTrigger(Ct({effect:i.sub},t));for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{pr()}}}function ta(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)ta(n)}const i=e.dep.subs;i!==e&&(e.prevSub=i,i&&(i.nextSub=e)),process.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const yr=new WeakMap,pi=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),br=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),hn=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function It(e,t,i){if(he&&_t){let n=yr.get(e);n||yr.set(e,n=new Map);let s=n.get(i);s||(n.set(i,s=new _r),s.map=n,s.key=i),process.env.NODE_ENV!=="production"?s.track({target:e,type:t,key:i}):s.track()}}function Se(e,t,i,n,s,r){const o=yr.get(e);if(!o){cn++;return}const a=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:i,newValue:n,oldValue:s,oldTarget:r}):l.trigger())};if(fr(),t==="clear")o.forEach(a);else{const l=Q(e),h=l&&lr(i);if(l&&i==="length"){const c=Number(n);o.forEach((d,u)=>{(u==="length"||u===hn||!ve(u)&&u>=c)&&a(d)})}else switch((i!==void 0||o.has(void 0))&&a(o.get(i)),h&&a(o.get(hn)),t){case"add":l?h&&a(o.get("length")):(a(o.get(pi)),hi(e)&&a(o.get(br)));break;case"delete":l||(a(o.get(pi)),hi(e)&&a(o.get(br)));break;case"set":hi(e)&&a(o.get(pi));break}}pr()}function Di(e){const t=rt(e);return t===e?t:(It(t,"iterate",hn),$t(e)?t:t.map(pe))}function ns(e){return It(e=rt(e),"iterate",hn),e}function Ye(e,t){return fe(e)?qe(e)?Vi(pe(t)):Vi(t):pe(t)}const Kh={__proto__:null,[Symbol.iterator](){return vr(this,Symbol.iterator,e=>Ye(this,e))},concat(...e){return Di(this).concat(...e.map(t=>Q(t)?Di(t):t))},entries(){return vr(this,"entries",e=>(e[1]=Ye(this,e[1]),e))},every(e,t){return Ie(this,"every",e,t,void 0,arguments)},filter(e,t){return Ie(this,"filter",e,t,i=>i.map(n=>Ye(this,n)),arguments)},find(e,t){return Ie(this,"find",e,t,i=>Ye(this,i),arguments)},findIndex(e,t){return Ie(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ie(this,"findLast",e,t,i=>Ye(this,i),arguments)},findLastIndex(e,t){return Ie(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ie(this,"forEach",e,t,void 0,arguments)},includes(...e){return wr(this,"includes",e)},indexOf(...e){return wr(this,"indexOf",e)},join(e){return Di(this).join(e)},lastIndexOf(...e){return wr(this,"lastIndexOf",e)},map(e,t){return Ie(this,"map",e,t,void 0,arguments)},pop(){return dn(this,"pop")},push(...e){return dn(this,"push",e)},reduce(e,...t){return ea(this,"reduce",e,t)},reduceRight(e,...t){return ea(this,"reduceRight",e,t)},shift(){return dn(this,"shift")},some(e,t){return Ie(this,"some",e,t,void 0,arguments)},splice(...e){return dn(this,"splice",e)},toReversed(){return Di(this).toReversed()},toSorted(e){return Di(this).toSorted(e)},toSpliced(...e){return Di(this).toSpliced(...e)},unshift(...e){return dn(this,"unshift",e)},values(){return vr(this,"values",e=>Ye(this,e))}};function vr(e,t,i){const n=ns(e),s=n[t]();return n!==e&&!$t(e)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=i(r.value)),r}),s}const Jh=Array.prototype;function Ie(e,t,i,n,s,r){const o=ns(e),a=o!==e&&!$t(e),l=o[t];if(l!==Jh[t]){const d=l.apply(e,r);return a?pe(d):d}let h=i;o!==e&&(a?h=function(d,u){return i.call(this,Ye(e,d),u,e)}:i.length>2&&(h=function(d,u){return i.call(this,d,u,e)}));const c=l.call(o,h,n);return a&&s?s(c):c}function ea(e,t,i,n){const s=ns(e);let r=i;return s!==e&&($t(e)?i.length>3&&(r=function(o,a,l){return i.call(this,o,a,l,e)}):r=function(o,a,l){return i.call(this,o,Ye(e,a),l,e)}),s[t](r,...n)}function wr(e,t,i){const n=rt(e);It(n,"iterate",hn);const s=n[t](...i);return(s===-1||s===!1)&&ls(i[0])?(i[0]=rt(i[0]),n[t](...i)):s}function dn(e,t,i=[]){de(),fr();const n=rt(e)[t].apply(e,i);return pr(),ue(),n}const Qh=Jt("__proto__,__v_isRef,__isVue"),ia=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ve));function Zh(e){ve(e)||(e=String(e));const t=rt(this);return It(t,"has",e),t.hasOwnProperty(e)}class na{constructor(t=!1,i=!1){this._isReadonly=t,this._isShallow=i}get(t,i,n){if(i==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(i==="__v_isReactive")return!s;if(i==="__v_isReadonly")return s;if(i==="__v_isShallow")return r;if(i==="__v_raw")return n===(s?r?ha:ca:r?la:aa).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Q(t);if(!s){let l;if(o&&(l=Kh[i]))return l;if(i==="hasOwnProperty")return Zh}const a=Reflect.get(t,i,Mt(t)?t:n);if((ve(i)?ia.has(i):Qh(i))||(s||It(t,"get",i),r))return a;if(Mt(a)){const l=o&&lr(i)?a:a.value;return s&&pt(l)?Er(l):l}return pt(a)?s?Er(a):gi(a):a}}class sa extends na{constructor(t=!1){super(!1,t)}set(t,i,n,s){let r=t[i];const o=Q(t)&&lr(i);if(!this._isShallow){const h=fe(r);if(!$t(n)&&!fe(n)&&(r=rt(r),n=rt(n)),!o&&Mt(r)&&!Mt(n))return h?(process.env.NODE_ENV!=="production"&&ce(`Set operation on key "${String(i)}" failed: target is readonly.`,t[i]),!0):(r.value=n,!0)}const a=o?Number(i)<t.length:lt(t,i),l=Reflect.set(t,i,n,Mt(t)?t:s);return t===rt(s)&&(a?ze(n,r)&&Se(t,"set",i,n,r):Se(t,"add",i,n)),l}deleteProperty(t,i){const n=lt(t,i),s=t[i],r=Reflect.deleteProperty(t,i);return r&&n&&Se(t,"delete",i,void 0,s),r}has(t,i){const n=Reflect.has(t,i);return(!ve(i)||!ia.has(i))&&It(t,"has",i),n}ownKeys(t){return It(t,"iterate",Q(t)?"length":pi),Reflect.ownKeys(t)}}class ra extends na{constructor(t=!1){super(!0,t)}set(t,i){return process.env.NODE_ENV!=="production"&&ce(`Set operation on key "${String(i)}" failed: target is readonly.`,t),!0}deleteProperty(t,i){return process.env.NODE_ENV!=="production"&&ce(`Delete operation on key "${String(i)}" failed: target is readonly.`,t),!0}}const td=new sa,ed=new ra,id=new sa(!0),nd=new ra(!0),Sr=e=>e,ss=e=>Reflect.getPrototypeOf(e);function sd(e,t,i){return function(...n){const s=this.__v_raw,r=rt(s),o=hi(r),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,h=s[e](...n),c=i?Sr:t?Vi:pe;return!t&&It(r,"iterate",l?br:pi),{next(){const{value:d,done:u}=h.next();return u?{value:d,done:u}:{value:a?[c(d[0]),c(d[1])]:c(d),done:u}},[Symbol.iterator](){return this}}}}function rs(e){return function(...t){if(process.env.NODE_ENV!=="production"){const i=t[0]?`on key "${t[0]}" `:"";ce(`${di(e)} operation ${i}failed: target is readonly.`,rt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function rd(e,t){const i={get(s){const r=this.__v_raw,o=rt(r),a=rt(s);e||(ze(s,a)&&It(o,"get",s),It(o,"get",a));const{has:l}=ss(o),h=t?Sr:e?Vi:pe;if(l.call(o,s))return h(r.get(s));if(l.call(o,a))return h(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!e&&It(rt(s),"iterate",pi),s.size},has(s){const r=this.__v_raw,o=rt(r),a=rt(s);return e||(ze(s,a)&&It(o,"has",s),It(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=rt(a),h=t?Sr:e?Vi:pe;return!e&&It(l,"iterate",pi),a.forEach((c,d)=>s.call(r,h(c),h(d),o))}};return Ct(i,e?{add:rs("add"),set:rs("set"),delete:rs("delete"),clear:rs("clear")}:{add(s){!t&&!$t(s)&&!fe(s)&&(s=rt(s));const r=rt(this);return ss(r).has.call(r,s)||(r.add(s),Se(r,"add",s,s)),this},set(s,r){!t&&!$t(r)&&!fe(r)&&(r=rt(r));const o=rt(this),{has:a,get:l}=ss(o);let h=a.call(o,s);h?process.env.NODE_ENV!=="production"&&oa(o,a,s):(s=rt(s),h=a.call(o,s));const c=l.call(o,s);return o.set(s,r),h?ze(r,c)&&Se(o,"set",s,r,c):Se(o,"add",s,r),this},delete(s){const r=rt(this),{has:o,get:a}=ss(r);let l=o.call(r,s);l?process.env.NODE_ENV!=="production"&&oa(r,o,s):(s=rt(s),l=o.call(r,s));const h=a?a.call(r,s):void 0,c=r.delete(s);return l&&Se(r,"delete",s,void 0,h),c},clear(){const s=rt(this),r=s.size!==0,o=process.env.NODE_ENV!=="production"?hi(s)?new Map(s):new Set(s):void 0,a=s.clear();return r&&Se(s,"clear",void 0,void 0,o),a}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=sd(s,e,t)}),i}function os(e,t){const i=rd(e,t);return(n,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?n:Reflect.get(lt(i,s)&&s in n?i:n,s,r)}const od={get:os(!1,!1)},ad={get:os(!1,!0)},ld={get:os(!0,!1)},cd={get:os(!0,!0)};function oa(e,t,i){const n=rt(i);if(n!==i&&t.call(e,n)){const s=ar(e);ce(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const aa=new WeakMap,la=new WeakMap,ca=new WeakMap,ha=new WeakMap;function hd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dd(e){return e.__v_skip||!Object.isExtensible(e)?0:hd(ar(e))}function gi(e){return fe(e)?e:as(e,!1,td,od,aa)}function ud(e){return as(e,!1,id,ad,la)}function Er(e){return as(e,!0,ed,ld,ca)}function Ee(e){return as(e,!0,nd,cd,ha)}function as(e,t,i,n,s){if(!pt(e))return process.env.NODE_ENV!=="production"&&ce(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=dd(e);if(r===0)return e;const o=s.get(e);if(o)return o;const a=new Proxy(e,r===2?n:i);return s.set(e,a),a}function qe(e){return fe(e)?qe(e.__v_raw):!!(e&&e.__v_isReactive)}function fe(e){return!!(e&&e.__v_isReadonly)}function $t(e){return!!(e&&e.__v_isShallow)}function ls(e){return e?!!e.__v_raw:!1}function rt(e){const t=e&&e.__v_raw;return t?rt(t):e}function fd(e){return!lt(e,"__v_skip")&&Object.isExtensible(e)&&es(e,"__v_skip",!0),e}const pe=e=>pt(e)?gi(e):e,Vi=e=>pt(e)?Er(e):e;function Mt(e){return e?e.__v_isRef===!0:!1}function Xt(e){return pd(e,!1)}function pd(e,t){return Mt(e)?e:new gd(e,t)}class gd{constructor(t,i){this.dep=new _r,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?t:rt(t),this._value=i?t:pe(t),this.__v_isShallow=i}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const i=this._rawValue,n=this.__v_isShallow||$t(t)||fe(t);t=n?t:rt(t),ze(t,i)&&(this._rawValue=t,this._value=n?t:pe(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:i}):this.dep.trigger())}}function da(e){return Mt(e)?e.value:e}const md={get:(e,t,i)=>t==="__v_raw"?e:da(Reflect.get(e,t,i)),set:(e,t,i,n)=>{const s=e[t];return Mt(s)&&!Mt(i)?(s.value=i,!0):Reflect.set(e,t,i,n)}};function ua(e){return qe(e)?e:new Proxy(e,md)}class _d{constructor(t,i,n){this.fn=t,this.setter=i,this._value=void 0,this.dep=new _r(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&_t!==this)return Yo(this,!0),!0;process.env.NODE_ENV}get value(){const t=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Jo(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):process.env.NODE_ENV!=="production"&&ce("Write operation failed: computed value is readonly")}}function yd(e,t,i=!1){let n,s;it(e)?n=e:(n=e.get,s=e.set);const r=new _d(n,s,i);return process.env.NODE_ENV,r}const cs={},hs=new WeakMap;let mi;function bd(e,t=!1,i=mi){if(i){let n=hs.get(i);n||hs.set(i,n=[]),n.push(e)}else process.env.NODE_ENV!=="production"&&!t&&ce("onWatcherCleanup() was called when there was no active watcher to associate with.")}function vd(e,t,i=dt){const{immediate:n,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=i,h=T=>{(i.onWarn||ce)("Invalid watch source: ",T,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=T=>s?T:$t(T)||s===!1||s===0?De(T,1):De(T);let d,u,f,p,_=!1,v=!1;if(Mt(e)?(u=()=>e.value,_=$t(e)):qe(e)?(u=()=>c(e),_=!0):Q(e)?(v=!0,_=e.some(T=>qe(T)||$t(T)),u=()=>e.map(T=>{if(Mt(T))return T.value;if(qe(T))return c(T);if(it(T))return l?l(T,2):T();process.env.NODE_ENV!=="production"&&h(T)})):it(e)?t?u=l?()=>l(e,2):e:u=()=>{if(f){de();try{f()}finally{ue()}}const T=mi;mi=d;try{return l?l(e,3,[p]):e(p)}finally{mi=T}}:(u=Lt,process.env.NODE_ENV!=="production"&&h(e)),t&&s){const T=u,P=s===!0?1/0:s;u=()=>De(T(),P)}const S=zh(),b=()=>{d.stop(),S&&S.active&&rr(S.effects,d)};if(r&&t){const T=t;t=(...P)=>{T(...P),b()}}let x=v?new Array(e.length).fill(cs):cs;const N=T=>{if(!(!(d.flags&1)||!d.dirty&&!T))if(t){const P=d.run();if(s||_||(v?P.some((E,C)=>ze(E,x[C])):ze(P,x))){f&&f();const E=mi;mi=d;try{const C=[P,x===cs?void 0:v&&x[0]===cs?[]:x,p];x=P,l?l(t,3,C):t(...C)}finally{mi=E}}}else d.run()};return a&&a(N),d=new Xo(u),d.scheduler=o?()=>o(N,!1):N,p=T=>bd(T,!1,d),f=d.onStop=()=>{const T=hs.get(d);if(T){if(l)l(T,4);else for(const P of T)P();hs.delete(d)}},process.env.NODE_ENV!=="production"&&(d.onTrack=i.onTrack,d.onTrigger=i.onTrigger),t?n?N(!0):x=d.run():o?o(N.bind(null,!0),!0):d.run(),b.pause=d.pause.bind(d),b.resume=d.resume.bind(d),b.stop=b,b}function De(e,t=1/0,i){if(t<=0||!pt(e)||e.__v_skip||(i=i||new Map,(i.get(e)||0)>=t))return e;if(i.set(e,t),t--,Mt(e))De(e.value,t,i);else if(Q(e))for(let n=0;n<e.length;n++)De(e[n],t,i);else if(Li(e)||hi(e))e.forEach(n=>{De(n,t,i)});else if(Zn(e)){for(const n in e)De(e[n],t,i);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&De(e[n],t,i)}return e}const _i=[];function ds(e){_i.push(e)}function us(){_i.pop()}let xr=!1;function U(e,...t){if(xr)return;xr=!0,de();const i=_i.length?_i[_i.length-1].component:null,n=i&&i.appContext.config.warnHandler,s=wd();if(n)Fi(n,i,11,[e+t.map(r=>{var o,a;return(a=(o=r.toString)==null?void 0:o.call(r))!=null?a:JSON.stringify(r)}).join(""),i&&i.proxy,s.map(({vnode:r})=>`at <${Tn(i,r.type)}>`).join(`
2
2
  `),s]);else{const r=[`[Vue warn]: ${e}`,...t];s.length&&r.push(`
3
- `,...ud(s)),console.warn(...r)}de(),Er=!1}function dd(){let e=mi[mi.length-1];if(!e)return[];const t=[];for(;e;){const i=t[0];i&&i.vnode===e?i.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function ud(e){const t=[];return e.forEach((i,n)=>{t.push(...n===0?[]:[`
4
- `],...fd(i))}),t}function fd({vnode:e,recurseCount:t}){const i=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,s=` at <${Nn(e.component,e.type,n)}`,r=">"+i;return e.props?[s,...pd(e.props),r]:[s+r]}function pd(e){const t=[],i=Object.keys(e);return i.slice(0,3).forEach(n=>{t.push(...ca(n,e[n]))}),i.length>3&&t.push(" ..."),t}function ca(e,t,i){return Nt(t)?(t=JSON.stringify(t),i?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?i?t:[`${e}=${t}`]:Rt(t)?(t=ca(e,rt(t.value),!0),i?t:[`${e}=Ref<`,t,">"]):it(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=rt(t),i?t:[`${e}=`,t])}const xr={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Fi(e,t,i,n){try{return n?e(...n):e()}catch(s){dn(s,t,i)}}function Ee(e,t,i,n){if(it(e)){const s=Fi(e,t,i,n);return s&&rr(s)&&s.catch(r=>{dn(r,t,i)}),s}if(Q(e)){const s=[];for(let r=0;r<e.length;r++)s.push(Ee(e[r],t,i,n));return s}else process.env.NODE_ENV!=="production"&&U(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function dn(e,t,i,n=!0){const s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||dt;if(t){let a=t.parent;const l=t.proxy,c=process.env.NODE_ENV!=="production"?xr[i]:`https://vuejs.org/error-reference/#runtime-${i}`;for(;a;){const h=a.ec;if(h){for(let d=0;d<h.length;d++)if(h[d](e,l,c)===!1)return}a=a.parent}if(r){he(),Fi(r,null,10,[e,l,c]),de();return}}gd(e,i,s,n,o)}function gd(e,t,i,n=!0,s=!1){if(process.env.NODE_ENV!=="production"){const r=xr[t];if(i&&hs(i),U(`Unhandled error${r?` during execution of ${r}`:""}`),i&&ds(),n)throw e;console.error(e)}else{if(s)throw e;console.error(e)}}const $t=[];let xe=-1;const Gi=[];let Ke=null,Bi=0;const ha=Promise.resolve();let us=null;const md=100;function fs(e){const t=us||ha;return e?t.then(this?e.bind(this):e):t}function _d(e){let t=xe+1,i=$t.length;for(;t<i;){const n=t+i>>>1,s=$t[n],r=un(s);r<e||r===e&&s.flags&2?t=n+1:i=n}return t}function ps(e){if(!(e.flags&1)){const t=un(e),i=$t[$t.length-1];!i||!(e.flags&2)&&t>=un(i)?$t.push(e):$t.splice(_d(t),0,e),e.flags|=1,da()}}function da(){us||(us=ha.then(ga))}function ua(e){Q(e)?Gi.push(...e):Ke&&e.id===-1?Ke.splice(Bi+1,0,e):e.flags&1||(Gi.push(e),e.flags|=1),da()}function fa(e,t,i=xe+1){for(process.env.NODE_ENV!=="production"&&(t=t||new Map);i<$t.length;i++){const n=$t[i];if(n&&n.flags&2){if(e&&n.id!==e.uid||process.env.NODE_ENV!=="production"&&Cr(t,n))continue;$t.splice(i,1),i--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function pa(e){if(Gi.length){const t=[...new Set(Gi)].sort((i,n)=>un(i)-un(n));if(Gi.length=0,Ke){Ke.push(...t);return}for(Ke=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),Bi=0;Bi<Ke.length;Bi++){const i=Ke[Bi];process.env.NODE_ENV!=="production"&&Cr(e,i)||(i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2)}Ke=null,Bi=0}}const un=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ga(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?i=>Cr(e,i):Lt;try{for(xe=0;xe<$t.length;xe++){const i=$t[xe];if(i&&!(i.flags&8)){if(process.env.NODE_ENV!=="production"&&t(i))continue;i.flags&4&&(i.flags&=-2),Fi(i,i.i,i.i?15:14),i.flags&4||(i.flags&=-2)}}}finally{for(;xe<$t.length;xe++){const i=$t[xe];i&&(i.flags&=-2)}xe=-1,$t.length=0,pa(e),us=null,($t.length||Gi.length)&&ga(e)}}function Cr(e,t){const i=e.get(t)||0;if(i>md){const n=t.i,s=n&&Kr(n.type);return dn(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,i+1),!1}let Ce=!1;const gs=new Map;process.env.NODE_ENV!=="production"&&(rn().__VUE_HMR_RUNTIME__={createRecord:Nr(ma),rerender:Nr(yd),reload:Nr(Sd)});const _i=new Map;function vd(e){const t=e.type.__hmrId;let i=_i.get(t);i||(ma(t,e.type),i=_i.get(t)),i.instances.add(e)}function bd(e){_i.get(e.type.__hmrId).instances.delete(e)}function ma(e,t){return _i.has(e)?!1:(_i.set(e,{initialDef:ms(t),instances:new Set}),!0)}function ms(e){return fl(e)?e.__vccOpts:e}function yd(e,t){const i=_i.get(e);i&&(i.initialDef.render=t,[...i.instances].forEach(n=>{t&&(n.render=t,ms(n.type).render=t),n.renderCache=[],Ce=!0,n.job.flags&8||n.update(),Ce=!1}))}function Sd(e,t){const i=_i.get(e);if(!i)return;t=ms(t),_a(i.initialDef,t);const n=[...i.instances];for(let s=0;s<n.length;s++){const r=n[s],o=ms(r.type);let a=gs.get(o);a||(o!==i.initialDef&&_a(o,t),gs.set(o,a=new Set)),a.add(r),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(a.add(r),r.ceReload(t.styles),a.delete(r)):r.parent?ps(()=>{r.job.flags&8||(Ce=!0,r.parent.update(),Ce=!1,a.delete(r))}):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),r.root.ce&&r!==r.root&&r.root.ce._removeChildStyle(o)}ua(()=>{gs.clear()})}function _a(e,t){Ct(e,t);for(const i in e)i!=="__file"&&!(i in t)&&delete e[i]}function Nr(e){return(t,i)=>{try{return e(t,i)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let pe,fn=[],Tr=!1;function pn(e,...t){pe?pe.emit(e,...t):Tr||fn.push({event:e,args:t})}function kr(e,t){var i,n;pe=e,pe?(pe.enabled=!0,fn.forEach(({event:s,args:r})=>pe.emit(s,...r)),fn=[]):typeof window<"u"&&window.HTMLElement&&!((n=(i=window.navigator)==null?void 0:i.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{kr(r,t)}),setTimeout(()=>{pe||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Tr=!0,fn=[])},3e3)):(Tr=!0,fn=[])}function wd(e,t){pn("app:init",e,t,{Fragment:Dt,Text:yn,Comment:Zt,Static:Ts})}function Ed(e){pn("app:unmount",e)}const xd=Or("component:added"),va=Or("component:updated"),Cd=Or("component:removed"),Nd=e=>{pe&&typeof pe.cleanupBuffer=="function"&&!pe.cleanupBuffer(e)&&Cd(e)};function Or(e){return t=>{pn(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}const Td=ba("perf:start"),kd=ba("perf:end");function ba(e){return(t,i,n)=>{pn(e,t.appContext.app,t.uid,t,i,n)}}function Od(e,t,i){pn("component:emit",e.appContext.app,e,t,i)}let Gt=null,ya=null;function _s(e){const t=Gt;return Gt=e,ya=e&&e.type.__scopeId||null,t}function gn(e,t=Gt,i){if(!t||e._n)return e;const n=(...s)=>{n._d&&ks(-1);const r=_s(t);let o;try{o=e(...s)}finally{_s(r),n._d&&ks(1)}return process.env.NODE_ENV!=="production"&&va(t),o};return n._n=!0,n._c=!0,n._d=!0,n}function Sa(e){Sh(e)&&U("Do not use built-in directive ids as custom directive id: "+e)}function vs(e,t){if(Gt===null)return process.env.NODE_ENV!=="production"&&U("withDirectives can only be used inside render functions."),e;const i=Ms(Gt),n=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[r,o,a,l=dt]=t[s];r&&(it(r)&&(r={mounted:r,updated:r}),r.deep&&De(o),n.push({dir:r,instance:i,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function vi(e,t,i,n){const s=e.dirs,r=t&&t.dirs;for(let o=0;o<s.length;o++){const a=s[o];r&&(a.oldValue=r[o].value);let l=a.dir[n];l&&(he(),Ee(l,i,8,[e.el,a,e,t]),de())}}const Pd=Symbol("_vte"),Ad=e=>e.__isTeleport,Rd=Symbol("_leaveCb");function Pr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Pr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ne(e,t){return it(e)?Ct({name:e.name},t,{setup:e}):e}function wa(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Ea=new WeakSet,bs=new WeakMap;function mn(e,t,i,n,s=!1){if(Q(e)){e.forEach((_,b)=>mn(_,t&&(Q(t)?t[b]:t),i,n,s));return}if(_n(n)&&!s){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&mn(e,t,i,n.component.subTree);return}const r=n.shapeFlag&4?Ms(n.component):n.el,o=s?null:r,{i:a,r:l}=e;if(process.env.NODE_ENV!=="production"&&!a){U("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const c=t&&t.r,h=a.refs===dt?a.refs={}:a.refs,d=a.setupState,u=rt(d),f=d===dt?Lo:_=>process.env.NODE_ENV!=="production"&&(lt(u,_)&&!Rt(u[_])&&U(`Template ref "${_}" used on a non-ref value. It will not work in the production build.`),Ea.has(u[_]))?!1:lt(u,_),p=_=>process.env.NODE_ENV==="production"||!Ea.has(_);if(c!=null&&c!==l){if(xa(t),Nt(c))h[c]=null,f(c)&&(d[c]=null);else if(Rt(c)){p(c)&&(c.value=null);const _=t;_.k&&(h[_.k]=null)}}if(it(l))Fi(l,a,12,[o,h]);else{const _=Nt(l),b=Rt(l);if(_||b){const w=()=>{if(e.f){const y=_?f(l)?d[l]:h[l]:p(l)||!e.k?l.value:h[e.k];if(s)Q(y)&&sr(y,r);else if(Q(y))y.includes(r)||y.push(r);else if(_)h[l]=[r],f(l)&&(d[l]=h[l]);else{const x=[r];p(l)&&(l.value=x),e.k&&(h[e.k]=x)}}else _?(h[l]=o,f(l)&&(d[l]=o)):b?(p(l)&&(l.value=o),e.k&&(h[e.k]=o)):process.env.NODE_ENV!=="production"&&U("Invalid template ref type:",l,`(${typeof l})`)};if(o){const y=()=>{w(),bs.delete(e)};y.id=-1,bs.set(e,y),Qt(y,i)}else xa(e),w()}else process.env.NODE_ENV!=="production"&&U("Invalid template ref type:",l,`(${typeof l})`)}}function xa(e){const t=bs.get(e);t&&(t.flags|=8,bs.delete(e))}rn().requestIdleCallback,rn().cancelIdleCallback;const _n=e=>!!e.type.__asyncLoader,Ar=e=>e.type.__isKeepAlive;function Md(e,t){Ca(e,"a",t)}function Ld(e,t){Ca(e,"da",t)}function Ca(e,t,i=Mt){const n=e.__wdc||(e.__wdc=()=>{let s=i;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ys(t,n,i),i){let s=i.parent;for(;s&&s.parent;)Ar(s.parent.vnode)&&Id(n,t,i,s),s=s.parent}}function Id(e,t,i,n){const s=ys(t,e,n,!0);Lr(()=>{sr(n[t],s)},i)}function ys(e,t,i=Mt,n=!1){if(i){const s=i[e]||(i[e]=[]),r=t.__weh||(t.__weh=(...o)=>{he();const a=xn(i),l=Ee(t,i,e,o);return a(),de(),l});return n?s.unshift(r):s.push(r),r}else if(process.env.NODE_ENV!=="production"){const s=di(xr[e].replace(/ hook$/,""));U(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Ve=e=>(t,i=Mt)=>{(!Cn||e==="sp")&&ys(e,(...n)=>t(...n),i)},Dd=Ve("bm"),Rr=Ve("m"),Vd=Ve("bu"),Mr=Ve("u"),Na=Ve("bum"),Lr=Ve("um"),Fd=Ve("sp"),Gd=Ve("rtg"),Bd=Ve("rtc");function $d(e,t=Mt){ys("ec",e,t)}const Hd="components";function $i(e,t){return Ud(Hd,e,!0,t)||e}const Wd=Symbol.for("v-ndc");function Ud(e,t,i=!0,n=!1){const s=Gt||Mt;if(s){const r=s.type;{const a=Kr(r,!1);if(a&&(a===t||a===Ft(t)||a===hi(Ft(t))))return r}const o=Ta(s[e]||r[e],t)||Ta(s.appContext[e],t);return!o&&n?r:(process.env.NODE_ENV!=="production"&&i&&!o&&U(`Failed to resolve ${e.slice(0,-1)}: ${t}
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),o)}else process.env.NODE_ENV!=="production"&&U(`resolve${hi(e.slice(0,-1))} can only be used in render() or setup().`)}function Ta(e,t){return e&&(e[t]||e[Ft(t)]||e[hi(Ft(t))])}function Fe(e,t,i,n){let s;const r=i,o=Q(e);if(o||Nt(e)){const a=o&&qe(e);let l=!1,c=!1;a&&(l=!Bt(e),c=ue(e),e=is(e)),s=new Array(e.length);for(let h=0,d=e.length;h<d;h++)s[h]=t(l?c?Vi(fe(e[h])):fe(e[h]):e[h],h,void 0,r)}else if(typeof e=="number"){process.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&U(`The v-for range expect an integer value but got ${e}.`),s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,r)}else if(pt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,r));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const h=a[l];s[l]=t(e[h],h,l,r)}}else s=[];return s}const Ir=e=>e?cl(e)?Ms(e):Ir(e.parent):null,bi=Ct(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?we(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?we(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?we(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?we(e.refs):e.refs,$parent:e=>Ir(e.parent),$root:e=>Ir(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ra(e),$forceUpdate:e=>e.f||(e.f=()=>{ps(e.update)}),$nextTick:e=>e.n||(e.n=fs.bind(e.proxy)),$watch:e=>ru.bind(e)}),Dr=e=>e==="_"||e==="$",Vr=(e,t)=>e!==dt&&!e.__isScriptSetup&&lt(e,t),ka={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:i,setupState:n,data:s,props:r,accessCache:o,type:a,appContext:l}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;if(t[0]!=="$"){const u=o[t];if(u!==void 0)switch(u){case 1:return n[t];case 2:return s[t];case 4:return i[t];case 3:return r[t]}else{if(Vr(n,t))return o[t]=1,n[t];if(s!==dt&&lt(s,t))return o[t]=2,s[t];if(lt(r,t))return o[t]=3,r[t];if(i!==dt&&lt(i,t))return o[t]=4,i[t];Fr&&(o[t]=0)}}const c=bi[t];let h,d;if(c)return t==="$attrs"?(It(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&xs()):process.env.NODE_ENV!=="production"&&t==="$slots"&&It(e,"get",t),c(e);if((h=a.__cssModules)&&(h=h[t]))return h;if(i!==dt&&lt(i,t))return o[t]=4,i[t];if(d=l.config.globalProperties,lt(d,t))return d[t];process.env.NODE_ENV!=="production"&&Gt&&(!Nt(t)||t.indexOf("__v")!==0)&&(s!==dt&&Dr(t[0])&&lt(s,t)?U(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===Gt&&U(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,i){const{data:n,setupState:s,ctx:r}=e;return Vr(s,t)?(s[t]=i,!0):process.env.NODE_ENV!=="production"&&s.__isScriptSetup&&lt(s,t)?(U(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):n!==dt&&lt(n,t)?(n[t]=i,!0):lt(e.props,t)?(process.env.NODE_ENV!=="production"&&U(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&U(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:i}):r[t]=i,!0)},has({_:{data:e,setupState:t,accessCache:i,ctx:n,appContext:s,props:r,type:o}},a){let l;return!!(i[a]||e!==dt&&a[0]!=="$"&&lt(e,a)||Vr(t,a)||lt(r,a)||lt(n,a)||lt(bi,a)||lt(s.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,i){return i.get!=null?e._.accessCache[t]=0:lt(i,"value")&&this.set(e,t,i.value,null),Reflect.defineProperty(e,t,i)}};process.env.NODE_ENV!=="production"&&(ka.ownKeys=e=>(U("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function jd(e){const t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(bi).forEach(i=>{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,get:()=>bi[i](e),set:Lt})}),t}function Xd(e){const{ctx:t,propsOptions:[i]}=e;i&&Object.keys(i).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:Lt})})}function zd(e){const{ctx:t,setupState:i}=e;Object.keys(rt(i)).forEach(n=>{if(!i.__isScriptSetup){if(Dr(n[0])){U(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i[n],set:Lt})}})}function Oa(e){return Q(e)?e.reduce((t,i)=>(t[i]=null,t),{}):e}function Yd(){const e=Object.create(null);return(t,i)=>{e[i]?U(`${t} property "${i}" is already defined in ${e[i]}.`):e[i]=t}}let Fr=!0;function qd(e){const t=Ra(e),i=e.proxy,n=e.ctx;Fr=!1,t.beforeCreate&&Pa(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:h,beforeMount:d,mounted:u,beforeUpdate:f,updated:p,activated:_,deactivated:b,beforeDestroy:w,beforeUnmount:y,destroyed:x,unmounted:N,render:T,renderTracked:O,renderTriggered:E,errorCaptured:C,serverPrefetch:P,expose:H,inheritAttrs:K,components:z,directives:Z,filters:J}=t,A=process.env.NODE_ENV!=="production"?Yd():null;if(process.env.NODE_ENV!=="production"){const[B]=e.propsOptions;if(B)for(const D in B)A("Props",D)}if(c&&Kd(c,n,A),o)for(const B in o){const D=o[B];it(D)?(process.env.NODE_ENV!=="production"?Object.defineProperty(n,B,{value:D.bind(i),configurable:!0,enumerable:!0,writable:!0}):n[B]=D.bind(i),process.env.NODE_ENV!=="production"&&A("Methods",B)):process.env.NODE_ENV!=="production"&&U(`Method "${B}" has type "${typeof D}" in the component definition. Did you reference the function correctly?`)}if(s){process.env.NODE_ENV!=="production"&&!it(s)&&U("The data option must be a function. Plain object usage is no longer supported.");const B=s.call(i,i);if(process.env.NODE_ENV!=="production"&&rr(B)&&U("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!pt(B))process.env.NODE_ENV!=="production"&&U("data() should return an object.");else if(e.data=pi(B),process.env.NODE_ENV!=="production")for(const D in B)A("Data",D),Dr(D[0])||Object.defineProperty(n,D,{configurable:!0,enumerable:!0,get:()=>B[D],set:Lt})}if(Fr=!0,r)for(const B in r){const D=r[B],nt=it(D)?D.bind(i,i):it(D.get)?D.get.bind(i,i):Lt;process.env.NODE_ENV!=="production"&&nt===Lt&&U(`Computed property "${B}" has no getter.`);const ht=!it(D)&&it(D.set)?D.set.bind(i):process.env.NODE_ENV!=="production"?()=>{U(`Write operation failed: computed property "${B}" is readonly.`)}:Lt,ot=wi({get:nt,set:ht});Object.defineProperty(n,B,{enumerable:!0,configurable:!0,get:()=>ot.value,set:mt=>ot.value=mt}),process.env.NODE_ENV!=="production"&&A("Computed",B)}if(a)for(const B in a)Aa(a[B],n,i,B);if(l){const B=it(l)?l.call(i):l;Reflect.ownKeys(B).forEach(D=>{iu(D,B[D])})}h&&Pa(h,e,"c");function L(B,D){Q(D)?D.forEach(nt=>B(nt.bind(i))):D&&B(D.bind(i))}if(L(Dd,d),L(Rr,u),L(Vd,f),L(Mr,p),L(Md,_),L(Ld,b),L($d,C),L(Bd,O),L(Gd,E),L(Na,y),L(Lr,N),L(Fd,P),Q(H))if(H.length){const B=e.exposed||(e.exposed={});H.forEach(D=>{Object.defineProperty(B,D,{get:()=>i[D],set:nt=>i[D]=nt,enumerable:!0})})}else e.exposed||(e.exposed={});T&&e.render===Lt&&(e.render=T),K!=null&&(e.inheritAttrs=K),z&&(e.components=z),Z&&(e.directives=Z),P&&wa(e)}function Kd(e,t,i=Lt){Q(e)&&(e=Gr(e));for(const n in e){const s=e[n];let r;pt(s)?"default"in s?r=ws(s.from||n,s.default,!0):r=ws(s.from||n):r=ws(s),Rt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[n]=r,process.env.NODE_ENV!=="production"&&i("Inject",n)}}function Pa(e,t,i){Ee(Q(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,i)}function Aa(e,t,i,n){let s=n.includes(".")?Va(i,n):()=>i[n];if(Nt(e)){const r=t[e];it(r)?yi(s,r):process.env.NODE_ENV!=="production"&&U(`Invalid watch handler specified by key "${e}"`,r)}else if(it(e))yi(s,e.bind(i));else if(pt(e))if(Q(e))e.forEach(r=>Aa(r,t,i,n));else{const r=it(e.handler)?e.handler.bind(i):t[e.handler];it(r)?yi(s,r,e):process.env.NODE_ENV!=="production"&&U(`Invalid watch handler specified by key "${e.handler}"`,r)}else process.env.NODE_ENV!=="production"&&U(`Invalid watch option: "${n}"`,e)}function Ra(e){const t=e.type,{mixins:i,extends:n}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,a=r.get(t);let l;return a?l=a:!s.length&&!i&&!n?l=t:(l={},s.length&&s.forEach(c=>Ss(l,c,o,!0)),Ss(l,t,o)),pt(t)&&r.set(t,l),l}function Ss(e,t,i,n=!1){const{mixins:s,extends:r}=t;r&&Ss(e,r,i,!0),s&&s.forEach(o=>Ss(e,o,i,!0));for(const o in t)if(n&&o==="expose")process.env.NODE_ENV!=="production"&&U('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=Jd[o]||i&&i[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Jd={data:Ma,props:La,emits:La,methods:vn,computed:vn,beforeCreate:Ht,created:Ht,beforeMount:Ht,mounted:Ht,beforeUpdate:Ht,updated:Ht,beforeDestroy:Ht,beforeUnmount:Ht,destroyed:Ht,unmounted:Ht,activated:Ht,deactivated:Ht,errorCaptured:Ht,serverPrefetch:Ht,components:vn,directives:vn,watch:Zd,provide:Ma,inject:Qd};function Ma(e,t){return t?e?function(){return Ct(it(e)?e.call(this,this):e,it(t)?t.call(this,this):t)}:t:e}function Qd(e,t){return vn(Gr(e),Gr(t))}function Gr(e){if(Q(e)){const t={};for(let i=0;i<e.length;i++)t[e[i]]=e[i];return t}return e}function Ht(e,t){return e?[...new Set([].concat(e,t))]:t}function vn(e,t){return e?Ct(Object.create(null),e,t):t}function La(e,t){return e?Q(e)&&Q(t)?[...new Set([...e,...t])]:Ct(Object.create(null),Oa(e),Oa(t??{})):t}function Zd(e,t){if(!e)return t;if(!t)return e;const i=Ct(Object.create(null),e);for(const n in t)i[n]=Ht(e[n],t[n]);return i}function Ia(){return{app:null,config:{isNativeTag:Lo,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}}let tu=0;function eu(e,t){return function(n,s=null){it(n)||(n=Ct({},n)),s!=null&&!pt(s)&&(process.env.NODE_ENV!=="production"&&U("root props passed to app.mount() must be an object."),s=null);const r=Ia(),o=new WeakSet,a=[];let l=!1;const c=r.app={_uid:tu++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:gl,get config(){return r.config},set config(h){process.env.NODE_ENV!=="production"&&U("app.config cannot be replaced. Modify individual options instead.")},use(h,...d){return o.has(h)?process.env.NODE_ENV!=="production"&&U("Plugin has already been applied to target app."):h&&it(h.install)?(o.add(h),h.install(c,...d)):it(h)?(o.add(h),h(c,...d)):process.env.NODE_ENV!=="production"&&U('A plugin must either be a function or an object with an "install" function.'),c},mixin(h){return r.mixins.includes(h)?process.env.NODE_ENV!=="production"&&U("Mixin has already been applied to target app"+(h.name?`: ${h.name}`:"")):r.mixins.push(h),c},component(h,d){return process.env.NODE_ENV!=="production"&&qr(h,r.config),d?(process.env.NODE_ENV!=="production"&&r.components[h]&&U(`Component "${h}" has already been registered in target app.`),r.components[h]=d,c):r.components[h]},directive(h,d){return process.env.NODE_ENV!=="production"&&Sa(h),d?(process.env.NODE_ENV!=="production"&&r.directives[h]&&U(`Directive "${h}" has already been registered in target app.`),r.directives[h]=d,c):r.directives[h]},mount(h,d,u){if(l)process.env.NODE_ENV!=="production"&&U("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!=="production"&&h.__vue_app__&&U("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const f=c._ceVNode||Tt(n,s);return f.appContext=r,u===!0?u="svg":u===!1&&(u=void 0),process.env.NODE_ENV!=="production"&&(r.reload=()=>{const p=Qe(f);p.el=null,e(p,h,u)}),e(f,h,u),l=!0,c._container=h,h.__vue_app__=c,process.env.NODE_ENV!=="production"&&(c._instance=f.component,wd(c,gl)),Ms(f.component)}},onUnmount(h){process.env.NODE_ENV!=="production"&&typeof h!="function"&&U(`Expected function as first argument to app.onUnmount(), but got ${typeof h}`),a.push(h)},unmount(){l?(Ee(a,c._instance,16),e(null,c._container),process.env.NODE_ENV!=="production"&&(c._instance=null,Ed(c)),delete c._container.__vue_app__):process.env.NODE_ENV!=="production"&&U("Cannot unmount an app that is not mounted.")},provide(h,d){return process.env.NODE_ENV!=="production"&&h in r.provides&&(lt(r.provides,h)?U(`App already provides property with key "${String(h)}". It will be overwritten with the new value.`):U(`App already provides property with key "${String(h)}" inherited from its parent element. It will be overwritten with the new value.`)),r.provides[h]=d,c},runWithContext(h){const d=Hi;Hi=c;try{return h()}finally{Hi=d}}};return c}}let Hi=null;function iu(e,t){if(process.env.NODE_ENV!=="production"&&(!Mt||Mt.isMounted)&&U("provide() can only be used inside setup()."),Mt){let i=Mt.provides;const n=Mt.parent&&Mt.parent.provides;n===i&&(i=Mt.provides=Object.create(n)),i[e]=t}}function ws(e,t,i=!1){const n=As();if(n||Hi){let s=Hi?Hi._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return i&&it(t)?t.call(n&&n.proxy):t;process.env.NODE_ENV!=="production"&&U(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&U("inject() can only be used inside setup() or functional components.")}const nu=Symbol.for("v-scx"),su=()=>{{const e=ws(nu);return e||process.env.NODE_ENV!=="production"&&U("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function yi(e,t,i){return process.env.NODE_ENV!=="production"&&!it(t)&&U("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Da(e,t,i)}function Da(e,t,i=dt){const{immediate:n,deep:s,flush:r,once:o}=i;process.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&U('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&U('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&U('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=Ct({},i);process.env.NODE_ENV!=="production"&&(a.onWarn=U);const l=t&&n||!t&&r!=="post";let c;if(Cn){if(r==="sync"){const f=su();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=Lt,f.resume=Lt,f.pause=Lt,f}}const h=Mt;a.call=(f,p,_)=>Ee(f,h,p,_);let d=!1;r==="post"?a.scheduler=f=>{Qt(f,h&&h.suspense)}:r!=="sync"&&(d=!0,a.scheduler=(f,p)=>{p?f():ps(f)}),a.augmentJob=f=>{t&&(f.flags|=4),d&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const u=hd(e,t,a);return Cn&&(c?c.push(u):l&&u()),u}function ru(e,t,i){const n=this.proxy,s=Nt(e)?e.includes(".")?Va(n,e):()=>n[e]:e.bind(n,n);let r;it(t)?r=t:(r=t.handler,i=t);const o=xn(this),a=Da(s,r.bind(n),i);return o(),a}function Va(e,t){const i=t.split(".");return()=>{let n=e;for(let s=0;s<i.length&&n;s++)n=n[i[s]];return n}}const ou=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ft(t)}Modifiers`]||e[`${Jt(t)}Modifiers`];function au(e,t,...i){if(e.isUnmounted)return;const n=e.vnode.props||dt;if(process.env.NODE_ENV!=="production"){const{emitsOptions:h,propsOptions:[d]}=e;if(h)if(!(t in h))(!d||!(di(Ft(t))in d))&&U(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${di(Ft(t))}" prop.`);else{const u=h[t];it(u)&&(u(...i)||U(`Invalid event arguments: event validation failed for event "${t}".`))}}let s=i;const r=t.startsWith("update:"),o=r&&ou(n,t.slice(7));if(o&&(o.trim&&(s=i.map(h=>Nt(h)?h.trim():h)),o.number&&(s=i.map(es))),process.env.NODE_ENV!=="production"&&Od(e,t,s),process.env.NODE_ENV!=="production"){const h=t.toLowerCase();h!==t&&n[di(h)]&&U(`Event "${h}" is emitted in component ${Nn(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Jt(t)}" instead of "${t}".`)}let a,l=n[a=di(t)]||n[a=di(Ft(t))];!l&&r&&(l=n[a=di(Jt(t))]),l&&Ee(l,e,6,s);const c=n[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Ee(c,e,6,s)}}const lu=new WeakMap;function Fa(e,t,i=!1){const n=i?lu:t.emitsCache,s=n.get(e);if(s!==void 0)return s;const r=e.emits;let o={},a=!1;if(!it(e)){const l=c=>{const h=Fa(c,t,!0);h&&(a=!0,Ct(o,h))};!i&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!r&&!a?(pt(e)&&n.set(e,null),null):(Q(r)?r.forEach(l=>o[l]=null):Ct(o,r),pt(e)&&n.set(e,o),o)}function Es(e,t){return!e||!en(t)?!1:(t=t.slice(2).replace(/Once$/,""),lt(e,t[0].toLowerCase()+t.slice(1))||lt(e,Jt(t))||lt(e,t))}let Br=!1;function xs(){Br=!0}function Ga(e){const{type:t,vnode:i,proxy:n,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:h,props:d,data:u,setupState:f,ctx:p,inheritAttrs:_}=e,b=_s(e);let w,y;process.env.NODE_ENV!=="production"&&(Br=!1);try{if(i.shapeFlag&4){const T=s||n,O=process.env.NODE_ENV!=="production"&&f.__isScriptSetup?new Proxy(T,{get(E,C,P){return U(`Property '${String(C)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(E,C,P)}}):T;w=ge(c.call(O,T,h,process.env.NODE_ENV!=="production"?we(d):d,f,u,p)),y=a}else{const T=t;process.env.NODE_ENV!=="production"&&a===d&&xs(),w=ge(T.length>1?T(process.env.NODE_ENV!=="production"?we(d):d,process.env.NODE_ENV!=="production"?{get attrs(){return xs(),we(a)},slots:o,emit:l}:{attrs:a,slots:o,emit:l}):T(process.env.NODE_ENV!=="production"?we(d):d,null)),y=t.props?a:cu(a)}}catch(T){Sn.length=0,dn(T,e,1),w=Tt(Zt)}let x=w,N;if(process.env.NODE_ENV!=="production"&&w.patchFlag>0&&w.patchFlag&2048&&([x,N]=Ba(w)),y&&_!==!1){const T=Object.keys(y),{shapeFlag:O}=x;if(T.length){if(O&7)r&&T.some(Jn)&&(y=hu(y,r)),x=Qe(x,y,!1,!0);else if(process.env.NODE_ENV!=="production"&&!Br&&x.type!==Zt){const E=Object.keys(a),C=[],P=[];for(let H=0,K=E.length;H<K;H++){const z=E[H];en(z)?Jn(z)||C.push(z[2].toLowerCase()+z.slice(3)):P.push(z)}P.length&&U(`Extraneous non-props attributes (${P.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),C.length&&U(`Extraneous non-emits event listeners (${C.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return i.dirs&&(process.env.NODE_ENV!=="production"&&!$a(x)&&U("Runtime directive used on component with non-element root node. The directives will not function as intended."),x=Qe(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(i.dirs):i.dirs),i.transition&&(process.env.NODE_ENV!=="production"&&!$a(x)&&U("Component inside <Transition> renders non-element root node that cannot be animated."),Pr(x,i.transition)),process.env.NODE_ENV!=="production"&&N?N(x):w=x,_s(b),w}const Ba=e=>{const t=e.children,i=e.dynamicChildren,n=$r(t,!1);if(n){if(process.env.NODE_ENV!=="production"&&n.patchFlag>0&&n.patchFlag&2048)return Ba(n)}else return[e,void 0];const s=t.indexOf(n),r=i?i.indexOf(n):-1,o=a=>{t[s]=a,i&&(r>-1?i[r]=a:a.patchFlag>0&&(e.dynamicChildren=[...i,a]))};return[ge(n),o]};function $r(e,t=!0){let i;for(let n=0;n<e.length;n++){const s=e[n];if(ji(s)){if(s.type!==Zt||s.children==="v-if"){if(i)return;if(i=s,process.env.NODE_ENV!=="production"&&t&&i.patchFlag>0&&i.patchFlag&2048)return $r(i.children)}}else return}return i}const cu=e=>{let t;for(const i in e)(i==="class"||i==="style"||en(i))&&((t||(t={}))[i]=e[i]);return t},hu=(e,t)=>{const i={};for(const n in e)(!Jn(n)||!(n.slice(9)in t))&&(i[n]=e[n]);return i},$a=e=>e.shapeFlag&7||e.type===Zt;function du(e,t,i){const{props:n,children:s,component:r}=e,{props:o,children:a,patchFlag:l}=t,c=r.emitsOptions;if(process.env.NODE_ENV!=="production"&&(s||a)&&Ce||t.dirs||t.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return n?Ha(n,o,c):!!o;if(l&8){const h=t.dynamicProps;for(let d=0;d<h.length;d++){const u=h[d];if(o[u]!==n[u]&&!Es(c,u))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?Ha(n,o,c):!0:!!o;return!1}function Ha(e,t,i){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let s=0;s<n.length;s++){const r=n[s];if(t[r]!==e[r]&&!Es(i,r))return!0}return!1}function uu({vnode:e,parent:t},i){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=i,t=t.parent;else break}}const Wa={},Ua=()=>Object.create(Wa),ja=e=>Object.getPrototypeOf(e)===Wa;function fu(e,t,i,n=!1){const s={},r=Ua();e.propsDefaults=Object.create(null),Xa(e,t,s,r);for(const o in e.propsOptions[0])o in s||(s[o]=void 0);process.env.NODE_ENV!=="production"&&qa(t||{},s,e),i?e.props=n?s:id(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function pu(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function gu(e,t,i,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=e,a=rt(s),[l]=e.propsOptions;let c=!1;if(!(process.env.NODE_ENV!=="production"&&pu(e))&&(n||o>0)&&!(o&16)){if(o&8){const h=e.vnode.dynamicProps;for(let d=0;d<h.length;d++){let u=h[d];if(Es(e.emitsOptions,u))continue;const f=t[u];if(l)if(lt(r,u))f!==r[u]&&(r[u]=f,c=!0);else{const p=Ft(u);s[p]=Hr(l,a,p,f,e,!1)}else f!==r[u]&&(r[u]=f,c=!0)}}}else{Xa(e,t,s,r)&&(c=!0);let h;for(const d in a)(!t||!lt(t,d)&&((h=Jt(d))===d||!lt(t,h)))&&(l?i&&(i[d]!==void 0||i[h]!==void 0)&&(s[d]=Hr(l,a,d,void 0,e,!0)):delete s[d]);if(r!==a)for(const d in r)(!t||!lt(t,d))&&(delete r[d],c=!0)}c&&Se(e.attrs,"set",""),process.env.NODE_ENV!=="production"&&qa(t||{},s,e)}function Xa(e,t,i,n){const[s,r]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(sn(l))continue;const c=t[l];let h;s&&lt(s,h=Ft(l))?!r||!r.includes(h)?i[h]=c:(a||(a={}))[h]=c:Es(e.emitsOptions,l)||(!(l in n)||c!==n[l])&&(n[l]=c,o=!0)}if(r){const l=rt(i),c=a||dt;for(let h=0;h<r.length;h++){const d=r[h];i[d]=Hr(s,l,d,c[d],e,!lt(c,d))}}return o}function Hr(e,t,i,n,s,r){const o=e[i];if(o!=null){const a=lt(o,"default");if(a&&n===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&it(l)){const{propsDefaults:c}=s;if(i in c)n=c[i];else{const h=xn(s);n=c[i]=l.call(null,t),h()}}else n=l;s.ce&&s.ce._setProp(i,n)}o[0]&&(r&&!a?n=!1:o[1]&&(n===""||n===Jt(i))&&(n=!0))}return n}const mu=new WeakMap;function za(e,t,i=!1){const n=i?mu:t.propsCache,s=n.get(e);if(s)return s;const r=e.props,o={},a=[];let l=!1;if(!it(e)){const h=d=>{l=!0;const[u,f]=za(d,t,!0);Ct(o,u),f&&a.push(...f)};!i&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!r&&!l)return pt(e)&&n.set(e,Mi),Mi;if(Q(r))for(let h=0;h<r.length;h++){process.env.NODE_ENV!=="production"&&!Nt(r[h])&&U("props must be strings when using array syntax.",r[h]);const d=Ft(r[h]);Ya(d)&&(o[d]=dt)}else if(r){process.env.NODE_ENV!=="production"&&!pt(r)&&U("invalid props options",r);for(const h in r){const d=Ft(h);if(Ya(d)){const u=r[h],f=o[d]=Q(u)||it(u)?{type:u}:Ct({},u),p=f.type;let _=!1,b=!0;if(Q(p))for(let w=0;w<p.length;++w){const y=p[w],x=it(y)&&y.name;if(x==="Boolean"){_=!0;break}else x==="String"&&(b=!1)}else _=it(p)&&p.name==="Boolean";f[0]=_,f[1]=b,(_||lt(f,"default"))&&a.push(d)}}}const c=[o,a];return pt(e)&&n.set(e,c),c}function Ya(e){return e[0]!=="$"&&!sn(e)?!0:(process.env.NODE_ENV!=="production"&&U(`Invalid prop name: "${e}" is a reserved property.`),!1)}function _u(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function qa(e,t,i){const n=rt(t),s=i.propsOptions[0],r=Object.keys(e).map(o=>Ft(o));for(const o in s){let a=s[o];a!=null&&vu(o,n[o],a,process.env.NODE_ENV!=="production"?we(n):n,!r.includes(o))}}function vu(e,t,i,n,s){const{type:r,required:o,validator:a,skipCheck:l}=i;if(o&&s){U('Missing required prop: "'+e+'"');return}if(!(t==null&&!o)){if(r!=null&&r!==!0&&!l){let c=!1;const h=Q(r)?r:[r],d=[];for(let u=0;u<h.length&&!c;u++){const{valid:f,expectedType:p}=yu(t,h[u]);d.push(p||""),c=f}if(!c){U(Su(e,t,d));return}}a&&!a(t,n)&&U('Invalid prop: custom validator check failed for prop "'+e+'".')}}const bu=Kt("String,Number,Boolean,Function,Symbol,BigInt");function yu(e,t){let i;const n=_u(t);if(n==="null")i=e===null;else if(bu(n)){const s=typeof e;i=s===n.toLowerCase(),!i&&s==="object"&&(i=e instanceof t)}else n==="Object"?i=pt(e):n==="Array"?i=Q(e):i=e instanceof t;return{valid:i,expectedType:n}}function Su(e,t,i){if(i.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${e}". Expected ${i.map(hi).join(" | ")}`;const s=i[0],r=or(t),o=Ka(t,s),a=Ka(t,r);return i.length===1&&Ja(s)&&!wu(s,r)&&(n+=` with value ${o}`),n+=`, got ${r} `,Ja(r)&&(n+=`with value ${a}.`),n}function Ka(e,t){return t==="String"?`"${e}"`:t==="Number"?`${Number(e)}`:`${e}`}function Ja(e){return["string","number","boolean"].some(i=>e.toLowerCase()===i)}function wu(...e){return e.some(t=>t.toLowerCase()==="boolean")}const Wr=e=>e==="_"||e==="_ctx"||e==="$stable",Ur=e=>Q(e)?e.map(ge):[ge(e)],Eu=(e,t,i)=>{if(t._n)return t;const n=gn((...s)=>(process.env.NODE_ENV!=="production"&&Mt&&!(i===null&&Gt)&&!(i&&i.root!==Mt.root)&&U(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),Ur(t(...s))),i);return n._c=!1,n},Qa=(e,t,i)=>{const n=e._ctx;for(const s in e){if(Wr(s))continue;const r=e[s];if(it(r))t[s]=Eu(s,r,n);else if(r!=null){process.env.NODE_ENV!=="production"&&U(`Non-function value encountered for slot "${s}". Prefer function slots for better performance.`);const o=Ur(r);t[s]=()=>o}}},Za=(e,t)=>{process.env.NODE_ENV!=="production"&&!Ar(e.vnode)&&U("Non-function value encountered for default slot. Prefer function slots for better performance.");const i=Ur(t);e.slots.default=()=>i},jr=(e,t,i)=>{for(const n in t)(i||!Wr(n))&&(e[n]=t[n])},xu=(e,t,i)=>{const n=e.slots=Ua();if(e.vnode.shapeFlag&32){const s=t._;s?(jr(n,t,i),i&&ts(n,"_",s,!0)):Qa(t,n)}else t&&Za(e,t)},Cu=(e,t,i)=>{const{vnode:n,slots:s}=e;let r=!0,o=dt;if(n.shapeFlag&32){const a=t._;a?process.env.NODE_ENV!=="production"&&Ce?(jr(s,t,i),Se(e,"set","$slots")):i&&a===1?r=!1:jr(s,t,i):(r=!t.$stable,Qa(t,s)),o=t}else t&&(Za(e,t),o={default:1});if(r)for(const a in s)!Wr(a)&&o[a]==null&&delete s[a]};let bn,Ge;function Wi(e,t){e.appContext.config.performance&&Cs()&&Ge.mark(`vue-${t}-${e.uid}`),process.env.NODE_ENV!=="production"&&Td(e,t,Cs()?Ge.now():Date.now())}function Ui(e,t){if(e.appContext.config.performance&&Cs()){const i=`vue-${t}-${e.uid}`,n=i+":end",s=`<${Nn(e,e.type)}> ${t}`;Ge.mark(n),Ge.measure(s,i,n),Ge.clearMeasures(s),Ge.clearMarks(i),Ge.clearMarks(n)}process.env.NODE_ENV!=="production"&&kd(e,t,Cs()?Ge.now():Date.now())}function Cs(){return bn!==void 0||(typeof window<"u"&&window.performance?(bn=!0,Ge=window.performance):bn=!1),bn}function Nu(){const e=[];if(process.env.NODE_ENV!=="production"&&e.length){const t=e.length>1;console.warn(`Feature flag${t?"s":""} ${e.join(", ")} ${t?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
3
+ `,...Sd(s)),console.warn(...r)}ue(),xr=!1}function wd(){let e=_i[_i.length-1];if(!e)return[];const t=[];for(;e;){const i=t[0];i&&i.vnode===e?i.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function Sd(e){const t=[];return e.forEach((i,n)=>{t.push(...n===0?[]:[`
4
+ `],...Ed(i))}),t}function Ed({vnode:e,recurseCount:t}){const i=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,s=` at <${Tn(e.component,e.type,n)}`,r=">"+i;return e.props?[s,...xd(e.props),r]:[s+r]}function xd(e){const t=[],i=Object.keys(e);return i.slice(0,3).forEach(n=>{t.push(...fa(n,e[n]))}),i.length>3&&t.push(" ..."),t}function fa(e,t,i){return Nt(t)?(t=JSON.stringify(t),i?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?i?t:[`${e}=${t}`]:Mt(t)?(t=fa(e,rt(t.value),!0),i?t:[`${e}=Ref<`,t,">"]):it(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=rt(t),i?t:[`${e}=`,t])}const Cr={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Fi(e,t,i,n){try{return n?e(...n):e()}catch(s){un(s,t,i)}}function xe(e,t,i,n){if(it(e)){const s=Fi(e,t,i,n);return s&&or(s)&&s.catch(r=>{un(r,t,i)}),s}if(Q(e)){const s=[];for(let r=0;r<e.length;r++)s.push(xe(e[r],t,i,n));return s}else process.env.NODE_ENV!=="production"&&U(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function un(e,t,i,n=!0){const s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||dt;if(t){let a=t.parent;const l=t.proxy,h=process.env.NODE_ENV!=="production"?Cr[i]:`https://vuejs.org/error-reference/#runtime-${i}`;for(;a;){const c=a.ec;if(c){for(let d=0;d<c.length;d++)if(c[d](e,l,h)===!1)return}a=a.parent}if(r){de(),Fi(r,null,10,[e,l,h]),ue();return}}Cd(e,i,s,n,o)}function Cd(e,t,i,n=!0,s=!1){if(process.env.NODE_ENV!=="production"){const r=Cr[t];if(i&&ds(i),U(`Unhandled error${r?` during execution of ${r}`:""}`),i&&us(),n)throw e;console.error(e)}else{if(s)throw e;console.error(e)}}const Bt=[];let Ce=-1;const Gi=[];let Ke=null,$i=0;const pa=Promise.resolve();let fs=null;const Nd=100;function ps(e){const t=fs||pa;return e?t.then(this?e.bind(this):e):t}function Td(e){let t=Ce+1,i=Bt.length;for(;t<i;){const n=t+i>>>1,s=Bt[n],r=fn(s);r<e||r===e&&s.flags&2?t=n+1:i=n}return t}function gs(e){if(!(e.flags&1)){const t=fn(e),i=Bt[Bt.length-1];!i||!(e.flags&2)&&t>=fn(i)?Bt.push(e):Bt.splice(Td(t),0,e),e.flags|=1,ga()}}function ga(){fs||(fs=pa.then(ba))}function ma(e){Q(e)?Gi.push(...e):Ke&&e.id===-1?Ke.splice($i+1,0,e):e.flags&1||(Gi.push(e),e.flags|=1),ga()}function _a(e,t,i=Ce+1){for(process.env.NODE_ENV!=="production"&&(t=t||new Map);i<Bt.length;i++){const n=Bt[i];if(n&&n.flags&2){if(e&&n.id!==e.uid||process.env.NODE_ENV!=="production"&&Nr(t,n))continue;Bt.splice(i,1),i--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function ya(e){if(Gi.length){const t=[...new Set(Gi)].sort((i,n)=>fn(i)-fn(n));if(Gi.length=0,Ke){Ke.push(...t);return}for(Ke=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),$i=0;$i<Ke.length;$i++){const i=Ke[$i];process.env.NODE_ENV!=="production"&&Nr(e,i)||(i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2)}Ke=null,$i=0}}const fn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ba(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?i=>Nr(e,i):Lt;try{for(Ce=0;Ce<Bt.length;Ce++){const i=Bt[Ce];if(i&&!(i.flags&8)){if(process.env.NODE_ENV!=="production"&&t(i))continue;i.flags&4&&(i.flags&=-2),Fi(i,i.i,i.i?15:14),i.flags&4||(i.flags&=-2)}}}finally{for(;Ce<Bt.length;Ce++){const i=Bt[Ce];i&&(i.flags&=-2)}Ce=-1,Bt.length=0,ya(e),fs=null,(Bt.length||Gi.length)&&ba(e)}}function Nr(e,t){const i=e.get(t)||0;if(i>Nd){const n=t.i,s=n&&Jr(n.type);return un(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,i+1),!1}let Ne=!1;const ms=new Map;process.env.NODE_ENV!=="production"&&(on().__VUE_HMR_RUNTIME__={createRecord:Tr(va),rerender:Tr(Od),reload:Tr(Ad)});const yi=new Map;function kd(e){const t=e.type.__hmrId;let i=yi.get(t);i||(va(t,e.type),i=yi.get(t)),i.instances.add(e)}function Pd(e){yi.get(e.type.__hmrId).instances.delete(e)}function va(e,t){return yi.has(e)?!1:(yi.set(e,{initialDef:_s(t),instances:new Set}),!0)}function _s(e){return _l(e)?e.__vccOpts:e}function Od(e,t){const i=yi.get(e);i&&(i.initialDef.render=t,[...i.instances].forEach(n=>{t&&(n.render=t,_s(n.type).render=t),n.renderCache=[],Ne=!0,n.job.flags&8||n.update(),Ne=!1}))}function Ad(e,t){const i=yi.get(e);if(!i)return;t=_s(t),wa(i.initialDef,t);const n=[...i.instances];for(let s=0;s<n.length;s++){const r=n[s],o=_s(r.type);let a=ms.get(o);a||(o!==i.initialDef&&wa(o,t),ms.set(o,a=new Set)),a.add(r),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(a.add(r),r.ceReload(t.styles),a.delete(r)):r.parent?gs(()=>{r.job.flags&8||(Ne=!0,r.parent.update(),Ne=!1,a.delete(r))}):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),r.root.ce&&r!==r.root&&r.root.ce._removeChildStyle(o)}ma(()=>{ms.clear()})}function wa(e,t){Ct(e,t);for(const i in e)i!=="__file"&&!(i in t)&&delete e[i]}function Tr(e){return(t,i)=>{try{return e(t,i)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let ge,pn=[],kr=!1;function gn(e,...t){ge?ge.emit(e,...t):kr||pn.push({event:e,args:t})}function Pr(e,t){var i,n;ge=e,ge?(ge.enabled=!0,pn.forEach(({event:s,args:r})=>ge.emit(s,...r)),pn=[]):typeof window<"u"&&window.HTMLElement&&!((n=(i=window.navigator)==null?void 0:i.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Pr(r,t)}),setTimeout(()=>{ge||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,kr=!0,pn=[])},3e3)):(kr=!0,pn=[])}function Md(e,t){gn("app:init",e,t,{Fragment:Dt,Text:wn,Comment:te,Static:ks})}function Rd(e){gn("app:unmount",e)}const Ld=Or("component:added"),Sa=Or("component:updated"),Id=Or("component:removed"),Dd=e=>{ge&&typeof ge.cleanupBuffer=="function"&&!ge.cleanupBuffer(e)&&Id(e)};function Or(e){return t=>{gn(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}const Vd=Ea("perf:start"),Fd=Ea("perf:end");function Ea(e){return(t,i,n)=>{gn(e,t.appContext.app,t.uid,t,i,n)}}function Gd(e,t,i){gn("component:emit",e.appContext.app,e,t,i)}let Gt=null,xa=null;function ys(e){const t=Gt;return Gt=e,xa=e&&e.type.__scopeId||null,t}function mn(e,t=Gt,i){if(!t||e._n)return e;const n=(...s)=>{n._d&&Ps(-1);const r=ys(t);let o;try{o=e(...s)}finally{ys(r),n._d&&Ps(1)}return process.env.NODE_ENV!=="production"&&Sa(t),o};return n._n=!0,n._c=!0,n._d=!0,n}function Ca(e){Ah(e)&&U("Do not use built-in directive ids as custom directive id: "+e)}function bs(e,t){if(Gt===null)return process.env.NODE_ENV!=="production"&&U("withDirectives can only be used inside render functions."),e;const i=Ls(Gt),n=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[r,o,a,l=dt]=t[s];r&&(it(r)&&(r={mounted:r,updated:r}),r.deep&&De(o),n.push({dir:r,instance:i,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function bi(e,t,i,n){const s=e.dirs,r=t&&t.dirs;for(let o=0;o<s.length;o++){const a=s[o];r&&(a.oldValue=r[o].value);let l=a.dir[n];l&&(de(),xe(l,i,8,[e.el,a,e,t]),ue())}}const $d=Symbol("_vte"),Bd=e=>e.__isTeleport,Hd=Symbol("_leaveCb");function Ar(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ar(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Te(e,t){return it(e)?Ct({name:e.name},t,{setup:e}):e}function Na(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Ta=new WeakSet,vs=new WeakMap;function _n(e,t,i,n,s=!1){if(Q(e)){e.forEach((_,v)=>_n(_,t&&(Q(t)?t[v]:t),i,n,s));return}if(yn(n)&&!s){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&_n(e,t,i,n.component.subTree);return}const r=n.shapeFlag&4?Ls(n.component):n.el,o=s?null:r,{i:a,r:l}=e;if(process.env.NODE_ENV!=="production"&&!a){U("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const h=t&&t.r,c=a.refs===dt?a.refs={}:a.refs,d=a.setupState,u=rt(d),f=d===dt?Fo:_=>process.env.NODE_ENV!=="production"&&(lt(u,_)&&!Mt(u[_])&&U(`Template ref "${_}" used on a non-ref value. It will not work in the production build.`),Ta.has(u[_]))?!1:lt(u,_),p=_=>process.env.NODE_ENV==="production"||!Ta.has(_);if(h!=null&&h!==l){if(ka(t),Nt(h))c[h]=null,f(h)&&(d[h]=null);else if(Mt(h)){p(h)&&(h.value=null);const _=t;_.k&&(c[_.k]=null)}}if(it(l))Fi(l,a,12,[o,c]);else{const _=Nt(l),v=Mt(l);if(_||v){const S=()=>{if(e.f){const b=_?f(l)?d[l]:c[l]:p(l)||!e.k?l.value:c[e.k];if(s)Q(b)&&rr(b,r);else if(Q(b))b.includes(r)||b.push(r);else if(_)c[l]=[r],f(l)&&(d[l]=c[l]);else{const x=[r];p(l)&&(l.value=x),e.k&&(c[e.k]=x)}}else _?(c[l]=o,f(l)&&(d[l]=o)):v?(p(l)&&(l.value=o),e.k&&(c[e.k]=o)):process.env.NODE_ENV!=="production"&&U("Invalid template ref type:",l,`(${typeof l})`)};if(o){const b=()=>{S(),vs.delete(e)};b.id=-1,vs.set(e,b),Zt(b,i)}else ka(e),S()}else process.env.NODE_ENV!=="production"&&U("Invalid template ref type:",l,`(${typeof l})`)}}function ka(e){const t=vs.get(e);t&&(t.flags|=8,vs.delete(e))}on().requestIdleCallback,on().cancelIdleCallback;const yn=e=>!!e.type.__asyncLoader,Mr=e=>e.type.__isKeepAlive;function Wd(e,t){Pa(e,"a",t)}function Ud(e,t){Pa(e,"da",t)}function Pa(e,t,i=Rt){const n=e.__wdc||(e.__wdc=()=>{let s=i;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ws(t,n,i),i){let s=i.parent;for(;s&&s.parent;)Mr(s.parent.vnode)&&jd(n,t,i,s),s=s.parent}}function jd(e,t,i,n){const s=ws(t,e,n,!0);Ir(()=>{rr(n[t],s)},i)}function ws(e,t,i=Rt,n=!1){if(i){const s=i[e]||(i[e]=[]),r=t.__weh||(t.__weh=(...o)=>{de();const a=Cn(i),l=xe(t,i,e,o);return a(),ue(),l});return n?s.unshift(r):s.push(r),r}else if(process.env.NODE_ENV!=="production"){const s=ui(Cr[e].replace(/ hook$/,""));U(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Ve=e=>(t,i=Rt)=>{(!Nn||e==="sp")&&ws(e,(...n)=>t(...n),i)},Xd=Ve("bm"),Rr=Ve("m"),zd=Ve("bu"),Lr=Ve("u"),Oa=Ve("bum"),Ir=Ve("um"),Yd=Ve("sp"),qd=Ve("rtg"),Kd=Ve("rtc");function Jd(e,t=Rt){ws("ec",e,t)}const Qd="components";function Bi(e,t){return tu(Qd,e,!0,t)||e}const Zd=Symbol.for("v-ndc");function tu(e,t,i=!0,n=!1){const s=Gt||Rt;if(s){const r=s.type;{const a=Jr(r,!1);if(a&&(a===t||a===Ft(t)||a===di(Ft(t))))return r}const o=Aa(s[e]||r[e],t)||Aa(s.appContext[e],t);return!o&&n?r:(process.env.NODE_ENV!=="production"&&i&&!o&&U(`Failed to resolve ${e.slice(0,-1)}: ${t}
5
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),o)}else process.env.NODE_ENV!=="production"&&U(`resolve${di(e.slice(0,-1))} can only be used in render() or setup().`)}function Aa(e,t){return e&&(e[t]||e[Ft(t)]||e[di(Ft(t))])}function Fe(e,t,i,n){let s;const r=i,o=Q(e);if(o||Nt(e)){const a=o&&qe(e);let l=!1,h=!1;a&&(l=!$t(e),h=fe(e),e=ns(e)),s=new Array(e.length);for(let c=0,d=e.length;c<d;c++)s[c]=t(l?h?Vi(pe(e[c])):pe(e[c]):e[c],c,void 0,r)}else if(typeof e=="number"){process.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&U(`The v-for range expect an integer value but got ${e}.`),s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,r)}else if(pt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,r));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,h=a.length;l<h;l++){const c=a[l];s[l]=t(e[c],c,l,r)}}else s=[];return s}const Dr=e=>e?fl(e)?Ls(e):Dr(e.parent):null,vi=Ct(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Ee(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Ee(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Ee(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Ee(e.refs):e.refs,$parent:e=>Dr(e.parent),$root:e=>Dr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Da(e),$forceUpdate:e=>e.f||(e.f=()=>{gs(e.update)}),$nextTick:e=>e.n||(e.n=ps.bind(e.proxy)),$watch:e=>gu.bind(e)}),Vr=e=>e==="_"||e==="$",Fr=(e,t)=>e!==dt&&!e.__isScriptSetup&&lt(e,t),Ma={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:i,setupState:n,data:s,props:r,accessCache:o,type:a,appContext:l}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;if(t[0]!=="$"){const u=o[t];if(u!==void 0)switch(u){case 1:return n[t];case 2:return s[t];case 4:return i[t];case 3:return r[t]}else{if(Fr(n,t))return o[t]=1,n[t];if(s!==dt&&lt(s,t))return o[t]=2,s[t];if(lt(r,t))return o[t]=3,r[t];if(i!==dt&&lt(i,t))return o[t]=4,i[t];Gr&&(o[t]=0)}}const h=vi[t];let c,d;if(h)return t==="$attrs"?(It(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&Cs()):process.env.NODE_ENV!=="production"&&t==="$slots"&&It(e,"get",t),h(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(i!==dt&&lt(i,t))return o[t]=4,i[t];if(d=l.config.globalProperties,lt(d,t))return d[t];process.env.NODE_ENV!=="production"&&Gt&&(!Nt(t)||t.indexOf("__v")!==0)&&(s!==dt&&Vr(t[0])&&lt(s,t)?U(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===Gt&&U(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,i){const{data:n,setupState:s,ctx:r}=e;return Fr(s,t)?(s[t]=i,!0):process.env.NODE_ENV!=="production"&&s.__isScriptSetup&&lt(s,t)?(U(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):n!==dt&&lt(n,t)?(n[t]=i,!0):lt(e.props,t)?(process.env.NODE_ENV!=="production"&&U(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&U(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:i}):r[t]=i,!0)},has({_:{data:e,setupState:t,accessCache:i,ctx:n,appContext:s,props:r,type:o}},a){let l;return!!(i[a]||e!==dt&&a[0]!=="$"&&lt(e,a)||Fr(t,a)||lt(r,a)||lt(n,a)||lt(vi,a)||lt(s.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,i){return i.get!=null?e._.accessCache[t]=0:lt(i,"value")&&this.set(e,t,i.value,null),Reflect.defineProperty(e,t,i)}};process.env.NODE_ENV!=="production"&&(Ma.ownKeys=e=>(U("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function eu(e){const t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(vi).forEach(i=>{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,get:()=>vi[i](e),set:Lt})}),t}function iu(e){const{ctx:t,propsOptions:[i]}=e;i&&Object.keys(i).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:Lt})})}function nu(e){const{ctx:t,setupState:i}=e;Object.keys(rt(i)).forEach(n=>{if(!i.__isScriptSetup){if(Vr(n[0])){U(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i[n],set:Lt})}})}function Ra(e){return Q(e)?e.reduce((t,i)=>(t[i]=null,t),{}):e}function su(){const e=Object.create(null);return(t,i)=>{e[i]?U(`${t} property "${i}" is already defined in ${e[i]}.`):e[i]=t}}let Gr=!0;function ru(e){const t=Da(e),i=e.proxy,n=e.ctx;Gr=!1,t.beforeCreate&&La(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:h,created:c,beforeMount:d,mounted:u,beforeUpdate:f,updated:p,activated:_,deactivated:v,beforeDestroy:S,beforeUnmount:b,destroyed:x,unmounted:N,render:T,renderTracked:P,renderTriggered:E,errorCaptured:C,serverPrefetch:O,expose:H,inheritAttrs:K,components:z,directives:Z,filters:J}=t,A=process.env.NODE_ENV!=="production"?su():null;if(process.env.NODE_ENV!=="production"){const[$]=e.propsOptions;if($)for(const D in $)A("Props",D)}if(h&&ou(h,n,A),o)for(const $ in o){const D=o[$];it(D)?(process.env.NODE_ENV!=="production"?Object.defineProperty(n,$,{value:D.bind(i),configurable:!0,enumerable:!0,writable:!0}):n[$]=D.bind(i),process.env.NODE_ENV!=="production"&&A("Methods",$)):process.env.NODE_ENV!=="production"&&U(`Method "${$}" has type "${typeof D}" in the component definition. Did you reference the function correctly?`)}if(s){process.env.NODE_ENV!=="production"&&!it(s)&&U("The data option must be a function. Plain object usage is no longer supported.");const $=s.call(i,i);if(process.env.NODE_ENV!=="production"&&or($)&&U("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!pt($))process.env.NODE_ENV!=="production"&&U("data() should return an object.");else if(e.data=gi($),process.env.NODE_ENV!=="production")for(const D in $)A("Data",D),Vr(D[0])||Object.defineProperty(n,D,{configurable:!0,enumerable:!0,get:()=>$[D],set:Lt})}if(Gr=!0,r)for(const $ in r){const D=r[$],nt=it(D)?D.bind(i,i):it(D.get)?D.get.bind(i,i):Lt;process.env.NODE_ENV!=="production"&&nt===Lt&&U(`Computed property "${$}" has no getter.`);const ht=!it(D)&&it(D.set)?D.set.bind(i):process.env.NODE_ENV!=="production"?()=>{U(`Write operation failed: computed property "${$}" is readonly.`)}:Lt,ot=Ei({get:nt,set:ht});Object.defineProperty(n,$,{enumerable:!0,configurable:!0,get:()=>ot.value,set:mt=>ot.value=mt}),process.env.NODE_ENV!=="production"&&A("Computed",$)}if(a)for(const $ in a)Ia(a[$],n,i,$);if(l){const $=it(l)?l.call(i):l;Reflect.ownKeys($).forEach(D=>{uu(D,$[D])})}c&&La(c,e,"c");function L($,D){Q(D)?D.forEach(nt=>$(nt.bind(i))):D&&$(D.bind(i))}if(L(Xd,d),L(Rr,u),L(zd,f),L(Lr,p),L(Wd,_),L(Ud,v),L(Jd,C),L(Kd,P),L(qd,E),L(Oa,b),L(Ir,N),L(Yd,O),Q(H))if(H.length){const $=e.exposed||(e.exposed={});H.forEach(D=>{Object.defineProperty($,D,{get:()=>i[D],set:nt=>i[D]=nt,enumerable:!0})})}else e.exposed||(e.exposed={});T&&e.render===Lt&&(e.render=T),K!=null&&(e.inheritAttrs=K),z&&(e.components=z),Z&&(e.directives=Z),O&&Na(e)}function ou(e,t,i=Lt){Q(e)&&(e=$r(e));for(const n in e){const s=e[n];let r;pt(s)?"default"in s?r=Es(s.from||n,s.default,!0):r=Es(s.from||n):r=Es(s),Mt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[n]=r,process.env.NODE_ENV!=="production"&&i("Inject",n)}}function La(e,t,i){xe(Q(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,i)}function Ia(e,t,i,n){let s=n.includes(".")?Ba(i,n):()=>i[n];if(Nt(e)){const r=t[e];it(r)?wi(s,r):process.env.NODE_ENV!=="production"&&U(`Invalid watch handler specified by key "${e}"`,r)}else if(it(e))wi(s,e.bind(i));else if(pt(e))if(Q(e))e.forEach(r=>Ia(r,t,i,n));else{const r=it(e.handler)?e.handler.bind(i):t[e.handler];it(r)?wi(s,r,e):process.env.NODE_ENV!=="production"&&U(`Invalid watch handler specified by key "${e.handler}"`,r)}else process.env.NODE_ENV!=="production"&&U(`Invalid watch option: "${n}"`,e)}function Da(e){const t=e.type,{mixins:i,extends:n}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,a=r.get(t);let l;return a?l=a:!s.length&&!i&&!n?l=t:(l={},s.length&&s.forEach(h=>Ss(l,h,o,!0)),Ss(l,t,o)),pt(t)&&r.set(t,l),l}function Ss(e,t,i,n=!1){const{mixins:s,extends:r}=t;r&&Ss(e,r,i,!0),s&&s.forEach(o=>Ss(e,o,i,!0));for(const o in t)if(n&&o==="expose")process.env.NODE_ENV!=="production"&&U('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=au[o]||i&&i[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const au={data:Va,props:Fa,emits:Fa,methods:bn,computed:bn,beforeCreate:Ht,created:Ht,beforeMount:Ht,mounted:Ht,beforeUpdate:Ht,updated:Ht,beforeDestroy:Ht,beforeUnmount:Ht,destroyed:Ht,unmounted:Ht,activated:Ht,deactivated:Ht,errorCaptured:Ht,serverPrefetch:Ht,components:bn,directives:bn,watch:cu,provide:Va,inject:lu};function Va(e,t){return t?e?function(){return Ct(it(e)?e.call(this,this):e,it(t)?t.call(this,this):t)}:t:e}function lu(e,t){return bn($r(e),$r(t))}function $r(e){if(Q(e)){const t={};for(let i=0;i<e.length;i++)t[e[i]]=e[i];return t}return e}function Ht(e,t){return e?[...new Set([].concat(e,t))]:t}function bn(e,t){return e?Ct(Object.create(null),e,t):t}function Fa(e,t){return e?Q(e)&&Q(t)?[...new Set([...e,...t])]:Ct(Object.create(null),Ra(e),Ra(t??{})):t}function cu(e,t){if(!e)return t;if(!t)return e;const i=Ct(Object.create(null),e);for(const n in t)i[n]=Ht(e[n],t[n]);return i}function Ga(){return{app:null,config:{isNativeTag:Fo,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}}let hu=0;function du(e,t){return function(n,s=null){it(n)||(n=Ct({},n)),s!=null&&!pt(s)&&(process.env.NODE_ENV!=="production"&&U("root props passed to app.mount() must be an object."),s=null);const r=Ga(),o=new WeakSet,a=[];let l=!1;const h=r.app={_uid:hu++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:bl,get config(){return r.config},set config(c){process.env.NODE_ENV!=="production"&&U("app.config cannot be replaced. Modify individual options instead.")},use(c,...d){return o.has(c)?process.env.NODE_ENV!=="production"&&U("Plugin has already been applied to target app."):c&&it(c.install)?(o.add(c),c.install(h,...d)):it(c)?(o.add(c),c(h,...d)):process.env.NODE_ENV!=="production"&&U('A plugin must either be a function or an object with an "install" function.'),h},mixin(c){return r.mixins.includes(c)?process.env.NODE_ENV!=="production"&&U("Mixin has already been applied to target app"+(c.name?`: ${c.name}`:"")):r.mixins.push(c),h},component(c,d){return process.env.NODE_ENV!=="production"&&Kr(c,r.config),d?(process.env.NODE_ENV!=="production"&&r.components[c]&&U(`Component "${c}" has already been registered in target app.`),r.components[c]=d,h):r.components[c]},directive(c,d){return process.env.NODE_ENV!=="production"&&Ca(c),d?(process.env.NODE_ENV!=="production"&&r.directives[c]&&U(`Directive "${c}" has already been registered in target app.`),r.directives[c]=d,h):r.directives[c]},mount(c,d,u){if(l)process.env.NODE_ENV!=="production"&&U("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!=="production"&&c.__vue_app__&&U("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const f=h._ceVNode||Tt(n,s);return f.appContext=r,u===!0?u="svg":u===!1&&(u=void 0),process.env.NODE_ENV!=="production"&&(r.reload=()=>{const p=Qe(f);p.el=null,e(p,c,u)}),e(f,c,u),l=!0,h._container=c,c.__vue_app__=h,process.env.NODE_ENV!=="production"&&(h._instance=f.component,Md(h,bl)),Ls(f.component)}},onUnmount(c){process.env.NODE_ENV!=="production"&&typeof c!="function"&&U(`Expected function as first argument to app.onUnmount(), but got ${typeof c}`),a.push(c)},unmount(){l?(xe(a,h._instance,16),e(null,h._container),process.env.NODE_ENV!=="production"&&(h._instance=null,Rd(h)),delete h._container.__vue_app__):process.env.NODE_ENV!=="production"&&U("Cannot unmount an app that is not mounted.")},provide(c,d){return process.env.NODE_ENV!=="production"&&c in r.provides&&(lt(r.provides,c)?U(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`):U(`App already provides property with key "${String(c)}" inherited from its parent element. It will be overwritten with the new value.`)),r.provides[c]=d,h},runWithContext(c){const d=Hi;Hi=h;try{return c()}finally{Hi=d}}};return h}}let Hi=null;function uu(e,t){if(process.env.NODE_ENV!=="production"&&(!Rt||Rt.isMounted)&&U("provide() can only be used inside setup()."),Rt){let i=Rt.provides;const n=Rt.parent&&Rt.parent.provides;n===i&&(i=Rt.provides=Object.create(n)),i[e]=t}}function Es(e,t,i=!1){const n=Ms();if(n||Hi){let s=Hi?Hi._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return i&&it(t)?t.call(n&&n.proxy):t;process.env.NODE_ENV!=="production"&&U(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&U("inject() can only be used inside setup() or functional components.")}const fu=Symbol.for("v-scx"),pu=()=>{{const e=Es(fu);return e||process.env.NODE_ENV!=="production"&&U("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function wi(e,t,i){return process.env.NODE_ENV!=="production"&&!it(t)&&U("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),$a(e,t,i)}function $a(e,t,i=dt){const{immediate:n,deep:s,flush:r,once:o}=i;process.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&U('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&U('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&U('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=Ct({},i);process.env.NODE_ENV!=="production"&&(a.onWarn=U);const l=t&&n||!t&&r!=="post";let h;if(Nn){if(r==="sync"){const f=pu();h=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=Lt,f.resume=Lt,f.pause=Lt,f}}const c=Rt;a.call=(f,p,_)=>xe(f,c,p,_);let d=!1;r==="post"?a.scheduler=f=>{Zt(f,c&&c.suspense)}:r!=="sync"&&(d=!0,a.scheduler=(f,p)=>{p?f():gs(f)}),a.augmentJob=f=>{t&&(f.flags|=4),d&&(f.flags|=2,c&&(f.id=c.uid,f.i=c))};const u=vd(e,t,a);return Nn&&(h?h.push(u):l&&u()),u}function gu(e,t,i){const n=this.proxy,s=Nt(e)?e.includes(".")?Ba(n,e):()=>n[e]:e.bind(n,n);let r;it(t)?r=t:(r=t.handler,i=t);const o=Cn(this),a=$a(s,r.bind(n),i);return o(),a}function Ba(e,t){const i=t.split(".");return()=>{let n=e;for(let s=0;s<i.length&&n;s++)n=n[i[s]];return n}}const mu=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ft(t)}Modifiers`]||e[`${Qt(t)}Modifiers`];function _u(e,t,...i){if(e.isUnmounted)return;const n=e.vnode.props||dt;if(process.env.NODE_ENV!=="production"){const{emitsOptions:c,propsOptions:[d]}=e;if(c)if(!(t in c))(!d||!(ui(Ft(t))in d))&&U(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${ui(Ft(t))}" prop.`);else{const u=c[t];it(u)&&(u(...i)||U(`Invalid event arguments: event validation failed for event "${t}".`))}}let s=i;const r=t.startsWith("update:"),o=r&&mu(n,t.slice(7));if(o&&(o.trim&&(s=i.map(c=>Nt(c)?c.trim():c)),o.number&&(s=i.map(is))),process.env.NODE_ENV!=="production"&&Gd(e,t,s),process.env.NODE_ENV!=="production"){const c=t.toLowerCase();c!==t&&n[ui(c)]&&U(`Event "${c}" is emitted in component ${Tn(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Qt(t)}" instead of "${t}".`)}let a,l=n[a=ui(t)]||n[a=ui(Ft(t))];!l&&r&&(l=n[a=ui(Qt(t))]),l&&xe(l,e,6,s);const h=n[a+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,xe(h,e,6,s)}}const yu=new WeakMap;function Ha(e,t,i=!1){const n=i?yu:t.emitsCache,s=n.get(e);if(s!==void 0)return s;const r=e.emits;let o={},a=!1;if(!it(e)){const l=h=>{const c=Ha(h,t,!0);c&&(a=!0,Ct(o,c))};!i&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!r&&!a?(pt(e)&&n.set(e,null),null):(Q(r)?r.forEach(l=>o[l]=null):Ct(o,r),pt(e)&&n.set(e,o),o)}function xs(e,t){return!e||!nn(t)?!1:(t=t.slice(2).replace(/Once$/,""),lt(e,t[0].toLowerCase()+t.slice(1))||lt(e,Qt(t))||lt(e,t))}let Br=!1;function Cs(){Br=!0}function Wa(e){const{type:t,vnode:i,proxy:n,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:h,renderCache:c,props:d,data:u,setupState:f,ctx:p,inheritAttrs:_}=e,v=ys(e);let S,b;process.env.NODE_ENV!=="production"&&(Br=!1);try{if(i.shapeFlag&4){const T=s||n,P=process.env.NODE_ENV!=="production"&&f.__isScriptSetup?new Proxy(T,{get(E,C,O){return U(`Property '${String(C)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(E,C,O)}}):T;S=me(h.call(P,T,c,process.env.NODE_ENV!=="production"?Ee(d):d,f,u,p)),b=a}else{const T=t;process.env.NODE_ENV!=="production"&&a===d&&Cs(),S=me(T.length>1?T(process.env.NODE_ENV!=="production"?Ee(d):d,process.env.NODE_ENV!=="production"?{get attrs(){return Cs(),Ee(a)},slots:o,emit:l}:{attrs:a,slots:o,emit:l}):T(process.env.NODE_ENV!=="production"?Ee(d):d,null)),b=t.props?a:bu(a)}}catch(T){Sn.length=0,un(T,e,1),S=Tt(te)}let x=S,N;if(process.env.NODE_ENV!=="production"&&S.patchFlag>0&&S.patchFlag&2048&&([x,N]=Ua(S)),b&&_!==!1){const T=Object.keys(b),{shapeFlag:P}=x;if(T.length){if(P&7)r&&T.some(Qn)&&(b=vu(b,r)),x=Qe(x,b,!1,!0);else if(process.env.NODE_ENV!=="production"&&!Br&&x.type!==te){const E=Object.keys(a),C=[],O=[];for(let H=0,K=E.length;H<K;H++){const z=E[H];nn(z)?Qn(z)||C.push(z[2].toLowerCase()+z.slice(3)):O.push(z)}O.length&&U(`Extraneous non-props attributes (${O.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),C.length&&U(`Extraneous non-emits event listeners (${C.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return i.dirs&&(process.env.NODE_ENV!=="production"&&!ja(x)&&U("Runtime directive used on component with non-element root node. The directives will not function as intended."),x=Qe(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(i.dirs):i.dirs),i.transition&&(process.env.NODE_ENV!=="production"&&!ja(x)&&U("Component inside <Transition> renders non-element root node that cannot be animated."),Ar(x,i.transition)),process.env.NODE_ENV!=="production"&&N?N(x):S=x,ys(v),S}const Ua=e=>{const t=e.children,i=e.dynamicChildren,n=Hr(t,!1);if(n){if(process.env.NODE_ENV!=="production"&&n.patchFlag>0&&n.patchFlag&2048)return Ua(n)}else return[e,void 0];const s=t.indexOf(n),r=i?i.indexOf(n):-1,o=a=>{t[s]=a,i&&(r>-1?i[r]=a:a.patchFlag>0&&(e.dynamicChildren=[...i,a]))};return[me(n),o]};function Hr(e,t=!0){let i;for(let n=0;n<e.length;n++){const s=e[n];if(ji(s)){if(s.type!==te||s.children==="v-if"){if(i)return;if(i=s,process.env.NODE_ENV!=="production"&&t&&i.patchFlag>0&&i.patchFlag&2048)return Hr(i.children)}}else return}return i}const bu=e=>{let t;for(const i in e)(i==="class"||i==="style"||nn(i))&&((t||(t={}))[i]=e[i]);return t},vu=(e,t)=>{const i={};for(const n in e)(!Qn(n)||!(n.slice(9)in t))&&(i[n]=e[n]);return i},ja=e=>e.shapeFlag&7||e.type===te;function wu(e,t,i){const{props:n,children:s,component:r}=e,{props:o,children:a,patchFlag:l}=t,h=r.emitsOptions;if(process.env.NODE_ENV!=="production"&&(s||a)&&Ne||t.dirs||t.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return n?Xa(n,o,h):!!o;if(l&8){const c=t.dynamicProps;for(let d=0;d<c.length;d++){const u=c[d];if(o[u]!==n[u]&&!xs(h,u))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?Xa(n,o,h):!0:!!o;return!1}function Xa(e,t,i){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let s=0;s<n.length;s++){const r=n[s];if(t[r]!==e[r]&&!xs(i,r))return!0}return!1}function Su({vnode:e,parent:t},i){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=i,t=t.parent;else break}}const za={},Ya=()=>Object.create(za),qa=e=>Object.getPrototypeOf(e)===za;function Eu(e,t,i,n=!1){const s={},r=Ya();e.propsDefaults=Object.create(null),Ka(e,t,s,r);for(const o in e.propsOptions[0])o in s||(s[o]=void 0);process.env.NODE_ENV!=="production"&&Za(t||{},s,e),i?e.props=n?s:ud(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function xu(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function Cu(e,t,i,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=e,a=rt(s),[l]=e.propsOptions;let h=!1;if(!(process.env.NODE_ENV!=="production"&&xu(e))&&(n||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let d=0;d<c.length;d++){let u=c[d];if(xs(e.emitsOptions,u))continue;const f=t[u];if(l)if(lt(r,u))f!==r[u]&&(r[u]=f,h=!0);else{const p=Ft(u);s[p]=Wr(l,a,p,f,e,!1)}else f!==r[u]&&(r[u]=f,h=!0)}}}else{Ka(e,t,s,r)&&(h=!0);let c;for(const d in a)(!t||!lt(t,d)&&((c=Qt(d))===d||!lt(t,c)))&&(l?i&&(i[d]!==void 0||i[c]!==void 0)&&(s[d]=Wr(l,a,d,void 0,e,!0)):delete s[d]);if(r!==a)for(const d in r)(!t||!lt(t,d))&&(delete r[d],h=!0)}h&&Se(e.attrs,"set",""),process.env.NODE_ENV!=="production"&&Za(t||{},s,e)}function Ka(e,t,i,n){const[s,r]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(rn(l))continue;const h=t[l];let c;s&&lt(s,c=Ft(l))?!r||!r.includes(c)?i[c]=h:(a||(a={}))[c]=h:xs(e.emitsOptions,l)||(!(l in n)||h!==n[l])&&(n[l]=h,o=!0)}if(r){const l=rt(i),h=a||dt;for(let c=0;c<r.length;c++){const d=r[c];i[d]=Wr(s,l,d,h[d],e,!lt(h,d))}}return o}function Wr(e,t,i,n,s,r){const o=e[i];if(o!=null){const a=lt(o,"default");if(a&&n===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&it(l)){const{propsDefaults:h}=s;if(i in h)n=h[i];else{const c=Cn(s);n=h[i]=l.call(null,t),c()}}else n=l;s.ce&&s.ce._setProp(i,n)}o[0]&&(r&&!a?n=!1:o[1]&&(n===""||n===Qt(i))&&(n=!0))}return n}const Nu=new WeakMap;function Ja(e,t,i=!1){const n=i?Nu:t.propsCache,s=n.get(e);if(s)return s;const r=e.props,o={},a=[];let l=!1;if(!it(e)){const c=d=>{l=!0;const[u,f]=Ja(d,t,!0);Ct(o,u),f&&a.push(...f)};!i&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!l)return pt(e)&&n.set(e,Ri),Ri;if(Q(r))for(let c=0;c<r.length;c++){process.env.NODE_ENV!=="production"&&!Nt(r[c])&&U("props must be strings when using array syntax.",r[c]);const d=Ft(r[c]);Qa(d)&&(o[d]=dt)}else if(r){process.env.NODE_ENV!=="production"&&!pt(r)&&U("invalid props options",r);for(const c in r){const d=Ft(c);if(Qa(d)){const u=r[c],f=o[d]=Q(u)||it(u)?{type:u}:Ct({},u),p=f.type;let _=!1,v=!0;if(Q(p))for(let S=0;S<p.length;++S){const b=p[S],x=it(b)&&b.name;if(x==="Boolean"){_=!0;break}else x==="String"&&(v=!1)}else _=it(p)&&p.name==="Boolean";f[0]=_,f[1]=v,(_||lt(f,"default"))&&a.push(d)}}}const h=[o,a];return pt(e)&&n.set(e,h),h}function Qa(e){return e[0]!=="$"&&!rn(e)?!0:(process.env.NODE_ENV!=="production"&&U(`Invalid prop name: "${e}" is a reserved property.`),!1)}function Tu(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function Za(e,t,i){const n=rt(t),s=i.propsOptions[0],r=Object.keys(e).map(o=>Ft(o));for(const o in s){let a=s[o];a!=null&&ku(o,n[o],a,process.env.NODE_ENV!=="production"?Ee(n):n,!r.includes(o))}}function ku(e,t,i,n,s){const{type:r,required:o,validator:a,skipCheck:l}=i;if(o&&s){U('Missing required prop: "'+e+'"');return}if(!(t==null&&!o)){if(r!=null&&r!==!0&&!l){let h=!1;const c=Q(r)?r:[r],d=[];for(let u=0;u<c.length&&!h;u++){const{valid:f,expectedType:p}=Ou(t,c[u]);d.push(p||""),h=f}if(!h){U(Au(e,t,d));return}}a&&!a(t,n)&&U('Invalid prop: custom validator check failed for prop "'+e+'".')}}const Pu=Jt("String,Number,Boolean,Function,Symbol,BigInt");function Ou(e,t){let i;const n=Tu(t);if(n==="null")i=e===null;else if(Pu(n)){const s=typeof e;i=s===n.toLowerCase(),!i&&s==="object"&&(i=e instanceof t)}else n==="Object"?i=pt(e):n==="Array"?i=Q(e):i=e instanceof t;return{valid:i,expectedType:n}}function Au(e,t,i){if(i.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${e}". Expected ${i.map(di).join(" | ")}`;const s=i[0],r=ar(t),o=tl(t,s),a=tl(t,r);return i.length===1&&el(s)&&!Mu(s,r)&&(n+=` with value ${o}`),n+=`, got ${r} `,el(r)&&(n+=`with value ${a}.`),n}function tl(e,t){return t==="String"?`"${e}"`:t==="Number"?`${Number(e)}`:`${e}`}function el(e){return["string","number","boolean"].some(i=>e.toLowerCase()===i)}function Mu(...e){return e.some(t=>t.toLowerCase()==="boolean")}const Ur=e=>e==="_"||e==="_ctx"||e==="$stable",jr=e=>Q(e)?e.map(me):[me(e)],Ru=(e,t,i)=>{if(t._n)return t;const n=mn((...s)=>(process.env.NODE_ENV!=="production"&&Rt&&!(i===null&&Gt)&&!(i&&i.root!==Rt.root)&&U(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),jr(t(...s))),i);return n._c=!1,n},il=(e,t,i)=>{const n=e._ctx;for(const s in e){if(Ur(s))continue;const r=e[s];if(it(r))t[s]=Ru(s,r,n);else if(r!=null){process.env.NODE_ENV!=="production"&&U(`Non-function value encountered for slot "${s}". Prefer function slots for better performance.`);const o=jr(r);t[s]=()=>o}}},nl=(e,t)=>{process.env.NODE_ENV!=="production"&&!Mr(e.vnode)&&U("Non-function value encountered for default slot. Prefer function slots for better performance.");const i=jr(t);e.slots.default=()=>i},Xr=(e,t,i)=>{for(const n in t)(i||!Ur(n))&&(e[n]=t[n])},Lu=(e,t,i)=>{const n=e.slots=Ya();if(e.vnode.shapeFlag&32){const s=t._;s?(Xr(n,t,i),i&&es(n,"_",s,!0)):il(t,n)}else t&&nl(e,t)},Iu=(e,t,i)=>{const{vnode:n,slots:s}=e;let r=!0,o=dt;if(n.shapeFlag&32){const a=t._;a?process.env.NODE_ENV!=="production"&&Ne?(Xr(s,t,i),Se(e,"set","$slots")):i&&a===1?r=!1:Xr(s,t,i):(r=!t.$stable,il(t,s)),o=t}else t&&(nl(e,t),o={default:1});if(r)for(const a in s)!Ur(a)&&o[a]==null&&delete s[a]};let vn,Ge;function Wi(e,t){e.appContext.config.performance&&Ns()&&Ge.mark(`vue-${t}-${e.uid}`),process.env.NODE_ENV!=="production"&&Vd(e,t,Ns()?Ge.now():Date.now())}function Ui(e,t){if(e.appContext.config.performance&&Ns()){const i=`vue-${t}-${e.uid}`,n=i+":end",s=`<${Tn(e,e.type)}> ${t}`;Ge.mark(n),Ge.measure(s,i,n),Ge.clearMeasures(s),Ge.clearMarks(i),Ge.clearMarks(n)}process.env.NODE_ENV!=="production"&&Fd(e,t,Ns()?Ge.now():Date.now())}function Ns(){return vn!==void 0||(typeof window<"u"&&window.performance?(vn=!0,Ge=window.performance):vn=!1),vn}function Du(){const e=[];if(process.env.NODE_ENV!=="production"&&e.length){const t=e.length>1;console.warn(`Feature flag${t?"s":""} ${e.join(", ")} ${t?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
6
6
 
7
- For more details, see https://link.vuejs.org/feature-flags.`)}}const Qt=Au;function Tu(e){return ku(e)}function ku(e,t){Nu();const i=rn();i.__VUE__=!0,process.env.NODE_ENV!=="production"&&kr(i.__VUE_DEVTOOLS_GLOBAL_HOOK__,i);const{insert:n,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:h,parentNode:d,nextSibling:u,setScopeId:f=Lt,insertStaticContent:p}=e,_=(g,v,k,F=null,R=null,M=null,Y=void 0,j=null,W=process.env.NODE_ENV!=="production"&&Ce?!1:!!v.dynamicChildren)=>{if(g===v)return;g&&!En(g,v)&&(F=ve(g),Ot(g,R,M,!0),g=null),v.patchFlag===-2&&(W=!1,v.dynamicChildren=null);const{type:I,ref:et,shapeFlag:q}=v;switch(I){case yn:b(g,v,k,F);break;case Zt:w(g,v,k,F);break;case Ts:g==null?y(v,k,F,Y):process.env.NODE_ENV!=="production"&&x(g,v,k,Y);break;case Dt:Z(g,v,k,F,R,M,Y,j,W);break;default:q&1?O(g,v,k,F,R,M,Y,j,W):q&6?J(g,v,k,F,R,M,Y,j,W):q&64||q&128?I.process(g,v,k,F,R,M,Y,j,W,qn):process.env.NODE_ENV!=="production"&&U("Invalid VNode type:",I,`(${typeof I})`)}et!=null&&R?mn(et,g&&g.ref,M,v||g,!v):et==null&&g&&g.ref!=null&&mn(g.ref,null,M,g,!0)},b=(g,v,k,F)=>{if(g==null)n(v.el=a(v.children),k,F);else{const R=v.el=g.el;v.children!==g.children&&c(R,v.children)}},w=(g,v,k,F)=>{g==null?n(v.el=l(v.children||""),k,F):v.el=g.el},y=(g,v,k,F)=>{[g.el,g.anchor]=p(g.children,v,k,F,g.el,g.anchor)},x=(g,v,k,F)=>{if(v.children!==g.children){const R=u(g.anchor);T(g),[v.el,v.anchor]=p(v.children,k,R,F)}else v.el=g.el,v.anchor=g.anchor},N=({el:g,anchor:v},k,F)=>{let R;for(;g&&g!==v;)R=u(g),n(g,k,F),g=R;n(v,k,F)},T=({el:g,anchor:v})=>{let k;for(;g&&g!==v;)k=u(g),s(g),g=k;s(v)},O=(g,v,k,F,R,M,Y,j,W)=>{if(v.type==="svg"?Y="svg":v.type==="math"&&(Y="mathml"),g==null)E(v,k,F,R,M,Y,j,W);else{const I=g.el&&g.el._isVueCE?g.el:null;try{I&&I._beginPatch(),H(g,v,R,M,Y,j,W)}finally{I&&I._endPatch()}}},E=(g,v,k,F,R,M,Y,j)=>{let W,I;const{props:et,shapeFlag:q,transition:tt,dirs:st}=g;if(W=g.el=o(g.type,M,et&&et.is,et),q&8?h(W,g.children):q&16&&P(g.children,W,null,F,R,Xr(g,M),Y,j),st&&vi(g,null,F,"created"),C(W,g,g.scopeId,Y,F),et){for(const St in et)St!=="value"&&!sn(St)&&r(W,St,null,et[St],M,F);"value"in et&&r(W,"value",null,et.value,M),(I=et.onVnodeBeforeMount)&&Te(I,F,g)}process.env.NODE_ENV!=="production"&&(ts(W,"__vnode",g,!0),ts(W,"__vueParentComponent",F,!0)),st&&vi(g,null,F,"beforeMount");const ft=Ou(R,tt);ft&&tt.beforeEnter(W),n(W,v,k),((I=et&&et.onVnodeMounted)||ft||st)&&Qt(()=>{I&&Te(I,F,g),ft&&tt.enter(W),st&&vi(g,null,F,"mounted")},R)},C=(g,v,k,F,R)=>{if(k&&f(g,k),F)for(let M=0;M<F.length;M++)f(g,F[M]);if(R){let M=R.subTree;if(process.env.NODE_ENV!=="production"&&M.patchFlag>0&&M.patchFlag&2048&&(M=$r(M.children)||M),v===M||il(M.type)&&(M.ssContent===v||M.ssFallback===v)){const Y=R.vnode;C(g,Y,Y.scopeId,Y.slotScopeIds,R.parent)}}},P=(g,v,k,F,R,M,Y,j,W=0)=>{for(let I=W;I<g.length;I++){const et=g[I]=j?Ze(g[I]):ge(g[I]);_(null,et,v,k,F,R,M,Y,j)}},H=(g,v,k,F,R,M,Y)=>{const j=v.el=g.el;process.env.NODE_ENV!=="production"&&(j.__vnode=v);let{patchFlag:W,dynamicChildren:I,dirs:et}=v;W|=g.patchFlag&16;const q=g.props||dt,tt=v.props||dt;let st;if(k&&Si(k,!1),(st=tt.onVnodeBeforeUpdate)&&Te(st,k,v,g),et&&vi(v,g,k,"beforeUpdate"),k&&Si(k,!0),process.env.NODE_ENV!=="production"&&Ce&&(W=0,Y=!1,I=null),(q.innerHTML&&tt.innerHTML==null||q.textContent&&tt.textContent==null)&&h(j,""),I?(K(g.dynamicChildren,I,j,k,F,Xr(v,R),M),process.env.NODE_ENV!=="production"&&Ns(g,v)):Y||nt(g,v,j,null,k,F,Xr(v,R),M,!1),W>0){if(W&16)z(j,q,tt,k,R);else if(W&2&&q.class!==tt.class&&r(j,"class",null,tt.class,R),W&4&&r(j,"style",q.style,tt.style,R),W&8){const ft=v.dynamicProps;for(let St=0;St<ft.length;St++){const bt=ft[St],Yt=q[bt],qt=tt[bt];(qt!==Yt||bt==="value")&&r(j,bt,Yt,qt,R,k)}}W&1&&g.children!==v.children&&h(j,v.children)}else!Y&&I==null&&z(j,q,tt,k,R);((st=tt.onVnodeUpdated)||et)&&Qt(()=>{st&&Te(st,k,v,g),et&&vi(v,g,k,"updated")},F)},K=(g,v,k,F,R,M,Y)=>{for(let j=0;j<v.length;j++){const W=g[j],I=v[j],et=W.el&&(W.type===Dt||!En(W,I)||W.shapeFlag&198)?d(W.el):k;_(W,I,et,null,F,R,M,Y,!0)}},z=(g,v,k,F,R)=>{if(v!==k){if(v!==dt)for(const M in v)!sn(M)&&!(M in k)&&r(g,M,v[M],null,R,F);for(const M in k){if(sn(M))continue;const Y=k[M],j=v[M];Y!==j&&M!=="value"&&r(g,M,j,Y,R,F)}"value"in k&&r(g,"value",v.value,k.value,R)}},Z=(g,v,k,F,R,M,Y,j,W)=>{const I=v.el=g?g.el:a(""),et=v.anchor=g?g.anchor:a("");let{patchFlag:q,dynamicChildren:tt,slotScopeIds:st}=v;process.env.NODE_ENV!=="production"&&(Ce||q&2048)&&(q=0,W=!1,tt=null),st&&(j=j?j.concat(st):st),g==null?(n(I,k,F),n(et,k,F),P(v.children||[],k,et,R,M,Y,j,W)):q>0&&q&64&&tt&&g.dynamicChildren?(K(g.dynamicChildren,tt,k,R,M,Y,j),process.env.NODE_ENV!=="production"?Ns(g,v):(v.key!=null||R&&v===R.subTree)&&Ns(g,v,!0)):nt(g,v,k,et,R,M,Y,j,W)},J=(g,v,k,F,R,M,Y,j,W)=>{v.slotScopeIds=j,g==null?v.shapeFlag&512?R.ctx.activate(v,k,F,Y,W):A(v,k,F,R,M,Y,W):L(g,v,W)},A=(g,v,k,F,R,M,Y)=>{const j=g.component=Fu(g,F,R);if(process.env.NODE_ENV!=="production"&&j.type.__hmrId&&vd(j),process.env.NODE_ENV!=="production"&&(hs(g),Wi(j,"mount")),Ar(g)&&(j.ctx.renderer=qn),process.env.NODE_ENV!=="production"&&Wi(j,"init"),Bu(j,!1,Y),process.env.NODE_ENV!=="production"&&Ui(j,"init"),process.env.NODE_ENV!=="production"&&Ce&&(g.el=null),j.asyncDep){if(R&&R.registerDep(j,B,Y),!g.el){const W=j.subTree=Tt(Zt);w(null,W,v,k),g.placeholder=W.el}}else B(j,g,v,k,R,M,Y);process.env.NODE_ENV!=="production"&&(ds(),Ui(j,"mount"))},L=(g,v,k)=>{const F=v.component=g.component;if(du(g,v,k))if(F.asyncDep&&!F.asyncResolved){process.env.NODE_ENV!=="production"&&hs(v),D(F,v,k),process.env.NODE_ENV!=="production"&&ds();return}else F.next=v,F.update();else v.el=g.el,F.vnode=v},B=(g,v,k,F,R,M,Y)=>{const j=()=>{if(g.isMounted){let{next:q,bu:tt,u:st,parent:ft,vnode:St}=g;{const Re=tl(g);if(Re){q&&(q.el=St.el,D(g,q,Y)),Re.asyncDep.then(()=>{g.isUnmounted||j()});return}}let bt=q,Yt;process.env.NODE_ENV!=="production"&&hs(q||g.vnode),Si(g,!1),q?(q.el=St.el,D(g,q,Y)):q=St,tt&&Ii(tt),(Yt=q.props&&q.props.onVnodeBeforeUpdate)&&Te(Yt,ft,q,St),Si(g,!0),process.env.NODE_ENV!=="production"&&Wi(g,"render");const qt=Ga(g);process.env.NODE_ENV!=="production"&&Ui(g,"render");const Ae=g.subTree;g.subTree=qt,process.env.NODE_ENV!=="production"&&Wi(g,"patch"),_(Ae,qt,d(Ae.el),ve(Ae),g,R,M),process.env.NODE_ENV!=="production"&&Ui(g,"patch"),q.el=qt.el,bt===null&&uu(g,qt.el),st&&Qt(st,R),(Yt=q.props&&q.props.onVnodeUpdated)&&Qt(()=>Te(Yt,ft,q,St),R),process.env.NODE_ENV!=="production"&&va(g),process.env.NODE_ENV!=="production"&&ds()}else{let q;const{el:tt,props:st}=v,{bm:ft,m:St,parent:bt,root:Yt,type:qt}=g,Ae=_n(v);Si(g,!1),ft&&Ii(ft),!Ae&&(q=st&&st.onVnodeBeforeMount)&&Te(q,bt,v),Si(g,!0);{Yt.ce&&Yt.ce._def.shadowRoot!==!1&&Yt.ce._injectChildStyle(qt),process.env.NODE_ENV!=="production"&&Wi(g,"render");const Re=g.subTree=Ga(g);process.env.NODE_ENV!=="production"&&Ui(g,"render"),process.env.NODE_ENV!=="production"&&Wi(g,"patch"),_(null,Re,k,F,g,R,M),process.env.NODE_ENV!=="production"&&Ui(g,"patch"),v.el=Re.el}if(St&&Qt(St,R),!Ae&&(q=st&&st.onVnodeMounted)){const Re=v;Qt(()=>Te(q,bt,Re),R)}(v.shapeFlag&256||bt&&_n(bt.vnode)&&bt.vnode.shapeFlag&256)&&g.a&&Qt(g.a,R),g.isMounted=!0,process.env.NODE_ENV!=="production"&&xd(g),v=k=F=null}};g.scope.on();const W=g.effect=new Ho(j);g.scope.off();const I=g.update=W.run.bind(W),et=g.job=W.runIfDirty.bind(W);et.i=g,et.id=g.uid,W.scheduler=()=>ps(et),Si(g,!0),process.env.NODE_ENV!=="production"&&(W.onTrack=g.rtc?q=>Ii(g.rtc,q):void 0,W.onTrigger=g.rtg?q=>Ii(g.rtg,q):void 0),I()},D=(g,v,k)=>{v.component=g;const F=g.vnode.props;g.vnode=v,g.next=null,gu(g,v.props,F,k),Cu(g,v.children,k),he(),fa(g),de()},nt=(g,v,k,F,R,M,Y,j,W=!1)=>{const I=g&&g.children,et=g?g.shapeFlag:0,q=v.children,{patchFlag:tt,shapeFlag:st}=v;if(tt>0){if(tt&128){ot(I,q,k,F,R,M,Y,j,W);return}else if(tt&256){ht(I,q,k,F,R,M,Y,j,W);return}}st&8?(et&16&&ae(I,R,M),q!==I&&h(k,q)):et&16?st&16?ot(I,q,k,F,R,M,Y,j,W):ae(I,R,M,!0):(et&8&&h(k,""),st&16&&P(q,k,F,R,M,Y,j,W))},ht=(g,v,k,F,R,M,Y,j,W)=>{g=g||Mi,v=v||Mi;const I=g.length,et=v.length,q=Math.min(I,et);let tt;for(tt=0;tt<q;tt++){const st=v[tt]=W?Ze(v[tt]):ge(v[tt]);_(g[tt],st,k,null,R,M,Y,j,W)}I>et?ae(g,R,M,!0,!1,q):P(v,k,F,R,M,Y,j,W,q)},ot=(g,v,k,F,R,M,Y,j,W)=>{let I=0;const et=v.length;let q=g.length-1,tt=et-1;for(;I<=q&&I<=tt;){const st=g[I],ft=v[I]=W?Ze(v[I]):ge(v[I]);if(En(st,ft))_(st,ft,k,null,R,M,Y,j,W);else break;I++}for(;I<=q&&I<=tt;){const st=g[q],ft=v[tt]=W?Ze(v[tt]):ge(v[tt]);if(En(st,ft))_(st,ft,k,null,R,M,Y,j,W);else break;q--,tt--}if(I>q){if(I<=tt){const st=tt+1,ft=st<et?v[st].el:F;for(;I<=tt;)_(null,v[I]=W?Ze(v[I]):ge(v[I]),k,ft,R,M,Y,j,W),I++}}else if(I>tt)for(;I<=q;)Ot(g[I],R,M,!0),I++;else{const st=I,ft=I,St=new Map;for(I=ft;I<=tt;I++){const Ut=v[I]=W?Ze(v[I]):ge(v[I]);Ut.key!=null&&(process.env.NODE_ENV!=="production"&&St.has(Ut.key)&&U("Duplicate keys found during update:",JSON.stringify(Ut.key),"Make sure keys are unique."),St.set(Ut.key,I))}let bt,Yt=0;const qt=tt-ft+1;let Ae=!1,Re=0;const Kn=new Array(qt);for(I=0;I<qt;I++)Kn[I]=0;for(I=st;I<=q;I++){const Ut=g[I];if(Yt>=qt){Ot(Ut,R,M,!0);continue}let Me;if(Ut.key!=null)Me=St.get(Ut.key);else for(bt=ft;bt<=tt;bt++)if(Kn[bt-ft]===0&&En(Ut,v[bt])){Me=bt;break}Me===void 0?Ot(Ut,R,M,!0):(Kn[Me-ft]=I+1,Me>=Re?Re=Me:Ae=!0,_(Ut,v[Me],k,null,R,M,Y,j,W),Yt++)}const _h=Ae?Pu(Kn):Mi;for(bt=_h.length-1,I=qt-1;I>=0;I--){const Ut=ft+I,Me=v[Ut],vh=v[Ut+1],bh=Ut+1<et?vh.el||vh.placeholder:F;Kn[I]===0?_(null,Me,k,bh,R,M,Y,j,W):Ae&&(bt<0||I!==_h[bt]?mt(Me,k,bh,2):bt--)}}},mt=(g,v,k,F,R=null)=>{const{el:M,type:Y,transition:j,children:W,shapeFlag:I}=g;if(I&6){mt(g.component.subTree,v,k,F);return}if(I&128){g.suspense.move(v,k,F);return}if(I&64){Y.move(g,v,k,qn);return}if(Y===Dt){n(M,v,k);for(let q=0;q<W.length;q++)mt(W[q],v,k,F);n(g.anchor,v,k);return}if(Y===Ts){N(g,v,k);return}if(F!==2&&I&1&&j)if(F===0)j.beforeEnter(M),n(M,v,k),Qt(()=>j.enter(M),R);else{const{leave:q,delayLeave:tt,afterLeave:st}=j,ft=()=>{g.ctx.isUnmounted?s(M):n(M,v,k)},St=()=>{M._isLeaving&&M[Rd](!0),q(M,()=>{ft(),st&&st()})};tt?tt(M,ft,St):St()}else n(M,v,k)},Ot=(g,v,k,F=!1,R=!1)=>{const{type:M,props:Y,ref:j,children:W,dynamicChildren:I,shapeFlag:et,patchFlag:q,dirs:tt,cacheIndex:st}=g;if(q===-2&&(R=!1),j!=null&&(he(),mn(j,null,k,g,!0),de()),st!=null&&(v.renderCache[st]=void 0),et&256){v.ctx.deactivate(g);return}const ft=et&1&&tt,St=!_n(g);let bt;if(St&&(bt=Y&&Y.onVnodeBeforeUnmount)&&Te(bt,v,g),et&6)tn(g.component,k,F);else{if(et&128){g.suspense.unmount(k,F);return}ft&&vi(g,null,v,"beforeUnmount"),et&64?g.type.remove(g,v,k,qn,F):I&&!I.hasOnce&&(M!==Dt||q>0&&q&64)?ae(I,v,k,!1,!0):(M===Dt&&q&384||!R&&et&16)&&ae(W,v,k),F&&Zi(g)}(St&&(bt=Y&&Y.onVnodeUnmounted)||ft)&&Qt(()=>{bt&&Te(bt,v,g),ft&&vi(g,null,v,"unmounted")},k)},Zi=g=>{const{type:v,el:k,anchor:F,transition:R}=g;if(v===Dt){process.env.NODE_ENV!=="production"&&g.patchFlag>0&&g.patchFlag&2048&&R&&!R.persisted?g.children.forEach(Y=>{Y.type===Zt?s(Y.el):Zi(Y)}):nr(k,F);return}if(v===Ts){T(g);return}const M=()=>{s(k),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(g.shapeFlag&1&&R&&!R.persisted){const{leave:Y,delayLeave:j}=R,W=()=>Y(k,M);j?j(g.el,M,W):W()}else M()},nr=(g,v)=>{let k;for(;g!==v;)k=u(g),s(g),g=k;s(v)},tn=(g,v,k)=>{process.env.NODE_ENV!=="production"&&g.type.__hmrId&&bd(g);const{bum:F,scope:R,job:M,subTree:Y,um:j,m:W,a:I}=g;el(W),el(I),F&&Ii(F),R.stop(),M&&(M.flags|=8,Ot(Y,g,v,k)),j&&Qt(j,v),Qt(()=>{g.isUnmounted=!0},v),process.env.NODE_ENV!=="production"&&Nd(g)},ae=(g,v,k,F=!1,R=!1,M=0)=>{for(let Y=M;Y<g.length;Y++)Ot(g[Y],v,k,F,R)},ve=g=>{if(g.shapeFlag&6)return ve(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=u(g.anchor||g.el),k=v&&v[Pd];return k?u(k):v};let Mo=!1;const mh=(g,v,k)=>{g==null?v._vnode&&Ot(v._vnode,null,null,!0):_(v._vnode||null,g,v,null,null,null,k),v._vnode=g,Mo||(Mo=!0,fa(),pa(),Mo=!1)},qn={p:_,um:Ot,m:mt,r:Zi,mt:A,mc:P,pc:nt,pbc:K,n:ve,o:e};return{render:mh,hydrate:void 0,createApp:eu(mh)}}function Xr({type:e,props:t},i){return i==="svg"&&e==="foreignObject"||i==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:i}function Si({effect:e,job:t},i){i?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ou(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ns(e,t,i=!1){const n=e.children,s=t.children;if(Q(n)&&Q(s))for(let r=0;r<n.length;r++){const o=n[r];let a=s[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[r]=Ze(s[r]),a.el=o.el),!i&&a.patchFlag!==-2&&Ns(o,a)),a.type===yn&&a.patchFlag!==-1&&(a.el=o.el),a.type===Zt&&!a.el&&(a.el=o.el),process.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}function Pu(e){const t=e.slice(),i=[0];let n,s,r,o,a;const l=e.length;for(n=0;n<l;n++){const c=e[n];if(c!==0){if(s=i[i.length-1],e[s]<c){t[n]=s,i.push(n);continue}for(r=0,o=i.length-1;r<o;)a=r+o>>1,e[i[a]]<c?r=a+1:o=a;c<e[i[r]]&&(r>0&&(t[n]=i[r-1]),i[r]=n)}}for(r=i.length,o=i[r-1];r-- >0;)i[r]=o,o=t[o];return i}function tl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:tl(t)}function el(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const il=e=>e.__isSuspense;function Au(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):ua(e)}const Dt=Symbol.for("v-fgt"),yn=Symbol.for("v-txt"),Zt=Symbol.for("v-cmt"),Ts=Symbol.for("v-stc"),Sn=[];let te=null;function at(e=!1){Sn.push(te=e?null:[])}function Ru(){Sn.pop(),te=Sn[Sn.length-1]||null}let wn=1;function ks(e,t=!1){wn+=e,e<0&&te&&t&&(te.hasOnce=!0)}function nl(e){return e.dynamicChildren=wn>0?te||Mi:null,Ru(),wn>0&&te&&te.push(e),e}function vt(e,t,i,n,s,r){return nl(ut(e,t,i,n,s,r,!0))}function Je(e,t,i,n,s){return nl(Tt(e,t,i,n,s,!0))}function ji(e){return e?e.__v_isVNode===!0:!1}function En(e,t){if(process.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const i=gs.get(t.type);if(i&&i.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const Mu=(...e)=>rl(...e),sl=({key:e})=>e??null,Os=({ref:e,ref_key:t,ref_for:i})=>(typeof e=="number"&&(e=""+e),e!=null?Nt(e)||Rt(e)||it(e)?{i:Gt,r:e,k:t,f:!!i}:e:null);function ut(e,t=null,i=null,n=0,s=null,r=e===Dt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&sl(t),ref:t&&Os(t),scopeId:ya,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Gt};return a?(zr(l,i),r&128&&e.normalize(l)):i&&(l.shapeFlag|=Nt(i)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&U("VNode created with invalid key (NaN). VNode type:",l.type),wn>0&&!o&&te&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&te.push(l),l}const Tt=process.env.NODE_ENV!=="production"?Mu:rl;function rl(e,t=null,i=null,n=0,s=null,r=!1){if((!e||e===Wd)&&(process.env.NODE_ENV!=="production"&&!e&&U(`Invalid vnode type when creating vnode: ${e}.`),e=Zt),ji(e)){const a=Qe(e,t,!0);return i&&zr(a,i),wn>0&&!r&&te&&(a.shapeFlag&6?te[te.indexOf(e)]=a:te.push(a)),a.patchFlag=-2,a}if(fl(e)&&(e=e.__vccOpts),t){t=Lu(t);let{class:a,style:l}=t;a&&!Nt(a)&&(t.class=ye(a)),pt(l)&&(as(l)&&!Q(l)&&(l=Ct({},l)),t.style=lr(l))}const o=Nt(e)?1:il(e)?128:Ad(e)?64:pt(e)?4:it(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&as(e)&&(e=rt(e),U("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
8
- Component that was made reactive: `,e)),ut(e,t,i,n,s,o,r,!0)}function Lu(e){return e?as(e)||ja(e)?Ct({},e):e:null}function Qe(e,t,i=!1,n=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=e,c=t?al(s||{},t):s,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&sl(c),ref:t&&t.ref?i&&r?Q(r)?r.concat(Os(t)):[r,Os(t)]:Os(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&Q(a)?a.map(ol):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Dt?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Qe(e.ssContent),ssFallback:e.ssFallback&&Qe(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&n&&Pr(h,l.clone(h)),h}function ol(e){const t=Qe(e);return Q(e.children)&&(t.children=e.children.map(ol)),t}function Iu(e=" ",t=0){return Tt(yn,null,e,t)}function Ps(e="",t=!1){return t?(at(),Je(Zt,null,e)):Tt(Zt,null,e)}function ge(e){return e==null||typeof e=="boolean"?Tt(Zt):Q(e)?Tt(Dt,null,e.slice()):ji(e)?Ze(e):Tt(yn,null,String(e))}function Ze(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Qe(e)}function zr(e,t){let i=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Q(t))i=16;else if(typeof t=="object")if(n&65){const s=t.default;s&&(s._c&&(s._d=!1),zr(e,s()),s._c&&(s._d=!0));return}else{i=32;const s=t._;!s&&!ja(t)?t._ctx=Gt:s===3&&Gt&&(Gt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else it(t)?(t={default:t,_ctx:Gt},i=32):(t=String(t),n&64?(i=16,t=[Iu(t)]):i=8);e.children=t,e.shapeFlag|=i}function al(...e){const t={};for(let i=0;i<e.length;i++){const n=e[i];for(const s in n)if(s==="class")t.class!==n.class&&(t.class=ye([t.class,n.class]));else if(s==="style")t.style=lr([t.style,n.style]);else if(en(s)){const r=t[s],o=n[s];o&&r!==o&&!(Q(r)&&r.includes(o))&&(t[s]=r?[].concat(r,o):o)}else s!==""&&(t[s]=n[s])}return t}function Te(e,t,i,n=null){Ee(e,t,7,[i,n])}const Du=Ia();let Vu=0;function Fu(e,t,i){const n=e.type,s=(t?t.appContext:e.appContext)||Du,r={uid:Vu++,vnode:e,type:n,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Dh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:za(n,s),emitsOptions:Fa(n,s),emit:null,emitted:null,propsDefaults:dt,inheritAttrs:n.inheritAttrs,ctx:dt,data:dt,props:dt,attrs:dt,slots:dt,refs:dt,setupState:dt,setupContext:null,suspense:i,suspenseId:i?i.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};return process.env.NODE_ENV!=="production"?r.ctx=jd(r):r.ctx={_:r},r.root=t?t.root:r,r.emit=au.bind(null,r),e.ce&&e.ce(r),r}let Mt=null;const As=()=>Mt||Gt;let Rs,Yr;{const e=rn(),t=(i,n)=>{let s;return(s=e[i])||(s=e[i]=[]),s.push(n),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};Rs=t("__VUE_INSTANCE_SETTERS__",i=>Mt=i),Yr=t("__VUE_SSR_SETTERS__",i=>Cn=i)}const xn=e=>{const t=Mt;return Rs(e),e.scope.on(),()=>{e.scope.off(),Rs(t)}},ll=()=>{Mt&&Mt.scope.off(),Rs(null)},Gu=Kt("slot,component");function qr(e,{isNativeTag:t}){(Gu(e)||t(e))&&U("Do not use built-in or reserved HTML elements as component id: "+e)}function cl(e){return e.vnode.shapeFlag&4}let Cn=!1;function Bu(e,t=!1,i=!1){t&&Yr(t);const{props:n,children:s}=e.vnode,r=cl(e);fu(e,n,r,t),xu(e,s,i||t);const o=r?$u(e,t):void 0;return t&&Yr(!1),o}function $u(e,t){const i=e.type;if(process.env.NODE_ENV!=="production"){if(i.name&&qr(i.name,e.appContext.config),i.components){const s=Object.keys(i.components);for(let r=0;r<s.length;r++)qr(s[r],e.appContext.config)}if(i.directives){const s=Object.keys(i.directives);for(let r=0;r<s.length;r++)Sa(s[r])}i.compilerOptions&&Hu()&&U('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ka),process.env.NODE_ENV!=="production"&&Xd(e);const{setup:n}=i;if(n){he();const s=e.setupContext=n.length>1?Uu(e):null,r=xn(e),o=Fi(n,e,0,[process.env.NODE_ENV!=="production"?we(e.props):e.props,s]),a=rr(o);if(de(),r(),(a||e.sp)&&!_n(e)&&wa(e),a){if(o.then(ll,ll),t)return o.then(l=>{hl(e,l,t)}).catch(l=>{dn(l,e,0)});if(e.asyncDep=o,process.env.NODE_ENV!=="production"&&!e.suspense){const l=Nn(e,i);U(`Component <${l}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else hl(e,o,t)}else dl(e,t)}function hl(e,t,i){it(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pt(t)?(process.env.NODE_ENV!=="production"&&ji(t)&&U("setup() should not return VNodes directly - return a render function instead."),process.env.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=la(t),process.env.NODE_ENV!=="production"&&zd(e)):process.env.NODE_ENV!=="production"&&t!==void 0&&U(`setup() should return an object. Received: ${t===null?"null":typeof t}`),dl(e,i)}const Hu=()=>!0;function dl(e,t,i){const n=e.type;e.render||(e.render=n.render||Lt);{const s=xn(e);he();try{qd(e)}finally{de(),s()}}process.env.NODE_ENV!=="production"&&!n.render&&e.render===Lt&&!t&&(n.template?U('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):U("Component is missing template or render function: ",n))}const ul=process.env.NODE_ENV!=="production"?{get(e,t){return xs(),It(e,"get",""),e[t]},set(){return U("setupContext.attrs is readonly."),!1},deleteProperty(){return U("setupContext.attrs is readonly."),!1}}:{get(e,t){return It(e,"get",""),e[t]}};function Wu(e){return new Proxy(e.slots,{get(t,i){return It(e,"get","$slots"),t[i]}})}function Uu(e){const t=i=>{if(process.env.NODE_ENV!=="production"&&(e.exposed&&U("expose() should be called only once per setup()."),i!=null)){let n=typeof i;n==="object"&&(Q(i)?n="array":Rt(i)&&(n="ref")),n!=="object"&&U(`expose() should be passed a plain object, received ${n}.`)}e.exposed=i||{}};if(process.env.NODE_ENV!=="production"){let i,n;return Object.freeze({get attrs(){return i||(i=new Proxy(e.attrs,ul))},get slots(){return n||(n=Wu(e))},get emit(){return(s,...r)=>e.emit(s,...r)},expose:t})}else return{attrs:new Proxy(e.attrs,ul),slots:e.slots,emit:e.emit,expose:t}}function Ms(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(la(nd(e.exposed)),{get(t,i){if(i in t)return t[i];if(i in bi)return bi[i](e)},has(t,i){return i in t||i in bi}})):e.proxy}const ju=/(?:^|[-_])\w/g,Xu=e=>e.replace(ju,t=>t.toUpperCase()).replace(/[-_]/g,"");function Kr(e,t=!0){return it(e)?e.displayName||e.name:e.name||t&&e.__name}function Nn(e,t,i=!1){let n=Kr(t);if(!n&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(n=s[1])}if(!n&&e){const s=r=>{for(const o in r)if(r[o]===t)return o};n=s(e.components)||e.parent&&s(e.parent.type.components)||s(e.appContext.components)}return n?Xu(n):i?"App":"Anonymous"}function fl(e){return it(e)&&"__vccOpts"in e}const wi=(e,t)=>{const i=ld(e,t,Cn);if(process.env.NODE_ENV!=="production"){const n=As();n&&n.appContext.config.warnRecursiveComputed&&(i._warnRecursive=!0)}return i};function pl(e,t,i){try{ks(-1);const n=arguments.length;return n===2?pt(t)&&!Q(t)?ji(t)?Tt(e,null,[t]):Tt(e,t):Tt(e,null,t):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&ji(i)&&(i=[i]),Tt(e,t,i))}finally{ks(1)}}function zu(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},i={style:"color:#f5222d"},n={style:"color:#eb2f96"},s={__vue_custom_formatter:!0,header(d){if(!pt(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(Rt(d)){he();const u=d.value;return de(),["div",{},["span",e,h(d)],"<",a(u),">"]}else{if(qe(d))return["div",{},["span",e,Bt(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${ue(d)?" (readonly)":""}`];if(ue(d))return["div",{},["span",e,Bt(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...r(d.$)]}};function r(d){const u=[];d.type.props&&d.props&&u.push(o("props",rt(d.props))),d.setupState!==dt&&u.push(o("setup",d.setupState)),d.data!==dt&&u.push(o("data",rt(d.data)));const f=l(d,"computed");f&&u.push(o("computed",f));const p=l(d,"inject");return p&&u.push(o("injected",p)),u.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),u}function o(d,u){return u=Ct({},u),Object.keys(u).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(u).map(f=>["div",{},["span",n,f+": "],a(u[f],!1)])]]:["span",{}]}function a(d,u=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",i,JSON.stringify(d)]:typeof d=="boolean"?["span",n,d]:pt(d)?["object",{object:u?rt(d):d}]:["span",i,String(d)]}function l(d,u){const f=d.type;if(it(f))return;const p={};for(const _ in d.ctx)c(f,_,u)&&(p[_]=d.ctx[_]);return p}function c(d,u,f){const p=d[f];if(Q(p)&&p.includes(u)||pt(p)&&u in p||d.extends&&c(d.extends,u,f)||d.mixins&&d.mixins.some(_=>c(_,u,f)))return!0}function h(d){return Bt(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}const gl="3.5.25",ee=process.env.NODE_ENV!=="production"?U:Lt;process.env.NODE_ENV,process.env.NODE_ENV;let Jr;const ml=typeof window<"u"&&window.trustedTypes;if(ml)try{Jr=ml.createPolicy("vue",{createHTML:e=>e})}catch(e){process.env.NODE_ENV!=="production"&&ee(`Error creating trusted types policy: ${e}`)}const _l=Jr?e=>Jr.createHTML(e):e=>e,Yu="http://www.w3.org/2000/svg",qu="http://www.w3.org/1998/Math/MathML",Be=typeof document<"u"?document:null,vl=Be&&Be.createElement("template"),Ku={insert:(e,t,i)=>{t.insertBefore(e,i||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,i,n)=>{const s=t==="svg"?Be.createElementNS(Yu,e):t==="mathml"?Be.createElementNS(qu,e):i?Be.createElement(e,{is:i}):Be.createElement(e);return e==="select"&&n&&n.multiple!=null&&s.setAttribute("multiple",n.multiple),s},createText:e=>Be.createTextNode(e),createComment:e=>Be.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Be.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,i,n,s,r){const o=i?i.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),i),!(s===r||!(s=s.nextSibling)););else{vl.innerHTML=_l(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const a=vl.content;if(n==="svg"||n==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,i)}return[o?o.nextSibling:t.firstChild,i?i.previousSibling:t.lastChild]}},Ju=Symbol("_vtc");function Qu(e,t,i){const n=e[Ju];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):i?e.setAttribute("class",t):e.className=t}const bl=Symbol("_vod"),Zu=Symbol("_vsh"),tf=Symbol(process.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),ef=/(?:^|;)\s*display\s*:/;function nf(e,t,i){const n=e.style,s=Nt(i);let r=!1;if(i&&!s){if(t)if(Nt(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();i[a]==null&&Ls(n,a,"")}else for(const o in t)i[o]==null&&Ls(n,o,"");for(const o in i)o==="display"&&(r=!0),Ls(n,o,i[o])}else if(s){if(t!==i){const o=n[tf];o&&(i+=";"+o),n.cssText=i,r=ef.test(i)}}else t&&e.removeAttribute("style");bl in e&&(e[bl]=r?n.display:"",e[Zu]&&(n.display="none"))}const sf=/[^\\];\s*$/,yl=/\s*!important$/;function Ls(e,t,i){if(Q(i))i.forEach(n=>Ls(e,t,n));else if(i==null&&(i=""),process.env.NODE_ENV!=="production"&&sf.test(i)&&ee(`Unexpected semicolon at the end of '${t}' style value: '${i}'`),t.startsWith("--"))e.setProperty(t,i);else{const n=rf(e,t);yl.test(i)?e.setProperty(Jt(n),i.replace(yl,""),"important"):e[n]=i}}const Sl=["Webkit","Moz","ms"],Qr={};function rf(e,t){const i=Qr[t];if(i)return i;let n=Ft(t);if(n!=="filter"&&n in e)return Qr[t]=n;n=hi(n);for(let s=0;s<Sl.length;s++){const r=Sl[s]+n;if(r in e)return Qr[t]=r}return t}const wl="http://www.w3.org/1999/xlink";function El(e,t,i,n,s,r=Lh(t)){n&&t.startsWith("xlink:")?i==null?e.removeAttributeNS(wl,t.slice(6,t.length)):e.setAttributeNS(wl,t,i):i==null||r&&!Go(i)?e.removeAttribute(t):e.setAttribute(t,r?"":be(i)?String(i):i)}function xl(e,t,i,n,s){if(t==="innerHTML"||t==="textContent"){i!=null&&(e[t]=t==="innerHTML"?_l(i):i);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?e.getAttribute("value")||"":e.value,l=i==null?e.type==="checkbox"?"on":"":String(i);(a!==l||!("_value"in e))&&(e.value=l),i==null&&e.removeAttribute(t),e._value=i;return}let o=!1;if(i===""||i==null){const a=typeof e[t];a==="boolean"?i=Go(i):i==null&&a==="string"?(i="",o=!0):a==="number"&&(i=0,o=!0)}try{e[t]=i}catch(a){process.env.NODE_ENV!=="production"&&!o&&ee(`Failed setting prop "${t}" on <${r.toLowerCase()}>: value ${i} is invalid.`,a)}o&&e.removeAttribute(s||t)}function $e(e,t,i,n){e.addEventListener(t,i,n)}function of(e,t,i,n){e.removeEventListener(t,i,n)}const Cl=Symbol("_vei");function af(e,t,i,n,s=null){const r=e[Cl]||(e[Cl]={}),o=r[t];if(n&&o)o.value=process.env.NODE_ENV!=="production"?Tl(n,t):n;else{const[a,l]=lf(t);if(n){const c=r[t]=df(process.env.NODE_ENV!=="production"?Tl(n,t):n,s);$e(e,a,c,l)}else o&&(of(e,a,o,l),r[t]=void 0)}}const Nl=/(?:Once|Passive|Capture)$/;function lf(e){let t;if(Nl.test(e)){t={};let n;for(;n=e.match(Nl);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Jt(e.slice(2)),t]}let Zr=0;const cf=Promise.resolve(),hf=()=>Zr||(cf.then(()=>Zr=0),Zr=Date.now());function df(e,t){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;Ee(uf(n,i.value),t,5,[n])};return i.value=e,i.attached=hf(),i}function Tl(e,t){return it(e)||Q(e)?e:(ee(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
9
- Expected function or array of functions, received type ${typeof e}.`),Lt)}function uf(e,t){if(Q(t)){const i=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{i.call(e),e._stopped=!0},t.map(n=>s=>!s._stopped&&n&&n(s))}else return t}const kl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ff=(e,t,i,n,s,r)=>{const o=s==="svg";t==="class"?Qu(e,n,o):t==="style"?nf(e,i,n):en(t)?Jn(t)||af(e,t,i,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pf(e,t,n,o))?(xl(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&El(e,t,n,o,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Nt(n))?xl(e,Ft(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),El(e,t,n,o))};function pf(e,t,i,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&kl(t)&&it(i));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return kl(t)&&Nt(i)?!1:t in e}const Ol={};function Pl(e,t,i){let n=Ne(e,t);Qn(n)&&(n=Ct({},n,t));class s extends to{constructor(o){super(n,o,i)}}return s.def=n,s}const gf=typeof HTMLElement<"u"?HTMLElement:class{};class to extends gf{constructor(t,i={},n=Gl){super(),this._def=t,this._props=i,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==Gl?this._root=this.shadowRoot:(process.env.NODE_ENV!=="production"&&this.shadowRoot&&ee("Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use `defineSSRCustomElement`."),t.shadowRoot!==!1?(this.attachShadow(Ct({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof to){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,fs(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const i of t)this._setAttr(i.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n<this.attributes.length;n++)this._setAttr(this.attributes[n].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(n,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:o}=n;let a;if(r&&!Q(r))for(const l in r){const c=r[l];(c===Number||c&&c.type===Number)&&(l in this._props&&(this._props[l]=Vo(this._props[l])),(a||(a=Object.create(null)))[Ft(l)]=!0)}this._numberProps=a,this._resolveProps(n),this.shadowRoot?this._applyStyles(o):process.env.NODE_ENV!=="production"&&o&&ee("Custom element style injection is not supported when using shadowRoot: false"),this._mount(n)},i=this._def.__asyncLoader;i?this._pendingResolve=i().then(n=>{n.configureApp=this._def.configureApp,t(this._def=n,!0)}):t(this._def)}_mount(t){process.env.NODE_ENV!=="production"&&!t.name&&(t.name="VueElement"),this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const i=this._instance&&this._instance.exposed;if(i)for(const n in i)lt(this,n)?process.env.NODE_ENV!=="production"&&ee(`Exposed property "${n}" already exists on custom element.`):Object.defineProperty(this,n,{get:()=>aa(i[n])})}_resolveProps(t){const{props:i}=t,n=Q(i)?i:Object.keys(i||{});for(const s of Object.keys(this))s[0]!=="_"&&n.includes(s)&&this._setProp(s,this[s]);for(const s of n.map(Ft))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(r){this._setProp(s,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const i=this.hasAttribute(t);let n=i?this.getAttribute(t):Ol;const s=Ft(t);i&&this._numberProps&&this._numberProps[s]&&(n=Vo(n)),this._setProp(s,n,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,i,n=!0,s=!1){if(i!==this._props[t]&&(this._dirty=!0,i===Ol?delete this._props[t]:(this._props[t]=i,t==="key"&&this._app&&(this._app._ceVNode.key=i)),s&&this._instance&&this._update(),n)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),i===!0?this.setAttribute(Jt(t),""):typeof i=="string"||typeof i=="number"?this.setAttribute(Jt(t),i+""):i||this.removeAttribute(Jt(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),xf(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const i=Tt(this._def,Ct(t,this._props));return this._instance||(i.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0,process.env.NODE_ENV!=="production"&&(n.ceReload=r=>{this._styles&&(this._styles.forEach(o=>this._root.removeChild(o)),this._styles.length=0),this._applyStyles(r),this._instance=null,this._update()});const s=(r,o)=>{this.dispatchEvent(new CustomEvent(r,Qn(o[0])?Ct({detail:o},o[0]):{detail:o}))};n.emit=(r,...o)=>{s(r,o),Jt(r)!==r&&s(Jt(r),o)},this._setParent()}),i}_applyStyles(t,i){if(!t)return;if(i){if(i===this._def||this._styleChildren.has(i))return;this._styleChildren.add(i)}const n=this._nonce;for(let s=t.length-1;s>=0;s--){const r=document.createElement("style");if(n&&r.setAttribute("nonce",n),r.textContent=t[s],this.shadowRoot.prepend(r),process.env.NODE_ENV!=="production")if(i){if(i.__hmrId){this._childStyles||(this._childStyles=new Map);let o=this._childStyles.get(i.__hmrId);o||this._childStyles.set(i.__hmrId,o=[]),o.push(r)}}else(this._styles||(this._styles=[])).push(r)}}_parseSlots(){const t=this._slots={};let i;for(;i=this.firstChild;){const n=i.nodeType===1&&i.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(i),this.removeChild(i)}}_renderSlots(){const t=this._getSlots(),i=this._instance.type.__scopeId;for(let n=0;n<t.length;n++){const s=t[n],r=s.getAttribute("name")||"default",o=this._slots[r],a=s.parentNode;if(o)for(const l of o){if(i&&l.nodeType===1){const c=i+"-s",h=document.createTreeWalker(l,1);l.setAttribute(c,"");let d;for(;d=h.nextNode();)d.setAttribute(c,"")}a.insertBefore(l,s)}else for(;s.firstChild;)a.insertBefore(s.firstChild,s);a.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const i=new Set;for(const n of t){const s=n.querySelectorAll("slot");for(let r=0;r<s.length;r++)i.add(s[r])}return Array.from(i)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){if(process.env.NODE_ENV!=="production"&&(this._styleChildren.delete(t),this._childStyles&&t.__hmrId)){const i=this._childStyles.get(t.__hmrId);i&&(i.forEach(n=>this._root.removeChild(n)),i.length=0)}}}const ti=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?i=>Ii(t,i):t};function mf(e){e.target.composing=!0}function Al(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const re=Symbol("_assign");function Rl(e,t,i){return t&&(e=e.trim()),i&&(e=es(e)),e}const Is={created(e,{modifiers:{lazy:t,trim:i,number:n}},s){e[re]=ti(s);const r=n||s.props&&s.props.type==="number";$e(e,t?"change":"input",o=>{o.target.composing||e[re](Rl(e.value,i,r))}),(i||r)&&$e(e,"change",()=>{e.value=Rl(e.value,i,r)}),t||($e(e,"compositionstart",mf),$e(e,"compositionend",Al),$e(e,"change",Al))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:i,modifiers:{lazy:n,trim:s,number:r}},o){if(e[re]=ti(o),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?es(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(n&&t===i||s&&e.value.trim()===l)||(e.value=l))}},Ml={deep:!0,created(e,t,i){e[re]=ti(i),$e(e,"change",()=>{const n=e._modelValue,s=Xi(e),r=e.checked,o=e[re];if(Q(n)){const a=cr(n,s),l=a!==-1;if(r&&!l)o(n.concat(s));else if(!r&&l){const c=[...n];c.splice(a,1),o(c)}}else if(Li(n)){const a=new Set(n);r?a.add(s):a.delete(s),o(a)}else o(Dl(e,r))})},mounted:Ll,beforeUpdate(e,t,i){e[re]=ti(i),Ll(e,t,i)}};function Ll(e,{value:t,oldValue:i},n){e._modelValue=t;let s;if(Q(t))s=cr(t,n.props.value)>-1;else if(Li(t))s=t.has(n.props.value);else{if(t===i)return;s=ui(t,Dl(e,!0))}e.checked!==s&&(e.checked=s)}const _f={created(e,{value:t},i){e.checked=ui(t,i.props.value),e[re]=ti(i),$e(e,"change",()=>{e[re](Xi(e))})},beforeUpdate(e,{value:t,oldValue:i},n){e[re]=ti(n),t!==i&&(e.checked=ui(t,n.props.value))}},vf={deep:!0,created(e,{value:t,modifiers:{number:i}},n){const s=Li(t);$e(e,"change",()=>{const r=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>i?es(Xi(o)):Xi(o));e[re](e.multiple?s?new Set(r):r:r[0]),e._assigning=!0,fs(()=>{e._assigning=!1})}),e[re]=ti(n)},mounted(e,{value:t}){Il(e,t)},beforeUpdate(e,t,i){e[re]=ti(i)},updated(e,{value:t}){e._assigning||Il(e,t)}};function Il(e,t){const i=e.multiple,n=Q(t);if(i&&!n&&!Li(t)){process.env.NODE_ENV!=="production"&&ee(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let s=0,r=e.options.length;s<r;s++){const o=e.options[s],a=Xi(o);if(i)if(n){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(c=>String(c)===String(a)):o.selected=cr(t,a)>-1}else o.selected=t.has(a);else if(ui(Xi(o),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!i&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function Xi(e){return"_value"in e?e._value:e.value}function Dl(e,t){const i=t?"_trueValue":"_falseValue";return i in e?e[i]:t}const bf={created(e,t,i){Ds(e,t,i,null,"created")},mounted(e,t,i){Ds(e,t,i,null,"mounted")},beforeUpdate(e,t,i,n){Ds(e,t,i,n,"beforeUpdate")},updated(e,t,i,n){Ds(e,t,i,n,"updated")}};function yf(e,t){switch(e){case"SELECT":return vf;case"TEXTAREA":return Is;default:switch(t){case"checkbox":return Ml;case"radio":return _f;default:return Is}}}function Ds(e,t,i,n,s){const o=yf(e.tagName,i.props&&i.props.type)[s];o&&o(e,t,i,n)}const Sf=["ctrl","shift","alt","meta"],wf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Sf.some(i=>e[`${i}Key`]&&!t.includes(i))},eo=(e,t)=>{const i=e._withMods||(e._withMods={}),n=t.join(".");return i[n]||(i[n]=((s,...r)=>{for(let o=0;o<t.length;o++){const a=wf[t[o]];if(a&&a(s,t))return}return e(s,...r)}))},Ef=Ct({patchProp:ff},Ku);let Vl;function Fl(){return Vl||(Vl=Tu(Ef))}const xf=((...e)=>{Fl().render(...e)}),Gl=((...e)=>{const t=Fl().createApp(...e);process.env.NODE_ENV!=="production"&&(Nf(t),Tf(t));const{mount:i}=t;return t.mount=n=>{const s=kf(n);if(!s)return;const r=t._component;!it(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=i(s,!1,Cf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function Cf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Nf(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>Ah(t)||Rh(t)||Mh(t),writable:!1})}function Tf(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){ee("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const i=e.config.compilerOptions,n='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return ee(n),i},set(){ee(n)}})}}function kf(e){if(Nt(e)){const t=document.querySelector(e);return process.env.NODE_ENV!=="production"&&!t&&ee(`Failed to mount app: mount target selector "${e}" returned null.`),t}return process.env.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&ee('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}function Of(){zu()}process.env.NODE_ENV!=="production"&&Of();const Bl=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Pf=Bl+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Af="["+Bl+"]["+Pf+"]*",Rf=new RegExp("^"+Af+"$");function $l(e,t){const i=[];let n=t.exec(e);for(;n;){const s=[];s.startIndex=t.lastIndex-n[0].length;const r=n.length;for(let o=0;o<r;o++)s.push(n[o]);i.push(s),n=t.exec(e)}return i}const Vs=function(e){const t=Rf.exec(e);return!(t===null||typeof t>"u")};function Mf(e){return typeof e<"u"}const Lf={allowBooleanAttributes:!1,unpairedTags:[]};function If(e,t){t=Object.assign({},Lf,t);const i=[];let n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let r=0;r<e.length;r++)if(e[r]==="<"&&e[r+1]==="?"){if(r+=2,r=Wl(e,r),r.err)return r}else if(e[r]==="<"){let o=r;if(r++,e[r]==="!"){r=Ul(e,r);continue}else{let a=!1;e[r]==="/"&&(a=!0,r++);let l="";for(;r<e.length&&e[r]!==">"&&e[r]!==" "&&e[r]!==" "&&e[r]!==`
10
- `&&e[r]!=="\r";r++)l+=e[r];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),r--),!Wf(l)){let d;return l.trim().length===0?d="Invalid space after '<'.":d="Tag '"+l+"' is an invalid name.",Pt("InvalidTag",d,Wt(e,r))}const c=Ff(e,r);if(c===!1)return Pt("InvalidAttr","Attributes for '"+l+"' have open quote.",Wt(e,r));let h=c.value;if(r=c.index,h[h.length-1]==="/"){const d=r-h.length;h=h.substring(0,h.length-1);const u=jl(h,t);if(u===!0)n=!0;else return Pt(u.err.code,u.err.msg,Wt(e,d+u.err.line))}else if(a)if(c.tagClosed){if(h.trim().length>0)return Pt("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Wt(e,o));if(i.length===0)return Pt("InvalidTag","Closing tag '"+l+"' has not been opened.",Wt(e,o));{const d=i.pop();if(l!==d.tagName){let u=Wt(e,d.tagStartPos);return Pt("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+u.line+", col "+u.col+") instead of closing tag '"+l+"'.",Wt(e,o))}i.length==0&&(s=!0)}}else return Pt("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Wt(e,r));else{const d=jl(h,t);if(d!==!0)return Pt(d.err.code,d.err.msg,Wt(e,r-h.length+d.err.line));if(s===!0)return Pt("InvalidXml","Multiple possible root nodes found.",Wt(e,r));t.unpairedTags.indexOf(l)!==-1||i.push({tagName:l,tagStartPos:o}),n=!0}for(r++;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="!"){r++,r=Ul(e,r);continue}else if(e[r+1]==="?"){if(r=Wl(e,++r),r.err)return r}else break;else if(e[r]==="&"){const d=$f(e,r);if(d==-1)return Pt("InvalidChar","char '&' is not expected.",Wt(e,r));r=d}else if(s===!0&&!Hl(e[r]))return Pt("InvalidXml","Extra text at the end",Wt(e,r));e[r]==="<"&&r--}}else{if(Hl(e[r]))continue;return Pt("InvalidChar","char '"+e[r]+"' is not expected.",Wt(e,r))}if(n){if(i.length==1)return Pt("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",Wt(e,i[0].tagStartPos));if(i.length>0)return Pt("InvalidXml","Invalid '"+JSON.stringify(i.map(r=>r.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Pt("InvalidXml","Start tag expected.",1);return!0}function Hl(e){return e===" "||e===" "||e===`
11
- `||e==="\r"}function Wl(e,t){const i=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const n=e.substr(i,t-i);if(t>5&&n==="xml")return Pt("InvalidXml","XML declaration allowed only at the start of the document.",Wt(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function Ul(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let i=1;for(t+=8;t<e.length;t++)if(e[t]==="<")i++;else if(e[t]===">"&&(i--,i===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}const Df='"',Vf="'";function Ff(e,t){let i="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Df||e[t]===Vf)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}i+=e[t]}return n!==""?!1:{value:i,index:t,tagClosed:s}}const Gf=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function jl(e,t){const i=$l(e,Gf),n={};for(let s=0;s<i.length;s++){if(i[s][1].length===0)return Pt("InvalidAttr","Attribute '"+i[s][2]+"' has no space in starting.",Tn(i[s]));if(i[s][3]!==void 0&&i[s][4]===void 0)return Pt("InvalidAttr","Attribute '"+i[s][2]+"' is without value.",Tn(i[s]));if(i[s][3]===void 0&&!t.allowBooleanAttributes)return Pt("InvalidAttr","boolean attribute '"+i[s][2]+"' is not allowed.",Tn(i[s]));const r=i[s][2];if(!Hf(r))return Pt("InvalidAttr","Attribute '"+r+"' is an invalid name.",Tn(i[s]));if(!n.hasOwnProperty(r))n[r]=1;else return Pt("InvalidAttr","Attribute '"+r+"' is repeated.",Tn(i[s]))}return!0}function Bf(e,t){let i=/\d/;for(e[t]==="x"&&(t++,i=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(i))break}return-1}function $f(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Bf(e,t);let i=0;for(;t<e.length;t++,i++)if(!(e[t].match(/\w/)&&i<20)){if(e[t]===";")break;return-1}return t}function Pt(e,t,i){return{err:{code:e,msg:t,line:i.line||i,col:i.col}}}function Hf(e){return Vs(e)}function Wf(e){return Vs(e)}function Wt(e,t){const i=e.substring(0,t).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function Tn(e){return e.startIndex+e[1].length}const Uf={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e},captureMetaData:!1},jf=function(e){return Object.assign({},Uf,e)};let Fs;typeof Symbol!="function"?Fs="@@xmlMetadata":Fs=Symbol("XML Node Metadata");class Ei{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,i){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:i})}addChild(t,i){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),i!==void 0&&(this.child[this.child.length-1][Fs]={startIndex:i})}static getMetaDataSymbol(){return Fs}}class Xf{constructor(t){this.suppressValidationErr=!t}readDocType(t,i){const n={};if(t[i+3]==="O"&&t[i+4]==="C"&&t[i+5]==="T"&&t[i+6]==="Y"&&t[i+7]==="P"&&t[i+8]==="E"){i=i+9;let s=1,r=!1,o=!1,a="";for(;i<t.length;i++)if(t[i]==="<"&&!o){if(r&&xi(t,"!ENTITY",i)){i+=7;let l,c;[l,c,i]=this.readEntityExp(t,i+1,this.suppressValidationErr),c.indexOf("&")===-1&&(n[l]={regx:RegExp(`&${l};`,"g"),val:c})}else if(r&&xi(t,"!ELEMENT",i)){i+=8;const{index:l}=this.readElementExp(t,i+1);i=l}else if(r&&xi(t,"!ATTLIST",i))i+=8;else if(r&&xi(t,"!NOTATION",i)){i+=9;const{index:l}=this.readNotationExp(t,i+1,this.suppressValidationErr);i=l}else if(xi(t,"!--",i))o=!0;else throw new Error("Invalid DOCTYPE");s++,a=""}else if(t[i]===">"){if(o?t[i-1]==="-"&&t[i-2]==="-"&&(o=!1,s--):s--,s===0)break}else t[i]==="["?r=!0:a+=t[i];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i}}readEntityExp(t,i){i=zt(t,i);let n="";for(;i<t.length&&!/\s/.test(t[i])&&t[i]!=='"'&&t[i]!=="'";)n+=t[i],i++;if(kn(n),i=zt(t,i),!this.suppressValidationErr){if(t.substring(i,i+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[i]==="%")throw new Error("Parameter entities are not supported")}let s="";return[i,s]=this.readIdentifierVal(t,i,"entity"),i--,[n,s,i]}readNotationExp(t,i){i=zt(t,i);let n="";for(;i<t.length&&!/\s/.test(t[i]);)n+=t[i],i++;!this.suppressValidationErr&&kn(n),i=zt(t,i);const s=t.substring(i,i+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);i+=s.length,i=zt(t,i);let r=null,o=null;if(s==="PUBLIC")[i,r]=this.readIdentifierVal(t,i,"publicIdentifier"),i=zt(t,i),(t[i]==='"'||t[i]==="'")&&([i,o]=this.readIdentifierVal(t,i,"systemIdentifier"));else if(s==="SYSTEM"&&([i,o]=this.readIdentifierVal(t,i,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:r,systemIdentifier:o,index:--i}}readIdentifierVal(t,i,n){let s="";const r=t[i];if(r!=='"'&&r!=="'")throw new Error(`Expected quoted string, found "${r}"`);for(i++;i<t.length&&t[i]!==r;)s+=t[i],i++;if(t[i]!==r)throw new Error(`Unterminated ${n} value`);return i++,[i,s]}readElementExp(t,i){i=zt(t,i);let n="";for(;i<t.length&&!/\s/.test(t[i]);)n+=t[i],i++;if(!this.suppressValidationErr&&!Vs(n))throw new Error(`Invalid element name: "${n}"`);i=zt(t,i);let s="";if(t[i]==="E"&&xi(t,"MPTY",i))i+=4;else if(t[i]==="A"&&xi(t,"NY",i))i+=2;else if(t[i]==="("){for(i++;i<t.length&&t[i]!==")";)s+=t[i],i++;if(t[i]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[i]}"`);return{elementName:n,contentModel:s.trim(),index:i}}readAttlistExp(t,i){i=zt(t,i);let n="";for(;i<t.length&&!/\s/.test(t[i]);)n+=t[i],i++;kn(n),i=zt(t,i);let s="";for(;i<t.length&&!/\s/.test(t[i]);)s+=t[i],i++;if(!kn(s))throw new Error(`Invalid attribute name: "${s}"`);i=zt(t,i);let r="";if(t.substring(i,i+8).toUpperCase()==="NOTATION"){if(r="NOTATION",i+=8,i=zt(t,i),t[i]!=="(")throw new Error(`Expected '(', found "${t[i]}"`);i++;let a=[];for(;i<t.length&&t[i]!==")";){let l="";for(;i<t.length&&t[i]!=="|"&&t[i]!==")";)l+=t[i],i++;if(l=l.trim(),!kn(l))throw new Error(`Invalid notation name: "${l}"`);a.push(l),t[i]==="|"&&(i++,i=zt(t,i))}if(t[i]!==")")throw new Error("Unterminated list of notations");i++,r+=" ("+a.join("|")+")"}else{for(;i<t.length&&!/\s/.test(t[i]);)r+=t[i],i++;const a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: "${r}"`)}i=zt(t,i);let o="";return t.substring(i,i+8).toUpperCase()==="#REQUIRED"?(o="#REQUIRED",i+=8):t.substring(i,i+7).toUpperCase()==="#IMPLIED"?(o="#IMPLIED",i+=7):[i,o]=this.readIdentifierVal(t,i,"ATTLIST"),{elementName:n,attributeName:s,attributeType:r,defaultValue:o,index:i}}}const zt=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function xi(e,t,i){for(let n=0;n<t.length;n++)if(t[n]!==e[i+n+1])return!1;return!0}function kn(e){if(Vs(e))return e;throw new Error(`Invalid entity name ${e}`)}const zf=/^[-+]?0x[a-fA-F0-9]+$/,Yf=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,qf={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Kf(e,t={}){if(t=Object.assign({},qf,t),!e||typeof e!="string")return e;let i=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(i))return e;if(e==="0")return 0;if(t.hex&&zf.test(i))return t0(i,16);if(i.includes("e")||i.includes("E"))return Qf(e,i,t);{const n=Yf.exec(i);if(n){const s=n[1]||"",r=n[2];let o=Zf(n[3]);const a=s?e[r.length+1]===".":e[r.length]===".";if(!t.leadingZeros&&(r.length>1||r.length===1&&!a))return e;{const l=Number(i),c=String(l);if(l===0)return l;if(c.search(/[eE]/)!==-1)return t.eNotation?l:e;if(i.indexOf(".")!==-1)return c==="0"||c===o||c===`${s}${o}`?l:e;let h=r?o:i;return r?h===c||s+h===c?l:e:h===c||h===s+c?l:e}}else return e}}const Jf=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Qf(e,t,i){if(!i.eNotation)return e;const n=t.match(Jf);if(n){let s=n[1]||"";const r=n[3].indexOf("e")===-1?"E":"e",o=n[2],a=s?e[o.length+1]===r:e[o.length]===r;return o.length>1&&a?e:o.length===1&&(n[3].startsWith(`.${r}`)||n[3][0]===r)?Number(t):i.leadingZeros&&!a?(t=(n[1]||"")+n[3],Number(t)):e}else return e}function Zf(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function t0(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Xl(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const i of e)if(typeof i=="string"&&t===i||i instanceof RegExp&&i.test(t))return!0}:()=>!1}class e0{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(i,n)=>String.fromCodePoint(Number.parseInt(n,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(i,n)=>String.fromCodePoint(Number.parseInt(n,16))}},this.addExternalEntities=i0,this.parseXml=a0,this.parseTextData=n0,this.resolveNameSpace=s0,this.buildAttributesMap=o0,this.isItStopNode=d0,this.replaceEntitiesValue=c0,this.readStopNodeData=f0,this.saveTextToParentTag=h0,this.addChild=l0,this.ignoreAttributesFn=Xl(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let i=0;i<this.options.stopNodes.length;i++){const n=this.options.stopNodes[i];typeof n=="string"&&(n.startsWith("*.")?this.stopNodesWildcard.add(n.substring(2)):this.stopNodesExact.add(n))}}}}function i0(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function n0(e,t,i,n,s,r,o){if(e!==void 0&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const a=this.options.tagValueProcessor(t,e,i,s,r);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?no(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?no(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function s0(e){if(this.options.removeNSPrefix){const t=e.split(":"),i=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=i+t[1])}return e}const r0=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function o0(e,t){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const i=$l(e,r0),n=i.length,s={};for(let r=0;r<n;r++){const o=this.resolveNameSpace(i[r][1]);if(this.ignoreAttributesFn(o,t))continue;let a=i[r][4],l=this.options.attributeNamePrefix+o;if(o.length)if(this.options.transformAttributeName&&(l=this.options.transformAttributeName(l)),l==="__proto__"&&(l="#__proto__"),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);const c=this.options.attributeValueProcessor(o,a,t);c==null?s[l]=a:typeof c!=typeof a||c!==a?s[l]=c:s[l]=no(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[l]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const r={};return r[this.options.attributesGroupName]=s,r}return s}}const a0=function(e){e=e.replace(/\r\n?/g,`
12
- `);const t=new Ei("!xml");let i=t,n="",s="";const r=new Xf(this.options.processEntities);for(let o=0;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="/"){const l=Ci(e,">",o,"Closing Tag is not closed.");let c=e.substring(o+2,l).trim();if(this.options.removeNSPrefix){const u=c.indexOf(":");u!==-1&&(c=c.substr(u+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),i&&(n=this.saveTextToParentTag(n,i,s));const h=s.substring(s.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let d=0;h&&this.options.unpairedTags.indexOf(h)!==-1?(d=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=s.lastIndexOf("."),s=s.substring(0,d),i=this.tagsNodeStack.pop(),n="",o=l}else if(e[o+1]==="?"){let l=io(e,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,s),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const c=new Ei(l.tagName);c.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(c[":@"]=this.buildAttributesMap(l.tagExp,s)),this.addChild(i,c,s,o)}o=l.closeIndex+1}else if(e.substr(o+1,3)==="!--"){const l=Ci(e,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const c=e.substring(o+4,l-2);n=this.saveTextToParentTag(n,i,s),i.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=l}else if(e.substr(o+1,2)==="!D"){const l=r.readDocType(e,o);this.docTypeEntities=l.entities,o=l.i}else if(e.substr(o+1,2)==="!["){const l=Ci(e,"]]>",o,"CDATA is not closed.")-2,c=e.substring(o+9,l);n=this.saveTextToParentTag(n,i,s);let h=this.parseTextData(c,i.tagname,s,!0,!1,!0,!0);h==null&&(h=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):i.add(this.options.textNodeName,h),o=l+2}else{let l=io(e,o,this.options.removeNSPrefix),c=l.tagName;const h=l.rawTagName;let d=l.tagExp,u=l.attrExpPresent,f=l.closeIndex;if(this.options.transformTagName){const b=this.options.transformTagName(c);d===c&&(d=b),c=b}i&&n&&i.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,i,s,!1));const p=i;p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(i=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),c!==t.tagname&&(s+=s?"."+c:c);const _=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,c)){let b="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),d=c):d=d.substr(0,d.length-1),o=l.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=l.closeIndex;else{const y=this.readStopNodeData(e,h,f+1);if(!y)throw new Error(`Unexpected end of ${h}`);o=y.i,b=y.tagContent}const w=new Ei(c);c!==d&&u&&(w[":@"]=this.buildAttributesMap(d,s)),b&&(b=this.parseTextData(b,c,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),w.add(this.options.textNodeName,b),this.addChild(i,w,s,_)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),d=c):d=d.substr(0,d.length-1),this.options.transformTagName){const w=this.options.transformTagName(c);d===c&&(d=w),c=w}const b=new Ei(c);c!==d&&u&&(b[":@"]=this.buildAttributesMap(d,s)),this.addChild(i,b,s,_),s=s.substr(0,s.lastIndexOf("."))}else{const b=new Ei(c);this.tagsNodeStack.push(i),c!==d&&u&&(b[":@"]=this.buildAttributesMap(d,s)),this.addChild(i,b,s,_),i=b}n="",o=f}}else n+=e[o];return t.child};function l0(e,t,i,n){this.options.captureMetaData||(n=void 0);const s=this.options.updateTag(t.tagname,i,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t,n))}const c0=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const i=this.docTypeEntities[t];e=e.replace(i.regx,i.val)}for(let t in this.lastEntities){const i=this.lastEntities[t];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const i=this.htmlEntities[t];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function h0(e,t,i,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,i,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function d0(e,t,i,n){return!!(t&&t.has(n)||e&&e.has(i))}function u0(e,t,i=">"){let n,s="";for(let r=t;r<e.length;r++){let o=e[r];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===i[0])if(i[1]){if(e[r+1]===i[1])return{data:s,index:r}}else return{data:s,index:r};else o===" "&&(o=" ");s+=o}}function Ci(e,t,i,n){const s=e.indexOf(t,i);if(s===-1)throw new Error(n);return s+t.length-1}function io(e,t,i,n=">"){const s=u0(e,t+1,n);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,c=!0;a!==-1&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(i){const d=l.indexOf(":");d!==-1&&(l=l.substr(d+1),c=l!==s.data.substr(d+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:c,rawTagName:h}}function f0(e,t,i){const n=i;let s=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const r=Ci(e,">",i,`${t} is not closed`);if(e.substring(i+2,r).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,i),i:r};i=r}else if(e[i+1]==="?")i=Ci(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=Ci(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=Ci(e,"]]>",i,"StopNode is not closed.")-2;else{const r=io(e,i,">");r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!=="/"&&s++,i=r.closeIndex)}}function no(e,t,i){if(t&&typeof e=="string"){const n=e.trim();return n==="true"?!0:n==="false"?!1:Kf(e,i)}else return Mf(e)?e:""}const so=Ei.getMetaDataSymbol();function p0(e,t){return zl(e,t)}function zl(e,t,i){let n;const s={};for(let r=0;r<e.length;r++){const o=e[r],a=g0(o);let l="";if(i===void 0?l=a:l=i+"."+a,a===t.textNodeName)n===void 0?n=o[a]:n+=""+o[a];else{if(a===void 0)continue;if(o[a]){let c=zl(o[a],t,l);const h=_0(c,t);o[so]!==void 0&&(c[so]=o[so]),o[":@"]?m0(c,o[":@"],l,t):Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?c=c[t.textNodeName]:Object.keys(c).length===0&&(t.alwaysCreateTextNode?c[t.textNodeName]="":c=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(c)):t.isArray(a,l,h)?s[a]=[c]:s[a]=c}}}return typeof n=="string"?n.length>0&&(s[t.textNodeName]=n):n!==void 0&&(s[t.textNodeName]=n),s}function g0(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];if(n!==":@")return n}}function m0(e,t,i,n){if(t){const s=Object.keys(t),r=s.length;for(let o=0;o<r;o++){const a=s[o];n.isArray(a,i+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function _0(e,t){const{textNodeName:i}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[i]||typeof e[i]=="boolean"||e[i]===0))}class ro{constructor(t){this.externalEntities={},this.options=jf(t)}parse(t,i){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});const r=If(t,i);if(r!==!0)throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`)}const n=new e0(this.options);n.addExternalEntities(this.externalEntities);const s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:p0(s,this.options)}addEntity(t,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=i}static getMetaDataSymbol(){return Ei.getMetaDataSymbol()}}const v0=`
13
- `;function b0(e,t){let i="";return t.format&&t.indentBy.length>0&&(i=v0),Yl(e,t,"",i)}function Yl(e,t,i,n){let s="",r=!1;for(let o=0;o<e.length;o++){const a=e[o],l=y0(a);if(l===void 0)continue;let c="";if(i.length===0?c=l:c=`${i}.${l}`,l===t.textNodeName){let p=a[l];S0(c,t)||(p=t.tagValueProcessor(l,p),p=Kl(p,t)),r&&(s+=n),s+=p,r=!1;continue}else if(l===t.cdataPropName){r&&(s+=n),s+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,r=!1;continue}else if(l===t.commentPropName){s+=n+`<!--${a[l][0][t.textNodeName]}-->`,r=!0;continue}else if(l[0]==="?"){const p=ql(a[":@"],t),_=l==="?xml"?"":n;let b=a[l][0][t.textNodeName];b=b.length!==0?" "+b:"",s+=_+`<${l}${b}${p}?>`,r=!0;continue}let h=n;h!==""&&(h+=t.indentBy);const d=ql(a[":@"],t),u=n+`<${l}${d}`,f=Yl(a[l],t,c,h);t.unpairedTags.indexOf(l)!==-1?t.suppressUnpairedNode?s+=u+">":s+=u+"/>":(!f||f.length===0)&&t.suppressEmptyNode?s+=u+"/>":f&&f.endsWith(">")?s+=u+`>${f}${n}</${l}>`:(s+=u+">",f&&n!==""&&(f.includes("/>")||f.includes("</"))?s+=n+t.indentBy+f+n:s+=f,s+=`</${l}>`),r=!0}return s}function y0(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];if(e.hasOwnProperty(n)&&n!==":@")return n}}function ql(e,t){let i="";if(e&&!t.ignoreAttributes)for(let n in e){if(!e.hasOwnProperty(n))continue;let s=t.attributeValueProcessor(n,e[n]);s=Kl(s,t),s===!0&&t.suppressBooleanAttributes?i+=` ${n.substr(t.attributeNamePrefix.length)}`:i+=` ${n.substr(t.attributeNamePrefix.length)}="${s}"`}return i}function S0(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let i=e.substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes)if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+i)return!0;return!1}function Kl(e,t){if(e&&e.length>0&&t.processEntities)for(let i=0;i<t.entities.length;i++){const n=t.entities[i];e=e.replace(n.regex,n.val)}return e}const w0={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ke(e){this.options=Object.assign({},w0,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Xl(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=C0),this.processTextOrObjNode=E0,this.options.format?(this.indentate=x0,this.tagEndChar=`>
7
+ For more details, see https://link.vuejs.org/feature-flags.`)}}const Zt=Bu;function Vu(e){return Fu(e)}function Fu(e,t){Du();const i=on();i.__VUE__=!0,process.env.NODE_ENV!=="production"&&Pr(i.__VUE_DEVTOOLS_GLOBAL_HOOK__,i);const{insert:n,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:h,setElementText:c,parentNode:d,nextSibling:u,setScopeId:f=Lt,insertStaticContent:p}=e,_=(g,y,k,F=null,M=null,R=null,Y=void 0,j=null,W=process.env.NODE_ENV!=="production"&&Ne?!1:!!y.dynamicChildren)=>{if(g===y)return;g&&!xn(g,y)&&(F=be(g),Pt(g,M,R,!0),g=null),y.patchFlag===-2&&(W=!1,y.dynamicChildren=null);const{type:I,ref:et,shapeFlag:q}=y;switch(I){case wn:v(g,y,k,F);break;case te:S(g,y,k,F);break;case ks:g==null?b(y,k,F,Y):process.env.NODE_ENV!=="production"&&x(g,y,k,Y);break;case Dt:Z(g,y,k,F,M,R,Y,j,W);break;default:q&1?P(g,y,k,F,M,R,Y,j,W):q&6?J(g,y,k,F,M,R,Y,j,W):q&64||q&128?I.process(g,y,k,F,M,R,Y,j,W,Kn):process.env.NODE_ENV!=="production"&&U("Invalid VNode type:",I,`(${typeof I})`)}et!=null&&M?_n(et,g&&g.ref,R,y||g,!y):et==null&&g&&g.ref!=null&&_n(g.ref,null,R,g,!0)},v=(g,y,k,F)=>{if(g==null)n(y.el=a(y.children),k,F);else{const M=y.el=g.el;y.children!==g.children&&h(M,y.children)}},S=(g,y,k,F)=>{g==null?n(y.el=l(y.children||""),k,F):y.el=g.el},b=(g,y,k,F)=>{[g.el,g.anchor]=p(g.children,y,k,F,g.el,g.anchor)},x=(g,y,k,F)=>{if(y.children!==g.children){const M=u(g.anchor);T(g),[y.el,y.anchor]=p(y.children,k,M,F)}else y.el=g.el,y.anchor=g.anchor},N=({el:g,anchor:y},k,F)=>{let M;for(;g&&g!==y;)M=u(g),n(g,k,F),g=M;n(y,k,F)},T=({el:g,anchor:y})=>{let k;for(;g&&g!==y;)k=u(g),s(g),g=k;s(y)},P=(g,y,k,F,M,R,Y,j,W)=>{if(y.type==="svg"?Y="svg":y.type==="math"&&(Y="mathml"),g==null)E(y,k,F,M,R,Y,j,W);else{const I=g.el&&g.el._isVueCE?g.el:null;try{I&&I._beginPatch(),H(g,y,M,R,Y,j,W)}finally{I&&I._endPatch()}}},E=(g,y,k,F,M,R,Y,j)=>{let W,I;const{props:et,shapeFlag:q,transition:tt,dirs:st}=g;if(W=g.el=o(g.type,R,et&&et.is,et),q&8?c(W,g.children):q&16&&O(g.children,W,null,F,M,zr(g,R),Y,j),st&&bi(g,null,F,"created"),C(W,g,g.scopeId,Y,F),et){for(const wt in et)wt!=="value"&&!rn(wt)&&r(W,wt,null,et[wt],R,F);"value"in et&&r(W,"value",null,et.value,R),(I=et.onVnodeBeforeMount)&&ke(I,F,g)}process.env.NODE_ENV!=="production"&&(es(W,"__vnode",g,!0),es(W,"__vueParentComponent",F,!0)),st&&bi(g,null,F,"beforeMount");const ft=Gu(M,tt);ft&&tt.beforeEnter(W),n(W,y,k),((I=et&&et.onVnodeMounted)||ft||st)&&Zt(()=>{I&&ke(I,F,g),ft&&tt.enter(W),st&&bi(g,null,F,"mounted")},M)},C=(g,y,k,F,M)=>{if(k&&f(g,k),F)for(let R=0;R<F.length;R++)f(g,F[R]);if(M){let R=M.subTree;if(process.env.NODE_ENV!=="production"&&R.patchFlag>0&&R.patchFlag&2048&&(R=Hr(R.children)||R),y===R||ol(R.type)&&(R.ssContent===y||R.ssFallback===y)){const Y=M.vnode;C(g,Y,Y.scopeId,Y.slotScopeIds,M.parent)}}},O=(g,y,k,F,M,R,Y,j,W=0)=>{for(let I=W;I<g.length;I++){const et=g[I]=j?Ze(g[I]):me(g[I]);_(null,et,y,k,F,M,R,Y,j)}},H=(g,y,k,F,M,R,Y)=>{const j=y.el=g.el;process.env.NODE_ENV!=="production"&&(j.__vnode=y);let{patchFlag:W,dynamicChildren:I,dirs:et}=y;W|=g.patchFlag&16;const q=g.props||dt,tt=y.props||dt;let st;if(k&&Si(k,!1),(st=tt.onVnodeBeforeUpdate)&&ke(st,k,y,g),et&&bi(y,g,k,"beforeUpdate"),k&&Si(k,!0),process.env.NODE_ENV!=="production"&&Ne&&(W=0,Y=!1,I=null),(q.innerHTML&&tt.innerHTML==null||q.textContent&&tt.textContent==null)&&c(j,""),I?(K(g.dynamicChildren,I,j,k,F,zr(y,M),R),process.env.NODE_ENV!=="production"&&Ts(g,y)):Y||nt(g,y,j,null,k,F,zr(y,M),R,!1),W>0){if(W&16)z(j,q,tt,k,M);else if(W&2&&q.class!==tt.class&&r(j,"class",null,tt.class,M),W&4&&r(j,"style",q.style,tt.style,M),W&8){const ft=y.dynamicProps;for(let wt=0;wt<ft.length;wt++){const bt=ft[wt],qt=q[bt],Kt=tt[bt];(Kt!==qt||bt==="value")&&r(j,bt,qt,Kt,M,k)}}W&1&&g.children!==y.children&&c(j,y.children)}else!Y&&I==null&&z(j,q,tt,k,M);((st=tt.onVnodeUpdated)||et)&&Zt(()=>{st&&ke(st,k,y,g),et&&bi(y,g,k,"updated")},F)},K=(g,y,k,F,M,R,Y)=>{for(let j=0;j<y.length;j++){const W=g[j],I=y[j],et=W.el&&(W.type===Dt||!xn(W,I)||W.shapeFlag&198)?d(W.el):k;_(W,I,et,null,F,M,R,Y,!0)}},z=(g,y,k,F,M)=>{if(y!==k){if(y!==dt)for(const R in y)!rn(R)&&!(R in k)&&r(g,R,y[R],null,M,F);for(const R in k){if(rn(R))continue;const Y=k[R],j=y[R];Y!==j&&R!=="value"&&r(g,R,j,Y,M,F)}"value"in k&&r(g,"value",y.value,k.value,M)}},Z=(g,y,k,F,M,R,Y,j,W)=>{const I=y.el=g?g.el:a(""),et=y.anchor=g?g.anchor:a("");let{patchFlag:q,dynamicChildren:tt,slotScopeIds:st}=y;process.env.NODE_ENV!=="production"&&(Ne||q&2048)&&(q=0,W=!1,tt=null),st&&(j=j?j.concat(st):st),g==null?(n(I,k,F),n(et,k,F),O(y.children||[],k,et,M,R,Y,j,W)):q>0&&q&64&&tt&&g.dynamicChildren?(K(g.dynamicChildren,tt,k,M,R,Y,j),process.env.NODE_ENV!=="production"?Ts(g,y):(y.key!=null||M&&y===M.subTree)&&Ts(g,y,!0)):nt(g,y,k,et,M,R,Y,j,W)},J=(g,y,k,F,M,R,Y,j,W)=>{y.slotScopeIds=j,g==null?y.shapeFlag&512?M.ctx.activate(y,k,F,Y,W):A(y,k,F,M,R,Y,W):L(g,y,W)},A=(g,y,k,F,M,R,Y)=>{const j=g.component=Yu(g,F,M);if(process.env.NODE_ENV!=="production"&&j.type.__hmrId&&kd(j),process.env.NODE_ENV!=="production"&&(ds(g),Wi(j,"mount")),Mr(g)&&(j.ctx.renderer=Kn),process.env.NODE_ENV!=="production"&&Wi(j,"init"),Ku(j,!1,Y),process.env.NODE_ENV!=="production"&&Ui(j,"init"),process.env.NODE_ENV!=="production"&&Ne&&(g.el=null),j.asyncDep){if(M&&M.registerDep(j,$,Y),!g.el){const W=j.subTree=Tt(te);S(null,W,y,k),g.placeholder=W.el}}else $(j,g,y,k,M,R,Y);process.env.NODE_ENV!=="production"&&(us(),Ui(j,"mount"))},L=(g,y,k)=>{const F=y.component=g.component;if(wu(g,y,k))if(F.asyncDep&&!F.asyncResolved){process.env.NODE_ENV!=="production"&&ds(y),D(F,y,k),process.env.NODE_ENV!=="production"&&us();return}else F.next=y,F.update();else y.el=g.el,F.vnode=y},$=(g,y,k,F,M,R,Y)=>{const j=()=>{if(g.isMounted){let{next:q,bu:tt,u:st,parent:ft,vnode:wt}=g;{const Me=sl(g);if(Me){q&&(q.el=wt.el,D(g,q,Y)),Me.asyncDep.then(()=>{g.isUnmounted||j()});return}}let bt=q,qt;process.env.NODE_ENV!=="production"&&ds(q||g.vnode),Si(g,!1),q?(q.el=wt.el,D(g,q,Y)):q=wt,tt&&Ii(tt),(qt=q.props&&q.props.onVnodeBeforeUpdate)&&ke(qt,ft,q,wt),Si(g,!0),process.env.NODE_ENV!=="production"&&Wi(g,"render");const Kt=Wa(g);process.env.NODE_ENV!=="production"&&Ui(g,"render");const Ae=g.subTree;g.subTree=Kt,process.env.NODE_ENV!=="production"&&Wi(g,"patch"),_(Ae,Kt,d(Ae.el),be(Ae),g,M,R),process.env.NODE_ENV!=="production"&&Ui(g,"patch"),q.el=Kt.el,bt===null&&Su(g,Kt.el),st&&Zt(st,M),(qt=q.props&&q.props.onVnodeUpdated)&&Zt(()=>ke(qt,ft,q,wt),M),process.env.NODE_ENV!=="production"&&Sa(g),process.env.NODE_ENV!=="production"&&us()}else{let q;const{el:tt,props:st}=y,{bm:ft,m:wt,parent:bt,root:qt,type:Kt}=g,Ae=yn(y);Si(g,!1),ft&&Ii(ft),!Ae&&(q=st&&st.onVnodeBeforeMount)&&ke(q,bt,y),Si(g,!0);{qt.ce&&qt.ce._def.shadowRoot!==!1&&qt.ce._injectChildStyle(Kt),process.env.NODE_ENV!=="production"&&Wi(g,"render");const Me=g.subTree=Wa(g);process.env.NODE_ENV!=="production"&&Ui(g,"render"),process.env.NODE_ENV!=="production"&&Wi(g,"patch"),_(null,Me,k,F,g,M,R),process.env.NODE_ENV!=="production"&&Ui(g,"patch"),y.el=Me.el}if(wt&&Zt(wt,M),!Ae&&(q=st&&st.onVnodeMounted)){const Me=y;Zt(()=>ke(q,bt,Me),M)}(y.shapeFlag&256||bt&&yn(bt.vnode)&&bt.vnode.shapeFlag&256)&&g.a&&Zt(g.a,M),g.isMounted=!0,process.env.NODE_ENV!=="production"&&Ld(g),y=k=F=null}};g.scope.on();const W=g.effect=new Xo(j);g.scope.off();const I=g.update=W.run.bind(W),et=g.job=W.runIfDirty.bind(W);et.i=g,et.id=g.uid,W.scheduler=()=>gs(et),Si(g,!0),process.env.NODE_ENV!=="production"&&(W.onTrack=g.rtc?q=>Ii(g.rtc,q):void 0,W.onTrigger=g.rtg?q=>Ii(g.rtg,q):void 0),I()},D=(g,y,k)=>{y.component=g;const F=g.vnode.props;g.vnode=y,g.next=null,Cu(g,y.props,F,k),Iu(g,y.children,k),de(),_a(g),ue()},nt=(g,y,k,F,M,R,Y,j,W=!1)=>{const I=g&&g.children,et=g?g.shapeFlag:0,q=y.children,{patchFlag:tt,shapeFlag:st}=y;if(tt>0){if(tt&128){ot(I,q,k,F,M,R,Y,j,W);return}else if(tt&256){ht(I,q,k,F,M,R,Y,j,W);return}}st&8?(et&16&&le(I,M,R),q!==I&&c(k,q)):et&16?st&16?ot(I,q,k,F,M,R,Y,j,W):le(I,M,R,!0):(et&8&&c(k,""),st&16&&O(q,k,F,M,R,Y,j,W))},ht=(g,y,k,F,M,R,Y,j,W)=>{g=g||Ri,y=y||Ri;const I=g.length,et=y.length,q=Math.min(I,et);let tt;for(tt=0;tt<q;tt++){const st=y[tt]=W?Ze(y[tt]):me(y[tt]);_(g[tt],st,k,null,M,R,Y,j,W)}I>et?le(g,M,R,!0,!1,q):O(y,k,F,M,R,Y,j,W,q)},ot=(g,y,k,F,M,R,Y,j,W)=>{let I=0;const et=y.length;let q=g.length-1,tt=et-1;for(;I<=q&&I<=tt;){const st=g[I],ft=y[I]=W?Ze(y[I]):me(y[I]);if(xn(st,ft))_(st,ft,k,null,M,R,Y,j,W);else break;I++}for(;I<=q&&I<=tt;){const st=g[q],ft=y[tt]=W?Ze(y[tt]):me(y[tt]);if(xn(st,ft))_(st,ft,k,null,M,R,Y,j,W);else break;q--,tt--}if(I>q){if(I<=tt){const st=tt+1,ft=st<et?y[st].el:F;for(;I<=tt;)_(null,y[I]=W?Ze(y[I]):me(y[I]),k,ft,M,R,Y,j,W),I++}}else if(I>tt)for(;I<=q;)Pt(g[I],M,R,!0),I++;else{const st=I,ft=I,wt=new Map;for(I=ft;I<=tt;I++){const Ut=y[I]=W?Ze(y[I]):me(y[I]);Ut.key!=null&&(process.env.NODE_ENV!=="production"&&wt.has(Ut.key)&&U("Duplicate keys found during update:",JSON.stringify(Ut.key),"Make sure keys are unique."),wt.set(Ut.key,I))}let bt,qt=0;const Kt=tt-ft+1;let Ae=!1,Me=0;const Jn=new Array(Kt);for(I=0;I<Kt;I++)Jn[I]=0;for(I=st;I<=q;I++){const Ut=g[I];if(qt>=Kt){Pt(Ut,M,R,!0);continue}let Re;if(Ut.key!=null)Re=wt.get(Ut.key);else for(bt=ft;bt<=tt;bt++)if(Jn[bt-ft]===0&&xn(Ut,y[bt])){Re=bt;break}Re===void 0?Pt(Ut,M,R,!0):(Jn[Re-ft]=I+1,Re>=Me?Me=Re:Ae=!0,_(Ut,y[Re],k,null,M,R,Y,j,W),qt++)}const Th=Ae?$u(Jn):Ri;for(bt=Th.length-1,I=Kt-1;I>=0;I--){const Ut=ft+I,Re=y[Ut],kh=y[Ut+1],Ph=Ut+1<et?kh.el||kh.placeholder:F;Jn[I]===0?_(null,Re,k,Ph,M,R,Y,j,W):Ae&&(bt<0||I!==Th[bt]?mt(Re,k,Ph,2):bt--)}}},mt=(g,y,k,F,M=null)=>{const{el:R,type:Y,transition:j,children:W,shapeFlag:I}=g;if(I&6){mt(g.component.subTree,y,k,F);return}if(I&128){g.suspense.move(y,k,F);return}if(I&64){Y.move(g,y,k,Kn);return}if(Y===Dt){n(R,y,k);for(let q=0;q<W.length;q++)mt(W[q],y,k,F);n(g.anchor,y,k);return}if(Y===ks){N(g,y,k);return}if(F!==2&&I&1&&j)if(F===0)j.beforeEnter(R),n(R,y,k),Zt(()=>j.enter(R),M);else{const{leave:q,delayLeave:tt,afterLeave:st}=j,ft=()=>{g.ctx.isUnmounted?s(R):n(R,y,k)},wt=()=>{R._isLeaving&&R[Hd](!0),q(R,()=>{ft(),st&&st()})};tt?tt(R,ft,wt):wt()}else n(R,y,k)},Pt=(g,y,k,F=!1,M=!1)=>{const{type:R,props:Y,ref:j,children:W,dynamicChildren:I,shapeFlag:et,patchFlag:q,dirs:tt,cacheIndex:st}=g;if(q===-2&&(M=!1),j!=null&&(de(),_n(j,null,k,g,!0),ue()),st!=null&&(y.renderCache[st]=void 0),et&256){y.ctx.deactivate(g);return}const ft=et&1&&tt,wt=!yn(g);let bt;if(wt&&(bt=Y&&Y.onVnodeBeforeUnmount)&&ke(bt,y,g),et&6)en(g.component,k,F);else{if(et&128){g.suspense.unmount(k,F);return}ft&&bi(g,null,y,"beforeUnmount"),et&64?g.type.remove(g,y,k,Kn,F):I&&!I.hasOnce&&(R!==Dt||q>0&&q&64)?le(I,y,k,!1,!0):(R===Dt&&q&384||!M&&et&16)&&le(W,y,k),F&&tn(g)}(wt&&(bt=Y&&Y.onVnodeUnmounted)||ft)&&Zt(()=>{bt&&ke(bt,y,g),ft&&bi(g,null,y,"unmounted")},k)},tn=g=>{const{type:y,el:k,anchor:F,transition:M}=g;if(y===Dt){process.env.NODE_ENV!=="production"&&g.patchFlag>0&&g.patchFlag&2048&&M&&!M.persisted?g.children.forEach(Y=>{Y.type===te?s(Y.el):tn(Y)}):sr(k,F);return}if(y===ks){T(g);return}const R=()=>{s(k),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(g.shapeFlag&1&&M&&!M.persisted){const{leave:Y,delayLeave:j}=M,W=()=>Y(k,R);j?j(g.el,R,W):W()}else R()},sr=(g,y)=>{let k;for(;g!==y;)k=u(g),s(g),g=k;s(y)},en=(g,y,k)=>{process.env.NODE_ENV!=="production"&&g.type.__hmrId&&Pd(g);const{bum:F,scope:M,job:R,subTree:Y,um:j,m:W,a:I}=g;rl(W),rl(I),F&&Ii(F),M.stop(),R&&(R.flags|=8,Pt(Y,g,y,k)),j&&Zt(j,y),Zt(()=>{g.isUnmounted=!0},y),process.env.NODE_ENV!=="production"&&Dd(g)},le=(g,y,k,F=!1,M=!1,R=0)=>{for(let Y=R;Y<g.length;Y++)Pt(g[Y],y,k,F,M)},be=g=>{if(g.shapeFlag&6)return be(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const y=u(g.anchor||g.el),k=y&&y[$d];return k?u(k):y};let Vo=!1;const Nh=(g,y,k)=>{g==null?y._vnode&&Pt(y._vnode,null,null,!0):_(y._vnode||null,g,y,null,null,null,k),y._vnode=g,Vo||(Vo=!0,_a(),ya(),Vo=!1)},Kn={p:_,um:Pt,m:mt,r:tn,mt:A,mc:O,pc:nt,pbc:K,n:be,o:e};return{render:Nh,hydrate:void 0,createApp:du(Nh)}}function zr({type:e,props:t},i){return i==="svg"&&e==="foreignObject"||i==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:i}function Si({effect:e,job:t},i){i?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Gu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ts(e,t,i=!1){const n=e.children,s=t.children;if(Q(n)&&Q(s))for(let r=0;r<n.length;r++){const o=n[r];let a=s[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[r]=Ze(s[r]),a.el=o.el),!i&&a.patchFlag!==-2&&Ts(o,a)),a.type===wn&&a.patchFlag!==-1&&(a.el=o.el),a.type===te&&!a.el&&(a.el=o.el),process.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}function $u(e){const t=e.slice(),i=[0];let n,s,r,o,a;const l=e.length;for(n=0;n<l;n++){const h=e[n];if(h!==0){if(s=i[i.length-1],e[s]<h){t[n]=s,i.push(n);continue}for(r=0,o=i.length-1;r<o;)a=r+o>>1,e[i[a]]<h?r=a+1:o=a;h<e[i[r]]&&(r>0&&(t[n]=i[r-1]),i[r]=n)}}for(r=i.length,o=i[r-1];r-- >0;)i[r]=o,o=t[o];return i}function sl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:sl(t)}function rl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const ol=e=>e.__isSuspense;function Bu(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):ma(e)}const Dt=Symbol.for("v-fgt"),wn=Symbol.for("v-txt"),te=Symbol.for("v-cmt"),ks=Symbol.for("v-stc"),Sn=[];let ee=null;function at(e=!1){Sn.push(ee=e?null:[])}function Hu(){Sn.pop(),ee=Sn[Sn.length-1]||null}let En=1;function Ps(e,t=!1){En+=e,e<0&&ee&&t&&(ee.hasOnce=!0)}function al(e){return e.dynamicChildren=En>0?ee||Ri:null,Hu(),En>0&&ee&&ee.push(e),e}function yt(e,t,i,n,s,r){return al(ut(e,t,i,n,s,r,!0))}function Je(e,t,i,n,s){return al(Tt(e,t,i,n,s,!0))}function ji(e){return e?e.__v_isVNode===!0:!1}function xn(e,t){if(process.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const i=ms.get(t.type);if(i&&i.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const Wu=(...e)=>cl(...e),ll=({key:e})=>e??null,Os=({ref:e,ref_key:t,ref_for:i})=>(typeof e=="number"&&(e=""+e),e!=null?Nt(e)||Mt(e)||it(e)?{i:Gt,r:e,k:t,f:!!i}:e:null);function ut(e,t=null,i=null,n=0,s=null,r=e===Dt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ll(t),ref:t&&Os(t),scopeId:xa,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Gt};return a?(Yr(l,i),r&128&&e.normalize(l)):i&&(l.shapeFlag|=Nt(i)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&U("VNode created with invalid key (NaN). VNode type:",l.type),En>0&&!o&&ee&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&ee.push(l),l}const Tt=process.env.NODE_ENV!=="production"?Wu:cl;function cl(e,t=null,i=null,n=0,s=null,r=!1){if((!e||e===Zd)&&(process.env.NODE_ENV!=="production"&&!e&&U(`Invalid vnode type when creating vnode: ${e}.`),e=te),ji(e)){const a=Qe(e,t,!0);return i&&Yr(a,i),En>0&&!r&&ee&&(a.shapeFlag&6?ee[ee.indexOf(e)]=a:ee.push(a)),a.patchFlag=-2,a}if(_l(e)&&(e=e.__vccOpts),t){t=Uu(t);let{class:a,style:l}=t;a&&!Nt(a)&&(t.class=we(a)),pt(l)&&(ls(l)&&!Q(l)&&(l=Ct({},l)),t.style=cr(l))}const o=Nt(e)?1:ol(e)?128:Bd(e)?64:pt(e)?4:it(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&ls(e)&&(e=rt(e),U("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
8
+ Component that was made reactive: `,e)),ut(e,t,i,n,s,o,r,!0)}function Uu(e){return e?ls(e)||qa(e)?Ct({},e):e:null}function Qe(e,t,i=!1,n=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=e,h=t?dl(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&ll(h),ref:t&&t.ref?i&&r?Q(r)?r.concat(Os(t)):[r,Os(t)]:Os(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&Q(a)?a.map(hl):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Dt?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Qe(e.ssContent),ssFallback:e.ssFallback&&Qe(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&n&&Ar(c,l.clone(c)),c}function hl(e){const t=Qe(e);return Q(e.children)&&(t.children=e.children.map(hl)),t}function ju(e=" ",t=0){return Tt(wn,null,e,t)}function As(e="",t=!1){return t?(at(),Je(te,null,e)):Tt(te,null,e)}function me(e){return e==null||typeof e=="boolean"?Tt(te):Q(e)?Tt(Dt,null,e.slice()):ji(e)?Ze(e):Tt(wn,null,String(e))}function Ze(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Qe(e)}function Yr(e,t){let i=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Q(t))i=16;else if(typeof t=="object")if(n&65){const s=t.default;s&&(s._c&&(s._d=!1),Yr(e,s()),s._c&&(s._d=!0));return}else{i=32;const s=t._;!s&&!qa(t)?t._ctx=Gt:s===3&&Gt&&(Gt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else it(t)?(t={default:t,_ctx:Gt},i=32):(t=String(t),n&64?(i=16,t=[ju(t)]):i=8);e.children=t,e.shapeFlag|=i}function dl(...e){const t={};for(let i=0;i<e.length;i++){const n=e[i];for(const s in n)if(s==="class")t.class!==n.class&&(t.class=we([t.class,n.class]));else if(s==="style")t.style=cr([t.style,n.style]);else if(nn(s)){const r=t[s],o=n[s];o&&r!==o&&!(Q(r)&&r.includes(o))&&(t[s]=r?[].concat(r,o):o)}else s!==""&&(t[s]=n[s])}return t}function ke(e,t,i,n=null){xe(e,t,7,[i,n])}const Xu=Ga();let zu=0;function Yu(e,t,i){const n=e.type,s=(t?t.appContext:e.appContext)||Xu,r={uid:zu++,vnode:e,type:n,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Xh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ja(n,s),emitsOptions:Ha(n,s),emit:null,emitted:null,propsDefaults:dt,inheritAttrs:n.inheritAttrs,ctx:dt,data:dt,props:dt,attrs:dt,slots:dt,refs:dt,setupState:dt,setupContext:null,suspense:i,suspenseId:i?i.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};return process.env.NODE_ENV!=="production"?r.ctx=eu(r):r.ctx={_:r},r.root=t?t.root:r,r.emit=_u.bind(null,r),e.ce&&e.ce(r),r}let Rt=null;const Ms=()=>Rt||Gt;let Rs,qr;{const e=on(),t=(i,n)=>{let s;return(s=e[i])||(s=e[i]=[]),s.push(n),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};Rs=t("__VUE_INSTANCE_SETTERS__",i=>Rt=i),qr=t("__VUE_SSR_SETTERS__",i=>Nn=i)}const Cn=e=>{const t=Rt;return Rs(e),e.scope.on(),()=>{e.scope.off(),Rs(t)}},ul=()=>{Rt&&Rt.scope.off(),Rs(null)},qu=Jt("slot,component");function Kr(e,{isNativeTag:t}){(qu(e)||t(e))&&U("Do not use built-in or reserved HTML elements as component id: "+e)}function fl(e){return e.vnode.shapeFlag&4}let Nn=!1;function Ku(e,t=!1,i=!1){t&&qr(t);const{props:n,children:s}=e.vnode,r=fl(e);Eu(e,n,r,t),Lu(e,s,i||t);const o=r?Ju(e,t):void 0;return t&&qr(!1),o}function Ju(e,t){const i=e.type;if(process.env.NODE_ENV!=="production"){if(i.name&&Kr(i.name,e.appContext.config),i.components){const s=Object.keys(i.components);for(let r=0;r<s.length;r++)Kr(s[r],e.appContext.config)}if(i.directives){const s=Object.keys(i.directives);for(let r=0;r<s.length;r++)Ca(s[r])}i.compilerOptions&&Qu()&&U('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ma),process.env.NODE_ENV!=="production"&&iu(e);const{setup:n}=i;if(n){de();const s=e.setupContext=n.length>1?tf(e):null,r=Cn(e),o=Fi(n,e,0,[process.env.NODE_ENV!=="production"?Ee(e.props):e.props,s]),a=or(o);if(ue(),r(),(a||e.sp)&&!yn(e)&&Na(e),a){if(o.then(ul,ul),t)return o.then(l=>{pl(e,l,t)}).catch(l=>{un(l,e,0)});if(e.asyncDep=o,process.env.NODE_ENV!=="production"&&!e.suspense){const l=Tn(e,i);U(`Component <${l}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else pl(e,o,t)}else gl(e,t)}function pl(e,t,i){it(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pt(t)?(process.env.NODE_ENV!=="production"&&ji(t)&&U("setup() should not return VNodes directly - return a render function instead."),process.env.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=ua(t),process.env.NODE_ENV!=="production"&&nu(e)):process.env.NODE_ENV!=="production"&&t!==void 0&&U(`setup() should return an object. Received: ${t===null?"null":typeof t}`),gl(e,i)}const Qu=()=>!0;function gl(e,t,i){const n=e.type;e.render||(e.render=n.render||Lt);{const s=Cn(e);de();try{ru(e)}finally{ue(),s()}}process.env.NODE_ENV!=="production"&&!n.render&&e.render===Lt&&!t&&(n.template?U('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):U("Component is missing template or render function: ",n))}const ml=process.env.NODE_ENV!=="production"?{get(e,t){return Cs(),It(e,"get",""),e[t]},set(){return U("setupContext.attrs is readonly."),!1},deleteProperty(){return U("setupContext.attrs is readonly."),!1}}:{get(e,t){return It(e,"get",""),e[t]}};function Zu(e){return new Proxy(e.slots,{get(t,i){return It(e,"get","$slots"),t[i]}})}function tf(e){const t=i=>{if(process.env.NODE_ENV!=="production"&&(e.exposed&&U("expose() should be called only once per setup()."),i!=null)){let n=typeof i;n==="object"&&(Q(i)?n="array":Mt(i)&&(n="ref")),n!=="object"&&U(`expose() should be passed a plain object, received ${n}.`)}e.exposed=i||{}};if(process.env.NODE_ENV!=="production"){let i,n;return Object.freeze({get attrs(){return i||(i=new Proxy(e.attrs,ml))},get slots(){return n||(n=Zu(e))},get emit(){return(s,...r)=>e.emit(s,...r)},expose:t})}else return{attrs:new Proxy(e.attrs,ml),slots:e.slots,emit:e.emit,expose:t}}function Ls(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ua(fd(e.exposed)),{get(t,i){if(i in t)return t[i];if(i in vi)return vi[i](e)},has(t,i){return i in t||i in vi}})):e.proxy}const ef=/(?:^|[-_])\w/g,nf=e=>e.replace(ef,t=>t.toUpperCase()).replace(/[-_]/g,"");function Jr(e,t=!0){return it(e)?e.displayName||e.name:e.name||t&&e.__name}function Tn(e,t,i=!1){let n=Jr(t);if(!n&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(n=s[1])}if(!n&&e){const s=r=>{for(const o in r)if(r[o]===t)return o};n=s(e.components)||e.parent&&s(e.parent.type.components)||s(e.appContext.components)}return n?nf(n):i?"App":"Anonymous"}function _l(e){return it(e)&&"__vccOpts"in e}const Ei=(e,t)=>{const i=yd(e,t,Nn);if(process.env.NODE_ENV!=="production"){const n=Ms();n&&n.appContext.config.warnRecursiveComputed&&(i._warnRecursive=!0)}return i};function yl(e,t,i){try{Ps(-1);const n=arguments.length;return n===2?pt(t)&&!Q(t)?ji(t)?Tt(e,null,[t]):Tt(e,t):Tt(e,null,t):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&ji(i)&&(i=[i]),Tt(e,t,i))}finally{Ps(1)}}function sf(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},i={style:"color:#f5222d"},n={style:"color:#eb2f96"},s={__vue_custom_formatter:!0,header(d){if(!pt(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(Mt(d)){de();const u=d.value;return ue(),["div",{},["span",e,c(d)],"<",a(u),">"]}else{if(qe(d))return["div",{},["span",e,$t(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${fe(d)?" (readonly)":""}`];if(fe(d))return["div",{},["span",e,$t(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...r(d.$)]}};function r(d){const u=[];d.type.props&&d.props&&u.push(o("props",rt(d.props))),d.setupState!==dt&&u.push(o("setup",d.setupState)),d.data!==dt&&u.push(o("data",rt(d.data)));const f=l(d,"computed");f&&u.push(o("computed",f));const p=l(d,"inject");return p&&u.push(o("injected",p)),u.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),u}function o(d,u){return u=Ct({},u),Object.keys(u).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(u).map(f=>["div",{},["span",n,f+": "],a(u[f],!1)])]]:["span",{}]}function a(d,u=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",i,JSON.stringify(d)]:typeof d=="boolean"?["span",n,d]:pt(d)?["object",{object:u?rt(d):d}]:["span",i,String(d)]}function l(d,u){const f=d.type;if(it(f))return;const p={};for(const _ in d.ctx)h(f,_,u)&&(p[_]=d.ctx[_]);return p}function h(d,u,f){const p=d[f];if(Q(p)&&p.includes(u)||pt(p)&&u in p||d.extends&&h(d.extends,u,f)||d.mixins&&d.mixins.some(_=>h(_,u,f)))return!0}function c(d){return $t(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}const bl="3.5.25",ie=process.env.NODE_ENV!=="production"?U:Lt;process.env.NODE_ENV,process.env.NODE_ENV;let Qr;const vl=typeof window<"u"&&window.trustedTypes;if(vl)try{Qr=vl.createPolicy("vue",{createHTML:e=>e})}catch(e){process.env.NODE_ENV!=="production"&&ie(`Error creating trusted types policy: ${e}`)}const wl=Qr?e=>Qr.createHTML(e):e=>e,rf="http://www.w3.org/2000/svg",of="http://www.w3.org/1998/Math/MathML",$e=typeof document<"u"?document:null,Sl=$e&&$e.createElement("template"),af={insert:(e,t,i)=>{t.insertBefore(e,i||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,i,n)=>{const s=t==="svg"?$e.createElementNS(rf,e):t==="mathml"?$e.createElementNS(of,e):i?$e.createElement(e,{is:i}):$e.createElement(e);return e==="select"&&n&&n.multiple!=null&&s.setAttribute("multiple",n.multiple),s},createText:e=>$e.createTextNode(e),createComment:e=>$e.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>$e.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,i,n,s,r){const o=i?i.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),i),!(s===r||!(s=s.nextSibling)););else{Sl.innerHTML=wl(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const a=Sl.content;if(n==="svg"||n==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,i)}return[o?o.nextSibling:t.firstChild,i?i.previousSibling:t.lastChild]}},lf=Symbol("_vtc");function cf(e,t,i){const n=e[lf];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):i?e.setAttribute("class",t):e.className=t}const El=Symbol("_vod"),hf=Symbol("_vsh"),df=Symbol(process.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),uf=/(?:^|;)\s*display\s*:/;function ff(e,t,i){const n=e.style,s=Nt(i);let r=!1;if(i&&!s){if(t)if(Nt(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();i[a]==null&&Is(n,a,"")}else for(const o in t)i[o]==null&&Is(n,o,"");for(const o in i)o==="display"&&(r=!0),Is(n,o,i[o])}else if(s){if(t!==i){const o=n[df];o&&(i+=";"+o),n.cssText=i,r=uf.test(i)}}else t&&e.removeAttribute("style");El in e&&(e[El]=r?n.display:"",e[hf]&&(n.display="none"))}const pf=/[^\\];\s*$/,xl=/\s*!important$/;function Is(e,t,i){if(Q(i))i.forEach(n=>Is(e,t,n));else if(i==null&&(i=""),process.env.NODE_ENV!=="production"&&pf.test(i)&&ie(`Unexpected semicolon at the end of '${t}' style value: '${i}'`),t.startsWith("--"))e.setProperty(t,i);else{const n=gf(e,t);xl.test(i)?e.setProperty(Qt(n),i.replace(xl,""),"important"):e[n]=i}}const Cl=["Webkit","Moz","ms"],Zr={};function gf(e,t){const i=Zr[t];if(i)return i;let n=Ft(t);if(n!=="filter"&&n in e)return Zr[t]=n;n=di(n);for(let s=0;s<Cl.length;s++){const r=Cl[s]+n;if(r in e)return Zr[t]=r}return t}const Nl="http://www.w3.org/1999/xlink";function Tl(e,t,i,n,s,r=Uh(t)){n&&t.startsWith("xlink:")?i==null?e.removeAttributeNS(Nl,t.slice(6,t.length)):e.setAttributeNS(Nl,t,i):i==null||r&&!Wo(i)?e.removeAttribute(t):e.setAttribute(t,r?"":ve(i)?String(i):i)}function kl(e,t,i,n,s){if(t==="innerHTML"||t==="textContent"){i!=null&&(e[t]=t==="innerHTML"?wl(i):i);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?e.getAttribute("value")||"":e.value,l=i==null?e.type==="checkbox"?"on":"":String(i);(a!==l||!("_value"in e))&&(e.value=l),i==null&&e.removeAttribute(t),e._value=i;return}let o=!1;if(i===""||i==null){const a=typeof e[t];a==="boolean"?i=Wo(i):i==null&&a==="string"?(i="",o=!0):a==="number"&&(i=0,o=!0)}try{e[t]=i}catch(a){process.env.NODE_ENV!=="production"&&!o&&ie(`Failed setting prop "${t}" on <${r.toLowerCase()}>: value ${i} is invalid.`,a)}o&&e.removeAttribute(s||t)}function Be(e,t,i,n){e.addEventListener(t,i,n)}function mf(e,t,i,n){e.removeEventListener(t,i,n)}const Pl=Symbol("_vei");function _f(e,t,i,n,s=null){const r=e[Pl]||(e[Pl]={}),o=r[t];if(n&&o)o.value=process.env.NODE_ENV!=="production"?Al(n,t):n;else{const[a,l]=yf(t);if(n){const h=r[t]=wf(process.env.NODE_ENV!=="production"?Al(n,t):n,s);Be(e,a,h,l)}else o&&(mf(e,a,o,l),r[t]=void 0)}}const Ol=/(?:Once|Passive|Capture)$/;function yf(e){let t;if(Ol.test(e)){t={};let n;for(;n=e.match(Ol);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Qt(e.slice(2)),t]}let to=0;const bf=Promise.resolve(),vf=()=>to||(bf.then(()=>to=0),to=Date.now());function wf(e,t){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;xe(Sf(n,i.value),t,5,[n])};return i.value=e,i.attached=vf(),i}function Al(e,t){return it(e)||Q(e)?e:(ie(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
9
+ Expected function or array of functions, received type ${typeof e}.`),Lt)}function Sf(e,t){if(Q(t)){const i=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{i.call(e),e._stopped=!0},t.map(n=>s=>!s._stopped&&n&&n(s))}else return t}const Ml=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ef=(e,t,i,n,s,r)=>{const o=s==="svg";t==="class"?cf(e,n,o):t==="style"?ff(e,i,n):nn(t)?Qn(t)||_f(e,t,i,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):xf(e,t,n,o))?(kl(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Tl(e,t,n,o,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Nt(n))?kl(e,Ft(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Tl(e,t,n,o))};function xf(e,t,i,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ml(t)&&it(i));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ml(t)&&Nt(i)?!1:t in e}const Rl={};function Ll(e,t,i){let n=Te(e,t);Zn(n)&&(n=Ct({},n,t));class s extends eo{constructor(o){super(n,o,i)}}return s.def=n,s}const Cf=typeof HTMLElement<"u"?HTMLElement:class{};class eo extends Cf{constructor(t,i={},n=Wl){super(),this._def=t,this._props=i,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==Wl?this._root=this.shadowRoot:(process.env.NODE_ENV!=="production"&&this.shadowRoot&&ie("Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use `defineSSRCustomElement`."),t.shadowRoot!==!1?(this.attachShadow(Ct({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof eo){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,ps(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const i of t)this._setAttr(i.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n<this.attributes.length;n++)this._setAttr(this.attributes[n].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(n,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:o}=n;let a;if(r&&!Q(r))for(const l in r){const h=r[l];(h===Number||h&&h.type===Number)&&(l in this._props&&(this._props[l]=Bo(this._props[l])),(a||(a=Object.create(null)))[Ft(l)]=!0)}this._numberProps=a,this._resolveProps(n),this.shadowRoot?this._applyStyles(o):process.env.NODE_ENV!=="production"&&o&&ie("Custom element style injection is not supported when using shadowRoot: false"),this._mount(n)},i=this._def.__asyncLoader;i?this._pendingResolve=i().then(n=>{n.configureApp=this._def.configureApp,t(this._def=n,!0)}):t(this._def)}_mount(t){process.env.NODE_ENV!=="production"&&!t.name&&(t.name="VueElement"),this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const i=this._instance&&this._instance.exposed;if(i)for(const n in i)lt(this,n)?process.env.NODE_ENV!=="production"&&ie(`Exposed property "${n}" already exists on custom element.`):Object.defineProperty(this,n,{get:()=>da(i[n])})}_resolveProps(t){const{props:i}=t,n=Q(i)?i:Object.keys(i||{});for(const s of Object.keys(this))s[0]!=="_"&&n.includes(s)&&this._setProp(s,this[s]);for(const s of n.map(Ft))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(r){this._setProp(s,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const i=this.hasAttribute(t);let n=i?this.getAttribute(t):Rl;const s=Ft(t);i&&this._numberProps&&this._numberProps[s]&&(n=Bo(n)),this._setProp(s,n,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,i,n=!0,s=!1){if(i!==this._props[t]&&(this._dirty=!0,i===Rl?delete this._props[t]:(this._props[t]=i,t==="key"&&this._app&&(this._app._ceVNode.key=i)),s&&this._instance&&this._update(),n)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),i===!0?this.setAttribute(Qt(t),""):typeof i=="string"||typeof i=="number"?this.setAttribute(Qt(t),i+""):i||this.removeAttribute(Qt(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Lf(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const i=Tt(this._def,Ct(t,this._props));return this._instance||(i.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0,process.env.NODE_ENV!=="production"&&(n.ceReload=r=>{this._styles&&(this._styles.forEach(o=>this._root.removeChild(o)),this._styles.length=0),this._applyStyles(r),this._instance=null,this._update()});const s=(r,o)=>{this.dispatchEvent(new CustomEvent(r,Zn(o[0])?Ct({detail:o},o[0]):{detail:o}))};n.emit=(r,...o)=>{s(r,o),Qt(r)!==r&&s(Qt(r),o)},this._setParent()}),i}_applyStyles(t,i){if(!t)return;if(i){if(i===this._def||this._styleChildren.has(i))return;this._styleChildren.add(i)}const n=this._nonce;for(let s=t.length-1;s>=0;s--){const r=document.createElement("style");if(n&&r.setAttribute("nonce",n),r.textContent=t[s],this.shadowRoot.prepend(r),process.env.NODE_ENV!=="production")if(i){if(i.__hmrId){this._childStyles||(this._childStyles=new Map);let o=this._childStyles.get(i.__hmrId);o||this._childStyles.set(i.__hmrId,o=[]),o.push(r)}}else(this._styles||(this._styles=[])).push(r)}}_parseSlots(){const t=this._slots={};let i;for(;i=this.firstChild;){const n=i.nodeType===1&&i.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(i),this.removeChild(i)}}_renderSlots(){const t=this._getSlots(),i=this._instance.type.__scopeId;for(let n=0;n<t.length;n++){const s=t[n],r=s.getAttribute("name")||"default",o=this._slots[r],a=s.parentNode;if(o)for(const l of o){if(i&&l.nodeType===1){const h=i+"-s",c=document.createTreeWalker(l,1);l.setAttribute(h,"");let d;for(;d=c.nextNode();)d.setAttribute(h,"")}a.insertBefore(l,s)}else for(;s.firstChild;)a.insertBefore(s.firstChild,s);a.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const i=new Set;for(const n of t){const s=n.querySelectorAll("slot");for(let r=0;r<s.length;r++)i.add(s[r])}return Array.from(i)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){if(process.env.NODE_ENV!=="production"&&(this._styleChildren.delete(t),this._childStyles&&t.__hmrId)){const i=this._childStyles.get(t.__hmrId);i&&(i.forEach(n=>this._root.removeChild(n)),i.length=0)}}}const ti=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?i=>Ii(t,i):t};function Nf(e){e.target.composing=!0}function Il(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const oe=Symbol("_assign");function Dl(e,t,i){return t&&(e=e.trim()),i&&(e=is(e)),e}const Ds={created(e,{modifiers:{lazy:t,trim:i,number:n}},s){e[oe]=ti(s);const r=n||s.props&&s.props.type==="number";Be(e,t?"change":"input",o=>{o.target.composing||e[oe](Dl(e.value,i,r))}),(i||r)&&Be(e,"change",()=>{e.value=Dl(e.value,i,r)}),t||(Be(e,"compositionstart",Nf),Be(e,"compositionend",Il),Be(e,"change",Il))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:i,modifiers:{lazy:n,trim:s,number:r}},o){if(e[oe]=ti(o),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?is(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(n&&t===i||s&&e.value.trim()===l)||(e.value=l))}},Vl={deep:!0,created(e,t,i){e[oe]=ti(i),Be(e,"change",()=>{const n=e._modelValue,s=Xi(e),r=e.checked,o=e[oe];if(Q(n)){const a=hr(n,s),l=a!==-1;if(r&&!l)o(n.concat(s));else if(!r&&l){const h=[...n];h.splice(a,1),o(h)}}else if(Li(n)){const a=new Set(n);r?a.add(s):a.delete(s),o(a)}else o($l(e,r))})},mounted:Fl,beforeUpdate(e,t,i){e[oe]=ti(i),Fl(e,t,i)}};function Fl(e,{value:t,oldValue:i},n){e._modelValue=t;let s;if(Q(t))s=hr(t,n.props.value)>-1;else if(Li(t))s=t.has(n.props.value);else{if(t===i)return;s=fi(t,$l(e,!0))}e.checked!==s&&(e.checked=s)}const Tf={created(e,{value:t},i){e.checked=fi(t,i.props.value),e[oe]=ti(i),Be(e,"change",()=>{e[oe](Xi(e))})},beforeUpdate(e,{value:t,oldValue:i},n){e[oe]=ti(n),t!==i&&(e.checked=fi(t,n.props.value))}},kf={deep:!0,created(e,{value:t,modifiers:{number:i}},n){const s=Li(t);Be(e,"change",()=>{const r=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>i?is(Xi(o)):Xi(o));e[oe](e.multiple?s?new Set(r):r:r[0]),e._assigning=!0,ps(()=>{e._assigning=!1})}),e[oe]=ti(n)},mounted(e,{value:t}){Gl(e,t)},beforeUpdate(e,t,i){e[oe]=ti(i)},updated(e,{value:t}){e._assigning||Gl(e,t)}};function Gl(e,t){const i=e.multiple,n=Q(t);if(i&&!n&&!Li(t)){process.env.NODE_ENV!=="production"&&ie(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let s=0,r=e.options.length;s<r;s++){const o=e.options[s],a=Xi(o);if(i)if(n){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(h=>String(h)===String(a)):o.selected=hr(t,a)>-1}else o.selected=t.has(a);else if(fi(Xi(o),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!i&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function Xi(e){return"_value"in e?e._value:e.value}function $l(e,t){const i=t?"_trueValue":"_falseValue";return i in e?e[i]:t}const Pf={created(e,t,i){Vs(e,t,i,null,"created")},mounted(e,t,i){Vs(e,t,i,null,"mounted")},beforeUpdate(e,t,i,n){Vs(e,t,i,n,"beforeUpdate")},updated(e,t,i,n){Vs(e,t,i,n,"updated")}};function Of(e,t){switch(e){case"SELECT":return kf;case"TEXTAREA":return Ds;default:switch(t){case"checkbox":return Vl;case"radio":return Tf;default:return Ds}}}function Vs(e,t,i,n,s){const o=Of(e.tagName,i.props&&i.props.type)[s];o&&o(e,t,i,n)}const Af=["ctrl","shift","alt","meta"],Mf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Af.some(i=>e[`${i}Key`]&&!t.includes(i))},io=(e,t)=>{const i=e._withMods||(e._withMods={}),n=t.join(".");return i[n]||(i[n]=((s,...r)=>{for(let o=0;o<t.length;o++){const a=Mf[t[o]];if(a&&a(s,t))return}return e(s,...r)}))},Rf=Ct({patchProp:Ef},af);let Bl;function Hl(){return Bl||(Bl=Vu(Rf))}const Lf=((...e)=>{Hl().render(...e)}),Wl=((...e)=>{const t=Hl().createApp(...e);process.env.NODE_ENV!=="production"&&(Df(t),Vf(t));const{mount:i}=t;return t.mount=n=>{const s=Ff(n);if(!s)return;const r=t._component;!it(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=i(s,!1,If(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function If(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Df(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>Bh(t)||Hh(t)||Wh(t),writable:!1})}function Vf(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){ie("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const i=e.config.compilerOptions,n='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return ie(n),i},set(){ie(n)}})}}function Ff(e){if(Nt(e)){const t=document.querySelector(e);return process.env.NODE_ENV!=="production"&&!t&&ie(`Failed to mount app: mount target selector "${e}" returned null.`),t}return process.env.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&ie('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}function Gf(){sf()}process.env.NODE_ENV!=="production"&&Gf();const Ul=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",$f=Ul+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Bf="["+Ul+"]["+$f+"]*",Hf=new RegExp("^"+Bf+"$");function jl(e,t){const i=[];let n=t.exec(e);for(;n;){const s=[];s.startIndex=t.lastIndex-n[0].length;const r=n.length;for(let o=0;o<r;o++)s.push(n[o]);i.push(s),n=t.exec(e)}return i}const Fs=function(e){const t=Hf.exec(e);return!(t===null||typeof t>"u")};function Wf(e){return typeof e<"u"}const no=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],Xl=["__proto__","constructor","prototype"],Uf={allowBooleanAttributes:!1,unpairedTags:[]};function jf(e,t){t=Object.assign({},Uf,t);const i=[];let n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let r=0;r<e.length;r++)if(e[r]==="<"&&e[r+1]==="?"){if(r+=2,r=Yl(e,r),r.err)return r}else if(e[r]==="<"){let o=r;if(r++,e[r]==="!"){r=ql(e,r);continue}else{let a=!1;e[r]==="/"&&(a=!0,r++);let l="";for(;r<e.length&&e[r]!==">"&&e[r]!==" "&&e[r]!==" "&&e[r]!==`
10
+ `&&e[r]!=="\r";r++)l+=e[r];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),r--),!Zf(l)){let d;return l.trim().length===0?d="Invalid space after '<'.":d="Tag '"+l+"' is an invalid name.",Ot("InvalidTag",d,Wt(e,r))}const h=Yf(e,r);if(h===!1)return Ot("InvalidAttr","Attributes for '"+l+"' have open quote.",Wt(e,r));let c=h.value;if(r=h.index,c[c.length-1]==="/"){const d=r-c.length;c=c.substring(0,c.length-1);const u=Kl(c,t);if(u===!0)n=!0;else return Ot(u.err.code,u.err.msg,Wt(e,d+u.err.line))}else if(a)if(h.tagClosed){if(c.trim().length>0)return Ot("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Wt(e,o));if(i.length===0)return Ot("InvalidTag","Closing tag '"+l+"' has not been opened.",Wt(e,o));{const d=i.pop();if(l!==d.tagName){let u=Wt(e,d.tagStartPos);return Ot("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+u.line+", col "+u.col+") instead of closing tag '"+l+"'.",Wt(e,o))}i.length==0&&(s=!0)}}else return Ot("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Wt(e,r));else{const d=Kl(c,t);if(d!==!0)return Ot(d.err.code,d.err.msg,Wt(e,r-c.length+d.err.line));if(s===!0)return Ot("InvalidXml","Multiple possible root nodes found.",Wt(e,r));t.unpairedTags.indexOf(l)!==-1||i.push({tagName:l,tagStartPos:o}),n=!0}for(r++;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="!"){r++,r=ql(e,r);continue}else if(e[r+1]==="?"){if(r=Yl(e,++r),r.err)return r}else break;else if(e[r]==="&"){const d=Jf(e,r);if(d==-1)return Ot("InvalidChar","char '&' is not expected.",Wt(e,r));r=d}else if(s===!0&&!zl(e[r]))return Ot("InvalidXml","Extra text at the end",Wt(e,r));e[r]==="<"&&r--}}else{if(zl(e[r]))continue;return Ot("InvalidChar","char '"+e[r]+"' is not expected.",Wt(e,r))}if(n){if(i.length==1)return Ot("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",Wt(e,i[0].tagStartPos));if(i.length>0)return Ot("InvalidXml","Invalid '"+JSON.stringify(i.map(r=>r.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ot("InvalidXml","Start tag expected.",1);return!0}function zl(e){return e===" "||e===" "||e===`
11
+ `||e==="\r"}function Yl(e,t){const i=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const n=e.substr(i,t-i);if(t>5&&n==="xml")return Ot("InvalidXml","XML declaration allowed only at the start of the document.",Wt(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function ql(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let i=1;for(t+=8;t<e.length;t++)if(e[t]==="<")i++;else if(e[t]===">"&&(i--,i===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}const Xf='"',zf="'";function Yf(e,t){let i="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Xf||e[t]===zf)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}i+=e[t]}return n!==""?!1:{value:i,index:t,tagClosed:s}}const qf=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Kl(e,t){const i=jl(e,qf),n={};for(let s=0;s<i.length;s++){if(i[s][1].length===0)return Ot("InvalidAttr","Attribute '"+i[s][2]+"' has no space in starting.",kn(i[s]));if(i[s][3]!==void 0&&i[s][4]===void 0)return Ot("InvalidAttr","Attribute '"+i[s][2]+"' is without value.",kn(i[s]));if(i[s][3]===void 0&&!t.allowBooleanAttributes)return Ot("InvalidAttr","boolean attribute '"+i[s][2]+"' is not allowed.",kn(i[s]));const r=i[s][2];if(!Qf(r))return Ot("InvalidAttr","Attribute '"+r+"' is an invalid name.",kn(i[s]));if(!Object.prototype.hasOwnProperty.call(n,r))n[r]=1;else return Ot("InvalidAttr","Attribute '"+r+"' is repeated.",kn(i[s]))}return!0}function Kf(e,t){let i=/\d/;for(e[t]==="x"&&(t++,i=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(i))break}return-1}function Jf(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Kf(e,t);let i=0;for(;t<e.length;t++,i++)if(!(e[t].match(/\w/)&&i<20)){if(e[t]===";")break;return-1}return t}function Ot(e,t,i){return{err:{code:e,msg:t,line:i.line||i,col:i.col}}}function Qf(e){return Fs(e)}function Zf(e){return Fs(e)}function Wt(e,t){const i=e.substring(0,t).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function kn(e){return e.startIndex+e[1].length}const Jl=e=>no.includes(e)?"__"+e:e,tp={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Jl};function ep(e,t){if(typeof e!="string")return;const i=e.toLowerCase();if(no.some(n=>i===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(Xl.some(n=>i===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Ql(e){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:Ql(!0)}const ip=function(e){const t=Object.assign({},tp,e),i=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(const{value:n,name:s}of i)n&&ep(n,s);return t.onDangerousProperty===null&&(t.onDangerousProperty=Jl),t.processEntities=Ql(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),t};let Gs;typeof Symbol!="function"?Gs="@@xmlMetadata":Gs=Symbol("XML Node Metadata");class ei{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,i){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:i})}addChild(t,i){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),i!==void 0&&(this.child[this.child.length-1][Gs]={startIndex:i})}static getMetaDataSymbol(){return Gs}}class np{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,i){const n=Object.create(null);let s=0;if(t[i+3]==="O"&&t[i+4]==="C"&&t[i+5]==="T"&&t[i+6]==="Y"&&t[i+7]==="P"&&t[i+8]==="E"){i=i+9;let r=1,o=!1,a=!1,l="";for(;i<t.length;i++)if(t[i]==="<"&&!a){if(o&&xi(t,"!ENTITY",i)){i+=7;let h,c;if([h,c,i]=this.readEntityExp(t,i+1,this.suppressValidationErr),c.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const d=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n[h]={regx:RegExp(`&${d};`,"g"),val:c},s++}}else if(o&&xi(t,"!ELEMENT",i)){i+=8;const{index:h}=this.readElementExp(t,i+1);i=h}else if(o&&xi(t,"!ATTLIST",i))i+=8;else if(o&&xi(t,"!NOTATION",i)){i+=9;const{index:h}=this.readNotationExp(t,i+1,this.suppressValidationErr);i=h}else if(xi(t,"!--",i))a=!0;else throw new Error("Invalid DOCTYPE");r++,l=""}else if(t[i]===">"){if(a?t[i-1]==="-"&&t[i-2]==="-"&&(a=!1,r--):r--,r===0)break}else t[i]==="["?o=!0:l+=t[i];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i}}readEntityExp(t,i){i=zt(t,i);const n=i;for(;i<t.length&&!/\s/.test(t[i])&&t[i]!=='"'&&t[i]!=="'";)i++;let s=t.substring(n,i);if(Pn(s),i=zt(t,i),!this.suppressValidationErr){if(t.substring(i,i+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[i]==="%")throw new Error("Parameter entities are not supported")}let r="";if([i,r]=this.readIdentifierVal(t,i,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&r.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${r.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return i--,[s,r,i]}readNotationExp(t,i){i=zt(t,i);const n=i;for(;i<t.length&&!/\s/.test(t[i]);)i++;let s=t.substring(n,i);!this.suppressValidationErr&&Pn(s),i=zt(t,i);const r=t.substring(i,i+6).toUpperCase();if(!this.suppressValidationErr&&r!=="SYSTEM"&&r!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);i+=r.length,i=zt(t,i);let o=null,a=null;if(r==="PUBLIC")[i,o]=this.readIdentifierVal(t,i,"publicIdentifier"),i=zt(t,i),(t[i]==='"'||t[i]==="'")&&([i,a]=this.readIdentifierVal(t,i,"systemIdentifier"));else if(r==="SYSTEM"&&([i,a]=this.readIdentifierVal(t,i,"systemIdentifier"),!this.suppressValidationErr&&!a))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:o,systemIdentifier:a,index:--i}}readIdentifierVal(t,i,n){let s="";const r=t[i];if(r!=='"'&&r!=="'")throw new Error(`Expected quoted string, found "${r}"`);i++;const o=i;for(;i<t.length&&t[i]!==r;)i++;if(s=t.substring(o,i),t[i]!==r)throw new Error(`Unterminated ${n} value`);return i++,[i,s]}readElementExp(t,i){i=zt(t,i);const n=i;for(;i<t.length&&!/\s/.test(t[i]);)i++;let s=t.substring(n,i);if(!this.suppressValidationErr&&!Fs(s))throw new Error(`Invalid element name: "${s}"`);i=zt(t,i);let r="";if(t[i]==="E"&&xi(t,"MPTY",i))i+=4;else if(t[i]==="A"&&xi(t,"NY",i))i+=2;else if(t[i]==="("){i++;const o=i;for(;i<t.length&&t[i]!==")";)i++;if(r=t.substring(o,i),t[i]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[i]}"`);return{elementName:s,contentModel:r.trim(),index:i}}readAttlistExp(t,i){i=zt(t,i);let n=i;for(;i<t.length&&!/\s/.test(t[i]);)i++;let s=t.substring(n,i);for(Pn(s),i=zt(t,i),n=i;i<t.length&&!/\s/.test(t[i]);)i++;let r=t.substring(n,i);if(!Pn(r))throw new Error(`Invalid attribute name: "${r}"`);i=zt(t,i);let o="";if(t.substring(i,i+8).toUpperCase()==="NOTATION"){if(o="NOTATION",i+=8,i=zt(t,i),t[i]!=="(")throw new Error(`Expected '(', found "${t[i]}"`);i++;let l=[];for(;i<t.length&&t[i]!==")";){const h=i;for(;i<t.length&&t[i]!=="|"&&t[i]!==")";)i++;let c=t.substring(h,i);if(c=c.trim(),!Pn(c))throw new Error(`Invalid notation name: "${c}"`);l.push(c),t[i]==="|"&&(i++,i=zt(t,i))}if(t[i]!==")")throw new Error("Unterminated list of notations");i++,o+=" ("+l.join("|")+")"}else{const l=i;for(;i<t.length&&!/\s/.test(t[i]);)i++;o+=t.substring(l,i);const h=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!h.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}i=zt(t,i);let a="";return t.substring(i,i+8).toUpperCase()==="#REQUIRED"?(a="#REQUIRED",i+=8):t.substring(i,i+7).toUpperCase()==="#IMPLIED"?(a="#IMPLIED",i+=7):[i,a]=this.readIdentifierVal(t,i,"ATTLIST"),{elementName:s,attributeName:r,attributeType:o,defaultValue:a,index:i}}}const zt=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function xi(e,t,i){for(let n=0;n<t.length;n++)if(t[n]!==e[i+n+1])return!1;return!0}function Pn(e){if(Fs(e))return e;throw new Error(`Invalid entity name ${e}`)}const sp=/^[-+]?0x[a-fA-F0-9]+$/,rp=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,op={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function ap(e,t={}){if(t=Object.assign({},op,t),!e||typeof e!="string")return e;let i=e.trim();if(i.length===0)return e;if(t.skipLike!==void 0&&t.skipLike.test(i))return e;if(i==="0")return 0;if(t.hex&&sp.test(i))return dp(i,16);if(isFinite(i)){if(i.includes("e")||i.includes("E"))return cp(e,i,t);{const n=rp.exec(i);if(n){const s=n[1]||"",r=n[2];let o=hp(n[3]);const a=s?e[r.length+1]===".":e[r.length]===".";if(!t.leadingZeros&&(r.length>1||r.length===1&&!a))return e;{const l=Number(i),h=String(l);if(l===0)return l;if(h.search(/[eE]/)!==-1)return t.eNotation?l:e;if(i.indexOf(".")!==-1)return h==="0"||h===o||h===`${s}${o}`?l:e;let c=r?o:i;return r?c===h||s+c===h?l:e:c===h||c===s+h?l:e}}else return e}}else return up(e,Number(i),t)}const lp=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function cp(e,t,i){if(!i.eNotation)return e;const n=t.match(lp);if(n){let s=n[1]||"";const r=n[3].indexOf("e")===-1?"E":"e",o=n[2],a=s?e[o.length+1]===r:e[o.length]===r;return o.length>1&&a?e:o.length===1&&(n[3].startsWith(`.${r}`)||n[3][0]===r)?Number(t):o.length>0?i.leadingZeros&&!a?(t=(n[1]||"")+n[3],Number(t)):e:Number(t)}else return e}function hp(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function dp(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function up(e,t,i){const n=t===1/0;switch(i.infinity.toLowerCase()){case"null":return null;case"infinity":return t;case"string":return n?"Infinity":"-Infinity";case"original":default:return e}}function fp(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const i of e)if(typeof i=="string"&&t===i||i instanceof RegExp&&i.test(t))return!0}:()=>!1}class zi{constructor(t,i={}){this.pattern=t,this.separator=i.separator||".",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(n=>n.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(n=>n.attrName!==void 0),this._hasPositionSelector=this.segments.some(n=>n.position!==void 0)}_parse(t){const i=[];let n=0,s="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(s.trim()&&(i.push(this._parseSegment(s.trim())),s=""),i.push({type:"deep-wildcard"}),n+=2):(s.trim()&&i.push(this._parseSegment(s.trim())),s="",n++):(s+=t[n],n++);return s.trim()&&i.push(this._parseSegment(s.trim())),i}_parseSegment(t){const i={type:"tag"};let n=null,s=t;const r=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(r&&(s=r[1]+r[3],r[2])){const c=r[2].slice(1,-1);c&&(n=c)}let o,a=s;if(s.includes("::")){const c=s.indexOf("::");if(o=s.substring(0,c).trim(),a=s.substring(c+2).trim(),!o)throw new Error(`Invalid namespace in pattern: ${t}`)}let l,h=null;if(a.includes(":")){const c=a.lastIndexOf(":"),d=a.substring(0,c).trim(),u=a.substring(c+1).trim();["first","last","odd","even"].includes(u)||/^nth\(\d+\)$/.test(u)?(l=d,h=u):l=a}else l=a;if(!l)throw new Error(`Invalid segment pattern: ${t}`);if(i.tag=l,o&&(i.namespace=o),n)if(n.includes("=")){const c=n.indexOf("=");i.attrName=n.substring(0,c).trim(),i.attrValue=n.substring(c+1).trim()}else i.attrName=n.trim();if(h){const c=h.match(/^nth\((\d+)\)$/);c?(i.position="nth",i.positionValue=parseInt(c[1],10)):i.position=h}return i}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}const pp=new Set(["push","pop","reset","updateCurrent","restore"]);class so{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[]}push(t,i=null,n=null){if(this.path.length>0){const c=this.path[this.path.length-1];c.values=void 0}const s=this.path.length;this.siblingStacks[s]||(this.siblingStacks[s]=new Map);const r=this.siblingStacks[s],o=n?`${n}:${t}`:t,a=r.get(o)||0;let l=0;for(const c of r.values())l+=c;r.set(o,a+1);const h={tag:t,position:l,counter:a};n!=null&&(h.namespace=n),i!=null&&(h.values=i),this.path.push(h)}pop(){if(this.path.length===0)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const i=this.path[this.path.length-1];t!=null&&(i.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){return this.path.length===0?void 0:this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;const i=this.path[this.path.length-1];return i.values!==void 0&&t in i.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,i=!0){const n=t||this.separator;return this.path.map(s=>i&&s.namespace?`${s.namespace}:${s.tag}`:s.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const i=t.segments;return i.length===0?!1:t.hasDeepWildcard()?this._matchWithDeepWildcard(i):this._matchSimple(i)}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let i=0;i<t.length;i++){const n=t[i],s=this.path[i],r=i===this.path.length-1;if(!this._matchSegment(n,s,r))return!1}return!0}_matchWithDeepWildcard(t){let i=this.path.length-1,n=t.length-1;for(;n>=0&&i>=0;){const s=t[n];if(s.type==="deep-wildcard"){if(n--,n<0)return!0;const r=t[n];let o=!1;for(let a=i;a>=0;a--){const l=a===this.path.length-1;if(this._matchSegment(r,this.path[a],l)){i=a-1,n--,o=!0;break}}if(!o)return!1}else{const r=i===this.path.length-1;if(!this._matchSegment(s,this.path[i],r))return!1;i--,n--}}return n<0}_matchSegment(t,i,n){if(t.tag!=="*"&&t.tag!==i.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==i.namespace)return!1;if(t.attrName!==void 0){if(!n||!i.values||!(t.attrName in i.values))return!1;if(t.attrValue!==void 0){const s=i.values[t.attrName];if(String(s)!==String(t.attrValue))return!1}}if(t.position!==void 0){if(!n)return!1;const s=i.counter??0;if(t.position==="first"&&s!==0)return!1;if(t.position==="odd"&&s%2!==1)return!1;if(t.position==="even"&&s%2!==0)return!1;if(t.position==="nth"&&s!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(i=>({...i})),this.siblingStacks=t.siblingStacks.map(i=>new Map(i))}readOnly(){const t=this;return new Proxy(t,{get(i,n,s){if(pp.has(n))return()=>{throw new TypeError(`Cannot call '${n}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};const r=Reflect.get(i,n,s);return n==="path"||n==="siblingStacks"?Object.freeze(Array.isArray(r)?r.map(o=>o instanceof Map?Object.freeze(new Map(o)):Object.freeze({...o})):r):typeof r=="function"?r.bind(i):r},set(i,n){throw new TypeError(`Cannot set property '${String(n)}' on a read-only Matcher.`)},deleteProperty(i,n){throw new TypeError(`Cannot delete property '${String(n)}' from a read-only Matcher.`)}})}}function gp(e,t){if(!e)return{};const i=t.attributesGroupName?e[t.attributesGroupName]:e;if(!i)return{};const n={};for(const s in i)if(s.startsWith(t.attributeNamePrefix)){const r=s.substring(t.attributeNamePrefix.length);n[r]=i[s]}else n[s]=i[s];return n}function mp(e){if(!e||typeof e!="string")return;const t=e.indexOf(":");if(t!==-1&&t>0){const i=e.substring(0,t);if(i!=="xmlns")return i}}class _p{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(i,n)=>Zl(n,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(i,n)=>Zl(n,16,"&#x")}},this.addExternalEntities=yp,this.parseXml=Ep,this.parseTextData=bp,this.resolveNameSpace=vp,this.buildAttributesMap=Sp,this.isItStopNode=Tp,this.replaceEntitiesValue=Cp,this.readStopNodeData=Pp,this.saveTextToParentTag=Np,this.addChild=xp,this.ignoreAttributesFn=fp(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new so,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let i=0;i<this.options.stopNodes.length;i++){const n=this.options.stopNodes[i];typeof n=="string"?this.stopNodeExpressions.push(new zi(n)):n instanceof zi&&this.stopNodeExpressions.push(n)}}}}function yp(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i],s=n.replace(/[.\-+*:]/g,"\\.");this.lastEntities[n]={regex:new RegExp("&"+s+";","g"),val:e[n]}}}function bp(e,t,i,n,s,r,o){if(e!==void 0&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,i));const a=this.options.jPath?i.toString():i,l=this.options.tagValueProcessor(t,e,a,s,r);return l==null?e:typeof l!=typeof e||l!==e?l:this.options.trimValues?oo(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?oo(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function vp(e){if(this.options.removeNSPrefix){const t=e.split(":"),i=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=i+t[1])}return e}const wp=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Sp(e,t,i){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const n=jl(e,wp),s=n.length,r={},o={};for(let a=0;a<s;a++){const l=this.resolveNameSpace(n[a][1]),h=n[a][4];if(l.length&&h!==void 0){let c=h;this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c,i,this.readonlyMatcher),o[l]=c}}Object.keys(o).length>0&&typeof t=="object"&&t.updateCurrent&&t.updateCurrent(o);for(let a=0;a<s;a++){const l=this.resolveNameSpace(n[a][1]),h=this.options.jPath?t.toString():this.readonlyMatcher;if(this.ignoreAttributesFn(l,h))continue;let c=n[a][4],d=this.options.attributeNamePrefix+l;if(l.length)if(this.options.transformAttributeName&&(d=this.options.transformAttributeName(d)),d=tc(d,this.options),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c,i,this.readonlyMatcher);const u=this.options.jPath?t.toString():this.readonlyMatcher,f=this.options.attributeValueProcessor(l,c,u);f==null?r[d]=c:typeof f!=typeof c||f!==c?r[d]=f:r[d]=oo(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[d]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const a={};return a[this.options.attributesGroupName]=r,a}return r}}const Ep=function(e){e=e.replace(/\r\n?/g,`
12
+ `);const t=new ei("!xml");let i=t,n="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const s=new np(this.options.processEntities);for(let r=0;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="/"){const a=Ci(e,">",r,"Closing Tag is not closed.");let l=e.substring(r+2,a).trim();if(this.options.removeNSPrefix){const c=l.indexOf(":");c!==-1&&(l=l.substr(c+1))}l=ao(this.options.transformTagName,l,"",this.options).tagName,i&&(n=this.saveTextToParentTag(n,i,this.readonlyMatcher));const h=this.matcher.getCurrentTag();if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);h&&this.options.unpairedTags.indexOf(h)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,i=this.tagsNodeStack.pop(),n="",r=a}else if(e[r+1]==="?"){let a=ro(e,r,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,this.readonlyMatcher),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const l=new ei(a.tagName);l.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(l[":@"]=this.buildAttributesMap(a.tagExp,this.matcher,a.tagName)),this.addChild(i,l,this.readonlyMatcher,r)}r=a.closeIndex+1}else if(e.substr(r+1,3)==="!--"){const a=Ci(e,"-->",r+4,"Comment is not closed.");if(this.options.commentPropName){const l=e.substring(r+4,a-2);n=this.saveTextToParentTag(n,i,this.readonlyMatcher),i.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}r=a}else if(e.substr(r+1,2)==="!D"){const a=s.readDocType(e,r);this.docTypeEntities=a.entities,r=a.i}else if(e.substr(r+1,2)==="!["){const a=Ci(e,"]]>",r,"CDATA is not closed.")-2,l=e.substring(r+9,a);n=this.saveTextToParentTag(n,i,this.readonlyMatcher);let h=this.parseTextData(l,i.tagname,this.readonlyMatcher,!0,!1,!0,!0);h==null&&(h=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}]):i.add(this.options.textNodeName,h),r=a+2}else{let a=ro(e,r,this.options.removeNSPrefix);if(!a){const b=e.substring(Math.max(0,r-50),Math.min(e.length,r+50));throw new Error(`readTagExp returned undefined at position ${r}. Context: "${b}"`)}let l=a.tagName;const h=a.rawTagName;let c=a.tagExp,d=a.attrExpPresent,u=a.closeIndex;if({tagName:l,tagExp:c}=ao(this.options.transformTagName,l,c,this.options),this.options.strictReservedNames&&(l===this.options.commentPropName||l===this.options.cdataPropName||l===this.options.textNodeName||l===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${l}`);i&&n&&i.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,i,this.readonlyMatcher,!1));const f=i;f&&this.options.unpairedTags.indexOf(f.tagname)!==-1&&(i=this.tagsNodeStack.pop(),this.matcher.pop());let p=!1;c.length>0&&c.lastIndexOf("/")===c.length-1&&(p=!0,l[l.length-1]==="/"?(l=l.substr(0,l.length-1),c=l):c=c.substr(0,c.length-1),d=l!==c);let _=null,v;v=mp(h),l!==t.tagname&&this.matcher.push(l,{},v),l!==c&&d&&(_=this.buildAttributesMap(c,this.matcher,l),_&&gp(_,this.options)),l!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));const S=r;if(this.isCurrentNodeStopNode){let b="";if(p)r=a.closeIndex;else if(this.options.unpairedTags.indexOf(l)!==-1)r=a.closeIndex;else{const N=this.readStopNodeData(e,h,u+1);if(!N)throw new Error(`Unexpected end of ${h}`);r=N.i,b=N.tagContent}const x=new ei(l);_&&(x[":@"]=_),x.add(this.options.textNodeName,b),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(i,x,this.readonlyMatcher,S)}else{if(p){({tagName:l,tagExp:c}=ao(this.options.transformTagName,l,c,this.options));const b=new ei(l);_&&(b[":@"]=_),this.addChild(i,b,this.readonlyMatcher,S),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(l)!==-1){const b=new ei(l);_&&(b[":@"]=_),this.addChild(i,b,this.readonlyMatcher,S),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=a.closeIndex;continue}else{const b=new ei(l);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(i),_&&(b[":@"]=_),this.addChild(i,b,this.readonlyMatcher,S),i=b}n="",r=u}}else n+=e[r];return t.child};function xp(e,t,i,n){this.options.captureMetaData||(n=void 0);const s=this.options.jPath?i.toString():i,r=this.options.updateTag(t.tagname,s,t[":@"]);r===!1||(typeof r=="string"&&(t.tagname=r),e.addChild(t,n))}function Cp(e,t,i){const n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){const s=this.options.jPath?i.toString():i;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,s)))return e}if(n.tagFilter){const s=this.options.jPath?i.toString():i;if(!n.tagFilter(t,s))return e}for(const s of Object.keys(this.docTypeEntities)){const r=this.docTypeEntities[s],o=e.match(r.regx);if(o){if(this.entityExpansionCount+=o.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);const a=e.length;if(e=e.replace(r.regx,r.val),n.maxExpandedLength&&(this.currentExpandedLength+=e.length-a,this.currentExpandedLength>n.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${n.maxExpandedLength}`)}}for(const s of Object.keys(this.lastEntities)){const r=this.lastEntities[s],o=e.match(r.regex);if(o&&(this.entityExpansionCount+=o.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);e=e.replace(r.regex,r.val)}if(e.indexOf("&")===-1)return e;if(this.options.htmlEntities)for(const s of Object.keys(this.htmlEntities)){const r=this.htmlEntities[s],o=e.match(r.regex);if(o&&(this.entityExpansionCount+=o.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);e=e.replace(r.regex,r.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e}function Np(e,t,i,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,i,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Tp(e,t){if(!e||e.length===0)return!1;for(let i=0;i<e.length;i++)if(t.matches(e[i]))return!0;return!1}function kp(e,t,i=">"){let n,s="";for(let r=t;r<e.length;r++){let o=e[r];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===i[0])if(i[1]){if(e[r+1]===i[1])return{data:s,index:r}}else return{data:s,index:r};else o===" "&&(o=" ");s+=o}}function Ci(e,t,i,n){const s=e.indexOf(t,i);if(s===-1)throw new Error(n);return s+t.length-1}function ro(e,t,i,n=">"){const s=kp(e,t+1,n);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,h=!0;a!==-1&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const c=l;if(i){const d=l.indexOf(":");d!==-1&&(l=l.substr(d+1),h=l!==s.data.substr(d+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:h,rawTagName:c}}function Pp(e,t,i){const n=i;let s=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const r=Ci(e,">",i,`${t} is not closed`);if(e.substring(i+2,r).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,i),i:r};i=r}else if(e[i+1]==="?")i=Ci(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=Ci(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=Ci(e,"]]>",i,"StopNode is not closed.")-2;else{const r=ro(e,i,">");r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!=="/"&&s++,i=r.closeIndex)}}function oo(e,t,i){if(t&&typeof e=="string"){const n=e.trim();return n==="true"?!0:n==="false"?!1:ap(e,i)}else return Wf(e)?e:""}function Zl(e,t,i){const n=Number.parseInt(e,t);return n>=0&&n<=1114111?String.fromCodePoint(n):i+e+";"}function ao(e,t,i,n){if(e){const s=e(t);i===t&&(i=s),t=s}return t=tc(t,n),{tagName:t,tagExp:i}}function tc(e,t){if(Xl.includes(e))throw new Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return no.includes(e)?t.onDangerousProperty(e):e}const lo=ei.getMetaDataSymbol();function Op(e,t){if(!e||typeof e!="object")return{};if(!t)return e;const i={};for(const n in e)if(n.startsWith(t)){const s=n.substring(t.length);i[s]=e[n]}else i[n]=e[n];return i}function Ap(e,t,i,n){return ec(e,t,i,n)}function ec(e,t,i,n){let s;const r={};for(let o=0;o<e.length;o++){const a=e[o],l=Mp(a);if(l!==void 0&&l!==t.textNodeName){const h=Op(a[":@"]||{},t.attributeNamePrefix);i.push(l,h)}if(l===t.textNodeName)s===void 0?s=a[l]:s+=""+a[l];else{if(l===void 0)continue;if(a[l]){let h=ec(a[l],t,i,n);const c=Lp(h,t);if(a[":@"]?Rp(h,a[":@"],n,t):Object.keys(h).length===1&&h[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?h=h[t.textNodeName]:Object.keys(h).length===0&&(t.alwaysCreateTextNode?h[t.textNodeName]="":h=""),a[lo]!==void 0&&typeof h=="object"&&h!==null&&(h[lo]=a[lo]),r[l]!==void 0&&Object.prototype.hasOwnProperty.call(r,l))Array.isArray(r[l])||(r[l]=[r[l]]),r[l].push(h);else{const d=t.jPath?n.toString():n;t.isArray(l,d,c)?r[l]=[h]:r[l]=h}l!==void 0&&l!==t.textNodeName&&i.pop()}}}return typeof s=="string"?s.length>0&&(r[t.textNodeName]=s):s!==void 0&&(r[t.textNodeName]=s),r}function Mp(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];if(n!==":@")return n}}function Rp(e,t,i,n){if(t){const s=Object.keys(t),r=s.length;for(let o=0;o<r;o++){const a=s[o],l=a.startsWith(n.attributeNamePrefix)?a.substring(n.attributeNamePrefix.length):a,h=n.jPath?i.toString()+"."+l:i;n.isArray(a,h,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function Lp(e,t){const{textNodeName:i}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[i]||typeof e[i]=="boolean"||e[i]===0))}class ic{constructor(t){this.externalEntities={},this.options=ip(t)}parse(t,i){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});const r=jf(t,i);if(r!==!0)throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`)}const n=new _p(this.options);n.addExternalEntities(this.externalEntities);const s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:Ap(s,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=i}static getMetaDataSymbol(){return ei.getMetaDataSymbol()}}const Ip=`
13
+ `;function Dp(e,t){let i="";t.format&&t.indentBy.length>0&&(i=Ip);const n=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let r=0;r<t.stopNodes.length;r++){const o=t.stopNodes[r];typeof o=="string"?n.push(new zi(o)):o instanceof zi&&n.push(o)}const s=new so;return nc(e,t,i,s,n)}function nc(e,t,i,n,s){let r="",o=!1;if(t.maxNestedTags&&n.getDepth()>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(e)){if(e!=null){let a=e.toString();return a=co(a,t),a}return""}for(let a=0;a<e.length;a++){const l=e[a],h=rc(l);if(h===void 0)continue;const c=Vp(l[":@"],t);n.push(h,c);const d=Gp(n,s);if(h===t.textNodeName){let v=l[h];d||(v=t.tagValueProcessor(h,v),v=co(v,t)),o&&(r+=i),r+=v,o=!1,n.pop();continue}else if(h===t.cdataPropName){o&&(r+=i),r+=`<![CDATA[${l[h][0][t.textNodeName]}]]>`,o=!1,n.pop();continue}else if(h===t.commentPropName){r+=i+`<!--${l[h][0][t.textNodeName]}-->`,o=!0,n.pop();continue}else if(h[0]==="?"){const v=oc(l[":@"],t,d),S=h==="?xml"?"":i;let b=l[h][0][t.textNodeName];b=b.length!==0?" "+b:"",r+=S+`<${h}${b}${v}?>`,o=!0,n.pop();continue}let u=i;u!==""&&(u+=t.indentBy);const f=oc(l[":@"],t,d),p=i+`<${h}${f}`;let _;d?_=sc(l[h],t):_=nc(l[h],t,u,n,s),t.unpairedTags.indexOf(h)!==-1?t.suppressUnpairedNode?r+=p+">":r+=p+"/>":(!_||_.length===0)&&t.suppressEmptyNode?r+=p+"/>":_&&_.endsWith(">")?r+=p+`>${_}${i}</${h}>`:(r+=p+">",_&&i!==""&&(_.includes("/>")||_.includes("</"))?r+=i+t.indentBy+_+i:r+=_,r+=`</${h}>`),o=!0,n.pop()}return r}function Vp(e,t){if(!e||t.ignoreAttributes)return null;const i={};let n=!1;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;const r=s.startsWith(t.attributeNamePrefix)?s.substr(t.attributeNamePrefix.length):s;i[r]=e[s],n=!0}return n?i:null}function sc(e,t){if(!Array.isArray(e))return e!=null?e.toString():"";let i="";for(let n=0;n<e.length;n++){const s=e[n],r=rc(s);if(r===t.textNodeName)i+=s[r];else if(r===t.cdataPropName)i+=s[r][0][t.textNodeName];else if(r===t.commentPropName)i+=s[r][0][t.textNodeName];else{if(r&&r[0]==="?")continue;if(r){const o=Fp(s[":@"],t),a=sc(s[r],t);!a||a.length===0?i+=`<${r}${o}/>`:i+=`<${r}${o}>${a}</${r}>`}}}return i}function Fp(e,t){let i="";if(e&&!t.ignoreAttributes)for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=e[n];s===!0&&t.suppressBooleanAttributes?i+=` ${n.substr(t.attributeNamePrefix.length)}`:i+=` ${n.substr(t.attributeNamePrefix.length)}="${s}"`}return i}function rc(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];if(Object.prototype.hasOwnProperty.call(e,n)&&n!==":@")return n}}function oc(e,t,i){let n="";if(e&&!t.ignoreAttributes)for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let r;i?r=e[s]:(r=t.attributeValueProcessor(s,e[s]),r=co(r,t)),r===!0&&t.suppressBooleanAttributes?n+=` ${s.substr(t.attributeNamePrefix.length)}`:n+=` ${s.substr(t.attributeNamePrefix.length)}="${r}"`}return n}function Gp(e,t){if(!t||t.length===0)return!1;for(let i=0;i<t.length;i++)if(e.matches(t[i]))return!0;return!1}function co(e,t){if(e&&e.length>0&&t.processEntities)for(let i=0;i<t.entities.length;i++){const n=t.entities[i];e=e.replace(n.regex,n.val)}return e}function $p(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const i of e)if(typeof i=="string"&&t===i||i instanceof RegExp&&i.test(t))return!0}:()=>!1}const Bp={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function Yt(e){if(this.options=Object.assign({},Bp,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(t=>typeof t=="string"&&t.startsWith("*.")?".."+t.substring(2):t)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let t=0;t<this.options.stopNodes.length;t++){const i=this.options.stopNodes[t];typeof i=="string"?this.stopNodeExpressions.push(new zi(i)):i instanceof zi&&this.stopNodeExpressions.push(i)}this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=$p(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Up),this.processTextOrObjNode=Hp,this.options.format?(this.indentate=Wp,this.tagEndChar=`>
14
14
  `,this.newLine=`
15
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}ke.prototype.build=function(e){return this.options.preserveOrder?b0(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},ke.prototype.j2x=function(e,t,i){let n="",s="";const r=i.join(".");for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))if(typeof e[o]>"u")this.isAttribute(o)&&(s+="");else if(e[o]===null)this.isAttribute(o)||o===this.options.cdataPropName?s+="":o[0]==="?"?s+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)s+=this.buildTextValNode(e[o],o,"",t);else if(typeof e[o]!="object"){const a=this.isAttribute(o);if(a&&!this.ignoreAttributesFn(a,r))n+=this.buildAttrPairStr(a,""+e[o]);else if(!a)if(o===this.options.textNodeName){let l=this.options.tagValueProcessor(o,""+e[o]);s+=this.replaceEntitiesValue(l)}else s+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){const a=e[o].length;let l="",c="";for(let h=0;h<a;h++){const d=e[o][h];if(!(typeof d>"u"))if(d===null)o[0]==="?"?s+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(typeof d=="object")if(this.options.oneListGroup){const u=this.j2x(d,t+1,i.concat(o));l+=u.val,this.options.attributesGroupName&&d.hasOwnProperty(this.options.attributesGroupName)&&(c+=u.attrStr)}else l+=this.processTextOrObjNode(d,o,t,i);else if(this.options.oneListGroup){let u=this.options.tagValueProcessor(o,d);u=this.replaceEntitiesValue(u),l+=u}else l+=this.buildTextValNode(d,o,"",t)}this.options.oneListGroup&&(l=this.buildObjectNode(l,o,c,t)),s+=l}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const a=Object.keys(e[o]),l=a.length;for(let c=0;c<l;c++)n+=this.buildAttrPairStr(a[c],""+e[o][a[c]])}else s+=this.processTextOrObjNode(e[o],o,t,i);return{attrStr:n,val:s}},ke.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function E0(e,t,i,n){const s=this.j2x(e,i+1,n.concat(t));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,s.attrStr,i):this.buildObjectNode(s.val,t,s.attrStr,i)}ke.prototype.buildObjectNode=function(e,t,i,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+i+"?"+this.tagEndChar:this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,r="";return t[0]==="?"&&(r="?",s=""),(i||i==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+i+r+">"+e+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&r.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+i+r+this.tagEndChar+e+this.indentate(n)+s}},ke.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t},ke.prototype.buildTextValNode=function(e,t,i,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+i+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),s===""?this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+i+">"+s+"</"+t+this.tagEndChar}},ke.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const i=this.options.entities[t];e=e.replace(i.regex,i.val)}return e};function x0(e){return this.options.indentBy.repeat(e)}function C0(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}class N0{attr_id;attr_version;Label;constructor({Label:t,attr_id:i,attr_version:n}){this.attr_id=i,this.attr_version=n,this.Label=t}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Label:this.Label}}}class T0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class Jl{value;constructor(t){this.value=t?.text_value}toXML(){return{text_value:this.value}}}function At(e,t){return e?Array.isArray(e)?e.map(i=>new t(i)):[new t(e)]:[]}function He(e){return e.map(t=>t.toXML())}function Oe(e){const t={};return e.forEach(i=>{const s=i.constructor.xmlTagName??i.constructor.name;t[s]||(t[s]=[]),t[s].push(i.toXML())}),t}class On{attr_id;attr_version;Units;TicketingEquipmentRef;TicketValidatorEquipmentRef;constructor({attr_id:t,attr_version:i,Units:n,TicketingEquipmentRef:s=void 0,TicketValidatorEquipmentRef:r=void 0}){this.attr_id=t,this.attr_version=i,this.Units=n,this.TicketingEquipmentRef=s,this.TicketValidatorEquipmentRef=r}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Units:this.Units,TicketingEquipmentRef:this.TicketingEquipmentRef?.toXML(),TicketValidatorEquipmentRef:this.TicketValidatorEquipmentRef?.toXML()}}}class k0{attr_id;attr_version;Name;PublicUse;TotalCapacity;actualVehicleEquipments;constructor({attr_id:t,attr_version:i,Name:n,PublicUse:s,TotalCapacity:r,actualVehicleEquipments:o}){this.attr_id=t,this.attr_version=i,this.Name=n?new Jl(n):void 0,this.actualVehicleEquipments=o?At(o.ActualVehicleEquipment,On):[],this.PublicUse=s?.text_value,this.TotalCapacity=r?.text_value}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Name:this.Name?.toXML}}}class ei{x;y;constructor(t,i){this.x=t,this.y=i}static fromXML(t){const i=t?.Location?.pos;if(typeof i=="string"){const[n,s]=i.split(" ").map(Number);if(typeof n=="number"&&typeof s=="number")return new ei(n,s)}else return new ei(0,0)}toXML(){return{Location:{pos:`${this.x} ${this.y}`}}}}class Ql{static xmlTagName="PassengerEntrance";attr_id;attr_version;Name;Label;Width;Height;actualVehicleEquipments;PublicUse;VehicleSide;SequenceFromFront;HeightFromGround;DeckEntranceType;IsEmergencyExit;HasDoor;IsAutomatic;Centroid;constructor({attr_id:t,attr_version:i,Name:n,Label:s,Width:r,Height:o,actualVehicleEquipments:a,PublicUse:l,VehicleSide:c,SequenceFromFront:h,HeightFromGround:d,DeckEntranceType:u,IsEmergencyExit:f,HasDoor:p,IsAutomatic:_,Centroid:b=void 0}){this.attr_id=t,this.attr_version=i,this.Name=n?new Jl(n):void 0,this.Label=s?.text_value,this.Width=r?.text_value,this.Height=o?.text_value,this.actualVehicleEquipments=At(a?.ActualVehicleEquipment,On),this.PublicUse=l?.text_value,this.VehicleSide=c?.text_value,this.SequenceFromFront=h?.text_value,this.HeightFromGround=d?.text_value,this.DeckEntranceType=u?.text_value,this.IsEmergencyExit=f?.text_value,this.HasDoor=p?.text_value,this.IsAutomatic=_?.text_value,this.Centroid=b?ei.fromXML(b):void 0}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Name:this.Name?.toXML(),Label:this.Label,Width:this.Width,Height:this.Height,actualVehicleEquipments:{ActualVehicleEquipment:He(this.actualVehicleEquipments)},PublicUse:this.PublicUse,VehicleSide:this.VehicleSide,SequenceFromFront:this.SequenceFromFront,HeightFromGround:this.HeightFromGround,DeckEntranceType:this.DeckEntranceType,IsEmergencyExit:this.IsEmergencyExit,HasDoor:this.HasDoor,IsAutomatic:this.IsAutomatic,Centroid:this.Centroid?.toXML()}}getShape(t,i,n){const s=(this.Width||.8)*t,r=.2*t;let o=s,a=r,l=0,c=0;if((this.VehicleSide==="front"||this.VehicleSide==="back")&&(o=r,a=s),this.Centroid){let h=(this.Centroid?.x??0)*t,d=(this.Centroid?.y??0)*t;return this.VehicleSide==="leftSide"?d=(this.Centroid?.y??0)*t-a/2:this.VehicleSide==="rightSide"?d=(this.Centroid?.y??0)*t+a/2:this.VehicleSide==="front"?h=(this.Centroid?.x??0)*t-o/2:this.VehicleSide==="back"&&(h=(this.Centroid?.x??0)*t+o/2),{x:h,y:d,width:o,height:a,fill:"orange",stroke:"darkorange",strokeWidth:2,draggable:!0}}return this.VehicleSide==="leftSide"?(l=(this.SequenceFromFront??0)*t-o/2+5,c=5):this.VehicleSide==="rightSide"?(l=(this.SequenceFromFront??0)*t-o/2+5,c=n*t+5-a):this.VehicleSide==="front"?(l=5,c=n*t/2+5-a/2):this.VehicleSide==="back"?(l=i*t+5-o,c=n*t/2+5-a/2):(l=5,c=5),{x:l,y:c,width:o,height:a,fill:"orange",stroke:"darkorange",strokeWidth:2,draggable:!0}}}class Zl{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class O0{attr_ref;attr_version;FromDeckEntranceRef;ToDeckEntranceRef;constructor({attr_ref:t,attr_version:i,FromDeckEntranceRef:n,ToDeckEntranceRef:s}){this.attr_ref=t,this.attr_version=i,this.FromDeckEntranceRef=new Zl(n),this.ToDeckEntranceRef=new Zl(s)}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version,FromDeckEntranceRef:this.FromDeckEntranceRef.toXML(),ToDeckEntranceRef:this.ToDeckEntranceRef.toXML()}}}class P0{attr_id;attr_version;Name;constructor({attr_id:t,attr_version:i,Name:n}){this.attr_id=t,this.attr_version=i,this.Name=n}toXML(){return{attr_id:this.attr_id,Name:this.Name,attr_version:this.attr_version}}}class A0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class R0{attr_ref;attr_version;validityConditions;Name;EntranceUsageType;EntranceSetting;ControlledLocking;constructor({attr_ref:t,attr_version:i,validityConditions:n,Name:s,EntranceUsageType:r,EntranceSetting:o,ControlledLocking:a}){this.attr_ref=t,this.attr_version=i,this.validityConditions=Object.entries(n).flatMap(([l,c])=>(l==="ValidityConditionRef"&&c.map(h=>new A0(h)),l==="ValidityCondition"&&c.map(h=>new P0(h)),[])),this.Name=s,this.EntranceUsageType=r,this.EntranceSetting=o,this.ControlledLocking=a}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version,validityConditions:Oe(this.validityConditions),Name:this.Name,EntranceUsageType:this.EntranceUsageType,EntranceSetting:this.EntranceSetting,ControlledLocking:this.ControlledLocking}}}class M0{attr_ref;attr_version;LocatableSpotType;capacity;constructor({attr_ref:t,attr_version:i,LocatableSpotType:n,capacity:s}){this.attr_ref=t,this.attr_version=i,this.LocatableSpotType=n,this.capacity=s}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version,LocatableSpotType:this.LocatableSpotType,capacity:this.capacity}}}class L0{attr_id;label;constructor({attr_id:t,Label:i}){this.attr_id=t,this.label=i}toXML(){return{attr_id:this.attr_id,label:this.label}}}class tc{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class I0{attr_id;label;constructor({attr_id:t,Label:i}){this.attr_id=t,this.label=i}toXML(){return{attr_id:this.attr_id,label:this.label}}}class ec{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class D0{attr_id;attr_version;Label;Orientation;actualVehicleEquipments;SpotColumnRef;SpotRowRef;constructor({attr_id:t,attr_version:i,Label:n,Orientation:s,actualVehicleEquipments:r,SpotColumnRef:o,SpotRowRef:a}){this.attr_id=t,this.attr_version=i,this.Label=n,this.Orientation=s,this.actualVehicleEquipments=r?At(r,On):[],this.SpotColumnRef=o?new tc(o):void 0,this.SpotRowRef=a?new ec(a):void 0}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Label:this.Label,Orientation:this.Orientation,actualVehicleEquipments:{ActualVehicleEquipment:He(this.actualVehicleEquipments)},SpotColumnRef:this.SpotColumnRef?.toXML(),SpotRowRef:this.SpotRowRef?.toXML()}}}class V0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}var Pn=(e=>(e.Occupied="Occupied",e.Selected="Selected",e.Filtered="Filtered",e.Defect="Defect",e.Undefined="Undefined",e))(Pn||{});class zi{static xmlTagName="PassengerSpot";attr_id;attr_version;Label;Orientation;actualVehicleEquipments;SpotColumnRef;SpotRowRef;ByWindow;ByAisle;HasPower;Centroid;Width;Length;availability;constructor({attr_id:t,attr_version:i,Label:n,Orientation:s,actualVehicleEquipments:r,SpotColumnRef:o,SpotRowRef:a,ByWindow:l,ByAisle:c,HasPower:h,Centroid:d,Width:u,Length:f}){this.attr_id=t,this.attr_version=i,this.Label=n||"",this.Orientation=s||void 0,this.actualVehicleEquipments=r?At(r,On):void 0,this.SpotColumnRef=o?new tc(o):void 0,this.SpotRowRef=a?new ec(a):void 0,this.ByWindow=l,this.ByAisle=c,this.HasPower=h,this.Centroid=d?ei.fromXML(d):void 0,this.Width=u||.5,this.Length=f||.5}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Label:this.Label?{text_value:this.Label}:void 0,Orientation:this.Orientation?{text_value:this.Orientation}:void 0,actualVehicleEquipments:this.actualVehicleEquipments?Oe(this.actualVehicleEquipments):void 0,SpotColumnRef:this.SpotColumnRef?.toXML(),SpotRowRef:this.SpotRowRef?.toXML(),ByWindow:this.ByWindow?{text_value:this.ByWindow}:void 0,ByAisle:this.ByAisle?{text_value:this.ByAisle}:void 0,HasPower:this.HasPower?{text_value:this.HasPower}:void 0,Centroid:this.Centroid?.toXML(),Width:this.Width,Length:this.Length}}getClasses(){const t=[];return this.ByWindow&&t.push("seat__by-window"),this.ByAisle&&t.push("seat__by-aisle"),this.HasPower&&t.push("seat__has-power"),this.Orientation&&t.push(`seat__orientation-${this.Orientation}`),this.availability&&t.push(`seat__availability-${this.availability.toLowerCase()}`),t.join(" ")}getShape(t){if(this.Centroid){const i=this.Width*t,n=this.Length*t;return{x:(this.Centroid?.x??1)*t-i/2+5,y:(this.Centroid?.y??1)*t-n/2+5,width:i,height:n,fill:"lightgray",stroke:"gray",strokeWidth:1,cornerRadius:2,draggable:!0}}return{x:0,y:0,width:this.Width*t,height:this.Length*t,fill:"red",draggable:!0}}}class F0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class ic{value;constructor(t){this.value=t}toXML(){return this.value}}class G0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class me{static xmlTagName="PassengerSpace";attr_id;attr_version;Name;SmokingAllowed;StandingAllowed;PassengerSpaceType;passengerSpots;luggageSpots;deckEntrances;deckEntranceUsage;deckEntranceCouples;deckSpaceCapacities;actualVehicleEquipments;ServiceFacilitySetRef;Centroid;Polygon;PublicUse;TotalCapacity;FareClass;AirConditioned;constructor({attr_id:t,attr_version:i,Name:n,SmokingAllowed:s,StandingAllowed:r,PassengerSpaceType:o,passengerSpots:a,luggageSpots:l,deckEntrances:c,deckEntranceUsage:h,deckEntranceCouples:d,deckSpaceCapacities:u,actualVehicleEquipments:f,ServiceFacilitySetRef:p,Centroid:_,Polygon:b,PublicUse:w,TotalCapacity:y,FareClass:x,AirConditioned:N}){this.attr_id=t,this.attr_version=i,this.Name=n,this.SmokingAllowed=s,this.StandingAllowed=r,this.PassengerSpaceType=o,this.passengerSpots=a?Object.entries(a).flatMap(([T,O])=>T==="PassengerSpot"?At(O,zi):T==="PassengerSpotRef"?At(O,F0):[]):[],this.luggageSpots=l?Object.entries(l).flatMap(([T,O])=>T==="LuggageSpot"?At(O,D0):T==="LuggageSpotRef"?At(O,V0):[]):[],this.deckEntrances=At(c?.PassengerEntrance,Ql),this.deckEntranceUsage=At(h?.DeckEntranceUsage,R0),this.deckEntranceCouples=At(d?.DeckEntranceCouple,O0),this.deckSpaceCapacities=At(u?.DeckSpaceCapacity,M0),this.actualVehicleEquipments=At(f?.ActualVehicleEquipment,On),this.ServiceFacilitySetRef=p?new G0(p):void 0,this.Centroid=_?ei.fromXML(_):void 0,this.Polygon=b?new ic(b):void 0,this.PublicUse=w?.text_value,this.TotalCapacity=y?.text_value,this.FareClass=x?.text_value,this.AirConditioned=N?.text_value}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Name:this.Name,SmokingAllowed:this.SmokingAllowed,StandingAllowed:this.StandingAllowed,PassengerSpaceType:this.PassengerSpaceType,passengerSpots:this.passengerSpots?Oe(this.passengerSpots):"",luggageSpots:this.luggageSpots?Oe(this.luggageSpots):void 0,deckEntrances:this.deckEntrances?Oe(this.deckEntrances):void 0,deckEntranceUsage:this.deckEntranceUsage?Oe(this.deckEntranceUsage):void 0,deckEntranceCouples:this.deckEntranceCouples?Oe(this.deckEntranceCouples):void 0,deckSpaceCapacities:this.deckSpaceCapacities?Oe(this.deckSpaceCapacities):void 0,actualVehicleEquipments:this.actualVehicleEquipments?Oe(this.actualVehicleEquipments):void 0,ServiceFacilitySetRef:this.ServiceFacilitySetRef?.toXML(),Centroid:this.Centroid?.toXML(),Polygon:this.Polygon?.toXML(),PublicUse:this.PublicUse,TotalCapacity:this.TotalCapacity,FareClass:this.FareClass,AirConditioned:this.AirConditioned}}}class B0{attr_id;attr_version;Name;polygon;deckspaces;DeckLevelRef;spotRows;spotColumns;Width;Length;constructor({attr_id:t,attr_version:i,deckSpaces:n,spotRows:s=void 0,spotColumns:r=void 0,DeckLevelRef:o=void 0,Name:a=void 0,polygon:l=void 0,Width:c=void 0,Length:h=void 0}){this.attr_id=t,this.attr_version=i,this.Name=a??"",this.polygon=l?new ic(l):void 0,this.DeckLevelRef=o?new T0(o):void 0,this.Width=c??2.825,this.Length=h??26.4,this.deckspaces=n?Object.entries(n).flatMap(([d,u])=>d==="OtherDeckSpace"?At(u,k0):d==="PassengerSpace"?At(u,me):[]):[],this.spotRows=At(s?.SpotRow,I0),this.spotColumns=At(r?.SpotColumn,L0)}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,spotRows:{SpotRow:He(this.spotRows)},spotColumns:{SpotColumn:He(this.spotColumns)},deckSpaces:Oe(this.deckspaces),DeckLevelRef:this.DeckLevelRef?.toXML(),polygon:this.polygon?.toXML(),Name:this.Name,Width:this.Width,Length:this.Length}}getBoundingBox(){const t=this.Length,i=this.Width;return{width:t,height:i}}getShape(t){const{width:i,height:n}=this.getBoundingBox();return{x:5,y:5,width:i*t,height:n*t,fill:"white",stroke:"gray",strokeWidth:2,cornerRadius:5}}}class nc{attr_id;attr_version;deckLevels;decks;constructor({attr_id:t,attr_version:i,decks:n=void 0,deckLevels:s=void 0}){this.attr_id=t,this.attr_version=i,this.deckLevels=At(s?.DeckLevel,N0),this.decks=At(n?.Deck,B0)}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,decks:{Deck:He(this.decks)},deckLevels:{DeckLevel:He(this.deckLevels)}}}}const $0=Ne({__name:"DeckVisualization",props:{deck:{type:Object,required:!0},availability:{type:Object},scale:{type:Number,required:!0},selectedElements:{type:Array,default:()=>[]}},emits:["select","area-select"],setup(e,{emit:t}){const i=e,n=t,s=Xt(null),r=Xt(!1),o=Xt({x:0,y:0}),a=Xt([]),l=Xt(new Map),c=wi(()=>i.deck.deckspaces?.flatMap(E=>E instanceof me?E.passengerSpots?.filter(C=>C instanceof zi)||[]:[]).map(E=>{const C=E;return C.availability=i.availability&&E.attr_id?Pn[i.availability[E.attr_id]??"Undefined"]:Pn.Undefined,C})||[]),h=wi(()=>i.deck.deckspaces?.flatMap(E=>E instanceof me?E.deckEntrances||[]:[])||[]),d=E=>i.selectedElements.includes(E)?{stroke:"#68a691",strokeWidth:3}:{},u=(E,C)=>{let P=0,H=0;const{width:K,height:z}=E.getBoundingBox();return P=Math.max(P,K),H=Math.max(H,z),{width:P*C+10,height:H*C+10}},f=(E,C)=>{r.value||(n("select",{element:C,ctrlKey:E.evt.ctrlKey||E.evt.metaKey}),E.cancelBubble=!0)},p=E=>{if(E.evt.ctrlKey||E.evt.metaKey||E.target===E.target.getStage()){r.value=!0;const P=E.target.getStage().getPointerPosition(),H=E.target.getAbsoluteTransform().copy();H.invert();const K=H.point(P);o.value={x:K.x,y:K.y},s.value={x:K.x,y:K.y,width:0,height:0,fill:"rgba(0, 255, 0, 0.3)",stroke:"#68a691",strokeWidth:1}}else n("area-select",[])},_=E=>{if(!r.value)return;const P=E.target.getStage().getPointerPosition(),H=E.target.getAbsoluteTransform().copy();H.invert();const K=H.point(P);s.value.width=K.x-o.value.x,s.value.height=K.y-o.value.y},b=()=>{if(!r.value)return;r.value=!1;const E=s.value;if(!E)return;const C=E.width>0?E.x:E.x+E.width,P=E.height>0?E.y:E.y+E.height,H=Math.abs(E.width),K=Math.abs(E.height),z=c.value.filter(Z=>{const J=Z.getShape(i.scale);return J.x<C+H&&J.x+J.width>C&&J.y<P+K&&J.y+J.height>P});z.length>0&&n("area-select",z),s.value=null},w=(E,C)=>{l.value.clear(),i.selectedElements.includes(C)&&i.selectedElements.forEach(P=>{if(P instanceof zi){const H=P.getShape(i.scale);l.value.set(P,{x:H.x,y:H.y})}})},y=(E,C)=>{a.value=[];const P=E.target.getStage(),H=c.value.filter(B=>B!==C&&!i.selectedElements.includes(B)),K=E.target.x(),z=E.target.y(),Z=10;let J=K,A=z;H.forEach(B=>{const D=B.getShape(i.scale);Math.abs(K-D.x)<Z&&(J=D.x,a.value.push({points:[D.x,0,D.x,P.height()],stroke:"red",strokeWidth:1,dash:[4,6]})),Math.abs(z-D.y)<Z&&(A=D.y,a.value.push({points:[0,D.y,P.width(),D.y],stroke:"red",strokeWidth:1,dash:[4,6]}))}),E.target.x(J),E.target.y(A);const L=l.value.get(C);if(L&&i.selectedElements.includes(C)){const B=J-L.x,D=A-L.y;i.selectedElements.forEach(nt=>{if(nt!==C&&nt instanceof zi){const ht=l.value.get(nt);ht&&N(nt,ht.x+B,ht.y+D)}})}},x=(E,C)=>{a.value=[];const P=E.target.x(),H=E.target.y();N(C,P,H),l.value.clear()},N=(E,C,P)=>{E.Centroid?(E.Centroid.x=(C-5)/i.scale+E.Width/2,E.Centroid.y=(P-5)/i.scale+E.Length/2):E.Centroid=new ei((C-5)/i.scale+E.Width/2,(P-5)/i.scale+E.Length/2)},T=(E,C)=>{const P=E.target.x(),H=E.target.y(),K=i.deck.Width*i.scale,z=i.deck.Length*i.scale,Z=C.getShape(i.scale,i.deck.Length,i.deck.Width),J=Z.width,A=Z.height,L=5,B=5,D=L+z,nt=B+K,ht=P+J/2,ot=H+A/2,mt=Math.abs(ht-L),Ot=Math.abs(ht-D),Zi=Math.abs(ot-B),nr=Math.abs(ot-nt),tn=Math.min(mt,Ot,Zi,nr);let ae=P,ve=H;tn===Zi?(ve=B,ae=Math.max(L,Math.min(P,D-J))):tn===nr?(ve=nt-A,ae=Math.max(L,Math.min(P,D-J))):tn===mt?(ae=L,ve=K/2+5-A/2):tn===Ot&&(ae=D-J,ve=K/2+5-A/2),E.target.x(ae),E.target.y(ve),C.Centroid||(C.Centroid=new ei(0,0)),C.Centroid.x=ae/i.scale,C.Centroid.y=ve/i.scale},O=(E,C)=>{const P=E.target.x(),H=E.target.y(),K=i.deck.Width*i.scale,z=i.deck.Length*i.scale,Z=C.getShape(i.scale,i.deck.Length,i.deck.Width),J=Z.width,A=Z.height,L=5,B=5,D=L+z,nt=B+K,ht=1;Math.abs(H-B)<ht?(C.VehicleSide="leftSide",C.SequenceFromFront=(P-L+J/2)/i.scale):Math.abs(H-(nt-A))<ht?(C.VehicleSide="rightSide",C.SequenceFromFront=(P-L+J/2)/i.scale):Math.abs(P-L)<ht?(C.VehicleSide="front",C.SequenceFromFront=0):Math.abs(P-(D-J))<ht&&(C.VehicleSide="back",C.SequenceFromFront=i.deck.Length)};return(E,C)=>{const P=$i("v-rect"),H=$i("v-text"),K=$i("v-group"),z=$i("v-line"),Z=$i("v-layer"),J=$i("v-stage");return at(),Je(J,{config:u(e.deck,e.scale)},{default:gn(()=>[Tt(Z,null,{default:gn(()=>[Tt(P,{config:{...e.deck.getShape(e.scale),y:5,...d(e.deck)},onClick:C[0]||(C[0]=A=>f(A,e.deck))},null,8,["config"]),Tt(P,{config:{x:0,y:0,width:e.deck.getShape(e.scale).width,height:e.deck.getShape(e.scale).height,fill:"transparent",listening:!0},onMousedown:p,onMousemove:_,onMouseup:b},null,8,["config"]),(at(!0),vt(Dt,null,Fe(c.value,(A,L)=>(at(),Je(K,{key:`seats-${L}`,config:{x:A.getShape(e.scale).x,y:A.getShape(e.scale).y,draggable:!0},onDragstart:B=>w(B,A),onDragend:B=>x(B,A),onDragmove:B=>y(B,A),onClick:B=>f(B,A)},{default:gn(()=>[Tt(P,{config:{width:A.getShape(e.scale).width,height:A.getShape(e.scale).height,fill:A.getShape(e.scale).fill,stroke:A.getShape(e.scale).stroke,strokeWidth:A.getShape(e.scale).strokeWidth,cornerRadius:A.getShape(e.scale).cornerRadius,...d(A)}},null,8,["config"]),Tt(H,{config:{width:A.getShape(e.scale).width,height:A.getShape(e.scale).height,text:A.Label,align:"center",verticalAlign:"middle",fontSize:Math.min(Math.min(A.getShape(e.scale).width,A.getShape(e.scale).height)/2,16),listening:!1}},null,8,["config"])]),_:2},1032,["config","onDragstart","onDragend","onDragmove","onClick"]))),128)),(at(!0),vt(Dt,null,Fe(h.value,(A,L)=>(at(),Je(K,{key:`entrance-${L}`,config:{x:A.getShape(e.scale,e.deck.Length,e.deck.Width).x,y:A.getShape(e.scale,e.deck.Length,e.deck.Width).y,draggable:!0},onDragmove:B=>T(B,A),onDragend:B=>O(B,A),onClick:B=>f(B,A)},{default:gn(()=>[Tt(P,{config:{width:A.getShape(e.scale,e.deck.Length,e.deck.Width).width,height:A.getShape(e.scale,e.deck.Length,e.deck.Width).height,fill:A.getShape(e.scale,e.deck.Length,e.deck.Width).fill,stroke:A.getShape(e.scale,e.deck.Length,e.deck.Width).stroke,strokeWidth:A.getShape(e.scale,e.deck.Length,e.deck.Width).strokeWidth,...d(A)}},null,8,["config"])]),_:2},1032,["config","onDragmove","onDragend","onClick"]))),128)),s.value?(at(),Je(P,{key:0,config:{...s.value,listening:!1}},null,8,["config"])):Ps("",!0),(at(!0),vt(Dt,null,Fe(a.value,(A,L)=>(at(),Je(z,{key:`guide-${L}`,config:A},null,8,["config"]))),128))]),_:1})]),_:1},8,["config"])}}}),H0={class:"flex flex-col h-full"},W0={class:"flex p-4 w-full items-center justify-center gap-10"},U0={for:"scale-slider"},j0={style:{display:"flex","flex-direction":"row","overflow-x":"auto",gap:"20px",padding:"20px"}},X0=["onClick"],z0=Ne({__name:"WagonVisualization",props:{deckPlans:{type:Array,required:!1},selectedElements:{type:Array,default:()=>[]}},setup(e){const t=Xt(20);return(i,n)=>(at(),vt("div",H0,[ut("div",W0,[ut("label",U0,"Scale: "+Le(t.value),1),vs(ut("input",{id:"scale-slider",type:"range",min:"10",max:"50","onUpdate:modelValue":n[0]||(n[0]=s=>t.value=s)},null,512),[[Is,t.value,void 0,{number:!0}]])]),ut("div",j0,[(at(!0),vt(Dt,null,Fe(e.deckPlans,(s,r)=>(at(),vt("div",{key:`deckplan-${r}`},[ut("h3",null,Le(s.attr_id),1),(at(!0),vt(Dt,null,Fe(s.decks,(o,a)=>(at(),vt("div",{key:`deck-${a}`},[ut("h4",{onClick:l=>i.$emit("select",{element:o,ctrlKey:!1}),class:ye(`${e.selectedElements.includes(o)?"text-ott-accent":""} cursor-pointer`)},Le(o.Name),11,X0),Tt($0,{deck:o,scale:t.value,selectedElements:e.selectedElements,onSelect:n[1]||(n[1]=l=>i.$emit("select",l)),onAreaSelect:n[2]||(n[2]=l=>i.$emit("area-select",l))},null,8,["deck","scale","selectedElements"])]))),128))]))),128))])]))}}),Y0={class:"bg-ott-bg-primary p-4"},q0={class:"flex justify-between items-center mb-4"},K0={key:0},J0=["for"],Q0=["id","onUpdate:modelValue","type"],Z0=["id","onUpdate:modelValue"],tp={key:2},ep=["id","onUpdate:modelValue"],ip={key:3},np={key:4},sp={key:1},rp=Ne({__name:"ObjectProperties",props:{element:{type:Object,default:null}},emits:["delete"],setup(e){return(t,i)=>(at(),vt("div",Y0,[ut("div",q0,[i[1]||(i[1]=ut("h3",{class:"font-bold"},"Properties",-1)),e.element?(at(),vt("button",{key:0,class:"ott-button border-ott-error! text-ott-error!",onClick:i[0]||(i[0]=n=>t.$emit("delete",e.element))}," Delete ")):Ps("",!0)]),e.element?(at(),vt("div",K0,[(at(!0),vt(Dt,null,Fe(e.element,(n,s)=>(at(),vt("div",{key:s,class:"flex items-center mb-10"},[ut("label",{for:s,class:"min-w-[150px] font-bold"},Le(s),9,J0),typeof n=="string"||typeof n=="number"?vs((at(),vt("input",{key:0,id:s,"onUpdate:modelValue":r=>e.element[s]=r,type:typeof n=="number"?"number":"text"},null,8,Q0)),[[bf,e.element[s]]]):typeof n=="boolean"?vs((at(),vt("input",{key:1,id:s,"onUpdate:modelValue":r=>e.element[s]=r,type:"checkbox"},null,8,Z0)),[[Ml,e.element[s]]]):n&&typeof n=="object"&&n.value!==void 0?(at(),vt("span",tp,[vs(ut("input",{id:s,"onUpdate:modelValue":r=>n.value=r,type:"text"},null,8,ep),[[Is,n.value]])])):n&&Array.isArray(n)?(at(),vt("span",ip,Le(n.length)+" elements ",1)):(at(),vt("span",np,Le(n),1))]))),128))])):(at(),vt("div",sp,[...i[2]||(i[2]=[ut("p",null,"Select an element to view properties.",-1)])]))]))}}),op=".object-properties[data-v-1987e529]{padding:20px;border-top:1px solid #ccc;background-color:#f9f9f9}.property-row[data-v-1987e529]{margin-bottom:10px;display:flex;align-items:center}.property-row label[data-v-1987e529]{width:150px;font-weight:700}.property-row input[data-v-1987e529]{flex:1;padding:5px}",sc=(e,t)=>{const i=e.__vccOpts||e;for(const[n,s]of t)i[n]=s;return i},ap=sc(rp,[["styles",[op]],["__scopeId","data-v-1987e529"]]),lp={class:"flex flex-col gap-2 p-4 bg-white flex-1"},cp={class:"flex flex-col gap-2"},hp=Ne({__name:"ElementCatalog",emits:["add-seat","add-door"],setup(e){return(t,i)=>(at(),vt("div",lp,[i[2]||(i[2]=ut("h3",{class:"font-bold mb-2"},"Catalog",-1)),ut("div",cp,[ut("button",{class:"ott-button w-fit text-left",onClick:i[0]||(i[0]=n=>t.$emit("add-seat"))}," + Add Seat "),ut("button",{class:"ott-button w-fit text-left",onClick:i[1]||(i[1]=n=>t.$emit("add-door"))}," + Add Door ")])]))}}),dp={class:"h-full overflow-y-auto bg-gray-100 p-4 font-mono text-sm"},up=["id"],fp=Ne({__name:"XmlViewer",props:{xml:{type:String,required:!0},selectedId:{type:String,default:null}},setup(e){const t=e,i=wi(()=>t.xml.split(`
16
- `)),n=Xt(null),s=o=>n.value?o>=n.value.start&&o<=n.value.end:!1,r=()=>{if(!t.selectedId){n.value=null;return}const o=i.value.findIndex(l=>l.includes(`id="${t.selectedId}"`));if(o===-1){n.value=null;return}const a=i.value[o];if(a){if(a.trim().endsWith("/>"))n.value={start:o,end:o};else{const l=a.match(/<(\w+)/);if(l){const c=l[1];let h=1,d=o;for(let u=o+1;u<i.value.length;u++){const f=i.value[u];if(f&&!f.match(new RegExp(`<${c}.*/>`))&&(f.match(new RegExp(`<${c}`))?h++:f.match(new RegExp(`</${c}>`))&&h--,h===0)){d=u;break}}n.value={start:o,end:d}}else n.value={start:o,end:o}}fs(()=>{document.getElementById(`line-${o}`)?.scrollIntoView({behavior:"smooth",block:"center"})})}};return yi(()=>[t.selectedId,t.xml],()=>{r()},{immediate:!0}),(o,a)=>(at(),vt("div",dp,[(at(!0),vt(Dt,null,Fe(i.value,(l,c)=>(at(),vt("div",{key:c,id:`line-${c}`,class:ye({"bg-yellow-200":s(c)})},[ut("pre",null,Le(l),1)],10,up))),128))]))}}),rc=e=>{const i=new ro({ignoreAttributes:!1,attributeNamePrefix:"attr_",removeNSPrefix:!0}).parse(e);return At(i.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,nc)},pp={class:"flex flex-col h-full"},gp={class:"p-4 border-b border-b-ott-bg-dark flex gap-2 items-center bg-ott-bg-primary"},mp={class:"flex-1 flex overflow-hidden"},_p={class:"flex-1 overflow-hidden"},vp={class:"flex flex-row h-75 border-t border-ott-bg-dark"},bp=Ne({__name:"DeckplanEditor",setup(e,{expose:t}){const i=Xt(null),n=Xt([]),s=Xt([]),r=Xt(null),o=Xt(!1),a=Xt(""),l=()=>{if(!o.value||!r.value)return;r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan=He(n.value);const O=new ke({ignoreAttributes:!1,textNodeName:"text_value",attributeNamePrefix:"attr_",format:!0});a.value=O.build(r.value)},c=()=>{o.value=!o.value,o.value&&l()};yi(n,()=>{l()},{deep:!0});const h=({element:O,ctrlKey:E})=>{if(E){const C=s.value.indexOf(O);if(C>-1)s.value.splice(C,1);else{if(s.value.length>0&&s.value[0].constructor!==O.constructor)return;s.value.push(O)}}else s.value=[O]},d=O=>{s.value=O},u=O=>{const E=O.target;i.value=E.files?E.files[0]:null};function f(){if(i.value){const O=new FileReader;O.addEventListener("load",E=>{const C=E.target?.result;if(typeof C!="string")return;const P=new ro({ignoreAttributes:!1,attributeNamePrefix:"attr_",removeNSPrefix:!0});r.value=P.parse(C),n.value=rc(C),n.value=[...n.value]}),O.readAsText(i.value)}}function p(){if(i.value){r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan=He(n.value);const E=new ke({ignoreAttributes:!1,textNodeName:"text_value",attributeNamePrefix:"attr_"}).build(r.value),C=new Blob([E],{type:"text/xml"}),P=document.createElement("a");P.href=URL.createObjectURL(C),P.download="Demo.xml",P.click()}}const _=()=>n.value.length>0&&n.value[0]?.decks.length&&n.value[0]?.decks?.length>0?n.value[0].decks[0]:null,b=()=>{const O=_();if(!O)return;const E=O.deckspaces?.find(P=>P instanceof me);if(!E){console.warn("No PassengerSpace found to add seat to");return}const C=new zi({attr_id:`seat_${Date.now()}`,attr_version:"1",Label:"",Orientation:"forwards",actualVehicleEquipments:[],SpotColumnRef:null,SpotRowRef:null,ByWindow:!1,ByAisle:!1,HasPower:!1,Centroid:{x:1,y:1},Width:.5,Length:.5});E.passengerSpots||(E.passengerSpots=[]),E.passengerSpots.push(C)},w=()=>{const O=_();if(!O)return;const E=O.deckspaces?.find(P=>P instanceof me);if(!E){console.warn("No PassengerSpace found to add door to");return}const C=new Ql({attr_id:`door_${Date.now()}`,attr_version:"1",Name:{text_value:"New Door"},Width:{text_value:1},VehicleSide:{text_value:"leftSide"},SequenceFromFront:{text_value:0},DeckEntranceType:{text_value:"external"},actualVehicleEquipments:{ActualVehicleEquipment:[]},Label:void 0,Height:void 0,PublicUse:void 0,HeightFromGround:void 0,IsEmergencyExit:void 0,HasDoor:void 0,IsAutomatic:void 0,Centroid:void 0});E.deckEntrances||(E.deckEntrances=[]),E.deckEntrances.push(C)},y=O=>{n.value.forEach(E=>{E.decks.forEach(C=>{C.deckspaces?.forEach(P=>{if(P instanceof me){if(P.passengerSpots){const H=P.passengerSpots.indexOf(O);H>-1&&P.passengerSpots.splice(H,1)}if(P.deckEntrances){const H=P.deckEntrances.indexOf(O);H>-1&&P.deckEntrances.splice(H,1)}}})})}),s.value=[]};function x(){return r.value?(r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan=He(n.value),new ke({ignoreAttributes:!1,textNodeName:"text_value",attributeNamePrefix:"attr_",format:!0}).build(r.value)):null}function N(){return new me({attr_id:`ps-${Date.now()}`,attr_version:"1",Name:void 0,SmokingAllowed:void 0,StandingAllowed:void 0,PassengerSpaceType:"seatingArea",passengerSpots:{PassengerSpot:[],PassengerSpotRef:[]},luggageSpots:{LuggageSpot:[],LuggageSpotRef:[]},deckEntrances:{PassengerEntrance:[]},deckEntranceUsage:{DeckEntranceUsage:[]},deckEntranceCouples:{DeckEntranceCouple:[]},deckSpaceCapacities:{DeckSpaceCapacity:[]},actualVehicleEquipments:{ActualVehicleEquipment:[]},ServiceFacilitySetRef:void 0,Centroid:void 0,Polygon:void 0,PublicUse:void 0,TotalCapacity:void 0,FareClass:void 0,AirConditioned:void 0})}function T(O){const C=new ro({ignoreAttributes:!1,attributeNamePrefix:"attr_",removeNSPrefix:!0,alwaysCreateTextNode:!1}).parse(O);r.value=C;const P=At(C.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,nc);P.forEach(H=>{H.decks.forEach(K=>{if(!K.deckspaces||K.deckspaces.length===0){K.deckspaces=[N()];return}const z=[];K.deckspaces.forEach(Z=>{Z instanceof me?z.push(Z):(Z?.passengerSpots||Z?.PassengerSpaceType)&&z.push(new me(Z))}),K.deckspaces=z})}),n.value=P}return t({exportXml:x,loadXml:T}),(O,E)=>(at(),vt("div",pp,[ut("div",gp,[ut("input",{ref:"inputRef",class:"ott-button",type:"file",multiple:"",onChange:u,accept:"text/xml"},null,544),ut("button",{onClick:f,class:"ott-button"},"Load"),ut("button",{onClick:p,class:"ott-button"},"Save"),ut("button",{onClick:c,class:ye(["ott-button",{"bg-ott-accent text-white":o.value}])},"XML",2)]),ut("div",mp,[ut("div",_p,[n.value.length>0?(at(),Je(z0,{key:0,deckPlans:n.value,selectedElements:s.value,onSelect:h,onAreaSelect:d},null,8,["deckPlans","selectedElements"])):Ps("",!0)]),o.value?(at(),Je(fp,{key:0,xml:a.value,selectedId:s.value[0]?.attr_id,class:"w-1/3 border-l border-ott-bg-dark"},null,8,["xml","selectedId"])):Ps("",!0)]),ut("div",vp,[Tt(ap,{element:s.value.length===1?s.value[0]:null,class:"flex-1 overflow-y-auto",onDelete:y},null,8,["element"]),Tt(hp,{class:"w-50 border-l border-ott-bg-dark",onAddSeat:b,onAddDoor:w})])]))}}),yp=Math.PI/180;function Sp(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Ni=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},X={_global:Ni,version:"10.0.12",isBrowser:Sp(),isUnminified:/param/.test((function(e){}).toString()),dblClickWindow:400,getAngle(e){return X.angleDeg?e*yp:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return X.DD.isDragging},isTransforming(){var e,t;return(t=(e=X.Transformer)===null||e===void 0?void 0:e.isTransforming())!==null&&t!==void 0?t:!1},isDragReady(){return!!X.DD.node},releaseCanvasOnDestroy:!0,document:Ni.document,_injectGlobal(e){typeof Ni.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Ni.Konva=e}},kt=e=>{X[e.prototype.getClassName()]=e};X._injectGlobal(X);const wp=`Konva.js unsupported environment.
15
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Yt.prototype.build=function(e){if(this.options.preserveOrder)return Dp(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});const t=new so;return this.j2x(e,0,t).val}},Yt.prototype.j2x=function(e,t,i){let n="",s="";if(this.options.maxNestedTags&&i.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");const r=this.options.jPath?i.toString():i,o=this.checkStopNode(i);for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a))if(typeof e[a]>"u")this.isAttribute(a)&&(s+="");else if(e[a]===null)this.isAttribute(a)||a===this.options.cdataPropName?s+="":a[0]==="?"?s+=this.indentate(t)+"<"+a+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+a+"/"+this.tagEndChar;else if(e[a]instanceof Date)s+=this.buildTextValNode(e[a],a,"",t,i);else if(typeof e[a]!="object"){const l=this.isAttribute(a);if(l&&!this.ignoreAttributesFn(l,r))n+=this.buildAttrPairStr(l,""+e[a],o);else if(!l)if(a===this.options.textNodeName){let h=this.options.tagValueProcessor(a,""+e[a]);s+=this.replaceEntitiesValue(h)}else{i.push(a);const h=this.checkStopNode(i);if(i.pop(),h){const c=""+e[a];c===""?s+=this.indentate(t)+"<"+a+this.closeTag(a)+this.tagEndChar:s+=this.indentate(t)+"<"+a+">"+c+"</"+a+this.tagEndChar}else s+=this.buildTextValNode(e[a],a,"",t,i)}}else if(Array.isArray(e[a])){const l=e[a].length;let h="",c="";for(let d=0;d<l;d++){const u=e[a][d];if(!(typeof u>"u"))if(u===null)a[0]==="?"?s+=this.indentate(t)+"<"+a+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+a+"/"+this.tagEndChar;else if(typeof u=="object")if(this.options.oneListGroup){i.push(a);const f=this.j2x(u,t+1,i);i.pop(),h+=f.val,this.options.attributesGroupName&&u.hasOwnProperty(this.options.attributesGroupName)&&(c+=f.attrStr)}else h+=this.processTextOrObjNode(u,a,t,i);else if(this.options.oneListGroup){let f=this.options.tagValueProcessor(a,u);f=this.replaceEntitiesValue(f),h+=f}else{i.push(a);const f=this.checkStopNode(i);if(i.pop(),f){const p=""+u;p===""?h+=this.indentate(t)+"<"+a+this.closeTag(a)+this.tagEndChar:h+=this.indentate(t)+"<"+a+">"+p+"</"+a+this.tagEndChar}else h+=this.buildTextValNode(u,a,"",t,i)}}this.options.oneListGroup&&(h=this.buildObjectNode(h,a,c,t)),s+=h}else if(this.options.attributesGroupName&&a===this.options.attributesGroupName){const l=Object.keys(e[a]),h=l.length;for(let c=0;c<h;c++)n+=this.buildAttrPairStr(l[c],""+e[a][l[c]],o)}else s+=this.processTextOrObjNode(e[a],a,t,i);return{attrStr:n,val:s}},Yt.prototype.buildAttrPairStr=function(e,t,i){return i||(t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function Hp(e,t,i,n){const s=this.extractAttributes(e);if(n.push(t,s),this.checkStopNode(n)){const a=this.buildRawContent(e),l=this.buildAttributesForStopNode(e);return n.pop(),this.buildObjectNode(a,t,l,i)}const o=this.j2x(e,i+1,n);return n.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,o.attrStr,i,n):this.buildObjectNode(o.val,t,o.attrStr,i)}Yt.prototype.extractAttributes=function(e){if(!e||typeof e!="object")return null;const t={};let i=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){const n=e[this.options.attributesGroupName];for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;const r=s.startsWith(this.options.attributeNamePrefix)?s.substring(this.options.attributeNamePrefix.length):s;t[r]=n[s],i=!0}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const s=this.isAttribute(n);s&&(t[s]=e[n],i=!0)}return i?t:null},Yt.prototype.buildRawContent=function(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];let t="";for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||this.isAttribute(i)||this.options.attributesGroupName&&i===this.options.attributesGroupName)continue;const n=e[i];if(i===this.options.textNodeName)t+=n;else if(Array.isArray(n)){for(let s of n)if(typeof s=="string"||typeof s=="number")t+=`<${i}>${s}</${i}>`;else if(typeof s=="object"&&s!==null){const r=this.buildRawContent(s),o=this.buildAttributesForStopNode(s);r===""?t+=`<${i}${o}/>`:t+=`<${i}${o}>${r}</${i}>`}}else if(typeof n=="object"&&n!==null){const s=this.buildRawContent(n),r=this.buildAttributesForStopNode(n);s===""?t+=`<${i}${r}/>`:t+=`<${i}${r}>${s}</${i}>`}else t+=`<${i}>${n}</${i}>`}return t},Yt.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!="object")return"";let t="";if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){const i=e[this.options.attributesGroupName];for(let n in i){if(!Object.prototype.hasOwnProperty.call(i,n))continue;const s=n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n,r=i[n];r===!0&&this.options.suppressBooleanAttributes?t+=" "+s:t+=" "+s+'="'+r+'"'}}else for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;const n=this.isAttribute(i);if(n){const s=e[i];s===!0&&this.options.suppressBooleanAttributes?t+=" "+n:t+=" "+n+'="'+s+'"'}}return t},Yt.prototype.buildObjectNode=function(e,t,i,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+i+"?"+this.tagEndChar:this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,r="";return t[0]==="?"&&(r="?",s=""),(i||i==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+i+r+">"+e+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&r.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+i+r+this.tagEndChar+e+this.indentate(n)+s}},Yt.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t},Yt.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},Yt.prototype.buildTextValNode=function(e,t,i,n,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(t,e);return r=this.replaceEntitiesValue(r),r===""?this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+i+">"+r+"</"+t+this.tagEndChar}},Yt.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const i=this.options.entities[t];e=e.replace(i.regex,i.val)}return e};function Wp(e){return this.options.indentBy.repeat(e)}function Up(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}class jp{attr_id;attr_version;Label;constructor({Label:t,attr_id:i,attr_version:n}){this.attr_id=i,this.attr_version=n,this.Label=t}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Label:this.Label}}}class Xp{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class ac{value;constructor(t){this.value=t?.text_value}toXML(){return{text_value:this.value}}}function At(e,t){return e?Array.isArray(e)?e.map(i=>new t(i)):[new t(e)]:[]}function He(e){return e.map(t=>t.toXML())}function Pe(e){const t={};return e.forEach(i=>{const s=i.constructor.xmlTagName??i.constructor.name;t[s]||(t[s]=[]),t[s].push(i.toXML())}),t}class On{attr_id;attr_version;Units;TicketingEquipmentRef;TicketValidatorEquipmentRef;constructor({attr_id:t,attr_version:i,Units:n,TicketingEquipmentRef:s=void 0,TicketValidatorEquipmentRef:r=void 0}){this.attr_id=t,this.attr_version=i,this.Units=n,this.TicketingEquipmentRef=s,this.TicketValidatorEquipmentRef=r}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Units:this.Units,TicketingEquipmentRef:this.TicketingEquipmentRef?.toXML(),TicketValidatorEquipmentRef:this.TicketValidatorEquipmentRef?.toXML()}}}class zp{attr_id;attr_version;Name;PublicUse;TotalCapacity;actualVehicleEquipments;constructor({attr_id:t,attr_version:i,Name:n,PublicUse:s,TotalCapacity:r,actualVehicleEquipments:o}){this.attr_id=t,this.attr_version=i,this.Name=n?new ac(n):void 0,this.actualVehicleEquipments=o?At(o.ActualVehicleEquipment,On):[],this.PublicUse=s?.text_value,this.TotalCapacity=r?.text_value}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Name:this.Name?.toXML}}}class ii{x;y;constructor(t,i){this.x=t,this.y=i}static fromXML(t){const i=t?.Location?.pos;if(typeof i=="string"){const[n,s]=i.split(" ").map(Number);if(typeof n=="number"&&typeof s=="number")return new ii(n,s)}else return new ii(0,0)}toXML(){return{Location:{pos:`${this.x} ${this.y}`}}}}class lc{static xmlTagName="PassengerEntrance";attr_id;attr_version;Name;Label;Width;Height;actualVehicleEquipments;PublicUse;VehicleSide;SequenceFromFront;HeightFromGround;DeckEntranceType;IsEmergencyExit;HasDoor;IsAutomatic;Centroid;constructor({attr_id:t,attr_version:i,Name:n,Label:s,Width:r,Height:o,actualVehicleEquipments:a,PublicUse:l,VehicleSide:h,SequenceFromFront:c,HeightFromGround:d,DeckEntranceType:u,IsEmergencyExit:f,HasDoor:p,IsAutomatic:_,Centroid:v=void 0}){this.attr_id=t,this.attr_version=i,this.Name=n?new ac(n):void 0,this.Label=s?.text_value,this.Width=r?.text_value,this.Height=o?.text_value,this.actualVehicleEquipments=At(a?.ActualVehicleEquipment,On),this.PublicUse=l?.text_value,this.VehicleSide=h?.text_value,this.SequenceFromFront=c?.text_value,this.HeightFromGround=d?.text_value,this.DeckEntranceType=u?.text_value,this.IsEmergencyExit=f?.text_value,this.HasDoor=p?.text_value,this.IsAutomatic=_?.text_value,this.Centroid=v?ii.fromXML(v):void 0}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Name:this.Name?.toXML(),Label:this.Label,Width:this.Width,Height:this.Height,actualVehicleEquipments:{ActualVehicleEquipment:He(this.actualVehicleEquipments)},PublicUse:this.PublicUse,VehicleSide:this.VehicleSide,SequenceFromFront:this.SequenceFromFront,HeightFromGround:this.HeightFromGround,DeckEntranceType:this.DeckEntranceType,IsEmergencyExit:this.IsEmergencyExit,HasDoor:this.HasDoor,IsAutomatic:this.IsAutomatic,Centroid:this.Centroid?.toXML()}}getShape(t,i,n){const s=(this.Width||.8)*t,r=.2*t;let o=s,a=r,l=0,h=0;if((this.VehicleSide==="front"||this.VehicleSide==="back")&&(o=r,a=s),this.Centroid){let c=(this.Centroid?.x??0)*t,d=(this.Centroid?.y??0)*t;return this.VehicleSide==="leftSide"?d=(this.Centroid?.y??0)*t-a/2:this.VehicleSide==="rightSide"?d=(this.Centroid?.y??0)*t+a/2:this.VehicleSide==="front"?c=(this.Centroid?.x??0)*t-o/2:this.VehicleSide==="back"&&(c=(this.Centroid?.x??0)*t+o/2),{x:c,y:d,width:o,height:a,fill:"orange",stroke:"darkorange",strokeWidth:2,draggable:!0}}return this.VehicleSide==="leftSide"?(l=(this.SequenceFromFront??0)*t-o/2+5,h=5):this.VehicleSide==="rightSide"?(l=(this.SequenceFromFront??0)*t-o/2+5,h=n*t+5-a):this.VehicleSide==="front"?(l=5,h=n*t/2+5-a/2):this.VehicleSide==="back"?(l=i*t+5-o,h=n*t/2+5-a/2):(l=5,h=5),{x:l,y:h,width:o,height:a,fill:"orange",stroke:"darkorange",strokeWidth:2,draggable:!0}}}class cc{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class Yp{attr_ref;attr_version;FromDeckEntranceRef;ToDeckEntranceRef;constructor({attr_ref:t,attr_version:i,FromDeckEntranceRef:n,ToDeckEntranceRef:s}){this.attr_ref=t,this.attr_version=i,this.FromDeckEntranceRef=new cc(n),this.ToDeckEntranceRef=new cc(s)}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version,FromDeckEntranceRef:this.FromDeckEntranceRef.toXML(),ToDeckEntranceRef:this.ToDeckEntranceRef.toXML()}}}class qp{attr_id;attr_version;Name;constructor({attr_id:t,attr_version:i,Name:n}){this.attr_id=t,this.attr_version=i,this.Name=n}toXML(){return{attr_id:this.attr_id,Name:this.Name,attr_version:this.attr_version}}}class Kp{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class Jp{attr_ref;attr_version;validityConditions;Name;EntranceUsageType;EntranceSetting;ControlledLocking;constructor({attr_ref:t,attr_version:i,validityConditions:n,Name:s,EntranceUsageType:r,EntranceSetting:o,ControlledLocking:a}){this.attr_ref=t,this.attr_version=i,this.validityConditions=Object.entries(n).flatMap(([l,h])=>(l==="ValidityConditionRef"&&h.map(c=>new Kp(c)),l==="ValidityCondition"&&h.map(c=>new qp(c)),[])),this.Name=s,this.EntranceUsageType=r,this.EntranceSetting=o,this.ControlledLocking=a}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version,validityConditions:Pe(this.validityConditions),Name:this.Name,EntranceUsageType:this.EntranceUsageType,EntranceSetting:this.EntranceSetting,ControlledLocking:this.ControlledLocking}}}class Qp{attr_ref;attr_version;LocatableSpotType;capacity;constructor({attr_ref:t,attr_version:i,LocatableSpotType:n,capacity:s}){this.attr_ref=t,this.attr_version=i,this.LocatableSpotType=n,this.capacity=s}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version,LocatableSpotType:this.LocatableSpotType,capacity:this.capacity}}}class Zp{attr_id;label;constructor({attr_id:t,Label:i}){this.attr_id=t,this.label=i}toXML(){return{attr_id:this.attr_id,label:this.label}}}class hc{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class t0{attr_id;label;constructor({attr_id:t,Label:i}){this.attr_id=t,this.label=i}toXML(){return{attr_id:this.attr_id,label:this.label}}}class dc{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class e0{attr_id;attr_version;Label;Orientation;actualVehicleEquipments;SpotColumnRef;SpotRowRef;constructor({attr_id:t,attr_version:i,Label:n,Orientation:s,actualVehicleEquipments:r,SpotColumnRef:o,SpotRowRef:a}){this.attr_id=t,this.attr_version=i,this.Label=n,this.Orientation=s,this.actualVehicleEquipments=r?At(r,On):[],this.SpotColumnRef=o?new hc(o):void 0,this.SpotRowRef=a?new dc(a):void 0}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Label:this.Label,Orientation:this.Orientation,actualVehicleEquipments:{ActualVehicleEquipment:He(this.actualVehicleEquipments)},SpotColumnRef:this.SpotColumnRef?.toXML(),SpotRowRef:this.SpotRowRef?.toXML()}}}class i0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}var An=(e=>(e.Occupied="Occupied",e.Selected="Selected",e.Filtered="Filtered",e.Defect="Defect",e.Undefined="Undefined",e))(An||{});class Yi{static xmlTagName="PassengerSpot";attr_id;attr_version;Label;Orientation;actualVehicleEquipments;SpotColumnRef;SpotRowRef;ByWindow;ByAisle;HasPower;Centroid;Width;Length;availability;constructor({attr_id:t,attr_version:i,Label:n,Orientation:s,actualVehicleEquipments:r,SpotColumnRef:o,SpotRowRef:a,ByWindow:l,ByAisle:h,HasPower:c,Centroid:d,Width:u,Length:f}){this.attr_id=t,this.attr_version=i,this.Label=n||"",this.Orientation=s||void 0,this.actualVehicleEquipments=r?At(r,On):void 0,this.SpotColumnRef=o?new hc(o):void 0,this.SpotRowRef=a?new dc(a):void 0,this.ByWindow=l,this.ByAisle=h,this.HasPower=c,this.Centroid=d?ii.fromXML(d):void 0,this.Width=u||.5,this.Length=f||.5}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Label:this.Label?{text_value:this.Label}:void 0,Orientation:this.Orientation?{text_value:this.Orientation}:void 0,actualVehicleEquipments:this.actualVehicleEquipments?Pe(this.actualVehicleEquipments):void 0,SpotColumnRef:this.SpotColumnRef?.toXML(),SpotRowRef:this.SpotRowRef?.toXML(),ByWindow:this.ByWindow?{text_value:this.ByWindow}:void 0,ByAisle:this.ByAisle?{text_value:this.ByAisle}:void 0,HasPower:this.HasPower?{text_value:this.HasPower}:void 0,Centroid:this.Centroid?.toXML(),Width:this.Width,Length:this.Length}}getClasses(){const t=[];return this.ByWindow&&t.push("seat__by-window"),this.ByAisle&&t.push("seat__by-aisle"),this.HasPower&&t.push("seat__has-power"),this.Orientation&&t.push(`seat__orientation-${this.Orientation}`),this.availability&&t.push(`seat__availability-${this.availability.toLowerCase()}`),t.join(" ")}getShape(t){if(this.Centroid){const i=this.Width*t,n=this.Length*t;return{x:(this.Centroid?.x??1)*t-i/2+5,y:(this.Centroid?.y??1)*t-n/2+5,width:i,height:n,fill:"lightgray",stroke:"gray",strokeWidth:1,cornerRadius:2,draggable:!0}}return{x:0,y:0,width:this.Width*t,height:this.Length*t,fill:"red",draggable:!0}}}class n0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class uc{value;constructor(t){this.value=t}toXML(){return this.value}}class s0{attr_ref;attr_version;constructor({attr_ref:t,attr_version:i}){this.attr_ref=t,this.attr_version=i}toXML(){return{attr_ref:this.attr_ref,attr_version:this.attr_version}}}class _e{static xmlTagName="PassengerSpace";attr_id;attr_version;Name;SmokingAllowed;StandingAllowed;PassengerSpaceType;passengerSpots;luggageSpots;deckEntrances;deckEntranceUsage;deckEntranceCouples;deckSpaceCapacities;actualVehicleEquipments;ServiceFacilitySetRef;Centroid;Polygon;PublicUse;TotalCapacity;FareClass;AirConditioned;constructor({attr_id:t,attr_version:i,Name:n,SmokingAllowed:s,StandingAllowed:r,PassengerSpaceType:o,passengerSpots:a,luggageSpots:l,deckEntrances:h,deckEntranceUsage:c,deckEntranceCouples:d,deckSpaceCapacities:u,actualVehicleEquipments:f,ServiceFacilitySetRef:p,Centroid:_,Polygon:v,PublicUse:S,TotalCapacity:b,FareClass:x,AirConditioned:N}){this.attr_id=t,this.attr_version=i,this.Name=n,this.SmokingAllowed=s,this.StandingAllowed=r,this.PassengerSpaceType=o,this.passengerSpots=a?Object.entries(a).flatMap(([T,P])=>T==="PassengerSpot"?At(P,Yi):T==="PassengerSpotRef"?At(P,n0):[]):[],this.luggageSpots=l?Object.entries(l).flatMap(([T,P])=>T==="LuggageSpot"?At(P,e0):T==="LuggageSpotRef"?At(P,i0):[]):[],this.deckEntrances=At(h?.PassengerEntrance,lc),this.deckEntranceUsage=At(c?.DeckEntranceUsage,Jp),this.deckEntranceCouples=At(d?.DeckEntranceCouple,Yp),this.deckSpaceCapacities=At(u?.DeckSpaceCapacity,Qp),this.actualVehicleEquipments=At(f?.ActualVehicleEquipment,On),this.ServiceFacilitySetRef=p?new s0(p):void 0,this.Centroid=_?ii.fromXML(_):void 0,this.Polygon=v?new uc(v):void 0,this.PublicUse=S?.text_value,this.TotalCapacity=b?.text_value,this.FareClass=x?.text_value,this.AirConditioned=N?.text_value}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,Name:this.Name,SmokingAllowed:this.SmokingAllowed,StandingAllowed:this.StandingAllowed,PassengerSpaceType:this.PassengerSpaceType,passengerSpots:this.passengerSpots?Pe(this.passengerSpots):"",luggageSpots:this.luggageSpots?Pe(this.luggageSpots):void 0,deckEntrances:this.deckEntrances?Pe(this.deckEntrances):void 0,deckEntranceUsage:this.deckEntranceUsage?Pe(this.deckEntranceUsage):void 0,deckEntranceCouples:this.deckEntranceCouples?Pe(this.deckEntranceCouples):void 0,deckSpaceCapacities:this.deckSpaceCapacities?Pe(this.deckSpaceCapacities):void 0,actualVehicleEquipments:this.actualVehicleEquipments?Pe(this.actualVehicleEquipments):void 0,ServiceFacilitySetRef:this.ServiceFacilitySetRef?.toXML(),Centroid:this.Centroid?.toXML(),Polygon:this.Polygon?.toXML(),PublicUse:this.PublicUse,TotalCapacity:this.TotalCapacity,FareClass:this.FareClass,AirConditioned:this.AirConditioned}}}class r0{attr_id;attr_version;Name;polygon;deckspaces;DeckLevelRef;spotRows;spotColumns;Width;Length;constructor({attr_id:t,attr_version:i,deckSpaces:n,spotRows:s=void 0,spotColumns:r=void 0,DeckLevelRef:o=void 0,Name:a=void 0,polygon:l=void 0,Width:h=void 0,Length:c=void 0}){this.attr_id=t,this.attr_version=i,this.Name=a??"",this.polygon=l?new uc(l):void 0,this.DeckLevelRef=o?new Xp(o):void 0,this.Width=h??2.825,this.Length=c??26.4,this.deckspaces=n?Object.entries(n).flatMap(([d,u])=>d==="OtherDeckSpace"?At(u,zp):d==="PassengerSpace"?At(u,_e):[]):[],this.spotRows=At(s?.SpotRow,t0),this.spotColumns=At(r?.SpotColumn,Zp)}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,spotRows:{SpotRow:He(this.spotRows)},spotColumns:{SpotColumn:He(this.spotColumns)},deckSpaces:Pe(this.deckspaces),DeckLevelRef:this.DeckLevelRef?.toXML(),polygon:this.polygon?.toXML(),Name:this.Name,Width:this.Width,Length:this.Length}}getBoundingBox(){const t=this.Length,i=this.Width;return{width:t,height:i}}getShape(t){const{width:i,height:n}=this.getBoundingBox();return{x:5,y:5,width:i*t,height:n*t,fill:"white",stroke:"gray",strokeWidth:2,cornerRadius:5}}}class fc{attr_id;attr_version;deckLevels;decks;constructor({attr_id:t,attr_version:i,decks:n=void 0,deckLevels:s=void 0}){this.attr_id=t,this.attr_version=i,this.deckLevels=At(s?.DeckLevel,jp),this.decks=At(n?.Deck,r0)}toXML(){return{attr_id:this.attr_id,attr_version:this.attr_version,decks:{Deck:He(this.decks)},deckLevels:{DeckLevel:He(this.deckLevels)}}}}const o0=Te({__name:"DeckVisualization",props:{deck:{type:Object,required:!0},availability:{type:Object},scale:{type:Number,required:!0},selectedElements:{type:Array,default:()=>[]}},emits:["select","area-select"],setup(e,{emit:t}){const i=e,n=t,s=Xt(null),r=Xt(!1),o=Xt({x:0,y:0}),a=Xt([]),l=Xt(new Map),h=Ei(()=>i.deck.deckspaces?.flatMap(E=>E instanceof _e?E.passengerSpots?.filter(C=>C instanceof Yi)||[]:[]).map(E=>{const C=E;return C.availability=i.availability&&E.attr_id?An[i.availability[E.attr_id]??"Undefined"]:An.Undefined,C})||[]),c=Ei(()=>i.deck.deckspaces?.flatMap(E=>E instanceof _e?E.deckEntrances||[]:[])||[]),d=E=>i.selectedElements.includes(E)?{stroke:"#68a691",strokeWidth:3}:{},u=(E,C)=>{let O=0,H=0;const{width:K,height:z}=E.getBoundingBox();return O=Math.max(O,K),H=Math.max(H,z),{width:O*C+10,height:H*C+10}},f=(E,C)=>{r.value||(n("select",{element:C,ctrlKey:E.evt.ctrlKey||E.evt.metaKey}),E.cancelBubble=!0)},p=E=>{if(E.evt.ctrlKey||E.evt.metaKey||E.target===E.target.getStage()){r.value=!0;const O=E.target.getStage().getPointerPosition(),H=E.target.getAbsoluteTransform().copy();H.invert();const K=H.point(O);o.value={x:K.x,y:K.y},s.value={x:K.x,y:K.y,width:0,height:0,fill:"rgba(0, 255, 0, 0.3)",stroke:"#68a691",strokeWidth:1}}else n("area-select",[])},_=E=>{if(!r.value)return;const O=E.target.getStage().getPointerPosition(),H=E.target.getAbsoluteTransform().copy();H.invert();const K=H.point(O);s.value.width=K.x-o.value.x,s.value.height=K.y-o.value.y},v=()=>{if(!r.value)return;r.value=!1;const E=s.value;if(!E)return;const C=E.width>0?E.x:E.x+E.width,O=E.height>0?E.y:E.y+E.height,H=Math.abs(E.width),K=Math.abs(E.height),z=h.value.filter(Z=>{const J=Z.getShape(i.scale);return J.x<C+H&&J.x+J.width>C&&J.y<O+K&&J.y+J.height>O});z.length>0&&n("area-select",z),s.value=null},S=(E,C)=>{l.value.clear(),i.selectedElements.includes(C)&&i.selectedElements.forEach(O=>{if(O instanceof Yi){const H=O.getShape(i.scale);l.value.set(O,{x:H.x,y:H.y})}})},b=(E,C)=>{a.value=[];const O=E.target.getStage(),H=h.value.filter($=>$!==C&&!i.selectedElements.includes($)),K=E.target.x(),z=E.target.y(),Z=10;let J=K,A=z;H.forEach($=>{const D=$.getShape(i.scale);Math.abs(K-D.x)<Z&&(J=D.x,a.value.push({points:[D.x,0,D.x,O.height()],stroke:"red",strokeWidth:1,dash:[4,6]})),Math.abs(z-D.y)<Z&&(A=D.y,a.value.push({points:[0,D.y,O.width(),D.y],stroke:"red",strokeWidth:1,dash:[4,6]}))}),E.target.x(J),E.target.y(A);const L=l.value.get(C);if(L&&i.selectedElements.includes(C)){const $=J-L.x,D=A-L.y;i.selectedElements.forEach(nt=>{if(nt!==C&&nt instanceof Yi){const ht=l.value.get(nt);ht&&N(nt,ht.x+$,ht.y+D)}})}},x=(E,C)=>{a.value=[];const O=E.target.x(),H=E.target.y();N(C,O,H),l.value.clear()},N=(E,C,O)=>{E.Centroid?(E.Centroid.x=(C-5)/i.scale+E.Width/2,E.Centroid.y=(O-5)/i.scale+E.Length/2):E.Centroid=new ii((C-5)/i.scale+E.Width/2,(O-5)/i.scale+E.Length/2)},T=(E,C)=>{const O=E.target.x(),H=E.target.y(),K=i.deck.Width*i.scale,z=i.deck.Length*i.scale,Z=C.getShape(i.scale,i.deck.Length,i.deck.Width),J=Z.width,A=Z.height,L=5,$=5,D=L+z,nt=$+K,ht=O+J/2,ot=H+A/2,mt=Math.abs(ht-L),Pt=Math.abs(ht-D),tn=Math.abs(ot-$),sr=Math.abs(ot-nt),en=Math.min(mt,Pt,tn,sr);let le=O,be=H;en===tn?(be=$,le=Math.max(L,Math.min(O,D-J))):en===sr?(be=nt-A,le=Math.max(L,Math.min(O,D-J))):en===mt?(le=L,be=K/2+5-A/2):en===Pt&&(le=D-J,be=K/2+5-A/2),E.target.x(le),E.target.y(be),C.Centroid||(C.Centroid=new ii(0,0)),C.Centroid.x=le/i.scale,C.Centroid.y=be/i.scale},P=(E,C)=>{const O=E.target.x(),H=E.target.y(),K=i.deck.Width*i.scale,z=i.deck.Length*i.scale,Z=C.getShape(i.scale,i.deck.Length,i.deck.Width),J=Z.width,A=Z.height,L=5,$=5,D=L+z,nt=$+K,ht=1;Math.abs(H-$)<ht?(C.VehicleSide="leftSide",C.SequenceFromFront=(O-L+J/2)/i.scale):Math.abs(H-(nt-A))<ht?(C.VehicleSide="rightSide",C.SequenceFromFront=(O-L+J/2)/i.scale):Math.abs(O-L)<ht?(C.VehicleSide="front",C.SequenceFromFront=0):Math.abs(O-(D-J))<ht&&(C.VehicleSide="back",C.SequenceFromFront=i.deck.Length)};return(E,C)=>{const O=Bi("v-rect"),H=Bi("v-text"),K=Bi("v-group"),z=Bi("v-line"),Z=Bi("v-layer"),J=Bi("v-stage");return at(),Je(J,{config:u(e.deck,e.scale)},{default:mn(()=>[Tt(Z,null,{default:mn(()=>[Tt(O,{config:{...e.deck.getShape(e.scale),y:5,...d(e.deck)},onClick:C[0]||(C[0]=A=>f(A,e.deck))},null,8,["config"]),Tt(O,{config:{x:0,y:0,width:e.deck.getShape(e.scale).width,height:e.deck.getShape(e.scale).height,fill:"transparent",listening:!0},onMousedown:p,onMousemove:_,onMouseup:v},null,8,["config"]),(at(!0),yt(Dt,null,Fe(h.value,(A,L)=>(at(),Je(K,{key:`seats-${L}`,config:{x:A.getShape(e.scale).x,y:A.getShape(e.scale).y,draggable:!0},onDragstart:$=>S($,A),onDragend:$=>x($,A),onDragmove:$=>b($,A),onClick:$=>f($,A)},{default:mn(()=>[Tt(O,{config:{width:A.getShape(e.scale).width,height:A.getShape(e.scale).height,fill:A.getShape(e.scale).fill,stroke:A.getShape(e.scale).stroke,strokeWidth:A.getShape(e.scale).strokeWidth,cornerRadius:A.getShape(e.scale).cornerRadius,...d(A)}},null,8,["config"]),Tt(H,{config:{width:A.getShape(e.scale).width,height:A.getShape(e.scale).height,text:A.Label,align:"center",verticalAlign:"middle",fontSize:Math.min(Math.min(A.getShape(e.scale).width,A.getShape(e.scale).height)/2,16),listening:!1}},null,8,["config"])]),_:2},1032,["config","onDragstart","onDragend","onDragmove","onClick"]))),128)),(at(!0),yt(Dt,null,Fe(c.value,(A,L)=>(at(),Je(K,{key:`entrance-${L}`,config:{x:A.getShape(e.scale,e.deck.Length,e.deck.Width).x,y:A.getShape(e.scale,e.deck.Length,e.deck.Width).y,draggable:!0},onDragmove:$=>T($,A),onDragend:$=>P($,A),onClick:$=>f($,A)},{default:mn(()=>[Tt(O,{config:{width:A.getShape(e.scale,e.deck.Length,e.deck.Width).width,height:A.getShape(e.scale,e.deck.Length,e.deck.Width).height,fill:A.getShape(e.scale,e.deck.Length,e.deck.Width).fill,stroke:A.getShape(e.scale,e.deck.Length,e.deck.Width).stroke,strokeWidth:A.getShape(e.scale,e.deck.Length,e.deck.Width).strokeWidth,...d(A)}},null,8,["config"])]),_:2},1032,["config","onDragmove","onDragend","onClick"]))),128)),s.value?(at(),Je(O,{key:0,config:{...s.value,listening:!1}},null,8,["config"])):As("",!0),(at(!0),yt(Dt,null,Fe(a.value,(A,L)=>(at(),Je(z,{key:`guide-${L}`,config:A},null,8,["config"]))),128))]),_:1})]),_:1},8,["config"])}}}),a0={class:"flex flex-col h-full"},l0={class:"flex p-4 w-full items-center justify-center gap-10"},c0={for:"scale-slider"},h0={style:{display:"flex","flex-direction":"row","overflow-x":"auto",gap:"20px",padding:"20px"}},d0=["onClick"],u0=Te({__name:"WagonVisualization",props:{deckPlans:{type:Array,required:!1},selectedElements:{type:Array,default:()=>[]}},setup(e){const t=Xt(20);return(i,n)=>(at(),yt("div",a0,[ut("div",l0,[ut("label",c0,"Scale: "+Le(t.value),1),bs(ut("input",{id:"scale-slider",type:"range",min:"10",max:"50","onUpdate:modelValue":n[0]||(n[0]=s=>t.value=s)},null,512),[[Ds,t.value,void 0,{number:!0}]])]),ut("div",h0,[(at(!0),yt(Dt,null,Fe(e.deckPlans,(s,r)=>(at(),yt("div",{key:`deckplan-${r}`},[ut("h3",null,Le(s.attr_id),1),(at(!0),yt(Dt,null,Fe(s.decks,(o,a)=>(at(),yt("div",{key:`deck-${a}`},[ut("h4",{onClick:l=>i.$emit("select",{element:o,ctrlKey:!1}),class:we(`${e.selectedElements.includes(o)?"text-ott-accent":""} cursor-pointer`)},Le(o.Name),11,d0),Tt(o0,{deck:o,scale:t.value,selectedElements:e.selectedElements,onSelect:n[1]||(n[1]=l=>i.$emit("select",l)),onAreaSelect:n[2]||(n[2]=l=>i.$emit("area-select",l))},null,8,["deck","scale","selectedElements"])]))),128))]))),128))])]))}}),f0={class:"bg-ott-bg-primary p-4"},p0={class:"flex justify-between items-center mb-4"},g0={key:0},m0=["for"],_0=["id","onUpdate:modelValue","type"],y0=["id","onUpdate:modelValue"],b0={key:2},v0=["id","onUpdate:modelValue"],w0={key:3},S0={key:4},E0={key:1},x0=Te({__name:"ObjectProperties",props:{element:{type:Object,default:null}},emits:["delete"],setup(e){return(t,i)=>(at(),yt("div",f0,[ut("div",p0,[i[1]||(i[1]=ut("h3",{class:"font-bold"},"Properties",-1)),e.element?(at(),yt("button",{key:0,class:"ott-button border-ott-error! text-ott-error!",onClick:i[0]||(i[0]=n=>t.$emit("delete",e.element))}," Delete ")):As("",!0)]),e.element?(at(),yt("div",g0,[(at(!0),yt(Dt,null,Fe(e.element,(n,s)=>(at(),yt("div",{key:s,class:"flex items-center mb-10"},[ut("label",{for:s,class:"min-w-[150px] font-bold"},Le(s),9,m0),typeof n=="string"||typeof n=="number"?bs((at(),yt("input",{key:0,id:s,"onUpdate:modelValue":r=>e.element[s]=r,type:typeof n=="number"?"number":"text"},null,8,_0)),[[Pf,e.element[s]]]):typeof n=="boolean"?bs((at(),yt("input",{key:1,id:s,"onUpdate:modelValue":r=>e.element[s]=r,type:"checkbox"},null,8,y0)),[[Vl,e.element[s]]]):n&&typeof n=="object"&&n.value!==void 0?(at(),yt("span",b0,[bs(ut("input",{id:s,"onUpdate:modelValue":r=>n.value=r,type:"text"},null,8,v0),[[Ds,n.value]])])):n&&Array.isArray(n)?(at(),yt("span",w0,Le(n.length)+" elements ",1)):(at(),yt("span",S0,Le(n),1))]))),128))])):(at(),yt("div",E0,[...i[2]||(i[2]=[ut("p",null,"Select an element to view properties.",-1)])]))]))}}),C0=".object-properties[data-v-1987e529]{padding:20px;border-top:1px solid #ccc;background-color:#f9f9f9}.property-row[data-v-1987e529]{margin-bottom:10px;display:flex;align-items:center}.property-row label[data-v-1987e529]{width:150px;font-weight:700}.property-row input[data-v-1987e529]{flex:1;padding:5px}",pc=(e,t)=>{const i=e.__vccOpts||e;for(const[n,s]of t)i[n]=s;return i},N0=pc(x0,[["styles",[C0]],["__scopeId","data-v-1987e529"]]),T0={class:"flex flex-col gap-2 p-4 bg-white flex-1"},k0={class:"flex flex-col gap-2"},P0=Te({__name:"ElementCatalog",emits:["add-seat","add-door"],setup(e){return(t,i)=>(at(),yt("div",T0,[i[2]||(i[2]=ut("h3",{class:"font-bold mb-2"},"Catalog",-1)),ut("div",k0,[ut("button",{class:"ott-button w-fit text-left",onClick:i[0]||(i[0]=n=>t.$emit("add-seat"))}," + Add Seat "),ut("button",{class:"ott-button w-fit text-left",onClick:i[1]||(i[1]=n=>t.$emit("add-door"))}," + Add Door ")])]))}}),O0={class:"h-full overflow-y-auto bg-gray-100 p-4 font-mono text-sm"},A0=["id"],M0=Te({__name:"XmlViewer",props:{xml:{type:String,required:!0},selectedId:{type:String,default:null}},setup(e){const t=e,i=Ei(()=>t.xml.split(`
16
+ `)),n=Xt(null),s=o=>n.value?o>=n.value.start&&o<=n.value.end:!1,r=()=>{if(!t.selectedId){n.value=null;return}const o=i.value.findIndex(l=>l.includes(`id="${t.selectedId}"`));if(o===-1){n.value=null;return}const a=i.value[o];if(a){if(a.trim().endsWith("/>"))n.value={start:o,end:o};else{const l=a.match(/<(\w+)/);if(l){const h=l[1];let c=1,d=o;for(let u=o+1;u<i.value.length;u++){const f=i.value[u];if(f&&!f.match(new RegExp(`<${h}.*/>`))&&(f.match(new RegExp(`<${h}`))?c++:f.match(new RegExp(`</${h}>`))&&c--,c===0)){d=u;break}}n.value={start:o,end:d}}else n.value={start:o,end:o}}ps(()=>{document.getElementById(`line-${o}`)?.scrollIntoView({behavior:"smooth",block:"center"})})}};return wi(()=>[t.selectedId,t.xml],()=>{r()},{immediate:!0}),(o,a)=>(at(),yt("div",O0,[(at(!0),yt(Dt,null,Fe(i.value,(l,h)=>(at(),yt("div",{key:h,id:`line-${h}`,class:we({"bg-yellow-200":s(h)})},[ut("pre",null,Le(l),1)],10,A0))),128))]))}}),gc=e=>{const i=new ic({ignoreAttributes:!1,attributeNamePrefix:"attr_",textNodeName:"text_value",removeNSPrefix:!0}).parse(e);return At(i.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,fc)},R0={class:"flex flex-col h-full"},L0={class:"p-4 border-b border-b-ott-bg-dark flex gap-2 items-center bg-ott-bg-primary"},I0={class:"flex-1 flex overflow-hidden"},D0={class:"flex-1 overflow-hidden"},V0={class:"flex flex-row h-75 border-t border-ott-bg-dark"},F0=Te({__name:"DeckplanEditor",setup(e,{expose:t}){const i=Xt(null),n=Xt([]),s=Xt([]),r=Xt(null),o=Xt(!1),a=Xt(""),l=()=>{if(!o.value||!r.value)return;r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan=He(n.value);const P=new Yt({ignoreAttributes:!1,textNodeName:"text_value",attributeNamePrefix:"attr_",format:!0});a.value=P.build(r.value)},h=()=>{o.value=!o.value,o.value&&l()};wi(n,()=>{l()},{deep:!0});const c=({element:P,ctrlKey:E})=>{if(E){const C=s.value.indexOf(P);if(C>-1)s.value.splice(C,1);else{if(s.value.length>0&&s.value[0].constructor!==P.constructor)return;s.value.push(P)}}else s.value=[P]},d=P=>{s.value=P},u=P=>{const E=P.target;i.value=E.files?E.files[0]:null};function f(){if(i.value){const P=new FileReader;P.addEventListener("load",E=>{const C=E.target?.result;typeof C=="string"&&(n.value=gc(C),n.value=[...n.value])}),P.readAsText(i.value)}}function p(){if(i.value){r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan=He(n.value);const E=new Yt({ignoreAttributes:!1,textNodeName:"text_value",attributeNamePrefix:"attr_"}).build(r.value),C=new Blob([E],{type:"text/xml"}),O=document.createElement("a");O.href=URL.createObjectURL(C),O.download="Demo.xml",O.click()}}const _=()=>n.value.length>0&&n.value[0]?.decks.length&&n.value[0]?.decks?.length>0?n.value[0].decks[0]:null,v=()=>{const P=_();if(!P)return;const E=P.deckspaces?.find(O=>O instanceof _e);if(!E){console.warn("No PassengerSpace found to add seat to");return}const C=new Yi({attr_id:`seat_${Date.now()}`,attr_version:"1",Label:"",Orientation:"forwards",actualVehicleEquipments:[],SpotColumnRef:null,SpotRowRef:null,ByWindow:!1,ByAisle:!1,HasPower:!1,Centroid:{x:1,y:1},Width:.5,Length:.5});E.passengerSpots||(E.passengerSpots=[]),E.passengerSpots.push(C)},S=()=>{const P=_();if(!P)return;const E=P.deckspaces?.find(O=>O instanceof _e);if(!E){console.warn("No PassengerSpace found to add door to");return}const C=new lc({attr_id:`door_${Date.now()}`,attr_version:"1",Name:{text_value:"New Door"},Width:{text_value:1},VehicleSide:{text_value:"leftSide"},SequenceFromFront:{text_value:0},DeckEntranceType:{text_value:"external"},actualVehicleEquipments:{ActualVehicleEquipment:[]},Label:void 0,Height:void 0,PublicUse:void 0,HeightFromGround:void 0,IsEmergencyExit:void 0,HasDoor:void 0,IsAutomatic:void 0,Centroid:void 0});E.deckEntrances||(E.deckEntrances=[]),E.deckEntrances.push(C)},b=P=>{n.value.forEach(E=>{E.decks.forEach(C=>{C.deckspaces?.forEach(O=>{if(O instanceof _e){if(O.passengerSpots){const H=O.passengerSpots.indexOf(P);H>-1&&O.passengerSpots.splice(H,1)}if(O.deckEntrances){const H=O.deckEntrances.indexOf(P);H>-1&&O.deckEntrances.splice(H,1)}}})})}),s.value=[]};function x(){return r.value?(r.value.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan=He(n.value),new Yt({ignoreAttributes:!1,textNodeName:"text_value",attributeNamePrefix:"attr_",format:!0}).build(r.value)):null}function N(){return new _e({attr_id:`ps-${Date.now()}`,attr_version:"1",Name:void 0,SmokingAllowed:void 0,StandingAllowed:void 0,PassengerSpaceType:"seatingArea",passengerSpots:{PassengerSpot:[],PassengerSpotRef:[]},luggageSpots:{LuggageSpot:[],LuggageSpotRef:[]},deckEntrances:{PassengerEntrance:[]},deckEntranceUsage:{DeckEntranceUsage:[]},deckEntranceCouples:{DeckEntranceCouple:[]},deckSpaceCapacities:{DeckSpaceCapacity:[]},actualVehicleEquipments:{ActualVehicleEquipment:[]},ServiceFacilitySetRef:void 0,Centroid:void 0,Polygon:void 0,PublicUse:void 0,TotalCapacity:void 0,FareClass:void 0,AirConditioned:void 0})}function T(P){const C=new ic({ignoreAttributes:!1,attributeNamePrefix:"attr_",removeNSPrefix:!0,alwaysCreateTextNode:!1}).parse(P);r.value=C;const O=At(C.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,fc);O.forEach(H=>{H.decks.forEach(K=>{if(!K.deckspaces||K.deckspaces.length===0){K.deckspaces=[N()];return}const z=[];K.deckspaces.forEach(Z=>{Z instanceof _e?z.push(Z):(Z?.passengerSpots||Z?.PassengerSpaceType)&&z.push(new _e(Z))}),K.deckspaces=z})}),n.value=O}return t({exportXml:x,loadXml:T}),(P,E)=>(at(),yt("div",R0,[ut("div",L0,[ut("input",{ref:"inputRef",class:"ott-button",type:"file",multiple:"",onChange:u,accept:"text/xml"},null,544),ut("button",{onClick:f,class:"ott-button"},"Load"),ut("button",{onClick:p,class:"ott-button"},"Save"),ut("button",{onClick:h,class:we(["ott-button",{"bg-ott-accent text-white":o.value}])},"XML",2)]),ut("div",I0,[ut("div",D0,[n.value.length>0?(at(),Je(u0,{key:0,deckPlans:n.value,selectedElements:s.value,onSelect:c,onAreaSelect:d},null,8,["deckPlans","selectedElements"])):As("",!0)]),o.value?(at(),Je(M0,{key:0,xml:a.value,selectedId:s.value[0]?.attr_id,class:"w-1/3 border-l border-ott-bg-dark"},null,8,["xml","selectedId"])):As("",!0)]),ut("div",V0,[Tt(N0,{element:s.value.length===1?s.value[0]:null,class:"flex-1 overflow-y-auto",onDelete:b},null,8,["element"]),Tt(P0,{class:"w-50 border-l border-ott-bg-dark",onAddSeat:v,onAddDoor:S})])]))}}),G0=Math.PI/180;function $0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Ni=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},X={_global:Ni,version:"10.0.12",isBrowser:$0(),isUnminified:/param/.test((function(e){}).toString()),dblClickWindow:400,getAngle(e){return X.angleDeg?e*G0:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return X.DD.isDragging},isTransforming(){var e,t;return(t=(e=X.Transformer)===null||e===void 0?void 0:e.isTransforming())!==null&&t!==void 0?t:!1},isDragReady(){return!!X.DD.node},releaseCanvasOnDestroy:!0,document:Ni.document,_injectGlobal(e){typeof Ni.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Ni.Konva=e}},kt=e=>{X[e.prototype.getClassName()]=e};X._injectGlobal(X);const B0=`Konva.js unsupported environment.
17
17
 
18
18
  Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
19
19
 
@@ -26,15 +26,15 @@ or
26
26
 
27
27
  bash: npm install skia-canvas
28
28
  js: import "konva/skia-backend";
29
- `,oc=()=>{if(typeof document>"u")throw new Error(wp)};class ie{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new ie(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const i=this.m;return{x:i[0]*t.x+i[2]*t.y+i[4],y:i[1]*t.x+i[3]*t.y+i[5]}}translate(t,i){return this.m[4]+=this.m[0]*t+this.m[2]*i,this.m[5]+=this.m[1]*t+this.m[3]*i,this}scale(t,i){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=i,this.m[3]*=i,this}rotate(t){const i=Math.cos(t),n=Math.sin(t),s=this.m[0]*i+this.m[2]*n,r=this.m[1]*i+this.m[3]*n,o=this.m[0]*-n+this.m[2]*i,a=this.m[1]*-n+this.m[3]*i;return this.m[0]=s,this.m[1]=r,this.m[2]=o,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,i){const n=this.m[0]+this.m[2]*i,s=this.m[1]+this.m[3]*i,r=this.m[2]+this.m[0]*t,o=this.m[3]+this.m[1]*t;return this.m[0]=n,this.m[1]=s,this.m[2]=r,this.m[3]=o,this}multiply(t){const i=this.m[0]*t.m[0]+this.m[2]*t.m[1],n=this.m[1]*t.m[0]+this.m[3]*t.m[1],s=this.m[0]*t.m[2]+this.m[2]*t.m[3],r=this.m[1]*t.m[2]+this.m[3]*t.m[3],o=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],a=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=i,this.m[1]=n,this.m[2]=s,this.m[3]=r,this.m[4]=o,this.m[5]=a,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),i=this.m[3]*t,n=-this.m[1]*t,s=-this.m[2]*t,r=this.m[0]*t,o=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=i,this.m[1]=n,this.m[2]=s,this.m[3]=r,this.m[4]=o,this.m[5]=a,this}getMatrix(){return this.m}decompose(){const t=this.m[0],i=this.m[1],n=this.m[2],s=this.m[3],r=this.m[4],o=this.m[5],a=t*s-i*n,l={x:r,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||i!=0){const c=Math.sqrt(t*t+i*i);l.rotation=i>0?Math.acos(t/c):-Math.acos(t/c),l.scaleX=c,l.scaleY=a/c,l.skewX=(t*n+i*s)/a,l.skewY=0}else if(n!=0||s!=0){const c=Math.sqrt(n*n+s*s);l.rotation=Math.PI/2-(s>0?Math.acos(-n/c):-Math.acos(n/c)),l.scaleX=a/c,l.scaleY=c,l.skewX=0,l.skewY=(t*n+i*s)/a}return l.rotation=S._getRotation(l.rotation),l}}const Ep="[object Array]",xp="[object Number]",Cp="[object String]",Np="[object Boolean]",Tp=Math.PI/180,kp=180/Math.PI,An="#",Op="",Pp="0",Ap="Konva warning: ",ac="Konva error: ",Rp="rgb(",oo={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Mp=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let Gs=[],Rn=null;const Lp=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},S={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===Ep},_isNumber(e){return Object.prototype.toString.call(e)===xp&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===Cp},_isBoolean(e){return Object.prototype.toString.call(e)===Np},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;const t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Gs.push(e),Gs.length===1&&Lp(function(){const t=Gs;Gs=[],t.forEach(function(i){i()})})},createCanvasElement(){oc();const e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return oc(),document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){const i=S.createImageElement();i.onload=function(){t(i)},i.src=e},_rgbToHex(e,t,i){return((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},_hexToRgb(e){e=e.replace(An,Op);const t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=Pp+e;return An+e},isCanvasFarblingActive(){if(Rn!==null)return Rn;if(typeof document>"u")return Rn=!1,!1;const e=this.createCanvasElement();e.width=10,e.height=10;const t=e.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const i=t.getImageData(0,0,10,10).data;let n=!1;for(let s=0;s<100;s++)if(i[s*4]!==40||i[s*4+1]!==40||i[s*4+2]!==40||i[s*4+3]!==255){n=!0;break}return Rn=n,this.releaseCanvas(e),Rn},getHitColor(){const e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,i){return this.isCanvasFarblingActive()&&(e=Math.round(e/5)*5,t=Math.round(t/5)*5,i=Math.round(i/5)*5),An+this._rgbToHex(e,t,i)},getSnappedHexColor(e){const t=this._hexToRgb(e);return An+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(e){let t;return e in oo?(t=oo[e],{r:t[0],g:t[1],b:t[2]}):e[0]===An?this._hexToRgb(e.substring(1)):e.substr(0,4)===Rp?(t=Mp.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",S._namedColorToRBA(e)||S._hex3ColorToRGBA(e)||S._hex4ColorToRGBA(e)||S._hex6ColorToRGBA(e)||S._hex8ColorToRGBA(e)||S._rgbColorToRGBA(e)||S._rgbaColorToRGBA(e)||S._hslColorToRGBA(e)},_namedColorToRBA(e){const t=oo[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];const t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];const t=e.split(/ *, */).map((i,n)=>i.slice(-1)==="%"?n===3?parseInt(i)/100:parseInt(i)/100*255:Number(i));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]==="#"&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]==="#"&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...i]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),n=Number(i[0])/360,s=Number(i[1])/100,r=Number(i[2])/100;let o,a,l;if(s===0)return l=r*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};r<.5?o=r*(1+s):o=r+s-r*s;const c=2*r-o,h=[0,0,0];for(let d=0;d<3;d++)a=n+1/3*-(d-1),a<0&&a++,a>1&&a--,6*a<1?l=c+(o-c)*6*a:2*a<1?l=o:3*a<2?l=c+(o-c)*(2/3-a)*6:l=c,h[d]=l*255;return{r:Math.round(h[0]),g:Math.round(h[1]),b:Math.round(h[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)},cloneObject(e){const t={};for(const i in e)this._isPlainObject(e[i])?t[i]=this.cloneObject(e[i]):this._isArray(e[i])?t[i]=this.cloneArray(e[i]):t[i]=e[i];return t},cloneArray(e){return e.slice(0)},degToRad(e){return e*Tp},radToDeg(e){return e*kp},_degToRad(e){return S.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),S.degToRad(e)},_radToDeg(e){return S.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),S.radToDeg(e)},_getRotation(e){return X.angleDeg?S.radToDeg(e):e},_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)},throw(e){throw new Error(ac+e)},error(e){console.error(ac+e)},warn(e){X.showWarnings&&console.warn(Ap+e)},each(e,t){for(const i in e)t(i,e[i])},_inRange(e,t,i){return t<=e&&e<i},_getProjectionToSegment(e,t,i,n,s,r){let o,a,l;const c=(e-i)*(e-i)+(t-n)*(t-n);if(c==0)o=e,a=t,l=(s-i)*(s-i)+(r-n)*(r-n);else{const h=((s-e)*(i-e)+(r-t)*(n-t))/c;h<0?(o=e,a=t,l=(e-s)*(e-s)+(t-r)*(t-r)):h>1?(o=i,a=n,l=(i-s)*(i-s)+(n-r)*(n-r)):(o=e+h*(i-e),a=t+h*(n-t),l=(o-s)*(o-s)+(a-r)*(a-r))}return[o,a,l]},_getProjectionToLine(e,t,i){const n=S.cloneObject(e);let s=Number.MAX_VALUE;return t.forEach(function(r,o){if(!i&&o===t.length-1)return;const a=t[(o+1)%t.length],l=S._getProjectionToSegment(r.x,r.y,a.x,a.y,e.x,e.y),c=l[0],h=l[1],d=l[2];d<s&&(n.x=c,n.y=h,s=d)}),n},_prepareArrayForTween(e,t,i){const n=[],s=[];if(e.length>t.length){const o=t;t=e,e=o}for(let o=0;o<e.length;o+=2)n.push({x:e[o],y:e[o+1]});for(let o=0;o<t.length;o+=2)s.push({x:t[o],y:t[o+1]});const r=[];return s.forEach(function(o){const a=S._getProjectionToLine(o,n,i);r.push(a.x),r.push(a.y)}),r},_prepareToStringify(e){let t;e.visitedByCircularReferenceRemoval=!0;for(const i in e)if(e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"){if(t=Object.getOwnPropertyDescriptor(e,i),e[i].visitedByCircularReferenceRemoval||S._isElement(e[i]))if(t.configurable)delete e[i];else return null;else if(S._prepareToStringify(e[i])===null)if(t.configurable)delete e[i];else return null}return delete e.visitedByCircularReferenceRemoval,e},_assign(e,t){for(const i in t)e[i]=t[i];return e},_getFirstPointerId(e){return e.touches?e.changedTouches[0].identifier:e.pointerId||999},releaseCanvas(...e){X.releaseCanvasOnDestroy&&e.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(e,t,i,n){let s=t<0?t:0,r=i<0?i:0;t=Math.abs(t),i=Math.abs(i);let o=0,a=0,l=0,c=0;typeof n=="number"?o=a=l=c=Math.min(n,t/2,i/2):(o=Math.min(n[0]||0,t/2,i/2),a=Math.min(n[1]||0,t/2,i/2),c=Math.min(n[2]||0,t/2,i/2),l=Math.min(n[3]||0,t/2,i/2)),e.moveTo(s+o,r),e.lineTo(s+t-a,r),e.arc(s+t-a,r+a,a,Math.PI*3/2,0,!1),e.lineTo(s+t,r+i-c),e.arc(s+t-c,r+i-c,c,0,Math.PI/2,!1),e.lineTo(s+l,r+i),e.arc(s+l,r+i-l,l,Math.PI/2,Math.PI,!1),e.lineTo(s,r+o),e.arc(s+o,r+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,i,n,s){n=Math.abs(n);for(let r=0;r<i;r++){const o=t[(r-1+i)%i],a=t[r],l=t[(r+1)%i],c={x:a.x-o.x,y:a.y-o.y},h={x:l.x-a.x,y:l.y-a.y},d=Math.hypot(c.x,c.y),u=Math.hypot(h.x,h.y);let f;typeof s=="number"?f=s:f=r<s.length?s[r]:0,f=n*Math.cos(Math.PI/i)*Math.min(1,f/n*2);const _={x:c.x/d,y:c.y/d},b={x:h.x/u,y:h.y/u},w={x:a.x-_.x*f,y:a.y-_.y*f},y={x:a.x+b.x*f,y:a.y+b.y*f};r===0?e.moveTo(w.x,w.y):e.lineTo(w.x,w.y),e.arcTo(a.x,a.y,y.x,y.y,f)}}};function Ip(e){const t=[],i=e.length,n=S;for(let s=0;s<i;s++){let r=e[s];n._isNumber(r)?r=Math.round(r*1e3)/1e3:n._isString(r)||(r=r+""),t.push(r)}return t}const lc=",",Dp="(",Vp=")",Fp="([",Gp="])",Bp=";",$p="()",Hp="=",cc=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Wp=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],Up=100;let Bs=null;function hc(){if(Bs!==null)return Bs;try{const t=S.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(Bs=!1,!1)}catch{return Bs=!1,!1}}class $s{constructor(t){this.canvas=t,X.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,i){let n=this.traceArr,s=n.length,r="",o,a,l,c;for(o=0;o<s;o++)a=n[o],l=a.method,l?(c=a.args,r+=l,t?r+=$p:S._isArray(c[0])?r+=Fp+c.join(lc)+Gp:(i&&(c=c.map(h=>typeof h=="number"?Math.floor(h):h)),r+=Dp+c.join(lc)+Vp)):(r+=a.property,t||(r+=Hp+a.val)),r+=Bp;return r}clearTrace(){this.traceArr=[]}_trace(t){let i=this.traceArr,n;i.push(t),n=i.length,n>=Up&&i.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const i=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,i.getWidth()/i.pixelRatio,i.getHeight()/i.pixelRatio)}_applyLineCap(t){const i=t.attrs.lineCap;i&&this.setAttr("lineCap",i)}_applyOpacity(t){const i=t.getAbsoluteOpacity();i!==1&&this.setAttr("globalAlpha",i)}_applyLineJoin(t){const i=t.attrs.lineJoin;i&&this.setAttr("lineJoin",i)}_applyMiterLimit(t){const i=t.attrs.miterLimit;i!=null&&this.setAttr("miterLimit",i)}setAttr(t,i){this._context[t]=i}arc(t,i,n,s,r,o){this._context.arc(t,i,n,s,r,o)}arcTo(t,i,n,s,r){this._context.arcTo(t,i,n,s,r)}beginPath(){this._context.beginPath()}bezierCurveTo(t,i,n,s,r,o){this._context.bezierCurveTo(t,i,n,s,r,o)}clearRect(t,i,n,s){this._context.clearRect(t,i,n,s)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,i){const n=arguments;if(n.length===2)return this._context.createImageData(t,i);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,i,n,s){return this._context.createLinearGradient(t,i,n,s)}createPattern(t,i){return this._context.createPattern(t,i)}createRadialGradient(t,i,n,s,r,o){return this._context.createRadialGradient(t,i,n,s,r,o)}drawImage(t,i,n,s,r,o,a,l,c){const h=arguments,d=this._context;h.length===3?d.drawImage(t,i,n):h.length===5?d.drawImage(t,i,n,s,r):h.length===9&&d.drawImage(t,i,n,s,r,o,a,l,c)}ellipse(t,i,n,s,r,o,a,l){this._context.ellipse(t,i,n,s,r,o,a,l)}isPointInPath(t,i,n,s){return n?this._context.isPointInPath(n,t,i,s):this._context.isPointInPath(t,i,s)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,i,n,s){this._context.fillRect(t,i,n,s)}strokeRect(t,i,n,s){this._context.strokeRect(t,i,n,s)}fillText(t,i,n,s){s?this._context.fillText(t,i,n,s):this._context.fillText(t,i,n)}measureText(t){return this._context.measureText(t)}getImageData(t,i,n,s){return this._context.getImageData(t,i,n,s)}lineTo(t,i){this._context.lineTo(t,i)}moveTo(t,i){this._context.moveTo(t,i)}rect(t,i,n,s){this._context.rect(t,i,n,s)}roundRect(t,i,n,s,r){this._context.roundRect(t,i,n,s,r)}putImageData(t,i,n){this._context.putImageData(t,i,n)}quadraticCurveTo(t,i,n,s){this._context.quadraticCurveTo(t,i,n,s)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,i){this._context.scale(t,i)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,i,n,s,r,o){this._context.setTransform(t,i,n,s,r,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,i,n,s){this._context.strokeText(t,i,n,s)}transform(t,i,n,s,r,o){this._context.transform(t,i,n,s,r,o)}translate(t,i){this._context.translate(t,i)}_enableTrace(){let t=this,i=cc.length,n=this.setAttr,s,r;const o=function(a){let l=t[a],c;t[a]=function(){return r=Ip(Array.prototype.slice.call(arguments,0)),c=l.apply(t,arguments),t._trace({method:a,args:r}),c}};for(s=0;s<i;s++)o(cc[s]);t.setAttr=function(){n.apply(t,arguments);const a=arguments[0];let l=arguments[1];(a==="shadowOffsetX"||a==="shadowOffsetY"||a==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:a,val:l})}}_applyGlobalCompositeOperation(t){const i=t.attrs.globalCompositeOperation;!i||i==="source-over"||this.setAttr("globalCompositeOperation",i)}}Wp.forEach(function(e){Object.defineProperty($s.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class jp extends $s{constructor(t,{willReadFrequently:i=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:i})}_fillColor(t){const i=t.fill();this.setAttr("fillStyle",i),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){const i=t._getLinearGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fillRadialGradient(t){const i=t._getRadialGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fill(t){const i=t.fill(),n=t.getFillPriority();if(i&&n==="color"){this._fillColor(t);return}const s=t.getFillPatternImage();if(s&&n==="pattern"){this._fillPattern(t);return}const r=t.getFillLinearGradientColorStops();if(r&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}i?this._fillColor(t):s?this._fillPattern(t):r?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const i=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),s=t.getStrokeLinearGradientColorStops(),r=this.createLinearGradient(i.x,i.y,n.x,n.y);if(s){for(let o=0;o<s.length;o+=2)r.addColorStop(s[o],s[o+1]);this.setAttr("strokeStyle",r)}}_stroke(t){const i=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();const r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),i&&t.dashEnabled()&&(this.setLineDash(i),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var i,n,s;const r=(i=t.getShadowRGBA())!==null&&i!==void 0?i:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,a=(s=t.getShadowOffset())!==null&&s!==void 0?s:{x:0,y:0},l=t.getAbsoluteScale(),c=this.canvas.getPixelRatio(),h=l.x*c,d=l.y*c;this.setAttr("shadowColor",r),this.setAttr("shadowBlur",o*Math.min(Math.abs(h),Math.abs(d))),this.setAttr("shadowOffsetX",a.x*h),this.setAttr("shadowOffsetY",a.y*d)}}class Xp extends $s{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const i=t.getStrokeScaleEnabled();if(!i){this.save();const r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);const n=t.hitStrokeWidth(),s=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",s),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),i||this.restore()}}}let Hs;function zp(){if(Hs)return Hs;const e=S.createCanvasElement(),t=e.getContext("2d");return Hs=(function(){const i=X._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n})(),S.releaseCanvas(e),Hs}class ao{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const n=(t||{}).pixelRatio||X.pixelRatio||zp();this.pixelRatio=n,this._canvas=S.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){const i=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/i,this.getHeight()/i)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,i){this.setWidth(t||0),this.setHeight(i||0)}toDataURL(t,i){try{return this._canvas.toDataURL(t,i)}catch{try{return this._canvas.toDataURL()}catch(s){return S.error("Unable to get data URL. "+s.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class ii extends ao{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new jp(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class lo extends ao{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new Xp(this),this.setSize(t.width,t.height)}}const gt={get isDragging(){let e=!1;return gt._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){let e;return gt._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];gt._dragElements.forEach((i,n)=>{const{node:s}=i,r=s.getStage();r.setPointersPositions(e),i.pointerId===void 0&&(i.pointerId=S._getFirstPointerId(e));const o=r._changedPointerPositions.find(a=>a.id===i.pointerId);if(o){if(i.dragStatus!=="dragging"){const a=s.dragDistance();if(Math.max(Math.abs(o.x-i.startPointerPos.x),Math.abs(o.y-i.startPointerPos.y))<a||(s.startDrag({evt:e}),!s.isDragging()))return}s._setDragPosition(e,i),t.push(s)}}),t.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:e},!0)})},_endDragBefore(e){const t=[];gt._dragElements.forEach(i=>{const{node:n}=i,s=n.getStage();if(e&&s.setPointersPositions(e),!s._changedPointerPositions.find(a=>a.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(gt.justDragged=!0,X._mouseListenClick=!1,X._touchListenClick=!1,X._pointerListenClick=!1,i.dragStatus="stopped");const o=i.node.getLayer()||i.node instanceof X.Stage&&i.node;o&&t.indexOf(o)===-1&&t.push(o)}),t.forEach(i=>{i.draw()})},_endDragAfter(e){gt._dragElements.forEach((t,i)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&gt._dragElements.delete(i)})}};X.isBrowser&&(window.addEventListener("mouseup",gt._endDragBefore,!0),window.addEventListener("touchend",gt._endDragBefore,!0),window.addEventListener("touchcancel",gt._endDragBefore,!0),window.addEventListener("mousemove",gt._drag),window.addEventListener("touchmove",gt._drag),window.addEventListener("mouseup",gt._endDragAfter,!1),window.addEventListener("touchend",gt._endDragAfter,!1),window.addEventListener("touchcancel",gt._endDragAfter,!1));function ni(e){return S._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||S._isBoolean(e)?e:Object.prototype.toString.call(e)}function dc(e){return e>255?255:e<0?0:Math.round(e)}function $(){if(X.isUnminified)return function(e,t){return S._isNumber(e)||S.warn(ni(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function Ws(e){if(X.isUnminified)return function(t,i){let n=S._isNumber(t),s=S._isArray(t)&&t.length==e;return!n&&!s&&S.warn(ni(t)+' is a not valid value for "'+i+'" attribute. The value should be a number or Array<number>('+e+")"),t}}function co(){if(X.isUnminified)return function(e,t){return S._isNumber(e)||e==="auto"||S.warn(ni(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function Ti(){if(X.isUnminified)return function(e,t){return S._isString(e)||S.warn(ni(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function uc(){if(X.isUnminified)return function(e,t){const i=S._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return i||n||S.warn(ni(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function Yp(){if(X.isUnminified)return function(e,t){const i=Int8Array?Object.getPrototypeOf(Int8Array):null;return i&&e instanceof i||(S._isArray(e)?e.forEach(function(n){S._isNumber(n)||S.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):S.warn(ni(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function _e(){if(X.isUnminified)return function(e,t){return e===!0||e===!1||S.warn(ni(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function qp(e){if(X.isUnminified)return function(t,i){return t==null||S.isObject(t)||S.warn(ni(t)+' is a not valid value for "'+i+'" attribute. The value should be an object with properties '+e),t}}const Mn="get",Ln="set",m={addGetterSetter(e,t,i,n,s){m.addGetter(e,t,i),m.addSetter(e,t,n,s),m.addOverloadedGetterSetter(e,t)},addGetter(e,t,i){const n=Mn+S._capitalize(t);e.prototype[n]=e.prototype[n]||function(){const s=this.attrs[t];return s===void 0?i:s}},addSetter(e,t,i,n){const s=Ln+S._capitalize(t);e.prototype[s]||m.overWriteSetter(e,t,i,n)},overWriteSetter(e,t,i,n){const s=Ln+S._capitalize(t);e.prototype[s]=function(r){return i&&r!==void 0&&r!==null&&(r=i.call(this,r,t)),this._setAttr(t,r),n&&n.call(this),this}},addComponentsGetterSetter(e,t,i,n,s){const r=i.length,o=S._capitalize,a=Mn+o(t),l=Ln+o(t);e.prototype[a]=function(){const h={};for(let d=0;d<r;d++){const u=i[d];h[u]=this.getAttr(t+o(u))}return h};const c=qp(i);e.prototype[l]=function(h){const d=this.attrs[t];n&&(h=n.call(this,h,t)),c&&c.call(this,h,t);for(const u in h)h.hasOwnProperty(u)&&this._setAttr(t+o(u),h[u]);return h||i.forEach(u=>{this._setAttr(t+o(u),void 0)}),this._fireChangeEvent(t,d,h),s&&s.call(this),this},m.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){const i=S._capitalize(t),n=Ln+i,s=Mn+i;e.prototype[t]=function(){return arguments.length?(this[n](arguments[0]),this):this[s]()}},addDeprecatedGetterSetter(e,t,i,n){S.error("Adding deprecated "+t);const s=Mn+S._capitalize(t),r=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[s]=function(){S.error(r);const o=this.attrs[t];return o===void 0?i:o},m.addSetter(e,t,n,function(){S.error(r)}),m.addOverloadedGetterSetter(e,t)},backCompat(e,t){S.each(t,function(i,n){const s=e.prototype[n],r=Mn+S._capitalize(i),o=Ln+S._capitalize(i);function a(){s.apply(this,arguments),S.error('"'+i+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[i]=a,e.prototype[r]=a,e.prototype[o]=a})},afterSetFilter(){this._filterUpToDate=!1}};function Kp(e){const t=/(\w+)\(([^)]+)\)/g;let i;for(;(i=t.exec(e))!==null;){const[,n,s]=i;switch(n){case"blur":{const r=parseFloat(s.replace("px",""));return function(o){this.blurRadius(r*.5);const a=X.Filters;a&&a.Blur&&a.Blur.call(this,o)}}case"brightness":{const r=s.includes("%")?parseFloat(s)/100:parseFloat(s);return function(o){this.brightness(r);const a=X.Filters;a&&a.Brightness&&a.Brightness.call(this,o)}}case"contrast":{const r=parseFloat(s);return function(o){const a=100*(Math.sqrt(r)-1);this.contrast(a);const l=X.Filters;l&&l.Contrast&&l.Contrast.call(this,o)}}case"grayscale":return function(r){const o=X.Filters;o&&o.Grayscale&&o.Grayscale.call(this,r)};case"sepia":return function(r){const o=X.Filters;o&&o.Sepia&&o.Sepia.call(this,r)};case"invert":return function(r){const o=X.Filters;o&&o.Invert&&o.Invert.call(this,r)};default:S.warn(`CSS filter "${n}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const Us="absoluteOpacity",js="allEventListeners",We="absoluteTransform",fc="absoluteScale",ki="canvas",Jp="Change",Qp="children",Zp="konva",ho="listening",tg="mouseenter",eg="mouseleave",ig="pointerenter",ng="pointerleave",sg="touchenter",rg="touchleave",pc="set",gc="Shape",Xs=" ",mc="stage",si="transform",og="Stage",uo="visible",ag=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Xs);let lg=1;class G{constructor(t){this._id=lg++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===si||t===We)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,i){let n=this._cache.get(t);return(n===void 0||(t===si||t===We)&&n.dirty===!0)&&(n=i.call(this),this._cache.set(t,n)),n}_calculate(t,i,n){if(!this._attachedDepsListeners.get(t)){const s=i.map(r=>r+"Change.konva").join(Xs);this.on(s,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(ki)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===We&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ki)){const{scene:t,filter:i,hit:n,buffer:s}=this._cache.get(ki);S.releaseCanvas(t,i,n,s),this._cache.delete(ki)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const i=t||{};let n={};(i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let s=Math.ceil(i.width||n.width),r=Math.ceil(i.height||n.height),o=i.pixelRatio,a=i.x===void 0?Math.floor(n.x):i.x,l=i.y===void 0?Math.floor(n.y):i.y,c=i.offset||0,h=i.drawBorder||!1,d=i.hitCanvasPixelRatio||1;if(!s||!r){S.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const u=Math.abs(Math.round(n.x)-a)>.5?1:0,f=Math.abs(Math.round(n.y)-l)>.5?1:0;s+=c*2+u,r+=c*2+f,a-=c,l-=c;const p=new ii({pixelRatio:o,width:s,height:r}),_=new ii({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),b=new lo({pixelRatio:d,width:s,height:r}),w=p.getContext(),y=b.getContext(),x=new ii({width:p.width/p.pixelRatio+Math.abs(a),height:p.height/p.pixelRatio+Math.abs(l),pixelRatio:p.pixelRatio}),N=x.getContext();return b.isCache=!0,p.isCache=!0,this._cache.delete(ki),this._filterUpToDate=!1,i.imageSmoothingEnabled===!1&&(p.getContext()._context.imageSmoothingEnabled=!1,_.getContext()._context.imageSmoothingEnabled=!1),w.save(),y.save(),N.save(),w.translate(-a,-l),y.translate(-a,-l),N.translate(-a,-l),x.x=a,x.y=l,this._isUnderCache=!0,this._clearSelfAndDescendantCache(Us),this._clearSelfAndDescendantCache(fc),this.drawScene(p,this,x),this.drawHit(b,this),this._isUnderCache=!1,w.restore(),y.restore(),h&&(w.save(),w.beginPath(),w.rect(0,0,s,r),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(ki,{scene:p,filter:_,hit:b,buffer:x,x:a,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ki)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,i){const n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let s=1/0,r=1/0,o=-1/0,a=-1/0;const l=this.getAbsoluteTransform(i);return n.forEach(function(c){const h=l.point(c);s===void 0&&(s=o=h.x,r=a=h.y),s=Math.min(s,h.x),r=Math.min(r,h.y),o=Math.max(o,h.x),a=Math.max(a,h.y)}),{x:s,y:r,width:o-s,height:a-r}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const i=this._getCanvasCache();t.translate(i.x,i.y);const n=this._getCachedSceneCanvas(),s=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/s,n.height/s),t.restore()}_drawCachedHitCanvas(t){const i=this._getCanvasCache(),n=i.hit;t.save(),t.translate(i.x,i.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),i=this._getCanvasCache(),n=i.scene,s=i.filter,r=s.getContext(),o,a,l,c;if(!t||t.length===0)return n;if(this._filterUpToDate)return s;let h=!0;for(let u=0;u<t.length;u++)if(typeof t[u]=="string"&&hc(),typeof t[u]!="string"||!hc()){h=!1;break}const d=n.pixelRatio;if(s.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio),h){const u=t.join(" ");return r.save(),r.setAttr("filter",u),r.drawImage(n._canvas,0,0,n.getWidth()/d,n.getHeight()/d),r.restore(),this._filterUpToDate=!0,s}try{for(o=t.length,r.clear(),r.drawImage(n._canvas,0,0,n.getWidth()/d,n.getHeight()/d),a=r.getImageData(0,0,s.getWidth(),s.getHeight()),l=0;l<o;l++)c=t[l],typeof c=="string"&&(c=Kp(c)),c.call(this,a),r.putImageData(a,0,0)}catch(u){S.error("Unable to apply filter. "+u.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,s}on(t,i){if(this._cache&&this._cache.delete(js),arguments.length===3)return this._delegate.apply(this,arguments);const n=t.split(Xs);for(let s=0;s<n.length;s++){const o=n[s].split("."),a=o[0],l=o[1]||"";this.eventListeners[a]||(this.eventListeners[a]=[]),this.eventListeners[a].push({name:l,handler:i})}return this}off(t,i){let n=(t||"").split(Xs),s=n.length,r,o,a,l,c,h;if(this._cache&&this._cache.delete(js),!t)for(o in this.eventListeners)this._off(o);for(r=0;r<s;r++)if(a=n[r],l=a.split("."),c=l[0],h=l[1],c)this.eventListeners[c]&&this._off(c,h,i);else for(o in this.eventListeners)this._off(o,h,i);return this}dispatchEvent(t){const i={target:this,type:t.type,evt:t};return this.fire(t.type,i),this}addEventListener(t,i){return this.on(t,function(n){i.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,i,n){const s=this;this.on(t,function(r){const o=r.target.findAncestors(i,!0,s);for(let a=0;a<o.length;a++)r=S.cloneObject(r),r.currentTarget=o[a],n.call(o[a],r)})}remove(){return this.isDragging()&&this.stopDrag(),gt._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(We),this._clearSelfAndDescendantCache(Us),this._clearSelfAndDescendantCache(fc),this._clearSelfAndDescendantCache(mc),this._clearSelfAndDescendantCache(uo),this._clearSelfAndDescendantCache(ho)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const i="get"+S._capitalize(t);return S._isFunction(this[i])?this[i]():this.attrs[t]}getAncestors(){let t=this.getParent(),i=[];for(;t;)i.push(t),t=t.getParent();return i}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let i,n;if(!t)return this;for(i in t)i!==Qp&&(n=pc+S._capitalize(i),S._isFunction(this[n])?this[n](t[i]):this._setAttr(i,t[i]))}),this}isListening(){return this._getCache(ho,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(uo,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,i=!1){if(t)return this._isVisible(t)&&this._isListening(t);const n=this.getLayer();let s=!1;gt._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(s=!0)});const r=!i&&!X.hitOnDragEnabled&&(s||X.isTransforming());return this.isListening()&&this.isVisible()&&!r}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),i=this,n=0,s,r,o,a;function l(h){for(s=[],r=h.length,o=0;o<r;o++)a=h[o],n++,a.nodeType!==gc&&(s=s.concat(a.getChildren().slice())),a._id===i._id&&(o=r);s.length>0&&s[0].getDepth()<=t&&l(s)}const c=this.getStage();return i.nodeType!==og&&c&&l(c.getChildren()),n}getDepth(){let t=0,i=this.parent;for(;i;)t++,i=i.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(si),this._clearSelfAndDescendantCache(We)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const i=t.getPointerPosition();if(!i)return null;const n=this.getAbsoluteTransform().copy();return n.invert(),n.point(i)}getAbsolutePosition(t){let i=!1,n=this.parent;for(;n;){if(n.isCached()){i=!0;break}n=n.parent}i&&!t&&(t=!0);const s=this.getAbsoluteTransform(t).getMatrix(),r=new ie,o=this.offset();return r.m=s.slice(),r.translate(o.x,o.y),r.getTranslation()}setAbsolutePosition(t){const{x:i,y:n,...s}=this._clearTransform();this.attrs.x=i,this.attrs.y=n,this._clearCache(si);const r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(s),this.setPosition({x:t.x,y:t.y}),this._clearCache(si),this._clearSelfAndDescendantCache(We),this}_setTransform(t){let i;for(i in t)this.attrs[i]=t[i]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let i=t.x,n=t.y,s=this.x(),r=this.y();return i!==void 0&&(s+=i),n!==void 0&&(r+=n),this.setPosition({x:s,y:r}),this}_eachAncestorReverse(t,i){let n=[],s=this.getParent(),r,o;if(!(i&&i._id===this._id)){for(n.unshift(this);s&&(!i||s._id!==i._id);)n.unshift(s),s=s.parent;for(r=n.length,o=0;o<r;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return S.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return S.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return S.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return S.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return S.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&S.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const i=this.index;return this.parent.children.splice(i,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Us,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const i=this.getParent();return i&&!i._isUnderCache&&(t*=i.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),i,n,s,r,o;const a={attrs:{},className:this.getClassName()};for(i in t)n=t[i],o=S.isObject(n)&&!S._isPlainObject(n)&&!S._isArray(n),!o&&(s=typeof this[i]=="function"&&this[i],delete t[i],r=s?s.call(this):null,t[i]=n,r!==n&&(a.attrs[i]=n));return S._prepareToStringify(a)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,i,n){const s=[];i&&this._isMatch(t)&&s.push(this);let r=this.parent;for(;r;){if(r===n)return s;r._isMatch(t)&&s.push(r),r=r.parent}return s}isAncestorOf(t){return!1}findAncestor(t,i,n){return this.findAncestors(t,i,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let i=t.replace(/ /g,"").split(","),n=i.length,s,r;for(s=0;s<n;s++)if(r=i[s],S.isValidSelector(r)||(S.warn('Selector "'+r+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),S.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),S.warn("Konva is awesome, right?")),r.charAt(0)==="#"){if(this.id()===r.slice(1))return!0}else if(r.charAt(0)==="."){if(this.hasName(r.slice(1)))return!0}else if(this.className===r||this.nodeType===r)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(mc,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,i={},n){return i.target=i.target||this,n?this._fireAndBubble(t,i):this._fire(t,i),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(We,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let i;if(t)return i=new ie,this._eachAncestorReverse(function(n){const s=n.transformsEnabled();s==="all"?i.multiply(n.getTransform()):s==="position"&&i.translate(n.x()-n.offsetX(),n.y()-n.offsetY())},t),i;{i=this._cache.get(We)||new ie,this.parent?this.parent.getAbsoluteTransform().copyInto(i):i.reset();const n=this.transformsEnabled();if(n==="all")i.multiply(this.getTransform());else if(n==="position"){const s=this.attrs.x||0,r=this.attrs.y||0,o=this.attrs.offsetX||0,a=this.attrs.offsetY||0;i.translate(s-o,r-a)}return i.dirty=!1,i}}getAbsoluteScale(t){let i=this;for(;i;)i._isUnderCache&&(t=i),i=i.getParent();const s=this.getAbsoluteTransform(t).decompose();return{x:s.scaleX,y:s.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(si,this._getTransform)}_getTransform(){var t,i;const n=this._cache.get(si)||new ie;n.reset();const s=this.x(),r=this.y(),o=X.getAngle(this.rotation()),a=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(i=this.attrs.scaleY)!==null&&i!==void 0?i:1,c=this.attrs.skewX||0,h=this.attrs.skewY||0,d=this.attrs.offsetX||0,u=this.attrs.offsetY||0;return(s!==0||r!==0)&&n.translate(s,r),o!==0&&n.rotate(o),(c!==0||h!==0)&&n.skew(c,h),(a!==1||l!==1)&&n.scale(a,l),(d!==0||u!==0)&&n.translate(-1*d,-1*u),n.dirty=!1,n}clone(t){let i=S.cloneObject(this.attrs),n,s,r,o,a;for(n in t)i[n]=t[n];const l=new this.constructor(i);for(n in this.eventListeners)for(s=this.eventListeners[n],r=s.length,o=0;o<r;o++)a=s[o],a.name.indexOf(Zp)<0&&(l.eventListeners[n]||(l.eventListeners[n]=[]),l.eventListeners[n].push(a));return l}_toKonvaCanvas(t){t=t||{};const i=this.getClientRect(),n=this.getStage(),s=t.x!==void 0?t.x:Math.floor(i.x),r=t.y!==void 0?t.y:Math.floor(i.y),o=t.pixelRatio||1,a=new ii({width:t.width||Math.ceil(i.width)||(n?n.width():0),height:t.height||Math.ceil(i.height)||(n?n.height():0),pixelRatio:o}),l=a.getContext(),c=new ii({width:a.width/a.pixelRatio+Math.abs(s),height:a.height/a.pixelRatio+Math.abs(r),pixelRatio:a.pixelRatio});return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(s||r)&&l.translate(-1*s,-1*r),this.drawScene(a,void 0,c),l.restore(),a}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const i=t.mimeType||null,n=t.quality||null,s=this._toKonvaCanvas(t).toDataURL(i,n);return t.callback&&t.callback(s),s}toImage(t){return new Promise((i,n)=>{try{const s=t?.callback;s&&delete t.callback,S._urlToImage(this.toDataURL(t),function(r){i(r),s?.(r)})}catch(s){n(s)}})}toBlob(t){return new Promise((i,n)=>{try{const s=t?.callback;s&&delete t.callback,this.toCanvas(t).toBlob(r=>{i(r),s?.(r)},t?.mimeType,t?.quality)}catch(s){n(s)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():X.dragDistance}_off(t,i,n){let s=this.eventListeners[t],r,o,a;for(r=0;r<s.length;r++)if(o=s[r].name,a=s[r].handler,(o!=="konva"||i==="konva")&&(!i||o===i)&&(!n||n===a)){if(s.splice(r,1),s.length===0){delete this.eventListeners[t];break}r--}}_fireChangeEvent(t,i,n){this._fire(t+Jp,{oldVal:i,newVal:n})}addName(t){if(!this.hasName(t)){const i=this.name(),n=i?i+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const i=this.name();return i?(i||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const i=(this.name()||"").split(/\s/g),n=i.indexOf(t);return n!==-1&&(i.splice(n,1),this.name(i.join(" "))),this}setAttr(t,i){const n=this[pc+S._capitalize(t)];return S._isFunction(n)?n.call(this,i):this._setAttr(t,i),this}_requestDraw(){if(X.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,i){const n=this.attrs[t];n===i&&!S.isObject(i)||(i==null?delete this.attrs[t]:this.attrs[t]=i,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,i),this._requestDraw())}_setComponentAttr(t,i,n){let s;n!==void 0&&(s=this.attrs[t],s||(this.attrs[t]=this.getAttr(t)),this.attrs[t][i]=n,this._fireChangeEvent(t,s,n))}_fireAndBubble(t,i,n){i&&this.nodeType===gc&&(i.target=this);const s=[tg,eg,ig,ng,sg,rg];if(!(s.indexOf(t)!==-1&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n))){this._fire(t,i);const o=s.indexOf(t)!==-1&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(i&&!i.cancelBubble||!i)&&this.parent&&this.parent.isListening()&&!o&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,i,n):this._fireAndBubble.call(this.parent,t,i))}}_getProtoListeners(t){var i,n,s;const r=(i=this._cache.get(js))!==null&&i!==void 0?i:{};let o=r?.[t];if(o===void 0){o=[];let a=Object.getPrototypeOf(this);for(;a;){const l=(s=(n=a.eventListeners)===null||n===void 0?void 0:n[t])!==null&&s!==void 0?s:[];o.push(...l),a=Object.getPrototypeOf(a)}r[t]=o,this._cache.set(js,r)}return o}_fire(t,i){i=i||{},i.currentTarget=this,i.type=t;const n=this._getProtoListeners(t);if(n)for(let r=0;r<n.length;r++)n[r].handler.call(this,i);const s=this.eventListeners[t];if(s)for(let r=0;r<s.length;r++)s[r].handler.call(this,i)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const i=t?t.pointerId:void 0,n=this.getStage(),s=this.getAbsolutePosition();if(!n)return;const r=n._getPointerById(i)||n._changedPointerPositions[0]||s;gt._dragElements.set(this._id,{node:this,startPointerPos:r,offset:{x:r.x-s.x,y:r.y-s.y},dragStatus:"ready",pointerId:i})}startDrag(t,i=!0){gt._dragElements.has(this._id)||this._createDragElement(t);const n=gt._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},i)}_setDragPosition(t,i){const n=this.getStage()._getPointerById(i.pointerId);if(!n)return;let s={x:n.x-i.offset.x,y:n.y-i.offset.y};const r=this.dragBoundFunc();if(r!==void 0){const o=r.call(this,s,t);o?s=o:S.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==s.x||this._lastPos.y!==s.y)&&(this.setAbsolutePosition(s),this._requestDraw()),this._lastPos=s}stopDrag(t){const i=gt._dragElements.get(this._id);i&&(i.dragStatus="stopped"),gt._endDragBefore(t),gt._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=gt._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(t.evt.button!==void 0)||X.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let s=!1;gt._dragElements.forEach(r=>{this.isAncestorOf(r.node)&&(s=!0)}),s||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const i=gt._dragElements.get(this._id),n=i&&i.dragStatus==="dragging",s=i&&i.dragStatus==="ready";n?this.stopDrag():s&&gt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const i=this.getStage();if(!i)return!1;const n={x:-t.x,y:-t.y,width:i.width()+2*t.x,height:i.height()+2*t.y};return S.haveIntersection(n,this.getClientRect())}static create(t,i){return S._isString(t)&&(t=JSON.parse(t)),this._createNode(t,i)}static _createNode(t,i){let n=G.prototype.getClassName.call(t),s=t.children,r,o,a;i&&(t.attrs.container=i),X[n]||(S.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const l=X[n];if(r=new l(t.attrs),s)for(o=s.length,a=0;a<o;a++)r.add(G._createNode(s[a]));return r}}G.prototype.nodeType="Node",G.prototype._attrsAffectingSize=[],G.prototype.eventListeners={},G.prototype.on.call(G.prototype,ag,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(si),this._clearSelfAndDescendantCache(We)}),G.prototype.on.call(G.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(uo)}),G.prototype.on.call(G.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(ho)}),G.prototype.on.call(G.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Us)});const yt=m.addGetterSetter;yt(G,"zIndex"),yt(G,"absolutePosition"),yt(G,"position"),yt(G,"x",0,$()),yt(G,"y",0,$()),yt(G,"globalCompositeOperation","source-over",Ti()),yt(G,"opacity",1,$()),yt(G,"name","",Ti()),yt(G,"id","",Ti()),yt(G,"rotation",0,$()),m.addComponentsGetterSetter(G,"scale",["x","y"]),yt(G,"scaleX",1,$()),yt(G,"scaleY",1,$()),m.addComponentsGetterSetter(G,"skew",["x","y"]),yt(G,"skewX",0,$()),yt(G,"skewY",0,$()),m.addComponentsGetterSetter(G,"offset",["x","y"]),yt(G,"offsetX",0,$()),yt(G,"offsetY",0,$()),yt(G,"dragDistance",void 0,$()),yt(G,"width",0,$()),yt(G,"height",0,$()),yt(G,"listening",!0,_e()),yt(G,"preventDefault",!0,_e()),yt(G,"filters",void 0,function(e){return this._filterUpToDate=!1,e}),yt(G,"visible",!0,_e()),yt(G,"transformsEnabled","all",Ti()),yt(G,"size"),yt(G,"dragBoundFunc"),yt(G,"draggable",!1,_e()),m.backCompat(G,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class ne extends G{constructor(){super(...arguments),this.children=[]}getChildren(t){const i=this.children||[];return t?i.filter(t):i}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let n=0;n<t.length;n++)this.add(t[n]);return this}const i=t[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){const i=this._generalFind(t,!0);return i.length>0?i[0]:void 0}_generalFind(t,i){const n=[];return this._descendants(s=>{const r=s._isMatch(t);return r&&n.push(s),!!(r&&i)}),n}_descendants(t){let i=!1;const n=this.getChildren();for(const s of n){if(i=t(s),i)return!0;if(s.hasChildren()&&(i=s._descendants(t),i))return!0}return!1}toObject(){const t=G.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(i=>{t.children.push(i.toObject())}),t}isAncestorOf(t){let i=t.getParent();for(;i;){if(i._id===this._id)return!0;i=i.getParent()}return!1}clone(t){const i=G.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){i.add(n.clone())}),i}getAllIntersections(t){const i=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&i.push(n)}),i}_clearSelfAndDescendantCache(t){var i;super._clearSelfAndDescendantCache(t),!this.isCached()&&((i=this.children)===null||i===void 0||i.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(i,n){i.index=n}),this._requestDraw()}drawScene(t,i,n){const s=this.getLayer(),r=t||s&&s.getCanvas(),o=r&&r.getContext(),a=this._getCanvasCache(),l=a&&a.scene,c=r&&r.isCache;if(!this.isVisible()&&!c)return this;if(l){o.save();const h=this.getAbsoluteTransform(i).getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,i,n);return this}drawHit(t,i){if(!this.shouldDrawHit(i))return this;const n=this.getLayer(),s=t||n&&n.hitCanvas,r=s&&s.getContext(),o=this._getCanvasCache();if(o&&o.hit){r.save();const l=this.getAbsoluteTransform(i).getMatrix();r.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(r),r.restore()}else this._drawChildren("drawHit",s,i);return this}_drawChildren(t,i,n,s){var r;const o=i&&i.getContext(),a=this.clipWidth(),l=this.clipHeight(),c=this.clipFunc(),h=typeof a=="number"&&typeof l=="number"||c,d=n===this;if(h){o.save();const f=this.getAbsoluteTransform(n);let p=f.getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath();let _;if(c)_=c.call(this,o,this);else{const b=this.clipX(),w=this.clipY();o.rect(b||0,w||0,a,l)}o.clip.apply(o,_),p=f.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}const u=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";u&&(o.save(),o._applyGlobalCompositeOperation(this)),(r=this.children)===null||r===void 0||r.forEach(function(f){f[t](i,n,s)}),u&&o.restore(),h&&o.restore()}getClientRect(t={}){var i;const n=t.skipTransform,s=t.relativeTo;let r,o,a,l,c={x:1/0,y:1/0,width:0,height:0};const h=this;(i=this.children)===null||i===void 0||i.forEach(function(f){if(!f.visible())return;const p=f.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});p.width===0&&p.height===0||(r===void 0?(r=p.x,o=p.y,a=p.x+p.width,l=p.y+p.height):(r=Math.min(r,p.x),o=Math.min(o,p.y),a=Math.max(a,p.x+p.width),l=Math.max(l,p.y+p.height)))});const d=this.find("Shape");let u=!1;for(let f=0;f<d.length;f++)if(d[f]._isVisible(this)){u=!0;break}return u&&r!==void 0?c={x:r,y:o,width:a-r,height:l-o}:c={x:0,y:0,width:0,height:0},n?c:this._transformedRect(c,s)}}m.addComponentsGetterSetter(ne,"clip",["x","y","width","height"]),m.addGetterSetter(ne,"clipX",void 0,$()),m.addGetterSetter(ne,"clipY",void 0,$()),m.addGetterSetter(ne,"clipWidth",void 0,$()),m.addGetterSetter(ne,"clipHeight",void 0,$()),m.addGetterSetter(ne,"clipFunc");const In=new Map,_c=X._global.PointerEvent!==void 0;function fo(e){return In.get(e)}function po(e){return{evt:e,pointerId:e.pointerId}}function vc(e,t){return In.get(e)===t}function bc(e,t){Dn(e),t.getStage()&&(In.set(e,t),_c&&t._fire("gotpointercapture",po(new PointerEvent("gotpointercapture"))))}function Dn(e,t){const i=In.get(e);if(!i)return;const n=i.getStage();n&&n.content,In.delete(e),_c&&i._fire("lostpointercapture",po(new PointerEvent("lostpointercapture")))}const cg="Stage",hg="string",yc="px",dg="mouseout",Sc="mouseleave",wc="mouseover",Ec="mouseenter",xc="mousemove",Cc="mousedown",Nc="mouseup",Vn="pointermove",Fn="pointerdown",Yi="pointerup",Gn="pointercancel",ug="lostpointercapture",zs="pointerout",Bn="pointerleave",Ys="pointerover",qs="pointerenter",go="contextmenu",Tc="touchstart",kc="touchend",Oc="touchmove",Pc="touchcancel",mo="wheel",fg=5,pg=[[Ec,"_pointerenter"],[Cc,"_pointerdown"],[xc,"_pointermove"],[Nc,"_pointerup"],[Sc,"_pointerleave"],[Tc,"_pointerdown"],[Oc,"_pointermove"],[kc,"_pointerup"],[Pc,"_pointercancel"],[wc,"_pointerover"],[mo,"_wheel"],[go,"_contextmenu"],[Fn,"_pointerdown"],[Vn,"_pointermove"],[Yi,"_pointerup"],[Gn,"_pointercancel"],[Bn,"_pointerleave"],[ug,"_lostpointercapture"]],_o={mouse:{[zs]:dg,[Bn]:Sc,[Ys]:wc,[qs]:Ec,[Vn]:xc,[Fn]:Cc,[Yi]:Nc,[Gn]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[zs]:"touchout",[Bn]:"touchleave",[Ys]:"touchover",[qs]:"touchenter",[Vn]:Oc,[Fn]:Tc,[Yi]:kc,[Gn]:Pc,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[zs]:zs,[Bn]:Bn,[Ys]:Ys,[qs]:qs,[Vn]:Vn,[Fn]:Fn,[Yi]:Yi,[Gn]:Gn,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},$n=e=>e.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",qi=e=>{const t=$n(e);if(t==="pointer")return X.pointerEventsEnabled&&_o.pointer;if(t==="touch")return _o.touch;if(t==="mouse")return _o.mouse};function Ac(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&S.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const gg="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Hn=[];class Ks extends ne{constructor(t){super(Ac(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Hn.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Ac(this.attrs)}),this._checkVisibility()}_validateAdd(t){const i=t.getType()==="Layer",n=t.getType()==="FastLayer";i||n||S.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===hg){let i;if(t.charAt(0)==="."){const n=t.slice(1);t=document.getElementsByClassName(n)[0]}else t.charAt(0)!=="#"?i=t:i=t.slice(1),t=document.getElementById(i);if(!t)throw"Can not find container in document with id "+i}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,i=t.length;for(let n=0;n<i;n++)t[n].clear();return this}clone(t){return t||(t={}),t.container=typeof document<"u"&&document.createElement("div"),ne.prototype.clone.call(this,t)}destroy(){super.destroy();const t=this.content;t&&S._isInDocument(t)&&this.container().removeChild(t);const i=Hn.indexOf(this);return i>-1&&Hn.splice(i,1),S.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(S.warn(gg),null)}_getPointerById(t){return this._pointerPositions.find(i=>i.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const i=new ii({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),n=i.getContext()._context,s=this.children;return(t.x||t.y)&&n.translate(-1*t.x,-1*t.y),s.forEach(function(r){if(!r.isVisible())return;const o=r._toKonvaCanvas(t);n.drawImage(o._canvas,t.x,t.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),i}getIntersection(t){if(!t)return null;const i=this.children,n=i.length,s=n-1;for(let r=s;r>=0;r--){const o=i[r].getIntersection(t);if(o)return o}return null}_resizeDOM(){const t=this.width(),i=this.height();this.content&&(this.content.style.width=t+yc,this.content.style.height=i+yc),this.bufferCanvas.setSize(t,i),this.bufferHitCanvas.setSize(t,i),this.children.forEach(n=>{n.setSize({width:t,height:i}),n.draw()})}add(t,...i){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.add(arguments[s]);return this}super.add(t);const n=this.children.length;return n>fg&&S.warn("The stage has "+n+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),X.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return vc(t,this)}setPointerCapture(t){bc(t,this)}releaseCapture(t){Dn(t)}getLayers(){return this.children}_bindContentEvents(){X.isBrowser&&pg.forEach(([t,i])=>{this.content.addEventListener(t,n=>{this[i](n)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const i=qi(t.type);i&&this._fire(i.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const i=qi(t.type);i&&this._fire(i.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let i=this[t+"targetShape"];return i&&!i.getStage()&&(i=null),i}_pointerleave(t){const i=qi(t.type),n=$n(t.type);if(!i)return;this.setPointersPositions(t);const s=this._getTargetShape(n),r=!(X.isDragging()||X.isTransforming())||X.hitOnDragEnabled;s&&r?(s._fireAndBubble(i.pointerout,{evt:t}),s._fireAndBubble(i.pointerleave,{evt:t}),this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this[n+"targetShape"]=null):r&&(this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(i.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const i=qi(t.type),n=$n(t.type);if(!i)return;this.setPointersPositions(t);let s=!1;this._changedPointerPositions.forEach(r=>{const o=this.getIntersection(r);if(gt.justDragged=!1,X["_"+n+"ListenClick"]=!0,!o||!o.isListening()){this[n+"ClickStartShape"]=void 0;return}X.capturePointerEventsEnabled&&o.setPointerCapture(r.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(i.pointerdown,{evt:t,pointerId:r.id}),s=!0;const a=t.type.indexOf("touch")>=0;o.preventDefault()&&t.cancelable&&a&&t.preventDefault()}),s||this._fire(i.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const i=qi(t.type),n=$n(t.type);if(!i)return;const s=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(X.isDragging()&&gt.node.preventDefault()&&t.cancelable&&s&&t.preventDefault(),this.setPointersPositions(t),!(!(X.isDragging()||X.isTransforming())||X.hitOnDragEnabled))return;const o={};let a=!1;const l=this._getTargetShape(n);this._changedPointerPositions.forEach(c=>{const h=fo(c.id)||this.getIntersection(c),d=c.id,u={evt:t,pointerId:d},f=l!==h;if(f&&l&&(l._fireAndBubble(i.pointerout,{...u},h),l._fireAndBubble(i.pointerleave,{...u},h)),h){if(o[h._id])return;o[h._id]=!0}h&&h.isListening()?(a=!0,f&&(h._fireAndBubble(i.pointerover,{...u},l),h._fireAndBubble(i.pointerenter,{...u},l),this[n+"targetShape"]=h),h._fireAndBubble(i.pointermove,{...u})):l&&(this._fire(i.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[n+"targetShape"]=null)}),a||this._fire(i.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const i=qi(t.type),n=$n(t.type);if(!i)return;this.setPointersPositions(t);const s=this[n+"ClickStartShape"],r=this[n+"ClickEndShape"],o={};let a=!1;this._changedPointerPositions.forEach(l=>{const c=fo(l.id)||this.getIntersection(l);if(c){if(c.releaseCapture(l.id),o[c._id])return;o[c._id]=!0}const h=l.id,d={evt:t,pointerId:h};let u=!1;X["_"+n+"InDblClickWindow"]?(u=!0,clearTimeout(this[n+"DblTimeout"])):gt.justDragged||(X["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){X["_"+n+"InDblClickWindow"]=!1},X.dblClickWindow),c&&c.isListening()?(a=!0,this[n+"ClickEndShape"]=c,c._fireAndBubble(i.pointerup,{...d}),X["_"+n+"ListenClick"]&&s&&s===c&&(c._fireAndBubble(i.pointerclick,{...d}),u&&r&&r===c&&c._fireAndBubble(i.pointerdblclick,{...d}))):(this[n+"ClickEndShape"]=null,a||(this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a=!0),X["_"+n+"ListenClick"]&&this._fire(i.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:h}),u&&this._fire(i.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:h}))}),a||this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),X["_"+n+"ListenClick"]=!1,t.cancelable&&n!=="touch"&&n!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(go,{evt:t}):this._fire(go,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(mo,{evt:t}):this._fire(mo,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const i=fo(t.pointerId)||this.getIntersection(this.getPointerPosition());i&&i._fireAndBubble(Yi,po(t)),Dn(t.pointerId)}_lostpointercapture(t){Dn(t.pointerId)}setPointersPositions(t){const i=this._getContentPosition();let n=null,s=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,r=>{this._pointerPositions.push({id:r.identifier,x:(r.clientX-i.left)/i.scaleX,y:(r.clientY-i.top)/i.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,r=>{this._changedPointerPositions.push({id:r.identifier,x:(r.clientX-i.left)/i.scaleX,y:(r.clientY-i.top)/i.scaleY})})):(n=(t.clientX-i.left)/i.scaleX,s=(t.clientY-i.top)/i.scaleY,this.pointerPos={x:n,y:s},this._pointerPositions=[{x:n,y:s,id:S._getFirstPointerId(t)}],this._changedPointerPositions=[{x:n,y:s,id:S._getFirstPointerId(t)}])}_setPointerPosition(t){S.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new ii({width:this.width(),height:this.height()}),this.bufferHitCanvas=new lo({pixelRatio:1,width:this.width(),height:this.height()}),!X.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}cache(){return S.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}}Ks.prototype.nodeType=cg,kt(Ks),m.addGetterSetter(Ks,"container"),X.isBrowser&&document.addEventListener("visibilitychange",()=>{Hn.forEach(e=>{e.batchDraw()})});const Rc="hasShadow",Mc="shadowRGBA",Lc="patternImage",Ic="linearGradient",Dc="radialGradient";let Js;function vo(){return Js||(Js=S.createCanvasElement().getContext("2d"),Js)}const Wn={};function mg(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function _g(e){e.stroke()}function vg(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function bg(e){e.stroke()}function yg(){this._clearCache(Rc)}function Sg(){this._clearCache(Mc)}function wg(){this._clearCache(Lc)}function Eg(){this._clearCache(Ic)}function xg(){this._clearCache(Dc)}class V extends G{constructor(t){super(t);let i,n=0;for(;i=S.getHitColor(),!(i&&!(i in Wn));)if(n++,n>=1e4){S.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),i=S.getRandomColor();break}this.colorKey=i,Wn[i]=this}getContext(){return S.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return S.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(Rc,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Lc,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const i=vo().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(i&&i.setTransform){const n=new ie;n.translate(this.fillPatternX(),this.fillPatternY()),n.rotate(X.getAngle(this.fillPatternRotation())),n.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),n.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const s=n.getMatrix(),r=typeof DOMMatrix>"u"?{a:s[0],b:s[1],c:s[2],d:s[3],e:s[4],f:s[5]}:new DOMMatrix(s);i.setTransform(r)}return i}}_getLinearGradient(){return this._getCache(Ic,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const i=vo(),n=this.fillLinearGradientStartPoint(),s=this.fillLinearGradientEndPoint(),r=i.createLinearGradient(n.x,n.y,s.x,s.y);for(let o=0;o<t.length;o+=2)r.addColorStop(t[o],t[o+1]);return r}}_getRadialGradient(){return this._getCache(Dc,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const i=vo(),n=this.fillRadialGradientStartPoint(),s=this.fillRadialGradientEndPoint(),r=i.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),s.x,s.y,this.fillRadialGradientEndRadius());for(let o=0;o<t.length;o+=2)r.addColorStop(t[o],t[o+1]);return r}}getShadowRGBA(){return this._getCache(Mc,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=S.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const i=this.getStage();if(!i)return!1;const n=i.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return G.prototype.destroy.call(this),delete Wn[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var i;if(!((i=this.attrs.perfectDrawEnabled)!==null&&i!==void 0?i:!0))return!1;const s=t||this.hasFill(),r=this.hasStroke(),o=this.getAbsoluteOpacity()!==1;if(s&&r&&o)return!0;const a=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(s&&r&&a&&l)}setStrokeHitEnabled(t){S.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let i=!1,n=this.getParent();for(;n;){if(n.isCached()){i=!0;break}n=n.getParent()}const s=t.skipTransform,r=t.relativeTo||i&&this.getStage()||void 0,o=this.getSelfRect(),l=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,c=o.width+l,h=o.height+l,d=!t.skipShadow&&this.hasShadow(),u=d?this.shadowOffsetX():0,f=d?this.shadowOffsetY():0,p=c+Math.abs(u),_=h+Math.abs(f),b=d&&this.shadowBlur()||0,w=p+b*2,y=_+b*2,x={width:w,height:y,x:-(l/2+b)+Math.min(u,0)+o.x,y:-(l/2+b)+Math.min(f,0)+o.y};return s?x:this._transformedRect(x,r)}drawScene(t,i,n){const s=this.getLayer(),r=t||s.getCanvas(),o=r.getContext(),a=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow();let h;const d=i===this;if(!this.isVisible()&&!d)return this;if(a){o.save();const u=this.getAbsoluteTransform(i).getMatrix();return o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!l)return this;if(o.save(),this._useBufferCanvas()){h=this.getStage();const u=n||h.bufferCanvas,f=u.getContext();f.clear(),f.save(),f._applyLineJoin(this),f._applyMiterLimit(this);const p=this.getAbsoluteTransform(i).getMatrix();f.transform(p[0],p[1],p[2],p[3],p[4],p[5]),l.call(this,f,this),f.restore();const _=u.pixelRatio;c&&o._applyShadow(this),d||(o._applyOpacity(this),o._applyGlobalCompositeOperation(this)),o.drawImage(u._canvas,u.x||0,u.y||0,u.width/_,u.height/_)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!d){const u=this.getAbsoluteTransform(i).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}c&&o._applyShadow(this),l.call(this,o,this)}return o.restore(),this}drawHit(t,i,n=!1){if(!this.shouldDrawHit(i,n))return this;const s=this.getLayer(),r=t||s.hitCanvas,o=r&&r.getContext(),a=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),c=l&&l.hit;if(this.colorKey||S.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),c){o.save();const d=this.getAbsoluteTransform(i).getMatrix();return o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!a)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===i)){const d=this.getAbsoluteTransform(i).getMatrix();o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}return a.call(this,o,this),o.restore(),this}drawHitFromCache(t=0){const i=this._getCanvasCache(),n=this._getCachedSceneCanvas(),s=i.hit,r=s.getContext(),o=s.getWidth(),a=s.getHeight();r.clear(),r.drawImage(n._canvas,0,0,o,a);try{const l=r.getImageData(0,0,o,a),c=l.data,h=c.length,d=S._hexToRgb(this.colorKey);for(let u=0;u<h;u+=4)c[u+3]>t?(c[u]=d.r,c[u+1]=d.g,c[u+2]=d.b,c[u+3]=255):c[u+3]=0;r.putImageData(l,0,0)}catch(l){S.error("Unable to draw hit graph from cached scene canvas. "+l.message)}return this}hasPointerCapture(t){return vc(t,this)}setPointerCapture(t){bc(t,this)}releaseCapture(t){Dn(t)}}V.prototype._fillFunc=mg,V.prototype._strokeFunc=_g,V.prototype._fillFuncHit=vg,V.prototype._strokeFuncHit=bg,V.prototype._centroid=!1,V.prototype.nodeType="Shape",kt(V),V.prototype.eventListeners={},V.prototype.on.call(V.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",yg),V.prototype.on.call(V.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Sg),V.prototype.on.call(V.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",wg),V.prototype.on.call(V.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",Eg),V.prototype.on.call(V.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",xg),m.addGetterSetter(V,"stroke",void 0,uc()),m.addGetterSetter(V,"strokeWidth",2,$()),m.addGetterSetter(V,"fillAfterStrokeEnabled",!1),m.addGetterSetter(V,"hitStrokeWidth","auto",co()),m.addGetterSetter(V,"strokeHitEnabled",!0,_e()),m.addGetterSetter(V,"perfectDrawEnabled",!0,_e()),m.addGetterSetter(V,"shadowForStrokeEnabled",!0,_e()),m.addGetterSetter(V,"lineJoin"),m.addGetterSetter(V,"lineCap"),m.addGetterSetter(V,"miterLimit"),m.addGetterSetter(V,"sceneFunc"),m.addGetterSetter(V,"hitFunc"),m.addGetterSetter(V,"dash"),m.addGetterSetter(V,"dashOffset",0,$()),m.addGetterSetter(V,"shadowColor",void 0,Ti()),m.addGetterSetter(V,"shadowBlur",0,$()),m.addGetterSetter(V,"shadowOpacity",1,$()),m.addComponentsGetterSetter(V,"shadowOffset",["x","y"]),m.addGetterSetter(V,"shadowOffsetX",0,$()),m.addGetterSetter(V,"shadowOffsetY",0,$()),m.addGetterSetter(V,"fillPatternImage"),m.addGetterSetter(V,"fill",void 0,uc()),m.addGetterSetter(V,"fillPatternX",0,$()),m.addGetterSetter(V,"fillPatternY",0,$()),m.addGetterSetter(V,"fillLinearGradientColorStops"),m.addGetterSetter(V,"strokeLinearGradientColorStops"),m.addGetterSetter(V,"fillRadialGradientStartRadius",0),m.addGetterSetter(V,"fillRadialGradientEndRadius",0),m.addGetterSetter(V,"fillRadialGradientColorStops"),m.addGetterSetter(V,"fillPatternRepeat","repeat"),m.addGetterSetter(V,"fillEnabled",!0),m.addGetterSetter(V,"strokeEnabled",!0),m.addGetterSetter(V,"shadowEnabled",!0),m.addGetterSetter(V,"dashEnabled",!0),m.addGetterSetter(V,"strokeScaleEnabled",!0),m.addGetterSetter(V,"fillPriority","color"),m.addComponentsGetterSetter(V,"fillPatternOffset",["x","y"]),m.addGetterSetter(V,"fillPatternOffsetX",0,$()),m.addGetterSetter(V,"fillPatternOffsetY",0,$()),m.addComponentsGetterSetter(V,"fillPatternScale",["x","y"]),m.addGetterSetter(V,"fillPatternScaleX",1,$()),m.addGetterSetter(V,"fillPatternScaleY",1,$()),m.addComponentsGetterSetter(V,"fillLinearGradientStartPoint",["x","y"]),m.addComponentsGetterSetter(V,"strokeLinearGradientStartPoint",["x","y"]),m.addGetterSetter(V,"fillLinearGradientStartPointX",0),m.addGetterSetter(V,"strokeLinearGradientStartPointX",0),m.addGetterSetter(V,"fillLinearGradientStartPointY",0),m.addGetterSetter(V,"strokeLinearGradientStartPointY",0),m.addComponentsGetterSetter(V,"fillLinearGradientEndPoint",["x","y"]),m.addComponentsGetterSetter(V,"strokeLinearGradientEndPoint",["x","y"]),m.addGetterSetter(V,"fillLinearGradientEndPointX",0),m.addGetterSetter(V,"strokeLinearGradientEndPointX",0),m.addGetterSetter(V,"fillLinearGradientEndPointY",0),m.addGetterSetter(V,"strokeLinearGradientEndPointY",0),m.addComponentsGetterSetter(V,"fillRadialGradientStartPoint",["x","y"]),m.addGetterSetter(V,"fillRadialGradientStartPointX",0),m.addGetterSetter(V,"fillRadialGradientStartPointY",0),m.addComponentsGetterSetter(V,"fillRadialGradientEndPoint",["x","y"]),m.addGetterSetter(V,"fillRadialGradientEndPointX",0),m.addGetterSetter(V,"fillRadialGradientEndPointY",0),m.addGetterSetter(V,"fillPatternRotation",0),m.addGetterSetter(V,"fillRule",void 0,Ti()),m.backCompat(V,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const Cg="beforeDraw",Ng="draw",Vc=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Tg=Vc.length;class Oi extends ne{constructor(t){super(t),this.canvas=new ii,this.hitCanvas=new lo({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const i=this.getStage();return i&&i.content&&(i.content.removeChild(this.getNativeCanvasElement()),t<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[t+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){G.prototype.moveToTop.call(this);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!G.prototype.moveUp.call(this))return!1;const i=this.getStage();return!i||!i.content?!1:(i.content.removeChild(this.getNativeCanvasElement()),this.index<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[this.index+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(G.prototype.moveDown.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(G.prototype.moveToBottom.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const t=this.getNativeCanvasElement();return G.prototype.remove.call(this),t&&t.parentNode&&S._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:i}){return this.canvas.setSize(t,i),this.hitCanvas.setSize(t,i),this._setSmoothEnabled(),this}_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&S.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t={...t},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),G.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){S.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){S.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,S.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let i=1,n=!1;for(;;){for(let s=0;s<Tg;s++){const r=Vc[s],o=this._getIntersection({x:t.x+r.x*i,y:t.y+r.y*i}),a=o.shape;if(a)return a;if(n=!!o.antialiased,!o.antialiased)break}if(n)i+=1;else return null}}_getIntersection(t){const i=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*i),Math.round(t.y*i),1,1).data,s=n[3];if(s===255){const r=S.getHitColorKey(n[0],n[1],n[2]),o=Wn[r];return o?{shape:o}:{antialiased:!0}}else if(s>0)return{antialiased:!0};return{}}drawScene(t,i,n){const s=this.getLayer(),r=t||s&&s.getCanvas();return this._fire(Cg,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),ne.prototype.drawScene.call(this,r,i,n),this._fire(Ng,{node:this}),this}drawHit(t,i){const n=this.getLayer(),s=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),ne.prototype.drawHit.call(this,s,i),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){S.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return S.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return S.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Oi.prototype.nodeType="Layer",kt(Oi),m.addGetterSetter(Oi,"imageSmoothingEnabled",!0),m.addGetterSetter(Oi,"clearBeforeDraw",!0),m.addGetterSetter(Oi,"hitGraphEnabled",!0,_e());class bo extends Oi{constructor(t){super(t),this.listening(!1),S.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}bo.prototype.nodeType="FastLayer",kt(bo);class Ki extends ne{_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&S.throw("You may only add groups and shapes to groups.")}}Ki.prototype.nodeType="Group",kt(Ki);const yo=(function(){return Ni.performance&&Ni.performance.now?function(){return Ni.performance.now()}:function(){return new Date().getTime()}})();class oe{constructor(t,i){this.id=oe.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:yo(),frameRate:0},this.func=t,this.setLayers(i)}setLayers(t){let i=[];return t&&(i=Array.isArray(t)?t:[t]),this.layers=i,this}getLayers(){return this.layers}addLayer(t){const i=this.layers,n=i.length;for(let s=0;s<n;s++)if(i[s]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const i=oe.animations,n=i.length;for(let s=0;s<n;s++)if(i[s].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=yo(),oe._addAnimation(this),this}stop(){return oe._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const i=t.id,n=this.animations,s=n.length;for(let r=0;r<s;r++)if(n[r].id===i){this.animations.splice(r,1);break}}static _runFrames(){const t={},i=this.animations;for(let n=0;n<i.length;n++){const s=i[n],r=s.layers,o=s.func;s._updateFrameObject(yo());const a=r.length;let l;if(o?l=o.call(s,s.frame)!==!1:l=!0,!!l)for(let c=0;c<a;c++){const h=r[c];h._id!==void 0&&(t[h._id]=h)}}for(const n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=oe;t.animations.length?(t._runFrames(),S.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,S.requestAnimFrame(this._animationLoop))}}oe.animations=[],oe.animIdCounter=0,oe.animRunning=!1;const kg={node:1,duration:1,easing:1,onFinish:1,yoyo:1},Og=1,Fc=2,Gc=3,Bc=["fill","stroke","shadowColor"];let Pg=0;class Ag{constructor(t,i,n,s,r,o,a){this.prop=t,this.propFunc=i,this.begin=s,this._pos=s,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=a,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=r-this.begin,this.pause()}fire(t){const i=this[t];i&&i()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=Fc,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=Gc,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const t=this.getTimer()-this._startTime;this.state===Fc?this.setTime(t):this.state===Gc&&this.setTime(this.duration-t)}pause(){this.state=Og,this.fire("onPause")}getTimer(){return new Date().getTime()}}class wt{constructor(t){const i=this,n=t.node,s=n._id,r=t.easing||Un.Linear,o=!!t.yoyo;let a,l;typeof t.duration>"u"?a=.3:t.duration===0?a=.001:a=t.duration,this.node=n,this._id=Pg++;const c=n.getLayer()||(n instanceof X.Stage?n.getLayers():null);c||S.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new oe(function(){i.tween.onEnterFrame()},c),this.tween=new Ag(l,function(h){i._tweenFunc(h)},r,0,1,a*1e3,o),this._addListeners(),wt.attrs[s]||(wt.attrs[s]={}),wt.attrs[s][this._id]||(wt.attrs[s][this._id]={}),wt.tweens[s]||(wt.tweens[s]={});for(l in t)kg[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,i){const n=this.node,s=n._id;let r,o,a,l,c;const h=wt.tweens[s][t];h&&delete wt.attrs[s][h][t];let d=n.getAttr(t);if(S._isArray(i))if(r=[],o=Math.max(i.length,d.length),t==="points"&&i.length!==d.length&&(i.length>d.length?(l=d,d=S._prepareArrayForTween(d,i,n.closed())):(a=i,i=S._prepareArrayForTween(i,d,n.closed()))),t.indexOf("fill")===0)for(let u=0;u<o;u++)if(u%2===0)r.push(i[u]-d[u]);else{const f=S.colorToRGBA(d[u]);c=S.colorToRGBA(i[u]),d[u]=f,r.push({r:c.r-f.r,g:c.g-f.g,b:c.b-f.b,a:c.a-f.a})}else for(let u=0;u<o;u++)r.push(i[u]-d[u]);else Bc.indexOf(t)!==-1?(d=S.colorToRGBA(d),c=S.colorToRGBA(i),r={r:c.r-d.r,g:c.g-d.g,b:c.b-d.b,a:c.a-d.a}):r=i-d;wt.attrs[s][this._id][t]={start:d,diff:r,end:i,trueEnd:a,trueStart:l},wt.tweens[s][t]=this._id}_tweenFunc(t){const i=this.node,n=wt.attrs[i._id][this._id];let s,r,o,a,l,c,h,d;for(s in n){if(r=n[s],o=r.start,a=r.diff,d=r.end,S._isArray(o))if(l=[],h=Math.max(o.length,d.length),s.indexOf("fill")===0)for(c=0;c<h;c++)c%2===0?l.push((o[c]||0)+a[c]*t):l.push("rgba("+Math.round(o[c].r+a[c].r*t)+","+Math.round(o[c].g+a[c].g*t)+","+Math.round(o[c].b+a[c].b*t)+","+(o[c].a+a[c].a*t)+")");else for(c=0;c<h;c++)l.push((o[c]||0)+a[c]*t);else Bc.indexOf(s)!==-1?l="rgba("+Math.round(o.r+a.r*t)+","+Math.round(o.g+a.g*t)+","+Math.round(o.b+a.b*t)+","+(o.a+a.a*t)+")":l=o+a*t;i.setAttr(s,l)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,i=wt.attrs[t._id][this._id];i.points&&i.points.trueEnd&&t.setAttr("points",i.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,i=wt.attrs[t._id][this._id];i.points&&i.points.trueStart&&t.points(i.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,i=this._id,n=wt.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const s in n)delete wt.tweens[t][s];delete wt.attrs[t][i],wt.tweens[t]&&(Object.keys(wt.tweens[t]).length===0&&delete wt.tweens[t],Object.keys(wt.attrs[t]).length===0&&delete wt.attrs[t])}}wt.attrs={},wt.tweens={},G.prototype.to=function(e){const t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new wt(e).play()};const Un={BackEaseIn(e,t,i,n){return i*(e/=n)*e*((1.70158+1)*e-1.70158)+t},BackEaseOut(e,t,i,n){return i*((e=e/n-1)*e*((1.70158+1)*e+1.70158)+1)+t},BackEaseInOut(e,t,i,n){let s=1.70158;return(e/=n/2)<1?i/2*(e*e*(((s*=1.525)+1)*e-s))+t:i/2*((e-=2)*e*(((s*=1.525)+1)*e+s)+2)+t},ElasticEaseIn(e,t,i,n,s,r){let o=0;return e===0?t:(e/=n)===1?t+i:(r||(r=n*.3),!s||s<Math.abs(i)?(s=i,o=r/4):o=r/(2*Math.PI)*Math.asin(i/s),-(s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r))+t)},ElasticEaseOut(e,t,i,n,s,r){let o=0;return e===0?t:(e/=n)===1?t+i:(r||(r=n*.3),!s||s<Math.abs(i)?(s=i,o=r/4):o=r/(2*Math.PI)*Math.asin(i/s),s*Math.pow(2,-10*e)*Math.sin((e*n-o)*(2*Math.PI)/r)+i+t)},ElasticEaseInOut(e,t,i,n,s,r){let o=0;return e===0?t:(e/=n/2)===2?t+i:(r||(r=n*(.3*1.5)),!s||s<Math.abs(i)?(s=i,o=r/4):o=r/(2*Math.PI)*Math.asin(i/s),e<1?-.5*(s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r))+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r)*.5+i+t)},BounceEaseOut(e,t,i,n){return(e/=n)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t},BounceEaseIn(e,t,i,n){return i-Un.BounceEaseOut(n-e,0,i,n)+t},BounceEaseInOut(e,t,i,n){return e<n/2?Un.BounceEaseIn(e*2,0,i,n)*.5+t:Un.BounceEaseOut(e*2-n,0,i,n)*.5+i*.5+t},EaseIn(e,t,i,n){return i*(e/=n)*e+t},EaseOut(e,t,i,n){return-i*(e/=n)*(e-2)+t},EaseInOut(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},StrongEaseIn(e,t,i,n){return i*(e/=n)*e*e*e*e+t},StrongEaseOut(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t},StrongEaseInOut(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},Linear(e,t,i,n){return i*e/n+t}},$c=S._assign(X,{Util:S,Transform:ie,Node:G,Container:ne,Stage:Ks,stages:Hn,Layer:Oi,FastLayer:bo,Group:Ki,DD:gt,Shape:V,shapes:Wn,Animation:oe,Tween:wt,Easings:Un,Context:$s,Canvas:ao});class Ue extends V{_sceneFunc(t){const i=X.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,i,n),t.arc(0,0,this.innerRadius(),i,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),i=this.outerRadius(),n=this.clockwise(),s=X.getAngle(n?360-this.angle():this.angle()),r=Math.cos(Math.min(s,Math.PI)),o=1,a=Math.sin(Math.min(Math.max(Math.PI,s),3*Math.PI/2)),l=Math.sin(Math.min(s,Math.PI/2)),c=r*(r>0?t:i),h=o*i,d=a*(a>0?t:i),u=l*(l>0?i:t);return{x:c,y:n?-1*u:d,width:h-c,height:u-d}}}Ue.prototype._centroid=!0,Ue.prototype.className="Arc",Ue.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],kt(Ue),m.addGetterSetter(Ue,"innerRadius",0,$()),m.addGetterSetter(Ue,"outerRadius",0,$()),m.addGetterSetter(Ue,"angle",0,$()),m.addGetterSetter(Ue,"clockwise",!1,_e());function So(e,t,i,n,s,r,o){const a=Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2)),l=Math.sqrt(Math.pow(s-i,2)+Math.pow(r-n,2)),c=o*a/(a+l),h=o*l/(a+l),d=i-c*(s-e),u=n-c*(r-t),f=i+h*(s-e),p=n+h*(r-t);return[d,u,f,p]}function Hc(e,t){const i=e.length,n=[];for(let s=2;s<i-2;s+=2){const r=So(e[s-2],e[s-1],e[s],e[s+1],e[s+2],e[s+3],t);isNaN(r[0])||(n.push(r[0]),n.push(r[1]),n.push(e[s]),n.push(e[s+1]),n.push(r[2]),n.push(r[3]))}return n}class je extends V{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const i=this.points(),n=i.length,s=this.tension(),r=this.closed(),o=this.bezier();if(!n)return;let a=0;if(t.beginPath(),t.moveTo(i[0],i[1]),s!==0&&n>4){const l=this.getTensionPoints(),c=l.length;for(a=r?0:4,r||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);a<c-2;)t.bezierCurveTo(l[a++],l[a++],l[a++],l[a++],l[a++],l[a++]);r||t.quadraticCurveTo(l[c-2],l[c-1],i[n-2],i[n-1])}else if(o)for(a=2;a<n;)t.bezierCurveTo(i[a++],i[a++],i[a++],i[a++],i[a++],i[a++]);else for(a=2;a<n;a+=2)t.lineTo(i[a],i[a+1]);r?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Hc(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),i=t.length,n=this.tension(),s=So(t[i-2],t[i-1],t[0],t[1],t[2],t[3],n),r=So(t[i-4],t[i-3],t[i-2],t[i-1],t[0],t[1],n),o=Hc(t,n);return[s[2],s[3]].concat(o).concat([r[0],r[1],t[i-2],t[i-1],r[2],r[3],s[0],s[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();let i=t[0],n=t[0],s=t[1],r=t[1],o,a;for(let l=0;l<t.length/2;l++)o=t[l*2],a=t[l*2+1],i=Math.min(i,o),n=Math.max(n,o),s=Math.min(s,a),r=Math.max(r,a);return{x:i,y:s,width:n-i,height:r-s}}}je.prototype.className="Line",je.prototype._attrsAffectingSize=["points","bezier","tension"],kt(je),m.addGetterSetter(je,"closed",!1),m.addGetterSetter(je,"bezier",!1),m.addGetterSetter(je,"tension",0,$()),m.addGetterSetter(je,"points",[],Yp());const Rg=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Mg=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Lg=[[1],[1,1],[1,2,1],[1,3,3,1]],Wc=(e,t,i)=>{let n,s;const o=i/2;n=0;for(let a=0;a<20;a++)s=o*Rg[20][a]+o,n+=Mg[20][a]*Ig(e,t,s);return o*n},Uc=(e,t,i)=>{i===void 0&&(i=1);const n=e[0]-2*e[1]+e[2],s=t[0]-2*t[1]+t[2],r=2*e[1]-2*e[0],o=2*t[1]-2*t[0],a=4*(n*n+s*s),l=4*(n*r+s*o),c=r*r+o*o;if(a===0)return i*Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(t[2]-t[0],2));const h=l/(2*a),d=c/a,u=i+h,f=d-h*h,p=u*u+f>0?Math.sqrt(u*u+f):0,_=h*h+f>0?Math.sqrt(h*h+f):0,b=h+Math.sqrt(h*h+f)!==0?f*Math.log(Math.abs((u+p)/(h+_))):0;return Math.sqrt(a)/2*(u*p-h*_+b)};function Ig(e,t,i){const n=wo(1,i,e),s=wo(1,i,t),r=n*n+s*s;return Math.sqrt(r)}const wo=(e,t,i)=>{const n=i.length-1;let s,r;if(n===0)return 0;if(e===0){r=0;for(let o=0;o<=n;o++)r+=Lg[n][o]*Math.pow(1-t,n-o)*Math.pow(t,o)*i[o];return r}else{s=new Array(n);for(let o=0;o<n;o++)s[o]=n*(i[o+1]-i[o]);return wo(e-1,t,s)}},jc=(e,t,i)=>{let n=1,s=e/t,r=(e-i(s))/t,o=0;for(;n>.001;){const a=i(s+r),l=Math.abs(e-a)/t;if(l<n)n=l,s+=r;else{const c=i(s-r),h=Math.abs(e-c)/t;h<n?(n=h,s-=r):r/=2}if(o++,o>500)break}return s};class Et extends V{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Et.parsePathData(this.data()),this.pathLength=Et.getPathLength(this.dataArray)}_sceneFunc(t){const i=this.dataArray;t.beginPath();let n=!1;for(let s=0;s<i.length;s++){const r=i[s].command,o=i[s].points;switch(r){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":const a=o[0],l=o[1],c=o[2],h=o[3],d=o[4],u=o[5],f=o[6],p=o[7],_=c>h?c:h,b=c>h?1:c/h,w=c>h?h/c:1;t.translate(a,l),t.rotate(f),t.scale(b,w),t.arc(0,0,_,d,d+u,1-p),t.scale(1/b,1/w),t.rotate(-f),t.translate(-a,-l);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(l){if(l.command==="A"){const c=l.points[4],h=l.points[5],d=l.points[4]+h;let u=Math.PI/180;if(Math.abs(c-d)<u&&(u=Math.abs(c-d)),h<0)for(let f=c-u;f>d;f-=u){const p=Et.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],f,0);t.push(p.x,p.y)}else for(let f=c+u;f<d;f+=u){const p=Et.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],f,0);t.push(p.x,p.y)}}else if(l.command==="C")for(let c=0;c<=1;c+=.01){const h=Et.getPointOnCubicBezier(c,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]);t.push(h.x,h.y)}else t=t.concat(l.points)});let i=t[0],n=t[0],s=t[1],r=t[1],o,a;for(let l=0;l<t.length/2;l++)o=t[l*2],a=t[l*2+1],isNaN(o)||(i=Math.min(i,o),n=Math.max(n,o)),isNaN(a)||(s=Math.min(s,a),r=Math.max(r,a));return{x:i,y:s,width:n-i,height:r-s}}getLength(){return this.pathLength}getPointAtLength(t){return Et.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,i,n,s){return Math.sqrt((n-t)*(n-t)+(s-i)*(s-i))}static getPathLength(t){let i=0;for(let n=0;n<t.length;++n)i+=t[n].pathLength;return i}static getPointAtLengthOfDataArray(t,i){let n,s=0,r=i.length;if(!r)return null;for(;s<r&&t>i[s].pathLength;)t-=i[s].pathLength,++s;if(s===r)return n=i[s-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return i[s].command==="M"?(n=i[s].points.slice(0,2),{x:n[0],y:n[1]}):{x:i[s].start.x,y:i[s].start.y};const o=i[s],a=o.points;switch(o.command){case"L":return Et.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return Et.getPointOnCubicBezier(jc(t,Et.getPathLength(i),_=>Wc([o.start.x,a[0],a[2],a[4]],[o.start.y,a[1],a[3],a[5]],_)),o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return Et.getPointOnQuadraticBezier(jc(t,Et.getPathLength(i),_=>Uc([o.start.x,a[0],a[2]],[o.start.y,a[1],a[3]],_)),o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":const l=a[0],c=a[1],h=a[2],d=a[3],u=a[5],f=a[6];let p=a[4];return p+=u*t/o.pathLength,Et.getPointOnEllipticalArc(l,c,h,d,p,f)}return null}static getPointOnLine(t,i,n,s,r,o,a){o=o??i,a=a??n;const l=this.getLineLength(i,n,s,r);if(l<1e-10)return{x:i,y:n};if(s===i)return{x:o,y:a+(r>n?t:-t)};const c=(r-n)/(s-i),h=Math.sqrt(t*t/(1+c*c))*(s<i?-1:1),d=c*h;if(Math.abs(a-n-c*(o-i))<1e-10)return{x:o+h,y:a+d};const u=((o-i)*(s-i)+(a-n)*(r-n))/(l*l),f=i+u*(s-i),p=n+u*(r-n),_=this.getLineLength(o,a,f,p),b=Math.sqrt(t*t-_*_),w=Math.sqrt(b*b/(1+c*c))*(s<i?-1:1),y=c*w;return{x:f+w,y:p+y}}static getPointOnCubicBezier(t,i,n,s,r,o,a,l,c){function h(b){return b*b*b}function d(b){return 3*b*b*(1-b)}function u(b){return 3*b*(1-b)*(1-b)}function f(b){return(1-b)*(1-b)*(1-b)}const p=l*h(t)+o*d(t)+s*u(t)+i*f(t),_=c*h(t)+a*d(t)+r*u(t)+n*f(t);return{x:p,y:_}}static getPointOnQuadraticBezier(t,i,n,s,r,o,a){function l(f){return f*f}function c(f){return 2*f*(1-f)}function h(f){return(1-f)*(1-f)}const d=o*l(t)+s*c(t)+i*h(t),u=a*l(t)+r*c(t)+n*h(t);return{x:d,y:u}}static getPointOnEllipticalArc(t,i,n,s,r,o){const a=Math.cos(o),l=Math.sin(o),c={x:n*Math.cos(r),y:s*Math.sin(r)};return{x:t+(c.x*a-c.y*l),y:i+(c.x*l+c.y*a)}}static parsePathData(t){if(!t)return[];let i=t;const n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];i=i.replace(new RegExp(" ","g"),",");for(let d=0;d<n.length;d++)i=i.replace(new RegExp(n[d],"g"),"|"+n[d]);const s=i.split("|"),r=[],o=[];let a=0,l=0;const c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let h;for(let d=1;d<s.length;d++){let u=s[d],f=u.charAt(0);for(u=u.slice(1),o.length=0;h=c.exec(u);)o.push(h[0]);let p=[],_=f==="A"||f==="a"?0:-1;for(let b=0,w=o.length;b<w;b++){const y=o[b];if(y==="00"){p.push(0,0),_>=0&&(_+=2,_>=7&&(_-=7));continue}if(_>=0){if(_===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(y)){p.push(parseInt(y[0],10)),p.push(parseInt(y[1],10)),p.push(parseFloat(y.slice(2))),_+=3,_>=7&&(_-=7);continue}if(y==="11"||y==="10"||y==="01"){p.push(parseInt(y[0],10)),p.push(parseInt(y[1],10)),_+=2,_>=7&&(_-=7);continue}if(y==="0"||y==="1"){p.push(parseInt(y,10)),_+=1,_>=7&&(_-=7);continue}}else if(_===4){if(/^[01]\d+(?:\.\d+)?$/.test(y)){p.push(parseInt(y[0],10)),p.push(parseFloat(y.slice(1))),_+=2,_>=7&&(_-=7);continue}if(y==="0"||y==="1"){p.push(parseInt(y,10)),_+=1,_>=7&&(_-=7);continue}}const x=parseFloat(y);isNaN(x)?p.push(0):p.push(x),_+=1,_>=7&&(_-=7)}else{const x=parseFloat(y);isNaN(x)?p.push(0):p.push(x)}}for(;p.length>0&&!isNaN(p[0]);){let b="",w=[];const y=a,x=l;let N,T,O,E,C,P,H,K,z,Z;switch(f){case"l":a+=p.shift(),l+=p.shift(),b="L",w.push(a,l);break;case"L":a=p.shift(),l=p.shift(),w.push(a,l);break;case"m":const J=p.shift(),A=p.shift();if(a+=J,l+=A,b="M",r.length>2&&r[r.length-1].command==="z"){for(let L=r.length-2;L>=0;L--)if(r[L].command==="M"){a=r[L].points[0]+J,l=r[L].points[1]+A;break}}w.push(a,l),f="l";break;case"M":a=p.shift(),l=p.shift(),b="M",w.push(a,l),f="L";break;case"h":a+=p.shift(),b="L",w.push(a,l);break;case"H":a=p.shift(),b="L",w.push(a,l);break;case"v":l+=p.shift(),b="L",w.push(a,l);break;case"V":l=p.shift(),b="L",w.push(a,l);break;case"C":w.push(p.shift(),p.shift(),p.shift(),p.shift()),a=p.shift(),l=p.shift(),w.push(a,l);break;case"c":w.push(a+p.shift(),l+p.shift(),a+p.shift(),l+p.shift()),a+=p.shift(),l+=p.shift(),b="C",w.push(a,l);break;case"S":T=a,O=l,N=r[r.length-1],N.command==="C"&&(T=a+(a-N.points[2]),O=l+(l-N.points[3])),w.push(T,O,p.shift(),p.shift()),a=p.shift(),l=p.shift(),b="C",w.push(a,l);break;case"s":T=a,O=l,N=r[r.length-1],N.command==="C"&&(T=a+(a-N.points[2]),O=l+(l-N.points[3])),w.push(T,O,a+p.shift(),l+p.shift()),a+=p.shift(),l+=p.shift(),b="C",w.push(a,l);break;case"Q":w.push(p.shift(),p.shift()),a=p.shift(),l=p.shift(),w.push(a,l);break;case"q":w.push(a+p.shift(),l+p.shift()),a+=p.shift(),l+=p.shift(),b="Q",w.push(a,l);break;case"T":T=a,O=l,N=r[r.length-1],N.command==="Q"&&(T=a+(a-N.points[0]),O=l+(l-N.points[1])),a=p.shift(),l=p.shift(),b="Q",w.push(T,O,a,l);break;case"t":T=a,O=l,N=r[r.length-1],N.command==="Q"&&(T=a+(a-N.points[0]),O=l+(l-N.points[1])),a+=p.shift(),l+=p.shift(),b="Q",w.push(T,O,a,l);break;case"A":E=p.shift(),C=p.shift(),P=p.shift(),H=p.shift(),K=p.shift(),z=a,Z=l,a=p.shift(),l=p.shift(),b="A",w=this.convertEndpointToCenterParameterization(z,Z,a,l,H,K,E,C,P);break;case"a":E=p.shift(),C=p.shift(),P=p.shift(),H=p.shift(),K=p.shift(),z=a,Z=l,a+=p.shift(),l+=p.shift(),b="A",w=this.convertEndpointToCenterParameterization(z,Z,a,l,H,K,E,C,P);break}r.push({command:b||f,points:w,start:{x:y,y:x},pathLength:this.calcLength(y,x,b||f,w)})}(f==="z"||f==="Z")&&r.push({command:"z",points:[],start:void 0,pathLength:0})}return r}static calcLength(t,i,n,s){let r,o,a,l;const c=Et;switch(n){case"L":return c.getLineLength(t,i,s[0],s[1]);case"C":return Wc([t,s[0],s[2],s[4]],[i,s[1],s[3],s[5]],1);case"Q":return Uc([t,s[0],s[2]],[i,s[1],s[3]],1);case"A":r=0;const h=s[4],d=s[5],u=s[4]+d;let f=Math.PI/180;if(Math.abs(h-u)<f&&(f=Math.abs(h-u)),o=c.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],h,0),d<0)for(l=h-f;l>u;l-=f)a=c.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],l,0),r+=c.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(l=h+f;l<u;l+=f)a=c.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],l,0),r+=c.getLineLength(o.x,o.y,a.x,a.y),o=a;return a=c.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],u,0),r+=c.getLineLength(o.x,o.y,a.x,a.y),r}return 0}static convertEndpointToCenterParameterization(t,i,n,s,r,o,a,l,c){const h=c*(Math.PI/180),d=Math.cos(h)*(t-n)/2+Math.sin(h)*(i-s)/2,u=-1*Math.sin(h)*(t-n)/2+Math.cos(h)*(i-s)/2,f=d*d/(a*a)+u*u/(l*l);f>1&&(a*=Math.sqrt(f),l*=Math.sqrt(f));let p=Math.sqrt((a*a*(l*l)-a*a*(u*u)-l*l*(d*d))/(a*a*(u*u)+l*l*(d*d)));r===o&&(p*=-1),isNaN(p)&&(p=0);const _=p*a*u/l,b=p*-l*d/a,w=(t+n)/2+Math.cos(h)*_-Math.sin(h)*b,y=(i+s)/2+Math.sin(h)*_+Math.cos(h)*b,x=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},N=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(x(H)*x(K))},T=function(H,K){return(H[0]*K[1]<H[1]*K[0]?-1:1)*Math.acos(N(H,K))},O=T([1,0],[(d-_)/a,(u-b)/l]),E=[(d-_)/a,(u-b)/l],C=[(-1*d-_)/a,(-1*u-b)/l];let P=T(E,C);return N(E,C)<=-1&&(P=Math.PI),N(E,C)>=1&&(P=0),o===0&&P>0&&(P=P-2*Math.PI),o===1&&P<0&&(P=P+2*Math.PI),[w,y,a,l,O,P,h,o]}}Et.prototype.className="Path",Et.prototype._attrsAffectingSize=["data"],kt(Et),m.addGetterSetter(Et,"data");class Pi extends je{_sceneFunc(t){super._sceneFunc(t);const i=Math.PI*2,n=this.points();let s=n;const r=this.tension()!==0&&n.length>4;r&&(s=this.getTensionPoints());const o=this.pointerLength(),a=n.length;let l,c;if(r){const u=[s[s.length-4],s[s.length-3],s[s.length-2],s[s.length-1],n[a-2],n[a-1]],f=Et.calcLength(s[s.length-4],s[s.length-3],"C",u),p=Et.getPointOnQuadraticBezier(Math.min(1,1-o/f),u[0],u[1],u[2],u[3],u[4],u[5]);l=n[a-2]-p.x,c=n[a-1]-p.y}else l=n[a-2]-n[a-4],c=n[a-1]-n[a-3];const h=(Math.atan2(c,l)+i)%i,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[a-2],n[a-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-o,d/2),t.lineTo(-o,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),r?(l=(s[0]+s[2])/2-n[0],c=(s[1]+s[3])/2-n[1]):(l=n[2]-n[0],c=n[3]-n[1]),t.rotate((Math.atan2(-c,-l)+i)%i),t.moveTo(0,0),t.lineTo(-o,d/2),t.lineTo(-o,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const i=this.dashEnabled();i&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),i&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),i=this.pointerWidth()/2;return{x:t.x,y:t.y-i,width:t.width,height:t.height+i*2}}}Pi.prototype.className="Arrow",kt(Pi),m.addGetterSetter(Pi,"pointerLength",10,$()),m.addGetterSetter(Pi,"pointerWidth",10,$()),m.addGetterSetter(Pi,"pointerAtBeginning",!1),m.addGetterSetter(Pi,"pointerAtEnding",!0);class Ji extends V{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Ji.prototype._centroid=!0,Ji.prototype.className="Circle",Ji.prototype._attrsAffectingSize=["radius"],kt(Ji),m.addGetterSetter(Ji,"radius",0,$());class ri extends V{_sceneFunc(t){const i=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),i!==n&&t.scale(1,n/i),t.arc(0,0,i,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}ri.prototype.className="Ellipse",ri.prototype._centroid=!0,ri.prototype._attrsAffectingSize=["radiusX","radiusY"],kt(ri),m.addComponentsGetterSetter(ri,"radius",["x","y"]),m.addGetterSetter(ri,"radiusX",0,$()),m.addGetterSetter(ri,"radiusY",0,$());class se extends V{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",i=>{this._removeImageLoad(i.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),i=this.hasShadow();return t&&i?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const i=this.getWidth(),n=this.getHeight(),s=this.cornerRadius(),r=this.attrs.image;let o;if(r){const a=this.attrs.cropWidth,l=this.attrs.cropHeight;a&&l?o=[r,this.cropX(),this.cropY(),a,l,0,0,i,n]:o=[r,0,0,i,n]}(this.hasFill()||this.hasStroke()||s)&&(t.beginPath(),s?S.drawRoundedRectPath(t,i,n,s):t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)),r&&(s&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){const i=this.width(),n=this.height(),s=this.cornerRadius();t.beginPath(),s?S.drawRoundedRectPath(t,i,n,s):t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,i,n;return(n=(t=this.attrs.width)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.width)!==null&&n!==void 0?n:0}getHeight(){var t,i,n;return(n=(t=this.attrs.height)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:0}static fromURL(t,i,n=null){const s=S.createImageElement();s.onload=function(){const r=new se({image:s});i(r)},s.onerror=n,s.crossOrigin="Anonymous",s.src=t}}se.prototype.className="Image",se.prototype._attrsAffectingSize=["image"],kt(se),m.addGetterSetter(se,"cornerRadius",0,Ws(4)),m.addGetterSetter(se,"image"),m.addComponentsGetterSetter(se,"crop",["x","y","width","height"]),m.addGetterSetter(se,"cropX",0,$()),m.addGetterSetter(se,"cropY",0,$()),m.addGetterSetter(se,"cropWidth",0,$()),m.addGetterSetter(se,"cropHeight",0,$());const Xc=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Dg="Change.konva",Vg="none",Eo="up",xo="right",Co="down",No="left",Fg=Xc.length;class To extends Ki{constructor(t){super(t),this.on("add.konva",function(i){this._addListeners(i.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){let i=this,n;const s=function(){i._sync()};for(n=0;n<Fg;n++)t.on(Xc[n]+Dg,s)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let t=this.getText(),i=this.getTag(),n,s,r,o,a,l,c;if(t&&i){switch(n=t.width(),s=t.height(),r=i.pointerDirection(),o=i.pointerWidth(),c=i.pointerHeight(),a=0,l=0,r){case Eo:a=n/2,l=-1*c;break;case xo:a=n+o,l=s/2;break;case Co:a=n/2,l=s+c;break;case No:a=-1*o,l=s/2;break}i.setAttrs({x:-1*a,y:-1*l,width:n,height:s}),t.setAttrs({x:-1*a,y:-1*l})}}}To.prototype.className="Label",kt(To);class Ai extends V{_sceneFunc(t){const i=this.width(),n=this.height(),s=this.pointerDirection(),r=this.pointerWidth(),o=this.pointerHeight(),a=this.cornerRadius();let l=0,c=0,h=0,d=0;typeof a=="number"?l=c=h=d=Math.min(a,i/2,n/2):(l=Math.min(a[0]||0,i/2,n/2),c=Math.min(a[1]||0,i/2,n/2),d=Math.min(a[2]||0,i/2,n/2),h=Math.min(a[3]||0,i/2,n/2)),t.beginPath(),t.moveTo(l,0),s===Eo&&(t.lineTo((i-r)/2,0),t.lineTo(i/2,-1*o),t.lineTo((i+r)/2,0)),t.lineTo(i-c,0),t.arc(i-c,c,c,Math.PI*3/2,0,!1),s===xo&&(t.lineTo(i,(n-o)/2),t.lineTo(i+r,n/2),t.lineTo(i,(n+o)/2)),t.lineTo(i,n-d),t.arc(i-d,n-d,d,0,Math.PI/2,!1),s===Co&&(t.lineTo((i+r)/2,n),t.lineTo(i/2,n+o),t.lineTo((i-r)/2,n)),t.lineTo(h,n),t.arc(h,n-h,h,Math.PI/2,Math.PI,!1),s===No&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*r,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){let t=0,i=0,n=this.pointerWidth(),s=this.pointerHeight(),r=this.pointerDirection(),o=this.width(),a=this.height();return r===Eo?(i-=s,a+=s):r===Co?a+=s:r===No?(t-=n*1.5,o+=n):r===xo&&(o+=n*1.5),{x:t,y:i,width:o,height:a}}}Ai.prototype.className="Tag",kt(Ai),m.addGetterSetter(Ai,"pointerDirection",Vg),m.addGetterSetter(Ai,"pointerWidth",0,$()),m.addGetterSetter(Ai,"pointerHeight",0,$()),m.addGetterSetter(Ai,"cornerRadius",0,Ws(4));class jn extends V{_sceneFunc(t){const i=this.cornerRadius(),n=this.width(),s=this.height();t.beginPath(),i?S.drawRoundedRectPath(t,n,s,i):t.rect(0,0,n,s),t.closePath(),t.fillStrokeShape(this)}}jn.prototype.className="Rect",kt(jn),m.addGetterSetter(jn,"cornerRadius",0,Ws(4));class oi extends V{_sceneFunc(t){const i=this._getPoints(),n=this.radius(),s=this.sides(),r=this.cornerRadius();if(t.beginPath(),r)S.drawRoundedPolygonPath(t,i,s,n,r);else{t.moveTo(i[0].x,i[0].y);for(let o=1;o<i.length;o++)t.lineTo(i[o].x,i[o].y)}t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,i=this.attrs.radius||0,n=[];for(let s=0;s<t;s++)n.push({x:i*Math.sin(s*2*Math.PI/t),y:-1*i*Math.cos(s*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();let i=t[0].x,n=t[0].x,s=t[0].y,r=t[0].y;return t.forEach(o=>{i=Math.min(i,o.x),n=Math.max(n,o.x),s=Math.min(s,o.y),r=Math.max(r,o.y)}),{x:i,y:s,width:n-i,height:r-s}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}oi.prototype.className="RegularPolygon",oi.prototype._centroid=!0,oi.prototype._attrsAffectingSize=["radius"],kt(oi),m.addGetterSetter(oi,"radius",0,$()),m.addGetterSetter(oi,"sides",0,$()),m.addGetterSetter(oi,"cornerRadius",0,Ws(4));const zc=Math.PI*2;class Ri extends V{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,zc,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),zc,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Ri.prototype.className="Ring",Ri.prototype._centroid=!0,Ri.prototype._attrsAffectingSize=["innerRadius","outerRadius"],kt(Ri),m.addGetterSetter(Ri,"innerRadius",0,$()),m.addGetterSetter(Ri,"outerRadius",0,$());class Pe extends V{constructor(t){super(t),this._updated=!0,this.anim=new oe(()=>{const i=this._updated;return this._updated=!1,i}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){const i=this.animation(),n=this.frameIndex(),s=n*4,r=this.animations()[i],o=this.frameOffsets(),a=r[s+0],l=r[s+1],c=r[s+2],h=r[s+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,c,h),t.closePath(),t.fillStrokeShape(this)),d)if(o){const u=o[i],f=n*2;t.drawImage(d,a,l,c,h,u[f+0],u[f+1],c,h)}else t.drawImage(d,a,l,c,h,0,0,c,h)}_hitFunc(t){const i=this.animation(),n=this.frameIndex(),s=n*4,r=this.animations()[i],o=this.frameOffsets(),a=r[s+2],l=r[s+3];if(t.beginPath(),o){const c=o[i],h=n*2;t.rect(c[h+0],c[h+1],a,l)}else t.rect(0,0,a,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const t=this.frameIndex(),i=this.animation(),n=this.animations(),s=n[i],r=s.length/4;t<r-1?this.frameIndex(t+1):this.frameIndex(0)}}Pe.prototype.className="Sprite",kt(Pe),m.addGetterSetter(Pe,"animation"),m.addGetterSetter(Pe,"animations"),m.addGetterSetter(Pe,"frameOffsets"),m.addGetterSetter(Pe,"image"),m.addGetterSetter(Pe,"frameIndex",0,$()),m.addGetterSetter(Pe,"frameRate",17,$()),m.backCompat(Pe,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class ai extends V{_sceneFunc(t){const i=this.innerRadius(),n=this.outerRadius(),s=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(let r=1;r<s*2;r++){const o=r%2===0?n:i,a=o*Math.sin(r*Math.PI/s),l=-1*o*Math.cos(r*Math.PI/s);t.lineTo(a,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}ai.prototype.className="Star",ai.prototype._centroid=!0,ai.prototype._attrsAffectingSize=["innerRadius","outerRadius"],kt(ai),m.addGetterSetter(ai,"numPoints",5,$()),m.addGetterSetter(ai,"innerRadius",0,$()),m.addGetterSetter(ai,"outerRadius",0,$());function li(e){return[...e].reduce((t,i,n,s)=>{if(new RegExp("\\p{Emoji}","u").test(i)){const r=s[n+1];r&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(r)?(t.push(i+r),s[n+1]=""):t.push(i)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(i+(s[n+1]||""))?t.push(i+s[n+1]):n>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(i)?t[t.length-1]+=i:i&&t.push(i);return t},[])}const Qi="auto",Gg="center",Yc="inherit",Xn="justify",Bg="Change.konva",$g="2d",qc="-",Kc="left",Hg="text",Wg="Text",Ug="top",jg="bottom",Jc="middle",Qc="normal",Xg="px ",Qs=" ",zg="right",Zc="rtl",Yg="word",qg="char",th="none",ko="…",eh=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Kg=eh.length;function Jg(e){return e.split(",").map(t=>{t=t.trim();const i=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return i&&!n&&(t=`"${t}"`),t}).join(", ")}let Zs;function Oo(){return Zs||(Zs=S.createCanvasElement().getContext($g),Zs)}function Qg(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Zg(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function t1(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class xt extends V{constructor(t){super(t1(t)),this._partialTextX=0,this._partialTextY=0;for(let i=0;i<Kg;i++)this.on(eh[i]+Bg,this._setTextData);this._setTextData()}_sceneFunc(t){var i,n;const s=this.textArr,r=s.length;if(!this.text())return;let o=this.padding(),a=this.fontSize(),l=this.lineHeight()*a,c=this.verticalAlign(),h=this.direction(),d=0,u=this.align(),f=this.getWidth(),p=this.letterSpacing(),_=this.charRenderFunc(),b=this.fill(),w=this.textDecoration(),y=w.indexOf("underline")!==-1,x=w.indexOf("line-through")!==-1,N;h=h===Yc?t.direction:h;let T=l/2,O=Jc;if(!X.legacyTextRendering){const E=this.measureSize("M");O="alphabetic";const C=(i=E.fontBoundingBoxAscent)!==null&&i!==void 0?i:E.actualBoundingBoxAscent,P=(n=E.fontBoundingBoxDescent)!==null&&n!==void 0?n:E.actualBoundingBoxDescent;T=(C-P)/2+l/2}for(h===Zc&&t.setAttr("direction",h),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",O),t.setAttr("textAlign",Kc),c===Jc?d=(this.getHeight()-r*l-o*2)/2:c===jg&&(d=this.getHeight()-r*l-o*2),t.translate(o,d+o),N=0;N<r;N++){let E=0,C=0;const P=s[N],H=P.text,K=P.width,z=P.lastInParagraph;if(t.save(),u===zg?E+=f-K-o*2:u===Gg&&(E+=(f-K-o*2)/2),y){t.save(),t.beginPath();const J=X.legacyTextRendering?Math.round(a/2):Math.round(a/4),A=E,L=T+C+J;t.moveTo(A,L);const B=u===Xn&&!z?f-o*2:K;t.lineTo(A+Math.round(B),L),t.lineWidth=a/15;const D=this._getLinearGradient();t.strokeStyle=D||b,t.stroke(),t.restore()}const Z=E;if(h!==Zc&&(p!==0||u===Xn||_)){const J=H.split(" ").length-1,A=li(H);for(let L=0;L<A.length;L++){const B=A[L];if(B===" "&&!z&&u===Xn&&(E+=(f-o*2-K)/J),this._partialTextX=E,this._partialTextY=T+C,this._partialText=B,_){t.save();const nt=s.slice(0,N).reduce((ot,mt)=>ot+li(mt.text).length,0),ht=L+nt;_({char:B,index:ht,x:E,y:T+C,lineIndex:N,column:L,isLastInLine:z,width:this.measureSize(B).width,context:t})}t.fillStrokeShape(this),_&&t.restore(),E+=this.measureSize(B).width+p}}else p!==0&&t.setAttr("letterSpacing",`${p}px`),this._partialTextX=E,this._partialTextY=T+C,this._partialText=H,t.fillStrokeShape(this);if(x){t.save(),t.beginPath();const J=X.legacyTextRendering?0:-Math.round(a/4),A=Z;t.moveTo(A,T+C+J);const L=u===Xn&&!z?f-o*2:K;t.lineTo(A+Math.round(L),T+C+J),t.lineWidth=a/15;const B=this._getLinearGradient();t.strokeStyle=B||b,t.stroke(),t.restore()}t.restore(),r>1&&(T+=l)}}_hitFunc(t){const i=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)}setText(t){const i=S._isString(t)?t:t==null?"":t+"";return this._setAttr(Hg,i),this}getWidth(){return this.attrs.width===Qi||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Qi||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return S.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var i,n,s,r,o,a,l,c,h,d,u;let f=Oo(),p=this.fontSize(),_;f.save(),f.font=this._getContextFont(),_=f.measureText(t),f.restore();const b=p/100;return{actualBoundingBoxAscent:(i=_.actualBoundingBoxAscent)!==null&&i!==void 0?i:71.58203125*b,actualBoundingBoxDescent:(n=_.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(s=_.actualBoundingBoxLeft)!==null&&s!==void 0?s:-7.421875*b,actualBoundingBoxRight:(r=_.actualBoundingBoxRight)!==null&&r!==void 0?r:75.732421875*b,alphabeticBaseline:(o=_.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(a=_.emHeightAscent)!==null&&a!==void 0?a:100*b,emHeightDescent:(l=_.emHeightDescent)!==null&&l!==void 0?l:-20*b,fontBoundingBoxAscent:(c=_.fontBoundingBoxAscent)!==null&&c!==void 0?c:91*b,fontBoundingBoxDescent:(h=_.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*b,hangingBaseline:(d=_.hangingBaseline)!==null&&d!==void 0?d:72.80000305175781*b,ideographicBaseline:(u=_.ideographicBaseline)!==null&&u!==void 0?u:-21*b,width:_.width,height:p}}_getContextFont(){return this.fontStyle()+Qs+this.fontVariant()+Qs+(this.fontSize()+Xg)+Jg(this.fontFamily())}_addTextLine(t){this.align()===Xn&&(t=t.trim());const n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){const i=this.letterSpacing(),n=t.length;return Oo().measureText(t).width+i*n}_setTextData(){let t=this.text().split(`
30
- `),i=+this.fontSize(),n=0,s=this.lineHeight()*i,r=this.attrs.width,o=this.attrs.height,a=r!==Qi&&r!==void 0,l=o!==Qi&&o!==void 0,c=this.padding(),h=r-c*2,d=o-c*2,u=0,f=this.wrap(),p=f!==th,_=f!==qg&&p,b=this.ellipsis();this.textArr=[],Oo().font=this._getContextFont();const w=b?this._getTextWidth(ko):0;for(let y=0,x=t.length;y<x;++y){let N=t[y],T=this._getTextWidth(N);if(a&&T>h)for(;N.length>0;){let O=0,E=li(N).length,C="",P=0;for(;O<E;){const H=O+E>>>1,K=li(N),z=K.slice(0,H+1).join(""),Z=this._getTextWidth(z);(b&&l&&u+s>d?Z+w:Z)<=h?(O=H+1,C=z,P=Z):E=H}if(C){if(_){const z=li(N),Z=li(C),J=z[Z.length],A=J===Qs||J===qc;let L;if(A&&P<=h)L=Z.length;else{const B=Z.lastIndexOf(Qs),D=Z.lastIndexOf(qc);L=Math.max(B,D)+1}L>0&&(O=L,C=z.slice(0,O).join(""),P=this._getTextWidth(C))}if(C=C.trimRight(),this._addTextLine(C),n=Math.max(n,P),u+=s,this._shouldHandleEllipsis(u)){this._tryToAddEllipsisToLastLine();break}if(N=li(N).slice(O).join("").trimLeft(),N.length>0&&(T=this._getTextWidth(N),T<=h)){this._addTextLine(N),u+=s,n=Math.max(n,T);break}}else break}else this._addTextLine(N),u+=s,n=Math.max(n,T),this._shouldHandleEllipsis(u)&&y<x-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&u+s>d)break}this.textHeight=i,this.textWidth=n}_shouldHandleEllipsis(t){const i=+this.fontSize(),n=this.lineHeight()*i,s=this.attrs.height,r=s!==Qi&&s!==void 0,o=this.padding(),a=s-o*2;return!(this.wrap()!==th)||r&&t+n>a}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,i=t!==Qi&&t!==void 0,n=this.padding(),s=t-n*2,r=this.ellipsis(),o=this.textArr[this.textArr.length-1];!o||!r||(i&&(this._getTextWidth(o.text+ko)<s||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+ko))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,i=this.hasShadow();return t&&i?!0:super._useBufferCanvas()}}xt.prototype._fillFunc=Qg,xt.prototype._strokeFunc=Zg,xt.prototype.className=Wg,xt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],kt(xt),m.overWriteSetter(xt,"width",co()),m.overWriteSetter(xt,"height",co()),m.addGetterSetter(xt,"direction",Yc),m.addGetterSetter(xt,"fontFamily","Arial"),m.addGetterSetter(xt,"fontSize",12,$()),m.addGetterSetter(xt,"fontStyle",Qc),m.addGetterSetter(xt,"fontVariant",Qc),m.addGetterSetter(xt,"padding",0,$()),m.addGetterSetter(xt,"align",Kc),m.addGetterSetter(xt,"verticalAlign",Ug),m.addGetterSetter(xt,"lineHeight",1,$()),m.addGetterSetter(xt,"wrap",Yg),m.addGetterSetter(xt,"ellipsis",!1,_e()),m.addGetterSetter(xt,"letterSpacing",0,$()),m.addGetterSetter(xt,"text","",Ti()),m.addGetterSetter(xt,"textDecoration",""),m.addGetterSetter(xt,"charRenderFunc",void 0);const e1="",ih="normal";function nh(e){e.fillText(this.partialText,0,0)}function sh(e){e.strokeText(this.partialText,0,0)}class Vt extends V{constructor(t){super(t),this.dummyCanvas=S.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Et.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const i=this.pathLength;return t>i?null:Et.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Et.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();const i=this.textDecoration(),n=this.fill(),s=this.fontSize(),r=this.glyphInfo,o=i.indexOf("underline")!==-1,a=i.indexOf("line-through")!==-1;o&&t.beginPath();for(let l=0;l<r.length;l++){t.save();const c=r[l].p0;t.translate(c.x,c.y),t.rotate(r[l].rotation),this.partialText=r[l].text,t.fillStrokeShape(this),o&&(l===0&&t.moveTo(0,s/2+1),t.lineTo(r[l].width,s/2+1)),t.restore()}if(o&&(t.strokeStyle=n,t.lineWidth=s/20,t.stroke()),a){t.beginPath();for(let l=0;l<r.length;l++){t.save();const c=r[l].p0;t.translate(c.x,c.y),t.rotate(r[l].rotation),l===0&&t.moveTo(0,0),t.lineTo(r[l].width,0),t.restore()}t.strokeStyle=n,t.lineWidth=s/20,t.stroke()}t.restore()}_hitFunc(t){t.beginPath();const i=this.glyphInfo;if(i.length>=1){const n=i[0].p0;t.moveTo(n.x,n.y)}for(let n=0;n<i.length;n++){const s=i[n].p1;t.lineTo(s.x,s.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return S.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return xt.prototype.setText.call(this,t)}_getContextFont(){return xt.prototype._getContextFont.call(this)}_getTextSize(t){const n=this.dummyCanvas.getContext("2d");n.save(),n.font=this._getContextFont();const s=n.measureText(t);return n.restore(),{width:s.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const t=li(this.text()),i=[];let n=0;for(let d=0;d<t.length;d++)i.push({char:t[d],width:this._getTextSize(t[d]).width}),n+=i[d].width;const{height:s}=this._getTextSize(this.attrs.text);if(this.textWidth=n,this.textHeight=s,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),o=this.align(),a=this.kerningFunc(),l=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let c=0;o==="center"&&(c=Math.max(0,this.pathLength/2-l/2)),o==="right"&&(c=Math.max(0,this.pathLength-l));let h=c;for(let d=0;d<i.length;d++){const u=this._getPointAtLength(h);if(!u)return;const f=i[d].char;let p=i[d].width+r;if(f===" "&&o==="justify"){const N=this.text().split(" ").length-1;p+=(this.pathLength-l)/N}const _=this._getPointAtLength(h+p);if(!_)return;const b=Et.getLineLength(u.x,u.y,_.x,_.y);let w=0;if(a)try{w=a(i[d-1].char,f)*this.fontSize()}catch{w=0}u.x+=w,_.x+=w,this.textWidth+=w;const y=Et.getPointOnLine(w+b/2,u.x,u.y,_.x,_.y),x=Math.atan2(_.y-u.y,_.x-u.x);this.glyphInfo.push({transposeX:y.x,transposeY:y.y,text:t[d],rotation:x,p0:u,p1:_,width:b}),h+=p}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});let i=t[0]||0,n=t[0]||0,s=t[1]||0,r=t[1]||0,o,a;for(let c=0;c<t.length/2;c++)o=t[c*2],a=t[c*2+1],i=Math.min(i,o),n=Math.max(n,o),s=Math.min(s,a),r=Math.max(r,a);const l=this.fontSize();return{x:i-l/2,y:s-l/2,width:n-i+l,height:r-s+l}}destroy(){return S.releaseCanvas(this.dummyCanvas),super.destroy()}}Vt.prototype._fillFunc=nh,Vt.prototype._strokeFunc=sh,Vt.prototype._fillFuncHit=nh,Vt.prototype._strokeFuncHit=sh,Vt.prototype.className="TextPath",Vt.prototype._attrsAffectingSize=["text","fontSize","data"],kt(Vt),m.addGetterSetter(Vt,"data"),m.addGetterSetter(Vt,"fontFamily","Arial"),m.addGetterSetter(Vt,"fontSize",12,$()),m.addGetterSetter(Vt,"fontStyle",ih),m.addGetterSetter(Vt,"align","left"),m.addGetterSetter(Vt,"letterSpacing",0,$()),m.addGetterSetter(Vt,"textBaseline","middle"),m.addGetterSetter(Vt,"fontVariant",ih),m.addGetterSetter(Vt,"text",e1),m.addGetterSetter(Vt,"textDecoration",""),m.addGetterSetter(Vt,"kerningFunc",void 0);const rh="tr-konva",i1=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${rh}`).join(" "),oh="nodesRect",n1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],s1={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},r1="ontouchstart"in X._global;function o1(e,t,i){if(e==="rotater")return i;t+=S.degToRad(s1[e]||0);const n=(S.radToDeg(t)%360+360)%360;return S._inRange(n,315+22.5,360)||S._inRange(n,0,22.5)?"ns-resize":S._inRange(n,45-22.5,45+22.5)?"nesw-resize":S._inRange(n,90-22.5,90+22.5)?"ew-resize":S._inRange(n,135-22.5,135+22.5)?"nwse-resize":S._inRange(n,180-22.5,180+22.5)?"ns-resize":S._inRange(n,225-22.5,225+22.5)?"nesw-resize":S._inRange(n,270-22.5,270+22.5)?"ew-resize":S._inRange(n,315-22.5,315+22.5)?"nwse-resize":(S.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}const tr=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function a1(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function ah(e,t,i){const n=i.x+(e.x-i.x)*Math.cos(t)-(e.y-i.y)*Math.sin(t),s=i.y+(e.x-i.x)*Math.sin(t)+(e.y-i.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:s}}function l1(e,t){const i=a1(e);return ah(e,t,i)}function c1(e,t,i){let n=t;for(let s=0;s<e.length;s++){const r=X.getAngle(e[s]),o=Math.abs(r-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<i&&(n=r)}return n}let Po=0;class ct extends Ki{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(i1,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return S.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return rh+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const i=t.filter(s=>s.isAncestorOf(this)?(S.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=t=i,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(s=>{const r=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(s._attrsAffectingSize.length){const o=s._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");s.on(o,r)}s.on(n1.map(o=>o+`.${this._getEventNamespace()}`).join(" "),r),s.on(`absoluteTransformChange.${this._getEventNamespace()}`,r),this._proxyDrag(s)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let i;t.on(`dragstart.${this._getEventNamespace()}`,n=>{i=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!i)return;const s=t.getAbsolutePosition(),r=s.x-i.x,o=s.y-i.y;this.nodes().forEach(a=>{if(a===t||a.isDragging())return;const l=a.getAbsolutePosition();a.setAbsolutePosition({x:l.x+r,y:l.y+o}),a.startDrag(n)}),i=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(oh),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(oh,this.__getNodeRect)}__getNodeShape(t,i=this.rotation(),n){const s=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),a=s.x*r.x-t.offsetX()*r.x,l=s.y*r.y-t.offsetY()*r.y,c=(X.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:o.x+a*Math.cos(c)+l*Math.sin(-c),y:o.y+l*Math.cos(c)+a*Math.sin(c),width:s.width*r.x,height:s.height*r.y,rotation:c};return ah(h,-X.getAngle(i),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const i=[];this.nodes().map(c=>{const h=c.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),d=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],u=c.getAbsoluteTransform();d.forEach(function(f){const p=u.point(f);i.push(p)})});const n=new ie;n.rotate(-X.getAngle(this.rotation()));let s=1/0,r=1/0,o=-1/0,a=-1/0;i.forEach(function(c){const h=n.point(c);s===void 0&&(s=o=h.x,r=a=h.y),s=Math.min(s,h.x),r=Math.min(r,h.y),o=Math.max(o,h.x),a=Math.max(a,h.y)}),n.invert();const l=n.point({x:s,y:r});return{x:l.x,y:l.y,width:o-s,height:a-r,rotation:X.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),tr.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){const i=new jn({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:r1?10:"auto"}),n=this;i.on("mousedown touchstart",function(s){n._handleMouseDown(s)}),i.on("dragstart",s=>{i.stopDrag(),s.cancelBubble=!0}),i.on("dragend",s=>{s.cancelBubble=!0}),i.on("mouseenter",()=>{const s=X.getAngle(this.rotation()),r=this.rotateAnchorCursor(),o=o1(t,s,r);i.getStage().content&&(i.getStage().content.style.cursor=o),this._cursorChange=!0}),i.on("mouseout",()=>{i.getStage().content&&(i.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(i)}_createBack(){const t=new V({name:"back",width:0,height:0,sceneFunc(i,n){const s=n.getParent(),r=s.padding();i.beginPath(),i.rect(-r,-r,n.width()+r*2,n.height()+r*2),i.moveTo(n.width()/2,-r),s.rotateEnabled()&&s.rotateLineVisible()&&i.lineTo(n.width()/2,-s.rotateAnchorOffset()*S._sign(n.height())-r),i.fillStrokeShape(n)},hitFunc:(i,n)=>{if(!this.shouldOverdrawWholeArea())return;const s=this.padding();i.beginPath(),i.rect(-s,-s,n.width()+s*2,n.height()+s*2),i.fillStrokeShape(n)}});this.add(t),this._proxyDrag(t),t.on("dragstart",i=>{i.cancelBubble=!0}),t.on("dragmove",i=>{i.cancelBubble=!0}),t.on("dragend",i=>{i.cancelBubble=!0}),this.on("dragmove",i=>{this.update()})}_handleMouseDown(t){if(this._transforming)return;this._movingAnchorName=t.target.name().split(" ")[0];const i=this._getNodeRect(),n=i.width,s=i.height,r=Math.sqrt(Math.pow(n,2)+Math.pow(s,2));this.sin=Math.abs(s/r),this.cos=Math.abs(n/r),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const o=t.target.getAbsolutePosition(),a=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-o.x,y:a.y-o.y},Po++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){let i,n,s;const r=this.findOne("."+this._movingAnchorName),o=r.getStage();o.setPointersPositions(t);const a=o.getPointerPosition();let l={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const c=r.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(c,l,t)),r.setAbsolutePosition(l);const h=r.getAbsolutePosition();if(c.x===h.x&&c.y===h.y)return;if(this._movingAnchorName==="rotater"){const y=this._getNodeRect();i=r.x()-y.width/2,n=-r.y()+y.height/2;let x=Math.atan2(-n,i)+Math.PI/2;y.height<0&&(x-=Math.PI);const T=X.getAngle(this.rotation())+x,O=X.getAngle(this.rotationSnapTolerance()),C=c1(this.rotationSnaps(),T,O)-y.rotation,P=l1(y,C);this._fitNodesInto(P,t);return}const d=this.shiftBehavior();let u;d==="inverted"?u=this.keepRatio()&&!t.shiftKey:d==="none"?u=this.keepRatio():u=this.keepRatio()||t.shiftKey;let f=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(u){const y=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};s=Math.sqrt(Math.pow(y.x-r.x(),2)+Math.pow(y.y-r.y(),2));const x=this.findOne(".top-left").x()>y.x?-1:1,N=this.findOne(".top-left").y()>y.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,this.findOne(".top-left").x(y.x-i),this.findOne(".top-left").y(y.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(r.y());else if(this._movingAnchorName==="top-right"){if(u){const y=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};s=Math.sqrt(Math.pow(r.x()-y.x,2)+Math.pow(y.y-r.y(),2));const x=this.findOne(".top-right").x()<y.x?-1:1,N=this.findOne(".top-right").y()>y.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,this.findOne(".top-right").x(y.x+i),this.findOne(".top-right").y(y.y-n)}var p=r.position();this.findOne(".top-left").y(p.y),this.findOne(".bottom-right").x(p.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(r.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(r.x());else if(this._movingAnchorName==="bottom-left"){if(u){const y=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};s=Math.sqrt(Math.pow(y.x-r.x(),2)+Math.pow(r.y()-y.y,2));const x=y.x<r.x()?-1:1,N=r.y()<y.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,r.x(y.x-i),r.y(y.y+n)}p=r.position(),this.findOne(".top-left").x(p.x),this.findOne(".bottom-right").y(p.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(r.y());else if(this._movingAnchorName==="bottom-right"){if(u){const y=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};s=Math.sqrt(Math.pow(r.x()-y.x,2)+Math.pow(r.y()-y.y,2));const x=this.findOne(".bottom-right").x()<y.x?-1:1,N=this.findOne(".bottom-right").y()<y.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,this.findOne(".bottom-right").x(y.x+i),this.findOne(".bottom-right").y(y.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(f=this.centeredScaling()||t.altKey,f){const y=this.findOne(".top-left"),x=this.findOne(".bottom-right"),N=y.x(),T=y.y(),O=this.getWidth()-x.x(),E=this.getHeight()-x.y();x.move({x:-N,y:-T}),y.move({x:O,y:E})}const _=this.findOne(".top-left").getAbsolutePosition();i=_.x,n=_.y;const b=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),w=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:i,y:n,width:b,height:w,rotation:X.getAngle(this.rotation())},t)}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var i;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const n=this.getNode();Po--,this._fire("transformend",{evt:t,target:n}),(i=this.getLayer())===null||i===void 0||i.batchDraw(),n&&this._nodes.forEach(s=>{var r;s._fire("transformend",{evt:t,target:s}),(r=s.getLayer())===null||r===void 0||r.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,i){const n=this._getNodeRect(),s=1;if(S._inRange(t.width,-this.padding()*2-s,s)){this.update();return}if(S._inRange(t.height,-this.padding()*2-s,s)){this.update();return}const r=new ie;if(r.rotate(X.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const u=r.point({x:-this.padding()*2,y:0});t.x+=u.x,t.y+=u.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const u=r.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const u=r.point({x:0,y:-this.padding()*2});t.x+=u.x,t.y+=u.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const u=r.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const u=this.boundBoxFunc()(n,t);u?t=u:S.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,a=new ie;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/o,n.height/o);const l=new ie,c=t.width/o,h=t.height/o;this.flipEnabled()===!1?(l.translate(t.x,t.y),l.rotate(t.rotation),l.translate(t.width<0?t.width:0,t.height<0?t.height:0),l.scale(Math.abs(c),Math.abs(h))):(l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(c,h));const d=l.multiply(a.invert());this._nodes.forEach(u=>{var f;if(!u.getStage())return;const p=u.getParent().getAbsoluteTransform(),_=u.getTransform().copy();_.translate(u.offsetX(),u.offsetY());const b=new ie;b.multiply(p.copy().invert()).multiply(d).multiply(p).multiply(_);const w=b.decompose();u.setAttrs(w),(f=u.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(S._getRotation(t.rotation)),this._nodes.forEach(u=>{this._fire("transform",{evt:i,target:u}),u._fire("transform",{evt:i,target:u})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,i){this.findOne(t).setAttrs(i)}update(){var t;const i=this._getNodeRect();this.rotation(S._getRotation(i.rotation));const n=i.width,s=i.height,r=this.enabledAnchors(),o=this.resizeEnabled(),a=this.padding(),l=this.anchorSize(),c=this.find("._anchor");c.forEach(d=>{d.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+a,offsetY:l/2+a,visible:o&&r.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:l/2+a,visible:o&&r.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:l/2-a,offsetY:l/2+a,visible:o&&r.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:s/2,offsetX:l/2+a,visible:o&&r.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:s/2,offsetX:l/2-a,visible:o&&r.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:s,offsetX:l/2+a,offsetY:l/2-a,visible:o&&r.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:s,offsetY:l/2-a,visible:o&&r.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:s,offsetX:l/2-a,offsetY:l/2-a,visible:o&&r.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*S._sign(s)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:s,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(d=>d.draggable()),x:0,y:0});const h=this.anchorStyleFunc();h&&c.forEach(d=>{h(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Ki.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return G.prototype.toObject.call(this)}clone(t){return G.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}ct.isTransforming=()=>Po>0;function h1(e){return e instanceof Array||S.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){tr.indexOf(t)===-1&&S.warn("Unknown anchor name: "+t+". Available names are: "+tr.join(", "))}),e||[]}ct.prototype.className="Transformer",kt(ct),m.addGetterSetter(ct,"enabledAnchors",tr,h1),m.addGetterSetter(ct,"flipEnabled",!0,_e()),m.addGetterSetter(ct,"resizeEnabled",!0),m.addGetterSetter(ct,"anchorSize",10,$()),m.addGetterSetter(ct,"rotateEnabled",!0),m.addGetterSetter(ct,"rotateLineVisible",!0),m.addGetterSetter(ct,"rotationSnaps",[]),m.addGetterSetter(ct,"rotateAnchorOffset",50,$()),m.addGetterSetter(ct,"rotateAnchorCursor","crosshair"),m.addGetterSetter(ct,"rotationSnapTolerance",5,$()),m.addGetterSetter(ct,"borderEnabled",!0),m.addGetterSetter(ct,"anchorStroke","rgb(0, 161, 255)"),m.addGetterSetter(ct,"anchorStrokeWidth",1,$()),m.addGetterSetter(ct,"anchorFill","white"),m.addGetterSetter(ct,"anchorCornerRadius",0,$()),m.addGetterSetter(ct,"borderStroke","rgb(0, 161, 255)"),m.addGetterSetter(ct,"borderStrokeWidth",1,$()),m.addGetterSetter(ct,"borderDash"),m.addGetterSetter(ct,"keepRatio",!0),m.addGetterSetter(ct,"shiftBehavior","default"),m.addGetterSetter(ct,"centeredScaling",!1),m.addGetterSetter(ct,"ignoreStroke",!1),m.addGetterSetter(ct,"padding",0,$()),m.addGetterSetter(ct,"nodes"),m.addGetterSetter(ct,"node"),m.addGetterSetter(ct,"boundBoxFunc"),m.addGetterSetter(ct,"anchorDragBoundFunc"),m.addGetterSetter(ct,"anchorStyleFunc"),m.addGetterSetter(ct,"shouldOverdrawWholeArea",!1),m.addGetterSetter(ct,"useSingleNodeRotation",!0),m.backCompat(ct,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Xe extends V{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,X.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Xe.prototype.className="Wedge",Xe.prototype._centroid=!0,Xe.prototype._attrsAffectingSize=["radius"],kt(Xe),m.addGetterSetter(Xe,"radius",0,$()),m.addGetterSetter(Xe,"angle",0,$()),m.addGetterSetter(Xe,"clockwise",!1),m.backCompat(Xe,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function lh(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const d1=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],u1=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function f1(e,t){const i=e.data,n=e.width,s=e.height;let r,o,a,l,c,h,d,u,f,p,_,b,w,y,x,N,T,O,E,C;const P=t+t+1,H=n-1,K=s-1,z=t+1,Z=z*(z+1)/2,J=new lh,A=d1[t],L=u1[t];let B=null,D=J,nt=null,ht=null;for(let ot=1;ot<P;ot++)D=D.next=new lh,ot===z&&(B=D);D.next=J,a=o=0;for(let ot=0;ot<s;ot++){b=w=y=x=l=c=h=d=0,u=z*(N=i[o]),f=z*(T=i[o+1]),p=z*(O=i[o+2]),_=z*(E=i[o+3]),l+=Z*N,c+=Z*T,h+=Z*O,d+=Z*E,D=J;for(let mt=0;mt<z;mt++)D.r=N,D.g=T,D.b=O,D.a=E,D=D.next;for(let mt=1;mt<z;mt++)r=o+((H<mt?H:mt)<<2),l+=(D.r=N=i[r])*(C=z-mt),c+=(D.g=T=i[r+1])*C,h+=(D.b=O=i[r+2])*C,d+=(D.a=E=i[r+3])*C,b+=N,w+=T,y+=O,x+=E,D=D.next;nt=J,ht=B;for(let mt=0;mt<n;mt++)i[o+3]=E=d*A>>L,E!==0?(E=255/E,i[o]=(l*A>>L)*E,i[o+1]=(c*A>>L)*E,i[o+2]=(h*A>>L)*E):i[o]=i[o+1]=i[o+2]=0,l-=u,c-=f,h-=p,d-=_,u-=nt.r,f-=nt.g,p-=nt.b,_-=nt.a,r=a+((r=mt+t+1)<H?r:H)<<2,b+=nt.r=i[r],w+=nt.g=i[r+1],y+=nt.b=i[r+2],x+=nt.a=i[r+3],l+=b,c+=w,h+=y,d+=x,nt=nt.next,u+=N=ht.r,f+=T=ht.g,p+=O=ht.b,_+=E=ht.a,b-=N,w-=T,y-=O,x-=E,ht=ht.next,o+=4;a+=n}for(let ot=0;ot<n;ot++){w=y=x=b=c=h=d=l=0,o=ot<<2,u=z*(N=i[o]),f=z*(T=i[o+1]),p=z*(O=i[o+2]),_=z*(E=i[o+3]),l+=Z*N,c+=Z*T,h+=Z*O,d+=Z*E,D=J;for(let Ot=0;Ot<z;Ot++)D.r=N,D.g=T,D.b=O,D.a=E,D=D.next;let mt=n;for(let Ot=1;Ot<=t;Ot++)o=mt+ot<<2,l+=(D.r=N=i[o])*(C=z-Ot),c+=(D.g=T=i[o+1])*C,h+=(D.b=O=i[o+2])*C,d+=(D.a=E=i[o+3])*C,b+=N,w+=T,y+=O,x+=E,D=D.next,Ot<K&&(mt+=n);o=ot,nt=J,ht=B;for(let Ot=0;Ot<s;Ot++)r=o<<2,i[r+3]=E=d*A>>L,E>0?(E=255/E,i[r]=(l*A>>L)*E,i[r+1]=(c*A>>L)*E,i[r+2]=(h*A>>L)*E):i[r]=i[r+1]=i[r+2]=0,l-=u,c-=f,h-=p,d-=_,u-=nt.r,f-=nt.g,p-=nt.b,_-=nt.a,r=ot+((r=Ot+z)<K?r:K)*n<<2,l+=b+=nt.r=i[r],c+=w+=nt.g=i[r+1],h+=y+=nt.b=i[r+2],d+=x+=nt.a=i[r+3],nt=nt.next,u+=N=ht.r,f+=T=ht.g,p+=O=ht.b,_+=E=ht.a,b-=N,w-=T,y-=O,x-=E,ht=ht.next,o+=n}}const p1=function(t){const i=Math.round(this.blurRadius());i>0&&f1(t,i)};m.addGetterSetter(G,"blurRadius",0,$(),m.afterSetFilter);const g1=function(e){const t=this.brightness()*255,i=e.data,n=i.length;for(let s=0;s<n;s+=4)i[s]+=t,i[s+1]+=t,i[s+2]+=t};m.addGetterSetter(G,"brightness",0,$(),m.afterSetFilter);const m1=function(e){const t=this.brightness(),i=e.data,n=i.length;for(let s=0;s<n;s+=4)i[s]=Math.min(255,i[s]*t),i[s+1]=Math.min(255,i[s+1]*t),i[s+2]=Math.min(255,i[s+2]*t)},_1=function(e){const t=Math.pow((this.contrast()+100)/100,2),i=e.data,n=i.length;let s=150,r=150,o=150;for(let a=0;a<n;a+=4)s=i[a],r=i[a+1],o=i[a+2],s/=255,s-=.5,s*=t,s+=.5,s*=255,r/=255,r-=.5,r*=t,r+=.5,r*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,s=s<0?0:s>255?255:s,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,i[a]=s,i[a+1]=r,i[a+2]=o};m.addGetterSetter(G,"contrast",0,$(),m.afterSetFilter);const v1=function(e){var t,i,n,s,r,o,a,l,c;const h=e.data,d=e.width,u=e.height,f=Math.min(1,Math.max(0,(i=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&i!==void 0?i:.5)),p=Math.min(1,Math.max(0,(s=(n=this.embossWhiteLevel)===null||n===void 0?void 0:n.call(this))!==null&&s!==void 0?s:.5)),b=(a={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(o=(r=this.embossDirection)===null||r===void 0?void 0:r.call(this))!==null&&o!==void 0?o:"top-left"])!==null&&a!==void 0?a:315,w=!!((c=(l=this.embossBlend)===null||l===void 0?void 0:l.call(this))!==null&&c!==void 0&&c),y=f*10,x=p*255,N=b*Math.PI/180,T=Math.cos(N),O=Math.sin(N),E=128/1020*y,C=new Uint8ClampedArray(h),P=new Float32Array(d*u);for(let J=0,A=0;A<h.length;A+=4,J++)P[J]=.2126*C[A]+.7152*C[A+1]+.0722*C[A+2];const H=[-1,0,1,-2,0,2,-1,0,1],K=[-1,-2,-1,0,0,0,1,2,1],z=[-d-1,-d,-d+1,-1,0,1,d-1,d,d+1],Z=J=>J<0?0:J>255?255:J;for(let J=1;J<u-1;J++)for(let A=1;A<d-1;A++){const L=J*d+A;let B=0,D=0;B+=P[L+z[0]]*H[0],D+=P[L+z[0]]*K[0],B+=P[L+z[1]]*H[1],D+=P[L+z[1]]*K[1],B+=P[L+z[2]]*H[2],D+=P[L+z[2]]*K[2],B+=P[L+z[3]]*H[3],D+=P[L+z[3]]*K[3],B+=P[L+z[5]]*H[5],D+=P[L+z[5]]*K[5],B+=P[L+z[6]]*H[6],D+=P[L+z[6]]*K[6],B+=P[L+z[7]]*H[7],D+=P[L+z[7]]*K[7],B+=P[L+z[8]]*H[8],D+=P[L+z[8]]*K[8];const nt=T*B+O*D,ht=Z(x+nt*E),ot=L*4;if(w){const mt=ht-x;h[ot]=Z(C[ot]+mt),h[ot+1]=Z(C[ot+1]+mt),h[ot+2]=Z(C[ot+2]+mt),h[ot+3]=C[ot+3]}else h[ot]=h[ot+1]=h[ot+2]=ht,h[ot+3]=C[ot+3]}for(let J=0;J<d;J++){let A=J*4,L=((u-1)*d+J)*4;h[A]=C[A],h[A+1]=C[A+1],h[A+2]=C[A+2],h[A+3]=C[A+3],h[L]=C[L],h[L+1]=C[L+1],h[L+2]=C[L+2],h[L+3]=C[L+3]}for(let J=1;J<u-1;J++){let A=J*d*4,L=(J*d+(d-1))*4;h[A]=C[A],h[A+1]=C[A+1],h[A+2]=C[A+2],h[A+3]=C[A+3],h[L]=C[L],h[L+1]=C[L+1],h[L+2]=C[L+2],h[L+3]=C[L+3]}return e};m.addGetterSetter(G,"embossStrength",.5,$(),m.afterSetFilter),m.addGetterSetter(G,"embossWhiteLevel",.5,$(),m.afterSetFilter),m.addGetterSetter(G,"embossDirection","top-left",void 0,m.afterSetFilter),m.addGetterSetter(G,"embossBlend",!1,void 0,m.afterSetFilter);function Ao(e,t,i,n,s){const r=i-t,o=s-n;if(r===0)return n+o/2;if(o===0)return n;let a=(e-t)/r;return a=o*a+n,a}const b1=function(e){const t=e.data,i=t.length;let n=t[0],s=n,r,o=t[1],a=o,l,c=t[2],h=c,d;const u=this.enhance();if(u===0)return;for(let x=0;x<i;x+=4)r=t[x+0],r<n?n=r:r>s&&(s=r),l=t[x+1],l<o?o=l:l>a&&(a=l),d=t[x+2],d<c?c=d:d>h&&(h=d);s===n&&(s=255,n=0),a===o&&(a=255,o=0),h===c&&(h=255,c=0);let f,p,_,b,w,y;if(u>0)f=s+u*(255-s),p=n-u*(n-0),_=a+u*(255-a),b=o-u*(o-0),w=h+u*(255-h),y=c-u*(c-0);else{const x=(s+n)*.5;f=s+u*(s-x),p=n+u*(n-x);const N=(a+o)*.5;_=a+u*(a-N),b=o+u*(o-N);const T=(h+c)*.5;w=h+u*(h-T),y=c+u*(c-T)}for(let x=0;x<i;x+=4)t[x+0]=Ao(t[x+0],n,s,p,f),t[x+1]=Ao(t[x+1],o,a,b,_),t[x+2]=Ao(t[x+2],c,h,y,w)};m.addGetterSetter(G,"enhance",0,$(),m.afterSetFilter);const y1=function(e){const t=e.data,i=t.length;for(let n=0;n<i;n+=4){const s=.34*t[n]+.5*t[n+1]+.16*t[n+2];t[n]=s,t[n+1]=s,t[n+2]=s}};m.addGetterSetter(G,"hue",0,$(),m.afterSetFilter),m.addGetterSetter(G,"saturation",0,$(),m.afterSetFilter),m.addGetterSetter(G,"luminance",0,$(),m.afterSetFilter);const S1=function(e){const t=e.data,i=t.length,n=1,s=Math.pow(2,this.saturation()),r=Math.abs(this.hue()+360)%360,o=this.luminance()*127,a=n*s*Math.cos(r*Math.PI/180),l=n*s*Math.sin(r*Math.PI/180),c=.299*n+.701*a+.167*l,h=.587*n-.587*a+.33*l,d=.114*n-.114*a-.497*l,u=.299*n-.299*a-.328*l,f=.587*n+.413*a+.035*l,p=.114*n-.114*a+.293*l,_=.299*n-.3*a+1.25*l,b=.587*n-.586*a-1.05*l,w=.114*n+.886*a-.2*l;let y,x,N,T;for(let O=0;O<i;O+=4)y=t[O+0],x=t[O+1],N=t[O+2],T=t[O+3],t[O+0]=c*y+h*x+d*N+o,t[O+1]=u*y+f*x+p*N+o,t[O+2]=_*y+b*x+w*N+o,t[O+3]=T},w1=function(e){const t=e.data,i=t.length,n=Math.pow(2,this.value()),s=Math.pow(2,this.saturation()),r=Math.abs(this.hue()+360)%360,o=n*s*Math.cos(r*Math.PI/180),a=n*s*Math.sin(r*Math.PI/180),l=.299*n+.701*o+.167*a,c=.587*n-.587*o+.33*a,h=.114*n-.114*o-.497*a,d=.299*n-.299*o-.328*a,u=.587*n+.413*o+.035*a,f=.114*n-.114*o+.293*a,p=.299*n-.3*o+1.25*a,_=.587*n-.586*o-1.05*a,b=.114*n+.886*o-.2*a;for(let w=0;w<i;w+=4){const y=t[w+0],x=t[w+1],N=t[w+2],T=t[w+3];t[w+0]=l*y+c*x+h*N,t[w+1]=d*y+u*x+f*N,t[w+2]=p*y+_*x+b*N,t[w+3]=T}};m.addGetterSetter(G,"hue",0,$(),m.afterSetFilter),m.addGetterSetter(G,"saturation",0,$(),m.afterSetFilter),m.addGetterSetter(G,"value",0,$(),m.afterSetFilter);const E1=function(e){const t=e.data,i=t.length;for(let n=0;n<i;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]},x1=function(e,t,i){const n=e.data,s=t.data,r=e.width,o=e.height,a=i.polarCenterX||r/2,l=i.polarCenterY||o/2;let c=Math.sqrt(a*a+l*l),h=r-a,d=o-l;const u=Math.sqrt(h*h+d*d);c=u>c?u:c;const f=o,p=r,_=360/p*Math.PI/180;for(let b=0;b<p;b+=1){const w=Math.sin(b*_),y=Math.cos(b*_);for(let x=0;x<f;x+=1){h=Math.floor(a+c*x/f*y),d=Math.floor(l+c*x/f*w);let N=(d*r+h)*4;const T=n[N+0],O=n[N+1],E=n[N+2],C=n[N+3];N=(b+x*r)*4,s[N+0]=T,s[N+1]=O,s[N+2]=E,s[N+3]=C}}},C1=function(e,t,i){const n=e.data,s=t.data,r=e.width,o=e.height,a=i.polarCenterX||r/2,l=i.polarCenterY||o/2;let c=Math.sqrt(a*a+l*l),h=r-a,d=o-l;const u=Math.sqrt(h*h+d*d);c=u>c?u:c;const f=o,p=r,_=0;let b,w;for(h=0;h<r;h+=1)for(d=0;d<o;d+=1){const y=h-a,x=d-l,N=Math.sqrt(y*y+x*x)*f/c;let T=(Math.atan2(x,y)*180/Math.PI+360+_)%360;T=T*p/360,b=Math.floor(T),w=Math.floor(N);let O=(w*r+b)*4;const E=n[O+0],C=n[O+1],P=n[O+2],H=n[O+3];O=(d*r+h)*4,s[O+0]=E,s[O+1]=C,s[O+2]=P,s[O+3]=H}},N1=function(e){const t=e.width,i=e.height;let n,s,r,o,a,l,c,h,d,u,f=Math.round(this.kaleidoscopePower());const p=Math.round(this.kaleidoscopeAngle()),_=Math.floor(t*(p%360)/360);if(f<1)return;const b=S.createCanvasElement();b.width=t,b.height=i;const w=b.getContext("2d").getImageData(0,0,t,i);S.releaseCanvas(b),x1(e,w,{polarCenterX:t/2,polarCenterY:i/2});let y=t/Math.pow(2,f);for(;y<=8;)y=y*2,f-=1;y=Math.ceil(y);let x=y,N=0,T=x,O=1;for(_+y>t&&(N=x,T=0,O=-1),s=0;s<i;s+=1)for(n=N;n!==T;n+=O)r=Math.round(n+_)%t,d=(t*s+r)*4,a=w.data[d+0],l=w.data[d+1],c=w.data[d+2],h=w.data[d+3],u=(t*s+n)*4,w.data[u+0]=a,w.data[u+1]=l,w.data[u+2]=c,w.data[u+3]=h;for(s=0;s<i;s+=1)for(x=Math.floor(y),o=0;o<f;o+=1){for(n=0;n<x+1;n+=1)d=(t*s+n)*4,a=w.data[d+0],l=w.data[d+1],c=w.data[d+2],h=w.data[d+3],u=(t*s+x*2-n-1)*4,w.data[u+0]=a,w.data[u+1]=l,w.data[u+2]=c,w.data[u+3]=h;x*=2}C1(w,e,{})};m.addGetterSetter(G,"kaleidoscopePower",2,$(),m.afterSetFilter),m.addGetterSetter(G,"kaleidoscopeAngle",0,$(),m.afterSetFilter);function er(e,t,i){let n=(i*e.width+t)*4;const s=[];return s.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),s}function zn(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function T1(e){const t=[0,0,0];for(let i=0;i<e.length;i++)t[0]+=e[i][0],t[1]+=e[i][1],t[2]+=e[i][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function k1(e,t){const i=er(e,0,0),n=er(e,e.width-1,0),s=er(e,0,e.height-1),r=er(e,e.width-1,e.height-1),o=t||10;if(zn(i,n)<o&&zn(n,r)<o&&zn(r,s)<o&&zn(s,i)<o){const a=T1([n,i,r,s]),l=[];for(let c=0;c<e.width*e.height;c++){const h=zn(a,[e.data[c*4],e.data[c*4+1],e.data[c*4+2]]);l[c]=h<o?0:255}return l}}function O1(e,t){for(let i=0;i<e.width*e.height;i++)e.data[4*i+3]=t[i]}function P1(e,t,i){const n=[1,1,1,1,0,1,1,1,1],s=Math.round(Math.sqrt(n.length)),r=Math.floor(s/2),o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++){const c=a*t+l;let h=0;for(let d=0;d<s;d++)for(let u=0;u<s;u++){const f=a+d-r,p=l+u-r;if(f>=0&&f<i&&p>=0&&p<t){const _=f*t+p,b=n[d*s+u];h+=e[_]*b}}o[c]=h===2040?255:0}return o}function A1(e,t,i){const n=[1,1,1,1,1,1,1,1,1],s=Math.round(Math.sqrt(n.length)),r=Math.floor(s/2),o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++){const c=a*t+l;let h=0;for(let d=0;d<s;d++)for(let u=0;u<s;u++){const f=a+d-r,p=l+u-r;if(f>=0&&f<i&&p>=0&&p<t){const _=f*t+p,b=n[d*s+u];h+=e[_]*b}}o[c]=h>=1020?255:0}return o}function R1(e,t,i){const n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],s=Math.round(Math.sqrt(n.length)),r=Math.floor(s/2),o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++){const c=a*t+l;let h=0;for(let d=0;d<s;d++)for(let u=0;u<s;u++){const f=a+d-r,p=l+u-r;if(f>=0&&f<i&&p>=0&&p<t){const _=f*t+p,b=n[d*s+u];h+=e[_]*b}}o[c]=h}return o}const M1=function(e){const t=this.threshold();let i=k1(e,t);return i&&(i=P1(i,e.width,e.height),i=A1(i,e.width,e.height),i=R1(i,e.width,e.height),O1(e,i)),e};m.addGetterSetter(G,"threshold",0,$(),m.afterSetFilter);const L1=function(e){const t=this.noise()*255,i=e.data,n=i.length,s=t/2;for(let r=0;r<n;r+=4)i[r+0]+=s-2*s*Math.random(),i[r+1]+=s-2*s*Math.random(),i[r+2]+=s-2*s*Math.random()};m.addGetterSetter(G,"noise",.2,$(),m.afterSetFilter);const I1=function(e){let t=Math.ceil(this.pixelSize()),i=e.width,n=e.height,s=Math.ceil(i/t),r=Math.ceil(n/t),o=e.data;if(t<=0){S.error("pixelSize value can not be <= 0");return}for(let a=0;a<s;a+=1)for(let l=0;l<r;l+=1){let c=0,h=0,d=0,u=0;const f=a*t,p=f+t,_=l*t,b=_+t;let w=0;for(let y=f;y<p;y+=1)if(!(y>=i))for(let x=_;x<b;x+=1){if(x>=n)continue;const N=(i*x+y)*4;c+=o[N+0],h+=o[N+1],d+=o[N+2],u+=o[N+3],w+=1}c=c/w,h=h/w,d=d/w,u=u/w;for(let y=f;y<p;y+=1)if(!(y>=i))for(let x=_;x<b;x+=1){if(x>=n)continue;const N=(i*x+y)*4;o[N+0]=c,o[N+1]=h,o[N+2]=d,o[N+3]=u}}};m.addGetterSetter(G,"pixelSize",8,$(),m.afterSetFilter);const D1=function(e){const t=Math.round(this.levels()*254)+1,i=e.data,n=i.length,s=255/t;for(let r=0;r<n;r+=1)i[r]=Math.floor(i[r]/s)*s};m.addGetterSetter(G,"levels",.5,$(),m.afterSetFilter);const V1=function(e){const t=e.data,i=t.length,n=this.red(),s=this.green(),r=this.blue();for(let o=0;o<i;o+=4){const a=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255;t[o]=a*n,t[o+1]=a*s,t[o+2]=a*r,t[o+3]=t[o+3]}};m.addGetterSetter(G,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"blue",0,dc,m.afterSetFilter);const F1=function(e){const t=e.data,i=t.length,n=this.red(),s=this.green(),r=this.blue(),o=this.alpha();for(let a=0;a<i;a+=4){const l=1-o;t[a]=n*o+t[a]*l,t[a+1]=s*o+t[a+1]*l,t[a+2]=r*o+t[a+2]*l}};m.addGetterSetter(G,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"blue",0,dc,m.afterSetFilter),m.addGetterSetter(G,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const G1=function(e){const t=e.data,i=t.length;for(let n=0;n<i;n+=4){const s=t[n+0],r=t[n+1],o=t[n+2];t[n+0]=Math.min(255,s*.393+r*.769+o*.189),t[n+1]=Math.min(255,s*.349+r*.686+o*.168),t[n+2]=Math.min(255,s*.272+r*.534+o*.131)}},B1=function(e){const i=e.data;for(let n=0;n<i.length;n+=4){const s=i[n],r=i[n+1],o=i[n+2];.2126*s+.7152*r+.0722*o>=128&&(i[n]=255-s,i[n+1]=255-r,i[n+2]=255-o)}return e},$1=function(e){const t=this.threshold()*255,i=e.data,n=i.length;for(let s=0;s<n;s+=1)i[s]=i[s]<t?0:255};m.addGetterSetter(G,"threshold",.5,$(),m.afterSetFilter);const Yn=$c.Util._assign($c,{Arc:Ue,Arrow:Pi,Circle:Ji,Ellipse:ri,Image:se,Label:To,Tag:Ai,Line:je,Path:Et,Rect:jn,RegularPolygon:oi,Ring:Ri,Sprite:Pe,Star:ai,Text:xt,TextPath:Vt,Transformer:ct,Wedge:Xe,Filters:{Blur:p1,Brightness:m1,Brighten:g1,Contrast:_1,Emboss:v1,Enhance:b1,Grayscale:y1,HSL:S1,HSV:w1,Invert:E1,Kaleidoscope:N1,Mask:M1,Noise:L1,Pixelate:I1,Posterize:D1,RGB:V1,RGBA:F1,Sepia:G1,Solarize:B1,Threshold:$1}});function ir(e){if(!Yn.autoDrawEnabled){const t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const ch={key:!0,style:!0,elm:!0,isRootInsert:!0},Ro=".vue-konva-event";function hh(e,t,i,n){const s=e.__konvaNode,r={};let o=!1;for(let a in i){if(ch.hasOwnProperty(a))continue;const l=a.slice(0,2)==="on",c=i[a]!==t[a];if(l&&c){let h=a.slice(2).toLowerCase();h.slice(0,7)==="content"&&(h="content"+h.slice(7,1).toUpperCase()+h.slice(8)),s?.off(h+Ro,i[a])}!t.hasOwnProperty(a)&&s?.setAttr(a,void 0)}for(let a in t){if(ch.hasOwnProperty(a))continue;let l=a.slice(0,2)==="on";const c=i[a]!==t[a];if(l&&c){let h=a.slice(2).toLowerCase();h.slice(0,7)==="content"&&(h="content"+h.slice(7,1).toUpperCase()+h.slice(8)),t[a]&&(s?.off(h+Ro),s?.on(h+Ro,t[a]))}!l&&(t[a]!==i[a]||n&&t[a]!==s?.getAttr(a))&&(o=!0,r[a]=t[a])}o&&s&&(s.setAttrs(r),ir(s))}const H1="v";function W1(e){function t(i){return i?.__konvaNode?i:i?.parent?t(i.parent):(console.error("vue-konva error: Can not find parent node"),null)}return t(e.parent)}function dh(e){return e.component?e.component.__konvaNode||dh(e.component.subTree):null}function U1(e){const{el:t,component:i}=e,n=dh(e);if(t?.tagName&&i&&!n){const s=t.tagName.toLowerCase();return console.error(`vue-konva error: You are trying to render "${s}" inside your component tree. Looks like it is not a Konva node. You can render only Konva components inside the Stage.`),null}return n}function j1(e){const t=s=>!!s&&typeof s=="object"&&"component"in s,i=s=>Array.isArray(s),n=s=>t(s)?[s,...n(s.children)]:i(s)?s.flatMap(n):[];return n(e.children)}function uh(e,t){const i=j1(e),n=[];i.forEach(r=>{const o=U1(r);o&&n.push(o)});let s=!1;n.forEach((r,o)=>{r.getZIndex()!==o&&(r.setZIndex(o),s=!0)}),s&&ir(t)}const X1=Yn.default?.Stage||Yn.Stage,z1=Ne({name:"Stage",props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},inheritAttrs:!1,setup(e,{attrs:t,slots:i,expose:n}){const s=As();if(!s)return;const r=pi({}),o=Xt(null),a=new X1({width:e.config.width,height:e.config.height,container:document.createElement("div")});s.__konvaNode=a,h();function l(){return s?.__konvaNode}function c(){return s?.__konvaNode}function h(){if(!s)return;const d=r||{},u={...t,...e.config};hh(s,u,d,e.__useStrictMode),Object.assign(r,u)}return Rr(()=>{o.value&&(o.value.innerHTML="",a.container(o.value)),h()}),Mr(()=>{h(),uh(s.subTree,a)}),Na(()=>{a.destroy()}),yi(()=>e.config,h,{deep:!0}),n({getStage:c,getNode:l}),()=>pl("div",{ref:o,style:t?.style},i.default?.())}}),Y1=".vue-konva-event",q1={Group:!0,Layer:!0,FastLayer:!0,Label:!0};function K1(e,t){return Ne({name:e,props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},setup(i,{attrs:n,slots:s,expose:r}){const o=As();if(!o)return;const a=pi({}),l=new t;o.__konvaNode=l,o.vnode.__konvaNode=l,d();function c(){return o?.__konvaNode}function h(){return o?.__konvaNode}function d(){if(!o)return;const f={};for(const b in o?.vnode.props)b.slice(0,2)==="on"&&(f[b]=o.vnode.props[b]);const p=a||{},_={...n,...i.config,...f};hh(o,_,p,i.__useStrictMode),Object.assign(a,_)}Rr(()=>{const f=W1(o)?.__konvaNode;f&&"add"in f&&f.add(l),ir(l)}),Lr(()=>{ir(l),l.destroy(),l.off(Y1)}),Mr(()=>{d(),uh(o.subTree,l)}),yi(()=>i.config,d,{deep:!0}),r({getStage:h,getNode:c});const u=q1.hasOwnProperty(e);return()=>u?pl("template",{},s.default?.()):null}})}const J1={install:(e,t)=>{const i=t?.prefix||H1,n=Yn.default||Yn,s={Arc:n.Arc,Arrow:n.Arrow,Circle:n.Circle,Ellipse:n.Ellipse,FastLayer:n.FastLayer,Group:n.Group,Image:n.Image,Label:n.Label,Layer:n.Layer,Line:n.Line,Path:n.Path,Rect:n.Rect,RegularPolygon:n.RegularPolygon,Ring:n.Ring,Shape:n.Shape,Sprite:n.Sprite,Star:n.Star,Tag:n.Tag,Text:n.Text,TextPath:n.TextPath,Transformer:n.Transformer,Wedge:n.Wedge,...t?.customNodes};[z1,...Object.entries(s).map(([r,o])=>K1(r,o))].forEach(r=>{e.component(`${i}${r.name}`,r)})}},fh='@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-yellow-200:oklch(94.5% .129 101.54);--color-gray-100:oklch(96.7% .003 264.542);--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-bold:700;--radius-lg:.5rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ott-accent:#68a691;--color-ott-text-primary:#2f2f2f;--color-ott-text-secondary:#a1a1a1;--color-ott-text-white:#fff;--color-ott-bg-primary:#fff;--color-ott-bg-secondary:#f3f3f3;--color-ott-bg-dark:#d3d3d3;--color-ott-error:#cd3c3c}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.static{position:static}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-10{margin-bottom:calc(var(--spacing)*10)}.block{display:block}.flex{display:flex}.h-75{height:calc(var(--spacing)*75)}.h-full{height:100%}.w-1\\/3{width:33.3333%}.w-50{width:calc(var(--spacing)*50)}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-10{gap:calc(var(--spacing)*10)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-ott-bg-dark{border-color:var(--color-ott-bg-dark)}.border-ott-error\\!{border-color:var(--color-ott-error)!important}.border-b-ott-bg-dark{border-bottom-color:var(--color-ott-bg-dark)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-ott-accent{background-color:var(--color-ott-accent)}.bg-ott-bg-primary{background-color:var(--color-ott-bg-primary)}.bg-white{background-color:var(--color-white)}.bg-yellow-200{background-color:var(--color-yellow-200)}.p-4{padding:calc(var(--spacing)*4)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.text-ott-accent{color:var(--color-ott-accent)}.text-ott-error\\!{color:var(--color-ott-error)!important}.text-white{color:var(--color-white)}}html,body,#app,#__nuxt,:host{background-color:var(--color-ott-bg-secondary);width:100%;height:100%;color:var(--color-ott-text-primary);font-family:Poppins,sans-serif;font-style:normal;font-weight:400}button{cursor:pointer}h2{margin-block:calc(var(--spacing)*4);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}main{width:100%;height:100%;max-height:100vh;display:block;overflow:auto}.ott-button{cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing)*5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-ott-text-primary);height:fit-content;padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-ott-text-primary);display:flex}.ott-button:disabled{cursor:default;border-color:var(--color-ott-bg-dark);color:var(--color-ott-bg-dark)}.ott-button-action{cursor:pointer;align-items:center;gap:calc(var(--spacing)*5);border-radius:var(--radius-lg);border-color:var(--color-ott-accent);background-color:var(--color-ott-accent);width:100%;height:fit-content;padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-ott-text-white);display:flex}.ott-button-action:disabled{cursor:default;background-color:var(--color-ott-text-secondary)}input{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-ott-bg-dark);padding-inline:calc(var(--spacing)*3);padding-block:calc(var(--spacing)*1);border-radius:.25rem}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}',Q1=["width","height"],Z1=["transform"],t2=["transform","onClick"],e2=["transform"],i2=["width","height"],n2=["x","width","height"],s2=["transform"],r2=["x","y","font-size"],o2=["transform","onClick"],a2=["width","height"],l2=sc(Ne({__name:"DeckRendering",props:{deck:{type:Object,required:!0},scale:{type:Number,required:!0},availability:{type:Object},vertical:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const i=e,n=pi(new Map),s=pi(new Map),r=t,o=wi(()=>i.deck.deckspaces?.flatMap(h=>h instanceof me?h.passengerSpots?.filter(d=>d instanceof zi)||[]:[]).map(h=>(h.availability=i.availability&&h.attr_id?Pn[i.availability[h.attr_id]??"Undefined"]:Pn.Undefined,h))||[]),a=wi(()=>i.deck.deckspaces?.flatMap(h=>h instanceof me?h.deckEntrances??[]:[])??[]),l=wi(()=>{const{width:h,height:d}=i.deck.getBoundingBox();return{width:h*i.scale+10,height:d*i.scale+10}});function c(h,d){r("select",{element:d,ctrlKey:h.ctrlKey||h.metaKey})}return(h,d)=>(at(),vt("svg",{width:e.vertical?l.value.height:l.value.width,height:e.vertical?l.value.width:l.value.height,class:"vehicle-frame",style:{"user-select":"none"}},[ut("g",{class:ye(`${e.vertical?"vehicle-frame--vertical":""}`),transform:`rotate(
29
+ `,mc=()=>{if(typeof document>"u")throw new Error(B0)};class ne{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new ne(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const i=this.m;return{x:i[0]*t.x+i[2]*t.y+i[4],y:i[1]*t.x+i[3]*t.y+i[5]}}translate(t,i){return this.m[4]+=this.m[0]*t+this.m[2]*i,this.m[5]+=this.m[1]*t+this.m[3]*i,this}scale(t,i){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=i,this.m[3]*=i,this}rotate(t){const i=Math.cos(t),n=Math.sin(t),s=this.m[0]*i+this.m[2]*n,r=this.m[1]*i+this.m[3]*n,o=this.m[0]*-n+this.m[2]*i,a=this.m[1]*-n+this.m[3]*i;return this.m[0]=s,this.m[1]=r,this.m[2]=o,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,i){const n=this.m[0]+this.m[2]*i,s=this.m[1]+this.m[3]*i,r=this.m[2]+this.m[0]*t,o=this.m[3]+this.m[1]*t;return this.m[0]=n,this.m[1]=s,this.m[2]=r,this.m[3]=o,this}multiply(t){const i=this.m[0]*t.m[0]+this.m[2]*t.m[1],n=this.m[1]*t.m[0]+this.m[3]*t.m[1],s=this.m[0]*t.m[2]+this.m[2]*t.m[3],r=this.m[1]*t.m[2]+this.m[3]*t.m[3],o=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],a=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=i,this.m[1]=n,this.m[2]=s,this.m[3]=r,this.m[4]=o,this.m[5]=a,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),i=this.m[3]*t,n=-this.m[1]*t,s=-this.m[2]*t,r=this.m[0]*t,o=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=i,this.m[1]=n,this.m[2]=s,this.m[3]=r,this.m[4]=o,this.m[5]=a,this}getMatrix(){return this.m}decompose(){const t=this.m[0],i=this.m[1],n=this.m[2],s=this.m[3],r=this.m[4],o=this.m[5],a=t*s-i*n,l={x:r,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||i!=0){const h=Math.sqrt(t*t+i*i);l.rotation=i>0?Math.acos(t/h):-Math.acos(t/h),l.scaleX=h,l.scaleY=a/h,l.skewX=(t*n+i*s)/a,l.skewY=0}else if(n!=0||s!=0){const h=Math.sqrt(n*n+s*s);l.rotation=Math.PI/2-(s>0?Math.acos(-n/h):-Math.acos(n/h)),l.scaleX=a/h,l.scaleY=h,l.skewX=0,l.skewY=(t*n+i*s)/a}return l.rotation=w._getRotation(l.rotation),l}}const H0="[object Array]",W0="[object Number]",U0="[object String]",j0="[object Boolean]",X0=Math.PI/180,z0=180/Math.PI,Mn="#",Y0="",q0="0",K0="Konva warning: ",_c="Konva error: ",J0="rgb(",ho={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Q0=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let $s=[],Rn=null;const Z0=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},w={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===H0},_isNumber(e){return Object.prototype.toString.call(e)===W0&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===U0},_isBoolean(e){return Object.prototype.toString.call(e)===j0},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;const t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){$s.push(e),$s.length===1&&Z0(function(){const t=$s;$s=[],t.forEach(function(i){i()})})},createCanvasElement(){mc();const e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return mc(),document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){const i=w.createImageElement();i.onload=function(){t(i)},i.src=e},_rgbToHex(e,t,i){return((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},_hexToRgb(e){e=e.replace(Mn,Y0);const t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=q0+e;return Mn+e},isCanvasFarblingActive(){if(Rn!==null)return Rn;if(typeof document>"u")return Rn=!1,!1;const e=this.createCanvasElement();e.width=10,e.height=10;const t=e.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const i=t.getImageData(0,0,10,10).data;let n=!1;for(let s=0;s<100;s++)if(i[s*4]!==40||i[s*4+1]!==40||i[s*4+2]!==40||i[s*4+3]!==255){n=!0;break}return Rn=n,this.releaseCanvas(e),Rn},getHitColor(){const e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,i){return this.isCanvasFarblingActive()&&(e=Math.round(e/5)*5,t=Math.round(t/5)*5,i=Math.round(i/5)*5),Mn+this._rgbToHex(e,t,i)},getSnappedHexColor(e){const t=this._hexToRgb(e);return Mn+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(e){let t;return e in ho?(t=ho[e],{r:t[0],g:t[1],b:t[2]}):e[0]===Mn?this._hexToRgb(e.substring(1)):e.substr(0,4)===J0?(t=Q0.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",w._namedColorToRBA(e)||w._hex3ColorToRGBA(e)||w._hex4ColorToRGBA(e)||w._hex6ColorToRGBA(e)||w._hex8ColorToRGBA(e)||w._rgbColorToRGBA(e)||w._rgbaColorToRGBA(e)||w._hslColorToRGBA(e)},_namedColorToRBA(e){const t=ho[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];const t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];const t=e.split(/ *, */).map((i,n)=>i.slice(-1)==="%"?n===3?parseInt(i)/100:parseInt(i)/100*255:Number(i));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]==="#"&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]==="#"&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...i]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),n=Number(i[0])/360,s=Number(i[1])/100,r=Number(i[2])/100;let o,a,l;if(s===0)return l=r*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};r<.5?o=r*(1+s):o=r+s-r*s;const h=2*r-o,c=[0,0,0];for(let d=0;d<3;d++)a=n+1/3*-(d-1),a<0&&a++,a>1&&a--,6*a<1?l=h+(o-h)*6*a:2*a<1?l=o:3*a<2?l=h+(o-h)*(2/3-a)*6:l=h,c[d]=l*255;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)},cloneObject(e){const t={};for(const i in e)this._isPlainObject(e[i])?t[i]=this.cloneObject(e[i]):this._isArray(e[i])?t[i]=this.cloneArray(e[i]):t[i]=e[i];return t},cloneArray(e){return e.slice(0)},degToRad(e){return e*X0},radToDeg(e){return e*z0},_degToRad(e){return w.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),w.degToRad(e)},_radToDeg(e){return w.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),w.radToDeg(e)},_getRotation(e){return X.angleDeg?w.radToDeg(e):e},_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)},throw(e){throw new Error(_c+e)},error(e){console.error(_c+e)},warn(e){X.showWarnings&&console.warn(K0+e)},each(e,t){for(const i in e)t(i,e[i])},_inRange(e,t,i){return t<=e&&e<i},_getProjectionToSegment(e,t,i,n,s,r){let o,a,l;const h=(e-i)*(e-i)+(t-n)*(t-n);if(h==0)o=e,a=t,l=(s-i)*(s-i)+(r-n)*(r-n);else{const c=((s-e)*(i-e)+(r-t)*(n-t))/h;c<0?(o=e,a=t,l=(e-s)*(e-s)+(t-r)*(t-r)):c>1?(o=i,a=n,l=(i-s)*(i-s)+(n-r)*(n-r)):(o=e+c*(i-e),a=t+c*(n-t),l=(o-s)*(o-s)+(a-r)*(a-r))}return[o,a,l]},_getProjectionToLine(e,t,i){const n=w.cloneObject(e);let s=Number.MAX_VALUE;return t.forEach(function(r,o){if(!i&&o===t.length-1)return;const a=t[(o+1)%t.length],l=w._getProjectionToSegment(r.x,r.y,a.x,a.y,e.x,e.y),h=l[0],c=l[1],d=l[2];d<s&&(n.x=h,n.y=c,s=d)}),n},_prepareArrayForTween(e,t,i){const n=[],s=[];if(e.length>t.length){const o=t;t=e,e=o}for(let o=0;o<e.length;o+=2)n.push({x:e[o],y:e[o+1]});for(let o=0;o<t.length;o+=2)s.push({x:t[o],y:t[o+1]});const r=[];return s.forEach(function(o){const a=w._getProjectionToLine(o,n,i);r.push(a.x),r.push(a.y)}),r},_prepareToStringify(e){let t;e.visitedByCircularReferenceRemoval=!0;for(const i in e)if(e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"){if(t=Object.getOwnPropertyDescriptor(e,i),e[i].visitedByCircularReferenceRemoval||w._isElement(e[i]))if(t.configurable)delete e[i];else return null;else if(w._prepareToStringify(e[i])===null)if(t.configurable)delete e[i];else return null}return delete e.visitedByCircularReferenceRemoval,e},_assign(e,t){for(const i in t)e[i]=t[i];return e},_getFirstPointerId(e){return e.touches?e.changedTouches[0].identifier:e.pointerId||999},releaseCanvas(...e){X.releaseCanvasOnDestroy&&e.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(e,t,i,n){let s=t<0?t:0,r=i<0?i:0;t=Math.abs(t),i=Math.abs(i);let o=0,a=0,l=0,h=0;typeof n=="number"?o=a=l=h=Math.min(n,t/2,i/2):(o=Math.min(n[0]||0,t/2,i/2),a=Math.min(n[1]||0,t/2,i/2),h=Math.min(n[2]||0,t/2,i/2),l=Math.min(n[3]||0,t/2,i/2)),e.moveTo(s+o,r),e.lineTo(s+t-a,r),e.arc(s+t-a,r+a,a,Math.PI*3/2,0,!1),e.lineTo(s+t,r+i-h),e.arc(s+t-h,r+i-h,h,0,Math.PI/2,!1),e.lineTo(s+l,r+i),e.arc(s+l,r+i-l,l,Math.PI/2,Math.PI,!1),e.lineTo(s,r+o),e.arc(s+o,r+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,i,n,s){n=Math.abs(n);for(let r=0;r<i;r++){const o=t[(r-1+i)%i],a=t[r],l=t[(r+1)%i],h={x:a.x-o.x,y:a.y-o.y},c={x:l.x-a.x,y:l.y-a.y},d=Math.hypot(h.x,h.y),u=Math.hypot(c.x,c.y);let f;typeof s=="number"?f=s:f=r<s.length?s[r]:0,f=n*Math.cos(Math.PI/i)*Math.min(1,f/n*2);const _={x:h.x/d,y:h.y/d},v={x:c.x/u,y:c.y/u},S={x:a.x-_.x*f,y:a.y-_.y*f},b={x:a.x+v.x*f,y:a.y+v.y*f};r===0?e.moveTo(S.x,S.y):e.lineTo(S.x,S.y),e.arcTo(a.x,a.y,b.x,b.y,f)}}};function tg(e){const t=[],i=e.length,n=w;for(let s=0;s<i;s++){let r=e[s];n._isNumber(r)?r=Math.round(r*1e3)/1e3:n._isString(r)||(r=r+""),t.push(r)}return t}const yc=",",eg="(",ig=")",ng="([",sg="])",rg=";",og="()",ag="=",bc=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],lg=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],cg=100;let Bs=null;function vc(){if(Bs!==null)return Bs;try{const t=w.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(Bs=!1,!1)}catch{return Bs=!1,!1}}class Hs{constructor(t){this.canvas=t,X.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,i){let n=this.traceArr,s=n.length,r="",o,a,l,h;for(o=0;o<s;o++)a=n[o],l=a.method,l?(h=a.args,r+=l,t?r+=og:w._isArray(h[0])?r+=ng+h.join(yc)+sg:(i&&(h=h.map(c=>typeof c=="number"?Math.floor(c):c)),r+=eg+h.join(yc)+ig)):(r+=a.property,t||(r+=ag+a.val)),r+=rg;return r}clearTrace(){this.traceArr=[]}_trace(t){let i=this.traceArr,n;i.push(t),n=i.length,n>=cg&&i.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const i=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,i.getWidth()/i.pixelRatio,i.getHeight()/i.pixelRatio)}_applyLineCap(t){const i=t.attrs.lineCap;i&&this.setAttr("lineCap",i)}_applyOpacity(t){const i=t.getAbsoluteOpacity();i!==1&&this.setAttr("globalAlpha",i)}_applyLineJoin(t){const i=t.attrs.lineJoin;i&&this.setAttr("lineJoin",i)}_applyMiterLimit(t){const i=t.attrs.miterLimit;i!=null&&this.setAttr("miterLimit",i)}setAttr(t,i){this._context[t]=i}arc(t,i,n,s,r,o){this._context.arc(t,i,n,s,r,o)}arcTo(t,i,n,s,r){this._context.arcTo(t,i,n,s,r)}beginPath(){this._context.beginPath()}bezierCurveTo(t,i,n,s,r,o){this._context.bezierCurveTo(t,i,n,s,r,o)}clearRect(t,i,n,s){this._context.clearRect(t,i,n,s)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,i){const n=arguments;if(n.length===2)return this._context.createImageData(t,i);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,i,n,s){return this._context.createLinearGradient(t,i,n,s)}createPattern(t,i){return this._context.createPattern(t,i)}createRadialGradient(t,i,n,s,r,o){return this._context.createRadialGradient(t,i,n,s,r,o)}drawImage(t,i,n,s,r,o,a,l,h){const c=arguments,d=this._context;c.length===3?d.drawImage(t,i,n):c.length===5?d.drawImage(t,i,n,s,r):c.length===9&&d.drawImage(t,i,n,s,r,o,a,l,h)}ellipse(t,i,n,s,r,o,a,l){this._context.ellipse(t,i,n,s,r,o,a,l)}isPointInPath(t,i,n,s){return n?this._context.isPointInPath(n,t,i,s):this._context.isPointInPath(t,i,s)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,i,n,s){this._context.fillRect(t,i,n,s)}strokeRect(t,i,n,s){this._context.strokeRect(t,i,n,s)}fillText(t,i,n,s){s?this._context.fillText(t,i,n,s):this._context.fillText(t,i,n)}measureText(t){return this._context.measureText(t)}getImageData(t,i,n,s){return this._context.getImageData(t,i,n,s)}lineTo(t,i){this._context.lineTo(t,i)}moveTo(t,i){this._context.moveTo(t,i)}rect(t,i,n,s){this._context.rect(t,i,n,s)}roundRect(t,i,n,s,r){this._context.roundRect(t,i,n,s,r)}putImageData(t,i,n){this._context.putImageData(t,i,n)}quadraticCurveTo(t,i,n,s){this._context.quadraticCurveTo(t,i,n,s)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,i){this._context.scale(t,i)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,i,n,s,r,o){this._context.setTransform(t,i,n,s,r,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,i,n,s){this._context.strokeText(t,i,n,s)}transform(t,i,n,s,r,o){this._context.transform(t,i,n,s,r,o)}translate(t,i){this._context.translate(t,i)}_enableTrace(){let t=this,i=bc.length,n=this.setAttr,s,r;const o=function(a){let l=t[a],h;t[a]=function(){return r=tg(Array.prototype.slice.call(arguments,0)),h=l.apply(t,arguments),t._trace({method:a,args:r}),h}};for(s=0;s<i;s++)o(bc[s]);t.setAttr=function(){n.apply(t,arguments);const a=arguments[0];let l=arguments[1];(a==="shadowOffsetX"||a==="shadowOffsetY"||a==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:a,val:l})}}_applyGlobalCompositeOperation(t){const i=t.attrs.globalCompositeOperation;!i||i==="source-over"||this.setAttr("globalCompositeOperation",i)}}lg.forEach(function(e){Object.defineProperty(Hs.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class hg extends Hs{constructor(t,{willReadFrequently:i=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:i})}_fillColor(t){const i=t.fill();this.setAttr("fillStyle",i),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){const i=t._getLinearGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fillRadialGradient(t){const i=t._getRadialGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fill(t){const i=t.fill(),n=t.getFillPriority();if(i&&n==="color"){this._fillColor(t);return}const s=t.getFillPatternImage();if(s&&n==="pattern"){this._fillPattern(t);return}const r=t.getFillLinearGradientColorStops();if(r&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}i?this._fillColor(t):s?this._fillPattern(t):r?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const i=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),s=t.getStrokeLinearGradientColorStops(),r=this.createLinearGradient(i.x,i.y,n.x,n.y);if(s){for(let o=0;o<s.length;o+=2)r.addColorStop(s[o],s[o+1]);this.setAttr("strokeStyle",r)}}_stroke(t){const i=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();const r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),i&&t.dashEnabled()&&(this.setLineDash(i),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var i,n,s;const r=(i=t.getShadowRGBA())!==null&&i!==void 0?i:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,a=(s=t.getShadowOffset())!==null&&s!==void 0?s:{x:0,y:0},l=t.getAbsoluteScale(),h=this.canvas.getPixelRatio(),c=l.x*h,d=l.y*h;this.setAttr("shadowColor",r),this.setAttr("shadowBlur",o*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",a.x*c),this.setAttr("shadowOffsetY",a.y*d)}}class dg extends Hs{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const i=t.getStrokeScaleEnabled();if(!i){this.save();const r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);const n=t.hitStrokeWidth(),s=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",s),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),i||this.restore()}}}let Ws;function ug(){if(Ws)return Ws;const e=w.createCanvasElement(),t=e.getContext("2d");return Ws=(function(){const i=X._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n})(),w.releaseCanvas(e),Ws}class uo{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const n=(t||{}).pixelRatio||X.pixelRatio||ug();this.pixelRatio=n,this._canvas=w.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){const i=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/i,this.getHeight()/i)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,i){this.setWidth(t||0),this.setHeight(i||0)}toDataURL(t,i){try{return this._canvas.toDataURL(t,i)}catch{try{return this._canvas.toDataURL()}catch(s){return w.error("Unable to get data URL. "+s.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class ni extends uo{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new hg(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class fo extends uo{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new dg(this),this.setSize(t.width,t.height)}}const gt={get isDragging(){let e=!1;return gt._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){let e;return gt._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];gt._dragElements.forEach((i,n)=>{const{node:s}=i,r=s.getStage();r.setPointersPositions(e),i.pointerId===void 0&&(i.pointerId=w._getFirstPointerId(e));const o=r._changedPointerPositions.find(a=>a.id===i.pointerId);if(o){if(i.dragStatus!=="dragging"){const a=s.dragDistance();if(Math.max(Math.abs(o.x-i.startPointerPos.x),Math.abs(o.y-i.startPointerPos.y))<a||(s.startDrag({evt:e}),!s.isDragging()))return}s._setDragPosition(e,i),t.push(s)}}),t.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:e},!0)})},_endDragBefore(e){const t=[];gt._dragElements.forEach(i=>{const{node:n}=i,s=n.getStage();if(e&&s.setPointersPositions(e),!s._changedPointerPositions.find(a=>a.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(gt.justDragged=!0,X._mouseListenClick=!1,X._touchListenClick=!1,X._pointerListenClick=!1,i.dragStatus="stopped");const o=i.node.getLayer()||i.node instanceof X.Stage&&i.node;o&&t.indexOf(o)===-1&&t.push(o)}),t.forEach(i=>{i.draw()})},_endDragAfter(e){gt._dragElements.forEach((t,i)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&gt._dragElements.delete(i)})}};X.isBrowser&&(window.addEventListener("mouseup",gt._endDragBefore,!0),window.addEventListener("touchend",gt._endDragBefore,!0),window.addEventListener("touchcancel",gt._endDragBefore,!0),window.addEventListener("mousemove",gt._drag),window.addEventListener("touchmove",gt._drag),window.addEventListener("mouseup",gt._endDragAfter,!1),window.addEventListener("touchend",gt._endDragAfter,!1),window.addEventListener("touchcancel",gt._endDragAfter,!1));function si(e){return w._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||w._isBoolean(e)?e:Object.prototype.toString.call(e)}function wc(e){return e>255?255:e<0?0:Math.round(e)}function B(){if(X.isUnminified)return function(e,t){return w._isNumber(e)||w.warn(si(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function Us(e){if(X.isUnminified)return function(t,i){let n=w._isNumber(t),s=w._isArray(t)&&t.length==e;return!n&&!s&&w.warn(si(t)+' is a not valid value for "'+i+'" attribute. The value should be a number or Array<number>('+e+")"),t}}function po(){if(X.isUnminified)return function(e,t){return w._isNumber(e)||e==="auto"||w.warn(si(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function Ti(){if(X.isUnminified)return function(e,t){return w._isString(e)||w.warn(si(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function Sc(){if(X.isUnminified)return function(e,t){const i=w._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return i||n||w.warn(si(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function fg(){if(X.isUnminified)return function(e,t){const i=Int8Array?Object.getPrototypeOf(Int8Array):null;return i&&e instanceof i||(w._isArray(e)?e.forEach(function(n){w._isNumber(n)||w.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):w.warn(si(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function ye(){if(X.isUnminified)return function(e,t){return e===!0||e===!1||w.warn(si(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function pg(e){if(X.isUnminified)return function(t,i){return t==null||w.isObject(t)||w.warn(si(t)+' is a not valid value for "'+i+'" attribute. The value should be an object with properties '+e),t}}const Ln="get",In="set",m={addGetterSetter(e,t,i,n,s){m.addGetter(e,t,i),m.addSetter(e,t,n,s),m.addOverloadedGetterSetter(e,t)},addGetter(e,t,i){const n=Ln+w._capitalize(t);e.prototype[n]=e.prototype[n]||function(){const s=this.attrs[t];return s===void 0?i:s}},addSetter(e,t,i,n){const s=In+w._capitalize(t);e.prototype[s]||m.overWriteSetter(e,t,i,n)},overWriteSetter(e,t,i,n){const s=In+w._capitalize(t);e.prototype[s]=function(r){return i&&r!==void 0&&r!==null&&(r=i.call(this,r,t)),this._setAttr(t,r),n&&n.call(this),this}},addComponentsGetterSetter(e,t,i,n,s){const r=i.length,o=w._capitalize,a=Ln+o(t),l=In+o(t);e.prototype[a]=function(){const c={};for(let d=0;d<r;d++){const u=i[d];c[u]=this.getAttr(t+o(u))}return c};const h=pg(i);e.prototype[l]=function(c){const d=this.attrs[t];n&&(c=n.call(this,c,t)),h&&h.call(this,c,t);for(const u in c)c.hasOwnProperty(u)&&this._setAttr(t+o(u),c[u]);return c||i.forEach(u=>{this._setAttr(t+o(u),void 0)}),this._fireChangeEvent(t,d,c),s&&s.call(this),this},m.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){const i=w._capitalize(t),n=In+i,s=Ln+i;e.prototype[t]=function(){return arguments.length?(this[n](arguments[0]),this):this[s]()}},addDeprecatedGetterSetter(e,t,i,n){w.error("Adding deprecated "+t);const s=Ln+w._capitalize(t),r=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[s]=function(){w.error(r);const o=this.attrs[t];return o===void 0?i:o},m.addSetter(e,t,n,function(){w.error(r)}),m.addOverloadedGetterSetter(e,t)},backCompat(e,t){w.each(t,function(i,n){const s=e.prototype[n],r=Ln+w._capitalize(i),o=In+w._capitalize(i);function a(){s.apply(this,arguments),w.error('"'+i+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[i]=a,e.prototype[r]=a,e.prototype[o]=a})},afterSetFilter(){this._filterUpToDate=!1}};function gg(e){const t=/(\w+)\(([^)]+)\)/g;let i;for(;(i=t.exec(e))!==null;){const[,n,s]=i;switch(n){case"blur":{const r=parseFloat(s.replace("px",""));return function(o){this.blurRadius(r*.5);const a=X.Filters;a&&a.Blur&&a.Blur.call(this,o)}}case"brightness":{const r=s.includes("%")?parseFloat(s)/100:parseFloat(s);return function(o){this.brightness(r);const a=X.Filters;a&&a.Brightness&&a.Brightness.call(this,o)}}case"contrast":{const r=parseFloat(s);return function(o){const a=100*(Math.sqrt(r)-1);this.contrast(a);const l=X.Filters;l&&l.Contrast&&l.Contrast.call(this,o)}}case"grayscale":return function(r){const o=X.Filters;o&&o.Grayscale&&o.Grayscale.call(this,r)};case"sepia":return function(r){const o=X.Filters;o&&o.Sepia&&o.Sepia.call(this,r)};case"invert":return function(r){const o=X.Filters;o&&o.Invert&&o.Invert.call(this,r)};default:w.warn(`CSS filter "${n}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const js="absoluteOpacity",Xs="allEventListeners",We="absoluteTransform",Ec="absoluteScale",ki="canvas",mg="Change",_g="children",yg="konva",go="listening",bg="mouseenter",vg="mouseleave",wg="pointerenter",Sg="pointerleave",Eg="touchenter",xg="touchleave",xc="set",Cc="Shape",zs=" ",Nc="stage",ri="transform",Cg="Stage",mo="visible",Ng=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(zs);let Tg=1;class G{constructor(t){this._id=Tg++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===ri||t===We)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,i){let n=this._cache.get(t);return(n===void 0||(t===ri||t===We)&&n.dirty===!0)&&(n=i.call(this),this._cache.set(t,n)),n}_calculate(t,i,n){if(!this._attachedDepsListeners.get(t)){const s=i.map(r=>r+"Change.konva").join(zs);this.on(s,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(ki)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===We&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ki)){const{scene:t,filter:i,hit:n,buffer:s}=this._cache.get(ki);w.releaseCanvas(t,i,n,s),this._cache.delete(ki)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const i=t||{};let n={};(i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let s=Math.ceil(i.width||n.width),r=Math.ceil(i.height||n.height),o=i.pixelRatio,a=i.x===void 0?Math.floor(n.x):i.x,l=i.y===void 0?Math.floor(n.y):i.y,h=i.offset||0,c=i.drawBorder||!1,d=i.hitCanvasPixelRatio||1;if(!s||!r){w.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const u=Math.abs(Math.round(n.x)-a)>.5?1:0,f=Math.abs(Math.round(n.y)-l)>.5?1:0;s+=h*2+u,r+=h*2+f,a-=h,l-=h;const p=new ni({pixelRatio:o,width:s,height:r}),_=new ni({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),v=new fo({pixelRatio:d,width:s,height:r}),S=p.getContext(),b=v.getContext(),x=new ni({width:p.width/p.pixelRatio+Math.abs(a),height:p.height/p.pixelRatio+Math.abs(l),pixelRatio:p.pixelRatio}),N=x.getContext();return v.isCache=!0,p.isCache=!0,this._cache.delete(ki),this._filterUpToDate=!1,i.imageSmoothingEnabled===!1&&(p.getContext()._context.imageSmoothingEnabled=!1,_.getContext()._context.imageSmoothingEnabled=!1),S.save(),b.save(),N.save(),S.translate(-a,-l),b.translate(-a,-l),N.translate(-a,-l),x.x=a,x.y=l,this._isUnderCache=!0,this._clearSelfAndDescendantCache(js),this._clearSelfAndDescendantCache(Ec),this.drawScene(p,this,x),this.drawHit(v,this),this._isUnderCache=!1,S.restore(),b.restore(),c&&(S.save(),S.beginPath(),S.rect(0,0,s,r),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore()),this._cache.set(ki,{scene:p,filter:_,hit:v,buffer:x,x:a,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ki)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,i){const n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let s=1/0,r=1/0,o=-1/0,a=-1/0;const l=this.getAbsoluteTransform(i);return n.forEach(function(h){const c=l.point(h);s===void 0&&(s=o=c.x,r=a=c.y),s=Math.min(s,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y)}),{x:s,y:r,width:o-s,height:a-r}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const i=this._getCanvasCache();t.translate(i.x,i.y);const n=this._getCachedSceneCanvas(),s=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/s,n.height/s),t.restore()}_drawCachedHitCanvas(t){const i=this._getCanvasCache(),n=i.hit;t.save(),t.translate(i.x,i.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),i=this._getCanvasCache(),n=i.scene,s=i.filter,r=s.getContext(),o,a,l,h;if(!t||t.length===0)return n;if(this._filterUpToDate)return s;let c=!0;for(let u=0;u<t.length;u++)if(typeof t[u]=="string"&&vc(),typeof t[u]!="string"||!vc()){c=!1;break}const d=n.pixelRatio;if(s.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio),c){const u=t.join(" ");return r.save(),r.setAttr("filter",u),r.drawImage(n._canvas,0,0,n.getWidth()/d,n.getHeight()/d),r.restore(),this._filterUpToDate=!0,s}try{for(o=t.length,r.clear(),r.drawImage(n._canvas,0,0,n.getWidth()/d,n.getHeight()/d),a=r.getImageData(0,0,s.getWidth(),s.getHeight()),l=0;l<o;l++)h=t[l],typeof h=="string"&&(h=gg(h)),h.call(this,a),r.putImageData(a,0,0)}catch(u){w.error("Unable to apply filter. "+u.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,s}on(t,i){if(this._cache&&this._cache.delete(Xs),arguments.length===3)return this._delegate.apply(this,arguments);const n=t.split(zs);for(let s=0;s<n.length;s++){const o=n[s].split("."),a=o[0],l=o[1]||"";this.eventListeners[a]||(this.eventListeners[a]=[]),this.eventListeners[a].push({name:l,handler:i})}return this}off(t,i){let n=(t||"").split(zs),s=n.length,r,o,a,l,h,c;if(this._cache&&this._cache.delete(Xs),!t)for(o in this.eventListeners)this._off(o);for(r=0;r<s;r++)if(a=n[r],l=a.split("."),h=l[0],c=l[1],h)this.eventListeners[h]&&this._off(h,c,i);else for(o in this.eventListeners)this._off(o,c,i);return this}dispatchEvent(t){const i={target:this,type:t.type,evt:t};return this.fire(t.type,i),this}addEventListener(t,i){return this.on(t,function(n){i.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,i,n){const s=this;this.on(t,function(r){const o=r.target.findAncestors(i,!0,s);for(let a=0;a<o.length;a++)r=w.cloneObject(r),r.currentTarget=o[a],n.call(o[a],r)})}remove(){return this.isDragging()&&this.stopDrag(),gt._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(We),this._clearSelfAndDescendantCache(js),this._clearSelfAndDescendantCache(Ec),this._clearSelfAndDescendantCache(Nc),this._clearSelfAndDescendantCache(mo),this._clearSelfAndDescendantCache(go)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const i="get"+w._capitalize(t);return w._isFunction(this[i])?this[i]():this.attrs[t]}getAncestors(){let t=this.getParent(),i=[];for(;t;)i.push(t),t=t.getParent();return i}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let i,n;if(!t)return this;for(i in t)i!==_g&&(n=xc+w._capitalize(i),w._isFunction(this[n])?this[n](t[i]):this._setAttr(i,t[i]))}),this}isListening(){return this._getCache(go,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(mo,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,i=!1){if(t)return this._isVisible(t)&&this._isListening(t);const n=this.getLayer();let s=!1;gt._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(s=!0)});const r=!i&&!X.hitOnDragEnabled&&(s||X.isTransforming());return this.isListening()&&this.isVisible()&&!r}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),i=this,n=0,s,r,o,a;function l(c){for(s=[],r=c.length,o=0;o<r;o++)a=c[o],n++,a.nodeType!==Cc&&(s=s.concat(a.getChildren().slice())),a._id===i._id&&(o=r);s.length>0&&s[0].getDepth()<=t&&l(s)}const h=this.getStage();return i.nodeType!==Cg&&h&&l(h.getChildren()),n}getDepth(){let t=0,i=this.parent;for(;i;)t++,i=i.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(ri),this._clearSelfAndDescendantCache(We)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const i=t.getPointerPosition();if(!i)return null;const n=this.getAbsoluteTransform().copy();return n.invert(),n.point(i)}getAbsolutePosition(t){let i=!1,n=this.parent;for(;n;){if(n.isCached()){i=!0;break}n=n.parent}i&&!t&&(t=!0);const s=this.getAbsoluteTransform(t).getMatrix(),r=new ne,o=this.offset();return r.m=s.slice(),r.translate(o.x,o.y),r.getTranslation()}setAbsolutePosition(t){const{x:i,y:n,...s}=this._clearTransform();this.attrs.x=i,this.attrs.y=n,this._clearCache(ri);const r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(s),this.setPosition({x:t.x,y:t.y}),this._clearCache(ri),this._clearSelfAndDescendantCache(We),this}_setTransform(t){let i;for(i in t)this.attrs[i]=t[i]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let i=t.x,n=t.y,s=this.x(),r=this.y();return i!==void 0&&(s+=i),n!==void 0&&(r+=n),this.setPosition({x:s,y:r}),this}_eachAncestorReverse(t,i){let n=[],s=this.getParent(),r,o;if(!(i&&i._id===this._id)){for(n.unshift(this);s&&(!i||s._id!==i._id);)n.unshift(s),s=s.parent;for(r=n.length,o=0;o<r;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return w.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return w.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return w.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return w.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return w.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&w.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const i=this.index;return this.parent.children.splice(i,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(js,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const i=this.getParent();return i&&!i._isUnderCache&&(t*=i.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),i,n,s,r,o;const a={attrs:{},className:this.getClassName()};for(i in t)n=t[i],o=w.isObject(n)&&!w._isPlainObject(n)&&!w._isArray(n),!o&&(s=typeof this[i]=="function"&&this[i],delete t[i],r=s?s.call(this):null,t[i]=n,r!==n&&(a.attrs[i]=n));return w._prepareToStringify(a)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,i,n){const s=[];i&&this._isMatch(t)&&s.push(this);let r=this.parent;for(;r;){if(r===n)return s;r._isMatch(t)&&s.push(r),r=r.parent}return s}isAncestorOf(t){return!1}findAncestor(t,i,n){return this.findAncestors(t,i,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let i=t.replace(/ /g,"").split(","),n=i.length,s,r;for(s=0;s<n;s++)if(r=i[s],w.isValidSelector(r)||(w.warn('Selector "'+r+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),w.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),w.warn("Konva is awesome, right?")),r.charAt(0)==="#"){if(this.id()===r.slice(1))return!0}else if(r.charAt(0)==="."){if(this.hasName(r.slice(1)))return!0}else if(this.className===r||this.nodeType===r)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(Nc,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,i={},n){return i.target=i.target||this,n?this._fireAndBubble(t,i):this._fire(t,i),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(We,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let i;if(t)return i=new ne,this._eachAncestorReverse(function(n){const s=n.transformsEnabled();s==="all"?i.multiply(n.getTransform()):s==="position"&&i.translate(n.x()-n.offsetX(),n.y()-n.offsetY())},t),i;{i=this._cache.get(We)||new ne,this.parent?this.parent.getAbsoluteTransform().copyInto(i):i.reset();const n=this.transformsEnabled();if(n==="all")i.multiply(this.getTransform());else if(n==="position"){const s=this.attrs.x||0,r=this.attrs.y||0,o=this.attrs.offsetX||0,a=this.attrs.offsetY||0;i.translate(s-o,r-a)}return i.dirty=!1,i}}getAbsoluteScale(t){let i=this;for(;i;)i._isUnderCache&&(t=i),i=i.getParent();const s=this.getAbsoluteTransform(t).decompose();return{x:s.scaleX,y:s.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(ri,this._getTransform)}_getTransform(){var t,i;const n=this._cache.get(ri)||new ne;n.reset();const s=this.x(),r=this.y(),o=X.getAngle(this.rotation()),a=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(i=this.attrs.scaleY)!==null&&i!==void 0?i:1,h=this.attrs.skewX||0,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,u=this.attrs.offsetY||0;return(s!==0||r!==0)&&n.translate(s,r),o!==0&&n.rotate(o),(h!==0||c!==0)&&n.skew(h,c),(a!==1||l!==1)&&n.scale(a,l),(d!==0||u!==0)&&n.translate(-1*d,-1*u),n.dirty=!1,n}clone(t){let i=w.cloneObject(this.attrs),n,s,r,o,a;for(n in t)i[n]=t[n];const l=new this.constructor(i);for(n in this.eventListeners)for(s=this.eventListeners[n],r=s.length,o=0;o<r;o++)a=s[o],a.name.indexOf(yg)<0&&(l.eventListeners[n]||(l.eventListeners[n]=[]),l.eventListeners[n].push(a));return l}_toKonvaCanvas(t){t=t||{};const i=this.getClientRect(),n=this.getStage(),s=t.x!==void 0?t.x:Math.floor(i.x),r=t.y!==void 0?t.y:Math.floor(i.y),o=t.pixelRatio||1,a=new ni({width:t.width||Math.ceil(i.width)||(n?n.width():0),height:t.height||Math.ceil(i.height)||(n?n.height():0),pixelRatio:o}),l=a.getContext(),h=new ni({width:a.width/a.pixelRatio+Math.abs(s),height:a.height/a.pixelRatio+Math.abs(r),pixelRatio:a.pixelRatio});return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(s||r)&&l.translate(-1*s,-1*r),this.drawScene(a,void 0,h),l.restore(),a}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const i=t.mimeType||null,n=t.quality||null,s=this._toKonvaCanvas(t).toDataURL(i,n);return t.callback&&t.callback(s),s}toImage(t){return new Promise((i,n)=>{try{const s=t?.callback;s&&delete t.callback,w._urlToImage(this.toDataURL(t),function(r){i(r),s?.(r)})}catch(s){n(s)}})}toBlob(t){return new Promise((i,n)=>{try{const s=t?.callback;s&&delete t.callback,this.toCanvas(t).toBlob(r=>{i(r),s?.(r)},t?.mimeType,t?.quality)}catch(s){n(s)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():X.dragDistance}_off(t,i,n){let s=this.eventListeners[t],r,o,a;for(r=0;r<s.length;r++)if(o=s[r].name,a=s[r].handler,(o!=="konva"||i==="konva")&&(!i||o===i)&&(!n||n===a)){if(s.splice(r,1),s.length===0){delete this.eventListeners[t];break}r--}}_fireChangeEvent(t,i,n){this._fire(t+mg,{oldVal:i,newVal:n})}addName(t){if(!this.hasName(t)){const i=this.name(),n=i?i+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const i=this.name();return i?(i||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const i=(this.name()||"").split(/\s/g),n=i.indexOf(t);return n!==-1&&(i.splice(n,1),this.name(i.join(" "))),this}setAttr(t,i){const n=this[xc+w._capitalize(t)];return w._isFunction(n)?n.call(this,i):this._setAttr(t,i),this}_requestDraw(){if(X.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,i){const n=this.attrs[t];n===i&&!w.isObject(i)||(i==null?delete this.attrs[t]:this.attrs[t]=i,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,i),this._requestDraw())}_setComponentAttr(t,i,n){let s;n!==void 0&&(s=this.attrs[t],s||(this.attrs[t]=this.getAttr(t)),this.attrs[t][i]=n,this._fireChangeEvent(t,s,n))}_fireAndBubble(t,i,n){i&&this.nodeType===Cc&&(i.target=this);const s=[bg,vg,wg,Sg,Eg,xg];if(!(s.indexOf(t)!==-1&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n))){this._fire(t,i);const o=s.indexOf(t)!==-1&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(i&&!i.cancelBubble||!i)&&this.parent&&this.parent.isListening()&&!o&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,i,n):this._fireAndBubble.call(this.parent,t,i))}}_getProtoListeners(t){var i,n,s;const r=(i=this._cache.get(Xs))!==null&&i!==void 0?i:{};let o=r?.[t];if(o===void 0){o=[];let a=Object.getPrototypeOf(this);for(;a;){const l=(s=(n=a.eventListeners)===null||n===void 0?void 0:n[t])!==null&&s!==void 0?s:[];o.push(...l),a=Object.getPrototypeOf(a)}r[t]=o,this._cache.set(Xs,r)}return o}_fire(t,i){i=i||{},i.currentTarget=this,i.type=t;const n=this._getProtoListeners(t);if(n)for(let r=0;r<n.length;r++)n[r].handler.call(this,i);const s=this.eventListeners[t];if(s)for(let r=0;r<s.length;r++)s[r].handler.call(this,i)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const i=t?t.pointerId:void 0,n=this.getStage(),s=this.getAbsolutePosition();if(!n)return;const r=n._getPointerById(i)||n._changedPointerPositions[0]||s;gt._dragElements.set(this._id,{node:this,startPointerPos:r,offset:{x:r.x-s.x,y:r.y-s.y},dragStatus:"ready",pointerId:i})}startDrag(t,i=!0){gt._dragElements.has(this._id)||this._createDragElement(t);const n=gt._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},i)}_setDragPosition(t,i){const n=this.getStage()._getPointerById(i.pointerId);if(!n)return;let s={x:n.x-i.offset.x,y:n.y-i.offset.y};const r=this.dragBoundFunc();if(r!==void 0){const o=r.call(this,s,t);o?s=o:w.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==s.x||this._lastPos.y!==s.y)&&(this.setAbsolutePosition(s),this._requestDraw()),this._lastPos=s}stopDrag(t){const i=gt._dragElements.get(this._id);i&&(i.dragStatus="stopped"),gt._endDragBefore(t),gt._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=gt._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(t.evt.button!==void 0)||X.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let s=!1;gt._dragElements.forEach(r=>{this.isAncestorOf(r.node)&&(s=!0)}),s||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const i=gt._dragElements.get(this._id),n=i&&i.dragStatus==="dragging",s=i&&i.dragStatus==="ready";n?this.stopDrag():s&&gt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const i=this.getStage();if(!i)return!1;const n={x:-t.x,y:-t.y,width:i.width()+2*t.x,height:i.height()+2*t.y};return w.haveIntersection(n,this.getClientRect())}static create(t,i){return w._isString(t)&&(t=JSON.parse(t)),this._createNode(t,i)}static _createNode(t,i){let n=G.prototype.getClassName.call(t),s=t.children,r,o,a;i&&(t.attrs.container=i),X[n]||(w.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const l=X[n];if(r=new l(t.attrs),s)for(o=s.length,a=0;a<o;a++)r.add(G._createNode(s[a]));return r}}G.prototype.nodeType="Node",G.prototype._attrsAffectingSize=[],G.prototype.eventListeners={},G.prototype.on.call(G.prototype,Ng,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(ri),this._clearSelfAndDescendantCache(We)}),G.prototype.on.call(G.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(mo)}),G.prototype.on.call(G.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(go)}),G.prototype.on.call(G.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(js)});const vt=m.addGetterSetter;vt(G,"zIndex"),vt(G,"absolutePosition"),vt(G,"position"),vt(G,"x",0,B()),vt(G,"y",0,B()),vt(G,"globalCompositeOperation","source-over",Ti()),vt(G,"opacity",1,B()),vt(G,"name","",Ti()),vt(G,"id","",Ti()),vt(G,"rotation",0,B()),m.addComponentsGetterSetter(G,"scale",["x","y"]),vt(G,"scaleX",1,B()),vt(G,"scaleY",1,B()),m.addComponentsGetterSetter(G,"skew",["x","y"]),vt(G,"skewX",0,B()),vt(G,"skewY",0,B()),m.addComponentsGetterSetter(G,"offset",["x","y"]),vt(G,"offsetX",0,B()),vt(G,"offsetY",0,B()),vt(G,"dragDistance",void 0,B()),vt(G,"width",0,B()),vt(G,"height",0,B()),vt(G,"listening",!0,ye()),vt(G,"preventDefault",!0,ye()),vt(G,"filters",void 0,function(e){return this._filterUpToDate=!1,e}),vt(G,"visible",!0,ye()),vt(G,"transformsEnabled","all",Ti()),vt(G,"size"),vt(G,"dragBoundFunc"),vt(G,"draggable",!1,ye()),m.backCompat(G,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class se extends G{constructor(){super(...arguments),this.children=[]}getChildren(t){const i=this.children||[];return t?i.filter(t):i}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let n=0;n<t.length;n++)this.add(t[n]);return this}const i=t[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){const i=this._generalFind(t,!0);return i.length>0?i[0]:void 0}_generalFind(t,i){const n=[];return this._descendants(s=>{const r=s._isMatch(t);return r&&n.push(s),!!(r&&i)}),n}_descendants(t){let i=!1;const n=this.getChildren();for(const s of n){if(i=t(s),i)return!0;if(s.hasChildren()&&(i=s._descendants(t),i))return!0}return!1}toObject(){const t=G.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(i=>{t.children.push(i.toObject())}),t}isAncestorOf(t){let i=t.getParent();for(;i;){if(i._id===this._id)return!0;i=i.getParent()}return!1}clone(t){const i=G.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){i.add(n.clone())}),i}getAllIntersections(t){const i=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&i.push(n)}),i}_clearSelfAndDescendantCache(t){var i;super._clearSelfAndDescendantCache(t),!this.isCached()&&((i=this.children)===null||i===void 0||i.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(i,n){i.index=n}),this._requestDraw()}drawScene(t,i,n){const s=this.getLayer(),r=t||s&&s.getCanvas(),o=r&&r.getContext(),a=this._getCanvasCache(),l=a&&a.scene,h=r&&r.isCache;if(!this.isVisible()&&!h)return this;if(l){o.save();const c=this.getAbsoluteTransform(i).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,i,n);return this}drawHit(t,i){if(!this.shouldDrawHit(i))return this;const n=this.getLayer(),s=t||n&&n.hitCanvas,r=s&&s.getContext(),o=this._getCanvasCache();if(o&&o.hit){r.save();const l=this.getAbsoluteTransform(i).getMatrix();r.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(r),r.restore()}else this._drawChildren("drawHit",s,i);return this}_drawChildren(t,i,n,s){var r;const o=i&&i.getContext(),a=this.clipWidth(),l=this.clipHeight(),h=this.clipFunc(),c=typeof a=="number"&&typeof l=="number"||h,d=n===this;if(c){o.save();const f=this.getAbsoluteTransform(n);let p=f.getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath();let _;if(h)_=h.call(this,o,this);else{const v=this.clipX(),S=this.clipY();o.rect(v||0,S||0,a,l)}o.clip.apply(o,_),p=f.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}const u=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";u&&(o.save(),o._applyGlobalCompositeOperation(this)),(r=this.children)===null||r===void 0||r.forEach(function(f){f[t](i,n,s)}),u&&o.restore(),c&&o.restore()}getClientRect(t={}){var i;const n=t.skipTransform,s=t.relativeTo;let r,o,a,l,h={x:1/0,y:1/0,width:0,height:0};const c=this;(i=this.children)===null||i===void 0||i.forEach(function(f){if(!f.visible())return;const p=f.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});p.width===0&&p.height===0||(r===void 0?(r=p.x,o=p.y,a=p.x+p.width,l=p.y+p.height):(r=Math.min(r,p.x),o=Math.min(o,p.y),a=Math.max(a,p.x+p.width),l=Math.max(l,p.y+p.height)))});const d=this.find("Shape");let u=!1;for(let f=0;f<d.length;f++)if(d[f]._isVisible(this)){u=!0;break}return u&&r!==void 0?h={x:r,y:o,width:a-r,height:l-o}:h={x:0,y:0,width:0,height:0},n?h:this._transformedRect(h,s)}}m.addComponentsGetterSetter(se,"clip",["x","y","width","height"]),m.addGetterSetter(se,"clipX",void 0,B()),m.addGetterSetter(se,"clipY",void 0,B()),m.addGetterSetter(se,"clipWidth",void 0,B()),m.addGetterSetter(se,"clipHeight",void 0,B()),m.addGetterSetter(se,"clipFunc");const Dn=new Map,Tc=X._global.PointerEvent!==void 0;function _o(e){return Dn.get(e)}function yo(e){return{evt:e,pointerId:e.pointerId}}function kc(e,t){return Dn.get(e)===t}function Pc(e,t){Vn(e),t.getStage()&&(Dn.set(e,t),Tc&&t._fire("gotpointercapture",yo(new PointerEvent("gotpointercapture"))))}function Vn(e,t){const i=Dn.get(e);if(!i)return;const n=i.getStage();n&&n.content,Dn.delete(e),Tc&&i._fire("lostpointercapture",yo(new PointerEvent("lostpointercapture")))}const kg="Stage",Pg="string",Oc="px",Og="mouseout",Ac="mouseleave",Mc="mouseover",Rc="mouseenter",Lc="mousemove",Ic="mousedown",Dc="mouseup",Fn="pointermove",Gn="pointerdown",qi="pointerup",$n="pointercancel",Ag="lostpointercapture",Ys="pointerout",Bn="pointerleave",qs="pointerover",Ks="pointerenter",bo="contextmenu",Vc="touchstart",Fc="touchend",Gc="touchmove",$c="touchcancel",vo="wheel",Mg=5,Rg=[[Rc,"_pointerenter"],[Ic,"_pointerdown"],[Lc,"_pointermove"],[Dc,"_pointerup"],[Ac,"_pointerleave"],[Vc,"_pointerdown"],[Gc,"_pointermove"],[Fc,"_pointerup"],[$c,"_pointercancel"],[Mc,"_pointerover"],[vo,"_wheel"],[bo,"_contextmenu"],[Gn,"_pointerdown"],[Fn,"_pointermove"],[qi,"_pointerup"],[$n,"_pointercancel"],[Bn,"_pointerleave"],[Ag,"_lostpointercapture"]],wo={mouse:{[Ys]:Og,[Bn]:Ac,[qs]:Mc,[Ks]:Rc,[Fn]:Lc,[Gn]:Ic,[qi]:Dc,[$n]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[Ys]:"touchout",[Bn]:"touchleave",[qs]:"touchover",[Ks]:"touchenter",[Fn]:Gc,[Gn]:Vc,[qi]:Fc,[$n]:$c,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[Ys]:Ys,[Bn]:Bn,[qs]:qs,[Ks]:Ks,[Fn]:Fn,[Gn]:Gn,[qi]:qi,[$n]:$n,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Hn=e=>e.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Ki=e=>{const t=Hn(e);if(t==="pointer")return X.pointerEventsEnabled&&wo.pointer;if(t==="touch")return wo.touch;if(t==="mouse")return wo.mouse};function Bc(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&w.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const Lg="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Wn=[];class Js extends se{constructor(t){super(Bc(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Wn.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Bc(this.attrs)}),this._checkVisibility()}_validateAdd(t){const i=t.getType()==="Layer",n=t.getType()==="FastLayer";i||n||w.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===Pg){let i;if(t.charAt(0)==="."){const n=t.slice(1);t=document.getElementsByClassName(n)[0]}else t.charAt(0)!=="#"?i=t:i=t.slice(1),t=document.getElementById(i);if(!t)throw"Can not find container in document with id "+i}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,i=t.length;for(let n=0;n<i;n++)t[n].clear();return this}clone(t){return t||(t={}),t.container=typeof document<"u"&&document.createElement("div"),se.prototype.clone.call(this,t)}destroy(){super.destroy();const t=this.content;t&&w._isInDocument(t)&&this.container().removeChild(t);const i=Wn.indexOf(this);return i>-1&&Wn.splice(i,1),w.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(w.warn(Lg),null)}_getPointerById(t){return this._pointerPositions.find(i=>i.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const i=new ni({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),n=i.getContext()._context,s=this.children;return(t.x||t.y)&&n.translate(-1*t.x,-1*t.y),s.forEach(function(r){if(!r.isVisible())return;const o=r._toKonvaCanvas(t);n.drawImage(o._canvas,t.x,t.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),i}getIntersection(t){if(!t)return null;const i=this.children,n=i.length,s=n-1;for(let r=s;r>=0;r--){const o=i[r].getIntersection(t);if(o)return o}return null}_resizeDOM(){const t=this.width(),i=this.height();this.content&&(this.content.style.width=t+Oc,this.content.style.height=i+Oc),this.bufferCanvas.setSize(t,i),this.bufferHitCanvas.setSize(t,i),this.children.forEach(n=>{n.setSize({width:t,height:i}),n.draw()})}add(t,...i){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.add(arguments[s]);return this}super.add(t);const n=this.children.length;return n>Mg&&w.warn("The stage has "+n+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),X.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return kc(t,this)}setPointerCapture(t){Pc(t,this)}releaseCapture(t){Vn(t)}getLayers(){return this.children}_bindContentEvents(){X.isBrowser&&Rg.forEach(([t,i])=>{this.content.addEventListener(t,n=>{this[i](n)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const i=Ki(t.type);i&&this._fire(i.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const i=Ki(t.type);i&&this._fire(i.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let i=this[t+"targetShape"];return i&&!i.getStage()&&(i=null),i}_pointerleave(t){const i=Ki(t.type),n=Hn(t.type);if(!i)return;this.setPointersPositions(t);const s=this._getTargetShape(n),r=!(X.isDragging()||X.isTransforming())||X.hitOnDragEnabled;s&&r?(s._fireAndBubble(i.pointerout,{evt:t}),s._fireAndBubble(i.pointerleave,{evt:t}),this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this[n+"targetShape"]=null):r&&(this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(i.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const i=Ki(t.type),n=Hn(t.type);if(!i)return;this.setPointersPositions(t);let s=!1;this._changedPointerPositions.forEach(r=>{const o=this.getIntersection(r);if(gt.justDragged=!1,X["_"+n+"ListenClick"]=!0,!o||!o.isListening()){this[n+"ClickStartShape"]=void 0;return}X.capturePointerEventsEnabled&&o.setPointerCapture(r.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(i.pointerdown,{evt:t,pointerId:r.id}),s=!0;const a=t.type.indexOf("touch")>=0;o.preventDefault()&&t.cancelable&&a&&t.preventDefault()}),s||this._fire(i.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const i=Ki(t.type),n=Hn(t.type);if(!i)return;const s=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(X.isDragging()&&gt.node.preventDefault()&&t.cancelable&&s&&t.preventDefault(),this.setPointersPositions(t),!(!(X.isDragging()||X.isTransforming())||X.hitOnDragEnabled))return;const o={};let a=!1;const l=this._getTargetShape(n);this._changedPointerPositions.forEach(h=>{const c=_o(h.id)||this.getIntersection(h),d=h.id,u={evt:t,pointerId:d},f=l!==c;if(f&&l&&(l._fireAndBubble(i.pointerout,{...u},c),l._fireAndBubble(i.pointerleave,{...u},c)),c){if(o[c._id])return;o[c._id]=!0}c&&c.isListening()?(a=!0,f&&(c._fireAndBubble(i.pointerover,{...u},l),c._fireAndBubble(i.pointerenter,{...u},l),this[n+"targetShape"]=c),c._fireAndBubble(i.pointermove,{...u})):l&&(this._fire(i.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[n+"targetShape"]=null)}),a||this._fire(i.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const i=Ki(t.type),n=Hn(t.type);if(!i)return;this.setPointersPositions(t);const s=this[n+"ClickStartShape"],r=this[n+"ClickEndShape"],o={};let a=!1;this._changedPointerPositions.forEach(l=>{const h=_o(l.id)||this.getIntersection(l);if(h){if(h.releaseCapture(l.id),o[h._id])return;o[h._id]=!0}const c=l.id,d={evt:t,pointerId:c};let u=!1;X["_"+n+"InDblClickWindow"]?(u=!0,clearTimeout(this[n+"DblTimeout"])):gt.justDragged||(X["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){X["_"+n+"InDblClickWindow"]=!1},X.dblClickWindow),h&&h.isListening()?(a=!0,this[n+"ClickEndShape"]=h,h._fireAndBubble(i.pointerup,{...d}),X["_"+n+"ListenClick"]&&s&&s===h&&(h._fireAndBubble(i.pointerclick,{...d}),u&&r&&r===h&&h._fireAndBubble(i.pointerdblclick,{...d}))):(this[n+"ClickEndShape"]=null,a||(this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a=!0),X["_"+n+"ListenClick"]&&this._fire(i.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),u&&this._fire(i.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}),a||this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),X["_"+n+"ListenClick"]=!1,t.cancelable&&n!=="touch"&&n!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(bo,{evt:t}):this._fire(bo,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(vo,{evt:t}):this._fire(vo,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const i=_o(t.pointerId)||this.getIntersection(this.getPointerPosition());i&&i._fireAndBubble(qi,yo(t)),Vn(t.pointerId)}_lostpointercapture(t){Vn(t.pointerId)}setPointersPositions(t){const i=this._getContentPosition();let n=null,s=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,r=>{this._pointerPositions.push({id:r.identifier,x:(r.clientX-i.left)/i.scaleX,y:(r.clientY-i.top)/i.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,r=>{this._changedPointerPositions.push({id:r.identifier,x:(r.clientX-i.left)/i.scaleX,y:(r.clientY-i.top)/i.scaleY})})):(n=(t.clientX-i.left)/i.scaleX,s=(t.clientY-i.top)/i.scaleY,this.pointerPos={x:n,y:s},this._pointerPositions=[{x:n,y:s,id:w._getFirstPointerId(t)}],this._changedPointerPositions=[{x:n,y:s,id:w._getFirstPointerId(t)}])}_setPointerPosition(t){w.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new ni({width:this.width(),height:this.height()}),this.bufferHitCanvas=new fo({pixelRatio:1,width:this.width(),height:this.height()}),!X.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}cache(){return w.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}}Js.prototype.nodeType=kg,kt(Js),m.addGetterSetter(Js,"container"),X.isBrowser&&document.addEventListener("visibilitychange",()=>{Wn.forEach(e=>{e.batchDraw()})});const Hc="hasShadow",Wc="shadowRGBA",Uc="patternImage",jc="linearGradient",Xc="radialGradient";let Qs;function So(){return Qs||(Qs=w.createCanvasElement().getContext("2d"),Qs)}const Un={};function Ig(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function Dg(e){e.stroke()}function Vg(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function Fg(e){e.stroke()}function Gg(){this._clearCache(Hc)}function $g(){this._clearCache(Wc)}function Bg(){this._clearCache(Uc)}function Hg(){this._clearCache(jc)}function Wg(){this._clearCache(Xc)}class V extends G{constructor(t){super(t);let i,n=0;for(;i=w.getHitColor(),!(i&&!(i in Un));)if(n++,n>=1e4){w.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),i=w.getRandomColor();break}this.colorKey=i,Un[i]=this}getContext(){return w.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return w.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(Hc,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Uc,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const i=So().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(i&&i.setTransform){const n=new ne;n.translate(this.fillPatternX(),this.fillPatternY()),n.rotate(X.getAngle(this.fillPatternRotation())),n.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),n.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const s=n.getMatrix(),r=typeof DOMMatrix>"u"?{a:s[0],b:s[1],c:s[2],d:s[3],e:s[4],f:s[5]}:new DOMMatrix(s);i.setTransform(r)}return i}}_getLinearGradient(){return this._getCache(jc,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const i=So(),n=this.fillLinearGradientStartPoint(),s=this.fillLinearGradientEndPoint(),r=i.createLinearGradient(n.x,n.y,s.x,s.y);for(let o=0;o<t.length;o+=2)r.addColorStop(t[o],t[o+1]);return r}}_getRadialGradient(){return this._getCache(Xc,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const i=So(),n=this.fillRadialGradientStartPoint(),s=this.fillRadialGradientEndPoint(),r=i.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),s.x,s.y,this.fillRadialGradientEndRadius());for(let o=0;o<t.length;o+=2)r.addColorStop(t[o],t[o+1]);return r}}getShadowRGBA(){return this._getCache(Wc,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=w.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const i=this.getStage();if(!i)return!1;const n=i.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return G.prototype.destroy.call(this),delete Un[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var i;if(!((i=this.attrs.perfectDrawEnabled)!==null&&i!==void 0?i:!0))return!1;const s=t||this.hasFill(),r=this.hasStroke(),o=this.getAbsoluteOpacity()!==1;if(s&&r&&o)return!0;const a=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(s&&r&&a&&l)}setStrokeHitEnabled(t){w.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let i=!1,n=this.getParent();for(;n;){if(n.isCached()){i=!0;break}n=n.getParent()}const s=t.skipTransform,r=t.relativeTo||i&&this.getStage()||void 0,o=this.getSelfRect(),l=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,h=o.width+l,c=o.height+l,d=!t.skipShadow&&this.hasShadow(),u=d?this.shadowOffsetX():0,f=d?this.shadowOffsetY():0,p=h+Math.abs(u),_=c+Math.abs(f),v=d&&this.shadowBlur()||0,S=p+v*2,b=_+v*2,x={width:S,height:b,x:-(l/2+v)+Math.min(u,0)+o.x,y:-(l/2+v)+Math.min(f,0)+o.y};return s?x:this._transformedRect(x,r)}drawScene(t,i,n){const s=this.getLayer(),r=t||s.getCanvas(),o=r.getContext(),a=this._getCanvasCache(),l=this.getSceneFunc(),h=this.hasShadow();let c;const d=i===this;if(!this.isVisible()&&!d)return this;if(a){o.save();const u=this.getAbsoluteTransform(i).getMatrix();return o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!l)return this;if(o.save(),this._useBufferCanvas()){c=this.getStage();const u=n||c.bufferCanvas,f=u.getContext();f.clear(),f.save(),f._applyLineJoin(this),f._applyMiterLimit(this);const p=this.getAbsoluteTransform(i).getMatrix();f.transform(p[0],p[1],p[2],p[3],p[4],p[5]),l.call(this,f,this),f.restore();const _=u.pixelRatio;h&&o._applyShadow(this),d||(o._applyOpacity(this),o._applyGlobalCompositeOperation(this)),o.drawImage(u._canvas,u.x||0,u.y||0,u.width/_,u.height/_)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!d){const u=this.getAbsoluteTransform(i).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}h&&o._applyShadow(this),l.call(this,o,this)}return o.restore(),this}drawHit(t,i,n=!1){if(!this.shouldDrawHit(i,n))return this;const s=this.getLayer(),r=t||s.hitCanvas,o=r&&r.getContext(),a=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),h=l&&l.hit;if(this.colorKey||w.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),h){o.save();const d=this.getAbsoluteTransform(i).getMatrix();return o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!a)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===i)){const d=this.getAbsoluteTransform(i).getMatrix();o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}return a.call(this,o,this),o.restore(),this}drawHitFromCache(t=0){const i=this._getCanvasCache(),n=this._getCachedSceneCanvas(),s=i.hit,r=s.getContext(),o=s.getWidth(),a=s.getHeight();r.clear(),r.drawImage(n._canvas,0,0,o,a);try{const l=r.getImageData(0,0,o,a),h=l.data,c=h.length,d=w._hexToRgb(this.colorKey);for(let u=0;u<c;u+=4)h[u+3]>t?(h[u]=d.r,h[u+1]=d.g,h[u+2]=d.b,h[u+3]=255):h[u+3]=0;r.putImageData(l,0,0)}catch(l){w.error("Unable to draw hit graph from cached scene canvas. "+l.message)}return this}hasPointerCapture(t){return kc(t,this)}setPointerCapture(t){Pc(t,this)}releaseCapture(t){Vn(t)}}V.prototype._fillFunc=Ig,V.prototype._strokeFunc=Dg,V.prototype._fillFuncHit=Vg,V.prototype._strokeFuncHit=Fg,V.prototype._centroid=!1,V.prototype.nodeType="Shape",kt(V),V.prototype.eventListeners={},V.prototype.on.call(V.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Gg),V.prototype.on.call(V.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",$g),V.prototype.on.call(V.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",Bg),V.prototype.on.call(V.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",Hg),V.prototype.on.call(V.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",Wg),m.addGetterSetter(V,"stroke",void 0,Sc()),m.addGetterSetter(V,"strokeWidth",2,B()),m.addGetterSetter(V,"fillAfterStrokeEnabled",!1),m.addGetterSetter(V,"hitStrokeWidth","auto",po()),m.addGetterSetter(V,"strokeHitEnabled",!0,ye()),m.addGetterSetter(V,"perfectDrawEnabled",!0,ye()),m.addGetterSetter(V,"shadowForStrokeEnabled",!0,ye()),m.addGetterSetter(V,"lineJoin"),m.addGetterSetter(V,"lineCap"),m.addGetterSetter(V,"miterLimit"),m.addGetterSetter(V,"sceneFunc"),m.addGetterSetter(V,"hitFunc"),m.addGetterSetter(V,"dash"),m.addGetterSetter(V,"dashOffset",0,B()),m.addGetterSetter(V,"shadowColor",void 0,Ti()),m.addGetterSetter(V,"shadowBlur",0,B()),m.addGetterSetter(V,"shadowOpacity",1,B()),m.addComponentsGetterSetter(V,"shadowOffset",["x","y"]),m.addGetterSetter(V,"shadowOffsetX",0,B()),m.addGetterSetter(V,"shadowOffsetY",0,B()),m.addGetterSetter(V,"fillPatternImage"),m.addGetterSetter(V,"fill",void 0,Sc()),m.addGetterSetter(V,"fillPatternX",0,B()),m.addGetterSetter(V,"fillPatternY",0,B()),m.addGetterSetter(V,"fillLinearGradientColorStops"),m.addGetterSetter(V,"strokeLinearGradientColorStops"),m.addGetterSetter(V,"fillRadialGradientStartRadius",0),m.addGetterSetter(V,"fillRadialGradientEndRadius",0),m.addGetterSetter(V,"fillRadialGradientColorStops"),m.addGetterSetter(V,"fillPatternRepeat","repeat"),m.addGetterSetter(V,"fillEnabled",!0),m.addGetterSetter(V,"strokeEnabled",!0),m.addGetterSetter(V,"shadowEnabled",!0),m.addGetterSetter(V,"dashEnabled",!0),m.addGetterSetter(V,"strokeScaleEnabled",!0),m.addGetterSetter(V,"fillPriority","color"),m.addComponentsGetterSetter(V,"fillPatternOffset",["x","y"]),m.addGetterSetter(V,"fillPatternOffsetX",0,B()),m.addGetterSetter(V,"fillPatternOffsetY",0,B()),m.addComponentsGetterSetter(V,"fillPatternScale",["x","y"]),m.addGetterSetter(V,"fillPatternScaleX",1,B()),m.addGetterSetter(V,"fillPatternScaleY",1,B()),m.addComponentsGetterSetter(V,"fillLinearGradientStartPoint",["x","y"]),m.addComponentsGetterSetter(V,"strokeLinearGradientStartPoint",["x","y"]),m.addGetterSetter(V,"fillLinearGradientStartPointX",0),m.addGetterSetter(V,"strokeLinearGradientStartPointX",0),m.addGetterSetter(V,"fillLinearGradientStartPointY",0),m.addGetterSetter(V,"strokeLinearGradientStartPointY",0),m.addComponentsGetterSetter(V,"fillLinearGradientEndPoint",["x","y"]),m.addComponentsGetterSetter(V,"strokeLinearGradientEndPoint",["x","y"]),m.addGetterSetter(V,"fillLinearGradientEndPointX",0),m.addGetterSetter(V,"strokeLinearGradientEndPointX",0),m.addGetterSetter(V,"fillLinearGradientEndPointY",0),m.addGetterSetter(V,"strokeLinearGradientEndPointY",0),m.addComponentsGetterSetter(V,"fillRadialGradientStartPoint",["x","y"]),m.addGetterSetter(V,"fillRadialGradientStartPointX",0),m.addGetterSetter(V,"fillRadialGradientStartPointY",0),m.addComponentsGetterSetter(V,"fillRadialGradientEndPoint",["x","y"]),m.addGetterSetter(V,"fillRadialGradientEndPointX",0),m.addGetterSetter(V,"fillRadialGradientEndPointY",0),m.addGetterSetter(V,"fillPatternRotation",0),m.addGetterSetter(V,"fillRule",void 0,Ti()),m.backCompat(V,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const Ug="beforeDraw",jg="draw",zc=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Xg=zc.length;class Pi extends se{constructor(t){super(t),this.canvas=new ni,this.hitCanvas=new fo({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const i=this.getStage();return i&&i.content&&(i.content.removeChild(this.getNativeCanvasElement()),t<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[t+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){G.prototype.moveToTop.call(this);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!G.prototype.moveUp.call(this))return!1;const i=this.getStage();return!i||!i.content?!1:(i.content.removeChild(this.getNativeCanvasElement()),this.index<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[this.index+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(G.prototype.moveDown.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(G.prototype.moveToBottom.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const t=this.getNativeCanvasElement();return G.prototype.remove.call(this),t&&t.parentNode&&w._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:i}){return this.canvas.setSize(t,i),this.hitCanvas.setSize(t,i),this._setSmoothEnabled(),this}_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&w.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t={...t},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),G.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){w.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){w.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,w.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let i=1,n=!1;for(;;){for(let s=0;s<Xg;s++){const r=zc[s],o=this._getIntersection({x:t.x+r.x*i,y:t.y+r.y*i}),a=o.shape;if(a)return a;if(n=!!o.antialiased,!o.antialiased)break}if(n)i+=1;else return null}}_getIntersection(t){const i=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*i),Math.round(t.y*i),1,1).data,s=n[3];if(s===255){const r=w.getHitColorKey(n[0],n[1],n[2]),o=Un[r];return o?{shape:o}:{antialiased:!0}}else if(s>0)return{antialiased:!0};return{}}drawScene(t,i,n){const s=this.getLayer(),r=t||s&&s.getCanvas();return this._fire(Ug,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),se.prototype.drawScene.call(this,r,i,n),this._fire(jg,{node:this}),this}drawHit(t,i){const n=this.getLayer(),s=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),se.prototype.drawHit.call(this,s,i),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){w.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return w.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return w.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Pi.prototype.nodeType="Layer",kt(Pi),m.addGetterSetter(Pi,"imageSmoothingEnabled",!0),m.addGetterSetter(Pi,"clearBeforeDraw",!0),m.addGetterSetter(Pi,"hitGraphEnabled",!0,ye());class Eo extends Pi{constructor(t){super(t),this.listening(!1),w.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Eo.prototype.nodeType="FastLayer",kt(Eo);class Ji extends se{_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&w.throw("You may only add groups and shapes to groups.")}}Ji.prototype.nodeType="Group",kt(Ji);const xo=(function(){return Ni.performance&&Ni.performance.now?function(){return Ni.performance.now()}:function(){return new Date().getTime()}})();class ae{constructor(t,i){this.id=ae.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:xo(),frameRate:0},this.func=t,this.setLayers(i)}setLayers(t){let i=[];return t&&(i=Array.isArray(t)?t:[t]),this.layers=i,this}getLayers(){return this.layers}addLayer(t){const i=this.layers,n=i.length;for(let s=0;s<n;s++)if(i[s]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const i=ae.animations,n=i.length;for(let s=0;s<n;s++)if(i[s].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=xo(),ae._addAnimation(this),this}stop(){return ae._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const i=t.id,n=this.animations,s=n.length;for(let r=0;r<s;r++)if(n[r].id===i){this.animations.splice(r,1);break}}static _runFrames(){const t={},i=this.animations;for(let n=0;n<i.length;n++){const s=i[n],r=s.layers,o=s.func;s._updateFrameObject(xo());const a=r.length;let l;if(o?l=o.call(s,s.frame)!==!1:l=!0,!!l)for(let h=0;h<a;h++){const c=r[h];c._id!==void 0&&(t[c._id]=c)}}for(const n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=ae;t.animations.length?(t._runFrames(),w.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,w.requestAnimFrame(this._animationLoop))}}ae.animations=[],ae.animIdCounter=0,ae.animRunning=!1;const zg={node:1,duration:1,easing:1,onFinish:1,yoyo:1},Yg=1,Yc=2,qc=3,Kc=["fill","stroke","shadowColor"];let qg=0;class Kg{constructor(t,i,n,s,r,o,a){this.prop=t,this.propFunc=i,this.begin=s,this._pos=s,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=a,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=r-this.begin,this.pause()}fire(t){const i=this[t];i&&i()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=Yc,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=qc,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const t=this.getTimer()-this._startTime;this.state===Yc?this.setTime(t):this.state===qc&&this.setTime(this.duration-t)}pause(){this.state=Yg,this.fire("onPause")}getTimer(){return new Date().getTime()}}class St{constructor(t){const i=this,n=t.node,s=n._id,r=t.easing||jn.Linear,o=!!t.yoyo;let a,l;typeof t.duration>"u"?a=.3:t.duration===0?a=.001:a=t.duration,this.node=n,this._id=qg++;const h=n.getLayer()||(n instanceof X.Stage?n.getLayers():null);h||w.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ae(function(){i.tween.onEnterFrame()},h),this.tween=new Kg(l,function(c){i._tweenFunc(c)},r,0,1,a*1e3,o),this._addListeners(),St.attrs[s]||(St.attrs[s]={}),St.attrs[s][this._id]||(St.attrs[s][this._id]={}),St.tweens[s]||(St.tweens[s]={});for(l in t)zg[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,i){const n=this.node,s=n._id;let r,o,a,l,h;const c=St.tweens[s][t];c&&delete St.attrs[s][c][t];let d=n.getAttr(t);if(w._isArray(i))if(r=[],o=Math.max(i.length,d.length),t==="points"&&i.length!==d.length&&(i.length>d.length?(l=d,d=w._prepareArrayForTween(d,i,n.closed())):(a=i,i=w._prepareArrayForTween(i,d,n.closed()))),t.indexOf("fill")===0)for(let u=0;u<o;u++)if(u%2===0)r.push(i[u]-d[u]);else{const f=w.colorToRGBA(d[u]);h=w.colorToRGBA(i[u]),d[u]=f,r.push({r:h.r-f.r,g:h.g-f.g,b:h.b-f.b,a:h.a-f.a})}else for(let u=0;u<o;u++)r.push(i[u]-d[u]);else Kc.indexOf(t)!==-1?(d=w.colorToRGBA(d),h=w.colorToRGBA(i),r={r:h.r-d.r,g:h.g-d.g,b:h.b-d.b,a:h.a-d.a}):r=i-d;St.attrs[s][this._id][t]={start:d,diff:r,end:i,trueEnd:a,trueStart:l},St.tweens[s][t]=this._id}_tweenFunc(t){const i=this.node,n=St.attrs[i._id][this._id];let s,r,o,a,l,h,c,d;for(s in n){if(r=n[s],o=r.start,a=r.diff,d=r.end,w._isArray(o))if(l=[],c=Math.max(o.length,d.length),s.indexOf("fill")===0)for(h=0;h<c;h++)h%2===0?l.push((o[h]||0)+a[h]*t):l.push("rgba("+Math.round(o[h].r+a[h].r*t)+","+Math.round(o[h].g+a[h].g*t)+","+Math.round(o[h].b+a[h].b*t)+","+(o[h].a+a[h].a*t)+")");else for(h=0;h<c;h++)l.push((o[h]||0)+a[h]*t);else Kc.indexOf(s)!==-1?l="rgba("+Math.round(o.r+a.r*t)+","+Math.round(o.g+a.g*t)+","+Math.round(o.b+a.b*t)+","+(o.a+a.a*t)+")":l=o+a*t;i.setAttr(s,l)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,i=St.attrs[t._id][this._id];i.points&&i.points.trueEnd&&t.setAttr("points",i.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,i=St.attrs[t._id][this._id];i.points&&i.points.trueStart&&t.points(i.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,i=this._id,n=St.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const s in n)delete St.tweens[t][s];delete St.attrs[t][i],St.tweens[t]&&(Object.keys(St.tweens[t]).length===0&&delete St.tweens[t],Object.keys(St.attrs[t]).length===0&&delete St.attrs[t])}}St.attrs={},St.tweens={},G.prototype.to=function(e){const t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new St(e).play()};const jn={BackEaseIn(e,t,i,n){return i*(e/=n)*e*((1.70158+1)*e-1.70158)+t},BackEaseOut(e,t,i,n){return i*((e=e/n-1)*e*((1.70158+1)*e+1.70158)+1)+t},BackEaseInOut(e,t,i,n){let s=1.70158;return(e/=n/2)<1?i/2*(e*e*(((s*=1.525)+1)*e-s))+t:i/2*((e-=2)*e*(((s*=1.525)+1)*e+s)+2)+t},ElasticEaseIn(e,t,i,n,s,r){let o=0;return e===0?t:(e/=n)===1?t+i:(r||(r=n*.3),!s||s<Math.abs(i)?(s=i,o=r/4):o=r/(2*Math.PI)*Math.asin(i/s),-(s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r))+t)},ElasticEaseOut(e,t,i,n,s,r){let o=0;return e===0?t:(e/=n)===1?t+i:(r||(r=n*.3),!s||s<Math.abs(i)?(s=i,o=r/4):o=r/(2*Math.PI)*Math.asin(i/s),s*Math.pow(2,-10*e)*Math.sin((e*n-o)*(2*Math.PI)/r)+i+t)},ElasticEaseInOut(e,t,i,n,s,r){let o=0;return e===0?t:(e/=n/2)===2?t+i:(r||(r=n*(.3*1.5)),!s||s<Math.abs(i)?(s=i,o=r/4):o=r/(2*Math.PI)*Math.asin(i/s),e<1?-.5*(s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r))+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r)*.5+i+t)},BounceEaseOut(e,t,i,n){return(e/=n)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t},BounceEaseIn(e,t,i,n){return i-jn.BounceEaseOut(n-e,0,i,n)+t},BounceEaseInOut(e,t,i,n){return e<n/2?jn.BounceEaseIn(e*2,0,i,n)*.5+t:jn.BounceEaseOut(e*2-n,0,i,n)*.5+i*.5+t},EaseIn(e,t,i,n){return i*(e/=n)*e+t},EaseOut(e,t,i,n){return-i*(e/=n)*(e-2)+t},EaseInOut(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},StrongEaseIn(e,t,i,n){return i*(e/=n)*e*e*e*e+t},StrongEaseOut(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t},StrongEaseInOut(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},Linear(e,t,i,n){return i*e/n+t}},Jc=w._assign(X,{Util:w,Transform:ne,Node:G,Container:se,Stage:Js,stages:Wn,Layer:Pi,FastLayer:Eo,Group:Ji,DD:gt,Shape:V,shapes:Un,Animation:ae,Tween:St,Easings:jn,Context:Hs,Canvas:uo});class Ue extends V{_sceneFunc(t){const i=X.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,i,n),t.arc(0,0,this.innerRadius(),i,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),i=this.outerRadius(),n=this.clockwise(),s=X.getAngle(n?360-this.angle():this.angle()),r=Math.cos(Math.min(s,Math.PI)),o=1,a=Math.sin(Math.min(Math.max(Math.PI,s),3*Math.PI/2)),l=Math.sin(Math.min(s,Math.PI/2)),h=r*(r>0?t:i),c=o*i,d=a*(a>0?t:i),u=l*(l>0?i:t);return{x:h,y:n?-1*u:d,width:c-h,height:u-d}}}Ue.prototype._centroid=!0,Ue.prototype.className="Arc",Ue.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],kt(Ue),m.addGetterSetter(Ue,"innerRadius",0,B()),m.addGetterSetter(Ue,"outerRadius",0,B()),m.addGetterSetter(Ue,"angle",0,B()),m.addGetterSetter(Ue,"clockwise",!1,ye());function Co(e,t,i,n,s,r,o){const a=Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2)),l=Math.sqrt(Math.pow(s-i,2)+Math.pow(r-n,2)),h=o*a/(a+l),c=o*l/(a+l),d=i-h*(s-e),u=n-h*(r-t),f=i+c*(s-e),p=n+c*(r-t);return[d,u,f,p]}function Qc(e,t){const i=e.length,n=[];for(let s=2;s<i-2;s+=2){const r=Co(e[s-2],e[s-1],e[s],e[s+1],e[s+2],e[s+3],t);isNaN(r[0])||(n.push(r[0]),n.push(r[1]),n.push(e[s]),n.push(e[s+1]),n.push(r[2]),n.push(r[3]))}return n}class je extends V{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const i=this.points(),n=i.length,s=this.tension(),r=this.closed(),o=this.bezier();if(!n)return;let a=0;if(t.beginPath(),t.moveTo(i[0],i[1]),s!==0&&n>4){const l=this.getTensionPoints(),h=l.length;for(a=r?0:4,r||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);a<h-2;)t.bezierCurveTo(l[a++],l[a++],l[a++],l[a++],l[a++],l[a++]);r||t.quadraticCurveTo(l[h-2],l[h-1],i[n-2],i[n-1])}else if(o)for(a=2;a<n;)t.bezierCurveTo(i[a++],i[a++],i[a++],i[a++],i[a++],i[a++]);else for(a=2;a<n;a+=2)t.lineTo(i[a],i[a+1]);r?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Qc(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),i=t.length,n=this.tension(),s=Co(t[i-2],t[i-1],t[0],t[1],t[2],t[3],n),r=Co(t[i-4],t[i-3],t[i-2],t[i-1],t[0],t[1],n),o=Qc(t,n);return[s[2],s[3]].concat(o).concat([r[0],r[1],t[i-2],t[i-1],r[2],r[3],s[0],s[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();let i=t[0],n=t[0],s=t[1],r=t[1],o,a;for(let l=0;l<t.length/2;l++)o=t[l*2],a=t[l*2+1],i=Math.min(i,o),n=Math.max(n,o),s=Math.min(s,a),r=Math.max(r,a);return{x:i,y:s,width:n-i,height:r-s}}}je.prototype.className="Line",je.prototype._attrsAffectingSize=["points","bezier","tension"],kt(je),m.addGetterSetter(je,"closed",!1),m.addGetterSetter(je,"bezier",!1),m.addGetterSetter(je,"tension",0,B()),m.addGetterSetter(je,"points",[],fg());const Jg=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Qg=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Zg=[[1],[1,1],[1,2,1],[1,3,3,1]],Zc=(e,t,i)=>{let n,s;const o=i/2;n=0;for(let a=0;a<20;a++)s=o*Jg[20][a]+o,n+=Qg[20][a]*t1(e,t,s);return o*n},th=(e,t,i)=>{i===void 0&&(i=1);const n=e[0]-2*e[1]+e[2],s=t[0]-2*t[1]+t[2],r=2*e[1]-2*e[0],o=2*t[1]-2*t[0],a=4*(n*n+s*s),l=4*(n*r+s*o),h=r*r+o*o;if(a===0)return i*Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(t[2]-t[0],2));const c=l/(2*a),d=h/a,u=i+c,f=d-c*c,p=u*u+f>0?Math.sqrt(u*u+f):0,_=c*c+f>0?Math.sqrt(c*c+f):0,v=c+Math.sqrt(c*c+f)!==0?f*Math.log(Math.abs((u+p)/(c+_))):0;return Math.sqrt(a)/2*(u*p-c*_+v)};function t1(e,t,i){const n=No(1,i,e),s=No(1,i,t),r=n*n+s*s;return Math.sqrt(r)}const No=(e,t,i)=>{const n=i.length-1;let s,r;if(n===0)return 0;if(e===0){r=0;for(let o=0;o<=n;o++)r+=Zg[n][o]*Math.pow(1-t,n-o)*Math.pow(t,o)*i[o];return r}else{s=new Array(n);for(let o=0;o<n;o++)s[o]=n*(i[o+1]-i[o]);return No(e-1,t,s)}},eh=(e,t,i)=>{let n=1,s=e/t,r=(e-i(s))/t,o=0;for(;n>.001;){const a=i(s+r),l=Math.abs(e-a)/t;if(l<n)n=l,s+=r;else{const h=i(s-r),c=Math.abs(e-h)/t;c<n?(n=c,s-=r):r/=2}if(o++,o>500)break}return s};class Et extends V{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Et.parsePathData(this.data()),this.pathLength=Et.getPathLength(this.dataArray)}_sceneFunc(t){const i=this.dataArray;t.beginPath();let n=!1;for(let s=0;s<i.length;s++){const r=i[s].command,o=i[s].points;switch(r){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":const a=o[0],l=o[1],h=o[2],c=o[3],d=o[4],u=o[5],f=o[6],p=o[7],_=h>c?h:c,v=h>c?1:h/c,S=h>c?c/h:1;t.translate(a,l),t.rotate(f),t.scale(v,S),t.arc(0,0,_,d,d+u,1-p),t.scale(1/v,1/S),t.rotate(-f),t.translate(-a,-l);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(l){if(l.command==="A"){const h=l.points[4],c=l.points[5],d=l.points[4]+c;let u=Math.PI/180;if(Math.abs(h-d)<u&&(u=Math.abs(h-d)),c<0)for(let f=h-u;f>d;f-=u){const p=Et.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],f,0);t.push(p.x,p.y)}else for(let f=h+u;f<d;f+=u){const p=Et.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],f,0);t.push(p.x,p.y)}}else if(l.command==="C")for(let h=0;h<=1;h+=.01){const c=Et.getPointOnCubicBezier(h,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]);t.push(c.x,c.y)}else t=t.concat(l.points)});let i=t[0],n=t[0],s=t[1],r=t[1],o,a;for(let l=0;l<t.length/2;l++)o=t[l*2],a=t[l*2+1],isNaN(o)||(i=Math.min(i,o),n=Math.max(n,o)),isNaN(a)||(s=Math.min(s,a),r=Math.max(r,a));return{x:i,y:s,width:n-i,height:r-s}}getLength(){return this.pathLength}getPointAtLength(t){return Et.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,i,n,s){return Math.sqrt((n-t)*(n-t)+(s-i)*(s-i))}static getPathLength(t){let i=0;for(let n=0;n<t.length;++n)i+=t[n].pathLength;return i}static getPointAtLengthOfDataArray(t,i){let n,s=0,r=i.length;if(!r)return null;for(;s<r&&t>i[s].pathLength;)t-=i[s].pathLength,++s;if(s===r)return n=i[s-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return i[s].command==="M"?(n=i[s].points.slice(0,2),{x:n[0],y:n[1]}):{x:i[s].start.x,y:i[s].start.y};const o=i[s],a=o.points;switch(o.command){case"L":return Et.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return Et.getPointOnCubicBezier(eh(t,Et.getPathLength(i),_=>Zc([o.start.x,a[0],a[2],a[4]],[o.start.y,a[1],a[3],a[5]],_)),o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return Et.getPointOnQuadraticBezier(eh(t,Et.getPathLength(i),_=>th([o.start.x,a[0],a[2]],[o.start.y,a[1],a[3]],_)),o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":const l=a[0],h=a[1],c=a[2],d=a[3],u=a[5],f=a[6];let p=a[4];return p+=u*t/o.pathLength,Et.getPointOnEllipticalArc(l,h,c,d,p,f)}return null}static getPointOnLine(t,i,n,s,r,o,a){o=o??i,a=a??n;const l=this.getLineLength(i,n,s,r);if(l<1e-10)return{x:i,y:n};if(s===i)return{x:o,y:a+(r>n?t:-t)};const h=(r-n)/(s-i),c=Math.sqrt(t*t/(1+h*h))*(s<i?-1:1),d=h*c;if(Math.abs(a-n-h*(o-i))<1e-10)return{x:o+c,y:a+d};const u=((o-i)*(s-i)+(a-n)*(r-n))/(l*l),f=i+u*(s-i),p=n+u*(r-n),_=this.getLineLength(o,a,f,p),v=Math.sqrt(t*t-_*_),S=Math.sqrt(v*v/(1+h*h))*(s<i?-1:1),b=h*S;return{x:f+S,y:p+b}}static getPointOnCubicBezier(t,i,n,s,r,o,a,l,h){function c(v){return v*v*v}function d(v){return 3*v*v*(1-v)}function u(v){return 3*v*(1-v)*(1-v)}function f(v){return(1-v)*(1-v)*(1-v)}const p=l*c(t)+o*d(t)+s*u(t)+i*f(t),_=h*c(t)+a*d(t)+r*u(t)+n*f(t);return{x:p,y:_}}static getPointOnQuadraticBezier(t,i,n,s,r,o,a){function l(f){return f*f}function h(f){return 2*f*(1-f)}function c(f){return(1-f)*(1-f)}const d=o*l(t)+s*h(t)+i*c(t),u=a*l(t)+r*h(t)+n*c(t);return{x:d,y:u}}static getPointOnEllipticalArc(t,i,n,s,r,o){const a=Math.cos(o),l=Math.sin(o),h={x:n*Math.cos(r),y:s*Math.sin(r)};return{x:t+(h.x*a-h.y*l),y:i+(h.x*l+h.y*a)}}static parsePathData(t){if(!t)return[];let i=t;const n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];i=i.replace(new RegExp(" ","g"),",");for(let d=0;d<n.length;d++)i=i.replace(new RegExp(n[d],"g"),"|"+n[d]);const s=i.split("|"),r=[],o=[];let a=0,l=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let c;for(let d=1;d<s.length;d++){let u=s[d],f=u.charAt(0);for(u=u.slice(1),o.length=0;c=h.exec(u);)o.push(c[0]);let p=[],_=f==="A"||f==="a"?0:-1;for(let v=0,S=o.length;v<S;v++){const b=o[v];if(b==="00"){p.push(0,0),_>=0&&(_+=2,_>=7&&(_-=7));continue}if(_>=0){if(_===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(b)){p.push(parseInt(b[0],10)),p.push(parseInt(b[1],10)),p.push(parseFloat(b.slice(2))),_+=3,_>=7&&(_-=7);continue}if(b==="11"||b==="10"||b==="01"){p.push(parseInt(b[0],10)),p.push(parseInt(b[1],10)),_+=2,_>=7&&(_-=7);continue}if(b==="0"||b==="1"){p.push(parseInt(b,10)),_+=1,_>=7&&(_-=7);continue}}else if(_===4){if(/^[01]\d+(?:\.\d+)?$/.test(b)){p.push(parseInt(b[0],10)),p.push(parseFloat(b.slice(1))),_+=2,_>=7&&(_-=7);continue}if(b==="0"||b==="1"){p.push(parseInt(b,10)),_+=1,_>=7&&(_-=7);continue}}const x=parseFloat(b);isNaN(x)?p.push(0):p.push(x),_+=1,_>=7&&(_-=7)}else{const x=parseFloat(b);isNaN(x)?p.push(0):p.push(x)}}for(;p.length>0&&!isNaN(p[0]);){let v="",S=[];const b=a,x=l;let N,T,P,E,C,O,H,K,z,Z;switch(f){case"l":a+=p.shift(),l+=p.shift(),v="L",S.push(a,l);break;case"L":a=p.shift(),l=p.shift(),S.push(a,l);break;case"m":const J=p.shift(),A=p.shift();if(a+=J,l+=A,v="M",r.length>2&&r[r.length-1].command==="z"){for(let L=r.length-2;L>=0;L--)if(r[L].command==="M"){a=r[L].points[0]+J,l=r[L].points[1]+A;break}}S.push(a,l),f="l";break;case"M":a=p.shift(),l=p.shift(),v="M",S.push(a,l),f="L";break;case"h":a+=p.shift(),v="L",S.push(a,l);break;case"H":a=p.shift(),v="L",S.push(a,l);break;case"v":l+=p.shift(),v="L",S.push(a,l);break;case"V":l=p.shift(),v="L",S.push(a,l);break;case"C":S.push(p.shift(),p.shift(),p.shift(),p.shift()),a=p.shift(),l=p.shift(),S.push(a,l);break;case"c":S.push(a+p.shift(),l+p.shift(),a+p.shift(),l+p.shift()),a+=p.shift(),l+=p.shift(),v="C",S.push(a,l);break;case"S":T=a,P=l,N=r[r.length-1],N.command==="C"&&(T=a+(a-N.points[2]),P=l+(l-N.points[3])),S.push(T,P,p.shift(),p.shift()),a=p.shift(),l=p.shift(),v="C",S.push(a,l);break;case"s":T=a,P=l,N=r[r.length-1],N.command==="C"&&(T=a+(a-N.points[2]),P=l+(l-N.points[3])),S.push(T,P,a+p.shift(),l+p.shift()),a+=p.shift(),l+=p.shift(),v="C",S.push(a,l);break;case"Q":S.push(p.shift(),p.shift()),a=p.shift(),l=p.shift(),S.push(a,l);break;case"q":S.push(a+p.shift(),l+p.shift()),a+=p.shift(),l+=p.shift(),v="Q",S.push(a,l);break;case"T":T=a,P=l,N=r[r.length-1],N.command==="Q"&&(T=a+(a-N.points[0]),P=l+(l-N.points[1])),a=p.shift(),l=p.shift(),v="Q",S.push(T,P,a,l);break;case"t":T=a,P=l,N=r[r.length-1],N.command==="Q"&&(T=a+(a-N.points[0]),P=l+(l-N.points[1])),a+=p.shift(),l+=p.shift(),v="Q",S.push(T,P,a,l);break;case"A":E=p.shift(),C=p.shift(),O=p.shift(),H=p.shift(),K=p.shift(),z=a,Z=l,a=p.shift(),l=p.shift(),v="A",S=this.convertEndpointToCenterParameterization(z,Z,a,l,H,K,E,C,O);break;case"a":E=p.shift(),C=p.shift(),O=p.shift(),H=p.shift(),K=p.shift(),z=a,Z=l,a+=p.shift(),l+=p.shift(),v="A",S=this.convertEndpointToCenterParameterization(z,Z,a,l,H,K,E,C,O);break}r.push({command:v||f,points:S,start:{x:b,y:x},pathLength:this.calcLength(b,x,v||f,S)})}(f==="z"||f==="Z")&&r.push({command:"z",points:[],start:void 0,pathLength:0})}return r}static calcLength(t,i,n,s){let r,o,a,l;const h=Et;switch(n){case"L":return h.getLineLength(t,i,s[0],s[1]);case"C":return Zc([t,s[0],s[2],s[4]],[i,s[1],s[3],s[5]],1);case"Q":return th([t,s[0],s[2]],[i,s[1],s[3]],1);case"A":r=0;const c=s[4],d=s[5],u=s[4]+d;let f=Math.PI/180;if(Math.abs(c-u)<f&&(f=Math.abs(c-u)),o=h.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],c,0),d<0)for(l=c-f;l>u;l-=f)a=h.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],l,0),r+=h.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(l=c+f;l<u;l+=f)a=h.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],l,0),r+=h.getLineLength(o.x,o.y,a.x,a.y),o=a;return a=h.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],u,0),r+=h.getLineLength(o.x,o.y,a.x,a.y),r}return 0}static convertEndpointToCenterParameterization(t,i,n,s,r,o,a,l,h){const c=h*(Math.PI/180),d=Math.cos(c)*(t-n)/2+Math.sin(c)*(i-s)/2,u=-1*Math.sin(c)*(t-n)/2+Math.cos(c)*(i-s)/2,f=d*d/(a*a)+u*u/(l*l);f>1&&(a*=Math.sqrt(f),l*=Math.sqrt(f));let p=Math.sqrt((a*a*(l*l)-a*a*(u*u)-l*l*(d*d))/(a*a*(u*u)+l*l*(d*d)));r===o&&(p*=-1),isNaN(p)&&(p=0);const _=p*a*u/l,v=p*-l*d/a,S=(t+n)/2+Math.cos(c)*_-Math.sin(c)*v,b=(i+s)/2+Math.sin(c)*_+Math.cos(c)*v,x=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},N=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(x(H)*x(K))},T=function(H,K){return(H[0]*K[1]<H[1]*K[0]?-1:1)*Math.acos(N(H,K))},P=T([1,0],[(d-_)/a,(u-v)/l]),E=[(d-_)/a,(u-v)/l],C=[(-1*d-_)/a,(-1*u-v)/l];let O=T(E,C);return N(E,C)<=-1&&(O=Math.PI),N(E,C)>=1&&(O=0),o===0&&O>0&&(O=O-2*Math.PI),o===1&&O<0&&(O=O+2*Math.PI),[S,b,a,l,P,O,c,o]}}Et.prototype.className="Path",Et.prototype._attrsAffectingSize=["data"],kt(Et),m.addGetterSetter(Et,"data");class Oi extends je{_sceneFunc(t){super._sceneFunc(t);const i=Math.PI*2,n=this.points();let s=n;const r=this.tension()!==0&&n.length>4;r&&(s=this.getTensionPoints());const o=this.pointerLength(),a=n.length;let l,h;if(r){const u=[s[s.length-4],s[s.length-3],s[s.length-2],s[s.length-1],n[a-2],n[a-1]],f=Et.calcLength(s[s.length-4],s[s.length-3],"C",u),p=Et.getPointOnQuadraticBezier(Math.min(1,1-o/f),u[0],u[1],u[2],u[3],u[4],u[5]);l=n[a-2]-p.x,h=n[a-1]-p.y}else l=n[a-2]-n[a-4],h=n[a-1]-n[a-3];const c=(Math.atan2(h,l)+i)%i,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[a-2],n[a-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-o,d/2),t.lineTo(-o,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),r?(l=(s[0]+s[2])/2-n[0],h=(s[1]+s[3])/2-n[1]):(l=n[2]-n[0],h=n[3]-n[1]),t.rotate((Math.atan2(-h,-l)+i)%i),t.moveTo(0,0),t.lineTo(-o,d/2),t.lineTo(-o,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const i=this.dashEnabled();i&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),i&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),i=this.pointerWidth()/2;return{x:t.x,y:t.y-i,width:t.width,height:t.height+i*2}}}Oi.prototype.className="Arrow",kt(Oi),m.addGetterSetter(Oi,"pointerLength",10,B()),m.addGetterSetter(Oi,"pointerWidth",10,B()),m.addGetterSetter(Oi,"pointerAtBeginning",!1),m.addGetterSetter(Oi,"pointerAtEnding",!0);class Qi extends V{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Qi.prototype._centroid=!0,Qi.prototype.className="Circle",Qi.prototype._attrsAffectingSize=["radius"],kt(Qi),m.addGetterSetter(Qi,"radius",0,B());class oi extends V{_sceneFunc(t){const i=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),i!==n&&t.scale(1,n/i),t.arc(0,0,i,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}oi.prototype.className="Ellipse",oi.prototype._centroid=!0,oi.prototype._attrsAffectingSize=["radiusX","radiusY"],kt(oi),m.addComponentsGetterSetter(oi,"radius",["x","y"]),m.addGetterSetter(oi,"radiusX",0,B()),m.addGetterSetter(oi,"radiusY",0,B());class re extends V{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",i=>{this._removeImageLoad(i.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),i=this.hasShadow();return t&&i?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const i=this.getWidth(),n=this.getHeight(),s=this.cornerRadius(),r=this.attrs.image;let o;if(r){const a=this.attrs.cropWidth,l=this.attrs.cropHeight;a&&l?o=[r,this.cropX(),this.cropY(),a,l,0,0,i,n]:o=[r,0,0,i,n]}(this.hasFill()||this.hasStroke()||s)&&(t.beginPath(),s?w.drawRoundedRectPath(t,i,n,s):t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)),r&&(s&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){const i=this.width(),n=this.height(),s=this.cornerRadius();t.beginPath(),s?w.drawRoundedRectPath(t,i,n,s):t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,i,n;return(n=(t=this.attrs.width)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.width)!==null&&n!==void 0?n:0}getHeight(){var t,i,n;return(n=(t=this.attrs.height)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:0}static fromURL(t,i,n=null){const s=w.createImageElement();s.onload=function(){const r=new re({image:s});i(r)},s.onerror=n,s.crossOrigin="Anonymous",s.src=t}}re.prototype.className="Image",re.prototype._attrsAffectingSize=["image"],kt(re),m.addGetterSetter(re,"cornerRadius",0,Us(4)),m.addGetterSetter(re,"image"),m.addComponentsGetterSetter(re,"crop",["x","y","width","height"]),m.addGetterSetter(re,"cropX",0,B()),m.addGetterSetter(re,"cropY",0,B()),m.addGetterSetter(re,"cropWidth",0,B()),m.addGetterSetter(re,"cropHeight",0,B());const ih=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],e1="Change.konva",i1="none",To="up",ko="right",Po="down",Oo="left",n1=ih.length;class Ao extends Ji{constructor(t){super(t),this.on("add.konva",function(i){this._addListeners(i.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){let i=this,n;const s=function(){i._sync()};for(n=0;n<n1;n++)t.on(ih[n]+e1,s)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let t=this.getText(),i=this.getTag(),n,s,r,o,a,l,h;if(t&&i){switch(n=t.width(),s=t.height(),r=i.pointerDirection(),o=i.pointerWidth(),h=i.pointerHeight(),a=0,l=0,r){case To:a=n/2,l=-1*h;break;case ko:a=n+o,l=s/2;break;case Po:a=n/2,l=s+h;break;case Oo:a=-1*o,l=s/2;break}i.setAttrs({x:-1*a,y:-1*l,width:n,height:s}),t.setAttrs({x:-1*a,y:-1*l})}}}Ao.prototype.className="Label",kt(Ao);class Ai extends V{_sceneFunc(t){const i=this.width(),n=this.height(),s=this.pointerDirection(),r=this.pointerWidth(),o=this.pointerHeight(),a=this.cornerRadius();let l=0,h=0,c=0,d=0;typeof a=="number"?l=h=c=d=Math.min(a,i/2,n/2):(l=Math.min(a[0]||0,i/2,n/2),h=Math.min(a[1]||0,i/2,n/2),d=Math.min(a[2]||0,i/2,n/2),c=Math.min(a[3]||0,i/2,n/2)),t.beginPath(),t.moveTo(l,0),s===To&&(t.lineTo((i-r)/2,0),t.lineTo(i/2,-1*o),t.lineTo((i+r)/2,0)),t.lineTo(i-h,0),t.arc(i-h,h,h,Math.PI*3/2,0,!1),s===ko&&(t.lineTo(i,(n-o)/2),t.lineTo(i+r,n/2),t.lineTo(i,(n+o)/2)),t.lineTo(i,n-d),t.arc(i-d,n-d,d,0,Math.PI/2,!1),s===Po&&(t.lineTo((i+r)/2,n),t.lineTo(i/2,n+o),t.lineTo((i-r)/2,n)),t.lineTo(c,n),t.arc(c,n-c,c,Math.PI/2,Math.PI,!1),s===Oo&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*r,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){let t=0,i=0,n=this.pointerWidth(),s=this.pointerHeight(),r=this.pointerDirection(),o=this.width(),a=this.height();return r===To?(i-=s,a+=s):r===Po?a+=s:r===Oo?(t-=n*1.5,o+=n):r===ko&&(o+=n*1.5),{x:t,y:i,width:o,height:a}}}Ai.prototype.className="Tag",kt(Ai),m.addGetterSetter(Ai,"pointerDirection",i1),m.addGetterSetter(Ai,"pointerWidth",0,B()),m.addGetterSetter(Ai,"pointerHeight",0,B()),m.addGetterSetter(Ai,"cornerRadius",0,Us(4));class Xn extends V{_sceneFunc(t){const i=this.cornerRadius(),n=this.width(),s=this.height();t.beginPath(),i?w.drawRoundedRectPath(t,n,s,i):t.rect(0,0,n,s),t.closePath(),t.fillStrokeShape(this)}}Xn.prototype.className="Rect",kt(Xn),m.addGetterSetter(Xn,"cornerRadius",0,Us(4));class ai extends V{_sceneFunc(t){const i=this._getPoints(),n=this.radius(),s=this.sides(),r=this.cornerRadius();if(t.beginPath(),r)w.drawRoundedPolygonPath(t,i,s,n,r);else{t.moveTo(i[0].x,i[0].y);for(let o=1;o<i.length;o++)t.lineTo(i[o].x,i[o].y)}t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,i=this.attrs.radius||0,n=[];for(let s=0;s<t;s++)n.push({x:i*Math.sin(s*2*Math.PI/t),y:-1*i*Math.cos(s*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();let i=t[0].x,n=t[0].x,s=t[0].y,r=t[0].y;return t.forEach(o=>{i=Math.min(i,o.x),n=Math.max(n,o.x),s=Math.min(s,o.y),r=Math.max(r,o.y)}),{x:i,y:s,width:n-i,height:r-s}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}ai.prototype.className="RegularPolygon",ai.prototype._centroid=!0,ai.prototype._attrsAffectingSize=["radius"],kt(ai),m.addGetterSetter(ai,"radius",0,B()),m.addGetterSetter(ai,"sides",0,B()),m.addGetterSetter(ai,"cornerRadius",0,Us(4));const nh=Math.PI*2;class Mi extends V{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,nh,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),nh,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Mi.prototype.className="Ring",Mi.prototype._centroid=!0,Mi.prototype._attrsAffectingSize=["innerRadius","outerRadius"],kt(Mi),m.addGetterSetter(Mi,"innerRadius",0,B()),m.addGetterSetter(Mi,"outerRadius",0,B());class Oe extends V{constructor(t){super(t),this._updated=!0,this.anim=new ae(()=>{const i=this._updated;return this._updated=!1,i}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){const i=this.animation(),n=this.frameIndex(),s=n*4,r=this.animations()[i],o=this.frameOffsets(),a=r[s+0],l=r[s+1],h=r[s+2],c=r[s+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,h,c),t.closePath(),t.fillStrokeShape(this)),d)if(o){const u=o[i],f=n*2;t.drawImage(d,a,l,h,c,u[f+0],u[f+1],h,c)}else t.drawImage(d,a,l,h,c,0,0,h,c)}_hitFunc(t){const i=this.animation(),n=this.frameIndex(),s=n*4,r=this.animations()[i],o=this.frameOffsets(),a=r[s+2],l=r[s+3];if(t.beginPath(),o){const h=o[i],c=n*2;t.rect(h[c+0],h[c+1],a,l)}else t.rect(0,0,a,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const t=this.frameIndex(),i=this.animation(),n=this.animations(),s=n[i],r=s.length/4;t<r-1?this.frameIndex(t+1):this.frameIndex(0)}}Oe.prototype.className="Sprite",kt(Oe),m.addGetterSetter(Oe,"animation"),m.addGetterSetter(Oe,"animations"),m.addGetterSetter(Oe,"frameOffsets"),m.addGetterSetter(Oe,"image"),m.addGetterSetter(Oe,"frameIndex",0,B()),m.addGetterSetter(Oe,"frameRate",17,B()),m.backCompat(Oe,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class li extends V{_sceneFunc(t){const i=this.innerRadius(),n=this.outerRadius(),s=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(let r=1;r<s*2;r++){const o=r%2===0?n:i,a=o*Math.sin(r*Math.PI/s),l=-1*o*Math.cos(r*Math.PI/s);t.lineTo(a,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}li.prototype.className="Star",li.prototype._centroid=!0,li.prototype._attrsAffectingSize=["innerRadius","outerRadius"],kt(li),m.addGetterSetter(li,"numPoints",5,B()),m.addGetterSetter(li,"innerRadius",0,B()),m.addGetterSetter(li,"outerRadius",0,B());function ci(e){return[...e].reduce((t,i,n,s)=>{if(new RegExp("\\p{Emoji}","u").test(i)){const r=s[n+1];r&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(r)?(t.push(i+r),s[n+1]=""):t.push(i)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(i+(s[n+1]||""))?t.push(i+s[n+1]):n>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(i)?t[t.length-1]+=i:i&&t.push(i);return t},[])}const Zi="auto",s1="center",sh="inherit",zn="justify",r1="Change.konva",o1="2d",rh="-",oh="left",a1="text",l1="Text",c1="top",h1="bottom",ah="middle",lh="normal",d1="px ",Zs=" ",u1="right",ch="rtl",f1="word",p1="char",hh="none",Mo="…",dh=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],g1=dh.length;function m1(e){return e.split(",").map(t=>{t=t.trim();const i=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return i&&!n&&(t=`"${t}"`),t}).join(", ")}let tr;function Ro(){return tr||(tr=w.createCanvasElement().getContext(o1),tr)}function _1(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function y1(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function b1(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class xt extends V{constructor(t){super(b1(t)),this._partialTextX=0,this._partialTextY=0;for(let i=0;i<g1;i++)this.on(dh[i]+r1,this._setTextData);this._setTextData()}_sceneFunc(t){var i,n;const s=this.textArr,r=s.length;if(!this.text())return;let o=this.padding(),a=this.fontSize(),l=this.lineHeight()*a,h=this.verticalAlign(),c=this.direction(),d=0,u=this.align(),f=this.getWidth(),p=this.letterSpacing(),_=this.charRenderFunc(),v=this.fill(),S=this.textDecoration(),b=S.indexOf("underline")!==-1,x=S.indexOf("line-through")!==-1,N;c=c===sh?t.direction:c;let T=l/2,P=ah;if(!X.legacyTextRendering){const E=this.measureSize("M");P="alphabetic";const C=(i=E.fontBoundingBoxAscent)!==null&&i!==void 0?i:E.actualBoundingBoxAscent,O=(n=E.fontBoundingBoxDescent)!==null&&n!==void 0?n:E.actualBoundingBoxDescent;T=(C-O)/2+l/2}for(c===ch&&t.setAttr("direction",c),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",P),t.setAttr("textAlign",oh),h===ah?d=(this.getHeight()-r*l-o*2)/2:h===h1&&(d=this.getHeight()-r*l-o*2),t.translate(o,d+o),N=0;N<r;N++){let E=0,C=0;const O=s[N],H=O.text,K=O.width,z=O.lastInParagraph;if(t.save(),u===u1?E+=f-K-o*2:u===s1&&(E+=(f-K-o*2)/2),b){t.save(),t.beginPath();const J=X.legacyTextRendering?Math.round(a/2):Math.round(a/4),A=E,L=T+C+J;t.moveTo(A,L);const $=u===zn&&!z?f-o*2:K;t.lineTo(A+Math.round($),L),t.lineWidth=a/15;const D=this._getLinearGradient();t.strokeStyle=D||v,t.stroke(),t.restore()}const Z=E;if(c!==ch&&(p!==0||u===zn||_)){const J=H.split(" ").length-1,A=ci(H);for(let L=0;L<A.length;L++){const $=A[L];if($===" "&&!z&&u===zn&&(E+=(f-o*2-K)/J),this._partialTextX=E,this._partialTextY=T+C,this._partialText=$,_){t.save();const nt=s.slice(0,N).reduce((ot,mt)=>ot+ci(mt.text).length,0),ht=L+nt;_({char:$,index:ht,x:E,y:T+C,lineIndex:N,column:L,isLastInLine:z,width:this.measureSize($).width,context:t})}t.fillStrokeShape(this),_&&t.restore(),E+=this.measureSize($).width+p}}else p!==0&&t.setAttr("letterSpacing",`${p}px`),this._partialTextX=E,this._partialTextY=T+C,this._partialText=H,t.fillStrokeShape(this);if(x){t.save(),t.beginPath();const J=X.legacyTextRendering?0:-Math.round(a/4),A=Z;t.moveTo(A,T+C+J);const L=u===zn&&!z?f-o*2:K;t.lineTo(A+Math.round(L),T+C+J),t.lineWidth=a/15;const $=this._getLinearGradient();t.strokeStyle=$||v,t.stroke(),t.restore()}t.restore(),r>1&&(T+=l)}}_hitFunc(t){const i=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)}setText(t){const i=w._isString(t)?t:t==null?"":t+"";return this._setAttr(a1,i),this}getWidth(){return this.attrs.width===Zi||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Zi||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return w.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var i,n,s,r,o,a,l,h,c,d,u;let f=Ro(),p=this.fontSize(),_;f.save(),f.font=this._getContextFont(),_=f.measureText(t),f.restore();const v=p/100;return{actualBoundingBoxAscent:(i=_.actualBoundingBoxAscent)!==null&&i!==void 0?i:71.58203125*v,actualBoundingBoxDescent:(n=_.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(s=_.actualBoundingBoxLeft)!==null&&s!==void 0?s:-7.421875*v,actualBoundingBoxRight:(r=_.actualBoundingBoxRight)!==null&&r!==void 0?r:75.732421875*v,alphabeticBaseline:(o=_.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(a=_.emHeightAscent)!==null&&a!==void 0?a:100*v,emHeightDescent:(l=_.emHeightDescent)!==null&&l!==void 0?l:-20*v,fontBoundingBoxAscent:(h=_.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*v,fontBoundingBoxDescent:(c=_.fontBoundingBoxDescent)!==null&&c!==void 0?c:21*v,hangingBaseline:(d=_.hangingBaseline)!==null&&d!==void 0?d:72.80000305175781*v,ideographicBaseline:(u=_.ideographicBaseline)!==null&&u!==void 0?u:-21*v,width:_.width,height:p}}_getContextFont(){return this.fontStyle()+Zs+this.fontVariant()+Zs+(this.fontSize()+d1)+m1(this.fontFamily())}_addTextLine(t){this.align()===zn&&(t=t.trim());const n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){const i=this.letterSpacing(),n=t.length;return Ro().measureText(t).width+i*n}_setTextData(){let t=this.text().split(`
30
+ `),i=+this.fontSize(),n=0,s=this.lineHeight()*i,r=this.attrs.width,o=this.attrs.height,a=r!==Zi&&r!==void 0,l=o!==Zi&&o!==void 0,h=this.padding(),c=r-h*2,d=o-h*2,u=0,f=this.wrap(),p=f!==hh,_=f!==p1&&p,v=this.ellipsis();this.textArr=[],Ro().font=this._getContextFont();const S=v?this._getTextWidth(Mo):0;for(let b=0,x=t.length;b<x;++b){let N=t[b],T=this._getTextWidth(N);if(a&&T>c)for(;N.length>0;){let P=0,E=ci(N).length,C="",O=0;for(;P<E;){const H=P+E>>>1,K=ci(N),z=K.slice(0,H+1).join(""),Z=this._getTextWidth(z);(v&&l&&u+s>d?Z+S:Z)<=c?(P=H+1,C=z,O=Z):E=H}if(C){if(_){const z=ci(N),Z=ci(C),J=z[Z.length],A=J===Zs||J===rh;let L;if(A&&O<=c)L=Z.length;else{const $=Z.lastIndexOf(Zs),D=Z.lastIndexOf(rh);L=Math.max($,D)+1}L>0&&(P=L,C=z.slice(0,P).join(""),O=this._getTextWidth(C))}if(C=C.trimRight(),this._addTextLine(C),n=Math.max(n,O),u+=s,this._shouldHandleEllipsis(u)){this._tryToAddEllipsisToLastLine();break}if(N=ci(N).slice(P).join("").trimLeft(),N.length>0&&(T=this._getTextWidth(N),T<=c)){this._addTextLine(N),u+=s,n=Math.max(n,T);break}}else break}else this._addTextLine(N),u+=s,n=Math.max(n,T),this._shouldHandleEllipsis(u)&&b<x-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&u+s>d)break}this.textHeight=i,this.textWidth=n}_shouldHandleEllipsis(t){const i=+this.fontSize(),n=this.lineHeight()*i,s=this.attrs.height,r=s!==Zi&&s!==void 0,o=this.padding(),a=s-o*2;return!(this.wrap()!==hh)||r&&t+n>a}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,i=t!==Zi&&t!==void 0,n=this.padding(),s=t-n*2,r=this.ellipsis(),o=this.textArr[this.textArr.length-1];!o||!r||(i&&(this._getTextWidth(o.text+Mo)<s||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Mo))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,i=this.hasShadow();return t&&i?!0:super._useBufferCanvas()}}xt.prototype._fillFunc=_1,xt.prototype._strokeFunc=y1,xt.prototype.className=l1,xt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],kt(xt),m.overWriteSetter(xt,"width",po()),m.overWriteSetter(xt,"height",po()),m.addGetterSetter(xt,"direction",sh),m.addGetterSetter(xt,"fontFamily","Arial"),m.addGetterSetter(xt,"fontSize",12,B()),m.addGetterSetter(xt,"fontStyle",lh),m.addGetterSetter(xt,"fontVariant",lh),m.addGetterSetter(xt,"padding",0,B()),m.addGetterSetter(xt,"align",oh),m.addGetterSetter(xt,"verticalAlign",c1),m.addGetterSetter(xt,"lineHeight",1,B()),m.addGetterSetter(xt,"wrap",f1),m.addGetterSetter(xt,"ellipsis",!1,ye()),m.addGetterSetter(xt,"letterSpacing",0,B()),m.addGetterSetter(xt,"text","",Ti()),m.addGetterSetter(xt,"textDecoration",""),m.addGetterSetter(xt,"charRenderFunc",void 0);const v1="",uh="normal";function fh(e){e.fillText(this.partialText,0,0)}function ph(e){e.strokeText(this.partialText,0,0)}class Vt extends V{constructor(t){super(t),this.dummyCanvas=w.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Et.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const i=this.pathLength;return t>i?null:Et.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Et.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();const i=this.textDecoration(),n=this.fill(),s=this.fontSize(),r=this.glyphInfo,o=i.indexOf("underline")!==-1,a=i.indexOf("line-through")!==-1;o&&t.beginPath();for(let l=0;l<r.length;l++){t.save();const h=r[l].p0;t.translate(h.x,h.y),t.rotate(r[l].rotation),this.partialText=r[l].text,t.fillStrokeShape(this),o&&(l===0&&t.moveTo(0,s/2+1),t.lineTo(r[l].width,s/2+1)),t.restore()}if(o&&(t.strokeStyle=n,t.lineWidth=s/20,t.stroke()),a){t.beginPath();for(let l=0;l<r.length;l++){t.save();const h=r[l].p0;t.translate(h.x,h.y),t.rotate(r[l].rotation),l===0&&t.moveTo(0,0),t.lineTo(r[l].width,0),t.restore()}t.strokeStyle=n,t.lineWidth=s/20,t.stroke()}t.restore()}_hitFunc(t){t.beginPath();const i=this.glyphInfo;if(i.length>=1){const n=i[0].p0;t.moveTo(n.x,n.y)}for(let n=0;n<i.length;n++){const s=i[n].p1;t.lineTo(s.x,s.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return w.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return xt.prototype.setText.call(this,t)}_getContextFont(){return xt.prototype._getContextFont.call(this)}_getTextSize(t){const n=this.dummyCanvas.getContext("2d");n.save(),n.font=this._getContextFont();const s=n.measureText(t);return n.restore(),{width:s.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const t=ci(this.text()),i=[];let n=0;for(let d=0;d<t.length;d++)i.push({char:t[d],width:this._getTextSize(t[d]).width}),n+=i[d].width;const{height:s}=this._getTextSize(this.attrs.text);if(this.textWidth=n,this.textHeight=s,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),o=this.align(),a=this.kerningFunc(),l=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let h=0;o==="center"&&(h=Math.max(0,this.pathLength/2-l/2)),o==="right"&&(h=Math.max(0,this.pathLength-l));let c=h;for(let d=0;d<i.length;d++){const u=this._getPointAtLength(c);if(!u)return;const f=i[d].char;let p=i[d].width+r;if(f===" "&&o==="justify"){const N=this.text().split(" ").length-1;p+=(this.pathLength-l)/N}const _=this._getPointAtLength(c+p);if(!_)return;const v=Et.getLineLength(u.x,u.y,_.x,_.y);let S=0;if(a)try{S=a(i[d-1].char,f)*this.fontSize()}catch{S=0}u.x+=S,_.x+=S,this.textWidth+=S;const b=Et.getPointOnLine(S+v/2,u.x,u.y,_.x,_.y),x=Math.atan2(_.y-u.y,_.x-u.x);this.glyphInfo.push({transposeX:b.x,transposeY:b.y,text:t[d],rotation:x,p0:u,p1:_,width:v}),c+=p}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const t=[];this.glyphInfo.forEach(function(h){t.push(h.p0.x),t.push(h.p0.y),t.push(h.p1.x),t.push(h.p1.y)});let i=t[0]||0,n=t[0]||0,s=t[1]||0,r=t[1]||0,o,a;for(let h=0;h<t.length/2;h++)o=t[h*2],a=t[h*2+1],i=Math.min(i,o),n=Math.max(n,o),s=Math.min(s,a),r=Math.max(r,a);const l=this.fontSize();return{x:i-l/2,y:s-l/2,width:n-i+l,height:r-s+l}}destroy(){return w.releaseCanvas(this.dummyCanvas),super.destroy()}}Vt.prototype._fillFunc=fh,Vt.prototype._strokeFunc=ph,Vt.prototype._fillFuncHit=fh,Vt.prototype._strokeFuncHit=ph,Vt.prototype.className="TextPath",Vt.prototype._attrsAffectingSize=["text","fontSize","data"],kt(Vt),m.addGetterSetter(Vt,"data"),m.addGetterSetter(Vt,"fontFamily","Arial"),m.addGetterSetter(Vt,"fontSize",12,B()),m.addGetterSetter(Vt,"fontStyle",uh),m.addGetterSetter(Vt,"align","left"),m.addGetterSetter(Vt,"letterSpacing",0,B()),m.addGetterSetter(Vt,"textBaseline","middle"),m.addGetterSetter(Vt,"fontVariant",uh),m.addGetterSetter(Vt,"text",v1),m.addGetterSetter(Vt,"textDecoration",""),m.addGetterSetter(Vt,"kerningFunc",void 0);const gh="tr-konva",w1=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${gh}`).join(" "),mh="nodesRect",S1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],E1={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},x1="ontouchstart"in X._global;function C1(e,t,i){if(e==="rotater")return i;t+=w.degToRad(E1[e]||0);const n=(w.radToDeg(t)%360+360)%360;return w._inRange(n,315+22.5,360)||w._inRange(n,0,22.5)?"ns-resize":w._inRange(n,45-22.5,45+22.5)?"nesw-resize":w._inRange(n,90-22.5,90+22.5)?"ew-resize":w._inRange(n,135-22.5,135+22.5)?"nwse-resize":w._inRange(n,180-22.5,180+22.5)?"ns-resize":w._inRange(n,225-22.5,225+22.5)?"nesw-resize":w._inRange(n,270-22.5,270+22.5)?"ew-resize":w._inRange(n,315-22.5,315+22.5)?"nwse-resize":(w.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}const er=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function N1(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function _h(e,t,i){const n=i.x+(e.x-i.x)*Math.cos(t)-(e.y-i.y)*Math.sin(t),s=i.y+(e.x-i.x)*Math.sin(t)+(e.y-i.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:s}}function T1(e,t){const i=N1(e);return _h(e,t,i)}function k1(e,t,i){let n=t;for(let s=0;s<e.length;s++){const r=X.getAngle(e[s]),o=Math.abs(r-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<i&&(n=r)}return n}let Lo=0;class ct extends Ji{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(w1,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return w.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return gh+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const i=t.filter(s=>s.isAncestorOf(this)?(w.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=t=i,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(s=>{const r=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(s._attrsAffectingSize.length){const o=s._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");s.on(o,r)}s.on(S1.map(o=>o+`.${this._getEventNamespace()}`).join(" "),r),s.on(`absoluteTransformChange.${this._getEventNamespace()}`,r),this._proxyDrag(s)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let i;t.on(`dragstart.${this._getEventNamespace()}`,n=>{i=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!i)return;const s=t.getAbsolutePosition(),r=s.x-i.x,o=s.y-i.y;this.nodes().forEach(a=>{if(a===t||a.isDragging())return;const l=a.getAbsolutePosition();a.setAbsolutePosition({x:l.x+r,y:l.y+o}),a.startDrag(n)}),i=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(mh),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(mh,this.__getNodeRect)}__getNodeShape(t,i=this.rotation(),n){const s=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),a=s.x*r.x-t.offsetX()*r.x,l=s.y*r.y-t.offsetY()*r.y,h=(X.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:o.x+a*Math.cos(h)+l*Math.sin(-h),y:o.y+l*Math.cos(h)+a*Math.sin(h),width:s.width*r.x,height:s.height*r.y,rotation:h};return _h(c,-X.getAngle(i),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const i=[];this.nodes().map(h=>{const c=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],u=h.getAbsoluteTransform();d.forEach(function(f){const p=u.point(f);i.push(p)})});const n=new ne;n.rotate(-X.getAngle(this.rotation()));let s=1/0,r=1/0,o=-1/0,a=-1/0;i.forEach(function(h){const c=n.point(h);s===void 0&&(s=o=c.x,r=a=c.y),s=Math.min(s,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y)}),n.invert();const l=n.point({x:s,y:r});return{x:l.x,y:l.y,width:o-s,height:a-r,rotation:X.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),er.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){const i=new Xn({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:x1?10:"auto"}),n=this;i.on("mousedown touchstart",function(s){n._handleMouseDown(s)}),i.on("dragstart",s=>{i.stopDrag(),s.cancelBubble=!0}),i.on("dragend",s=>{s.cancelBubble=!0}),i.on("mouseenter",()=>{const s=X.getAngle(this.rotation()),r=this.rotateAnchorCursor(),o=C1(t,s,r);i.getStage().content&&(i.getStage().content.style.cursor=o),this._cursorChange=!0}),i.on("mouseout",()=>{i.getStage().content&&(i.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(i)}_createBack(){const t=new V({name:"back",width:0,height:0,sceneFunc(i,n){const s=n.getParent(),r=s.padding();i.beginPath(),i.rect(-r,-r,n.width()+r*2,n.height()+r*2),i.moveTo(n.width()/2,-r),s.rotateEnabled()&&s.rotateLineVisible()&&i.lineTo(n.width()/2,-s.rotateAnchorOffset()*w._sign(n.height())-r),i.fillStrokeShape(n)},hitFunc:(i,n)=>{if(!this.shouldOverdrawWholeArea())return;const s=this.padding();i.beginPath(),i.rect(-s,-s,n.width()+s*2,n.height()+s*2),i.fillStrokeShape(n)}});this.add(t),this._proxyDrag(t),t.on("dragstart",i=>{i.cancelBubble=!0}),t.on("dragmove",i=>{i.cancelBubble=!0}),t.on("dragend",i=>{i.cancelBubble=!0}),this.on("dragmove",i=>{this.update()})}_handleMouseDown(t){if(this._transforming)return;this._movingAnchorName=t.target.name().split(" ")[0];const i=this._getNodeRect(),n=i.width,s=i.height,r=Math.sqrt(Math.pow(n,2)+Math.pow(s,2));this.sin=Math.abs(s/r),this.cos=Math.abs(n/r),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const o=t.target.getAbsolutePosition(),a=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-o.x,y:a.y-o.y},Lo++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){let i,n,s;const r=this.findOne("."+this._movingAnchorName),o=r.getStage();o.setPointersPositions(t);const a=o.getPointerPosition();let l={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const h=r.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(h,l,t)),r.setAbsolutePosition(l);const c=r.getAbsolutePosition();if(h.x===c.x&&h.y===c.y)return;if(this._movingAnchorName==="rotater"){const b=this._getNodeRect();i=r.x()-b.width/2,n=-r.y()+b.height/2;let x=Math.atan2(-n,i)+Math.PI/2;b.height<0&&(x-=Math.PI);const T=X.getAngle(this.rotation())+x,P=X.getAngle(this.rotationSnapTolerance()),C=k1(this.rotationSnaps(),T,P)-b.rotation,O=T1(b,C);this._fitNodesInto(O,t);return}const d=this.shiftBehavior();let u;d==="inverted"?u=this.keepRatio()&&!t.shiftKey:d==="none"?u=this.keepRatio():u=this.keepRatio()||t.shiftKey;let f=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(u){const b=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};s=Math.sqrt(Math.pow(b.x-r.x(),2)+Math.pow(b.y-r.y(),2));const x=this.findOne(".top-left").x()>b.x?-1:1,N=this.findOne(".top-left").y()>b.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,this.findOne(".top-left").x(b.x-i),this.findOne(".top-left").y(b.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(r.y());else if(this._movingAnchorName==="top-right"){if(u){const b=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};s=Math.sqrt(Math.pow(r.x()-b.x,2)+Math.pow(b.y-r.y(),2));const x=this.findOne(".top-right").x()<b.x?-1:1,N=this.findOne(".top-right").y()>b.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,this.findOne(".top-right").x(b.x+i),this.findOne(".top-right").y(b.y-n)}var p=r.position();this.findOne(".top-left").y(p.y),this.findOne(".bottom-right").x(p.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(r.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(r.x());else if(this._movingAnchorName==="bottom-left"){if(u){const b=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};s=Math.sqrt(Math.pow(b.x-r.x(),2)+Math.pow(r.y()-b.y,2));const x=b.x<r.x()?-1:1,N=r.y()<b.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,r.x(b.x-i),r.y(b.y+n)}p=r.position(),this.findOne(".top-left").x(p.x),this.findOne(".bottom-right").y(p.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(r.y());else if(this._movingAnchorName==="bottom-right"){if(u){const b=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};s=Math.sqrt(Math.pow(r.x()-b.x,2)+Math.pow(r.y()-b.y,2));const x=this.findOne(".bottom-right").x()<b.x?-1:1,N=this.findOne(".bottom-right").y()<b.y?-1:1;i=s*this.cos*x,n=s*this.sin*N,this.findOne(".bottom-right").x(b.x+i),this.findOne(".bottom-right").y(b.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(f=this.centeredScaling()||t.altKey,f){const b=this.findOne(".top-left"),x=this.findOne(".bottom-right"),N=b.x(),T=b.y(),P=this.getWidth()-x.x(),E=this.getHeight()-x.y();x.move({x:-N,y:-T}),b.move({x:P,y:E})}const _=this.findOne(".top-left").getAbsolutePosition();i=_.x,n=_.y;const v=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),S=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:i,y:n,width:v,height:S,rotation:X.getAngle(this.rotation())},t)}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var i;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const n=this.getNode();Lo--,this._fire("transformend",{evt:t,target:n}),(i=this.getLayer())===null||i===void 0||i.batchDraw(),n&&this._nodes.forEach(s=>{var r;s._fire("transformend",{evt:t,target:s}),(r=s.getLayer())===null||r===void 0||r.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,i){const n=this._getNodeRect(),s=1;if(w._inRange(t.width,-this.padding()*2-s,s)){this.update();return}if(w._inRange(t.height,-this.padding()*2-s,s)){this.update();return}const r=new ne;if(r.rotate(X.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const u=r.point({x:-this.padding()*2,y:0});t.x+=u.x,t.y+=u.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const u=r.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const u=r.point({x:0,y:-this.padding()*2});t.x+=u.x,t.y+=u.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const u=r.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const u=this.boundBoxFunc()(n,t);u?t=u:w.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,a=new ne;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/o,n.height/o);const l=new ne,h=t.width/o,c=t.height/o;this.flipEnabled()===!1?(l.translate(t.x,t.y),l.rotate(t.rotation),l.translate(t.width<0?t.width:0,t.height<0?t.height:0),l.scale(Math.abs(h),Math.abs(c))):(l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(h,c));const d=l.multiply(a.invert());this._nodes.forEach(u=>{var f;if(!u.getStage())return;const p=u.getParent().getAbsoluteTransform(),_=u.getTransform().copy();_.translate(u.offsetX(),u.offsetY());const v=new ne;v.multiply(p.copy().invert()).multiply(d).multiply(p).multiply(_);const S=v.decompose();u.setAttrs(S),(f=u.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(w._getRotation(t.rotation)),this._nodes.forEach(u=>{this._fire("transform",{evt:i,target:u}),u._fire("transform",{evt:i,target:u})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,i){this.findOne(t).setAttrs(i)}update(){var t;const i=this._getNodeRect();this.rotation(w._getRotation(i.rotation));const n=i.width,s=i.height,r=this.enabledAnchors(),o=this.resizeEnabled(),a=this.padding(),l=this.anchorSize(),h=this.find("._anchor");h.forEach(d=>{d.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+a,offsetY:l/2+a,visible:o&&r.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:l/2+a,visible:o&&r.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:l/2-a,offsetY:l/2+a,visible:o&&r.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:s/2,offsetX:l/2+a,visible:o&&r.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:s/2,offsetX:l/2-a,visible:o&&r.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:s,offsetX:l/2+a,offsetY:l/2-a,visible:o&&r.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:s,offsetY:l/2-a,visible:o&&r.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:s,offsetX:l/2-a,offsetY:l/2-a,visible:o&&r.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*w._sign(s)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:s,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(d=>d.draggable()),x:0,y:0});const c=this.anchorStyleFunc();c&&h.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Ji.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return G.prototype.toObject.call(this)}clone(t){return G.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}ct.isTransforming=()=>Lo>0;function P1(e){return e instanceof Array||w.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){er.indexOf(t)===-1&&w.warn("Unknown anchor name: "+t+". Available names are: "+er.join(", "))}),e||[]}ct.prototype.className="Transformer",kt(ct),m.addGetterSetter(ct,"enabledAnchors",er,P1),m.addGetterSetter(ct,"flipEnabled",!0,ye()),m.addGetterSetter(ct,"resizeEnabled",!0),m.addGetterSetter(ct,"anchorSize",10,B()),m.addGetterSetter(ct,"rotateEnabled",!0),m.addGetterSetter(ct,"rotateLineVisible",!0),m.addGetterSetter(ct,"rotationSnaps",[]),m.addGetterSetter(ct,"rotateAnchorOffset",50,B()),m.addGetterSetter(ct,"rotateAnchorCursor","crosshair"),m.addGetterSetter(ct,"rotationSnapTolerance",5,B()),m.addGetterSetter(ct,"borderEnabled",!0),m.addGetterSetter(ct,"anchorStroke","rgb(0, 161, 255)"),m.addGetterSetter(ct,"anchorStrokeWidth",1,B()),m.addGetterSetter(ct,"anchorFill","white"),m.addGetterSetter(ct,"anchorCornerRadius",0,B()),m.addGetterSetter(ct,"borderStroke","rgb(0, 161, 255)"),m.addGetterSetter(ct,"borderStrokeWidth",1,B()),m.addGetterSetter(ct,"borderDash"),m.addGetterSetter(ct,"keepRatio",!0),m.addGetterSetter(ct,"shiftBehavior","default"),m.addGetterSetter(ct,"centeredScaling",!1),m.addGetterSetter(ct,"ignoreStroke",!1),m.addGetterSetter(ct,"padding",0,B()),m.addGetterSetter(ct,"nodes"),m.addGetterSetter(ct,"node"),m.addGetterSetter(ct,"boundBoxFunc"),m.addGetterSetter(ct,"anchorDragBoundFunc"),m.addGetterSetter(ct,"anchorStyleFunc"),m.addGetterSetter(ct,"shouldOverdrawWholeArea",!1),m.addGetterSetter(ct,"useSingleNodeRotation",!0),m.backCompat(ct,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Xe extends V{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,X.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Xe.prototype.className="Wedge",Xe.prototype._centroid=!0,Xe.prototype._attrsAffectingSize=["radius"],kt(Xe),m.addGetterSetter(Xe,"radius",0,B()),m.addGetterSetter(Xe,"angle",0,B()),m.addGetterSetter(Xe,"clockwise",!1),m.backCompat(Xe,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function yh(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const O1=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],A1=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function M1(e,t){const i=e.data,n=e.width,s=e.height;let r,o,a,l,h,c,d,u,f,p,_,v,S,b,x,N,T,P,E,C;const O=t+t+1,H=n-1,K=s-1,z=t+1,Z=z*(z+1)/2,J=new yh,A=O1[t],L=A1[t];let $=null,D=J,nt=null,ht=null;for(let ot=1;ot<O;ot++)D=D.next=new yh,ot===z&&($=D);D.next=J,a=o=0;for(let ot=0;ot<s;ot++){v=S=b=x=l=h=c=d=0,u=z*(N=i[o]),f=z*(T=i[o+1]),p=z*(P=i[o+2]),_=z*(E=i[o+3]),l+=Z*N,h+=Z*T,c+=Z*P,d+=Z*E,D=J;for(let mt=0;mt<z;mt++)D.r=N,D.g=T,D.b=P,D.a=E,D=D.next;for(let mt=1;mt<z;mt++)r=o+((H<mt?H:mt)<<2),l+=(D.r=N=i[r])*(C=z-mt),h+=(D.g=T=i[r+1])*C,c+=(D.b=P=i[r+2])*C,d+=(D.a=E=i[r+3])*C,v+=N,S+=T,b+=P,x+=E,D=D.next;nt=J,ht=$;for(let mt=0;mt<n;mt++)i[o+3]=E=d*A>>L,E!==0?(E=255/E,i[o]=(l*A>>L)*E,i[o+1]=(h*A>>L)*E,i[o+2]=(c*A>>L)*E):i[o]=i[o+1]=i[o+2]=0,l-=u,h-=f,c-=p,d-=_,u-=nt.r,f-=nt.g,p-=nt.b,_-=nt.a,r=a+((r=mt+t+1)<H?r:H)<<2,v+=nt.r=i[r],S+=nt.g=i[r+1],b+=nt.b=i[r+2],x+=nt.a=i[r+3],l+=v,h+=S,c+=b,d+=x,nt=nt.next,u+=N=ht.r,f+=T=ht.g,p+=P=ht.b,_+=E=ht.a,v-=N,S-=T,b-=P,x-=E,ht=ht.next,o+=4;a+=n}for(let ot=0;ot<n;ot++){S=b=x=v=h=c=d=l=0,o=ot<<2,u=z*(N=i[o]),f=z*(T=i[o+1]),p=z*(P=i[o+2]),_=z*(E=i[o+3]),l+=Z*N,h+=Z*T,c+=Z*P,d+=Z*E,D=J;for(let Pt=0;Pt<z;Pt++)D.r=N,D.g=T,D.b=P,D.a=E,D=D.next;let mt=n;for(let Pt=1;Pt<=t;Pt++)o=mt+ot<<2,l+=(D.r=N=i[o])*(C=z-Pt),h+=(D.g=T=i[o+1])*C,c+=(D.b=P=i[o+2])*C,d+=(D.a=E=i[o+3])*C,v+=N,S+=T,b+=P,x+=E,D=D.next,Pt<K&&(mt+=n);o=ot,nt=J,ht=$;for(let Pt=0;Pt<s;Pt++)r=o<<2,i[r+3]=E=d*A>>L,E>0?(E=255/E,i[r]=(l*A>>L)*E,i[r+1]=(h*A>>L)*E,i[r+2]=(c*A>>L)*E):i[r]=i[r+1]=i[r+2]=0,l-=u,h-=f,c-=p,d-=_,u-=nt.r,f-=nt.g,p-=nt.b,_-=nt.a,r=ot+((r=Pt+z)<K?r:K)*n<<2,l+=v+=nt.r=i[r],h+=S+=nt.g=i[r+1],c+=b+=nt.b=i[r+2],d+=x+=nt.a=i[r+3],nt=nt.next,u+=N=ht.r,f+=T=ht.g,p+=P=ht.b,_+=E=ht.a,v-=N,S-=T,b-=P,x-=E,ht=ht.next,o+=n}}const R1=function(t){const i=Math.round(this.blurRadius());i>0&&M1(t,i)};m.addGetterSetter(G,"blurRadius",0,B(),m.afterSetFilter);const L1=function(e){const t=this.brightness()*255,i=e.data,n=i.length;for(let s=0;s<n;s+=4)i[s]+=t,i[s+1]+=t,i[s+2]+=t};m.addGetterSetter(G,"brightness",0,B(),m.afterSetFilter);const I1=function(e){const t=this.brightness(),i=e.data,n=i.length;for(let s=0;s<n;s+=4)i[s]=Math.min(255,i[s]*t),i[s+1]=Math.min(255,i[s+1]*t),i[s+2]=Math.min(255,i[s+2]*t)},D1=function(e){const t=Math.pow((this.contrast()+100)/100,2),i=e.data,n=i.length;let s=150,r=150,o=150;for(let a=0;a<n;a+=4)s=i[a],r=i[a+1],o=i[a+2],s/=255,s-=.5,s*=t,s+=.5,s*=255,r/=255,r-=.5,r*=t,r+=.5,r*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,s=s<0?0:s>255?255:s,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,i[a]=s,i[a+1]=r,i[a+2]=o};m.addGetterSetter(G,"contrast",0,B(),m.afterSetFilter);const V1=function(e){var t,i,n,s,r,o,a,l,h;const c=e.data,d=e.width,u=e.height,f=Math.min(1,Math.max(0,(i=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&i!==void 0?i:.5)),p=Math.min(1,Math.max(0,(s=(n=this.embossWhiteLevel)===null||n===void 0?void 0:n.call(this))!==null&&s!==void 0?s:.5)),v=(a={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(o=(r=this.embossDirection)===null||r===void 0?void 0:r.call(this))!==null&&o!==void 0?o:"top-left"])!==null&&a!==void 0?a:315,S=!!((h=(l=this.embossBlend)===null||l===void 0?void 0:l.call(this))!==null&&h!==void 0&&h),b=f*10,x=p*255,N=v*Math.PI/180,T=Math.cos(N),P=Math.sin(N),E=128/1020*b,C=new Uint8ClampedArray(c),O=new Float32Array(d*u);for(let J=0,A=0;A<c.length;A+=4,J++)O[J]=.2126*C[A]+.7152*C[A+1]+.0722*C[A+2];const H=[-1,0,1,-2,0,2,-1,0,1],K=[-1,-2,-1,0,0,0,1,2,1],z=[-d-1,-d,-d+1,-1,0,1,d-1,d,d+1],Z=J=>J<0?0:J>255?255:J;for(let J=1;J<u-1;J++)for(let A=1;A<d-1;A++){const L=J*d+A;let $=0,D=0;$+=O[L+z[0]]*H[0],D+=O[L+z[0]]*K[0],$+=O[L+z[1]]*H[1],D+=O[L+z[1]]*K[1],$+=O[L+z[2]]*H[2],D+=O[L+z[2]]*K[2],$+=O[L+z[3]]*H[3],D+=O[L+z[3]]*K[3],$+=O[L+z[5]]*H[5],D+=O[L+z[5]]*K[5],$+=O[L+z[6]]*H[6],D+=O[L+z[6]]*K[6],$+=O[L+z[7]]*H[7],D+=O[L+z[7]]*K[7],$+=O[L+z[8]]*H[8],D+=O[L+z[8]]*K[8];const nt=T*$+P*D,ht=Z(x+nt*E),ot=L*4;if(S){const mt=ht-x;c[ot]=Z(C[ot]+mt),c[ot+1]=Z(C[ot+1]+mt),c[ot+2]=Z(C[ot+2]+mt),c[ot+3]=C[ot+3]}else c[ot]=c[ot+1]=c[ot+2]=ht,c[ot+3]=C[ot+3]}for(let J=0;J<d;J++){let A=J*4,L=((u-1)*d+J)*4;c[A]=C[A],c[A+1]=C[A+1],c[A+2]=C[A+2],c[A+3]=C[A+3],c[L]=C[L],c[L+1]=C[L+1],c[L+2]=C[L+2],c[L+3]=C[L+3]}for(let J=1;J<u-1;J++){let A=J*d*4,L=(J*d+(d-1))*4;c[A]=C[A],c[A+1]=C[A+1],c[A+2]=C[A+2],c[A+3]=C[A+3],c[L]=C[L],c[L+1]=C[L+1],c[L+2]=C[L+2],c[L+3]=C[L+3]}return e};m.addGetterSetter(G,"embossStrength",.5,B(),m.afterSetFilter),m.addGetterSetter(G,"embossWhiteLevel",.5,B(),m.afterSetFilter),m.addGetterSetter(G,"embossDirection","top-left",void 0,m.afterSetFilter),m.addGetterSetter(G,"embossBlend",!1,void 0,m.afterSetFilter);function Io(e,t,i,n,s){const r=i-t,o=s-n;if(r===0)return n+o/2;if(o===0)return n;let a=(e-t)/r;return a=o*a+n,a}const F1=function(e){const t=e.data,i=t.length;let n=t[0],s=n,r,o=t[1],a=o,l,h=t[2],c=h,d;const u=this.enhance();if(u===0)return;for(let x=0;x<i;x+=4)r=t[x+0],r<n?n=r:r>s&&(s=r),l=t[x+1],l<o?o=l:l>a&&(a=l),d=t[x+2],d<h?h=d:d>c&&(c=d);s===n&&(s=255,n=0),a===o&&(a=255,o=0),c===h&&(c=255,h=0);let f,p,_,v,S,b;if(u>0)f=s+u*(255-s),p=n-u*(n-0),_=a+u*(255-a),v=o-u*(o-0),S=c+u*(255-c),b=h-u*(h-0);else{const x=(s+n)*.5;f=s+u*(s-x),p=n+u*(n-x);const N=(a+o)*.5;_=a+u*(a-N),v=o+u*(o-N);const T=(c+h)*.5;S=c+u*(c-T),b=h+u*(h-T)}for(let x=0;x<i;x+=4)t[x+0]=Io(t[x+0],n,s,p,f),t[x+1]=Io(t[x+1],o,a,v,_),t[x+2]=Io(t[x+2],h,c,b,S)};m.addGetterSetter(G,"enhance",0,B(),m.afterSetFilter);const G1=function(e){const t=e.data,i=t.length;for(let n=0;n<i;n+=4){const s=.34*t[n]+.5*t[n+1]+.16*t[n+2];t[n]=s,t[n+1]=s,t[n+2]=s}};m.addGetterSetter(G,"hue",0,B(),m.afterSetFilter),m.addGetterSetter(G,"saturation",0,B(),m.afterSetFilter),m.addGetterSetter(G,"luminance",0,B(),m.afterSetFilter);const $1=function(e){const t=e.data,i=t.length,n=1,s=Math.pow(2,this.saturation()),r=Math.abs(this.hue()+360)%360,o=this.luminance()*127,a=n*s*Math.cos(r*Math.PI/180),l=n*s*Math.sin(r*Math.PI/180),h=.299*n+.701*a+.167*l,c=.587*n-.587*a+.33*l,d=.114*n-.114*a-.497*l,u=.299*n-.299*a-.328*l,f=.587*n+.413*a+.035*l,p=.114*n-.114*a+.293*l,_=.299*n-.3*a+1.25*l,v=.587*n-.586*a-1.05*l,S=.114*n+.886*a-.2*l;let b,x,N,T;for(let P=0;P<i;P+=4)b=t[P+0],x=t[P+1],N=t[P+2],T=t[P+3],t[P+0]=h*b+c*x+d*N+o,t[P+1]=u*b+f*x+p*N+o,t[P+2]=_*b+v*x+S*N+o,t[P+3]=T},B1=function(e){const t=e.data,i=t.length,n=Math.pow(2,this.value()),s=Math.pow(2,this.saturation()),r=Math.abs(this.hue()+360)%360,o=n*s*Math.cos(r*Math.PI/180),a=n*s*Math.sin(r*Math.PI/180),l=.299*n+.701*o+.167*a,h=.587*n-.587*o+.33*a,c=.114*n-.114*o-.497*a,d=.299*n-.299*o-.328*a,u=.587*n+.413*o+.035*a,f=.114*n-.114*o+.293*a,p=.299*n-.3*o+1.25*a,_=.587*n-.586*o-1.05*a,v=.114*n+.886*o-.2*a;for(let S=0;S<i;S+=4){const b=t[S+0],x=t[S+1],N=t[S+2],T=t[S+3];t[S+0]=l*b+h*x+c*N,t[S+1]=d*b+u*x+f*N,t[S+2]=p*b+_*x+v*N,t[S+3]=T}};m.addGetterSetter(G,"hue",0,B(),m.afterSetFilter),m.addGetterSetter(G,"saturation",0,B(),m.afterSetFilter),m.addGetterSetter(G,"value",0,B(),m.afterSetFilter);const H1=function(e){const t=e.data,i=t.length;for(let n=0;n<i;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]},W1=function(e,t,i){const n=e.data,s=t.data,r=e.width,o=e.height,a=i.polarCenterX||r/2,l=i.polarCenterY||o/2;let h=Math.sqrt(a*a+l*l),c=r-a,d=o-l;const u=Math.sqrt(c*c+d*d);h=u>h?u:h;const f=o,p=r,_=360/p*Math.PI/180;for(let v=0;v<p;v+=1){const S=Math.sin(v*_),b=Math.cos(v*_);for(let x=0;x<f;x+=1){c=Math.floor(a+h*x/f*b),d=Math.floor(l+h*x/f*S);let N=(d*r+c)*4;const T=n[N+0],P=n[N+1],E=n[N+2],C=n[N+3];N=(v+x*r)*4,s[N+0]=T,s[N+1]=P,s[N+2]=E,s[N+3]=C}}},U1=function(e,t,i){const n=e.data,s=t.data,r=e.width,o=e.height,a=i.polarCenterX||r/2,l=i.polarCenterY||o/2;let h=Math.sqrt(a*a+l*l),c=r-a,d=o-l;const u=Math.sqrt(c*c+d*d);h=u>h?u:h;const f=o,p=r,_=0;let v,S;for(c=0;c<r;c+=1)for(d=0;d<o;d+=1){const b=c-a,x=d-l,N=Math.sqrt(b*b+x*x)*f/h;let T=(Math.atan2(x,b)*180/Math.PI+360+_)%360;T=T*p/360,v=Math.floor(T),S=Math.floor(N);let P=(S*r+v)*4;const E=n[P+0],C=n[P+1],O=n[P+2],H=n[P+3];P=(d*r+c)*4,s[P+0]=E,s[P+1]=C,s[P+2]=O,s[P+3]=H}},j1=function(e){const t=e.width,i=e.height;let n,s,r,o,a,l,h,c,d,u,f=Math.round(this.kaleidoscopePower());const p=Math.round(this.kaleidoscopeAngle()),_=Math.floor(t*(p%360)/360);if(f<1)return;const v=w.createCanvasElement();v.width=t,v.height=i;const S=v.getContext("2d").getImageData(0,0,t,i);w.releaseCanvas(v),W1(e,S,{polarCenterX:t/2,polarCenterY:i/2});let b=t/Math.pow(2,f);for(;b<=8;)b=b*2,f-=1;b=Math.ceil(b);let x=b,N=0,T=x,P=1;for(_+b>t&&(N=x,T=0,P=-1),s=0;s<i;s+=1)for(n=N;n!==T;n+=P)r=Math.round(n+_)%t,d=(t*s+r)*4,a=S.data[d+0],l=S.data[d+1],h=S.data[d+2],c=S.data[d+3],u=(t*s+n)*4,S.data[u+0]=a,S.data[u+1]=l,S.data[u+2]=h,S.data[u+3]=c;for(s=0;s<i;s+=1)for(x=Math.floor(b),o=0;o<f;o+=1){for(n=0;n<x+1;n+=1)d=(t*s+n)*4,a=S.data[d+0],l=S.data[d+1],h=S.data[d+2],c=S.data[d+3],u=(t*s+x*2-n-1)*4,S.data[u+0]=a,S.data[u+1]=l,S.data[u+2]=h,S.data[u+3]=c;x*=2}U1(S,e,{})};m.addGetterSetter(G,"kaleidoscopePower",2,B(),m.afterSetFilter),m.addGetterSetter(G,"kaleidoscopeAngle",0,B(),m.afterSetFilter);function ir(e,t,i){let n=(i*e.width+t)*4;const s=[];return s.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),s}function Yn(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function X1(e){const t=[0,0,0];for(let i=0;i<e.length;i++)t[0]+=e[i][0],t[1]+=e[i][1],t[2]+=e[i][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function z1(e,t){const i=ir(e,0,0),n=ir(e,e.width-1,0),s=ir(e,0,e.height-1),r=ir(e,e.width-1,e.height-1),o=t||10;if(Yn(i,n)<o&&Yn(n,r)<o&&Yn(r,s)<o&&Yn(s,i)<o){const a=X1([n,i,r,s]),l=[];for(let h=0;h<e.width*e.height;h++){const c=Yn(a,[e.data[h*4],e.data[h*4+1],e.data[h*4+2]]);l[h]=c<o?0:255}return l}}function Y1(e,t){for(let i=0;i<e.width*e.height;i++)e.data[4*i+3]=t[i]}function q1(e,t,i){const n=[1,1,1,1,0,1,1,1,1],s=Math.round(Math.sqrt(n.length)),r=Math.floor(s/2),o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++){const h=a*t+l;let c=0;for(let d=0;d<s;d++)for(let u=0;u<s;u++){const f=a+d-r,p=l+u-r;if(f>=0&&f<i&&p>=0&&p<t){const _=f*t+p,v=n[d*s+u];c+=e[_]*v}}o[h]=c===2040?255:0}return o}function K1(e,t,i){const n=[1,1,1,1,1,1,1,1,1],s=Math.round(Math.sqrt(n.length)),r=Math.floor(s/2),o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++){const h=a*t+l;let c=0;for(let d=0;d<s;d++)for(let u=0;u<s;u++){const f=a+d-r,p=l+u-r;if(f>=0&&f<i&&p>=0&&p<t){const _=f*t+p,v=n[d*s+u];c+=e[_]*v}}o[h]=c>=1020?255:0}return o}function J1(e,t,i){const n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],s=Math.round(Math.sqrt(n.length)),r=Math.floor(s/2),o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++){const h=a*t+l;let c=0;for(let d=0;d<s;d++)for(let u=0;u<s;u++){const f=a+d-r,p=l+u-r;if(f>=0&&f<i&&p>=0&&p<t){const _=f*t+p,v=n[d*s+u];c+=e[_]*v}}o[h]=c}return o}const Q1=function(e){const t=this.threshold();let i=z1(e,t);return i&&(i=q1(i,e.width,e.height),i=K1(i,e.width,e.height),i=J1(i,e.width,e.height),Y1(e,i)),e};m.addGetterSetter(G,"threshold",0,B(),m.afterSetFilter);const Z1=function(e){const t=this.noise()*255,i=e.data,n=i.length,s=t/2;for(let r=0;r<n;r+=4)i[r+0]+=s-2*s*Math.random(),i[r+1]+=s-2*s*Math.random(),i[r+2]+=s-2*s*Math.random()};m.addGetterSetter(G,"noise",.2,B(),m.afterSetFilter);const t2=function(e){let t=Math.ceil(this.pixelSize()),i=e.width,n=e.height,s=Math.ceil(i/t),r=Math.ceil(n/t),o=e.data;if(t<=0){w.error("pixelSize value can not be <= 0");return}for(let a=0;a<s;a+=1)for(let l=0;l<r;l+=1){let h=0,c=0,d=0,u=0;const f=a*t,p=f+t,_=l*t,v=_+t;let S=0;for(let b=f;b<p;b+=1)if(!(b>=i))for(let x=_;x<v;x+=1){if(x>=n)continue;const N=(i*x+b)*4;h+=o[N+0],c+=o[N+1],d+=o[N+2],u+=o[N+3],S+=1}h=h/S,c=c/S,d=d/S,u=u/S;for(let b=f;b<p;b+=1)if(!(b>=i))for(let x=_;x<v;x+=1){if(x>=n)continue;const N=(i*x+b)*4;o[N+0]=h,o[N+1]=c,o[N+2]=d,o[N+3]=u}}};m.addGetterSetter(G,"pixelSize",8,B(),m.afterSetFilter);const e2=function(e){const t=Math.round(this.levels()*254)+1,i=e.data,n=i.length,s=255/t;for(let r=0;r<n;r+=1)i[r]=Math.floor(i[r]/s)*s};m.addGetterSetter(G,"levels",.5,B(),m.afterSetFilter);const i2=function(e){const t=e.data,i=t.length,n=this.red(),s=this.green(),r=this.blue();for(let o=0;o<i;o+=4){const a=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255;t[o]=a*n,t[o+1]=a*s,t[o+2]=a*r,t[o+3]=t[o+3]}};m.addGetterSetter(G,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"blue",0,wc,m.afterSetFilter);const n2=function(e){const t=e.data,i=t.length,n=this.red(),s=this.green(),r=this.blue(),o=this.alpha();for(let a=0;a<i;a+=4){const l=1-o;t[a]=n*o+t[a]*l,t[a+1]=s*o+t[a+1]*l,t[a+2]=r*o+t[a+2]*l}};m.addGetterSetter(G,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),m.addGetterSetter(G,"blue",0,wc,m.afterSetFilter),m.addGetterSetter(G,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const s2=function(e){const t=e.data,i=t.length;for(let n=0;n<i;n+=4){const s=t[n+0],r=t[n+1],o=t[n+2];t[n+0]=Math.min(255,s*.393+r*.769+o*.189),t[n+1]=Math.min(255,s*.349+r*.686+o*.168),t[n+2]=Math.min(255,s*.272+r*.534+o*.131)}},r2=function(e){const i=e.data;for(let n=0;n<i.length;n+=4){const s=i[n],r=i[n+1],o=i[n+2];.2126*s+.7152*r+.0722*o>=128&&(i[n]=255-s,i[n+1]=255-r,i[n+2]=255-o)}return e},o2=function(e){const t=this.threshold()*255,i=e.data,n=i.length;for(let s=0;s<n;s+=1)i[s]=i[s]<t?0:255};m.addGetterSetter(G,"threshold",.5,B(),m.afterSetFilter);const qn=Jc.Util._assign(Jc,{Arc:Ue,Arrow:Oi,Circle:Qi,Ellipse:oi,Image:re,Label:Ao,Tag:Ai,Line:je,Path:Et,Rect:Xn,RegularPolygon:ai,Ring:Mi,Sprite:Oe,Star:li,Text:xt,TextPath:Vt,Transformer:ct,Wedge:Xe,Filters:{Blur:R1,Brightness:I1,Brighten:L1,Contrast:D1,Emboss:V1,Enhance:F1,Grayscale:G1,HSL:$1,HSV:B1,Invert:H1,Kaleidoscope:j1,Mask:Q1,Noise:Z1,Pixelate:t2,Posterize:e2,RGB:i2,RGBA:n2,Sepia:s2,Solarize:r2,Threshold:o2}});function nr(e){if(!qn.autoDrawEnabled){const t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const bh={key:!0,style:!0,elm:!0,isRootInsert:!0},Do=".vue-konva-event";function vh(e,t,i,n){const s=e.__konvaNode,r={};let o=!1;for(let a in i){if(bh.hasOwnProperty(a))continue;const l=a.slice(0,2)==="on",h=i[a]!==t[a];if(l&&h){let c=a.slice(2).toLowerCase();c.slice(0,7)==="content"&&(c="content"+c.slice(7,1).toUpperCase()+c.slice(8)),s?.off(c+Do,i[a])}!t.hasOwnProperty(a)&&s?.setAttr(a,void 0)}for(let a in t){if(bh.hasOwnProperty(a))continue;let l=a.slice(0,2)==="on";const h=i[a]!==t[a];if(l&&h){let c=a.slice(2).toLowerCase();c.slice(0,7)==="content"&&(c="content"+c.slice(7,1).toUpperCase()+c.slice(8)),t[a]&&(s?.off(c+Do),s?.on(c+Do,t[a]))}!l&&(t[a]!==i[a]||n&&t[a]!==s?.getAttr(a))&&(o=!0,r[a]=t[a])}o&&s&&(s.setAttrs(r),nr(s))}const a2="v";function l2(e){function t(i){return i?.__konvaNode?i:i?.parent?t(i.parent):(console.error("vue-konva error: Can not find parent node"),null)}return t(e.parent)}function wh(e){return e.component?e.component.__konvaNode||wh(e.component.subTree):null}function c2(e){const{el:t,component:i}=e,n=wh(e);if(t?.tagName&&i&&!n){const s=t.tagName.toLowerCase();return console.error(`vue-konva error: You are trying to render "${s}" inside your component tree. Looks like it is not a Konva node. You can render only Konva components inside the Stage.`),null}return n}function h2(e){const t=s=>!!s&&typeof s=="object"&&"component"in s,i=s=>Array.isArray(s),n=s=>t(s)?[s,...n(s.children)]:i(s)?s.flatMap(n):[];return n(e.children)}function Sh(e,t){const i=h2(e),n=[];i.forEach(r=>{const o=c2(r);o&&n.push(o)});let s=!1;n.forEach((r,o)=>{r.getZIndex()!==o&&(r.setZIndex(o),s=!0)}),s&&nr(t)}const d2=qn.default?.Stage||qn.Stage,u2=Te({name:"Stage",props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},inheritAttrs:!1,setup(e,{attrs:t,slots:i,expose:n}){const s=Ms();if(!s)return;const r=gi({}),o=Xt(null),a=new d2({width:e.config.width,height:e.config.height,container:document.createElement("div")});s.__konvaNode=a,c();function l(){return s?.__konvaNode}function h(){return s?.__konvaNode}function c(){if(!s)return;const d=r||{},u={...t,...e.config};vh(s,u,d,e.__useStrictMode),Object.assign(r,u)}return Rr(()=>{o.value&&(o.value.innerHTML="",a.container(o.value)),c()}),Lr(()=>{c(),Sh(s.subTree,a)}),Oa(()=>{a.destroy()}),wi(()=>e.config,c,{deep:!0}),n({getStage:h,getNode:l}),()=>yl("div",{ref:o,style:t?.style},i.default?.())}}),f2=".vue-konva-event",p2={Group:!0,Layer:!0,FastLayer:!0,Label:!0};function g2(e,t){return Te({name:e,props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},setup(i,{attrs:n,slots:s,expose:r}){const o=Ms();if(!o)return;const a=gi({}),l=new t;o.__konvaNode=l,o.vnode.__konvaNode=l,d();function h(){return o?.__konvaNode}function c(){return o?.__konvaNode}function d(){if(!o)return;const f={};for(const v in o?.vnode.props)v.slice(0,2)==="on"&&(f[v]=o.vnode.props[v]);const p=a||{},_={...n,...i.config,...f};vh(o,_,p,i.__useStrictMode),Object.assign(a,_)}Rr(()=>{const f=l2(o)?.__konvaNode;f&&"add"in f&&f.add(l),nr(l)}),Ir(()=>{nr(l),l.destroy(),l.off(f2)}),Lr(()=>{d(),Sh(o.subTree,l)}),wi(()=>i.config,d,{deep:!0}),r({getStage:c,getNode:h});const u=p2.hasOwnProperty(e);return()=>u?yl("template",{},s.default?.()):null}})}const m2={install:(e,t)=>{const i=t?.prefix||a2,n=qn.default||qn,s={Arc:n.Arc,Arrow:n.Arrow,Circle:n.Circle,Ellipse:n.Ellipse,FastLayer:n.FastLayer,Group:n.Group,Image:n.Image,Label:n.Label,Layer:n.Layer,Line:n.Line,Path:n.Path,Rect:n.Rect,RegularPolygon:n.RegularPolygon,Ring:n.Ring,Shape:n.Shape,Sprite:n.Sprite,Star:n.Star,Tag:n.Tag,Text:n.Text,TextPath:n.TextPath,Transformer:n.Transformer,Wedge:n.Wedge,...t?.customNodes};[u2,...Object.entries(s).map(([r,o])=>g2(r,o))].forEach(r=>{e.component(`${i}${r.name}`,r)})}},Eh='@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-yellow-200:oklch(94.5% .129 101.54);--color-gray-100:oklch(96.7% .003 264.542);--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-bold:700;--radius-lg:.5rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ott-accent:#68a691;--color-ott-text-primary:#2f2f2f;--color-ott-text-secondary:#a1a1a1;--color-ott-text-white:#fff;--color-ott-bg-primary:#fff;--color-ott-bg-secondary:#f3f3f3;--color-ott-bg-dark:#d3d3d3;--color-ott-error:#cd3c3c}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.static{position:static}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-10{margin-bottom:calc(var(--spacing)*10)}.block{display:block}.flex{display:flex}.h-75{height:calc(var(--spacing)*75)}.h-full{height:100%}.w-1\\/3{width:33.3333%}.w-50{width:calc(var(--spacing)*50)}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-10{gap:calc(var(--spacing)*10)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-ott-bg-dark{border-color:var(--color-ott-bg-dark)}.border-ott-error\\!{border-color:var(--color-ott-error)!important}.border-b-ott-bg-dark{border-bottom-color:var(--color-ott-bg-dark)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-ott-accent{background-color:var(--color-ott-accent)}.bg-ott-bg-primary{background-color:var(--color-ott-bg-primary)}.bg-white{background-color:var(--color-white)}.bg-yellow-200{background-color:var(--color-yellow-200)}.p-4{padding:calc(var(--spacing)*4)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.text-ott-accent{color:var(--color-ott-accent)}.text-ott-error\\!{color:var(--color-ott-error)!important}.text-white{color:var(--color-white)}}html,body,#app,#__nuxt,:host{background-color:var(--color-ott-bg-secondary);width:100%;height:100%;color:var(--color-ott-text-primary);font-family:Poppins,sans-serif;font-style:normal;font-weight:400}button{cursor:pointer}h2{margin-block:calc(var(--spacing)*4);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}main{width:100%;height:100%;max-height:100vh;display:block;overflow:auto}.ott-button{cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing)*5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-ott-text-primary);height:fit-content;padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-ott-text-primary);display:flex}.ott-button:disabled{cursor:default;border-color:var(--color-ott-bg-dark);color:var(--color-ott-bg-dark)}.ott-button-action{cursor:pointer;align-items:center;gap:calc(var(--spacing)*5);border-radius:var(--radius-lg);border-color:var(--color-ott-accent);background-color:var(--color-ott-accent);width:100%;height:fit-content;padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-ott-text-white);display:flex}.ott-button-action:disabled{cursor:default;background-color:var(--color-ott-text-secondary)}input{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-ott-bg-dark);padding-inline:calc(var(--spacing)*3);padding-block:calc(var(--spacing)*1);border-radius:.25rem}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}',_2=["width","height"],y2=["transform"],b2=["transform","onClick"],v2=["transform"],w2=["width","height"],S2=["x","width","height"],E2=["transform"],x2=["x","y","font-size"],C2=["transform","onClick"],N2=["width","height"],T2=pc(Te({__name:"DeckRendering",props:{deck:{type:Object,required:!0},scale:{type:Number,required:!0},availability:{type:Object},vertical:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const i=e,n=gi(new Map),s=gi(new Map),r=t,o=Ei(()=>i.deck.deckspaces?.flatMap(c=>c instanceof _e?c.passengerSpots?.filter(d=>d instanceof Yi)||[]:[]).map(c=>(c.availability=i.availability&&c.attr_id?An[i.availability[c.attr_id]??"Undefined"]:An.Undefined,c))||[]),a=Ei(()=>i.deck.deckspaces?.flatMap(c=>c instanceof _e?c.deckEntrances??[]:[])??[]),l=Ei(()=>{const{width:c,height:d}=i.deck.getBoundingBox();return{width:c*i.scale+10,height:d*i.scale+10}});function h(c,d){r("select",{element:d,ctrlKey:c.ctrlKey||c.metaKey})}return(c,d)=>(at(),yt("svg",{width:e.vertical?l.value.height:l.value.width,height:e.vertical?l.value.width:l.value.height,class:"vehicle-frame",style:{"user-select":"none"}},[ut("g",{class:we(`${e.vertical?"vehicle-frame--vertical":""}`),transform:`rotate(
31
31
  ${e.vertical?90:0},
32
32
  ${l.value.height/2},
33
33
  ${l.value.height/2}
34
- )`},[ut("rect",al({...e.deck.getShape(e.scale),y:5},{onClick:d[0]||(d[0]=eo(u=>c(u,e.deck),["stop"])),class:"vehicle-deck"}),null,16),(at(!0),vt(Dt,null,Fe(o.value,(u,f)=>(at(),vt("g",{key:`seat-${f}`,transform:`translate(${n.get(u)?.x??u.getShape(e.scale).x},
35
- ${n.get(u)?.y??u.getShape(e.scale).y})`,onClick:eo(p=>c(p,u),["stop"]),class:ye(`seat ${u.getClasses()}`)},[ut("g",{class:"seat__container",transform:`rotate( ${u.Orientation==="forwards"?180:0}, ${u.getShape(e.scale).width/2}, ${u.getShape(e.scale).height/2})`},[ut("rect",{width:u.getShape(e.scale).width,height:u.getShape(e.scale).height,class:ye("seat__base")},null,8,i2),ut("rect",{x:u.getShape(e.scale).width*.9,y:"0",width:u.getShape(e.scale).width*.2,height:u.getShape(e.scale).height,rx:"6",ry:"6",class:ye(["seat__backrest","seat__backrest"]),"pointer-events":"none"},null,8,n2)],8,e2),ut("g",{class:"seat__text-container",transform:`rotate(
34
+ )`},[ut("rect",dl({...e.deck.getShape(e.scale),y:5},{onClick:d[0]||(d[0]=io(u=>h(u,e.deck),["stop"])),class:"vehicle-deck"}),null,16),(at(!0),yt(Dt,null,Fe(o.value,(u,f)=>(at(),yt("g",{key:`seat-${f}`,transform:`translate(${n.get(u)?.x??u.getShape(e.scale).x},
35
+ ${n.get(u)?.y??u.getShape(e.scale).y})`,onClick:io(p=>h(p,u),["stop"]),class:we(`seat ${u.getClasses()}`)},[ut("g",{class:"seat__container",transform:`rotate( ${u.Orientation==="forwards"?180:0}, ${u.getShape(e.scale).width/2}, ${u.getShape(e.scale).height/2})`},[ut("rect",{width:u.getShape(e.scale).width,height:u.getShape(e.scale).height,class:we("seat__base")},null,8,w2),ut("rect",{x:u.getShape(e.scale).width*.9,y:"0",width:u.getShape(e.scale).width*.2,height:u.getShape(e.scale).height,rx:"6",ry:"6",class:we(["seat__backrest","seat__backrest"]),"pointer-events":"none"},null,8,S2)],8,v2),ut("g",{class:"seat__text-container",transform:`rotate(
36
36
  ${e.vertical?-90:0},
37
37
  ${u.getShape(e.scale).width/2},
38
38
  ${u.getShape(e.scale).height/2}
39
- )`},[ut("text",{x:u.getShape(e.scale).width/2,y:u.getShape(e.scale).height/2,"text-anchor":"middle","dominant-baseline":"middle",class:"seat__text","font-size":Math.max(Math.min(u.getShape(e.scale).width,u.getShape(e.scale).height)/3,10),"pointer-events":"none"},Le(u.Label),9,r2)],8,s2)],10,t2))),128)),(at(!0),vt(Dt,null,Fe(a.value,(u,f)=>(at(),vt("g",{key:`entrance-${f}`,transform:`translate(${s.get(u)?.x??u.getShape(e.scale,e.deck.Length,e.deck.Width).x},
40
- ${s.get(u)?.y??u.getShape(e.scale,e.deck.Length,e.deck.Width).y})`,onClick:eo(p=>c(p,u),["stop"])},[ut("rect",{width:u.getShape(e.scale,e.deck.Length,e.deck.Width).width,height:u.getShape(e.scale,e.deck.Length,e.deck.Width).height,class:"door"},null,8,a2)],8,o2))),128))],10,Z1)],8,Q1))}}),[["styles",[".vehicle-frame{background-color:#f0f0f0;border:1px solid #ccc}.vehicle-deck{fill:#fff;stroke:#68a691;rx:5px;stroke-width:2px}.seat .seat__base{fill:#4caf50}.seat-occupied .seat__base{fill:#f44336}.seat-selected .seat__base,.seat-filtered .seat__base{fill:#ff9800}.seat-undefined .seat__base{fill:#9e9e9e}.seat .seat__base{fill:#d9d9d9;stroke:#7c7c7c;stroke-width:1px;cursor:pointer;rx:5px}.seat .seat__backrest{fill:#7c7c7c}.seat__text{stroke:#7c7c7c;pointer-events:none}.door{fill:#dedede;stroke:#dedede;stroke-width:1px;cursor:pointer}"]]]),ph=Pl(bp,{shadowRoot:!0,styles:[fh],configureApp(e){e.use(J1)}}),gh=Pl(l2,{shadowRoot:!0,styles:[fh]});return typeof customElements<"u"&&(customElements.get("deckplan-editor")||customElements.define("deckplan-editor",ph),customElements.get("deck-rendering")||customElements.define("deck-rendering",gh)),{DeckplanEditorElement:ph,DeckRenderingElement:gh,parseNeTEx:rc}}));
39
+ )`},[ut("text",{x:u.getShape(e.scale).width/2,y:u.getShape(e.scale).height/2,"text-anchor":"middle","dominant-baseline":"middle",class:"seat__text","font-size":Math.max(Math.min(u.getShape(e.scale).width,u.getShape(e.scale).height)/3,10),"pointer-events":"none"},Le(u.Label),9,x2)],8,E2)],10,b2))),128)),(at(!0),yt(Dt,null,Fe(a.value,(u,f)=>(at(),yt("g",{key:`entrance-${f}`,transform:`translate(${s.get(u)?.x??u.getShape(e.scale,e.deck.Length,e.deck.Width).x},
40
+ ${s.get(u)?.y??u.getShape(e.scale,e.deck.Length,e.deck.Width).y})`,onClick:io(p=>h(p,u),["stop"])},[ut("rect",{width:u.getShape(e.scale,e.deck.Length,e.deck.Width).width,height:u.getShape(e.scale,e.deck.Length,e.deck.Width).height,class:"door"},null,8,N2)],8,C2))),128))],10,y2)],8,_2))}}),[["styles",[".vehicle-frame{background-color:#f0f0f0;border:1px solid #ccc}.vehicle-deck{fill:#fff;stroke:#68a691;rx:5px;stroke-width:2px}.seat .seat__base{fill:#4caf50}.seat-occupied .seat__base{fill:#f44336}.seat-selected .seat__base,.seat-filtered .seat__base{fill:#ff9800}.seat-undefined .seat__base{fill:#9e9e9e}.seat .seat__base{fill:#d9d9d9;stroke:#7c7c7c;stroke-width:1px;cursor:pointer;rx:5px}.seat .seat__backrest{fill:#7c7c7c}.seat__text{stroke:#7c7c7c;pointer-events:none}.door{fill:#dedede;stroke:#dedede;stroke-width:1px;cursor:pointer}"]]]),xh=Ll(F0,{shadowRoot:!0,styles:[Eh],configureApp(e){e.use(m2)}}),Ch=Ll(T2,{shadowRoot:!0,styles:[Eh]});return typeof customElements<"u"&&(customElements.get("deckplan-editor")||customElements.define("deckplan-editor",xh),customElements.get("deck-rendering")||customElements.define("deck-rendering",Ch)),{DeckplanEditorElement:xh,DeckRenderingElement:Ch,parseNeTEx:gc}}));